audioeffects.multitapdelay
MultiTapDelay - one recording read by several heads on a fixed grid.
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. How it works, and why, is in the docstrings of _route, _wire and
_resync below.
- audioeffects.multitapdelay.TIME_MIN_MS = 20.0
Section 6’s spans, fixed on every instance.
- audioeffects.multitapdelay.TILT_DB = 12.0
Tilt’s span in dB from head 1 to head K at |Tilt| = 1 (ours).
- audioeffects.multitapdelay.MAX_LAP_MS = 1600.0
400 ms x four heads by default, and never under 540 ms, where every Heads keeps Time alive and its span at 3.33 : 1 or more.
- Type:
max_lap_ms
- audioeffects.multitapdelay.BLOCK = 256
The block every node renders, in frames.
- audioeffects.multitapdelay.LAG = 256
How far the tap node’s own timeline runs behind the dry, in frames, and so how much shorter than k n1 each head’s offset is handed (
_route). Every offset k n1 - LAG must be at least one frame: an offset of 0 reads the line a whole lap back, and a negative one is a position the node refuses. The shortest head is Time’s 20 ms, and the lap clamp never lands n1 below it, so that holds exactly where 20 ms lands on more than LAG frames: at MIN_SAMPLE_RATE and above (257 frames at 12 825 Hz, 441 at 22.05 kHz). The class refuses a lower rate at construction.
- audioeffects.multitapdelay.MIN_SAMPLE_RATE = 12825
the least whole rate at which Time’s 20 ms lands on more than LAG frames, floor(20 fs / 1000 + 0.5).
- Type:
The lowest sample rate the class accepts
- audioeffects.multitapdelay.HEAD_SETS = ((1,), (2,), (3,), (1, 2), (2, 3), (1, 3), (1, 2, 3), (1, 4), (3, 4), (1, 3, 4), (1, 2, 4))
S1’s
Head Combinations for Each Mode, modes 1-11. Mode 12 is every head on the plain grid (section 8.3), so it is not in the table.
- audioeffects.multitapdelay.DIVISION_BEATS = (0.125, 0.16666666666666666, 0.1875, 0.25, 0.3333333333333333, 0.375, 0.5, 0.6666666666666666, 0.75, 1.0, 1.3333333333333333, 1.5, 2.0, 2.6666666666666665, 3.0, 4.0)
1/32, 1/16T, 1/32., 1/16, 1/8T, 1/16., 1/8, 1/4T, 1/8., 1/4, 1/2T, 1/4., 1/2, 1/1T, 1/2., 1/1 (
DigitalDelay’s).- Type:
Division’s sixteen note values, in quarter-note beats, rising
- audioeffects.multitapdelay.DECAY_MARGIN = 1.52587890625e-05
The tap node truncates every sample it sends round toward zero; the tail bound reckons with a decay this much larger, relatively, so a board’s single-precision arithmetic can only lengthen it.
- audioeffects.multitapdelay.f32(value)[source]
valuerounded to single precision: exact emulation on a desktop, the identity on a board, whose float already is one.
- audioeffects.multitapdelay.lap_node_frames(value_ms, sample_rate)[source]
The lap node’s own arithmetic for a
delay_msit is handed,value * rate / 1000.0fin single precision (audiodsp_feedback_delay.c:148at v0.6.3rc1).
- audioeffects.multitapdelay.lap_node_ms(lap, sample_rate)[source]
The
delay_msthe lap node is handed for a lap oflapframes: the least single-precision value whose frames, the node’s way, are at or overlap. From float32(lap 1000 / fs), step up one float32 unit while the frames are under; if the start is already over, step down while the next value down is still at or over.
- audioeffects.multitapdelay.head_set(mode, heads, table=((1,), (2,), (3,), (1, 2), (2, 3), (1, 3), (1, 2, 3), (1, 4), (3, 4), (1, 3, 4), (1, 2, 4)))[source]
Pattern mode 1-12 on a grid of
headsheads -> the heads that sound, rising. Mode 12 is every head 1 … K.
- audioeffects.multitapdelay.head_levels(selected, heads, tilt)[source]
Tilt’s law: a straight line in dB across the grid,
TILT_DBx Tilt from head 1 to head K, far heads louder for Tilt > 0, with the loudest sounding head at exactly 1.0.
- audioeffects.multitapdelay.landed(time_ms, heads, sample_rate, max_lap_ms)[source]
(n1, P) in frames: the base on the nearest whole frame, clamped so the lap P = K n1 fits
max_lap_ms.
- audioeffects.multitapdelay.trunc_laps(decay)[source]
Laps of the tap node’s own loop to exact zero from full scale. Once the input stops it writes
(int32_t)(delayed * decay)(audiodsp_multitap.c:32at v0.6.3rc1), which truncates toward zero, so a peak x goes to floor(x d) < x and the count is finite at every decay.
- audioeffects.multitapdelay.tone_excess(damping_hz, sample_rate)[source]
DigitalDelay._tone_excessfor a pre-warpeddamping_hz: (memory frames, relative excess) of the lap node’s loop low-pass, (0, 0.0) with it out.
- class audioeffects.multitapdelay.MultiTapDelay(source, *options, **keywords)[source]
Bases:
ComponentA multi-head echo: one recording read by several heads on a grid.
The heads of a multi-head tape echo, after the Roland Space Echo’s multi-head modes: your dry signal passes untouched, and a pattern of echoes follows it.
The controls. Time is the gap to head 1, landed on a whole frame, and head k sounds at exactly k times that gap. Heads is how many heads the grid has, and the pattern repeats once per trip past the farthest of them. Pattern picks which heads sound, from the twelve positions of the Roland RE-202’s mode selector. Its last position sounds every head on the grid, not the RE-202’s unpublished positions. The lap is the farthest head on the grid, sounded or not, so heads past the ones a position sounds lengthen the lap without sounding. Feedback sends the pattern round again, each lap quieter. Repeat Tone darkens each lap a little more than the one before, once per lap, never once per head. Tilt leans the pattern’s levels towards the near heads or the far ones. Up to Mix 1 the dry passes at unity, and at Mix 2 the echoes play alone. At unity the dry is exact to the sample, mono and stereo, right up to the rails, on every interpreter. Keep the input under -6 dBFS and the defaults and patches stay off the rails. Mix 0 is a wire. Sync locks Time to Division of the host’s beat, clamped to Time’s span. With no host tempo, Time stays on the knob. Time runs from 20 to 400 ms, Heads from 3 to 8, Feedback from 0 to 0.95 and Mix from 0 to 2.
max_lap_ms(1600 by default, 540 at least) caps the lap: where a grid would pass it, Time comes down to fit. A click comes out on the frame it went in: there is no latency. A one-channel source gets the same effect on its one channel. The sample rate must be at least 12 825 Hz: below it the constructor raisesValueError.Reset, Mix at zero and the tail. The lines are not fed while Mix is 0, so a return from Mix 0 starts both lines empty.
reset()empties both lines and returns to patch 0. Neither a reset nor a trip to Mix 0 drops a frame of your source or plays one twice, whatever size of buffer it hands out.tail_samplesis an upper bound on how long the echoes take to reach exact zero once your input stops. The tail rings on while your source hands back nothing.On a board. Measured at v0.6.3, patch 4 costs 5.567 ms a block on the ESP32-S3, where a block lasts 5.333 ms, so it needs a P4-class board: the ESP32-P4 runs it in 3.865 ms. Patch 3 costs 4.163 ms on the ESP32-S3, inside the 4.267 ms budget, and may need a P4-class board too, especially when the board is running anything else.
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.
- NAME = 'MultiTapDelay'
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.
CAPABILITIESnames"tempo_sync"if and only if the class readsself._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', 'Pattern', 'Heads', 'Feedback', 'Mix', 'Tilt', 'Repeat Tone', '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: ('Three Heads, Even', (85, 69, 0, 60, 22, 64, 68, 0, 25)), 1: ('Three Heads, Even - lean', (85, 69, 0, 60, 22, 64, 127, 0, 25)), 2: ('Two Heads, Near Loudest', (93, 35, 25, 67, 22, 32, 68, 0, 25)), 3: ('Four Heads, Far Loudest', (55, 127, 25, 67, 22, 96, 78, 0, 25)), 4: ('Eight Heads, Dense', (29, 127, 127, 74, 19, 64, 56, 0, 25)), 5: ('One Head, Long Repeats', (76, 23, 0, 94, 22, 64, 48, 0, 25)), 6: ('Triplet Grid, Synced', (85, 69, 0, 60, 22, 64, 68, 127, 34))}
_component.macro_ofof the dossier’s section 6 settings; patch 0 is the constructor’s defaults on the grid.
- reset()[source]
Empty both lines and restore patch 0, without pulling the borrowed source (
_route).
- property tail_samples
Frames until the output is exactly zero once the input stops, as an upper bound.
Repeat Tone in:
laps_to_zero(f', excess) x (P + 1 + memory) + P,DigitalDelay’s bound for the lap node at the Feedback it is handed, plus one lap for the tap node’s line to be read out. Repeat Tone out:(trunc_laps(f) + 1) x P, the tap node’s own truncating loop. Finite at every setting.