diff options
| author | Mitja Felicijan <mitja.felicijan@gmail.com> | 2024-10-12 06:14:14 +0200 |
|---|---|---|
| committer | Mitja Felicijan <mitja.felicijan@gmail.com> | 2024-10-12 06:14:14 +0200 |
| commit | 39bd41ad4d4832d4022a99e3cfcc49409f8b2da6 (patch) | |
| tree | 051b355fa3ea5cfcceb2b63efba0bbdf13970ee9 /midi.c | |
| parent | 920bdc358831087c46db736120a718ed9a75fbd4 (diff) | |
| download | ttdaw-39bd41ad4d4832d4022a99e3cfcc49409f8b2da6.tar.gz | |
Added basic interface and keyboard capture of terminal
Diffstat (limited to 'midi.c')
| -rw-r--r-- | midi.c | 30 |
1 files changed, 17 insertions, 13 deletions
@@ -6,6 +6,7 @@ #include "midi.h" #include "mutex.h" +#include "termbox2.h" static snd_seq_t *seq_handle; static snd_seq_addr_t *ports; @@ -40,10 +41,10 @@ void *midi(void *arg) { } // Listing assigned ports. - fprintf(stdout, "Ports:\n"); - for (int j = 0; j < MAX_MIDI_PORTS; j++) { - fprintf(stdout, " client: %d, port: %d\n", ports[j].client, ports[j].port); - } + /* fprintf(stdout, "Ports:\n"); */ + /* for (int j = 0; j < MAX_MIDI_PORTS; j++) { */ + /* fprintf(stdout, " client: %d, port: %d\n", ports[j].client, ports[j].port); */ + /* } */ // Connecting ports. for (int i = 0; i < MAX_MIDI_PORTS; ++i) { @@ -87,21 +88,24 @@ void *midi(void *arg) { shared_data.note = ev->data.note.note; shared_data.state = 1; shared_data.velocity = ev->data.note.velocity; - printf("%3d:%-3dNote on %2d, note %d, velocity: %3d\n", - ev->source.client, ev->source.port, - ev->data.note.channel, - ev->data.note.note, - ev->data.note.velocity); + tb_printf(0, 3, TB_CYAN, 0, "Note: %3d", ev->data.note.note); + tb_printf(0, 4, TB_CYAN, 0, "Velocity: %3d", ev->data.note.velocity); + tb_present(); + /* printf("%3d:%-3dNote on %2d, note %d, velocity: %3d\n", */ + /* ev->source.client, ev->source.port, */ + /* ev->data.note.channel, */ + /* ev->data.note.note, */ + /* ev->data.note.velocity); */ break; case SND_SEQ_EVENT_NOTEOFF: shared_data.note = ev->data.note.note; shared_data.state = 0; shared_data.velocity = 0; - printf("%3d:%-3dNote off\t%2d, note %d\n", - ev->source.client, ev->source.port, - ev->data.note.channel, - ev->data.note.note); + /* printf("%3d:%-3dNote off\t%2d, note %d\n", */ + /* ev->source.client, ev->source.port, */ + /* ev->data.note.channel, */ + /* ev->data.note.note); */ break; |
