Oops - it's even easier:
I forgot that I included convenience methods that do all of these operations in one shot. All you need is:
[euclid old-snapshot( | [tabletool current-data]
You'll get the single number out of the left outlet. That's the square/sum/sqrt method. The [taxi( method does the sum of absolute values.
2010/10/13 William Brent william.brent@gmail.com:
I haven't looked at your patch, but you could do this fairly easily using [tabletool]. In the case of one table, you can store the snapshot of old values in a table (called "old-snapshot"), then, if the new data is in a table called "current-data", do
[subtract old-snapshot( | [tabletool current-data]
You'll get the difference between the tables out of [tabletool]'s right outlet, which you can write to a third table, then use the [abs( and [sum( functions in [tabletool] to get an indication of how much change there actually was. Instead of absolute value, you could also square everything, sum it, and take the square root. Either way, you'll get a single number that indicates how much the current data differs from the old.
William
2010/10/13 cristiano figueiró crislists@gmail.com:
Hi list, I'm with a little problem here: In the attached patch, imagine that the arrays are probabilities of something (i.e. pitches), i would like to automate something that would have the output: "array1 is more stable than array2" and thinking that the array would be changing it's values in real-time, this comparison would be between an old snapshot and actual snapshot of the same array. I'm in deep trouble? :p Thanks for help :) Cristiano
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
-- William Brent www.williambrent.com
“Great minds flock together” Conflations: conversational idiom for the 21st century
www.conflations.com