grain window (cycle~ phase); duplicate with 180deg offset?

brendan mccloskey's icon
Max Patch
Copy patch and select New From Clipboard in Max.

I'm driving a [play~] object with a [phasor~]; this signal is also going to [cycle~] phase input (via *0.5, +0.75), to give me a nice grain ampl envelope. Now i'd like to duplicate this window, 180deg out of phase with the first - despite staring at the patch for hours, the obviously simple solution eludes me:

thanks
Brendan

Tim Lloyd's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Here's how I do it for multiple synch-ed overlaps. It ends up with the same result as using Eric Lyon's [phasor.shift~] external but it's nice to know how it works.

brendan mccloskey's icon

Thanks Tim; I had an idea that [delay~] might be involved, but knew it would add additional control elements (delaytime = period/2)

brendan mccloskey's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Tim
once more I must seek assistance; I implemented your advice into a simple grain/looper engine, and, if you look at the patch below; the delayed/shifted envelope is causing clicks. Do I need a separate sah-phasor-play setup?
Thanks in advance

Psyko Logical's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Here's another way:

Roman Thilenius's icon

delay~ or tapout~ is one solution, using math (e.g +~ 0.5, %~ 1.0) is another.

Psyko Logical's icon
Max Patch
Copy patch and select New From Clipboard in Max.

And here's one with 4 windows, just to show how easily it can be expanded.

brendan mccloskey's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Here's a demo patch, showing clearly how one window avoids clicks, and the 180deg-shifted window causes clicks. I'm guessing that i may need to separate phasor~ engines for each window.
Thanks in advance
Brendan

Tim Lloyd's icon

Firstly I think Psyko Logical's method is better than mine, I try and stay away from delays for time-critical stuff, even though there is not reason why it would go out of sync.

In your patch if you want 2 overlapping grains, you need to have 2 instances of [play~ liveBuf], each driven by its own signal and with its own grain window (that is synched with the corresponding playback signal). Like you say, you need separate phasor~ engines for each grain.

Max Patch
Copy patch and select New From Clipboard in Max.

I've just rebuilt your patch a bit differently to remove all clicking:

volker böhm's icon
Max Patch
Copy patch and select New From Clipboard in Max.

here is yet another one. maybe slightly easier on cpu than pong~.

Psyko Logical's icon

Heh, I never thought of manually subtracting to do a modulo. That's pretty cool.

brendan mccloskey's icon

These solutions are all equally elegant and concise; however, the question remains, in my last posted patch above, do I need a duplicate sah-phasor-play combination, as the shifted window is allowing/causing clicks, unlike the unshifted window which is not causing clicks. The solutions have highlighted an underlying flaw in my otherwise elegant granulator.

brendan mccloskey's icon

Doh!
I missed Tim's interjection (above Volker's); so please ignore the post above - thanks everyone, esp Tim

Brendan