const a = new Clock({onTick: val => console.log(`count at ${val}`)})
setTimeout(() => console.log('value should be 4', a.val()), 5000)
setTimeout(() => a.stop(), 5000)
Usage in hydra:
const b = new Clock({interval: 2000}) // two seconds
osc(() => b.val()) // value will increase on every tick
This clock would work really nice with sclang inspired functions such as:
foldAt, foldBetween and warpAt, which would allow the values to either oscillante between to values.
A small class that creates a clock.
Usage in hydra:
This clock would work really nice with
sclang
inspired functions such as:foldAt
,foldBetween
andwarpAt
, which would allow the values to either oscillante between to values.i.e.