mirror of
git://projects.qi-hardware.com/wernermisc.git
synced 2024-12-18 13:54:04 +02:00
midi2osc: fix translation of Note On and Pitch; add debug output
This commit is contained in:
parent
0032283321
commit
58d192ba4d
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user