«Shift register patch» by david_morgan
on 26 Jan'18 16:45 in1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
/* Shift register code adapted from here: "http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/serial-in-parallell-out-shift-register-ugen-td6331387.html" */ ( ~shift_register = {arg length = 5, trig, in; var buf = LocalBuf(length); var count = PulseCount.kr(trig); Demand.kr(trig, 0, Dbufwr(in, buf, count)); Demand.kr(trig, 0, Dbufrd(buf, count + (1..length))).reverse; }; Ndef(\n1, { var amp = 0.1; var pulse = Impulse.kr(1/16); var rate = TChoose.kr(pulse, [3,5,10]); var trans = TChoose.kr(pulse, [0,2,-2,7,-5]); //var trig = Impulse.kr([3,5]/2); var trig = Trig1.kr(CuspL.ar(rate * 3), 0.001); var octave = Demand.kr(PulseDivider.kr(trig, 4), 0, Drand([12,-12], inf)); var note = Demand.kr(trig, 0, Dseq([42,46,51,54,59,63,66].scramble + trans, inf) + octave); var chord = ~shift_register.(5, trig, note); var sig = PMOsc.ar( Vibrato.ar(K2A.ar(chord.midicps)), chord.midicps * LFPulse.kr(1/8).range(1.01, 2.01), Env([3,3,0],[0, 0.2], -4).kr(gate:trig) ); sig = sig * AmpCompA.kr(chord.midicps) * amp; sig = sig.flatten.sum; sig = XFade2.ar(sig!2, GVerb.ar(BPF.ar(sig, 90.midicps), roomsize:50, revtime:8, drylevel:0), 0.2); sig; }).play(fadeTime:4); )
reception
Lovely. Really lovely. And funny. Serial pareil parrallell (ohhgram).
so cool