Mixer
File: Rhapsodist/Processors/Mixer.js.
Overview
An up-to-12-channel mixer (adapts to however many mixerGain\d effects actually exist): gain, pan, purge, mute, solo, and output routing per channel, meant to be driven from a MixerPanel widget or custom UI.
This script does not apply gain/pan itself, it expects one SimpleGain effect per channel in the container (mixerGain0, mixerGain1, …) and sets Gain/Balance attributes on those. Route each stereo pair to a separate output via the SimpleGains’ own routing matrix.
Mute/solo is resolved jointly across all channels: a channel is audible only if it isn’t muted (or is soloed) and, when any channel is soloed, only if it’s one of the soloed ones. Toggling any channel’s mute or solo re-evaluates every channel, silencing the rest via gain rather than bypassing them.
Purge only affects samplers with more than one mic position, purging or reloading the matching position across every such sampler at once. Changing a channel’s output routes its stereo pair to the chosen bus; if that connection fails, both channels fall back to the default stereo output (0/1).
Parameters
Each control is duplicated per channel, suffixed with the channel index (0-11), e.g. Gain0, Gain1, etc.
| ID | Description |
|---|---|
Gain<n> | Channel gain, applied to that channel’s SimpleGain, decibel mode, max 12 dB. |
Pan<n> | Channel pan/balance, applied to that channel’s SimpleGain. |
Purge<n> | Reloads (on) or purges (off) mic position n across every sampler with more than one mic position. |
Mute<n> | Mutes the channel, subject to solo state. |
Solo<n> | Solos the channel; while any channel is soloed, only soloed channels are audible. |
Output<n> | Output bus for the channel, 0–12; routes the channel’s stereo pair to the corresponding routing matrix connection. |
Usage
Build the module tree first (Mixer.js plus one SimpleGain per channel, named mixerGain0, mixerGain1, …), then connect MixerPanel’s controls, or a custom UI, to this module’s parameters via processorId/parameterId.
Internal Reference
| Function | Description | Returns |
|---|---|---|
getAllSamplers() | Collects every Sampler in the tree, used by purgeLoadChannel to purge/reload mic positions across all of them at once. | Array |
soloMuteProcess() | Re-evaluates mute/solo state for every channel and sets each SimpleGain’s Gain to either its knob value or -100 accordingly. Runs whenever any channel’s mute or solo button changes. | — |
purgeLoadChannel(index, value) | Purges or reloads the mic position at index across every sampler that has more than one mic position. | — |
updateOutputConnections(index, value) | Routes a channel’s stereo pair to the routing matrix connection implied by value, falling back to the default stereo output (0/1) if the connection fails. | — |