It never occurred to me that I could use signal logic to test values of an audio signal. So simple! But I also like the idea of using the same loop playing Phasor~ to run another windowing function in sync with it.
Thanks very much, all three of you who replied.
So I suppose my only remaining question is:
With a variety of methods to achieve the same goal (eg. using Line~ vs Phasor~ to drive sample playback; or the two methods suggested for solving my problem above), is there a most CPU-efficient way to build such a sampler?
I'm been using PD on and off for about a year now, slowly improving. I wrote a sample player/looper, which works. However, I didn't build in any 'windowing' to avoid clicks when playback loops.
Basically, it works by: 1) loading a sample into an array, 2) doing some calculations based on the sample's length and my loop start/length values, playback speed, etc, and 3) plugging that data into a Phasor~ that reads the array.
So I thought, I just need to insert a Line~ after the Phasor~ to ramp up and down the output each time the sample plays, but I don't know how to tell PD exactly when to trigger those ramps. Can PD rapidly and efficiently 'monitor' Phasor~'s audio data output, that I could then use for the triggers?
Maybe somebody can tell me what the best way to go about this sampler is - I mean, is there a more efficient way to do it? And do you have a solution for my windowing issue that would fit into my patch as it stands?