Stereo Mixer — User Guide
Mix 1–8 mono or stereo Sound objects into one stereo output, with per-source left/right gains, preset gain patterns, automatic sample-rate matching, optional peak normalization, and a compact visual summary.
What this does
Stereo Mixer creates one stereo Sound from 1–8 selected input Sounds. Each source receives an independent left gain and right gain, then all processed sources are summed into a shared stereo buffer.
Output R(t) = Σ [ sourcei,R(t) × gaini,R ]
Mono sources are first converted to stereo, so the same mono signal is available to both sides before the L/R gains are applied. Stereo sources keep their original left and right channels and those two channels are weighted independently.
The script accepts mono and stereo inputs only. A source with 3 or more channels is rejected rather than silently dropping channels.
Quick start
- In Praat, select between 1 and 8 Sound objects. Each selected Sound must be mono or stereo.
- Run
Stereo_Mixer.praat. - Choose a preset, or select Custom and enter L/R gains.
- If Custom is used with more than four sources, enable Edit custom gains 5 to 8 to open the second gain dialog.
- Choose whether to normalize the result, draw the visualization, and play the result.
- Click OK. The resulting Sound is left selected in the Objects window.
Mixed_Spread_4src.Source numbering: Objects-list order
The labels Sound 1, Sound 2, and so on refer to the selected Sound objects in the order returned by Praat's Objects list: top to bottom. They do not refer to the order in which the objects were clicked.
This matters for all presets whose pattern changes with source number, especially Stereo Spread, Wide Spread, Fade L to R, Fade R to L, and V Shape.
Preset gain patterns
Preset values replace the Custom gain entries for every selected source. The patterns are computed for the actual number of selected Sounds.
| Preset | Gain pattern | Behavior |
|---|---|---|
| Custom | User-defined L/R gains | Uses the values entered in the form and, optionally, the second dialog for Sounds 5–8. |
| All Unity | L=1.0, R=1.0 for every source | Preserves stereo sources at unity; mono sources become dual-mono. |
| Stereo Spread | Odd: 1.0 / 0.3 Even: 0.3 / 1.0 | Alternates left-heavy and right-heavy sources. |
| Wide Spread | Odd: 1.0 / 0.0 Even: 0.0 / 1.0 | Alternates hard-left and hard-right channel weighting. |
| Left Heavy | L=1.0, R=0.3 | Weights every source toward the left side. |
| Right Heavy | L=0.3, R=1.0 | Weights every source toward the right side. |
| Fade L to R | L decreases 1→0; R increases 0→1 | Distributes sources progressively from left to right according to source number. |
| Fade R to L | L increases 0→1; R decreases 1→0 | Reverse progression. |
| V Shape | L→R→L | Moves the numbered source pattern from left toward right near the midpoint, then back toward left. |
Custom gains
The main form exposes L/R gains for Sounds 1–4. Sounds 5–8 default to 1.0 / 1.0. When Custom is selected, more than four Sounds are present, and Edit custom gains 5 to 8 is enabled, a second dialog appears with the remaining gain controls.
Only gain values belonging to Sounds that actually exist in the current selection are used.
This derived value is used only for the stereo-field visualization and the compact L/C/R Info label; it is not the mixing law itself.
Processing pipeline
- Validate selection: require 1–8 selected Sounds and reject any source with more than two channels.
- Read source properties: collect names, durations, sample rates, and source order.
- Choose output format: output duration is the longest source duration; output sample rate is the highest sample rate among the selected Sounds.
- Create a silent stereo buffer at that duration and sample rate.
- Prepare each source: copy it, resample it to the maximum sample rate when necessary, and convert mono input to stereo.
- Apply L/R gains independently to channels 1 and 2.
- Sum into the shared stereo buffer.
- Normalize if requested.
- Rename, visualize, and optionally play the result.
Different source durations
The output always lasts as long as the longest input. Shorter Sounds contribute only while they contain samples; after they end, their contribution is zero. If the longest and shortest durations differ by more than 0.1 seconds, the Info window reports the mismatch.
Different sample rates
The highest input sample rate becomes the output sample rate. Sources with a different sample rate are resampled to that rate with Praat's resampling command before mixing.
Parameters
| Control | Default | Meaning |
|---|---|---|
| Preset | Custom | Selects the L/R gain strategy. |
| Gain 1–4 L/R | 1.0 | Custom left and right gain for Sounds 1–4. |
| Edit custom gains 5 to 8 | Off | When Custom is active and more than four Sounds are selected, opens a second dialog for Sources 5–8. |
| Normalize output | On | Runs final peak scaling on the completed stereo mix. |
| Target peak | 0.95 | Target amplitude passed to Scale peak. Must be greater than zero when normalization is enabled. |
| Draw visualization | On | Draws the AudioTools-style mixing summary. |
| Play result | On | Plays the resulting stereo Sound after processing. |
Scale peak scales the completed mix so its peak reaches the requested target. It can therefore raise a quiet result as well as attenuate a loud one.Visualization
When enabled, Stereo Mixer draws a compact AudioTools-style summary with four main information areas:
One marker per source. Horizontal position is derived from the L/R gain ratio; marker size follows average gain. Blue indicates left-heavy, orange right-heavy, gray near-center.
Paired blue/orange gain bars for each source, with a dotted unity reference at gain 1.0.
Separate waveform displays for the final left and right output channels.
Source count, preset, output duration, sample rate, and elapsed processing time.
The title reports the final result name, preset, and number of mixed Sounds.
Important behavior and limitations
- Output is always stereo. The suffix
Nsrcreports the number of source Sounds, not the number of output channels. - Inputs are mono or stereo only. Multichannel sources must be downmixed explicitly before using Stereo Mixer.
- Stereo inputs are not collapsed to point sources. L/R gains scale the existing stereo channels independently.
- No automatic headroom is applied before summing. Several unity-gain sources can produce a large peak; final normalization handles the result only when enabled.
- No loudness matching is performed. Gain values are linear amplitude multipliers.
- No time alignment is performed. All Sounds are mixed on their existing common time axis starting at the output buffer's time origin.