harmonic_shaper

NODE

Adds the 2nd to 5th harmonics in proportions you set, rather than whatever a saturation curve happens to produce.

Parameters

FIELDWHAT IT DECIDESRANGEREQUIRED
h2_pct2nd harmonic percentage [%].0 〜 20no
h3_pct3rd harmonic percentage [%].0 〜 20no
h4_pct4th harmonic percentage [%].0 〜 20no
h5_pct5th harmonic percentage [%].0 〜 20no
{
  "h2_pct": 1.5,
  "h3_pct": 0.3,
  "type": "harmonic_shaper"
}

How it is computed

u = x / A_ref                    A_ref is the reference amplitude (-20 dBFS RMS)

T̂2(u) = 2u²                      a sine gives 1 - cos(2ωt): 2nd harmonic and DC
T̂3(u) = 4u³ - 3u                 gives -sin(3ωt)
T̂4(u) = 8u⁴ - 8u²                gives -1 + cos(4ωt): 4th harmonic and DC
T̂5(u) = 16u⁵ - 20u³ + 5u         gives sin(5ωt)

u is clamped to ±2 so the polynomials cannot run away on a large input.
At the reference level the clamp never engages and the percentages hold exactly.
Chebyshev polynomials corrected so that they pass through the origin: at silence the node emits neither offset nor DC, and at the reference level each order appears at exactly the percentage you asked for.

Using it

  • Even orders need a DC blocker after them.

    The 2nd and the 4th produce a DC component as a property of the polynomial. If either percentage is above zero, put a dc_blocker downstream.

  • The percentages are defined at the reference level.

    They are exact for a signal at -20 dBFS RMS. Quieter or louder material sits at a different point on the polynomial, so the ratios move, which is also true of every real circuit.

  • It is deterministic, unlike a saturator.

    A waveshaper gives you whatever spectrum its curve produces. This node lets you ask for a spectrum directly, which is the difference between colouring by ear and colouring by specification.