Intensity Envelope Processor — v1.6 User Guide
Seven dynamics and time-processing modes: intensity-derived power shaping and inversion, synthetic tremolo, rhythmic gating and random modulation, plus audible time shift and tape-speed time scaling.
What this does
Intensity Envelope Processor is a multi-mode processor. Power Shaping and Envelope Inversion analyze the source with Praat To Intensity: 100, 0, "yes" and derive a time-varying gain from that contour. Tremolo, Gating and Random Modulation do not use the Intensity analysis; they construct synthetic gain-control Sounds on a rate-adaptive grid. Time Shift and Time Scaling operate directly on the audio rather than on an envelope.
Sound & IntensityTier: Multiply path and makes Normalize = no meaningful.
The source Sound is never replaced. Processing preserves its channel count. A non-zero source start time is respected by the analysis and modulation formulas.
Quick start
- Select exactly one Sound object.
- Run
Intensity_Envelope_Processor.praat. - Choose a Preset, or leave Custom and choose one of the seven Mode options.
- Leave Advanced_settings off for the built-in defaults, or enable it to edit the mode parameters.
- Normalize defaults to on, Visualize defaults to on, and Play defaults to on.
Max_gain or Tremolo phase) remain available.Presets
| Preset | Mode | Values imposed by the preset | Output suffix |
|---|---|---|---|
| Custom | Uses the selected Mode | No mode-specific override | _Custom for envelope modes |
| Soft Compression | Power Shaping | Exponent = 0.5 | _SoftComp |
| Hard Expansion | Power Shaping | Exponent = 3.0 | _HardExp |
| Gentle Tremolo | Tremolo | Rate = 3 Hz; depth = 0.3; center = 0.7 | _GentleTrem |
| Fast Tremolo | Tremolo | Rate = 8 Hz; depth = 0.5; center = 0.5 | _FastTrem |
| Rhythmic Chop | Gating | Rate = 4 Hz; duty = 50%; min = 0; max = 1; smoothing = 2 ms | _RhythmChop |
| Smooth Gate | Gating | Rate = 2 Hz; duty = 70%; min = 0.1; max = 1; smoothing = 20 ms | _SmoothGate |
| Tape Slowdown | Time Scaling | Scale factor = 2.0 | _scaled |
| Reverse Dynamics | Envelope Inversion | Mode only; uses the current Max_gain | _ReverseDyn |
| Random Flutter | Random Modulation | Rate = 12 Hz; depth = 0.25 | _Flutter |
Processing modes
1. Power Shaping
Intensity-derived dynamic shaping
Praat analyzes intensity with a fixed 100 Hz pitch floor, automatic time step, and mean subtraction. Let I(t) be the analyzed dB contour and Imax its maximum. The script converts it to a relative linear-amplitude contour:
Exponent = 1 is neutral. Values below 1 compress the relative envelope by boosting quieter regions, subject to Max_gain. Values above 1 expand the relative envelope by attenuating quieter regions more strongly. Silent input is detected and left at unity gain.
2. Sine Modulation (Tremolo)
Periodic multiplicative gain
Tremolo_center is clamped to 0–1 and requested depth to ≥0. The effective depth is reduced further when necessary so the sinusoid stays inside 0–1 without flat-topped clipping. Phase is specified in degrees and the cycle is anchored to the Sound's own start time.
3. Rhythmic Gating
Duty-cycle gate with cosine-smoothed edges
The gate alternates between Gate_min and Gate_max. Duty controls the fraction of each cycle spent in the high state. At the transitions the script uses a half-cosine interpolation rather than a hard step.
0% duty produces constant Gate_min; 100% produces constant Gate_max. Levels are constrained to 0–1 and the duty value to 0–100%.
4. Time Shift
Audible content shift, not an envelope-only shift
- Shift = 0: copy unchanged.
- Positive: prepend that duration of real silence before the entire Sound.
- Negative: trim that duration from the beginning of the Sound. The trim is limited so at least 1 ms of audio remains.
This changes the Sound's duration. It does not move intensity points inside an otherwise unchanged file.
5. Time Scaling (Tape Speed)
Varispeed: duration and pitch change together
Scale_factor > 1 produces a longer, slower, lower-pitched result. Scale_factor < 1 produces a shorter, faster, higher-pitched result. This is not pitch-preserving time stretch.
6. Envelope Inversion
Gain-limited inversion of the relative intensity contour
The loudest analyzed point (r=1) is driven toward zero; quieter regions receive increasing gain, capped by Max_gain. Because of that cap, this is deliberately a gain-limited inversion rather than an unlimited mathematical inverse. Silent input is left unchanged.
7. Random Modulation
Rate-defined random gain control
The script generates one independent random control value per 1 / Random_rate_Hz seconds, with values in [1 - Random_depth, 1], then uses that control Sound as the gain source. Random_depth is clamped to 0–1.
Random_seed = 0 initializes unpredictably. Any non-zero seed produces a reproducible control sequence for that run; afterward Praat's generator is returned to an unpredictable state.
Advanced settings
The main form is intentionally compact. Enabling Advanced_settings opens one additional dialog containing the following defaults:
| Parameter | Default | Meaning / enforced behavior |
|---|---|---|
Exponent | 2.0 | Power-shaping exponent. |
Tremolo_rate_Hz | 5.0 | Positive input; additionally capped by synthetic/Nyquist safety limits. |
Tremolo_depth | 0.5 | Requested depth; clamped ≥0, then reduced to a center-safe depth if needed. |
Tremolo_center | 0.5 | Clamped to 0–1. |
Tremolo_phase | 0° | Phase offset in degrees. |
Gate_rate_Hz | 4.0 | Positive input; capped by synthetic/Nyquist safety limits. |
Gate_duty_percent | 50 | Clamped to 0–100%. |
Gate_max | 1.0 | High gain. Min/max are swapped if inverted, then both clamped to 0–1. |
Gate_min | 0.0 | Low gain. |
Gate_smoothing_ms | 5 ms | Requested cosine transition duration, additionally limited by duty cycle. |
Shift_seconds | +0.1 s | Positive = prepend silence; negative = trim start. |
Scale_factor | 1.5 | Positive varispeed factor. |
Random_rate_Hz | 8 | Random decisions per second; capped by synthetic-control safety. |
Random_depth | 0.3 | Clamped to 0–1. |
Random_seed | 0 | 0 = unpredictable; non-zero = reproducible. |
Max_gain | 20× | Safety ceiling for Power Shaping compression and Envelope Inversion. |
Normalization & output
Normalize defaults to on. After processing, the script measures the result peak and, if it is non-zero, runs Scale peak: 0.95. This is full peak normalization: it can either attenuate or amplify the processed result, so it can change the absolute gain created by the envelope. A fully silent result is left unchanged and normalization is reported as skipped.
Output naming depends on the processing family:
- Time Shift:
<source>_shifted - Time Scaling:
<source>_scaled - All envelope modes:
<source>_<PresetName>; with Custom this is<source>_Custom.
The result remains selected at the end. Play controls automatic playback.
Visualization
When Visualize is enabled, the script draws an AudioTools-style page with a header and summary strip.
Two waveform panels: Original and Result, followed by the summary strip.
Input waveform, Envelope panel, Result waveform, followed by the summary strip.
For Tremolo, Gate and Random, the green Envelope curve is the actual multiplicative gain control. For Power Shaping and Inversion it instead shows the target normalized output envelope (r^Exponent or 1-r), while the waveform is multiplied by the corresponding gain ratio; the summary reports the gain cap. The envelope axes use the Sound's actual start and end times.
The summary reports mode-specific parameters, source duration and sample rate, output duration and peak, preset, and whether normalization was applied, off, or skipped because the result was silent.
Validation & safety behavior
- Exactly one Sound is required and duration must be positive.
- Tremolo and Gate rates are capped to
min(audio Nyquist − 1 Hz, 5000 Hz). Random rate is capped at 5000 Hz. - Synthetic Tremolo/Gate/Random modulators normally use at least 2000 samples/s or 20 samples per requested control cycle. Their grid is capped at 100 kHz and 5,000,000 total control samples. On very long files the baseline may be reduced, but never below 200 Hz or 20 samples per cycle; if those requirements cannot fit the safety limit, the script stops.
- Time Scaling requires the intermediate sampling rate to stay between 100 Hz and 500 kHz, output duration to remain ≤1800 s, and the final output to contain at least about 10 samples.
- Negative Time Shift cannot delete the entire Sound; at least 1 ms is preserved.
- Parameter clamps and other adjustments are printed in the Info window.