Skip to content

Mode lifecycle

Every mode is loaded, started, stopped and tweaked through these four messages. One dispatcher on the SuperCollider side handles all modes; adding a mode adds no new lifecycle plumbing.

The load → ack → start sequence exists because /mode/load may need to read files or allocate buffers. Starting before SuperCollider is ready produces silence that looks exactly like a broken patch.

/mode/load

engine → sc event since 0.1.0

Load a mode and its initial parameters. Does not start it.

s modeId
s
modeId s string
Identifier of the mode to load, e.g. "route". Must match a mode id in the reference section.

Acknowledged by /mode/loaded.

packet /mode/load route
SuperCollider NetAddr("127.0.0.1", 57120).sendMsg('/mode/load', "route");
engine (C#) osc.Send(Osc.ModeLoad, "route");

The modeId is followed by that mode's initParams, in the exact order the mode declares them. The concrete type tag string therefore differs per mode — each mode page shows its own.

Send /wall/config and load every sample the mode will name BEFORE /mode/load. A mode never waits for geometry or files once it starts.

Loading while a mode is running implicitly stops the running one.

/mode/loaded

sc → engine event since 0.1.0

SuperCollider has finished loading the requested mode.

s modeId
i ok
s detail
sis
modeId s string
The mode that was loaded, echoed back.
ok i int32 0 | 1
1 on success, 0 on failure.
detail s string
Empty on success; a human-readable reason on failure.
packet /mode/loaded route 1
SuperCollider ~osc[\modeLoaded].value("route", 1, "");
engine (C#) // handler for Osc.ModeLoaded

/mode/start

engine → sc event since 0.1.0

Start the loaded mode. Idempotent.

/mode/start takes no arguments.

packet /mode/start
SuperCollider NetAddr("127.0.0.1", 57120).sendMsg('/mode/start');
engine (C#) osc.Send(Osc.ModeStart);

Sending this twice is safe. Sending it with no mode loaded is a no-op.

/mode/stop

engine → sc event since 0.1.0

Stop the running mode and release its resources. Idempotent.

/mode/stop takes no arguments.

packet /mode/stop
SuperCollider NetAddr("127.0.0.1", 57120).sendMsg('/mode/stop');
engine (C#) osc.Send(Osc.ModeStop);

Stops with the mode's own release envelope. For an immediate hard kill, use /sys/panic instead.

/mode/param

engine → sc state since 0.1.0

Tweak one runtime parameter of the running mode.

s name
f value
sf
name s string
Parameter name, from the running mode's runtimeParams list. Unknown names are logged and ignored, never an error.
value f float32
New value, always a float even when the parameter reads as an integer. Clamped to the parameter's declared range.
packet /mode/param tempo 110.0
SuperCollider NetAddr("127.0.0.1", 57120).sendMsg('/mode/param', "tempo", 110.0);
engine (C#) osc.Send(Osc.ModeParam, "tempo", 110.0f);

The modeId in /mode/load is followed by that mode’s init parameters, in order, so the concrete type tag string differs per mode:

Mode/mode/load type tagsArguments after the address
Chase the Shapesisifs“chase”, zoneCount, shape, shapeSize, speed, soundSet
Mirror, Mirror on the Wallsiiss“mirror”, zoneCount, leaderZone, display, soundSet
Find the Matchsisss“match”, pairCount, complexity, variant, soundSet
Sound Wallssi“soundwall”, playback, maxVoices
Climbing Synthsssffis“synth”, scale, customScale, rootNote, tempo, steps, instrument
Draw & Climbss“draw”, soundSet
Memory Gamessi“memory”, storyId, routeLength
Arcadessi“arcade”, gameId, startMission