[PD] repeating data in array or looping the data when reading?

IOhannes m zmoelnig zmoelnig at iem.at
Mon Sep 2 09:36:23 CEST 2013


-----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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.14 (GNU/Linux)
Comment: Using GnuPG with Icedove - http://www.enigmail.net/

iEYEARECAAYFAlIkP/UACgkQkX2Xpv6ydvRY8ACfeDlJHNV081VzkxpaUAcqvluJ
OmEAoOsIqP7mPwiDTNyHrutRwY51QJ1l
=r5+G
-----END PGP SIGNATURE-----



More information about the Pd-list mailing list