1 <!DOCTYPE html PUBLIC
"-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
4 <meta http-equiv=
"Content-Type" content=
"text/html; charset=UTF-8">
5 <meta http-equiv=
"Content-Style-Type" content=
"text/css">
7 <meta name=
"Generator" content=
"Cocoa HTML Writer">
8 <meta name=
"CocoaVersion" content=
"949.43">
9 <style type=
"text/css">
10 p
.p1
{margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica
}
11 p
.p2
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; color: #001bb9; min-height: 12.0px}
12 p
.p3
{margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica
; color: #001bb9}
13 p
.p4
{margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica
; min-height: 14.0px}
14 p
.p5
{margin: 0.0px 0.0px 0.0px 14.0px; text-indent: -14.0px; font: 12.0px Helvetica
}
15 p
.p6
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
}
16 p
.p7
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; min-height: 12.0px}
17 span
.s1
{font: 18.0px Helvetica
}
18 span
.s2
{font: 14.0px Helvetica
}
19 span
.s3
{color: #000000}
20 span
.s4
{color: #0021e7}
21 span
.s5
{color: #001bb9}
22 span
.s6
{color: #606060}
23 span
.s7
{color: #2c7014}
24 span
.s8
{color: #0000ff}
25 span
.Apple-tab-span
{white-space:pre
}
29 <p class=
"p1"><span class=
"s1"><b>InTrig
</b></span><span class=
"s2"><b><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></b></span><b>generate a trigger anytime a bus is set
</b></p>
30 <p class=
"p2"><br></p>
31 <p class=
"p3"><span class=
"s3"><b>Inherits from:
</b><a href=
"../../Core/Object.html"><b>Object
</b></a></span><b> :
</b><a href=
"../../Core/Kernel/AbstractFunction.html"><span class=
"s4"><b>AbstractFunction
</b></span></a><b> :
</b><a href=
"../UGen.html"><span class=
"s4"><b>UGen
</b></span></a><b> :
</b><a href=
"../Multichannel/MultiOutUGen.html"><span class=
"s4"><b>MultiOutUGen
</b></span></a><b> :
</b><a href=
"AbstractIn.html"><b>AbstractIn
</b></a></p>
32 <p class=
"p2"><br></p>
33 <p class=
"p1"><b>*kr(bus, numChannels)
</b></p>
34 <p class=
"p4"><br></p>
35 <p class=
"p1"><b>bus
</b>- the index of the bus to read in from.
</p>
36 <p class=
"p5"><b>numChannels
</b>- the number of channels (i.e. adjacent buses) to read in. The default is
1. You cannot modulate this number by assigning it to an argument in a SynthDef.
</p>
37 <p class=
"p2"><br></p>
38 <p class=
"p1">Any time the bus is
"touched" ie. has its value set (using
"/c_set" etc.), a single impulse trigger will be generated. Its amplitude is the value that the bus was set to.
</p>
39 <p class=
"p4"><br></p>
40 <p class=
"p4"><br></p>
41 <p class=
"p6">s =
<span class=
"s5">Server
</span>.local;
</p>
42 <p class=
"p6">b =
<span class=
"s5">Bus
</span>.control(s,
1);
</p>
43 <p class=
"p7"><br></p>
44 <p class=
"p6"><span class=
"s5">SynthDef
</span>(
<span class=
"s6">"help-InTrig"</span>, {
<span class=
"s5">arg
</span> out=
0, busnum=
0;
</p>
45 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"s5">var
</span> inTrig;
</p>
46 <p class=
"p6"><span class=
"Apple-tab-span"> </span>inTrig =
<span class=
"s5">InTrig
</span>.kr( busnum );
</p>
47 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"s5">Out
</span>.ar(out,
<span class=
"Apple-converted-space"> </span></p>
48 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"s5">EnvGen
</span>.kr(
<span class=
"s5">Env
</span>.perc, gate: inTrig, levelScale: inTrig ) *
<span class=
"s5">SinOsc
</span>.ar
</p>
49 <p class=
"p6"><span class=
"Apple-tab-span"> </span>)
</p>
50 <p class=
"p6">}).play(s, [
<span class=
"s7">\out
</span>,
0,
<span class=
"s7">\busnum
</span>, b]);
</p>
51 <p class=
"p7"><br></p>
52 <p class=
"p7"><br></p>
53 <p class=
"p7"><br></p>
54 <p class=
"p6">b.set(
1.0);
</p>
55 <p class=
"p7"><br></p>
56 <p class=
"p6">b.value =
1.0;
</p>
57 <p class=
"p7"><br></p>
58 <p class=
"p6">b.value =
0.2;
</p>
59 <p class=
"p7"><br></p>
60 <p class=
"p6">b.value =
0.1;
</p>
61 <p class=
"p4"><br></p>
62 <p class=
"p1">compare with
<a href=
"In.html"><span class=
"s8">In
</span></a> example.
</p>
63 <p class=
"p4"><br></p>
64 <p class=
"p4"><br></p>