ampOSC
AppleScript
ampOSC carries a full AppleScript dictionary, so anything the OSC API does can be done from
a script, a Keyboard Maestro macro, or one line of osascript in a shell. It is
the same pipeline either way — AppleScript builds an OSC message and posts it through the
bridge exactly as a UDP client would.
Quick start
tell application "ampOSC"
connect "192.168.1.50" family "SQ"
send osc "/Input/1/Mute" value "true"
send osc "/Input/1/Level" value "-5.0"
get connection status -- "connected"
end tell connect returns immediately and the console answers in its own time, so a
script that does something straight afterwards should poll
connection status rather than assume.
Properties
All five sit on the application object.
| Property | Type | Access | Meaning |
|---|---|---|---|
connection status | text | read | disconnected, connecting, connected or error |
console name | text | read | Name of the connected console. Empty when not connected |
console host | text | read | IP address of the configured console |
osc port | integer | read | The UDP port the OSC server listens on — 8765 |
log open | boolean | read / write | Whether the floating log window is showing |
tell application "ampOSC"
get console name -- "My dLive"
get osc port -- 8765
set log open to false
end tell Connecting
connect <ip> [port <integer>] [family <text>] | Parameter | Type | Default | Notes |
|---|---|---|---|
| direct | text | required | IP address of the console |
port | integer | 51325 | TCP port override. The default suits every family |
family | text | the saved family | dLive, Avantis, SQ, SQ+,
Qu or CQ, case-insensitive
|
connect "192.168.1.50" -- saved family, default port
connect "192.168.1.50" family "SQ"
connect "10.0.0.1" port 51325 family "dLive" disconnect takes no parameters and closes the console connection. It does not
stop the OSC server, so UDP clients stay connected to ampOSC.
Sending OSC
send osc <path> [value <text>]
The path is the same address a UDP client would use, and everything the
OSC reference describes works here unchanged — the four
intents, index ranges, wildcards, and the explicit /Set/ and
/Get/ prefixes. A path with a value is a SET; a path without one is a GET,
and asking also subscribes you.
send osc "/Input/1/Level" value "-5.0" set input 1 to -6 dB
send osc "/Input/1/Name" value "Kick" set the name
send osc "/Input/1/Level" ask, and subscribe from now on
send osc "/Input/1-32/Level" a range
send osc "/Input/*/Mute" value "false" a wildcard
send osc "/Subscribe/Input/1-8/Mute" subscribe without asking first
send osc "/Unsubscribe/Input/1/Mute" stop
The command returns "ok" once the message has been posted to the bridge.
That is not confirmation the console did anything — replies arrive on the OSC server, and
a script that needs to read a value should subscribe and listen there.
Writing a value
AppleScript hands ampOSC a string, and ampOSC decides what OSC type to send. It reads the string in this order:
| Written as | Sent as | Used for |
|---|---|---|
true t yes onfalse f no off | ,T / ,F | Every switch — Mute, MainAssign, Phantom, Pad, and the Enable paths |
Anything numeric — -5.0, 1, 0 | ,f | Levels, frequencies, gain, pan |
| Anything else | ,s | Names, EQ shape |
A switch takes a word, never 1 or 0. OSC has
real boolean types and ampOSC parses Mute and its relatives as those, with no numeric
coercion behind them. 1 is a perfectly good float, so
value "1" on a Mute sends ,f 1.0, the adaptor reads
nothing, and the command still returns "ok". Write
value "true".
Values are always engineering units — the number an engineer would read off the desk, never a normalised 0-to-1 float. ampOSC converts and clamps at the wire, so the same script works on every family.
Reading the inventory
get inventory <type>
Returns one line per channel, tab separated:
shortName · name · #RRGGBB, with
none where a channel has no colour. Type names are case-insensitive.
InputGroupAuxMatrixFxReturnFxSendDCAMuteGroupMainOutput
Those ten are the whole list, and the app shows more than ten types.
There is no name for the stereo variants — Grp St, Aux St,
Mtx St, FxRtn St — or for the UFX sends and returns, so
get inventory cannot reach them. On a dLive configured with 12 stereo
groups, 3 stereo auxes, 16 stereo FX returns, 4 stereo matrices and 8 UFX each way,
that is 51 of its 227 channels. Use a UDP client, or read them from the app's
Inventory window.
set inv to get inventory "Input"
-- Ip1 Kick #FF0000
-- Ip2 Snare #00FF00
-- Ip3 Hat none Splitting it up:
set inv to get inventory "Input"
set oldDelims to AppleScript's text item delimiters
set AppleScript's text item delimiters to linefeed
repeat with aLine in text items of inv
set AppleScript's text item delimiters to tab
set cols to text items of aLine
set shortName to item 1 of cols -- "Ip1"
set chName to item 2 of cols -- "Kick"
set hexColor to item 3 of cols -- "#FF0000" or "none"
set AppleScript's text item delimiters to linefeed
end repeat
set AppleScript's text item delimiters to oldDelims
This one blocks, for up to five seconds, while the state reads come back
from the console. It returns an empty string if no topology has loaded — which is what you
get if you call it immediately after connect.
The log window
open log and close log take no parameters, and
log open is a readable and writable property, so it can be toggled.
tell application "ampOSC" to set log open to (not log open) From the shell
Every command works through osascript.
osascript -e 'tell application "ampOSC" to connect "192.168.1.50" family "SQ"'
STATUS=$(osascript -e 'tell application "ampOSC" to get connection status')
echo "Connection: $STATUS"
osascript -e 'tell application "ampOSC" to send osc "/Input/1/Mute" value "true"'
osascript -e 'tell application "ampOSC" to send osc "/Input/1-8/Mute" value "false"'
osascript -e 'tell application "ampOSC" to get inventory "Input"' > inputs.tsv Limits
- Everything is asynchronous except
get inventory.connectandsend oscreturn as soon as the message is away. Pollconnection statusrather than assuming. - There is no way to send an int32. Any integer is claimed as a float
first, so the int-typed paths —
/Scene/Recalland the UFX key and scale — cannot be set from AppleScript today. Use a UDP client for those. - Replies do not come back through AppleScript.
send oscanswers"ok", not a value. Subscribe and read the OSC server for values. - ampOSC has to be running.
tell application "ampOSC"will launch it, but it is a menu bar app and a script that launches it should give the console connection time to come up before sending anything.