Two-way communication between Kyma and Max using OSC
This section describes how to send OSC messages bi-directionally between Kyma and Max. For sending MIDI-over-OSC between Kyma and Max, please see Andy Capon's Max external.
To establish two way communications, EITHER Max has to tell Bonjour which port it is receiving messages on using the oscbonjour external from IRCAM. OR, you can have Max send Kyma a /osc/respond_to message.
For example, Max could send the following message once:
/osc/respond_to 8000
to let Kyma know to send OSC responses and update messages to port 8000. Max would receive the following message back on port 8000:
/osc/response_from 57088
This means that Max is receiving on its port 8000. And the Pacarana is saying that it received a message from Max on port 57088. So Max is receiving on 8000 and sending on 57088.
Asking Kyma to send updates to a VCS widget to Max
Kyma will automatically send OSC updates to Max of any VCS widgets for which the Paca(rana) has received OSC messages.
To send values generated in Kyma to Max, use a SoundToGlobalController with a generated event in the form of an OSC message.
For example if the Value of the SoundToGlobalController were 0.25 and the GeneratedEvent were
!osc_fader_1
then Kyma would be sending out the OSC message:
/fader/1 0.25
To establish two-communication, have Max send that OSC message with a floating point value, for example:
/fader/1 0.125
once to Kyma. Once Kyma knows which port Max is sending and receiving on (see above) and has received the fader message once, it will send changes back to Max in the future.
For diagnostics or just to see what's going on, try this sequence:
Download the sources or binaries for some tools from CNMAT (Look in the OSC Resources section for the links).
Create and play a SoundToGlobalController with GeneratedEvent of !osc_test and Value of !x.
In Terminal, run CNMAT's dumposc utility to monitor OSC messages: dumposc 9000
In another Terminal window, run CNMAT's sendosc utility to send OSC messages (replace the 2 with the serial number of your Pacarana): sendosc -h beslime-2.local 8000
In the sendosc window, enter: /osc/respond_to 9000
In the dumposc window, you should see: /osc/response_from 54485
In the sendosc window, enter: /test 0.1
In Kyma, you should see the !osc_test fader move.
In Kyma, drag the !x fader
You should see messages indicating new value of !osc_test, for example: /test 0.180000
OSCfromKyma.txt: A Max 5 patch by Phil Curtis that allows Max to receive OSC messages from the Pacarana, which optionally uses oscbonjour (IRCAM object) to avoid having to hard-code the IP address in the udpsend object. Also requires OSC-route (CNMAT object). Both third-party objects can be found linked from maxobjects.com. There's a small bug in the patch that seems to require you to click twice on the large button to connect instead of just once. To use the linked Max patch, just copy the text and then select "New from Clipboard" in Max5's File window.
Here's a screenshot of Phil's Max5 patch (useful for PD and Max4 users, who won't be able to open the Max5 version):