diff options
author | deva <deva> | 2011-03-01 19:19:02 +0000 |
---|---|---|
committer | deva <deva> | 2011-03-01 19:19:02 +0000 |
commit | e190d38057892b69246391841b234a368bc2b4ad (patch) | |
tree | 34f946bc1c3b86997d4cd45e63c433ef07b36486 /src/midimapper.cc | |
parent | c393edc920f8ee126d1bced3500b6bc1ecf86f83 (diff) |
MAJOR rewrite of the internals. New input/output 'plugin' system. Still a lot missing.
Diffstat (limited to 'src/midimapper.cc')
-rw-r--r-- | src/midimapper.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/midimapper.cc b/src/midimapper.cc index 6bf38c7..243c22e 100644 --- a/src/midimapper.cc +++ b/src/midimapper.cc @@ -26,6 +26,8 @@ */ #include "midimapper.h" +#include <stdio.h> + #define NOTE_ON 0x9 MidiMapper::MidiMapper(DrumKit *drumkit) @@ -63,11 +65,11 @@ MidiMapper::MidiMapper(DrumKit *drumkit) Sample *MidiMapper::map(jack_midi_event_t event) { Sample *sample = NULL; - +#if 0 // printf("m"); fflush(stdout); if(event.size != 3) return NULL; - if(event.buffer[0] & NOTE_ON != NOTE_ON) return NULL; + if((event.buffer[0] & NOTE_ON) != NOTE_ON) return NULL; int key = event.buffer[1]; int velocity = event.buffer[2]; @@ -82,15 +84,16 @@ Sample *MidiMapper::map(jack_midi_event_t event) } printf("]\n"); */ + if(drumkit->instruments.find(key) == drumkit->instruments.end()) { printf("Unknown instrument %d\n", key); return NULL; } - + Velocity *v = drumkit->instruments[key]->getVelocity(velocity); if(!v) return NULL; sample = v->getSample(); - +#endif return sample; } |