summaryrefslogtreecommitdiffstats
path: root/src/midi.c
diff options
context:
space:
mode:
authorgramanas <anastasis.gramm2@gmail.com>2023-06-28 22:40:47 +0300
committergramanas <anastasis.gramm2@gmail.com>2023-06-28 22:40:47 +0300
commit89e85142d0958d3e3a87fb155d698fc59eafd4c6 (patch)
tree013c3e878a6fa3b822999e05771e129777e37323 /src/midi.c
parent60c82a72fedd719f69c1f1de896aca00784a2881 (diff)
downloadsynth-project-89e85142d0958d3e3a87fb155d698fc59eafd4c6.tar.gz
synth-project-89e85142d0958d3e3a87fb155d698fc59eafd4c6.tar.bz2
synth-project-89e85142d0958d3e3a87fb155d698fc59eafd4c6.zip
Remove old note stuff
Diffstat (limited to 'src/midi.c')
-rw-r--r--src/midi.c17
1 files changed, 0 insertions, 17 deletions
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");