Performance Launcher — Real-Time Multichannel Audio & MIDI Cue Player

Turn selected Praat Sound objects into a multichannel performance set, triggered from the computer keyboard, a MIDI keyboard, or on-screen controls. Shape cue levels, fades, routing, and MIDI mappings in a dedicated live-performance GUI.

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

What this does

Select one or more Sound objects in Praat and launch them in a dedicated real-time audio engine. Every Sound becomes an independent cue that can be triggered via computer keyboard, MIDI note, or GUI play button. The interface provides per-cue gain, fade-in/out, channel offset, progress, and remaining time. Audio is loaded into RAM in advance for responsive triggering.

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 and run PerformanceLauncher.praat.
  2. Choose an Output Device and the required number of output channels.
  3. For MIDI performance, connect your controller, choose its port in MIDI In, and select the appropriate Ch (or Omni). Use the refresh button if needed.
  4. Play cues using their default MIDI notes (starting at C3 / note 48), computer keys, or GUI buttons.
  5. To reposition the set on your keyboard, select Chromatic or Diatonic, click Map from key…, and press the note for cue 1. To customize a single cue, click its note button and press a MIDI key.
  6. Optionally enable Note-off stops and Velocity. Adjust individual gains, fades, channel offsets, and master gain.
  7. Stop playback with the red MIDI Stop note, GUI Stop All, or Esc. Close the launcher to save settings and clean up temporary audio files.
Default mapping: MIDI cue 1 starts at note 48 (C3 with middle C = C4). Further cues ascend chromatically by default. MIDI octave labels vary between manufacturers. Computer-key defaults begin 1–0, followed by q–p, a–l and z–m. MIDI and computer-key mappings are independent.
Python setup: Required audio modules: python -m pip install sounddevice soundfile numpy. MIDI input additionally requires python -m pip install python-rtmidi in the same Python environment used by Praat AudioTools. Tkinter is also required. Without python-rtmidi, keyboard/mouse audio triggering remains available.

Workflow: Praat → Performance Launcher

1 · Prepare in Praat

Edit, synthesize, or process Sound objects. Select the sounds to perform; their selection order determines the initial cue order.

2 · Export and launch

The Praat front end resamples exported copies to the highest selected sample rate, writes temporary WAV files and a JSON manifest, then opens the Python GUI. Original Praat objects are unchanged.

3 · Configure audio and MIDI

Choose the audio interface, channel count, master gain and exclusive mode. If using a MIDI controller, select its MIDI input port, channel, layout, and optional gate/velocity behavior.

4 · Map and perform

Use default mappings or MIDI Learn. Trigger cues, control per-cue gain/fades/routing, and follow their progress and remaining time. The MIDI Stop key and Stop All control fade out active cues.

5 · Save and close

On close, performance settings are saved for future sessions; temporary WAVs and manifest are cleaned up.

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.

MIDI performance

Connect a MIDI keyboard to trigger Praat sounds as playable cues. MIDI Note On initiates a cue directly in the audio engine; the interface updates independently to show the received note, velocity and cue name.

Input and expressive controls

ControlWhat it does
MIDI InSelect the connected MIDI input device; refresh the list after connecting a controller. The previously selected port is restored by name when available.
ChListen to Omni (all channels) or one MIDI channel (1–16).
Note-off stopsGate mode: releasing a mapped key starts that cue’s fade-out; with this off, notes trigger independently of key release.
VelocityUse note velocity to scale each new cue’s amplitude as (velocity / 127)². Disable it for a fixed trigger level.
MIDI activityIndicates incoming notes, mapped cues, unmapped notes and events excluded by the channel filter.

Mapping notes to cues

