OSC connection: Max for Live, Pure Data, etc.

Open Sound Control (OSC) is a protocol for sending messages between music programs, on the same computer or over a network. With the output format Real-time OSC (Max, Pd…), the Bol Processor sends each note as an OSC message, at the time it should be played, to any program that listens to them. This program decides what to do with the notes: play them with its own synthesisers, control lights or video, display them…

Compared with real-time MIDI, OSC messages carry more information:

  • the frequency of each note in Hertz, including the tuning of microtonal scales, in addition to its MIDI key;
  • the name of the instrument and the values of its parameters by name, such as vol, pan, mod or an additional parameter like splash;
  • the duration of the note, known when it starts;
  • a number identifying each note, so that its end can be matched with its beginning even when the same key is played twice.

To play in SuperCollider, the output format Real-time SuperCollider, which needs no programming, is described on this page.

Settings in the Bol Processor

  1. On the page of the grammar or data project, select the output format Real-time OSC (Max, Pd…) and click SAVE.
  2. Click Show/hide settings below the format. Messages go to the host 127.0.0.1 (this computer) on UDP port 7400 by default. To reach a program on another computer, or listening to another port, type its address and port, then click SAVE. This destination is saved for this computer and used by all projects.
  3. Start the receiving program, listening to this port, then click PRODUCE ITEM(S) or PLAY.

The Bol Processor starts no other program and gets no answer: if nothing listens to the port, the messages are lost without any error message.

Instrument names

Names and parameters of the instruments come from the resource file of the project: its SuperCollider resource file (-sc) if it names one, otherwise its Csound resource file (-cs). The Change instruments button of the project page chooses this file, and Show/hide details lists the instruments and their parameters. Without a resource file, instrument n (_ins(n)) is named bpn, and notes have no additional parameters.

The messages

MessageMeaning
/bp/startA performance begins.
/bp/note id instrument name key freq duration velocity channel [name value]...A note begins.
/bp/off id instrument name key channelThe note id ends (not sent for notes of duration 0).
/bp/stopSTOP, PAUSE or PANIC was clicked: silence all notes.
/bp/endThe performance is over.

Arguments of /bp/note:

  • id (integer): number of the note, repeated in its /bp/off;
  • instrument (integer) and name (string): number and name of the instrument (_ins());
  • key (integer): MIDI key, 0 to 127;
  • freq (float): pitch in Hertz, including the tuning of the scale (_scale());
  • duration (float): in seconds; 0 for out-time notes such as <<C4>>, which can be used as signals;
  • velocity (float): MIDI velocity, 0 to 127;
  • channel (integer): MIDI channel, 1 to 16 (_chan());
  • then pairs of a name and a value, depending on the instrument: vol/vol2 (volume at the beginning and end of the note, 0 to 127), vel (attack velocity), pan/pan2 (panoramic, 64 = centre), mod/mod2 (modulation, 0 to 16383), press/press2 (pressure), bend/bend2 (pitchbend in cents), and the additional parameters of the instrument, e.g. splash/splash2 for _value(splash,250).

For example, the data C4 _ins(6) D4 with the default Csound instruments (-cs.0-default) sends:

/bp/start
/bp/note 1 1 "piano" 60 261.626 1.0 64.0 1 "vol" 90.0 "vol2" 90.0 "vel" 64.0 "pan" 64.0 "pan2" 64.0 "mod" 0.0 "mod2" 0.0 "bend" 0.0 "bend2" 0.0
/bp/off 1 1 "piano" 60 1
/bp/note 2 6 "flute" 62 293.665 1.0 64.0 1 "vol" 90.0 "vol2" 90.0 "vel" 64.0 "pan" 64.0 "pan2" 64.0 "mod" 0.0 "mod2" 0.0 "bend" 0.0 "bend2" 0.0
/bp/off 2 6 "flute" 62 1
/bp/end

Each message is sent at the date of its event, not in advance, so the receiving program simply acts on messages as they arrive. The full description is in the file ReadMe.txt of the folder osc_resources of the Bol Processor installation, also linked below the output format.

Programs receiving OSC

