Forums > MaxMSP

Problems with LFO triggering adsr~ inside of poly~

June 23, 2010 | 10:08 pm

I’m sending an LFO to trigger a poly synth patch. If a new note is triggered before the previous is finished, I want the previous note to be allowed to fade out. I am attempting to do this all at signal rate with standard objects. If I have to fix it with externals so be it, but I’d prefer not to.

Here’s what is going wrong. Either one of two things happen:
— All the instances are being triggered at the same time with the same note, and when a new trigger comes it ramps the envelope back up instead of fading out.
— All the instances are busy or muted, causing no output when triggered.

And now the example patches I developed to show how I have things set up. There is also a zip of the files below if that is preferred.

The main patch (cudlfo.pat):

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 432 127 200 196617 this allows the previous note to fade out;
#P comment 432 113 200 196617 each trigger is sent to a separate instance;
#P comment 432 99 200 196617 adsr~ controls envelope of cycle~;
#P window setfont "Sans Serif" 12.;
#P comment 432 65 120 196620 INSIDE OF POLY;
#P window setfont "Sans Serif" 9.;
#P comment 432 85 200 196617 adsr~ triggers sah~ to output pitch;
#P comment 215 99 200 196617 2nd phasor~ (pulse) sends trigger to adsr~;
#P message 423 185 39 196617 open 8;
#P message 300 185 39 196617 open 5;
#P message 382 185 39 196617 open 7;
#P message 341 185 39 196617 open 6;
#P message 259 185 39 196617 open 4;
#P message 136 185 39 196617 open 1;
#P message 218 185 39 196617 open 3;
#P message 177 185 39 196617 open 2;
#P window linecount 2;
#P newex 19 215 69 196617 poly~ cudlfopoly 8;
#P window linecount 1;
#P hidden newex 140 97 47 196617 s ex.init;
#P button 19 29 25 0;
#P hidden newex 19 67 48 196617 loadbang;
#P hidden newex 78 97 49 196617 float 2.9;
#P hidden newex 19 97 43 196617 float 2.;
#P flonum 78 127 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 19 127 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user ezdac~ 19 257 63 290 0;
#P newex 78 185 39 196617 < ~ 0.5;
#P newex 78 155 46 196617 phasor~;
#P newex 19 155 46 196617 phasor~;
#P window setfont "Sans Serif" 12.;
#P comment 45 32 118 196620 initalize example;
#P window setfont "Sans Serif" 14.;
#P comment 215 32 200 196622 what should be happening:;
#P window setfont "Sans Serif" 12.;
#P comment 215 65 120 196620 OUTSIDE OF POLY;
#P window setfont "Sans Serif" 9.;
#P comment 215 85 200 196617 1st phasor~ (ramp) sends value to sah~;
#P hidden connect 13 0 12 0;
#P hidden connect 12 0 10 0;
#P hidden connect 10 0 8 0;
#P connect 8 0 4 0;
#P hidden fasten 23 0 15 0 428 207 24 207;
#P hidden fasten 21 0 15 0 387 207 24 207;
#P hidden fasten 20 0 15 0 346 207 24 207;
#P hidden fasten 22 0 15 0 305 207 24 207;
#P hidden fasten 19 0 15 0 264 207 24 207;
#P hidden fasten 17 0 15 0 223 207 24 207;
#P hidden fasten 16 0 15 0 182 207 24 207;
#P hidden fasten 18 0 15 0 141 207 24 207;
#P connect 4 0 15 0;
#P connect 15 0 7 0;
#P fasten 15 0 7 1 24 250 58 250;
#P hidden fasten 12 0 11 0 24 90 83 90;
#P hidden connect 11 0 9 0;
#P connect 9 0 5 0;
#P connect 5 0 6 0;
#P connect 6 0 15 1;
#P hidden fasten 12 0 14 0 24 90 145 90;
#P window clipboard copycount 30;

The poly patch (cudlfopoly.pat):

#P window setfont "Sans Serif" 9.;
#P user number~ 95 140 134 155 9 3 3 2 0. 0. 0 0. 20 0. 0 0 0 221 221 221 222 222 222 0 0 0;
#P user number~ 13 170 52 185 9 3 3 2 0. 0. 0 0. 20 0. 0 0 0 221 221 221 222 222 222 0 0 0;
#P user number~ 13 230 52 245 9 3 3 2 0. 0. 0 0. 20 0. 0 0 0 221 221 221 222 222 222 0 0 0;
#P user number~ 13 200 52 215 9 3 3 2 0. 0. 0 0. 20 0. 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 277 230 15 0;
#P number 235 230 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 235 200 52 196617 thispoly~;
#P user meter~ 105 290 185 303 50 0 168 0 103 103 103 255 153 0 255 0 0 217 217 0 153 186 0 12 3 3 3 3;
#N out~ 1;
#P newobj 53 290 39 196617 out~ 1;
#N in~ 2;
#P newobj 135 110 33 196617 in~ 2;
#N in~ 1;
#P newobj 53 140 33 196617 in~ 1;
#P newex 53 260 92 196617 *~;
#P hidden newex 172 38 47 196617 r ex.init;
#P window linecount 2;
#P hidden newex 209 68 35 196617 float 0.;
#P hidden newex 246 68 35 196617 float 1.;
#P hidden newex 283 68 35 196617 float 2500.;
#P hidden newex 172 68 35 196617 float 50.;
#P flonum 283 110 40 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 246 110 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 209 110 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 172 110 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 135 140 161 196617 adsr~;
#P newex 53 230 40 196617 cycle~;
#P newex 53 200 50 196617 *~ 1000;
#P newex 53 170 69 196617 sah~ 0.;
#P connect 7 0 3 4;
#P hidden connect 9 0 7 0;
#P hidden connect 12 0 8 0;
#P hidden fasten 12 0 11 0 177 61 214 61;
#P hidden fasten 12 0 10 0 177 61 251 61;
#P hidden fasten 12 0 9 0 177 61 288 61;
#P connect 18 1 20 0;
#P connect 6 0 3 3;
#P hidden connect 10 0 6 0;
#P connect 18 0 19 0;
#P connect 3 2 18 0;
#P connect 3 0 13 1;
#P fasten 3 0 18 0 140 178 240 178;
#P connect 5 0 3 2;
#P hidden connect 11 0 5 0;
#P connect 4 0 3 1;
#P hidden connect 8 0 4 0;
#P fasten 15 0 24 0 140 133 100 133;
#P connect 15 0 3 0;
#P fasten 3 1 0 1 190 163 117 163;
#P connect 13 0 16 0;
#P fasten 13 0 17 0 58 283 110 283;
#P connect 2 0 13 0;
#P fasten 1 0 22 0 58 223 18 223;
#P connect 1 0 2 0;
#P fasten 0 0 21 0 58 193 18 193;
#P connect 0 0 1 0;
#P fasten 14 0 23 0 58 163 18 163;
#P connect 14 0 0 0;
#P window clipboard copycount 25;

Attachments:
  1. cudlfo_example.zip

June 23, 2010 | 10:35 pm

I haven’t looked really closely at the patch, but signal inputs are sent to all voices, so I believe what you are experiencing is expected.

Why don’t you put your ramp and pulse signals in the poly~?

-Ben


June 23, 2010 | 10:49 pm

sad to hear that this is the normal function. hopefully someone knows a way around it.

the ramp and pulses are going to be sent to other places as well once the patch develops. plus wouldn’t it not make any difference?


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