[PD] reading colors from txt file with repeat

IOhannes m zmoelnig zmoelnig at iem.at
Tue Jan 20 19:46:29 CET 2009


punchik punchik wrote:
> Hello pd happy people, one question , i have a txt file with rgb colors .
> The txt file i have is something like this:
> 
> 142     250      0
> 0       100      50
> 14      123      0
> 123     222      111   .... and so on.
> 
> each line represents the rgb color where the first item in each line is red , the second green and the third blue.
> 
> My question is this: 
> i have a gem patch that creates random 3d shapes using nested repeat objects with geos.   How can i read each line of my txt file (each color ) and apply to each repeated geo? for example if i have a sphere repeated 10 times, i would like that the first sphere would be  the color of the first line in my txt file, the second sphere the second line in my txt file , the third  sphere  the third color in my txt file and so on.....
> 
> how can i do something like this????????????

something like the attached?

but you probably really should use tables/arrays to store the values 
rather than using [textfile]

fgmasdr
IOhannes
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: colors.txt
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20090120/9eeca2d2/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: colorsphere.pd
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20090120/9eeca2d2/attachment.asc>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3636 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20090120/9eeca2d2/attachment.bin>


More information about the Pd-list mailing list