You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: shared-bindings/synthio/Synthesizer.c
+113-5Lines changed: 113 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -32,6 +32,7 @@
32
32
#include"py/objproperty.h"
33
33
#include"py/runtime.h"
34
34
#include"shared-bindings/util.h"
35
+
#include"shared-bindings/synthio/Biquad.h"
35
36
#include"shared-bindings/synthio/Synthesizer.h"
36
37
#include"shared-bindings/synthio/LFO.h"
37
38
#include"shared-bindings/synthio/__init__.h"
@@ -52,7 +53,6 @@
52
53
//| channel_count: int = 1,
53
54
//| waveform: Optional[ReadableBuffer] = None,
54
55
//| envelope: Optional[Envelope] = None,
55
-
//| filter: Optional[ReadableBuffer] = None,
56
56
//| ) -> None:
57
57
//| """Create a synthesizer object.
58
58
//|
@@ -65,17 +65,15 @@
65
65
//| :param int sample_rate: The desired playback sample rate; higher sample rate requires more memory
66
66
//| :param int channel_count: The number of output channels (1=mono, 2=stereo)
67
67
//| :param ReadableBuffer waveform: A single-cycle waveform. Default is a 50% duty cycle square wave. If specified, must be a ReadableBuffer of type 'h' (signed 16 bit)
68
-
//| :param ReadableBuffer filter: Coefficients of an FIR filter to apply to notes with ``filter=True``. If specified, must be a ReadableBuffer of type 'h' (signed 16 bit)
69
68
//| :param Optional[Envelope] envelope: An object that defines the loudness of a note over time. The default envelope, `None` provides no ramping, voices turn instantly on and off.
//| """Construct a low-pass filter with the given parameters.
294
+
//|
295
+
//| ``frequency``, called f0 in the cookbook, is the corner frequency in Hz
296
+
//| of the filter.
297
+
//|
298
+
//| ``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.
299
+
//| """
300
+
301
+
enumpassfilter_arg_e { ARG_f0, ARG_Q };
302
+
303
+
// M_PI is not part of the math.h standard and may not be defined
304
+
// And by defining our own we can ensure it uses the correct const format.
//| """Construct a high-pass filter with the given parameters.
337
+
//|
338
+
//| ``frequency``, called f0 in the cookbook, is the corner frequency in Hz
339
+
//| of the filter.
340
+
//|
341
+
//| ``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.
//| """Construct a band-pass filter with the given parameters.
367
+
//|
368
+
//| ``frequency``, called f0 in the cookbook, is the center frequency in Hz
369
+
//| of the filter.
370
+
//|
371
+
//| ``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.
372
+
//|
373
+
//| The coefficients are scaled such that the filter has a 0dB peak gain.
0 commit comments