diff options
Diffstat (limited to 'src/midi.c')
-rw-r--r-- | src/midi.c | 17 |
1 files changed, 0 insertions, 17 deletions
@@ -15,25 +15,10 @@ void midi_decode(uint32_t msg, synth_t * synth) { switch (message) { case 0x08: // printf("Note Off: channel=%d, note=%d, velocity=%d\n", channel, data1, data2); - if (synth->n.key == data1) { - synth->n.noteOff = Pa_GetStreamTime(synth->stream); - } - synth->midi_note[data1].noteOff = Pa_GetStreamTime(synth->stream); - break; case 0x09: // printf("Note On: channel=%d, note=%d, velocity=%d\n", channel, data1, data2); - synth->n.key = data1; - synth->n.freq = notes[data1 % 12][(data1 / 12) % 8]; - synth->n.noteOn = Pa_GetStreamTime(synth->stream); - synth->n.noteOff = 0; - synth->n.elapsed = 0; - synth->adsr.elapsed = 0; - synth->active = 1; - //synth->gain = data2 / 127.0; - - //synth->midi_note[i].n = -1; synth->midi_note[data1].freq = notes[data1 % 12][(data1 / 12) % 8]; synth->midi_note[data1].channel = channel; @@ -42,7 +27,6 @@ void midi_decode(uint32_t msg, synth_t * synth) { synth->midi_note[data1].velocity = (float)data2 / 127.0; synth->midi_note[data1].elapsed = 0; synth->midi_note[data1].active = 1; - break; case 0x0A: printf("Aftertouch: channel=%d, note=%d, pressure=%d\n", channel, data1, data2); @@ -98,7 +82,6 @@ void midi_decode(uint32_t msg, synth_t * synth) { break; case 0x0E: printf("Pitch Bend: channel=%d, value=%d\n", channel, ((data2 << 7) | data1) - 8192); - synth->n.freq = (((data2 << 7) | data1) - 8192); break; default: printf("Unknown MIDI message\n"); |