shithub: leaf

Download patch

ref: 55ef84edaf6a5718e261922337be9bd89789ed5b
parent: cbcb57165e25140fa4099a513084e7cf62ff8d58
author: Matthew Wang <mjw7@princeton.edu>
date: Mon Feb 17 13:19:14 EST 2020

minor fix to poly to handle changing num voices

--- a/LEAF/Src/leaf-midi.c
+++ b/LEAF/Src/leaf-midi.c
@@ -514,7 +514,7 @@
     poly->notes[note][1] = -1;
     
     int deactivatedVoice = -1;
-    for (int i = 0; i < poly->numVoices; i++)
+    for (int i = 0; i < poly->maxNumVoices; i++)
     {
         if (poly->voices[i][0] == note)
         {