Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// negatum-94fb0dd8
def Protect(in: GE, lo: Double, hi: Double, dyn: Boolean): GE = {
val in1 = if (lo.isInfinite && hi.isInfinite) in
else if (lo.isInfinite) in.min(hi)
else if (hi.isInfinite) in.max(lo)
else in.clip(lo, hi)
val in2 = if (dyn) LeakDC.ar(in1) else in1
in2
}
val f0: GE = Seq(18344.684, 18344.684 * 1.1)
val f1: GE = Seq(10.0, 10.0 * 1.1)
val lFCub = LFCub.ar(freq = 0.2, iphase = 0.0)
val min_0 = lFCub // min 0.2 // interesting to replace by `lFCub`
val linCongC = LinCongC.ar(freq = f0, a = 0.2, c = min_0, m = 0.2, xi = 0.2)
val min_3 = lFCub min linCongC
val min_4 = min_3 min min_0
val min_6 = min_4 min 0.0
val in_3 = Protect(min_6, -inf, inf, true)
val delay2 = Delay2.ar(in_3)
val min_23 = delay2 min 0.0
val min_24 = min_23 min min_4
val in_4 = Protect(min_24, -inf, inf, true)
val bPZ2 = BPZ2.ar(in_4)
val min_29 = 0.0 min bPZ2
val min_30 = linCongC min min_29
val rq_1 = Protect(min_3, 0.01, 100.0, false)
val k = MidEQ.ar(in_3, freq = f1, rq = rq_1, gain = min_6)
val min_43 = 0.0 min k
val min_44 = min_43 // min_43 min ring1
val scaleneg = min_43 scaleNeg min_6
val standardL = StandardL.ar(freq = min_6, k = k, xi = scaleneg, yi = 0.0)
val in_6 = Protect(standardL, -inf, inf, true)
val in_7 = min_6 min standardL
val min_55 = min_44 min in_6
val min_56 = min_55 min min_30
val in_10 = Protect(min_4, -inf, inf, true)
val coeff_0 = Protect(min_6, -0.999, 0.999, false)
val integrator = Integrator.ar(in_10, coeff = coeff_0)
val timeDown_0 = Protect(k, 0.0, 30.0, false)
val lag2UD = Lag2UD.ar(in_3, timeUp = 0.0, timeDown = timeDown_0)
val rq_2 = Protect(lag2UD, 0.01, 100.0, false)
val bPF = BPF.ar(in_6, freq = f1, rq = rq_2)
val min_60 = min_6 min bPF
val lFTri = LFTri.ar(freq = 0.01, iphase = 0.0)
val leakDC = LeakDC.ar(in_7, coeff = 0.8)
val linCongL = LinCongL.ar(freq = min_60, a = 1.1, c = 0.0, m = min_60, xi = bPZ2)
val mix = Mix(
Seq[GE](integrator, min_6, lFTri, leakDC, linCongL, min_56))
val sig = LeakDC.ar(mix.clip2(1.0)) * 0.5
Out.ar(0, sig)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.