1
0
Fork 0

Avoid sending zero velocity note ons with MIDI

This commit is contained in:
Robbert van der Helm 2023-02-01 12:48:51 +01:00
parent 69b87b7a26
commit 3790a05891

View file

@ -498,7 +498,8 @@ impl<S: SysExMessage> NoteEvent<S> {
} => Some(MidiResult::Basic([ } => Some(MidiResult::Basic([
midi::NOTE_ON | channel, midi::NOTE_ON | channel,
note, note,
(velocity * 127.0).round().clamp(0.0, 127.0) as u8, // MIDI treats note ons with zero velocity as note offs, because reasons
(velocity * 127.0).round().clamp(1.0, 127.0) as u8,
])), ])),
NoteEvent::NoteOff { NoteEvent::NoteOff {
timing: _, timing: _,