Envelope Sustain with curve~ ?

Dec 24, 2007 at 9:29am

Envelope Sustain with curve~ ?

Could anyone help me implent Sustain in this ADSR?
I cant seem to figure it out..

max v2;
#N vpatcher 15 55 615 455;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P comment 506 100 38 9109513 curve;
#N comlet Curve;
#P inlet 517 120 15 0;
#P newex 282 152 149 9109513 pack 1 1 0. 0 0 0.;
#P newex 282 214 128 9109513 curve~;
#N comlet Velocity;
#P inlet 219 72 15 0;
#P comment 440 99 38 9109513 release;
#P comment 341 80 34 9109513 sustain;
#P comment 381 101 34 9109513 decay;
#P comment 301 101 32 9109513 attack;
#N comlet Bang;
#P inlet 282 121 15 0;
#N comlet ADSR Out;
#P outlet 162 305 15 0;
#N comlet Release;
#P inlet 449 123 15 0;
#N comlet Decay;
#P inlet 390 120 15 0;
#N comlet Sustain;
#P inlet 349 103 15 0;
#N comlet Attack;
#P inlet 309 120 15 0;
#N comlet Int;
#P inlet 180 73 15 0;
#N comlet Select 0;
#P inlet 84 111 15 0;
#P comment 217 48 38 9109513 velocity;
#P newex 163 268 27 9109513 *~;
#P newex 180 99 79 9109513 scale 0 127 0. 1.;
#P newex 84 155 49 9109513 pack 0 0.;
#P connect 4 0 0 0;
#P fasten 9 0 0 1 454 190 60 190 60 138 128 138;
#P connect 2 0 10 0;
#P fasten 17 0 2 0 287 250 168 250;
#P connect 5 0 1 0;
#P connect 1 0 2 1;
#P connect 16 0 1 3;
#P connect 11 0 18 0;
#P connect 18 0 17 0;
#P fasten 0 0 17 0 89 201 287 201;
#P connect 6 0 18 1;
#P fasten 19 0 18 2 522 145 341 145;
#P lcolor 3;
#P connect 8 0 18 4;
#P fasten 19 0 18 5 522 145 422 145;
#P lcolor 3;
#P pop;

#35106
Dec 24, 2007 at 9:57am

here is one i use for Fc of a low pass filter
but you can modify it for amplitude

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#N vpatcher 599 197 1024 576;
#P origin -52 -73;
#P window setfont “Sans Serif” 9.;
#P newex 130 136 22 196617 b 1;
#P newex 121 293 45 196617 loadbang;
#P message 121 320 23 196617 0.5;
#P newex 66 289 40 196617 curve~;
#N comlet fc harmony;
#P inlet 25 139 15 0;
#P newex 2 165 33 196617 * 0.5;
#P newex 2 75 40 196617 t f f b;
#P message 231 225 35 196617 set $1;
#P newex 83 139 45 196617 * 0.001;
#P flonum 2 193 63 9 20. 10000. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 130 165 27 196617 * 1.;
#P flonum 66 193 63 9 20. 10000. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 66 165 27 196617 * 1.;
#P newex 2 49 29 196617 mtof;
#N comlet filt env;
#P outlet 66 319 15 0;
#N comlet noteoff;
#P inlet 265 193 15 0;
#N comlet noteon;
#P inlet 2 23 15 0;
#P newex 63 97 45 196617 delay 10;
#P message 130 193 35 196617 set $1;
#P newex 130 249 61 196617 pack 0. 100;
#P newex 265 249 58 196617 pack 0. 500;
#P newex 66 249 61 196617 pack 0. 100;
#N comlet amt;
#P inlet 83 117 15 0;
#P newex 117 23 85 196617 receive 1attack1;
#P newex 181 193 83 196617 receive 1decay1;
#P newex 147 94 72 196617 receive 1sus1;
#P newex 313 193 90 196617 receive 1release1;
#P connect 10 0 13 0;
#P connect 13 0 20 0;
#P connect 20 1 21 0;
#P connect 21 0 17 0;
#P connect 22 0 21 1;
#P connect 20 2 9 0;
#P connect 20 0 14 0;
#P connect 14 0 15 0;
#P connect 15 0 5 0;
#P connect 6 0 23 0;
#P connect 7 0 23 0;
#P connect 5 0 23 0;
#P connect 23 0 12 0;
#P connect 4 0 18 0;
#P connect 18 0 14 1;
#P connect 24 0 23 2;
#P connect 3 0 9 1;
#P connect 3 0 5 1;
#P connect 25 0 24 0;
#P connect 1 0 26 0;
#P fasten 15 0 16 0 71 214 109 214 109 159 135 159;
#P connect 26 0 16 0;
#P connect 16 0 8 0;
#P connect 8 0 7 0;
#P connect 9 0 7 0;
#P connect 1 0 16 1;
#P connect 2 0 7 1;
#P connect 17 0 19 0;
#P connect 11 0 6 0;
#P connect 19 0 6 0;
#P connect 0 0 6 1;
#P pop;
#P newobj 662 312 61 196617 p env;
#P window clipboard copytext “p env” #E;
#P window clipboard copycount 1;

#119273
Dec 24, 2007 at 10:24am

Thanks, but i cant get the sustain to work in my setup, it just makes the sound to “drone”. Like an endless Release, wich probly is caused by me using only note-on’s in my setup.
(wich is something im forced to do because my midi-key is sending out strange note-off’s, that i have to filter out)

So any tips on how to actually implent the Sustain in my own setup would be appreciated!

#119274
Dec 24, 2007 at 11:08am

Ok, nevermind. I changed my midi-in setup, and got it all to work properly.

#119275

You must be logged in to reply to this topic.