Rivendell Macro LangaugeOverview
Rivendell Macro Language (or RML for short) is a set of commands
implemented within Rivendell that can be used to program the system
to take various actions. A wide variety of commands exist, ranging
from control of outboard gear (such as switchers and GPIO devices)
to control of various aspects of log playout in RDAirPlay, to
Rivendell user management.
Protocol
The Normal form of a command takes the following syntax:
cmd [arg] [...]!
cmd
A command mneumonic consisting of two alpha-numeric characters
indicating the action to be performed.
arg
Zero or more arguments, delimited by spaces or, if the last
argument, by ! (see below)
!
The ASCII character 33, indicating the end of the command sequence.
Command Delivery
To be executed by a Rivendell system, an appropriate command should be
delivered to UDP ports 5858 or 5859 on said system, using the SOCK_DGRAM
connectionless protocol. Commands delivered to port 5858 may receive a
reply back to the originating IP address at UDP socket 5860 to indicated
command success/failure, while commands delivered to 5859 will be
processed, but no reply made.
Command Reply
If delivered to UDP port 5858, each command may receive a reply,
formulated as follows:
rpy+|-rpy
The full command string (including arguments) originally received
+
ACK response, indicates success of the command.
-
NAK response, indicates failure of the command.
Specifying Color
In places where a color can be specified as a macro argument, the
following predefined values are valid:
whiteredgreenbluecyanmagentayellowgraylightGrayblackdarkReddarkGreendarkBluedarkCyandarkMagentadarkYellowdarkGrayBinary Data
Certain commands (e.g. SO and UO)
have the ability to transmit arbitrary binary data in addition to textual
characters. Such arbitrary binary data can be specified by means of
escape codes as follows:
%hexcodehexcode
Two digit numeric value of the byte to send in hexidecimal.
For example, the sequence 'TEST' followed by a carriage return/newline
could be specified as:
TEST%0D%0AJACK Port Names
Some commands (e.g. the Connect Jack Ports [JC] RML) require JACK port
name arguments. Such port names have the following form:
jack-client-name:jack-endpoint-name
For example, to connect the first Rivendell audio output to the first
available system playback ports, the following RML could be used:
JC system:playback_1 rivendell_0:playout_0L!JC system:playback_2 rivendell_0:playout_0R!
In this example, system and
rivendell_0 are
jack-client-names, while
playback_1, playback_2,
playout_0L and playout_0R
are jack-endpoint-names.
Note that two RML commands are required
for this specific example. This is because JACK has no notion of
stereo pairs, hence the "left" and "right" Rivendell
playout ports have to be independently connected to the specific system
playback ports.
Log Machines
Some commands (e.g., MD, PL,
and PS) require a log
machine argument. See
Log Machines in
RDAirPlay for a detailed
description of Log Machines.
The log machine argument in the context
of Rivendell macros must be an integer falling within one of the
following values:
0All non-virtual log machines --i.e. the
Main Log,
Aux 1 Log and
Aux 2 Log log machines.
1Main Log2Aux 1 Log3Aux 2 Log101 through 120Virtual Log 101 through
Virtual Log 120
For example, the macro PL 1 0! starts
playing at the first line (0) of the
Main Log (log machine
1).
CommandsAir Gate [AG]Moduleripcd8MnemonicAG
Process an RML only if the On-Air flag is ON.
AGrml!
Execute RML rml only if the On-Air flag on
the local machine is ON.
Append Log [AL]Modulerdairplay1,
rdairplayd8MnemonicAL
Append a log to a cuurently loaded log.
AL
machlogname!
Append the log named logname to the log
currently loaded in log machine mach.
Binary Serial Out [BO]Moduleripcd8MnemonicBO
Output a string of binary codes.
BO
portnumhexcode..!
Output a string of binary codes represented by
hexcode.. on
serial port portnum.
Clear Serial Trap [SC]Moduleripcd8MnemonicSC
Clear a serial trap.
SC
portnumcartstring!SC
portnumcart!SC
portnum!
Clear a serial trap. The three argument form will clear all traps on
port that reference
cart and string.
The two argument form will clear all traps on
port that reference
cart, while the one argument form will
clear all traps on port.
Command Send [CC]Moduleripcd8MnemonicCC
Send RML to a remote host.
CC
dest[:udpport]
rml!
Execute the RML command rml on host
dest, where dest
may be either a Rivendell host name or an IP address. A UDP port value
may be optionally specified as udpport
(default value 5859).
Connect Jack Ports [JC]Moduleripcd8MnemonicJC
Connect a JACK input port to an output port.
JC
outputinput!
Attempt to connect JACK input port input
to output. See
for an example.
Console Label [CL]Moduleripcd8MnemonicCL
Set the label on a control surface.
CL
matrixsurfacechanlabel!
On matrix matrix, set the input
chan module label of control surface
surface to label.
Copy Cut [CP]Modulerdcatchd8MnemonicCP
Copy cut audio and metadata.
CP
srccartsrccutdstcartdstcut!
Copy the audio and metadata from cut number
srccut in cart
srccart to cut number
dstcut in cart
dstcart. The destination cart/cut must
already exist.
Cut Event [CE]Modulerdcatchd8MnemonicCE
Place a cut event at the current location of an active RDCatch recording.
CE
decknumeventnum!
Place a cut event with event number
eventnum at the current position of the
active recording in RDCatch Deck
decknum.
Disconnect Jack Ports [JD]Moduleripcd8MnemonicJD
Disconnect a JACK input port from an output port.
JD
outputinput!
Attempt to disconnect JACK input port input
from output.
Disconnect All Jack Ports [JZ]Moduleripcd8MnemonicJZ
Disconnect all JACK audio port connections.
JZ!
Attempt to disconnect all JACK port connections.
Duck Panel Button [PD]Modulerdairplay1MnemonicPD
Set the duck level of a SoundPanel button in RDAirPlay.
PD
panelcolrowlevelfade
[mport]!
Set the duck level of button at column,
row of panel
panel.
Panel: S1...S50 or
U1...U50;
C for panel means
currently selected panel.
If col and/or row
is 0: duck all buttons in
col or row.
If playing, the audio fades to level
(in db) in fade msecs.
If specified, only stop carts playing on panel port
mport. The duck level will be set to 0 after
the playback is finished, or the button is stopped or reset.
Execute Breakaway [DX]Modulerdcartslots1MnemonicDX
Execute a breakaway.
DX
slotlen!
Execute a breakaway of length len (in mS)
using the autofill carts configured for the service currently loaded
in the slot slot. The slot must be in
Breakaway mode. If a breakaway is currently executing, it will
immediately be aborted and a new one started. Passing a '0' for
len will cause any currently executing
breakaway to be aborted immediately and input audio restored.
Execute Cart [EX]Modulerdcatchd8MnemonicEX
Execute a macro cart.
EX
cartnum!
Execute macro cart cartnum on the local host.
Fire Salvo [FS]Moduleripcd8MnemonicFS
Execute a switcher salvo.
FS
matrixsalvo!
Fire salvo number salvo on matrix
matrix.
GPI Enable [GE]Moduleripcd8MnemonicGE
Enable/disable a GPI line.
GE
matrixtypegpinum-specstate!
Enable or disable the GPI line(s) of type type
indicated by gpinum on matrix
matrix. Possible types are:
IInputOOutput
The gpinum-spec can be an integer value
to indicate a single GPI line or a range specification to indicate
multiple lines. A range specification has the following format:
[first-value]:[last-value]
All values in a range specification are inclusive. Some examples:
Range Specification Examples
1:10
Lines 1 through 10, inclusive
5:10
Lines 5 through 10, inclusive
7:7
Line 7
:10
Lines 1 through 10, inclusive
1:
Lines 1 onward, inclusive
:
All lines in the specified matrix
Note for Python programmers
Python programmers in the audience may be noticing similarities between
range specifications and
Python slices.
The concepts are similar, but there are differences! Specifically:
All values in range specifications are inclusive,
whereas the stop parameter in a slice is
last_value+1.
There is no step parameter.
All parameter values must be positive integers --i.e. zero- and
negative-valued parameters are not supported.
GPI Enable [GE] (old format, deprecated)Moduleripcd8MnemonicGE
Enable/disable a GPI line.
GE
matrixgpinum-specstate!
Enable or disable the GPI line(s) indicated by
gpinum-spec on matrix
matrix.
The gpinum-spec can be an integer value
to indicate a single GPI line or a range specification to indicate
multiple lines. See
above
for examples of range specifications.
GPI Set [GI]Moduleripcd8MnemonicGI
Set action in response to a GPIO event.
GI
matrixtypegpinumstatecart!
Execute the macro cart cart upon transition
of the GPIO of type type and line
gpinum on matrix
matrix to state.
Possible types are:
IInputOOutputGPI Set [GI] (old format, deprecated)Moduleripcd8MnemonicGI
Set action in response to a GPIO event.
GI
matrixgpinumstatecart!
Execute the macro cart cart upon transition
of the GPIO of line gpinum on matrix
matrix to state.
GPO Set [GO]Moduleripcd8MnemonicGO
Set the state of a GPIO line.
GO
matrixtypegponumstatelength!
Command GPIO line gponum of type
type on matrix
matrix> to state
for length> mS. A length of
0 indicates to hold the state indefinitely.
Possible types are:
IInputOOutput
Possible states are:
0OFF1ON-1Passthrough hardware input (valid only for Input type)GPO Set [GO] (old format, deprecated)Moduleripcd8MnemonicGO
Set the state of a GPIO line.
GO
matrixgponumstatelength!
Command GPIO line gponum on matrix
matrix> to state
for length> mS. A length of
0 indicates to hold the state indefinitely.
Insert Cart [PX]Modulerdairplay1MnemonicPX
Insert a cart in a log.
PX
machcart
[offset
[PLAY|SEGUE|STOP]]!
Insert cart cart after the currently playing
or next event plus offset (default '0')
lines on log machine mach. The
transition may also be optionally specified.
Insert Serial Trap [SI]Moduleripcd8MnemonicSI
Insert a serial trap to detect a character sequence.
SI
portnumcartstring!
Insert a serial trap to execute the macro cart
cart upon receipt of
string on serial port
port.
Label Panel [PC]Modulerdairplay1MnemonicPC
Set the label of a SoundPanel button in RDAirPlay.
PC
panelcolrowlabelcolor!
Set the button at col,
row of panel panel
to have a text label of label and a
background color of color.
Panel: S1...S50 or
U1...U50;
C for panel means
currently selected panel.
Load Log [LL]Modulerdairplay1MnemonicLL
Load a log into RDAirPlay.
LL
mach
[logname]
[startline]!
Load the log logname in log machine
mach. After loading, start the log at line
startline if it is >=0. If
startline is -2, the log will be started at
the first event if that event does not have a 'stop' transition.
Default startline=-1. If no
log is specified, the machine's current log
is unloaded.
Load Message [LM]Modulerdairplay1MnemonicLM
Load a webpage into RDAirPlay's Message Area.
LM
url!
Display the web page specified by url in the
message widget.
Load Panel [PE]Modulerdairplay1MnemonicPE
Load a cart into a SoundPanel button in RDAirPlay.
PE
panelcolrowcart!
Load cart cart into the button at
col,row of panel
panel.
Panel: S1...S50 or
U1...U50;
C for panel means
currently selected panel.
Load Slot [DL]Modulerdcartslots1MnemonicDL
Load an RDCartSlots slot.
This command has two syntaxes, depending upon the mode of the slot.
Cart Deck Mode syntax:
DL
slotcart!
Load the cart cart into the
slot slot. Passing a '0' for
cart will cause the slot to be unloaded.
This command will be ignored if the slot is currently playing.
Breakaway Mode syntax:
DL
slotsvcname!
Set the slot slot to use service
svcname. Omitting the
svcname argument will cause the slot to be
unloaded. This command will be ignored if the slot is currently
executing a breakaway.
Login [LO]Moduleripcd8MnemonicLO
Change the active Rivendell user context.
LO
userpassword!
Set the current Rivendell user to user.
If no arguments are supplied, log out the station --i.e. revert to the
default user.
Macro Timer [MT]Moduleripcd8MnemonicMT
Timer for running macro carts.
MT
timernumtimeoutcart!
Set the macro timer timernum to execute macro
cart cart in
timeout milliseconds. Setting
timeout to 0 disables
the timer. Sixteen macro timers (numbered 1-16) are available on each
Rivendell host.
Make Next [MN]Modulerdairplay1MnemonicMN
Load changes to a currently loaded log in RDAirPlay.
RL
machline!
Set the next event for log machine mach to
line line.
Message Box [MB]Moduleripcd8MnemonicMB
Display a popup message box on a host display.
MB
displayseveritymsg!
Display the text msg in a popup window on X
display display, with an icon to indicate
severity. Valid values of
severity are:
1Information2Warning3Critical
When using the 'Message Box' ['MB'] RML,
it may be necessary to configure the X server to allow local
connections from other processes. One way to
do this is to execute the following command as the local Rivendell user:
xhost +local:
For more information, see the
xhost1 man page.
No Operation [NN]ModulenoneMnemonicNN
Do nothing.
NN!
This RML does precisely nothing.
Pause Panel [PU]Modulerdairplay1MnemonicPU
Pause a SoundPanel button in RDAirPlay.
PU
panelcolrow
[mport]!
Pause the button at col,
row of panel panel.
Panel: S1...S50 or
U1...U50;
C for panel means
currently selected panel.
If col and/or row
is 0: pause all playing buttons in
col or row.
If specified, start the playout on panel port
mport.
In order for paused buttons to work, the
Enable Button Pausing checkbox must be
ticked on the
Configure RDAirPlay dialog
in rdadmin1.
Play Panel [PP]Modulerdairplay1MnemonicPP
Load a cart into a SoundPanel button in RDAirPlay.
PP
panelcolrow
[mport]
[0|1]!
Play the button at col,
row of panel panel.
Panel: S1...S50 or
U1...U50;
C for panel means
currently selected panel.
If col and/or row
is 0: Start the first loaded button that is not
active. If specified, start the playout on panel port
mport. The started panel will stay active when
finished, if the 5th argument is 1.
Play Slot [DP]Modulerdcartslots1MnemonicDP
Play an RDCartSlots slot.
DP
slot!
Play the cart currently loaded in the slot
slot. The slot must be in Cart Deck mode. This command will be
ignored if the slot is unloaded or already playing.
Refresh Log [RL]Modulerdairplay1MnemonicRL
Load changes to a currently loaded log in RDAirPlay.
RL
mach!
Refresh the log currently loaded in log machine
mach.
Run Shell Command [RN]Moduleripcd8MnemonicRN
Run a shell command.
RN
cmd!
Run the shell command cmd.
The command is actually executed as:
/bin/sh -c cmd
using the user and group specified by the
"RnRmlOwner=" and "RnRmlGroup=" directives in
the "[Identity]" section of
rd.conf5.
Select Widget [PW]Modulerdairplay1MnemonicPW
Select right-hand widget in RDAirPlay.
PW
mach!
Select right-hand widget to log-machine mach
or 0 for sound panel or
4 for voice tracker.
Serial Out [SO]Moduleripcd8MnemonicSO
Output a string on a serial port.
SO
portnumdata!
Output data on serial port
portnum. data can
consist of arbitrary binary data as well as textual characters (see
above).
Serial Reload [SY]Moduleripcd8MnemonicSY
Reload the configuration for a serial port.
SY
portnum!
Reload the configuration for serial port
portnum. Normally, this should only be
issued by RDAdmin following a configuration change.
Set Color Label [LC]Modulerdairplay1MnemonicLC
Display a color message in the label widget on RDAirPlay.
LC
colorstring!
Display string in color
color in the message widget. For the list
of available colors, see .
Set Default Now & Next Cart [SN]Modulerdairplay1MnemonicSN
Set the default Now & Next cart.
SN
now|next
machcart!
Set the default Now & Next cart for log
mach to cart.
Set Display [SD]Moduleripcd8MnemonicSD
Set a console display.
SD
matrixdisplaylinecolattrlabel!
On matrix matrix, set the console display
display to label,
starting at position line,
col and using message attributes
attr.
The message attributes value is constructed as follows:
Bit 7Display modeBits 6,5Video attributeBit 2,1,0Message Text Color
Display Mode:
0Overwrite text1Insert text
Video Attribute:
00Normal01Flash02Reverse
Text Color:
000White001Red010Yellow011Green100Cyan101MagentaSet Duck Level [MD]Modulerdairplay1MnemonicMD
Set duck level for an RDAirPlay log machine.
MD
machlevelfade
[mport]!
Set the duck level of mach, or
0 for all log machines. If playing, the audio
fades to level (in db) in
fade msecs. If specified, only affect carts
playing on machine port mport.
Loading or clearing a log will set the duck level back to 0.
Set Label [LB]Modulerdairplay1MnemonicLB
Display a message in the label widget on RDAirPlay.
LB
string!
Display string in the message widget.
Set Mode [PM]Modulerdairplay1MnemonicPM
Set the mode of an RDAirPlay log machine.
PM
mode
[mach]!
Set log machine mach to mode
mode. If mode is not given or the Mode
Control Style is set to 'Unified', then all log machines are set to
mode. Valid values for
mode are:
1LiveAssist2Auto3Manual
See for the possible values
of mach.
Sleep [SP]Moduleripcd8MnemonicSP
Pause for specified time.
SP
msecs!
Wait for msecs milliseconds.
Start [PL]Modulerdairplay1MnemonicPL
Start a log at a specified line.
PL
machline!
Start log machine mach at line
line if stopped, otherwise do nothing.
Start Button [PB]Modulerdairplay1MnemonicPB
Push an RDAirPlay Start button (numbered starting from 1 at the top
and counting downwards).
PB
button!
Push button button.
Start Next [PN]Modulerdairplay1MnemonicPN
Start the next event in a log.
PN
mach
[mport]
[skip]!
Start log machine mach if stopped, or start
next event if already running. If specified, start the playout on
machine port mport. If
skip is supplied, equal to '1' and the log
machine is in Manual or Live Assist mode, then any intervening
meta-events in log between the current 'next' event and the next cart
will be skipped over.
Start Record Deck [RS]Modulerdcatchd8MnemonicRS
Start an RDCatch Recording
RS
decknumcartnumcutnummaxlen!
Start recording to cut cutnum of cart
cartnum, using RDCatch record deck
decknum for a maximum time of
maxlen mS. The record parameters used
(format, sample rate, channels, etc) will be those configured for the
selected deck in RDAdmin->ManageHosts->RDCatch. The selected cart and
cut must already exist. Any audio previously residing in the selected
cart and cut will be overwritten.
Stop [PS]Modulerdairplay1MnemonicPS
Stop a log in RDAirPlay.
PS
mach|0
[fade]
[mport]!
Stop log machine mach, or
0 for all log machines. If specified, only stop
carts playing on machine port mport. If
specified, fade out fade msecs.
Stop Panel [PT]Modulerdairplay1MnemonicPT
Stop a SoundPanel button in RDAirPlay.
PT
panelcolrow
[mport]
[0|1]
fade!
Stop the button at col,
row of panel panel.
Panel: S1...S50 or
U1...U50;
C for panel means
currently selected panel.
If col and/or row
is 0: stop all playing buttons in
col or row.
If specified, stop the playout on panel port
mport, applying a fade of duration
fade milliseconds. If the 5th argument is
1, the button will enter the paused state after
the fade completes.
In order for paused buttons to work, the
Enable Button Pausing checkbox must be
ticked on the
Configure RDAirPlay dialog
in rdadmin1.
Stop Record Deck [RR]Modulerdcatchd8MnemonicRR
Stop an RDCatch Recording
RR
decknum!
Stop any active recording on RDCatch deck decknum.
Stop Slot [DS]Modulerdcartslots1MnemonicDS
Stop an RDCartSlots slot.
DS
slot!
Stop the cart currently loaded in the slot
slot. The slot must be in Cart Deck mode. This command will be
ignored if the slot is unloaded or already playing.
Switch Add [SA]Moduleripcd8MnemonicSA
Add an input to an output.
SA
matrixinputoutput!
Command switch matrix number matrix to add
input number input to output number
output. Unlike SWITCH TAKE,
this command leaves any other previously assigned inputs unchanged.
Switch Add With Gain [SG]Moduleripcd8MnemonicSG
Add an input to an output while specifyng the crosspoint gain.
SG
matrixinputoutputgain!
Command switch matrix number matrix to add
input number input to output number
output at gain gain.
The gain is specified in 1/10 of a dB, with 0 = unity gain.
Unlike SWITCH TAKE, this command leaves any other
previously assigned inputs unchanged.
Switch Crosspoint Gain [SX]Moduleripcd8MnemonicSX
Set crosspoint gain.
SX
matrixinputoutputlevel!
Command switch matrix number matrix to adjust
the gain of the crosspoint connecting input
input to output
output to level dB.
Switch Level [SL]Moduleripcd8MnemonicSL
Set input gain.
SL
matrixinputlevel!
Command switch matrix number matrix to adjust
the gain of input number input to
level dB.
Switch Reload [SZ]Moduleripcd8MnemonicSZ
Reload the configuration for a switch matrix.
SZ
matrix!
Reload the configuration for switch matrix
matrix. Normally, this should only be
issued by RDAdmin following a configuration change.
Switch Remove [SR]Moduleripcd8MnemonicSR
Remove an input from an output.
SR
matrixinputoutput!
Command switch matrix number matrix to remove
input number input from output number
output. Unlike SWITCH TAKE,
this command leaves any other previously assigned inputs unchanged.
Switch Take [ST]Moduleripcd8MnemonicST
Exclusively route an input to an output.
ST
matrixinputoutput!
Command switch matrix number matrix to take
input number input to output number
output. "Take" in this context implies
removing any previously assigned inputs from the referenced output.
Toggle On Air Flag [TA]Moduleripcd8MnemonicTA
Set the state of the On Air flag.
TA 0|1!
Set the On-Air flag to ON [1] or OFF
[0].
UDP Out [UO]Moduleripcd8MnemonicUO
Send data to a UDP port.
UO
ipaddrudpportdata!
Send data in a UDP packet to port
udpport at ipaddr.
data can consist of arbitrary binary data as
well as textual characters (see
for details).