Commit dc899bf7 authored by Jacob Vosmaer's avatar Jacob Vosmaer

Use NUM_NOTES

parent cc051f11
......@@ -246,7 +246,7 @@ void poly2_init(void) {
l_flush(&poly2.note_queue);
l_flush(&poly2.available_voices);
for_each_voice (v) {
poly2.current_note[v] = poly2.note_queue.sup;
poly2.current_note[v] = NUM_NOTES;
l_pushl(&poly2.available_voices, v);
}
}
......@@ -263,7 +263,7 @@ void poly2_assign_available_voices(void) {
}
void poly2_note_on(uint8_t note) {
if (note >= poly2.note_queue.sup) {
if (note >= NUM_NOTES) {
return;
}
......@@ -272,14 +272,14 @@ void poly2_note_on(uint8_t note) {
}
void poly2_note_off(uint8_t note) {
if (note >= poly2.note_queue.sup) {
if (note >= NUM_NOTES) {
return;
}
l_delete(&poly2.note_queue, note);
for_each_voice (v) {
if (poly2.current_note[v] == note) {
poly2.current_note[v] = poly2.note_queue.sup;
poly2.current_note[v] = NUM_NOTES;
gate_off(v);
l_pushl(&poly2.available_voices, v);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment