Max output to C++

Dec 6, 2007 at 10:26am

Max output to C++

Hi, I’m new to max so please bear with me!

I want to get max to output integers on localhost (or any other way, I’m open to suggestions) and then for C++ to recieve the data for processing. I have been looking into the net.tcp.send object and osc but there is no documentation saying how to use the objects, or any step by step tutorials.

The OSC seemed to be more complicated than the mxj tcp object so I started with tcp object. There is no reference to it in any of the max documentation, however, I found an article on the Cycling 74 website which had a screenshot of the object patch. I basically copied it and ran it, but not surprisingly it printed failure.

Any advice you can give me will be very much appreciated.

Thanks,

Alex

#34909
Dec 6, 2007 at 10:27am

Me again. Just an update on my progress with the tcp.send object.

I have found the little help patch for the object within max but when I ran that it also printed failure. One of the outlet boxes is a number which is the “number of active packets (sent but no response received)”. This number increments as the message is sent through the object. But it always eventually prints failure.

I thought maybe it was my firewall and permissions with localhost but it made no difference when I turned the firewalls off.

Does anyone have experience with this object? Is windows stopping it somehow?

Am I misunderstanding the meaning of the failure aswell? Is it a failure to actually send the message or a failure of the message being transmitted to something?

#118374
Dec 6, 2007 at 11:05am

Hi Alex,

What are you running as a server process? Can you get tcp.send to work
with tcp.receive?


Owen

Alex Matthews wrote:
> Me again. Just an update on my progress with the tcp.send object.
>
> I have found the little help patch for the object within max but when
> I ran that it also printed failure. One of the outlet boxes is a
> number which is the “number of active packets (sent but no response
> received)”. This number increments as the message is sent through the
> object. But it always eventually prints failure.
>
> I thought maybe it was my firewall and permissions with localhost but
> it made no difference when I turned the firewalls off.
>
> Does anyone have experience with this object? Is windows stopping it
> somehow?
>
> Am I misunderstanding the meaning of the failure aswell? Is it a
> failure to actually send the message or a failure of the message
> being transmitted to something?
>
>

#118375
Dec 6, 2007 at 12:08pm

Hi Owen,

Thanks for your quick reply.

I haven’t actually tried the receive object yet. I just wanted to see how the send one worked so I could then create code in C++ to receive the data.

Is the failure notice coming up because I have nothing actually receiving the data? I thought maybe it was due to the patch not being able to send the packet due to a firewall or some internal windows barrier.

I’ll try the send with the receive object and let you know what happens.

Do you know much about the Open Sound Control stuff? Is this easier to use to get max and C++ communicating?

Thanks,

Alex

#118376
Dec 6, 2007 at 7:07pm

Quote: kooshty_@hotmail.com wrote on Thu, 06 December 2007 04:08
—————————————————-
>
> I haven’t actually tried the receive object yet. I just wanted to see how the send one worked so I could then create code in C++ to receive the data.
>

> Is the failure notice coming up because I have nothing actually receiving the data?

The TCP protocol has requires a receiver to acknowledge the data has arrived. With no receiver, you’ll get an error. If you just want to send packets out without checking to see if they got there, look at UDP.

> I’ll try the send with the receive object and let you know what happens.
>
> Do you know much about the Open Sound Control stuff?

OSC is a protocol, but not a transport mechanism. In other words, you send OSC over TCP, UDP, USB, RS232, etc. More here:

http://www.cnmat.berkeley.edu/OpenSoundControl/

mz

#118377
Dec 6, 2007 at 11:17pm

you might want to tryout liblo as an osc interface in your code:

http://liblo.sourceforge.net/

i have successfully passed messages between max and a separate application, using osc and liblo.

#118378
Dec 7, 2007 at 3:12pm

Great! thanks very much guys.

#118379

You must be logged in to reply to this topic.