Forums > MaxMSP

a new noise decay time

March 31, 2007 | 5:51 pm

Hi all, I am trying to put together a way to control the decay of noise~ because as it is it is very long. I tried using line~ and pack but with no results. This patch shows how i think it might be achieved but once again my brain serves me incorrectly. In the left inlet of line~ the number 1 sets the intial amplitued and then 0 is the target amplitude with the dial in the right inlet setting the adjustable ramp time. Any help would be much appreciated.
Steve

max v2;
#N vpatcher 10 59 610 459;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 79 114 29 196617 1 , 0;
#P user dial 134 92 23 23 128 1 0 0 159 270 1 1. 170 170 170 221 221 221 120 120 120 225 225 225 0 0 0 0 0 0;
#P number 134 127 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 79 150 32 196617 line~;
#P user ezdac~ 48 238 92 271 0;
#P newex 48 178 41 196617 *~ 0.2;
#P newex 48 27 35 196617 noise~;
#B color 5;
#P connect 0 0 1 0;
#P connect 1 0 2 0;
#P fasten 3 1 6 0 106 184 183 184 183 74 84 74;
#P connect 6 0 3 0;
#P connect 3 0 1 1;
#P fasten 1 0 2 1 53 202 87 202;
#P connect 4 0 3 1;
#P connect 5 0 4 0;
#P pop;


March 31, 2007 | 6:13 pm

Hi Steven,

Try this. BTW, is the noise supposed to loop?

max v2;
#N vpatcher 382 341 982 741;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 139 174 44 196617 1 , 0 $1;
#P user dial 181 75 23 23 128 1 0 0 159 270 1 1. 170 170 170 221 221 221 120 120 120 225 225 225 0 0 0 0 0 0;
#P number 181 110 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 139 210 50 196617 line~ 1.;
#P user ezdac~ 108 298 152 331 0;
#P newex 108 238 41 196617 *~ 0.2;
#P newex 108 87 35 196617 noise~;
#B color 5;
#P connect 0 0 1 0;
#P connect 1 0 2 0;
#P connect 4 0 6 0;
#P fasten 3 1 6 0 184 244 243 244 243 134 144 134;
#P connect 6 0 3 0;
#P connect 3 0 1 1;
#P fasten 1 0 2 1 113 262 147 262;
#P connect 5 0 4 0;
#P pop;


March 31, 2007 | 6:33 pm

Thanks Brian that alters the decay time well but it seems to send out a delayed version of the noise, repeatedly. The shorter the decay time the faster the delay. I just want to use noise as a sound source.
Steve


March 31, 2007 | 6:43 pm

That’s why I was asking if you wanted the noise to loop. Disconnect the right outlet of [line~] that goes back and bangs the message box. See if that does it for you.


March 31, 2007 | 6:53 pm

At 6:51 PM +0100 3/31/07, Steven Holt wrote:
>Hi all, I am trying to put together a way to control the decay of noise~ because as it is it is very long.

Noise has no inherent decay, AFAIK.

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 189 48 37 196617 Decay;
#P message 118 114 14 196617 0;
#P message 61 157 14 196617 1;
#P newex 118 79 30 196617 t b b;
#P button 118 47 15 0;
#P newex 118 132 56 196617 pack i i;
#P user dial 164 46 23 23 500 1 0 0 159 270 1 1. 170 170 170 221 221 221 120 120 120 225 225 225 0 0 0 0 0 0;
#P number 164 81 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 61 180 32 196617 line~;
#P user ezdac~ 30 268 74 301 0;
#P newex 30 208 41 196617 *~ 0.2;
#P newex 30 79 35 196617 noise~;
#B color 5;
#P comment 88 48 29 196617 Trig;
#P connect 2 0 3 0;
#P fasten 2 0 3 1 35 232 69 232;
#P connect 11 0 7 0;
#P connect 9 0 11 0;
#P connect 10 0 4 0;
#P fasten 9 1 10 0 143 106 66 106;
#P connect 8 0 9 0;
#P connect 7 0 4 0;
#P connect 5 0 7 1;
#P connect 6 0 5 0;
#P connect 4 0 2 1;
#P connect 1 0 2 0;
#P window clipboard copycount 13;


Chris Muir | "There are many futures and only one status quo.
cbm@well.com | This is why conservatives mostly agree,
http://www.xfade.com | and radicals always argue." – Brian Eno



_j
March 31, 2007 | 6:56 pm

Yeah, ditto what was said above. Noise has no decay. Good point. Half of the problem is being able to understand the logic behind it.


March 31, 2007 | 6:56 pm

That got rid of the delay effect but the noise doesn’t sound again after pressing the first note. I have to move the dial get it to sound. I guess it needs to trigger the amplitude back to 1. Thats why I figured that the bang was supposed to go back into the message box.
Steve


March 31, 2007 | 7:05 pm

Your right noise~ has no decay. Thanks for pointing that out. I need a break max…I was getting the decay from the release of my envelope. But i got the idea of noise decay from a synth I use and thought it would be great for making percussive sounds so I wanted to have one in my patch.
Steve


March 31, 2007 | 7:09 pm

So did my example do what you wanted?


March 31, 2007 | 7:18 pm

Hi Chris this text wont open as a max patch. It just shows the text. Can you resend it or something?


March 31, 2007 | 7:41 pm

1. Copy the Maxish text from my post (the #P block of text)
2. Go to Max
3. Select "New from Clipboard" from the File menu
4. ta da!


March 31, 2007 | 8:22 pm

Quote: Steven wrote on Sat, 31 March 2007 11:56
—————————————————-
> That got rid of the delay effect but the noise doesn’t sound again after pressing the first note. I have to move the dial get it to sound. I guess it needs to trigger the amplitude back to 1. Thats why I figured that the bang was supposed to go back into the message box.
> Steve
—————————————————-

Hmm… It should work by just clicking the message box again. Try this.

max v2;
#N vpatcher 382 341 982 741;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 63 58 44 196617 1 , 0 $1;
#P number 63 29 35 9 0 0 64 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 43 94 44 196617 line~ 1.;
#P user ezdac~ 18 182 62 215 0;
#P newex 18 122 35 196617 *~ 0.;
#P newex 18 29 35 196617 noise~;
#B color 5;
#P comment 108 60 100 196617 click to play noise;
#P comment 101 30 100 196617 ramp time in ms;
#P connect 2 0 3 0;
#P connect 3 0 4 0;
#P fasten 7 0 5 0 68 86 48 86;
#P connect 5 0 3 1;
#P fasten 3 0 4 1 23 146 57 146;
#P connect 6 0 7 0;
#P pop;


March 31, 2007 | 8:26 pm

Thanks a lot Chris, that seems to be working well. Just the note on and note off messages seem triggering the noise now but i’m sure i can fix that.
Thanks :)
Steve


March 31, 2007 | 8:46 pm

stripnote


March 31, 2007 | 9:11 pm

So Chris Muir’s use of sprintf got me thinking. Here’s one that uses MIDI note velocity to adjust the amplitude of the noise attack before it begins to delay.

max v2;
#N vpatcher 10 59 610 459;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 65 73 87 196617 scale 0 127 0. 1.;
#P newex 65 100 29 196617 t b f;
#P newex 29 50 46 196617 select 0;
#P newex 14 27 40 196617 notein;
#P message 156 74 26 196617 500;
#P newex 156 50 48 196617 loadbang;
#P newex 65 157 62 196617 prepend set;
#P newex 65 131 101 196617 sprintf %f\, 0 %ld;
#P message 65 191 101 196617 1. , 0 500;
#P number 156 101 44 9 0 0 64 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 65 213 44 196617 line~ 1.;
#P user ezdac~ 40 274 84 307 0;
#P newex 40 241 35 196617 *~ 0.;
#P newex 18 213 35 196617 noise~;
#B color 5;
#P comment 199 102 100 196617 set ramp time in ms;
#P comment 56 29 164 196617 play any MIDI note to trigger noise;
#P connect 12 1 13 0;
#P fasten 2 0 3 0 23 235 45 235;
#P connect 3 0 4 0;
#P connect 13 1 15 0;
#P connect 15 0 14 0;
#P fasten 14 1 8 0 89 124 70 124;
#P connect 8 0 9 0;
#P fasten 14 0 7 0 70 121 55 121 55 184 70 184;
#P connect 9 0 7 0;
#P connect 7 0 5 0;
#P connect 5 0 3 1;
#P fasten 3 0 4 1 45 265 79 265;
#P connect 10 0 11 0;
#P connect 11 0 6 0;
#P connect 6 0 8 1;
#P pop;


March 31, 2007 | 9:14 pm

I should have said …before it begins to *decay*


March 31, 2007 | 9:30 pm

you could create such a short envelope by using [click~]
to enter the sample values and then [peek~] to write them
into a [buffer~].

when this [buffer~] is played, it will "open the gate"
when controlling a [*~ ] behind the [noise~].

[click~] itself, used alone that is, is useful for percussion
synthesis anyway, with the only limit that it is not fully
dynamic.
(you need to send it messages to change the sound/lenght)

-110


March 31, 2007 | 9:39 pm

excuse me: "peek~" must read "record~" of course.


March 31, 2007 | 10:51 pm

