| @@ -137,6 +137,7 @@ int tStack_addIfNotAlreadyThere(tStack* const stack, uint16_t noteVal) · 136 unmodified lines |
| 137 | // Remove noteVal. return 1 if removed, 0 if not | 137 | // Remove noteVal. return 1 if removed, 0 if not |
| 138 | int tStack_remove(tStack* const stack, uint16_t noteVal) | 138 | int tStack_remove(tStack* const stack, uint16_t noteVal) |
| 139 | { | 139 | { |
| | 140 | |
| 140 | _tStack* ns = *stack; | 141 | _tStack* ns = *stack; |
| 141 | | 142 | |
| 142 | uint8_t k; | 143 | uint8_t k; |
| @@ -801,7 +802,7 @@ void tSimplePoly_deactivateVoice(tSimplePoly* const polyh, uint8_t voice) · 658 unmodified lines |
| 801 | //grab old notes off the stack if there are notes waiting to replace the free voice | 802 | //grab old notes off the stack if there are notes waiting to replace the free voice |
| 802 | for (int j = 0; j < tStack_getSize(&poly->stack); ++j) | 803 | for (int j = 0; j < tStack_getSize(&poly->stack); ++j) |
| 803 | { | 804 | { |
| 804 | noteToTest = tStack_get(&poly->stack, j); | 805 | noteToTest = tStack_get(&poly->stack, j); //note to check if it is waiting to be recovered |
| 805 | | 806 | |
| 806 | if (poly->notes[noteToTest][0] == -3) //if there is a stolen note waiting (marked inactive but on the stack) | 807 | if (poly->notes[noteToTest][0] == -3) //if there is a stolen note waiting (marked inactive but on the stack) |
| 807 | { | 808 | { |
| @@ -809,6 +810,8 @@ void tSimplePoly_deactivateVoice(tSimplePoly* const polyh, uint8_t voice) · 1 unmodified line |
| 809 | poly->voices[voice][1] = poly->notes[noteToTest][1]; // set the velocity of the voice to be the velocity of that note | 810 | poly->voices[voice][1] = poly->notes[noteToTest][1]; // set the velocity of the voice to be the velocity of that note |
| 810 | poly->voices[voice][2] = noteToTest; | 811 | poly->voices[voice][2] = noteToTest; |
| 811 | poly->notes[noteToTest][0] = voice; //mark that it is no longer stolen and is now active | 812 | poly->notes[noteToTest][0] = voice; //mark that it is no longer stolen and is now active |
| | 813 | //poly->notes[][0] = -1; |
| | 814 | break; |
| 812 | } | 815 | } |
| 813 | } | 816 | } |
| 814 | } | 817 | } |