webaudio optimizations

- samples with obejct format for pitch declaration
- support note to repitch samples
- support choke to fit samples to hap duration
- support "legacy" context.velocity in .out
- support ":" inside s or note to set n
- fix sample fadeout for soundfonts and choke
- move gain before filters
This commit is contained in:
Felix Roos 2022-06-27 00:01:28 +02:00
parent eca76dd7c4
commit c1ce72469c
4 changed files with 91 additions and 25 deletions

View file

@ -16,6 +16,9 @@ async function loadFont(name) {
}
export async function getFontBufferSource(name, pitch, ac) {
if (typeof pitch === 'string') {
pitch = toMidi(pitch);
}
const { buffer, zone } = await getFontPitch(name, pitch, ac);
const src = ac.createBufferSource();
src.buffer = buffer;