Open Stage Control (Tutorial) - An alternative to Lemur and TouchOSC

Manaberry

Active Member
Hi everyone! I've been using Open Stage Control for almost a year now. This application really improved my workflow as a composer. It’s an alternative to Lemur/TouchOSC. This is a free software developed by jean-emmanuel, available on Windows, OSX, Linux. It's quite a long post, so get some coffee!

Welcome to this tutorial (for Windows 10) to set up and use Open Stage Control as a MIDI/OSC controller using your web browser. It is similar to Lemur or TouchOSC, but in order to work, it requires some configuration.
If you are on MacOSX, a member published a step by step video here.


Introduction to Open Stage Control


Open Stage Control is a desktop OSC bi-directionnal control surface application. It's built on web technologies and runs as an Electron web server that accepts any number of clients.


(screenshot from OSC template for Ardour)

What are you able to do with Open Stage Control?

You can use it to create your own mixing table with endless tracks. You can create a modal window that pops up for your articulation to save room. You can set a single input field and spread the value with a variable through the whole thing (devs know). You can just do all of the previous things within a single one screen area. There is similarities as Lemur on the script side. It’s javascript.

I'm using a Dell P2418HT screen.


A bit of programming and it does work perfectly with Cubase, Dorico (with Bome Midi Translator), and Ableton.

I also created my own colors palette - there is some CSS (Cascade Style Sheet, the common way to controls appearance of elements in a front-end web environment) fields so, there are no limits here. You can create something that looks like Tony Stark’s suit if you want.



I have information stored in a javascript file, which is imported into OSC when the software starts(custom-module field.) Those data are about articulations mostly. It does look like that:

{'name':'Marimba','color':'47bbff','background':'1b1d20',
'articulationsLong':['Fingers','Hard','Soft','Muted'],
articulationsShort':[],
'articulationsDeco':[]
}
It's an improved version of a code from another member. Thanks to him for sharing it here in this thread!

Name is displayed on a text area.
Color refer to the text color.
Background refer to the background color of the button.
Articulations are splitted into 3 sections: Long, Short, Deco.

Of course this is how I did my template and how I organise the data. You are free to do differently ;)

The more you work on your Open Stage Control template, the more you can do sophisticated things.

But first, we have to install the server!



My template (Cubase)



Step 1: Core installation


Libraries are needed to make this work. Let’s install them. Nothing complicated. First, we need Pyton on the computer.


1. Install python

2. Install rtmidi python package (command prompt)


Step 1: Run the Command prompt as Administrator:
Search for “cmd”, right-click, Run as Administrator.​
Step 2: Go to the Scripts directory (grey color = command/response in the command prompt)
Use the following command to access python directory. (“cd” means, Change Directory). You can also go to the parent folder by using “cd ..”​

cd C:\Users\YOURUSERNAME\AppData\Local\Programs\Python36

Step 3: Run the python-rtmidi command to install the package
Enter the following command in the command prompt and let the magic happen.​
pip install python-rtmidi

(If you have an error: LINK: fatal error LNK1181: cannot open input file ‘python34.lib’, go to libs folder in the python install directory; duplicate python36.lib and rename it to python34.lib. Now go back to step 3. It’s looking for an older version of python lib.

***

Important: To avoid any error, please update “pip”. If there is no error, we are good to go!

Now, we need to create a virtual midi port in order to initialize our little server. In my case I’m using
rtpMidi. The next step of this tutorial is featuring screenshots of this software.


Step 2: MIDI Setup


Open Stage Control is not that hard to set up. It’s pretty easy, to be honest, but follow the next steps carefully; it will be helpful for further maintenance if something went wrong.


Virtual midi port
Open Stage Control needs a free midi port to work. If you want to run the server on your working computer, then loopMidi is enough.

Just create a midi port. In this tutorial, It will be named “VIControl”. (avoid using "space" in the name)​


  • Two computers (network) (rtpMidi)
For clarity, MC is for Master Computer (the one receiving midi). And SC for Slave Computer (the one running the server and sending midi to the MC).​


1.1 On the slave computer (SC) that will run the server, let’s create a new session named “toVIControl” on rtpMidi. (avoid using "space" in the name)


1.2 On the master computer (MC), let’s create “VIControl” session.



MC We already see the session from the slave computer (toVIControl). Press “Connect” to add this one to the list of Participants.
SC Same step, connect “VIControl” from Directory list to the participants list in the “toVIControl” session.


rtpMidi should ping and connect both computers on their mutual sessions. You should see some latency as a proof of a successful pairing.


OK, virtual midi port is created. You can already add VIControl as a new midi controller in your favorite DAW on the MC. The MC part is done.

Now let’s run the server on the SC.
 
Last edited:
OP
Manaberry

Manaberry

Active Member
Step 3: Configuration/Initialization

You have downloaded Open Stage Control and you just extracted all the files. Great! Now, once you launched the soft, you should see this:


Well, I already see you coming. There is an update. We will take care of this one later (...)


So many fields, so many options. For now only two of them are mandatory for this tutorial: send and midi.

For additional informations, please check the official documentation.


Send is the IP of the machine that MIDI messages will be send to. In our case, we want to send MIDI msgs to MC. Check the MC IP in the Network Connection Details (Control Panel\Network and Internet\Network Connections).

xxx.xxx.xxx.xxx:8000


In the midi field, we tell Open Stage Control to use our virtual midi. The command looks like that:


--midi MIDIPORTNAME:INPUTPORT,OUTPUTPORT


! If you remember well the midi session on SC: it will be only VIControl for the single computer solution.


--midi toVIControl:INPUTPORT,OUTPUTPORT



We don’t know the input/output port number for toVIControl. Don't panic, there is a simple button for that! First, start Open Stage Control by pressing the START button.

Then Right-click anywhere on the Open Stage Control window, and a context menu should appear. Choose Midi > List Devices.


Some information should appear in the console like below:




Perfect! Input port 6, output port 7. We can complete the command line:

--midi toVIControl:6,7

We have all we need to start the server. You should have both MC ip and midi command line set.


To change settings we need to stop the server. No need to close the window to do so. To relaunch, Right click > App > Relaunch.


Congrats! Open Stage Control is now launched on SC. Now we can spend the rest of our lives making a nice GUI for our DAW and libraries!


You can now access Open Stage Control with a compatible web browser (chromium based) anywhere on the network just by using the IP of the machine running the server (SC) and the port 8080 (by default).

xxx.xxx.xxx.xxx:8080


Step 4: a GUI to rule them all

You pressed new, so you should see something like this. Welcome to Open Stage Control. Now, I regret to tell you that you will spend a lot of time on this editor view... Because there are so many things to do!



Before I let you go do some experimentations, there is one last thing you should know. To send midi message correctly, you have to tell your buttons what to do.


Let’s create a push button. Right-click on the grid > Add widget > Buttons > Push.

Click on the button freshly created. On the right panel “OPEN STAGE CONTROL”, there is a couple of fields. Scroll down to the “OSC” category.

A push button might be configured as follows in order to send a MIDI note whose velocity is defined by the button's on/off value: (from official documentation)
  • address: /note
  • preArgs: [1, 60] (for MIDI channel 1, and note 60 / C3)
  • on: 100 (for noteOn velocity of 100 on button push)
  • off: 0 (to send a noteOff on button release)
  • target: ["midi:device_name"] (where device_name is one of the declared midi devices defined during setup)

    Please note the "_" replace space. If your midi device name is "my device" the correct syntax to use in the target field is "my_device".

You should have something like this:



For this example, we are using a push button. But remember: you have to fill the target field with midi:toVIControl on every widget you create!


Precision is the number after the decimal. For the /note address, we don’t need 2 of precision, but for /control - on a track volume for instance, 1 of precision (-6.4db) or 2 (-6.43db) can make a big difference!


If you press the push button, you should have a midi input signal on the MC.


In addition to Cubase Generic Remote Control, I’m using Midi Translator to convert MIDI msgs to emulate keystrokes. It’s easy to use and powerful! It has to be installed on the MC.


You have everything in your hands to create your own GUI on Open Stage Control.
The last part is some CSS code and tips to help you in the creation process. Good luck and have fun!


Step 5: Tricks and CSS code


Here is a Spreadsheet with some css codes and base64 images for your template.​

If you have any questions or if you need help, feel free to ask on this thread! I will help as much as I can!

The Open Stage Control developer is highly active. If you have some errors, bugs, or even features ideas; feel free to help him by posting on the project github. For other requests or discussions about OSC, please join the brand new discussion group.

Thank you so much for reading. I hope you enjoyed this tutorial and this software!

Manaberry
 
Last edited:

bryla

Senior Member
I don’t think I’ll need this in my workflow any time soon but that is a great post! Thank you!
 

Shad0wLandsUK

Senior Member
I am getting an error on installing pip rtmidi, but not the one you have listed. Also you put that you can forget the update pip part, but I do not see that in your walk-through either :/

As I am trying to do that ;)
 
OP
Manaberry

Manaberry

Active Member
I am getting an error on installing pip rtmidi, but not the one you have listed. Also you put that you can forget the update pip part, but I do not see that in your walk-through either :/

As I am trying to do that ;)
If the python build has the updated pip version, you will not get the message.
Can you please post the error message? We will find a way to make it work ;)
 
Last edited:

Shad0wLandsUK

Senior Member
If the python build has the updated pip version, you will not get the message.
Can you please post the error message? We will find a way to make it work ;)
Ok man,

I have installed:
Python 3.6 (all options)
vs Build-tools (made selection of just VS 2017 options under install tab)
Was not sure if I was meant to install the full 4GB?

Here you go (see attached)
 

Attachments

OP
Manaberry

Manaberry

Active Member
Ok man,

I have installed:
Python 3.6 (all options)
vs Build-tools (made selection of just VS 2017 options under install tab)
Was not sure if I was meant to install the full 4GB?

