Avoid sending zero velocity note ons with MIDI
This commit is contained in:
parent
69b87b7a26
commit
3790a05891
1 changed files with 2 additions and 1 deletions
|
@ -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: _,
|
||||||
|
|
Loading…
Add table
Reference in a new issue