Some missing cleanup

This commit is contained in:
Aria
2025-09-04 20:51:06 -05:00
parent 1205573bc6
commit 46a45b4596
3 changed files with 5 additions and 9 deletions
+4 -7
View File
@@ -686,13 +686,8 @@ export const superdough = async (value, t, hapDuration, cps = 0.5, cycle = 0.5)
let sourceNode;
if (source) {
sourceNode = source(t, value, hapDuration, cps);
} else {
const soundSource = wt ?? s;
const sound = getSound(soundSource);
if (!sound) {
throw new Error(`sound ${soundSource} not found! Is it loaded?`);
}
const { onTrigger } = sound;
} else if (getSound(s)) {
const { onTrigger } = getSound(s);
const onEnded = () => {
audioNodes.forEach((n) => n?.disconnect());
activeSoundSources.delete(chainID);
@@ -703,6 +698,8 @@ export const superdough = async (value, t, hapDuration, cps = 0.5, cycle = 0.5)
sourceNode = soundHandle.node;
activeSoundSources.set(chainID, soundHandle);
}
} else {
throw new Error(`sound ${s} not found! Is it loaded?`);
}
if (!sourceNode) {
// if onTrigger does not return anything, we will just silently skip
-1
View File
@@ -909,7 +909,6 @@ class ByteBeatProcessor extends AudioWorkletProcessor {
registerProcessor('byte-beat-processor', ByteBeatProcessor);
export const WarpMode = Object.freeze({
NONE: 0,
ASYM: 1,
@@ -312,7 +312,7 @@ export function SettingsTab({ started }) {
confirmDialog('Sure?').then((r) => {
if (r) {
const { userPatterns } = settingsMap.get(); // keep current patterns
settingsMap.set({...defaultSettings, userPatterns});
settingsMap.set({ ...defaultSettings, userPatterns });
}
});
}}