mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-30 02:17:49 +01:00
Fix record/import of note ons with velocity 0.
Best to just do this as early as possible to avoid having to deal with this situation all over the code. Also fixes violation of LV2 MIDI specification, which requires no such events are delivered to plugins.
This commit is contained in:
parent
6fb4bd578e
commit
450291adfc
2 changed files with 9 additions and 0 deletions
|
|
@ -287,6 +287,11 @@ SMF::read_event(uint32_t* delta_t, uint32_t* size, uint8_t** buf, event_id_t* no
|
|||
}
|
||||
memcpy(*buf, event->midi_buffer, size_t(event_size));
|
||||
*size = event_size;
|
||||
if ((*buf)[0] == 0x90 && (*buf)[2] == 0) {
|
||||
/* normalize note on with velocity 0 to proper note off */
|
||||
(*buf)[0] = 0x80; /* note off */
|
||||
(*buf)[2] = 0x40; /* default velocity */
|
||||
}
|
||||
|
||||
if (!midi_event_is_valid(*buf, *size)) {
|
||||
cerr << "WARNING: SMF ignoring illegal MIDI event" << endl;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue