Wave Terrain Synthesis — Complete Guide
Advanced synthesis technique: generates complex sounds by scanning mathematical terrains with dynamic trajectories, creating rich evolving textures and harmonic structures.
What this does
This script implements wave terrain synthesis — an advanced synthesis technique that creates complex audio by scanning mathematical surfaces (terrains) with dynamic paths (trajectories). The system generates a 2D height field where each point represents an amplitude value, then moves through this terrain along user-defined paths to produce the final sound.
Key Features:
- 9 Built-in Presets — From classic to experimental textures
- 5 Terrain Types — Sine, Chebyshev, Random, Fractal, Spiral
- 4 Waveform Trajectories — Sine, Triangle, Saw, Square paths
- Real-time Visualization — Terrain and contour map display
- Frequency Modulation — Dynamic trajectory modulation
- Flexible Parameters — Complete control over synthesis process
- High-Quality Output — Professional audio generation
Technical Implementation: (1) Terrain Generation: Creates 2D matrix representing height field. (2) Trajectory Calculation: Generates X and Y paths through terrain. (3) Audio Synthesis: Samples terrain values along trajectories. (4) Visualization: Displays terrain and contour maps. (5) Modulation: Applies frequency modulation to trajectories. (6) Quality Control: Normalization and parameter validation. (7) Progress Reporting: Real-time processing feedback.
Quick start
- In Praat, ensure no objects are selected (script creates new sounds).
- Run script… →
wave_terrain_synthesis.praat. - Choose Preset or select "Custom" for manual control.
- Set Duration and Sample_rate for output.
- Configure Terrain Settings (type, size, scale).
- Define Trajectory Settings (frequencies, waveforms, amplitudes).
- Adjust Modulation parameters for dynamic effects.
- Set Output_gain for final volume.
- Click OK — terrain visualization appears and sound generates.
- Result plays automatically as "waveTerrain".
Wave Terrain Synthesis Theory
Core Concept
🗺️ The Terrain as Sound Source
Fundamental idea: A 2D height field where elevation = amplitude
Synthesis process: Move through terrain along defined paths
Output: Terrain values at path positions become audio samples
Mathematical foundation:
Historical Context
Origins and Development
Wave terrain synthesis history:
Advantages Over Traditional Synthesis
Unique Capabilities
Why use wave terrain synthesis?
| Aspect | Traditional Synthesis | Wave Terrain Synthesis |
|---|---|---|
| Spectrum Control | Explicit harmonic design | Emergent from terrain structure |
| Time Evolution | Envelope-based changes | Natural evolution through paths |
| Visual Interface | Parameter sliders/knobs | Direct terrain manipulation |
| Complexity | Additive components | Inherent in terrain geometry |
| Unpredictability | Limited without modulation | Natural from path interactions |
| Learning Curve | Technical parameter knowledge | Spatial/visual intuition |
Terrain Types
Type 1: Sine Product
🌊 Sine Wave Terrain
Formula: sin(2π×nx×scale) × sin(2π×ny×scale)
Sound character: Harmonic, bell-like, crystalline
Best for: Musical tones, harmonic exploration
Mathematical properties:
Type 2: Chebyshev Polynomials
📐 Chebyshev Terrain
Formula: (2x-1)³(2y-1)² - (2x-1)²(2y-1)³
Sound character: Metallic, complex, inharmonic
Best for: Experimental textures, metallic sounds
Type 3: Random Terrain
🎲 Random Terrain
Formula: Gaussian random values with smoothing
Sound character: Noisy, textured, unpredictable
Best for: Noise textures, granular effects
Type 4: Fractal Terrain
🔺 Fractal Terrain
Formula: Multi-scale sine summation
Sound character: Rich, evolving, complex
Best for: Evolving pads, complex textures
Type 5: Spiral Terrain
🌀 Spiral Terrain
Formula: sin(2π×distance×scale + angle)
Sound character: Swirling, phasey, rotating
Best for: Doppler effects, rotating sounds
Terrain Parameters
| Parameter | Range | Default | Effect |
|---|---|---|---|
| Terrain_size | 32-512 | 128 | Resolution (higher = more detail) |
| Terrain_scale | 0.1-10.0 | 1.0 | Feature size (higher = smaller features) |
| Terrain_type | 1-5 | 1 | Mathematical function type |
Terrain Visualization
👁️ Understanding the Display
Top panel: Terrain Image
Bottom panel: Contour Map
Trajectory Systems
Trajectory Fundamentals
🛤️ Paths Through the Terrain
Concept: Time-varying paths that sample the terrain
Dual control: Independent X and Y trajectory functions
Result: Combined path creates complex sampling pattern
Trajectory mathematics:
Waveform Types
Sine Trajectories
Smooth circular/elliptical paths:
Triangle Trajectories
Linear ramps with sharp direction changes:
Sawtooth Trajectories
Continuous sweeps with instant resets:
Square Trajectories
Binary switching between extremes:
Trajectory Parameters
| Parameter | Range | Default | Effect |
|---|---|---|---|
| X_frequency | 0.1-20000 Hz | 220 Hz | Horizontal motion speed |
| Y_frequency | 0.1-20000 Hz | 330 Hz | Vertical motion speed |
| X_amplitude | 0.0-1.0 | 0.8 | Horizontal motion range |
| Y_amplitude | 0.0-1.0 | 0.8 | Vertical motion range |
| X_offset | 0.0-1.0 | 0.5 | Horizontal center position |
| Y_offset | 0.0-1.0 | 0.5 | Vertical center position |
| X_phase | 0-360° | 0° | Horizontal starting phase |
| Y_phase | 0-360° | 90° | Vertical starting phase |
Frequency Modulation
Dynamic Trajectory Control
Adding motion to motion:
Built-in Presets
Preset 1: Classic Sine Terrain
🎵 Fundamental Wave Terrain
Configuration: Sine terrain with sine trajectories
Sound character: Pure, harmonic, bell-like
Best for: Learning, fundamental tones
Preset parameters:
Preset 2: Metallic Chebyshev
🔩 Metallic Textures
Configuration: Chebyshev polynomials with sine motion
Sound character: Metallic, complex, inharmonic
Best for: Industrial sounds, metallic effects
Preset 3: Chaotic Fractal
🌪️ Complex Evolution
Configuration: Fractal terrain with modulated triangles
Sound character: Evolving, chaotic, rich
Best for: Soundscapes, experimental music
Preset 4: Spiral Galaxy
🌌 Rotating Patterns
Configuration: Spiral terrain with modulated sines
Sound character: Swirling, phasey, rotating
Best for: Doppler effects, spatial motion
Preset 5: FM Complex
📡 Frequency Modulation
Configuration: Sine terrain with heavy FM
Sound character: Dense, bright, evolving
Best for: FM-like textures, complex spectra
Preset 6: Alien Landscape
👽 Experimental Textures
Configuration: Random terrain with square waves
Sound character: Noisy, unpredictable, gritty
Best for: Sci-fi effects, noise textures
Preset 7: Rhythmic Pulses
🥁 Rhythmic Patterns
Configuration: Sine terrain with mixed waveforms
Sound character: Pulsed, rhythmic, articulated
Best for: Rhythmic content, percussive sounds
Preset 8: Smooth Ambient
☁️ Gentle Textures
Configuration: Subtle sine terrain with slow motion
Sound character: Smooth, ambient, pad-like
Best for: Background textures, ambient music
Preset Comparison Table
| Preset | Terrain | X Traj | Y Traj | Complexity | Musicality |
|---|---|---|---|---|---|
| Classic Sine | Sine | Sine | Sine | Low | High |
| Metallic | Chebyshev | Sine | Sine | Medium | Medium |
| Chaotic Fractal | Fractal | Triangle | Saw | High | Low |
| Spiral Galaxy | Spiral | Sine | Sine | Medium | Medium |
| FM Complex | Sine | Sine | Sine | High | Medium |
| Alien Landscape | Random | Square | Triangle | Very High | Low |
| Rhythmic Pulses | Sine | Square | Sine | Medium | High |
| Smooth Ambient | Sine | Sine | Sine | Low | High |
Applications
Sound Design for Media
Use case: Creating unique sounds for film, games, and animation
Technique: Use complex terrains with modulated trajectories
Presets: Alien Landscape, Chaotic Fractal, Metallic Chebyshev
Electronic Music Production
Use case: Generating synth sounds and textures
Technique: Musical frequency ratios with harmonic terrains
Presets: Classic Sine, FM Complex, Rhythmic Pulses
Algorithmic Composition
Use case: Creating evolving musical structures
Technique: Parameter automation through time
Presets: All, with focus on evolutionary parameters
Academic Research
Use case: Studying complex synthesis methods
Technique: Systematic parameter exploration
Presets: Custom configurations for specific studies
Music Education
Use case: Teaching synthesis and sound physics
Technique: Visual demonstration of sound generation
Presets: Classic Sine for clear demonstrations
Practical Workflow Examples
🎬 Sci-Fi Sound Design
Goal: Create alien technology sounds
Settings:
- Preset: Alien Landscape
- Duration: 3-5 seconds
- Add modulation for evolution
- Experiment with extreme parameters
Result: Unique, otherworldly sound effects
🎹 Electronic Music
Goal: Create synth bass or lead sounds
Settings:
- Preset: Classic Sine or FM Complex
- Use musical frequency ratios (2:3, 3:4, etc.)
- Shorter durations for notes
- Moderate modulation for warmth
Result: Rich, evolving synth tones
🌊 Ambient Soundscapes
Goal: Create background textures
Settings:
- Preset: Smooth Ambient or Spiral Galaxy
- Long durations (10-30 seconds)
- Slow frequencies and subtle modulation
- Low output gain for background levels
Result: Evolving ambient pads and textures
Creative Techniques
- Start simple: Use Classic Sine preset as baseline
- Change one parameter at a time: Understand individual effects
- Use musical ratios: 2:3, 3:4, 4:5 for harmonic results
- Experiment with extremes: Discover unexpected textures
- Combine terrains and trajectories: Create unique hybrids
- Parameter automation: Change frequencies over time
- Hybrid approaches: Combine with other synthesis methods
- Spectral processing: Apply filters or effects to output
- Multi-layer: Combine multiple terrain sounds
- Custom terrains: Modify the terrain generation code
Troubleshooting Common Issues
Cause: Extreme parameters, aliasing, clipping
Solution: Reduce frequencies, lower gain, use anti-aliasing
Cause: Large terrain size, long duration, high sample rate
Solution: Reduce terrain size, shorten duration, lower sample rate
Cause: Simple ratios, no modulation, small terrain
Solution: Use complex ratios, add modulation, increase terrain size
Cause: Very large terrain, insufficient RAM
Solution: Reduce terrain size, close other applications
Cause: Trajectories not crossing harmonic features
Solution: Adjust trajectory parameters, try different terrains
Technical Reference
Complete Parameter Reference
| Parameter | Type | Default | Description |
|---|---|---|---|
| Preset | optionmenu | 1 | Pre-configured sound settings |
| Duration | positive | 1.0 | Output sound duration (seconds) |
| Sample_rate | positive | 22500 | Audio sampling rate (Hz) |
| Terrain_size | positive | 128 | Terrain resolution (pixels) |
| Terrain_type | optionmenu | 1 | Mathematical terrain function |
| Terrain_scale | real | 1.0 | Terrain feature size scaling |
| X_frequency | positive | 220 | Horizontal trajectory frequency (Hz) |
| Y_frequency | positive | 330 | Vertical trajectory frequency (Hz) |
| X_phase | real | 0 | Horizontal starting phase (degrees) |
| Y_phase | real | 90 | Vertical starting phase (degrees) |
| X_trajectory | optionmenu | 1 | Horizontal waveform type |
| Y_trajectory | optionmenu | 1 | Vertical waveform type |
| X_amplitude | real | 0.8 | Horizontal motion range (0-1) |
| Y_amplitude | real | 0.8 | Vertical motion range (0-1) |
| X_offset | real | 0.5 | Horizontal center position (0-1) |
| Y_offset | real | 0.5 | Vertical center position (0-1) |
| X_freq_mod | real | 0 | Horizontal frequency modulation (Hz) |
| Y_freq_mod | real | 0 | Vertical frequency modulation (Hz) |
| Mod_depth | real | 0.5 | Modulation intensity (0-1) |
| Output_gain | positive | 0.5 | Final output amplitude |
Performance Characteristics
Processing Time Factors
Major time consumers:
Output Specifications
Generated Sound Properties
Technical details: