From 965ab85f6f819132c5fe6b4a2d77679b6b863725 Mon Sep 17 00:00:00 2001 From: Paul Ferrand Date: Sun, 15 Dec 2019 02:12:19 +0100 Subject: [PATCH] Corrected the assert in pitchBendEvent --- src/sfizz/MidiState.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/sfizz/MidiState.h b/src/sfizz/MidiState.h index 498e4feb..07c4d8cd 100644 --- a/src/sfizz/MidiState.h +++ b/src/sfizz/MidiState.h @@ -15,6 +15,10 @@ namespace sfz class MidiState { public: + MidiState() noexcept + { + reset(); + } /** * @brief Update the state after a note on event * @@ -22,7 +26,7 @@ public: * @param noteNumber * @param velocity */ - void noteOnEvent(int channel, int noteNumber, uint8_t velocity) + void noteOnEvent(int channel, int noteNumber, uint8_t velocity) noexcept { ASSERT(channel >= 1 && channel <= 16); ASSERT(noteNumber >= 0 && noteNumber <= 127); @@ -62,7 +66,7 @@ public: * @param noteNumber * @return uint8_t */ - uint8_t getNoteVelocity(int channel, int noteNumber) const + uint8_t getNoteVelocity(int channel, int noteNumber) const noexcept { ASSERT(channel >= 1 && channel <= 16); ASSERT(noteNumber >= 0 && noteNumber <= 127); @@ -73,7 +77,7 @@ public: void pitchBendEvent(int channel, int pitchBendValue) noexcept { ASSERT(channel >= 1 && channel <= 16); - ASSERT(pitchBendValue >= 8192 && pitchBendValue <= 8192); + ASSERT(pitchBendValue >= -8192 && pitchBendValue <= 8192); channel = translateSfzChannelToMidi(channel); pitchBends[channel] = pitchBendValue; }