oscillator (before filter) after filter white dots in the response plot = the browser's own Web Audio filter, queried independently. Hold a key (mouse, touch or Enter/Space) to play.
Oscillator. Band-limited sums of sines: sawtooth (2/π) Σ sin(kθ)/k, square (4/π) Σodd k sin(kθ)/k, triangle (8/π²) Σodd k (−1)(k−1)/2 sin(kθ)/k². Only harmonics below the Nyquist frequency (22.05 kHz) are included, so nothing aliases in the plots.
Filter. A second-order IIR "biquad" from the RBJ cookbook: y[n] = (b0x[n]+b1x[n−1]+b2x[n−2] − a1y[n−1] − a2y[n−2])/a0 with ω0=2πfc/fs, α=sinω0/(2Q). For the low-pass, b0=b2=(1−cosω0)/2, b1=1−cosω0; the gain at the cutoff is exactly Q (so Q = 10 means a +20 dB resonance peak). Above cutoff a 2-pole filter falls at 12 dB/octave.
Envelope. ADSR: linear attack, then exponential decay to the sustain level with time constant D/3, and exponential release with R/3 (what Web Audio's setTargetAtTime does).
Delay. A feedback loop with gain g: echo n has amplitude gn, so it falls 60 dB after n = −3/log10 g echoes.
Simplifications. Plots use 44.1 kHz offline calculation (a separate code path from the browser audio you hear), a single voice, no filter envelope or LFO, no oversampling or soft clipping.