mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-15 19:16:40 +01:00
Normalize notes on all channels.
Probably.
This commit is contained in:
parent
450291adfc
commit
b68a4e5cdc
2 changed files with 4 additions and 4 deletions
|
|
@ -117,9 +117,9 @@ MidiPort::get_midi_buffer (pframes_t nframes)
|
|||
if (buf[0] == 0xfe) {
|
||||
/* throw away active sensing */
|
||||
continue;
|
||||
} if (buf[0] == 0x90 && buf[2] == 0) {
|
||||
} else if ((buf[0] & 0xF0) == 0x90 && buf[2] == 0) {
|
||||
/* normalize note on with velocity 0 to proper note off */
|
||||
buf[0] = 0x80; /* note off */
|
||||
buf[0] = 0x80 | (buf[0] & 0x0F); /* note off */
|
||||
buf[2] = 0x40; /* default velocity */
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -287,9 +287,9 @@ 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) {
|
||||
if (((*buf)[0] & 0xF0) == 0x90 && (*buf)[2] == 0) {
|
||||
/* normalize note on with velocity 0 to proper note off */
|
||||
(*buf)[0] = 0x80; /* note off */
|
||||
(*buf)[0] = 0x80 | ((*buf)[0] & 0x0F); /* note off */
|
||||
(*buf)[2] = 0x40; /* default velocity */
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue