Remove webaudio from core dependencies
This commit is contained in:
parent
2a0635879c
commit
0f652e8b5b
5 changed files with 24 additions and 38 deletions
|
|
@ -268,11 +268,6 @@ export class StrudelMirror {
|
|||
this.flash();
|
||||
await this.repl.evaluate(this.code);
|
||||
}
|
||||
async exportAudio(begin, end, sampleRate, downloadName = undefined) {
|
||||
await this.repl.evaluate(this.code, false);
|
||||
await this.repl.exportAudio(begin, end, sampleRate, downloadName);
|
||||
this.repl.scheduler.stop();
|
||||
}
|
||||
async stop() {
|
||||
this.repl.scheduler.stop();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ This program is free software: you can redistribute it and/or modify it under th
|
|||
|
||||
import createClock from './zyklus.mjs';
|
||||
import { errorLogger, logger } from './logger.mjs';
|
||||
import { loadBuffer, renderPatternAudio, setAudioContext, superdough } from '@strudel/webaudio';
|
||||
|
||||
export class Cyclist {
|
||||
constructor({
|
||||
|
|
@ -111,15 +110,6 @@ export class Cyclist {
|
|||
this.clock.start();
|
||||
this.setStarted(true);
|
||||
}
|
||||
|
||||
async exportAudio(begin, end, sampleRate, downloadName = undefined) {
|
||||
if (!this.pattern) {
|
||||
throw new Error('Scheduler: no pattern set! call .setPattern first.');
|
||||
}
|
||||
logger('[cyclist] exporting');
|
||||
await renderPatternAudio(this.pattern, this.cps, begin, end, sampleRate, downloadName);
|
||||
}
|
||||
|
||||
pause() {
|
||||
logger('[cyclist] pause');
|
||||
this.clock.pause();
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@
|
|||
},
|
||||
"homepage": "https://strudel.cc",
|
||||
"dependencies": {
|
||||
"@strudel/webaudio": "workspace:*",
|
||||
"fraction.js": "^5.2.1"
|
||||
},
|
||||
"gitHead": "0e26d4e741500f5bae35b023608f062a794905c2",
|
||||
|
|
|
|||
|
|
@ -91,8 +91,6 @@ export function repl({
|
|||
|
||||
const stop = () => scheduler.stop();
|
||||
const start = () => scheduler.start();
|
||||
const exportAudio = async (begin, end, sampleRate, downloadName = undefined) =>
|
||||
await scheduler.exportAudio(begin, end, sampleRate, downloadName);
|
||||
const pause = () => scheduler.pause();
|
||||
const toggle = () => scheduler.toggle();
|
||||
const setCps = (cps) => {
|
||||
|
|
@ -259,7 +257,7 @@ export function repl({
|
|||
}
|
||||
};
|
||||
const setCode = (code) => updateState({ code });
|
||||
return { scheduler, evaluate, start, exportAudio, stop, pause, setCps, setPattern, setCode, toggle, state };
|
||||
return { scheduler, evaluate, start, stop, pause, setCps, setPattern, setCode, toggle, state };
|
||||
}
|
||||
|
||||
export const getTrigger =
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import { getDrawContext } from '@strudel/draw';
|
|||
import { transpiler } from '@strudel/transpiler';
|
||||
import {
|
||||
getAudioContextCurrentTime,
|
||||
renderPatternAudio,
|
||||
webaudioOutput,
|
||||
resetGlobalEffects,
|
||||
resetLoadedSounds,
|
||||
|
|
@ -203,8 +204,11 @@ export function useReplContext() {
|
|||
const handleEvaluate = () => {
|
||||
editorRef.current.evaluate();
|
||||
};
|
||||
|
||||
const handleExport = async (begin, end, sampleRate, downloadName = undefined) => {
|
||||
await editorRef.current.exportAudio(begin, end, sampleRate, downloadName);
|
||||
await editorRef.current.evaluate();
|
||||
await renderPatternAudio(editorRef.current.repl.state.pattern, editorRef.current.repl.scheduler.cps, begin, end, sampleRate, downloadName)
|
||||
editorRef.current.repl.scheduler.stop();
|
||||
};
|
||||
const handleShuffle = async () => {
|
||||
const patternData = await getRandomTune();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue