summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2023-06-04 11:00:08 +0200
committerThomas White <taw@physics.org>2023-06-04 11:00:08 +0200
commit4e774dc4eb1b8a4ccd00e49b19a1cfd00c36e309 (patch)
treebd00451de0037ac2ba362f690f17d205f5c05a5d
parent622813d02f9186e3255aa4745f3bdf133f63ca91 (diff)
Add an extremely conservative wait after sending to the K2
It seems there's some kind of internal buffer that is easily overflowed.
-rw-r--r--x1k2-midi-osc.c4
1 files 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);
}