@@ -92,7 +92,20 @@ STATIC mp_obj_t synthio_synthesizer_press(mp_obj_t self_in, mp_obj_t press) {
92
92
return mp_const_none ;
93
93
}
94
94
STATIC MP_DEFINE_CONST_FUN_OBJ_2 (synthio_synthesizer_press_obj , synthio_synthesizer_press );
95
- //
95
+ //| def release(self, /, release: Sequence[int] = ()) -> None:
96
+ //| """Turn some notes off. Notes use MIDI numbering, with 60 being middle C, approximately 262Hz.
97
+ //|
98
+ //| Releasing a note that was already released has no effect.
99
+ //|
100
+ //| :param Sequence[int] release: Any sequence of integer notes."""
101
+ STATIC mp_obj_t synthio_synthesizer_release (mp_obj_t self_in , mp_obj_t release ) {
102
+ synthio_synthesizer_obj_t * self = MP_OBJ_TO_PTR (self_in );
103
+ check_for_deinit (self );
104
+ common_hal_synthio_synthesizer_release (self , release );
105
+ return mp_const_none ;
106
+ }
107
+ STATIC MP_DEFINE_CONST_FUN_OBJ_2 (synthio_synthesizer_release_obj , synthio_synthesizer_release );
108
+
96
109
//| def release_then_press(
97
110
//| self, release: Sequence[int] = (), press: Sequence[int] = ()
98
111
//| ) -> None:
@@ -210,6 +223,7 @@ MP_PROPERTY_GETTER(synthio_synthesizer_pressed_obj,
210
223
STATIC const mp_rom_map_elem_t synthio_synthesizer_locals_dict_table [] = {
211
224
// Methods
212
225
{ MP_ROM_QSTR (MP_QSTR_press ), MP_ROM_PTR (& synthio_synthesizer_press_obj ) },
226
+ { MP_ROM_QSTR (MP_QSTR_release ), MP_ROM_PTR (& synthio_synthesizer_release_obj ) },
213
227
{ MP_ROM_QSTR (MP_QSTR_release_all ), MP_ROM_PTR (& synthio_synthesizer_release_all_obj ) },
214
228
{ MP_ROM_QSTR (MP_QSTR_release_then_press ), MP_ROM_PTR (& synthio_synthesizer_release_then_press_obj ) },
215
229
{ MP_ROM_QSTR (MP_QSTR_release_all_then_press ), MP_ROM_PTR (& synthio_synthesizer_release_all_then_press_obj ) },
0 commit comments