0

I need to set up a (bidirectional) communication channel between a C# application and a Max for Live Patch (Max 6).

One can run JavaScript inside a Max patch (pretty lightweight) and I thought about using named pipes inside JS for sending data out to a C# server. However I have no clue how to set them up in the Max environment because things like ActiveXObject cannot be used.

Is this possible to achieve or do I have to write a Max Extension in C as a proxy?

(Or should I rather go with a network connection?) Any hints welcome!

Regards, Moritz

mvo
  • 1,138
  • 10
  • 18

1 Answers1

0

I admit that I don't have much experience with named pipes, but regardless I would recommend setting up a network connection.

Most Max users that need to communicate with other applications use the native UDP objects udpsend and udpreceive along with the OSC protocol developed at CNMAT. I prefer TCP / Json myself, and have been frustrated by the lack of native TCP support in Max. Depending upon the needs of your application, it could be very important to know when clients disconnect, to ensure that packets arrive in the proper order, etc--features UDP does not provide.

For this reason, I have started developing a native TCP client for Max using Unix sockets. Since you are using Windows, this won't work for you out of the box, but the basic building blocks could still be useful. If you want to add winsock support, that could be a great benefit to the Max community.