Performance Launcher — Real-Time Multichannel Cue Player

Prepares selected Sound objects, resamples them to a unified sample rate, writes a performance manifest, and hands complete execution over to a real-time Python audio engine with keyboard-triggered GUI playback.

Author: Shai Cohen Affiliation: Department of Music, Bar-Ilan University, Israel Version: 1.1 (2026) License: MIT License Repo: https://github.com/ShaiCohen-ops/Praat-plugin_AudioTools
Contents:

What this does

This script provides a bridge from Praat to a real-time multichannel audio cue launcher. Select one or more Sound objects in Praat, run the script, and a Python GUI window opens. Each selected sound becomes a playable cue, assigned a default keyboard key (1,2,3…q,w,e…). The cues can be triggered in real time, with per-cue gain, fade-in/out, channel offset, and progress indicators. All audio is pre-loaded into RAM for instantaneous playback.

Use case: Live electronic music performance, sound installation, theatre sound design, or any situation where you need to trigger pre-prepared audio clips from Praat with low latency. The Python engine handles real-time mixing, fading, and multichannel output to any audio interface. Praat handles audio analysis, editing, and preparation — then hands off to a dedicated performance environment.

Key Features:

Technical implementation: Praat exports each selected Sound as a temporary WAV file, builds a JSON manifest with metadata (duration, sample rate, channels), and launches the Python engine. The Python script uses sounddevice for low-latency audio output, soundfile for reading WAVs, numpy for audio mixing, and tkinter for the GUI. The engine runs a real-time callback thread that mixes all active cues sample-accurately with fade-in/out and channel routing.

Quick start

  1. In Praat, select one or more Sound objects.
  2. Run script…PerformanceLauncher.praat.
  3. The script exports each sound to a temporary WAV, builds a manifest, and launches the Python GUI.
  4. In the GUI, select your output audio device and number of output channels.
  5. Click the ▶ play button for any cue, or press its assigned keyboard key.
  6. Adjust per-cue gain, channel offset, and master gain as needed.
  7. Close the window when finished — temporary files are cleaned up automatically.
Quick tip: Default key assignments: numbers 1–0, then letters q,w,e,r,t,y,u,i,o,p, a,s,d,f,g,h,j,k,l, z,x,c,v,b,n,m. Hover over a cue to see its key. Use Exclusive mode for one-shot playback (new cue stops all others). Press Stop All button or Esc key to silence all cues.
Important: Python dependencies required — install with pip install sounddevice soundfile numpy. The GUI requires tkinter (usually included with Python). If you see "Missing Python dependency", run the install command in your terminal. The script resamples all sounds to the highest sample rate among selected files — this may increase RAM usage for high-resolution files.

Workflow: Praat → Performance Launcher

Step 1: Prepare sounds in Praat
• Edit, filter, analyse, or generate sounds using any Praat tools
• Select all sounds you want in your performance set
• Sound names become cue names in the GUI
• Stereo sounds remain stereo; mono sounds can be panned via channel offset Step 2: Run PerformanceLauncher.praat
• Script calculates target sample rate (max of all selected)
• Resamples sounds if necessary (preserves original objects)
• Exports each sound as temporary WAV
• Writes JSON manifest with metadata
• Launches Python GUI Step 3: Configure playback in GUI
• Select output device and channel count
• Adjust master gain
• Set per-cue gain, fade times, channel offset
• Assign custom keyboard keys (click the key badge) Step 4: Perform!
• Trigger cues by clicking buttons or pressing keys
• Monitor progress bars and countdown timers
• Stop individual cues or all cues at once Step 5: Close and clean up
• Configuration auto-saves to temp file
• Temporary WAVs and manifest deleted on exit
• Praat objects unchanged
Resampling behaviour: If you select sounds with different sample rates (e.g., 44.1 kHz and 48 kHz), the script resamples all sounds to the highest sample rate. This ensures consistent timing across cues. The original Sound objects in Praat are never modified — only the exported temporary files are resampled.

GUI Features

Main window layout

SectionControlsDescription
Top barStop All button, window titleStop all currently playing cues with fade-out.
Master controlsMaster gain slider, Exclusive mode toggleGlobal output level. Exclusive mode = new cue stops all others.
Device selectorOutput device dropdown, Channels spinboxChoose audio interface and output channel count (1–32).
Cue gridScrollable list of cues. Each row contains:
  • Key badge — assigned keyboard key (click to change)
  • Play button — cue name, triggers playback
  • Duration — length in seconds
  • Progress bar + timer — visual and countdown (e.g., "-0:02.3")
  • Gain spinbox — per-cue dB (-40 to +12)
  • Ch+ spinbox — output channel offset (0–31)
  • Stop button — stop this cue (with fade-out)
Status barShows current action, device status, or error messages.

Playback modes

Restart mode (default)

If the same cue is triggered while playing, it stops (with fade-out) and restarts from the beginning. Ideal for drum hits or short phrases.

Overlap mode

Multiple instances of the same cue can play simultaneously (configured via manifest). Useful for layers and polyphonic textures.

Fade-in/out: Each cue has configurable fade times (default fade_in=0, fade_out=0.1s). Fades are applied as cosine ramps to prevent clicks. When stopping a cue manually, the fade-out is applied before the audio ends.

Keyboard shortcuts

Default key assignments (37 cues):
1–0Cues 0–9
q, w, e, r, t, y, u, i, o, pCues 10–19
a, s, d, f, g, h, j, k, lCues 20–28
z, x, c, v, b, n, mCues 29–35
Global shortcuts:
  • Esc — Stop all cues
Customising keys: Click the key badge on any cue row to assign a different key. Assignments persist between sessions via the config file.
Cross-platform input: The GUI supports mouse wheel scrolling on all platforms (Windows/macOS: MouseWheel, Linux: Button-4/Button-5). The cue list scrolls smoothly even with many cues.

Applications

Live electronic music performance

Use case: Trigger pre-composed loops, one-shots, or effect tails from a laptop running Praat as a sound design environment.

Workflow: Prepare sounds in Praat (filtering, spectral processing, granulation), select them, launch Performance Launcher, and perform using keyboard or MIDI (via external mapping).

Sound installation / gallery

Use case: Autonomous or interactive playback of multiple sound files with individual level and pan control.

Workflow: Load ambient textures, field recordings, or spoken word cues. Use exclusive mode to ensure only one sound plays at a time. Connect to a multichannel speaker array using channel offset.

Theatre / dance production

Use case: Cue-to-cue playback with precise fade control.

Workflow: Each cue has its own gain and fade-out time. The stage manager triggers cues via keyboard. Progress bars show remaining time for each sound — essential for cueing next elements.

Rehearsal / practice tool

Use case: Quickly audition multiple versions of a processed sound.

Workflow: In Praat, generate several variations (different filters, pitch shifts, delays), select all, launch Performance Launcher, and trigger each version with a single key press for A/B comparison.

Workflow: Multi-track stem playback

Source: 8 stereo stems (drums, bass, pads, leads, etc.) prepared in Praat.
Settings: Output channels = 16 (or 8 stereo pairs). Set Ch+ offset for each cue to route to different speaker pairs.
Result: Independent level and mute control over each stem via the GUI, all synchronised by triggering simultaneously.

Workflow: A/B comparison for mastering

Source: Same audio file processed with different settings (e.g., different compressor thresholds).
Settings: Exclusive mode on. Assign neighbouring keys (e.g., '1' and '2').
Result: Quick switching between versions for blind listening tests.

Troubleshooting:
No sound / device not found: Check that your audio interface is connected and selected in the dropdown. Use the device test tone (available via right-click on device list in some versions).
Latency / glitches: Increase the block size (not exposed in GUI, but can be tuned in the engine). Ensure no other applications are using the audio device exclusively.
Python fails to launch: Verify that python or python3 is in your PATH. The script attempts OS-specific discovery (Homebrew, system Python, etc.).
GUI scroll not working on Linux: Version 1.1 adds explicit Button-4/Button-5 bindings for X11 — ensure you're running the latest.
Cues not playing: Check that the temporary WAV files were created successfully. Look for error messages in the Praat Info window.

Configuration persistence

When you close the Performance Launcher window, the following settings are saved to a temporary config file:
  • Selected audio device index
  • Output channel count
  • Master gain dB value
  • Exclusive mode state
  • Per-cue: key assignment, gain dB, output offset, playback mode
These settings are reloaded the next time you launch the same Praat session (config persists until system temp cleanup).
Audio engine details: The real-time engine uses sounddevice.OutputStream with a callback that runs at the audio hardware buffer size (typically 256–1024 samples). All mixing is done in 32-bit float to prevent clipping until final output. Per-cue gain, fade-in/out, and channel routing are applied in the callback, which means zero latency for parameter changes.
```