Add function envelope to Groove

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

At the moment im using trapezoid~ on the loop sync output to add a window but I would like to have more control over the grain shape. Function seems like a good choice but I cant get it to work at all. I multiplied the total loop time by the sync output to get the total domain size of function and used it as I would with any audio source but no sound. Any ideas? I would really appreciate some help.... thus far all my threads have gotten no responses heh not sure what im doing wrong. Is my writing style offensive lol?

Source Audio's icon

You are hearing no sound cause sig~ has to be greater than 0, so use sig~1, or loadbang that 1 above it.
The rest of the patch .... just check the start - end times of a loop

brendan mccloskey's icon

Yeah, that randomiser on the loop start point was causing problems - you weren't setting the loop points correctly. As for envelope shapes, use the loop sync ramp to drive [cos~] or[triangle~] rather than [trapezoid~], and that will give you some control over envelope shape (see below). An alternative would be to use the sync ramp to read from a buffer, which you fill with any shape you like (see the 'functions' and 'generators' tabs inside the help-file for [buffer~].

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

And if you're looking at granulation synthesis, you should stay in the signal domain: [metro 1] and control domain floats, not good :(

Brendan

Christopher Dobrian's icon

I didn't really get what's going on in your patch, but...

If you want to create a window shape (an envelope function) that will synchronize with your sound sample, I suggest putting the envelope function in a buffer~, then using the sync (right) output of groove~ to read through the buffer~ with a wave~ object, like this:

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

brendan mccloskey's icon

Simple, elegant, didactic and precise, as always Christopher

Grumbling Feathers's icon

Wow thanks much appreciated! Brendan why was the randomiser causing problems? I need to randomise grain duration. Is there a way to resize the domain for each randomised grain?

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

Here's the adjusted patch.

brendan mccloskey's icon

Because the loop start point somehow surpassed the loop end point (if I recall correctly), causing silence.

I am also struggling to decipher your patch because I cannot get it to even start; can I suggest that you start a different thread and state what exactly you want to achieve, which bits work and which bits don't.

Source Audio's icon

no wonder the patch won't start or function ...
There are some obvious mistakes in there just like in the original one.
for example - how is one going to record in a buffer~ grainenv which has length of 0 (zero) ?
and so on, and so on
How about learning basics of record, playback, dealing with buffers etc, before
talking about grains, random and similar

Source Audio's icon

I know that learning max is a complex adventure, so sorry if my comments sometimes get a bit out of tune ...
Just a tip - objects with control inputs which accept both float and signals will allways ignore
float messages if signal is also connected to the input.

brendan mccloskey's icon

. . . and beside what source audio has pointed out, I think you might be trying to 'fast forward' your patch/processes. Start with simple, then develop it as your needs develop, and troubleshoot every step you take. This is a very active forum with extremely helpful and sympathetic contributors, but it's very hard to find simple solutions to ostensibly simple problems if an example patch has more than a few errors.

New thread?

Grumbling Feathers's icon

Many thanks for the input its much appreciated. I set myself the task of building this but im realising that I need to read something like microsound to really understand how granular processes work.