Skip to content

Save a Mix as JSON: Scene Format and Schema ​

A scene is the pure-data description of a whole mixer.

It is the format Mixer.fromJson(...) reads and toJson() writes. In Python, the names are from_json(...) and to_json().

The format is identical across WASM, Python, Node, the C ABI, and C++. Because it is plain JSON, you can store it with a project, diff it in git, hand-edit it, and reload it later. A JSON Schema for it, mixer-scene.schema.json, ships inside the npm and Python packages so a hand-written or generated scene can be checked before it ever reaches a mixer — see Validating a scene against the schema.

If you have not met strips, sends, and buses yet, read Mixing Basics and the Mixing Engine guide first. This page is the field-by-field reference. The Mixing Studio demo saves a different, private file; it is described in Mixing Studio Project File.

The demo below shows the same routing ideas without JSON: lanes feed a small mixer, sends and levels change the output, and the meters respond immediately. Use it first if the scene fields feel abstract, then come back to the schema with the signal flow in mind.

ENGINE · LANE MIXERIDLE
The engine lane mixer — faders and mutes inside the playback engine

Three MIDI clips loop through the realtime engine: each track occupies a lane with its own channel strip, and the lanes sum into a master strip carrying the engine’s true-peak limiter. The faders call the strip setters and the mutes call setSoloMute — every band below is the engine’s separate solo previews through the master chain, re-rendered through renderOffline as you move the controls.

Lead fader
0 dB
Bass fader
3 dB
Drums fader
-8 dB
Mute lead
Mute bass
Mute drums

What You Will Learn ​

By the end of this page you should be able to:

  • recognize the top-level scene shape and the role of strips, buses, VCA groups, and connections;
  • edit or generate a scene without confusing strip controls, inserts, sends, and routing edges;
  • understand which fields have defaults and which identifiers must match across the graph;
  • validate a scene against the shipped JSON Schema, and know which mistakes only the loader can catch;
  • use a built-in preset as the safest starting point for custom scene JSON.

Learn the format by example

The fastest way to understand the format is to print a built-in preset and read it: mixingScenePreset('vocalReverbSend'). Every field below appears in that output, so you can match each key to a real value. The annotated preset at the end of this page does exactly that.

Top-level shape ​

json
{
  "version": 2,
  "strips": [],
  "buses": [],
  "vcaGroups": [],
  "connections": []
}
FieldTypeMeaning
versionintegerFormat version. It must be 2; any other number is refused (Mixer.fromJson: version must be 2) and a string is refused as not a number. The schema requires the key; the loader accepts a document without it.
stripsarrayThe track lanes (see Strip).
busesarrayShared destinations, including the master (see Bus).
vcaGroupsarrayLevel groups that trim several strips at once (see VCA group).
connectionsarrayThe routing graph edges (see Connection).

The loader refuses unknown keys

A key the reader does not consume is a likely typo, such as processorName for processor or faderDB for faderDb, so the load fails instead of leaving the field at its default. The refusal names the key path, including array indices where applicable, and lists the accepted keys in sorted order; it does not suggest a replacement spelling. For example, an unread saturation.softClipper parameter is reported as unknown key strips[0].inserts[0].params.unreadKey (expected aliasing, ceiling, driveDb, mix). A snake_case key such as fader_db follows the same format; see Documents written by 1.10 for the full message.

Scene fields that start with $ or x- are reserved for producer metadata. Inside an insert's params object, the processor checks every key.

Insert params are checked against that processor's accepted keys, too. Enumerate them with masteringInsertParamNames(insert) (Python mastering_insert_param_names(name)); the insert id is a positional argument, and an id the registry does not know throws a RangeError in JavaScript or raises SonareValueError in Python. A key the processor does not read refuses the load at its indexed path, including for a bus insert.

