Skip to content

Commit a94031d

Browse files
committed
synthio: make most Note constructor args kw-only
for similar reasons as Envelope. The mandatory frequency argument can still be given as a positional argument.
1 parent c839888 commit a94031d

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

shared-bindings/synthio/Note.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,18 @@
3535

3636
static const mp_arg_t note_properties[] = {
3737
{ MP_QSTR_frequency, MP_ARG_OBJ | MP_ARG_REQUIRED, {.u_obj = NULL } },
38-
{ MP_QSTR_amplitude, MP_ARG_OBJ, {.u_obj = MP_ROM_INT(1) } },
39-
{ MP_QSTR_tremolo_rate, MP_ARG_OBJ, {.u_obj = NULL } },
40-
{ MP_QSTR_tremolo_depth, MP_ARG_OBJ, {.u_obj = NULL } },
41-
{ MP_QSTR_vibrato_rate, MP_ARG_OBJ, {.u_obj = NULL } },
42-
{ MP_QSTR_vibrato_depth, MP_ARG_OBJ, {.u_obj = NULL } },
43-
{ MP_QSTR_waveform, MP_ARG_OBJ, {.u_obj = MP_ROM_NONE } },
44-
{ MP_QSTR_envelope, MP_ARG_OBJ, {.u_obj = MP_ROM_NONE } },
38+
{ MP_QSTR_amplitude, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj = MP_ROM_INT(1) } },
39+
{ MP_QSTR_tremolo_rate, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj = NULL } },
40+
{ MP_QSTR_tremolo_depth, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj = NULL } },
41+
{ MP_QSTR_vibrato_rate, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj = NULL } },
42+
{ MP_QSTR_vibrato_depth, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj = NULL } },
43+
{ MP_QSTR_waveform, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj = MP_ROM_NONE } },
44+
{ MP_QSTR_envelope, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj = MP_ROM_NONE } },
4545
};
4646
//| class Note:
4747
//| def __init__(
4848
//| self,
49+
//| *,
4950
//| frequency: float,
5051
//| amplitude: float = 1.0,
5152
//| waveform: Optional[ReadableBuffer] = None,

0 commit comments

Comments
 (0)