From e150c644f100042f28b829b3c94757516def0610 Mon Sep 17 00:00:00 2001 From: Paul Ferrand Date: Mon, 9 Dec 2019 23:41:06 +0100 Subject: [PATCH] Dispatch bend messages to the voices --- src/sfizz/Synth.cpp | 8 +++++++- src/sfizz/Synth.h | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/sfizz/Synth.cpp b/src/sfizz/Synth.cpp index cc00b295..b4a8f003 100644 --- a/src/sfizz/Synth.cpp +++ b/src/sfizz/Synth.cpp @@ -454,9 +454,15 @@ void sfz::Synth::cc(int delay, int channel, int ccNumber, uint8_t ccValue) noexc } } -void sfz::Synth::pitchWheel(int /* delay */, int channel, int /* pitch */) noexcept +void sfz::Synth::pitchWheel(int delay, int channel, int pitch) noexcept { + ASSERT(pitch <= 8192); + ASSERT(pitch >= 8192); channel = translateMidiChannelToSfz(channel); + + for (auto& voice: voices) { + voice->registerPitchWheel(delay, channel, pitch); + } } void sfz::Synth::aftertouch(int /* delay */, int channel, uint8_t /* aftertouch */) noexcept { diff --git a/src/sfizz/Synth.h b/src/sfizz/Synth.h index 41cd4600..81ca9f53 100644 --- a/src/sfizz/Synth.h +++ b/src/sfizz/Synth.h @@ -223,7 +223,7 @@ public: * than the size of the block in the next call to * renderBlock(). * @param channel the midi channel for the event (0-based) - * @param pitch the pitch value + * @param pitch the pitch value centered between -8192 and 8192 */ void pitchWheel(int delay, int channel, int pitch) noexcept; /**