![]() |
![]() ![]() ![]() ![]() ![]()
|
next newest topic | next oldest topic |
Author | Topic: threshold for changes for hasChangedInLast? |
Phi Curtis Member |
![]() ![]() ![]() Hi, I have this code: | penXSwarmController | penXSwarmController := !PenX swarmFollowFromPosition: 0 velocity: !PenY acceleration: ((!PenTiltY * 0.5 + 0.5) clipTo01) friction: (((!PenTiltX * 0.5 + 0.5)clipTo01) * 0.95 + 0.05). (penXSwarmController hasChangedInLast: 0.1 s) You can see that I am using a swarmFollowFromPosition expression on !PenX, and I am detecting when the resulting movement has stopped. However, I find that when the friction in the expression is low (ie when !PenTiltX is low) a large amount of time is spent waiting for extremely small changes in the value of the penXSwarmController expression to die away. I would like the hasChangedInLast expression to disregard very small changes (say +/- 0.05), so that it doesn't take so long for the expression to become 0. Any ideas of simple ways to do this? thanks, [This message has been edited by Phi Curtis (edited 01 September 2008).] IP: Logged |
SSC Administrator |
![]() ![]() ![]() I wonder whether sameForLast:tolerance: might work in this situation? For example penXSwarmController sameForLast: 1 tolerance: 0.5 For small changes in the measured value, this will be true. However, if the value jumps 0.5 between updates, the expression becomes false (0). You make tolerance into a fader to experiment and find the right tolerance value. IP: Logged |
Phi Curtis Member |
![]() ![]() ![]() Hi SSC, Thanks - this seems to be in the right direction, but it seems to work almost opposite of what I'm looking for. If I set the tolerance very low (like at 0.001), it seems to toggle when the changes in the swarm expression are large. What I was doing to test it was using this code in a SoundToGlobalController with the "silent" parameter unchecked (so I can listen for fast triggers): code: IP: Logged |
All times are CT (US) | next newest topic | next oldest topic |
![]() ![]() |
This forum is provided solely for the support and edification of the customers of Symbolic Sound Corporation.