Skip to content

Commit af40a17

Browse files
committed
synthio: midi_to_hz: remove arbitrary note number limitation
The underlying routine can return numbers for higher and lower octaves. Other bits of the code might have frequency limitations but that doesn't mean we shouldn't let someone get a ~4Hz "note" by sending in (-12), because that's actually totally plausible as an LFO frequency.
1 parent 1b174f8 commit af40a17

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

shared-bindings/synthio/__init__.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(synthio_from_file_obj, 1, synthio_from_file);
276276
//|
277277

278278
STATIC mp_obj_t midi_to_hz(mp_obj_t arg) {
279-
mp_float_t note = mp_arg_validate_obj_float_range(arg, 0, 127, MP_QSTR_note);
279+
mp_float_t note = mp_arg_validate_type_float(arg, MP_QSTR_note);
280280
return mp_obj_new_float(common_hal_synthio_midi_to_hz_float(note));
281281
}
282282
MP_DEFINE_CONST_FUN_OBJ_1(synthio_midi_to_hz_obj, midi_to_hz);

0 commit comments

Comments
 (0)