WIP export UI

This commit is contained in:
Nikita 2025-10-19 23:02:20 +03:00
parent 9a47e0f11e
commit b3715dc5df
6 changed files with 134 additions and 17 deletions

View file

@ -270,7 +270,7 @@ export class StrudelMirror {
}
async exportAudio(begin, end) {
await this.repl.evaluate(this.code, false)
this.repl.exportAudio(begin, end);
await this.repl.exportAudio(begin, end);
this.repl.scheduler.stop();
}

View file

@ -91,7 +91,7 @@ export function repl({
const stop = () => scheduler.stop();
const start = () => scheduler.start();
const exportAudio = (begin, end) => scheduler.exportAudio(begin, end);
const exportAudio = async (begin, end) => await scheduler.exportAudio(begin, end);
const pause = () => scheduler.pause();
const toggle = () => scheduler.toggle();
const setCps = (cps) => {

View file

@ -63,7 +63,7 @@ export async function renderPatternAudio(pattern, cps, begin, end) {
}
})
context.startRendering().then(async (renderedBuffer) => {
return context.startRendering().then(async (renderedBuffer) => {
console.log(renderedBuffer)
const wavBuffer = audioBufferToWav(renderedBuffer);
const blob = new Blob([wavBuffer], { type: 'audio/wav' });