25 Feb Gig Performer as an OSC controller
You don’t have to use Gig Performer just for music!
Although Gig Performer’s primary purpose is as a plugin host for live performing musicians, due to its sophisticated OSC implementation and proprietary programming language, Gig Performer can also be used as an OSC controller.
Widgets and OSC
Every widget (knobs, sliders, buttons, etc) can both respond to incoming OSC messages as well as send them out. For example, if I create a knob with the caption MyKnob and an OSC handle knob1, then turning that knob will send out OSC messages with the name of the knob and its current value.
Similarly, if an OSC message (e.g., /knob1/SetValue 0.5) is sent into Gig Performer, the widget will respond by setting its position at 5 on the dial (OSC values go from 0.0 to 1.0 with 0.5 representing a position half way)
But that’s only a small piece of the story.
GPScript (don’t let the name fool you) is actually a proprietary compiler whose language is modeled after Pascal (to some extent) recognizing that that language was designed to make it easier for beginners to learn some programming skills. GPScript comes with a lot of functionality to support Gig Performer but for now we will concentrate on its OSC features.
Sending out OSC messages
GPScript has a collection of functions for constructing arbitrary OSC messages and it’s easy to wrap these inside functions to facilitate their use.
Here is an example that just sends out a value.
We have already seen an example where you can send a widget’s intrinsic value (between 0.0 and 1.0) as an OSC message but suppose your external system needs values between 0 and 100.
This is easily handled by GPScript by having it respond to widget values, scaling those values and then sending the results out as OSC messages. Let’s see an example.
There are several interesting aspects to this example
- We declare a variable with the same name as the OSC handle we defined earlier (first green arrow)
- We can now refer to that variable directly without the need to do any low level binding operations (second green arrow)
- We declare a callback (red arrow) that will be called automatically when the widget is moved.
It should be clear from the above that it is very easy to send out any kind of OSC message from Gig Performer. Incidentally, there is an extended version of the underlying OSC send mechanism that allows you to specify explicit IP addresses and ports if you don’t want to use the defaults defined by Gig Performer.
Responding to OSC messages
GPScript makes it easy to respond to incoming OSC messages as well. Consider the following:
Here, instead of a callback that responds to a widget, we have a callback that responds when a message is received whose address matches /MultiplyByTwo followed by a floating point value. When such a message is received, using a new OSC address, we send back the value multiple by 2
Although you would normally be using a third party application, I used a command line program called oscchief to generate a suitable message.
Here, we are sending the value 12.5 as a floating point message into Gig Performer. The callback responds and sends the answer back.
This was a very simple example but it is sufficient to demonstrate how GPScript along with widgets could be used to build a very sophisticated OSC control application inside Gig Performer.