summaryrefslogtreecommitdiffstats
path: root/src/midi.c
diff options
context:
space:
mode:
authorgramanas <anastasis.gramm2@gmail.com>2023-06-28 22:41:03 +0300
committergramanas <anastasis.gramm2@gmail.com>2023-06-28 22:41:03 +0300
commitf170fb058a07175e6e753f2a6d20283dc7200a88 (patch)
treee43c20efa7efe12fbe1828777474669f9ac01135 /src/midi.c
parent89e85142d0958d3e3a87fb155d698fc59eafd4c6 (diff)
downloadsynth-project-f170fb058a07175e6e753f2a6d20283dc7200a88.tar.gz
synth-project-f170fb058a07175e6e753f2a6d20283dc7200a88.tar.bz2
synth-project-f170fb058a07175e6e753f2a6d20283dc7200a88.zip
Add wavetable synthesis
Diffstat (limited to 'src/midi.c')
-rw-r--r--src/midi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/midi.c b/src/midi.c
index d9955d2..8452bcc 100644
--- a/src/midi.c
+++ b/src/midi.c
@@ -27,6 +27,7 @@ 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;
+ synth->active = 1;
break;
case 0x0A:
printf("Aftertouch: channel=%d, note=%d, pressure=%d\n", channel, data1, data2);
@@ -144,7 +145,7 @@ init_midi(midi_t *m, synth_t *synth)
void
terminate_midi(midi_t *m)
{
- Pm_Close(m->stream);
Pt_Stop();
+ Pm_Close(m->stream);
Pm_Terminate();
}