Dispatch the pitch bends to the midi state for memory

This commit is contained in:
Paul Ferrand 2019-12-13 10:16:07 +01:00
parent 32d53a1b0a
commit 5e1419ffe4
2 changed files with 10 additions and 1 deletions

View file

@ -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 };
};
}

View file

@ -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);
}