add freq support to sampler

This commit is contained in:
Felix Roos 2022-12-12 20:41:09 +01:00
parent 8b22c2e04f
commit df73ce8a60
5 changed files with 43 additions and 8 deletions

View file

@ -288,10 +288,10 @@ export const webaudioOutput = async (hap, deadline, hapDuration) => {
if (soundfont) {
// is soundfont
bufferSource = await globalThis.getFontBufferSource(soundfont, note || n, ac);
bufferSource = await globalThis.getFontBufferSource(soundfont, note || n, ac, freq);
} else {
// is sample from loaded samples(..)
bufferSource = await getSampleBufferSource(s, n, note, speed);
bufferSource = await getSampleBufferSource(s, n, note, speed, freq);
}
// asny stuff above took too long?
if (ac.currentTime > t) {