mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-23 03:28:33 +00:00
merging main
This commit is contained in:
commit
7f9cc7cd2d
@ -12,7 +12,8 @@ import {
|
|||||||
lineNumbers,
|
lineNumbers,
|
||||||
drawSelection,
|
drawSelection,
|
||||||
} from '@codemirror/view';
|
} from '@codemirror/view';
|
||||||
import { Pattern, Drawer, repl, cleanupDraw } from '@strudel/core';
|
import { Pattern, repl } from '@strudel/core';
|
||||||
|
import { Drawer, cleanupDraw } from '@strudel/draw';
|
||||||
import { isAutoCompletionEnabled } from './autocomplete.mjs';
|
import { isAutoCompletionEnabled } from './autocomplete.mjs';
|
||||||
import { isTooltipEnabled } from './tooltip.mjs';
|
import { isTooltipEnabled } from './tooltip.mjs';
|
||||||
import { flash, isFlashEnabled } from './flash.mjs';
|
import { flash, isFlashEnabled } from './flash.mjs';
|
||||||
|
|||||||
@ -45,6 +45,7 @@
|
|||||||
"@replit/codemirror-vim": "^6.1.0",
|
"@replit/codemirror-vim": "^6.1.0",
|
||||||
"@replit/codemirror-vscode-keymap": "^6.0.2",
|
"@replit/codemirror-vscode-keymap": "^6.0.2",
|
||||||
"@strudel/core": "workspace:*",
|
"@strudel/core": "workspace:*",
|
||||||
|
"@strudel/draw": "workspace:*",
|
||||||
"@uiw/codemirror-themes": "^4.21.21",
|
"@uiw/codemirror-themes": "^4.21.21",
|
||||||
"@uiw/codemirror-themes-all": "^4.21.21",
|
"@uiw/codemirror-themes-all": "^4.21.21",
|
||||||
"nanostores": "^0.9.5"
|
"nanostores": "^0.9.5"
|
||||||
|
|||||||
@ -15,7 +15,7 @@ export function createParam(names) {
|
|||||||
let bag;
|
let bag;
|
||||||
// check if we have an object with an unnamed control (.value)
|
// check if we have an object with an unnamed control (.value)
|
||||||
if (typeof xs === 'object' && xs.value !== undefined) {
|
if (typeof xs === 'object' && xs.value !== undefined) {
|
||||||
bag = xs; // grab props that are already there
|
bag = { ...xs }; // grab props that are already there
|
||||||
xs = xs.value; // grab the unnamed control for this one
|
xs = xs.value; // grab the unnamed control for this one
|
||||||
delete bag.value;
|
delete bag.value;
|
||||||
}
|
}
|
||||||
@ -28,7 +28,8 @@ export function createParam(names) {
|
|||||||
});
|
});
|
||||||
return result;
|
return result;
|
||||||
} else if (bag) {
|
} else if (bag) {
|
||||||
return { ...bag, [name]: xs };
|
bag[name] = xs;
|
||||||
|
return bag;
|
||||||
} else {
|
} else {
|
||||||
return { [name]: xs };
|
return { [name]: xs };
|
||||||
}
|
}
|
||||||
@ -125,6 +126,16 @@ export const { note } = registerControl(['note', 'n']);
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
export const { accelerate } = registerControl('accelerate');
|
export const { accelerate } = registerControl('accelerate');
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Sets the velocity from 0 to 1. Is multiplied together with gain.
|
||||||
|
* @name velocity
|
||||||
|
* @example
|
||||||
|
* s("hh*8")
|
||||||
|
* .gain(".4!2 1 .4!2 1 .4 1")
|
||||||
|
* .velocity(".4 1")
|
||||||
|
*/
|
||||||
|
export const { velocity } = registerControl('velocity');
|
||||||
/**
|
/**
|
||||||
* Controls the gain by an exponential amount.
|
* Controls the gain by an exponential amount.
|
||||||
*
|
*
|
||||||
@ -1183,11 +1194,9 @@ export const { rate } = registerControl('rate');
|
|||||||
export const { slide } = registerControl('slide');
|
export const { slide } = registerControl('slide');
|
||||||
// TODO: detune? https://tidalcycles.org/docs/patternlib/tutorials/synthesizers/#supersquare
|
// TODO: detune? https://tidalcycles.org/docs/patternlib/tutorials/synthesizers/#supersquare
|
||||||
export const { semitone } = registerControl('semitone');
|
export const { semitone } = registerControl('semitone');
|
||||||
// TODO: dedup with synth param, see https://tidalcycles.org/docs/reference/synthesizers/#superpiano
|
|
||||||
// ['velocity'],
|
|
||||||
// TODO: synth param
|
// TODO: synth param
|
||||||
export const { voice } = registerControl('voice');
|
export const { voice } = registerControl('voice');
|
||||||
|
|
||||||
// voicings // https://github.com/tidalcycles/strudel/issues/506
|
// voicings // https://github.com/tidalcycles/strudel/issues/506
|
||||||
// chord to voice, like C Eb Fm7 G7. the symbols can be defined via addVoicings
|
// chord to voice, like C Eb Fm7 G7. the symbols can be defined via addVoicings
|
||||||
export const { chord } = registerControl('chord');
|
export const { chord } = registerControl('chord');
|
||||||
|
|||||||
@ -22,6 +22,7 @@ export const evalScope = async (...args) => {
|
|||||||
globalThis[name] = value;
|
globalThis[name] = value;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
return modules;
|
||||||
};
|
};
|
||||||
|
|
||||||
function safeEval(str, options = {}) {
|
function safeEval(str, options = {}) {
|
||||||
|
|||||||
@ -22,10 +22,6 @@ export * from './repl.mjs';
|
|||||||
export * from './cyclist.mjs';
|
export * from './cyclist.mjs';
|
||||||
export * from './logger.mjs';
|
export * from './logger.mjs';
|
||||||
export * from './time.mjs';
|
export * from './time.mjs';
|
||||||
export * from './draw.mjs';
|
|
||||||
export * from './animate.mjs';
|
|
||||||
export * from './pianoroll.mjs';
|
|
||||||
export * from './spiral.mjs';
|
|
||||||
export * from './ui.mjs';
|
export * from './ui.mjs';
|
||||||
export { default as drawLine } from './drawLine.mjs';
|
export { default as drawLine } from './drawLine.mjs';
|
||||||
// below won't work with runtime.mjs (json import fails)
|
// below won't work with runtime.mjs (json import fails)
|
||||||
|
|||||||
@ -2063,7 +2063,7 @@ export const { echoWith, echowith, stutWith, stutwith } = register(
|
|||||||
* s("bd sd").echo(3, 1/6, .8)
|
* s("bd sd").echo(3, 1/6, .8)
|
||||||
*/
|
*/
|
||||||
export const echo = register('echo', function (times, time, feedback, pat) {
|
export const echo = register('echo', function (times, time, feedback, pat) {
|
||||||
return pat._echoWith(times, time, (pat, i) => pat.velocity(Math.pow(feedback, i)));
|
return pat._echoWith(times, time, (pat, i) => pat.gain(Math.pow(feedback, i)));
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -2076,7 +2076,7 @@ export const echo = register('echo', function (times, time, feedback, pat) {
|
|||||||
* s("bd sd").stut(3, .8, 1/6)
|
* s("bd sd").stut(3, .8, 1/6)
|
||||||
*/
|
*/
|
||||||
export const stut = register('stut', function (times, feedback, time, pat) {
|
export const stut = register('stut', function (times, feedback, time, pat) {
|
||||||
return pat._echoWith(times, time, (pat, i) => pat.velocity(Math.pow(feedback, i)));
|
return pat._echoWith(times, time, (pat, i) => pat.gain(Math.pow(feedback, i)));
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -2221,19 +2221,6 @@ export const { color, colour } = register(['color', 'colour'], function (color,
|
|||||||
return pat.withContext((context) => ({ ...context, color }));
|
return pat.withContext((context) => ({ ...context, color }));
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* Sets the velocity from 0 to 1. Is multiplied together with gain.
|
|
||||||
* @name velocity
|
|
||||||
* @example
|
|
||||||
* s("hh*8")
|
|
||||||
* .gain(".4!2 1 .4!2 1 .4 1")
|
|
||||||
* .velocity(".4 1")
|
|
||||||
*/
|
|
||||||
export const velocity = register('velocity', function (velocity, pat) {
|
|
||||||
return pat.withContext((context) => ({ ...context, velocity: (context.velocity || 1) * velocity }));
|
|
||||||
});
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
// Control-related functions, i.e. ones that manipulate patterns of
|
// Control-related functions, i.e. ones that manipulate patterns of
|
||||||
// objects
|
// objects
|
||||||
|
|||||||
@ -152,12 +152,14 @@ export const csoundm = register('csoundm', (instrument, pat) => {
|
|||||||
const p2 = tidal_time - getAudioContext().currentTime;
|
const p2 = tidal_time - getAudioContext().currentTime;
|
||||||
const p3 = hap.duration.valueOf() + 0;
|
const p3 = hap.duration.valueOf() + 0;
|
||||||
const frequency = getFrequency(hap);
|
const frequency = getFrequency(hap);
|
||||||
|
let { gain = 1, velocity = 0.9 } = hap.value;
|
||||||
|
velocity = gain * velocity;
|
||||||
// Translate frequency to MIDI key number _without_ rounding.
|
// Translate frequency to MIDI key number _without_ rounding.
|
||||||
const C4 = 261.62558;
|
const C4 = 261.62558;
|
||||||
let octave = Math.log(frequency / C4) / Math.log(2.0) + 8.0;
|
let octave = Math.log(frequency / C4) / Math.log(2.0) + 8.0;
|
||||||
const p4 = octave * 12.0 - 36.0;
|
const p4 = octave * 12.0 - 36.0;
|
||||||
// We prefer floating point precision, but over the MIDI range [0, 127].
|
// We prefer floating point precision, but over the MIDI range [0, 127].
|
||||||
const p5 = 127 * (hap.context?.velocity ?? 0.9);
|
const p5 = 127 * velocity;
|
||||||
// The Strudel controls as a string.
|
// The Strudel controls as a string.
|
||||||
const p6 = Object.entries({ ...hap.value, frequency })
|
const p6 = Object.entries({ ...hap.value, frequency })
|
||||||
.flat()
|
.flat()
|
||||||
|
|||||||
@ -7,9 +7,9 @@ const CC_MESSAGE = 0xb0;
|
|||||||
|
|
||||||
Pattern.prototype.midi = function (output) {
|
Pattern.prototype.midi = function (output) {
|
||||||
return this.onTrigger((time, hap, currentTime, cps) => {
|
return this.onTrigger((time, hap, currentTime, cps) => {
|
||||||
const { note, nrpnn, nrpv, ccn, ccv } = hap.value;
|
let { note, nrpnn, nrpv, ccn, ccv, velocity = 0.9, gain = 1 } = hap.value;
|
||||||
const offset = (time - currentTime) * 1000;
|
const offset = (time - currentTime) * 1000;
|
||||||
const velocity = Math.floor((hap.context?.velocity ?? 0.9) * 100); // TODO: refactor velocity
|
velocity = Math.floor(gain * velocity * 100);
|
||||||
const duration = Math.floor((hap.duration.valueOf() / cps) * 1000 - 10);
|
const duration = Math.floor((hap.duration.valueOf() / cps) * 1000 - 10);
|
||||||
const roundedOffset = Math.round(offset);
|
const roundedOffset = Math.round(offset);
|
||||||
const midichan = (hap.value.midichan ?? 1) - 1;
|
const midichan = (hap.value.midichan ?? 1) - 1;
|
||||||
|
|||||||
9
packages/draw/README.md
Normal file
9
packages/draw/README.md
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# @strudel/canvas
|
||||||
|
|
||||||
|
Helpers for drawing with the Canvas API and Strudel
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
```sh
|
||||||
|
npm i @strudel/canvas --save
|
||||||
|
```
|
||||||
@ -1,11 +1,14 @@
|
|||||||
import { Pattern, getDrawContext, silence, register, pure, createParams } from './index.mjs';
|
import { Pattern, silence, register, pure, createParams } from '@strudel/core';
|
||||||
|
import { getDrawContext } from './draw.mjs';
|
||||||
|
|
||||||
let clearColor = '#22222210';
|
let clearColor = '#22222210';
|
||||||
|
|
||||||
Pattern.prototype.animate = function ({ callback, sync = false, smear = 0.5 } = {}) {
|
Pattern.prototype.animate = function ({ callback, sync = false, smear = 0.5 } = {}) {
|
||||||
window.frame && cancelAnimationFrame(window.frame);
|
window.frame && cancelAnimationFrame(window.frame);
|
||||||
const ctx = getDrawContext();
|
const ctx = getDrawContext();
|
||||||
const { clientWidth: ww, clientHeight: wh } = ctx.canvas;
|
let { clientWidth: ww, clientHeight: wh } = ctx.canvas;
|
||||||
|
ww *= window.devicePixelRatio;
|
||||||
|
wh *= window.devicePixelRatio;
|
||||||
let smearPart = smear === 0 ? '99' : Number((1 - smear) * 100).toFixed(0);
|
let smearPart = smear === 0 ? '99' : Number((1 - smear) * 100).toFixed(0);
|
||||||
smearPart = smearPart.length === 1 ? `0${smearPart}` : smearPart;
|
smearPart = smearPart.length === 1 ? `0${smearPart}` : smearPart;
|
||||||
clearColor = `#200010${smearPart}`;
|
clearColor = `#200010${smearPart}`;
|
||||||
@ -1,31 +1,32 @@
|
|||||||
/*
|
/*
|
||||||
draw.mjs - <short description TODO>
|
draw.mjs - <short description TODO>
|
||||||
Copyright (C) 2022 Strudel contributors - see <https://github.com/tidalcycles/strudel/blob/main/packages/core/draw.mjs>
|
Copyright (C) 2022 Strudel contributors - see <https://github.com/tidalcycles/strudel/blob/main/packages/canvas/draw.mjs>
|
||||||
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Pattern, getTime, State, TimeSpan } from './index.mjs';
|
import { Pattern, getTime, State, TimeSpan } from '@strudel/core';
|
||||||
|
|
||||||
export const getDrawContext = (id = 'test-canvas') => {
|
export const getDrawContext = (id = 'test-canvas', options) => {
|
||||||
|
let { contextType = '2d', pixelated = false, pixelRatio = window.devicePixelRatio } = options || {};
|
||||||
let canvas = document.querySelector('#' + id);
|
let canvas = document.querySelector('#' + id);
|
||||||
if (!canvas) {
|
if (!canvas) {
|
||||||
const scale = 2; // 2 = crisp on retina screens
|
|
||||||
canvas = document.createElement('canvas');
|
canvas = document.createElement('canvas');
|
||||||
canvas.id = id;
|
canvas.id = id;
|
||||||
canvas.width = window.innerWidth * scale;
|
canvas.width = window.innerWidth * pixelRatio;
|
||||||
canvas.height = window.innerHeight * scale;
|
canvas.height = window.innerHeight * pixelRatio;
|
||||||
canvas.style = 'pointer-events:none;width:100%;height:100%;position:fixed;top:0;left:0';
|
canvas.style = 'pointer-events:none;width:100%;height:100%;position:fixed;top:0;left:0';
|
||||||
|
pixelated && (canvas.style.imageRendering = 'pixelated');
|
||||||
document.body.prepend(canvas);
|
document.body.prepend(canvas);
|
||||||
let timeout;
|
let timeout;
|
||||||
window.addEventListener('resize', () => {
|
window.addEventListener('resize', () => {
|
||||||
timeout && clearTimeout(timeout);
|
timeout && clearTimeout(timeout);
|
||||||
timeout = setTimeout(() => {
|
timeout = setTimeout(() => {
|
||||||
canvas.width = window.innerWidth * scale;
|
canvas.width = window.innerWidth * pixelRatio;
|
||||||
canvas.height = window.innerHeight * scale;
|
canvas.height = window.innerHeight * pixelRatio;
|
||||||
}, 200);
|
}, 200);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return canvas.getContext('2d');
|
return canvas.getContext(contextType);
|
||||||
};
|
};
|
||||||
|
|
||||||
Pattern.prototype.draw = function (callback, { from, to, onQuery } = {}) {
|
Pattern.prototype.draw = function (callback, { from, to, onQuery } = {}) {
|
||||||
@ -61,6 +62,25 @@ Pattern.prototype.draw = function (callback, { from, to, onQuery } = {}) {
|
|||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// this is a more generic helper to get a rendering callback for the currently active haps
|
||||||
|
// TODO: this misses events that are prolonged with clip or duration (would need state)
|
||||||
|
Pattern.prototype.onFrame = function (fn, offset = 0) {
|
||||||
|
if (typeof window === 'undefined') {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
if (window.strudelAnimation) {
|
||||||
|
cancelAnimationFrame(window.strudelAnimation);
|
||||||
|
}
|
||||||
|
const animate = () => {
|
||||||
|
const t = getTime() + offset;
|
||||||
|
const haps = this.queryArc(t, t);
|
||||||
|
fn(haps, t, this);
|
||||||
|
window.strudelAnimation = requestAnimationFrame(animate);
|
||||||
|
};
|
||||||
|
requestAnimationFrame(animate);
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
|
||||||
export const cleanupDraw = (clearScreen = true) => {
|
export const cleanupDraw = (clearScreen = true) => {
|
||||||
const ctx = getDrawContext();
|
const ctx = getDrawContext();
|
||||||
clearScreen && ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.width);
|
clearScreen && ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.width);
|
||||||
5
packages/draw/index.mjs
Normal file
5
packages/draw/index.mjs
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
export * from './animate.mjs';
|
||||||
|
export * from './color.mjs';
|
||||||
|
export * from './draw.mjs';
|
||||||
|
export * from './pianoroll.mjs';
|
||||||
|
export * from './spiral.mjs';
|
||||||
37
packages/draw/package.json
Normal file
37
packages/draw/package.json
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
{
|
||||||
|
"name": "@strudel/draw",
|
||||||
|
"version": "1.0.1",
|
||||||
|
"description": "Helpers for drawing with Strudel",
|
||||||
|
"main": "index.mjs",
|
||||||
|
"type": "module",
|
||||||
|
"publishConfig": {
|
||||||
|
"main": "dist/index.mjs"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"build": "vite build",
|
||||||
|
"prepublishOnly": "npm run build"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/tidalcycles/strudel.git"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"titdalcycles",
|
||||||
|
"strudel",
|
||||||
|
"pattern",
|
||||||
|
"livecoding",
|
||||||
|
"algorave"
|
||||||
|
],
|
||||||
|
"author": "Felix Roos <flix91@gmail.com>",
|
||||||
|
"license": "AGPL-3.0-or-later",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/tidalcycles/strudel/issues"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/tidalcycles/strudel#readme",
|
||||||
|
"dependencies": {
|
||||||
|
"@strudel/core": "workspace:*"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"vite": "^5.0.10"
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,10 +1,10 @@
|
|||||||
/*
|
/*
|
||||||
pianoroll.mjs - <short description TODO>
|
pianoroll.mjs - <short description TODO>
|
||||||
Copyright (C) 2022 Strudel contributors - see <https://github.com/tidalcycles/strudel/blob/main/packages/core/pianoroll.mjs>
|
Copyright (C) 2022 Strudel contributors - see <https://github.com/tidalcycles/strudel/blob/main/packages/canvas/pianoroll.mjs>
|
||||||
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Pattern, noteToMidi, getDrawContext, freqToMidi, isNote } from './index.mjs';
|
import { Pattern, noteToMidi, freqToMidi } from '@strudel/core';
|
||||||
|
|
||||||
const scale = (normalized, min, max) => normalized * (max - min) + min;
|
const scale = (normalized, min, max) => normalized * (max - min) + min;
|
||||||
const getValue = (e) => {
|
const getValue = (e) => {
|
||||||
@ -187,7 +187,8 @@ export function pianoroll({
|
|||||||
color = isActive ? active : inactive;
|
color = isActive ? active : inactive;
|
||||||
ctx.fillStyle = fillCurrent ? color : 'transparent';
|
ctx.fillStyle = fillCurrent ? color : 'transparent';
|
||||||
ctx.strokeStyle = color;
|
ctx.strokeStyle = color;
|
||||||
ctx.globalAlpha = event.context.velocity ?? event.value?.gain ?? 1;
|
const { velocity = 1, gain = 1 } = event.value || {};
|
||||||
|
ctx.globalAlpha = velocity * gain;
|
||||||
const timeProgress = (event.whole.begin - (flipTime ? to : from)) / timeExtent;
|
const timeProgress = (event.whole.begin - (flipTime ? to : from)) / timeExtent;
|
||||||
const timePx = scale(timeProgress, ...timeRange);
|
const timePx = scale(timeProgress, ...timeRange);
|
||||||
let durationPx = scale(event.duration / timeExtent, 0, timeAxis);
|
let durationPx = scale(event.duration / timeExtent, 0, timeAxis);
|
||||||
@ -1,4 +1,4 @@
|
|||||||
import { Pattern } from './index.mjs';
|
import { Pattern } from '@strudel/core';
|
||||||
|
|
||||||
// polar coords -> xy
|
// polar coords -> xy
|
||||||
function fromPolar(angle, radius, cx, cy) {
|
function fromPolar(angle, radius, cx, cy) {
|
||||||
19
packages/draw/vite.config.js
Normal file
19
packages/draw/vite.config.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
import { defineConfig } from 'vite';
|
||||||
|
import { dependencies } from './package.json';
|
||||||
|
import { resolve } from 'path';
|
||||||
|
|
||||||
|
// https://vitejs.dev/config/
|
||||||
|
export default defineConfig({
|
||||||
|
plugins: [],
|
||||||
|
build: {
|
||||||
|
lib: {
|
||||||
|
entry: resolve(__dirname, 'index.mjs'),
|
||||||
|
formats: ['es'],
|
||||||
|
fileName: (ext) => ({ es: 'index.mjs' })[ext],
|
||||||
|
},
|
||||||
|
rollupOptions: {
|
||||||
|
external: [...Object.keys(dependencies)],
|
||||||
|
},
|
||||||
|
target: 'esnext',
|
||||||
|
},
|
||||||
|
});
|
||||||
@ -1,40 +1,49 @@
|
|||||||
import { getDrawContext } from '@strudel/core';
|
import { getDrawContext } from '@strudel/draw';
|
||||||
|
import { controls } from '@strudel/core';
|
||||||
|
|
||||||
let latestOptions;
|
let latestOptions;
|
||||||
|
let hydra;
|
||||||
function appendCanvas(c) {
|
|
||||||
const { canvas: testCanvas } = getDrawContext();
|
|
||||||
c.canvas.id = 'hydra-canvas';
|
|
||||||
c.canvas.style.position = 'fixed';
|
|
||||||
c.canvas.style.top = '0px';
|
|
||||||
testCanvas.after(c.canvas);
|
|
||||||
return testCanvas;
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function initHydra(options = {}) {
|
export async function initHydra(options = {}) {
|
||||||
// reset if options have changed since last init
|
// reset if options have changed since last init
|
||||||
if (latestOptions && JSON.stringify(latestOptions) !== JSON.stringify(options)) {
|
if (latestOptions && JSON.stringify(latestOptions) !== JSON.stringify(options)) {
|
||||||
document.getElementById('hydra-canvas').remove();
|
document.getElementById('hydra-canvas')?.remove();
|
||||||
}
|
}
|
||||||
latestOptions = options;
|
latestOptions = options;
|
||||||
//load and init hydra
|
//load and init hydra
|
||||||
if (!document.getElementById('hydra-canvas')) {
|
if (!document.getElementById('hydra-canvas')) {
|
||||||
console.log('reinit..');
|
|
||||||
const {
|
const {
|
||||||
src = 'https://unpkg.com/hydra-synth',
|
src = 'https://unpkg.com/hydra-synth',
|
||||||
feedStrudel = false,
|
feedStrudel = false,
|
||||||
|
contextType = 'webgl',
|
||||||
|
pixelRatio = 1,
|
||||||
|
pixelated = true,
|
||||||
...hydraConfig
|
...hydraConfig
|
||||||
} = { detectAudio: false, ...options };
|
} = {
|
||||||
|
detectAudio: false,
|
||||||
|
...options,
|
||||||
|
};
|
||||||
|
const { canvas } = getDrawContext('hydra-canvas', { contextType, pixelRatio, pixelated });
|
||||||
|
hydraConfig.canvas = canvas;
|
||||||
|
|
||||||
await import(/* @vite-ignore */ src);
|
await import(/* @vite-ignore */ src);
|
||||||
const hydra = new Hydra(hydraConfig);
|
hydra = new Hydra(hydraConfig);
|
||||||
if (feedStrudel) {
|
if (feedStrudel) {
|
||||||
const { canvas } = getDrawContext();
|
const { canvas } = getDrawContext();
|
||||||
canvas.style.display = 'none';
|
canvas.style.display = 'none';
|
||||||
hydra.synth.s0.init({ src: canvas });
|
hydra.synth.s0.init({ src: canvas });
|
||||||
}
|
}
|
||||||
appendCanvas(hydra);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function clearHydra() {
|
||||||
|
if (hydra) {
|
||||||
|
hydra.hush();
|
||||||
|
}
|
||||||
|
globalThis.s0?.clear();
|
||||||
|
document.getElementById('hydra-canvas')?.remove();
|
||||||
|
globalThis.speed = controls.speed;
|
||||||
|
globalThis.shape = controls.shape;
|
||||||
|
}
|
||||||
|
|
||||||
export const H = (p) => () => p.queryArc(getTime(), getTime())[0].value;
|
export const H = (p) => () => p.queryArc(getTime(), getTime())[0].value;
|
||||||
|
|||||||
@ -34,6 +34,7 @@
|
|||||||
"homepage": "https://github.com/tidalcycles/strudel#readme",
|
"homepage": "https://github.com/tidalcycles/strudel#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@strudel/core": "workspace:*",
|
"@strudel/core": "workspace:*",
|
||||||
|
"@strudel/draw": "workspace:*",
|
||||||
"hydra-synth": "^1.3.29"
|
"hydra-synth": "^1.3.29"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@ -125,8 +125,9 @@ Pattern.prototype.midi = function (output) {
|
|||||||
const timeOffsetString = `+${offset}`;
|
const timeOffsetString = `+${offset}`;
|
||||||
|
|
||||||
// destructure value
|
// destructure value
|
||||||
const { note, nrpnn, nrpv, ccn, ccv, midichan = 1, midicmd } = hap.value;
|
let { note, nrpnn, nrpv, ccn, ccv, midichan = 1, midicmd, gain = 1, velocity = 0.9 } = hap.value;
|
||||||
const velocity = hap.context?.velocity ?? 0.9; // TODO: refactor velocity
|
|
||||||
|
velocity = gain * velocity;
|
||||||
|
|
||||||
// note off messages will often a few ms arrive late, try to prevent glitching by subtracting from the duration length
|
// note off messages will often a few ms arrive late, try to prevent glitching by subtracting from the duration length
|
||||||
const duration = Math.floor((hap.duration.valueOf() / cps) * 1000 - 10);
|
const duration = Math.floor((hap.duration.valueOf() / cps) * 1000 - 10);
|
||||||
|
|||||||
@ -125,7 +125,7 @@ export function patternifyAST(ast, code, onEnter, offset = 0) {
|
|||||||
return enter(ast.source_);
|
return enter(ast.source_);
|
||||||
}
|
}
|
||||||
case 'atom': {
|
case 'atom': {
|
||||||
if (ast.source_ === '~') {
|
if (ast.source_ === '~' || ast.source_ === '-') {
|
||||||
return strudel.silence;
|
return strudel.silence;
|
||||||
}
|
}
|
||||||
if (!ast.location_) {
|
if (!ast.location_) {
|
||||||
|
|||||||
@ -117,6 +117,9 @@ describe('mini', () => {
|
|||||||
checkEuclid([11, 24], 'x ~ ~ x ~ x ~ x ~ x ~ x ~ ~ x ~ x ~ x ~ x ~ x ~');
|
checkEuclid([11, 24], 'x ~ ~ x ~ x ~ x ~ x ~ x ~ ~ x ~ x ~ x ~ x ~ x ~');
|
||||||
checkEuclid([13, 24], 'x ~ x x ~ x ~ x ~ x ~ x ~ x x ~ x ~ x ~ x ~ x ~');
|
checkEuclid([13, 24], 'x ~ x x ~ x ~ x ~ x ~ x ~ x x ~ x ~ x ~ x ~ x ~');
|
||||||
});
|
});
|
||||||
|
it('supports the - alias for ~', () => {
|
||||||
|
expect(minS('a - b [- c]')).toEqual(minS('a ~ b [~ c]'));
|
||||||
|
});
|
||||||
it('supports the ? operator', () => {
|
it('supports the ? operator', () => {
|
||||||
expect(
|
expect(
|
||||||
mini('a?')
|
mini('a?')
|
||||||
|
|||||||
@ -35,6 +35,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@strudel/codemirror": "workspace:*",
|
"@strudel/codemirror": "workspace:*",
|
||||||
"@strudel/core": "workspace:*",
|
"@strudel/core": "workspace:*",
|
||||||
|
"@strudel/draw": "workspace:*",
|
||||||
"@strudel/hydra": "workspace:*",
|
"@strudel/hydra": "workspace:*",
|
||||||
"@strudel/midi": "workspace:*",
|
"@strudel/midi": "workspace:*",
|
||||||
"@strudel/mini": "workspace:*",
|
"@strudel/mini": "workspace:*",
|
||||||
|
|||||||
@ -6,6 +6,7 @@ export async function prebake() {
|
|||||||
const modulesLoading = evalScope(
|
const modulesLoading = evalScope(
|
||||||
// import('@strudel/core'),
|
// import('@strudel/core'),
|
||||||
core,
|
core,
|
||||||
|
import('@strudel/draw'),
|
||||||
import('@strudel/mini'),
|
import('@strudel/mini'),
|
||||||
import('@strudel/tonal'),
|
import('@strudel/tonal'),
|
||||||
import('@strudel/webaudio'),
|
import('@strudel/webaudio'),
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
import { getDrawContext, silence } from '@strudel/core';
|
import { silence } from '@strudel/core';
|
||||||
|
import { getDrawContext } from '@strudel/draw';
|
||||||
import { transpiler } from '@strudel/transpiler';
|
import { transpiler } from '@strudel/transpiler';
|
||||||
import { getAudioContext, webaudioOutput } from '@strudel/webaudio';
|
import { getAudioContext, webaudioOutput } from '@strudel/webaudio';
|
||||||
import { StrudelMirror, codemirrorSettings } from '@strudel/codemirror';
|
import { StrudelMirror, codemirrorSettings } from '@strudel/codemirror';
|
||||||
|
|||||||
@ -65,7 +65,7 @@ superdough({ s: 'bd', delay: 0.5 }, 0, 1);
|
|||||||
- `bandf`: band pass filter cutoff
|
- `bandf`: band pass filter cutoff
|
||||||
- `bandq`: band pass filter resonance
|
- `bandq`: band pass filter resonance
|
||||||
- `crush`: amplitude bit crusher using given number of bits
|
- `crush`: amplitude bit crusher using given number of bits
|
||||||
- `shape`: distortion effect from 0 (none) to 1 (full). might get loud!
|
- `distort`: distortion effect. might get loud!
|
||||||
- `pan`: stereo panning from 0 (left) to 1 (right)
|
- `pan`: stereo panning from 0 (left) to 1 (right)
|
||||||
- `phaser`: sets the speed of the modulation
|
- `phaser`: sets the speed of the modulation
|
||||||
- `phaserdepth`: the amount the signal is affected by the phaser effect.
|
- `phaserdepth`: the amount the signal is affected by the phaser effect.
|
||||||
|
|||||||
@ -347,7 +347,7 @@ export const superdough = async (value, deadline, hapDuration) => {
|
|||||||
//music programs/audio gear usually increments inputs/outputs from 1, so imitate that behavior
|
//music programs/audio gear usually increments inputs/outputs from 1, so imitate that behavior
|
||||||
channels = (Array.isArray(channels) ? channels : [channels]).map((ch) => ch - 1);
|
channels = (Array.isArray(channels) ? channels : [channels]).map((ch) => ch - 1);
|
||||||
|
|
||||||
gain *= velocity; // legacy fix for velocity
|
gain *= velocity; // velocity currently only multiplies with gain. it might do other things in the future
|
||||||
let toDisconnect = []; // audio nodes that will be disconnected when the source has ended
|
let toDisconnect = []; // audio nodes that will be disconnected when the source has ended
|
||||||
const onended = () => {
|
const onended = () => {
|
||||||
toDisconnect.forEach((n) => n?.disconnect());
|
toDisconnect.forEach((n) => n?.disconnect());
|
||||||
|
|||||||
@ -5,3 +5,5 @@ export * from './tonal.mjs';
|
|||||||
export * from './voicings.mjs';
|
export * from './voicings.mjs';
|
||||||
|
|
||||||
import './ireal.mjs';
|
import './ireal.mjs';
|
||||||
|
|
||||||
|
export const packageName = '@strudel/tonal';
|
||||||
|
|||||||
@ -77,8 +77,13 @@ export const voicingRegistry = {
|
|||||||
lefthand: { dictionary: lefthand, range: ['F3', 'A4'], mode: 'below', anchor: 'a4' },
|
lefthand: { dictionary: lefthand, range: ['F3', 'A4'], mode: 'below', anchor: 'a4' },
|
||||||
triads: { dictionary: triads, mode: 'below', anchor: 'a4' },
|
triads: { dictionary: triads, mode: 'below', anchor: 'a4' },
|
||||||
guidetones: { dictionary: guidetones, mode: 'above', anchor: 'a4' },
|
guidetones: { dictionary: guidetones, mode: 'above', anchor: 'a4' },
|
||||||
default: { dictionary: defaultDictionary, mode: 'below', anchor: 'a4' },
|
legacy: { dictionary: defaultDictionary, mode: 'below', anchor: 'a4' },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let defaultDict = 'ireal';
|
||||||
|
export const setDefaultVoicings = (dict) => (defaultDict = dict);
|
||||||
|
// e.g. typeof setDefaultVoicings !== 'undefined' && setDefaultVoicings('legacy');
|
||||||
|
|
||||||
export const setVoicingRange = (name, range) => addVoicings(name, voicingRegistry[name].dictionary, range);
|
export const setVoicingRange = (name, range) => addVoicings(name, voicingRegistry[name].dictionary, range);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -193,7 +198,7 @@ export const voicing = register('voicing', function (pat) {
|
|||||||
.fmap((value) => {
|
.fmap((value) => {
|
||||||
// destructure voicing controls out
|
// destructure voicing controls out
|
||||||
value = typeof value === 'string' ? { chord: value } : value;
|
value = typeof value === 'string' ? { chord: value } : value;
|
||||||
let { dictionary = 'default', chord, anchor, offset, mode, n, octaves, ...rest } = value;
|
let { dictionary = defaultDict, chord, anchor, offset, mode, n, octaves, ...rest } = value;
|
||||||
dictionary =
|
dictionary =
|
||||||
typeof dictionary === 'string' ? voicingRegistry[dictionary] : { dictionary, mode: 'below', anchor: 'c5' };
|
typeof dictionary === 'string' ? voicingRegistry[dictionary] : { dictionary, mode: 'below', anchor: 'c5' };
|
||||||
try {
|
try {
|
||||||
@ -234,3 +239,8 @@ Object.keys(simple).forEach((symbol) => {
|
|||||||
|
|
||||||
registerVoicings('ireal', simple);
|
registerVoicings('ireal', simple);
|
||||||
registerVoicings('ireal-ext', complex);
|
registerVoicings('ireal-ext', complex);
|
||||||
|
|
||||||
|
export function resetVoicings() {
|
||||||
|
lastVoicing = undefined;
|
||||||
|
setDefaultVoicings('ireal');
|
||||||
|
}
|
||||||
|
|||||||
@ -34,6 +34,7 @@
|
|||||||
"homepage": "https://github.com/tidalcycles/strudel#readme",
|
"homepage": "https://github.com/tidalcycles/strudel#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@strudel/core": "workspace:*",
|
"@strudel/core": "workspace:*",
|
||||||
|
"@strudel/draw": "workspace:*",
|
||||||
"superdough": "workspace:*"
|
"superdough": "workspace:*"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
import { Pattern, getDrawContext, clamp } from '@strudel/core';
|
import { Pattern, clamp } from '@strudel/core';
|
||||||
|
import { getDrawContext } from '../draw/index.mjs';
|
||||||
import { analyser, getAnalyzerData } from 'superdough';
|
import { analyser, getAnalyzerData } from 'superdough';
|
||||||
|
|
||||||
export function drawTimeScope(
|
export function drawTimeScope(
|
||||||
|
|||||||
@ -12,7 +12,7 @@ setLogger(logger);
|
|||||||
|
|
||||||
const hap2value = (hap) => {
|
const hap2value = (hap) => {
|
||||||
hap.ensureObjectValue();
|
hap.ensureObjectValue();
|
||||||
return { ...hap.value, velocity: hap.context.velocity };
|
return hap.value;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const webaudioOutputTrigger = (t, hap, ct, cps) => superdough(hap2value(hap), t - ct, hap.duration / cps, cps);
|
export const webaudioOutputTrigger = (t, hap, ct, cps) => superdough(hap2value(hap), t - ct, hap.duration / cps, cps);
|
||||||
|
|||||||
102
pnpm-lock.yaml
generated
102
pnpm-lock.yaml
generated
@ -96,7 +96,7 @@ importers:
|
|||||||
devDependencies:
|
devDependencies:
|
||||||
vite:
|
vite:
|
||||||
specifier: ^5.0.10
|
specifier: ^5.0.10
|
||||||
version: 5.0.10(@types/node@20.10.6)
|
version: 5.0.10
|
||||||
|
|
||||||
examples/headless-repl:
|
examples/headless-repl:
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -106,7 +106,7 @@ importers:
|
|||||||
devDependencies:
|
devDependencies:
|
||||||
vite:
|
vite:
|
||||||
specifier: ^5.0.10
|
specifier: ^5.0.10
|
||||||
version: 5.0.10(@types/node@20.10.6)
|
version: 5.0.10
|
||||||
|
|
||||||
examples/minimal-repl:
|
examples/minimal-repl:
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -128,7 +128,7 @@ importers:
|
|||||||
devDependencies:
|
devDependencies:
|
||||||
vite:
|
vite:
|
||||||
specifier: ^5.0.10
|
specifier: ^5.0.10
|
||||||
version: 5.0.10(@types/node@20.10.6)
|
version: 5.0.10
|
||||||
|
|
||||||
examples/superdough:
|
examples/superdough:
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -138,7 +138,7 @@ importers:
|
|||||||
devDependencies:
|
devDependencies:
|
||||||
vite:
|
vite:
|
||||||
specifier: ^5.0.10
|
specifier: ^5.0.10
|
||||||
version: 5.0.10(@types/node@20.10.6)
|
version: 5.0.10
|
||||||
|
|
||||||
packages/codemirror:
|
packages/codemirror:
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -181,6 +181,9 @@ importers:
|
|||||||
'@strudel/core':
|
'@strudel/core':
|
||||||
specifier: workspace:*
|
specifier: workspace:*
|
||||||
version: link:../core
|
version: link:../core
|
||||||
|
'@strudel/draw':
|
||||||
|
specifier: workspace:*
|
||||||
|
version: link:../draw
|
||||||
'@uiw/codemirror-themes':
|
'@uiw/codemirror-themes':
|
||||||
specifier: ^4.21.21
|
specifier: ^4.21.21
|
||||||
version: 4.21.21(@codemirror/language@6.10.0)(@codemirror/state@6.4.0)(@codemirror/view@6.23.0)
|
version: 4.21.21(@codemirror/language@6.10.0)(@codemirror/state@6.4.0)(@codemirror/view@6.23.0)
|
||||||
@ -193,7 +196,7 @@ importers:
|
|||||||
devDependencies:
|
devDependencies:
|
||||||
vite:
|
vite:
|
||||||
specifier: ^5.0.10
|
specifier: ^5.0.10
|
||||||
version: 5.0.10(@types/node@20.10.6)
|
version: 5.0.10
|
||||||
|
|
||||||
packages/core:
|
packages/core:
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -203,7 +206,7 @@ importers:
|
|||||||
devDependencies:
|
devDependencies:
|
||||||
vite:
|
vite:
|
||||||
specifier: ^5.0.10
|
specifier: ^5.0.10
|
||||||
version: 5.0.10(@types/node@20.10.6)
|
version: 5.0.10
|
||||||
vitest:
|
vitest:
|
||||||
specifier: ^1.1.0
|
specifier: ^1.1.0
|
||||||
version: 1.1.0(@vitest/ui@1.1.0)
|
version: 1.1.0(@vitest/ui@1.1.0)
|
||||||
@ -222,7 +225,7 @@ importers:
|
|||||||
devDependencies:
|
devDependencies:
|
||||||
vite:
|
vite:
|
||||||
specifier: ^5.0.10
|
specifier: ^5.0.10
|
||||||
version: 5.0.10(@types/node@20.10.6)
|
version: 5.0.10
|
||||||
|
|
||||||
packages/desktopbridge:
|
packages/desktopbridge:
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -233,6 +236,16 @@ importers:
|
|||||||
specifier: ^1.5.3
|
specifier: ^1.5.3
|
||||||
version: 1.5.3
|
version: 1.5.3
|
||||||
|
|
||||||
|
packages/draw:
|
||||||
|
dependencies:
|
||||||
|
'@strudel/core':
|
||||||
|
specifier: workspace:*
|
||||||
|
version: link:../core
|
||||||
|
devDependencies:
|
||||||
|
vite:
|
||||||
|
specifier: ^5.0.10
|
||||||
|
version: 5.0.11(@types/node@20.10.6)
|
||||||
|
|
||||||
packages/embed: {}
|
packages/embed: {}
|
||||||
|
|
||||||
packages/hydra:
|
packages/hydra:
|
||||||
@ -240,6 +253,9 @@ importers:
|
|||||||
'@strudel/core':
|
'@strudel/core':
|
||||||
specifier: workspace:*
|
specifier: workspace:*
|
||||||
version: link:../core
|
version: link:../core
|
||||||
|
'@strudel/draw':
|
||||||
|
specifier: workspace:*
|
||||||
|
version: link:../draw
|
||||||
hydra-synth:
|
hydra-synth:
|
||||||
specifier: ^1.3.29
|
specifier: ^1.3.29
|
||||||
version: 1.3.29
|
version: 1.3.29
|
||||||
@ -249,7 +265,7 @@ importers:
|
|||||||
version: 5.8.1
|
version: 5.8.1
|
||||||
vite:
|
vite:
|
||||||
specifier: ^5.0.10
|
specifier: ^5.0.10
|
||||||
version: 5.0.10(@types/node@20.10.6)
|
version: 5.0.10
|
||||||
|
|
||||||
packages/midi:
|
packages/midi:
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -265,7 +281,7 @@ importers:
|
|||||||
devDependencies:
|
devDependencies:
|
||||||
vite:
|
vite:
|
||||||
specifier: ^5.0.10
|
specifier: ^5.0.10
|
||||||
version: 5.0.10(@types/node@20.10.6)
|
version: 5.0.10
|
||||||
|
|
||||||
packages/mini:
|
packages/mini:
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -278,7 +294,7 @@ importers:
|
|||||||
version: 3.0.2
|
version: 3.0.2
|
||||||
vite:
|
vite:
|
||||||
specifier: ^5.0.10
|
specifier: ^5.0.10
|
||||||
version: 5.0.10(@types/node@20.10.6)
|
version: 5.0.10
|
||||||
vitest:
|
vitest:
|
||||||
specifier: ^1.1.0
|
specifier: ^1.1.0
|
||||||
version: 1.1.0(@vitest/ui@1.1.0)
|
version: 1.1.0(@vitest/ui@1.1.0)
|
||||||
@ -297,7 +313,7 @@ importers:
|
|||||||
version: 5.8.1
|
version: 5.8.1
|
||||||
vite:
|
vite:
|
||||||
specifier: ^5.0.10
|
specifier: ^5.0.10
|
||||||
version: 5.0.10(@types/node@20.10.6)
|
version: 5.0.10
|
||||||
|
|
||||||
packages/repl:
|
packages/repl:
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -307,6 +323,9 @@ importers:
|
|||||||
'@strudel/core':
|
'@strudel/core':
|
||||||
specifier: workspace:*
|
specifier: workspace:*
|
||||||
version: link:../core
|
version: link:../core
|
||||||
|
'@strudel/draw':
|
||||||
|
specifier: workspace:*
|
||||||
|
version: link:../draw
|
||||||
'@strudel/hydra':
|
'@strudel/hydra':
|
||||||
specifier: workspace:*
|
specifier: workspace:*
|
||||||
version: link:../hydra
|
version: link:../hydra
|
||||||
@ -337,7 +356,7 @@ importers:
|
|||||||
version: 5.12.0
|
version: 5.12.0
|
||||||
vite:
|
vite:
|
||||||
specifier: ^5.0.10
|
specifier: ^5.0.10
|
||||||
version: 5.0.10(@types/node@20.10.6)
|
version: 5.0.10
|
||||||
|
|
||||||
packages/serial:
|
packages/serial:
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -347,7 +366,7 @@ importers:
|
|||||||
devDependencies:
|
devDependencies:
|
||||||
vite:
|
vite:
|
||||||
specifier: ^5.0.10
|
specifier: ^5.0.10
|
||||||
version: 5.0.10(@types/node@20.10.6)
|
version: 5.0.10
|
||||||
|
|
||||||
packages/soundfonts:
|
packages/soundfonts:
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -369,7 +388,7 @@ importers:
|
|||||||
version: 3.3.2
|
version: 3.3.2
|
||||||
vite:
|
vite:
|
||||||
specifier: ^5.0.10
|
specifier: ^5.0.10
|
||||||
version: 5.0.10(@types/node@20.10.6)
|
version: 5.0.10
|
||||||
|
|
||||||
packages/superdough:
|
packages/superdough:
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -379,7 +398,7 @@ importers:
|
|||||||
devDependencies:
|
devDependencies:
|
||||||
vite:
|
vite:
|
||||||
specifier: ^5.0.10
|
specifier: ^5.0.10
|
||||||
version: 5.0.10(@types/node@20.10.6)
|
version: 5.0.10
|
||||||
|
|
||||||
packages/tonal:
|
packages/tonal:
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -398,7 +417,7 @@ importers:
|
|||||||
devDependencies:
|
devDependencies:
|
||||||
vite:
|
vite:
|
||||||
specifier: ^5.0.10
|
specifier: ^5.0.10
|
||||||
version: 5.0.10(@types/node@20.10.6)
|
version: 5.0.10
|
||||||
vitest:
|
vitest:
|
||||||
specifier: ^1.1.0
|
specifier: ^1.1.0
|
||||||
version: 1.1.0(@vitest/ui@1.1.0)
|
version: 1.1.0(@vitest/ui@1.1.0)
|
||||||
@ -423,7 +442,7 @@ importers:
|
|||||||
devDependencies:
|
devDependencies:
|
||||||
vite:
|
vite:
|
||||||
specifier: ^5.0.10
|
specifier: ^5.0.10
|
||||||
version: 5.0.10(@types/node@20.10.6)
|
version: 5.0.10
|
||||||
vitest:
|
vitest:
|
||||||
specifier: ^1.1.0
|
specifier: ^1.1.0
|
||||||
version: 1.1.0(@vitest/ui@1.1.0)
|
version: 1.1.0(@vitest/ui@1.1.0)
|
||||||
@ -451,20 +470,23 @@ importers:
|
|||||||
devDependencies:
|
devDependencies:
|
||||||
vite:
|
vite:
|
||||||
specifier: ^5.0.10
|
specifier: ^5.0.10
|
||||||
version: 5.0.10(@types/node@20.10.6)
|
version: 5.0.10
|
||||||
|
|
||||||
packages/webaudio:
|
packages/webaudio:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@strudel/core':
|
'@strudel/core':
|
||||||
specifier: workspace:*
|
specifier: workspace:*
|
||||||
version: link:../core
|
version: link:../core
|
||||||
|
'@strudel/draw':
|
||||||
|
specifier: workspace:*
|
||||||
|
version: link:../draw
|
||||||
superdough:
|
superdough:
|
||||||
specifier: workspace:*
|
specifier: workspace:*
|
||||||
version: link:../superdough
|
version: link:../superdough
|
||||||
devDependencies:
|
devDependencies:
|
||||||
vite:
|
vite:
|
||||||
specifier: ^5.0.10
|
specifier: ^5.0.10
|
||||||
version: 5.0.10(@types/node@20.10.6)
|
version: 5.0.10
|
||||||
|
|
||||||
packages/xen:
|
packages/xen:
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -474,7 +496,7 @@ importers:
|
|||||||
devDependencies:
|
devDependencies:
|
||||||
vite:
|
vite:
|
||||||
specifier: ^5.0.10
|
specifier: ^5.0.10
|
||||||
version: 5.0.10(@types/node@20.10.6)
|
version: 5.0.10
|
||||||
vitest:
|
vitest:
|
||||||
specifier: ^1.1.0
|
specifier: ^1.1.0
|
||||||
version: 1.1.0(@vitest/ui@1.1.0)
|
version: 1.1.0(@vitest/ui@1.1.0)
|
||||||
@ -535,6 +557,9 @@ importers:
|
|||||||
'@strudel/desktopbridge':
|
'@strudel/desktopbridge':
|
||||||
specifier: workspace:*
|
specifier: workspace:*
|
||||||
version: link:../packages/desktopbridge
|
version: link:../packages/desktopbridge
|
||||||
|
'@strudel/draw':
|
||||||
|
specifier: workspace:*
|
||||||
|
version: link:../packages/draw
|
||||||
'@strudel/hydra':
|
'@strudel/hydra':
|
||||||
specifier: workspace:*
|
specifier: workspace:*
|
||||||
version: link:../packages/hydra
|
version: link:../packages/hydra
|
||||||
@ -2382,6 +2407,7 @@ packages:
|
|||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [android]
|
os: [android]
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/@esbuild/android-arm@0.19.11:
|
/@esbuild/android-arm@0.19.11:
|
||||||
@ -2398,6 +2424,7 @@ packages:
|
|||||||
cpu: [arm]
|
cpu: [arm]
|
||||||
os: [android]
|
os: [android]
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/@esbuild/android-x64@0.19.11:
|
/@esbuild/android-x64@0.19.11:
|
||||||
@ -2414,6 +2441,7 @@ packages:
|
|||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [android]
|
os: [android]
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/@esbuild/darwin-arm64@0.19.11:
|
/@esbuild/darwin-arm64@0.19.11:
|
||||||
@ -2430,6 +2458,7 @@ packages:
|
|||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [darwin]
|
os: [darwin]
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/@esbuild/darwin-x64@0.19.11:
|
/@esbuild/darwin-x64@0.19.11:
|
||||||
@ -2446,6 +2475,7 @@ packages:
|
|||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [darwin]
|
os: [darwin]
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/@esbuild/freebsd-arm64@0.19.11:
|
/@esbuild/freebsd-arm64@0.19.11:
|
||||||
@ -2462,6 +2492,7 @@ packages:
|
|||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [freebsd]
|
os: [freebsd]
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/@esbuild/freebsd-x64@0.19.11:
|
/@esbuild/freebsd-x64@0.19.11:
|
||||||
@ -2478,6 +2509,7 @@ packages:
|
|||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [freebsd]
|
os: [freebsd]
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/@esbuild/linux-arm64@0.19.11:
|
/@esbuild/linux-arm64@0.19.11:
|
||||||
@ -2494,6 +2526,7 @@ packages:
|
|||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/@esbuild/linux-arm@0.19.11:
|
/@esbuild/linux-arm@0.19.11:
|
||||||
@ -2510,6 +2543,7 @@ packages:
|
|||||||
cpu: [arm]
|
cpu: [arm]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/@esbuild/linux-ia32@0.19.11:
|
/@esbuild/linux-ia32@0.19.11:
|
||||||
@ -2526,6 +2560,7 @@ packages:
|
|||||||
cpu: [ia32]
|
cpu: [ia32]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/@esbuild/linux-loong64@0.19.11:
|
/@esbuild/linux-loong64@0.19.11:
|
||||||
@ -2542,6 +2577,7 @@ packages:
|
|||||||
cpu: [loong64]
|
cpu: [loong64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/@esbuild/linux-mips64el@0.19.11:
|
/@esbuild/linux-mips64el@0.19.11:
|
||||||
@ -2558,6 +2594,7 @@ packages:
|
|||||||
cpu: [mips64el]
|
cpu: [mips64el]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/@esbuild/linux-ppc64@0.19.11:
|
/@esbuild/linux-ppc64@0.19.11:
|
||||||
@ -2574,6 +2611,7 @@ packages:
|
|||||||
cpu: [ppc64]
|
cpu: [ppc64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/@esbuild/linux-riscv64@0.19.11:
|
/@esbuild/linux-riscv64@0.19.11:
|
||||||
@ -2590,6 +2628,7 @@ packages:
|
|||||||
cpu: [riscv64]
|
cpu: [riscv64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/@esbuild/linux-s390x@0.19.11:
|
/@esbuild/linux-s390x@0.19.11:
|
||||||
@ -2606,6 +2645,7 @@ packages:
|
|||||||
cpu: [s390x]
|
cpu: [s390x]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/@esbuild/linux-x64@0.19.11:
|
/@esbuild/linux-x64@0.19.11:
|
||||||
@ -2622,6 +2662,7 @@ packages:
|
|||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/@esbuild/netbsd-x64@0.19.11:
|
/@esbuild/netbsd-x64@0.19.11:
|
||||||
@ -2638,6 +2679,7 @@ packages:
|
|||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [netbsd]
|
os: [netbsd]
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/@esbuild/openbsd-x64@0.19.11:
|
/@esbuild/openbsd-x64@0.19.11:
|
||||||
@ -2654,6 +2696,7 @@ packages:
|
|||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [openbsd]
|
os: [openbsd]
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/@esbuild/sunos-x64@0.19.11:
|
/@esbuild/sunos-x64@0.19.11:
|
||||||
@ -2670,6 +2713,7 @@ packages:
|
|||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [sunos]
|
os: [sunos]
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/@esbuild/win32-arm64@0.19.11:
|
/@esbuild/win32-arm64@0.19.11:
|
||||||
@ -2686,6 +2730,7 @@ packages:
|
|||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [win32]
|
os: [win32]
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/@esbuild/win32-ia32@0.19.11:
|
/@esbuild/win32-ia32@0.19.11:
|
||||||
@ -2702,6 +2747,7 @@ packages:
|
|||||||
cpu: [ia32]
|
cpu: [ia32]
|
||||||
os: [win32]
|
os: [win32]
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/@esbuild/win32-x64@0.19.11:
|
/@esbuild/win32-x64@0.19.11:
|
||||||
@ -2718,6 +2764,7 @@ packages:
|
|||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [win32]
|
os: [win32]
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/@eslint-community/eslint-utils@4.4.0(eslint@8.56.0):
|
/@eslint-community/eslint-utils@4.4.0(eslint@8.56.0):
|
||||||
@ -5346,8 +5393,8 @@ packages:
|
|||||||
tsconfck: 3.0.0(typescript@5.3.3)
|
tsconfck: 3.0.0(typescript@5.3.3)
|
||||||
unist-util-visit: 5.0.0
|
unist-util-visit: 5.0.0
|
||||||
vfile: 6.0.1
|
vfile: 6.0.1
|
||||||
vite: 5.0.10(@types/node@20.10.6)
|
vite: 5.0.11(@types/node@20.10.6)
|
||||||
vitefu: 0.2.5(vite@5.0.10)
|
vitefu: 0.2.5(vite@5.0.11)
|
||||||
which-pm: 2.1.1
|
which-pm: 2.1.1
|
||||||
yargs-parser: 21.1.1
|
yargs-parser: 21.1.1
|
||||||
zod: 3.22.4
|
zod: 3.22.4
|
||||||
@ -6828,6 +6875,7 @@ packages:
|
|||||||
'@esbuild/win32-arm64': 0.19.5
|
'@esbuild/win32-arm64': 0.19.5
|
||||||
'@esbuild/win32-ia32': 0.19.5
|
'@esbuild/win32-ia32': 0.19.5
|
||||||
'@esbuild/win32-x64': 0.19.5
|
'@esbuild/win32-x64': 0.19.5
|
||||||
|
dev: true
|
||||||
|
|
||||||
/escalade@3.1.1:
|
/escalade@3.1.1:
|
||||||
resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==}
|
resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==}
|
||||||
@ -13565,7 +13613,7 @@ packages:
|
|||||||
- supports-color
|
- supports-color
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/vite@5.0.10(@types/node@20.10.6):
|
/vite@5.0.10:
|
||||||
resolution: {integrity: sha512-2P8J7WWgmc355HUMlFrwofacvr98DAjoE52BfdbwQtyLH06XKwaL/FMnmKM2crF0iX4MpmMKoDlNCB1ok7zHCw==}
|
resolution: {integrity: sha512-2P8J7WWgmc355HUMlFrwofacvr98DAjoE52BfdbwQtyLH06XKwaL/FMnmKM2crF0iX4MpmMKoDlNCB1ok7zHCw==}
|
||||||
engines: {node: ^18.0.0 || >=20.0.0}
|
engines: {node: ^18.0.0 || >=20.0.0}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
@ -13593,12 +13641,12 @@ packages:
|
|||||||
terser:
|
terser:
|
||||||
optional: true
|
optional: true
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/node': 20.10.6
|
|
||||||
esbuild: 0.19.5
|
esbuild: 0.19.5
|
||||||
postcss: 8.4.32
|
postcss: 8.4.32
|
||||||
rollup: 4.9.2
|
rollup: 4.9.2
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
fsevents: 2.3.3
|
fsevents: 2.3.3
|
||||||
|
dev: true
|
||||||
|
|
||||||
/vite@5.0.11(@types/node@20.10.6):
|
/vite@5.0.11(@types/node@20.10.6):
|
||||||
resolution: {integrity: sha512-XBMnDjZcNAw/G1gEiskiM1v6yzM4GE5aMGvhWTlHAYYhxb7S3/V1s3m2LDHa8Vh6yIWYYB0iJwsEaS523c4oYA==}
|
resolution: {integrity: sha512-XBMnDjZcNAw/G1gEiskiM1v6yzM4GE5aMGvhWTlHAYYhxb7S3/V1s3m2LDHa8Vh6yIWYYB0iJwsEaS523c4oYA==}
|
||||||
@ -13629,13 +13677,13 @@ packages:
|
|||||||
optional: true
|
optional: true
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/node': 20.10.6
|
'@types/node': 20.10.6
|
||||||
esbuild: 0.19.5
|
esbuild: 0.19.11
|
||||||
postcss: 8.4.32
|
postcss: 8.4.32
|
||||||
rollup: 4.9.2
|
rollup: 4.9.2
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
fsevents: 2.3.3
|
fsevents: 2.3.3
|
||||||
|
|
||||||
/vitefu@0.2.5(vite@5.0.10):
|
/vitefu@0.2.5(vite@5.0.11):
|
||||||
resolution: {integrity: sha512-SgHtMLoqaeeGnd2evZ849ZbACbnwQCIwRH57t18FxcXoZop0uQu0uzlIhJBlF/eWVzuce0sHeqPcDo+evVcg8Q==}
|
resolution: {integrity: sha512-SgHtMLoqaeeGnd2evZ849ZbACbnwQCIwRH57t18FxcXoZop0uQu0uzlIhJBlF/eWVzuce0sHeqPcDo+evVcg8Q==}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
vite: ^3.0.0 || ^4.0.0 || ^5.0.0
|
vite: ^3.0.0 || ^4.0.0 || ^5.0.0
|
||||||
@ -13643,7 +13691,7 @@ packages:
|
|||||||
vite:
|
vite:
|
||||||
optional: true
|
optional: true
|
||||||
dependencies:
|
dependencies:
|
||||||
vite: 5.0.10(@types/node@20.10.6)
|
vite: 5.0.11(@types/node@20.10.6)
|
||||||
|
|
||||||
/vitest@1.1.0(@vitest/ui@1.1.0):
|
/vitest@1.1.0(@vitest/ui@1.1.0):
|
||||||
resolution: {integrity: sha512-oDFiCrw7dd3Jf06HoMtSRARivvyjHJaTxikFxuqJjO76U436PqlVw1uLn7a8OSPrhSfMGVaRakKpA2lePdw79A==}
|
resolution: {integrity: sha512-oDFiCrw7dd3Jf06HoMtSRARivvyjHJaTxikFxuqJjO76U436PqlVw1uLn7a8OSPrhSfMGVaRakKpA2lePdw79A==}
|
||||||
|
|||||||
@ -2167,38 +2167,38 @@ exports[`runs examples > example "early" example index 0 1`] = `
|
|||||||
|
|
||||||
exports[`runs examples > example "echo" example index 0 1`] = `
|
exports[`runs examples > example "echo" example index 0 1`] = `
|
||||||
[
|
[
|
||||||
"[ -1/3 ⇜ (0/1 → 1/6) | s:sd ]",
|
"[ -1/3 ⇜ (0/1 → 1/6) | s:sd gain:0.8 ]",
|
||||||
"[ -1/6 ⇜ (0/1 → 1/3) | s:sd ]",
|
"[ -1/6 ⇜ (0/1 → 1/3) | s:sd gain:0.6400000000000001 ]",
|
||||||
"[ 0/1 → 1/2 | s:bd ]",
|
"[ 0/1 → 1/2 | s:bd gain:1 ]",
|
||||||
"[ 1/6 → 2/3 | s:bd ]",
|
"[ 1/6 → 2/3 | s:bd gain:0.8 ]",
|
||||||
"[ 1/3 → 5/6 | s:bd ]",
|
"[ 1/3 → 5/6 | s:bd gain:0.6400000000000001 ]",
|
||||||
"[ 1/2 → 1/1 | s:sd ]",
|
"[ 1/2 → 1/1 | s:sd gain:1 ]",
|
||||||
"[ (2/3 → 1/1) ⇝ 7/6 | s:sd ]",
|
"[ (2/3 → 1/1) ⇝ 7/6 | s:sd gain:0.8 ]",
|
||||||
"[ (5/6 → 1/1) ⇝ 4/3 | s:sd ]",
|
"[ (5/6 → 1/1) ⇝ 4/3 | s:sd gain:0.6400000000000001 ]",
|
||||||
"[ 2/3 ⇜ (1/1 → 7/6) | s:sd ]",
|
"[ 2/3 ⇜ (1/1 → 7/6) | s:sd gain:0.8 ]",
|
||||||
"[ 5/6 ⇜ (1/1 → 4/3) | s:sd ]",
|
"[ 5/6 ⇜ (1/1 → 4/3) | s:sd gain:0.6400000000000001 ]",
|
||||||
"[ 1/1 → 3/2 | s:bd ]",
|
"[ 1/1 → 3/2 | s:bd gain:1 ]",
|
||||||
"[ 7/6 → 5/3 | s:bd ]",
|
"[ 7/6 → 5/3 | s:bd gain:0.8 ]",
|
||||||
"[ 4/3 → 11/6 | s:bd ]",
|
"[ 4/3 → 11/6 | s:bd gain:0.6400000000000001 ]",
|
||||||
"[ 3/2 → 2/1 | s:sd ]",
|
"[ 3/2 → 2/1 | s:sd gain:1 ]",
|
||||||
"[ (5/3 → 2/1) ⇝ 13/6 | s:sd ]",
|
"[ (5/3 → 2/1) ⇝ 13/6 | s:sd gain:0.8 ]",
|
||||||
"[ (11/6 → 2/1) ⇝ 7/3 | s:sd ]",
|
"[ (11/6 → 2/1) ⇝ 7/3 | s:sd gain:0.6400000000000001 ]",
|
||||||
"[ 5/3 ⇜ (2/1 → 13/6) | s:sd ]",
|
"[ 5/3 ⇜ (2/1 → 13/6) | s:sd gain:0.8 ]",
|
||||||
"[ 11/6 ⇜ (2/1 → 7/3) | s:sd ]",
|
"[ 11/6 ⇜ (2/1 → 7/3) | s:sd gain:0.6400000000000001 ]",
|
||||||
"[ 2/1 → 5/2 | s:bd ]",
|
"[ 2/1 → 5/2 | s:bd gain:1 ]",
|
||||||
"[ 13/6 → 8/3 | s:bd ]",
|
"[ 13/6 → 8/3 | s:bd gain:0.8 ]",
|
||||||
"[ 7/3 → 17/6 | s:bd ]",
|
"[ 7/3 → 17/6 | s:bd gain:0.6400000000000001 ]",
|
||||||
"[ 5/2 → 3/1 | s:sd ]",
|
"[ 5/2 → 3/1 | s:sd gain:1 ]",
|
||||||
"[ (8/3 → 3/1) ⇝ 19/6 | s:sd ]",
|
"[ (8/3 → 3/1) ⇝ 19/6 | s:sd gain:0.8 ]",
|
||||||
"[ (17/6 → 3/1) ⇝ 10/3 | s:sd ]",
|
"[ (17/6 → 3/1) ⇝ 10/3 | s:sd gain:0.6400000000000001 ]",
|
||||||
"[ 8/3 ⇜ (3/1 → 19/6) | s:sd ]",
|
"[ 8/3 ⇜ (3/1 → 19/6) | s:sd gain:0.8 ]",
|
||||||
"[ 17/6 ⇜ (3/1 → 10/3) | s:sd ]",
|
"[ 17/6 ⇜ (3/1 → 10/3) | s:sd gain:0.6400000000000001 ]",
|
||||||
"[ 3/1 → 7/2 | s:bd ]",
|
"[ 3/1 → 7/2 | s:bd gain:1 ]",
|
||||||
"[ 19/6 → 11/3 | s:bd ]",
|
"[ 19/6 → 11/3 | s:bd gain:0.8 ]",
|
||||||
"[ 10/3 → 23/6 | s:bd ]",
|
"[ 10/3 → 23/6 | s:bd gain:0.6400000000000001 ]",
|
||||||
"[ 7/2 → 4/1 | s:sd ]",
|
"[ 7/2 → 4/1 | s:sd gain:1 ]",
|
||||||
"[ (11/3 → 4/1) ⇝ 25/6 | s:sd ]",
|
"[ (11/3 → 4/1) ⇝ 25/6 | s:sd gain:0.8 ]",
|
||||||
"[ (23/6 → 4/1) ⇝ 13/3 | s:sd ]",
|
"[ (23/6 → 4/1) ⇝ 13/3 | s:sd gain:0.6400000000000001 ]",
|
||||||
]
|
]
|
||||||
`;
|
`;
|
||||||
|
|
||||||
@ -7051,38 +7051,38 @@ exports[`runs examples > example "struct" example index 0 1`] = `
|
|||||||
|
|
||||||
exports[`runs examples > example "stut" example index 0 1`] = `
|
exports[`runs examples > example "stut" example index 0 1`] = `
|
||||||
[
|
[
|
||||||
"[ -1/3 ⇜ (0/1 → 1/6) | s:sd ]",
|
"[ -1/3 ⇜ (0/1 → 1/6) | s:sd gain:0.8 ]",
|
||||||
"[ -1/6 ⇜ (0/1 → 1/3) | s:sd ]",
|
"[ -1/6 ⇜ (0/1 → 1/3) | s:sd gain:0.6400000000000001 ]",
|
||||||
"[ 0/1 → 1/2 | s:bd ]",
|
"[ 0/1 → 1/2 | s:bd gain:1 ]",
|
||||||
"[ 1/6 → 2/3 | s:bd ]",
|
"[ 1/6 → 2/3 | s:bd gain:0.8 ]",
|
||||||
"[ 1/3 → 5/6 | s:bd ]",
|
"[ 1/3 → 5/6 | s:bd gain:0.6400000000000001 ]",
|
||||||
"[ 1/2 → 1/1 | s:sd ]",
|
"[ 1/2 → 1/1 | s:sd gain:1 ]",
|
||||||
"[ (2/3 → 1/1) ⇝ 7/6 | s:sd ]",
|
"[ (2/3 → 1/1) ⇝ 7/6 | s:sd gain:0.8 ]",
|
||||||
"[ (5/6 → 1/1) ⇝ 4/3 | s:sd ]",
|
"[ (5/6 → 1/1) ⇝ 4/3 | s:sd gain:0.6400000000000001 ]",
|
||||||
"[ 2/3 ⇜ (1/1 → 7/6) | s:sd ]",
|
"[ 2/3 ⇜ (1/1 → 7/6) | s:sd gain:0.8 ]",
|
||||||
"[ 5/6 ⇜ (1/1 → 4/3) | s:sd ]",
|
"[ 5/6 ⇜ (1/1 → 4/3) | s:sd gain:0.6400000000000001 ]",
|
||||||
"[ 1/1 → 3/2 | s:bd ]",
|
"[ 1/1 → 3/2 | s:bd gain:1 ]",
|
||||||
"[ 7/6 → 5/3 | s:bd ]",
|
"[ 7/6 → 5/3 | s:bd gain:0.8 ]",
|
||||||
"[ 4/3 → 11/6 | s:bd ]",
|
"[ 4/3 → 11/6 | s:bd gain:0.6400000000000001 ]",
|
||||||
"[ 3/2 → 2/1 | s:sd ]",
|
"[ 3/2 → 2/1 | s:sd gain:1 ]",
|
||||||
"[ (5/3 → 2/1) ⇝ 13/6 | s:sd ]",
|
"[ (5/3 → 2/1) ⇝ 13/6 | s:sd gain:0.8 ]",
|
||||||
"[ (11/6 → 2/1) ⇝ 7/3 | s:sd ]",
|
"[ (11/6 → 2/1) ⇝ 7/3 | s:sd gain:0.6400000000000001 ]",
|
||||||
"[ 5/3 ⇜ (2/1 → 13/6) | s:sd ]",
|
"[ 5/3 ⇜ (2/1 → 13/6) | s:sd gain:0.8 ]",
|
||||||
"[ 11/6 ⇜ (2/1 → 7/3) | s:sd ]",
|
"[ 11/6 ⇜ (2/1 → 7/3) | s:sd gain:0.6400000000000001 ]",
|
||||||
"[ 2/1 → 5/2 | s:bd ]",
|
"[ 2/1 → 5/2 | s:bd gain:1 ]",
|
||||||
"[ 13/6 → 8/3 | s:bd ]",
|
"[ 13/6 → 8/3 | s:bd gain:0.8 ]",
|
||||||
"[ 7/3 → 17/6 | s:bd ]",
|
"[ 7/3 → 17/6 | s:bd gain:0.6400000000000001 ]",
|
||||||
"[ 5/2 → 3/1 | s:sd ]",
|
"[ 5/2 → 3/1 | s:sd gain:1 ]",
|
||||||
"[ (8/3 → 3/1) ⇝ 19/6 | s:sd ]",
|
"[ (8/3 → 3/1) ⇝ 19/6 | s:sd gain:0.8 ]",
|
||||||
"[ (17/6 → 3/1) ⇝ 10/3 | s:sd ]",
|
"[ (17/6 → 3/1) ⇝ 10/3 | s:sd gain:0.6400000000000001 ]",
|
||||||
"[ 8/3 ⇜ (3/1 → 19/6) | s:sd ]",
|
"[ 8/3 ⇜ (3/1 → 19/6) | s:sd gain:0.8 ]",
|
||||||
"[ 17/6 ⇜ (3/1 → 10/3) | s:sd ]",
|
"[ 17/6 ⇜ (3/1 → 10/3) | s:sd gain:0.6400000000000001 ]",
|
||||||
"[ 3/1 → 7/2 | s:bd ]",
|
"[ 3/1 → 7/2 | s:bd gain:1 ]",
|
||||||
"[ 19/6 → 11/3 | s:bd ]",
|
"[ 19/6 → 11/3 | s:bd gain:0.8 ]",
|
||||||
"[ 10/3 → 23/6 | s:bd ]",
|
"[ 10/3 → 23/6 | s:bd gain:0.6400000000000001 ]",
|
||||||
"[ 7/2 → 4/1 | s:sd ]",
|
"[ 7/2 → 4/1 | s:sd gain:1 ]",
|
||||||
"[ (11/3 → 4/1) ⇝ 25/6 | s:sd ]",
|
"[ (11/3 → 4/1) ⇝ 25/6 | s:sd gain:0.8 ]",
|
||||||
"[ (23/6 → 4/1) ⇝ 13/3 | s:sd ]",
|
"[ (23/6 → 4/1) ⇝ 13/3 | s:sd gain:0.6400000000000001 ]",
|
||||||
]
|
]
|
||||||
`;
|
`;
|
||||||
|
|
||||||
@ -7364,38 +7364,38 @@ exports[`runs examples > example "unit" example index 0 1`] = `
|
|||||||
|
|
||||||
exports[`runs examples > example "velocity" example index 0 1`] = `
|
exports[`runs examples > example "velocity" example index 0 1`] = `
|
||||||
[
|
[
|
||||||
"[ 0/1 → 1/8 | s:hh gain:0.4 ]",
|
"[ 0/1 → 1/8 | s:hh gain:0.4 velocity:0.4 ]",
|
||||||
"[ 1/8 → 1/4 | s:hh gain:0.4 ]",
|
"[ 1/8 → 1/4 | s:hh gain:0.4 velocity:0.4 ]",
|
||||||
"[ 1/4 → 3/8 | s:hh gain:1 ]",
|
"[ 1/4 → 3/8 | s:hh gain:1 velocity:0.4 ]",
|
||||||
"[ 3/8 → 1/2 | s:hh gain:0.4 ]",
|
"[ 3/8 → 1/2 | s:hh gain:0.4 velocity:0.4 ]",
|
||||||
"[ 1/2 → 5/8 | s:hh gain:0.4 ]",
|
"[ 1/2 → 5/8 | s:hh gain:0.4 velocity:1 ]",
|
||||||
"[ 5/8 → 3/4 | s:hh gain:1 ]",
|
"[ 5/8 → 3/4 | s:hh gain:1 velocity:1 ]",
|
||||||
"[ 3/4 → 7/8 | s:hh gain:0.4 ]",
|
"[ 3/4 → 7/8 | s:hh gain:0.4 velocity:1 ]",
|
||||||
"[ 7/8 → 1/1 | s:hh gain:1 ]",
|
"[ 7/8 → 1/1 | s:hh gain:1 velocity:1 ]",
|
||||||
"[ 1/1 → 9/8 | s:hh gain:0.4 ]",
|
"[ 1/1 → 9/8 | s:hh gain:0.4 velocity:0.4 ]",
|
||||||
"[ 9/8 → 5/4 | s:hh gain:0.4 ]",
|
"[ 9/8 → 5/4 | s:hh gain:0.4 velocity:0.4 ]",
|
||||||
"[ 5/4 → 11/8 | s:hh gain:1 ]",
|
"[ 5/4 → 11/8 | s:hh gain:1 velocity:0.4 ]",
|
||||||
"[ 11/8 → 3/2 | s:hh gain:0.4 ]",
|
"[ 11/8 → 3/2 | s:hh gain:0.4 velocity:0.4 ]",
|
||||||
"[ 3/2 → 13/8 | s:hh gain:0.4 ]",
|
"[ 3/2 → 13/8 | s:hh gain:0.4 velocity:1 ]",
|
||||||
"[ 13/8 → 7/4 | s:hh gain:1 ]",
|
"[ 13/8 → 7/4 | s:hh gain:1 velocity:1 ]",
|
||||||
"[ 7/4 → 15/8 | s:hh gain:0.4 ]",
|
"[ 7/4 → 15/8 | s:hh gain:0.4 velocity:1 ]",
|
||||||
"[ 15/8 → 2/1 | s:hh gain:1 ]",
|
"[ 15/8 → 2/1 | s:hh gain:1 velocity:1 ]",
|
||||||
"[ 2/1 → 17/8 | s:hh gain:0.4 ]",
|
"[ 2/1 → 17/8 | s:hh gain:0.4 velocity:0.4 ]",
|
||||||
"[ 17/8 → 9/4 | s:hh gain:0.4 ]",
|
"[ 17/8 → 9/4 | s:hh gain:0.4 velocity:0.4 ]",
|
||||||
"[ 9/4 → 19/8 | s:hh gain:1 ]",
|
"[ 9/4 → 19/8 | s:hh gain:1 velocity:0.4 ]",
|
||||||
"[ 19/8 → 5/2 | s:hh gain:0.4 ]",
|
"[ 19/8 → 5/2 | s:hh gain:0.4 velocity:0.4 ]",
|
||||||
"[ 5/2 → 21/8 | s:hh gain:0.4 ]",
|
"[ 5/2 → 21/8 | s:hh gain:0.4 velocity:1 ]",
|
||||||
"[ 21/8 → 11/4 | s:hh gain:1 ]",
|
"[ 21/8 → 11/4 | s:hh gain:1 velocity:1 ]",
|
||||||
"[ 11/4 → 23/8 | s:hh gain:0.4 ]",
|
"[ 11/4 → 23/8 | s:hh gain:0.4 velocity:1 ]",
|
||||||
"[ 23/8 → 3/1 | s:hh gain:1 ]",
|
"[ 23/8 → 3/1 | s:hh gain:1 velocity:1 ]",
|
||||||
"[ 3/1 → 25/8 | s:hh gain:0.4 ]",
|
"[ 3/1 → 25/8 | s:hh gain:0.4 velocity:0.4 ]",
|
||||||
"[ 25/8 → 13/4 | s:hh gain:0.4 ]",
|
"[ 25/8 → 13/4 | s:hh gain:0.4 velocity:0.4 ]",
|
||||||
"[ 13/4 → 27/8 | s:hh gain:1 ]",
|
"[ 13/4 → 27/8 | s:hh gain:1 velocity:0.4 ]",
|
||||||
"[ 27/8 → 7/2 | s:hh gain:0.4 ]",
|
"[ 27/8 → 7/2 | s:hh gain:0.4 velocity:0.4 ]",
|
||||||
"[ 7/2 → 29/8 | s:hh gain:0.4 ]",
|
"[ 7/2 → 29/8 | s:hh gain:0.4 velocity:1 ]",
|
||||||
"[ 29/8 → 15/4 | s:hh gain:1 ]",
|
"[ 29/8 → 15/4 | s:hh gain:1 velocity:1 ]",
|
||||||
"[ 15/4 → 31/8 | s:hh gain:0.4 ]",
|
"[ 15/4 → 31/8 | s:hh gain:0.4 velocity:1 ]",
|
||||||
"[ 31/8 → 4/1 | s:hh gain:1 ]",
|
"[ 31/8 → 4/1 | s:hh gain:1 velocity:1 ]",
|
||||||
]
|
]
|
||||||
`;
|
`;
|
||||||
|
|
||||||
@ -7453,22 +7453,22 @@ exports[`runs examples > example "vibmod" example index 1 1`] = `
|
|||||||
|
|
||||||
exports[`runs examples > example "voicing" example index 0 1`] = `
|
exports[`runs examples > example "voicing" example index 0 1`] = `
|
||||||
[
|
[
|
||||||
"[ 0/1 → 1/4 | note:64 ]",
|
"[ 0/1 → 1/4 | note:52 ]",
|
||||||
"[ 1/4 → 1/2 | note:67 ]",
|
"[ 1/4 → 1/2 | note:60 ]",
|
||||||
"[ 1/2 → 3/4 | note:72 ]",
|
"[ 1/2 → 3/4 | note:64 ]",
|
||||||
"[ 3/4 → 1/1 | note:76 ]",
|
"[ 3/4 → 1/1 | note:67 ]",
|
||||||
"[ 1/1 → 5/4 | note:64 ]",
|
"[ 1/1 → 5/4 | note:57 ]",
|
||||||
"[ 5/4 → 3/2 | note:69 ]",
|
"[ 5/4 → 3/2 | note:60 ]",
|
||||||
"[ 3/2 → 7/4 | note:72 ]",
|
"[ 3/2 → 7/4 | note:64 ]",
|
||||||
"[ 7/4 → 2/1 | note:76 ]",
|
"[ 7/4 → 2/1 | note:69 ]",
|
||||||
"[ 2/1 → 9/4 | note:65 ]",
|
"[ 2/1 → 9/4 | note:53 ]",
|
||||||
"[ 9/4 → 5/2 | note:69 ]",
|
"[ 9/4 → 5/2 | note:60 ]",
|
||||||
"[ 5/2 → 11/4 | note:72 ]",
|
"[ 5/2 → 11/4 | note:65 ]",
|
||||||
"[ 11/4 → 3/1 | note:77 ]",
|
"[ 11/4 → 3/1 | note:69 ]",
|
||||||
"[ 3/1 → 13/4 | note:62 ]",
|
"[ 3/1 → 13/4 | note:55 ]",
|
||||||
"[ 13/4 → 7/2 | note:67 ]",
|
"[ 13/4 → 7/2 | note:62 ]",
|
||||||
"[ 7/2 → 15/4 | note:71 ]",
|
"[ 7/2 → 15/4 | note:67 ]",
|
||||||
"[ 15/4 → 4/1 | note:74 ]",
|
"[ 15/4 → 4/1 | note:71 ]",
|
||||||
]
|
]
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -26,6 +26,7 @@
|
|||||||
"@nanostores/react": "^0.7.1",
|
"@nanostores/react": "^0.7.1",
|
||||||
"@strudel/codemirror": "workspace:*",
|
"@strudel/codemirror": "workspace:*",
|
||||||
"@strudel/core": "workspace:*",
|
"@strudel/core": "workspace:*",
|
||||||
|
"@strudel/draw": "workspace:*",
|
||||||
"@strudel/csound": "workspace:*",
|
"@strudel/csound": "workspace:*",
|
||||||
"@strudel/desktopbridge": "workspace:*",
|
"@strudel/desktopbridge": "workspace:*",
|
||||||
"@strudel/hydra": "workspace:*",
|
"@strudel/hydra": "workspace:*",
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
import { colorMap } from '@strudel/core/color.mjs';
|
import { colorMap } from '@strudel/draw';
|
||||||
import React from 'react';
|
|
||||||
|
|
||||||
const Colors = () => {
|
const Colors = () => {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import { useState, useRef, useCallback, useMemo, useEffect } from 'react';
|
import { useState, useRef, useCallback, useMemo, useEffect } from 'react';
|
||||||
import { Icon } from './Icon';
|
import { Icon } from './Icon';
|
||||||
import { silence, getPunchcardPainter, noteToMidi, _mod } from '@strudel/core';
|
import { silence, noteToMidi, _mod } from '@strudel/core';
|
||||||
|
import { getPunchcardPainter } from '@strudel/draw';
|
||||||
import { transpiler } from '@strudel/transpiler';
|
import { transpiler } from '@strudel/transpiler';
|
||||||
import { getAudioContext, webaudioOutput, initAudioOnFirstClick } from '@strudel/webaudio';
|
import { getAudioContext, webaudioOutput, initAudioOnFirstClick } from '@strudel/webaudio';
|
||||||
import { StrudelMirror } from '@strudel/codemirror';
|
import { StrudelMirror } from '@strudel/codemirror';
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { createCanvas } from 'canvas';
|
import { createCanvas } from 'canvas';
|
||||||
import { pianoroll } from '@strudel/core';
|
import { pianoroll } from '@strudel/draw';
|
||||||
import { evaluate } from '@strudel/transpiler';
|
import { evaluate } from '@strudel/transpiler';
|
||||||
import '../../../../test/runtime.mjs';
|
import '../../../../test/runtime.mjs';
|
||||||
import * as tunes from '../../repl/tunes.mjs';
|
import * as tunes from '../../repl/tunes.mjs';
|
||||||
|
|||||||
@ -238,9 +238,9 @@ Let's break down all pitch envelope controls:
|
|||||||
|
|
||||||
<JsDoc client:idle name="crush" h={0} />
|
<JsDoc client:idle name="crush" h={0} />
|
||||||
|
|
||||||
## shape
|
## distort
|
||||||
|
|
||||||
<JsDoc client:idle name="shape" h={0} />
|
<JsDoc client:idle name="distort" h={0} />
|
||||||
|
|
||||||
# Global Effects
|
# Global Effects
|
||||||
|
|
||||||
|
|||||||
@ -115,7 +115,7 @@ You can use fm with any of the above waveforms, although the below examples all
|
|||||||
|
|
||||||
Strudel can also use the sampler to load custom waveforms as a replacement of the default waveforms used by WebAudio for the base synth. A default set of more than 1000 wavetables is accessible by default (coming from the [AKWF](https://www.adventurekid.se/akrt/waveforms/adventure-kid-waveforms/) set). You can also import/use your own. A wavetable is a one-cycle waveform, which is then repeated to create a sound at the desired frequency. It is a classic but very effective synthesis technique.
|
Strudel can also use the sampler to load custom waveforms as a replacement of the default waveforms used by WebAudio for the base synth. A default set of more than 1000 wavetables is accessible by default (coming from the [AKWF](https://www.adventurekid.se/akrt/waveforms/adventure-kid-waveforms/) set). You can also import/use your own. A wavetable is a one-cycle waveform, which is then repeated to create a sound at the desired frequency. It is a classic but very effective synthesis technique.
|
||||||
|
|
||||||
Any sample preceded by the `wt_` prefix will be loaded as a wavetable. This means that the `loop` argument will be set to `1` by defalt. You can scan over the wavetable by using `loopBegin` and `loopEnd` as well.
|
Any sample preceded by the `wt_` prefix will be loaded as a wavetable. This means that the `loop` argument will be set to `1` by default. You can scan over the wavetable by using `loopBegin` and `loopEnd` as well.
|
||||||
|
|
||||||
<MiniRepl
|
<MiniRepl
|
||||||
client:idle
|
client:idle
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { createCanvas } from 'canvas';
|
import { createCanvas } from 'canvas';
|
||||||
import { pianoroll } from '@strudel/core';
|
import { pianoroll } from '@strudel/draw';
|
||||||
import { evaluate } from '@strudel/transpiler';
|
import { evaluate } from '@strudel/transpiler';
|
||||||
import '../../../../test/runtime.mjs';
|
import '../../../../test/runtime.mjs';
|
||||||
import { getMyPatterns } from '../../my_patterns';
|
import { getMyPatterns } from '../../my_patterns';
|
||||||
|
|||||||
@ -4,7 +4,8 @@ Copyright (C) 2022 Strudel contributors - see <https://github.com/tidalcycles/st
|
|||||||
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { code2hash, getDrawContext, logger, silence } from '@strudel/core';
|
import { code2hash, logger, silence } from '@strudel/core';
|
||||||
|
import { getDrawContext } from '@strudel/draw';
|
||||||
import cx from '@src/cx.mjs';
|
import cx from '@src/cx.mjs';
|
||||||
import { transpiler } from '@strudel/transpiler';
|
import { transpiler } from '@strudel/transpiler';
|
||||||
import {
|
import {
|
||||||
@ -17,6 +18,7 @@ import {
|
|||||||
import { defaultAudioDeviceName } from '../settings.mjs';
|
import { defaultAudioDeviceName } from '../settings.mjs';
|
||||||
import { getAudioDevices, setAudioDevice } from './util.mjs';
|
import { getAudioDevices, setAudioDevice } from './util.mjs';
|
||||||
import { StrudelMirror, defaultSettings } from '@strudel/codemirror';
|
import { StrudelMirror, defaultSettings } from '@strudel/codemirror';
|
||||||
|
import { clearHydra } from '@strudel/hydra';
|
||||||
import { useCallback, useEffect, useRef, useState } from 'react';
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||||
import { settingsMap, useSettings } from '../settings.mjs';
|
import { settingsMap, useSettings } from '../settings.mjs';
|
||||||
import {
|
import {
|
||||||
@ -48,6 +50,14 @@ if (typeof window !== 'undefined') {
|
|||||||
isIframe = window.location !== window.parent.location;
|
isIframe = window.location !== window.parent.location;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function getModule(name) {
|
||||||
|
if (!modulesLoading) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const modules = await modulesLoading;
|
||||||
|
return modules.find((m) => m.packageName === name);
|
||||||
|
}
|
||||||
|
|
||||||
export function Repl({ embedded = false }) {
|
export function Repl({ embedded = false }) {
|
||||||
const isEmbedded = embedded || isIframe;
|
const isEmbedded = embedded || isIframe;
|
||||||
const { panelPosition, isZen } = useSettings();
|
const { panelPosition, isZen } = useSettings();
|
||||||
@ -75,6 +85,11 @@ export function Repl({ embedded = false }) {
|
|||||||
onUpdateState: (state) => {
|
onUpdateState: (state) => {
|
||||||
setReplState({ ...state });
|
setReplState({ ...state });
|
||||||
},
|
},
|
||||||
|
onToggle: (playing) => {
|
||||||
|
if (!playing) {
|
||||||
|
clearHydra();
|
||||||
|
}
|
||||||
|
},
|
||||||
afterEval: (all) => {
|
afterEval: (all) => {
|
||||||
const { code } = all;
|
const { code } = all;
|
||||||
setLatestCode(code);
|
setLatestCode(code);
|
||||||
@ -163,8 +178,10 @@ export function Repl({ embedded = false }) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const resetEditor = async () => {
|
const resetEditor = async () => {
|
||||||
|
(await getModule('@strudel/tonal'))?.resetVoicings();
|
||||||
resetGlobalEffects();
|
resetGlobalEffects();
|
||||||
clearCanvas();
|
clearCanvas();
|
||||||
|
clearHydra();
|
||||||
resetLoadedSounds();
|
resetLoadedSounds();
|
||||||
editorRef.current.repl.setCps(0.5);
|
editorRef.current.repl.setCps(0.5);
|
||||||
await prebake(); // declare default samples
|
await prebake(); // declare default samples
|
||||||
@ -188,15 +205,12 @@ export function Repl({ embedded = false }) {
|
|||||||
logger(`[repl] ✨ loading random tune "${patternData.id}"`);
|
logger(`[repl] ✨ loading random tune "${patternData.id}"`);
|
||||||
setActivePattern(patternData.id);
|
setActivePattern(patternData.id);
|
||||||
setViewingPatternData(patternData);
|
setViewingPatternData(patternData);
|
||||||
clearCanvas();
|
await resetEditor();
|
||||||
resetLoadedSounds();
|
|
||||||
resetGlobalEffects();
|
|
||||||
await prebake(); // declare default samples
|
|
||||||
editorRef.current.setCode(code);
|
editorRef.current.setCode(code);
|
||||||
editorRef.current.repl.evaluate(code);
|
editorRef.current.repl.evaluate(code);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleShare = async () => shareCode(activeCode);
|
const handleShare = async () => shareCode(replState.code);
|
||||||
const context = {
|
const context = {
|
||||||
embedded,
|
embedded,
|
||||||
started,
|
started,
|
||||||
|
|||||||
@ -24,7 +24,9 @@ angle(saw)
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
// https://strudel.cc/?C31_NrcMfZEO
|
// https://strudel.cc/?C31_NrcMfZEO
|
||||||
export const spiralflower = `const {innerWidth:ww,innerHeight:wh} = window;
|
export const spiralflower = `let {innerWidth:ww,innerHeight:wh} = window;
|
||||||
|
ww*=window.devicePixelRatio;
|
||||||
|
wh*=window.devicePixelRatio;
|
||||||
const ctx = getDrawContext()
|
const ctx = getDrawContext()
|
||||||
const piDiv180 = Math.PI / 180;
|
const piDiv180 = Math.PI / 180;
|
||||||
function fromPolar(angle, radius, cx, cy) {
|
function fromPolar(angle, radius, cx, cy) {
|
||||||
|
|||||||
@ -239,8 +239,10 @@ export const wavyKalimba = `// "Wavy kalimba"
|
|||||||
// @license CC BY-NC-SA 4.0 https://creativecommons.org/licenses/by-nc-sa/4.0/
|
// @license CC BY-NC-SA 4.0 https://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||||
// @by Felix Roos
|
// @by Felix Roos
|
||||||
|
|
||||||
|
setcps(1)
|
||||||
|
|
||||||
samples({
|
samples({
|
||||||
'kalimba': { c5:'https://freesound.org/data/previews/536/536549_11935698-lq.mp3' }
|
'kalimba': { c5:'https://cdn.freesound.org/previews/536/536549_11935698-lq.mp3' }
|
||||||
})
|
})
|
||||||
const scales = "<C:major C:mixolydian F:lydian [F:minor Db:major]>"
|
const scales = "<C:major C:mixolydian F:lydian [F:minor Db:major]>"
|
||||||
|
|
||||||
@ -271,19 +273,18 @@ export const festivalOfFingers = `// "Festival of fingers"
|
|||||||
|
|
||||||
const chords = "<Cm7 Fm7 G7 F#7>";
|
const chords = "<Cm7 Fm7 G7 F#7>";
|
||||||
stack(
|
stack(
|
||||||
chord(chords).dict('lefthand').voicing().struct("x(3,8,-1)")
|
chord(chords).dict('lefthand').voicing()
|
||||||
.velocity(.5).off(1/7,x=>x.add(note(12)).velocity(.2)),
|
.struct("x(3,8,-1)")
|
||||||
|
.gain(.5).off(1/7,x=>x.add(note(12)).mul(gain(.2))),
|
||||||
chords.rootNotes(2).struct("x(4,8,-2)").note(),
|
chords.rootNotes(2).struct("x(4,8,-2)").note(),
|
||||||
|
|
||||||
chords.rootNotes(4)
|
chords.rootNotes(4)
|
||||||
.scale(cat('C minor','F dorian','G dorian','F# mixolydian'))
|
.scale(cat('C minor','F dorian','G dorian','F# mixolydian'))
|
||||||
.struct("x(3,8,-2)".fast(2))
|
.struct("x(3,8,-2)".fast(2))
|
||||||
.scaleTranspose("0 4 0 6".early(".125 .5")).layer(scaleTranspose("0,<2 [4,6] [5,7]>/4"))
|
.scaleTranspose("0 4 0 6".early(".125 .5"))
|
||||||
|
.layer(scaleTranspose("0,<2 [4,6] [5,7]>/4"))
|
||||||
.note()
|
.note()
|
||||||
|
|
||||||
).slow(2)
|
).slow(2)
|
||||||
.velocity(sine.struct("x*8").add(3/5).mul(2/5).fast(8))
|
.mul(gain(sine.struct("x*8").add(3/5).mul(2/5).fast(8)))
|
||||||
.piano()`;
|
.piano()`;
|
||||||
|
|
||||||
// iter, echo, echoWith
|
// iter, echo, echoWith
|
||||||
@ -302,14 +303,14 @@ stack(
|
|||||||
"[c2 a1 bb1 ~] ~"
|
"[c2 a1 bb1 ~] ~"
|
||||||
.echo(2, 1/16, 1)
|
.echo(2, 1/16, 1)
|
||||||
.slow(2)
|
.slow(2)
|
||||||
.layer(h)
|
|
||||||
.note().s('square')
|
.note().s('square')
|
||||||
|
.layer(h)
|
||||||
.clip(.4)
|
.clip(.4)
|
||||||
.cutoff(400).decay(.12).sustain(0)
|
.cutoff(400).decay(.12).sustain(0)
|
||||||
,
|
,
|
||||||
"[g2,[c3 eb3]]".iter(4)
|
"[g2,[c3 eb3]]".iter(4)
|
||||||
.echoWith(4, 1/8, (x,n)=>x.transpose(n*12).velocity(Math.pow(.4,n)))
|
.echoWith(4, 1/8, (x,n)=>x.transpose(n*12).gain(Math.pow(.4,n)))
|
||||||
.layer(h).note()
|
.note().layer(h)
|
||||||
.clip(.1)
|
.clip(.1)
|
||||||
)
|
)
|
||||||
.fast(2/3)
|
.fast(2/3)
|
||||||
@ -349,11 +350,11 @@ stack(
|
|||||||
.n().scale(scale),
|
.n().scale(scale),
|
||||||
n("<0 4>(5,8,-1)").scale(scale).sub(note(12))
|
n("<0 4>(5,8,-1)").scale(scale).sub(note(12))
|
||||||
)
|
)
|
||||||
.velocity(".6 .7".fast(4))
|
.gain(".6 .7".fast(4))
|
||||||
.add(note(4))
|
.add(note(4))
|
||||||
.piano()
|
.piano()
|
||||||
.clip(2)
|
.clip(2)
|
||||||
.velocity(.8)
|
.mul(gain(.8))
|
||||||
.slow(2)
|
.slow(2)
|
||||||
.pianoroll()`;
|
.pianoroll()`;
|
||||||
|
|
||||||
@ -410,16 +411,16 @@ export const randomBells = `// "Random bells"
|
|||||||
// @by Felix Roos
|
// @by Felix Roos
|
||||||
|
|
||||||
samples({
|
samples({
|
||||||
bell: { c6: 'https://freesound.org/data/previews/411/411089_5121236-lq.mp3' },
|
bell: { c6: 'https://cdn.freesound.org/previews/411/411089_5121236-lq.mp3' },
|
||||||
bass: { d2: 'https://freesound.org/data/previews/608/608286_13074022-lq.mp3' }
|
bass: { d2: 'https://cdn.freesound.org/previews/608/608286_13074022-lq.mp3' }
|
||||||
})
|
})
|
||||||
|
|
||||||
stack(
|
stack(
|
||||||
// bells
|
// bells
|
||||||
"0".euclidLegato(3,8)
|
n("0").euclidLegato(3,8)
|
||||||
.echo(3, 1/16, .5)
|
.echo(3, 1/16, .5)
|
||||||
.add(rand.range(0,12))
|
.add(n(rand.range(0,12)))
|
||||||
.scale("D:minor:pentatonic").note()
|
.scale("D:minor:pentatonic")
|
||||||
.velocity(rand.range(.5,1))
|
.velocity(rand.range(.5,1))
|
||||||
.s('bell').gain(.6).delay(.2).delaytime(1/3).delayfeedback(.8),
|
.s('bell').gain(.6).delay(.2).delaytime(1/3).delayfeedback(.8),
|
||||||
// bass
|
// bass
|
||||||
@ -462,7 +463,7 @@ samples({
|
|||||||
hh: '561/561241_12517458-lq.mp3',
|
hh: '561/561241_12517458-lq.mp3',
|
||||||
hh2:'44/44944_236326-lq.mp3',
|
hh2:'44/44944_236326-lq.mp3',
|
||||||
hh3: '44/44944_236326-lq.mp3',
|
hh3: '44/44944_236326-lq.mp3',
|
||||||
}, 'https://freesound.org/data/previews/')
|
}, 'https://cdn.freesound.org/previews/')
|
||||||
|
|
||||||
stack(
|
stack(
|
||||||
"-7 0 -7 7".struct("x(5,8,1)").fast(2).sub(7)
|
"-7 0 -7 7".struct("x(5,8,1)").fast(2).sub(7)
|
||||||
@ -473,10 +474,9 @@ stack(
|
|||||||
.apply(filter1)
|
.apply(filter1)
|
||||||
.lpa(.1).lpenv(2).ftype('24db')
|
.lpa(.1).lpenv(2).ftype('24db')
|
||||||
,
|
,
|
||||||
"~@3 [<2 3>,<4 5>]"
|
n("~@3 [<2 3>,<4 5>]")
|
||||||
.echo(4,1/16,.7)
|
.echo(4,1/16,.7)
|
||||||
.scale(scales)
|
.scale(scales)
|
||||||
.note()
|
|
||||||
.s('square').gain(.7)
|
.s('square').gain(.7)
|
||||||
.attack(0.01).decay(0.1).sustain(0)
|
.attack(0.01).decay(0.1).sustain(0)
|
||||||
.apply(filter1),
|
.apply(filter1),
|
||||||
@ -484,12 +484,11 @@ stack(
|
|||||||
.superimpose(sub("5"))
|
.superimpose(sub("5"))
|
||||||
.fast(1).euclidLegato(3,8)
|
.fast(1).euclidLegato(3,8)
|
||||||
.mask("<1 0@7>")
|
.mask("<1 0@7>")
|
||||||
.fast(2)
|
.fast(2).n()
|
||||||
.echo(32, 1/8, .8)
|
.echo(32, 1/8, .8)
|
||||||
.scale(scales)
|
.scale(scales)
|
||||||
.note()
|
|
||||||
.s("sawtooth")
|
.s("sawtooth")
|
||||||
.gain(sine.range(.1,.4).slow(8))
|
.mul(gain(sine.range(.1,.4).slow(8)))
|
||||||
.attack(.001).decay(.2).sustain(0)
|
.attack(.001).decay(.2).sustain(0)
|
||||||
.apply(filter2)
|
.apply(filter2)
|
||||||
).stack(
|
).stack(
|
||||||
@ -498,13 +497,14 @@ stack(
|
|||||||
"~ sn",
|
"~ sn",
|
||||||
"[~ hh3]*2"
|
"[~ hh3]*2"
|
||||||
).s().fast(2).gain(.7)
|
).s().fast(2).gain(.7)
|
||||||
).slow(2)
|
).slow(2)`;
|
||||||
// strudel disable-highlighting`;
|
|
||||||
|
|
||||||
export const festivalOfFingers3 = `// "Festival of fingers 3"
|
export const festivalOfFingers3 = `// "Festival of fingers 3"
|
||||||
// @license CC BY-NC-SA 4.0 https://creativecommons.org/licenses/by-nc-sa/4.0/
|
// @license CC BY-NC-SA 4.0 https://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||||
// @by Felix Roos
|
// @by Felix Roos
|
||||||
|
|
||||||
|
setcps(1)
|
||||||
|
|
||||||
n("[-7*3],0,2,6,[8 7]")
|
n("[-7*3],0,2,6,[8 7]")
|
||||||
.echoWith(
|
.echoWith(
|
||||||
4, // echo 4 times
|
4, // echo 4 times
|
||||||
@ -514,7 +514,7 @@ n("[-7*3],0,2,6,[8 7]")
|
|||||||
.gain(1/(i+1)) // reduce gain
|
.gain(1/(i+1)) // reduce gain
|
||||||
.clip(1/(i+1))
|
.clip(1/(i+1))
|
||||||
)
|
)
|
||||||
.velocity(perlin.range(.5,.9).slow(8))
|
.mul(gain(perlin.range(.5,.9).slow(8)))
|
||||||
.stack(n("[22 25]*3")
|
.stack(n("[22 25]*3")
|
||||||
.clip(sine.range(.5,2).slow(8))
|
.clip(sine.range(.5,2).slow(8))
|
||||||
.gain(sine.range(.4,.8).slow(5))
|
.gain(sine.range(.4,.8).slow(5))
|
||||||
@ -610,15 +610,17 @@ sd: ['sd/rytm-01-classic.wav','sd/rytm-00-hard.wav'],
|
|||||||
hh: ['hh27/000_hh27closedhh.wav','hh/000_hh3closedhh.wav'],
|
hh: ['hh27/000_hh27closedhh.wav','hh/000_hh3closedhh.wav'],
|
||||||
}, 'github:tidalcycles/dirt-samples');
|
}, 'github:tidalcycles/dirt-samples');
|
||||||
|
|
||||||
note("<8(3,8) <7 7*2> [4 5@3] 8>".sub(1) // sub 1 -> 1-indexed
|
setcps(1)
|
||||||
|
|
||||||
|
"<8(3,8) <7 7*2> [4 5@3] 8>".sub(1) // sub 1 -> 1-indexed
|
||||||
.layer(
|
.layer(
|
||||||
x=>x,
|
x=>x,
|
||||||
x=>x.add(7).color('steelblue')
|
x=>x.add(7).color('steelblue')
|
||||||
.off(1/8,x=>x.add("2,4").off(1/8,x=>x.add(5).echo(4,.125,.5)))
|
.off(1/8,x=>x.add("2,4").off(1/8,x=>x.add(5).echo(4,.125,.5)))
|
||||||
.slow(2),
|
.slow(2),
|
||||||
).scale('A1 minor'))
|
).n().scale('A1 minor')
|
||||||
.s("flbass").n(0)
|
.s("flbass").n(0)
|
||||||
.gain(.3)
|
.mul(gain(.3))
|
||||||
.cutoff(sine.slow(7).range(200,4000))
|
.cutoff(sine.slow(7).range(200,4000))
|
||||||
.resonance(10)
|
.resonance(10)
|
||||||
//.hcutoff(400)
|
//.hcutoff(400)
|
||||||
|
|||||||
@ -72,6 +72,7 @@ export async function getRandomTune() {
|
|||||||
export function loadModules() {
|
export function loadModules() {
|
||||||
let modules = [
|
let modules = [
|
||||||
import('@strudel/core'),
|
import('@strudel/core'),
|
||||||
|
import('@strudel/draw'),
|
||||||
import('@strudel/tonal'),
|
import('@strudel/tonal'),
|
||||||
import('@strudel/mini'),
|
import('@strudel/mini'),
|
||||||
import('@strudel/xen'),
|
import('@strudel/xen'),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user