SPB Git

Repository Public

synthesis.md 3.2 KB

# Synthesis engines

These engines do not claim to model an acoustic object.

# organ: additive

y = sum_{k=1..9} L_k sin(2 pi r_k f0 t),   r = (0.5, 1.5, 1, 2, 3, 4, 5, 6, 8)

the nine drawbar footages (16', 5 1/3', 8', 4', 2 2/3', 2', 1 3/5', 1 1/3', 1'). Footages above 0.45 fs are muted (a tonewheel organ folds them back an octave instead; that is not done). Key click and pipe chiff are filtered noise bursts; the tremolo is an amplitude modulation in opposite phase in the two channels, not a rotating-speaker Doppler model.

# synth: subtractive

Two polyBLEP oscillators (sonata_dsp::osc::Oscillator, residual aliasing documented there), a sine sub-oscillator and noise, 1 to 7 unison copies, a zero-delay-feedback state-variable filter (12 dB/octave, Q from 0.5 to 20), two ADSR envelopes and an LFO. Modulation sources are evaluated every 16 samples (3 kHz at 48 kHz); the cutoff is

f_c = cutoff * 2^(keytrack (m - 60)/12 + vel_amt (v - 0.5) + env_amt * env + lfo_amt * lfo)

# fm: phase modulation

Each operator is sin(2 pi r f0 t + I * modulator + feedback), with the index I = 4 pi * level * envelope (up to 12.6 rad) and velocity scaling of the modulators. For one modulator of index I the sideband amplitudes are the Bessel functions J_n(I) (unit test in sonata-dsp: J0, J1, J2 at I = 1 within 0.01). Operator feedback is averaged over two samples to suppress its high-frequency instability. Six routings are provided.

# bass (synth type)

Saw/square blend and sub sine through two cascaded state-variable low-pass filters (24 dB/octave) with a decaying filter envelope and tanh drive.

# voice: source-filter

source = tilt(saw(f0)) * (1 - 0.6 breath) + noise * 0.35 breath
y      = sum_{k=1..5} g_k BP(source; F_k, F_k / B_k)

A sawtooth has a -6 dB/octave spectrum; the one-pole tilt filter (500 to 6000 Hz with tension) brings it towards the -12 dB/octave of a glottal pulse. Five parallel band-pass filters sit at the formants of the vowel, interpolated linearly between the tables of a, e, i, o, u (tenor averages from the phonetics literature) and scaled by 1.22 / 1.12 / 1.0 / 0.9 for soprano / alto / tenor / bass. Parallel formants do not reproduce the spectral zeros and the level interaction of a real vocal tract (a cascade would), consonants do not exist, and above about 600 Hz the fundamental passes the first formant, as for a real soprano: vowels become hard to tell apart. No voice is imitated.

# patch: graph interpreter

Nodes are evaluated once per sample in declaration order; a node reading a later node gets its previous sample, which is only allowed for delay.in (the compiler and PatchSpec::validate reject any other loop). Oscillators are the same band-limited ones as synth; wavetable is alias-free. Nonlinear nodes (saturate, clip) are not oversampled and alias when driven hard at high pitch. The output is multiplied by gain and passed through a cubic soft clipper that reaches full scale at 1.5 times full scale input, so a patch cannot exceed 0 dBFS per voice. Control-rate nodes run at audio rate in this version.

Files main
Menu

Theme