Skip to content

Commit

Permalink
improve sample accurate processing
Browse files Browse the repository at this point in the history
  • Loading branch information
dingodoppelt committed Jan 24, 2024
1 parent ced16d6 commit 4eadd21
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ewisynth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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;
Expand Down

0 comments on commit 4eadd21

Please sign in to comment.