Spectral-Driven Intensity Modulation — User Guide
Time-varying spectral analysis drives an attenuation-only tremolo: spectral flatness controls depth, normalized spectral spread controls rate, and tonal compact-spectrum regions can be protected by reducing both.
What this does
Spectral-Driven Intensity Modulation listens to how the spectrum changes through the selected Sound and turns those changes into a continuously evolving tremolo. Short analysis windows are distributed across the recording. Each window measures two scale-independent spectral descriptors:
- Spectral flatness controls attenuation depth: flatter, more noise-like spectra move toward the upper end of the selected depth range.
- Normalized spectral spread controls modulation rate: spectrally broader windows move toward the upper end of the selected rate range.
The measured values are interpolated between analysis windows, so depth and rate evolve continuously rather than jumping from one window to the next. When a region is both sufficiently tonal and spectrally compact, optional protection factors reduce the derived depth and rate before the tremolo is generated.
Processing pipeline
2. Choose a mono analysis signal, with strongest-channel fallback if a multichannel fold-down is strongly cancelled.
3. Place short Hamming-windowed analysis regions across the recording.
4. Compute an exact-length Spectrum for every analysis window.
5. Measure spectral flatness, centroid, and normalized spectral spread inside the requested band.
6. Interpolate flatness and spread through time.
7. Map flatness to depth and spread to modulation rate, with optional tonal/compact-spectrum protection.
8. Integrate the changing rate into a continuous modulation phase.
9. Write a relative-dB IntensityTier and multiply it with the original multichannel Sound.
10. Apply Dry/Wet mixing and an attenuation-only Safety Peak ceiling.
The spectral features control the effect; they do not replace the source audio. The final Sound retains the original sample grid and channel structure.
Spectral analysis
Analysis source
Mono input is copied directly for analysis. Multichannel input is first converted to mono. The script also measures every original channel independently. If the mono fold-down peak is less than 10% of the strongest channel peak, the fold-down is considered vulnerable to phase cancellation and the strongest individual channel is used for analysis instead.
The analysis copy is shifted to a local 0-second start when the original Sound has a non-zero xmin. This simplifies analysis timing without altering the original Sound or its eventual output time domain.
Window placement
By default, 8 analysis windows of 200 ms are distributed evenly across the usable duration. Their centers run from half a window after the beginning to half a window before the end.
If the Sound is shorter than the requested window duration, the complete Sound is reused for every spectral measurement while the control timestamps are still distributed over the valid output duration.
Frequency band
The default analysis band is 80–5000 Hz. The upper edge is clamped to 0.49 × sample rate. The script requires at least two valid FFT bins inside the resolved band.
Spectral flatness
The floor is relative to the mean spectral power, so multiplying the source by a constant level does not materially change the flatness estimate. The final value is clamped to 0…1.
Spectral centroid and normalized spread
The centroid is measured but is not used as a modulation controller. The rate mapping uses normalized spectral spread. The factor sqrt(12) makes a uniform spectral distribution across the complete analysis band approach a normalized spread of 1.
Spectral mapping
Flatness → attenuation depth
Before tonal protection, flatness 0 maps to Base Depth and flatness 1 maps to Max Depth.
Spread → modulation rate
Before tonal protection, normalized spread 0 maps to Base Rate and spread 1 maps to Max Rate.
Tonal / compact-spectrum protection
The protection stage activates only when both conditions are true:
When active:
Because the reduction is applied after the normal mapping, protected regions can fall below the nominal Base Depth and Base Rate. With the default factors, the depth is multiplied by 0.3 and the rate by 0.7.
Gain trajectory
Adaptive control resolution
The Advanced Time step is an upper limit, not always the final spacing. The script also guarantees at least 32 control points per cycle of the fastest requested modulation rate:
With the default 5 Hz maximum rate and a 10 ms requested step, this resolves to 6.25 ms.
Interpolation of spectral controls
At every control point, flatness and normalized spread are linearly interpolated between the two surrounding spectral-analysis timestamps. Before the first analysis center, the first measurement is held; after the last center, the final measurement is held.
Continuous phase
Changing rate is converted into one continuous phase accumulator:
This avoids restarting the oscillator whenever the spectrally derived rate changes.
Attenuation-only tremolo law
The range is exactly 0 dB to −depth_dB. Phase starts at zero, so the processed path begins at 0 dB rather than with an artificial level discontinuity.
Relative-dB IntensityTier
The gain values are written directly to an IntensityTier in the original Sound's absolute time domain. Praat interprets IntensityTier values as relative dB multipliers. The script calls Multiply: "no", explicitly disabling Praat's optional post-multiply scaling to 0.9.
Dry/Wet
Since the processed path is itself attenuation-only, the Dry/Wet blend also cannot exceed the instantaneous original amplitude through the tremolo mapping alone. 0% Wet is an exact copied bypass.
Safety Peak
After active processing, the script measures the peak. If it exceeds Safety Peak, the complete Sound is scaled down to that ceiling. Signals already below the threshold are not raised. Safety Peak is skipped on the explicit 0% Wet bypass.
Presets
| Preset | Depth range | Rate range | Tonal protection changes |
|---|---|---|---|
| Custom | 20–50 dB | 1–5 Hz | Default advanced values |
| Subtle Texture | 12–30 dB | 0.8–3 Hz | Default advanced values |
| Moderate Dynamics | 18–42 dB | 1–4 Hz | Default advanced values |
| Strong Spectral Response | 22–52 dB | 1.5–6 Hz | Default advanced values |
| Voice Protection Mode | 16–36 dB | default 1–5 Hz | Flatness threshold .40; spread threshold .18; depth ×.20; speed ×.50 |
| Maximum Effect | 26–60 dB | 2–8 Hz | Depth reduction becomes ×.60; other advanced protection defaults remain |
Parameters
Main form
| Parameter | Default | Meaning | Runtime handling |
|---|---|---|---|
| Preset | Custom | Selects one of five mapped behaviors or the manual values below. | Named presets overwrite their assigned mapping values. |
| Base depth dB | 20 | Depth mapped from flatness = 0 before protection. | Clamped to 0…80 dB. |
| Max depth dB | 50 | Depth mapped from flatness = 1 before protection. | Clamped to Base Depth…80 dB. |
| Base mod speed Hz | 1.0 | Rate mapped from spread = 0 before protection. | Clamped to 0…50 Hz. |
| Max mod speed Hz | 5.0 | Rate mapped from spread = 1 before protection. | Clamped to Base Rate…50 Hz. |
| Dry/Wet percent | 100 | Global blend of original and attenuated path. | Clamped to 0…100%; 0 gives exact bypass. |
| Advanced settings | off | Opens the analysis, tonal-protection, resolution, and safety controls. | — |
| Draw visualization | yes | Creates the AudioTools figure. | Does not change audio. |
| Play result | yes | Plays the completed result. | Does not change audio. |
Advanced settings
| Parameter | Default | Meaning | Runtime handling |
|---|---|---|---|
| Num analysis points | 8 | Number of short spectral measurements across the Sound. | Clamped to 2…64. |
| Window size seconds | 0.2 | Length of each Hamming-windowed spectral analysis region. | Clamped to .005 s…Sound duration. |
| Min frequency Hz | 80 | Lower analysis-band edge. | Clamped to 0…0.49 × sample rate. |
| Max frequency Hz | 5000 | Upper analysis-band edge. | Clamped to 0…0.49 × sample rate; must remain above Min. |
| Tonal flatness threshold | .30 | Upper flatness limit for tonal protection. | Clamped to 0…1. |
| Smooth spread threshold | .12 | Upper normalized-spread limit for tonal protection. | Clamped to 0…1. |
| Tonal depth reduction | .30 | Multiplier applied to depth when both protection tests pass. | Clamped to 0…1. |
| Tonal speed reduction | .70 | Multiplier applied to rate when both protection tests pass. | Clamped to 0…1. |
| Time step | .01 s | Maximum spacing requested for the IntensityTier control grid. | Clamped to .0005….05 s, then possibly reduced to satisfy 32 points/cycle. |
| Safety peak | .99 | Maximum peak allowed after active processing. | Clamped to 0…1; 0 disables safety; attenuation only. |
Channels & output
| Property | Behavior |
|---|---|
| Analysis | Mono input directly, otherwise mono fold-down with strongest-channel fallback when cancellation is severe. |
| Gain control | One shared relative-dB IntensityTier controls every source channel identically. |
| Channel count | Preserved, including arbitrary multichannel Sounds. |
| Sample rate | Preserved. |
| Duration | Preserved. |
| Start time | Preserved; the control tier is created directly over the original absolute time domain. |
| Randomness | None. Analysis and modulation are deterministic for the same source and settings. |
| 0% Wet | Exact copied bypass. |
| Maximum active gain | 0 dB before Safety Peak; the tremolo itself never boosts. |
Visualization
When Draw visualization is enabled, v0.4 produces the standardized AudioTools picture:
Input
The original waveform.
Output
The final processed waveform after optional safety attenuation.
Spectral drives
Interpolated spectral flatness and normalized spread over time. The dotted horizontal line marks the tonal-flatness threshold.
Gain modulation
The actual relative-dB control trajectory, from 0 dB downward.
Visualization decimation
The full IntensityTier can contain many more points, especially at high modulation rates. The figure stores at most 500 representative control points for drawing. This does not reduce the resolution of the audio modulation itself.
Summary strip
The summary reports average interpolated flatness, average normalized spread, average derived depth, average derived rate, Wet percentage, Safety setting, duration, sample rate, and channel count.