From a854e554f4f2492aaa881da659c601afdeef047e Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 5 May 2023 18:25:51 -0500 Subject: [PATCH] synthio: add midi_to_hz to docs --- shared-bindings/synthio/__init__.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/shared-bindings/synthio/__init__.c b/shared-bindings/synthio/__init__.c index 5af352b404..b48e279028 100644 --- a/shared-bindings/synthio/__init__.c +++ b/shared-bindings/synthio/__init__.c @@ -262,6 +262,10 @@ STATIC mp_obj_t synthio_from_file(size_t n_args, const mp_obj_t *pos_args, mp_ma } MP_DEFINE_CONST_FUN_OBJ_KW(synthio_from_file_obj, 1, synthio_from_file); +//| def midi_to_hz(midi_note: int) -> float: +//| """Converts the given midi note (60 = middle C, 69 = concert A) to Hz""" +//| +/ STATIC mp_obj_t midi_to_hz(mp_obj_t arg) { mp_int_t note = mp_arg_validate_int_range(mp_obj_get_int(arg), 1, 127, MP_QSTR_note); return mp_obj_new_float(common_hal_synthio_midi_to_hz_float(note));