fix: double registering

This commit is contained in:
Felix Roos 2023-08-30 15:32:45 +02:00
parent 1463f27a0f
commit 90cdea3656
4 changed files with 8 additions and 20 deletions

View file

@ -21,21 +21,6 @@ const fm = (osc, harmonicityRatio, modulationIndex, wave = 'sine') => {
};
export function registerSynthSounds() {
['zsine', 'zsaw', 'ztri', 'ztan', 'znoise'].forEach((wave) => {
registerSound(wave, (t, value, onended) => {
const duration = 0.2;
const { node: o } = getZZFX({ s: wave, ...value }, t, duration);
o.onended = () => {
o.disconnect();
onended();
};
return {
node: o,
stop: () => {},
};
});
});
['sine', 'square', 'triangle', 'sawtooth'].forEach((wave) => {
registerSound(
wave,