Format
This commit is contained in:
parent
6baca67cd3
commit
fe70a2df43
2 changed files with 18 additions and 2 deletions
|
|
@ -39,7 +39,16 @@ export const webaudioOutput = (hap, _deadline, hapDuration, cps, t) => {
|
|||
return superdough(hap2value(hap), t, hapDuration, cps, hap.whole?.begin.valueOf());
|
||||
};
|
||||
|
||||
export async function renderPatternAudio(pattern, cps, begin, end, sampleRate, maxPolyphony, multiChannelOrbits, downloadName = undefined) {
|
||||
export async function renderPatternAudio(
|
||||
pattern,
|
||||
cps,
|
||||
begin,
|
||||
end,
|
||||
sampleRate,
|
||||
maxPolyphony,
|
||||
multiChannelOrbits,
|
||||
downloadName = undefined,
|
||||
) {
|
||||
let audioContext = getAudioContext();
|
||||
await audioContext.close();
|
||||
audioContext = new OfflineAudioContext(2, ((end - begin) / cps) * sampleRate, sampleRate);
|
||||
|
|
|
|||
|
|
@ -204,7 +204,14 @@ export default function ExportModal(Props) {
|
|||
setStrudelMaxPolyphony(maxPolyphony);
|
||||
setStrudelMultiChannelOrbits(multiChannelOrbits);
|
||||
setTimeout(refreshProgress, 1000);
|
||||
await handleExport(startCycle, endCycle, sampleRate, maxPolyphony, multiChannelOrbits, downloadName).finally(() => {
|
||||
await handleExport(
|
||||
startCycle,
|
||||
endCycle,
|
||||
sampleRate,
|
||||
maxPolyphony,
|
||||
multiChannelOrbits,
|
||||
downloadName,
|
||||
).finally(() => {
|
||||
setExporting(false);
|
||||
const modal = document.getElementById('exportModal');
|
||||
setProgress(0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue