Granular at audio-rate

Dave Mollen's icon

I've been trying to change the grain duration at audio-rate, but can't figure out how to do it.
I walk through the grains with a phasor and I want to be able to change the speed of the phasor only at the end/start of a cycle.

In the patch below you can see what I've tried so far.
Now I know this won't work, because it's a feedback loop.
But I don't want to have the delay of one vector size either.

I've also tried to use two phasors, firing one after the other has finished a cycle,
but I can't figure out how to do this right as well.

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

Any help?

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

i am no expert. i muddle along with all this stuff and get reasonable results. you need to introduce the secret MSP 1 vector delay:

you should search this forum as there are many excellent patch examples of exactly this sort of thing, going back many years. basically, sah~ is your friend, small use of vector delay is your friend, and you will be interested in the awesome volker bohm external [vb.phasor0~] and the andrew benson signal externals, especially [wait~].

good luck.

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

p.s. - you only want 1 phasor~ for EVERYTHING. use the rate~ object lots to split up your syncs and timings. also, forgot to mention:

best

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

oops! that first exaample should have been audio rate send/receives of course!

Dave Mollen's icon

Thanks for the advice.
But all your examples use a delay of 1 signal vector.
Maybe this isn't that bad.
But actually I'd rather have my patch to be absolutely sample-accurate.

So I wondered if there was any other way to do this.
Maybe some construction which doesn't involve feedback.
Then you wouldn't need the vector delay.

brendan mccloskey's icon

I wouldn't call myself a digital-audio/DSP guru, but I've been researching this exact topic for several months and all the above comments and recommendations hold true in my own implementation of a granulator in Max.

There are numerous threads here, going back several years recommending different approaches and the 'central' [phasor~] to [play~] plus [sah~] algorithm works best (for me);

+1 for vbphasor~; it does exactly what is expected - I just built my own though, for more specific control.

This related thread may take you someplace helpful...
https://cycling74.com/forums/help-with-an-exercise-about-filters

Brendan

Dave Mollen's icon

Hey,

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

But this actually doesn't work.
I've tried both the tapin~ tapout~ and the send~ receive~.

brendan mccloskey's icon

Hi

now it works:

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

Later this weekend I will be posting a detailed video description of one approach to audio rate granulation, on my blog if you wish to see it:

Best
Brendan

Dave Mollen's icon

Thanks.
I'll use this then for now.
I'll check out your video, maybe it'll help me with some other difficulties.

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

oops, sorry: