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=
"1038.11">
9 <style type=
"text/css">
10 p
.p1
{margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Helvetica
}
11 p
.p2
{margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica
; min-height: 14.0px}
12 p
.p3
{margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica
; color: #0000ee}
13 p
.p4
{margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica
}
14 p
.p5
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; min-height: 12.0px}
15 p
.p6
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; color: #0030a7; min-height: 12.0px}
16 p
.p7
{margin: 0.0px 0.0px 0.0px 14.0px; text-indent: -14.0px; font: 12.0px Helvetica
}
17 p
.p8
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; color: #9d1c12}
18 p
.p9
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
}
19 p
.p10
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; color: #606060}
20 p
.p11
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; color: #0026b4}
21 span
.s1
{font: 18.0px Helvetica
}
22 span
.s2
{color: #000000}
23 span
.s3
{color: #001bb9}
24 span
.s4
{color: #0000ee}
25 span
.s5
{color: #0000ff}
26 span
.s6
{color: #0038e9}
27 span
.s7
{color: #0026b4}
28 span
.s8
{color: #606060}
29 span
.Apple-tab-span
{white-space:pre
}
33 <p class=
"p1"><span class=
"s1"><b>OffsetOut
</b></span><b><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>write a signal to a bus with sample accurate timing
<span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></b></p>
34 <p class=
"p2"><br></p>
35 <p class=
"p3"><span class=
"s2"><b>Inherits from:
</b><a href=
"../../Core/Object.html"><b>Object
</b></a></span><span class=
"s3"><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=
"AbstractOut.html"><span class=
"s5"><b>AbstractOut
</b></span></a></span><span class=
"s5"><b> :
</b><a href=
"Out.html"><span class=
"s4"><b>Out
</b></span></a></span></p>
36 <p class=
"p2"><br></p>
37 <p class=
"p4">Output signal to a bus,
<span class=
"Apple-converted-space"> </span>the sample offset within the bus is kept exactly; i.e. if the synth is scheduled to be started part way through a control cycle, OffsetOut will maintain the correct offset by buffering the output and delaying it until the exact time that the synth was scheduled for.
</p>
38 <p class=
"p2"><br></p>
39 <p class=
"p4">This ugen is used where sample accurate output is needed.
</p>
40 <p class=
"p5"><br></p>
41 <p class=
"p4"><b>*ar(bus, channelsArray)
<span class=
"Apple-converted-space"> </span></b>- write a signal to an audio bus.
</p>
42 <p class=
"p4"><b>*kr(bus, channelsArray)
<span class=
"Apple-converted-space"> </span></b>-
<b> </b>write a signal to a control bus.
</p>
43 <p class=
"p6"><span class=
"Apple-tab-span"> </span></p>
44 <p class=
"p4"><b>bus
</b>- the index, or array of indexes, of busses to write to. The lowest index numbers are written to the audio hardware.
</p>
45 <p class=
"p7"><b>channelsArray
</b>- an Array of channels or single output to write out. You cannot change the size of this once a SynthDef has been built.
</p>
46 <p class=
"p5"><span class=
"Apple-tab-span"> </span></p>
47 <p class=
"p4">See the
<a href=
"../../ServerArchitecture/Server-Architecture.html"><span class=
"s6">Server-Architecture
</span></a> and
<a href=
"../../ServerArchitecture/Bus.html"><span class=
"s6">Bus
</span></a> helpfiles for more information on buses and how they are used.
</p>
48 <p class=
"p5"><span class=
"Apple-tab-span"> </span></p>
49 <p class=
"p4">for achieving subsample accuracy see:
<a href=
"../Info/SubsampleOffset.html"><span class=
"s6">SubsampleOffset
</span></a></p>
50 <p class=
"p5"><span class=
"Apple-tab-span"> </span></p>
51 <p class=
"p5"><span class=
"Apple-tab-span"> </span></p>
52 <p class=
"p5"><br></p>
53 <p class=
"p8">// example
</p>
54 <p class=
"p5"><br></p>
55 <p class=
"p9"><span class=
"Apple-tab-span"> </span>(
</p>
56 <p class=
"p10"><span class=
"s2"><span class=
"Apple-tab-span"> </span></span><span class=
"s7">SynthDef
</span><span class=
"s2">(
</span>"help-OffsetOut"<span class=
"s2">,
<span class=
"Apple-converted-space"> </span></span></p>
57 <p class=
"p9"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>{
<span class=
"s7">arg
</span> out=
0, freq=
440, sustain=
0.05;
</p>
58 <p class=
"p9"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"s7">var
</span> env;
</p>
59 <p class=
"p9"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>env =
<span class=
"s7">EnvGen
</span>.kr(
<span class=
"s7">Env
</span>.perc(
0.01, sustain,
0.2), doneAction:
2);
</p>
60 <p class=
"p9"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"s7">OffsetOut
</span>.ar(out,
<span class=
"s7">SinOsc
</span>.ar(freq,
0, env))
</p>
61 <p class=
"p9"><span class=
"Apple-tab-span"> </span>}).send(s);
</p>
62 <p class=
"p5"><span class=
"Apple-tab-span"> </span></p>
63 <p class=
"p10"><span class=
"s2"><span class=
"Apple-tab-span"> </span></span><span class=
"s7">SynthDef
</span><span class=
"s2">(
</span>"help-Out"<span class=
"s2">,
<span class=
"Apple-converted-space"> </span></span></p>
64 <p class=
"p9"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>{
<span class=
"s7">arg
</span> out=
0, freq=
440, sustain=
0.05;
</p>
65 <p class=
"p9"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"s7">var
</span> env;
</p>
66 <p class=
"p9"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>env =
<span class=
"s7">EnvGen
</span>.kr(
<span class=
"s7">Env
</span>.perc(
0.01, sustain,
0.2), doneAction:
2);
</p>
67 <p class=
"p8"><span class=
"s2"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></span>//compare to Out:
</p>
68 <p class=
"p9"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"s7">Out
</span>.ar(out,
<span class=
"s7">SinOsc
</span>.ar(freq,
0, env))
</p>
69 <p class=
"p9"><span class=
"Apple-tab-span"> </span>}).send(s);
</p>
70 <p class=
"p9"><span class=
"Apple-tab-span"> </span>)
</p>
71 <p class=
"p5"><br></p>
72 <p class=
"p5"><span class=
"Apple-tab-span"> </span></p>
73 <p class=
"p8"><span class=
"s2"><span class=
"Apple-tab-span"> </span></span>// these are in sync
</p>
74 <p class=
"p9"><span class=
"Apple-tab-span"> </span>(
</p>
75 <p class=
"p11"><span class=
"s2"><span class=
"Apple-tab-span"> </span></span>Routine
<span class=
"s2">({
</span></p>
76 <p class=
"p9"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>loop {
</p>
77 <p class=
"p9"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>s.sendBundle(
0.2, [
<span class=
"s8">"/s_new"</span>,
<span class=
"s8">"help-OffsetOut"</span>, -
1]);
</p>
78 <p class=
"p9"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>0.01.wait;
</p>
79 <p class=
"p9"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>}
</p>
80 <p class=
"p9"><span class=
"Apple-tab-span"> </span>}).play;
</p>
81 <p class=
"p9"><span class=
"Apple-tab-span"> </span>)
</p>
82 <p class=
"p5"><span class=
"Apple-tab-span"> </span></p>
83 <p class=
"p8"><span class=
"s2"><span class=
"Apple-tab-span"> </span></span>// these are less reliably in sync and are placed at multiples of blocksize.
</p>
84 <p class=
"p9"><span class=
"Apple-tab-span"> </span>(
</p>
85 <p class=
"p11"><span class=
"s2"><span class=
"Apple-tab-span"> </span></span>Routine
<span class=
"s2">({
</span></p>
86 <p class=
"p9"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>loop {
</p>
87 <p class=
"p9"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>s.sendBundle(
0.2, [
<span class=
"s8">"/s_new"</span>,
<span class=
"s8">"help-Out"</span>, -
1]);
</p>
88 <p class=
"p9"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>0.01.wait;
</p>
89 <p class=
"p9"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>}
</p>
90 <p class=
"p9"><span class=
"Apple-tab-span"> </span>}).play;
</p>
91 <p class=
"p9"><span class=
"Apple-tab-span"> </span>)
</p>
92 <p class=
"p5"><span class=
"Apple-tab-span"> </span></p>
93 <p class=
"p5"><span class=
"Apple-tab-span"> </span></p>
94 <p class=
"p5"><span class=
"Apple-tab-span"> </span></p>
95 <p class=
"p5"><br></p>
96 <p class=
"p4">Note that if you have an input to the synth, it will be coming in at its normal time, then mixed in your synth, and then delayed with the output. So you shouldn't use OffsetOut for effects or gating.
</p>
97 <p class=
"p5"><br></p>
98 <p class=
"p11">SynthDef
<span class=
"s2">(
</span><span class=
"s8">"trig1"</span><span class=
"s2">,{
</span></p>
99 <p class=
"p9"><span class=
"Apple-tab-span"> </span><span class=
"s7">var
</span> gate,tone;
</p>
100 <p class=
"p9"><span class=
"Apple-tab-span"> </span>gate =
<span class=
"s7">Trig1
</span>.ar(
1.0,t);
</p>
101 <p class=
"p8"><span class=
"s2"><span class=
"Apple-tab-span"> </span>tone =
</span><span class=
"s7">In
</span><span class=
"s2">.ar(
10,
1);
</span>// tone comes in normally
</p>
102 <p class=
"p8"><span class=
"s2"><span class=
"Apple-tab-span"> </span></span>// but is then delayed when by the OffsetOut
</p>
103 <p class=
"p11"><span class=
"s2"><span class=
"Apple-tab-span"> </span></span>OffsetOut
<span class=
"s2">.ar(
0,
</span></p>
104 <p class=
"p9"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>tone *
<span class=
"s7">EnvGen
</span>.ar(
</p>
105 <p class=
"p9"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"s7">Env
</span>([
0,
0.1,
0.1,
0],[
0.01,
1.0,
0.01],[-
4,
4],
2),
</p>
106 <p class=
"p9"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>gate,doneAction:
2</p>
107 <p class=
"p9"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>)
</p>
108 <p class=
"p9"><span class=
"Apple-tab-span"> </span>)
</p>
110 <p class=
"p5"><span class=
"Apple-tab-span"> </span></p>