audioeffects.analogdelay

AnalogDelay - a bucket-brigade delay whose Time knob is its clock.

The player’s text is the class docstring, and every sentence in it that makes a claim is tied to a test by the CLAIMS table in the class’s test file.

audioeffects.analogdelay.SINGLE_LINE = 'single-line'

one MN3005 on the DM-2, two in series on the Deluxe Memory Man.

Type:

The characters and their stage counts (dossier section 6)

audioeffects.analogdelay.CORNER_PER_STAGE_SECOND = 0.2211

sinc(x) is -3 dB at x = 0.4422, so the corner is 0.4422 f_clk = 0.2211 N / T (dossier Appendix A).

audioeffects.analogdelay.TIME_MIN_MS = 20.0

20-600 ms, log, on both characters (the span is ours; dossier section 8.11).

Type:

The Time map, fixed on every instance

audioeffects.analogdelay.SWING_MAX_MS = 5.0

Modulation’s peak delay swing, ms, and Mod Rate’s span, Hz.

audioeffects.analogdelay.LINE_HEADROOM_MS = 6.0

the modulation’s peak swing, plus one for the node’s length - 2 clamp on the read (audiodsp_feedback_delay.c tap_for).

Type:

The line over max_time_ms

audioeffects.analogdelay.FEEDBACK_MAX = 0.99

157`).

Type:

The node’s own loop ceiling (`audiodsp_feedback_delay.c

audioeffects.analogdelay.TABLE_POINTS = 256

One period of the modulation’s triangle, borrowed by the node.

audioeffects.analogdelay.ECHO_TOLERANCE = 1e-09

How close a Time write must be to the constructor’s seed position to count as a host reading the knob back and writing it again, which keeps the constructor’s exact Time on the audio path.

audioeffects.analogdelay.triangle_table(points=256)[source]

Q15 unit triangle, one period: 0 -> +1 -> 0 -> -1 -> 0.

audioeffects.analogdelay.corner_hz(stages, time_ms)[source]

The sinc’s -3 dB point for stages at time_ms, before the clamp.

audioeffects.analogdelay.clock_slew(from_frames, to_frames)[source]

The node’s delay_slew for a clock step from a settled line: the walk runs |dT| / T_new delay-seconds per second, so it lasts exactly T_new and holds the ratio T_old / T_new (dossier section 6).

audioeffects.analogdelay.walk_floor(frames)[source]

The smallest delay_slew that still moves a read head sitting at up to frames: two single-precision steps of frames. The node walks delay_current += slew in single precision, and a slew under half a step of the head’s position rounds back to where it was, so the head would stay put for good (a move under about T / 2048 frames).

audioeffects.analogdelay.node_frames(value_ms, sample_rate)[source]

What the node makes of delay_ms = value_ms: the single-precision value * rate / 1000.0f (audiodsp_feedback_delay.c:148).

audioeffects.analogdelay.hand_off_ms(frames, sample_rate)[source]

The delay_ms the class hands the node for whole frame frames: frames * 1000 / fs in single precision, stepped up one single step where the node’s own arithmetic would land below frames, so the read’s whole part is frames (dossier section 6, the hand-off).

audioeffects.analogdelay.tone_excess(damping_hz, sample_rate)[source]

(frames, relative excess) for the loop low-pass, by DigitalDelay’s _tone_excess arithmetic: after frames frames whatever the state held weighs under 2^-17 LSB, and the single-precision state can rest up to 2^-24 / a of the peak above it, a being the coefficient.

class audioeffects.analogdelay.AnalogDelay(source, *options, **keywords)[source]

Bases: Component

A bucket-brigade delay whose Time knob is the line’s clock.

A bucket brigade has a fixed number of stages, so a longer delay is a slower clock and a lower band limit: the repeats get darker as you turn Time up, and your dry signal passes untouched.

The controls. Time sets the delay and with it the clock. Feedback sends each repeat round again. Mix blends the repeats in. Modulation and Mod Rate wobble the delay, a chorus in a blend and a vibrato with the repeats alone. Spread feeds each side’s repeats into the other. Sync locks Time to Division of the host’s beat, clamped to Time’s span. Time runs from 20 to 600 ms, Feedback from 0 to 0.99 and Mix from 0 to 2. Up to Mix 1 the dry passes untouched until the first repeat arrives. Mix 0 is a wire. A click comes out on the frame it went in: there is no latency. A one-channel source gets the same effect with Spread held at 0.

Two characters. "single-line" (the default) is one 4096-stage line, the Boss DM-2; "double-line" is two in series, the Deluxe Memory Man. Any other character raises ValueError. The repeats’ high-frequency corner is 0.2211 N / T for N stages and a Time of T seconds, so it halves each time Time doubles. Where the law passes 0.98 of Nyquist the corner holds there, so a shorter Time no longer brightens the repeats.

Time. Every Time lands on a whole frame at every rate. A small Time move still lands. Turning Time through several positions a block apart takes seconds to settle, where one jump to the same place lands within the new Time.

Modulation. The delay swings on a triangle by a fixed number of milliseconds, whatever the Time. A Time move leaves the swing as it is. A Modulation move glides over 20 ms.

Level and tail. Below Mix 1, an input peaking at or below floor(32767 (1 - Mix)) - 1 does not reach the rail. Keep the input under -6 dBFS and the defaults and patches stay off the rails. tail_samples is an upper bound on how long the repeats take to reach exact zero after your input stops. reset() empties the line and returns to patch 0. With no host tempo, Time stays on the knob.

What it leaves out. There is no sample-and-hold, so the repeats have no null at the clock. There is no fixed anti-alias pair: the repeats’ one corner is the one that moves with Time.

Limits shared by the family. A control that jumps makes the output step: move it in small steps from the host if you need it smooth. When your source ends, the tail rings out as it would on silence.

NAME = 'AnalogDelay'

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 = ('tempo_sync',)

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

INPUT_CEILING_DBFS = -6

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

MACRO_LABELS = ('Time', 'Feedback', 'Mix', 'Modulation', 'Mod Rate', 'Spread', 'Sync', 'Division')

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: ('Single Line Repeats', (101, 51, 25, 0, 69, 0, 0, 51)), 1: ('Short Bright Repeats', (41, 38, 32, 0, 69, 0, 0, 51)), 2: ('Long Dark Repeats', (124, 71, 25, 0, 69, 0, 0, 51)), 3: ('Modulated Repeats', (107, 58, 29, 76, 75, 0, 0, 51)), 4: ('Wet Vibrato', (26, 0, 127, 51, 115, 0, 0, 51)), 5: ('High Feedback Wash', (116, 109, 22, 25, 52, 64, 0, 51)), 6: ('Dotted Eighth, Synced', (101, 58, 25, 0, 69, 0, 127, 68))}

_component.macro_of of the dossier’s section 6 settings; patch 0 is the constructor’s defaults on the grid.

reset()[source]

Clear every node this class built, tail first, and restore patch 0. The borrowed source is never named here.

property tail_samples

Frames until the output is exactly zero once the input stops, as an upper bound: laps_to_zero(f, excess) laps of the longest delay the read head may be at, plus the modulation’s peak swing in frames rounded up, plus one frame for the interpolated read, plus the loop low-pass’s memory. Finite at every setting the class reaches.