add repl-react + fix deps

This commit is contained in:
Felix Roos 2022-03-25 18:46:45 +01:00
parent 6f60a3a1d5
commit 6430f6207d
53 changed files with 33850 additions and 24809 deletions

View file

@ -6,7 +6,7 @@ import * as Tone from 'tone';
const WebMidi = _WebMidi;
const Pattern = _Pattern;
export default function enableWebMidi() {
export function enableWebMidi() {
return new Promise((resolve, reject) => {
if (WebMidi.enabled) {
// if already enabled, just resolve WebMidi
@ -30,7 +30,7 @@ Pattern.prototype.midi = function (output, channel = 1) {
throw new Error(
`.midi does not accept Pattern input. Make sure to pass device name with single quotes. Example: .midi('${
WebMidi.outputs?.[0]?.name || 'IAC Driver Bus 1'
}')`
}')`,
);
}
return this._withEvent((event) => {
@ -59,7 +59,7 @@ Pattern.prototype.midi = function (output, channel = 1) {
throw new Error(
`🔌 MIDI device '${output ? output : ''}' not found. Use one of ${WebMidi.outputs
.map((o) => `'${o.name}'`)
.join(' | ')}`
.join(' | ')}`,
);
}
// console.log('midi', value, output);

View file

@ -0,0 +1,26 @@
{
"name": "@strudel/midi",
"version": "0.0.1",
"description": "Midi API for strudel",
"main": "midi.mjs",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/tidalcycles/strudel.git"
},
"keywords": [
"titdalcycles",
"strudel",
"pattern",
"livecoding",
"algorave"
],
"author": "Felix Roos <flix91@gmail.com>",
"license": "GPL-3.0-or-later",
"bugs": {
"url": "https://github.com/tidalcycles/strudel/issues"
},
"homepage": "https://github.com/tidalcycles/strudel#readme"
}