Skip to content

Timings

James Chang edited this page Jun 30, 2025 · 1 revision

Enhanced Spatial Audio Implementation

TIMING DOCUMENTATION SUMMARY

This application uses hardcoded timing values for four different musical movements. All timing values are defined in the timestampPatterns object.

TIMING SOURCES

  1. Primary: timestampPatterns object in script.js — actively used by the app
  2. Reference: /timings/*.txt files — development reference only (not used by the app)

MOVEMENT TIMING BREAKDOWN

1. DEFAULT (Double Clarinet)

  • 27 timing points from 0 to 68.79 seconds
  • Simple pattern switching between 6 speakers
  • Timings: timestampPatterns.default.timestamps

2. TRANSITION 1–2

  • 25 timing points from 0 to 56.929 seconds
  • Special decay behavior: speakers fade to 0.5 instead of 0
  • Timings: timestampPatterns["transition1-2"].timestamps

3. TRANSITION 3–4

  • 5 timing points from 0 to 55.5 seconds
  • Uses circular panning with acceleration over time
  • Rotation speed controlled in animateCircularPanning()
  • Timings: timestampPatterns["transition3-4"].timestamps

4. STROPHE V (This is not relevant, but there in case some form of visualization is needed)

  • 10 timing points from 0 to 9 seconds (simplified for demo)
  • Uses dry/wet mixing between performer and hidden speaker
  • Crossfading controlled in updateDryWetBalance()
  • Timings: timestampPatterns.stropheV.timestamps

TIMING CONTROL FUNCTIONS

  • startPatternSwitching() — Main timing loop (50ms intervals)
  • animateCircularPanning() — Controls rotation speed for Transition 3–4
  • updateDryWetBalance() — Controls crossfading for Strophe V
  • setInitialSpeakerGains() — Sets starting conditions for each movement

Below are a couple important things for transition3-4 (the one that might need a bit of work still)

Easier way to find stuff: Copy the comment and use command+f to search for the same comment in the respective file

For transition3-4 (in script.js):

  • Line 826

    • // INITIAL TIMING SETUP: Different movements start with different speaker configurations
  • Line 499

    • // TIMING SETUP: Define base parameters for circular panning movement
  • Line 1020

    • // TIMING CONTROL: Circular panning speed accelerates based on audio position
  • Line 1035

    • // Update the angle - ROTATION SPEED CONTROLLED HERE