@maruaudio/dsp/voices/oscillo is a just-intonation dual-oscillator stereo voice: two PolyBLEP oscillators into a linear-attack, exponential-release envelope, tremolo and equal-power pan. OSC 2 is OSC 1 times the just ratio of its interval, a small-integer ratio that the source says keeps a Lissajous figure still. One free-running LFO routes its depth to pitch, level or pan. Eight voices: same-note retrigger, lowest free slot, oldest-first stealing.
Parameters
setOscilloParam(state, index, value), clamped as coded (integers rounded):
| Index | Range | Default | Unit |
|---|---|---|---|
0 OSC1_WAVE, 5 OSC2_WAVE | 0 to 3 (sine, saw, square, triangle) | 0 | — |
1 OSC1_OCTAVE | −2 to 2 | 0 | octaves |
2 OSC1_DETUNE, 7 OSC2_DETUNE | −100 to 100 | 0 | cents |
4 OSC2_ON / 6 OSC2_INTERVAL | 0 or 1 / −12 to 12 semitones | 1 / 7 | — |
9 LFO_WAVE | 0 to 3 (sine, triangle, saw, square) | 0 | — |
10 LFO_RATE / 11 LFO_DEPTH | 0.05 to 20 / 0 to 1 | 2.5 / 0.12 | Hz / — |
12 LFO_TARGET | 0 pitch (±60 cents at full depth), 1 level, 2 pan | 0 | — |
13 AMP_ATTACK / 14 AMP_RELEASE | 0.001 to 2 / 0.02 to 5 | 0.01 / 0.4 | s |
15 TUNING_KEY / 16 TUNING_SYSTEM | 0 to 11 / 0 just, 1 equal | 0 / 0 | — |
17 MASTER_LEVEL, 3 and 8 levels | 0 to 1 | 0.8; 0.8, 0.6 | — |
Indices 18 to 20 (scope) are visual-only no-ops. setOscilloAttackSeconds allows 0.001 to 30 s for the next note-on.
Lifecycle
initOscilloVoice(rate) → parameters → note on/off (plain or …Id) → updateOscilloQuantum per 128 frames (pitch) → oscilloTick per frame, then read outLeft/outRight. resetOscilloVoice(state, rate) restores factory state in place. Optional: mono/legato glide (setOscilloPerformance), per-note tuning, pressure and brightness on a 10 ms ramp, and up to 32 retirement tails.
When to use it
A polyphonic two-oscillator instrument whose oscillator interval should be a pure ratio, in just intonation against a key.
Limits
- Stereo, sample tick, eight voices; gains and pan pass a one-pole smoother.
- The LFO runs from frame 0, unreset by notes; the voices barrel does not export it.