Submit
Browse
Anonymous
Login
RSS
SuperCollider Code
Fork Code: OSC etude #1
name
code content
// OSC etude 1 ( s = Server.local; s.options.sampleRate_(44100); s.options.memSize_(65536 * 4); s.boot; // global variables and buses ~out = 0; // make buses ~makeBuses = {~revBus = Bus.audio(s, 2)}; // make nodes ~makeNodes = { s.bind({ ~mGr = Group.new; // marimba group ~effects = Group.after(~mGr); ~reverb = Synth(\reverb, [\in, ~revBus, \out, ~out], ~effects, addAction:\addToTail); }); }; ~cleanup = { s.freeAll; Buffer.freeAll; OSCdef.freeAll; s.newBusAllocators; ServerBoot.removeAll; ServerTree.removeAll; ServerQuit.removeAll; }; // register functions ServerBoot.add(~makeBuses); ServerQuit.add(~cleanup); // OSCdefs OSCdef.new(\multi1, { arg msg; //[msg].postln; ~marimba[0].set(\rq, msg[1].linlin(0.0,1.0,0.03,0.007)); ~marimba[0].set(\cf, msg[2].linlin(0.0,1.0,110,880)); }, '/touch1' ); OSCdef.new(\multi2, { arg msg; //[msg].postln; ~marimba[1].set(\rq, msg[1].linlin(0.0,1.0,0.03,0.007)); ~marimba[1].set(\cf, msg[2].linlin(0.0,1.0,110,880)); }, '/touch2' ); OSCdef.new(\multi3, { arg msg; //[msg].postln; ~marimba[2].set(\rq, msg[1].linlin(0.0,1.0,0.03,0.007)); ~marimba[2].set(\cf, msg[2].linlin(0.0,1.0,110,880)); }, '/touch3' ); s.waitForBoot({ s.sync; // SynthDefs SynthDef(\marimba, { var sig, env, rq; rq = \rq.kr(0.03); env = Env.asr(\atk.ir(0.25), 0.5, \rel.ir(1)).kr(2, \gate.kr(1)); sig = LFSaw.ar( LFNoise1.kr( LFNoise1.kr(6).range(\rmin.kr(2), \rmax.kr(16)), 0.9, ).exprange(\fmin.kr(4),\fmax.kr(12)) )!2; sig = BPF.ar(sig, \cf.kr(200), rq, 1/rq.sqrt); sig = sig * env * \amp.kr(0.45); Out.ar(\out.ir(~out), sig * \dry.kr(1)); Out.ar(\fx.ir(~revBus), sig * (1-\dry.kr(1))) }).add; // my go-to reverb SynthDef.new(\reverb, { var sig; sig = JPverb.ar( In.ar(\in.ir(~revBus), 2), \rtime.kr(4), \damp.kr(0.75), \size.kr(4.5), \earlyDiff.kr(0.8), \modDepth.kr(0.12), \modFreq.kr(2), \low.kr(1), \mid.kr(0.9), \high.kr(0.8) ); sig = sig * \revAmp.kr(0.5); Out.ar(\out.kr(~out), sig); }).add; s.sync; ServerTree.add(~makeNodes); s.freeAll; s.sync; "done".postln; }); ) // start performance; modulate up to three of the "marimbas" via multitouch on Sensors2Osc ( ~marimba = 3.collect{ Synth(\marimba, [\rq, 0.008, \cf, (Scale.minorPentatonic.degrees+49).choose.midicps, \dry, rrand(0.25,0.45)], ~mGr); }; ) // record if wanted s.record; s.stopRecording; // stop performance ~mGr.set(\gate, 0); s.quit;
code description
3 bandpass-filtered sawtooth waves, center frequency of bandpass filter modulated by OSC via the multitouch feature of Sensors2Osc
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