# Stream Deck

Run a show from an Elgato Stream Deck. The Audio X plugin gives you keys for GO, stop, pause, panic, single cues, soundboard pads, the radio, the countdown timer, the recorder (record, stop, marker) and live show status. The keys show what is happening in Audio X: the cue on standby, the pad that is playing, the time left.

The plugin needs Stream Deck software 6.6 or newer and Audio X 1.4.3 or newer for the recorder keys, on Windows or on a Mac (a Mac can control Audio X over the network). It needs nothing else installed: Stream Deck brings its own Node.js.

| Stream Deck | What the plugin uses |
|---|---|
| Mini, MK.2, XL, Neo, Studio (keys) | The keys: every action below |
| **Stream Deck +** and Studio | The keys, **and the dials and the touch strip** (see *Dials and the touch strip*) |
| Pedal | The pedals press the actions (GO, stop, pause, panic, a cue, a pad, talk...). A pedal has no screen, so nothing is drawn |

## Install

1. Get `AudioX-StreamDeck-1.3.2.streamDeckPlugin` from [audiox.info](https://audiox.info) (or from the `dist` folder of the build).
2. Double-click it. Stream Deck asks to install it. Choose **Install**.
3. In the Stream Deck window, the list of actions on the right has a new group called **Audio X**.

## Connect it to Audio X

The plugin uses the same remote interface as the phone page, so switch that on first.

1. In Audio X open **Network > Remote control** and tick *Allow control from a phone or tablet*. Note the **port** (8765) and the **PIN**. See [Remote Control and the Phone App](Remote-Control-and-Phone-App).
2. Drag any Audio X action onto a key. Its settings panel has an **Audio X connection** section at the bottom.
3. Enter the **Computer** (`127.0.0.1` when Audio X is on the same PC as Stream Deck, otherwise the address shown in the Remote control window), the **Port** and the **PIN**, then press **Save and connect**.
4. The panel says *Connected to Audio X* and every Audio X key on every page comes alive. You only enter this once: it is shared by all the keys.

If Audio X is not running or cannot be reached, the keys turn dark and say why (*Not reachable*, *Wrong PIN*). They come back by themselves when Audio X is available. After a wrong PIN the plugin does **not** keep trying, because Audio X locks an address out for a minute after five wrong PINs; fix the PIN and press **Save and connect**.

## The keys

| Key | What a press does | What it shows |
|---|---|---|
| **GO** | Starts the cue on standby | The standby cue |
| **Stop all** | Fades out and stops every cue | Bright red while a cue plays |
| **Pause / resume** | Pauses or resumes the playing cues | PAUSE or RESUME |
| **PANIC** | Stops everything at once: cues, the test generator, the soundboard and (unless switched off in Audio X's Preferences) the radio and the talk-over | PANIC. Optional: *Hold for 1 second* |
| **Fire cue** | Selects one cue and starts it | Cue number and name, amber when on standby, green with a progress bar while playing |
| **Next cue** / **Previous cue** | Moves the standby cue down or up | The cue it will move to |
| **Soundboard pad** | Plays one pad (a hold pad plays while the key is held) | Pad name in the pad's colour, progress bar while playing, red mark on an error |
| **Stop all pads** | Stops every pad | |
| **Radio on / off** | Starts or stops the radio | ON AIR and the song playing |
| **Radio talk** | Hold to talk, or press to switch on and off | Red while the talk-over is live |
| **Radio ident** | Plays one ident | The ident name, green while it plays |
| **Countdown** | Start / pause, reset, or set a time (your choice per key) | The time left, a bar, green while running, red when finished |
| **Show status** | Nothing (display only) | Now playing with time left, the elapsed time, the show time left, or the clock |
| **Record** | Starts recording in the Audio X recorder (see *The recorder keys* below) | The next take; the recording time, blinking red, while recording |
| **Record stop** | Stops the recording and finishes the files (hold 1 second, switchable) | STOP and the time while recording |
| **Record / stop** | One key: press to start, hold 1 second to stop | RECORD, or STOP with the time |
| **Record marker** | Drops a marker into the recording | The recording time, lit while recording |
| **Recorder status** | Nothing (display only) | READY or IDLE, or the time, number of tracks, free disk space and dropouts |

### The recorder keys

The record keys use the Recorder window of Audio X (**Live > Multitrack recorder**, see [Input Monitor and Recorder](Input-Monitor-and-Recorder)). A key press does the same as the window's buttons, with one difference: no session dialog opens. The recording uses the **session name, folder and armed tracks** you last set in the Recorder window, and the take number goes up by one each time. Set the tracks and the folder there once, before the show.

![Recorder keys while recording](images/streamdeck-rec.png)

* If the Recorder window is not open, Audio X opens it in the background (it does not take the focus) when the first record key is pressed. A recording keeps running if that window is closed or hidden.
* **Record stop** and the Record / stop key need a **hold of 1 second** to stop, so a stray touch cannot end a take. Starting is a single press. Untick *Hold for 1 second* in the key's settings to stop with a plain press.
* Stopping can take a few seconds for long recordings while the files are finished. The key shows the time until it is done.
* If something is missing (no audio device open, no track armed, no inputs) the key flashes the warning triangle and the Recorder window says why.
* The recorder has **no pause**: Audio X can record, stop and drop markers. So there is no pause key.

### Choosing the cue, ident or pad

* **Fire cue**: type the cue's number as it is in the **Cue** column of Audio X (for example `3` or `5A`). If you start typing, the panel suggests the cues of the show that is open. If no cue has that number, a plain number is taken as the row.
* **Radio ident**: type the ident's name, or its place in the list (1, 2, 3...).
* **Soundboard pad**: choose the bank (its name is shown) and the row and column, counted from the top left as on the soundboard window.

Keys follow the show that is open: change the show and the keys show the new cues. A key whose cue or pad does not exist says so on its face, and flashes a warning triangle when pressed.

## Dials and the touch strip (Stream Deck +)

On a Stream Deck + each dial has a segment of the touch strip above it. The plugin draws on that segment, and there are four actions made for dials:

| Dial action | Turn | Push the dial or tap the strip | Hold the strip |
|---|---|---|---|
| **Cue dial** | Chooses the standby cue (the strip shows it) | GO | |
| **Countdown dial** | Sets the countdown time (10 seconds per click, changeable in the settings) | Start / pause | Reset |
| **Pad dial** | Chooses a soundboard pad in the bank | Plays the pad (push); tap the strip for the next bank | Stop all pads |
| **Status dial** | | Pause / resume | |
| **Record dial** | | Start recording (hold 1 second to stop, switchable) | Tap the strip: drop a marker |

The Record dial shows the recording time, tracks and free disk space on the strip while recording.

The Status dial shows now playing, the elapsed time, the show time left or the clock, as you choose in its settings.

### One wide display across the touch strip

Put **Status dial** on two, three or all four dials next to each other. They join into one wide display across the touch strip, with bigger text, and each dial draws its own part of it.

![Four Status dials joined into one display](images/streamdeck-strip.png)

* The left dial's setting (now playing, elapsed, show left or clock) is used for the whole display.
* Dials must be side by side on the same Stream Deck. A gap, or an other action in between, splits the display.
* Untick *Join neighbouring Status dials* in a dial's settings to keep it a single block.
* Pushing any of the joined dials pauses or resumes.

Every key action can also be put on a dial. Pushing the dial, or tapping its part of the strip, then presses it, and the strip shows the same picture as the key would.

## A layout to start with

Stream Deck profiles are made in the Stream Deck window, so no ready-made profile is included. A 15-key Stream Deck (5 across, 3 down) works well like this:

![An example Stream Deck layout](images/streamdeck-keys.png)

| Key 1 | Key 2 | Key 3 | Key 4 | Key 5 |
|---|---|---|---|---|
| **GO** | Previous cue | Next cue | Show status (now playing) | **PANIC** (hold) |
| Stop all | Pause / resume | Show status (show left) | Countdown (set 5:30) | Radio ident |
| Soundboard pad | Fire cue | Fire cue | Radio on / off | Radio talk |

Make a folder or second page for the cues of a show with **Fire cue** keys, and another for the 16 pads of a bank.

## Good to know

* Anyone who can reach Audio X with the PIN can control it, and so can this plugin. The PIN is kept in Stream Deck's settings on this PC. Use the show network only.
* To control a different PC, enter its address in the connection section. The Windows Firewall button in the Remote control window opens the port.
* The keys update about three times a second. Audio X must have the Remote control switched on for the whole show.
* The plugin is free software under the same licence as Audio X. Its source is in the `streamdeck` folder of the source code.

## Troubleshooting

* **Keys say "Enter the PIN"**: open any Audio X key's settings, fill in the connection section and press *Save and connect*.
* **"Not reachable"**: Audio X is not running, Remote control is switched off, or the computer name or port is wrong. Try opening the address in a web browser first.
* **"Wrong PIN"**: the PIN changed (**New PIN** in the Remote control window signs everybody out). Enter the new one.
* **"Locked out, wait"**: five wrong PINs were tried from this PC. Wait a minute.
* **A key flashes a warning triangle**: the cue, ident or pad it points at does not exist, or Audio X refused the command (for example a pad without a file). Stream Deck's log has the reason.
