Still a noob after 4 years...Help with [expr] etc needed

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

I'm building a simple event-driven granulator with [groove~]; obviously, as [sig~] varies, so too does the size of the loop. Hmmm, if only I could use maths to shrink the loop size as [sig~] speed falls, and vice-versa. Here's a small excerpt of the patch, highlighting the problem:

Thanks

goodparleyandorfing's icon

Use [wave~] instead of [groove~] for this. But I think the [expr] calculation you are asking for is frequency to milliseconds, which is
1000 / $f1.

brendan mccloskey's icon

Hi and thanks for the suggestion.
I'd like to stick with [groove~] if possible; but no matter how i implement the [expr $f2/$f1] function, playback is always relative to sigspeed, ie if sigspeed=0.5, loop length is half of that when sigspeed is 1. This is really frustrating me. Any further suggestions?

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

Like this?

brendan mccloskey's icon

this is perfect, exactly what i need!

goodparleyandorfing's icon

Just to clarify that last posting: when you halve the frequency of [sig~] the loop points remain at the same place in the buffer and the overall loop takes twice as long to complete. That equation up there will make it so the overall loop time remains constant, and the loop points move accordingly.

I think that's what you are asking for?

goodparleyandorfing's icon

oops, posted at the same time.. glad it works!

brendan mccloskey's icon

Many many thanks again; I don't like admitting defeat and resorting to the forum, but I guess that's why it's here.....

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

isn't all that the same as that ? Oo

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

and in your original patch would be simply that...

...or i missed something ?

brendan mccloskey's icon

@vichug
Yes, this does perform the same function; but i had got bogged down in trying to use [expr] cos i thought that's where the answer lay - well spotted, and thanks to both for the solutions - btw: I'm compiling a 'live granulation' tutorial for someone on youtube, to expand on the excellent 'Baz Tutorials', so i'll post a link when its done, tomorrow
Good wishes
Brendan