mirror of
https://github.com/eliasstepanik/strudel.git
synced 2026-01-12 06:08:37 +00:00
add sync flag for neocyclist
This commit is contained in:
parent
619ffdd5e1
commit
2fcbffeaf9
@ -1,4 +1,5 @@
|
||||
import { NeoCyclist } from './neocyclist.mjs';
|
||||
import { Cyclist } from './cyclist.mjs';
|
||||
import { evaluate as _evaluate } from './evaluate.mjs';
|
||||
import { logger } from './logger.mjs';
|
||||
import { setTime } from './time.mjs';
|
||||
@ -15,6 +16,7 @@ export function repl({
|
||||
onToggle,
|
||||
editPattern,
|
||||
onUpdateState,
|
||||
sync = false,
|
||||
}) {
|
||||
const state = {
|
||||
schedulerError: undefined,
|
||||
@ -35,14 +37,16 @@ export function repl({
|
||||
onUpdateState?.(state);
|
||||
};
|
||||
|
||||
const scheduler = new NeoCyclist({
|
||||
const schedulerOptions = {
|
||||
onTrigger: getTrigger({ defaultOutput, getTime }),
|
||||
getTime,
|
||||
onToggle: (started) => {
|
||||
updateState({ started });
|
||||
onToggle?.(started);
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const scheduler = sync ? new NeoCyclist(schedulerOptions) : new Cyclist(schedulerOptions);
|
||||
let pPatterns = {};
|
||||
let allTransform;
|
||||
|
||||
|
||||
@ -56,6 +56,7 @@ export function Repl({ embedded = false }) {
|
||||
});
|
||||
};
|
||||
const editor = new StrudelMirror({
|
||||
sync: true,
|
||||
defaultOutput: webaudioOutput,
|
||||
getTime: () => getAudioContext().currentTime,
|
||||
transpiler,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user