Controlling Reaktor from Opusmodus Using OSC

Written by on March 20, 2019 in LISP, Music, Programming with 0 Comments

I am a great fan of Opusmodus software. I have written many articles about it in the past. Owing to my several other commitments, I am not able to spend much time on it these days, but I keep checking the features in new releases regularly. The software has evolved substantially since its first release a few years ago.

One of the nice feature additions in the latest 1.3 release is support for Open Sound Control (OSC). This is something I have been waiting for a long time, so I decided to check it out immediately.

In an earlier article, I showed how it is possible to configure Reaktor as a OSC receiver. For that example, I used Chuck programming language to send OSC commands to Reaktor. Today, I want to reconstruct the same Reaktor experiment, but using Opusmodus, instead of Chuck, to send OSC messages.

Make sure you are running the latest release of Opusmodus. As of this writing, the latest version is 1.3.24692.

First, we launch Reaktor 6, and create a new Sine oscillator with Pitch and Amplitude controllers. The output can be connected to the default output channels. See the following figure:

A Simple Sine Oscillator

A Simple Sine Oscillator

Next, we should configure the Pitch and Amplitude controllers to receive OSC messages. Whatever name we use here must be the same as the one we use in Opusmodus. We choose the name “pitch” for the Pitch controller and “ampl” for the Amplitude controller.

Setting Up OSC Address

Setting Up OSC Address

Now that Reaktor has been setup, we can run Opusmodus and send OSC messages. Here is a very short code fragment that illustrates the idea:

Sending OSC Messages

Sending OSC Messages

The actual function that transmits the messages is “osc-thread”. The first argument to the function is the destination address: IP address and Port number. The second argument is the OSC address of the receiving controller (make sure the name matches that in Reaktor). The last argument is the actual data to be transmitted to the recipient. It is a series of <value> and <time> pairs.

The “osc-thread” function returns a Thread object. We save this in a variable so that we can stop the thread if needed. The created thread runs independent of other threads. In our case, we have created two threads to take care of Pitch and Amplitude controls in Reaktor.

In this example, I have hardcoded the data values to be sent to Reaktor. In practice, this data is likely to be generated algorithmically elsewhere. Opusmodus has a rich set of functions to do this. Here is another code fragment that uses “gen-osc-data” to get the data in the required format before sending to the target:

Using "gen-osc-data" Function

Using “gen-osc-data” Function

You can see the data being received by Reaktor:

Monitoring OSC Messages

Monitoring OSC Messages

That is it. Quite straightforward, isn’t it? What I have demonstrated in this example is an extremely simplified situation. It is possible to setup more complex ensembles in Reaktor and control them from Opusmodus using OSC. But the idea is the same. If time permits, I will discuss more interesting examples in the future.

I would like to thank Janusz Podrazik, the creator of Opusmodus, for developing such a nice environment for music composition, and more importantly for his great support!

Have a nice day!

Tags: , ,


If you enjoyed this article, subscribe now to receive more just like it.

Subscribe via RSS Feed

Leave a Reply

Your email address will not be published. Required fields are marked *