Achieving a gaussian amplitude envelope

dthomas86's icon

hello everyone,
I am currently trying to brainstorm at the moment of achieving a Gaussian bell shaped curve going from 0-1 used as a grain envelope. Would the easiest way to achieve such a thing, by using trapezoid expr fed into it? If this makes sense?
I also remember in Max tutorial 17 the average of three numbers will generate a bell shaped curve similar to Gaussian.

brendan mccloskey's icon

As I am hopeless at Math(s), I rely on [curve~] for my curvaceous windows....
Brendan

AlexHarker's icon

I would write a grain shape to a buffer using uzi and expr ( you could read it using cycle~ / play~ / or wave~)

The maths you need is here:

Of course, the y value never hits 0 completely, so depending on how much of the curve you use, it may be necessary to add some short fades either side.

A.

pid's icon

yes. but these days i am lazy and i just use/modify the brilliant waaa~ library from graham wakefield. it is simply better than me! also, taking the envelope functions apart taught me how to use jit.expr.

dthomas86's icon

thank you guys very helpful stuff here will look into it :)

Steven Miller's icon

Have a look at the 'window maker' link here; might be helpful

Luke Hall's icon

Here's a small patch that I've used before for making envelopes. Otherwise Steven's link above is really useful!

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

lh

dthomas86's icon

cheers everyone, I think the expr and curve are the better methods to use. Also would using a pfft with fftin with an associated gaussian shaped buffer as its argument?