2 summary:: Write to buses local to a synth.
3 related:: Classes/LocalIn
4 categories:: UGens>InOut
9 LocalOut writes to buses that are local to the enclosing synth. The buses
10 should have been defined by a link::Classes/LocalIn:: ugen. The
11 code::channelsArray:: must be the same number of channels
12 as were declared in the link::Classes/LocalIn:: . These are like the
13 global buses, but are more convenient if you want to implement a self
14 contained effect that uses a feedback processing loop.
19 Audio written to a LocalOut will not be read by a corresponding
20 link::Classes/LocalIn:: until the next cycle, i.e. one block size of
21 samples later. Because of this it is important to take this additional
22 delay into account when using link::Classes/LocalIn:: to create
23 feedback delays with delay times shorter than the threshold of pitch
24 (i. e. < 0.05 seconds or > 20Hz), or where sample accurate
25 alignment is required. See the resonator example below.
33 argument::channelsArray
35 An Array of channels or single output to write out. You cannot
36 change the size of this once a SynthDef has been built.
47 source = Decay.ar(Impulse.ar(0.3), 0.1) * WhiteNoise.ar(0.2);
49 local = LocalIn.ar(2) + [source, 0]; // read feedback, add to source
51 local = DelayN.ar(local, 0.2, 0.2); // delay sound
53 // reverse channels to give ping pong effect, apply decay factor
54 LocalOut.ar(local.reverse * 0.8);
63 z = SynthDef("tank", {
68 Decay2.ar(Dust.ar(0.05), 0.1, 0.5, 0.1)
69 * FSinOsc.ar(IRand(36,84).midicps).cubed.max(0),
72 in = in + Pan2.ar(Decay2.ar(Dust.ar(0.03), 0.04, 0.3) * BrownNoise.ar, 0);
74 4.do { in = AllpassN.ar(in, 0.03, {Rand(0.005,0.02)}.dup, 1); };
76 local = LocalIn.ar(2) * 0.98;
77 local = OnePole.ar(local, 0.5);
79 local = Rotate2.ar(local[0], local[1], 0.23);
80 local = AllpassN.ar(local, 0.05, {Rand(0.01,0.05)}.dup, 2);
82 local = DelayN.ar(local, 0.3, [0.19,0.26]);
83 local = AllpassN.ar(local, 0.05, {Rand(0.03,0.15)}.dup, 2);
85 local = LeakDC.ar(local);
97 z = SynthDef("tape", {
100 in = AudioIn.ar([1,2]);
102 amp = Amplitude.kr(Mix.ar(in));
103 in = in * (amp > 0.02); // noise gate
105 local = LocalIn.ar(2);
106 local = OnePole.ar(local, 0.4);
107 local = OnePole.ar(local, -0.08);
109 local = Rotate2.ar(local[0], local[1], 0.2);
111 local = DelayN.ar(local, 0.25, 0.25);
113 local = LeakDC.ar(local);
114 local = ((local + in) * 1.25).softclip;
118 Out.ar(0, local * 0.1);
122 // Resonator, must subtract blockSize for correct tuning
124 var play, imp, initial;
125 SynthDef("testRes", {
127 play = LocalIn.ar(1);
130 LocalOut.ar(DelayC.ar(imp + (play * 0.995), 1, 440.reciprocal - ControlRate.ir.reciprocal)); // for feedback
132 OffsetOut.ar(0, play);
136 {SinOsc.ar(440, 0, 0.2) }.play(s, 1); // compare pitch