Amplitude-Following Wah-Wah — User Guide
An offline envelope-controlled resonant filter: the source amplitude is tracked with separate attack and release times, mapped over a fixed dB range, and used to move the filter centre between a low and high frequency.
What this does
Amplitude-Following Wah-Wah creates a wah-like resonant-filter movement directly from the dynamics of the selected Sound. Louder regions move the filter centre upward; quieter regions move it downward. The motion is controlled by an attack/release envelope follower rather than by frame-wise file min/max normalization.
selected Sound → channel-safe amplitude estimate → attack/release follower → peak-relative dB mapping → time-varying FormantGrid centre frequency → resonant filtering → dry/wet mix → optional attenuation-only safety stage
The effect is offline: the complete Sound is analyzed and rendered before playback. The resulting filter trajectory is deterministic for a given source and parameter set.
Quick start
- Select exactly one Sound object.
- Choose one of the four presets or Custom.
- Set Attack and Release to control how quickly the wah reacts to rising and falling amplitude.
- Set Envelope range to define how many dB below the observed envelope peak map across the full filter range.
- Use Dry/Wet to blend the processed and original signals.
- Use Safety peak if you want attenuation-only protection against an excessive output peak.
Presets
The preset selects only the filter-frequency range and bandwidth. Envelope, mix, safety, visualization, and playback controls remain user-adjustable.
| Preset | Centre-frequency range | Bandwidth | Character |
|---|---|---|---|
| Classic Guitar | 400–2500 Hz | 100 Hz | Narrow mid-range sweep. |
| Funky Bass | 80–800 Hz | 80 Hz | Low-frequency focused sweep. |
| Subtle Vocal | 500–1500 Hz | 300 Hz | Broader, gentler resonance. |
| Sci-Fi Zap | 200–4000 Hz | 50 Hz | Very narrow, wide-range motion. |
| Custom | User-defined | User-defined | Uses the three Custom filter fields. |
Envelope follower
Channel-safe amplitude input
The envelope analysis is deliberately constructed so opposite-polarity channels cannot cancel. The script squares every real channel first, averages the squared channels when the source is multichannel, and then takes the square root.
multichannel: envelope input = sqrt(mean(x_channel²))
This amplitude-control signal is used only to drive the filter trajectory. The audio that is filtered remains the original Sound with its original channels.
Attack / release smoothing
A one-pole follower is evaluated sample by sample. Rising input uses the attack coefficient; falling input uses the release coefficient.
alphaRelease = exp[-1 / (ReleaseSeconds × sampleRate)]
if input[n] > env[n-1]:
env[n] = alphaAttack × env[n-1] + (1-alphaAttack) × input[n]
else:
env[n] = alphaRelease × env[n-1] + (1-alphaRelease) × input[n]
An Attack or Release value of 0 ms sets the corresponding coefficient to zero, giving immediate response in that direction.
Peak-relative dB mapping
After the follower is built, its maximum value becomes the reference peak. Each control sample is converted to dB relative to that peak:
normalized(t) = clamp((relative_dB(t) + EnvelopeRange_dB) / EnvelopeRange_dB, 0, 1)
centre(t) = minCutoff + (maxCutoff - minCutoff) × normalized(t)
The observed envelope peak therefore maps to the maximum filter frequency. A level exactly Envelope range dB below the peak maps to the minimum frequency. Anything quieter is clamped at the minimum.
If the envelope is effectively silent, the normalized control is 0 and the filter centre stays at the minimum frequency.
Control-point density
The FormantGrid trajectory uses up to 5000 control points. The script aims for approximately 5 ms spacing on ordinary-duration files; when a file is long enough to exceed 5000 points, the points are distributed evenly across the complete duration at a wider spacing.
Filtering and dry/wet mix
A one-formant FormantGrid is created over the exact start and end times of the source. Every control point receives the mapped centre frequency and the selected fixed bandwidth. Praat's FormantGrid Filter command is then applied to the original Sound.
The script does not implement the wah as a separate textbook biquad equation, so the guide does not assign an external transfer-function formula to the filter. The implemented control variables are the FormantGrid centre-frequency trajectory and a fixed bandwidth.
Dry/wet
At 100% wet, the processed Sound is copied directly. Between 0 and 100%, dry and filtered samples are linearly mixed channel by channel.
Parameters
| Parameter | Default | Implemented behavior |
|---|---|---|
| Style | Classic Guitar | Selects one of four fixed filter ranges/bandwidths or Custom. |
| Custom min Hz | 400 Hz | Used only for Custom; wet processing clamps the effective minimum to at least 20 Hz. |
| Custom max Hz | 2500 Hz | Used only for Custom; wet processing clamps the effective maximum to 95% of Nyquist. |
| Custom bandwidth Hz | 150 Hz | Used only for Custom; effective bandwidth is at least 1 Hz and no more than 90% of Nyquist. |
| Attack ms | 8 ms | Rise time constant of the one-pole follower; negative entries are clamped to 0. |
| Release ms | 80 ms | Fall time constant of the one-pole follower; negative entries are clamped to 0. |
| Envelope range dB | 30 dB | Peak-relative dB span mapped from minimum to maximum filter centre; clamped to at least 1 dB. |
| Dry/Wet percent | 100% | Clamped to 0–100%; 0% invokes the exact dry bypass. |
| Safety peak | .99 | Clamped to 0–1; 0 disables the safety stage. Otherwise only signals above the target are attenuated. |
| Draw visualization | On | Draws input/output, normalized control, centre-frequency path, and summary when wet processing is active. |
| Play result | On | Plays the completed result. |
Channel, timing, and sample-rate behavior
| Property | Behavior |
|---|---|
| Input | Exactly one selected Sound. |
| Envelope analysis | One channel-safe RMS-like control signal derived from all input channels. |
| Filtering | The FormantGrid is applied to the original Sound, not to the mono control signal. |
| Dry/wet mix | Performed channel by channel using the same wet amount. |
| Channel count | Preserved. |
| Sample rate | Preserved. |
| Duration | Preserved. |
| Start time | Preserved; the FormantGrid is built over the source's actual start/end times. |
Nyquist-aware validation and safety peak
Filter range
Wet processing enforces:
maximum centre ≤ 0.95 × Nyquist
maximum centre > minimum centre
If clamping leaves no valid frequency span, the script stops with an error rather than creating an invalid FormantGrid trajectory.
Bandwidth
Safety peak
The safety stage is attenuation only. It measures the absolute output extremum and scales only if that peak exceeds the requested Safety peak.
gain = SafetyPeak / outputPeak
output = output × gain
otherwise: output is unchanged
This is not target peak normalization: quieter results are never boosted.
Visualization
When wet processing is active and Draw visualization is enabled, v0.6 draws four process views plus a summary:
Input
The original waveform.
Output
The final processed waveform after dry/wet mixing and any safety attenuation.
Envelope
The normalized 0–1 control actually used for the dB-to-frequency mapping. A dotted 0.5 reference line is shown.
Centre (Hz)
The actual mapped filter-centre trajectory. Dotted lines mark the effective minimum and maximum frequencies after sample-rate-aware validation.
Summary
Reports the effective range, bandwidth, attack/release, envelope range, wet percentage, safety setting, channel count, and duration.
Output behavior
- The result is a new Sound; the selected source is left unchanged.
- Its channel count, sampling frequency, start time, and duration are preserved.
- There is no unconditional output normalization.
- Safety peak, when enabled, can only reduce level.
- The same envelope-derived centre-frequency trajectory controls all audio channels.