summaryrefslogtreecommitdiff
path: root/libs/evoral/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2015-02-19 20:23:11 -0500
committerDavid Robillard <d@drobilla.net>2015-02-19 20:23:11 -0500
commitb68a4e5cdc59ffb81c1952ac9cad63ddf0c76d06 (patch)
treeaf8d97525461c83580bfe4096850d7342ba463cf /libs/evoral/src
parent450291adfca22a41fb63f8792fd588cede35b463 (diff)
Normalize notes on all channels.
Probably.
Diffstat (limited to 'libs/evoral/src')
-rw-r--r--libs/evoral/src/SMF.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/evoral/src/SMF.cpp b/libs/evoral/src/SMF.cpp
index edf33c23f2..0a5bf589f5 100644
--- a/libs/evoral/src/SMF.cpp
+++ b/libs/evoral/src/SMF.cpp
@@ -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 */
}