Maolan OSC
An Open Sound Control surface covering transport, track management, routing, plugins, automation, clip editing, MIDI editing, MIDI learn, devices, offline bounce, and state queries.
Enabling OSC
OSC is disabled by default and must be turned on from the GUI preferences before the engine starts listening.
Open the preferences dialog from the GUI.
Turn on Enable OSC.
Save preferences so the engine starts its OSC listener thread.
Config File
The preference is stored in:
~/.config/maolan/config.toml
OSC Listener
A single listener serves every command and query address.
Bind Address
The engine listens on:
0.0.0.0:9000
Scope
-
There is no
/maolanprefix on any OSC address. -
Arguments use OSC type tags:
iinteger,ffloat,sstring,T/Ftrue/false (also accepted asi0/1). - Complex structured data (clip data, MIDI notes, controllers, tempo maps, modulators, audio-device settings, automation lanes) is sent as JSON strings, because the OSC implementation uses flat typed arguments rather than bundles.
Command Addresses
All command addresses accepted by the engine, grouped by area.
Transport
Start playback.
Stop playback.
Pause transport.
Jump to session start.
Jump to session end.
Set transport position in samples.
Set position after N frames.
Start session playback.
Enable (1) or disable (0) recording.
Toggle looping.
Loop start and end in samples.
Clear the loop range.
Toggle punch recording.
Punch start and end in samples.
Clear the punch range.
Toggle the metronome.
Toggle clip playback.
Toggle session clip playback.
Panic: stop all audio output.
Set tempo in BPM.
Numerator and denominator.
JSON tempo/time-signature map.
Enable (1) or disable (0) step
recording.
Compatibility Aliases
-
/transport/jump_to_start→/transport/start -
/transport/jump_to_end→/transport/end -
/transport/start_of_session→/transport/start -
/transport/end_of_session→/transport/end
Tempo map JSON format
{
"tempo_points": [
{"sample": 0, "bpm": 120.0}
],
"time_signature_points": [
{"sample": 0, "numerator": 4, "denominator": 4}
]
}
Session
Launch clip on track/scene.
Stop clip on track/scene.
Launch every clip in the given scene.
Stop every clip in the given scene.
Stop all currently playing session clips.
Set session path.
History is intentionally not exposed over OSC.
Track Management
name, audio_ins, midi_ins, audio_outs, midi_outs, folder.
Remove a track by name.
Rename a track.
Set the folder flag.
Toggle folder state.
Empty parent string removes the parent.
Add an audio input.
Remove an audio input.
Add an audio output.
Remove an audio output.
Track Mixing / State
Set track level.
Set track balance.
Set automation level.
Set automation balance.
track_name, channel, cc, value.
Mute or unmute the track.
Solo or unsolo the track.
Arm or disarm the track.
Toggle phase invert.
Toggle the master flag.
RGBA track color (alpha defaults to 1.0).
Clear the track color.
Freeze or unfreeze the track.
Channel -1 clears the assignment.
Assign a session slot.
Toggle session slot playback.
Toggle input monitoring.
Toggle disk monitoring.
Toggle MIDI input monitoring.
Toggle MIDI disk monitoring.
Clear default passthrough.
Remove all plugins from the track.
Connect audio between nodes.
Disconnect audio between nodes.
Connect MIDI between nodes.
Disconnect MIDI between nodes.
Connectable node strings
"track_input", "track_output",
"child:<name>", "clap_<id>",
"vst3_<id>", "lv2_<id>".
Routing
from_track, from_port, to_track, to_port, kind.
Same arguments; removes the connection.
kind is "audio" or
"midi".
Clips
track, name, start, length, offset, input_channel, muted, fade_enabled, fade_in, fade_out, kind, optional source_name, optional preview_name.
track, kind, comma-separated indices.
kind, from_track, from_index, to_track, to_offset, to_channel, copy.
track, clip_index, kind, fade_enabled, fade_in_samples, fade_out_samples.
track, clip_index, kind, start, length, offset.
Mute or unmute a clip.
Rename a clip.
Set the clip source name.
Empty JSON string clears the graph.
JSON pitch-correction data or empty string.
track, kind, audio_clip JSON, midi_clip JSON.
Pitch-correction JSON format
{
"preview_name": "preview.wav",
"source_name": "source.wav",
"source_offset": 0,
"source_length": 44100,
"frame_likeness": 0.5,
"inertia_ms": 50,
"formant_compensation": false,
"points": [
{
"start_sample": 0,
"length_samples": 1000,
"detected_midi_pitch": 60.0,
"target_midi_pitch": 61.0,
"clarity": 0.9
}
]
}
MIDI Editing
All MIDI editing commands take a JSON string as the last argument.
Insert notes.
Delete notes.
Modify notes.
Insert controllers.
Delete controllers.
Modify controllers.
Send SysEx data.
device, channel, pitch, velocity.
Insert-notes JSON format
[
{"index": 0, "start_sample": 0, "length_samples": 1000,
"pitch": 60, "velocity": 100, "channel": 0}
]
Delete-notes JSON format
{
"indices": [0, 1],
"deleted": [
{"index": 0, "start_sample": 0, "length_samples": 1000,
"pitch": 60, "velocity": 100, "channel": 0}
]
}
Modify-notes JSON format
{
"indices": [0, 1],
"new": [{"start_sample": 0, "length_samples": 1000, "pitch": 60}],
"old": [{"start_sample": 0, "length_samples": 1000, "pitch": 59}]
}
Controller JSON objects use sample,
controller, value, and
channel.
SysEx JSON format
[{"sample": 0, "data": [240, 1, 2, 247]}]
Plugins
track_name, format ("clap",
"vst3", "lv2"), plugin ID.
Unload a plugin.
Unload one plugin instance.
track_name, format, instance_id, bypassed.
Show the plugin GUI.
Snapshot plugin state.
JSON state ({"bytes":[...]} for CLAP,
{"plugin_id":"...","component_state":[...],"controller_state":[...]}
for VST3).
Set the plugin resource directory.
track_name, format, instance_id, file_index, path.
Connect plugin audio.
Disconnect plugin audio.
Connect plugin MIDI.
Disconnect plugin MIDI.
Set a plugin parameter.
Set a clip-plugin parameter.
Snapshot clip-plugin state.
Restore clip-plugin state from JSON.
Set the clip-plugin resource directory.
Update a clip-plugin file reference.
Plugin graph node strings
"track_input", "track_output",
"clap_<instance_id>",
"vst3_<instance_id>",
"lv2_<instance_id>".
Automation
Targets: "volume", "balance",
"midi_cc_<channel>_<cc>" (channel is
1–16).
track_name, mode ("read",
"touch", "latch",
"write").
Toggle an automation lane.
track_name, target, sample, value.
track_name, target, sample.
MIDI Learn
Track targets: volume, balance,
mute, solo, arm,
input_monitor, disk_monitor. Global
targets: play_pause, stop,
record_toggle. Session targets:
slot:<track>:<scene>,
scene:<scene>,
stop_track:<track>, stop_all.
Arm learn for a track target.
Arm learn for a global target.
Arm learn for a session target.
Bind a track target.
Bind a global target.
Bind a session target.
Clear all bindings.
Binding JSON (empty string clears)
{"device": "X-Touch", "channel": 1, "cc": 7}
Modulators / Devices
JSON array of modulators.
JSON audio-device configuration.
Open a MIDI input device.
Open a MIDI output device.
Add a JACK audio input.
Remove a JACK audio input.
Add a JACK audio output.
Remove a JACK audio output.
Audio-device JSON format
{
"device": "hw:0",
"input_device": "hw:0",
"sample_rate_hz": 48000,
"bits": 32,
"exclusive": false,
"period_frames": 256,
"nperiods": 2,
"sync_mode": false,
"actual_period_frames": 256,
"input_channels": 2,
"output_channels": 2,
"bytes_per_frame": 8
}
Offline Bounce
track, output_path, start_sample, length_samples, automation_lanes JSON, apply_fader.
Cancel a bounce.
Cancel all bounces.
Piano Key
track_name, note, velocity, on.
Query Addresses
Queries return replies to the sender.
→ /response/tracks s... — track names.
→ /response/transport i i f i i — sample,
playing, tempo, time_sig_num, time_sig_denom.
→ /response/meters ... — current meter levels.
→ /response/plugins s i (i s s s i)* —
track_name, plugin_count, then instance_id, format, uri,
name, bypassed per plugin.
→ /response/plugin_parameters s i s s —
track_name, instance_id, format, parameters_json.
→ clip plugin parameters reply.
→ /response/clap_plugins s...
→ CLAP plugin list with I/O capabilities.
→ /response/vst3_plugins s...
→ /response/lv2_plugins s...
→ /response/clap_note_names s...
→ /response/lv2_midnam s ... — LV2 midnam MIDI
note names; Unix only.
→ /response/vst3_graph s...
→ /response/diagnostics s...
→ /response/midi_learn_report s...
Reply Formats
-
Plugin-list replies contain strings in the form
id|namefor CLAP and VST3,uri|namefor LV2. -
Errors are reported as
/error s.
maolan-osc Helper
The repository includes a command-line helper with global options and subcommands covering the full OSC surface.
Global Options
maolan-osc --target 127.0.0.1:9000 play
maolan-osc --host 192.168.1.10 --port 9000 stop
maolan-osc --file commands.txt
Subcommands
Subcommands cover transport, tracks, routing, plugins, clip plugins, clips, MIDI editing, automation, MIDI learn, session, step recording, and queries.
Run maolan-osc --help for the full command list.
Command Files
--file <path> reads commands from a file, one
per line, using the same syntax as the command line. Blank
lines and lines starting with # are ignored, and
single or double quotes group arguments containing whitespace
(track names, JSON payloads).
The whole file is parsed first and every error is reported with its line number; packets are sent only when the file parses without errors.
# set up a mix
track level "Drums" -6.0
track mute "Drums" 1
tempo 128.5
A ready-made example file with five commands is available at /commands.txt.
Examples
cargo run --bin maolan-osc -- play
cargo run --bin maolan-osc -- tempo 128.5
cargo run --bin maolan-osc -- record 1
cargo run --bin maolan-osc -- track add "Vocals" 2 0 2 0
cargo run --bin maolan-osc -- track level "Drums" -6.0
cargo run --bin maolan-osc -- connect "Kick" 0 "Drums" 0 audio
cargo run --bin maolan-osc -- plugin load "Drums" clap "rs.maolan.widener"
cargo run --bin maolan-osc -- plugin set_param "Drums" clap 0 0 0.75
cargo run --bin maolan-osc -- midi insert_notes "Piano" 0 '[{"index":0,"start_sample":0,"length_samples":1000,"pitch":60,"velocity":100,"channel":0}]'
cargo run --bin maolan-osc -- automation point "Drums" midi_cc_1_7 44100 64.0
cargo run --bin maolan-osc -- midi_learn bind_track "Drums" volume '{"device":"X-Touch","channel":1,"cc":7}'
cargo run --bin maolan-osc -- query tracks
cargo run --bin maolan-osc -- session stop_scene 2
Notes
- OSC only starts after it is enabled in preferences and the setting has been saved.
-
If OSC is disabled,
maolan-osccan still send packets, but the engine will not be listening for them. - Query replies are sent to the source address of the request.