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.

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_pb
@e_pbchannel
@event_pb
@event_pbchannel

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

@e_cp
@e_cpchannel
@event_cp
@event_cpchannel

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

@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_row
@event_row

@e_column
@event_column

@e_id
@event_id

These variables don't reference anything in the events; instead, they keep information about the button.

  • e_row and e_column store the button's position, where the top left corner is (0,0).

  • e_id stores the unique ID assigned to the button by the Stream Deck software. The ID is in the form of a GUID, e.g., "25147989a1d6b01ef371c0121e5ccb32".