ASA Demos: Auditory Scene Analysis Demonstrations

A Praat script collection demonstrating principles of auditory stream segregation, perceptual organization, and musical listening based on Bregman's Auditory Scene Analysis.

Author: Shai Cohen Affiliation: Department of Music, Bar-Ilan University, Israel Version: 1.0 (2025) Based on: Bregman's Auditory Scene Analysis (1990) Repo: https://github.com/ShaiCohen-ops/Praat-plugin_AudioTools
Contents:

What is Auditory Scene Analysis?

Auditory Scene Analysis (ASA) is the process by which the human auditory system organizes sound into perceptually meaningful elements. In real-world listening, multiple sound sources overlap in time and frequency. ASA explains how we segregate these sources into separate "streams" and perceive them as distinct auditory objects.

👂 Key ASA Principles (Bregman, 1990)

  • Stream Segregation: Sounds with similar properties (pitch, timbre, location) group together
  • Principle of Proximity: Sounds close in frequency or time tend to group
  • Principle of Similarity: Sounds with similar acoustic properties group
  • Principle of Good Continuation: Smoothly changing sounds group together
  • Principle of Common Fate: Sounds with correlated changes group
  • Old+New Heuristic: New sounds are segregated from ongoing sounds

Musical Relevance: ASA explains why we can follow individual instruments in an ensemble, perceive melodies despite accompaniment, and experience auditory illusions like the scale illusion or auditory streaming.

Quick Start

  1. In Praat, open the script editor.
  2. Load ASA_Demos.praat.
  3. Select the Experiment_Type from the dropdown menu.
  4. Click RunRun (or press Ctrl+R).
  5. The script will generate and play the selected auditory demonstration.
  6. A new Sound object named according to the demo will appear in the Objects list.
Listening Tips:
  • Use headphones for best results
  • Listen in a quiet environment
  • Close your eyes to focus auditory attention
  • Listen multiple times to notice different aspects
  • Try to consciously switch between possible perceptual organizations
Important Notes:
  • All demos generate synthetic tones (sine waves or xylophone-like decays)
  • Default sample rate: 44.1 kHz
  • Amplitude scaling: High tones at 0 dB, Low tones at -6 dB (Demo 2: -1.5 dB)
  • All outputs are normalized to peak amplitude of 0.99
  • Stereo/mono: All outputs are mono (single channel)
  • No external files required - everything is generated procedurally

ASA Theory & Principles

Streaming and Fusion

Two Perceptual States:

  1. Stream Segregation (Two-stream percept): High and low tones heard as separate sequences
  2. Stream Integration (One-stream percept): All tones heard as a single sequence

Factors influencing streaming:

FactorEffectDemo
Frequency SeparationLarger separation → more segregationDemo 1, 3
Temporal ProximityFaster tempo → more segregationDemo 1
SimilaritySimilar amplitudes, timbres → more integrationDemo 2
RepetitionMore repetition → stronger streamingDemo 4
Pitch RangeSeparate ranges → easier segregationDemo 8

Primitive vs. Schema-Based Organization

🧠 Two Processing Stages

Primitive (Bottom-up) Organization:

  • Automatic, innate processes
  • Based on acoustic properties (frequency, timing, location)
  • Operates on short time scales (seconds)
  • Examples: Streaming based on frequency separation

Schema-Based (Top-down) Organization:

  • Learned, cognitive processes
  • Based on knowledge, expectations, attention
  • Operates on longer time scales
  • Examples: Recognizing familiar melodies, attending to specific instruments

Musical Applications of ASA

🎵 How ASA Explains Musical Perception

  • Polyphonic Listening: How we separate multiple melodies
  • Figure-Ground Segregation: Melody vs. accompaniment
  • Timbre-Based Grouping: Instrument identification in ensembles
  • Rhythmic Perception: How tempo affects pattern recognition
  • Auditory Illusions: Scale illusion, Deutsch's tritone paradox

Demonstrations Overview

Demo 1: Stream Segregation (Cycle Speed)

⏱️ Effect of Tempo on Streaming

Stimulus: Alternating high and low tones (H-L-H-L-H-L)

FREQUENCIES: High: 2500 Hz, 2000 Hz, 1600 Hz Low: 350 Hz, 430 Hz, 550 Hz Amplitude: High = 0 dB, Low = -6 dB STRUCTURE: Part 1: Slow tempo (400 ms tones, 4 cycles) [1 second gap] Part 2: Fast tempo (100 ms tones, 16 cycles)

Perceptual Effect: At slow tempo, hear integrated pattern. At fast tempo, hear segregated high and low streams.

ASA Principle: Temporal proximity affects streaming threshold.

Demo 2: Pattern Recognition (Within-Stream)

🎯 Recognizing Patterns in Single Streams

Stimulus A: High tones only, with gaps (H-gap-H-gap-H-gap)

Stimulus B: High and low tones alternating (H-L-H-L-H-L)

AMPLITUDE DIFFERENCE: High tones: 0 dB Low tones: -1.5 dB (smaller than Demo 1) TEMPO: 100 ms tones, 100 ms gaps/silences

Perceptual Effect: Easier to recognize repeating pattern in Stream A than in integrated Stream B.

ASA Principle: Stream segregation facilitates pattern recognition within streams.

Demo 2: Pattern Recognition (Across-Stream)

🔄 Recognizing Patterns Across Streams

Stimulus A: High tones with one low tone at end (H-gap-H-gap-L-gap)

Stimulus B: Alternating pattern with swapped positions (H-L-H-L-L-H)

Perceptual Effect: Demonstrates difficulty of recognizing patterns that cross stream boundaries.

ASA Principle: Patterns are easier to recognize within streams than across streams.

Demo 3: Loss of Rhythm (Large Separation)

🥁 Rhythm Perception with Frequency Separation

Stimulus: Accelerating sequence: H-L-H-gap pattern

FREQUENCIES: High: 1400 Hz Low: 500 Hz (large separation ~2.8 octaves) TEMPO: Starts at 287 ms, accelerates to 88 ms ACCELERATION: Each cycle 96% of previous duration

Perceptual Effect: At slow tempo, hear gallop rhythm. At fast tempo, lose rhythmic pattern due to streaming.

ASA Principle: Large frequency separation promotes streaming, disrupting rhythm perception.

Demo 3: Loss of Rhythm (Small Separation)

🎵 Preserved Rhythm with Small Separation

Stimulus: Same accelerating pattern but smaller frequency separation

FREQUENCIES: High: 1400 Hz Low: 1320 Hz (small separation ~minor 2nd) SAME TEMPO ACCELERATION: 287 ms → 88 ms

Perceptual Effect: Rhythmic pattern remains perceptible even at fast tempo.

ASA Principle: Small frequency separation maintains integration, preserving rhythm.

Demo 4: Cumulative Effects of Repetition

🔄 Build-up of Streaming with Repetition

Stimulus: Alternating high-low tones repeated in blocks

STRUCTURE: Block 1: 2 repetitions (2 cycles) [4 second gap] Block 2: 4 repetitions (4 cycles) [4 second gap] Block 3: 8 repetitions (8 cycles) [4 second gap] Block 4: 16 repetitions (16 cycles) [4 second gap] Block 5: 32 repetitions (32 cycles) FREQUENCIES: High: 2000 Hz (0 dB) Low: 700 Hz (-6 dB) TIMING: 100 ms tones, 12.5 ms gaps between tones

Perceptual Effect: Streaming becomes stronger with more repetitions.

ASA Principle: Streaming builds up cumulatively over time.

Demo 5: Segregation of Melody from Interference

🎼 Melody Recognition with Distractors

Stimulus: Target melody + random distractor tones

MELODY: 16-note pattern based on C major scale DISTRACTORS: Random frequencies 261-392 Hz STRUCTURE: Three rounds with transpositions: Round 1: Original key Round 2: Transposed up perfect fifth (+7 semitones) Round 3: Transposed up octave (+12 semitones) TIMING: 120 ms tones, no gaps (simultaneous presentation)

Perceptual Effect: Can you follow the melody despite interference?

ASA Principle: Pitch proximity and good continuation help melody tracking.

Demo 6: Telemann Sonata (Compound Melody)

🎻 Bach/Telemann Violin Solo Streaming

Stimulus: Fast alternating notes that can be heard as one or two streams

MUSIC: Excerpt from Telemann Fantasia or similar NOTES: G5-E5-G5-C5-G5-D5-G5-B4-G5-C5-G5-A4-G5-B4-G5-G4 STRUCTURE: Part 1: Slow tempo (250 ms notes, 2 measures) [1 second gap] Part 2: Fast tempo (100 ms notes, 4 measures)

Perceptual Effect: At slow tempo, hear single melodic line. At fast tempo, may hear two interleaved streams.

ASA Principle: Compound melodies demonstrate streaming in real music.

Demo 7: African Xylophone (Interlocking Parts)

🎹 Amadinda/Xylophone Interlocking

Stimulus: Two interlocking xylophone parts presented separately then together

TUNING: Equipentatonic scale (5 equal steps of 240 cents) f1 = 350 Hz (root) f2 = 350 * 2^(240/1200) ≈ 418 Hz f3 = 350 * 2^(480/1200) ≈ 499 Hz f4 = 350 * 2^(720/1200) ≈ 595 Hz f5 = 350 * 2^(960/1200) ≈ 709 Hz PARTS: Part A: f1 - silence - f3 - silence (repeated) Part B: silence - f4 - silence - f5 (repeated) Combined: f1-f4-f3-f5 (interlocked)

Perceptual Effect: Hear separate patterns, then hear how they combine.

ASA Principle: Temporal and pitch factors in polyrhythmic music.

Demo 8: African Xylophone (Pitch Range Separation)

🎚️ Effect of Pitch Range on Streaming

Stimulus: Same as Demo 7 but Part B transposed up one octave

MODIFICATION: f4 and f5 from Demo 7 multiplied by 2 f4' = 595 * 2 = 1190 Hz f5' = 709 * 2 = 1418 Hz EFFECT: Larger pitch separation between parts

Perceptual Effect: Easier to hear separate streams due to pitch range separation.

ASA Principle: Pitch proximity/remoteness affects streaming strength.

Core Procedures & Implementation

Basic Tone Generation

🔊 MakeTone Procedure

procedure MakeTone: .freq, .dur, .gain, .rise, .fall Create Sound from formula: "tone", 1, 0, .dur, sampleRate, "sin(2*pi*.freq*x)" .rEnd = .rise .fStart = .dur - .fall if .fStart < 0 .fStart = 0 endif Formula: "self * (if x < .rEnd then x/.rEnd else if x > .fStart then (xmax - x)/(xmax - .fStart) else 1 fi fi)" Formula: "self * .gain" endproc

Parameters:

  • .freq: Frequency in Hz
  • .dur: Duration in seconds
  • .gain: Amplitude multiplier
  • .rise: Rise time (linear fade in)
  • .fall: Fall time (linear fade out)

Xylophone Tone Generation

🎹 MakeXylophone Procedure

procedure MakeXylophone: .freq, .dur # Exponential decay for wood sound (Amadinda style) Create Sound from formula: "xylo", 1, 0, .dur, sampleRate, "sin(2*pi*.freq*x) * exp(-40*x)" # Tiny fade in to prevent clicks Formula: "self * (if x < 0.002 then x/0.002 else 1 fi)" endproc

Characteristics: Exponential decay simulates wooden bar percussion. 40 Hz decay rate gives natural xylophone envelope.

Pattern Repetition

🔄 RepeatSound Procedure

procedure RepeatSound: .name$, .times, .outName$ selectObject: "Sound " + .name$ Copy: "repAccum" for .i from 2 to .times selectObject: "Sound " + .name$ Copy: "tmpRep" selectObject: "Sound repAccum", "Sound tmpRep" Concatenate Rename: "repAccumNew" selectObject: "Sound repAccum", "Sound tmpRep" Remove selectObject: "Sound repAccumNew" Rename: "repAccum" endfor Rename: .outName$ endproc

Purpose: Efficiently repeats a sound pattern multiple times without memory leaks.

Global Configuration

# ------------------------- # Global Configuration # ------------------------- sampleRate = 44100 gainHigh = 1.0 # 0 dB gainLow = 10 ^ (6.0 / 20) # -6 dB (Demo 1, 3, 4) gainLowDemo2 = 10 ^ (1.5 / 20) # -1.5 dB (Demo 2) rampShort = 0.010 # 10 ms rise/fall finalName$ = "" # Output sound name

Applications & Educational Use

Teaching Auditory Perception

Classroom Demonstrations:

  • Psychology Courses: Auditory perception, cognitive psychology
  • Music Theory: Polyphonic listening, contrapuntal perception
  • Audio Engineering: Mixing principles, auditory masking
  • Neuroscience: Auditory processing, neural correlates of streaming

Suggested Activities:

  1. Play demos, have students describe what they hear
  2. Compare different listening strategies (passive vs. focused attention)
  3. Discuss individual differences in perception
  4. Relate to real-world listening situations
  5. Experiment with modifying parameters

Research Applications

Experimental Stimuli Generation:

  • Psychoacoustics: Measuring streaming thresholds
  • Neuroimaging: fMRI/EEG studies of auditory organization
  • Clinical Audiology: Testing auditory processing disorders
  • Music Cognition: Studying polyphonic perception

Modification Guidelines:

  • Change frequencies to test different separations
  • Adjust tempo to find streaming thresholds
  • Modify amplitudes to test intensity effects
  • Add spatial cues (not implemented in current version)
  • Incorporate more complex timbres

Musical Composition Insights

🎵 Compositional Implications

Streaming in Music:

  • Counterpoint: Voice separation depends on pitch proximity
  • Orchestration: Instrument choice affects stream cohesion
  • Tempo Effects: Fast passages may cause unintended streaming
  • Register Planning: Pitch range distribution affects clarity

Historical Examples:

  • Bach's compound melodies: Designed to suggest multiple voices
  • African xylophone music: Uses streaming for interlocking patterns
  • Minimalist music: Explores perceptual ambiguity
  • Electronic music: Intentional streaming effects

Parameters & Technical Details

Frequency Parameters

DemoHigh FrequenciesLow FrequenciesSeparation
Demo 12500, 2000, 1600 Hz350, 430, 550 Hz~2.5-3 octaves
Demo 22500, 2000, 1600 Hz350, 430, 550 Hz~2.5-3 octaves
Demo 3 (Large)1400 Hz500 Hz~2.8 octaves
Demo 3 (Small)1400 Hz1320 Hz~minor 2nd
Demo 42000 Hz700 Hz~2.9 octaves
Demo 5Melody: C4-G4 rangeRandom: C4-G4Variable
Demo 6G4-G5 range(Single stream)1 octave span
Demo 7350-709 HzSame rangeEquipentatonic
Demo 8350-709 Hz / 1190-1418 HzTwo ranges1+ octave between parts

Temporal Parameters

DemoTone DurationGap DurationTotal Duration
Demo 1 (Slow)400 ms0 ms~9.6 s total
Demo 1 (Fast)100 ms0 ms
Demo 2100 ms100 ms~36 s total
Demo 3287→88 msTone duration12 s
Demo 4100 ms12.5 ms~70 s
Demo 5120 ms0 ms~7.7 s
Demo 6 (Slow)250 ms0 ms~9 s
Demo 6 (Fast)100 ms0 ms
Demo 7/8120 ms120 ms (in parts)~12 s

Amplitude Parameters

📊 Amplitude Settings

ParameterValuedBUse
gainHigh1.00 dBAll high tones
gainLow10^(-6/20) ≈ 0.501-6 dBDemo 1, 3, 4 low tones
gainLowDemo210^(-1.5/20) ≈ 0.841-1.5 dBDemo 2 low tones
Final scalingPeak to 0.99-0.09 dBFSAll outputs

Rationale: -6 dB difference creates clear streaming. -1.5 dB in Demo 2 makes streaming more ambiguous, testing pattern recognition limits.

Modification Guide

To modify demonstrations:

  1. Change frequencies: Edit the frequency values in the specific demo section
  2. Adjust tempo: Modify tone durations and gap durations
  3. Change amplitudes: Modify gainHigh, gainLow, gainLowDemo2 values
  4. Add spatialization: Convert to stereo and add panning (not implemented)
  5. Modify timbre: Replace sine tones with more complex waveforms
  6. Change patterns: Modify the tone sequences in procedures

Example: Create custom frequency separation test:

# In Demo 1 section, change frequencies: h1 = 1000 # Instead of 2500 h2 = 900 # Instead of 2000 h3 = 800 # Instead of 1600 l1 = 700 # Instead of 350 l2 = 750 # Instead of 430 l3 = 650 # Instead of 550