What's new

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

Manaberry

Senior Member
Hi everyone! I've been using https://osc.ammd.net/ (Open Stage Control) for almost two years now (jeez, time flies). 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!

For Mac users, Brian Rivlin made a fantastic video about O-S-C, and how to set up the software. For Windows user, stay with me and follow this thread ;)




_____________________________​



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.


Introduction to Open Stage Control


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

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 are similarities to 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 color palette - there are some CSS (Cascade Style Sheet, the common way to controls the 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 Mihkel Zilmer. Thanks to him for sharing it here in this thread!

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

Of course, this is how I did my template and how I organize 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!


tH7NWSG.jpg

My template (Cubase)



Step 1: Core installation (obsolete since version 1.70)

Since 1.7.0, you don't have to install python and rtmidi anymore. If you still want to use an earlier version of Open Stage Control, the instructions are available in the following spoiler container.

If you want to continue the installation of OSC 1.7.0 (or above), please go to Step 2 "Midi Setup".
Libraries are needed to make this work. Let’s install them. Nothing complicated. First, we need Python on the computer. (obsolete since version 1.70)


1. Install python (obsolete since version 1.70)

2. Install rtmidi python package (command prompt) (obsolete since version 1.70)


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 with. 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)​

Cpw1dDo.png

  • Two computers (network) (rtpMidi)
For clarity, MC stands for Master Computer (the one receiving MIDI). And SC for Slave Computer (the one running the server and sending MIDI to 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)

P13VU1E.png

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

51enVoF.png


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 the Directory list to the participant's list in the “toVIControl” session.


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


OK, the 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:
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:

osc1.jpg


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

For additional information, please check the https://openstagecontrol.ammd.net/docs/getting-started/introduction/ (official documentation.)


In the MIDI field, we tell Open Stage Control to use our virtual MIDI freshly created with rtpMIDI. The command looks like that:


MIDIPORTNAME:INPUTPORT,OUTPUTPORT


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


toVIControl:INPUTPORT,OUTPUTPORT


TIPS: You can add as many MIDI Virtual devices as you want. Just add a space between each of them.

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.

Then click on the 3 vertical dots located at the top left of Open Stage Control window. Then click on List MIDI Devices.


Some information should appear in the console like below:


osc2.jpg osc3.jpg


Perfect! Input port 49, output port 19. We can complete the command line:

toVIControl:49,19

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


We can now start Open Stage Control by pressing the Play icon. A new window should appear as shown below.



overall.jpg

Congrats! Open Stage Control is now launched on SC. Now we can spend countless amounts of time 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).
The IP should be shown in the same window used to display the MIDI Devices list.


(INFO) Server started, app available at
xxx.xxx.xxx.xxx:8080
127.0.0.1:8080



Step 4: a GUI to rule them all

Welcome to Open Stage Control. Now, I have to tell you that you will spend a lot of time on this editor view... Because there are so many things to do! If you are new to that kind of tool, consider grabbing a beer along with a bucket of ice. It will take time to build a complete template, you have been warned!

Before I let you go do some experiments, there is one last thing you should know. To send a MIDI message correctly, you have to tell your widget where to send the data, and how. It means that setting properly the first button and make it fully functional is primordial in order to duplicate it afterward to save time.



Let’s create a regular button. Right-click on the grid > Add widget > Basics > Button.

Click on the button freshly created. In the right panel “Inspector”, you should see fields spread across multiple categories. Scroll down to the "Button" and “OSC” ones and open them.

In this example, we will configure the button to send a MIDI note: (from official documentation)

- Button
  • on: 100 (1 to 127, define the velocity of the note)
  • off: 0 (note Off)
- osc
  • address: /note
  • preArgs: [1, 60] (for MIDI channel 1, and note 60 / C3)
  • target: midi:deviceName (deviceName being one of the declared MIDI devices defined during the Step 2, so in this tutorial: toVIControl)

You should have something like this:

oscPanel.jpg

Remember: you have to fill the target field with midi:toVIControl on every widget you create!


Decimals will round numbers. Higher the number, the higher the number of digits after the decimal place.
Note that numbers are rounded anyway by OSC when converted to MIDI.


If you did follow everything correctly, you should have a MIDI input signal received on the MC when pressing the button.

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

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:
I don’t think I’ll need this in my workflow any time soon but that is a great post! Thank you!
 
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 ;)
 
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:
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

  • Python_Script_Error_OSC.JPG
    Python_Script_Error_OSC.JPG
    148.8 KB · Views: 78
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 ;)
 
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
 
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:

IEUUFuJ.jpg


(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:
Yes, in order to use O-S-C, this is needed files for Windows : <

You should have this installed:

LZ9NL4F.jpg


(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 :/
 
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
 
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.
 
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.
 
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.
 
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 https://192.168.1.215:8080/browser/scripts.js:414:1449 (no stacktrace available)

No worries if you don't!
 
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:
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:
Top Bottom