Script events
Script initialization event
The script initialization event is triggered when the script is loaded, either when Stream Deck starts or when a profile/page/folder with the button/dial is loaded. The primary purpose of the init event is to prepare an image and text on the button/dial, but any action can be executed.
Incoming Midi events
For incoming Midi events, all commands triggered by the event are run. If an incoming midi event triggers multiple commands, they are executed in the order they appear in the script.
The plugin monitors both midi commands sent from your daw and commands sent from Stream Deck buttons.
Press/release events
The order of (press)/(release) commands is important. When the button is pressed and released, the commands will be executed in the order they appear in the script.
The plugin can operate in two different "modes":
Press mode
If there are one or more press commands in the script, the plugin works in the traditional mode, which has been the only mode up to version 3.11.
Multiple (press) events can be defined; if so, the plugin will cycle through them, one (press) event for each button/dial press. When no more (press) events are defined, the plugin starts over with the first one.
(release) events are triggered when the button/dial is released. Each (release) event is matched with the (press) event immediately before it in the script. Several multi-event (release) commands can be defined following a (press) command, but only the first (release) command with all events fulfilled will be executed.
If there is a need for a (release) command where no action is needed for the preceding (press) command, you can use an empty (press) command. If you want to emphasize that no action will be performed, you can use the {noaction} action, which performs....ehh...no action. :-)
[(press)]
[(press){noaction}]
Release mode
If there are no (press) commands in the script, the plugin works only with (release) commands. The primary use for the release mode is for dials, where at the press moment, it is not clear what the purpose of the dial press is; is it pressed to be rotated or pressed just to be released?
Release mode requires the script to have absolute no (press) commands. In this mode, multiple (release) events can be defined; if so, the plugin will cycle through them, one (release) event for each button/dial release. When no more (release) events are defined, the plugin starts over with the first one.
In release mode, the {nextpress} action will not work. If you need to use the {nextpress} action, you need to use the press mode and add an empty (press) command for each (release) command.
Value definitions
Events related to numerical values can often be defined in different ways.
- A single value is, of course, defined by a single integer: "25".
- An interval is defined if the event should trigger for multiple values; the range is defined as "25-64".
- A transition is defined when the event should trigger when the value transitions from one value to another. The transition event is using the "<>" characters. The event (_event_:<64<) will trigger when the previous value for the event was above 64, and the current value is 64 or below. The event (_event_:>64>) will trigger when the previous value for the event is below 64 and the current value is 64 or above.
- "All values" is defined with "*".
Please note that many events are treated differently when used in multi-event commands. This table describes the event logic used in single-event commands; please see the Multi-event commands page for the event logic in multi-event commands.
Events
(init)
(init+)
The (init) event is triggered once when the script is loaded.
The (init+) event is likewise triggered when the script is loaded, but also whenever the additional event(s) in the command are triggered.
Example: Assume you want to display a text when a specific CC command is received and also want this text to be present when you switch to the page with the script. Using the (init) command, you would need to define two commands: one for the init phase and one for the running operation:
[(init)(cc:1,1,0){text:Super\nDuper}]
[(cc:1,1,0){text:Super\nDuper}]
If you use (init+), a single command handles both functions:
[(init+)(cc:1,1,0){text:Super\nDuper}]