Repository Public
1<!--2ORIX Sonata3File: Documentation/acoustics/synthesis.md4Author: Simon-Pierre Boucher5Contact: contact@spboucher.ai6-->7# Synthesis engines89These engines do not claim to model an acoustic object.1011## `organ`: additive1213 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)1415the nine drawbar footages (16', 5 1/3', 8', 4', 2 2/3', 2', 1 3/5', 1 1/3', 1'). Footages above160.45 fs are muted (a tonewheel organ folds them back an octave instead; that is not done).17Key click and pipe chiff are filtered noise bursts; the tremolo is an amplitude modulation in18opposite phase in the two channels, not a rotating-speaker Doppler model.1920## `synth`: subtractive2122Two polyBLEP oscillators (`sonata_dsp::osc::Oscillator`, residual aliasing documented there),23a sine sub-oscillator and noise, 1 to 7 unison copies, a zero-delay-feedback state-variable24filter (12 dB/octave, Q from 0.5 to 20), two ADSR envelopes and an LFO. Modulation sources are25evaluated every 16 samples (3 kHz at 48 kHz); the cutoff is2627 f_c = cutoff * 2^(keytrack (m - 60)/12 + vel_amt (v - 0.5) + env_amt * env + lfo_amt * lfo)2829## `fm`: phase modulation3031Each operator is `sin(2 pi r f0 t + I * modulator + feedback)`, with the index32`I = 4 pi * level * envelope` (up to 12.6 rad) and velocity scaling of the modulators. For one33modulator of index `I` the sideband amplitudes are the Bessel functions `J_n(I)` (unit test in34`sonata-dsp`: J0, J1, J2 at I = 1 within 0.01). Operator feedback is averaged over two samples35to suppress its high-frequency instability. Six routings are provided.3637## `bass` (synth type)3839Saw/square blend and sub sine through two cascaded state-variable low-pass filters (2440dB/octave) with a decaying filter envelope and `tanh` drive.4142## `voice`: source-filter4344 source = tilt(saw(f0)) * (1 - 0.6 breath) + noise * 0.35 breath45 y = sum_{k=1..5} g_k BP(source; F_k, F_k / B_k)4647A sawtooth has a -6 dB/octave spectrum; the one-pole tilt filter (500 to 6000 Hz with48`tension`) brings it towards the -12 dB/octave of a glottal pulse. Five parallel band-pass49filters sit at the formants of the vowel, interpolated linearly between the tables of a, e, i,50o, u (tenor averages from the phonetics literature) and scaled by 1.22 / 1.12 / 1.0 / 0.9 for51soprano / alto / tenor / bass. Parallel formants do not reproduce the spectral zeros and the52level interaction of a real vocal tract (a cascade would), consonants do not exist, and above53about 600 Hz the fundamental passes the first formant, as for a real soprano: vowels become54hard to tell apart. No voice is imitated.5556## `patch`: graph interpreter5758Nodes are evaluated once per sample in declaration order; a node reading a later node gets its59previous sample, which is only allowed for `delay.in` (the compiler and `PatchSpec::validate`60reject any other loop). Oscillators are the same band-limited ones as `synth`; `wavetable` is61alias-free. Nonlinear nodes (`saturate`, `clip`) are **not oversampled** and alias when driven62hard at high pitch. The output is multiplied by `gain` and passed through a cubic soft clipper63that reaches full scale at 1.5 times full scale input, so a patch cannot exceed 0 dBFS per64voice. Control-rate nodes run at audio rate in this version.65