@@ -44,6 +44,7 @@ static const mp_arg_t note_properties[] = {
44
44
{ MP_QSTR_bend_mode , MP_ARG_OBJ | MP_ARG_KW_ONLY , {.u_obj = (mp_obj_t )MP_ROM_PTR (& bend_mode_VIBRATO_obj ) } },
45
45
{ MP_QSTR_waveform , MP_ARG_OBJ | MP_ARG_KW_ONLY , {.u_obj = MP_ROM_NONE } },
46
46
{ MP_QSTR_envelope , MP_ARG_OBJ | MP_ARG_KW_ONLY , {.u_obj = MP_ROM_NONE } },
47
+ { MP_QSTR_filter , MP_ARG_OBJ | MP_ARG_KW_ONLY , {.u_obj = MP_ROM_INT (1 ) } },
47
48
{ MP_QSTR_ring_frequency , MP_ARG_OBJ , {.u_obj = NULL } },
48
49
{ MP_QSTR_ring_waveform , MP_ARG_OBJ | MP_ARG_KW_ONLY , {.u_obj = MP_ROM_NONE } },
49
50
};
@@ -102,6 +103,24 @@ MP_PROPERTY_GETSET(synthio_note_frequency_obj,
102
103
(mp_obj_t )& synthio_note_get_frequency_obj ,
103
104
(mp_obj_t )& synthio_note_set_frequency_obj );
104
105
106
+ //| filter: bool
107
+ //| """True if the note should be processed via the synthesizer's FIR filter."""
108
+ STATIC mp_obj_t synthio_note_get_filter (mp_obj_t self_in ) {
109
+ synthio_note_obj_t * self = MP_OBJ_TO_PTR (self_in );
110
+ return mp_obj_new_bool (common_hal_synthio_note_get_filter (self ));
111
+ }
112
+ MP_DEFINE_CONST_FUN_OBJ_1 (synthio_note_get_filter_obj , synthio_note_get_filter );
113
+
114
+ STATIC mp_obj_t synthio_note_set_filter (mp_obj_t self_in , mp_obj_t arg ) {
115
+ synthio_note_obj_t * self = MP_OBJ_TO_PTR (self_in );
116
+ common_hal_synthio_note_set_filter (self , mp_obj_is_true (arg ));
117
+ return mp_const_none ;
118
+ }
119
+ MP_DEFINE_CONST_FUN_OBJ_2 (synthio_note_set_filter_obj , synthio_note_set_filter );
120
+ MP_PROPERTY_GETSET (synthio_note_filter_obj ,
121
+ (mp_obj_t )& synthio_note_get_filter_obj ,
122
+ (mp_obj_t )& synthio_note_set_filter_obj );
123
+
105
124
//| panning: float
106
125
//| """Defines the channel(s) in which the note appears.
107
126
//|
@@ -317,6 +336,7 @@ static void note_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_
317
336
318
337
STATIC const mp_rom_map_elem_t synthio_note_locals_dict_table [] = {
319
338
{ MP_ROM_QSTR (MP_QSTR_frequency ), MP_ROM_PTR (& synthio_note_frequency_obj ) },
339
+ { MP_ROM_QSTR (MP_QSTR_filter ), MP_ROM_PTR (& synthio_note_filter_obj ) },
320
340
{ MP_ROM_QSTR (MP_QSTR_panning ), MP_ROM_PTR (& synthio_note_panning_obj ) },
321
341
{ MP_ROM_QSTR (MP_QSTR_waveform ), MP_ROM_PTR (& synthio_note_waveform_obj ) },
322
342
{ MP_ROM_QSTR (MP_QSTR_envelope ), MP_ROM_PTR (& synthio_note_envelope_obj ) },
0 commit comments