add many more krill operators

This commit is contained in:
Felix Roos 2022-02-06 20:59:41 +01:00
parent c8bf4331c8
commit 27be90358f
8 changed files with 758 additions and 85 deletions

View file

@ -6,12 +6,12 @@ import * as Tone from 'tone';
import useCycle from './useCycle';
import type { Hap, Pattern } from './types';
import * as tunes from './tunes';
import _mini from './mini';
import * as krill from './parse';
const { tetris, tetrisMini } = tunes;
const { tetris, tetrisMini, tetrisHaskell } = tunes;
const { sequence, pure, reify, slowcat, fastcat, cat, stack, silence } = strudel; // make available to eval
const mini = _mini; // for eval (direct import wont work somehow)
const { mini, h } = krill; // for eval (direct import wont work somehow)
const parse = (code: string): Pattern => eval(code);
const synth = new Tone.PolySynth().toDestination();
@ -23,7 +23,7 @@ synth.set({
});
function App() {
const [code, setCode] = useState<string>(tetrisMini);
const [code, setCode] = useState<string>(tetrisHaskell);
const [log, setLog] = useState('');
const logBox = useRef<any>();
const [error, setError] = useState<Error>();