From 96c49689ec71999c3ef7f4435e60549ae7944fe9 Mon Sep 17 00:00:00 2001 From: Felix Roos Date: Fri, 4 Nov 2022 20:15:46 +0100 Subject: [PATCH] improve readmes --- packages/mini/README.md | 9 ++++++++ packages/osc/README.md | 4 +++- packages/react/README.md | 44 ++++++++++++++++++++++++++++++++++++++-- 3 files changed, 54 insertions(+), 3 deletions(-) diff --git a/packages/mini/README.md b/packages/mini/README.md index f5e6f4b5..755ba5df 100644 --- a/packages/mini/README.md +++ b/packages/mini/README.md @@ -33,3 +33,12 @@ yields: ## Mini Notation API 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 +``` diff --git a/packages/osc/README.md b/packages/osc/README.md index cb48090d..2c52e2dc 100644 --- a/packages/osc/README.md +++ b/packages/osc/README.md @@ -31,7 +31,9 @@ Now open Supercollider (with the super dirt startup file) Now open the REPL and type: ```js -s(" hh").osc() +s(' hh').osc(); ``` 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) diff --git a/packages/react/README.md b/packages/react/README.md index 4fc64a8e..ce2e5247 100644 --- a/packages/react/README.md +++ b/packages/react/README.md @@ -1,4 +1,44 @@ # @strudel.cycles/react -This package contains react hooks and components for strudel. -Example coming soon +This package contains react hooks and components for strudel. It is used internally by the Strudel REPL. + +## 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 ; +} +``` + +## 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 +```