mirror of
https://github.com/eliasstepanik/strudel.git
synced 2026-01-11 05:38:35 +00:00
overhaul the remaining readmes
This commit is contained in:
parent
b58f5232c7
commit
54a61dcdae
@ -43,10 +43,7 @@
|
||||
getTime: () => ctx.currentTime,
|
||||
transpiler,
|
||||
});
|
||||
document.getElementById('start').addEventListener('click', () => {
|
||||
ctx.resume();
|
||||
evaluate(input.value);
|
||||
});
|
||||
document.getElementById('start').addEventListener('click', () => evaluate(input.value));
|
||||
|
||||
function getTune() {
|
||||
return `await samples('github:tidalcycles/Dirt-Samples/master')
|
||||
|
||||
@ -33,11 +33,4 @@ export function Repl({ tune }) {
|
||||
}
|
||||
```
|
||||
|
||||
## 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
|
||||
```
|
||||
For a more sophisticated example, check out the [nano-repl](./examples/nano-repl/)!
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "nano-repl",
|
||||
"name": "@strudel.cycles/nano-repl",
|
||||
"private": true,
|
||||
"version": "0.0.0",
|
||||
"version": "0.6.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
# @strudel.cycles/serial
|
||||
|
||||
This package adds webserial functionality to strudel Patterns, for e.g. sending messages to arduino microcontrollers.
|
||||
|
||||
|
||||
@ -1,9 +1,11 @@
|
||||
# @strudel.cycles/tone
|
||||
|
||||
Note: This package still works but is no longer maintained in favor of `@strudel.cycles/webaudio`.
|
||||
|
||||
This package adds Tone.js functions to strudel Patterns.
|
||||
|
||||
## Deprecation Note
|
||||
|
||||
This package will not be developed further. Consider using `@strudel.cycles/webaudio` as a replacement.
|
||||
|
||||
## Install
|
||||
|
||||
```sh
|
||||
@ -30,6 +32,3 @@ document.getElementById('play').addEventListener('click', async () => {
|
||||
Tone.getTransport().start('+0.1');
|
||||
});
|
||||
```
|
||||
|
||||
[open in codesandbox](https://codesandbox.io/s/strudel-tone-example-5ph2te?file=/src/index.js:0-708)
|
||||
|
||||
|
||||
@ -6,8 +6,6 @@ This package contains a JS code transpiler with the following features:
|
||||
- converts pseudo note variables to note strings
|
||||
- adds return statement to the last expression
|
||||
|
||||
The transpiler is written with [acorn](https://github.com/acornjs/acorn) and aims to replace the `@strudel.cycles/eval` package, which uses [shift-ast](https://www.npmjs.com/package/shift-ast).
|
||||
|
||||
## Install
|
||||
|
||||
```sh
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
# @strudel.cycles/webaudio
|
||||
|
||||
This package contains a scheduler + a clockworker and synths based on the Web Audio API.
|
||||
It's an alternative to `@strudel.cycles/tone`, with better performance, but less features.
|
||||
This package contains helpers to make music with strudel and the Web Audio API.
|
||||
|
||||
## Install
|
||||
|
||||
@ -12,18 +11,25 @@ npm i @strudel.cycles/webaudio --save
|
||||
## Example
|
||||
|
||||
```js
|
||||
import { Scheduler, getAudioContext } from '@strudel.cycles/webaudio';
|
||||
import { repl, controls } from "@strudel.cycles/core";
|
||||
import { initAudioOnFirstClick, getAudioContext, webaudioOutput } from "@strudel.cycles/webaudio";
|
||||
const { note } = controls;
|
||||
|
||||
const scheduler = new Scheduler({
|
||||
audioContext: getAudioContext(),
|
||||
interval: 0.1,
|
||||
onEvent: (e) => e.context?.createAudioNode?.(e),
|
||||
initAudioOnFirstClick();
|
||||
const ctx = getAudioContext();
|
||||
|
||||
const { scheduler } = repl({
|
||||
defaultOutput: webaudioOutput,
|
||||
getTime: () => ctx.currentTime
|
||||
});
|
||||
const pattern = sequence([55, 99], 110).osc('sawtooth');
|
||||
|
||||
const pattern = note("c3", ["eb3", "g3"]).s("sawtooth");
|
||||
|
||||
scheduler.setPattern(pattern);
|
||||
scheduler.start();
|
||||
//scheduler.stop()
|
||||
document.getElementById("start").addEventListener("click", () => scheduler.start());
|
||||
document.getElementById("stop").addEventListener("click", () => scheduler.stop());
|
||||
```
|
||||
|
||||
A more sophisticated example can be found in [examples/repl.html](./examples/repl.html).
|
||||
You can run it by opening the html file with your browser, or by clicking [this link](https://raw.githack.com/tidalcycles/strudel/main/packages/webaudio/examples/repl.html)
|
||||
[Play with the example codesandbox](https://codesandbox.io/s/amazing-dawn-gclfwg?file=/src/index.js).
|
||||
|
||||
Read more in the docs about [samples](https://strudel.tidalcycles.org/learn/samples/), [synths](https://strudel.tidalcycles.org/learn/synths/) and [effects](https://strudel.tidalcycles.org/learn/effects/).
|
||||
|
||||
@ -2,10 +2,6 @@
|
||||
|
||||
This package adds [webdirt](https://github.com/dktr0/WebDirt) support to strudel!
|
||||
|
||||
## Dev Notes
|
||||
## Deprecation Note
|
||||
|
||||
Add default samples to repl:
|
||||
|
||||
1. move samples to `repl/public` folder. the samples folder is expected to have subfolders, with samples in it. the subfolders will be the names of the samples.
|
||||
2. run `./makeSampleMap.sh ../../repl/public/EmuSP12 > ../../repl/public/EmuSP12.json`
|
||||
3. adapt `loadWebDirt` in App.jsx + MiniRepl.jsx to use the generated json file
|
||||
This package will not be developed further. Consider using `@strudel.cycles/webaudio` as a replacement.
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
# @strudel.cycles/xen
|
||||
|
||||
This package adds xenharmonic / microtonal functions to strudel Patterns.
|
||||
This package adds xenharmonic / microtonal functions to strudel Patterns. Further documentation + examples will follow.
|
||||
|
||||
## Install
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user