now
Returns the current value of the clock.
Syntax
Usage
Using now() explicitly is rare, but may be useful when creating custom schedulers.
now() returns an absolute time, measured in 'beats' since the start of the performance.
The clock is an counter incrementing at the rate specified by the tempo.
cslc UDO's use now() internally to calculate time intervals and scheduling of events.
itime -- the current time in beats
Example
now.orc
| Example of using now to select ranges of random pitch |
|---|
| instr myoscil
asig oscil p4,p5
asig declickr asig,0.0001
send asig
endin
patchsig "myoscil", "outs"
instr temporalrecursor
;alternate random pitch ranges
if (now() % 3) > 1.5 then
schedule "myoscil",0,1/16,0.5,cpstuni(randint(3,9)+14,gi_CurrentScale)
else
schedule "myoscil",0,1/16,0.5,cpstuni(randint(0,3)+7,gi_CurrentScale)
endif
schedule p1,randselect_i(1/8,1/4,1/4,1/16),0.1
endin
schedule "temporalrecursor",0,1
|