Gig Performer as an OSC controller

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.

Knob sending OSC messages

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.

Introducing GPScript

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.

Screenshot 1245

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.

Screenshot 1246

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 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:

Screenshot 1247

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.

Screenshot 1248

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

Screenshot 1249

Conclusion

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.

No Comments

Sorry, the comment form is closed at this time.