The error depends on how the scene is supplied. JSON document readers such as Mixer.fromJson(...), Project.fromJson(...) and Project.fromJsonWithDiagnostics(...) report InvalidFormat; an embedded project's path starts with scene.. The object argument Project.setMixerScene(scene) and a typed scene passed to new Mixer({ sampleRate, scene }) use TypeError for unknown keys and wrong types, and RangeError for structured value refusals such as a numeric version other than 2. In Python, Mixer.from_json(json_text, ...) raises SonareError with INVALID_FORMAT, while Mixer(scene=mapping, ...) reports an unknown mapping key as SonareValueError, with the path rooted at scene..

The shipped schema catches structural and typed-field mistakes before loading. It cannot check processor-specific names inside the open params object, so consult the insert catalog and let the loader validate them. Other scene objects use additionalProperties: false with patternProperties allowing $ and x- annotations.

Strip ​

Each strip object describes one channel lane. All numeric fields have sensible defaults, so a minimal strip is just { "id": "vocal" }.

FieldTypeDefaultMeaning
idstring— (required)Unique strip identifier used by connections, sends, and VCA members
inputTrimDbnumber0Gain before any processing (the first stage in the strip signal flow)
faderDbnumber0Main fader level
vcaOffsetDbnumber0Per-strip VCA trim summed into the fader stage (the live setVcaOffsetDb(...) value; separate from any VCA group gainDb, which is applied as a delta on top and is not stored in this field)
pannumber0Pan position, -1 (left) … +1 (right). A value outside that range is refused
widthnumber1Stereo width / side multiplier (0 = mono, 1 = unchanged, 2 = doubled). A value outside 0 … 2 is refused
mutedbooleanfalseSilences the strip
soloedbooleanfalseImplies-mutes other (non-solo-safe) strips
soloSafebooleanfalseNever implied-muted by another strip's solo
panModestring"balance""balance", "stereoPan" or "dualPan"; see Accepted values
dualPanLeftnumber-1Left position in dualPan mode (default is identity hard-left, preserving the stereo image); a value outside -1 … +1 is refused
dualPanRightnumber1Right position in dualPan mode (default is identity hard-right); a value outside -1 … +1 is refused
sourceLayoutstring"stereo"Channel layout of the source feeding the strip: "mono", "stereo", "5.1", or "7.1". The writer omits it at the stereo default; any other string is rejected at load
surroundPanobjectidentitySurround-pan position for wider-than-stereo hosts. azimuth, divergence, and lfe affect the realtime engine's 5.1/7.1 group-bus panner; elevation and distance are reserved. Values are clamped into the panner's ranges on load and round-tripped through scene JSON; the writer omits the object at the centred default. The standalone offline Mixer remains stereo and therefore does not apply it
meteringobjectall onWhich meters the strip computes: enabled, lufs, truePeak (booleans, default true) and truePeakOversample (integer, default 4, either 4 or 8; any other value is refused). The writer omits the object when every meter is at its default
polarityInvertLeftbooleanfalseInverts the left channel polarity
polarityInvertRightbooleanfalseInverts the right channel polarity
panLawstring"const3Db""const3Db", "const4.5Db", "const6Db" or "linear0Db"; see Accepted values
channelDelaySamplesinteger0Per-strip delay, 0 … 192000; delays only this strip and is excluded from PDC. Out of range is rejected at load
eqobjectidentityThe strip's built-in equalizer, which runs pre-fader: enabled (default true) and bands, at most 24 EQ bands. Omitted by the writer while it is enabled and every band is at its default. Scene JSON is the only way to configure it from WASM, which has no EQ setters on Mixer
insertsarray[]In-series processors (see Insert)
sendsarray[]Parallel sends to buses (see Send)

Accepted values ​

Every closed set is a string token, matched exactly (case included). A number, a differently cased spelling or any other string is refused and the message names the field's path and the full set, for example Mixer.fromJson: strips[0].panMode must be one of balance, stereoPan, dualPan. The runtime setters take the same tokens: setPanLaw(strip, 'const3Db'), addSend(strip, { ..., timing: 'postFader' }) and, in Python, set_pan_law(strip, 'const3Db').

