Submit
Browse
Anonymous
Login
RSS
SuperCollider Code
Fork Code: wiard noise ring variation using a ringbuffer instead of bitshifting, language implementation (task-based)
name
code content
q = (); q.registerSize = 16; q.rbuf = RingBuffer(q.registerSize); // parameters, can be changed while playing q.min = "C2".namemidi.asInteger; q.max = "C6".namemidi.asInteger; q.waitTime = 0.05; // in seconds q.chance = 0.1; q.change = 10; // step size ( // initialise q.registerSize.do{ q.rbuf.overwrite(rrand(q.min, q.max)); }; // do one step q.step = {|q, rbuf, chance, step, min, max| var item; item = rbuf.pop; (chance.coin).if{ // apply brown noise, bounce back from constraints. //"+++++++ change! % >> ".postf(item); item = (item + step.xrand2).fold(min, max); item; //.postln; }; rbuf.add(item); item; // return (altered) item }; ( Tdef(\steppr, { var midinote; loop{ midinote = q.step(q.rbuf, q.chance, q.change, q.min, q.max); // debug output // q.rbuf.asArray.postln; // play the current note, can be basically everything ( midinote: midinote, sustain: 0.05, dur: 0.2, amp: 0.2 ).play; q.waitTime.wait; } }) ); ) // start Tdef(\steppr).play // stop Tdef(\steppr).stop
code description
wiard noise ring variation using a ringbuffer instead of bitshifting. Reimplemented according to Julian Parker's m4l patch.
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