From 4eadd217f3c063a44921b70e2566c3e5e4a103b5 Mon Sep 17 00:00:00 2001 From: Nils Brederlow <62596379+dingodoppelt@users.noreply.github.com> Date: Wed, 24 Jan 2024 14:14:17 +0100 Subject: [PATCH] improve sample accurate processing --- ewisynth.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ewisynth.cpp b/ewisynth.cpp index e43e04c..4340327 100644 --- a/ewisynth.cpp +++ b/ewisynth.cpp @@ -156,18 +156,22 @@ void EwiSynth::run(const uint32_t sample_count) { switch (typ) { case LV2_MIDI_MSG_NOTE_ON: handleNoteOn(msg[1]); + updateOscillators(); break; case LV2_MIDI_MSG_CHANNEL_PRESSURE: handlePressure(msg[1]); + updateOscillators(); break; case LV2_MIDI_MSG_CONTROLLER: handleController(msg[1], msg[2]); + updateOscillators(); break; case LV2_MIDI_MSG_BENDER: handlePitchbend((msg[2] << 7) | msg[1]); + updateOscillators(); break; default: @@ -176,7 +180,6 @@ void EwiSynth::run(const uint32_t sample_count) { } offset = (uint32_t)ev->time.frames; } - updateOscillators(); for (int i = offset; i < sample_count; i++) { const StereoPair outputs = sumOscillators(); l_audio_out_ptr[i] = outputs.sqr_l;