FieldAccepted tokens
panMode (strip, bus)balance, stereoPan, dualPan
panLaw (strip, bus)const3Db, const4.5Db, const6Db, linear0Db
slot (insert)pre, post
timing (send)preFader, postFader
type (EQ band)peak, lowShelf, highShelf, lowPass, highPass, bandPass, notch, allPass; tiltShelf and flatTilt are valid band types elsewhere but refused on a strip or bus EQ
role (bus)master, aux, submix
sourceLayout (strip), layout (bus)mono, stereo, 5.1, 7.1

An insert's slot and a send's timing are different vocabularies: "post" is a slot, "postFader" is a send timing, and each is refused in the other's field.

Serializing a scene after runtime pan edits preserves the strip's current panMode. Use Mixer.toJson() / Mixer.to_json() instead of rebuilding the pan fields by hand.

How a rejected scene reaches you

Malformed JSON reports the parser error. A refused scene field, such as an unsupported version, a wrong-typed value, an out-of-range value or an unknown processor, reports the path to that field.

RuntimeWhat you catch
WASM, Node nativeAn error from Mixer.fromJson(...) whose message reads Mixer.fromJson: <path> <reason>
PythonAn error from Mixer.from_json(...) whose message names Mixer.from_json and carries the same path and reason
C ABInullptr from sonare_mixer_from_scene_json; the reason is in sonare_last_error_message()

Log the message to see which field was wrong. Error classes distinguish document input from object arguments as described above; within either route, use the message path to find the refused field.

What is refused:

InputMessage names
A string where a number belongs ("faderDb": "loud"), a number where a boolean belongs ("muted": 1)strips[0].faderDb must be a number, strips[0].muted must be a boolean
params written as an escaped JSON stringstrips[0].inserts[0].params must be an object
A param value that is neither a number nor a boolean, such as "ratio": "2.5"strips[0].inserts[0].params.ratio must be a number or a boolean
A params key the processor does not readunknown key strips[0].inserts[0].params.<key> (expected <sorted processor keys>)
A fractional value for an integer fieldthe field, with the integer range it takes
A number outside the 32-bit float range (1e40)the field, with the range
An entry of the wrong container type ("strips": {}, a string in strips)strips must be an array, strips[0] must be an object
An empty or missing id, an unknown processor, a connection or sidechainKey naming no node, a duplicate strip idthe path, with what it must be

An unknown insert params key is refused at load time; check the processor's accepted keys with masteringInsertParamNames(...) before saving the scene.

Field terms: dual pan, polarity invert, pan law, PDC
  • Dual pan (panMode: "dualPan"): pans the left and right channels to independent positions instead of moving the whole signal together. Useful for narrowing or re-placing an already-stereo source.
  • Polarity invert: multiplies a channel by −1, flipping the waveform. Used to fix a track recorded out of phase with another; it changes phase relationships, not perceived loudness on its own.
  • Pan law: how much the center is attenuated relative to hard-left/right so loudness stays even as you pan. const 3 dB is constant power, const 6 dB is constant amplitude (it keeps the mono sum steady), const 4.5 dB sits between the two, and linear 0 dB applies no center compensation. The center dip reaches the output only in stereo-pan mode (panMode: "stereoPan"); in the default balance mode a centered strip stays at 0 dB under every law. See Mixing Engine.
  • PDC (plugin-delay compensation): when one path is delayed by a lookahead processor, the engine delays the shorter paths to match so everything lines up at the master. channelDelaySamples is excluded from that calculation.

Insert ​

An insert is a named processor running in series inside the strip (or a bus).

