OSC Control Surface Command & query reference

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.

0.0.0.0:9000
Default OSC listener
13
Command groups
15
Query addresses

Enabling OSC

OSC is disabled by default and must be turned on from the GUI preferences before the engine starts listening.

1. Open Preferences

Open the preferences dialog from the GUI.

2. Enable OSC

Turn on Enable OSC.

3. Save

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 /maolan prefix on any OSC address.
  • Arguments use OSC type tags: i integer, f float, s string, T/F true/false (also accepted as i 0/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

/transport/play

Start playback.

/transport/stop

Stop playback.

/transport/pause

Pause transport.

/transport/start

Jump to session start.

/transport/end

Jump to session end.

/transport/position i

Set transport position in samples.

/transport/position_at i i

Set position after N frames.

/transport/session_play

Start session playback.

/transport/record i

Enable (1) or disable (0) recording.

/transport/loop_enable i

Toggle looping.

/transport/loop_range ii

Loop start and end in samples.

/transport/loop_range/clear

Clear the loop range.

/transport/punch_enable i

Toggle punch recording.

/transport/punch_range ii

Punch start and end in samples.

/transport/punch_range/clear

Clear the punch range.

/transport/metronome i

Toggle the metronome.

/transport/clip_playback i

Toggle clip playback.

/transport/session_clip_playback i

Toggle session clip playback.

/transport/panic

Panic: stop all audio output.

/transport/tempo f

Set tempo in BPM.

/transport/time_signature ii

Numerator and denominator.

/transport/tempo_map s

JSON tempo/time-signature map.

/step_recording i

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

/session/launch s i

Launch clip on track/scene.

/session/stop s i

Stop clip on track/scene.

/session/scene i

Launch every clip in the given scene.

/session/stop_scene i

Stop every clip in the given scene.

/session/stopall

Stop all currently playing session clips.

/session/path s

Set session path.

History is intentionally not exposed over OSC.

Track Management

/track/add s i i i i i

name, audio_ins, midi_ins, audio_outs, midi_outs, folder.

/track/remove s

Remove a track by name.

/track/rename s s

Rename a track.

/track/set_folder s i

Set the folder flag.

/track/toggle_folder s

Toggle folder state.

/track/set_parent s s

Empty parent string removes the parent.

/track/add_audio_input s

Add an audio input.

/track/remove_audio_input s

Remove an audio input.

/track/add_audio_output s

Add an audio output.

/track/remove_audio_output s

Remove an audio output.

Track Mixing / State

/track/level s f

Set track level.

/track/balance s f

Set track balance.

/track/automation_level s f

Set automation level.

/track/automation_balance s f

Set automation balance.

/track/midi_cc s i i i

track_name, channel, cc, value.

/track/mute s i

Mute or unmute the track.

/track/solo s i

Solo or unsolo the track.

/track/arm s i

Arm or disarm the track.

/track/phase s i

Toggle phase invert.

/track/master s i

Toggle the master flag.

/track/color s f f f [f]

RGBA track color (alpha defaults to 1.0).

/track/color/clear s

Clear the track color.

/track/frozen s i

Freeze or unfreeze the track.

/track/midi_lane_channel s i i

Channel -1 clears the assignment.

/track/session_slot s i s

Assign a session slot.

/track/session_slot_play_enabled s i i

Toggle session slot playback.

/track/toggle_input_monitor s i

Toggle input monitoring.

/track/toggle_disk_monitor s i

Toggle disk monitoring.

/track/toggle_midi_input_monitor s i

Toggle MIDI input monitoring.

/track/toggle_midi_disk_monitor s i

Toggle MIDI disk monitoring.

/track/clear_default_passthrough s

Clear default passthrough.

/track/clear_plugins s

Remove all plugins from the track.

/track/connect_audio s s i s i

Connect audio between nodes.

/track/disconnect_audio s s i s i

Disconnect audio between nodes.

/track/connect_midi s s i s i

Connect MIDI between nodes.

/track/disconnect_midi s s i s i

Disconnect MIDI between nodes.

Connectable node strings

"track_input", "track_output", "child:<name>", "clap_<id>", "vst3_<id>", "lv2_<id>".

Routing

/connect s i s i s

from_track, from_port, to_track, to_port, kind.

/disconnect s i s i s

Same arguments; removes the connection.

kind is "audio" or "midi".

Clips

/clip/add s s i i i i i i i i s [s] [s]

track, name, start, length, offset, input_channel, muted, fade_enabled, fade_in, fade_out, kind, optional source_name, optional preview_name.

/clip/remove s s s

track, kind, comma-separated indices.

/clip/move s s i s i i i

kind, from_track, from_index, to_track, to_offset, to_channel, copy.

/clip/fade s i s i i i

track, clip_index, kind, fade_enabled, fade_in_samples, fade_out_samples.

/clip/bounds s i s i i i

track, clip_index, kind, start, length, offset.

/clip/mute s i s i

Mute or unmute a clip.

/clip/rename s i s s

Rename a clip.

/clip/source_name s i s s

Set the clip source name.

/clip/plugin_graph_json s i s

Empty JSON string clears the graph.

/clip/pitch_correction s i s

JSON pitch-correction data or empty string.

/clip_group/add s s s s

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.

/midi/insert_notes s i s

Insert notes.

/midi/delete_notes s i s

Delete notes.

/midi/modify_notes s i s

Modify notes.

/midi/insert_controllers s i s

Insert controllers.

/midi/delete_controllers s i s

Delete controllers.

/midi/modify_controllers s i s

Modify controllers.

/midi/sysex s i s

Send SysEx data.

/midi/step_record s i i i

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

/plugin/load s s s

track_name, format ("clap", "vst3", "lv2"), plugin ID.

/plugin/unload s s s

Unload a plugin.

/plugin/unload_instance s s i

Unload one plugin instance.

/plugin/bypass s s i i

track_name, format, instance_id, bypassed.

/plugin/show_gui s s i

Show the plugin GUI.

/plugin/snapshot_state s s i

Snapshot plugin state.

/plugin/restore_state s s i s

JSON state ({"bytes":[...]} for CLAP, {"plugin_id":"...","component_state":[...],"controller_state":[...]} for VST3).

/plugin/set_resource_dir s s i s

Set the plugin resource directory.

/plugin/update_file_reference s s i i s

track_name, format, instance_id, file_index, path.

/plugin/connect_audio s s i s i

Connect plugin audio.

/plugin/disconnect_audio s s i s i

Disconnect plugin audio.

/plugin/connect_midi s s i s i

Connect plugin MIDI.

/plugin/disconnect_midi s s i s i

Disconnect plugin MIDI.

/plugin/set_param s s i i f

Set a plugin parameter.

/clip_plugin/set_param s s i i i f

Set a clip-plugin parameter.

/clip_plugin/snapshot_state s s i i

Snapshot clip-plugin state.

/clip_plugin/restore_state s s i i s

Restore clip-plugin state from JSON.

/clip_plugin/set_resource_dir s s i i s

Set the clip-plugin resource directory.

/clip_plugin/update_file_reference s s i i i s

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).

/automation/mode s s

track_name, mode ("read", "touch", "latch", "write").

/automation/toggle_lane s s

Toggle an automation lane.

/automation/insert_point s s i f

track_name, target, sample, value.

/automation/delete_point s s i

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.

/midi_learn/arm_track s s

Arm learn for a track target.

/midi_learn/arm_global s

Arm learn for a global target.

/midi_learn/arm_session s

Arm learn for a session target.

/midi_learn/bind_track s s s

Bind a track target.

/midi_learn/bind_global s s

Bind a global target.

/midi_learn/bind_session s s

Bind a session target.

/midi_learn/clear

Clear all bindings.

Binding JSON (empty string clears)

{"device": "X-Touch", "channel": 1, "cc": 7}

Modulators / Devices

/modulators s

JSON array of modulators.

/device/audio_open s

JSON audio-device configuration.

/device/midi_in_open s

Open a MIDI input device.

/device/midi_out_open s

Open a MIDI output device.

/device/jack/add_audio_in

Add a JACK audio input.

/device/jack/remove_audio_in i

Remove a JACK audio input.

/device/jack/add_audio_out

Add a JACK audio output.

/device/jack/remove_audio_out i

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

/bounce/start s s i i s i

track, output_path, start_sample, length_samples, automation_lanes JSON, apply_fader.

/bounce/cancel s

Cancel a bounce.

/bounce/cancel_all

Cancel all bounces.

Piano Key

/piano_key s i i i

track_name, note, velocity, on.

Query Addresses

Queries return replies to the sender.

/query/tracks

/response/tracks s... — track names.

/query/transport

/response/transport i i f i i — sample, playing, tempo, time_sig_num, time_sig_denom.

/query/meters

/response/meters ... — current meter levels.

/query/plugins s

/response/plugins s i (i s s s i)* — track_name, plugin_count, then instance_id, format, uri, name, bypassed per plugin.

/query/plugin_parameters s s i i

/response/plugin_parameters s i s s — track_name, instance_id, format, parameters_json.

/query/clip_plugin_parameters s s i i i

→ clip plugin parameters reply.

/query/clap_plugins

/response/clap_plugins s...

/query/clap_plugins_with_capabilities

→ CLAP plugin list with I/O capabilities.

/query/vst3_plugins

/response/vst3_plugins s...

/query/lv2_plugins

/response/lv2_plugins s...

/query/clap_note_names s

/response/clap_note_names s...

/query/lv2_midnam s

/response/lv2_midnam s ... — LV2 midnam MIDI note names; Unix only.

/query/vst3_graph s

/response/vst3_graph s...

/query/diagnostics

/response/diagnostics s...

/query/midi_learn_report

/response/midi_learn_report s...

Reply Formats

  • Plugin-list replies contain strings in the form id|name for CLAP and VST3, uri|name for 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-osc can still send packets, but the engine will not be listening for them.
  • Query replies are sent to the source address of the request.