summaryrefslogtreecommitdiffstats
path: root/src/midi.c
diff options
context:
space:
mode:
authorgramanas <anastasis.gramm2@gmail.com>2023-11-21 14:07:33 +0200
committergramanas <anastasis.gramm2@gmail.com>2023-11-21 14:07:33 +0200
commitc03d395f6848fe9b2d1185173a9cf5ec8277394f (patch)
tree2dad9fe79a189096b713559e35cf49497fea817a /src/midi.c
parenta7c39399e3ec051f210d9e991fe0112d0f988817 (diff)
downloadsynth-project-c03d395f6848fe9b2d1185173a9cf5ec8277394f.tar.gz
synth-project-c03d395f6848fe9b2d1185173a9cf5ec8277394f.tar.bz2
synth-project-c03d395f6848fe9b2d1185173a9cf5ec8277394f.zip
Crappy fft for spectrum analysis and initial gtk test
Diffstat (limited to 'src/midi.c')
-rw-r--r--src/midi.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/midi.c b/src/midi.c
index c01b803..e711ecb 100644
--- a/src/midi.c
+++ b/src/midi.c
@@ -14,12 +14,12 @@ 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);
+ printf("Note Off: channel=%d, note=%d, velocity=%d\n", channel, data1, data2);
synth->midi_note[data1].noteOff = Pa_GetStreamTime(synth->stream);
synth->midi_note[data1].noteOffSample = synth->midi_note[data1].elapsed;
break;
case 0x09:
- // printf("Note On: channel=%d, note=%d, velocity=%d\n", channel, data1, data2);
+ printf("Note On: channel=%d, note=%d, velocity=%d\n", channel, data1, data2);
//synth->midi_note[i].n = -1;
synth->midi_note[data1].freq = notes[data1 % 12][(data1 / 12) % 8];
synth->midi_note[data1].channel = channel;
@@ -127,9 +127,10 @@ init_midi(midi_t *m, synth_t *synth)
info = Pm_GetDeviceInfo(i);
printf("%d: %s [input: %d output: %d opened: %d is_virt:%d] (interf: %s) -- %d\n", i, info->name, info->input, info->output, info->opened, info->is_virtual, info->interf, Pm_GetDefaultInputDeviceID());
//if (!strcmp("MPK225 MIDI", info->name) && !info->input) break;
- //if (!strcmp("MPK225 Port A", info->name) && info->input == 1) break;
+ if (!strcmp("MPK225 Port A", info->name) && info->input == 1) break;
//if (!strcmp("CH345 MIDI 1", info->name) && info->input == 1) break;
- if (!strcmp("Midi Through Port-0", info->name) && info->input == 1) break;
+ //if (!strcmp("Midi Through Port-0", info->name) && info->input == 1) break;
+ //if (!strcmp("DigitalKBD MIDI 1", info->name) && info->input == 1) break;
}
Pt_Start(1, midiCallback, m);