sync highlighting with tone draw
This commit is contained in:
parent
cad81acc44
commit
1375932c05
4 changed files with 15 additions and 7 deletions
|
|
@ -11,7 +11,7 @@ let s4 = () => {
|
|||
.substring(1);
|
||||
};
|
||||
|
||||
function useRepl({ tune, defaultSynth, autolink = true, onEvent }: any) {
|
||||
function useRepl({ tune, defaultSynth, autolink = true, onEvent, onDraw }: any) {
|
||||
const id = useMemo(() => s4(), []);
|
||||
const [code, setCode] = useState<string>(tune);
|
||||
const [activeCode, setActiveCode] = useState<string>();
|
||||
|
|
@ -52,6 +52,7 @@ function useRepl({ tune, defaultSynth, autolink = true, onEvent }: any) {
|
|||
};
|
||||
// cycle hook to control scheduling
|
||||
const cycle = useCycle({
|
||||
onDraw,
|
||||
onEvent: useCallback(
|
||||
(time, event) => {
|
||||
try {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue