No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-10-21 04:31:07 +02:00
src better ofx support 2026-10-21 04:31:07 +02:00
.gitignore socket docs 2026-10-18 19:55:15 +02:00
Cargo.lock better ofx support 2026-10-21 04:31:07 +02:00
Cargo.toml better ofx support 2026-10-21 04:31:07 +02:00
README.md socket docs 2026-10-18 19:55:15 +02:00

mms

mms exposes a local Unix-domain control socket while the desktop app is running. It accepts text commands for transport, tracks, devices, MIDI input and recording, clip import and editing, media analysis, export, project files, and UI interaction.

This reference was checked against the implementation and the running app's help output on 2026-10-18. It documents the current command handlers, including their defaults and limitations; it is not a proposed API. Runtime checks for this documentation were limited to inspection commands. Behavior of editing commands below was checked in source, not exhaustively exercised against the open project.

Connect

Use the same mms executable as the running app:

target/debug/mms --send ping
target/debug/mms --send help
target/debug/mms --send state

--send must be the first argument. It connects to an existing app; it does not launch the GUI.

Both server and client choose the socket path using their own environment:

Environment Socket path
XDG_RUNTIME_DIR is set $XDG_RUNTIME_DIR/mms.sock
XDG_RUNTIME_DIR is unset /tmp/mms-<uid>.sock, using the process's numeric user ID

If the app and command shell have different environments, set the client's runtime directory to the app's actual directory. For example, the app used to verify these docs listens at /run/user/1000/mms.sock:

XDG_RUNTIME_DIR=/run/user/1000 target/debug/mms --send state

The server starts automatically. If another instance already owns the selected socket, the new instance continues without socket control and reports control socket disabled: ... on stderr. A stale socket is removed before binding. The server removes its socket when dropped.

Sources: entry point, socket server and client, app startup.

Wire protocol and replies

  • Transport is AF_UNIX / SOCK_STREAM, not TCP, HTTP, WebSocket, JSON, or OSC.
  • Send one UTF-8 command per line, terminated by \n. Blank lines are ignored.
  • Tokens are separated by whitespace outside double quotes. Double quotes group a token and are removed. Single quotes and backslashes have no special meaning to the socket parser. There is no escaping for literal double quotes, and unmatched double quotes are not rejected.
  • Commands and option spellings are case-sensitive unless an exception is described below. There is no shell expansion of ~, $VARIABLE, wildcards, or command substitutions on the server.
  • Relative file paths are interpreted by the running app, relative to its working directory. Prefer absolute paths.
  • Success is ok\n or ok\n<payload>\n. Failure normally starts with error <message>\n. Payloads may contain multiple lines; they are unescaped human-readable text.
  • There is no response length, request ID, subscription, or explicit end-of-response marker. For a simple reliable client, send one command, half-close the write side, and read until EOF. This is what --send does.
  • A connection may carry multiple command lines. The server handles each line and writes its reply in sequence, but multiline replies are not separately framed. Do not assume one line of reply per command.
  • Requests are executed on the GUI thread. The server waits up to 30 seconds for each reply, then sends error timed out. A timeout does not cancel the queued request. Do not blindly retry a timed-out mutation.
  • Most handlers acknowledge immediately. Audio/UI synchronization and history commits occur later in the update; ok is not a general completion barrier. Export, scanning, recording, decoding, and analysis have additional asynchronous behavior described below.
  • Commands are not transactions. A failure can follow partial changes: for example, select-clips clears the previous selection before validating every ID, and importing into new can leave a new track if file reading fails.
  • Many handlers ignore extra arguments or accept permissive defaults. Use the documented syntax instead of relying on every malformed request being rejected.

CLI exit codes: 0 when the collected reply does not start with error; 1 when it does; 2 on connect/write failure. The current client ignores read/shutdown errors, so exit 0 alone is not proof of a complete response. Check the reply as well. For example, flow reports a failed render inside an ok payload.

Shell quoting and socket quoting are separate: --send automatically wraps arguments containing whitespace in double quotes. This works for --send add-device 0 "Drum Synth", but it does not escape embedded double quotes or preserve an empty shell argument as a quoted empty token. Raw socket requests can represent an empty argument as "".

Python client

This example uses only the standard library. It preserves empty arguments and rejects characters it cannot safely encode in this line protocol.

import os
import socket


def command(*args):
    runtime = os.environ.get("XDG_RUNTIME_DIR")
    path = (os.path.join(runtime, "mms.sock") if runtime is not None
            else f"/tmp/mms-{os.getuid()}.sock")
    tokens = [str(arg) for arg in args]
    if any('"' in token or '\n' in token or '\r' in token for token in tokens):
        raise ValueError("Double quotes and line breaks cannot be encoded")
    request = " ".join('"' + token + '"' for token in tokens) + "\n"
    with socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) as sock:
        sock.settimeout(35)
        sock.connect(path)
        sock.sendall(request.encode("utf-8"))
        sock.shutdown(socket.SHUT_WR)
        chunks = []
        while chunk := sock.recv(65536):
            chunks.append(chunk)
    reply = b"".join(chunks).decode("utf-8")
    if reply == "ok\n":
        return ""
    if reply.startswith("ok\n"):
        return reply[3:].removesuffix("\n")
    raise RuntimeError(reply.rstrip() or "No reply")


print(command("state"))
# track_index = int(command("add-track", "Drums"))
# device_id = int(command("add-device", track_index, "Drum Synth"))

IDs, indexes, units, and selection

Argument Meaning
<track> Zero-based track index in state, not the track's id= value. Indexes can change when tracks are removed or reordered.
<clip> Project clip ID, from clips or the reply to import-file.
<device> Device ID, from state, add-device, or add-plugin. Device commands search regular tracks, not the master track.
<plugin index> Zero-based index in the current plugins listing.
<param index> Zero-based position printed by params, not the parameter's id= value.
<take> / <marker> ID printed by takes / markers, local to that clip's data.
<beat> Floating-point musical beats, starting at zero. At 4/4, beats 0, 4, 8 are bar starts.
MIDI note start / comp range Beats in the MIDI clip's content coordinates, including any clip offset; not absolute arrangement positions.
Warp marker beat / source Content beat position / source-media time in seconds.
<x>, <y> egui logical coordinates in the app viewport, not global desktop coordinates. Screenshot pixels may differ when display scaling is not 1.

select, select-clips, select-time, and open-clip affect different selection fields. Selecting clips does not open their editor or clear a time selection. A remaining time selection takes priority for split. Inspect the UI when switching between selection-based operations; there is no dedicated clear-time-selection command.

The command tables use <required>, [optional], and a|b for choices. Do not send those brackets or separators literally.

Inspection

Command Behavior / payload
ping Returns pong.
help Returns the built-in command summary.
state Transport playing/recording/count-in state, playhead, tempo, loop range; view, detail tab/clip, selected track name and file; audio host, sample rate, load and xruns (or audio error); each track's index, ID, name, mute/solo, clip count and meter level; device IDs, kind, format, parameter count, disabled/editor/error flags; plugin count and scan flag. It does not list master-track devices.
clips Every clip: ID, track index, kind, name, arrangement start, length, content offset, and MIDI note count or media path.
notes <clip> MIDI notes: note ID, pitch, content start, length and normalized velocity. * marks selected notes. Errors for non-MIDI clips.
status Current transient UI status text, or an empty payload. Useful for export and recording feedback, but not a durable job log.

Transport

Command Behavior
play Starts playback from the current playhead if not already playing. This command calls playback with no count-in.
pause Pauses if playing, leaving the playhead at its current position.
stop If playing, pauses and seeks to the playback origin. If already paused/stopped, seeks to beat zero. It does not always mean “go to zero.”
seek <beat> Sets playhead and playback origin; clamps negative beats to zero.
tempo <bpm> Sets tempo, clamped to 20–400 BPM.
loop on|off [start end] Enables looping only when the first argument is exactly on. If both bounds parse and end > start, updates the range, clamping start to at least zero. Missing/invalid bounds leave the previous range in place; they do not produce an error.

Sources: handlers, transport.

Project files and history

Command Behavior / payload
new Replaces the document with a new project containing two empty tracks, Track 1 and Track 2. Selects the first, resets the file path/history, pauses playback and seeks to zero. It does not create a zero-track project.
open <path> Loads an .mmsp archive, including available history/plugin state; replaces the project on success, pauses and seeks to zero. Reports load errors.
save [path] Saves the project, selection, history and available plugin state. Uses the existing path when omitted; errors if there is none. Replaces the supplied extension with .mmsp unless it is already exactly mmsp. Returns the resulting path.
undo Undoes one history entry if available and prunes invalid selections. At the beginning, succeeds without changing anything.
redo Redoes one entry if available and prunes invalid selections. At the end, succeeds without changing anything.
history [entry] Without an argument: entry count, cursor, numbered labels and operation counts; > marks the cursor entry. With an argument: details of that one-based entry. history 0 is invalid.
history-jump <n> Moves to the history cursor after n entries. 0 is the empty history baseline; values beyond the last entry are clamped to the end. Rebuilds project and selection.
history-verify Replays history to the current cursor and compares project and selection. Plugin-state blobs are excluded from the project comparison. Returns replayed <n> entries from an empty document, or an error describing the mismatch. Does not edit the current project.
quit Requests app closure and allows it immediately.

The socket handlers for new, open, and quit bypass the GUI's unsaved-changes confirmation. Save first if you need the current work. File saving does not create missing parent directories. Media paths are stored as references; the save code does not bundle source audio/video files into the archive.

History commits are made by the app update, not explicitly once per socket command. Do not assume a one-to-one mapping between commands and undo entries, particularly with concurrent clients or ongoing UI interaction/recording.

Sources: document lifecycle, archive format and saving, history.

Tracks, selection, and arrangement editing

Command Behavior / payload
add-track [name] Appends and selects a track. Default name is Track <new track count>. Returns the new track index. No instrument is added automatically.
select <track> Selects a track by index. Also determines the live MIDI target when the app synchronizes MIDI routing.
select-clips [clip ...] Replaces the selected clip-ID set. With no IDs, clears that set. Validates IDs in order; an error can leave a partial selection.
open-clip <clip> Selects only that clip, selects its owning track, opens the Clip detail tab and shows the detail panel.
tool pointer|time|pen|erase|slice Selects an editing tool.
snap <label> Sets the snap grid using an exact label from the table below.
select-time <start> <end> [track ...] Stores an arrangement time selection, ordering the bounds from smaller to larger, and replaces the time-selection track set with the supplied track indexes. With no tracks the set is empty, not all tracks.
delete-time Removes clip material within the current time selection on its selected tracks, splitting boundary-crossing clips as needed. Leaves a gap; does not ripple later clips left.
duplicate-time Copies the portions of clips inside the time selection onto the same tracks, shifted by the selection's length. Does not push existing material aside. Selects the copies and advances the time selection to the following interval.
split With a time selection: splits at both selection boundaries on the time-selection tracks and selects clips inside. Otherwise splits selected clips at the playhead; if no clips are selected, uses clips crossing the playhead on the selected track.
slice <clip> <beat> Splits the specified clip at an absolute arrangement beat and selects the new right-hand clip.

delete-time, duplicate-time, and time-selection split require a stored time selection. The split/slice handlers can report error nothing to do. A successful time-range command does not necessarily imply any material was affected (for example, the track set may be empty).

Exact snap label Grid in beats
Off Disabled
1 Bar 4 (a fixed value in the current implementation)
1/2 2
1/4 1
1/8 0.5
1/16 0.25
1/32 0.125

Quote the label containing a space: target/debug/mms --send snap "1 Bar".

Sources: operations, project edits, selection and snap.

Devices and plugins

Command Behavior / payload
plugins Lists scan results: index, clap/vst3, name, vendor, instrument/effect designation and path.
rescan-plugins Requests a rescan; returns before it completes. Inspect state for the scanning flag and then obtain a fresh plugins list.
add-plugin <track> <index|name> [clap|vst3] Creates a scanned plugin on the track and selects the track. Returns the device ID. Names match exactly ignoring ASCII case, not by substring. Format filters name lookup only; an index directly selects that list entry. An unrecognized format is treated as no filter.
add-device <track> <name> Adds a built-in device with an exact, case-sensitive name from the catalog below. Returns the device ID.
remove-device <device> Removes the device and its automation lanes, then prunes selections.
editor <device> open|close Opens/closes the plugin's native editor. Only close chooses closing; missing/other values attempt to open. Opening can fail, for example if the plugin has no supported editor.
params <device> [filter] Lists parameter index, parameter ID, name, normalized value and formatted value. Optional filter is a case-insensitive substring of the parameter name. No match gives an empty payload.
set-param <device> <index> <value> Sets a normalized value, clamped to 0–1. Returns its formatted value. Does not accept Hz, milliseconds, dB, or a parameter name in place of the index.

Devices are inserted in kind order: note effects, instruments, audio effects, video effects; new devices of the same kind follow existing ones. The socket has no device-reorder or enable/disable command. Parameter writes set the stored value; existing automation can override the value used during playback.

Built-in catalog and parameter order

Each numbered parameter below is the index accepted by set-param. Ranges are physical values before normalization. Unless labeled otherwise, normalization is linear.

Device Parameters (index: name, range)
Polysynth 0: Osc Mix, 0–100%; 1: Cutoff, 20–20000 Hz (log); 2: Resonance, 0–100%; 3: Attack, 0–2000 ms (square); 4: Release, 0–4000 ms (square)
Drum Synth 0: Tune, −12–12 st; 1: Decay, 10–200%; 2: Tone, 0–100%; 3: Level, −24–6 dB
Arpeggiator 0: Rate, 1–32 (th); 1: Gate, 0–100%; 2: Octaves, 1–4
Transpose 0: Semitones, −24–24 st
EQ 0: Low, −18–18 dB; 1: Mid, −18–18 dB; 2: High, −18–18 dB; 3: Output, −24–24 dB
Compressor 0: Threshold, −60–0 dB; 1: Ratio, 1–20; 2: Attack, 0.1–100 ms (log); 3: Release, 10–1000 ms (log); 4: Makeup, 0–24 dB
Delay 0: Time, 1–2000 ms (log); 1: Feedback, 0–100%; 2: Mix, 0–100%
Reverb 0: Size, 0–100%; 1: Decay, 0.1–20 s (log); 2: Damping, 0–100%; 3: Mix, 0–100%
Transform 0: X, −100–100%; 1: Y, −100–100%; 2: Scale, 0–400%; 3: Rotation, −180–180°; 4: Opacity, 0–100%
Color 0: Brightness, −100–100%; 1: Contrast, −100–100%; 2: Saturation, 0–200%; 3: Hue, −180–180°
Blur 0: Radius, 0–100 px

For a desired physical value v in [min, max], send:

linear: (v - min) / (max - min)
square: sqrt((v - min) / (max - min))
log:    ln(v / min) / ln(max / min)

For example, a 2400 Hz Polysynth cutoff is ln(2400/20)/ln(20000/20), about 0.69306; a 5 ms attack is sqrt(5/2000) = 0.05. Use params to read current values and confirm the result. Plugin parameters come from the plugin; do not apply built-in ranges to them.

The catalog describes fields that can be created and set, not a guarantee that every field has a renderer. The current video preview reads Transform's parameters and Color's Brightness/Saturation. Color Contrast/Hue and Blur Radius are exposed as parameters but are not read by the current preview rendering code. Clip export does not render these devices either.

Drum Synth pitches

MIDI pitch Synth voice
35, 36 Kick
37–40 Snare
42, 44 Closed hat (chokes active open hats)
46 Open hat
41, 43, 45, 47, 48, 50 Tom
49, 51, 52, 53, 55, 57, 59 Cymbal
All other pitches Pitched blip

Sources: device catalog and normalization, insertion and removal, audio DSP, video preview, audio snapshot/automation.

MIDI input, recording, and takes

Command Behavior / payload
midi-inputs Lists MIDI port names, enabled/connected flags and any input error; finishes with activity count and selected target track ID (or -).
midi-input <name> on|off Enables/disables the first port whose name contains the supplied case-sensitive substring. Returns the matched full name. Only off disables; omitted/other values enable.
midi-send on <pitch> [velocity] Queues a live note-on for the selected track. Velocity is divided by 127; omitted or unparsable velocity defaults to 100. Use pitches 0–127 and velocities 1–127.
midi-send off <pitch> Queues a live note-off (zero velocity).
midi-send cc <controller> <value> Queues a MIDI control change. Use 0–127 for both values.
midi-send bend <value> Queues pitch bend. Use 0–16383; center is 8192.
record [on|off] Requests recording on/off; with no argument or any other word, toggles. Recording targets the selected track, creates/reuses a MIDI clip, and starts playback if needed. If starting playback for recording, applies the configured count-in.
takes <clip> MIDI active-note/take counts, each take's ID and pitch@start+length notes, comp ranges, and active notes.
comp <clip> <take> <start> <end> Replaces the MIDI content range with notes from an existing take, trimming notes at boundaries and updating comp segments. Uses content beats. A reversed/empty range is a no-op after validating the clip and take.

Live MIDI commands do not insert an arranged note at a specified beat. To capture their timing, enable recording; otherwise they only play live. midi-send has no channel or scheduled timestamp argument. MIDI messages sent to plugins use channel 1. These commands do not send to an external MIDI output port.

The handlers parse pitch/controller/value as unsigned 8-bit numbers and bend as an unsigned 16-bit number; they do not uniformly enforce MIDI's smaller ranges. Stay within the ranges above. A failed live-event enqueue returns error audio engine not running; that message can also result from a full event queue or unavailable sender, not just a stopped engine.

record replies before recording synchronization. Check state and status to confirm it started; without a selected track the UI status says Select a track to record into. record off finishes recording but does not itself pause playback. Pausing/stopping also finishes an active recording.

With looping and comping enabled, recording uses a MIDI clip matching the loop range and builds takes per lap; with comping disabled, recorded notes are overdubbed. Without looping, it reuses a MIDI clip containing the playhead or creates one and grows it by bars. Input quantization, when enabled with a non-Off snap grid, snaps newly recorded note starts on finishing. It does not quantize arbitrary existing MIDI clips. Recording currently captures note events, not CC/bend automation or audio input.

Sources: MIDI routing and messages, live events, recording synchronization, recorder, comping.

Browser, import, and preview

Command Behavior / payload
browse [dir] Without a directory: configured roots as dir <path>. With one: refreshes/expands it and lists directories followed by supported media files, sorted case-insensitively by name. Hidden names are omitted. Unreadable/missing directories yield an empty listing.
preview-file <path> Selects the browser path and creates a file preview. Starts preview playback only if autoplay is enabled. Does not import into the project or force the preview panel visible.
preview-stop [close] Pauses the file preview. With exactly close, also removes the preview.
import-file <track|new> <beat> <path> Imports a MIDI/audio/video file at an arrangement beat onto an existing track index or a newly appended track. Returns the clip ID. New track/clip names come from the file stem. No instrument is added and the handler does not explicitly select/open the imported clip.
set-media <clip> <path> Sets the path of an existing audio/video clip and attempts to refit its length from media duration. Returns length=<beats>. Rejects MIDI clips. It does not change the clip kind based on the replacement file.

Supported filename extensions (case-insensitive):

Kind Extensions
MIDI mid, midi
Audio wav, flac, mp3, ogg, opus, aif, aiff, m4a
Video mp4, mov, mkv, webm, avi, m4v, mpg, mpeg

MIDI import reads notes into a single MIDI clip, merges notes from file tracks/channels, and rounds clip duration up to a project bar (minimum one bar). It does not set project tempo from the MIDI file, create instruments from program changes, or import CC/bend automation. The reader rejects SMPTE time division.

Audio/video imports initially use four bars, then attempt to fit duration at the current tempo. Audio imports also queue automatic warp when the project's auto_warp setting is enabled, so their length/markers can change after import. There is currently no socket settings-set auto-warp option.

Import and set-media success is not proof that decoding succeeded: the duration-fitting helper returns without an error when metadata is unavailable. Inspect the clip/UI afterward. set-media stores the supplied path even if fitting fails.

Sources: browser, import and fitting, MIDI reader, extensions.

Audio/video timing and analysis

All commands in this table use audio/video clips, except picture and flow, which require video.

Command Behavior / payload
stretch <clip> off|repitch|beats|stretch|tonal Sets the clip's stretch mode. A non-Off mode ensures endpoint markers exist, using clip offset + length and the current tempo. Switching Off does not erase markers.
transients <clip> Requests/reads transient analysis. Returns space-separated source times in seconds, to four decimal places. May return error still analysing while decoding/analysis is pending.
beatgrid <clip> Requests/reads beat detection. Returns estimated BPM, steady flag, beat count, downbeat index and the first up to 16 source beat times in seconds. Can report still analysing or no steady tempo found.
warp-grid <clip> Uses detected beats to replace warp markers with a musical beat grid aligned to the detected downbeat. Enables Stretch if mode was Off and adjusts clip length for the mapped source duration. Returns detected BPM, not a project tempo change. May report still analysing, no steady tempo found, or still decoding.
quantize <clip> [strength] Quantizes detected audio transients to the current snap grid by replacing interior warp markers. Defaults to strength 1 if missing/unparsable; strength is clamped to 0–1 by the model. Snap Off falls back to 0.25 beats. Enables Stretch if mode was Off. Returns <n> markers (interior markers placed). Not a MIDI-note quantizer.
markers <clip> Returns mode=... picture=... warped=..., followed by marker ID, content beat and source seconds.
marker-move <clip> <marker> <beat> Moves the marker's beat, preserving its source time; clamps between neighboring markers with a 0.001-beat margin. An unknown marker ID silently does nothing.
picture <clip> hold|blend|flow Sets the video clip's picture mode.
flow <clip> Starts/polls a cached optical-flow render for the source video. Payload is ready <path>, rendering <percent>%, or failed <reason>. A failed payload still follows ok. Does not itself change picture mode.

