Fixed performance problem
This commit is contained in:
parent
c1ce9f1fc9
commit
afd542ee86
4 changed files with 28 additions and 4 deletions
|
|
@ -141,6 +141,26 @@ void loop()
|
||||||
delay(10); // Add a small delay to avoid flooding the serial output
|
delay(10); // Add a small delay to avoid flooding the serial output
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void AUDIO_FUNC(audio_block_callback)(float in[][kBufferSize], float out[][kBufferSize], size_t n_channels, size_t n_frames)
|
||||||
|
{
|
||||||
|
digitalWrite(Pins::LED_TIMING, HIGH);
|
||||||
|
for (size_t i = 0; i < n_frames; ++i) {
|
||||||
|
|
||||||
|
float y = in[0][i];
|
||||||
|
|
||||||
|
// Audio processing
|
||||||
|
if (audio_app) {
|
||||||
|
y = audio_app->ProcessLean();
|
||||||
|
}
|
||||||
|
|
||||||
|
out[0][i] = y;
|
||||||
|
out[1][i] = y;
|
||||||
|
}
|
||||||
|
digitalWrite(Pins::LED_TIMING, LOW);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void setup1()
|
void setup1()
|
||||||
{
|
{
|
||||||
while (!READ_VOLATILE(serial_ready)) {
|
while (!READ_VOLATILE(serial_ready)) {
|
||||||
|
|
@ -162,14 +182,17 @@ void setup1()
|
||||||
// shared_ptr with custom deleter calling only the destructor (control block still allocates)
|
// shared_ptr with custom deleter calling only the destructor (control block still allocates)
|
||||||
auto audio_deleter = [](PAFSynthAudioApp* p) { if (p) p->~PAFSynthAudioApp(); };
|
auto audio_deleter = [](PAFSynthAudioApp* p) { if (p) p->~PAFSynthAudioApp(); };
|
||||||
std::shared_ptr<PAFSynthAudioApp> temp_audio_app(audio_raw, audio_deleter);
|
std::shared_ptr<PAFSynthAudioApp> temp_audio_app(audio_raw, audio_deleter);
|
||||||
|
|
||||||
MEMORY_BARRIER();
|
MEMORY_BARRIER();
|
||||||
audio_app = temp_audio_app;
|
audio_app = temp_audio_app;
|
||||||
MEMORY_BARRIER();
|
MEMORY_BARRIER();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AudioDriver::SetBlockCallback(audio_block_callback);
|
||||||
// Start audio driver
|
// Start audio driver
|
||||||
AudioDriver::Setup();
|
AudioDriver::Setup();
|
||||||
|
AudioDriver::SetBlockCallback(audio_block_callback);
|
||||||
|
|
||||||
|
|
||||||
WRITE_VOLATILE(core_1_ready, true);
|
WRITE_VOLATILE(core_1_ready, true);
|
||||||
while (!READ_VOLATILE(core_0_ready)) {
|
while (!READ_VOLATILE(core_0_ready)) {
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
#include "PAFSynthAudioApp.hpp"
|
#include "PAFSynthAudioApp.hpp"
|
||||||
#include "src/memllib/synth/maximilian.h" // Required for maxiSettings etc.
|
#include "src/memllib/synth/maximilian.h" // Required for maxiSettings etc.
|
||||||
|
|
||||||
#define ARPEGGIATOR
|
|
||||||
|
|
||||||
PAFSynthAudioApp::PAFSynthAudioApp() : AudioAppBase() {}
|
PAFSynthAudioApp::PAFSynthAudioApp() : AudioAppBase() {}
|
||||||
|
|
||||||
bool PAFSynthAudioApp::euclidean(float phase, const size_t n, const size_t k, const size_t offset, const float pulseWidth)
|
bool PAFSynthAudioApp::euclidean(float phase, const size_t n, const size_t k, const size_t offset, const float pulseWidth)
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,9 @@
|
||||||
#include "src/memllib/interface/InterfaceBase.hpp" // Added missing include
|
#include "src/memllib/interface/InterfaceBase.hpp" // Added missing include
|
||||||
|
|
||||||
|
|
||||||
|
#define ARPEGGIATOR
|
||||||
|
|
||||||
|
|
||||||
class PAFSynthAudioApp : public AudioAppBase
|
class PAFSynthAudioApp : public AudioAppBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
Subproject commit a85fab44b44034098cec31285bfd68f4a041b33a
|
Subproject commit 95c1e6abd474c744b17763d432e65fe208a773b3
|
||||||
Loading…
Reference in a new issue