Skip to content

Commit

Permalink
When stopping playback, turn off the hold pedal.
Browse files Browse the repository at this point in the history
This ensures that the pedal doesn't remain active when resuming playback, and also stops playback immediately instead of letting notes ring out if a "let ring" was active.

Fixes: #337
  • Loading branch information
cameronwhite committed Sep 11, 2021
1 parent bbbcc53 commit 973f992
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Thanks to the following contributors who worked on this release:
### Changed

### Fixed
- Fixed an issue where stopping MIDI playback while a "let ring" was active could incorrectly keep the "let ring" active when restarting playback from the beginning (#337).

## [Alpha 15] - 2021-07-24

Expand Down
3 changes: 3 additions & 0 deletions source/audio/midioutputdevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ MidiOutputDevice::stopAllNotes()
for (uint8_t channel = 0; channel < Midi::NUM_MIDI_CHANNELS_PER_PORT;
++channel)
{
// Turn off the pedal in case a "let ring" event was active.
sendMidiMessage(ControlChange + channel, HoldPedal, 0);
// Stop all notes.
sendMidiMessage(ControlChange + channel, AllNotesOff, 0);
}
}
Expand Down

0 comments on commit 973f992

Please sign in to comment.