From 89e85142d0958d3e3a87fb155d698fc59eafd4c6 Mon Sep 17 00:00:00 2001 From: gramanas Date: Wed, 28 Jun 2023 22:40:47 +0300 Subject: Remove old note stuff --- src/midi.c | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'src/midi.c') diff --git a/src/midi.c b/src/midi.c index d3e2adb..d9955d2 100644 --- a/src/midi.c +++ b/src/midi.c @@ -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"); -- cgit v1.2.3