time
module reference
index
- Default clock source (60fps).
- Create a clock source.
- Emit events regularly.
- Low-frequency oscillator.
- Sawtooth LFO.
- Scale clock time.
- Emit a sequence of values as events over time.
- Count ticks.
details
- Default clock source (60fps).
- Create a clock source.
(clock)
(clock fps)
Creates a new clock event stream.
The clock event stream is an IO that triggers other operators at a fixed frame rate.
fps
has to be an eval-time constant and defaults to60
if omitted.
- Emit events regularly.
(every [clock] period [evt])
Emits
evt
as an event once everyperiod
seconds.clock
should be atime/clock
event stream. This argument can be omitted and the stream be passed as a dynamic definition in*clock*
instead.period
should be a num-value.evt
can be a value of any type. It defaults tobang
.- the return type will be an event stream with the same type as
evt
.
- Low-frequency oscillator.
(lfo [clock] freq [wave])
Oscillates betwen
0
and1
at the frequencyfreq
.clock
should be atime/clock
event stream. This argument can be omitted and the stream be passed as a dynamic definition in*clock*
instead.freq
should be a num-value.wave
selects the wave shape from one of the following:'sin'
(the default)'saw'
'tri'
- Sawtooth LFO.
(ramp [clock] period [max])
Ramps from
0
tomax
once everyperiod
seconds.clock
should be atime/clock
event stream. This argument can be omitted and the stream be passed as a dynamic definition in*clock*
instead.period
should be a num-value.max
should be a num-value and defaults toperiod
if omitted.
- Scale clock time.
(scale-time [clock] scale)
Creates a new clock event stream scaled by
scale
.clock
should be atime/clock
event stream. This argument can be omitted and the stream be passed as a dynamic definition in*clock*
instead.scale
should be a num-value.
- Emit a sequence of values as events over time.
(sequence [clock] delay0 evt1 delay1 evt2 delay2…)
Emits
evt1
,evt2
, … as events with delaysdelay0
,delay1
, … in between.clock
should be atime/clock
event stream. This argument can be omitted and the stream be passed as a dynamic definition in*clock*
instead.delay0
,delay1
, … must be num-values.evt1
,evt2
, … must be values of the same type.- the return type will be an event stream with the same type as the
evt
s.
- Count ticks.
(tick [clock] period)
Counts upwards by one every
period
seconds.clock
should be atime/clock
event stream. This argument can be omitted and the stream be passed as a dynamic definition in*clock*
instead.period
should be a num-value.- returns a
num
value that increases by 1 everyperiod
.