Sending a pointer via OSC


Is it possible to convert a pointer e.g. to float[] and send this via OSC? I would imagine this might be by converting the float* to a string, but how would one then convert a string back to a float pointer?

In case it helps, I’m interested in sending a large array from Max/MSP to openFrameworks.

Any help appreciated.


you cannot send a pointer over OSC.

how many floats do you have? if it’s not too many, your best bet will be to loop over your array and build up your osc message by repeatedly calling addFloatArg…


I’m interested in sending information from a Fourier transform. So either I could pre-process or else I was considering sending an array of e.g. 512, 1024, 2048 elements. Is there a limit to that?

Why do you want to do it outside of?
fftSmoothed() (look at the fft-example) should do the job, without having to have two programs running + network
Otherwise you can still send all your 512 floats but it’s pretty heavy to do :confused:

Thanks for pointing that out - that’s very good that example!

I’m using Max/MSP - I’ve coded an FFT routine as part of my own Max object by using the FFTW library. However, with Max it’s hard to visualise what’s happening and so I’m using openFrameworks for that. I’ve been sending 512 values by OSC which are the frequencies I’m interested in. It’s been working surprisingly well. The combination of the two is a great way to code real-time and to visualise what’s going on - and creatively there’s the possibility of using oF for visuals that are run off of audio data generated by Max.

So the pointer idea was just wishful thinking that the two programs could pass pointers to the same object.

Great if that worked out for you :)!

For the pointers, the pointers are addresses within a program, you cannot exchange data from a program to another by giving memory addresses, only things you can do is via direct communication such as OSC or by files/databases

By the way, Kyle has already made an FFTW addon for OF, so you could actually incorporate that in OF too and reduce the latency…±kiss-fft-wrapper/2184/10