From 5e1419ffe4b32ccecf6cef8da3c55efb09c706fe Mon Sep 17 00:00:00 2001 From: Paul Ferrand Date: Fri, 13 Dec 2019 10:16:07 +0100 Subject: [PATCH] Dispatch the pitch bends to the midi state for memory --- src/sfizz/MidiState.h | 9 +++++++++ src/sfizz/Synth.cpp | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/sfizz/MidiState.h b/src/sfizz/MidiState.h index 6035940d..e158da91 100644 --- a/src/sfizz/MidiState.h +++ b/src/sfizz/MidiState.h @@ -58,6 +58,11 @@ struct MidiState return 0; } + inline void pitchBendEvent(int pitchBendValue) + { + pitchBend = pitchBendValue; + } + /** * @brief Stores the note on times. * @@ -74,5 +79,9 @@ struct MidiState * */ CCValueArray cc; + /** + * Pitch bend status + */ + int pitchBend { 0 }; }; } diff --git a/src/sfizz/Synth.cpp b/src/sfizz/Synth.cpp index b4a8f003..e0e4a67d 100644 --- a/src/sfizz/Synth.cpp +++ b/src/sfizz/Synth.cpp @@ -459,7 +459,7 @@ void sfz::Synth::pitchWheel(int delay, int channel, int pitch) noexcept ASSERT(pitch <= 8192); ASSERT(pitch >= 8192); channel = translateMidiChannelToSfz(channel); - + midiState.pitchBendEvent(pitch); for (auto& voice: voices) { voice->registerPitchWheel(delay, channel, pitch); }