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.

Type: Multi-parameter Audio Transformation Methods: 6 distinct processing types Input: Sound intensity analysis Implementation: Praat Script with Two-Stage Interface
Contents:

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:

What are intensity envelopes? An intensity envelope represents how loudness evolves over time. This script:
  1. Extracts the intensity contour from a sound using Praat's intensity analysis
  2. Transforms this intensity curve using mathematical operations
  3. 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

  1. In Praat, select exactly one Sound object.
  2. Run script…intensity_envelope_processor.praat.
  3. 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)
  4. Click OKSTAGE 2: Type-specific parameters appear.
  5. Choose preset (Custom, Subtle, Medium, Heavy, Extreme) or set custom values.
  6. Adjust intensity extraction parameters if needed (minimum_pitch, time_step).
  7. Set method-specific parameters (exponent, frequency, shift amount, etc.).
  8. Configure output options (scale_intensities, play_after_processing, keep_intermediate_objects).
  9. Click OK — processing applied, result played and saved as "originalname_result".
Quick tip: Start with presets to hear each method's character. For speech: Try "Power Shaping" with Medium preset to enhance dynamics. For music: Try "Rhythmic Gating" with Heavy preset for dramatic rhythmic effects. Use Sine Modulation with low frequency (2-5 Hz) for breathing-like effects. Time Shift with negative values creates "early" anticipation effects. Enable keep_intermediate_objects to inspect the intensity analysis. The scale_intensities option normalizes output to prevent clipping — usually keep enabled.
Important: The script works on intensity envelopes, not the raw waveform. Very quiet sounds may have poor intensity estimation. minimum_pitch should be below the fundamental frequency of the sound (100 Hz works for most speech/music). time_step controls temporal resolution — smaller = smoother but slower processing. subtract_mean removes DC offset from intensity — usually keep enabled. Extreme parameter values can create unnatural or distorted results — start with presets. Time scaling changes duration — result may be longer/shorter than original. Output sound is mono (intensity processing is monophonic).

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

Exponent behavior: exponent < 1.0: Compression (reduce dynamic range) Quiet parts become relatively louder exponent = 1.0: No change (linear) exponent > 1.0: Expansion (increase dynamic range) Loud parts become relatively louder exponent = 2.0: Quadratic (squaring) Example with intensity_scale=100: I_in=25 → (25/100)²×100 = 0.0625×100 = 6.25 (quieter) I_in=50 → (50/100)²×100 = 0.25×100 = 25.0 I_in=75 → (75/100)²×100 = 0.5625×100 = 56.25 I_in=100 → (100/100)²×100 = 1.0×100 = 100.0

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

Parameters: frequency = oscillations per second (Hz) center = baseline modulation level (0-1) depth = modulation depth (0-1) Example: center=0.5, depth=0.5, frequency=10 Hz Modulation varies between: Minimum: 0.5 + 0.5×(-1) = 0.0 (silence at trough) Maximum: 0.5 + 0.5×(+1) = 1.0 (full amplitude at peak) Waveform: I_in × [0.5 + 0.5×sin(2π×10×t)]

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

Gate function: (sin(x×frequency) > 0) Returns 1 when sine positive, 0 when negative Parameters: frequency = gate cycles per second (Hz) min_level = minimum level during "off" periods (0-1) max_level = maximum level during "on" periods (0-1) gate_depth = max_level - min_level Example: min_level=0.3, max_level=1.0, frequency=8 Hz Gate alternates between: Off: 0.3 × I_in (30% amplitude) On: 1.0 × I_in (full amplitude) Duty cycle: 50% (equal on/off)

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

Shift operation: I_out(t) = I_in(t + shift) Parameters: shift_amount_seconds = time shift (negative = earlier, positive = later) Examples: shift = -0.3 → intensity peaks occur 0.3 seconds EARLIER shift = +0.2 → intensity peaks occur 0.2 seconds LATER Boundary handling: Praat's "Shift times to" handles boundaries gracefully Early shifts leave silence at end Late shifts leave silence at beginning

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

Scaling operation: I_out(t) = I_in(t × scale_factor) [for scale_factor ≥ 1] I_out(t) = I_in(t / scale_factor) [for scale_factor < 1] Parameters: time_scale_factor = scaling factor >1.0 = stretch (slower dynamics) <1.0 = compress (faster dynamics) Examples: factor = 2.0 → dynamics take twice as long factor = 0.5 → dynamics happen twice as fast Duration change: Output duration = original_duration × time_scale_factor

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

Inversion operation: I_out = midpoint - I_in Parameters: inversion_midpoint = center value for inversion Examples (with midpoint=80): I_in=60 → I_out=80-60=20 (quiet becomes loud) I_in=80 → I_out=80-80=0 (mid becomes quiet) I_in=100 → I_out=80-100=-20 (clipped to 0 or scaled) Effect: Loud parts become quiet, quiet parts become loud Creates "negative" of intensity contour

Musical applications: Reverse dynamics, background/foreground reversal, unusual dynamic profiles, experimental effects.

Method Comparison

MethodPrimary EffectKey ParameterTypical UsePreset Range
Power ShapingDynamic range controlexponent (0.5-4.0)Compression/expansion1.3-4.0
Sine ModulationRhythmic oscillationfrequency (2-25 Hz)Tremolo, pulsation5-25 Hz
Rhythmic GatingOn/off choppinggate_frequency (4-16 Hz)Trance gate, stutter4-16 Hz
Time ShiftTiming adjustmentshift_amount (-0.8 to +0.8s)Anticipation, syncopation-0.15 to -0.8s
Time ScalingDuration changescale_factor (0.5-4.0)Slow/fast dynamics1.3-4.0
Wave InversionDynamics reversalmidpoint (60-100 dB)Reverse dynamics90-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

Option menu choices: 1. Power Shaping 2. Sine Modulation 3. Rhythmic Gating 4. Time Shift (Early/Late) 5. Time Scaling (Compress/Stretch) 6. Wave Inversion Design rationale: - Separates method choice from parameter setting - Clean interface: only relevant parameters shown - Logical workflow: what → how

User decision: Based on desired effect: dynamics control (Power), rhythmic modulation (Sine/Gating), timing (Shift/Scale), or inversion (Wave).

Stage 2: Parameter Configuration

Dynamic form generation: After method selection, a type-specific parameter form appears:
  • 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

Each method has 5 preset options: 1. Custom: User sets all parameters manually 2. Subtle: Mild transformation (good for natural enhancement) 3. Medium: Noticeable but not extreme (default starting point) 4. Heavy: Strong transformation (clear artistic effect) 5. Extreme: Maximum transformation (experimental/abstract) Preset implementation: if preset = 2: apply Subtle parameters if preset = 3: apply Medium parameters if preset = 4: apply Heavy parameters if preset = 5: apply Extreme parameters User workflow: Start with Medium preset → listen → adjust as needed Or jump to Extreme for dramatic effects

Intensity Analysis Fundamentals

What is Intensity in Praat?

Praat's intensity object: Represents sound pressure level (SPL) over time, calculated as:
  • 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

ParameterDefaultEffectRecommendations
minimum_pitch100 HzLowest frequency considered in intensity calculationSpeech: 75-150 Hz, Music: 50-200 Hz, Higher = exclude low-frequency noise
time_step0.1 secondsTime between intensity sample pointsSmaller = smoother envelope but slower; 0.01-0.05s for detailed dynamics
subtract_mean1 (yes)Remove DC offset from intensity curveUsually keep enabled; prevents baseline shifts

Intensity to IntensityTier Conversion

Processing chain: 1. Sound → Intensity (analysis with parameters) 2. Intensity → (transformation via formula) 3. Intensity → IntensityTier (point-based representation) 4. Sound × IntensityTier = Result (envelope application) IntensityTier properties: - Point-based: (time, value) pairs - Linear interpolation between points - Compatible with Praat's Multiply function - Preserves timing of intensity changes Mathematical operation: result[t] = sound[t] × (10^(intensity_tier[t]/20) / reference) Simplified: amplitude multiplied by envelope gain factor

Scaling Considerations

Important: scale_intensities option
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)

ParameterTypeDefaultDescription
presetoptionMenuCustomPreset configuration (Custom + 4 intensity levels)
minimum_pitchpositive100Lowest frequency for intensity analysis (Hz)
time_steppositive0.1Time between intensity samples (seconds)
subtract_meanboolean1Remove DC offset from intensity
scale_intensitiesboolean1Normalize intensity to prevent clipping
play_after_processingboolean1Auto-play result sound
keep_intermediate_objectsboolean0Keep analysis objects in Objects window

Power Shaping Parameters

ParameterDefaultRangeDescription
exponent2.00.1-10.0Power law exponent (<1=compress, >1=expand)
intensity_scale10010-1000Scaling factor for normalized intensity

Sine Modulation Parameters

ParameterDefaultRangeDescription
modulation_frequency100.1-100Sine wave frequency (Hz)
modulation_center0.50.0-1.0Baseline modulation level
modulation_depth0.50.0-1.0Modulation depth (peak deviation)

Rhythmic Gating Parameters

