Van der Pol Tube Distortion — Waveshaping

Memoryless waveshaping through the Liénard characteristic F(x) = x³/3 − x — van der Pol's own model of the triode's current-voltage curve. Odd symmetry produces odd harmonics only. Two character modes: authentic fold (the original curve) or monotonic tube (peak-hold cubic soft clip).

Author: Shai Cohen Affiliation: Department of Music, Bar-Ilan University, Israel Version: 0.3 (2026) License: MIT License Repo: https://github.com/ShaiCohen-ops/Praat-plugin_AudioTools
Contents:

What this does

This script implements memoryless waveshaping through the Van der Pol / Liénard characteristic: y = x − μ·(x³/3). This is (up to sign) the Liénard characteristic F(x) = x³/3 − x of the Van der Pol oscillator — van der Pol's own model of the triode's current-voltage curve. This is not an approximation of the tube equation; it is the historical tube nonlinearity the equation was built from. Odd symmetry produces odd harmonics only.

Authentic fold vs. monotonic tube: The cubic peaks at |x·Drive| = 1/√μ (height (2/3)/√μ), then folds back, crosses zero at |x·Drive| = √(3/μ), and inverts. Authentic fold is the original v0.2 curve — it folds and inverts at high drive levels. Monotonic tube holds the cubic's peak beyond the fold point, producing a classic soft-clip that is guaranteed monotonic at any setting. The Character menu makes the choice explicit.

Key Features:

v0.3 honest behaviour note: The cubic folds back and inverts at high drive levels. For μ=1.0, the curve inverts above input 0.69 (Classic Saturation preset). The tanh guard engages only deep in the inverted region — it bounds the output but does not prevent folding or polarity inversion. The Character menu makes the choice explicit, and the transfer function visualisation shows the true curve.

Quick start

  1. In Praat, select exactly one Sound object.
  2. Run script…VanDerPol_Tube_Distortion.praat.
  3. Choose a preset from the dropdown (5 options, plus Manual).
  4. Select Character: authentic fold (the original curve) or monotonic tube (peak-hold soft clip).
  5. If Manual, adjust Drive, Mu, Output_Gain.
  6. Click OK — script applies waveshaping, creates output originalname_VdP_Dist_presetname.
Quick tip: Start with Gentle Tube Warmth for a subtle, warm coloration (Drive=1.2, Mu=0.5). Classic Tube Saturation (Drive=2.5, Mu=1.0) produces the classic Van der Pol fold-back — odd harmonics, warm saturation. Fold-back Extreme (Drive=9.0, Mu=3.0) pushes the curve into deep inversion. Enable Draw_visualization to see the transfer function — red curve shows how input maps to output.
Important: The authentic fold character inverts the waveform at high drive levels. This is the historical Van der Pol curve — it is not a bug. If you need a guaranteed monotonic (non-inverting) waveshaper, use the monotonic tube character instead. The final hard clamp prevents values exceeding ±0.999 but does not alter the waveshaping character. The transfer function visualisation shows exactly what the waveshaper does.

5 Presets

PresetDriveMuOutput GainCharacter
Subtle Coloration1.050.20.98Very light harmonic enhancement — barely noticeable.
Gentle Tube Warmth1.20.50.95Warm, subtle saturation — gentle odd harmonics.
Classic Tube Saturation2.51.00.85Classic Van der Pol fold-back — inverts above input 0.69.
Aggressive Drive5.01.50.6Heavy folding and inversion — aggressive distortion.
Fold-back Extreme9.03.00.4Deep inversion — extreme fold-back, very low output gain to compensate.

Theory — Van der Pol / Liénard Characteristic

Van der Pol oscillator

x'' − μ·(1 − x²)·x' + x = 0

The Liénard characteristic is F(x) = x³/3 − x

This script implements y = x − μ·(x³/3) which is −μ·F(x) — the triode's current-voltage curve.

Odd symmetry: F(−x) = −F(x) → odd harmonics only.

Waveshaping pipeline:
  1. Input scaling: x = sample × Drive
  2. Cubic: y = x − μ·(x³/3)
  3. Character (authentic fold): if |y| > safetyThreshold, apply tanh fallback (bounded)
  4. Character (monotonic tube): if |x| > 1/√μ, hold peak value (2/3)/√μ
  5. Output gain: y = y × Output_Gain
  6. Hard clamp: y = clamp(y, -0.999, 0.999)
