diff --git a/midi2osc/midi2osc.c b/midi2osc/midi2osc.c index ffc82de..6b0f5e2 100644 --- a/midi2osc/midi2osc.c +++ b/midi2osc/midi2osc.c @@ -100,7 +100,12 @@ static void forward(snd_seq_t *midi, lo_address osc) while (snd_seq_event_input(midi, &ev)) { switch (ev->type) { case SND_SEQ_EVENT_NOTEON: - msg[1] = 0x90 | ev->data.control.channel; + if (debug) + fprintf(stderr, "note c%u.%u=%u\n", + ev->data.note.channel, + ev->data.note.note, + ev->data.note.velocity); + msg[1] = 0x90 | ev->data.note.channel; msg[2] = ev->data.note.note; msg[3] = ev->data.note.velocity; break; @@ -110,7 +115,8 @@ static void forward(snd_seq_t *midi, lo_address osc) value = ev->data.control.value; map(&chan, &ctrl, &value); if (debug) - fprintf(stderr, "c%u.%u=%u -> c%u.%u=%u\n", + fprintf(stderr, + "control c%u.%u=%u -> c%u.%u=%u\n", ev->data.control.channel, ev->data.control.param, ev->data.control.value, @@ -120,9 +126,13 @@ static void forward(snd_seq_t *midi, lo_address osc) msg[3] = value; break; case SND_SEQ_EVENT_PITCHBEND: + if (debug) + fprintf(stderr, "pitch c%u=%u\n", + ev->data.control.channel, + ev->data.control.value); msg[1] = 0xe0 | ev->data.control.channel; - msg[2] = ev->data.control.value; - msg[3] = 0; + msg[2] = ev->data.control.value & 0x7f; + msg[3] = ev->data.control.value >> 7; break; default: /* Flickernoise currently doesn't support any others */