Submit
Browse
Anonymous
Login
RSS
SuperCollider Code
Fork Code: windter
name
code content
s.options.numOutputBusChannels = 16; s.reboot; ( var amp = 0.1; var isDolby = true; isDolby.if({ SynthDef(\sortChannels, { var ins = In.ar(0, 8) ++ Silent.ar(8); ins = ins * 0.9; ins = ins.tanh; [0, 2, 1, 5, 7, 12, 6, 4, 3, 8, 9, 10, 11, 13, 14, 15].do{|idx, i| ReplaceOut.ar(idx, ins[i]) }; }).add; }, { SynthDef(\sortChannels, { Silent.ar(1); // do nothing }).add; }) // intro White SynthDef(\introWhite, { var pink, white, whiter, whiter2, crackle, out; crackle = {LPF.ar(Dust.ar(1000), 50, mul: 20)}!8; whiter = { HPF.ar(WhiteNoise.ar, XLine.kr(4000, 10000, 10), mul: XLine.kr(0.1, 10, 10)) }!8; white = {WhiteNoise.ar}!8; pink = {PinkNoise.ar}!8; out = SelectX.ar( EnvGen.ar(Env([0, 3, 3, 0], [0.1, 9.8, 0.1])), [crackle, pink, white, whiter] ).tanh * EnvGen.ar(Env([0, 1, 1, 0], [0, 10, 0]), doneAction: 2) * amp; Out.ar(0, out) }).add; // White + shake SynthDef(\whiteshake, {|lFreq=67| var pink, white, whiter, whiter2, crackle, out; crackle = {Crackle.ar(Line.kr(1, 2.1, 10))}!8; whiter = { HPF.ar(WhiteNoise.ar, Line.kr(4000, 16000, 10), mul: Line.kr(1, 5, 10)) + RLPF.ar(Pulse.ar(Line.ar(1, 0.9, 10) * 25, Rand(0, 1)), 400, mul: 20) + RLPF.ar(Impulse.ar(Line.ar(1, 1.1, 10) * 50, Rand(0, 1)), 200, mul: 20) + RLPF.ar(Impulse.ar(Line.ar(1, 0.8746, 10) * 75, Rand(0, 1)), 100, mul: 20) }!8; whiter2 = { //HPF.ar( ClipNoise.ar // , Line.kr(4000, 16000, 10) // , mul: Line.kr(1, 100, 10)) }!8; white = {WhiteNoise.ar}!8; pink = {PinkNoise.ar}!8; out = SelectX.ar( EnvGen.ar(Env([0, 1, 4, 4, 2, 1, 1, 3], [0.1, 0.1, 3.7, 0.1, 0.1, 2, 1])), [crackle, pink, white, whiter2, whiter] ).tanh * RLPF.ar(Pulse.ar(Line.ar(1, rrand(0.9, 1.1), 10) * 100, rrand(0.5, 1.0)), lFreq, rq: 0.01, mul: 20) * EnvGen.ar(Env([0, 1, 1, 0], [0, 10, 0]), doneAction: 2) * amp * 0.2; Out.ar(0, out.tanh) }).add; // Impulses SynthDef(\impulses, {|freq = 5, i = 0, hFreq = 1000| var out = SplayAz.ar( 8, ({|j| HPF.ar(Impulse.ar(freq, j/20), hFreq)}!20).scramble, EnvGen.ar(Env([0, 0, 0.1, 0.2, 0.5], [0.5, 2, 3, 4.5])), center: Line.ar(i.sign * 4, 0, 10) + (i/4) ).postln * EnvGen.ar(Env([0, 1, 1, 0], [0, 10, 0]), doneAction: 2) * amp * 40; Out.ar(0, out) }).add; thisThread.randSeed = [5651, 561, 51, 54, 54349857].choose.postln; // karussel SynthDef(\karussel, {|scaling = 0| var channels = #[0, 1, 2, 3, 4, 5, 6, 7]; var allEight; var out; allEight = (12.collect{|i| var freq = (rrand(10, 40).degreeToKey([0, 3, 6, 9] + scaling) * LFPulse.kr(2).range(2, 1)) .midicps * EnvGen.ar(Env([0.125, 1, 1, 0], [0.5, 8.5, 1]), doneAction: 2) * LFNoise1.ar(10).range(0.98, 1.02); var a, b; var out; var trig; trig = Impulse.ar(1, i/8); #a, b = Pan2.ar( SinOsc.ar(freq, 0, XLine.kr(10, 1, 10)).tanh * EnvGen.ar(Env.perc(0.001, rrand(0.1, 0.5)), gate: trig), EnvGen.ar(Env.perc(0, 1), gate: trig) ); channels = channels.scramble; out = 0!8; out[channels.first] = a; out[channels.last] = b; }.sum + (Silent.ar!8))* 0.5; out = SplayAz.ar(8, allEight, Line.ar(0, 2, 5), center: Line.kr(16, 0, 10)) * EnvGen.ar(Env([0, 1, 1, 0], [0, 10, 0]), doneAction: 2) * amp * 10; Out.ar(0, out.postln) }).add; thisThread.randSeed = 54349857; // Roundnround SynthDef(\roundnround, {|scaling = 0| var in, pos, out; var freq = (({rrand(5, 20)}!5).degreeToKey([0, 3, 6, 9] + scaling)) .midicps * LFNoise1.ar(10).range(0.98, 1.02); in = SinOsc.ar(freq, Rand(0, pi), mul: Line.kr(10, 1, 5)).tanh; pos = {HPF.ar( WhiteNoise.ar.lag( Line.kr(0.05, 0, 9.5) ), Line.kr(50, 20000, 9)) + rrand(0.0, 2) }!5 + SinOsc.ar(0.01 //XLine.kr(0.1, 1, 10).range(0, 2) ); out = PanAz.ar( 8, in, pos ).sum * EnvGen.ar(Env([0, 1, 1, 0], [0, 10, 0]), doneAction: 2) * amp * 2; Out.ar(0, out) }).add; // outro White SynthDef(\outroWhite, { var pink, white, whiter, whiter2, crackle, monowhiter, polywhiter, out; crackle = {LPF.ar(Dust.ar(1000), 50, mul: 20)}!8; whiter = { HPF.ar(WhiteNoise.ar, XLine.kr(10000, 4000, 10), mul: XLine.kr(10, 0.5, 10)) }!8; white = {WhiteNoise.ar}!8; pink = {PinkNoise.ar}!8; polywhiter = { HPF.ar(WhiteNoise.ar, 4000, mul: 0.5) }!8; monowhiter = ( HPF.ar(WhiteNoise.ar, 4000, mul: 0.5) )!8; out = SelectX.ar( EnvGen.ar(Env([2, 5, 5, 2, 1, 0], [0.1, 9.8, 0.1, 0, 5])), [polywhiter, monowhiter, crackle, pink, white, whiter] ).tanh * EnvGen.ar(Env([0, 1, 1, 0], [0, 15, 5]), doneAction: 2) * amp; Out.ar(0, out) }).add; SynthDef(\sortChannels, { var ins = In.ar(0, 8) ++ Silent.ar(8); ins = ins * 0.9; ins = ins.tanh; [0, 2, 1, 5, 7, 12, 6, 4, 3, 8, 9, 10, 11, 13, 14, 15].do{|idx, i| ReplaceOut.ar(idx, ins[i]) }; }).add; ) ( { var dt, playGroup, sorter; dt = 4.6; playGroup = Group(); s.sync; sorter = Synth.after(playGroup, \sortChannels); dt.wait; Synth.grain(\introWhite, target: playGroup); 10.wait; dt.wait; Synth.grain(\impulses, [\freq, 12, \i, 0, \hFreq, 5000], target: playGroup); 12.wait; [0, -2, 3, 0].do{|scale| [8, 12, 5, 10, 14, 16, 12].do{|freq, i| Synth.grain(\impulses, [\freq, freq-scale, \i, i-scale, \hFreq, 5000], target: playGroup); 1.wait }; 11.wait; }; dt.wait; [50, 67, 60, 50].do{|lfreq| Synth.grain(\whiteshake, [\lfreq, lfreq], target: playGroup); 11.5.wait; }; dt.wait; [0, -1, 3, 0].do{|scale| Synth.grain(\karussel, [\scaling, scale], target: playGroup); 11.wait; }; dt.wait; [0, -1, 3, 0].do{|scale| Synth.grain(\roundnround, [\scaling, scale], target: playGroup); 11.5.wait; }; dt.wait; Synth.grain(\outroWhite, target: playGroup); 20.wait; sorter.free; }.fork )
code description
An 8-channel fixed-media piece arranged and composed Till Bovermann aka LFSaw for the 2011 edition of 4for8, Helsinki.
use markdown for formating
category tags
comma separated, i.g. "wild, siren" (do not enter default SC class names, please)
ancestor(s)
comma separated identificators, i.g. "1-C,1-1,1-4M,1-x"
Private?
the code will be accessible by direct url and not visible in public activity
signup to submit public code without captcha
comment of change