Forums > MaxMSP

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

July 7, 2010 | 2:19 pm

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:

– Pasted Max Patch, click to expand. –

thanks
Brendan


July 7, 2010 | 2:36 pm

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.

– Pasted Max Patch, click to expand. –

July 7, 2010 | 2:58 pm

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


July 7, 2010 | 3:32 pm

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

– Pasted Max Patch, click to expand. –

July 7, 2010 | 3:59 pm

Here’s another way:

– Pasted Max Patch, click to expand. –

July 7, 2010 | 3:59 pm

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


July 7, 2010 | 4:04 pm

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

– Pasted Max Patch, click to expand. –

July 7, 2010 | 5:28 pm

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

– Pasted Max Patch, click to expand. –

July 7, 2010 | 5:39 pm

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.

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

– Pasted Max Patch, click to expand. –

July 7, 2010 | 5:56 pm

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

– Pasted Max Patch, click to expand. –

July 7, 2010 | 7:04 pm

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


July 7, 2010 | 7:38 pm

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.


July 7, 2010 | 8:36 pm

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

Brendan


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