lichen-community-systems / Flocking

Flocking - Creative audio synthesis for the Web
GNU General Public License v2.0
697 stars 60 forks source link

flock.ugen.lfNoise and flock.ugen.whiteNoise do not generate values in the correct range #133

Open colinbdclark opened 8 years ago

colinbdclark commented 8 years ago

Currently, the lfNoise and whiteNoise unit generators produce their values by directly outputting the result of a call to Math.random(). This is incorrect, since Math.random() returns values between 0 and 1, whereas lfNoise and whiteNoise should both return values in "signal range," i.e. between -1 and 1.

While SuperCollider's documentation is somewhat ambiguous for both unit generators, other documentation clearly identifies LFNoise0 as outputting values in the -1 to 1 range.

Fixing this issue will, unfortunately, break a significant number of applications that use lfNoise to create random modulations where the code assumes its output to be between 0 and 1. Users of whiteNoise will likely be unaffected, except perhaps beneficially from the improved signal quality.