Index: src/midi.c =================================================================== RCS file: /cvsroot/jack-rack/jack-rack/src/midi.c,v retrieving revision 1.11 diff -u -r1.11 midi.c --- src/midi.c 18 Nov 2007 13:20:00 -0000 1.11 +++ src/midi.c 18 Jul 2009 16:47:20 -0000 @@ -179,6 +179,7 @@ static void midi_control (midi_info_t *minfo, snd_seq_ev_ctrl_t *event, + snd_seq_ev_note_t *note, snd_seq_event_type_t type) { GSList *list; @@ -202,6 +203,11 @@ event->param == param && event->channel+1 == channel ) /* control change */ || + (type == SND_SEQ_EVENT_NOTEON && + note->velocity > 0 && /* ignore second note signal */ + note->note == param && + event->channel+1 == channel ) /* keyboard note press */ + || ( type == SND_SEQ_EVENT_PGMCHANGE && event->value == param ) ) /* prog change stores our 'param' in 'value'. ignore channel. */ @@ -246,7 +252,7 @@ plugin = midi_ctrl->plugin_slot->plugin; /* For control change, off = 0, on = value_max. - For prog change, just flip the state */ + For prog change or note-on, just flip the state */ if(type == SND_SEQ_EVENT_CONTROLLER || type == SND_SEQ_EVENT_CONTROL14) { if(event->value == 0) @@ -256,7 +262,7 @@ else return; } - else if(type == SND_SEQ_EVENT_PGMCHANGE) + else if(type == SND_SEQ_EVENT_NOTEON || type == SND_SEQ_EVENT_PGMCHANGE) { gboolean wasEnabled = plugin->enabled; plugin->enabled = !wasEnabled; @@ -284,12 +290,14 @@ do { snd_seq_event_input (minfo->seq, &event); + switch (event->type) { + case SND_SEQ_EVENT_NOTEON: case SND_SEQ_EVENT_CONTROLLER: case SND_SEQ_EVENT_CONTROL14: - case SND_SEQ_EVENT_PGMCHANGE: - midi_control (minfo, &event->data.control, event->type); + case SND_SEQ_EVENT_PGMCHANGE: + midi_control (minfo, &event->data.control, &event->data.note, event->type); break; default: break; Index: src/midi_window.c =================================================================== RCS file: /cvsroot/jack-rack/jack-rack/src/midi_window.c,v retrieving revision 1.7 diff -u -r1.7 midi_window.c --- src/midi_window.c 28 Jun 2007 18:57:46 -0000 1.7 +++ src/midi_window.c 18 Jul 2009 16:47:21 -0000 @@ -265,7 +265,7 @@ MIDI_CONTROL_POINTER, midi_ctrl, -1); - gtk_widget_show (mwin->window); + /* gtk_widget_show (mwin->window); */ }