1. Communicating in OSC with score

In this first tutorial, we will see how to communicate with a simple PureData patch.

Presentation

When you first open score, you will be greeted by the following blank score.

score

At the left is the Device Explorer, which will show the parameters of the software or hardware that you wish to control.
In the center, the actual Score is present, and at the right, an element Inspector is shown. It is currently empty because no element is selected.
At the top, the transport section allows to start playing and stop the score, and we can zoom the main score view.
Multiple options and buttons are present in the top menu; we will leave them for now.

Creation of a PureData patch

First install PureData if you have not, and add the “mrpeach” extension in “Help > Find Externals”.
This patch will listen for OSC messages on the port 9001 and print them on the console :

Minimal PureData patch
Minimal PureData patch

Connecting to the PureData patch from score

Then, we will add a corresponding device to score.
At the bottom of the Device Explorer, there is a blue Plus sign.
Click on it and select “Add device”. Alternatively, you can right-click
on the background of the Device Explorer.

A new window will open, with multiple fields.
If the Protocol field isn’t “OSC”, select “OSC”.

Then, set the device listening port to the Pd patch’s port, here 9001 :

Creating an OSC device
Creating an OSC device

 

Any name can be given instead of OSCDevice; this is useful if you want to connect
to more than one patch.

Then press OK.
A new line appears in the Device Explorer :

OSC device created
OSC device created

This line represents a Device, it is an abstraction over a remote software or a remote hardware
controllable via OSC or any other protocol that score supports.

To communicate with it, we have to add an address to this device.
Right-click on the created Device, and select : “Add child”.
Any name can be given. The allowed characters are integers, letters, dots and parentheses, e.g. “Fr.ui.t(36)”.
For this example we choose the name “aValue”.
In the “Value Type” field, put “Int”.
This means that this address on the remote device expects to receive integer values (1, 2, 3, -5, 8192).
The other fields can be left as they are :

Creating an integer value
Creating an integer value

Upon validation, the tree can now be unfold and has a new node :

The integer value created
The integer value created

Testing

To test the behaviour, you can write numeric values in the “Value” column – for instance 42 –
They are sent to the PureData patch when pressing “Enter”.

The PureData console should then display : “/aValue 42”

One Reply to “1. Communicating in OSC with score”

Comments are closed.