Skip to content

Commit

Permalink
Cap noise amount to 1
Browse files Browse the repository at this point in the history
  • Loading branch information
Bubobubobubobubo committed Sep 30, 2023
1 parent bb7b8c2 commit e3333e7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/superdough/synth.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ export function getOscillator({ s, freq, t, vib, vibmod, partials, noise }) {

if (noise > 0) {
// Two gain nodes to set the oscillators to their respective levels
noise = noise > 1 ? 1 : noise;
let o_gain = ac.createGain();
let n_gain = ac.createGain();
o_gain.gain.setValueAtTime(1 - noise, ac.currentTime);
Expand Down

0 comments on commit e3333e7

Please sign in to comment.