Permalink
Browse files

Fixed bug with MIDI control in certain mode.

  • Loading branch information...
1 parent eb4a8b3 commit 0287759df1053c4b73a72fd50b9ecc39bbcc83ab Jeremy Salwen committed Jan 4, 2011
Showing with 6 additions and 6 deletions.
  1. +2 −2 so-404.c
  2. +2 −2 so-666.c
  3. +2 −2 so-kl5.c
View
@@ -29,7 +29,7 @@ void runSO_404( LV2_Handle arg, uint32_t nframes ) {
} else if(event->type==so->midi_event_id) {
if(event->frames > i) {
break;
- } else if(*so->controlmode_p<=0) {
+ } else {
const uint8_t* evt=(uint8_t*)data;
if((evt[0]&MIDI_CHANNELMASK)==(int) (*so->channel_p)) {
if((evt[0]&MIDI_COMMANDMASK)==MIDI_NOTEON) {
@@ -46,7 +46,7 @@ void runSO_404( LV2_Handle arg, uint32_t nframes ) {
else if((evt[0]&MIDI_COMMANDMASK)==MIDI_NOTEOFF ) {
so->noteson -= 1;
}
- else if((evt[0]&MIDI_COMMANDMASK)==MIDI_CONTROL ) {
+ else if((*so->controlmode_p<=0) && (evt[0]&MIDI_COMMANDMASK)==MIDI_CONTROL ) {
unsigned int command_val=evt[2];
switch(evt[1]) {
case 74:
View
@@ -42,7 +42,7 @@ void runSO_666( LV2_Handle arg, uint32_t nframes ) {
} else if(event->type==so->midi_event_id) {
if(event->frames > i) {
break;
- } else if(*so->controlmode_p<=0) {
+ } else {
const uint8_t* evt=(uint8_t*)data;
if((evt[0]&MIDI_CHANNELMASK)==(int) (*so->channel_p)) {
if((evt[0]&MIDI_COMMANDMASK)==MIDI_NOTEON) {
@@ -59,7 +59,7 @@ void runSO_666( LV2_Handle arg, uint32_t nframes ) {
status[note] = 0;
}
}
- else if((evt[0]&MIDI_COMMANDMASK)==MIDI_CONTROL ) {
+ else if((*so->controlmode_p<=0) && (evt[0]&MIDI_COMMANDMASK)==MIDI_CONTROL) {
if( evt[1] == 74 ) {
unsigned int cutoff =evt[2];
so->fcutoff = cutoff_scale((cutoff+50.0)/200.0);
View
@@ -35,7 +35,7 @@ void runSO_kl5( LV2_Handle arg, uint32_t nframes ) {
} else if(event->type==so->midi_event_id) {
if(event->frames > i) {
break;
- } else if(*so->controlmode_p<=0) {
+ } else {
const uint8_t* evt=(uint8_t*)data;
if((evt[0]&MIDI_CHANNELMASK)==(int) (*so->channel_p)) {
if((evt[0]&MIDI_COMMANDMASK)==MIDI_NOTEON) {
@@ -111,7 +111,7 @@ void runSO_kl5( LV2_Handle arg, uint32_t nframes ) {
status[note] = 0;
}
}
- else if((evt[0]&MIDI_COMMANDMASK)==MIDI_CONTROL ) {
+ else if((*so->controlmode_p<=0) && (evt[0]&MIDI_COMMANDMASK)==MIDI_CONTROL ) {
if( evt[1] == 74 ) {
unsigned int cutoff =evt[2];
so->fcutoff = (cutoff+5.0)/400.0;

0 comments on commit 0287759

Please sign in to comment.