Skip to content

Commit 6ff3860

Browse files
committed
Synthesizer: Match documentation to implementation.
The docstrings incorrectly gave the name of the argument; the code only accepts the argument name "Q": ``` { MP_QSTR_Q, MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL } }, ```
1 parent a3d7eb6 commit 6ff3860

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

shared-bindings/synthio/Synthesizer.c

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -287,13 +287,13 @@ MP_PROPERTY_GETTER(synthio_synthesizer_blocks_obj,
287287
//| """Maximum polyphony of the synthesizer (read-only class property)"""
288288
//|
289289

290-
//| def low_pass_filter(cls, frequency: float, q_factor: float = 0.7071067811865475) -> Biquad:
290+
//| def low_pass_filter(cls, frequency: float, Q: float = 0.7071067811865475) -> Biquad:
291291
//| """Construct a low-pass filter with the given parameters.
292292
//|
293293
//| ``frequency``, called f0 in the cookbook, is the corner frequency in Hz
294294
//| of the filter.
295295
//|
296-
//| ``q_factor``, called ``Q`` in the cookbook. Controls how peaked the response will be at the cutoff frequency. A large value makes the response more peaked.
296+
//| ``Q`` controls how peaked the response will be at the cutoff frequency. A large value makes the response more peaked.
297297
//| """
298298

299299
enum passfilter_arg_e { ARG_f0, ARG_Q };
@@ -328,15 +328,13 @@ static mp_obj_t synthio_synthesizer_lpf(size_t n_pos, const mp_obj_t *pos_args,
328328

329329
MP_DEFINE_CONST_FUN_OBJ_KW(synthio_synthesizer_lpf_fun_obj, 1, synthio_synthesizer_lpf);
330330

331-
//| def high_pass_filter(
332-
//| cls, frequency: float, q_factor: float = 0.7071067811865475
333-
//| ) -> Biquad:
331+
//| def high_pass_filter(cls, frequency: float, Q: float = 0.7071067811865475) -> Biquad:
334332
//| """Construct a high-pass filter with the given parameters.
335333
//|
336334
//| ``frequency``, called f0 in the cookbook, is the corner frequency in Hz
337335
//| of the filter.
338336
//|
339-
//| ``q_factor``, called ``Q`` in the cookbook. Controls how peaked the response will be at the cutoff frequency. A large value makes the response more peaked.
337+
//| ``Q`` controls how peaked the response will be at the cutoff frequency. A large value makes the response more peaked.
340338
//| """
341339

342340
static mp_obj_t synthio_synthesizer_hpf(size_t n_pos, const mp_obj_t *pos_args, mp_map_t *kw_args) {
@@ -358,15 +356,13 @@ static mp_obj_t synthio_synthesizer_hpf(size_t n_pos, const mp_obj_t *pos_args,
358356

359357
}
360358

361-
//| def band_pass_filter(
362-
//| cls, frequency: float, q_factor: float = 0.7071067811865475
363-
//| ) -> Biquad:
359+
//| def band_pass_filter(cls, frequency: float, Q: float = 0.7071067811865475) -> Biquad:
364360
//| """Construct a band-pass filter with the given parameters.
365361
//|
366362
//| ``frequency``, called f0 in the cookbook, is the center frequency in Hz
367363
//| of the filter.
368364
//|
369-
//| ``q_factor``, called ``Q`` in the cookbook. Controls how peaked the response will be at the cutoff frequency. A large value makes the response more peaked.
365+
//| ``Q`` Controls how peaked the response will be at the cutoff frequency. A large value makes the response more peaked.
370366
//|
371367
//| The coefficients are scaled such that the filter has a 0dB peak gain.
372368
//| """

0 commit comments

Comments
 (0)