summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-03-12 22:50:13 +0000
committerDavid Robillard <d@drobilla.net>2007-03-12 22:50:13 +0000
commitc39b2c29f12c604ed2fd36484a19d176603c589c (patch)
tree7f722cc4733e309bb251fa03ded0f913af2fdf7d
parent48df4a4510195c5036ff02e6c1a6b83488530e2f (diff)
downloadraul-c39b2c29f12c604ed2fd36484a19d176603c589c.tar.gz
raul-c39b2c29f12c604ed2fd36484a19d176603c589c.tar.bz2
raul-c39b2c29f12c604ed2fd36484a19d176603c589c.zip
Fixed MIDI note off normalization for multiple channels.
git-svn-id: http://svn.drobilla.net/lad/raul@359 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r--src/SMFReader.cpp4
-rw-r--r--tests/smf_test.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/SMFReader.cpp b/src/SMFReader.cpp
index 4c03229..56232cf 100644
--- a/src/SMFReader.cpp
+++ b/src/SMFReader.cpp
@@ -260,8 +260,8 @@ SMFReader::read_event(size_t buf_len, unsigned char* buf, uint32_t* ev_size, uin
// Read event, return size
fread(buf+1, 1, *ev_size - 1, _fd);
- if (buf[0] == 0x90 && buf[2] == 0) {
- buf[0] = 0x80;
+ if ((buf[0] & 0xF0) == 0x90 && buf[2] == 0) {
+ buf[0] = (0x80 | (buf[0] & 0x0F));
buf[2] = 0x40;
}
diff --git a/tests/smf_test.cpp b/tests/smf_test.cpp
index d4e5411..3396b90 100644
--- a/tests/smf_test.cpp
+++ b/tests/smf_test.cpp
@@ -47,8 +47,8 @@ main(int argc, char** argv)
uint32_t ev_delta_time;
while (reader.read_event(4, buf, &ev_size, &ev_delta_time) >= 0) {
- cout << "\n\nEvent, size = " << ev_size << ", time = " << ev_delta_time;
- cout << ", data = ";
+ cout << "Event, size = " << ev_size << ", time = " << ev_delta_time;
+ cout << ":\t";
cout.flags(ios::hex);
for (uint32_t i=0; i < ev_size; ++i) {
cout << "0x" << (int)buf[i] << " ";