Frank Barknecht wrote:
Hallo, pete mcpartlan hat gesagt: // pete mcpartlan wrote:
thanks martin, this seems to work and is roughly what i need-
what is the best way to write this into an array? is there a way to send a table an eqation other than cosinesum etc. using [tabwrite] always seems to have gaps...
See for example: http://royalrabbit.goto10.org/svn/goto10/pd-patches/fbar/tuts/gaussverteilun... for how to do a gaussian using the [expr] object (ignore the missing objects like rrad.scale)
Following the same idiom you can write everything to a table, that is possible to express with [expr].
Ciao
Nice. I changed it to work with tanh and variable horizontal scale. See attached patch.
Martin
#N canvas 243 252 372 382 10; #X obj 21 5 table x 515; #X text 106 5 size=512+3 for tabread4~; #X obj 24 324 tabwrite x; #X obj 24 178 f 0; #X obj 50 178 + 1; #X obj 24 202 t f f; #X obj 24 151 until; #X obj 24 71 t b b; #X msg 94 127 0; #X msg 24 98 515; #X obj 24 47 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 24 125 t f f; #X text 81 177 count 0 to tablesize; #X text 72 260 divide by tablesize to make expr happy.; #X obj 24 259 / 515; #X obj 1 234 - 257.5; #X obj 24 286 expr tanh($f2 * $f1); #X floatatom 123 236 5 0 0 0 - - -; #X obj 85 202 / 2; #X text 159 237 horizontal scale; #X obj 123 194 loadbang; #X msg 123 214 1; #X connect 3 0 4 0; #X connect 3 0 5 0; #X connect 4 0 3 1; #X connect 5 0 15 0; #X connect 5 1 2 1; #X connect 6 0 3 0; #X connect 7 0 9 0; #X connect 7 1 8 0; #X connect 8 0 3 1; #X connect 9 0 11 0; #X connect 10 0 7 0; #X connect 11 0 6 0; #X connect 11 1 14 1; #X connect 11 1 18 0; #X connect 14 0 16 0; #X connect 15 0 14 0; #X connect 16 0 2 0; #X connect 17 0 16 1; #X connect 18 0 15 1; #X connect 20 0 21 0; #X connect 21 0 17 0;