...i just built an abstraction that will take a message from the left inlet and pass it to the left outlet randomly n% of the time. the others will be passed as a bang to the right outlet.
just wondering if this looks ok or if there is a better way to do it which i assume there is based on my own random n% of incompetance...
attached is abstraction
cheers mark
mark edward grimm | m.f.a | ed.m
megrimm.net | socialmediagroup.org & .com
meg156@columbia.edu | 585.509.8703
______________________________
#N canvas 293 131 228 362 10; #X obj 64 273 spigot; #X floatatom 97 232 1 0 0 0 - - -; #X obj 97 251 expr 1-$f1; #X obj 14 274 spigot; #X obj 14 13 inlet; #X obj 14 320 outlet; #X obj 97 89 random 100; #X obj 97 167 moses; #X obj 124 12 inlet; #X obj 64 296 t b; #X obj 64 320 outlet; #X obj 124 146 clip 0 100; #X obj 97 189 t b; #X obj 128 189 t b; #X obj 97 67 t b; #X msg 97 210 0; #X msg 128 210 1; #X connect 0 0 9 0; #X connect 1 0 2 0; #X connect 1 0 3 1; #X connect 2 0 0 1; #X connect 3 0 5 0; #X connect 4 0 3 0; #X connect 4 0 0 0; #X connect 4 0 14 0; #X connect 6 0 7 0; #X connect 7 0 12 0; #X connect 7 1 13 0; #X connect 8 0 11 0; #X connect 9 0 10 0; #X connect 11 0 7 1; #X connect 12 0 15 0; #X connect 13 0 16 0; #X connect 14 0 6 0; #X connect 15 0 1 0; #X connect 16 0 1 0;
Hallo, mark edward grimm hat gesagt: // mark edward grimm wrote:
...i just built an abstraction that will take a message from the left inlet and pass it to the left outlet randomly n% of the time. the others will be passed as a bang to the right outlet.
just wondering if this looks ok or if there is a better way to do it which i assume there is based on
The basic approach is perfect. I would remove the numberbox, as this is potentially a CPU hog, and in an abstraction you don't see it anyways, and instead of [expr 1-$f1] in your case [== 0] is more what you want.
*BUT*: There is a deep problem with triggering and execution order in your patch: You have three patch cords coming out of the first [inlet]: so called "fanning" connections. You must be aware that the order, in which these cords get activated, is important for your patch to work correctly. To make sure, that this ordering is actually the way you want it, you *must* use a trigger object: [t a a a]. Search the list-archives for some of my longer explanations why this is so important.
Frank Barknecht _ ______footils.org_ __goto10.org__