audioeffects.notch

Notch - the two-pole band-stop: everything except one band, tuned.

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

audioeffects.notch.MIN_Q = 0.05

audiobiquad’s own clamp (AUDIODSP_FILTER_F32_MIN_Q / MAX_Q, audiodsp/src/shared/audiodsp_filter_f32.c:21-22), mirrored because the module does not export it. It bites on the harmonic notch: Width 32 doubles to 64 and lands on 60, so the harmonic is 6.7 % wider in hertz than the fundamental there. Stated rather than hidden - dossier D3.

audioeffects.notch.HARMONIC = 2.0

The harmonic notch sits at this multiple of the centre, and its Q is multiplied by the same number so that its width in hertz matches the fundamental’s: width is f/Q (S3), so f -> 2f at Q -> 2Q is the same number of hertz. Mains harmonics are exact multiples, so the narrow one is what a hum eliminator wants (dossier A16, D3: 5.00 Hz against 10.00).

audioeffects.notch.CENTRE_CEILING = 0.4

The highest centre this class will tune to, as a fraction of the rate. Not _hz()’s 0.49: T2 reads unity at 0.48*Fs, and a notch centred above this has its own band over that probe. Clamps, never refuses - the rate-honesty invariant (vision section 3).

audioeffects.notch.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. Measured on this node at 48 000 / 44 100 / 22 050 Hz and -12/-6/+6/+12 dB: worst deviation from the requested gain 0.105 dB, at 20 Hz, and 0.021 dB or better from 50 Hz up (dossier A16).

audioeffects.notch.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.notch.Notch(source, *options, **keywords)[source]

Bases: Component

A notch: one band taken out, and the rest of the signal left alone.

Controls. Frequency is where the notch sits. Width is its bandwidth: low, the notch is a wide scoop; high, it is a few hertz across and you hear a tone leave without hearing the music change. Harmonics adds a second notch an octave up, as narrow in hertz as the first, for hum that comes as a series. Depth is a blend, and at 0 the class is a wire. Trim is a flat gain. The Effect controls page lists what the knobs span.

Response. DC and the top of the band pass untouched. At low centres the notch is shallower: there it reduces a hum rather than removing it.

Timing. Latency is zero at every setting. Silence in settles to exact silence out.

Levels. Keep the input under -6 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 = 'Notch'

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 = 965439

The design-rate worst case of the per-build bound tail_samples reports: 20 Hz at Width 60, the harmonic notch on and the trim at +12 dB, at 48 kHz. The instance’s own figure is what a host should read: patch 0’s is 187 samples. Before audiocomponents#114 this was a measured 143 360, which a move from a high centre to a low one as the input stopped outlived by up to twice.

INPUT_CEILING_DBFS = -6

The defaults and every patch play the ceiling kit’s materials clean at this level; at -3 dBFS, patch 1 rails on a 100 Hz square.

CLIPS_AT_TOP = (4,)

the rail check skips them.

Type:

Settings that clip by design

MACRO_LABELS = ('Frequency', 'Width', 'Harmonics', 'Depth', '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: ('Wide Notch', (74, 11, 0, 127, 64)), 1: ('Hum 50', (17, 97, 127, 127, 64)), 2: ('Hum 60', (21, 97, 127, 127, 64)), 3: ('Feedback Tamer', (92, 118, 0, 127, 64)), 4: ('Mud Scoop', (51, 27, 0, 76, 64)), 5: ('Whistle Kill', (114, 125, 0, 127, 64))}

Named for settings, never for products, and every value is macro_of() of the setting in the comment beside it. A 7-bit step on a 20 Hz - 16 kHz log span is 5.4 %, so the settings below are what the grid stands for and not what was asked for.

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 a Depth of 0 or the Harmonics switch has taken out passes its input through and adds nothing.