Move things around to allow selection by name and avoid circular imports; fixed chebyshev

This commit is contained in:
Aria 2025-09-04 11:47:01 -05:00
parent bb982e6b9b
commit 42ab65abdb
12 changed files with 142 additions and 106 deletions

View file

@ -13,6 +13,7 @@ import { createFilter, gainNode, getCompressor, getDistortion, getWorklet, webAu
import { map } from 'nanostores';
import { logger, errorLogger } from './logger.mjs';
import { loadBuffer } from './sampler.mjs';
import { getAudioContext } from './audioContext.mjs';
export const DEFAULT_MAX_POLYPHONY = 128;
const DEFAULT_AUDIO_DEVICE_NAME = 'System Standard';
@ -193,25 +194,6 @@ export function setVersionDefaults(version) {
export const resetLoadedSounds = () => soundMap.set({});
let audioContext;
export const setDefaultAudioContext = () => {
audioContext = new AudioContext();
return audioContext;
};
export const getAudioContext = () => {
if (!audioContext) {
return setDefaultAudioContext();
}
return audioContext;
};
export function getAudioContextCurrentTime() {
return getAudioContext().currentTime;
}
let workletsLoading;
function loadWorklets() {
if (!workletsLoading) {