level down soundfonts
+ do not load in prebake (breaks static rendering) + instead load on import
This commit is contained in:
parent
ac148b2f32
commit
ff412f6396
3 changed files with 9 additions and 3 deletions
|
|
@ -126,13 +126,18 @@ export function registerSoundfonts() {
|
|||
const bufferSource = await getFontBufferSource(instrument, note || n, ctx);
|
||||
bufferSource.start(time);
|
||||
const stop = (time) => bufferSource.stop(time);
|
||||
const g = new GainNode(ctx, { gain: 0.3 });
|
||||
bufferSource.connect(g);
|
||||
bufferSource.onended = () => {
|
||||
bufferSource.disconnect();
|
||||
g.disconnect();
|
||||
onended();
|
||||
};
|
||||
return { node: bufferSource, stop };
|
||||
return { node: g, stop };
|
||||
},
|
||||
{ type: 'soundfont', prebake: true },
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
registerSoundfonts();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue