import React, { useMemo } from 'react'; import * as Tone from 'tone'; import useRepl from '../useRepl'; import CodeMirror from '../CodeMirror'; import cx from '../cx'; const defaultSynth = new Tone.PolySynth().chain(new Tone.Gain(0.5), Tone.Destination).set({ oscillator: { type: 'triangle' }, envelope: { release: 0.01, }, }); function MiniRepl({ tune, height = 100 }) { /* const defaultSynth = useMemo(() => { return new Tone.PolySynth().chain(new Tone.Gain(0.5), Tone.Destination).set({ oscillator: { type: 'triangle' }, envelope: { release: 0.01, }, }); }, []); */ const { code, setCode, activateCode, activeCode, setPattern, error, cycle, dirty, log, togglePlay } = useRepl({ tune, defaultSynth, }); return (