Pmcvoss 1/f noise generator
superclass: Pvoss
This class implements James McCartney's variant on the Gardner-Voss algorithm for 1/f noise. In the original Gardner-Voss algorithm, the number of calculations varies from value to value -- it isn't time-constant to evaluate. This version rearranges the calculations so that only one random number generator has to be updated per output value, for improved efficiency.
More on the difference between these algorithms may be found at:
http://swiki.hfbk-hamburg.de:8888/MusicTechnology/738
See also: Pvoss
Pmcvoss(lo, hi, generators, length)
lo, hi lower and upper boundary of values (default: 0.0 and 1.0)
generators number of random number generators to use (default: 8)
length number of values produced (default: inf)
The higher the number of generators, the smoother the signal.
// plot
(a = Pmcvoss.new.asStream.nextN(350)).plot(minval: a.minItem.floor, maxval: a.maxItem.ceil);
// for pitch (non-tempered) -- default number of generators
p = Pbind(
\midinote, Pmcvoss(48, 72),
\dur, 0.125
).play;
p.stop;
// for pitch (non-tempered) -- fewer generators = 4
// leaps between notes are larger on average
p = Pbind(
\midinote, Pmcvoss(48, 72, 4),
\dur, 0.125
).play;
p.stop;