I was looking at the exponential smoothing thing again using capytalk.
If I want to evaluate a capytalk expression every capytalk cycle (every 1 ms) I could do something like this:
| lastValue |
lastValue := EventVariable new initialValue: 0.
(!localTime true:
(lastValue <~ (lastValue + (!Input - lastValue / !Factor)))
false:
nil
),
(lastValue).
If I want to evaluate less often I could use "0.1 s tick evaluate:..." instead of "!localTime true:...". But tick can't seem to go faster than 0.02 s.
How do you create faster triggers in capytalk, between 1 and 10 ms?
(Also would it be much more efficient to use a tick of 0.1 s duration in the example above and smooth the output, or just evaluate the expression at full capytalk rate?)