http://dl.dropbox.com/u/779859/speedCalc_puradata.JPG
I achieved it in pure data, have a look at the schematic of what I'm thinking:
- Recieving Midi Control input from ctlin 20 and 21
- Pipe delays whatever signal it recieves
- Pythagoras
- Viola, the speed of the input. The units don't matter, as long as it is absolute.
I was thinking about doing the same but in python, for the mouse cursor.
Basically, when I move my mouse, I want to see at what speed the mouse is moving. The rate of input packets is constant at 200hz.
I might have come up with a way, though I haven't tested it yet. How about collecting, say, 51 values in a list, keeping the [0] current, and [50] the oldest. Then simply doing the math on those two values?
Let me know what you're thinking.