Skip to content

Commit

Permalink
V4.0.0 beta (#26)
Browse files Browse the repository at this point in the history
* Rename filenames for usability

* Remove alternative modules

* Update README.md

* Update .gitignore

* Remove hidden config files

* Update change notes
  • Loading branch information
bsmith96 authored Jan 17, 2022
1 parent ee3c923 commit fac647e
Show file tree
Hide file tree
Showing 25 changed files with 26 additions and 4,403 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,5 @@ dist
.tern-port

# config file
/open-stage-control-module/qlab-info-config.json
/open-stage-control-module/qlab-display.config
qlab-info-config.json
qlab-display.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- @description Get Unique IDs for Open Stage Control monitoring
-- @author Ben Smith
-- @link bensmithsound.uk
-- @version 3.0-beta2
-- @version 3.0
-- @testedmacos 10.14.6
-- @testedqlab 4.6.10
-- @about
Expand Down Expand Up @@ -98,8 +98,7 @@ end getCueLists
on getIP()
try
set theReturned to (do shell script "ifconfig | grep inet | grep -v inet6 | cut -d\" \" -f2")
set theIPs to splitString(theReturned, "
")
set theIPs to splitString(theReturned, "")
on error
set theIPs to {"Can't get Local IP"}
end try
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
-- @description Create Open Stage Control server setup
-- @author Ben Smith
-- @link bensmithsound.uk
-- @version 1.0-beta1
-- @version 2.0
-- @testedmacos 10.14.6
-- @testedqlab 4.6.10
-- @about Creates a file to open/load in Open Stage Control, with settings required to start the server.

-- @changelog
-- v1.0 + init
-- v1.0 + change filenames


---- DECLARATIONS -------------------------
Expand Down Expand Up @@ -48,7 +48,7 @@ set rootFolder to getRootFolder()
set rootFolder to rootFolder as text
set rootFolder to POSIX path of alias rootFolder

set configContents to configContents & "\"load\":\"" & rootFolder & "open-stage-control-template.json\",\"custom-module\":\"" & rootFolder & "get-cue-list-playhead.js\""
set configContents to configContents & "\"load\":\"" & rootFolder & "qlab-display_layout.json\",\"custom-module\":\"" & rootFolder & "qlab-display_module.js\""

if useTCP of control of qlabConfig is false then
set configContents to configContents & ",\"osc-port\":53001"
Expand Down
122 changes: 15 additions & 107 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,145 +9,53 @@

This version runs entirely within the [Open Stage Control](http://openstagecontrol.ammd.net/) software, as a 'custom module'. It requests updates from Qlab when there are changes to the workspace, and interprets the responses appropriately - the module ignores responses which do not relate to the playhead position of the chosen cue list.

You can run the module with either a UDP or TCP connection to Qlab. I recommend using TCP, as this maintains a permanent connection to Qlab, increasing reliability, but with minimal CPU overhead. If you wish to use UDP, you must send a thump (heartbeat) message to Qlab to maintain the connection – to enable this, at the top of the module, edit the variable `useTCP = false`.
You can run the module with either a UDP or TCP connection to Qlab. I recommend using TCP, as this maintains a permanent connection to Qlab, increasing reliability, but with minimal CPU overhead. If you wish to use UDP, you must send a thump (heartbeat) message to Qlab to maintain the connection – to enable this, choose "UDP" when setting up the first applescript, or ensure `qlab-info-config.json` contains `control.useTCP = false`.

## Open Stage Control setup

- First, put the 'open-stage-control-module' folder on the computer you wish to run the server from. Ensure the computer is on the network, and file sharing is enabled.
- On your Qlab computer, navigate to the folder over the network and open 'Get-IDs.applescript' in script editor.
- First, put the repository folder on the computer you wish to run the web-server from. Ensure the computer is on the network, and file sharing is enabled. Port 53000 (and 53001 if using UDP) must be open.
- On your Qlab computer, navigate to the above folder over the network and open '1-generate-module-config.applescript' in script editor.
- Ensure your Qlab file is open, and the front-most Qlab workspace.
- Run the 'Get-IDs' script - this will create 'qlab-info-config.json' in the root folder.
- Run the script - this will create 'qlab-info-config.json' in the root folder.
- The first dialog box asks you to define the Qlab computer
- If this is your only Qlab computer, or if this is your "Main" or "A" machine, select "Main".
- If you have a *main* and *backup* Qlab computer, ensure you run this setup process on the *main* first, then repeat the process on the *backup*, selecting "Backup", to complete the config file.
- The second dialog box allows you to choose the cue list you wish to monitor.
- The third dialog box asks you which local IP address you wish to use. If your computer is on multiple networks, e.g. a control network and a [Dante](https://www.audinate.com/meet-dante/what-is-dante) network, this allows you to select the correct one.
- **NB**: 127.0.0.1 is the localhost address.
- **NB**: If you can only see 127.0.0.1, try cmd+F "set theIPs to splitString(theReturned". Replace the line break (between the 2 quote marks) with `\r` and re-compile, and save.
- If you are running the server on a mac:
- On the computer running the server, open 'Create-Server-Setup.applescript' in script editor, and run the script. This will create 'qlab-display.config'.
- On the computer running the server, open '2-generate-app-config.applescript' in script editor, and run the script. This will create 'qlab-display.config'.
- Open **Open Stage Control**.
- Select *Load* and open 'qlab-display.config'.
- Click start to launch the OSC & web server.
- If you are running the server on a non-mac computer:
- Set the following settings in the launcher, using files from the `open-stage-control-module` folder:
- **load**: select the file `open-stage-control-template.json`
- **custom-module**: select the file `get-cue-list-playhead.js`
- Set the following settings in the launcher:
- **load**: select the file `qlab-display_layout.json`
- **custom-module**: select the file `qlab-display_module.js`
- **port**: this is the port that the web server is served to. Leave this blank to use the default 8080.
- **no-gui**: if you do not want this open on the device which is the server, set this to true.
- **no-gui**: if you do not want the display open on the device which is the server, set this to true.
- **IF USING UDP**
- **osc-port**: set 53001. This is the port it will listen for replies from.
- Ensure you also edit the variable useTCP to "false" in `get-cue-list-playhead.js`
- **IF USING TCP**
- **tcp-port**: set 53001.
- **tcp-targets**: set \[Qlab IP\]:53000 (e.g. `127.0.0.1:53000`). Use a space to separate multiple instances.
- **tcp-targets**: set \[Qlab IP\]:53000 (e.g. `127.0.0.1:53000`). Use a space to separate multiple instances, e.g. Main and Backup.
- Now, click start to launch the OSC & web server.

My suggested setup is to run the Open Stage Control server at Front Of House (for example, on the System computer), with the local GUI active, so the Sound No. 1 can see that it is working correctly. Then, the remote display for the MD is simply a browser window.

This has the added advantage that, if the Sound No 1 has to switch to the Backup due to issues with the Main, or the Main computer crashing entirely, they can also hit the "BACKUP" button on the viewer, which also switches it for the MD.
This has the added advantage that, if the Sound No 1 has to switch to the Backup Qlab computer due to issues with the Main, or the Main computer crashing entirely, they can hit the "BACKUP" button on the viewer, which also switches it for the MD.

If you ever need to re-generate 'qlab-info-config.json', you can simply run the process again. This might happen if you bundle the workspace.

# Node JS version

## Methods

This script has several versions for displaying the result:
- `qlab-mon.js` displays the current playhead in terminal.
- `qlab-mon-streamdeck.js` displays the current playhead on 2 buttons on a streamdeck, which can be on a separate computer to that running the script if desired.
- `qlab-mon-open-stage-control.js` displays the current playhead in the software "open stage control", which can also be run on either the same or a remote computer, and can also be viewed over the network in a web browser.

## Installation

1. Clone this repository, or download and expand the zip.
2. Ensure you have installed [node.js](https://nodejs.org/en/).
3. In terminal, set the repository folder as the directory, e.g: `cd Documents/qlab-display`.
4. In terminal, enter `npm install` to install all dependencies of the project.
5. To set variables to allow the scripts to work on your system, open config.yml in a text or code editor. Here, you can set:
- Production information:
- Production name
- Cue list name
- Config version (in case you make changes to your network)
- Cue list number
- Qlab information:
- IP address
- Port to send to
- Port replies come from
- Display information:
- IP address
- For Open Stage Control:
- Port
- OSC address for displaying cue number
- OSC address for displaying cue name
- OSC address for a heartbeat indicator
- For Streamdeck:
- Port
- Companion page number
- Companion button number for Q Number
- Companion button number for Q Name
6. You can also set most of these variables from the command line, which could be particularly useful for cue list numbers and OSC ports.

## Operation

Choose which version of the script you wish to use: in `package.json`, change the filename under "main" to be that script. By default, I've set this to `qlab-mon-open-stage-control.js`.

In terminal, enter: `node .`. Leave this terminal window open, and it will constantly send Qlab a message every 0.5s (by default) to request the playhead position on the cue list specified.

### Command Line Variables

You can control several variables when launching the scripts - simply add the following after `node .` if you desire.

- `--cuelist, -q`, to set the cue list number to monitor
- `--qlabip, --qi`, to set the IP address for qlab
- `--qlabport, --qp`, to set the OSC port to send to qlab
- `--displayip, --di`, to set the IP address for the computer running the display (Companion or Open Stage Control)
- `--displayport, -d`, to set the OSC port of the display software
- `--companionpage, --cp`, on streamdeck to set the page to display the information
- `--cuenumberbutton, --cqnum`, on streamdeck to set the button which displays the cue number
- `--cuenamebutton, --cqname`, on streamdeck to set the button which displays the cue name
- `--help, -h` to see a list of all available options on the script you're using

### qlab-mon.js

The terminal window will display the number and name of the playhead position, updating automatically every 0.5s.

### qlab-mon-streamdeck.js

If you have Bitfocus Companion open, the buttons you set should update automatically.

### qlab-mon-open-stage-control.js

Once you start Open Stage Control on the correct port, with the correct template open, this template should update.

If you are using the included template, `open-stage-control-template.json`, try setting this file in the "load" option before clicking the 'play' button to start Open Stage Control. This will automatically load the file, and enable you to log into, for example, http://127.0.0.1:7000 remotely and see this information too.

## Limitations

To use this method, the cue list you wish to monitor must have a cue number. e.g., for "Click Tracks", you might number the cue list "CLICK".

# Screenshots

## Open Stage Control Custom Module

### Launching Open Stage Control Module (using TCP)
## Launching Open Stage Control Module (using TCP)
![Launching Open Stage Control Module (TCP)](_images/A_Open_Stage_Control_Module_Launcher.png)

### Open Stage Control Module
## Open Stage Control Module
![Open Stage Control Module](_images/B_Open_Stage_Control_Module.png)

### Module disconnected from Qlab
## Module disconnected from Qlab
![Open Stage Control Module](_images/C_Open_Stage_Control_Disconnected.png)

## Node.js Version

### Launching the script from the macOS terminal
![Launching the script from macOS terminal](_images/D_Node_Launch_From_Terminal.png)

### Setting custom options when launching the script from the macOS terminal
![Launching the script with custom options](_images/E_Node_Set_Options_From_Terminal.png)

### The Qlab Display working in Open Stage Control
![Qlab Display in Open Stage Control](_images/F_Node_Open_Stage_Control_Display.png)

### Qlab Display when Qlab has disconnected
![Qlab Display when disconnected](_images/G_Node_Open_Stage_Control_Disconnected.png)
Binary file removed _images/D_Node_Launch_From_Terminal.png
Binary file not shown.
Binary file removed _images/E_Node_Set_Options_From_Terminal.png
Binary file not shown.
Binary file removed _images/F_Node_Open_Stage_Control_Display.png
Binary file not shown.
Binary file removed _images/G_Node_Open_Stage_Control_Disconnected.png
Binary file not shown.
26 changes: 0 additions & 26 deletions node-js-version/config.yml

This file was deleted.

5 changes: 0 additions & 5 deletions node-js-version/launch.sh

This file was deleted.

Loading

0 comments on commit fac647e

Please sign in to comment.