TITLE:: DNoiseRing
summary:: Demand rate implementation of a Wiard noise ring
categories:: UGens>Demand, UGens>Generators>Chaotic
RELATED:: Overviews/DEIND, Classes/Duty, Classes/Demand


DESCRIPTION::
Demand rate implementation of a Wiard noise ring.

EMPHASIS::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)

Developed as part of the LINK::Overviews/DEIND:: project.

CLASSMETHODS::
private:: categories

METHOD:: new
change = 0.5, chance = 0.5, shift = 1, numBits = 8, resetval = 0;

argument::change
The higher change, the greater the chance for a new value
 
argument::chance
The higher chance, the greater the chance the new value is HIGH

argument::shift
not yet implemented.

argument::numBits
not yet implemented.

argument::resetval
Initial value

returns::
A Demand rate UGen.

EXAMPLES::

Plot

code::
{
Demand.ar(Impulse.ar(1000), 0, DNoiseRing(change: 0.1, numBits: 32)) * (2**32).reciprocal
}.plot(1)
::

Plain 32bit value scaled to 0..1 and out of the speaker

code::
{Demand.ar(Impulse.ar(10000), 0, DNoiseRing(change: MouseX.kr(0, 1), chance: 0.51, numBits: 32)) * (2**32).reciprocal}.play
::

As a sequencer

code::
{
var freq = (Demand.ar(Impulse.ar(10), 0, DNoiseRing(change: MouseX.kr(0, 1), chance: MouseY.kr(0, 1), numBits: 32))).linlin(0, 2**32, 40, 40+48).midicps.poll;
	
	SinOsc.ar(freq)!2
}.play
::