Musings

drk’s Electronic Music Blog

Control a Capybara (and other MIDI devices) using OSC


Symbolic Sound’s previous generation sound engine, the Capybara, was born in the era before Open Sound Control (OSC) was widely used. It lacks networking facilities, and relies on MIDI for external control. Its FireWire interface, the Flame, is used by Kyma itself to convey control information but that path is proprietary and not available to users.

Does this mean that it is impossible to use OSC with the Capybara? Yes, but there is a work around: converting OSC messages to MIDI messages. The basic idea is to use a software application to translate the incoming OSC messages into MIDI messages that the Capybara can digest. Tools like Max, Osculator, SuperCollider , and Delora Software’s KymaConnect and CapyLink are well suited for this purpose.

KymaConnect and CapyLink? Yes. Hidden inside both is a simple translator that transforms a family of OSC messages into MIDI continuous control messages (MIDI CC). Those MIDI messages are then sent to the MIDI port assigned to the Capybara. It's a uni-directional conversion so it is not possible to use this method to send OSC messages from the Capybara. Still for many uses, this one way OSC conversion is adequate.

This facility is not to be confused with MIDI-over-OSC. MIDI-over-OSC is part of Symbolic Sound’s Paca and Pacarana native OSC implementation. It uses the special OSC MIDI data type (defined in the OSC specification) to transmit MIDI. MIDI-over-OSC is an important part of KymaConnect and CapyLink, and can be used as a general-purpose method for sending bi-directional MIDI. KymaConnect and CapyLink both make it possible to use this same MIDI-over-OSC with a Capybara.

MIDI-over-OSC can send any MIDI message, including advanced MIDI commands like MTC, MIDI CLK, and SYSEX. Think of MIDI-over-OSC as a pair of virtual MIDI cables that connect an OSC client application with a Kyma sound engine. Alas MIDI-over-OSC is a more complex OSC command than the ones you typically encounter. Furthermore bidirectional support requires additional OSC set up commands. Few OSC applications "speak" MIDI-over-OSC.

So MIDI-over-OSC is probably not the right solution for many common OSC tasks. Which brings us back to KymaConnect's and CapyLink's hidden OSC translator.

So why is this feature included in those two applications, and why is it not documented? The scheme was created so that one of the features of Delora Software’s vKi iOS app (vKi was the first iOS app available for controlling a Kyma workstation), could be transparently used with either a Pacarana or Capybara. vKi has Learn Faders that supplement vKi’s VCS auto mapped buttons, faders, and rotaries. The Learn Faders extend the number of hands-on controls, and are designed to work well with both Kyma's VCS’ Learn feature, or by embedding OSC commands in a Kyma sound. They are OSC messages so a solution was needed so they could be used with Capybaras. So it was time to teach the Capybara a little OSC. Who says that you cannot teach an old dog, or in this case a Capybara, new tricks!

CapyLink already handled the MIDI-over-OSC chores. This was augmented with a simple OSC to MIDI translator. The same scheme was later included in KymaConnect as part of its “CapyLink Proxy”.

The messages are “plain vanilla OSC” so they can be readily used by most OSC clients. Messages look like this:

/delora/fader/n/ch, f

where “n” is the control number, “ch” is the desired MIDI channel, and “f” is a float value in the range 0.0 to 1.0.

The channel parameter (ch) takes values from 1 to 16 and corresponds directly to MIDI channel numbers. The continuous control number (n) takes values from 1 to 128. These match MIDI CC00 - CC127. Note that the value of n is one greater than the CC number. When KymaConnect or CapyLink receive one of these messages, a corresponding MIDI CC message is made and sent to the Capybara MIDI port.

This is all fine and good but what if you do not have a Capybara? Why would you care?

If you use KymaConnect then you have probably disabled its CapyLink feature. But suppose that you need to get an OSC message to one of your external MIDI devices? This simple OSC command construct can send any MIDI CC message on any MIDI channel. You can use this to control a hardware synthesizer, modular gear (through a MIDI to CV converter), and even software applications, provided you assign an IAC MIDI device to the Capybara port. You could, of course, opt for Max or OSculator. But for simple conversion tasks this does the job, and it's already available from KymaConnect or CapyLink. And for many applications that is all you need.