mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2024-12-22 12:50:36 +01:00
Also fake array entries that contain zero.
This commit is contained in:
parent
df5109bbf6
commit
f7a0990a29
@ -83,7 +83,14 @@
|
||||
var noiseLevel = getAudioNoiseLevel(prefs);
|
||||
var rng = randomSupply.getRng(rate, window);
|
||||
forEachIndex(array, prefs, function(index, i){
|
||||
array[index] *= 1 + (rng(i) / 0xffffffff - 0.5) * noiseLevel;
|
||||
let value;
|
||||
if (array[index] !== 0){
|
||||
value = array[index] * (1 + (rng(i) / 0xffffffff - 0.5) * noiseLevel);
|
||||
}
|
||||
else {
|
||||
value = Number.EPSILON * (rng(i) / 0xffffffff - 0.5) * noiseLevel;
|
||||
}
|
||||
array[index] = value;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user