synthio: fix crash on synthesizer.press((float,))
This commit is contained in:
parent
0a3faf8c9d
commit
522c5a9a11
@ -110,11 +110,12 @@ void common_hal_synthio_synthesizer_press(synthio_synthesizer_obj_t *self, mp_ob
|
||||
mp_obj_t iterable = mp_getiter(to_press, &iter_buf);
|
||||
mp_obj_t note_obj;
|
||||
while ((note_obj = mp_iternext(iterable)) != MP_OBJ_STOP_ITERATION) {
|
||||
note_obj = validate_note(note_obj);
|
||||
if (!mp_obj_is_small_int(note_obj)) {
|
||||
synthio_note_obj_t *note = MP_OBJ_TO_PTR(note_obj);
|
||||
synthio_note_start(note, self->synth.sample_rate);
|
||||
}
|
||||
synthio_span_change_note(&self->synth, SYNTHIO_SILENCE, validate_note(note_obj));
|
||||
synthio_span_change_note(&self->synth, SYNTHIO_SILENCE, note_obj);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user