audioeffects.ringmod

RingMod - Bode multiplier-type ring, with a switching character.

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

audioeffects.ringmod.TABLE_FRAMES = 256

One carrier period as a short waveform. Rate is Note.frequency, not this length over f_s. 256 is one palette block (~0.10 ms on the P4 as an extra source) and is why 2 Hz no longer asks for 24000 frames.

audioeffects.ringmod.carrier_gain(freq_hz, corner_hz)[source]

First-order high-pass amplitude at freq_hz for corner corner_hz.

audioeffects.ringmod.bandlimited_odd(phase, freq_hz, sample_rate, shape)[source]

Sine at shape 0; odd-harmonic chopper truncated below 0.45·f_s at 1.

class audioeffects.ringmod.RingMod(source, *options, **keywords)[source]

Bases: Component

A ring modulator after Harald Bode’s: your signal is multiplied by a carrier, so at Depth 1 the pitches you played vanish and only their sum and difference with the carrier remain, metallic and out of key.

Controls. Frequency sets the carrier, and stops short of 0.45 times the sample rate. Depth blends the carrier with a steady level: at 1 your signal is gone and the two sidebands come out level with each other, at 0.5 it is textbook AM, your signal 6 dB over each sideband, and at 0 the class is a wire. Mix sets the result against your signal, and Mix 0 is a wire too. The Effect controls page lists what the knobs span.

Character and Shape. Character switches the carrier from Bode’s multiplier to his switching chopper. Shape then moves the chopper from a sine, where it sounds just like the multiplier, to a band-limited square whose odd harmonics add sidebands of their own: at Shape 1 the third harmonic’s pair sits about 9.5 dB under the main pair. While Character is on the multiplier, Shape does nothing.

Letting your signal through. Balance and Program Bal each add a steady offset to the carrier, so your signal comes through under the ring: at 0.5 it is level with each sideband, to within 0.5 dB. They do the same thing.

Stereo and the low end. Stereo Phase shifts the right channel’s carrier against the left’s, and at 0 the two channels match. Carrier Low is a high-pass on the carrier and matters only with Frequency turned down near it: at its default 5 Hz, a 2 Hz carrier comes out about 8.6 dB under a 200 Hz one.

Controls that do nothing. Squelch, Threshold and Release do not change the sound: the output is the same sample for sample wherever they sit.

Levels. At Depth 1 the ring comes out about 9 dB under your signal, and on every patch the output peaks at least 3 dB under the input.

Timing. Latency is zero at every setting, and so is the tail: silence in is silence out.

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

NAME = 'RingMod'

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

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

MACRO_LABELS = ('Frequency', 'Depth', 'Mix', 'Shape', 'Balance', 'Program Bal', 'Squelch', 'Threshold', 'Release', 'Carrier Low', 'Stereo Phase', 'Character')

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 carrier again: its 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.