Fold and inversion thresholds:
  • Fold onset: |x·Drive| = 1/√μ
  • Inversion onset: |x·Drive| = √(3/μ)
Authentic fold vs. monotonic tube:
  • Authentic fold: the curve folds back and inverts — this is the historical Van der Pol curve. The tanh fallback bounds extreme outputs but does not prevent inversion.
  • Monotonic tube: holds the cubic's peak beyond the fold point — classic cubic soft-clip, guaranteed monotonic at any setting.
The transfer function visualisation in the Praat Picture shows the selected character's true curve.

Controls

Waveshaping parameters

ParameterRangeDescription
Characterauthentic fold / monotonic tubeAuthentic = original Van der Pol curve (folds/inverts). Monotonic = peak-hold soft clip.
Drive>0Multiplies the input before the cubic — higher = more distortion.
Mu>0Coefficient of the cubic term — higher = more severe fold-back.
Output_Gain0–1Post-processing gain — compensates for amplitude changes.
Safety threshold: The tanh fallback engages when |cubic| > 3.0, bounding the output. The final hard clamp ensures the output never exceeds ±0.999, preventing clipping in subsequent processing.

Applications

Subtle tube warmth (Gentle Tube Warmth)

Use case: Add gentle harmonic enhancement without aggressive distortion.

Settings: Gentle Tube Warmth preset, Character = monotonic tube. The curve adds odd harmonics without folding, preserving the waveform's shape.

Classic tube saturation (Classic Saturation)

Use case: The historical Van der Pol distortion — odd harmonics, fold-back, warm saturation.

Settings: Classic Saturation preset, Character = authentic fold. The curve folds above input 0.69 and inverts above 1.73 — classic tube-like behaviour.

Extreme fold-back (Fold-back Extreme)

Use case: Extreme distortion — deep inversion, chaotic fold-back.

Settings: Fold-back Extreme preset, Character = authentic fold. The curve inverts deeply, producing a highly distorted, aggressive texture.

Soft clip / limiter (monotonic tube)

Use case: A smooth, monotonic waveshaper for soft clipping or limiting.

Settings: Character = monotonic tube, Drive=1.2, Mu=0.5. The curve saturates smoothly without folding or inverting.

Workflow: Voice → Gentle warmth

Source: Spoken word or vocal recording.
Settings: Gentle Tube Warmth preset, Character = monotonic tube.
Result: The voice gains a subtle, warm harmonic enhancement — odd harmonics enrich the sound without distortion.

Workflow: Synth pad → Classic saturation

Source: Synth pad.
Settings: Classic Saturation preset, Character = authentic fold.
Result: The pad develops a warm, saturated character with odd harmonics — the fold-back adds texture without harsh clipping.

Workflow: Drum loop → Extreme fold-back

Source: Drum loop.
Settings: Fold-back Extreme preset, Character = authentic fold.
Result: The drums are heavily distorted — transients are folded and inverted, producing a chaotic, aggressive texture.

Troubleshooting:
Output has no distortion: Increase Drive or Mu. For subtle settings (Drive=1.0, Mu=0.2), the cubic is nearly linear.
Output is inverted / phase-flipped: This is the authentic fold character. Switch to monotonic tube if you need a non-inverting waveshaper.
Output is silent or very quiet: Aggressive presets have low Output_Gain to prevent clipping. Increase Output_Gain manually.
Output clips: The hard clamp prevents clipping, but if you see distortion, reduce Drive or Output_Gain.
Transfer function shows weird curve: The visualisation draws the exact curve including tanh fallback and hard clamp — what you see is what you hear.

Visualisation

When Draw_visualization is enabled, the script generates:
  • Title bar — script name, preset, Drive, Mu, Output_Gain
  • Transfer function — the waveshaper's input-output curve (red line). Shows fold-back, inversion, and tanh safety boundaries.
  • Parameter report — Drive, Mu, safety threshold, curve character description.
  • Output waveform — the distorted sound (blue for mono, blue/orange for stereo).
  • Summary bar — preset, parameters, curve character, output duration and peak.
The transfer function is the key diagnostic: it shows exactly how the waveshaper behaves — whether it folds, inverts, or saturates.
```