First time here? Check out the FAQ!

Sending Kyma's IP address over OSC to Max

+1 vote
Hello, I'm working on the implementation of the monome device directly in Kyma. I use Max as bridge application. The OSC communication works already well and I can control monome instantly from Kyma because monome has a fixed IP and OSC listening port. I also get the /ocs/respond_from message from Kyma, but it gives me only the OSC port which is already known in Max. And since Kyma changes its IP on every power-up, I need to copy it and paste it in Max application to get the connection back to Kyma.

So here the question:

how can I send Kyma's IP Address to Max automatically, and maybe without using bonjour service?

Many thanks in advance !
asked Jan 28 in Controllers, OSC & MIDI by roman-weingardt (Practitioner) (730 points)
edited Jan 28 by roman-weingardt
Hi Roman, doesn't the Mac also change its IP address on each power-up as well?  By using Bonjour, we can find the Mac and the Pacarana IP addresses.  Otherwise, how can the Pacarana know where to send its OSC messages?

It seems that there may be a Max external that can be used to get IP addresses from Bonjour:

It refers to source code for the Max external, but the link is old. Here is the updated link:
Hello ssc, thank you for the quick reply!
My Mac has also changed its IP address until I made it fix. So Pacarana knows where to send the messages to.
I'll try the Bonjour-solution as well, thank you for the Tip !

1 Answer

+3 votes
Best answer

While the most flexible way to automatically set the Pacarana's OSC IP address is through a Bonjour lookup, there is another way to do this automatically without manually entering an IP address each time the Pacarana powers on. This can be done using Max's built-in udp_send object. This works because the Pacarana convienently publishes is "host name".

Max's udp_send object accepts a host argument as either an IP address, or as a host name. udp_send will use the OS's DNS name resolution services to determine the actual IP address corresponding to the host. This happens automatically.

Pacas and Pacaranas have host names that look like this: "beslime-NNN.local" where NNN is the id number/serial number of the Pacarana. Here's an example Pacarana host name: "beslime-105.local"

For the general case this only works if the OSC service you are trying to reach is running on a host that has also registered its name with the network's DNS service. It also requires that you know the port where that host offers the OSC service.

The Pacarana avoids the port issue because it is always listening on port 8000. Many OSC services running on computers or other devices may not use a fixed port number. They often use a port that is automatically assigned by the OS. This is why Bonjour is helpful; iit provides is the port number so that connection can be established automatically.

If you wish to use this work around to communicate with KymaConnect (and ultimately the Pacarana through KymaConnect's PacaProxy) you have to known the host name of the Mac where KymaConnect is running. You also must have configured KymaConnect so that it is running with the "Force port to 8000" option enabled.

Here is a sample Max patch demonstrating this technique:

And here is the patcher file EXAMPLE_PATCHER

answered Jan 28 by delora-software (Adept) (1,650 points)
selected Jan 28 by roman-weingardt
Thank you for the very detailed explantation, this is exactly what I was looking for ! I already use udp_send / udp_receive objects in Max, but I didn't know about the possibility to use the host name. This is just great and it works! Now I power up my system and everything gets recognized automatically and runs well. It is also good to know that this work around works as well with KymaConnect. Best Regards, Roman
Hi Roman, in your setup, are you using Max as a bridge when communicating via OSC in performance, or just for the startup procedure to get the IP?