Show Global Expressions

Starting with version 0.5 you can use Show files to more conveniently perform actions when specific sections of particular tracks are played. Shows have their own sets of expressions, which we cover next.

The Tracks menu at the top of a Show window lets you define three expressions that can manage values you want to make available to all your other expressions within the Show.

To support that, all Show expressions have access to a Clojure atom named globals that is shared with all other Show expressions, so that’s a great place to put things for them to find. The atom starts out holding an empty map, which allows you to add key/value pairs to organize the information you want to share across expressions. Show expressions also all have access to the Triggers window globals atom, under the name trigger-globals.

Also, all expressions that run in a show have access to a value show that contains everything Beat Link Trigger knows about the show, which can be useful.

Global Setup Expression

This is run when the Show file is opened, either because you explicitly opened it using the Triggers window File menu, or because Beat Link Trigger automatically reopened it at launch because you had it open the last time you used the program. You can use it to open network connections or set up other values for your Track and Cue expressions to use.

Came Online Expression

This is run whenever the show is opened when Beat Link Trigger is already connected to a DJ Link network, or if you have told it manually to go online with the show already open. When opening the show it will run after the Global Setup expression as long as you are online. It runs by itself when you choose Network  Online? to successfully transition from an offline to an online state.

You have access to the show and triggers globals if you need to use anything in them.

Default Enabled Filter Expression

The basic concept of an Enabled Filter is described in the introduction to this section; shows use them in a similar way. Each Track that you are watching in the Show can be enabled separately. If the track’s Enabled menu is set to Default, that track will look to the show itself to decide whether it should be enabled. There is an Enabled Default menu at the top of the Show window that is used by all tracks whose Enabled mode is Default. If the Show’s Enabled Default is set to Custom, it will run your Default Enabled Filter Expression to decide what to do. If your expression returns a true value, all these tracks will be enabled; otherwise they will be disabled.

Disabled Tracks do not respond to being played, and all of their configured cues are disabled.

Going Offline Expression

This is run whenever the show is open, Beat Link Trigger was online, and you manually take it offline by choosing Network  Online?, when you close the Show file, or exit the program. In any of the situations where you are doing more than just going offline, it runs right before the Global Shutdown expression. It gives you a chance to gracefully close any connections and release any system resources you allocated in your Came Online Expression.

You have access to the show and triggers globals if you need to use anything in them.

Global Shutdown Expression

This is run when the Show file is closed, either because you closed the window, or because Beat Link Trigger is shutting down. You can use it to close any network connections or clean up any other resources your Global Setup Expression allocated.