bool Poly::noteOff(bool pedalHeld) { // Generally, non-sustaining instruments ignore note off. They die away eventually anyway. // Key 0 (only used by special cases on rhythm part) reacts to note off even if non-sustaining or pedal held. if (state == POLY_Inactive || state == POLY_Releasing) { return false; } if (pedalHeld) { state = POLY_Held; } else { startDecay(); } return true; }
bool Poly::stopPedalHold() { if (state != POLY_Held) { return false; } return startDecay(); }