audioeffects.lowpass

LowPass - the two-pole analog prototype every synth and console low-pass is a version of, digitised without losing its tail.

The player’s text is the class docstring; the CLAIMS table in the class’s test file ties its claim sentences to tests.

audioeffects.lowpass.BUTTERWORTH_LOW = 0.5411961001461969

The fourth-order Butterworth Q pair. At 24 dB/oct the first section holds the lower one fixed and the resonance rides the second alone, so that |H(f0)| is the product 0.5412 * 1.3066 * Q/0.7071 = Q - the same reading of the Resonance knob at both slopes. Scaling both Qs would square it (Resonance 2 would stand +15 dB up rather than +6) and T1 would hold at one slope and not the other. Measured, both slopes, Q 0.5 to 16: within 0.001 dB of 20*log10(Q) at f0 1 kHz. Swept over the whole Frequency travel by the gate audit it holds to 0.011 dB at 12 dB/oct and leaves the bar at 24 dB/oct only at f0 20-31.5 Hz with Q 16 (worst -0.2717 dB).

audioeffects.lowpass.FLAT_Q = 0.7071067811865476

The Q at which the pair above is exactly Butterworth, and the resonance the panel’s own “flat” position stands for.

audioeffects.lowpass.MIN_Q = 0.05

audiobiquad’s own clamp (AUDIODSP_FILTER_F32_MIN_Q / MAX_Q), mirrored because the module does not export it. Resonance 16 at 24 dB/oct asks for 29.56, which is inside it.

audioeffects.lowpass.TRIM_CORNER_HZ = 5.0

The trim is one high shelf at a subsonic corner, which is a broadband gain everywhere above it: no node on the palette gives gain above unity (MixerVoice.level clamps to 0..1, audiomath.Multiply only attenuates), and there is no route from Python to a biquad’s b coefficients, so the shelf is how a low-pass gets its make-up. Measured on this node at 48 000 / 44 100 / 22 050 Hz and -12/-6/+6/+12 dB: flat to 0.010 dB from 50 Hz to 15 kHz, 0.100 dB worst at 20 Hz. A 10 Hz corner reads 0.95 dB out at 20 Hz, which is why the corner is 5.

audioeffects.lowpass.FLAT_DB = 0.2

A trim under this is built as a wire rather than a pass of arithmetic that must come back byte-identical. MIDI 64 is the exact centre of a BIPOLAR span since audiocomponents#87, so the detent itself is 0.000 dB; what this floor still covers is the codes either side of it.

class audioeffects.lowpass.LowPass(source, *options, **keywords)[source]

Bases: Component

A low-pass: above the corner the signal rolls away.

Controls. Frequency slides the whole curve along without changing its shape. Resonance is how loud the corner itself stands: at 0.707 it is 3 dB down and the roll-off is as gentle as it gets, and turned up it stands above the passband and a click at the input rings where you put it. Slope is 12 or 24 dB an octave. Trim is a flat gain across the band. Mix at 0 is your dry signal. The Effect controls page lists what the knobs span.

Response. Above the corner the roll-off is 12 or 24 dB an octave. The curve keeps one shape at every corner from 31.5 Hz up. From 40 Hz up at 48 kHz the corner stands as loud as Resonance says at either slope; at the bottom of the Frequency knob with Resonance high on the steep slope it stands a little low.

Timing. Latency is zero at every setting. Silence in is silence out once the filter rings down, and the class reports a tail that covers its lowest corner and highest Resonance.

Levels. Keep the input under -3 dBFS and the defaults and patches stay off the rails. Trim at its top can still push the output onto the rails.

On a board. The class needs audiodsp’s audiobiquad, and on a board without it construction raises ImportError.

NAME = 'LowPass'

The stable provider name audioeffects.create() discovers.

TIER = 'audiodsp'

STOCK or AUDIODSP, with REQUIRES naming the audiodsp-own modules an AUDIODSP class needs.

Type:

roadmap §3

CAPABILITIES = ()

The contract’s static reads. CAPABILITIES names "tempo_sync" if and only if the class reads self._transport().

TAIL_SAMPLES = 528261

The design-rate worst case of the per-build bound tail_samples reports: 20 Hz at Resonance 16 and 24 dB/oct with the trim cutting, at 48 kHz. The instance’s own figure is what a host should read: patch 0’s is 45 samples. Before audiocomponents#114 this was a measured 204 800, which a move from a high corner to a low one as the input stopped outlived (279 149 at patch 4).

INPUT_CEILING_DBFS = -3

The defaults and every patch play the ceiling kit’s materials clean at this level; at full scale, patch 5 rails on a 50 Hz sine.

CLIPS_AT_TOP = (4,)

the rail check skips them.

Type:

Settings that clip by design

MACRO_LABELS = ('Frequency', 'Resonance', 'Slope', 'Mix', 'Trim')

Knob names, one per macro index; one mode per label; the private engineering spans behind them; and the patches on the 0-127 grid.

PATCHES = {0: ('Open', (127, 13, 0, 127, 64)), 1: ('Soft Roll', (105, 13, 0, 127, 64)), 2: ('Steep Cut', (92, 13, 127, 127, 64)), 3: ('Resonant Peak', (75, 91, 0, 127, 32)), 4: ('Squelch', (59, 116, 127, 127, 16)), 5: ('Sub Only', (33, 13, 127, 127, 64))}

Named for settings, never for products, and every value is macro_of() of the setting in the comment beside it.

property tail_samples

The ring time of this build: the sections in circuit, each bounded from its coefficients in force (_component.biquad_ring), summed down the cascade. The bound holds from any state the sections can hold, including what the settings before a move left in them (audiocomponents#114). A section that Mix 0 or the Slope switch has taken out passes its input through and adds nothing.