Submit
Browse
Anonymous
Login
RSS
SuperCollider Code
Fork Code: ChannelStrip
name
code content
/************************************************************************Mixer*******************************************************************/ ( ~aux1 = Bus.audio(s, 2); ~aux2 = Bus.audio(s, 2); SynthDef(\ChannelStrip, { arg in = 0, out = 0, pan = 0, hpfreq = 20, band1freq = 80, band1rq = 1, band1db = 0, band2freq = 1200, band2rq = 1, band2db = 0, band3freq = 8000, band3rq = 1, band3db = 0, lpfreq = 20000, mute = 1, auxsend1 = 0, auxsend2 = 0, level = 0.5; var input, sig; input = InFeedback.ar(in, 2); sig = BHiPass.ar(input, Lag2.kr(hpfreq.max(20).min(20000), 0.5)); // HPF sig = BPeakEQ.ar(sig, Lag2.kr(band1freq.max(20).min(20000), 0.5), band1rq, band1db); // Band 1 sig = BPeakEQ.ar(sig, Lag2.kr(band2freq.max(20).min(20000), 0.5), band2rq, band2db); // Band 2 sig = BPeakEQ.ar(sig, Lag2.kr(band3freq.max(20).min(20000), 0.5), band3rq, band3db); // Band 3 sig = BLowPass.ar(sig, Lag2.kr(lpfreq.max(20).min(20000), 0.5)); // LPF Out.ar(~aux1, sig * auxsend1); //aux 1 pre fader / pre mute / post eq Out.ar(~aux2, sig * auxsend2); //aux 2 pre fader / pre mute / post eq sig = sig * mute; Out.ar(out, Balance2.ar(sig[0], sig[1], pan, level.curvelin(0, 1, 0, 1, log(10)))); }).add; SynthDef(\MasterStrip, { arg in = 0, out = 0, hpfreq = 20, lpfreq = 20000, level = 0.5; var input, sig; input = In.ar(in, 2); sig = BHiPass.ar(input, Lag2.kr(hpfreq.max(20).min(20000), 0.5)); // HPF sig = BLowPass.ar(sig, Lag2.kr(lpfreq.max(20).min(20000), 0.5)); // LPF Out.ar(out, sig * level.curvelin(0, 1, 0, 1, log(10))); }).add; /**********************************************************************Sounds & Fx***************************************************************/ SynthDef(\IkedaClick, { arg out = 0, t_trig = 0, centerFreq = 15000, rq = 0.9, amp = 25, pan = 0, level = 1; var env, noise, sig; env = EnvGen.ar(Env.perc(0.001, 0.00001 * LFNoise1.kr(4).abs, 1, -4), t_trig, doneAction: 0); noise = PinkNoise.ar(env); sig = BPF.ar(noise, centerFreq.max(1), rq, amp).fold(-1, 1); Out.ar(out, Pan2.ar(sig, pan, level.curvelin(0, 1, 0, 1, log(10)))); }).add; SynthDef(\IkedaBass, { arg out = 0, t_trig = 0, pan = 0, level = 1; var env, sin, sig; env = EnvGen.ar(Env([0, 0.5, 0.4, 0], [0, 0.2, 0.01], -5), t_trig, doneAction: 0); sin = SinOsc.ar(0, (Sweep.ar(t_trig, 2pi * [52.8, 740]) + (pi/3)).wrap(-pi, pi), [2, 0.05]).mean.tanh; sig = sin * env; Out.ar(out, Pan2.ar(sig, pan, level.curvelin(0, 1, 0, 1, log(10)))); }).add; SynthDef(\Reverb, {arg in = 0, out = 0, predelaytime = 0.048, decaytimec = 5, decaytimea = 1, drywet = 0.5, level = 0.2; var input, numc, numa, temp; input = In.ar(in, 2); numc = 4; // number of comb delays numa = 6; // number of allpass delays temp = DelayN.ar(input, 0.1, predelaytime); temp = Mix.fill(numc, { CombL.ar(temp, 0.1, rrand(0.01, 0.1), decaytimec) }); numa.do({ temp = AllpassN.ar(temp, 0.051, [rrand(0.01, 0.05), rrand(0.01, 0.05)], decaytimea) }); XOut.ar(out, drywet, temp * level.curvelin(0, 1, 0, 1, log(10))); }).add; SynthDef(\SimpleDelay, { arg in = 0, out = 0, delaytime = 0.1; var input, effect; input = In.ar(in, 2); effect = DelayN.ar(input, 1, delaytime); ReplaceOut.ar(out, effect); // overwriting previous data on the corresponding bus }).add; ) /**********************************************************************Routing*******************************************************************/ ( var channels, masterBus; masterBus = Bus.audio(s, 2); ~masterBus = Synth(\MasterStrip, [\in, masterBus], addAction: 'addToTail'); channels = Array.newClear(4); // number of channels channels.size.do { arg i; channels[i] = Bus.audio(s, 2); currentEnvironment.put((\channel ++ i).asSymbol, Synth(\ChannelStrip, [\in, channels[i], \out, masterBus])); }; ~ikedaClick = Synth(\IkedaClick, [\out, channels[0]]); ~ikedaBass = Synth(\IkedaBass, [\out, channels[1]]); ~reverb = Synth(\Reverb, [\in, ~aux1, \out, channels[2]], ~masterBus, 'addBefore'); ~simpleDelay = Synth(\SimpleDelay, [\in, ~aux2, \out, channels[3]], ~masterBus, 'addBefore'); ) /**********************************************************************Actions*******************************************************************/ // Synth actions ~ikedaClick.set(\t_trig, 1, \level, 0.2); ~ikedaBass.set(\t_trig, 1); // Mixer actions // Channel 0 = Click ~channel0.set(\auxsend1, 0.9); // aux 1 => Reverb ~channel0.set(\auxsend1, 0); ~channel0.set(\auxsend2, 0.8); // aux 2 => Delay ~channel0.set(\auxsend2, 0); // Channel 1 = Bass ~channel1.set(\auxsend1, 1); // aux 1 => Reverb ~channel1.set(\auxsend1, 0); ~channel1.set(\auxsend2, 0.8); // aux 2 => Delay ~channel1.set(\auxsend2, 0); // Channel 2 = Reverb ~channel2.set(\auxsend1, 0.08); // aux 1 => Reverb ~channel2.set(\auxsend1, 0); ~channel2.set(\auxsend2, 0.5); // aux 2 => Delay ~channel2.set(\auxsend2, 0); // Channel 3 = Delay ~channel3.set(\auxsend1, 0.25); // aux 1 => Reverb ~channel3.set(\auxsend1, 0); ~channel3.set(\auxsend2, 0.5); // aux 2 => Delay ~channel3.set(\auxsend2, 0); // Master ~masterBus.set(\hpfreq, 20, \lpfreq, 200); ~masterBus.set(\hpfreq, 20, \lpfreq, 20000);
code description
A channel strip and master bus SynthDef to create your own mixer, be carefull cause you can create feedback loops by feeding channel A into channel B and vice versa...(it's the aim here) Thank you to Batuhan Bozkurt for his sound inspired by Ikeda
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