fbpx

Gig Performer as an OSC controller

Feb 25, 2020 | Gig Performer Blog, Tips

In this article, we will show you how to use Gig Performer as an OSC controller

Gig Performer is an audio plugin host for live performance and session musicians. But you don’t have to use Gig Performer just for music!

We know that Gig Performer’s primary purpose is to be a plugin host (AU, VST3, VST host) for live performing musicians. However, due to its sophisticated OSC implementation and proprietary programming language, GPScript, 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.

Gig Performer Widget Sends OSC messages

Similarly, if you send an OSC message (e.g., /knob1/SetValue 0.5) 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.

Introducing GPScript

.
GPScript (don’t let the name fool you) is actually a proprietary compiler whose language is modeled after Pascal (to some extent). We recognized 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.

GPScript musician programming language send OSC message

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 let’s suppose your external system needs values between 0 and 100.

You can easily handle this by GPScript. You can have it respond to widget values, scale those values, and then sending the results out as OSC messages. Let’s see an example.

Gig Performer Script Editor Send OSC message

There are several interesting aspects to this example

  1. We declare a variable with the same name as the OSC handle we defined earlier (first green arrow)
  2. We can now refer to that variable directly without the need to do any low level binding operations (second green arrow)
  3. We declare a callback (red arrow) that will be called automatically when we move the widget.

.
It should be clear from the above that it is very easy to send out any kind of OSC message from Gig Performer. Suppose you don’t want to use the defaults defined by Gig Performer. In that case, there is an extended version of the underlying OSC send mechanism that allows you to specify explicit IP addresses and ports.

Responding to OSC messages

.
GPScript makes it easy to respond to incoming OSC messages as well. Consider the following:

GPScript responding to OSC messages

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

I used a command line program called oscchief to generate a suitable message. (Although you would normally use a third-party application)

Application OSChief generates OSC messages

Here, we are sending the value 12.5 as a floating point message into Gig Performer. The callback responds and sends the answer back.

Gig-Performer-GPScript-Callback-Responds

Conclusion

.
This was a very simple example that uses widgets, OSC, and GPScript. However, it is sufficient to demonstrate how you can use Gig Performer to build a very sophisticated OSC control application.

.

Related topics:
OSC Broadcast Mode
OSC messages in Gig Performer User Manual
How to control your guitar or keyboard effects from a Web browser
Use your mobile phone to control your guitar or keyboard effects