Merge branch 'main' into docs/xen/added-tune
This commit is contained in:
commit
e87bb4376f
4 changed files with 39 additions and 26 deletions
|
|
@ -264,7 +264,7 @@ export const randrun = (n) => {
|
||||||
const rands = timeToRands(t.floor().add(0.5), n);
|
const rands = timeToRands(t.floor().add(0.5), n);
|
||||||
const nums = rands
|
const nums = rands
|
||||||
.map((n, i) => [n, i])
|
.map((n, i) => [n, i])
|
||||||
.sort((a, b) => a[0] > b[0] - a[0] < b[0])
|
.sort((a, b) => (a[0] > b[0]) - (a[0] < b[0]))
|
||||||
.map((x) => x[1]);
|
.map((x) => x[1]);
|
||||||
const i = t.cyclePos().mul(n).floor() % n;
|
const i = t.cyclePos().mul(n).floor() % n;
|
||||||
return nums[i];
|
return nums[i];
|
||||||
|
|
|
||||||
|
|
@ -126,7 +126,7 @@ export const getAudioDevices = async () => {
|
||||||
return devicesMap;
|
return devicesMap;
|
||||||
};
|
};
|
||||||
|
|
||||||
const defaultDefaultValues = {
|
let defaultDefaultValues = {
|
||||||
s: 'triangle',
|
s: 'triangle',
|
||||||
gain: 0.8,
|
gain: 0.8,
|
||||||
postgain: 1,
|
postgain: 1,
|
||||||
|
|
@ -150,6 +150,17 @@ const defaultDefaultValues = {
|
||||||
fft: 8,
|
fft: 8,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const defaultDefaultDefaultValues = Object.freeze({ ...defaultDefaultValues });
|
||||||
|
|
||||||
|
export function setDefault(control, value) {
|
||||||
|
// const main = getControlName(control); // we cant do this because superdough is independent of strudel/core
|
||||||
|
defaultDefaultValues[control] = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function resetDefaults() {
|
||||||
|
defaultDefaultValues = { ...defaultDefaultDefaultValues };
|
||||||
|
}
|
||||||
|
|
||||||
let defaultControls = new Map(Object.entries(defaultDefaultValues));
|
let defaultControls = new Map(Object.entries(defaultDefaultValues));
|
||||||
|
|
||||||
export function setDefaultValue(key, value) {
|
export function setDefaultValue(key, value) {
|
||||||
|
|
|
||||||
|
|
@ -8813,46 +8813,46 @@ exports[`runs examples > example "shrink" example index 3 1`] = `
|
||||||
|
|
||||||
exports[`runs examples > example "shuffle" example index 0 1`] = `
|
exports[`runs examples > example "shuffle" example index 0 1`] = `
|
||||||
[
|
[
|
||||||
"[ 0/1 → 1/4 | note:c s:piano ]",
|
"[ 0/1 → 1/4 | note:e s:piano ]",
|
||||||
"[ 1/4 → 1/2 | note:d s:piano ]",
|
"[ 1/4 → 1/2 | note:d s:piano ]",
|
||||||
"[ 1/2 → 3/4 | note:e s:piano ]",
|
"[ 1/2 → 3/4 | note:f s:piano ]",
|
||||||
"[ 3/4 → 1/1 | note:f s:piano ]",
|
"[ 3/4 → 1/1 | note:c s:piano ]",
|
||||||
"[ 1/1 → 5/4 | note:c s:piano ]",
|
"[ 1/1 → 5/4 | note:e s:piano ]",
|
||||||
"[ 5/4 → 3/2 | note:d s:piano ]",
|
"[ 5/4 → 3/2 | note:c s:piano ]",
|
||||||
"[ 3/2 → 7/4 | note:e s:piano ]",
|
"[ 3/2 → 7/4 | note:f s:piano ]",
|
||||||
"[ 7/4 → 2/1 | note:f s:piano ]",
|
"[ 7/4 → 2/1 | note:d s:piano ]",
|
||||||
"[ 2/1 → 9/4 | note:c s:piano ]",
|
"[ 2/1 → 9/4 | note:d s:piano ]",
|
||||||
"[ 9/4 → 5/2 | note:d s:piano ]",
|
"[ 9/4 → 5/2 | note:c s:piano ]",
|
||||||
"[ 5/2 → 11/4 | note:e s:piano ]",
|
"[ 5/2 → 11/4 | note:e s:piano ]",
|
||||||
"[ 11/4 → 3/1 | note:f s:piano ]",
|
"[ 11/4 → 3/1 | note:f s:piano ]",
|
||||||
"[ 3/1 → 13/4 | note:c s:piano ]",
|
"[ 3/1 → 13/4 | note:c s:piano ]",
|
||||||
"[ 13/4 → 7/2 | note:d s:piano ]",
|
"[ 13/4 → 7/2 | note:e s:piano ]",
|
||||||
"[ 7/2 → 15/4 | note:e s:piano ]",
|
"[ 7/2 → 15/4 | note:f s:piano ]",
|
||||||
"[ 15/4 → 4/1 | note:f s:piano ]",
|
"[ 15/4 → 4/1 | note:d s:piano ]",
|
||||||
]
|
]
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`runs examples > example "shuffle" example index 1 1`] = `
|
exports[`runs examples > example "shuffle" example index 1 1`] = `
|
||||||
[
|
[
|
||||||
"[ 0/1 → 1/8 | note:c s:piano ]",
|
"[ 0/1 → 1/8 | note:e s:piano ]",
|
||||||
"[ 1/8 → 1/4 | note:d s:piano ]",
|
"[ 1/8 → 1/4 | note:d s:piano ]",
|
||||||
"[ 1/4 → 3/8 | note:e s:piano ]",
|
"[ 1/4 → 3/8 | note:f s:piano ]",
|
||||||
"[ 3/8 → 1/2 | note:f s:piano ]",
|
"[ 3/8 → 1/2 | note:c s:piano ]",
|
||||||
"[ 1/2 → 1/1 | note:g s:piano ]",
|
"[ 1/2 → 1/1 | note:g s:piano ]",
|
||||||
"[ 1/1 → 9/8 | note:c s:piano ]",
|
"[ 1/1 → 9/8 | note:e s:piano ]",
|
||||||
"[ 9/8 → 5/4 | note:d s:piano ]",
|
"[ 9/8 → 5/4 | note:c s:piano ]",
|
||||||
"[ 5/4 → 11/8 | note:e s:piano ]",
|
"[ 5/4 → 11/8 | note:f s:piano ]",
|
||||||
"[ 11/8 → 3/2 | note:f s:piano ]",
|
"[ 11/8 → 3/2 | note:d s:piano ]",
|
||||||
"[ 3/2 → 2/1 | note:g s:piano ]",
|
"[ 3/2 → 2/1 | note:g s:piano ]",
|
||||||
"[ 2/1 → 17/8 | note:c s:piano ]",
|
"[ 2/1 → 17/8 | note:d s:piano ]",
|
||||||
"[ 17/8 → 9/4 | note:d s:piano ]",
|
"[ 17/8 → 9/4 | note:c s:piano ]",
|
||||||
"[ 9/4 → 19/8 | note:e s:piano ]",
|
"[ 9/4 → 19/8 | note:e s:piano ]",
|
||||||
"[ 19/8 → 5/2 | note:f s:piano ]",
|
"[ 19/8 → 5/2 | note:f s:piano ]",
|
||||||
"[ 5/2 → 3/1 | note:g s:piano ]",
|
"[ 5/2 → 3/1 | note:g s:piano ]",
|
||||||
"[ 3/1 → 25/8 | note:c s:piano ]",
|
"[ 3/1 → 25/8 | note:c s:piano ]",
|
||||||
"[ 25/8 → 13/4 | note:d s:piano ]",
|
"[ 25/8 → 13/4 | note:e s:piano ]",
|
||||||
"[ 13/4 → 27/8 | note:e s:piano ]",
|
"[ 13/4 → 27/8 | note:f s:piano ]",
|
||||||
"[ 27/8 → 7/2 | note:f s:piano ]",
|
"[ 27/8 → 7/2 | note:d s:piano ]",
|
||||||
"[ 7/2 → 4/1 | note:g s:piano ]",
|
"[ 7/2 → 4/1 | note:g s:piano ]",
|
||||||
]
|
]
|
||||||
`;
|
`;
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ import {
|
||||||
resetGlobalEffects,
|
resetGlobalEffects,
|
||||||
resetLoadedSounds,
|
resetLoadedSounds,
|
||||||
initAudioOnFirstClick,
|
initAudioOnFirstClick,
|
||||||
|
resetDefaults,
|
||||||
} from '@strudel/webaudio';
|
} from '@strudel/webaudio';
|
||||||
import { setVersionDefaultsFrom } from './util.mjs';
|
import { setVersionDefaultsFrom } from './util.mjs';
|
||||||
import { StrudelMirror, defaultSettings } from '@strudel/codemirror';
|
import { StrudelMirror, defaultSettings } from '@strudel/codemirror';
|
||||||
|
|
@ -181,6 +182,7 @@ export function useReplContext() {
|
||||||
|
|
||||||
const resetEditor = async () => {
|
const resetEditor = async () => {
|
||||||
(await getModule('@strudel/tonal'))?.resetVoicings();
|
(await getModule('@strudel/tonal'))?.resetVoicings();
|
||||||
|
resetDefaults();
|
||||||
resetGlobalEffects();
|
resetGlobalEffects();
|
||||||
clearCanvas();
|
clearCanvas();
|
||||||
clearHydra();
|
clearHydra();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue