fix: double registering
This commit is contained in:
parent
1463f27a0f
commit
90cdea3656
4 changed files with 8 additions and 20 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue