Hi again, I'm creating some structures iterating geos using the "repeat" object.
I have tables with data(colors) and I'm applying a different color to each iterated geo.
If my array has 20 values (20 colors) and then i iterate 20 times a geo, then each geo is gonna have a different color.
But if i iterate 40 times then i will only have the first 20 geos colored and the rest is gonna be black.
I was wondering which should be the best approach in pd to solve this problem.
I need that instead having black geos i need that it can loop the values in the array , in that way it wouldn't mind to have more iterated geos than values in my array.
Other approach i was thinking is creating a large table , and then filling only with 20 color values, and then repeat the data through the whole table.
I was wondering which should be the best approach for this? how can i repeat the data of my array?
cheers
R.
Hello,
Le 01/09/2013 10:30, Ronni Montoya a écrit :
Hi again, I'm creating some structures iterating geos using the "repeat" object.
[repeat] comes from zexy. You have two specifics object for this purpose (iteration) called [gemlist] from Gem and [until] from Pd. See gemlist-help.pd.
I have tables with data(colors) and I'm applying a different color to each iterated geo.
If my array has 20 values (20 colors) and then i iterate 20 times a geo, then each geo is gonna have a different color.
But if i iterate 40 times then i will only have the first 20 geos colored and the rest is gonna be black.
In your counter, use a [mod 20] to loop two times from 0 to 19 (to read your table which has 20 index). ++
Jack
I was wondering which should be the best approach in pd to solve this problem.
I need that instead having black geos i need that it can loop the values in the array , in that way it wouldn't mind to have more iterated geos than values in my array.
Other approach i was thinking is creating a large table , and then filling only with 20 color values, and then repeat the data through the whole table.
I was wondering which should be the best approach for this? how can i repeat the data of my array?
cheers
R.
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Hey Jack, if i have a table with 20 index and i iterate 20 times and then i use [mod 20] i dont see how this is gonna work as you explained. If i iterate 20 times and i use [mod 10] then it that way it is gonna repeat 2 times. If i iterate 20 times and i use [mod 5] then its gonna gonna 4 times.
so as you see, i can use [mod ] when the repeating value is less than the number of iterated geos. But not in my case.
anybody have an idea how to solve this?
2013/9/1, Jack jack@rybn.org:
Hello,
Le 01/09/2013 10:30, Ronni Montoya a écrit :
Hi again, I'm creating some structures iterating geos using the "repeat" object.
[repeat] comes from zexy. You have two specifics object for this purpose (iteration) called [gemlist] from Gem and [until] from Pd. See gemlist-help.pd.
I have tables with data(colors) and I'm applying a different color to each iterated geo.
If my array has 20 values (20 colors) and then i iterate 20 times a geo, then each geo is gonna have a different color.
But if i iterate 40 times then i will only have the first 20 geos colored and the rest is gonna be black.
In your counter, use a [mod 20] to loop two times from 0 to 19 (to read your table which has 20 index). ++
Jack
I was wondering which should be the best approach in pd to solve this problem.
I need that instead having black geos i need that it can loop the values in the array , in that way it wouldn't mind to have more iterated geos than values in my array.
Other approach i was thinking is creating a large table , and then filling only with 20 color values, and then repeat the data through the whole table.
I was wondering which should be the best approach for this? how can i repeat the data of my array?
cheers
R.
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 2013-09-02 03:11, Ronni Montoya wrote:
Hey Jack, if i have a table with 20 index and i iterate 20 times and then i use [mod 20] i dont see how this is gonna work as you explained. If i iterate 20 times and i use [mod 10] then it that way it is gonna repeat 2 times. If i iterate 20 times and i use [mod 5] then its gonna gonna 4 times.
so as you see, i can use [mod ] when the repeating value is less than the number of iterated geos. But not in my case.
using a [mod 20] will allow you to read 40 values from a 20-elements table (by repeating them once). what you call "number of iterated geos" is 40, and what you call "repeating value" is 20, so the aboce is valid "in your case".
the only information you have given about your problem is that the last 20 color-values are "black". nobody can possibly know what is going wrong without information on how you generate these values. one assumption (and i think a good one, but you never know without seeing the patch) is that you have a table of 20 elements, and you are trying to read 40 elements. obviously the last 20 elements are "undefined" (in theory, in practice Pd will make things a bit failsafe: if the index you are trying to access exceeds the table-size, [tabread] will return the last defined value. but then i think you are doing it slightly differently: your table is bigger than 20 elements, but you have only assigned values for the first 20 indices; this leaves all the rest to what it used to be, most likely 0 (which results in black)).
gfgmasdr IOhannes