Commit b10e0e0b0c78731029caa1c0d463092429a8551a

Thomas de Grivel 2018-08-12T19:42:40

fix note repetitions

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/rtbuf_glfw3_keyboard.c b/rtbuf_glfw3_keyboard.c
index 7492ac1..32098ba 100644
--- a/rtbuf_glfw3_keyboard.c
+++ b/rtbuf_glfw3_keyboard.c
@@ -71,7 +71,7 @@ static int find_note (s_rtbuf_music_notes *notes, double freq)
   unsigned int n = notes->note_n;
   while (i < RTBUF_MUSIC_NOTE_MAX && n > 0) {
     s_rtbuf_music_note *note = &notes->note[i];
-    if (note->velocity > 0.0 && note->start >= 0.0) {
+    if (note->velocity > 0.0 && note->start >= 0.0 && note->stop < 0.0) {
       if (freq == notes->note[i].freq)
         return i;
       n--;