FieldTypeMeaning
slot"pre" | "post"Runs before or after the fader; defaults to "pre" when omitted. A send's timing uses preFader/postFader instead.
processorstringRequired. Processor id, e.g. eq.parametric, dynamics.compressor, effects.reverb.plate. See Mastering Processors for solo processors and Effects Inserts for the creative-FX catalog. An id the registry does not know is refused when the scene is loaded, not by the schema.
paramsobjectThe processor's parameters, keyed by parameter name, e.g. { "thresholdDb": -18, "ratio": 2.5 }. Values are numbers or booleans, with two processor-specific exceptions: a string for a named rig or an embedded impulse response, and a per-band array for the acoustic room morph. A numeric value written as a string is refused.
sidechainKeystringOptional. Strip id whose signal feeds this insert's external sidechain (e.g. ducking). Omitted when empty.

Sidechain and ducking

Normally a processor reacts to the audio passing through it. A sidechain makes it react to a different track instead: sidechainKey names that other strip. The classic use is ducking: a compressor on the music that turns the music down whenever the named voice strip is loud, so speech stays clear over a music bed.

On the live realtime engine, sidechain keys are bound with setStripSidechain (a track id or 'master' as the first argument) and setBusSidechain, which refuse a binding they cannot honor with InvalidParameter. canSetStripSidechain(trackId, insertIndex, source) and canSetBusSidechain ask the same question without changing anything and answer { ok, reason }, so a UI can gray out an impossible choice before the user makes it. reason is null exactly when ok is true; otherwise it is the first check that failed:

reasonThe binding is refused because
invalidTargetthe track id is 0, or the bus is not configured
insertOutOfRangethe strip has no insert at that index
undeclaredSourcethe source track or bus is not declared
invalidSourceKindthe source kind is neither a track nor a bus
selfKeya strip would key itself
cyclethe key would close a loop through outputs, sends, or other keys
tableFullthe sidechain binding table is full
planRefusedno delay-compensation plan exists for the alignment

The calls and their setup are in Realtime Engine.

params is an object

toJson() writes params as a nested object ("params": { "ratio": 2.5 }), and that is the only shape the loader and the schema admit. An escaped JSON string ("params": "{\"ratio\":2.5}") is refused with params must be an object.

Send ​

A send routes a copy of the strip's signal to a destination bus. The timing field chooses whether the copy is tapped before the fader ("preFader") or after it ("postFader") — see the channel-strip signal flow.

FieldTypeMeaning
idstringSend identifier, unique within the strip
destinationBusIdstringRequired. The id of the target bus. An id that no bus declares creates an implicit aux bus that routes to the master, so a misspelled destination is not rejected: it makes sound, and it raises a scene warning naming the strip and the bus (send 'a' targets undeclared bus 'nope'; created as implicit aux). Declare the bus you mean
sendDbnumberSend level in dB, default 0
timing"preFader" | "postFader"Tapped before or after the fader; defaults to "postFader"

Bus ​

FieldTypeMeaning
idstringRequired. Bus identifier (one bus is conventionally "master")
rolestring"master", "aux" (the default) or "submix"; any other string is refused
layoutstringChannel layout of the bus: "mono", "stereo" (default), "5.1", or "7.1". The master bus carries the project output layout. Omitted by the writer at the stereo default
inputTrimDbnumberGain at the bus input, default 0
widthnumberStereo width of the bus, default 1, in 0 … 2 like a strip's (a value outside it is refused). Refused when layout is wider than stereo, since a surround bed has no stereo image to narrow or widen
polarityInvertLeft / polarityInvertRightbooleanPer-channel polarity flip on the bus, default false
pan, panMode, dualPanLeft, dualPanRight, panLawas on a stripSame meaning and ranges as the strip fields. Anything other than the defaults is refused when layout is wider than stereo
eqobjectThe bus's built-in equalizer; the same shape as the strip's eq
insertsarrayProcessors on the bus itself (same Insert shape as a strip)

The writer omits layout, inputTrimDb, width, the pan fields, eq, and both polarity flags whenever they sit at their defaults, so a plain stereo bus serializes as just id, role, and inserts.

EQ bands ​

