diff --git a/repl/src/useCycle.ts b/repl/src/useCycle.ts index b9cee0f0..2d156b71 100644 --- a/repl/src/useCycle.ts +++ b/repl/src/useCycle.ts @@ -68,12 +68,20 @@ function useCycle(props: UseCycleProps) { Tone.getTransport().start('+0.1'); }; const stop = () => { - console.log('stop'); - setStarted(false); Tone.getTransport().pause(); + setStarted(false); }; const toggle = () => (started ? stop() : start()); - return { start, stop, setStarted, onEvent, started, toggle, query, activeCycle }; + return { + start, + stop, + onEvent, + started, + setStarted, + toggle, + query, + activeCycle, + }; } export default useCycle; diff --git a/repl/src/useRepl.ts b/repl/src/useRepl.ts index 09a7b73e..ad6f36da 100644 --- a/repl/src/useRepl.ts +++ b/repl/src/useRepl.ts @@ -25,13 +25,13 @@ function useRepl({ tune, defaultSynth, autolink = true, onEvent, onDraw }: any) const activateCode = async (_code = code) => { if (activeCode && !dirty) { setError(undefined); - !cycle.started && cycle.start(); + cycle.start(); return; } try { setPending(true); const parsed = await evaluate(_code); - !cycle.started && cycle.start(); + cycle.start(); broadcast({ type: 'start', from: id }); setPattern(() => parsed.pattern); if (autolink) {