audioeffects.stereowidener

StereoWidener - a stereo widener with Haas and Mid/Side characters.

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

audioeffects.stereowidener.DELAY_MIN_MS = 1.0

The Delay span, in ms, swept by ratio.

audioeffects.stereowidener.LINE_MS = 41.0

Delay’s top plus 1 ms, so the node never clamps the read.

Type:

The line

audioeffects.stereowidener.SLEW = 0.1875

How fast a Delay move walks the read head, in delay-seconds per second: 3/16, exact in every float format, a pitch bend of x1.1875 while it moves.

audioeffects.stereowidener.HARD = 0.999969482421875

The hardest a Mixer voice pans. The integer mixer clamps any panning to this, and its far channel keeps a scale of 1/32768: a voice at level 1 then hands that channel x >> 15, which is -1 for every negative sample and 0 otherwise. SIGN and NEGATE build the +1 that cancels it.

audioeffects.stereowidener.SIGN = 1

The two modulators the cancelling branch multiplies by, in audiomath.Multiply’s Q15: 1 turns a sample into the far channel’s x >> 15 (-1 below zero, else 0), and -32768 turns that into +1 or 0, exactly.

audioeffects.stereowidener.TABLE_FRAMES = 16

more than one, so the native mixer and Multiply never take a table shorter than the word they consume.

Type:

Frames in each modulator table

audioeffects.stereowidener.BLOCK = 256

The frames a mixer pull hands out, and so the frames each voice and each Splitter tap take per pull.

audioeffects.stereowidener.ECHO_TOLERANCE = 1e-06

How close, as a 0..1 knob position, a Delay write must come to the grid step the constructor’s delay_ms seeded to count as a host echoing it back: 1e-6 is 1/7 874 of one MIDI step, and holds a single-precision round trip.

audioeffects.stereowidener.DELAY_STEPS = {62: 6.0, 91: 14.0, 111: 25.0}

Delay on one of these steps plays the round number the patch table names (14 ms, not the step’s 14.06), whichever way it got there.

Type:

The patches’ Delays, exactly, by MIDI step

audioeffects.stereowidener.STEP_TOLERANCE = 0.0001

How close, in MIDI steps, Delay must sit to a step in DELAY_STEPS.

audioeffects.stereowidener.DEFAULT_WIDTH = 1.0

The constructor defaults, which NaN falls back to.

audioeffects.stereowidener.haas_voices(width)[source]

((lead level, lead panning), (copy level, copy panning)) for a Haas Width: up to 1 the lead keeps the left at unity and turns its right down by the Width while the copy comes up in the right; above 1 the copy stays at unity and the lead turns down to 1/Width.

class audioeffects.stereowidener.StereoWidener(source, *options, **keywords)[source]

Bases: Component

Widen a stereo part: Haas delays the right channel a few milliseconds behind the left, and Mid/Side scales the difference between the channels.

The controls. Width sets how wide the part sounds. Delay is how late the Haas copy is, and only Haas uses it. Character picks Haas or Mid/Side. The Effect controls page lists what the knobs span.

Haas. The ear places a sound by the first arrival and hears the late copy as width. At Width 1 the left channel passes untouched and the right channel is your right channel, exactly Delay late. Between Width 0 and 1 the right channel crossfades from itself to its late copy, which colours it most at 0.5. Width 0 is a wire. Above Width 1 the copy stays where it is and the left turns down, 6 dB at Width 2, to pull back the image the left’s early arrival leans its way. Turning Delay glides the copy to the new time instead of clicking, bending its pitch while it moves. Haas folds to mono as a comb filter: at Width 1 with the default 14 ms, the mono sum has full-depth notches at 35.7, 107 and 179 Hz and on up. Use Mid/Side when the mix may be summed.

Mid/Side. Summed to mono, the output is the same at every Width, within one LSB. Width 0 is mono, 1 is a wire and 2 doubles the sides. Above Width 1, a part panned hard left shows up inverted on the right. A part that is the same in both channels comes out unchanged. Peaks below half of full scale never clip at any Width.

Mono, latency, tail. A one-channel source comes out exactly as it went in, whatever the controls say. To widen a mono part, make it stereo first (a stereo chorus, say) and put this after it. A click in the left comes out on the frame it went in: there is no latency. tail_samples is the copy’s reach in Haas, and 0 in Mid/Side or at Width 0. reset() empties the line and returns to patch 0. The class never reads the host’s tempo.

Limits shared by the family. A control that jumps, Width or Character, makes the output step: move it in small steps from the host if you need it smooth.

NAME = 'StereoWidener'

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().

INPUT_CEILING_DBFS = -6.03

Mid/Side at Width 2 doubles an anti-phase pair’s side, and 2 x 16 383 still fits.

Type:

Half of full scale, rounded down a step

MACRO_LABELS = ('Width', 'Delay', 'Character')

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: ('Haas 14 ms', (64, 91, 0)), 1: ('Haas Tight', (64, 62, 0)), 2: ('Haas Wide', (64, 111, 0)), 3: ('Haas Recentred', (96, 91, 0)), 4: ('Mid/Side Wide', (96, 91, 127)), 5: ('Mid/Side Narrow', (32, 91, 127)), 6: ('Mono', (0, 91, 127))}

_component.macro_of of the card’s patch settings.

macro(index)[source]

What macro index currently stands for, in its own units; for Delay, the milliseconds it plays.

property tail_samples

What this bound promises is in the class docstring.