A strip's or bus's eq object is { "enabled": true, "bands": [...] }, with at most 24 bands. Each band has the same fields as the realtime engine's EqBandInput:

FieldMeaning
enabledDefaults to false: a band does nothing until it is enabled
typepeak (default), lowShelf, highShelf, lowPass, highPass, bandPass, notch or allPass; see Accepted values for tiltShelf and flatTilt
frequencyHz, gainDb, qCenter or corner frequency (default 1000), gain (default 0), and resonance or slope
slopeDbOct, coeffMode, placement, phase, soloed, bypassedFilter slope, coefficient mode, stereo placement, phase mode, and per-band solo and bypass
dynamic, thresholdDb, ratio, rangeDb, attackMs, releaseMs, …The per-band dynamic-EQ fields; see eqBand in the schema for the full list

A band left out of the list stays at the identity, and the writer drops the whole object while every band is untouched.

Bus roles are a closed set

A bus role is master, aux or submix, and a bus with no role is aux. submix marks a group bus that collects related strips (a drum bus); the built-in drumBusSubgroup preset writes "role": "submix" for it. Any other string, a misspelt "mastre" included, is refused with the path and the three accepted roles, so a typo cannot quietly turn the master into an ordinary bus. The master is the bus with the role master.

VCA group ​

A VCA (voltage-controlled amplifier) group is one fader that trims several strips at once without re-routing their audio.

FieldTypeMeaning
idstringRequired. Group identifier
gainDbnumberOffset summed into each member's fader, default 0
membersstring[]Strip ids governed by the group

Connection ​

FieldTypeMeaning
sourcestringRequired. Strip or bus id the signal leaves
destinationstringRequired. Strip or bus id the signal enters

Connections are the graph edges. A strip routed to master is { "source": "vocal", "destination": "master" }. A send's bus reaches the master through a connection from the bus (or its return strip) to master. Both ends must name a strip or bus in the document; the mixer build refuses connection references unknown node otherwise.

A strip with no outgoing connection is routed to the master bus automatically when the graph is built. An explicitly declared bus is not: an aux or group bus with no connection out stays unpatched, which is how a scene keeps a bus silent on purpose.

Validating a scene against the schema ​

The scene format is described by a JSON Schema (draft 2020-12) titled MixSceneDocument. It covers the document Mixer.fromJson reads, toJson writes, mixingAssistantSuggest returns, and sonare mix --scene loads. The engine's own tests hold the schema to the writer's published field list and validate every built-in preset against it, so a key the writer emits cannot be missing from it.

WherePath
Engine source treeschemas/mixer-scene.schema.json
npm @libraz/libsonareexports subpath @libraz/libsonare/schemas/mixer-scene.schema.json
Python wheellibsonare/schemas/mixer-scene.schema.json inside the installed package
Python sdistschemas/mixer-scene.schema.json