Many programs understand OSC. The folder osc_resources contains ready-made receivers for some of them. The others need a few lines of code or a patch, which the examples below can serve as a starting point for.

Max

Max (Cycling '74) receives the messages with [udpreceive 7400] followed by [route /bp/note /bp/off /bp/stop]. The patch BP_OSC_receiver.maxpat prints the messages and plays each note with a sine wave, one note at a time. For polyphony, send /bp/note to the voices of a [poly~], using id to find the voice of each /bp/off.

Ableton Live (Max for Live)

The device BP_OSC_to_Live.amxd plays the notes on the instrument of a Live track, filtered by channel or instrument, and sends vol, pan and mod as MIDI controllers. Its installation and use are described on the page about Ableton Live.

Pure Data

Pd (Pure Data), free and open source, receives them with [netreceive -u -b 7400] → [oscparse] → [list trim] → [route bp] → [route note off stop]. The patch BP_OSC_receiver.pd does the same as the Max patch. For polyphony, use [clone].

SuperCollider's language

Besides the output format Real-time SuperCollider, which plays SynthDefs directly on the server, the language of SuperCollider (sclang) can receive the OSC messages and do anything with them, for instance trigger patterns or change the parameters of running synths. A minimal example, to run in the SuperCollider IDE after booting the server:

(
thisProcess.openUDPPort(7400);
OSCdef(\bp_note, { |msg|
	// msg = [/bp/note, id, instrument, name, key, freq, duration, velocity, channel, name, value...]
	(instrument: \default, freq: msg[5], sustain: msg[6].max(0.05), amp: msg[7] / 127 * 0.3).play;
}, '/bp/note', recvPort: 7400);
)

Sonic Pi

Sonic Pi listens to OSC on port 4560 once Allow incoming OSC is checked in its preferences. Set the port 4560 in the Bol Processor, then run:

live_loop :bp do
  use_real_time
  id, ins, name, key, freq, dur, vel, chan = sync "/osc*/bp/note"
  synth :piano, note: hz_to_midi(freq), sustain: dur, amp: vel / 127.0
end

Other programs

  • Csound, with the opcodes OSCinit and OSClisten, for a Csound instrument controlled by another program at the same time. For Csound alone, the output format Real-time Csound is simpler.
  • ChucK, with the class OscIn.
  • VCV Rack, a virtual modular synthesiser, with modules converting OSC into control voltages (e.g. cvOSCcv of trowaSoft).
  • TouchDesigner, with the OSC In operators, and other visual programs such as Vuo or Isadora, for images and video following the music.
  • Processing (library oscP5), openFrameworks (ofxOsc), Python (python-osc), JavaScript (osc.js): programming environments for interactive works.
  • Chataigne and OSCulator (MacOS), which convert OSC into MIDI, DMX lighting and other protocols without programming.

To check what the Bol Processor sends, this Python script (with pip install python-osc) prints every message received on port 7400:

from pythonosc.dispatcher import Dispatcher
from pythonosc.osc_server import BlockingOSCUDPServer

def show(address, *args):
    print(address, args)

dispatcher = Dispatcher()
dispatcher.map("/bp/*", show)
BlockingOSCUDPServer(("127.0.0.1", 7400), dispatcher).serve_forever()

Interaction

The Bol Processor can wait for MIDI events during the performance, for instance _script(wait for C3 channel 1) (see interactions). In real-time OSC, the MIDI ports of the project page are used for this interaction only: select a MIDI input and save the MIDI ports. The receiving program can then send MIDI to the Bol Processor, through a virtual MIDI bus, to start or synchronise the music.

If nothing is received

  • Check that the port set in the Bol Processor (Show/hide settings) is the one the program listens to. Only one program can listen to a port.
  • Start the receiving program first: messages sent while nothing listens are lost.
  • On the same computer, use the host 127.0.0.1. Towards another computer, a firewall may block UDP messages.
  • Run the Python script above to see whether the messages arrive and what they contain.

👉 The receivers supplied in osc_resources and the examples on this page have not been tested with every program listed.

Note: This page was entirely composed by Claude Opus 5.5 on 21 November 2026.

Leave a Reply

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

« Translate