Compare commits

..

4 Commits

Author SHA1 Message Date
Felix Roos 429fcaf05a Publish
- @strudel.cycles/midi@0.0.3
 - @strudel.cycles/mini@0.0.3
 - @strudel.cycles/tone@0.0.3
2022-03-28 00:04:23 +02:00
Felix Roos 4603d16162 add midi note 2022-03-27 23:53:31 +02:00
Felix Roos 6d4a7f96eb add tone example 2022-03-27 23:49:56 +02:00
Felix Roos 4c277afea9 add publishing info 2022-03-27 23:45:46 +02:00
8 changed files with 48 additions and 7 deletions
+10
View File
@@ -19,3 +19,13 @@ cd repl
npm install
npm run start
```
## Publish Packages
To publish, just run:
```sh
npx lerna version
```
This will publish all packages that changed since the last version.
+4
View File
@@ -7,3 +7,7 @@ This package adds midi functionality to strudel Patterns.
```sh
npm i @strudel.cycles/midi --save
```
## Dev Notes
- is this package really necessary? currently, /tone also depends on webmidi through @tonejs/piano. Either move piano out of /tone or merge /midi into /tone...
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@strudel.cycles/midi",
"version": "0.0.2",
"version": "0.0.3",
"lockfileVersion": 2,
"requires": true,
"packages": {
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@strudel.cycles/midi",
"version": "0.0.2",
"version": "0.0.3",
"description": "Midi API for strudel",
"main": "midi.mjs",
"repository": {
@@ -21,7 +21,7 @@
},
"homepage": "https://github.com/tidalcycles/strudel#readme",
"dependencies": {
"@strudel.cycles/tone": "^0.0.2",
"@strudel.cycles/tone": "^0.0.3",
"tone": "^14.7.77",
"webmidi": "^2.5.2"
}
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@strudel.cycles/mini",
"version": "0.0.2",
"version": "0.0.3",
"description": "Mini notation for strudel",
"main": "mini.mjs",
"type": "module",
@@ -26,6 +26,6 @@
"homepage": "https://github.com/tidalcycles/strudel#readme",
"dependencies": {
"@strudel.cycles/eval": "^0.0.2",
"@strudel.cycles/tone": "^0.0.2"
"@strudel.cycles/tone": "^0.0.3"
}
}
+27
View File
@@ -8,6 +8,33 @@ This package adds Tone.js functions to strudel Patterns.
npm i @strudel.cycles/tone --save
```
## Example
The following example will create a pattern and play it back with tone.js:
```js
import { sequence, stack, State, TimeSpan } from '@strudel.cycles/core';
import { Tone, polysynth, osc, out } from '@strudel.cycles/tone';
const pattern = sequence('c3', ['eb3', stack('g3', 'bb3')]).tone(polysynth().set(osc('sawtooth4')).chain(out()));
document.getElementById('play').addEventListener('click', async () => {
await Tone.start();
Tone.getTransport().stop();
const events = pattern.query(new State(new TimeSpan(0, 4))).filter((e) => e.whole.begin.equals(e.part.begin));
events.forEach((event) =>
Tone.getTransport().schedule((time) => event.context.onTrigger(time, event), event.whole.begin.valueOf()),
);
Tone.getTransport().start('+0.1');
});
```
[open in codesandbox](https://codesandbox.io/s/strudel-tone-example-5ph2te?file=/src/index.js:0-708)
## API
See "Tone API" in the [Strudel Tutorial](https://strudel.tidalcycles.org/tutorial/)
## Dev Notes
- `@tonejs/piano` has peer dependency on `webmidi@^2.5.1`! A newer version of webmidi will break.
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@strudel.cycles/tone",
"version": "0.0.2",
"version": "0.0.3",
"lockfileVersion": 2,
"requires": true,
"packages": {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@strudel.cycles/tone",
"version": "0.0.2",
"version": "0.0.3",
"description": "Tone.js API for strudel",
"main": "tone.mjs",
"type": "module",