ActionResult
Default mappingCue 1 = C3 (note 48), then upward according to the chosen layout.
ChromaticEvery successive MIDI semitone triggers the next cue.
DiatonicOnly white keys are used. A starting black key is moved up to the next white key.
Map from key…Press the desired starting MIDI note: cue 1 is assigned there and all following cues are laid out in sequence. The MIDI Stop key follows the last cue.
Click a cue’s note buttonLearn one note from the next MIDI keypress. Right-click the button to clear its mapping.
Red ■ Stop note buttonThe next layout key after the final cue is assigned to Stop All by default. Click to learn another Stop note; right-click to clear.
Mapping changes: Switching Chromatic/Diatonic or using “Map from key…” reassigns the entire cue set and replaces individually learned note assignments. Learning a note already assigned to another cue transfers it from the previous cue; learning the Stop note for a cue clears the Stop assignment. Press Esc to cancel MIDI Learn.
Other MIDI stop commands: Control Change 120 (All Sound Off) and CC 123 (All Notes Off) trigger Stop All. These controls use the same cue fade-out handling as the on-screen Stop All button. Notes above MIDI 127 cannot be mapped.

GUI Features

Main window layout

SectionControlsDescription
Top barStop All button, window titleStop all currently playing cues with fade-out.
MIDI controlsMIDI In, refresh, Ch, Note-off stops, Velocity, layout, Map from key…, MIDI StopChoose your controller, assign notes, and configure expressive triggering. Available when python-rtmidi is installed.
Master controlsMaster gain slider, Exclusive mode toggleGlobal output level. Exclusive mode = new cue stops all others.
Device selectorOutput device dropdown, Channels spinboxSelect the audio interface and output channel count (1–32, subject to device capabilities). Device labels identify their host API, including ASIO on Windows.
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)

Also: a MIDI note button (click to learn; right-click to clear), and editable fade-in/fade-out times in seconds.

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 and fade-out: Set per-cue fade durations directly in the cue row (seconds). The default is 0 s in and 0.1 s out. Fades use linear ramps and are clamped to cue duration. Triggered fade-outs combine with a natural end-of-cue fade; typed edits to per-cue gain affect active instances as well as subsequent triggers.

Keyboard shortcuts

Computer keyboard cue assignments (36 default keys):
1–0Cues 1–10
q–pCues 11–20
a–lCues 21–29
z–mCues 30–36

Global controls: Esc stops all cues (or cancels MIDI Learn); ↑/↓ adjust master gain by ±1 dB and →/← by ±0.1 dB.

Click a cue’s computer-key badge to customize the keyboard shortcut. MIDI assignments are configured separately in the MIDI note button.

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

Trigger prepared loops, one-shots, sound layers, or longer passages from the computer keyboard or directly from a MIDI controller.

Workflow: Prepare sounds in Praat (filtering, spectral processing, granulation), select them, launch Performance Launcher, and perform using keyboard or MIDI (directly, with note learn and chromatic/diatonic layouts).

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 MIDI input: Install python-rtmidi in the interpreter chosen by the Praat launcher, connect the keyboard, refresh MIDI In, and select its port.
  • Notes are ignored: Set Ch to Omni to test; check the MIDI activity indicator for a filtered channel or unmapped note.
  • MIDI port does not open: Another application (such as Live or Max) may already own it, especially on Windows.
  • No audio: Choose the correct output device and channel count. For ASIO, match the hardware sample rate; changing devices can interrupt playback.
  • Too many cue channels: A cue requiring more channels than the selected stream will be blocked rather than silently folded down.
  • Computer keys do not trigger: Click the launcher window to focus it; text-editing fields suppress cue shortcuts while you type.

Configuration persistence

Settings are saved in the Praat AudioTools plug-in configuration and are restored across sessions when possible: output device (by name/host API), channels, master gain, exclusive mode, per-cue gain, fades, output offset, playback mode and computer key; MIDI input port, MIDI channel, MIDI layout, per-cue note assignments, Stop note, gate and velocity toggles. Cue-specific settings are matched using cue names when selection order changes. Temporary exported audio files are removed after clean shutdown; configuration is retained.
Audio engine: Preloaded floating-point WAV audio is mixed in a sounddevice.OutputStream callback (512-frame block size). The MIDI listener uses python-rtmidi and triggers the lock-protected engine without waiting for Tk GUI updates. Actual audible latency still depends on audio hardware, drivers, and buffer scheduling. Routing and fades occur in the audio callback.
```