Analysis requests can initiate background work. Poll queries again after pending results; no socket subscription or completion event is provided. Source decoding/analysis failures are not always distinguished from pending work by these handlers. Media processing relies on the application's decoder/render helpers and installed tools such as FFmpeg.

Sources: command handlers, warp model, media cache and analysis.

Export

Command Behavior / payload
export-clip <clip> <dir> Queues one clip for export and immediately returns queued. Clip existence and destination checks happen later. The destination must already be a directory.
exports Returns <n> running, the count of asynchronous export jobs. It is not a count of queued requests or a success/failure summary.

Inspect status for Exporting ..., Exported <path>, or Export failed: ..., and check the output file. exports returning zero does not prove a queued export succeeded; MIDI exports complete synchronously when the queued request is processed, and failures also leave no running job.

Clip kind Output and actual scope
MIDI .mid containing active notes whose starts fall inside the visible content window, shifted to zero and trimmed at the window end; project tempo/time signature are written. Notes starting before the window are omitted, even if sustained into it. No instrument audio, effects, separate takes, or CC automation is rendered.
Audio FFmpeg source trim using clip offset/length converted to seconds at project tempo. WAV (16-bit PCM) or FLAC, selected by audio-export.
Video FFmpeg source trim to MP4, H.264 (libx264, veryfast, configured CRF, yuv420p) and AAC at 192 kb/s.

Audio/video export is a trim/transcode of source media. It does not render track/master devices, volume/pan automation, clip gain, warp markers/stretch processing, video effects, or the full arrangement. There is no full-song mixdown command.

Output names use a sanitized clip name and add 2, 3, etc. if the candidate path already exists. This is not an atomic reservation across simultaneous exports.

Source: export implementation, export scheduling/status.

Settings

Command Behavior
settings Prints autoplay, preview volume, export format, video quality, metronome, comping, count-in, input quantize and browser roots. It does not print every field in the settings model.
show-settings [off] Opens the Settings UI; only off closes it.
settings-root add|remove <path> Adds a root if that exact path is not already present, or removes exact matches. Does not canonicalize paths or validate directory existence.
settings-set <key> <value> Changes one supported setting below.
Key Values and implementation behavior
autoplay File-preview autoplay. Only true or on enables; any other value disables.
volume File-preview volume in dB, parsed as a float. Not track/master volume. No clamp in this handler.
audio-export Exactly wav or flac.
video-quality Unsigned integer passed as FFmpeg CRF on video export. No range clamp in this handler.
metronome true/on enables; anything else disables.
comping true/on enables loop-take comping; anything else disables.
count-in Unsigned bar count, clamped to at most 4. Used when recording starts playback.
input-quantize true/on enables recording note-start quantization; anything else disables.

These settings belong to the project and are saved with it. Audio device/host configuration, sample rate, and auto_warp are not exposed by this command.

Sources: settings handlers, settings model/defaults, preview audio.

UI controls and screenshots

Command Behavior / payload
view arrange|mix Switches the main view.
panel inspector|detail|preview on|off Shows/hides that panel. Only off hides; omitted/other values show.
tab clip|devices|automation|history Selects the detail tab and shows the detail panel.
screenshot <path.png> Requests a viewport screenshot, writes an RGBA PNG and replies with the path once written. Parent directory must exist; an existing file is overwritten. The encoder writes PNG regardless of extension.
move <x> <y> Injects a pointer-move event. Does not move a clip or the OS cursor.
click <x> <y> [right] [double] [shift|ctrl|alt ...] Injects pointer movement followed by button press/release. Defaults to left button; right chooses secondary; double emits two press/release sequences. Flags may be combined.
drag <x1> <y1> <x2> <y2> [steps] [shift|ctrl|alt ...] Injects a left-button drag with interpolated pointer movement. Defaults to 12 steps when missing/unparsable; minimum 1.
key <name> [shift|ctrl|alt ...] Injects key-down and key-up events with repeat=false. Names are parsed by egui's Key::from_name.

