migrate repl + move imports out of minirepl
This commit is contained in:
parent
0bcc01ed0e
commit
ed35f967b0
11 changed files with 114 additions and 183 deletions
25
tutorial/MiniRepl.jsx
Normal file
25
tutorial/MiniRepl.jsx
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
import { Tone } from '@strudel.cycles/tone';
|
||||
import { evalScope } from '@strudel.cycles/eval';
|
||||
import { MiniRepl as _MiniRepl } from '@strudel.cycles/react';
|
||||
|
||||
export const defaultSynth = new Tone.PolySynth().chain(new Tone.Gain(0.5), Tone.Destination).set({
|
||||
oscillator: { type: 'triangle' },
|
||||
envelope: {
|
||||
release: 0.01,
|
||||
},
|
||||
});
|
||||
|
||||
evalScope(
|
||||
Tone,
|
||||
import('@strudel.cycles/core'),
|
||||
import('@strudel.cycles/tone'),
|
||||
import('@strudel.cycles/tonal'),
|
||||
import('@strudel.cycles/mini'),
|
||||
import('@strudel.cycles/midi'),
|
||||
import('@strudel.cycles/xen'),
|
||||
import('@strudel.cycles/webaudio'),
|
||||
);
|
||||
|
||||
export function MiniRepl({ tune }) {
|
||||
return <_MiniRepl tune={tune} defaultSynth={defaultSynth} />;
|
||||
}
|
||||
|
|
@ -10,7 +10,6 @@ import Tutorial from './tutorial.mdx';
|
|||
import './style.css';
|
||||
import '@strudel.cycles/react/dist/style.css';
|
||||
|
||||
|
||||
ReactDOM.render(
|
||||
<React.StrictMode>
|
||||
<div className="min-h-screen">
|
||||
|
|
@ -32,5 +31,5 @@ ReactDOM.render(
|
|||
</main>
|
||||
</div>
|
||||
</React.StrictMode>,
|
||||
document.getElementById('root')
|
||||
document.getElementById('root'),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { MiniRepl } from '@strudel.cycles/react';
|
||||
import { MiniRepl } from './MiniRepl';
|
||||
|
||||
# What is Strudel?
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue