Submit
Browse
Anonymous
Login
RSS
SuperCollider Code
Fork Code: ScoreClock, Patterns, RT/NRT and server-side resources
name
code content
( p = Pbind( \instrument, \bufGrainPan, \bufnum, b, \time, Pwhite(0.1, 0.3, inf), \start, Pwhite(0.0, b.duration - Pkey(\time), inf) * b.sampleRate, \pan, Pwhite(-1.0, 1.0, inf), \delta, Pkey(\time) * Pexprand(0.8, 1.25, inf) ); q = Pseq([ (play: { // initialization event SynthDef(\bufGrainPan, { |start, time, bufnum, pan, rate = 1, amp = 1, attack = 0.001, decay = 0.02, outbus| var sig; sig = PlayBuf.ar(1, bufnum, rate * BufRateScale.kr(bufnum), 1, start, 0) * EnvGen.kr(Env.linen(attack, time, decay), doneAction:2); Out.ar(outbus, Pan2.ar(sig, pan, amp)); }).add; // NOTE: Mac OSX/Windows users need to change this for the actual location b = Buffer.read(s, Platform.systemAppSupportDir +/+ "sounds/a11wlk01.wav"); s.sync }, delta: 0), p ]); f = { // cleanup func b.debug("freeing").free }; ) s.reboot; // RT ( r = q.play; c = SimpleController(r).put(\stopped, { c.remove; f.value }); ) r.stop; // should free the buffer // NRT ( ScoreClock.beginScore; Pfindur(10, q).play(ScoreClock); // cleanup not needed since NRT server dies anyway ScoreClock.makeScore.recordNRT(PathName.tmp +/+ "osc.osc", thisProcess.platform.recordingsDir +/+ "test2.aiff", options: ServerOptions.new.numOutputBusChannels_(2), duration: 10, action: { "done".postln }); )
code description
A quick demo of one way to allocate server-side resources (SynthDefs, Buffers) that works in RT/NRT with minimal modification. You'll need Jonatan Liljedahl's ScoreClock quark: // Mac OSX / Linux Quarks.install("ScoreClock"); // Windows, see http://swiki.hfbk-hamburg.de/MusicTechnology/883
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