audioeffects.pingpongdelay
PingPongDelay - repeats that alternate between the speakers.
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.pingpongdelay.TIME_MIN_MS = 20.0
20-1000 ms, log.
- Type:
The Time span, fixed on every instance (dossier section 6)
- audioeffects.pingpongdelay.LINE_HEADROOM_MS = 1.0
the node clamps a delay at
line_frames - 2(audiodsp_feedback_delay.c:148-150), so a line of exactlymax_time_mscould not reach it.- Type:
The line’s headroom over
max_time_ms
- audioeffects.pingpongdelay.FEEDBACK_MAX = 0.99
157`).
- Type:
The node’s own loop ceiling (`audiodsp_feedback_delay.c
- audioeffects.pingpongdelay.TONE_MIN_HZ = 800.0
The Repeat Tone and Repeat Cut spans’ corners, Hz. Tone’s top stop and Cut’s bottom stop are the filters out of circuit.
- audioeffects.pingpongdelay.SLEW = 0.1875
3/16, exact in float32 (dossier section 8.5,
SlapbackDelay’s section 8 answer 6).- Type:
The fixed Time walk, delay-seconds per second
- audioeffects.pingpongdelay.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: 1e-6 is 1/7 874 of one MIDI step.
- audioeffects.pingpongdelay.DEFAULT_TIME_MS = 280.0
Time, Feedback, Mix, Spread, Division.
- Type:
The constructor defaults NaN falls back to
- class audioeffects.pingpongdelay.PingPongDelay(source, *options, **keywords)[source]
Bases:
ComponentTwo delay lines crossed into each other: the repeats bounce between the speakers.
Your dry signal passes untouched on both sides, and the repeats come back one side and then the other, all the way down.
The controls. The first repeat comes back Time later on the side First Side names, the next Time after that on the other side, and they keep bouncing, each a Feedback’s worth quieter than the last. Time runs from 20 to 1000 ms and Feedback from 0 to 0.99. Mix is the echo level: the dry stays at unity up to Mix 1, Mix 2 is the repeats alone, and at Mix 0 the output is the input. Spread moves between two plain delays with the same repeats on both sides, at 0, and the full bounce, at 1. At Spread 1 each repeat is on one side only, and the other side is exact zero. With Sync on, Time is Division of the host’s beat, up to 1000 ms; with no host tempo, Time stays where the knob is. The class reads the host’s transport only while Sync is on, and then only when a control moves, a patch loads or the host calls
transport_changed(), never while it plays. Repeat Tone is a low-pass and Repeat Cut a high-pass inside the loop, so each bounce is a little darker or thinner than the last. Repeat Tone’s top stop and Repeat Cut’s bottom stop take them out, and a filter taken out is out. At 22.05 kHz the top positions of Repeat Tone sit on one clamp below Nyquist and sound the same. Turning Time walks the repeats to the new Time, bending their pitch, instead of clicking.Stereo and mono. At Spread 1 the loop hears the average of the two input channels, so what differs between them never repeats. The dry is always each channel’s own signal, never swapped or summed. A one-channel source gets an ordinary feedback delay at the same Time, Feedback and Mix, and Spread and First Side do nothing there.
Where it stops. At 48 kHz every Time position lands on the nearest whole frame. At 44.1 and 22.05 kHz the node lands some positions a fraction of a frame off, and a sliver of each repeat falls on the frame beside it. The dry sits at unity and the repeats add to it, so a hot input can reach the int16 rail. With Repeat Cut out and Mix below 1, an input that peaks at or below floor(32767 (1 - Mix)) - 1 cannot reach the rail, at any Time, Feedback or Spread. Repeat Cut’s high-pass overshoots, so with it in leave more room. Keep the input under -6 dBFS and the defaults and patches stay off the rails.
Limits shared by the family. Mix walks a jump over 20 ms, but any other 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. A click comes out on the frame it went in: there is no latency.
tail_samplesis an upper bound on how many frames the output takes to reach exact zero, counted from when your input stops or from when you read it if that is later, for the settings as they stand when you read it. With Repeat Cut in circuit the bound is twice as many repeats as with it out, a margin measured rather than derived. Pass a lowermax_time_msfor a shorter line: Time then stops at that ceiling, andget_macro(0)shows where it stopped. A constructor value outside a knob’s span clamps to the nearer stop, atone_hzorcut_hzof 0 or less is that filter out, and NaN takes the option’s default.reset()empties the line and returns to patch 0. The class needs audiodsp’saudioecho, and on a board without it construction raisesImportError.- NAME = 'PingPongDelay'
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, patch 3 rails on a DC step.
- MACRO_LABELS = ('Time', 'Feedback', 'Mix', 'Spread', 'First Side', 'Sync', 'Division', 'Repeat Tone', 'Repeat Cut')
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 Bounce', (86, 58, 19, 127, 0, 0, 51, 127, 0)), 1: ('Eighth Note Bounce', (86, 64, 19, 127, 0, 127, 51, 127, 0)), 2: ('Quarter Note Bounce', (86, 51, 19, 127, 0, 127, 76, 127, 0)), 3: ('Narrow Bounce', (86, 58, 19, 64, 0, 0, 51, 127, 0)), 4: ('Two Delays', (86, 58, 19, 0, 0, 0, 51, 127, 0)), 5: ('Dark Bounce', (99, 83, 19, 127, 0, 0, 51, 48, 0)), 6: ('Right First', (86, 58, 19, 127, 127, 0, 51, 127, 0))}
_component.macro_ofof 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, each at most one frame longer than the longest delay the read head may be at (the read interpolates towards the next older frame), plus the Tone low-pass’s memory. While a walk falls, that is the Time it is walking from, until a reset lands the head. The cross-feed hands each lane a convex mix of the two lanes’ loop values (audiodsp_feedback_delay.c:581-589), so the per-lap argument holds at every Spread. With Repeat Cut in, the laps are countedCUT_LAP_FACTORtimes, asDigitalDelaycounts them: the high-pass can lift a lap’s peak above the last one’s, and that margin is measured, not derived.