diff options
author | deva <deva> | 2009-11-22 09:56:08 +0000 |
---|---|---|
committer | deva <deva> | 2009-11-22 09:56:08 +0000 |
commit | 366701768b4e7e31e3d96071700783a49bcbd078 (patch) | |
tree | aa8a1c9493c8f46d36ee1f3239d9b59361692139 /src/midimapper.cc | |
parent | 28630efa5e905f501f267e5e105d184ec5dd379a (diff) |
Added editor for automated chopping up of audiofiles into samples.
Diffstat (limited to 'src/midimapper.cc')
-rw-r--r-- | src/midimapper.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/midimapper.cc b/src/midimapper.cc index 1d2c7a8..6bf38c7 100644 --- a/src/midimapper.cc +++ b/src/midimapper.cc @@ -26,7 +26,7 @@ */ #include "midimapper.h" -#define NOTE_ON 0x90 +#define NOTE_ON 0x9 MidiMapper::MidiMapper(DrumKit *drumkit) { @@ -64,8 +64,10 @@ Sample *MidiMapper::map(jack_midi_event_t event) { Sample *sample = NULL; + // printf("m"); fflush(stdout); + if(event.size != 3) return NULL; - if(event.buffer[0] != NOTE_ON) return NULL; + if(event.buffer[0] & NOTE_ON != NOTE_ON) return NULL; int key = event.buffer[1]; int velocity = event.buffer[2]; @@ -81,7 +83,7 @@ Sample *MidiMapper::map(jack_midi_event_t event) printf("]\n"); */ if(drumkit->instruments.find(key) == drumkit->instruments.end()) { - printf("Unknown intrsument %d\n", key); + printf("Unknown instrument %d\n", key); return NULL; } |