Description

Hello, my name is Clive Alcock and this is my personal take on a wide variety of live sound topics.

Wednesday, July 12, 2023

Control of Digico desks with OSC

Part 3A – Using TouchOSC

Part 3 of a three part series about practical ways to use OSC to remotely control Digico desks. I don’t pretend to be an OSC expert but the information and solutions included in this series have been tested and work well.

Here in Part 3 we pay attention to the specific software package TouchOSC. It is a sophisticated program with the ability to program multiple commands and actions on each GUI object. It is much more complicated than most similar programs and demands some commitment to get useable results. We’ll discuss all this in significant detail and give examples that you can use as templates or starting off points for your own projects. If you are not familiar with the use of OSC, especially with Digico desks, then I recommend you read through Parts 1 & 2 of this series, they will help you get up to speed and prepare you for this more complex process.

 This turned out to be a rather long article so I divided it into two parts, 3A and 3B.

 _____________________________________________________________

Download TouchOSC from here.

https://hexler.net/products       Win / Mac / Linux / IPad / IOS / Android

I strongly recommend downloading the accompanying utility, Protokol, at the same time if you have not already done so. See Part 2 of this series for more information about it.

Note that TouchOSC is free to try (with nag screens) but currently costs USD$ 30.00 for a licensed copy. This is really inexpensive for such a powerful piece of software and I strongly recommend purchase.

What is TouchOSC and what does it do.

Touch OSC combines a quick and flexible interface for building control screens with typical controls. Each control and each screen (page in TouchOSC jargon) has extensive property fields that are key to making controls work the way you wish.

In addition there is a scripting language that can extend the scope of each control’s abilities. The scripts are writtten using a subset of the LUA programming language.

If you have some experience with Javascript or Python scripting then you will find the LUA scripts reasonably easy to navigate.

TouchOSC Resources

One major challenge of TouchOSC is documentation. The developer supplies basic definitions of each function and a very few examples of scripts. Unfortunately none of this tells you how to use the program, it only gives the definitions of objects.

There are lots of YouTube clips that discuss very specific applications none of which are very relevant to our use case here and still do not really explain how to use the software.

This article will point you to more general use of the software so you can build controls for many different end applications including controlling AV gear, DAW’s and other devices.

At the end of this article I will list some of the more useful clips and resources to help you develop your own projects.

Installation

Installation packages are available for Windows, Mac and Linux, just follow the standard installation process for your flavour of Operating System. Note that the desktop packages include both the editor and run-time versions of the software. The tablet and phone versions are run-time only clients and require a project built using an editor. All the examples in this article use the Windows editor edition of TouchOSC.

Before we Start

  • If you have not already done so I strongly recommend that you review Parts 1 and 2 of this series of articles. There is a lot of useful information about how OSC works and how to setup Digico desks for remote control by OSC.

  • I also recommend that you follow along this article by running a copy of Protokol set to read any OSC commands that you issue while you are building control panels. Later on you may wish to setup a seperate computer on the same subnet as your control computer and run a copy of the Digico off-line editor to see what your commands do in real time.

Building Controls

Once you have installed the software start it up and you will land on the main editor page that looks like this.

At the top is a conventional menu bar, below that is a panel with graduated edge lines and a dotted work area which is hard to see. “Untitled” is the file name for this new file. All TouchOSC files have the extension *.tosc and these are the working versions of your projects.

On the right hand side is a properties page with multiple sub pages that are reached using the drop down arrows.

Let’s build a simple control

Right click (Windows) or CMD click (MAC) on the graduated panel to bring up a window of options which include boxes, buttons, sliders, rotaries, radars and many other types of controls. In this example we have added a button, changed it’s size and moved it over to be close to the properties panel.


 You can change the control size and shape by dragging the edge highlighted buttons around and move the control on the page by clicking and dragging the body of the control. Let’s take a look at the properties page beside the button. Several object properties have automatically dropped down to display those that are unique to this control.

 

 Document Tree lists the pages in this project file and allows navigation between them. On our “Untitled” page we have one object that was automatically named "button1". You can rename this if you wish in the control properties.

The physical properties for the button are defined under the Button drop down and includes type which can be Momentary, Toggle Release or Toggle Press. Momentary is used for one shot actions e.g. recalling a macro. Toggle is used for boolean actions e.g. Mute On / Mute Off. The press/release properties give you options for the exact manner in which the button works. There are a lot more properties for this button object and these are listed in the Control drop down.

Control Properties

Here is enabled a detailed properties list for the control including name, exact size, colour, outline behaviour and orientation. 

The bottom section of this panel adds Values, Messages and any Script that you wish to use as an action for this control. We’ll discuss scripting at the end of this article in part 3B. 

Value x refers to the return value of the control when it is operated e.g. for a boolean button it will return a 1 or a 0. For a fader control it will return a float value within any range that you may specify. Clicking the “x” drop down gives more properties that you may assign to that control including a default value.

We are getting deep into the weeds here. The best thing to do is to experiment with colours, styling and orientation just to have a handle on how to size, shape and shade your custom controls. Much more important right now is the next properties drop down “Messages”.

