Initial work on crackle

This commit is contained in:
Raphael Forment 2023-11-17 12:55:17 +01:00
parent 49aa9cf6da
commit 476bda812e
2 changed files with 15 additions and 6 deletions

View file

@ -22,7 +22,7 @@ const fm = (osc, harmonicityRatio, modulationIndex, wave = 'sine') => {
};
const waveforms = ['sine', 'square', 'triangle', 'sawtooth'];
const noises = ['pink', 'white', 'brown'];
const noises = ['pink', 'white', 'brown', 'crackle'];
export function registerSynthSounds() {
[...waveforms, ...noises].forEach((s) => {
@ -36,7 +36,7 @@ export function registerSynthSounds() {
if (waveforms.includes(s)) {
sound = getOscillator(s, t, value);
} else {
sound = getNoiseOscillator(s, t);
sound = getNoiseOscillator(s, t, 0.002);
}
let { node: o, stop, triggerRelease } = sound;