audioeffects.octaver
Octaver - the analog octave-down.
The player’s text is the class docstring; the CLAIMS table in the class’s
test file ties its claim sentences to tests. How the graph works is told
where it is built, in Octaver._build.
- audioeffects.octaver.DEFAULTS = (1.0, 0.7, 0.0, 90.0, 324.0, 70.3, -80.0)
The constructor defaults, which NaN falls back to (patch 0).
- audioeffects.octaver.CURVE_POINTS = 4097
4097 points over the shaper’s -1..1, exact zero across |i - 2048| <= 7, a tick of +-TICK out to |i - 2048| = 63, and the rails beyond. Interpolating between two points of a one-point step is a gain stage, which leaks an octave up and DC below Sensitivity; a dead band many points wide reads exact zero.
The rails are Sensitivity: only they reach the octave. The ticks clock the dividers 18 dB under it, so a clock whose peaks are unequal (a second harmonic the tracking low-pass left, or the last few LSB of a quiet one) has crossed both sides by the time either side reaches a rail. Clocked on the rails alone, such a clock crossed one rail and not the other: the divider never turned over, and the signal times its one-sided pulses was the dry note itself.
- Type:
The comparator’s table
- audioeffects.octaver.EDGE = 0.03125
The comparator reaches the rail where its input times
pre_gainis 64/2048, sopre_gain = EDGE / 10^(Sensitivity/20)puts the rail at the clock’s level of Sensitivity. 1/32 is exact in every float format.
- audioeffects.octaver.CLOCK_Q = 0.5
two sections of 0.5 are four coincident real poles, whose phase a two-stage first-order all-pass matches exactly.
- Type:
The clock filters’ Q
- audioeffects.octaver.MEAN_HZ = 20.0
three first-order low-passes at MEAN_HZ in a row, which
_centretakes out of the clock before the comparator. A direct offset in the input passes the Tracking low-pass whole where a high note’s fundamental does not, so the comparator’s zero sat outside the clock; with the mean taken out the zero follows the clock’s own centre. Each pole is an all-pass at half mix, which is exactly 1 at DC however low the corner (a low-pass biquad at 10 Hz is not: its coefficients round in single precision and its DC gain reads 0.90 to 1.24). Three poles make what is subtracted fall as the cube of the frequency, so the clock’s phase at the note moves by less than a degree (A2) and the square still turns over on the signal’s own crossings; a high-pass at the same corner would lead by 10 degrees there and move the octave’s level. The corner is a trade between two rows: the mean forgets the attack’s step in about 50 ms at 20 Hz, where at 10 Hz a note above the range (E5) kept a pulse in its clock past 125 ms and played for that long, and from 30 Hz the A2 decay’s spread and seed-7 level move.- Type:
The clock’s slow mean
- audioeffects.octaver.CLOCK_THRESHOLD = 3.0517578125e-05
one LSB, under TICK.
- Type:
The dividers turn over on the comparator’s ticks
- audioeffects.octaver.GATE_HALF = 1
the identity, with exact zero for |x| < 16 LSB, which takes the ticks out of the square and leaves its rails as they are.
- Type:
The table after each divider
- audioeffects.octaver.BLOCK = 256
Frames a mixer pull hands out, and so what every node and tap takes per pull: the palette’s own block, so the Splitters’ rings empty each pull.
- audioeffects.octaver.comparator_curve()[source]
The comparator’s table, built once and shared by every instance.
- audioeffects.octaver.pre_gain(sensitivity_db)[source]
The comparator’s input gain for a Sensitivity in dBFS.
- class audioeffects.octaver.Octaver(source, *options, **keywords)[source]
Bases:
ComponentAn octave down that is your own note: like the Boss OC-2, it turns every other cycle of what you play upside down, so the octave keeps your attack, your decay and your tone.
The controls. Direct is your own note’s level, and the Octave knobs set the octaves’. Tracking moves the range of notes the divider follows. Tone 1 and Tone 2 are two-pole low-passes at the hertz they show, on the first and second octave. Sensitivity is the level your note must keep after Tracking’s low-pass for the octaves to play, not the level you play at. The higher the note, the more that low-pass takes, so a quiet high note stops before a quiet low one: at patch 0 a sine at -60 dBFS still has its octave on E2 and none on E4. Constructor values land on the nearest of each knob’s 128 steps. The Effect controls page lists what the knobs span.
What you hear. The octave is exactly half your note and sounds within 2 ms of it. Octave 2 is Octave 1 divided again: two octaves down, not a fourth below the note, until Octave 1 itself stops. On an A2 the octave follows your note’s decay within 1 dB: it has no envelope of its own. Below Sensitivity the octaves are silent, with no ghost and no hum, and as a note fades into it the octave never turns into the note itself. With the Tones open the octave carries a fifth above it 4.4 dB quieter, as the pedal’s multiplication does, wherever Tracking is set. Turning Tone 1 down thins that fifth more on high notes than on low ones.
Its range. Played at -8.7 dBFS peak, every note at patch 0 from low E (E2) to A4 divides cleanly, even with a strong second harmonic. Played at -8.7 dBFS peak, the Bass patch covers E1 to G3, and High on the neck covers D3 to E5; played quieter, each range ends lower. Below the range a low note’s second harmonic clocks the divider and it skips; above it the clock is low-passed under Sensitivity and the octave goes silent. Between -90 and -84.5 dBFS Sensitivity changes nothing: that whole stretch is one step of the clock. A direct offset in the input, as a plucked string rings round, does not take the top of the range from you: the divider turns over on the clock’s own centre, not on zero.
Limits. It plays one note at a time: on a power chord (A2 and E3) about two fifths of the octave is intermodulation. A stereo source is clocked on its mid: with the right channel 45 degrees ahead of the left, the fifth sits 3.2 dB under the octave instead of 4.4, on both channels. The output can peak at about 5 times the input (a low square, all three levels at full with the Tones open), so keep the input under -15 dBFS. A control that jumps makes the output step: move it in small steps from the host if you need it smooth.
On an ESP32-S3, Both octaves can’t keep up and the sound breaks up; play Both octaves - lean instead. It has the same balance of your note and the two octaves, 2 dB louder: turn the level after it down 2 dB and you hear Both octaves.
Wire, latency, tail. With both octaves at 0 and Direct at 1 the output is the input, byte for byte, however the host’s buffers are cut. There is no latency.
tail_samplescovers the all-pass and the two Tone filters ringing down.reset()clears the filters and the dividers and returns to patch 0. The class never reads the host’s tempo.- NAME = 'Octaver'
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.
CAPABILITIESnames"tempo_sync"if and only if the class readsself._transport().
- INPUT_CEILING_DBFS = -15.0
a square near E2 with all three levels at full, the Tones open and Tracking at 40 Hz, over every semitone from E1 to A2 at both Tracking stops (the kit’s own 100 Hz square reads 3.75). -15 dBFS keeps it 1 dB inside full scale.
- Type:
The worst peak gain is 5.03
- MACRO_LABELS = ('Direct', 'Octave 1', 'Octave 2', 'Tracking', 'Tone 1', 'Tone 2', 'Sensitivity')
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: ('Octave down under the dry', (127, 89, 0, 45, 50, 24, 25)), 1: ('Both octaves', (102, 89, 89, 45, 50, 24, 25)), 2: ('Octaves alone, no dry', (0, 127, 76, 45, 50, 24, 25)), 3: ('Bass guitar', (127, 102, 0, 12, 39, 24, 25)), 4: ('High on the neck', (127, 89, 0, 89, 82, 24, 25)), 5: ('Two octaves down alone', (0, 0, 127, 45, 50, 24, 25)), 6: ('Both octaves - lean', (127, 111, 111, 45, 50, 24, 25))}
0.7 is 89, 0.8 is 102, 0.6 is 76; Tracking 90/50/200 Hz is 45/12/89; Tone 1 324/250/700 Hz is 50/39/82; Tone 2 70.3 Hz is 24; Sensitivity -80 dBFS is 25. Patch 6 is patch 1 with Direct at 1 and both octaves at 111 (0.874), the same balance 1.9 dB up. A mixer voice at exactly 1 passes its samples through with no multiply, which is the 0.07 ms an ESP32-S3 lacks for patch 1, where all three levels are under 1.
- Type:
_component.macro_ofof the card’s settings
- property tail_samples
The all-pass and both Tone filters ringing down, end to end.