Input batches are fed into the app's raw input, one batch per GUI update. The reply is deferred until the input queue has drained; it reports event injection, not that a specific widget action succeeded. Coordinates, focus, scroll position, zoom and current tool determine the result. These are app-internal egui events, not general desktop automation or guaranteed input to native plugin windows.

ctrl sets both egui's ctrl and command modifiers. shift and alt set their respective flags. There is no separate super, meta, or cmd flag; unknown modifier words are ignored. key does not inject text, clipboard contents, scrolling, or arbitrary Unicode text events.

The locked egui 0.33.3 dependency accepts these key names (plus aliases listed afterward):

  • Navigation/control: ArrowDown, ArrowLeft, ArrowRight, ArrowUp, Escape, Tab, Backspace, Enter, Insert, Delete, Home, End, PageUp, PageDown, Copy, Cut, Paste, Space, BrowserBack.
  • Letters: A–Z (lowercase also accepted).
  • Digits: 0–9, also Digit0–Digit9 and Numpad0–Numpad9 (not Num0).
  • Function keys: F1–F35.
  • Punctuation: Colon, Comma, Minus, Period, Plus, Equals, Semicolon, Backslash, Slash, Pipe, Questionmark, Exclamationmark, OpenBracket, CloseBracket, OpenCurlyBracket, CloseCurlyBracket, Backtick, Quote; corresponding single-character symbols are accepted by egui, subject to the socket quoting limitations.
  • Other aliases: Down/Left/Right/Up and ⏷/⏴/⏵/⏶; Esc; Return; Help for Insert; Equal/NumpadEqual; Backquote/Grave; Unicode − for Minus; a literal space for Space.

For example, key Space invokes the app's play/pause shortcut when focus allows it; key Z ctrl invokes undo under the same condition. The Copy, Cut, and Paste key names produce key events, not clipboard payload events.

Sources: input construction, event delivery and screenshot handling, PNG writer, egui 0.33.3 src/data/key.rs in the dependency pinned by Cargo.lock.

Example: build an editable MIDI arrangement

Given a MIDI file you have already created, the Python command helper above can import it and attach an instrument:

# These commands modify the current project; use a fresh project if desired.
track = int(command("add-track", "Drums"))
device = int(command("add-device", track, "Drum Synth"))
clip = int(command("import-file", track, 0, "/absolute/path/drums.mid"))
print(command("notes", clip))
print(command("params", device))
command("tempo", 132)
command("loop", "on", 0, 16)
command("select", track)
command("open-clip", clip)
command("save", "/existing/directory/My Beat.mmsp")
command("seek", 0)
command("play")

Always use returned indexes/IDs. In particular, after new, the first add-track returns index 2, because two tracks already exist. A MIDI file supplies note positions, durations and velocities precisely; midi-send supplies live events with real-time timing instead.

Commands that do not exist

The current dispatcher has no direct command for:

  • Adding, deleting or editing individual arranged MIDI notes; creating an empty clip; setting clip start/length/offset/name/color.
  • Renaming, removing or reordering tracks; setting track/master volume, pan, mute, solo or arm.
  • Creating or editing automation lanes/points, enabling/disabling/reordering devices, or addressing master-track devices.
  • Changing time signature, audio host/device/sample rate, or auto-warp settings.
  • Adding/deleting individual warp markers, clearing only the time selection, or querying all UI geometry/selection fields.
  • Text input, clipboard payloads, mouse-wheel scrolling, or operating-system mouse/keyboard events.
  • Full-arrangement audio mixdown, rendering a MIDI instrument to audio, or exporting a processed effect chain.
  • Scheduling commands at musical timestamps, transactions, structured JSON replies, or push notifications.

Some edits can be performed indirectly through the existing GUI using the input commands, and MIDI notes can be brought in through MIDI files or recording. That does not make names such as add-note, rename, set-volume, or export-song valid socket commands. Unknown commands return error unknown command <name> (try help).