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