Forums > MaxMSP

Sending Audio over OSC

September 7, 2010 | 10:51 pm

Hi I would like to send audio to another application(Touch Designer) with OSC. I’m wondering if anybody has any ideas how to go about doing this. If I were to use the snapshot~ object I’ll lose samples so I’m hoping that someone might have a better way.

thanks
Keith



EMV
September 8, 2010 | 12:45 pm

I am not entirely sure, but I don’t think this will work. OSC is designed for control rate data, audio is much faster.
I highly doubt any OSC-capable program or device will be happy with throughput of 44.1 kHz or higher.


September 8, 2010 | 7:35 pm

It’s possible but tricky. If course, you wouldn’t want to send every single sample individually, but instead a vector consisting of a large number of samples (512 is a good number) which the receiver would write to a buffer (from which the audio signal would be read). There are some considerations regarding the protocols to be used: udp is faster, but imposes some limits what the packet size is concerned; and packets may get lost on the network. Tcp is safer, and accommodated larger packets, but it’s also slower since a confirmation is sent back to the sender that the packet was received. Another aspect is that if you were to send a vector via OSC, you’d probably try to avoid converting the signal vector into a Max control message. Jit.net.send in conjunction with jit.poke~ will allow you to send vectors via the network without the vector ever hitting the control world. Maybe this could be the answer to your problem?


September 10, 2010 | 2:44 am

Thanks for the replies guys. I also thought using Jitter might work to sample audio, but I’ve tried sending actual video over Jit.net.send to Touch before with no luck so I’m not sure how to recieve it. I was on the touch forum and one of the developers gave me a tip on how to send audio over OSC between to different Touch Designer apps but I’m not sure how to implement it Max. Maybe someone here might have an idea. Here is the tip below;

You should be able to send audio streams from other applications to TouchDesigner using OSC and its bundles format.

This is cut/pasted from another forum post from one of our developers, and we can expand on it further if you are interested in audio streans into/out of TouchDesiger:

"You should find you can send 16 @ 16khz channels between two Touch’s on the network easily.
We also tried 6 channels @ 48khz.

One thing to keep in mind, is that we now have an option to send multiple samples per message at once. (Format: Timeslice)

example:

bundle 1: timestamp (/_samplerate ,f 16000) (/x ,ffff 1 2 3 4) (/y ,ffff 1 2 3 4)
bundle 2: timestamp (/_samplerate ,f 16000) (/x ,ffff 5 6 7 8) (/y ,ffff 5 6 7 8)

The CHOP actually sends up to 90 samples per channel, not the 4 shown above.
This cuts down dramatically on the data pushed through compared to one sample at a time.
"

If anyone can help I would totally appreciate it.

Thanks
Keith


September 23, 2013 | 6:12 am

It would be really handy if you could send audio through OSC in standardized ways(to any application with OSC support). If anybody from OSC(I don’t know if it’s exclusively CNMAT or also somebody else) developers reading this, I would humbly ask you to think about implementation of it.
MIDI standart, which the OSC should be replacement of, is capable to send audio at least in non-realtime, so why OSC shouldn’t have any audio features?


September 23, 2013 | 7:44 am

that "nonrealtime" is what makes the little difference.


September 23, 2013 | 7:54 am

sending audio through midi ???!! where did you see that ?? i’m really curious !
Sending audio through osc for now seems like a hack… osc not beeing designed for audio etc. Maybe a better route to look at would be NetJack, thouh i’m not sure it’s fully functionnal yet… Though native, standard audio through osc would indeed be rad ! though i guess would need a lot of work to redefine it…


September 23, 2013 | 11:33 am

Are you sending audio between two applications on one computer? I’m assuming Windows, since you mentioned TouchDesigner.

Jack is probably your best bet:

http://jackaudio.org/download

On OSX, I’d look at Soundflower:

https://code.google.com/p/soundflower/

For network on OSX or Linux, jack.trip:

https://ccrma.stanford.edu/groups/soundwire/software/jacktrip/


September 24, 2013 | 5:04 pm

>sending audio through midi ???!! where did you see that ?? i’m really curious !

sysex file transfers, like in old-timey samplers, I’m guessing. Shit, I would NOT want to revisit those "glory days". Nuh-uh.


September 24, 2013 | 5:26 pm

most old samplers did that, akai, ensoniq, roland, peavy …

took some time, but was a nice free alternative to using SCSI connections or built-in harddrives.


September 24, 2013 | 6:18 pm

oh… i might have underestimated the "non realtime" here :D especially since, in those days and ages, you could do AMAZING things with a 2 second audio sample at a weird sample rate like 11 kHz and weird bit depth like 8 bits…


September 24, 2013 | 7:35 pm

absolutely.

it is a shame what i am able to do with gigasampler, maxmsp and nuendo today compared to what i was doing with my first 12 bit sampler with some 30 seconds of total sampling time.


September 24, 2013 | 8:13 pm

Maybe tells a bit more about ourselves and how we behave in regard to technology than we would like, eh ?


September 25, 2013 | 9:09 am

What do you mean, Vichug?

I’ve done midi sample transfers, first on an AKAI s950, then s1000, IIRC, then a yamaha a5000. Each time a very unpleasant experience – and not in the "enhances my creativity" kind of way, in a "oh my GOD I’m about to stab a fool, why’s this taking so long?!? " kinda way.

Copying over on floppies was much more pleasant.


September 25, 2013 | 2:57 pm

(that i don’t get used to better technology as much/fast as i would, and it doesn’t automatically imply the progresses i wish it would. i say "we" but…)


September 25, 2013 | 4:47 pm

@wetterberg: if you send the files via midi to an editor, you could edit the sample on your atari or mac, then send it back to your akai.


September 26, 2013 | 1:02 am

The feature is called "MIDI Sample Dump" and was developed in 1985 as an addition to the Detailed MIDI Specification 1.0. It was transmitted using System Exclusive messages and yes, it took forever because of MIDI’s astonishing 31250 bps baud rate! The funny thing is that there was an addendum to this standard to update the sample limit from 2 MB to 32 GB… I can’t imagine the time it would take…

But I agree that we really get spoiled nowadays! With so much more technological resources and knowledge at our disposal, we sometimes are able to accomplish less than in the past…


Viewing 17 posts - 1 through 17 (of 17 total)