On 9/15/06, Chuckk Hubbard badmuthahubbard@gmail.com wrote:
On 9/15/06, Ollie Glass ollieglaskovik@gmail.com wrote:
2 Averaging the last 10 values received from a midi controller and outputting that average every time a control message is received.
Here's one way to do that.
Here's another way. I don't know if this actually saves any computing time, but you can see how a patch can be altered. The first bang from the trigger object hits the 9, which reads the 9 stored values and leaves the sum in the lower "+"; at the same time, the trigger hits the counter over the "tabwrite" object to advance by
0 back into the counter, which then comes out the left side of the "moses". This way the "tabwrite" object will write each new number into a different location in the "midi2" table. That all happens from the rightmost outlet of the "trigger". Next, whatever number was input into the trigger gets sent out the left outlet. This simultaneously resets to zero the function that summed the table, adds the new value to the sum and divides by 10, and writes the new value into the table. I changed the names of the table and the print object so this patch and the first one can be open at the same time and not interfere.
I don't know if this is useful for your purposes or not. -Chuckk