mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-11 05:38:34 +00:00
Merge branch 'main' into fanchor
This commit is contained in:
commit
d9214b91b6
@ -22,4 +22,4 @@ vite.config.js
|
||||
reverbGen.mjs
|
||||
hydra.mjs
|
||||
jsdoc-synonyms.js
|
||||
packages/hs2js/src/hs2js.mjs
|
||||
packages/hs2js/src/hs2js.mjs
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
{
|
||||
"env": {
|
||||
"node": true,
|
||||
"browser": true,
|
||||
"es2021": true
|
||||
},
|
||||
|
||||
@ -1,9 +1,31 @@
|
||||
<!doctype html>
|
||||
<script src="https://unpkg.com/@strudel/web@1.0.3"></script>
|
||||
<button id="play">play</button>
|
||||
<button id="stop">stop</button>
|
||||
<script>
|
||||
strudel.initStrudel();
|
||||
document.getElementById('play').addEventListener('click', () => evaluate('note("c a f e").jux(rev)'));
|
||||
document.getElementById('play').addEventListener('stop', () => hush());
|
||||
</script>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<!-- <script src="../../packages/web/dist/index.js"></script> -->
|
||||
<script src="https://unpkg.com/@strudel/web@1.0.3"></script>
|
||||
</head>
|
||||
<body style="background: #222">
|
||||
<button id="play">play</button>
|
||||
<button id="stop">stop</button>
|
||||
<script>
|
||||
strudel.initStrudel();
|
||||
document.getElementById('play').addEventListener('click', () =>
|
||||
evaluate(`
|
||||
//@title washover @by Switch Angel
|
||||
//@social https://www.instagram.com/_switch_angel/
|
||||
|
||||
n("{0 1 3 5 2 }%16")
|
||||
.add(n(tri.range(0, 6).slow(3)))
|
||||
.scale("C4:pentatonic")
|
||||
.sound("sawtooth").att(saw.range(0, 0.05).fast(6))
|
||||
.release(3).pan(rand).decay(rand.range(0.1, 0.3))
|
||||
.lpf(tri.range(200, 8000).slow(5)).lpq(0)
|
||||
.gain(.4).vib(1).vibmod(.1)
|
||||
.scope({pos:.5})
|
||||
`),
|
||||
);
|
||||
document.getElementById('stop').addEventListener('click', () => strudel.hush());
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -1,16 +1,24 @@
|
||||
<!doctype html>
|
||||
<script src="https://unpkg.com/@strudel/web@1.0.3"></script>
|
||||
<button id="a">A</button>
|
||||
<button id="b">B</button>
|
||||
<button id="c">C</button>
|
||||
<button id="stop">stop</button>
|
||||
<script>
|
||||
initStrudel({
|
||||
prebake: () => samples('github:tidalcycles/dirt-samples'),
|
||||
});
|
||||
const click = (id, action) => document.getElementById(id).addEventListener('click', action);
|
||||
click('a', () => evaluate(`s('bd,jvbass(3,8)').jux(rev)`));
|
||||
click('b', () => s('bd*2,hh(3,4),jvbass(5,8,1)').jux(rev).play());
|
||||
click('c', () => s('bd*2,hh(3,4),jvbass:[0 4](5,8,1)').jux(rev).stack(s('~ sd')).play());
|
||||
click('stop', () => hush());
|
||||
</script>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<!-- <script src="../../packages/web/dist/index.js"></script> -->
|
||||
<script src="https://unpkg.com/@strudel/web@1.0.3"></script>
|
||||
</head>
|
||||
<body style="background: #222">
|
||||
<button id="a">A</button>
|
||||
<button id="b">B</button>
|
||||
<button id="c">C</button>
|
||||
<button id="stop">stop</button>
|
||||
<script>
|
||||
initStrudel({
|
||||
prebake: () => samples('github:tidalcycles/dirt-samples'),
|
||||
});
|
||||
const click = (id, action) => document.getElementById(id).addEventListener('click', action);
|
||||
click('a', () => evaluate(`s('bd,jvbass(3,8)').jux(rev)`));
|
||||
click('b', () => s('bd*2,hh(3,4),jvbass(5,8,1)').jux(rev).play());
|
||||
click('c', () => s('bd*2,hh(3,4),jvbass:[0 4](5,8,1)').jux(rev).stack(s('~ sd')).play());
|
||||
click('stop', () => hush());
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -430,6 +430,17 @@ export const { crush } = registerControl('crush');
|
||||
*/
|
||||
export const { coarse } = registerControl('coarse');
|
||||
|
||||
/**
|
||||
* filter overdrive for supported filter types
|
||||
*
|
||||
* @name drive
|
||||
* @param {number | Pattern} amount
|
||||
* @example
|
||||
* note("{f g g c d a a#}%16".sub(17)).s("supersaw").lpenv(8).lpf(150).lpq(.8).ftype('ladder').drive("<.5 4>")
|
||||
*
|
||||
*/
|
||||
export const { drive } = registerControl('drive');
|
||||
|
||||
/**
|
||||
* Allows you to set the output channels on the interface
|
||||
*
|
||||
@ -742,15 +753,17 @@ export const { hprelease, hpr } = registerControl('hprelease', 'hpr');
|
||||
*/
|
||||
export const { bprelease, bpr } = registerControl('bprelease', 'bpr');
|
||||
/**
|
||||
* Sets the filter type. The 24db filter is more aggressive. More types might be added in the future.
|
||||
* Sets the filter type. The ladder filter is more aggressive. More types might be added in the future.
|
||||
* @name ftype
|
||||
* @param {number | Pattern} type 12db (default) or 24db
|
||||
* @param {number | Pattern} type 12db (0), ladder (1), or 24db (2)
|
||||
* @example
|
||||
* note("c2 e2 f2 g2")
|
||||
* note("{f g g c d a a#}%8").s("sawtooth").lpenv(4).lpf(500).ftype("<0 1 2>").lpq(1)
|
||||
* @example
|
||||
* note("c f g g a c d4").fast(2)
|
||||
* .sound('sawtooth')
|
||||
* .lpf(500)
|
||||
* .bpenv(4)
|
||||
* .ftype("12db 24db")
|
||||
* .lpf(200).fanchor(0)
|
||||
* .lpenv(3).lpq(1)
|
||||
* .ftype("<ladder 12db 24db>")
|
||||
*/
|
||||
export const { ftype } = registerControl('ftype');
|
||||
|
||||
|
||||
@ -191,7 +191,16 @@ export function getComputedPropertyValue(name) {
|
||||
return getComputedStyle(document.documentElement).getPropertyValue(name);
|
||||
}
|
||||
|
||||
let theme = {};
|
||||
let theme = {
|
||||
background: '#222',
|
||||
foreground: '#75baff',
|
||||
caret: '#ffcc00',
|
||||
selection: 'rgba(128, 203, 196, 0.5)',
|
||||
selectionMatch: '#036dd626',
|
||||
lineHighlight: '#00000050',
|
||||
gutterBackground: 'transparent',
|
||||
gutterForeground: '#8a919966',
|
||||
};
|
||||
export function getTheme() {
|
||||
return theme;
|
||||
}
|
||||
|
||||
@ -108,7 +108,7 @@ export function pianoroll({
|
||||
active = getTheme().foreground,
|
||||
background = 'transparent',
|
||||
smear = 0,
|
||||
playheadColor = 'white',
|
||||
playheadColor = getTheme().foreground,
|
||||
minMidi = 10,
|
||||
maxMidi = 90,
|
||||
autorange = 0,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { getDrawContext } from '@strudel/draw';
|
||||
import { controls } from '@strudel/core';
|
||||
import { controls, getTime, reify } from '@strudel/core';
|
||||
|
||||
let latestOptions;
|
||||
let hydra;
|
||||
@ -27,6 +27,7 @@ export async function initHydra(options = {}) {
|
||||
hydraConfig.canvas = canvas;
|
||||
|
||||
await import(/* @vite-ignore */ src);
|
||||
/* eslint-disable-next-line */
|
||||
hydra = new Hydra(hydraConfig);
|
||||
if (feedStrudel) {
|
||||
const { canvas } = getDrawContext();
|
||||
@ -46,4 +47,4 @@ export function clearHydra() {
|
||||
globalThis.shape = controls.shape;
|
||||
}
|
||||
|
||||
export const H = (p) => () => p.queryArc(getTime(), getTime())[0].value;
|
||||
export const H = (p) => () => reify(p).queryArc(getTime(), getTime())[0].value;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@strudel/sampler",
|
||||
"version": "0.0.9",
|
||||
"version": "0.0.13",
|
||||
"description": "",
|
||||
"keywords": [
|
||||
"tidalcycles",
|
||||
|
||||
@ -4,7 +4,7 @@ import cowsay from 'cowsay';
|
||||
import { createReadStream } from 'fs';
|
||||
import { readdir } from 'fs/promises';
|
||||
import http from 'http';
|
||||
import { join } from 'path';
|
||||
import { join, sep } from 'path';
|
||||
import os from 'os';
|
||||
|
||||
// eslint-disable-next-line
|
||||
@ -45,15 +45,16 @@ async function getFilesInDirectory(directory) {
|
||||
}
|
||||
|
||||
async function getBanks(directory) {
|
||||
// const directory = resolve(__dirname, '.');
|
||||
let files = await getFilesInDirectory(directory);
|
||||
let banks = {};
|
||||
files = files.map((url) => {
|
||||
const [bank] = url.split('/').slice(-2);
|
||||
directory = directory.split(sep).join('/');
|
||||
files = files.map((path) => {
|
||||
path = path.split(sep).join('/');
|
||||
const [bank] = path.split('/').slice(-2);
|
||||
banks[bank] = banks[bank] || [];
|
||||
url = url.replace(directory, '');
|
||||
banks[bank].push(url);
|
||||
return url;
|
||||
const relativeUrl = path.replace(directory, '');
|
||||
banks[bank].push(relativeUrl);
|
||||
return relativeUrl;
|
||||
});
|
||||
banks._base = `http://localhost:5432`;
|
||||
return { banks, files };
|
||||
@ -74,7 +75,7 @@ const server = http.createServer(async (req, res) => {
|
||||
res.end('File not found');
|
||||
return;
|
||||
}
|
||||
const filePath = join(directory, subpath);
|
||||
const filePath = join(directory, subpath.split('/').join(sep));
|
||||
const readStream = createReadStream(filePath);
|
||||
readStream.on('error', (err) => {
|
||||
res.statusCode = 500;
|
||||
|
||||
@ -14,6 +14,15 @@ const getSlope = (y1, y2, x1, x2) => {
|
||||
}
|
||||
return (y2 - y1) / (x2 - x1);
|
||||
};
|
||||
|
||||
export function getWorklet(ac, processor, params, config) {
|
||||
const node = new AudioWorkletNode(ac, processor, config);
|
||||
Object.entries(params).forEach(([key, value]) => {
|
||||
node.parameters.get(key).value = value;
|
||||
});
|
||||
return node;
|
||||
}
|
||||
|
||||
export const getParamADSR = (
|
||||
param,
|
||||
attack,
|
||||
@ -103,14 +112,22 @@ export const getADSRValues = (params, curve = 'linear', defaultValues) => {
|
||||
return [Math.max(a ?? 0, envmin), Math.max(d ?? 0, envmin), Math.min(sustain, envmax), Math.max(r ?? 0, releaseMin)];
|
||||
};
|
||||
|
||||
export function createFilter(context, type, frequency, Q, att, dec, sus, rel, fenv, start, end, fanchor) {
|
||||
export function createFilter(context, type, frequency, Q, att, dec, sus, rel, fenv, start, end, fanchor, model, drive) {
|
||||
const curve = 'exponential';
|
||||
const [attack, decay, sustain, release] = getADSRValues([att, dec, sus, rel], curve, [0.005, 0.14, 0, 0.1]);
|
||||
const filter = context.createBiquadFilter();
|
||||
let filter;
|
||||
let frequencyParam;
|
||||
if (model === 'ladder') {
|
||||
filter = getWorklet(context, 'ladder-processor', { frequency, q: Q, drive });
|
||||
frequencyParam = filter.parameters.get('frequency');
|
||||
} else {
|
||||
filter = context.createBiquadFilter();
|
||||
filter.type = type;
|
||||
filter.Q.value = Q;
|
||||
filter.frequency.value = frequency;
|
||||
frequencyParam = filter.frequency;
|
||||
}
|
||||
|
||||
filter.type = type;
|
||||
filter.Q.value = Q;
|
||||
filter.frequency.value = frequency;
|
||||
// envelope is active when any of these values is set
|
||||
const hasEnvelope = att ?? dec ?? sus ?? rel ?? fenv;
|
||||
// Apply ADSR to filter frequency
|
||||
@ -122,7 +139,7 @@ export function createFilter(context, type, frequency, Q, att, dec, sus, rel, fe
|
||||
let min = clamp(2 ** -offset * frequency, 0, 20000);
|
||||
let max = clamp(2 ** (fenvAbs - offset) * frequency, 0, 20000);
|
||||
if (fenv < 0) [min, max] = [max, min];
|
||||
getParamADSR(filter.frequency, attack, decay, sustain, release, min, max, start, end, curve);
|
||||
getParamADSR(frequencyParam, attack, decay, sustain, release, min, max, start, end, curve);
|
||||
return filter;
|
||||
}
|
||||
return filter;
|
||||
|
||||
@ -7,9 +7,9 @@ This program is free software: you can redistribute it and/or modify it under th
|
||||
import './feedbackdelay.mjs';
|
||||
import './reverb.mjs';
|
||||
import './vowel.mjs';
|
||||
import { clamp, nanFallback } from './util.mjs';
|
||||
import { clamp, nanFallback, _mod } from './util.mjs';
|
||||
import workletsUrl from './worklets.mjs?url';
|
||||
import { createFilter, gainNode, getCompressor } from './helpers.mjs';
|
||||
import { createFilter, gainNode, getCompressor, getWorklet } from './helpers.mjs';
|
||||
import { map } from 'nanostores';
|
||||
import { logger } from './logger.mjs';
|
||||
import { loadBuffer } from './sampler.mjs';
|
||||
@ -84,14 +84,6 @@ function loadWorklets() {
|
||||
return workletsLoading;
|
||||
}
|
||||
|
||||
export function getWorklet(ac, processor, params, config) {
|
||||
const node = new AudioWorkletNode(ac, processor, config);
|
||||
Object.entries(params).forEach(([key, value]) => {
|
||||
node.parameters.get(key).value = value;
|
||||
});
|
||||
return node;
|
||||
}
|
||||
|
||||
// this function should be called on first user interaction (to avoid console warning)
|
||||
export async function initAudio(options = {}) {
|
||||
const { disableWorklets = false } = options;
|
||||
@ -178,26 +170,25 @@ function getDelay(orbit, delaytime, delayfeedback, t) {
|
||||
return delays[orbit];
|
||||
}
|
||||
|
||||
// each orbit will have its own lfo
|
||||
const phaserLFOs = {};
|
||||
function getPhaser(orbit, t, speed = 1, depth = 0.5, centerFrequency = 1000, sweep = 2000) {
|
||||
function getPhaser(time, end, frequency = 1, depth = 0.5, centerFrequency = 1000, sweep = 2000) {
|
||||
//gain
|
||||
const ac = getAudioContext();
|
||||
const lfoGain = ac.createGain();
|
||||
lfoGain.gain.value = sweep;
|
||||
lfoGain.gain.value = sweep * 2;
|
||||
// centerFrequency = centerFrequency * 2;
|
||||
// sweep = sweep * 1.5;
|
||||
|
||||
//LFO
|
||||
if (phaserLFOs[orbit] == null) {
|
||||
phaserLFOs[orbit] = ac.createOscillator();
|
||||
phaserLFOs[orbit].frequency.value = speed;
|
||||
phaserLFOs[orbit].type = 'sine';
|
||||
phaserLFOs[orbit].start();
|
||||
}
|
||||
|
||||
phaserLFOs[orbit].connect(lfoGain);
|
||||
if (phaserLFOs[orbit].frequency.value != speed) {
|
||||
phaserLFOs[orbit].frequency.setValueAtTime(speed, t);
|
||||
}
|
||||
const lfo = getWorklet(ac, 'lfo-processor', {
|
||||
frequency,
|
||||
depth: 1,
|
||||
skew: 0,
|
||||
phaseoffset: 0,
|
||||
time,
|
||||
end,
|
||||
shape: 1,
|
||||
dcoffset: -0.5,
|
||||
});
|
||||
lfo.connect(lfoGain);
|
||||
|
||||
//filters
|
||||
const numStages = 2; //num of filters in series
|
||||
@ -220,10 +211,14 @@ function getPhaser(orbit, t, speed = 1, depth = 0.5, centerFrequency = 1000, swe
|
||||
return filterChain[filterChain.length - 1];
|
||||
}
|
||||
|
||||
function getFilterType(ftype) {
|
||||
ftype = ftype ?? 0;
|
||||
const filterTypes = ['12db', 'ladder', '24db'];
|
||||
return typeof ftype === 'number' ? filterTypes[Math.floor(_mod(ftype, filterTypes.length))] : ftype;
|
||||
}
|
||||
|
||||
let reverbs = {};
|
||||
|
||||
let hasChanged = (now, before) => now !== undefined && now !== before;
|
||||
|
||||
function getReverb(orbit, duration, fade, lp, dim, ir) {
|
||||
// If no reverb has been created for a given orbit, create one
|
||||
if (!reverbs[orbit]) {
|
||||
@ -322,8 +317,8 @@ export const superdough = async (value, t, hapDuration) => {
|
||||
postgain = defaults.get('postgain'),
|
||||
density = defaults.get('density'),
|
||||
// filters
|
||||
ftype = defaults.get('ftype'),
|
||||
fanchor = defaults.get('fanchor'),
|
||||
drive = 0.69,
|
||||
// low pass
|
||||
cutoff,
|
||||
lpenv,
|
||||
@ -428,6 +423,8 @@ export const superdough = async (value, t, hapDuration) => {
|
||||
// gain stage
|
||||
chain.push(gainNode(gain));
|
||||
|
||||
//filter
|
||||
const ftype = getFilterType(value.ftype);
|
||||
if (cutoff !== undefined) {
|
||||
let lp = () =>
|
||||
createFilter(
|
||||
@ -443,6 +440,8 @@ export const superdough = async (value, t, hapDuration) => {
|
||||
t,
|
||||
t + hapDuration,
|
||||
fanchor,
|
||||
ftype,
|
||||
drive,
|
||||
);
|
||||
chain.push(lp());
|
||||
if (ftype === '24db') {
|
||||
@ -518,7 +517,7 @@ export const superdough = async (value, t, hapDuration) => {
|
||||
}
|
||||
// phaser
|
||||
if (phaser !== undefined && phaserdepth > 0) {
|
||||
const phaserFX = getPhaser(orbit, t, phaser, phaserdepth, phasercenter, phasersweep);
|
||||
const phaserFX = getPhaser(t, t + hapDuration, phaser, phaserdepth, phasercenter, phasersweep);
|
||||
chain.push(phaserFX);
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { clamp, midiToFreq, noteToMidi } from './util.mjs';
|
||||
import { registerSound, getAudioContext, getWorklet } from './superdough.mjs';
|
||||
import { registerSound, getAudioContext } from './superdough.mjs';
|
||||
import {
|
||||
applyFM,
|
||||
gainNode,
|
||||
@ -8,6 +8,7 @@ import {
|
||||
getPitchEnvelope,
|
||||
getVibratoOscillator,
|
||||
webAudioTimeout,
|
||||
getWorklet,
|
||||
} from './helpers.mjs';
|
||||
import { getNoiseMix, getNoiseOscillator } from './noise.mjs';
|
||||
|
||||
|
||||
@ -1,7 +1,141 @@
|
||||
// coarse, crush, and shape processors adapted from dktr0's webdirt: https://github.com/dktr0/WebDirt/blob/5ce3d698362c54d6e1b68acc47eb2955ac62c793/dist/AudioWorklets.js
|
||||
// LICENSE GNU General Public License v3.0 see https://github.com/dktr0/WebDirt/blob/main/LICENSE
|
||||
// TOFIX: THIS FILE DOES NOT SUPPORT IMPORTS ON DEPOLYMENT
|
||||
const clamp = (num, min, max) => Math.min(Math.max(num, min), max);
|
||||
const _mod = (n, m) => ((n % m) + m) % m;
|
||||
|
||||
const blockSize = 128;
|
||||
// adjust waveshape to remove frequencies above nyquist to prevent aliasing
|
||||
// referenced from https://www.kvraudio.com/forum/viewtopic.php?t=375517
|
||||
function polyBlep(phase, dt) {
|
||||
// 0 <= phase < 1
|
||||
if (phase < dt) {
|
||||
phase /= dt;
|
||||
// 2 * (phase - phase^2/2 - 0.5)
|
||||
return phase + phase - phase * phase - 1;
|
||||
}
|
||||
|
||||
// -1 < phase < 0
|
||||
else if (phase > 1 - dt) {
|
||||
phase = (phase - 1) / dt;
|
||||
// 2 * (phase^2/2 + phase + 0.5)
|
||||
return phase * phase + phase + phase + 1;
|
||||
}
|
||||
|
||||
// 0 otherwise
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
const waveshapes = {
|
||||
tri(phase, skew = 0.5) {
|
||||
const x = 1 - skew;
|
||||
if (phase >= skew) {
|
||||
return 1 / x - phase / x;
|
||||
}
|
||||
return phase / skew;
|
||||
},
|
||||
sine(phase) {
|
||||
return Math.sin(Math.PI * 2 * phase) * 0.5 + 0.5;
|
||||
},
|
||||
ramp(phase) {
|
||||
return phase;
|
||||
},
|
||||
saw(phase) {
|
||||
return 1 - phase;
|
||||
},
|
||||
|
||||
square(phase, skew = 0.5) {
|
||||
if (phase >= skew) {
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
},
|
||||
custom(phase, values = [0, 1]) {
|
||||
const numParts = values.length - 1;
|
||||
const currPart = Math.floor(phase * numParts);
|
||||
|
||||
const partLength = 1 / numParts;
|
||||
const startVal = clamp(values[currPart], 0, 1);
|
||||
const endVal = clamp(values[currPart + 1], 0, 1);
|
||||
const y2 = endVal;
|
||||
const y1 = startVal;
|
||||
const x1 = 0;
|
||||
const x2 = partLength;
|
||||
const slope = (y2 - y1) / (x2 - x1);
|
||||
return slope * (phase - partLength * currPart) + startVal;
|
||||
},
|
||||
sawblep(phase, dt) {
|
||||
const v = 2 * phase - 1;
|
||||
return v - polyBlep(phase, dt);
|
||||
},
|
||||
};
|
||||
|
||||
const waveShapeNames = Object.keys(waveshapes);
|
||||
class LFOProcessor extends AudioWorkletProcessor {
|
||||
static get parameterDescriptors() {
|
||||
return [
|
||||
{ name: 'time', defaultValue: 0 },
|
||||
{ name: 'end', defaultValue: 0 },
|
||||
{ name: 'frequency', defaultValue: 0.5 },
|
||||
{ name: 'skew', defaultValue: 0.5 },
|
||||
{ name: 'depth', defaultValue: 1 },
|
||||
{ name: 'phaseoffset', defaultValue: 0 },
|
||||
{ name: 'shape', defaultValue: 0 },
|
||||
{ name: 'dcoffset', defaultValue: 0 },
|
||||
];
|
||||
}
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this.phase;
|
||||
}
|
||||
|
||||
incrementPhase(dt) {
|
||||
this.phase += dt;
|
||||
if (this.phase > 1.0) {
|
||||
this.phase = this.phase - 1;
|
||||
}
|
||||
}
|
||||
|
||||
process(inputs, outputs, parameters) {
|
||||
// eslint-disable-next-line no-undef
|
||||
if (currentTime >= parameters.end[0]) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const output = outputs[0];
|
||||
const frequency = parameters['frequency'][0];
|
||||
|
||||
const time = parameters['time'][0];
|
||||
const depth = parameters['depth'][0];
|
||||
const skew = parameters['skew'][0];
|
||||
const phaseoffset = parameters['phaseoffset'][0];
|
||||
|
||||
const dcoffset = parameters['dcoffset'][0];
|
||||
const shape = waveShapeNames[parameters['shape'][0]];
|
||||
|
||||
const blockSize = output[0].length ?? 0;
|
||||
|
||||
if (this.phase == null) {
|
||||
this.phase = _mod(time * frequency + phaseoffset, 1);
|
||||
}
|
||||
// eslint-disable-next-line no-undef
|
||||
const dt = frequency / sampleRate;
|
||||
for (let n = 0; n < blockSize; n++) {
|
||||
for (let i = 0; i < output.length; i++) {
|
||||
const modval = (waveshapes[shape](this.phase, skew) + dcoffset) * depth;
|
||||
output[i][n] = modval;
|
||||
}
|
||||
this.incrementPhase(dt);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
registerProcessor('lfo-processor', LFOProcessor);
|
||||
|
||||
class CoarseProcessor extends AudioWorkletProcessor {
|
||||
static get parameterDescriptors() {
|
||||
return [{ name: 'coarse', defaultValue: 1 }];
|
||||
@ -106,6 +240,77 @@ class ShapeProcessor extends AudioWorkletProcessor {
|
||||
}
|
||||
registerProcessor('shape-processor', ShapeProcessor);
|
||||
|
||||
function fast_tanh(x) {
|
||||
const x2 = x * x;
|
||||
return (x * (27.0 + x2)) / (27.0 + 9.0 * x2);
|
||||
}
|
||||
const _PI = 3.14159265359;
|
||||
//adapted from https://github.com/TheBouteillacBear/webaudioworklet-wasm?tab=MIT-1-ov-file
|
||||
class LadderProcessor extends AudioWorkletProcessor {
|
||||
static get parameterDescriptors() {
|
||||
return [
|
||||
{ name: 'frequency', defaultValue: 500 },
|
||||
{ name: 'q', defaultValue: 1 },
|
||||
{ name: 'drive', defaultValue: 0.69 },
|
||||
];
|
||||
}
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this.started = false;
|
||||
this.p0 = [0, 0];
|
||||
this.p1 = [0, 0];
|
||||
this.p2 = [0, 0];
|
||||
this.p3 = [0, 0];
|
||||
this.p32 = [0, 0];
|
||||
this.p33 = [0, 0];
|
||||
this.p34 = [0, 0];
|
||||
}
|
||||
|
||||
process(inputs, outputs, parameters) {
|
||||
const input = inputs[0];
|
||||
const output = outputs[0];
|
||||
|
||||
const hasInput = !(input[0] === undefined);
|
||||
if (this.started && !hasInput) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.started = hasInput;
|
||||
|
||||
const resonance = parameters.q[0];
|
||||
const drive = clamp(Math.exp(parameters.drive[0]), 0.1, 2000);
|
||||
|
||||
let cutoff = parameters.frequency[0];
|
||||
// eslint-disable-next-line no-undef
|
||||
cutoff = (cutoff * 2 * _PI) / sampleRate;
|
||||
cutoff = cutoff > 1 ? 1 : cutoff;
|
||||
|
||||
const k = Math.min(8, resonance * 0.4);
|
||||
// drive makeup * resonance volume loss makeup
|
||||
let makeupgain = (1 / drive) * Math.min(1.75, 1 + k);
|
||||
|
||||
for (let n = 0; n < blockSize; n++) {
|
||||
for (let i = 0; i < input.length; i++) {
|
||||
const out = this.p3[i] * 0.360891 + this.p32[i] * 0.41729 + this.p33[i] * 0.177896 + this.p34[i] * 0.0439725;
|
||||
|
||||
this.p34[i] = this.p33[i];
|
||||
this.p33[i] = this.p32[i];
|
||||
this.p32[i] = this.p3[i];
|
||||
|
||||
this.p0[i] += (fast_tanh(input[i][n] * drive - k * out) - fast_tanh(this.p0[i])) * cutoff;
|
||||
this.p1[i] += (fast_tanh(this.p0[i]) - fast_tanh(this.p1[i])) * cutoff;
|
||||
this.p2[i] += (fast_tanh(this.p1[i]) - fast_tanh(this.p2[i])) * cutoff;
|
||||
this.p3[i] += (fast_tanh(this.p2[i]) - fast_tanh(this.p3[i])) * cutoff;
|
||||
|
||||
output[i][n] = out * makeupgain;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
registerProcessor('ladder-processor', LadderProcessor);
|
||||
|
||||
class DistortProcessor extends AudioWorkletProcessor {
|
||||
static get parameterDescriptors() {
|
||||
return [
|
||||
@ -142,34 +347,7 @@ class DistortProcessor extends AudioWorkletProcessor {
|
||||
}
|
||||
registerProcessor('distort-processor', DistortProcessor);
|
||||
|
||||
// adjust waveshape to remove frequencies above nyquist to prevent aliasing
|
||||
// referenced from https://www.kvraudio.com/forum/viewtopic.php?t=375517
|
||||
const polyBlep = (phase, dt) => {
|
||||
// 0 <= phase < 1
|
||||
if (phase < dt) {
|
||||
phase /= dt;
|
||||
// 2 * (phase - phase^2/2 - 0.5)
|
||||
return phase + phase - phase * phase - 1;
|
||||
}
|
||||
|
||||
// -1 < phase < 0
|
||||
else if (phase > 1 - dt) {
|
||||
phase = (phase - 1) / dt;
|
||||
// 2 * (phase^2/2 + phase + 0.5)
|
||||
return phase * phase + phase + phase + 1;
|
||||
}
|
||||
|
||||
// 0 otherwise
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
const saw = (phase, dt) => {
|
||||
const v = 2 * phase - 1;
|
||||
return v - polyBlep(phase, dt);
|
||||
};
|
||||
|
||||
// SUPERSAW
|
||||
function lerp(a, b, n) {
|
||||
return n * (b - a) + a;
|
||||
}
|
||||
@ -269,7 +447,7 @@ class SuperSawOscillatorProcessor extends AudioWorkletProcessor {
|
||||
|
||||
for (let i = 0; i < output[0].length; i++) {
|
||||
this.phase[n] = this.phase[n] ?? Math.random();
|
||||
const v = saw(this.phase[n], dt);
|
||||
const v = waveshapes.sawblep(this.phase[n], dt);
|
||||
|
||||
output[0][i] = output[0][i] + v * gainL;
|
||||
output[1][i] = output[1][i] + v * gainR;
|
||||
|
||||
@ -72,7 +72,13 @@ document.getElementById('play').addEventListener('stop',
|
||||
There is a tiny difference between the [Strudel REPL](https://strudel.cc/) and `@strudel/web`.
|
||||
In the REPL you can use 'single quotes' for regular JS strings and "double quotes" for mini notation patterns.
|
||||
In `@strudel/web`, it does not matter which types of quotes you're using.
|
||||
There will probably be an escapte hatch for that in the future.
|
||||
|
||||
This difference means that you cannot call pattern methods on raw strings, for example `"1 2 3".slow(2)`.
|
||||
To make it work you can either:
|
||||
|
||||
1. Use the `evaluate` function, which behaves exactly like the Strudel REPL, interpreting double quoted strings as mini notation.
|
||||
2. wrap the string with `m`: `m("1 2 3").slow(2)`
|
||||
3. wrap the string in a control function: `n("1 2 3").slow(2)` depending on your context.
|
||||
|
||||
## More Examples
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@ export * from '@strudel/transpiler';
|
||||
export * from '@strudel/mini';
|
||||
export * from '@strudel/tonal';
|
||||
export * from '@strudel/webaudio';
|
||||
import { Pattern, evalScope } from '@strudel/core';
|
||||
import { Pattern, evalScope, setTime } from '@strudel/core';
|
||||
import { initAudioOnFirstClick, registerSynthSounds, webaudioScheduler } from '@strudel/webaudio';
|
||||
// import { registerSoundfonts } from '@strudel/soundfonts';
|
||||
import { evaluate as _evaluate } from '@strudel/transpiler';
|
||||
@ -33,11 +33,14 @@ export function initStrudel(options = {}) {
|
||||
miniAllStrings();
|
||||
const { prebake, ...schedulerOptions } = options;
|
||||
|
||||
scheduler = webaudioScheduler(schedulerOptions);
|
||||
initDone = (async () => {
|
||||
await defaultPrebake();
|
||||
await prebake?.();
|
||||
return scheduler;
|
||||
})();
|
||||
scheduler = webaudioScheduler(schedulerOptions);
|
||||
setTime(() => scheduler.now());
|
||||
return initDone;
|
||||
}
|
||||
|
||||
window.initStrudel = initStrudel;
|
||||
|
||||
@ -2197,6 +2197,75 @@ exports[`runs examples > example "djf" example index 0 1`] = `
|
||||
|
||||
exports[`runs examples > example "drawLine" example index 0 1`] = `[]`;
|
||||
|
||||
exports[`runs examples > example "drive" example index 0 1`] = `
|
||||
[
|
||||
"[ 0/1 → 1/16 | note:36 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:0.5 ]",
|
||||
"[ 1/16 → 1/8 | note:38 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:0.5 ]",
|
||||
"[ 1/8 → 3/16 | note:38 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:0.5 ]",
|
||||
"[ 3/16 → 1/4 | note:31 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:0.5 ]",
|
||||
"[ 1/4 → 5/16 | note:33 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:0.5 ]",
|
||||
"[ 5/16 → 3/8 | note:40 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:0.5 ]",
|
||||
"[ 3/8 → 7/16 | note:41 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:0.5 ]",
|
||||
"[ 7/16 → 1/2 | note:36 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:0.5 ]",
|
||||
"[ 1/2 → 9/16 | note:38 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:0.5 ]",
|
||||
"[ 9/16 → 5/8 | note:38 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:0.5 ]",
|
||||
"[ 5/8 → 11/16 | note:31 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:0.5 ]",
|
||||
"[ 11/16 → 3/4 | note:33 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:0.5 ]",
|
||||
"[ 3/4 → 13/16 | note:40 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:0.5 ]",
|
||||
"[ 13/16 → 7/8 | note:41 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:0.5 ]",
|
||||
"[ 7/8 → 15/16 | note:36 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:0.5 ]",
|
||||
"[ 15/16 → 1/1 | note:38 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:0.5 ]",
|
||||
"[ 1/1 → 17/16 | note:38 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:4 ]",
|
||||
"[ 17/16 → 9/8 | note:31 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:4 ]",
|
||||
"[ 9/8 → 19/16 | note:33 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:4 ]",
|
||||
"[ 19/16 → 5/4 | note:40 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:4 ]",
|
||||
"[ 5/4 → 21/16 | note:41 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:4 ]",
|
||||
"[ 21/16 → 11/8 | note:36 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:4 ]",
|
||||
"[ 11/8 → 23/16 | note:38 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:4 ]",
|
||||
"[ 23/16 → 3/2 | note:38 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:4 ]",
|
||||
"[ 3/2 → 25/16 | note:31 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:4 ]",
|
||||
"[ 25/16 → 13/8 | note:33 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:4 ]",
|
||||
"[ 13/8 → 27/16 | note:40 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:4 ]",
|
||||
"[ 27/16 → 7/4 | note:41 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:4 ]",
|
||||
"[ 7/4 → 29/16 | note:36 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:4 ]",
|
||||
"[ 29/16 → 15/8 | note:38 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:4 ]",
|
||||
"[ 15/8 → 31/16 | note:38 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:4 ]",
|
||||
"[ 31/16 → 2/1 | note:31 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:4 ]",
|
||||
"[ 2/1 → 33/16 | note:33 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:0.5 ]",
|
||||
"[ 33/16 → 17/8 | note:40 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:0.5 ]",
|
||||
"[ 17/8 → 35/16 | note:41 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:0.5 ]",
|
||||
"[ 35/16 → 9/4 | note:36 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:0.5 ]",
|
||||
"[ 9/4 → 37/16 | note:38 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:0.5 ]",
|
||||
"[ 37/16 → 19/8 | note:38 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:0.5 ]",
|
||||
"[ 19/8 → 39/16 | note:31 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:0.5 ]",
|
||||
"[ 39/16 → 5/2 | note:33 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:0.5 ]",
|
||||
"[ 5/2 → 41/16 | note:40 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:0.5 ]",
|
||||
"[ 41/16 → 21/8 | note:41 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:0.5 ]",
|
||||
"[ 21/8 → 43/16 | note:36 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:0.5 ]",
|
||||
"[ 43/16 → 11/4 | note:38 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:0.5 ]",
|
||||
"[ 11/4 → 45/16 | note:38 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:0.5 ]",
|
||||
"[ 45/16 → 23/8 | note:31 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:0.5 ]",
|
||||
"[ 23/8 → 47/16 | note:33 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:0.5 ]",
|
||||
"[ 47/16 → 3/1 | note:40 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:0.5 ]",
|
||||
"[ 3/1 → 49/16 | note:41 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:4 ]",
|
||||
"[ 49/16 → 25/8 | note:36 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:4 ]",
|
||||
"[ 25/8 → 51/16 | note:38 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:4 ]",
|
||||
"[ 51/16 → 13/4 | note:38 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:4 ]",
|
||||
"[ 13/4 → 53/16 | note:31 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:4 ]",
|
||||
"[ 53/16 → 27/8 | note:33 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:4 ]",
|
||||
"[ 27/8 → 55/16 | note:40 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:4 ]",
|
||||
"[ 55/16 → 7/2 | note:41 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:4 ]",
|
||||
"[ 7/2 → 57/16 | note:36 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:4 ]",
|
||||
"[ 57/16 → 29/8 | note:38 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:4 ]",
|
||||
"[ 29/8 → 59/16 | note:38 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:4 ]",
|
||||
"[ 59/16 → 15/4 | note:31 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:4 ]",
|
||||
"[ 15/4 → 61/16 | note:33 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:4 ]",
|
||||
"[ 61/16 → 31/8 | note:40 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:4 ]",
|
||||
"[ 31/8 → 63/16 | note:41 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:4 ]",
|
||||
"[ 63/16 → 4/1 | note:36 s:supersaw lpenv:8 cutoff:150 resonance:0.8 ftype:ladder drive:4 ]",
|
||||
]
|
||||
`;
|
||||
|
||||
exports[`runs examples > example "dry" example index 0 1`] = `
|
||||
[
|
||||
"[ 0/1 → 1/8 | n:0 s:superpiano room:0.7 dry:0 ]",
|
||||
@ -2914,22 +2983,99 @@ exports[`runs examples > example "fscope" example index 0 1`] = `
|
||||
|
||||
exports[`runs examples > example "ftype" example index 0 1`] = `
|
||||
[
|
||||
"[ 0/1 → 1/4 | note:c2 s:sawtooth cutoff:500 bpenv:4 ftype:12db ]",
|
||||
"[ 1/4 → 1/2 | note:e2 s:sawtooth cutoff:500 bpenv:4 ftype:12db ]",
|
||||
"[ 1/2 → 3/4 | note:f2 s:sawtooth cutoff:500 bpenv:4 ftype:24db ]",
|
||||
"[ 3/4 → 1/1 | note:g2 s:sawtooth cutoff:500 bpenv:4 ftype:24db ]",
|
||||
"[ 1/1 → 5/4 | note:c2 s:sawtooth cutoff:500 bpenv:4 ftype:12db ]",
|
||||
"[ 5/4 → 3/2 | note:e2 s:sawtooth cutoff:500 bpenv:4 ftype:12db ]",
|
||||
"[ 3/2 → 7/4 | note:f2 s:sawtooth cutoff:500 bpenv:4 ftype:24db ]",
|
||||
"[ 7/4 → 2/1 | note:g2 s:sawtooth cutoff:500 bpenv:4 ftype:24db ]",
|
||||
"[ 2/1 → 9/4 | note:c2 s:sawtooth cutoff:500 bpenv:4 ftype:12db ]",
|
||||
"[ 9/4 → 5/2 | note:e2 s:sawtooth cutoff:500 bpenv:4 ftype:12db ]",
|
||||
"[ 5/2 → 11/4 | note:f2 s:sawtooth cutoff:500 bpenv:4 ftype:24db ]",
|
||||
"[ 11/4 → 3/1 | note:g2 s:sawtooth cutoff:500 bpenv:4 ftype:24db ]",
|
||||
"[ 3/1 → 13/4 | note:c2 s:sawtooth cutoff:500 bpenv:4 ftype:12db ]",
|
||||
"[ 13/4 → 7/2 | note:e2 s:sawtooth cutoff:500 bpenv:4 ftype:12db ]",
|
||||
"[ 7/2 → 15/4 | note:f2 s:sawtooth cutoff:500 bpenv:4 ftype:24db ]",
|
||||
"[ 15/4 → 4/1 | note:g2 s:sawtooth cutoff:500 bpenv:4 ftype:24db ]",
|
||||
"[ 0/1 → 1/8 | note:f s:sawtooth lpenv:4 cutoff:500 ftype:0 resonance:1 ]",
|
||||
"[ 1/8 → 1/4 | note:g s:sawtooth lpenv:4 cutoff:500 ftype:0 resonance:1 ]",
|
||||
"[ 1/4 → 3/8 | note:g s:sawtooth lpenv:4 cutoff:500 ftype:0 resonance:1 ]",
|
||||
"[ 3/8 → 1/2 | note:c s:sawtooth lpenv:4 cutoff:500 ftype:0 resonance:1 ]",
|
||||
"[ 1/2 → 5/8 | note:d s:sawtooth lpenv:4 cutoff:500 ftype:0 resonance:1 ]",
|
||||
"[ 5/8 → 3/4 | note:a s:sawtooth lpenv:4 cutoff:500 ftype:0 resonance:1 ]",
|
||||
"[ 3/4 → 7/8 | note:a# s:sawtooth lpenv:4 cutoff:500 ftype:0 resonance:1 ]",
|
||||
"[ 7/8 → 1/1 | note:f s:sawtooth lpenv:4 cutoff:500 ftype:0 resonance:1 ]",
|
||||
"[ 1/1 → 9/8 | note:g s:sawtooth lpenv:4 cutoff:500 ftype:1 resonance:1 ]",
|
||||
"[ 9/8 → 5/4 | note:g s:sawtooth lpenv:4 cutoff:500 ftype:1 resonance:1 ]",
|
||||
"[ 5/4 → 11/8 | note:c s:sawtooth lpenv:4 cutoff:500 ftype:1 resonance:1 ]",
|
||||
"[ 11/8 → 3/2 | note:d s:sawtooth lpenv:4 cutoff:500 ftype:1 resonance:1 ]",
|
||||
"[ 3/2 → 13/8 | note:a s:sawtooth lpenv:4 cutoff:500 ftype:1 resonance:1 ]",
|
||||
"[ 13/8 → 7/4 | note:a# s:sawtooth lpenv:4 cutoff:500 ftype:1 resonance:1 ]",
|
||||
"[ 7/4 → 15/8 | note:f s:sawtooth lpenv:4 cutoff:500 ftype:1 resonance:1 ]",
|
||||
"[ 15/8 → 2/1 | note:g s:sawtooth lpenv:4 cutoff:500 ftype:1 resonance:1 ]",
|
||||
"[ 2/1 → 17/8 | note:g s:sawtooth lpenv:4 cutoff:500 ftype:2 resonance:1 ]",
|
||||
"[ 17/8 → 9/4 | note:c s:sawtooth lpenv:4 cutoff:500 ftype:2 resonance:1 ]",
|
||||
"[ 9/4 → 19/8 | note:d s:sawtooth lpenv:4 cutoff:500 ftype:2 resonance:1 ]",
|
||||
"[ 19/8 → 5/2 | note:a s:sawtooth lpenv:4 cutoff:500 ftype:2 resonance:1 ]",
|
||||
"[ 5/2 → 21/8 | note:a# s:sawtooth lpenv:4 cutoff:500 ftype:2 resonance:1 ]",
|
||||
"[ 21/8 → 11/4 | note:f s:sawtooth lpenv:4 cutoff:500 ftype:2 resonance:1 ]",
|
||||
"[ 11/4 → 23/8 | note:g s:sawtooth lpenv:4 cutoff:500 ftype:2 resonance:1 ]",
|
||||
"[ 23/8 → 3/1 | note:g s:sawtooth lpenv:4 cutoff:500 ftype:2 resonance:1 ]",
|
||||
"[ 3/1 → 25/8 | note:c s:sawtooth lpenv:4 cutoff:500 ftype:0 resonance:1 ]",
|
||||
"[ 25/8 → 13/4 | note:d s:sawtooth lpenv:4 cutoff:500 ftype:0 resonance:1 ]",
|
||||
"[ 13/4 → 27/8 | note:a s:sawtooth lpenv:4 cutoff:500 ftype:0 resonance:1 ]",
|
||||
"[ 27/8 → 7/2 | note:a# s:sawtooth lpenv:4 cutoff:500 ftype:0 resonance:1 ]",
|
||||
"[ 7/2 → 29/8 | note:f s:sawtooth lpenv:4 cutoff:500 ftype:0 resonance:1 ]",
|
||||
"[ 29/8 → 15/4 | note:g s:sawtooth lpenv:4 cutoff:500 ftype:0 resonance:1 ]",
|
||||
"[ 15/4 → 31/8 | note:g s:sawtooth lpenv:4 cutoff:500 ftype:0 resonance:1 ]",
|
||||
"[ 31/8 → 4/1 | note:c s:sawtooth lpenv:4 cutoff:500 ftype:0 resonance:1 ]",
|
||||
]
|
||||
`;
|
||||
|
||||
exports[`runs examples > example "ftype" example index 1 1`] = `
|
||||
[
|
||||
"[ 0/1 → 1/14 | note:c s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:ladder ]",
|
||||
"[ 1/14 → 1/7 | note:f s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:ladder ]",
|
||||
"[ 1/7 → 3/14 | note:g s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:ladder ]",
|
||||
"[ 3/14 → 2/7 | note:g s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:ladder ]",
|
||||
"[ 2/7 → 5/14 | note:a s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:ladder ]",
|
||||
"[ 5/14 → 3/7 | note:c s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:ladder ]",
|
||||
"[ 3/7 → 1/2 | note:d4 s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:ladder ]",
|
||||
"[ 1/2 → 4/7 | note:c s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:ladder ]",
|
||||
"[ 4/7 → 9/14 | note:f s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:ladder ]",
|
||||
"[ 9/14 → 5/7 | note:g s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:ladder ]",
|
||||
"[ 5/7 → 11/14 | note:g s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:ladder ]",
|
||||
"[ 11/14 → 6/7 | note:a s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:ladder ]",
|
||||
"[ 6/7 → 13/14 | note:c s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:ladder ]",
|
||||
"[ 13/14 → 1/1 | note:d4 s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:ladder ]",
|
||||
"[ 1/1 → 15/14 | note:c s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:12db ]",
|
||||
"[ 15/14 → 8/7 | note:f s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:12db ]",
|
||||
"[ 8/7 → 17/14 | note:g s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:12db ]",
|
||||
"[ 17/14 → 9/7 | note:g s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:12db ]",
|
||||
"[ 9/7 → 19/14 | note:a s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:12db ]",
|
||||
"[ 19/14 → 10/7 | note:c s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:12db ]",
|
||||
"[ 10/7 → 3/2 | note:d4 s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:12db ]",
|
||||
"[ 3/2 → 11/7 | note:c s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:12db ]",
|
||||
"[ 11/7 → 23/14 | note:f s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:12db ]",
|
||||
"[ 23/14 → 12/7 | note:g s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:12db ]",
|
||||
"[ 12/7 → 25/14 | note:g s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:12db ]",
|
||||
"[ 25/14 → 13/7 | note:a s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:12db ]",
|
||||
"[ 13/7 → 27/14 | note:c s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:12db ]",
|
||||
"[ 27/14 → 2/1 | note:d4 s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:12db ]",
|
||||
"[ 2/1 → 29/14 | note:c s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:24db ]",
|
||||
"[ 29/14 → 15/7 | note:f s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:24db ]",
|
||||
"[ 15/7 → 31/14 | note:g s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:24db ]",
|
||||
"[ 31/14 → 16/7 | note:g s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:24db ]",
|
||||
"[ 16/7 → 33/14 | note:a s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:24db ]",
|
||||
"[ 33/14 → 17/7 | note:c s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:24db ]",
|
||||
"[ 17/7 → 5/2 | note:d4 s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:24db ]",
|
||||
"[ 5/2 → 18/7 | note:c s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:24db ]",
|
||||
"[ 18/7 → 37/14 | note:f s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:24db ]",
|
||||
"[ 37/14 → 19/7 | note:g s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:24db ]",
|
||||
"[ 19/7 → 39/14 | note:g s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:24db ]",
|
||||
"[ 39/14 → 20/7 | note:a s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:24db ]",
|
||||
"[ 20/7 → 41/14 | note:c s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:24db ]",
|
||||
"[ 41/14 → 3/1 | note:d4 s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:24db ]",
|
||||
"[ 3/1 → 43/14 | note:c s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:ladder ]",
|
||||
"[ 43/14 → 22/7 | note:f s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:ladder ]",
|
||||
"[ 22/7 → 45/14 | note:g s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:ladder ]",
|
||||
"[ 45/14 → 23/7 | note:g s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:ladder ]",
|
||||
"[ 23/7 → 47/14 | note:a s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:ladder ]",
|
||||
"[ 47/14 → 24/7 | note:c s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:ladder ]",
|
||||
"[ 24/7 → 7/2 | note:d4 s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:ladder ]",
|
||||
"[ 7/2 → 25/7 | note:c s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:ladder ]",
|
||||
"[ 25/7 → 51/14 | note:f s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:ladder ]",
|
||||
"[ 51/14 → 26/7 | note:g s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:ladder ]",
|
||||
"[ 26/7 → 53/14 | note:g s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:ladder ]",
|
||||
"[ 53/14 → 27/7 | note:a s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:ladder ]",
|
||||
"[ 27/7 → 55/14 | note:c s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:ladder ]",
|
||||
"[ 55/14 → 4/1 | note:d4 s:sawtooth cutoff:200 fanchor:0 lpenv:3 resonance:1 ftype:ladder ]",
|
||||
]
|
||||
`;
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user