PolyA6
The PolyA6 is a sixteen-voice poly synth inspired by the Alesis Andromeda A6: two oscillators per voice, each with its own sub-oscillator, hard sync, OSC 2 FM into OSC 1 (linear, exponential and pulse width), a ring modulator, shared noise, two filters per voice (a two-pole multimode and a four-pole transistor ladder) that run in parallel or in series, three envelopes, two LFOs, a sample and hold, unison, portamento and an analogue-style distortion. It adds no latency.
import audioinstruments._rack.adapter as adapter
inst = adapter.create(48000, voice="polya6") # sixteen voices; voices=N for fewer or more
audio_out.play(inst.output)
inst.program_change(1) # Brass Swell
for note in (48, 55, 60, 64):
inst.note_on(note, 100)
There are twelve patches: Init, Brass Swell, PWM Strings, Huge Pad, Unison Lead,
Sync Sweep, Ring Bells, FM Clang, Series Notch, Pluck Bass, S&H Steps and Noise Wind.
The ten macros are f2_freq, f2_res, f2_env2, f1_freq, f1_res, env3_attack,
env3_release, unison_detune, lfo2_rate and porta_time, each covering its
control’s whole range (exponentially for hertz and seconds). examples/polya6_demo.py
plays all twelve in turn and writes wav_exports/polya6_demo.wav.
The controls use the panel’s own units: levels 0 to 100, bipolar amounts -100 to
+100, semitones, cents, hertz and seconds. Every control is in polya6.SETTINGS, and
each patch is that list with a few controls changed. Pool controls (kb_mode,
unison, unison_detune, assign) go to the voice pool and bend_range to the
MIDI module; distortion and dist_level go to the output. For unison, mono mode
and the order voices are given out in, see polyphony.md.
Where the original’s panel says something, the page quotes it: the Andromeda A6 Reference Manual, version 1.40, Alesis, by the page numbers printed in it ([M]), and Sound On Sound’s April 2001 review ([SOS]). Everything else is a design choice and is marked as one.
The two filters
Each voice has two filters [M p.95, p.274]. Filter 1 is a two-pole (12 dB per
octave) multimode filter built on three synthio biquads, a low-pass, a high-pass and
a band-pass, with f1_freq (22 Hz up to 22 kHz [M p.128], held under 0.45 of the
sample rate) and f1_res (0 to 100, up to a Q of 24). The notch is the low-pass and
the high-pass added together [M p.124-125]. A biquad has no per-sample input, so
Filter 1’s cutoff moves once per block, from the cutoff CV at the last sample of
the block (design choice): a slow sweep is smooth, a fast envelope steps at the block
rate, and it takes no audio-rate FM. It does not self-oscillate. Filter 2 is a
four-pole (24 dB per octave) transistor ladder whose cutoff CV is read every
sample, so it takes audio-rate FM from the oscillators (f2_fm). At f2_res 100 it
self-oscillates at its cutoff [M p.121]; F2_RES_TOP (1.05) is the ladder’s resonance
at that setting, a little above the ladder’s own 1.0 because it starts to sing only
just under it (design choice). Its top frequency is the ladder’s own limit (design
choice; the original’s goes to 44.7 kHz).
Each filter has a keyboard tracking amount: at 50 the cutoff follows the key by one octave per octave, as the original’s 1 volt per octave [M p.121, p.129]. The reference key is C4 (design choice).
f2_input picks what Filter 2 hears [M p.124-125]:
|
Filter 2 hears |
Routing |
What reaches the output |
|---|---|---|---|
|
The pre filter mix |
Parallel |
Whatever the |
|
Filter 1’s low-pass and high-pass, at their |
Series |
Those two knobs no longer reach the output: only Filter 2 does |
|
Filter 1’s band-pass at unity |
Series |
|
|
Nothing |
Filter 2 is silent |
Filter 1 runs only the sections that are heard or feed Filter 2, and a voice renders only the oscillators, subs, ring, envelopes and LFOs that something is listening to. The Init patch runs neither biquad.
Kept and folded
The original is very deep: a 79-source modulation matrix, seven-stage envelopes, a 16-stage tracking generator and 28 digital effects. The PolyA6 keeps its voice and folds the rest.
Original |
In the rack |
Why |
|---|---|---|
16 voices, poly or mono, unison 2-16, detune, assign lowest or rotary |
Kept: |
The voice pool has all four [M p.55-57] |
UNISON STACK, MONOVX, mix mode |
Left out |
Stack changes with the notes held; the rest is per-part routing |
SEMITONE, CENTS, FINE |
Kept; FINE folded into fractional |
One knob for the same thing |
1PITCH (keyboard tracking off) |
Left out |
A drone feature |
Saw up or down, triangle, sine, square with width and level, all at once |
Kept |
The character of the VCO [M p.106] |
Sub-oscillator, a square an octave down |
Kept: |
A separate oscillator core per VCO [M p.184] |
Hard sync |
Kept: |
The core’s sync input [M p.115] |
Soft sync |
Left out |
No core does it |
ENV 1 amount to each VCO |
Kept as one level per VCO |
Two knobs say what a knob and a selector say |
OSC 2 FM: LINFM, EXPFM, PWM |
Kept as three knobs, always live |
[M p.109] |
The 79-source matrix and custom MODs |
Folded into fixed routes |
See the routing table |
Pre filter mix of six |
Kept |
[M p.183] |
Noise white, pink, red; external audio; filter feedback |
White and pink kept |
No red noise core, no audio input |
Filter 2 as a four-pole low-pass, self-oscillating |
Kept |
A transistor ladder core |
Each filter’s FREQ, RES, ENV 2, KEY TRACK |
Kept; the offsets folded |
|
Each filter’s CV input and three MODs |
Folded to fixed LFO 2 and S&H amounts, and FILTFM into Filter 2 only |
Filter 1 moves once a block |
Post filter mix, BP invert, the direct sines and ring, filter bypass |
Kept |
[M p.189] |
Voice PAN, MAIN and AUX |
Folded |
The pool spreads unison voices |
Three seven-stage envelopes |
Folded to three ADSRs, 2 ms to 30 s |
Delay, second stages, shapes and loops would need a new core |
VELMOD on each envelope |
Kept for ENV 2 and ENV 3 |
|
Three LFOs with six shapes |
Two, with the four shapes |
Random is the S&H; noise is the noise |
Portamento, OCTAVE and 1SPEED, LEGATO, curves |
One constant time, 1SPEED, on each voice [M p.59-60] |
The glide moves both VCOs and the key tracking |
Pitch wheel range and per-VCO switches |
One range, a switch per VCO |
The adapter’s bend has one range |
Mod wheel into LFO 1 on both VCOs |
Kept: |
The original’s default routing [M p.198] |
Analogue distortion, four types |
Kept: |
|
28 digital effects |
Left out |
Put a reverb or chorus after the instrument |
Design choices
These are not on the panel. They are the numbers to change if the sound is wrong for you.
OSC 1 renders first because it is the sync master, so it reads OSC 2’s previous block for linear FM, exponential FM and pulse width FM. FM runs a block (128 frames by default) late.
Each sub-oscillator is its own core, an octave under its VCO’s pitch before any FM. It is not synced and takes no linear FM.
The pulse width is held between
PW_MIN(0.05) andPW_MAX(0.95), because at 0 and 100 percent a pulse is a constant, which is DC and not a sound. Every pulse is centred on zero at every width. On MicroPython the width swing narrows as the width nears either end; on CPython the sum is cut off at the limit.The ring modulator multiplies the two VCOs’ sums as they are heard (before their mix levels) and scales the product by
RING_SCALE(2.0).The noise is one generator for every voice, as the original has it [M p.185].
slop(0 to 100, fresh 10) gives each voice its own fixed pitch offset on each VCO (up to 10 cents at 10, ten times that at 100), its own cutoff offset on both filters (up to a sixth of an octave at 10) and a slow drift under 0.3 Hz, the same on every run. At 0 every voice is exactly in tune.The fresh values:
osc2_centsis 7.0 so a fresh patch beats slowly,post_f2_lpis 100 so the Init patch needs no biquad,unison_detune15 cents,assign"rotary"so releases ring.Unison spreads its voices evenly from
-unison_detuneto+unison_detunecents; the original staggers them alternately [M p.57].
The routing table
Every route, the control that sets it, its depth at 100 and the constants in
lib/audioinstruments/_rack/modules/polya6/voice.py (or output.py, for the distortion) that set it.
Pitch is a CV of 0.1 per octave. An LFO, the S&H or a VCO’s sum is taken as +-1 and
an envelope as 0 to 1 before the amount applies. Each rule has a test of its own in
tests/test_synth_polya6.py.
Rule |
What it does |
Controls |
Depth at 100 |
Constants |
Test |
|---|---|---|---|---|---|
|
Key, |
|
LFO 1 and S&H +-12 semitones; ENV 1 4 octaves; exponential FM 2 octaves |
|
|
|
As OSC 1, without the FM term |
|
As OSC 1 |
The same four less |
|
|
OSC 2’s previous block into OSC 1’s linear FM |
|
|
|
|
|
With |
|
|
||
|
|
|
LFO 2 and OSC 2 each 0.45 of the width |
|
|
|
Each VCO’s switched waves added, the saw signed, the pulse at |
|
|
||
|
A square an octave under its VCO, following key, tuning and bend |
|
|
||
|
OSC 1’s sum times OSC 2’s sum, into the pre mix and the post mix |
|
Scale 2.0 |
|
|
|
The six sources at their levels, into Filter 1 and (on |
|
Noise +-1 at 100 |
|
|
|
What Filter 2 hears, as in the table above |
|
|
||
|
|
|
ENV 2 8 octaves; LFO 2 and S&H 3 octaves; key 50 is 1 octave per octave |
|
|
|
The same terms, every sample, and the FILTFM sum of the VCOs switched to it |
|
As Filter 1; FILTFM 2 octaves |
The three above and |
|
|
Filter 1’s sections, Filter 2 and the direct sources at their levels; |
|
|
||
|
The post mix times ENV 3, the velocity factor and |
|
|
|
|
|
ENV 1 moves only the pitch, ENV 2 only the cutoffs, ENV 3 only the level; the attack is corrected to reach its peak in the time set |
|
|
|
|
|
|
|
|
||
|
The bend reaches each VCO by its switch and never glides; the wheel scales |
|
|
||
|
|
|
+-100 cents |
|
|
|
|
|
Drive and level compensation below |
|
|
A DC block follows the distortion: a 6 dB per octave high-pass at about 10 Hz on each side, which takes a constant out entirely.
What it costs
examples/poly_bench.py polya6 renders 1024-frame buffers with the notes held
(a real-time factor above 1.0 keeps up). Machine: the shared development host with
other work running, so read the figures as ranges, middle of one run each.
block |
held |
CPython ms per buffer |
factor |
MicroPython ms per buffer |
factor |
|---|---|---|---|---|---|
128 |
1 |
4.07 |
5.24 |
4.15 |
5.14 |
128 |
4 |
8.64 |
2.47 |
7.08 |
3.01 |
128 |
16 |
27.79 |
0.77 |
20.39 |
1.05 |
At 128 frames, the Init patch keeps up with 10 held notes on CPython and with all
16 on MicroPython, only just (a factor of 1.05). Init is the cheapest patch, since it
runs neither biquad. The Series Notch patch runs three biquads and the ladder in every
voice and keeps up with 6 held notes on CPython and 12 on MicroPython (1.21 and 1.03).
A patch with unison above 1 uses that many voices a note, so it keeps up with that
many times fewer notes. Sixteen notes held on a heavy patch will not keep up on
either interpreter at 128 frames: a bigger block or fewer notes will. At 256 frames
sixteen held notes of Init run at 1.34 on CPython and 1.21 on MicroPython.