Messages

On  the Messages drop down is a little “+” sign gives you a message type to add to the control. The types are MIDI, LOCAL, OSC and Gamepad. Midi and OSC are obvious, Local refers to the ability to change the properties of the local control when operated. Gamepad is for pad controllers with two or more value properties. The “x” on the side of the message type tab is to delete the message.

 We are going to investigate OSC and LOCAL properties.

 You can see that on the Address line there are a couple of things already added, the “/” and “name” are added automatically, I added the “constant” because we are going to build an OSC command that is a fixed message. The automatically added messages are actually very confusing because they refer to a different style of using OSC that works for certain kinds of page addressed devices. We don’t need to use it for our purposes.

So we are going to edit the Constant field and add an OSC command that will recall Digico Macro 1. Here is how this will look on the properties page.

 If you compare this with the previous picture you will see that I did the following

  • Deleted the automatically added messages
  • Double clicked and edited the text on the right of the Constant field and inserted our OSC command.

The control is now ready to run. You need to save your work first (as always) and then enter run mode by going to the top menu bar and pressing the Play button. This will clear the screen of all properties and leave a button ready to operate. The momentary button will illuminate every time you press it and go to background colour each time you release. To exit the run mode click on the small dot in the top right corner of the panel.

The macro command will not go anywhere at this point because we have not set up any of our client connection details, so let’s do that next.

 Setting up Connections 

Go to the top menu bar and click the connections icon here circled in red.This brings up the Connections page.


On this menu I selected OSC from the left panel and clicked Connection 1 to add the OSC address information for my remote computer. On a local subnet you can use UDP or TCP and if you are just running Protokol on your local computer you can use your local host address of 127.0.0.1 for connection.

Either way you need to specify send and receive ports. The communications panel allows selections for up to 5 distinct physical devices and multiple sessions can be run on each device using different ports. I find that the Digico off-line editor is not happy being run on the local computer at the same time as the OSC control software, probably because of port conflicts.

To start we’ll setup Protokol on our local machine to listen on port 8001. Then we’ll setup our communications on Device 1 for UDP with the local host IP address of 127.0.0.1

Now we set TouchOSC to Play mode and click our momentary button. Here’s what we see on Protokol.




The screen shows Enabled on Port 8001 and a receive message with our macro command of type Float.

More Control Properties

Now we are going to look at the LOCAL properties of the button control. First we’ll head back to our editor page and we are going to change our button from a MOMENTARY to a type TOGGLE PRESS. This is accessed by the Button properties page.

button1 is the object we are changing and under the Button properties drop down we have changed the action from Momentary to Toggle Press. The value of the button changes when you press the button, it can also be set to operate when you release the button. Note that Press and Release can be seperately enabled.

Now we can assign two different operations to this button, one when pressed and another when released. This is programmed in the Messages section which refer to rise (toggle on) and fall (toggle off) to represent the two states of the button.

Assigning OSC Commands to a Toggle Button

We will now proceed to program two different commands to our Toggle button. We are going to assign two Macro commands which could be anything that is controllable by macros on a Digico desk. A great example would be changing the mute status of a control group on and off

Look carefully at the OSC command properties, it looks  the same as for the momentary button example above except for one important detail. The top OSC command is set to trigger when the Toggle is pressed, on the Rise. The second OSC command will trigger when the toggle is pressed again, on the Fall. Rise and Fall refer to the boolean status of the toggle (on/off or 1/0). If we check with Protokol we can see each command being issued alternately each time we press the button. The Float number is the boolean value of the button state.

Results of pressing the Toggle button twice.

 LOCAL Properties

The Toggle button has a standard condition of being highlighted or not highlighted to show its on or off status but all in the same colour. Of course it would be much more pleasing visually if we could have completely different button colours indicating the status of the toggle. We can do this by setting up local properties for this control.

 

We have setup the toggle button to have two different colours triggered each time the button is pressed by assigning two different Local properties. The Rise trigger condition has a source hex colour code assigned as a constant. (Do a browser search for hex colour codes to get lists and charts of what codes represent what colours).

On the Source property line is a drop down that allows you to select a constant, you then paste the hex value into the adjacent empty box.

Next we select our target by clicking the dropper symbol and dragging it over our control. It will then paste “button1” into that selection box. You can write "button1" in there as well.

Click the drop down in the adjacent Target box and select Property/color.

Lastly go to the Conversion property line which might have FLOAT automatically selected, use the drop down to change this to STRING as in this example.

Now add a second LOCAL property set that gives the alternate colour when the toggle is released.

How it looks

Let’s take a look at the condition of our toggle and what Protokol reports to us.

When our toggle is in the on condition it is coloured red and has issued a command to recall Macro 1.

In the off condition it is coloured green (and unhighlighted) and has issued a command to recall Macro 2.

Overall we have now built a button that issues two different OSC commands and changes colour depending on what it’s status is.

There are many other options for target properties of the button including outline, shape, orientation, name and tagging. There are also many possibilities of Source properties that can change the condition of the control. None of these are very obvious and it takes quite a lot of experimentation to get controls to behave the way that you want.

If you have hung in this long and been dutifully following along you will have probably realised that TouchOSC is an extremely flexible and powerful way to build OSC control interfaces. It’s also complex, opaque and not well documented. However if you are prepared to commit some time and thought to it you can develop very useful control pages.

Next we are going to look at faders, how to make them work sensibly, how to scale them and how to use labels to give you feedback on the current value of that fader.

Faders and Labels

We created a new file and used the right click context menu to add two controls, a fader and a label. We changed the colour of each from the default red to a lively yellow! We did that by clicking on the Color property under the Control drop down. I also adjusted the widths of each to be the same and the outlines to Full for both. 

 


Before we do any changes on this new file we should check our Connections on the menu bar and make sure that we are routing our OSC messages to Protokol by using our local host IP address (127.0.0.1), send port 8001 and receive port 9001.

Now select the fader control so it’s highlighted and add an OSC command. In this example we added the Digico OSC command “/Input_Channels/1/fader” which is the control command for fader 1 on a Digico SD desk.

Next we will go to Run mode, click the fader first at the very bottom of it’s range, then at the very top of it’s range and finally somewhere in the centre. Let’s take a look.


The yellow bar represents the current position of the fader but take a careful look at what Protokol is telling us on the right hand side. The low value is a Float(0), the high value is Float(1) and the approximate centre value is Float(0.52*****). This is not much use to us as a fader. A typical desk fader could have a range from -120 to +10 and would be logarithmic in it’s response. A software fader is linear, so how can we make it more useful?

First we need to change it’s range of operation from 0 to1 to something more useable that will still give a reasonably visual representation of a desk fader.

Scaling the fader value

In order to scale the value of the fader to something more useable we have to modify the value argument of the OSC command in order to scale it. We do this by clicking on the x argument to reveal more parameters including scale and conversion type. 


Once we click the x argument we see the additional parameters that be assigned to it. We have changed the scale of the x value to -60 to +6 which is useable for a fader range. 

We leave the Conversion as a Float to give us a smooth fader action.

Local Properties for Faders

On the page example above you will notice that I added one extra item, a label. In TouchOSC a label can be assigned values within defined ranges and so can be used as a visual indicator of what our fader level is on a scale that makes sense for us. 

 

There are some important, not so obvious things to note here.
  • We added the Local property to the fader object, not to the label.
  • We made the label into the target of our local message.
  • We changed the Scale from 0 to 1 to more suit a fader action, here -60 to +6.
  • We changed the conversion from Float (which is automatically inserted by the software) to Integer to reduce the results from 7 decimal place readings to something more readable.

 Now when you check the results on Protokol you will see something like this.


We did exactly the same thing with the fader as in the last example, changing to run mode and clicking low, high and mid positions on the fader.

The difference now is that Protokol reports fader values that can be read by a Digico desk and scales to the majority of the fader range.

Real World Fader Scaling 

An important note here is that in reality the hardware fader probably has a range of -120 to +10. Because our software fader is linear and not logarithmic using that big a scale  would cram our normal range of mixing into a very small area of the fader at the top of it's range.    By limiting the scaling we get much closer to the look and feel of a hardware fader. Generally I think -60db is low enough to be off for all intents and purposes. If you need a true OFF you could build a button to MUTE/UNMUTE that fader.

Radio Buttons

A handy feature of the TouchOSC GUI is the availability of Radio Buttons which are essentially a pre-built button array that is sequentially numbered. Here is an example of a 10 position Radio Button with a label array showing what the action is for each button. These buttons are only useful for a set of alike OSC commands where the value is in the range of the button number sequence e.g. Macro commands that are listed sequentially.


The variable x is added to the macro OSC command instead of a fixed number so that each button number is assigned according to it's position in the button array.

This example was run and the radio buttons for Macros 0, 4 and 9 were each pressed once. Protokol shows the commands that were issued. The number range of the Radio Button control appears to be fixed starting at 0. You can however remove the zero starting point by changing the trigger action of the OSC command to RISE instead of ANY.


Now when you press the Macro 0 button nothing happens but the other Macros 1 – 9 work as normal. As an example you might wish to build a series of mutes that affect sequential channels but Muting Channel 0 doesn’t make any sense. In that case you could label the 0 position with something relevant or not label it at all.

Another nifty thing about these controls is that you can Shift-Click the labels and the control to link them and then group them. So if you need to move this item around your page the object and all the labels move together.

Rotary Controls

Here is an example of a rotary control used to issue OSC commands to control the output level of an auxiliary send, in this case Auxiliary send 1 for Channel 1 on a Digico desk. For the range scale of -60 to +10 the highlighted level setting is approximately 0db.


 --------------------------------------------------------------------------------------------------------------

 Coming up in Part 3B

Pages and page controls

Scripting with examples and explanations

 

Check back soon!

---------------------------------------------------------------------------------------------------------------

No comments:

Post a Comment

Please Feel Free to Comment