2 summary:: Define and read from buses local to a synth.
3 related:: Classes/LocalOut
4 categories:: UGens>InOut
8 LocalIn defines buses that are local to the enclosing synth. These are
9 like the global buses, but are more convenient if you want to implement a
10 self contained effect that uses a feedback processing loop.
12 There can only be one audio rate and one control rate LocalIn per
13 SynthDef. The audio can be written to the bus using
14 link::Classes/LocalOut:: .
17 Audio written to a link::Classes/LocalOut:: will not be read by a
18 corresponding LocalIn until the next cycle, i.e. one block size of
19 samples later. Because of this it is important to take this additional
20 delay into account when using LocalIn to create feedback delays with
21 delay times shorter than the threshold of pitch (i. e. < 0.05
22 seconds or > 20Hz), or where sample accurate alignment is required.
23 See the resonator example below.
32 The number of channels (i.e. adjacent buses) to read in. You
33 cannot modulate this number by assigning it to an argument in a
38 The initial value written to the bus once, so that it can be used before overwriting it with LocalOut. An array can be passed in to specify different values for each channel.
48 source = Decay.ar(Impulse.ar(0.3), 0.1) * WhiteNoise.ar(0.2);
50 local = LocalIn.ar(2) + [source, 0]; // read feedback, add to source
52 local = DelayN.ar(local, 0.2, 0.2); // delay sound
54 // reverse channels to give ping pong effect, apply decay factor
55 LocalOut.ar(local.reverse * 0.8);
67 Decay2.ar(Dust.ar(0.05), 0.1, 0.5, 0.1)
68 * FSinOsc.ar(IRand(36,84).midicps).cubed.max(0),
71 in = in + Pan2.ar(Decay2.ar(Dust.ar(0.03), 0.04, 0.3) * BrownNoise.ar, 0);
73 4.do { in = AllpassN.ar(in, 0.03, {Rand(0.005,0.02)}.dup, 1); };
75 local = LocalIn.ar(2) * 0.98;
76 local = OnePole.ar(local, 0.5);
78 local = Rotate2.ar(local[0], local[1], 0.23);
79 local = AllpassN.ar(local, 0.05, {Rand(0.01,0.05)}.dup, 2);
81 local = DelayN.ar(local, 0.3, [0.19,0.26]);
82 local = AllpassN.ar(local, 0.05, {Rand(0.03,0.15)}.dup, 2);
84 local = LeakDC.ar(local);
95 in = AudioIn.ar([1,2]);
97 amp = Amplitude.kr(Mix.ar(in));
98 in = in * (amp > 0.02); // noise gate
100 local = LocalIn.ar(2);
101 local = OnePole.ar(local, 0.4);
102 local = OnePole.ar(local, -0.08);
104 local = Rotate2.ar(local[0], local[1], 0.2);
106 local = DelayN.ar(local, 0.25, 0.25);
108 local = LeakDC.ar(local);
109 local = ((local + in) * 1.25).softclip;
116 // Resonator, must subtract blockSize for correct tuning
123 sound = DelayC.ar(imp + (play * 0.995), 1, 440.reciprocal - ControlRate.ir.reciprocal);
124 LocalOut.ar(sound); // for feedback
130 SinOsc.ar(440, 0, 0.2)