Ignore superdough errors when exporting, instead skip sound.
This commit is contained in:
parent
7b74a902a2
commit
5a70599aac
1 changed files with 17 additions and 13 deletions
|
|
@ -54,13 +54,17 @@ export async function renderPatternAudio(pattern, cps, begin, end, sampleRate, d
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
haps.map(async (hap) => {
|
haps.map(async (hap) => {
|
||||||
if (hap.hasOnset()) {
|
if (hap.hasOnset()) {
|
||||||
await superdough(
|
try {
|
||||||
hap2value(hap),
|
await superdough(
|
||||||
hap.whole.begin.valueOf() / cps,
|
hap2value(hap),
|
||||||
hap.duration,
|
hap.whole.begin.valueOf() / cps,
|
||||||
cps,
|
hap.duration,
|
||||||
hap.whole?.begin.valueOf(),
|
cps,
|
||||||
);
|
hap.whole?.begin.valueOf(),
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
logger("[webaudio] An error had occured while calling superdough. Skipping hap.")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
@ -81,12 +85,12 @@ export async function renderPatternAudio(pattern, cps, begin, end, sampleRate, d
|
||||||
document.body.removeChild(a);
|
document.body.removeChild(a);
|
||||||
URL.revokeObjectURL(url);
|
URL.revokeObjectURL(url);
|
||||||
})
|
})
|
||||||
.finally(async () => {
|
// .finally(async () => {
|
||||||
setAudioContext(null);
|
// setAudioContext(null);
|
||||||
setSuperdoughAudioController(null);
|
// setSuperdoughAudioController(null);
|
||||||
resetGlobalEffects();
|
// resetGlobalEffects();
|
||||||
await initAudio();
|
// await initAudio();
|
||||||
});
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
export function webaudioRepl(options = {}) {
|
export function webaudioRepl(options = {}) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue