Hello,
Frank Barknecht wrote :
Generally I prefer to count from 0 to maxstep-1, a "modulo counter" that is easily build with
[r $0-restart] | [f 0]/[+ 1]/[mod 8] | | | [s $0-restart] | counter output here
I tried the modulo method but I saw that if the user change the max value to a value less than the current value, the counter never resets again ...
I tried the implementation with the [select] object and I put and extra select to be sure that the counter never exceeds the maximum of 8 steps.
Attached you'll find my current 8step implementation.
ΓñçóéìïðïéΓ₯ΓΓ΄Γ₯ Yahoo! ΓÑñΓ₯Γ¨ΓΓͺÑôΓ₯ ôÑ Γ₯Γï÷ëçôéΓͺà ìçΓΓ½ ìÑôÑ (spam); ΓΓ― Yahoo! Mail ÀéÑèΓΓ΄Γ₯Γ© ôçà ΓͺÑëýôΓ₯Γ±Γ§ ÀáΓÑôà ðñïóôÑóΓΓ‘ ΓͺÑôà ôùà Γ₯Γï÷ëçôéΓͺþà ìçΓáìΓôùà http://login.yahoo.com/config/mail?.intl=gr
#N canvas 307 257 826 771 12; #X obj 269 382 + 1; #X msg 269 152 bang; #X obj 269 352 float; #X floatatom 552 275 2 0 0 2 current - -; #X obj 269 425 t f f; #X msg 179 332 0; #X msg 352 332 0; #X floatatom 391 274 3 1 8 2 steps - -; #X obj 179 273 select; #X obj 222 240 + 1; #X obj 269 247 trigger b b; #X obj 269 114 r bang; #X obj 222 491 s bang; #X obj 517 276 bng 15 250 50 0 empty empty stop 0 -10 0 8 -262144 -1 -1; #X msg 517 303 stop; #X obj 476 276 bng 15 250 50 0 empty empty start 0 -10 0 8 -262144 -1 -1; #X obj 432 276 nbx 3 14 10 300 0 1 empty empty bpm 3 -10 0 10 -262144 -1 -1 120 120; #X obj 432 303 bpm2ms; #X obj 269 323 metro; #X obj 435 439 cnv 15 100 60 empty empty empty 20 12 0 14 -233017 -66577 0; #X obj 220 307 outlet; #X obj 222 458 select 9; #X text 327 202; #X connect 0 0 4 0; #X connect 1 0 7 0; #X connect 1 0 10 0; #X connect 1 0 16 0; #X connect 2 0 0 0; #X connect 3 0 21 0; #X connect 4 0 8 0; #X connect 4 1 2 1; #X connect 5 0 2 0; #X connect 6 0 2 1; #X connect 7 0 9 0; #X connect 8 0 5 0; #X connect 8 1 3 0; #X connect 8 1 20 0; #X connect 9 0 8 1; #X connect 10 0 18 0; #X connect 10 1 6 0; #X connect 11 0 1 0; #X connect 13 0 14 0; #X connect 14 0 18 0; #X connect 15 0 1 0; #X connect 16 0 17 0; #X connect 17 0 18 1; #X connect 18 0 2 0; #X connect 21 0 12 0; #X coords 0 -1 1 1 230 60 1 380 235;
Hallo, Tas Pas hat gesagt: // Tas Pas wrote:
[r $0-restart] | [f 0]/[+ 1]/[mod 8] | | | [s $0-restart] | counter output here
I tried the modulo method but I saw that if the user change the max value to a value less than the current value, the counter never resets again ...
Hm, it should reset. If you have a [mod 10] and you send a current value bigger than 10 into it, say 12, then out you get a 2 which is fine and what is wanted generally.
I tried the implementation with the [select] object and I put and extra select to be sure that the counter never exceeds the maximum of 8 steps.
I'm away from Pd at the moment so I cannot test your patch, but I find counters stopped or reset by only one value to be a bit "dangerous", because you always have to make sure that this value is actually reached. There are a couple of things that could go wrong. For example if you count only even values like 0 2 4 ..., [select 11] will never select anything. ANother common danger is trying to compare floating point values lke [select 1.001] or [== 0.01], which also will not work generally.
That's why I generally recommend the [mod] counter for counting.
Frank Barknecht _ ______footils.org_ __goto10.org__
Tas, I cant seem to reproduce that specific problem. Here's a slightly simpler take. Basically what Frank says, but don't even bother to reset. Resetting is what causes the problems, but there's no need, just take the modulo and let the counter run forever. If you want to zero the steps value then force the float to zero. (caveat - if you do that halfway through a beat your first beat will be off by the difference, everything else will then be fine) Imho this is the simplest and best method. Thanks for what you said about "Hi Honey", being "ahead of your time" isn't always good. Nobody likes a clever bastard. ;)
On Wed, 2 Aug 2006 10:35:30 +0100 (BST) Tas Pas tprotopgr@yahoo.gr wrote:
Hello,
Frank Barknecht wrote :
Generally I prefer to count from 0 to maxstep-1, a "modulo counter" that is easily build with
[r $0-restart] | [f 0]/[+ 1]/[mod 8] | | | [s $0-restart] | counter output here
I tried the modulo method but I saw that if the user change the max value to a value less than the current value, the counter never resets again ...
I tried the implementation with the [select] object and I put and extra select to be sure that the counter never exceeds the maximum of 8 steps.
Attached you'll find my current 8step implementation.
______________ Yahoo! __________ __ __________ ____ ____ (spam); __ Yahoo! Mail ________ ___ ________ ______ _________ ____ ___ ___________ _________ http://login.yahoo.com/config/mail?.intl=gr