This commit is contained in:
Felix Roos 2022-03-18 17:39:14 +01:00
parent 6691afb9b9
commit 8af4a92fc0
7 changed files with 44 additions and 30 deletions

2
docs/dist/tunes.js vendored
View file

@ -226,7 +226,7 @@ export const magicSofa = `stack(
.every(2, fast(2))
.voicings(),
"<c2 f2 g2> <d2 g2 a2 e2>"
).slow(1).transpose.slowcat(0, 2, 3, 4)`;
).slow(1).transpose(slowcat(0, 2, 3, 4))`;
export const confusedPhone = `"[g2 ~@1.3] [c3 ~@1.3]"
.superimpose(
transpose(-12).late(0),

View file

@ -34,7 +34,7 @@ function useCycle(props) {
};
useEffect(() => {
ready && query();
}, [onEvent, onSchedule, onQuery, ready]);
}, [onEvent, onSchedule, onQuery, onDraw, ready]);
const start = async () => {
setStarted(true);
await Tone.start();

View file

@ -47,6 +47,11 @@ function useRepl({tune, defaultSynth, autolink = true, onEvent, onDraw}) {
if (_events.length) {
}
};
onDraw = useMemo(() => {
if (activeCode && !activeCode.includes("strudel disable-highlighting")) {
return onDraw;
}
}, [activeCode]);
const cycle = useCycle({
onDraw,
onEvent: useCallback((time, event) => {