Forums > MaxMSP

AHD?

February 26, 2007 | 4:43 pm

Is there a AHD (Attack Hold Decay) object around for me to study?
Or can anyone hint me a way to create such a thing?

My own guess would be to edit the adsr~’s Release, am i way off?


February 26, 2007 | 5:08 pm

Have a look at the graphical breakpoint function. You can set nodes to
hold.

On 2/26/07 11:43 AM, "steffensen" wrote:

>
> Is there a AHD (Attack Hold Decay) object around for me to study?
> Or can anyone hint me a way to create such a thing?
>
> My own guess would be to edit the adsr~’s Release, am i way off?

Cheers
Gary Lee Nelson
Oberlin College
http://www.timara.oberlin.edu/GaryLeeNelson


March 2, 2007 | 2:29 pm

Is there any way i can apply this behaviour to a curve~?
As this is what i use for ADSR at the moment.

I really only want a simple Attack, Decay and Hold.


March 2, 2007 | 2:44 pm

The help file for curve~ shows how it might be used as envelope. Check it out.

j.


March 2, 2007 | 2:52 pm

I have/am, but i guess i will continue to scratch my head then, thanks. :)


March 2, 2007 | 2:54 pm

What is it you are finding hard to grasp? – maybe i can help.


March 2, 2007 | 3:33 pm

Thing is, im using curve~ so i can slide between Log and Exp, as the adsr~ isnt able to do this as far as i know?
Using adsr~ i am able to do this ADH thing however, thanks to the help file as u adviced me to check out.

On the other hand, adsr~ might be all i need as Main Amp Env.
Im using curve~ for mod env’s however, and i dont necessarily need Hold on them.

I think ill leave this for now, and focus on the more essential problems in the patch as of now. Thanks for making me check out adsr~ again, i missed some options there before.


March 2, 2007 | 4:28 pm

not quite sure how at this point, but u could try to turn adsr’s output into exp / log curve rather than linear…

j


March 2, 2007 | 5:49 pm

thanks, will try that.
adsr~ seems to be a better solution than using curve~ it seems, even if i have to transform the outcoming signals afterwards to exp/log.


March 2, 2007 | 6:05 pm

Here is a solution. In the patch below I have an AHD envelope tied to the volume of a simple monophonic synth.

The parameters for curve look like this
["destination value" "rise time" "exponent"]

So an AHD has three of these sets of parementers packed into a message. The first one "1. 250. 0." says "rise to 1. in 250 ms with a linear curve". The "1. 500. 0" says "stay at 1. for 500 ms". This would be the hold portion of the envelope. The exponent doesnt matter since the value stays the same, but put it in there so curve doesn’t get confused. The last three numbers (0. 250 0.) say "go to 0. in 250 ms with a linear curve.

Hope this helps!

max v2;
#N vpatcher 100 100 700 500;
#P button 243 52 15 0;
#P window setfont "Sans Serif" 9.;
#P hidden newex 547 48 82 196617 unpack 250 500;
#P hidden newex 547 22 48 196617 loadbang;
#P user ezdac~ 64 562 108 595 0;
#P user gain~ 64 408 24 100 158 0 1.071519 7.94321 10.;
#P newex 64 373 27 196617 *~;
#P newex 128 175 27 196617 t b i;
#P newex 128 334 27 196617 *~;
#P user scope~ 374 321 504 451 256 3 128 -1. 1. 0 0. 0 0. 102 255 51 135 135 135 0;
#P newex 64 235 31 196617 mtof;
#P newex 64 281 61 196617 cycle~ 500;
#P newex 145 201 90 196617 scale 0 127 0. 1.;
#P newex 106 151 32 196617 sel 0;
#P comment 422 93 13 196617 d;
#P comment 353 93 13 196617 h;
#P flonum 422 104 35 9 0. 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 353 105 35 9 0. 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 284 105 35 9 0. 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 491 106 35 9 -1. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 261 232 196 196617 pack 1. 250. 0. 1. 500. 0. 0. 250. 0.;
#P newex 261 263 42 196617 curve~;
#P newex 64 108 94 196617 notein;
#P comment 284 93 13 196617 a;
#P comment 490 94 36 196617 curve;
#P comment 255 76 71 196617 AHD Envelope;
#P user panel 254 85 289 212;
#X brgb 205 215 224;
#X frgb 0 0 0;
#X border 0;
#X rounded 0;
#X shadow 0;
#X done;
#P comment 98 89 89 196617 monophonic synth;
#P user panel 49 98 192 303;
#X brgb 205 215 224;
#X frgb 0 0 0;
#X border 0;
#X rounded 0;
#X shadow 0;
#X done;
#P comment 264 52 96 196617 < -- click to trigger;
#P connect 7 0 19 0;
#P connect 19 0 18 0;
#P connect 18 0 23 0;
#P connect 23 0 24 0;
#P connect 24 0 25 0;
#P fasten 21 0 23 1 133 362 86 362;
#P fasten 24 0 25 1 69 546 103 546;
#P connect 7 1 16 0;
#P connect 16 1 22 0;
#P lcolor 7;
#P fasten 8 0 21 0 266 307 133 307;
#P fasten 22 1 17 0 150 196 150 196;
#P connect 17 0 21 1;
#P fasten 22 0 9 0 133 195 266 195;
#P lcolor 7;
#P fasten 28 0 9 0 248 228 266 228;
#P lcolor 15;
#P connect 9 0 8 0;
#P hidden fasten 27 0 11 0 552 75 289 75;
#P connect 11 0 9 1;
#P fasten 10 0 9 2 496 151 312 151;
#P lcolor 13;
#P hidden fasten 27 1 12 0 624 75 358 75;
#P connect 12 0 9 4;
#P fasten 8 0 20 0 266 300 379 300;
#P fasten 10 0 9 5 496 151 381 151;
#P lcolor 13;
#P hidden fasten 27 0 13 0 552 84 427 84;
#P connect 13 0 9 7;
#P fasten 10 0 9 8 496 151 450 151;
#P lcolor 13;
#P hidden connect 26 0 27 0;
#P pop;


March 2, 2007 | 6:29 pm

Yeah!
This really solved it all, and by looking at it, it totally makes sense. I almost feel like hitting myself hard.
Thanks a million man! :)


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