Well, as long as we’re going for extra credit:

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P hidden message 267 323 23 196617 20.;
#B color 10;
#P user number~ 72 348 136 363 9 3 3 1 0. 0. 0 1046.502319 250 0. 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 71 159 31 196617 mtof;
#P button 43 47 20 0;
#P hidden message 572 318 31 196617 200.;
#B color 10;
#P hidden message 534 318 23 196617 0.15;
#B color 10;
#P hidden message 271 352 49 196617 resonant;
#B color 10;
#P comment 78 332 30 196617 Freq;
#P comment 196 332 56 196617 Resonance;
#P user number~ 190 348 229 363 9 3 3 1 0. 0. 0 20. 250 0. 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 43 405 159 196617 biquad~;
#P newex 72 377 129 196617 filtercoeff~;
#B color 5;
#P toggle 262 234 15 0;
#P message 262 213 14 196617 0;
#P newex 262 183 32 196617 sel 0;
#P newex 262 144 46 196617 metro 5;
#P hidden message 496 318 20 196617 35;
#B color 10;
#P hidden message 458 318 17 196617 0.;
#B color 10;
#P hidden newex 132 230 48 196617 loadbang;
#B color 10;
#P newex 457 155 87 196617 scale 0 127 0. 1.;
#P hidden message 373 361 46 196617 legato 1;
#B color 10;
#P flonum 420 194 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 572 362 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 534 362 35 9 0. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 496 362 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 458 362 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 420 386 162 196617 adsr~;
#P message 245 213 14 196617 1;
#P button 229 213 15 0;
#P newex 262 163 66 196617 mousestate;
#P number 457 137 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 71 137 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user kslider 71 81 54 0 24 96 31 12 0 128 128 128 128 128 128 255 255 255 0 0 0 0 0 0;
#P user ezdac~ 43 504 87 537 0;
#P newex 43 477 41 196617 *~ 0.2;
#P newex 43 260 39 196617 noise~;
#B color 5;
#P comment 231 236 30 196617 Gate;
#P window setfont "Sans Serif" 12.;
#P comment 73 47 68 196620 Init Patch;
#P window setfont "Sans Serif" 18.;
#P comment 463 337 21 196626 A;
#P window setfont "Sans Serif" 9.;
#P comment 419 408 206 196617 A , D & R times in ms , S level 0-1;
#P comment 457 194 60 196617 Velo / Trig;
#P window setfont "Sans Serif" 18.;
#P comment 501 337 21 196626 D;
#P comment 539 337 21 196626 S;
#P comment 577 337 21 196626 R;
#P connect 8 0 33 0;
#P connect 33 0 9 0;
#P connect 9 0 10 0;
#P connect 11 0 12 0;
#P connect 12 0 41 0;
#P connect 41 0 42 0;
#P hidden connect 37 0 32 0;
#P lcolor 11;
#P connect 42 0 32 0;
#P connect 32 0 33 1;
#P connect 17 0 9 1;
#P fasten 9 0 10 1 48 498 82 498;
#P connect 32 1 33 2;
#P connect 32 2 33 3;
#P hidden fasten 40 0 25 0 48 187 137 187;
#P lcolor 11;
#P connect 32 3 33 4;
#P connect 32 4 33 5;
#P hidden connect 43 0 34 0;
#P lcolor 11;
#P connect 34 0 32 2;
#P connect 11 0 15 0;
#P connect 15 0 16 0;
#P fasten 31 0 28 0 267 253 335 253 335 137 267 137;
#P connect 28 0 14 0;
#P connect 14 0 29 0;
#P connect 29 0 30 0;
#P connect 30 0 31 0;
#P connect 16 0 31 0;
#P hidden connect 25 0 43 0;
#P lcolor 11;
#P hidden connect 25 0 37 0;
#P lcolor 11;
#P hidden connect 25 0 23 0;
#P lcolor 11;
#P connect 24 0 22 0;
#P fasten 30 0 17 0 267 230 425 230;
#P connect 22 0 17 0;
#P hidden connect 23 0 17 0;
#P lcolor 11;
#P connect 11 1 13 0;
#P connect 13 0 24 0;
#P hidden connect 25 0 26 0;
#P lcolor 11;
#P hidden connect 26 0 18 0;
#P lcolor 11;
#P connect 18 0 17 1;
#P hidden connect 25 0 27 0;
#P lcolor 11;
#P hidden connect 27 0 19 0;
#P lcolor 11;
#P connect 19 0 17 2;
#P hidden connect 25 0 38 0;
#P lcolor 11;
#P hidden connect 38 0 20 0;
#P lcolor 11;
#P connect 20 0 17 3;
#P hidden connect 25 0 39 0;
#P lcolor 11;
#P hidden connect 39 0 21 0;
#P lcolor 11;
#P connect 21 0 17 4;
#P window clipboard copycount 44;


March 31, 2007 | 11:05 pm

show-off :-)



_j
April 1, 2007 | 6:45 am

bwah, that’s hardly showing off =P


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