A UGen that reads buses that are local to the enclosing synth. These buses
should be written using a LocalOut
ugen. They behave like regular buses, but
are more convenient for the implementation of a self contained effect that uses
a feedback processing loop.
In a synth, there can be only each one control-rate and audio-rate LocalIn
/
LocalOut
pair. The signal written to a LocalOut
will not be read by the
LocalIn
until the next control block cycle, introducing a delay of
ControlDur
.
'''Warning''': The argument has been changed numChannels: Int
in version
1.15.3 to init: GE
in version 1.16.0. The previous version was incompatible
with SuperCollider 3.6.x. A previous usage such as LocalIn.ar(2)
to create two
channels must now be expressed as LocalIn.ar(Seq(0, 0))
!
===Examples===
// ping-pong delay with feedback
play {
val src = Decay.ar(Impulse.ar(0.3), 0.1) * WhiteNoise.ar(0.2)
val in = LocalIn.ar(Seq(0, 0)) + Seq[GE](src, 0) // read feedback, add source to left chan
val dly = DelayN.ar(in, 0.2, 0.2) // delay sound
val att = dly * 0.8 // apply decay factor
// reverse channels to give ping pong effect
LocalOut.ar(Seq(att.out(1), dly.out(0)))
dly
}
// tank
play {
val tones = Mix.fill(12) {
Pan2.ar(
Decay2.ar(Dust.ar(0.05), 0.1, 0.5) * 0.1 *
FSinOsc.ar(IRand(36,84).midiCps).cubed.max(0),
Rand(-1,1))
}
val gen = tones + Pan2.ar(Decay2.ar(Dust.ar(0.03), 0.04, 0.3) * BrownNoise.ar, 0)
val verb = Mix.fold(gen, 4) { z =>
AllpassN.ar(z, 0.03, Seq.fill(2)(Rand(0.005,0.02)), 1)
}
val in = LocalIn.ar(Seq(0, 0)) * 0.98
val flt = OnePole.ar(in, 0.5)
val pan = Rotate2.ar(flt.out(0), flt.out(1), 0.23)
val v1 = AllpassN.ar(pan, 0.05, Seq.fill(2)(Rand(0.01,0.05)), 2)
val v2 = DelayN.ar(v1, 0.3, Seq(0.19,0.26))
val v3 = AllpassN.ar(v2 , 0.05, Seq.fill(2)(Rand(0.03,0.15)), 2)
val out = LeakDC.ar(v3)
val sig = gen + out
LocalOut.ar(sig)
sig
}
// resonator
play {
val imp = Impulse.ar
val in = LocalIn.ar
val feed = imp + in * 0.995
// must subtract block-size for correct tuning
// (try removing the ControlDur to here the pitch change)
val time = 440.reciprocal - ControlDur.ir
val dly = DelayC.ar(feed, time, time)
LocalOut.ar(dly)
// alternate between feedback and reference pitch
val comp = Seq(dly, SinOsc.ar(440) * 0.2): GE
comp * LFPulse.kr(1, Seq(0.0, 0.5))
}
- See also
- Companion
- class
Type members
Value members
Concrete methods
- Value Params
- init
the initial state of the UGen. The number of channels of this signal should match with the number of channels written via
LocalOut
.