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
@e_ccvalue
@e_ccchannel
@event_cc
@event_ccvalue
@event_ccchannel

These variables reference the controller, controller value, and channel for the command's first occurrence of a Control Change event.

@e_nrpn
@e_nrpnvalue
@e_nrpnchannel
@event_nrpn
@event_nrpnvalue
@event_nrpnchannel

These variables reference the controller, controller value, and channel for the command's first occurrence of an NRPN event.

@e_pc
@e_pcchannel
@event_pc
@event_pcchannel

These variables reference the program and channel for the command's first occurrence of a Program Change event.

@e_note
@e_notevelocity
@e_notechannel
@event_note
@event_notevelocity
@event_notechannel

These variables reference the key, velocity, and channel for the command's first occurrence of a Note On or Note Off event.

@e_pbvalue
@e_pbchannel
@event_pbvalue
@event_pbchannel

These variables reference the program and channel for the command's first occurrence of a PitchBend event.

@e_cpvalue
@e_cpchannel
@event_cpvalue
@event_cpchannel

These variables reference the program and channel for the command's first occurrence of a Channel Pressure event.

@e_fadervalue
@event_fadervalue

This variable references the fader level for the command's first occurrence of a Fader event. (Generic Midi button only)

@e_vpotvalue
@event_vpotvalue

This variable references the vpot position for the command's first occurrence of a Vpot event. (Generic Midi button only)

@e_state
@event_state

This variable references the current state (0/1) of the button.

@e_sysex
@event_sysex

@e_sysexvalue
@event_sysexvalue

@e_sysextext
@event_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_sysex stores the raw sysex hexadecimal values for the variable part of the sysex message: "48 69 21".

  • e_sysexvalue stores the integer value for the first byte of the variable part of the sysex message: 72 (since 72 is the hexadecimal value 48 converted to an integer)

  • e_sysextext stores the ASCII text representation of the variable part of the sysex message: "Hi!" . Please see the ASCII page for hexadecimal codes for characters.

@e_rotatevalue
@event_rotatevalue
@e_tics
@event_tics

These variables references the position or the rotation amount for the dial.

  • e_rotatevalue stores the new position of the control.
  • e_tics stores the number of steps the dial has been rotated during the last 50 ms.

@e_tapx
@event_tapx

@e_tapy
@event_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
@event_selectedindex

@e_selectedtext
@event_selectedtext

When an item in a list is selected, the selectedfromlist event is triggered. 

  • e_selectedindex will keep the index of the selected item. The first item has index 1. If the list is configured to show an exit item, this has an index of 0, so the first "real item always has an index of 1.
  • e_selectedtext will keep the text of the selected item.

@e_deeplinkpart1
@event_deeplinkpart1

@e_deeplinkpart2
@event_deeplinkpart2

@e_deeplinkpart3
@event_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
@event_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.