improve readmes
This commit is contained in:
parent
698f560d56
commit
96c49689ec
3 changed files with 54 additions and 3 deletions
|
|
@ -33,3 +33,12 @@ yields:
|
||||||
## Mini Notation API
|
## Mini Notation API
|
||||||
|
|
||||||
See "Mini Notation" in the [Strudel Tutorial](https://strudel.tidalcycles.org/tutorial/)
|
See "Mini Notation" in the [Strudel Tutorial](https://strudel.tidalcycles.org/tutorial/)
|
||||||
|
|
||||||
|
## Building the Parser
|
||||||
|
|
||||||
|
The parser [krill-parser.js] is generated from [krill.pegjs](./krill.pegjs) using [peggy](https://peggyjs.org/).
|
||||||
|
To generate the parser, run
|
||||||
|
|
||||||
|
```js
|
||||||
|
npm run build:parser
|
||||||
|
```
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,9 @@ Now open Supercollider (with the super dirt startup file)
|
||||||
Now open the REPL and type:
|
Now open the REPL and type:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
s("<bd sd> hh").osc()
|
s('<bd sd> hh').osc();
|
||||||
```
|
```
|
||||||
|
|
||||||
or just [click here](http://localhost:3000/#cygiPGJkIHNkPiBoaCIpLm9zYygp)...
|
or just [click here](http://localhost:3000/#cygiPGJkIHNkPiBoaCIpLm9zYygp)...
|
||||||
|
|
||||||
|
You can read more about [how to use Superdirt with Strudel the Tutorial](https://strudel.tidalcycles.org/tutorial/#superdirt-api)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,44 @@
|
||||||
# @strudel.cycles/react
|
# @strudel.cycles/react
|
||||||
|
|
||||||
This package contains react hooks and components for strudel.
|
This package contains react hooks and components for strudel. It is used internally by the Strudel REPL.
|
||||||
Example coming soon
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
```js
|
||||||
|
npm i @strudel.cycles/react
|
||||||
|
```
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
Here is a minimal example of how to set up a MiniRepl:
|
||||||
|
|
||||||
|
```jsx
|
||||||
|
import { evalScope } from '@strudel.cycles/eval';
|
||||||
|
import { MiniRepl } from '@strudel.cycles/react';
|
||||||
|
import controls from '@strudel.cycles/core/controls.mjs';
|
||||||
|
import { prebake } from '../repl/src/prebake.mjs';
|
||||||
|
|
||||||
|
evalScope(
|
||||||
|
controls,
|
||||||
|
import('@strudel.cycles/core'),
|
||||||
|
import('@strudel.cycles/tonal'),
|
||||||
|
import('@strudel.cycles/mini'),
|
||||||
|
import('@strudel.cycles/webaudio'),
|
||||||
|
/* probably import other strudel packages */
|
||||||
|
);
|
||||||
|
|
||||||
|
prebake();
|
||||||
|
|
||||||
|
export function Repl({ tune }) {
|
||||||
|
return <MiniRepl tune={tune} hideOutsideView={true} />;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Development
|
||||||
|
|
||||||
|
If you change something in here and want to see the changes in the repl, make sure to run `npm run build` inside this folder!
|
||||||
|
|
||||||
|
```js
|
||||||
|
npm run dev # dev server
|
||||||
|
npm run build # build package
|
||||||
|
```
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue