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.

Author: Shai Cohen Version: 1.6 (2026) Input: exactly one Sound Output: same channel count as the input
Contents:

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.

Important distinction: this is no longer an IntensityTier-based processor. Envelope modes multiply the waveform directly with an explicit gain modulator. This avoids Praat's hidden peak rescaling in the older 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

  1. Select exactly one Sound object.
  2. Run Intensity_Envelope_Processor.praat.
  3. Choose a Preset, or leave Custom and choose one of the seven Mode options.
  4. Leave Advanced_settings off for the built-in defaults, or enable it to edit the mode parameters.
  5. Normalize defaults to on, Visualize defaults to on, and Play defaults to on.
Preset precedence: named presets set the mode and the parameters listed in the preset table after the Advanced dialog has been read. Advanced values not replaced by that preset (for example Max_gain or Tremolo phase) remain available.

Presets

PresetModeValues imposed by the presetOutput suffix
CustomUses the selected ModeNo mode-specific override_Custom for envelope modes
Soft CompressionPower ShapingExponent = 0.5_SoftComp
Hard ExpansionPower ShapingExponent = 3.0_HardExp
Gentle TremoloTremoloRate = 3 Hz; depth = 0.3; center = 0.7_GentleTrem
Fast TremoloTremoloRate = 8 Hz; depth = 0.5; center = 0.5_FastTrem
Rhythmic ChopGatingRate = 4 Hz; duty = 50%; min = 0; max = 1; smoothing = 2 ms_RhythmChop
Smooth GateGatingRate = 2 Hz; duty = 70%; min = 0.1; max = 1; smoothing = 20 ms_SmoothGate
Tape SlowdownTime ScalingScale factor = 2.0_scaled
Reverse DynamicsEnvelope InversionMode only; uses the current Max_gain_ReverseDyn
Random FlutterRandom ModulationRate = 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:

r(t) = 10^((I(t) - Imax) / 20) r is floored at 0.0001 visual target envelope = r^Exponent applied waveform gain = min(r^(Exponent - 1), Max_gain)

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

safeDepth = min(Tremolo_depth, Tremolo_center, 1 - Tremolo_center) g(t) = center + safeDepth * sin(2*pi*rate*(t - sourceStart) + phase*pi/180)

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.

duty = Gate_duty_percent / 100 riseWidth(cycles) = Gate_smoothing_ms/1000 * Gate_rate_Hz riseWidth <= 0.98 * min(duty, 1-duty)

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

intermediate sampling frequency = original_SR / Scale_factor new duration = original_duration * Scale_factor then resample back to original_SR (quality 50)

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

r(t) = 10^((I(t) - Imax) / 20), floored at 0.0001 visual target envelope = 1 - r applied gain = min((1 - r) / r, Max_gain)

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:

ParameterDefaultMeaning / enforced behavior
Exponent2.0Power-shaping exponent.
Tremolo_rate_Hz5.0Positive input; additionally capped by synthetic/Nyquist safety limits.
Tremolo_depth0.5Requested depth; clamped ≥0, then reduced to a center-safe depth if needed.
Tremolo_center0.5Clamped to 0–1.
Tremolo_phasePhase offset in degrees.
Gate_rate_Hz4.0Positive input; capped by synthetic/Nyquist safety limits.
Gate_duty_percent50Clamped to 0–100%.
Gate_max1.0High gain. Min/max are swapped if inverted, then both clamped to 0–1.
Gate_min0.0Low gain.
Gate_smoothing_ms5 msRequested cosine transition duration, additionally limited by duty cycle.
Shift_seconds+0.1 sPositive = prepend silence; negative = trim start.
Scale_factor1.5Positive varispeed factor.
Random_rate_Hz8Random decisions per second; capped by synthetic-control safety.
Random_depth0.3Clamped to 0–1.
Random_seed00 = unpredictable; non-zero = reproducible.
Max_gain20×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:

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.

Time Shift / Time Scale
Two waveform panels: Original and Result, followed by the summary strip.
Envelope modes
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