chance in max

Sep 3, 2006 at 7:44pm

chance in max

hi all,

Im a bit rusty on using max so any help would be greatly appreciated!

Heres the setup: i want to have 2 bangs with some code in between them…with this code i want to be able to specify the chance of a bang getting through…so if i input 1.0 and repeatedly hit the first bang the second should light up every time.if i input 0.0 then the second bang should never light up…then if i input 0.5 the second bang should light up on average every other time that the first bang is hit.And so on….
0.25 – 1 in 4
0.9 – 9 in 10
0.66r – 2 in 3 etc etc.

Im sure theres an easy way to do it using ‘random’ but im feeling dim so please help…

thanks very much,

joe

#27455
Sep 3, 2006 at 8:08pm

Here is one way to do it.

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P comment 186 62 43 196617 0. to 1.;
#P comment 50 235 22 196617 out;
#P button 33 236 15 0;
#P newex 33 199 29 196617 gate;
#P newex 72 163 27 196617 < =;
#P newex 72 125 64 196617 random 100;
#P newex 147 120 41 196617 * 100.;
#P flonum 147 60 35 9 0. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 52 89 30 196617 t b b;
#P button 52 56 15 0;
#P comment 70 56 16 196617 in;
#P connect 5 0 6 0;
#P lcolor 7;
#P connect 2 1 5 0;
#P lcolor 7;
#P fasten 6 0 7 0 77 189 38 189;
#P lcolor 7;
#P fasten 4 0 6 1 152 152 94 152;
#P connect 3 0 4 0;
#P connect 7 0 8 0;
#P connect 2 0 7 1;
#P connect 1 0 2 0;
#P window clipboard copycount 11;

#83081
Sep 3, 2006 at 8:23pm

Max Tutorial 25. Scroll to the right.

I can’t believe that I’m answering a question about randomness
without plugging Litter Power, but there you have it.-

On 3-Sep-2006, at 21:44, Joe Canti wrote:

>
> hi all,
>
> Im a bit rusty on using max so any help would be greatly appreciated!
>
> Heres the setup: i want to have 2 bangs with some code in between
> them…with this code i want to be able to specify the chance of a
> bang getting through…so if i input 1.0 and repeatedly hit the
> first bang the second should light up every time.if i input 0.0
> then the second bang should never light up…then if i input 0.5
> the second bang should light up on average every other time that
> the first bang is hit.And so on….
> 0.25 – 1 in 4
> 0.9 – 9 in 10
> 0.66r – 2 in 3 etc etc.
>
> Im sure theres an easy way to do it using ‘random’ but im feeling
> dim so please help…
>
> thanks very much,
>
> joe
>

————– http://www.bek.no/~pcastine/Litter/ ————-
Peter Castine +–> Litter Power & Litter Bundle for Jitter
Universal Binaries on the way
iCE: Sequencing, Recording &
Interface Building for |home | chez nous|
Max/MSP Extremely cool |bei uns | i nostri|
http://www.dspaudio.com/ http://www.castine.de

#83082
Sep 3, 2006 at 8:46pm

thanks very much for both replies…

it was as easy as that!

cheers,

joe

#83083

You must be logged in to reply to this topic.