Search guides and the APICtrl K
  1. API reference
  2. DSP

tone.h

The two tone controls every second plugin has, done once.

#include <sonore/tone.h>
On this page

Design notes

A "Tone" knob is a tilt: one control that leans the whole spectrum, treble up and bass down or the reverse, pivoting on a frequency where nothing changes. FERRIC's tone control was exactly this and was written by hand, as every other one had been. It is an RBJ shelf pair from dsp.h with the right Q, and it is here so the right Q is chosen once: a shelf at Q = 0.71 has no overshoot at the corner, which is what makes a tilt read 0 dB at its pivot instead of a bump there.

Baxandall's 1952 bass/treble pair is the hi-fi tone stack, and here it is the NETWORK, not a pair of shelves drawn to look like it. The circuit is the symmetric feedback arrangement of his Wireless World article: an inverting amplifier whose input and feedback arms are the two halves of each pot, the bass pot bypassed by a capacitor across each half so it only divides at low frequencies, the treble pot coupled by a capacitor at each end so it only divides at high ones. With the wiper at the amplifier's virtual earth, each arm is an admittance from its end to the wiper, the arms of one side sum, and the gain is the ratio of the input side's sum to the feedback side's -- a rational function of s whose numerator and denominator are the two sides' polynomials multiplied out. That is what update() does, in double, and the bilinear transform turns the quartic into a fourth-order section (its own derivation, in tonedetail::bilinear).

Two properties fall out of the circuit rather than being designed in, and the test asks for both: with both pots centred the two sides are identical and the response is EXACTLY flat at every frequency; and moving a pot from one end to the other swaps the two sides, so cut is the exact mirror of boost, |H_cut| = 1/|H_boost|, which no shelf pair delivers.

Included by dsp.h.

Types 2

Tilt equaliser. +6 dB of tilt is +3 dB at the top of the spectrum and -3 dB at the bottom, with the pivot untouched; negative tilts the other way.

The Baxandall network. Pots run 0..1 (cut .. boost, 0.5 flat); setBass/setTreble take decibels and place the pot where the circuit's own asymptote reaches them. The default parts give +/-21 dB of bass at DC with a 145 Hz turnover and +/-14 dB of treble at the top, which is the classic hi-fi range; a different flavour is a different set of parts.

↑↓ to move↵ to openEvery public name in the headers, and every guide