Hallo, Hans-Christoph Steiner hat gesagt: // Hans-Christoph Steiner wrote: > [once] controls flow. It should take a float argument like [spigot] > and [gate] so you can choose the default state. No argument implies > an argument of 0. Therefore it makes sense that [once] would be > default closed.
But then it wouldn't be [once] anymore, as I already remarked. > If you want it to be default open, you can easily do > [once 1]. Changing the behaviour of [once] would force anyone who was using [once] to change their patches. I guess we all agree that adding an argument to [once] can be considered, however IOhannes and I both don't want this if it changes the default behaviour. As a compromise why not let [once] stay the way it is and as it's used, but instead introduce a new object with a new name. I thought a bit about this, and *if* we want an argument to [once], then this argument should be used for a little bit more than just selecting open or close. The most natural use for an argument I could come up with was to select, after how many incoming messages the object should close. Of course then the name [once] wouldn't be useful anymore as we would also have a reaction to messages coming in "more than once". So my idea for this object is like this: [the_object_previously_known_as_once] would close after 0 messages, that is, default is closed just like you wished. [the_object_previously_known_as_once 1] would be like the old [once] [the_object_previously_known_as_once 10] would close after 10 in-messages, that is after it has counted down like: 9, 8, 7, 6, 5, 4, 3, 2, 1, liftoff! That's also the name I finally chose for the new [the_object_previously_known_as_once]: [countdown] It's attached. Ciao -- Frank Barknecht _ ______footils.org_ __goto10.org__
#N canvas 0 0 450 300 10; #X obj 90 30 inlet; #X obj 90 112 spigot \$1; #X obj 90 134 t a b; #X obj 90 250 outlet; #X obj 197 82 t a a; #X obj 197 29 inlet; #X obj 178 252 outlet; #X obj 247 171 - 1; #X obj 227 143 - 1; #X obj 148 222 t a a; #X obj 211 191 max 0; #X obj 211 171 f; #X obj 197 57 f \$1; #X obj 242 30 loadbang; #X connect 0 0 1 0; #X connect 1 0 2 0; #X connect 2 0 3 0; #X connect 2 1 11 0; #X connect 4 0 1 1; #X connect 4 1 8 0; #X connect 5 0 12 0; #X connect 7 0 11 1; #X connect 8 0 11 1; #X connect 9 0 1 1; #X connect 9 1 6 0; #X connect 10 0 9 0; #X connect 11 0 7 0; #X connect 11 0 10 0; #X connect 12 0 4 0; #X connect 13 0 12 0;
#N canvas 0 0 717 324 10; #X floatatom 306 194 5 0 0 1 countdown - -; #X obj 234 201 print; #X floatatom 306 141 5 0 0 0 - - -; #X obj 432 201 print; #X floatatom 490 139 5 0 0 0 - - -; #X floatatom 490 190 5 0 0 1 countdown - -; #X obj 234 169 countdown 3; #X text 38 53 Countdown lets anything pass a certain number of times until the countdown reaches zero.; #X msg 234 112 boom_after_3; #X msg 432 112 too_late; #X obj 48 197 print; #X floatatom 120 136 5 0 0 0 - - -; #X floatatom 120 190 5 0 0 1 countdown - -; #X msg 48 108 BOOM!; #X msg 320 166 bang; #X obj 432 169 countdown; #X obj 48 165 countdown 1; #X connect 2 0 6 1; #X connect 4 0 15 1; #X connect 6 0 1 0; #X connect 6 1 0 0; #X connect 8 0 6 0; #X connect 9 0 15 0; #X connect 11 0 16 1; #X connect 13 0 16 0; #X connect 14 0 6 1; #X connect 15 0 3 0; #X connect 15 1 5 0; #X connect 16 0 10 0; #X connect 16 1 12 0;
_______________________________________________ PD-dev mailing list PD-dev@iem.at http://lists.puredata.info/listinfo/pd-dev