ParameterDefaultRangeDescription
gate_frequency80.1-100Gate cycling frequency (Hz)
minimum_level0.30.0-1.0Amplitude during "off" periods
maximum_level1.00.0-1.0Amplitude during "on" periods

Time Shift Parameters

ParameterDefaultRangeDescription
shift_amount_seconds-0.3-5.0 to +5.0Time shift (negative=earlier, positive=later)

Time Scaling Parameters

ParameterDefaultRangeDescription
time_scale_factor2.00.1-10.0Time scaling factor (>1=stretch, <1=compress)

Wave Inversion Parameters

ParameterDefaultRangeDescription
inversion_midpoint1000-200Center value for intensity inversion

Preset Values Summary

Power Shaping presets: Subtle: exponent=1.3 Medium: exponent=2.0 (default) Heavy: exponent=3.0 Extreme: exponent=4.0 Sine Modulation presets: Subtle: freq=5, center=0.7, depth=0.2 Medium: freq=10, center=0.5, depth=0.5 (default) Heavy: freq=15, center=0.5, depth=0.45 Extreme: freq=25, center=0.5, depth=0.48 Rhythmic Gating presets: Subtle: freq=4, min=0.5, max=1.0 Medium: freq=8, min=0.3, max=1.0 (default) Heavy: freq=12, min=0.15, max=1.0 Extreme: freq=16, min=0.05, max=1.0 Time Shift presets: Subtle: shift=-0.15s, time_step=0.08 Medium: shift=-0.3s, time_step=0.1 (default) Heavy: shift=-0.5s, time_step=0.12 Extreme: shift=-0.8s, time_step=0.15 Time Scaling presets: Subtle: factor=1.3 Medium: factor=2.0 (default) Heavy: factor=3.0 Extreme: factor=4.0 Wave Inversion presets: Subtle: midpoint=90 Medium: midpoint=80 (default) Heavy: midpoint=70 Extreme: midpoint=60

Processing Workflow

Complete Algorithm

1. INPUT VALIDATION Check: Sound object selected Exit if no sound 2. STAGE 1: METHOD SELECTION Form: "Intensity Envelope Processor - Select Type" User chooses processing_type (1-6) Form closes, script continues 3. STAGE 2: PARAMETER CONFIGURATION Based on processing_type: Show type-specific form with parameters User sets values or chooses preset If preset chosen: auto-fill parameters User clicks OK/Cancel If Cancel: exit script 4. PROCESSING INITIALIZATION Store original sound and name Determine suffix based on processing_type Copy sound: originalName + suffix 5. INTENSITY EXTRACTION intensity_obj = To Intensity: minimum_pitch, time_step, subtract_mean 6. INTENSITY TRANSFORMATION Apply formula based on processing_type: Type 1 (Power): (self/intensity_scale)^exponent × intensity_scale Type 2 (Sine): self × (center + depth × sin(x×frequency)) Type 3 (Gate): self × (min_level + gate_depth × (sin(x×frequency) > 0)) Type 4 (Shift): Shift times to: start time, shift_amount Type 5 (Scale): Scale times by/scale times to Type 6 (Invert): midpoint - self 7. ENVELOPE APPLICATION intensity_tier = Down to IntensityTier Select original_sound + intensity_tier Multiply: scale_intensities Rename: originalName + "_result" 8. OUTPUT AND CLEANUP If play_after_processing: Play result If not keep_intermediate_objects: Remove: copy_sound, intensity_obj, intensity_tier Else: keep all objects Select result_sound

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

Chaining multiple processes:
  1. Run Power Shaping (Medium) to enhance dynamics
  2. Take result, run Sine Modulation (Subtle) to add pulsation
  3. Take result, run Time Shift (Light) to adjust timing
  4. Result: Complex multi-stage envelope transformation

Tip: Use keep_intermediate_objects=yes when chaining to preserve workflow.

Creative parameter combinations:
  • 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

Problem: No sound or very quiet output
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
Problem: Clipping/distortion
Causes: scale_intensities=no with high values, extreme power shaping (exponent>3)
Solutions: Enable scale_intensities, reduce exponent or intensity_scale
Problem: Unnatural "stepped" envelope
Causes: time_step too large, insufficient temporal resolution
Solutions: Reduce time_step to 0.01-0.05 seconds
Problem: Incorrect timing effects
Causes: Time shift/scaling with wrong sign or factor
Solutions: For Time Shift: negative=earlier, positive=later. For Time Scaling: >1=slower, <1=faster.
Problem: Script errors or no form appears
Causes: Praat version incompatible, script corruption, no sound selected
Solutions: Ensure Praat ≥6.2, re-download script, select exactly one Sound object

Performance Considerations

Processing speed factors:
  • 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
Optimization tips:
  • 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