Skip to content

Commit 522c5a9

Browse files
committed
synthio: fix crash on synthesizer.press((float,))
1 parent 0a3faf8 commit 522c5a9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

shared-module/synthio/Synthesizer.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,12 @@ void common_hal_synthio_synthesizer_press(synthio_synthesizer_obj_t *self, mp_ob
110110
mp_obj_t iterable = mp_getiter(to_press, &iter_buf);
111111
mp_obj_t note_obj;
112112
while ((note_obj = mp_iternext(iterable)) != MP_OBJ_STOP_ITERATION) {
113+
note_obj = validate_note(note_obj);
113114
if (!mp_obj_is_small_int(note_obj)) {
114115
synthio_note_obj_t *note = MP_OBJ_TO_PTR(note_obj);
115116
synthio_note_start(note, self->synth.sample_rate);
116117
}
117-
synthio_span_change_note(&self->synth, SYNTHIO_SILENCE, validate_note(note_obj));
118+
synthio_span_change_note(&self->synth, SYNTHIO_SILENCE, note_obj);
118119
}
119120
}
120121

0 commit comments

Comments
 (0)