audioeffects.tapedelay

TapeDelay - a tape echo with two transports: the Roland RE-201’s motor and the Maestro EP-3’s sliding head.

Your dry signal passes untouched, and the repeats follow it off a loop of tape, each one a little darker than the last.

Controls. Time is the delay, from 20 to 1200 ms, and Feedback is how much of each repeat goes round again, up to 0.99. Mix is the echo return: the dry stays at unity up to Mix 1, Mix 2 is the repeats alone, and at Mix 0 the output is the input. Spacing is how far the worn head sits off the tape: more spacing, darker repeats. Wow and Flutter are the transport’s slow and fast wobble. Record Level drives the tape harder, a soft squash on every pass. Spread feeds each channel’s repeats into the other, and does nothing on a mono source. With Sync on, Time is Division of the host’s beat; with no host tempo, Time stays where the knob is.

Two characters. character="varispeed", the default, is the RE-201: Time moves the motor, so a Time move bends the pitch of everything on the tape instead of clicking, then settles. Glide does nothing on this character. character="sliding-head" is the EP-3: Time slides a head, so the pitch bends only while the head moves, at the rate Glide sets, and the tape runs at one speed, so the darkening does not follow Time. Glide 0 is an instant slide, and its price is a click.

Where the pitch bend stops. A Time move made while the last one is still bending takes its rate from the last Time you set, not from where the tape has got to, so it does not telescope as a real motor would. A long rising move, or a rising slide at the fastest Glides, can read more than 10 cents off the ideal bend, because the node walks its read head in single precision.

The tape. The wobble is periodic, not random. A Wow or Flutter move glides in, whether it changes how deep the wobble is or the balance between them: a new balance takes the wobble out and brings it back in the new shape. The darkening follows the tape’s loss law only up to a band top that rises with the tape’s speed. Record Level has no memory: tape hysteresis is not modelled. The RE-201’s Bass and Treble are not here. Keep the input under -6 dBFS and the defaults and patches stay off the rails.

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.

Latency, tail, portability. Latency is zero samples: nothing looks ahead. tail_samples is an upper bound on how long the output takes to reach exact zero once your input stops, at every Feedback and Spread, stereo and mono. Pass a lower max_time_ms for a shorter line: Time then stops at that ceiling, and get_macro(0) shows where it stopped. The class needs audiodsp’s audioecho, and on a board without it construction raises ImportError. character must be "varispeed" or "sliding-head".

Cost. Measured at v0.6.2 at the default and every patch, the full class costs 0.551-0.608 ms a block on the P4 and 1.056-1.093 ms on the S3, over the budgets of 0.480 ms and 0.800 ms. Measured at v0.6.2, patch 8 on a class built with max_time_ms=800 costs 0.445-0.455 ms on the P4 and 0.781-0.797 ms on the S3, inside both budgets. reset() returns to patch 0, so a host that wants the lean patch sets it again after a reset.

audioeffects.tapedelay.TIME_MIN_MS = 20.0

20-1 200 ms.

Type:

The Time map, fixed on every instance (dossier section 6)

audioeffects.tapedelay.FULL_RANGE_MS = 1180.0

Glide is the time a full-range Time move takes on sliding-head; the node’s delay_slew is FULL_RANGE_MS / glide_ms (dossier section 6).

audioeffects.tapedelay.GLIDE_MIN_MS = 1200.0

The Glide knob’s span, log, with grid 0 the jump.

audioeffects.tapedelay.SLEW_PIN = 0.99

At slew 1 a rising Time stands the read head still. A constructor Glide under 1 191.9 ms is pinned here; no grid position gets there (grid 1 is 1 222.0 ms, slew 0.966).

audioeffects.tapedelay.GLIDE_FLOOR = 0.007874015748031496

The Glide knob’s position for a constructor Glide faster than grid 1: grid 1 itself, never grid 0, the jump (DigitalDelay’s GLIDE_FLOOR).

audioeffects.tapedelay.FEEDBACK_MAX = 0.99

