Pitch Processor — User Guide
Advanced pitch processing with two distinct modes: Instant Stereo Harmonizer creates stereo width through sample rate manipulation, while Time-Delayed Canon generates multi-voice polyphonic textures with precise timing and pitch control.
What this does
This script implements advanced pitch processing with two fundamentally different approaches to audio manipulation. Mode 1: Instant Stereo Harmonizer creates stereo width and subtle pitch differences by processing left and right channels with different sample rates before combining to stereo. Mode 2: Time-Delayed Canon generates complex polyphonic textures by creating multiple delayed voices, each with precise pitch shifting and amplitude control, mixed down to a rich mono result.
Key Features:
- Two Distinct Processing Modes — Stereo harmonization vs. polyphonic canon
- 3 Built-in Canon Presets — Major arpeggio, cluster, octave textures
- Precise Pitch Control — Semitone-accurate pitch shifting
- Temporal Precision — Sample-accurate voice timing
- Dynamic Control — Progressive amplitude envelopes
- High-Quality Resampling — Configurable resampling precision
Technical Implementation: (1) Mode 1 (Stereo Harmonizer): Create two copies of source, apply different sample rates to each channel (left: original rate, right: overridden rate), resample both to target rate, combine to stereo. (2) Mode 2 (Time-Delayed Canon): For each voice: calculate pitch shift factor (2^(semitones/12)), override sampling frequency to achieve pitch shift, resample to target rate, apply precise delay through zero-padding, scale intensity based on voice position, mix all voices with careful duration matching. (3) Quality control: High-precision resampling (50-point by default), sample-rate conversion, peak normalization, intermediate object cleanup. Key insight: Pitch shifting via sample rate manipulation preserves audio quality when combined with high-quality resampling. Temporal precision achieved through mathematical sample calculation and zero-padding.
Quick start
- In Praat, select exactly one Sound object.
- Run script… →
pitch_processor.praat. - Choose Operation Mode: Instant Stereo Harmonizer or Time-Delayed Canon.
- For Stereo Harmonizer:
- Set Override_sample_rate for right channel (default 40000 Hz)
- For Time-Delayed Canon:
- Choose Preset or "Custom" for manual control
- Set Number_of_voices (polyphony level)
- Adjust Delay_between_entries (voice timing)
- Set Semitone_step (pitch interval between voices)
- Configure Wrap_to_octave (limit pitch range)
- Set Start_intensity_dB and Intensity_step_dB
- Configure Global Settings:
- Output_sample_rate (default 44100 Hz)
- Resample_precision (quality, default 50)
- Play_after_processing (immediate preview)
- Keep_intermediate_objects (debugging)
- Click OK — processing applied, result appears in Objects window.
Operation Modes
Mode 1: Instant Stereo Harmonizer
🎧 Stereo Width Enhancement
Concept: Creates stereo image from mono sources through subtle pitch and timing differences
Technique: Independent sample rate processing for left/right channels
Result: Psychoacoustically enhanced stereo width
Best for: Mono-to-stereo conversion, subtle spatial enhancement
Processing Pipeline:
How Stereo Harmonization Works
Psychoacoustic principles:
Left channel: Original sample rate → resampled to target
Right channel: Overridden sample rate → resampled to target
Resulting Differences:
1. Micro-timing variations: Slight phase differences
2. Subtle pitch variations: Minor frequency shifts
3. Spectral variations: Different resampling artifacts
Perceptual Result:
Brain interprets differences as spatial information
Creates impression of stereo width and depth
More natural than artificial stereo wideners
Mode 2: Time-Delayed Canon
🎵 Polyphonic Texture Generation
Concept: Musical canon technique adapted for digital audio processing
Technique: Multiple delayed voices with progressive pitch shifting
Result: Complex polyphonic textures from monophonic sources
Best for: Musical arrangement, sound design, experimental textures
Processing Pipeline:
Canon Musical Structure
Traditional canon adapted for audio:
Voice 2: Pitch + semitone_step, delay_between_entries, reduced intensity
Voice 3: Pitch + 2×semitone_step, 2×delay, further reduced intensity
...
Voice N: Pitch + (N-1)×semitone_step, (N-1)×delay, minimum intensity
Musical Effects:
- Arpeggio: When semitone_step creates chord tones
- Cluster: When semitone_step = 1 (dense semitones)
- Octaves: When semitone_step = 12 (octave doubling)
- Complex textures: With wrap_to_octave and larger steps
Mode Comparison
| Aspect | Stereo Harmonizer | Time-Delayed Canon |
|---|---|---|
| Output | Stereo | Mono |
| Processing | Fast, simple | Complex, iterative |
| Effect | Spatial width | Polyphonic texture |
| Use Case | Stereo enhancement | Musical arrangement |
| Voice Count | Fixed 2 (L/R) | Configurable (1-10+) |
| Pitch Control | Subtle, implicit | Precise, explicit |
| Timing | Micro-differences | Musical timing |
Technical Theory
Pitch Shifting Mathematics
Sample Rate Manipulation
Pitch shifting via sample rate override:
Why This Approach?
Advantages of sample rate pitch shifting:
- Quality preservation: No phase vocoder artifacts
- Natural sound: Preserves original character
- Computational efficiency: Leverages built-in resampling
- Musical accuracy: Exact semitone relationships
Limitations and considerations:
- Duration preservation: No time compensation
- Extreme shifts: Quality degrades beyond ±24 semitones
- Resampling quality: Dependent on precision parameter
Resampling Theory
High-Quality Sample Rate Conversion
Resampling precision parameter:
Temporal Precision
Sample-Accurate Timing
Delay implementation through zero-padding:
Mixing Mathematics
Multi-Voice Combination
Careful signal addition:
Complete Processing Algorithms
Stereo Harmonizer Detailed Algorithm
Time-Delayed Canon Detailed Algorithm
Canon Presets
Preset 1: Custom
🎛️ Full Parameter Control
Character: Complete manual control over all canon parameters
Use case: Experimental sound design, specific musical requirements
Recommended for: Advanced users, specific musical applications
Preset 2: Major Arpeggio (Fast)
🎹 Musical Chord Arpeggiation
Settings: voices=4, delay=0.25s, semitone_step=4, no octave wrap, intensity_step=-3dB
Character: Fast, musical arpeggio using major third intervals
Musical result: Creates major chord arpeggios (root, major third, fifth, major seventh)
Best for: Melodic material, chordal enhancement, musical arrangement
Preset 3: Spooky Cluster (Slow)
👻 Dense Microtonal Texture
Settings: voices=5, delay=1.2s, semitone_step=1, no octave wrap, intensity_step=-1dB
Character: Slow, dense cluster of closely spaced pitches
Musical result: Creates tense, complex textures with minimal pitch variation
Best for: Atmospheric sounds, horror effects, experimental textures
Preset 4: Octave Stacks
📊 Powerful Octave Doubling
Settings: voices=3, delay=0.5s, semitone_step=12, no octave wrap, intensity_step=-2dB
Character: Strong, powerful octave doubling effect
Musical result: Creates thick, reinforced textures through octave stacking
Best for: Bass enhancement, powerful leads, impactful sounds
Preset Musical Analysis
| Preset | Intervals Created | Musical Character | Tempo Feel |
|---|---|---|---|
| Major Arpeggio | P1, M3, P5, M7 | Bright, consonant | Fast (0.25s) |
| Spooky Cluster | P1, m2, M2, m3, M3 | Dense, dissonant | Slow (1.2s) |
| Octave Stacks | P1, P8, P15 | Powerful, reinforced | Medium (0.5s) |
Creating Custom Presets
- 0: Unison (thickening)
- 1: Minor second (cluster)
- 2: Major second (whole tone)
- 3: Minor third (dark)
- 4: Major third (bright)
- 5: Perfect fourth (open)
- 7: Perfect fifth (powerful)
- 12: Octave (reinforcement)
Combine with wrap_to_octave for complex patterns within one octave
Parameters & Controls
Global Parameters
| Parameter | Type | Range | Default | Description |
|---|---|---|---|---|
| Output_sample_rate | positive | 8000-192000 | 44100 | Final output sample rate |
| Resample_precision | positive | 10-100 | 50 | Resampling quality |
| Play_after_processing | boolean | 0/1 | 1 | Auto-play result |
| Keep_intermediate_objects | boolean | 0/1 | 0 | Keep temp objects (debug) |
Stereo Harmonizer Parameters
| Parameter | Type | Range | Default | Description |
|---|---|---|---|---|
| Override_sample_rate | positive | 8000-192000 | 40000 | Right channel sample rate |
Time-Delayed Canon Parameters
| Parameter | Type | Range | Default | Description |
|---|---|---|---|---|
| Number_of_voices | natural | 1-20 | 4 | Polyphony level |
| Delay_between_entries | positive | 0.0-10.0 | 0.5 | Voice entry timing |
| Semitone_step | integer | -24 to +24 | 7 | Pitch interval |
| Wrap_to_octave | boolean | 0/1 | 1 | Limit to one octave |
| Start_intensity_dB | real | 0-100 | 70 | First voice level |
| Intensity_step_dB | real | -20 to +20 | -3 | Level change per voice |
Parameter Effects Guide
1-3: Sparse, transparent
4-6: Rich, musical
7-10: Dense, complex
>10: Very dense, potentially muddy
Delay_between_entries (0.0-10.0s):
0.0-0.1: Rhythmic, phasing effects
0.2-0.5: Musical timing, arpeggios
0.6-2.0: Clear entrances, canon effect
>2.0: Spacious, atmospheric
Semitone_step (-24 to +24):
0: Unison thickening
1: Microtonal cluster
3-5: Chord intervals
7: Perfect fifth
12: Octave
Intensity_step_dB (-20 to +20):
Negative: Fading trail (canon)
0: Equal voices (chorus)
Positive: Building intensity (crescendo)
Applications
Stereo Enhancement
Use case: Converting mono recordings to stereo
Technique: Stereo Harmonizer mode
Workflow: Process mono sources, mix with original for width control
Musical Arrangement
Use case: Creating harmonies and arrangements from monophonic material
Technique: Time-Delayed Canon with musical intervals
Examples: Vocal harmonies, instrumental arrangements, chord generation
Sound Design
Use case: Creating complex textures from simple sources
Technique: Canon mode with extreme parameters
Applications: Atmospheric beds, rhythmic textures, experimental sounds
Vocal Processing
Use case: Enhancing vocals with harmonies and spatial effects
Technique: Both modes for different effects
Considerations: Maintain intelligibility, use musical intervals
Instrumental Enhancement
Use case: Adding depth and richness to solo instruments
Technique: Canon mode with complementary intervals
Examples: Guitar doubling, string sections, brass ensembles
Practical Workflow Examples
🎤 Vocal Harmony Creation
Goal: Add natural harmonies to lead vocal
Settings:
- Mode: Time-Delayed Canon
- Preset: Major Arpeggio or Custom
- Voices: 3-4, Delay: 0.0s (simultaneous)
- Intervals: +3, +7 semitones (third, fifth)
- Mix with original for balance
Result: Natural vocal harmonies supporting lead line
🎸 Guitar Thickening
Goal: Create rich guitar textures from single takes
Settings:
- Mode: Stereo Harmonizer for width
- Plus: Canon mode with octave doubling
- Process separately and mix
- Use subtle settings for natural result
Result: Thick, professional guitar sound
🌌 Ambient Pad Generation
Goal: Create evolving pads from short sounds
Settings:
- Mode: Time-Delayed Canon
- Preset: Spooky Cluster or Custom
- Long delays (2-5s), many voices (6-8)
- Subtle pitch variations
- Fading intensity trail
Result: Complex, evolving ambient textures
Advanced Techniques
- Multiple passes: Apply different modes sequentially
- Section processing: Different settings for verse/chorus
- Hybrid approaches: Stereo width + canon textures
- Parameter automation: Change settings over time
Experiment with unconventional source material for unique results
- Rhythmic canons: Use very short delays for phasing
- Microtonal exploration: Fractional semitone steps
- Extreme settings: Push parameters beyond normal ranges
- Source manipulation: Process already-processed material
Troubleshooting Common Issues
Cause: High voice count with long delays
Solution: Reduce number_of_voices or delay_between_entries
Cause: Too many voices or inappropriate intervals
Solution: Reduce voice count, use clearer intervals (4ths, 5ths, octaves)
Cause: Similar sample rates in Stereo Harmonizer
Solution: Increase difference between original and override rates
Cause: Extreme pitch shifts or low resample precision
Solution: Reduce semitone_step, increase resample_precision
Technical Deep Dive
Sample Rate Conversion Mathematics
Sinc Interpolation Theory
High-quality resampling foundation:
Pitch Perception Psychology
How We Hear Pitch Differences
Psychoacoustic principles in stereo perception:
Just Noticeable Difference (JND): ~0.5-1% for pure tones
In complex signals: slightly higher thresholds
Stereo perception mechanisms:
1. Interaural Time Differences (ITD): Micro-timing between ears
2. Interaural Level Differences (ILD): Amplitude differences
3. Spectral differences: Frequency content variations
Stereo Harmonizer exploits:
- ITD through resampling timing differences
- Spectral differences through resampling artifacts
- Creates convincing stereo image from mono
Computational Complexity Analysis
Processing Time Estimation
Big-O analysis for each mode: