class library: SynthDef - lazy implementation of removeUGen
[supercollider.git] / HelpSource / Classes / Timer.schelp
blobddeaaca21a1a97a291b3a935e13ed135be32d94c
1 class:: Timer
2 summary:: Returns time since last triggered.
3 categories::  UGens>Triggers
5 Description::
6 Timer returns time since last triggered.
8 classmethods::
9 private:: categories
11 method::ar, kr
13 argument::trig
15 A trigger occurs when trig signal crosses from non-positive to positive.
18 Examples::
20 code::
22 // using timer to modulate sine frequency: the slower the trigger is the higher the frequency
24 { var trig;
25         trig = Impulse.kr(MouseX.kr(0.5, 20, 1));
26         SinOsc.ar(Timer.kr(trig) * 500 + 500, 0, 0.2)
27 }.play;