Sending Audio between M4L devices
Hello guys,
maybe my question seems silly, i am pretty new to Max/MSP and still kind of confused about it.
what i am going to do is creating some kind of routing mechanism. I want to put a M4L device in one audio track and connect the signal to a send˜ module (i named it "A").
Then i create another audio track with one more M4L device having a receive˜ module named "A" to receive the signal from the first audio track.
For some reason it does not work. But actually it should, or am i wrong?
As i could not find the Max' function to export a patcher as plain ascii, i just took a screenshot of my simple example devices.
i found these sentences in the reference and manuals:
"The "name space" in Max is global - when you have objects that have names associated with them such as coll, send, receive, table, or buffer~ , you can share data between Max for Live devices. In these cases, the Max name space is shared, but the "signal processing space" is independent - each Max for Live device processes its audio or data separately."
sounds to me, that my structure is supposed to work.
or this sentence: "Signals can be received from any loaded patcher without patch cords"
what am i doing wrong?
Copying and pasting the ASCII version of patches is easier than you think... just select the objects that you want to copy, and then go to the Edit menu and select "Copy Compressed". Then paste it into your browser.
While I know that you can write and read global buffers (you can see an example of this in monomlake's granulator input device), I'm not sure if you can arbitrarily route audio between M4L devices. That would require sample-accurate communication between threads ... but I just hit the limit of my knowledge there so hopefully someone else can elaborate.
"The use of the send~ and receive~ objects to pass audio between Max for Live devices is not supported."
Quote from the documentation
you can try plugsend~ and plugreceive~ but there's a bunch of latency.
Thx for your answers! Very very helpful! I was thinking about plugsend, too, until i foud this text in the reference:
"...The use of the plugsend~ and plugreceive~ objects to pass audio between Max for Live devices is not supported..."
So i am going for a buffer based solution. Something like recording Samples in a buffer at index N in the first device. And reading samples at index N-1 in the other device.
I guess I will need the modules "index~" and "poke~".
Or does anybody already know, that i won't have success?
I did it with buffers now and it really does work! Well, it's still a little glitchy, but i hope you guys know the trick ;)
It's still two devices, each in a different track. The first writes the sample input into a global buffer (i use poke˜ and a counter). The second device reads out samples (here i use index˜ and a counter) from the buffer - with a little delay to prevent glitches - and routes them to it's output.
I don't know what the problem is. I read out the samples with 15 ms delay and it's still glitchy. Is written data messed up? or is the reading mechanism creating a messed up output signal?
Copying and pasting the ASCII version of patches is easier than you think... just select the objects that you want to copy, and then go to the Edit menu and select "Copy Compressed". Then paste it into your browser.
thx man ;)
Device A - Buffer Recorder
Device B - Buffer Player
Maybe try it in a single patch, get it working, then separate it into two patches and see if you get similar results? I definitely get glitches when approaching low delays like that....even in the same patch.
For start/stop synchronization you may better use [plugsync~] since live.observer is not accurate in general.
Note that plugsync~ also provides sample count information which could be useful.
Thx again for your ideas. I made a "in-one-device"-solution. It works perfect.
thx for the hint about plugsync˜! very helpful! I even tried to use the sample counter for indexing the buffer samples. but for some reason that didn't work as i expected.
i will try to split it up again. maybe it's going to work better with the new synchro stuff.
if some one is interested in the "in-one-device"-solution which is actually a circular buffer now.
Thx for all your hints! these experiments cleared up alot in my brain!
But finally i went a completly differnt way. it's much much easier and way more stable. I just abused the sends of the tracks and created a patch that will pull down the fader and turn up a given send (post fader), when a button is pressed. No glitches, no noises, just working, midi controlable routing.
here is the final result.
Hey, replying here from the future because this somehow comes up in the first page of google results. This thread was last active in 2011, and since then m4l has been updated with this functionality. Check out this article: https://cycling74.com/articles/audio-routings-a-new-system-for-multi-channel-routing-in-ableton-live