Dynamic convolution processing: generates impulse responses based on acoustic features (intensity/pitch) and convolves them with the original sound for self-modulating effects.
Author: Based on Praat AudioTools by Shai CohenVersion: 2025Process: Feature detection → Impulse generation → Convolution
This script implements feedback-aware convolution — a dynamic audio processing technique that generates impulse responses based on the acoustic characteristics of the input sound itself. The process: (1) Feature extraction: Analyze the sound for intensity or pitch content, (2) Threshold detection: Identify moments where features exceed user-defined thresholds, (3) Impulse generation: Create an impulse train where each impulse corresponds to a detected event, (4) Amplitude mapping: Scale impulse amplitudes based on feature values, (5) Convolution: Convolve the original sound with the generated impulse train. Result: self-modulating effects where the processing is dynamically controlled by the audio's own characteristics.
Key Features:
Dual Detection Modes — Intensity-based or pitch-based impulse generation
Temporal Control — Minimum spacing prevents impulse crowding
High Precision — Configurable sampling rate for accurate detection
Self-Modulating Effects — Processing responds to input characteristics
What is feedback-aware convolution? Traditional convolution: fixed impulse response applied to entire signal. Feedback-aware convolution: impulse response dynamically generated from the signal's own features. Advantages: (1) Adaptive processing: Effect intensity varies with input characteristics, (2) Musical response: Processing follows musical events, (3) Creative possibilities: Self-modulating, evolving effects, (4) Natural dynamics: Preserves and enhances original performance nuances, (5) Novel textures: Creates complex, feedback-like behaviors. Use cases: Music production (dynamic effects), sound design (evolving textures), experimental music (self-modulating systems), audio restoration (feature-aware processing), interactive systems (responsive audio effects).
Technical Implementation: (1) Parameter extraction: Create Intensity or Pitch objects from input sound. (2) Event detection: Sample parameter values and detect threshold crossings. (3) Impulse generation: Create Gaussian-windowed impulses at event times. (4) Amplitude mapping: Scale impulse amplitudes based on parameter values. (5) Convolution: Apply standard convolution with generated impulse train. (6) Cleanup: Remove intermediate objects. Key insight: Audio features → event detection → dynamic impulse response → convolution = self-modulating processing.
Quick start
In Praat, select exactly one Sound object.
Run script… → feedback_aware_convolution.praat.
Choose parameter type: Intensity (energy-based) or Pitch (melody-based).
Set detection threshold appropriate for your audio and mode.
Adjust minimum impulse spacing to control density (0.05s typical).
Click OK — processes audio, creates "originalname_feedback_conv" output.
Quick tip: Start with Intensity mode + threshold 65 dB for general audio. Use Pitch mode + threshold 200 Hz for melodic material. Set minimum spacing 0.05-0.1s for musical results. Check Info window for detection statistics and adjust threshold accordingly. For sparse effects, use higher thresholds and longer minimum spacing. For dense textures, use lower thresholds and shorter minimum spacing.
Important:THRESHOLD SEMANTICS DIFFER BY MODE — intensity threshold in dB, pitch threshold in Hz. No impulses detected usually means threshold is too high. Very dense impulse trains can create overwhelming results. Pitch mode requires sounds with clear pitch content. Check Info window for actual parameter ranges in your sound. Intermediate objects are automatically cleaned up. Processing time depends on audio length and detection precision.
Feedback Convolution Theory
Traditional vs Feedback-Aware Convolution
Standard Convolution
Mathematical foundation:
Standard convolution:
y(t) = ∫ x(τ) · h(t - τ) dτ
Where:
x(t) = input signal
h(t) = impulse response (fixed)
y(t) = output signal
Characteristics:
- Linear, time-invariant system
- Impulse response h(t) is constant
- Same processing applied to entire signal
- Examples: reverb, filtering, echo
Limitation:
- No adaptation to input signal content
- Static processing regardless of musical events
Feedback-Aware Convolution
Dynamic impulse response generation:
Feedback-aware convolution:
y(t) = ∫ x(τ) · h(t, τ) dτ
Where h(t, τ) is now time-dependent and generated from x(t):
h(t, τ) = generate_impulses_from_features(x(t))
Process:
1. Extract features f(t) from x(t) (intensity/pitch)
2. Detect events: times tᵢ where f(tᵢ) > threshold
3. Generate impulses at tᵢ with amplitudes ∝ f(tᵢ)
4. Convolve x(t) with generated impulse train
Result: Adaptive processing that responds to input characteristics
Event Detection and Impulse Generation
Threshold Crossing Detection
Parameter sampling and event identification:
Detection process:
FOR each sample time t at rate parameter_sample_rate:
value = get_parameter_value(t)
IF value > detection_threshold AND
(t - last_impulse_time) ≥ min_impulse_spacing:
ADD impulse at time t
SET impulse_amplitude ∝ (value - threshold)
UPDATE last_impulse_time = t
Key concepts:
- parameter_sample_rate: Temporal precision of detection
- detection_threshold: Sensitivity control
- min_impulse_spacing: Density control (refractory period)
- Amplitude mapping: Strength reflects parameter value
Visual example (Intensity mode):
Sound: ▁▂▃▄▅▆▇█▇▆▅▄▃▂▁
Threshold: ────────────────
Detected: ↑ ↑ ↑
Impulses: • • •
Amplitudes: ▴ ▴ ▴
Gaussian Impulse Generation
Temporal impulse characteristics:
Gaussian impulse formula:
impulse(t) = amplitude × exp(-((t - t₀) / (duration/6))²)
Where:
t₀ = impulse center time
duration = impulse_duration parameter
amplitude = mapped from parameter value
Properties:
- Smooth onset and offset
- No sharp discontinuities
- Controlled temporal width
- Natural-sounding impulses
Amplitude mapping:
IF parameter_type$ = "intensity":
normalized = (value - 40) / 40 # 40-80 dB range
ELSE: # pitch mode
normalized = (value - threshold) / threshold
amplitude = max(0, min(1, normalized)) × amplitude_mapping_strength
Complete Processing Pipeline
INPUT: Sound object
STEP 1: PARAMETER EXTRACTION
IF parameter_type$ = "intensity":
Create Intensity object (75 Hz floor, 1ms resolution)
Convert to IntensityTier for sampling
ELSE: # pitch mode
Create Pitch object with user pitch_floor/pitch_ceiling
STEP 2: THRESHOLD DETECTION
Initialize: impulse_count = 0, last_impulse_time = -1
IF intensity mode:
FOR each point in IntensityTier:
IF value > threshold AND spacing_ok:
Store impulse time and value
impulse_count += 1
ELSE: # pitch mode
FOR time from 0 to duration in 1/parameter_sample_rate steps:
value = Get pitch at time (if defined)
IF value > threshold AND spacing_ok:
Store impulse time and value
impulse_count += 1
STEP 3: IMPULSE TRAIN GENERATION
Create silent sound of same duration as input
FOR each detected impulse i:
time = impulse_time_i
value = impulse_value_i
# Calculate amplitude from parameter value
amplitude = map_parameter_to_amplitude(value, threshold)
# Add Gaussian impulse at time
Formula (part): time ± duration/2,
"self + amplitude × exp(-((x-time)/(duration/6))²)"
STEP 4: CONVOLUTION
Convolve original sound with impulse train
Method: "integral", "zero" padding
Normalize output to prevent clipping
STEP 5: CLEANUP AND OUTPUT
Remove intermediate objects
Rename and select result
Play output
OUTPUT: Sound with feedback-aware convolution applied
Parameter Detection Modes
Mode 1: Intensity-Based Detection
📊 Energy-Driven Processing
Principle: Detect loudness peaks and generate impulses
Analysis: Praat Intensity object with 75 Hz floor
Threshold Range: 50-80 dB typical for speech/music
Output: List of impulse times and parameter values
Statistics: Impulse count reported for tuning
Detection Algorithm
Detection pseudocode:
impulse_count = 0
last_impulse_time = -min_impulse_spacing # Allow first impulse at t=0
FOR each sampling time t:
value = get_parameter_value(t)
IF value ≠ undefined AND value > detection_threshold:
time_since_last = t - last_impulse_time
IF time_since_last ≥ min_impulse_spacing:
impulse_count += 1
impulse_time[impulse_count] = t
impulse_value[impulse_count] = value
last_impulse_time = t
IF impulse_count ≥ max_impulses (safety limit):
BREAK with warning
Key features:
- Respects minimum spacing (refractory period)
- Handles undefined values (pitch mode)
- Safety limit prevents memory issues
- Stores both time and value for amplitude mapping
Step 3: Impulse Train Generation
⚡ Dynamic Impulse Response
Purpose: Create convolution kernel from detected events
Method: Gaussian-windowed impulses at event times
Amplitude: Mapped from parameter values
Character: Smooth, natural-sounding impulses
Impulse Generation Details
Amplitude mapping:
IF intensity mode:
# Map from typical 40-80 dB range to 0-1
normalized = (value - 40) / 40
IF pitch mode:
# Map relative to threshold
normalized = (value - threshold) / threshold
# Apply clamping and strength
normalized = max(0, min(1, normalized))
amplitude = normalized × amplitude_mapping_strength
Gaussian impulse formula:
impulse(t) = amplitude × exp(-((t - t₀) / σ)²)
WHERE σ = impulse_duration / 6
Rationale for σ = duration/6:
Gaussian drops to ~0.0001 at ±3σ from center
So 6σ ≈ impulse_duration covers most energy
Creates smooth, well-localized impulses
Step 4: Convolution and Output
🎚️ Final Processing
Method: Standard convolution with generated impulse train
Parameters: "integral" method with "zero" padding
Normalization: Automatic peak scaling to prevent clipping
Convolution command:
select original_sound
plus impulse_train
Convolve: "integral", "zero"
Parameters:
"integral": Suitable for impulse response convolution
"zero": Zero-padding at boundaries
Normalization:
peak = Get maximum absolute amplitude
IF peak > 0.99:
Formula: "self × 0.99 / peak"
Cleanup sequence:
Remove: impulse_train
Remove: parameter_object (IntensityTier or Pitch)
Select: convolved_result
Rename: originalname_feedback_conv
Play result
Final output:
Clean object list with only original and result
Automatic playback for immediate evaluation
Parameters & Settings
Core Detection Parameters
Parameter
Type
Default
Description
Parameter_type
optionmenu
Intensity
Feature used for detection (Intensity/Pitch)
Detection_threshold
positive
75
Threshold for impulse generation
Pitch_floor_(Hz)
positive
80
Minimum pitch for analysis (pitch mode)
Pitch_ceiling_(Hz)
positive
600
Maximum pitch for analysis (pitch mode)
Temporal Control Parameters
Parameter
Type
Default
Description
Minimum_impulse_spacing_(seconds)
positive
0.05
Refractory period between impulses
Impulse_duration_(seconds)
positive
0.0003
Temporal width of each impulse
Parameter_sample_rate_(Hz)
positive
1000
Temporal resolution for detection
Amplitude Control Parameters
Parameter
Type
Default
Description
Amplitude_mapping_strength
positive
1.0
How strongly values affect impulse amplitude
Parameter Guidelines and Ranges
Detection_threshold (mode-dependent):
Intensity mode (dB):
50-55: Very sensitive (many impulses)
60-65: Moderate sensitivity
70-75: Selective detection
80+: Very selective (few impulses)
Pitch mode (Hz):
150-200: Sensitive to mid/high pitches
200-250: Moderate sensitivity
250-300: Selective for high pitches
300+: Very selective (very high pitches)
Minimum_impulse_spacing (seconds):
0.02: Very dense (50 impulses/second max)
0.05: Moderate density (20 impulses/second)
0.10: Sparse (10 impulses/second)
0.20: Very sparse (5 impulses/second)
Impulse_duration (seconds):
0.0001: Very narrow impulses
0.0003: Typical (0.3 ms)
0.0010: Wide impulses
0.0030: Very wide impulses
Amplitude_mapping_strength:
0.5: Subtle amplitude variation
1.0: Normal variation
2.0: Strong variation
3.0: Extreme variation
Parameter_sample_rate (Hz):
500: Lower precision, faster
1000: Good balance (default)
2000: High precision, slower
5000: Very high precision, much slower
Applications
Music Production
Use case: Creating dynamic, self-modulating effects
Technique: Use intensity mode for rhythmic elements, pitch mode for melodic content
Example: Drum loops with intensity-driven convolution for rhythmic complexity
Sound Design
Use case: Generating evolving textures from simple sounds
Technique: Extreme settings with high amplitude mapping
Example: Turning simple tones into complex, self-modulating pads
Voice Processing
Use case: Creative vocal effects and transformations
Technique: Pitch mode for singing, intensity mode for speech
Example: Vocal tracks with pitch-following convolution effects
Experimental Music
Use case: Creating feedback-like systems and complex behaviors
Technique: Serial processing with different parameter sets
Example: Multi-stage feedback convolution for chaotic textures
Slow processing: Increase time step, use lower sample rate
Pitch mode not working: Check if sound has clear pitch, adjust floor/ceiling
Troubleshooting Common Issues
Problem: No impulses detected Cause: Threshold too high or parameter out of range Solution: Lower threshold, check Info window for actual parameter range
Problem: Too dense/overwhelming result Cause: Threshold too low or spacing too short Solution: Increase threshold, increase minimum spacing
Problem: Pitch mode detects nothing Cause: Sound has no clear pitch or range incorrect Solution: Use intensity mode, or adjust pitch floor/ceiling
Problem: Processing very slow Cause: High sample rate on long audio Solution: Reduce parameter_sample_rate, use larger time steps
Problem: Output too quiet or too loud Cause: Amplitude mapping extreme or impulse density issues Solution: Adjust amplitude_mapping_strength, normalize after processing