Advanced scripting - Event reference variables
Event reference variables can be used in actions to reference event values more flexibly than the #value# reference. Event reference variables are prefixed with "@event_" or "@e_" and are set automatically when the events in the command are evaluated.
- The event reference variables are set according to the first event for each event type.
- You can only use event reference variables in actions; you cannot set or reference them in events.
- You can only use event reference variables in commands where the referenced event is present.
The following command will display the received controller while the button is in the off state and the received controller value while the button is in the on state:
[
(state:0)(cc:1,1,0-127)
{text:#@e_cc#}
]
[
(state:1)(cc:1,1,0-127)
{text:#@e_ccvalue#}
]
[
(state:1)(press)(cc:1,1,0-127)
{text:#@e_cc#}
]
[
(state:0)(press)(cc:1,1,0-127)
{text:#@e_ccvalue#}
]
Event reference variables
Event variable names are not case-sensitive.
Variable | Description |
---|---|
@e_cc | These variables reference the controller, controller value, and channel for the command's first occurrence of a Control Change event. |
@e_nrpn | These variables reference the controller, controller value, and channel for the command's first occurrence of an NRPN event. |
@e_pc | These variables reference the program and channel for the command's first occurrence of a Program Change event. |
@e_note | These variables reference the key, velocity, and channel for the command's first occurrence of a Note On or Note Off event. |
@e_pbvalue | These variables reference the program and channel for the command's first occurrence of a PitchBend event. |
@e_cpvalue | These variables reference the program and channel for the command's first occurrence of a Channel Pressure event. |
@e_fadervalue | This variable references the fader level for the command's first occurrence of a Fader event. (Generic Midi button only) |
@e_vpotvalue | This variable references the vpot position for the command's first occurrence of a Vpot event. (Generic Midi button only) |
@e_state | This variable references the current state (0/1) of the button. |
@e_sysex @e_sysexvalue @e_sysextext | These variables reference the variable part of a received sysex message. With a sysex event defined as (sysex:F0 01 20 XX F7) and a received sysex message "F0 01 20 48 69 21 F7", the variables will have these values:
|
@e_rotatevalue | These variables references the position or the rotation amount for the dial.
|
@e_tapx @e_tapy | These variables reference the X and Y coordinates of the tap position, where (0,0) is the upper left corner of the dial's screen area. |
@e_selectedindex @e_selectedtext | When an item in a list is selected, the selectedfromlist event is triggered.
|
@e_deeplinkpart1 @e_deeplinkpart2 @e_deeplinkpart3 | When a deep link is received, the deeplink event is triggered, and the @e_deeplinkpart1, 2, and 3 event reference variables are assigned their corresponding parts from the incoming message, excluding the prefix character. If a part is absent in the incoming message, the related event reference variable will be empty. |
@e_devicename | When a device is connected or disconnected the deviceconnected / devicedisconnected events are triggered, and the @e_devicename event reference variable is assigned the name of the device. |