Search
Share Section
All Sections
Symbolic Sound
TWiki Links
| diff oldPos val | "Declare EventVariables" diff := EventVariable new initialValue: 0. oldPos := EventVariable new readEveryMillisecond. val := EventVariable new initialValue: 60. ((!Pos ne: oldPos) true: ((diff <+ (!Pos - oldPos)), "Kludge to ignore when the rotary wraps around and resets to 0" ((diff abs gt: 0.75) true: (diff <+ 0) false: nil), (oldPos <+ !Pos)) false: (diff <+ 0)), (val <~ (val + diff))