157`).

Type:

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

audioeffects.tapedelay.LINE_HEADROOM_MS = 5.0

one frame for the node’s line_frames - 2 clamp (audiodsp_feedback_delay.c:148-150) plus the wow table’s largest excursion, 3.096 ms at the Wow and Flutter stops, rounded up (dossier Tier 3).

Type:

The line’s headroom over max_time_ms

audioeffects.tapedelay.GAP_M = 5e-06

S3 eq. (13)’s play gap and tape thickness, metres (dossier section 6).

audioeffects.tapedelay.SPACING_MIN_UM = 2.0

The Spacing knob, micrometres, log.

audioeffects.tapedelay.V_FAST = 0.4

40 cm/s at Time 180 ms and below, 12 cm/s at 600 ms and above, 40 x 180 / T between (fixed heads: T is inversely v). Sliding-head: the Echoplex’s roughly 8 ips.

Type:

The speed law (dossier section 6). Varispeed

audioeffects.tapedelay.WOW_HZ = 0.01

one period of TABLE_POINTS Q15 points at WOW_HZ, holding the wow line at harmonic WOW_HARMONIC, the flutter line at FLUTTER_HARMONIC and the drift at harmonics 1-9, amplitude 1/k, at DRIFT_PHASES (dossier section 6). TABLE_POINTS is not a cost lever. The node reads any length the same way, and a shorter table silently kills the flutter: at 1 024 points harmonic 512 sits on the table’s Nyquist, at 256 it folds onto DC, and the Flutter knob then writes the same table as Flutter 0 while T4 still reads two lines, an interpolation image of the wow line (the 2026-09-28 cost study).

Type:

The wow table

audioeffects.tapedelay.DRIFT_PER_WOW_CENT_MS = 0.25

The drift’s peak excursion, ms per cent of Wow.

audioeffects.tapedelay.ECHO_TOLERANCE = 1e-06

How close, as a 0..1 knob position, a Time write must come to the constructor’s own seeded position to count as a host echoing it back.

audioeffects.tapedelay.DEFAULTS = (350.0, 0.45, 0.35, 6000.0, 2.0, 1.0, 0.2, 5.0, 0.0, 0.0, 6.0)

The constructor defaults, which NaN falls back to.

audioeffects.tapedelay.eq13_gain(k, spacing_m)[source]

S3 eq. (13), one pass, as a linear gain at wavenumber k (rad/m): spacing e^(-k d), thickness (1 - e^(-k delta)) / (k delta) and gap |sinc(k g / 2)|, at GAP_M and THICK_M.

audioeffects.tapedelay.k3_of(spacing_m)[source]

The wavenumber at which eq. (13) is at half power (-3.01 dB), by bisection in log k: 15 967 rad/m (393.5 um) at 5 um.

audioeffects.tapedelay.speed(character, time_ms)[source]

Tape speed, m/s, for a character at a Time (dossier section 6).

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

(frames, relative excess) for the loop low-pass at damping_hz (already pre-warped): after frames frames whatever its state held weighs under 2^-17 of it, and its single-precision state can rest up to 2^-24 / a above the line’s peak, a being the coefficient. DigitalDelay’s _tone_excess, as a function of the handed value.

audioeffects.tapedelay.slew_of(glide_ms)[source]

Sliding-head’s delay_slew for a Glide: 0 (the jump) at Glide 0, otherwise 1 180 ms over glide_ms, pinned at 0.99.

audioeffects.tapedelay.varispeed_slew(from_ms, to_ms)[source]

The tape equation for a speed step from a settled transport: dT/dt = 1 - T_old / T_new, so the walk runs |dT| / T_new delay-seconds per second and lasts exactly T_new (S4 eq. 3).

audioeffects.tapedelay.cents_to_depth_ms(cents, line_hz)[source]

A delay D sin(2 pi f t) ms moves pitch by a peak ratio of 1 + 2 pi f D / 1000, so cents peak is D = (2^(cents/1200) - 1) / (2 pi f) x 1000: 8 cents of the 0.72 Hz line is 1.024 ms, 4 cents of the 5.12 Hz line 0.072 ms.

audioeffects.tapedelay.wow_table(wow_cents, flutter_cents, out, flutter_harmonic=512, drift=True)[source]

Write the wow table for (Wow, Flutter) into out, an int16 array of TABLE_POINTS, and return its peak excursion in ms, which is the node’s wow_depth_ms; 0.0 (and out untouched) with nothing to write.

The wow line’s peak is cents_to_depth_ms(wow, 0.72 Hz), the flutter line’s cents_to_depth_ms(flutter, 5.12 Hz) and the drift’s 0.25 ms per cent of Wow; the table is their sum normalised to its own peak.

class audioeffects.tapedelay.TapeDelay(source, *options, **keywords)[source]

Bases: Component

A tape echo with the RE-201’s motor or the EP-3’s sliding head. The module docstring is the player’s manual.

NAME = 'TapeDelay'

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', 'Glide', 'Wow', 'Flutter', 'Record Level', 'Spacing', '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: ('Warm Repeats', (89, 58, 22, 89, 32, 32, 25, 51, 0, 0, 51)), 1: ('Long Repeats, Slow Glide', (114, 71, 22, 127, 32, 32, 25, 51, 0, 0, 51)), 2: ('Short Slap', (47, 19, 32, 89, 16, 16, 25, 51, 0, 0, 51)), 3: ('Dark Repeats, Heavy Wow', (97, 71, 22, 89, 95, 64, 25, 111, 0, 0, 51)), 4: ('High Intensity', (93, 115, 25, 89, 32, 32, 76, 51, 0, 0, 51)), 5: ('Worn Heads', (89, 58, 22, 89, 64, 95, 64, 127, 0, 0, 51)), 6: ('Clean Transport', (89, 58, 22, 89, 0, 0, 0, 0, 0, 0, 51)), 7: ('Dotted Eighth, Synced', (89, 58, 22, 89, 32, 32, 25, 51, 0, 127, 68)), 8: ('Tape Delay - lean', (89, 58, 22, 89, 32, 32, 0, 51, 0, 0, 51))}

_component.macro_of of the dossier’s section 6 settings; patch 0 is the constructor’s defaults on the grid. Patch 8 is patch 0 with Record Level at 0, the board’s lean patch (with max_time_ms=800; the module docstring’s Cost).

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 wow table’s peak excursion 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, stereo and mono, at every Spread.