[PD] An Iterator object
Frank Barknecht
fbar at footils.org
Thu May 29 09:49:00 CEST 2003
Hallo,
Michael McGonagle hat gesagt: // Michael McGonagle wrote:
> I am looking for an object that will create any number of "embedded"
> iterators. The best analogy would be having a bunch of embedded "for"
> loops, like this:
>
>
> for (i = i_init; i < i_limit; i += i_inc)
> for (j = j_init; j < j_limit; j += j_inc)
> doSomething();
>
>
> I have created an abstraction that acts as a single loop, and I am using
> "until" to control the loops iterations. I would like to be able to not
> use "until" as this forces a restriction of making sure that all
> operations be performed within the same "time-interval" as all others. I
> would like to be able to send a single bang to the "top of the loop",
> and have it output the next set of iterators. For example
>
> [iterator 0 10 1 100 1000 100]
>
> banging on the iterator would produce the follow excerpt:
>
> 0 100
> 0 200
> ...etc
> 0 1000
> 1 100
> 1 200
> ...etc
Isn't this simply a combination of two counters with [select i_limit]?
I attached an example, that solves, how I understood the question...
ciao
--
Frank Barknecht _ ______footils.org__
-------------- next part --------------
#N canvas 218 217 450 300 10;
#X obj 122 41 inlet;
#X obj 110 230 outlet;
#X obj 152 102 f \$1;
#X obj 188 102 + \$3;
#X obj 176 139 select \$2;
#X obj 237 171 f \$1;
#X obj 237 206 s \$0-reset;
#X obj 175 40 r \$0-reset;
#X obj 110 208 f;
#X obj 122 70 t b b;
#X obj 176 174 outlet;
#X connect 0 0 9 0;
#X connect 2 0 4 0;
#X connect 2 0 8 1;
#X connect 3 0 2 1;
#X connect 4 0 5 0;
#X connect 4 0 10 0;
#X connect 4 1 3 0;
#X connect 5 0 6 0;
#X connect 7 0 2 1;
#X connect 8 0 1 0;
#X connect 9 0 8 0;
#X connect 9 1 2 0;
-------------- next part --------------
#N canvas 631 235 450 300 10;
#X obj 100 114 metro 250;
#X floatatom 214 187 5 0 0 0 - - -;
#X obj 100 88 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
;
#X obj 100 135 iter 100 1000 100;
#X floatatom 100 189 5 0 0 0 - - -;
#X obj 214 159 iter 0 10 1;
#X connect 0 0 3 0;
#X connect 2 0 0 0;
#X connect 3 0 4 0;
#X connect 3 1 5 0;
#X connect 5 0 1 0;
More information about the Pd-list
mailing list