Date:2012-02-14 00:43:44 (7 years 4 months ago)
Author:Werner Almesberger
Commit:58d192ba4d8d3f51ec1a31600c3388239e9bf124
Message:midi2osc: fix translation of Note On and Pitch; add debug output

Files: midi2osc/midi2osc.c (3 diffs)

Change Details

midi2osc/midi2osc.c
100100    while (snd_seq_event_input(midi, &ev)) {
101101        switch (ev->type) {
102102        case SND_SEQ_EVENT_NOTEON:
103            msg[1] = 0x90 | ev->data.control.channel;
103            if (debug)
104                fprintf(stderr, "note c%u.%u=%u\n",
105                    ev->data.note.channel,
106                    ev->data.note.note,
107                    ev->data.note.velocity);
108            msg[1] = 0x90 | ev->data.note.channel;
104109            msg[2] = ev->data.note.note;
105110            msg[3] = ev->data.note.velocity;
106111            break;
...... 
110115            value = ev->data.control.value;
111116            map(&chan, &ctrl, &value);
112117            if (debug)
113                fprintf(stderr, "c%u.%u=%u -> c%u.%u=%u\n",
118                fprintf(stderr,
119                    "control c%u.%u=%u -> c%u.%u=%u\n",
114120                    ev->data.control.channel,
115121                    ev->data.control.param,
116122                    ev->data.control.value,
...... 
120126            msg[3] = value;
121127            break;
122128        case SND_SEQ_EVENT_PITCHBEND:
129            if (debug)
130                fprintf(stderr, "pitch c%u=%u\n",
131                    ev->data.control.channel,
132                    ev->data.control.value);
123133            msg[1] = 0xe0 | ev->data.control.channel;
124            msg[2] = ev->data.control.value;
125            msg[3] = 0;
134            msg[2] = ev->data.control.value & 0x7f;
135            msg[3] = ev->data.control.value >> 7;
126136            break;
127137        default:
128138            /* Flickernoise currently doesn't support any others */

Archive Download the corresponding diff file

Branches:
master



interactive