The $id (https://libraz.net/schemas/libsonare/mixer-scene.schema.json) is an identifier, not a download location — point your validator at the installed copy. The @libraz/libsonare-native package and the CMake install do not carry the file; take it from one of the packages above.

Associate a schema with a scene

A scene may carry a "$schema" key for editor discovery. Keys beginning with $ or x- are accepted on every object by the schema and ignored without warnings by the loader. You can also associate the schema through an editor file-match rule or pass it directly to a validator, as below.

typescript
import Ajv from 'ajv/dist/2020';
import schema from '@libraz/libsonare/schemas/mixer-scene.schema.json' with { type: 'json' };

const validate = new Ajv().compile(schema);
const scene = JSON.parse(sceneText);
if (!validate(scene)) {
  throw new Error(JSON.stringify(validate.errors, null, 2));
}
const mixer = Mixer.fromJson(sceneText, { sampleRate: 48000, maxBlockSize: 512 });
bash
# npm: ajv-cli, with the draft the schema declares
npx ajv-cli validate --spec=draft2020 \
  -s node_modules/@libraz/libsonare/schemas/mixer-scene.schema.json \
  -d my-scene.json

# Python: check-jsonschema, reading the copy inside the installed wheel
check-jsonschema \
  --schemafile "$(python -c 'from importlib.resources import files; print(files("libsonare") / "schemas/mixer-scene.schema.json")')" \
  my-scene.json
json
{
  "json.schemas": [
    {
      "fileMatch": ["*.scene.json"],
      "url": "./node_modules/@libraz/libsonare/schemas/mixer-scene.schema.json"
    }
  ]
}

Where the schema and the loader disagree ​

The loader is the authority. The schema is written to be stricter than the loader for some structural and typed-field mistakes; in the other direction, the loader enforces a few things the schema leaves open, and the build checks references no schema can express. Validate first, load next, then read sceneWarnings() for remaining recoverable diagnostics such as undeclared sends.

InputSchemaLoader
Missing versionRejected (required)Accepted
Unknown or misspelled scene key (faderDB), snake_case key (fader_db)Rejected (additionalProperties: false)Refused as unknown key <path> (expected <sorted accepted keys>), without a replacement hint
Insert params key the processor does not readAccepted (the processor-specific object is open)Refused with its indexed path and sorted accepted processor keys
Wrong-typed scalar ("faderDb": "loud", "muted": 1), params as an escaped stringRejectedRefused, naming the path
pan, dualPanLeft, dualPanRight outside −1 … 1, width outside 0 … 2Rejected (minimum/maximum)Refused
Missing id, processor, destinationBusId, source, destinationRejected (required, minLength: 1)Refused, naming the path
Bus role other than master, aux, submixAccepted (the schema describes role as an unrestricted string)Refused
tiltShelf or flatTilt as a strip or bus EQ band typeAcceptedRefused
Number outside 32-bit float range (1e40)AcceptedRefused
Unknown processor id, connection or sidechainKey naming an unknown node, duplicate idsAccepted (not expressible)Refused
destinationBusId naming no declared busAccepted (not expressible)Accepted: the send feeds an implicit aux bus routed to the master, which busCount does not count, and sceneWarnings() reports it

Where both agree, the validator's message simply arrives earlier and names the path. They agree that version must be 2 when present, that slot is "pre" or "post", that timing is "preFader" or "postFader", that panMode, panLaw, sourceLayout and layout are one of their tokens, and that integer fields must be integral. They also share the ranges channelDelaySamples 0–192000 and metering.truePeakOversample 4 or 8.

Built-In Presets ​

PresetIntent
vocalReverbSendVocal strip (EQ + compressor inserts) with a post-fader aux send into a plate-reverb return
drumBusSubgroupKick/snare/overheads into a group bus (role submix), made cohesive with parallel compression and tape, ridden by a "drums" VCA
commentaryDuckingHost/guest speech (de-ess + compress) with a music bed ducked via dynamics.sidechainRouter keyed off the host

Discover them at runtime with mixingScenePresetNames() and fetch one with mixingScenePreset(name).

A complete, annotated scene ​

This is the actual output of mixingScenePreset('vocalReverbSend') (defaults trimmed for readability, so the shortened form still validates). dryWet: 1 keeps the return fully wet; the plate's own default is 0.35, so leaving it out would let dry signal into the return. It shows every relationship: a vocal strip with two pre-fader inserts and a post-fader send, a reverb return strip, two buses, and the connections that wire them to the master.

json
{
  "version": 2,
  "strips": [
    {
      "id": "vocal",
      "faderDb": -3,
      "inserts": [
        { "slot": "pre", "processor": "eq.parametric",
          "params": { "band0.frequencyHz": 80, "band1.frequencyHz": 4000, "band1.gainDb": 2 } },
        { "slot": "pre", "processor": "dynamics.compressor", "params": { "thresholdDb": -18, "ratio": 2.5 } }
      ],
      "sends": [
        { "id": "vocal-to-verb", "destinationBusId": "vocal-verb", "sendDb": -14, "timing": "postFader" }
      ]
    },
    {
      "id": "vocal-verb-return",
      "faderDb": -10,
      "width": 1.25,
      "inserts": [
        { "slot": "post", "processor": "effects.reverb.plate", "params": { "decaySec": 1.8, "preDelayMs": 25, "dryWet": 1 } }
      ]
    }
  ],
  "buses": [
    { "id": "master",     "role": "master" },
    { "id": "vocal-verb", "role": "aux" }
  ],
  "vcaGroups": [],
  "connections": [
    { "source": "vocal",             "destination": "master" },
    { "source": "vocal-verb",        "destination": "vocal-verb-return" },
    { "source": "vocal-verb-return", "destination": "master" }
  ]
}

Trace the reverb below: one reverb instance, with the dry vocal and the wet return kept as separate paths to master.

Reverb-send signal path
drypost-fader sendwetvocal (strip)vocal-verb (aux bus)vocal-verb-return(plate reverb)master
The vocal strip connects straight to master (dry) and, via a post-fader send, into the vocal-verb aux bus; that bus feeds the vocal-verb-return strip hosting the plate reverb, which returns to master (wet).

The eq.parametric insert uses band-indexed keys

The eq.parametric insert reads band-indexed keys — band{N}.type, band{N}.frequencyHz, band{N}.gainDb, band{N}.q, and the per-band dynamic-EQ fields. In this preset, band0 is an 80 Hz high-pass and band1 is a +2 dB presence bell at 4 kHz. This insert is separate from the strip's built-in eq field.

List the full key set with masteringInsertParamNames('eq.parametric'). A key outside that list (say, a flat highPassHz) refuses the scene load with its indexed path and the accepted keys. sceneWarnings() remains for recoverable diagnostics such as sends to undeclared buses.

For one-knob tonal moves, simpler inserts remain: eq.tilt (tiltDb, pivotHz) for a broad bright/dark tilt, and spectral.airBand (amount, shelfFrequencyHz) for a high-shelf "air" lift.

Editing and re-saving ​

typescript
const json = JSON.stringify(mixingScenePreset('vocalReverbSend'));
const mixer = Mixer.fromJson(json, { sampleRate: 48000, maxBlockSize: 512 });

mixer.sceneWarnings();  // [] recoverable warnings, such as sends to undeclared buses

mixer.addSend(0, { id: 'more-verb', destinationBusId: 'vocal-verb', sendDb: -18, timing: 'postFader' });  // topology change
mixer.compile();                                                 // rebuild before timing-critical work

const saved = mixer.toJson();   // round-trips back to the same format
python
import json
import libsonare as sonare

scene_json = json.dumps(sonare.mixing_scene_preset('vocalReverbSend'))
with sonare.Mixer.from_json(scene_json, sample_rate=48000, max_block_size=512) as mixer:
    mixer.scene_warnings()  # [] recoverable warnings, such as sends to undeclared buses

    mixer.add_send(0, 'more-verb', 'vocal-verb', -18, 'postFader')  # topology change
    mixer.compile()                                                  # rebuild before timing-critical work

    saved = mixer.to_json()   # round-trips back to the same format
bash
# Export a built-in scene, edit the JSON file, then render it.
sonare mixing-preset --preset vocalReverbSend > my-scene.json
sonare mix --scene my-scene.json --input vocal=vocal.wav -o master.wav

mix --scene renders a whole scene

Rendering a whole scene from a JSON file with one --input per strip is mix, on both the Python and the native CLI. mix-strip is a separate single-strip, single-input processor with no --scene — use it for quick per-strip checks, not full scene renders. See the channel strip.

When to recompile

Structural edits (adding or removing buses, sends, or connections, or re-routing with setOutputBus) mark the graph dirty and need compile() before the next timing-critical block. Parameter moves (setSendDb / Python set_send_db, setPanLaw), VCA group changes (add/remove/gain — applied live as control-only gain offsets on member strips), and scheduled automation do not need a recompile.