Here you go (see attached)
You have to install the Visual Studio Build Tools. It's 1Gb download but indeed, it is 4GB of space required.
If you have not installed it that way, it's maybe the problem.
If some part of my tutorial is unclear, I will improve it of course ;)
 

Shad0wLandsUK

Senior Member
You have to install the Visual Studio Build Tools. It's 1Gb download but indeed, it is 4GB of space required.
If you have not installed it that way, it's maybe the problem.
If some part of my tutorial is unclear, I will improve it of course ;)
So you want us to install the whole of the vs Build Tools?
Just that from your instructions you put '2017' in brackets, so I removed all the 'extras' :)

But no matter, adding the rest now
 
OP
Manaberry

Manaberry

Active Member
So you want us to install the whole of the vs Build Tools?
Just that from your instructions you put '2017' in brackets, so I removed all the 'extras' :)

But no matter, adding the rest now
Yes, in order to use O-S-C, this is needed files for Windows : <

You should have this installed:



(Visual C++ Build Tools core features and Visual C++ 2017 Redistributable Update).
Optional = Windows 10 Sdk and Testing tools core

I'm uninstalling it to reinstall it to capture screenshots of the process for the tutorial.
 
Last edited:

Shad0wLandsUK

Senior Member
Yes, in order to use O-S-C, this is needed files for Windows : <

You should have this installed:



(Visual C++ Build Tools core features and Visual C++ 2017 Redistributable Update).
Optional = not needed

I'm uninstalling it to reinstall it to capture screenshots of the process for the tutorial.
Ok, so I installed all of Build Tools and now it has worked, after copying and renaming python36.lib and then making python34.lib too

Before that I got the 1181 error, but remembered the steps you mentioned :)

All installed successfully now
Unsure how to update pip though :/
 
OP
Manaberry

Manaberry

Active Member
Wonderful!
You don't have to update pip (but if you want to, there is the command in the command prompt: see the screen you captured). Pip is usually used to install packages. You did install the package (rtmidi) we want to install. The command prompt part is done, so you can leave pip alone :D
 
OP
Manaberry

Manaberry

Active Member
Just to let you guys know, I'm working on releasing my template (still few things to fix). I'm also making vector icons for my daw (Live). If you want some for your specific DAW, tell me on the thread! I will try to do something ;)

On the dev side, the developer released nice new versions. You can now use icons (with 700+ icons font). You can also use your own with base64 method. A dark version is also available directly with a command line, based on my UI work.
You can ask for your own features on the github if needed.
 
OP
Manaberry

Manaberry

Active Member
Is it possible to use this template within a different DAW? I'm using Reaper
My template is using channel 16, and I've made a quick Python remote control to make it work with Ableton. But the template itself can be rearranged based on what you need.
You can try the reaper template first, and once you get familiar with the software, you merge both.

Here is the thing for Reaper.
 

jadedsean

Active Member
My template is using channel 16, and I've made a quick Python remote control to make it work with Ableton. But the template itself can be rearranged based on what you need.
You can try the reaper template first, and once you get familiar with the software, you merge both.

Here is the thing for Reaper.
Oh that's cool thank you so much, really appreciate it.
 

Gaijin14

New Member
When I run the '--midi list' message I get these error codes. Any idea what I have done wrong?

A JavaScript error occurred in the main process: Uncaught Exception: Error: spawn python ENOENT at exports._errnoException (util.js:1024:11) at Process.ChildProcess._handle.onexit (internal/child_process.js:192:19) at onErrorNT (internal/child_process.js:374:16) at _combinedTickCallback (internal/process/next_tick.js:138:11) at process._tickCallback (internal/process/next_tick.js:180:9)

[Renderer process error] TypeError: null is not an object (evaluating 'e.socket.send') at http://192.168.1.215:8080/browser/scripts.js:414:1449 (no stacktrace available)

No worries if you don't!
 
OP
Manaberry

Manaberry

Active Member
I'm investigating your issue to see if I find any solution.
Have you reported this on the github directly to the developer?

Does the error occur even without the --midi list line?

EDIT:

Okay, I had the same issue. You are running the wrong version of Python.
Be sure to run the x64 version of Python if you are on 64 bit OS.

Tell me if it solves the problem :>
 
Last edited:

Gaijin14

New Member
I'm investigating your issue to see if I find any solution.
Have you reported this on the github directly to the developer?

Does the error occur even without the --midi list line?

EDIT:

Okay, I had the same issue. You are running the wrong version of Python.
Be sure to run the x64 version of Python if you are on 64 bit OS.

Tell me if it solves the problem :>

You were right about the wrong version; however, when I run the RTmidi command I get this:

C:\Users\david\AppData\Local\Programs\Python36\Scripts>pip install rtmidi
Traceback (most recent call last):
File "c:\users\david\appdata\local\programs\python\python36\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\users\david\appdata\local\programs\python\python36\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\david\AppData\Local\Programs\Python36\Scripts\pip.exe\__main__.py", line 5, in <module>
ModuleNotFoundError: No module named 'pip._internal'


Any ideas what I have done wrong this time around?
 
Last edited: