diff options
author | David Robillard <d@drobilla.net> | 2015-02-19 16:54:21 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2015-02-19 18:38:30 -0500 |
commit | 450291adfca22a41fb63f8792fd588cede35b463 (patch) | |
tree | 20fbbb4c53e2534dc16c62d425113025677fb636 /libs/ardour/midi_port.cc | |
parent | 6fb4bd578ef30fc65c06b98c32a3278d9c443696 (diff) |
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.
Diffstat (limited to 'libs/ardour/midi_port.cc')
-rw-r--r-- | libs/ardour/midi_port.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libs/ardour/midi_port.cc b/libs/ardour/midi_port.cc index b12999cc9f..ccd6e9848b 100644 --- a/libs/ardour/midi_port.cc +++ b/libs/ardour/midi_port.cc @@ -117,6 +117,10 @@ MidiPort::get_midi_buffer (pframes_t nframes) if (buf[0] == 0xfe) { /* throw away active sensing */ continue; + } 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 */ } /* check that the event is in the acceptable time range */ |