Submit
Browse
Anonymous
Login
RSS
SuperCollider Code
Fork Code: wiard noise ring, language implementation (task-based)
name
code content
q = (); q.registerSize = 7; // max 64 q.rbuf = ((2**q.registerSize).asInteger).rand; // parameters, can be changed while playing // The higher change, the greater the chance for a new value q.change = 0.1; // The higher chance, the greater the chance the new value is HIGH q.chance = 0.5; q.waitTime = 0.01; // in seconds ( q.ror = {|q, x, shift, numBits| // shift right by m bits, input x is a number with numBits bits: var lsbs = x & ((1 << shift) - 1); (x >> shift) | (lsbs << (numBits-shift)); }; // do one step q.step = {|q, rbuf, change, chance| // rotate rbuf = q.ror(rbuf, 1, q.registerSize); // rbuf.asBinaryDigits(7).postln; (change.coin).if{ // swap bit //rbuf = rbuf.bitXor(1); rbuf = rbuf.setBit(0, chance.coin.postln); "+++++++ change!>>".postln; }; rbuf; // return (altered) item }; ( Tdef(\steppr, { loop{ q.rbuf = q.step(q.rbuf, q.change, q.chance); // debug output // q.rbuf.asArray.postln; // play the current note, can be basically everything ( midinote: q.rbuf, sustain: 0.01, dur: 0.2, amp: 0.2 ).play; q.waitTime.wait; } }) ); ) // start Tdef(\steppr).play // stop Tdef(\steppr).stop
code description
"In latter model synthesizers, digital noise sources began to appear in place of analog ones. Traditionally, a psuedo-random shift register set up for optimal length. By optimal length, it is meant that every state of all available bits will appear at some time, but the order is unknown. Essentially a counter that counts in an unknown order. This represents the maximum state of information "entropy" available for that number of bits. But music has close self-similarity over short periods of time. That is, it repeats itself with changes appearing slowly. This shift register generator is designed to give control of the rate of appearance of new information. It has a tight set of controls over how random it actually is and how fast change occurs. (text from http://mamonu.weebly.com/wiard-noisering.html)
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