Intensity Envelope Processor — User Guide
Six transformative methods for manipulating sound intensity envelopes: power shaping, sine modulation, rhythmic gating, time shifting, time scaling, and wave inversion.
What this does
This script provides six distinct methods for transforming sound intensity envelopes. It analyzes the intensity (loudness) contour of a sound, applies mathematical transformations to that envelope, then re-applies the modified envelope to the original audio. This creates dramatic or subtle changes in dynamics, rhythm, and timing while preserving the original spectral content.
Key Features:
- Six Processing Types: Power shaping, sine modulation, rhythmic gating, time shift, time scaling, wave inversion
- Two-Stage Interface: First choose method, then set type-specific parameters
- Preset System: 5 presets per method (Custom + 4 intensity levels)
- Intensity-Based Processing: Works on the amplitude envelope, not the waveform directly
- Non-Destructive Options: Can keep intermediate objects for analysis
- Musical Transformations: Creates effects ranging from subtle dynamics to extreme rhythmic manipulation
- Extracts the intensity contour from a sound using Praat's intensity analysis
- Transforms this intensity curve using mathematical operations
- Re-applies the modified envelope to the original sound
Advantages over waveform manipulation:
- Preserves spectral content: Only dynamics change, not pitch or timbre
- Musically meaningful: Loudness contours correspond to perceived dynamics
- Flexible: Can create effects difficult with standard audio processing
- Controllable: Parameters directly affect perceptual loudness changes
Technical Implementation: (1) Two-stage form: First selects processing type, then shows type-specific parameters. (2) Intensity extraction: Converts sound to intensity object with configurable pitch floor and time step. (3) Mathematical transformation: Applies formula based on selected method (power law, sine wave, gate function, etc.). (4) Envelope reapplication: Converts transformed intensity to IntensityTier, multiplies original sound. (5) Preset system: Each method has 4 intensity presets plus custom. (6) Cleanup options: Can retain or discard intermediate analysis objects.
Quick start
- In Praat, select exactly one Sound object.
- Run script… →
intensity_envelope_processor.praat. - STAGE 1: Choose Processing_type from 6 options:
- Power Shaping (dynamic range compression/expansion)
- Sine Modulation (rhythmic loudness oscillations)
- Rhythmic Gating (on/off amplitude gating)
- Time Shift (early/late timing)
- Time Scaling (compress/stretch duration)
- Wave Inversion (invert loudness contour)
- Click OK → STAGE 2: Type-specific parameters appear.
- Choose preset (Custom, Subtle, Medium, Heavy, Extreme) or set custom values.
- Adjust intensity extraction parameters if needed (minimum_pitch, time_step).
- Set method-specific parameters (exponent, frequency, shift amount, etc.).
- Configure output options (scale_intensities, play_after_processing, keep_intermediate_objects).
- Click OK — processing applied, result played and saved as "originalname_result".
Processing Methods
Method 1: Power Shaping
⚡ Dynamic Range Compression/Expansion
Formula: I_out = (I_in / intensity_scale)^exponent × intensity_scale
Effect: Applies power-law transformation to intensity values
Musical applications: Dynamic control, evening out levels, creating exaggerated dynamics, "pumping" effects.
Method 2: Sine Modulation
🌊 Rhythmic Loudness Oscillations
Formula: I_out = I_in × [center + depth × sin(x × frequency)]
Effect: Multiplies intensity by sine wave modulator
Musical applications: Tremolo effects, rhythmic pulsation, breathing-like dynamics, amplitude-based vibrato.
Method 3: Rhythmic Gating
⏱️ On/Off Amplitude Gating
Formula: I_out = I_in × [min_level + gate_depth × (sin(x×frequency) > 0)]
Effect: Rectified sine wave creates rhythmic on/off gating
Musical applications: Trance gates, rhythmic chopping, stutter effects, sidechain compression simulation.
Method 4: Time Shift
⏰ Early/Late Timing Adjustment
Operation: Shift intensity envelope in time
Effect: Makes loudness peaks occur earlier or later
Musical applications: Anticipation effects, syncopation, timing correction, creating "rushed" or "dragging" feels.
Method 5: Time Scaling
⏱️ Duration Compression/Expansion
Operation: Scale intensity envelope time axis
Effect: Makes dynamics evolve faster or slower
Musical applications: Slowing down/speeding up dynamics without pitch change, creating "suspended time" effects, rhythmic manipulation.
Method 6: Wave Inversion
🔄 Loudness Contour Inversion
Formula: I_out = midpoint - I_in
Effect: Inverts intensity values around a midpoint
Musical applications: Reverse dynamics, background/foreground reversal, unusual dynamic profiles, experimental effects.
Method Comparison
| Method | Primary Effect | Key Parameter | Typical Use | Preset Range |
|---|---|---|---|---|
| Power Shaping | Dynamic range control | exponent (0.5-4.0) | Compression/expansion | 1.3-4.0 |
| Sine Modulation | Rhythmic oscillation | frequency (2-25 Hz) | Tremolo, pulsation | 5-25 Hz |
| Rhythmic Gating | On/off chopping | gate_frequency (4-16 Hz) | Trance gate, stutter | 4-16 Hz |
| Time Shift | Timing adjustment | shift_amount (-0.8 to +0.8s) | Anticipation, syncopation | -0.15 to -0.8s |
| Time Scaling | Duration change | scale_factor (0.5-4.0) | Slow/fast dynamics | 1.3-4.0 |
| Wave Inversion | Dynamics reversal | midpoint (60-100 dB) | Reverse dynamics | 90-60 dB |
Two-Stage Interface
Stage 1: Method Selection
🎯 Choose Transformation Type
Purpose: Select which of the 6 processing methods to apply
Interface: Single option menu with 6 choices
User decision: Based on desired effect: dynamics control (Power), rhythmic modulation (Sine/Gating), timing (Shift/Scale), or inversion (Wave).
Stage 2: Parameter Configuration
- All methods include:
- Preset selector: Custom + 4 intensity levels
- Intensity extraction parameters: minimum_pitch, time_step, subtract_mean
- Output options: scale_intensities, play_after_processing, keep_intermediate_objects
- Method-specific parameters: Unique to each processing type
- Preset application: Choosing a preset auto-fills parameters
- Custom override: Even with preset selected, individual parameters can be modified
Preset System
Intensity Analysis Fundamentals
What is Intensity in Praat?
- Method: Root mean square (RMS) of amplitude in sliding windows
- Units: Decibels (dB) relative to auditory threshold
- Calculation: 10 × log₁₀(RMS² / reference) where reference = 2×10⁻⁵ Pa
- Temporal resolution: Controlled by time_step parameter
- Frequency sensitivity: Controlled by minimum_pitch (affects bandpass filtering)
Key properties for envelope processing:
- Perceptually relevant: dB scale corresponds to loudness perception
- Time-varying: Captures dynamic changes
- Robust: Less sensitive to phase than waveform amplitude
- Band-limited: Can focus on specific frequency ranges via minimum_pitch
Extraction Parameters
| Parameter | Default | Effect | Recommendations |
|---|---|---|---|
| minimum_pitch | 100 Hz | Lowest frequency considered in intensity calculation | Speech: 75-150 Hz, Music: 50-200 Hz, Higher = exclude low-frequency noise |
| time_step | 0.1 seconds | Time between intensity sample points | Smaller = smoother envelope but slower; 0.01-0.05s for detailed dynamics |
| subtract_mean | 1 (yes) | Remove DC offset from intensity curve | Usually keep enabled; prevents baseline shifts |
Intensity to IntensityTier Conversion
Scaling Considerations
Purpose: Normalizes the intensity values before application
Why needed: Intensity transformations can create values outside 0-1 range
Operation: Scales intensity tier to have maximum value = 1.0
Effect: Prevents clipping, maintains relative dynamics
Recommendation: Usually keep enabled (default: yes)
Disabling: Only if you want raw transformed values (risk of clipping)
Parameters & Presets
Common Parameters (All Methods)
| Parameter | Type | Default | Description |
|---|---|---|---|
| preset | optionMenu | Custom | Preset configuration (Custom + 4 intensity levels) |
| minimum_pitch | positive | 100 | Lowest frequency for intensity analysis (Hz) |
| time_step | positive | 0.1 | Time between intensity samples (seconds) |
| subtract_mean | boolean | 1 | Remove DC offset from intensity |
| scale_intensities | boolean | 1 | Normalize intensity to prevent clipping |
| play_after_processing | boolean | 1 | Auto-play result sound |
| keep_intermediate_objects | boolean | 0 | Keep analysis objects in Objects window |
Power Shaping Parameters
| Parameter | Default | Range | Description |
|---|---|---|---|
| exponent | 2.0 | 0.1-10.0 | Power law exponent (<1=compress, >1=expand) |
| intensity_scale | 100 | 10-1000 | Scaling factor for normalized intensity |
Sine Modulation Parameters
| Parameter | Default | Range | Description |
|---|---|---|---|
| modulation_frequency | 10 | 0.1-100 | Sine wave frequency (Hz) |
| modulation_center | 0.5 | 0.0-1.0 | Baseline modulation level |
| modulation_depth | 0.5 | 0.0-1.0 | Modulation depth (peak deviation) |
Rhythmic Gating Parameters
| Parameter | Default | Range | Description |
|---|---|---|---|
| gate_frequency | 8 | 0.1-100 | Gate cycling frequency (Hz) |
| minimum_level | 0.3 | 0.0-1.0 | Amplitude during "off" periods |
| maximum_level | 1.0 | 0.0-1.0 | Amplitude during "on" periods |
Time Shift Parameters
| Parameter | Default | Range | Description |
|---|---|---|---|
| shift_amount_seconds | -0.3 | -5.0 to +5.0 | Time shift (negative=earlier, positive=later) |
Time Scaling Parameters
| Parameter | Default | Range | Description |
|---|---|---|---|
| time_scale_factor | 2.0 | 0.1-10.0 | Time scaling factor (>1=stretch, <1=compress) |
Wave Inversion Parameters
| Parameter | Default | Range | Description |
|---|---|---|---|
| inversion_midpoint | 100 | 0-200 | Center value for intensity inversion |
Preset Values Summary
Processing Workflow
Complete Algorithm
Practical Examples
🗣️ Speech Enhancement
Goal: Improve intelligibility, add expressiveness
Method: Power Shaping
Settings:
- Preset: Medium (exponent=2.0)
- minimum_pitch: 100 Hz
- time_step: 0.05 s (smoother)
- subtract_mean: yes
Effect: Exaggerates dynamic contrasts, makes quiet syllables more audible, enhances expressive peaks.
🎵 Rhythmic Processing (Electronic Music)
Goal: Add rhythmic interest to sustained sounds
Method: Rhythmic Gating
Settings:
- Preset: Heavy (freq=12 Hz, min=0.15)
- minimum_pitch: 80 Hz
- time_step: 0.1 s
- keep_intermediate_objects: yes (to tweak)
Effect: Creates trance-like gating, rhythmic chopping, sidechain compression effect.
⏱️ Timing Manipulation (Sound Design)
Goal: Create anticipation or dragged timing
Method: Time Shift
Settings:
- Preset: Extreme (shift=-0.8s)
- time_step: 0.15 s
- scale_intensities: yes
Effect: Makes loudness peaks occur 0.8 seconds earlier, creating rushed, anticipatory feel.
Advanced Techniques
- Run Power Shaping (Medium) to enhance dynamics
- Take result, run Sine Modulation (Subtle) to add pulsation
- Take result, run Time Shift (Light) to adjust timing
- Result: Complex multi-stage envelope transformation
Tip: Use keep_intermediate_objects=yes when chaining to preserve workflow.
- Power + Sine: First compress (exponent=0.7), then add slow modulation (freq=2 Hz)
- Gate + Shift: Rhythmic gating (freq=6 Hz) with slight early shift (-0.1s)
- Invert + Power: Invert dynamics (midpoint=80), then expand (exponent=1.5)
- Scale + Gate: Slow down dynamics (factor=1.8), then add fast gate (freq=20 Hz)
Troubleshooting
Causes: intensity extraction failed, scale_intensities=no with low values, extreme inversion
Solutions: Check minimum_pitch below sound's fundamental, enable scale_intensities, use Moderate preset first
Causes: scale_intensities=no with high values, extreme power shaping (exponent>3)
Solutions: Enable scale_intensities, reduce exponent or intensity_scale
Causes: time_step too large, insufficient temporal resolution
Solutions: Reduce time_step to 0.01-0.05 seconds
Causes: Time shift/scaling with wrong sign or factor
Solutions: For Time Shift: negative=earlier, positive=later. For Time Scaling: >1=slower, <1=faster.
Causes: Praat version incompatible, script corruption, no sound selected
Solutions: Ensure Praat ≥6.2, re-download script, select exactly one Sound object
Performance Considerations
- Sound duration: Longer sounds take proportionally longer
- time_step: Smaller values increase intensity point count
- Method complexity: Sine/Gating involve trigonometric calculations
- keep_intermediate_objects: No performance impact, just memory
- Use larger time_step (0.1s) for initial experimentation
- Process shorter segments first to test parameters
- For long sounds, consider extracting representative portion
- Disable play_after_processing for batch processing