Does anybody have a better method to setting the domain of a function object to the length in milliseconds it takes for a phasor to go from 0. to 1. ? I've been using the timer object but have found for some reason it produces terribly out of synch results.
What I'm trying to do is essentially this...
Run Ableton while sending and recording a track into a buffer~ in a max patch. Then I want to use 2d.wave~ to manipulate this audio and send it back to Ableton.
Syncing Ableton via sync~ has been easy, but the rate of the phasor has always been based on quarter notes. So, I've tried using rate~ to achieve the appropriate time it would take to run through the buffer~. I hope this makes sense.
EXAMPLE: If my buffer length (the length of the audio clip being manipulated) is 2 measures in Ableton, and I choose to slice it into 2 rows with 2d.wave~, then the x-axis phasor~ should be synced to the length of 4 beats from sync~ (assuming I'm in 4/4 time) This will ensure that I am always playing back the sample at it's original pitch. Even up until this it's still worked fairly well for me.
HERE is the part that's driving me insane. I would like the domain of a function object to be the length of the sample divided by how many rows I select. AND it needs to be triggered at the START of the measures in Ableton. Then I feed the function into a curve~ and feed that to drive the y-axis of 2d.wave~...
So far I've been using timer to get the length of a phasor~ and sending that to function, but it's always off time. Even getting it to trigger at the beginning of a measure is tricky. Is there anyway to sync function to phasor~ in the MSP side of MAX?
here is a stripped down version of my patch that includes the basics of how I want 2d.wave~ to work. The stuff in the red is the failed part of my patch. It's on red because that is the color I see in my head when trying to make this work.
THANKS, SOMEBODY SAVE ME.