audioeffects.autopan

AutoPan - an auto-panner: a pan law under an LFO.

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

class audioeffects.autopan.AutoPan(source, *options, **keywords)[source]

Bases: Component

An auto-panner: an LFO sweeps your signal between the speakers, with a new pan position on every sample, under a pan law.

The controls. Rate is the sweep’s speed. Depth is how far it swings: at Depth 1 it reaches each side, where the far speaker is silent, and at Depth 0 the output is the input. Shape runs the sweep from a triangle at 0 to a sine at 1. Law is how far the centre dips; at 3.01 dB the power holds steady across the sweep. Centre moves the middle of the sweep towards one side. Phase moves where the sweep starts: at 0 it starts on the left. With Sync on, Rate snaps to the nearest of one, two, four or eight sweeps a beat of the host’s tempo; with no host tempo, Rate stays where the knob is. The Effect controls page lists what the knobs span.

Levels. The sweep sits 6 dB under your source: hard over, the near speaker plays it at half level. A mono source passes untouched, and silence in is silence out.

Timing. Latency is zero at every setting, and so is the tail: nothing looks ahead and nothing rings on.

On a board. The class needs audiodsp’s audiomath, and on a board without it construction raises ImportError.

NAME = 'AutoPan'

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

TABLE_FRAMES = 1500

One LFO period as a short waveform. Rate is the note frequency, not this length over f_s. 1500 makes the synthio DDS exact at 2 / 5 / 20 Hz on 48 kHz (375 × 4; A6 extremes land on samples).

LAW_POWER_DB = 3.010299956639812

Centre attenuation of the constant-power law, 10*log10(2) dB.

LAW_LINEAR_DB = 6.020599913279624

Centre attenuation of the linear / mono-safe law, 20*log10(2) dB.

SYNC_BEATS = (1.0, 0.5, 0.25, 0.125)

Beats per pan cycle when Sync is on, longest first. At 120 BPM these are 2-16 Hz, covering the Rate span without leaving it.

MACRO_LABELS = ('Rate', 'Depth', 'Shape', 'Law', 'Centre', 'Phase', 'Sync')

Knob names, one per macro index; one mode per label; the private engineering spans behind them; and the patches on the 0-127 grid.

reset()[source]

Clear every node, restore patch 0 and start the LFO again: the notes on the modulating synthio.Synthesizer played on through the walk, a block ahead, so patch 0 now builds a fresh one, as a fresh instance does.