class library: SynthDef - lazy implementation of removeUGen
[supercollider.git] / HelpSource / Classes / TIRand.schelp
blobbbd147385b511581ac85d6671ccfb4d5b40de16a
1 class:: TIRand
2 summary:: Triggered integer random number generator.
3 related:: Classes/ExpRand, Classes/IRand, Classes/LinRand, Classes/NRand, Classes/Rand, Classes/TExpRand, Classes/TRand
4 categories:: UGens>Random, UGens>Triggers
7 Description::
9 Generates a random integer value in uniform distribution from
10 code::lo::  to  code::hi::  each time the
11 trigger signal changes from nonpositive to positive values.
14 classmethods::
16 method::ar, kr
18 argument::lo
19 Lower limit of the output range.
21 argument::hi
22 Upper limit of the output range.
24 argument::trig
26 The trigger. Trigger can be any signal. A trigger happens when
27 the signal changes from non-positive to positive.
30 Examples::
32 code::
35 SynthDef("help-TIRand", {
36         var trig, outBus;
37         trig = Dust.kr(10);
38         outBus = TIRand.kr(0, 1, trig); //play on random channel between 0 and 1
39         Out.ar(outBus, PinkNoise.ar(0.2))
41 }).play;
46         var trig = Dust.kr(10);
47         SinOsc.ar(
48                         TIRand.kr(4, 12, trig) * 100
49                 ) * 0.1
50 }.play;
55         var trig = Dust.ar(MouseX.kr(1, 8000, 1));
56         SinOsc.ar(
57                         TIRand.ar(4, 12, trig) * 100
58                 ) * 0.1
59 }.play;