Hi Frank
Maybe look at this concept attached tab-many.pd its more generic.
Stef
Frank Barknecht skrev:
Hallo, Frank Barknecht hat gesagt: // Frank Barknecht wrote:
You can only store one number per index. So you either should use 3 arrays (i.e. $0-r, $0-g, $0-b) or group three values inside one table by adjusting the indices accordingly. It's easier to show in a patch than to tell, so just look at the attachment to see what I mean.
Actually that's nice to have as an abstraction so I made it. It's called tabread-three and not tabread3 because of tabread4. ;)
#N canvas 27 42 393 214 10; #X msg 25 54 0.15 0.2 0.25; #X msg 51 81 0.85 0.8 0.75; #N canvas 0 0 528 452 write 0; #X obj 195 90 inlet; #X obj 424 90 inlet; #X obj 424 112 * 3; #X obj 158 379 tabwrite $0-array; #X obj 257 353 +; #X obj 237 136 0; #X obj 222 294 f; #X obj 251 293 + 1; #X obj 195 112 t b a b; #X obj 158 202 list; #X obj 158 232 list split 1; #X obj 158 258 t f b; #X obj 158 138 3; #X obj 158 160 until; #X floatatom 320 178 5 0 0 0 - - -; #X connect 0 0 8 0; #X connect 1 0 2 0; #X connect 2 0 4 1; #X connect 4 0 3 1; #X connect 5 0 6 1; #X connect 6 0 7 0; #X connect 6 0 4 0; #X connect 7 0 6 1; #X connect 8 0 12 0; #X connect 8 1 9 1; #X connect 8 2 5 0; #X connect 9 0 10 0; #X connect 10 0 11 0; #X connect 10 1 9 1; #X connect 11 0 3 0; #X connect 11 1 6 0; #X connect 12 0 13 0; #X connect 13 0 9 0; #X connect 14 0 12 1; #X connect 14 0 2 1; #X restore 25 131 pd write; #X floatatom 70 106 5 0 0 0 - - -; #N canvas 0 0 509 502 read 0; #X obj 199 34 inlet; #X obj 243 298 tabread $0-array; #X obj 199 64 * 3; #X obj 259 354 list; #X obj 294 354 t l; #X obj 106 384 list; #X obj 243 270 +; #X obj 200 180 until; #X obj 200 158 3; #X obj 199 92 t b b f b; #X obj 200 213 f; #X obj 226 213 + 1; #X obj 284 176 0; #X floatatom 370 37 5 0 0 0 - - -; #X text 418 37 <-arg?; #X obj 106 419 outlet; #X connect 0 0 2 0; #X connect 1 0 3 0; #X connect 2 0 9 0; #X connect 3 0 4 0; #X connect 3 0 5 1; #X connect 4 0 3 1; #X connect 5 0 15 0; #X connect 6 0 1 0; #X connect 7 0 10 0; #X connect 8 0 7 0; #X connect 9 0 5 0; #X connect 9 1 8 0; #X connect 9 2 6 1; #X connect 9 3 3 1; #X connect 9 3 12 0; #X connect 10 0 11 0; #X connect 10 0 6 0; #X connect 11 0 10 1; #X connect 12 0 10 1; #X connect 13 0 2 1; #X connect 13 0 8 1; #X restore 159 84 pd read; #X msg 159 128 0 0 0; #X msg 159 106 set $1 $2 $3; #X floatatom 159 54 5 0 0 0 - - -; #X obj 26 17 table $0-array; #X connect 0 0 2 0; #X connect 1 0 2 0; #X connect 3 0 2 1; #X connect 4 0 6 0; #X connect 6 0 5 0; #X connect 7 0 4 0;