From 4e774dc4eb1b8a4ccd00e49b19a1cfd00c36e309 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Sun, 4 Jun 2023 11:00:08 +0200 Subject: Add an extremely conservative wait after sending to the K2 It seems there's some kind of internal buffer that is easily overflowed. --- x1k2-midi-osc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x1k2-midi-osc.c b/x1k2-midi-osc.c index 3ad763d..e91dd09 100644 --- a/x1k2-midi-osc.c +++ b/x1k2-midi-osc.c @@ -78,7 +78,7 @@ static void send_note_on(snd_rawmidi_t *midi_out, int note) if ( r != 3 ) { printf("snd_rawmidi_write said %li\n", r); } - snd_rawmidi_drain(midi_out); + usleep(1000); } @@ -93,7 +93,7 @@ static void send_note_off(snd_rawmidi_t *midi_out, int note) if ( r != 3 ) { printf("snd_rawmidi_write said %li\n", r); } - snd_rawmidi_drain(midi_out); + usleep(1000); } -- cgit v1.2.3