Skip to content

Commit 11d8a6e

Browse files
committed
synthio: rename synthesizer.lfos to .blocks
.. since math blocks can be placed in it too (and that's useful)
1 parent c20e862 commit 11d8a6e

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

shared-bindings/synthio/Synthesizer.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -270,22 +270,22 @@ MP_DEFINE_CONST_FUN_OBJ_1(synthio_synthesizer_get_pressed_obj, synthio_synthesiz
270270
MP_PROPERTY_GETTER(synthio_synthesizer_pressed_obj,
271271
(mp_obj_t)&synthio_synthesizer_get_pressed_obj);
272272

273-
//| lfos: List[LFO]
274-
//| """A list of LFOs to advance whether or not they are associated with a playing note.
273+
//| blocks: List[BlockInput]
274+
//| """A list of blocks to advance whether or not they are associated with a playing note.
275275
//|
276276
//| This can be used to implement 'free-running' LFOs. LFOs associated with playing notes are advanced whether or not they are in this list.
277277
//|
278-
//| This property is read-only but its contents may be modified by e.g., calling ``synth.lfos.append()`` or ``synth.lfos.remove()``. It is initially an empty list."""
278+
//| This property is read-only but its contents may be modified by e.g., calling ``synth.blocks.append()`` or ``synth.blocks.remove()``. It is initially an empty list."""
279279
//|
280-
STATIC mp_obj_t synthio_synthesizer_obj_get_lfos(mp_obj_t self_in) {
280+
STATIC mp_obj_t synthio_synthesizer_obj_get_blocks(mp_obj_t self_in) {
281281
synthio_synthesizer_obj_t *self = MP_OBJ_TO_PTR(self_in);
282282
check_for_deinit(self);
283-
return common_hal_synthio_synthesizer_get_lfos(self);
283+
return common_hal_synthio_synthesizer_get_blocks(self);
284284
}
285-
MP_DEFINE_CONST_FUN_OBJ_1(synthio_synthesizer_get_lfos_obj, synthio_synthesizer_obj_get_lfos);
285+
MP_DEFINE_CONST_FUN_OBJ_1(synthio_synthesizer_get_blocks_obj, synthio_synthesizer_obj_get_blocks);
286286

287-
MP_PROPERTY_GETTER(synthio_synthesizer_lfos_obj,
288-
(mp_obj_t)&synthio_synthesizer_get_lfos_obj);
287+
MP_PROPERTY_GETTER(synthio_synthesizer_blocks_obj,
288+
(mp_obj_t)&synthio_synthesizer_get_blocks_obj);
289289

290290
//| max_polyphony: int
291291
//| """Maximum polyphony of the synthesizer (read-only class property)"""
@@ -308,7 +308,7 @@ STATIC const mp_rom_map_elem_t synthio_synthesizer_locals_dict_table[] = {
308308
{ MP_ROM_QSTR(MP_QSTR_sample_rate), MP_ROM_PTR(&synthio_synthesizer_sample_rate_obj) },
309309
{ MP_ROM_QSTR(MP_QSTR_max_polyphony), MP_ROM_INT(CIRCUITPY_SYNTHIO_MAX_CHANNELS) },
310310
{ MP_ROM_QSTR(MP_QSTR_pressed), MP_ROM_PTR(&synthio_synthesizer_pressed_obj) },
311-
{ MP_ROM_QSTR(MP_QSTR_lfos), MP_ROM_PTR(&synthio_synthesizer_lfos_obj) },
311+
{ MP_ROM_QSTR(MP_QSTR_blocks), MP_ROM_PTR(&synthio_synthesizer_blocks_obj) },
312312
};
313313
STATIC MP_DEFINE_CONST_DICT(synthio_synthesizer_locals_dict, synthio_synthesizer_locals_dict_table);
314314

shared-bindings/synthio/Synthesizer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ void common_hal_synthio_synthesizer_press(synthio_synthesizer_obj_t *self, mp_ob
4444
void common_hal_synthio_synthesizer_retrigger(synthio_synthesizer_obj_t *self, mp_obj_t to_retrigger);
4545
void common_hal_synthio_synthesizer_release_all(synthio_synthesizer_obj_t *self);
4646
mp_obj_t common_hal_synthio_synthesizer_get_pressed_notes(synthio_synthesizer_obj_t *self);
47-
mp_obj_t common_hal_synthio_synthesizer_get_lfos(synthio_synthesizer_obj_t *self);
47+
mp_obj_t common_hal_synthio_synthesizer_get_blocks(synthio_synthesizer_obj_t *self);

shared-module/synthio/Synthesizer.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ void common_hal_synthio_synthesizer_construct(synthio_synthesizer_obj_t *self,
3737
mp_obj_t envelope_obj) {
3838

3939
synthio_synth_init(&self->synth, sample_rate, channel_count, waveform_obj, filter_obj, envelope_obj);
40-
self->lfos = mp_obj_new_list(0, NULL);
40+
self->blocks = mp_obj_new_list(0, NULL);
4141
}
4242

4343
void common_hal_synthio_synthesizer_deinit(synthio_synthesizer_obj_t *self) {
@@ -75,7 +75,7 @@ audioio_get_buffer_result_t synthio_synthesizer_get_buffer(synthio_synthesizer_o
7575

7676
// free-running LFOs
7777
mp_obj_iter_buf_t iter_buf;
78-
mp_obj_t iterable = mp_getiter(self->lfos, &iter_buf);
78+
mp_obj_t iterable = mp_getiter(self->blocks, &iter_buf);
7979
mp_obj_t item;
8080
while ((item = mp_iternext(iterable)) != MP_OBJ_STOP_ITERATION) {
8181
if (!synthio_obj_is_block(item)) {
@@ -185,6 +185,6 @@ mp_obj_t common_hal_synthio_synthesizer_get_pressed_notes(synthio_synthesizer_ob
185185
return MP_OBJ_FROM_PTR(result);
186186
}
187187

188-
mp_obj_t common_hal_synthio_synthesizer_get_lfos(synthio_synthesizer_obj_t *self) {
189-
return self->lfos;
188+
mp_obj_t common_hal_synthio_synthesizer_get_blocks(synthio_synthesizer_obj_t *self) {
189+
return self->blocks;
190190
}

shared-module/synthio/Synthesizer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
typedef struct {
3535
mp_obj_base_t base;
3636
synthio_synth_t synth;
37-
mp_obj_t lfos;
37+
mp_obj_t blocks;
3838
} synthio_synthesizer_obj_t;
3939

4040

0 commit comments

Comments
 (0)