good morning,
instead of writing to an array, you can get the value of an audio signal more directly, and convert it to a control signal. see [snapshot~] or [avg~] and [unsig~] (which i think are in the zexy library)
here's on idea on how you could go about it. it creates an sinewave LFO using [osc~] based on BPM, snaphost~'s it every 5 msecs, scales the value to something ctlout can use (0 - 127), and outputs it.
you might want to check my math on the scaling. ugh. algebra. i should have paid more attention in junior high.
and i thought i'd never say it. algebra serves a purpose? i guess you win this time, junior high school math teacher.
--eric
------ http://USFamily.Net/info - Unlimited Internet - From $8.99/mo! ------
#N canvas 0 0 590 558 12; #X obj 42 51 / 60; #X obj 42 105 osc~; #X obj 42 30 nbx 3 14 -1e+037 1e+037 0 1 empty empty empty 0 -6 0 10 -262144 -1 -1 130 256; #X obj 41 180 snapshot~; #X obj 56 133 loadbang; #X obj 41 243 + 1; #X obj 41 264 / 2; #X obj 41 312 * 127; #X text 120 180 ... convert from audio signal to control signal; #X text 89 104 <-- LFO; #X text 76 253 convert from (-1 to 1) to (0 to 1); #X text 83 312 convert from (0 ... 1) to (0 ... 127); #X obj 44 381 hsl 128 15 0 127 0 0 empty empty empty -2 -6 0 8 -262144 -1 -1 5600 1; #X text 87 50 LFO speed (in BPM , for a quarter note); #X obj 42 76 / 4; #X text 86 75 divide by 4 (for a measure); #X obj 41 333 int; #X text 83 335 convert to an integer; #X obj 41 355 change; #X text 83 356 only update when the number changes; #X obj 56 157 metro 5; #X text 118 160 every 5 msecs ...; #X floatatom 41 430 5 0 0 0 - - -; #X text 78 429 feed this to ctlout; #X obj 41 506 ctlout 15 1; #X floatatom 274 452 5 0 0 0 - - -; #X floatatom 362 451 5 0 0 0 - - -; #X obj 190 533 hsl 128 15 0 127 0 0 empty empty empty -2 -6 0 8 -262144 -1 -1 6500 1; #X obj 187 494 int; #X obj 187 470 expr ($f1 * ($f3 - $f2)) + $f2; #X text 308 452 min; #X text 396 451 max; #X text 273 413 set LFO range; #X msg 274 432 25; #X msg 362 432 115; #X obj 187 514 change; #X msg 42 12 130; #X connect 0 0 14 0; #X connect 1 0 3 0; #X connect 2 0 0 0; #X connect 3 0 5 0; #X connect 4 0 20 0; #X connect 5 0 6 0; #X connect 6 0 7 0; #X connect 6 0 29 0; #X connect 7 0 16 0; #X connect 12 0 22 0; #X connect 14 0 1 0; #X connect 16 0 18 0; #X connect 18 0 12 0; #X connect 20 0 3 0; #X connect 22 0 24 0; #X connect 25 0 29 1; #X connect 26 0 29 2; #X connect 28 0 35 0; #X connect 29 0 28 0; #X connect 33 0 25 0; #X connect 34 0 26 0; #X connect 35 0 27 0; #X connect 36 0 2 0;