diff --git a/.forgejo/workflows/deploy-hot.yml b/.forgejo/workflows/deploy-hot.yml index a19917dfa..b6556c936 100644 --- a/.forgejo/workflows/deploy-hot.yml +++ b/.forgejo/workflows/deploy-hot.yml @@ -19,11 +19,6 @@ jobs: with: ref: ${{ github.event.pull_request.head.sha }} - uses: pnpm/action-setup@v4 - with: - version: 9.12.2 - - uses: actions/setup-node@v4 - with: - node-version: 20 - name: Install Dependencies run: pnpm install diff --git a/.forgejo/workflows/deploy-warm-beta.yml b/.forgejo/workflows/deploy-warm-beta.yml index 264f716d0..67b9d5b39 100644 --- a/.forgejo/workflows/deploy-warm-beta.yml +++ b/.forgejo/workflows/deploy-warm-beta.yml @@ -19,12 +19,7 @@ jobs: steps: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v4 - with: - version: 9.12.2 - - uses: actions/setup-node@v4 - with: - node-version: 20 - # cache: "pnpm" + - name: Install Dependencies run: pnpm install diff --git a/.forgejo/workflows/deploy.yml b/.forgejo/workflows/deploy.yml index 2b47e5e17..e9f035ba8 100644 --- a/.forgejo/workflows/deploy.yml +++ b/.forgejo/workflows/deploy.yml @@ -16,12 +16,7 @@ jobs: steps: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v4 - with: - version: 9.12.2 - - uses: actions/setup-node@v4 - with: - node-version: 20 - # cache: "pnpm" + - name: Install Dependencies run: pnpm install diff --git a/.forgejo/workflows/test.yml b/.forgejo/workflows/test.yml index c1db1c5f9..bae636c94 100644 --- a/.forgejo/workflows/test.yml +++ b/.forgejo/workflows/test.yml @@ -6,21 +6,10 @@ jobs: build: runs-on: docker container: node:22-bookworm - strategy: - matrix: - node-version: [20] steps: - uses: actions/checkout@v4 - - name: apt install ztd - run: apt update && apt install -y zstd - uses: pnpm/action-setup@v4 - with: - version: 9.12.2 - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - cache: "pnpm" - run: pnpm install - run: pnpm run format-check - run: pnpm run lint diff --git a/package.json b/package.json index 26a20aec3..59e378329 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "0.5.0", "private": true, "description": "Port of tidalcycles to javascript", + "packageManager": "pnpm@10.15.0", "scripts": { "setup": "pnpm i", "pretest": "npm run jsdoc-json", diff --git a/packages/codemirror/basicSetup.mjs b/packages/codemirror/basicSetup.mjs index 02294b93a..1bad65f8b 100644 --- a/packages/codemirror/basicSetup.mjs +++ b/packages/codemirror/basicSetup.mjs @@ -2,23 +2,13 @@ import { keymap, highlightSpecialChars, drawSelection, - highlightActiveLine, dropCursor, rectangularSelection, crosshairCursor, - lineNumbers, - highlightActiveLineGutter, } from '@codemirror/view'; -import { - defaultHighlightStyle, - syntaxHighlighting, - bracketMatching, - foldGutter, - foldKeymap, -} from '@codemirror/language'; +import { defaultHighlightStyle, syntaxHighlighting } from '@codemirror/language'; import { defaultKeymap, history, historyKeymap } from '@codemirror/commands'; -import { searchKeymap, highlightSelectionMatches } from '@codemirror/search'; -import { completionKeymap, closeBracketsKeymap } from '@codemirror/autocomplete'; +import { closeBracketsKeymap } from '@codemirror/autocomplete'; // Taken + slightly modified from https://github.com/codemirror/basic-setup/blob/main/src/codemirror.ts diff --git a/packages/core/controls.mjs b/packages/core/controls.mjs index e6d5c89e5..a59fe6c33 100644 --- a/packages/core/controls.mjs +++ b/packages/core/controls.mjs @@ -519,10 +519,10 @@ export const { fmh, fmh1, fmh2, fmh3, fmh4, fmh5, fmh6, fmh7, fmh8 } = registerM * each other with matrix commands like `fm13`, which would send `fm1` back into * `fm3` * - * @name fmi + * @name fm * @tags fm, superdough, supradough * @param {number | Pattern} brightness modulation index - * @synonyms fm + * @synonyms fmi * @example * note("c e g b g e") * .fm("<0 1 2 8 32>") diff --git a/packages/core/pattern.mjs b/packages/core/pattern.mjs index d6f6e5986..98aaee643 100644 --- a/packages/core/pattern.mjs +++ b/packages/core/pattern.mjs @@ -2354,8 +2354,8 @@ export const ply = register('ply', function (factor, pat) { * @example * s("bd hh sd hh").fast(2) // s("[bd hh sd hh]*2") */ -export const { fast, density } = register( - ['fast', 'density'], +export const fast = register( + 'fast', function (factor, pat) { if (factor === 0) { return silence; diff --git a/packages/soundfonts/fontloader.mjs b/packages/soundfonts/fontloader.mjs index b4ae59828..073dc4901 100644 --- a/packages/soundfonts/fontloader.mjs +++ b/packages/soundfonts/fontloader.mjs @@ -28,7 +28,7 @@ async function loadFont(name) { const url = `${soundfontUrl}/${name}.js`; const preset = await fetch(url).then((res) => res.text()); let [_, data] = preset.split('={'); - return eval('{' + data); + return new Function('return {' + data)().zones; }; loadCache[name] = load(); return loadCache[name]; diff --git a/packages/webaudio/supradough.mjs b/packages/webaudio/supradough.mjs index 83458c54e..925a9bd5e 100644 --- a/packages/webaudio/supradough.mjs +++ b/packages/webaudio/supradough.mjs @@ -61,7 +61,7 @@ function githubPath(base, subpath = '') { } return `https://raw.githubusercontent.com/${path}/${subpath}`; } -export async function fetchSampleMap(url) { +export async function _fetchSampleMap(url) { if (url.startsWith('github:')) { url = githubPath(url, 'strudel.json'); } @@ -116,7 +116,7 @@ async function fetchSample(url) { export async function supradoughsamples(sampleMap, baseUrl) { if (typeof sampleMap === 'string') { - const [json, base] = await fetchSampleMap(sampleMap); + const [json, base] = await _fetchSampleMap(sampleMap); // console.log('json', json, 'base', base); return supradoughsamples(json, base); } diff --git a/packages/xen/xen.mjs b/packages/xen/xen.mjs index 0dcc4c9d6..a3d11ac7d 100644 --- a/packages/xen/xen.mjs +++ b/packages/xen/xen.mjs @@ -106,7 +106,7 @@ export const xen = register( let k = parray(input); return new Pattern((state) => { - let res = k.withValue((x) => x.map((y) => eval(y.join('/')))).query(state); + let res = k.withValue((x) => x.map((y) => y.reduce((acc, v) => acc / v))).query(state); return res; }); }; diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index c8be1ac16..936f0cd29 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -4,18 +4,19 @@ packages: - tools/dbpatch - website/ -onlyBuiltDependencies: +catalog: + '@codemirror/autocomplete': ^6.18.4 + '@codemirror/commands': ^6.8.0 + '@codemirror/lang-javascript': ^6.2.2 + '@codemirror/language': ^6.10.8 + '@codemirror/search': ^6.5.8 + '@codemirror/state': ^6.5.1 + '@codemirror/view': ^6.36.2 + +ignoredBuiltDependencies: + - '@serialport/bindings-cpp' + - tree-sitter-haskell + - tree-sitter - esbuild - nx - sharp - - tree-sitter - - tree-sitter-haskell - -catalog: - "@codemirror/commands": "^6.8.0" - "@codemirror/language": "^6.10.8" - "@codemirror/lang-javascript": "^6.2.2" - "@codemirror/state": "^6.5.1" - "@codemirror/view": "^6.36.2" - "@codemirror/autocomplete": "^6.18.4" - "@codemirror/search": "^6.5.8" diff --git a/test/__snapshots__/examples.test.mjs.snap b/test/__snapshots__/examples.test.mjs.snap index dc4c98c45..4bd44ce7b 100644 --- a/test/__snapshots__/examples.test.mjs.snap +++ b/test/__snapshots__/examples.test.mjs.snap @@ -4777,6 +4777,72 @@ exports[`runs examples > example "floor" example index 0 1`] = ` ] `; +exports[`runs examples > example "fm" example index 0 1`] = ` +[ + "[ 0/1 → 1/6 | note:c fmi:0 ]", + "[ 1/6 → 1/3 | note:e fmi:0 ]", + "[ 1/3 → 1/2 | note:g fmi:0 ]", + "[ 1/2 → 2/3 | note:b fmi:0 ]", + "[ 2/3 → 5/6 | note:g fmi:0 ]", + "[ 5/6 → 1/1 | note:e fmi:0 ]", + "[ 1/1 → 7/6 | note:c fmi:1 ]", + "[ 7/6 → 4/3 | note:e fmi:1 ]", + "[ 4/3 → 3/2 | note:g fmi:1 ]", + "[ 3/2 → 5/3 | note:b fmi:1 ]", + "[ 5/3 → 11/6 | note:g fmi:1 ]", + "[ 11/6 → 2/1 | note:e fmi:1 ]", + "[ 2/1 → 13/6 | note:c fmi:2 ]", + "[ 13/6 → 7/3 | note:e fmi:2 ]", + "[ 7/3 → 5/2 | note:g fmi:2 ]", + "[ 5/2 → 8/3 | note:b fmi:2 ]", + "[ 8/3 → 17/6 | note:g fmi:2 ]", + "[ 17/6 → 3/1 | note:e fmi:2 ]", + "[ 3/1 → 19/6 | note:c fmi:8 ]", + "[ 19/6 → 10/3 | note:e fmi:8 ]", + "[ 10/3 → 7/2 | note:g fmi:8 ]", + "[ 7/2 → 11/3 | note:b fmi:8 ]", + "[ 11/3 → 23/6 | note:g fmi:8 ]", + "[ 23/6 → 4/1 | note:e fmi:8 ]", +] +`; + +exports[`runs examples > example "fm" example index 1 1`] = ` +[ + "[ 0/1 → 1/8 | s:sine note:F1 fmi:4 fmi2:0 fmi3:0 fmh:1.06 fmh2:10 fmh3:0.1 ]", + "[ 1/8 → 1/4 | s:sine note:F1 fmi:4 fmi2:2.7408622801303864 fmi3:0.125 fmh:1.06 fmh2:10 fmh3:0.1 ]", + "[ 1/4 → 3/8 | s:sine note:F1 fmi:4 fmi2:1.479038767516613 fmi3:0.25 fmh:1.06 fmh2:10 fmh3:0.1 ]", + "[ 3/8 → 1/2 | s:sine note:F1 fmi:4 fmi2:1.605570062994957 fmi3:0.375 fmh:1.06 fmh2:10 fmh3:0.1 ]", + "[ 1/2 → 5/8 | s:sine note:F1 fmi:4 fmi2:1.041922464966774 fmi3:0.5 fmh:1.06 fmh2:10 fmh3:0.1 ]", + "[ 5/8 → 3/4 | s:sine note:F1 fmi:4 fmi2:0.5425434708595276 fmi3:0.625 fmh:1.06 fmh2:10 fmh3:0.1 ]", + "[ 3/4 → 7/8 | s:sine note:F1 fmi:4 fmi2:0.7833059206604958 fmi3:0.75 fmh:1.06 fmh2:10 fmh3:0.1 ]", + "[ 7/8 → 1/1 | s:sine note:F1 fmi:4 fmi2:1.590524323284626 fmi3:0.875 fmh:1.06 fmh2:10 fmh3:0.1 ]", + "[ 1/1 → 9/8 | s:sine note:F1 fmi:4 fmi2:2.078168660402298 fmi3:1 fmh:1.06 fmh2:10 fmh3:0.1 ]", + "[ 9/8 → 5/4 | s:sine note:F1 fmi:4 fmi2:2.689958058297634 fmi3:1.125 fmh:1.06 fmh2:10 fmh3:0.1 ]", + "[ 5/4 → 11/8 | s:sine note:F1 fmi:4 fmi2:2.914912812411785 fmi3:1.25 fmh:1.06 fmh2:10 fmh3:0.1 ]", + "[ 11/8 → 3/2 | s:sine note:F1 fmi:4 fmi2:0.7312150076031685 fmi3:1.375 fmh:1.06 fmh2:10 fmh3:0.1 ]", + "[ 3/2 → 13/8 | s:sine note:F1 fmi:4 fmi2:2.4336322993040085 fmi3:1.5 fmh:1.06 fmh2:10 fmh3:0.1 ]", + "[ 13/8 → 7/4 | s:sine note:F1 fmi:4 fmi2:1.987018845975399 fmi3:1.625 fmh:1.06 fmh2:10 fmh3:0.1 ]", + "[ 7/4 → 15/8 | s:sine note:F1 fmi:4 fmi2:0.8189515843987465 fmi3:1.75 fmh:1.06 fmh2:10 fmh3:0.1 ]", + "[ 15/8 → 2/1 | s:sine note:F1 fmi:4 fmi2:2.3782287165522575 fmi3:1.875 fmh:1.06 fmh2:10 fmh3:0.1 ]", + "[ 2/1 → 17/8 | s:sine note:F1 fmi:4 fmi2:3.838108479976654 fmi3:2 fmh:1.06 fmh2:10 fmh3:0.1 ]", + "[ 17/8 → 9/4 | s:sine note:F1 fmi:4 fmi2:3.613561175763607 fmi3:2.125 fmh:1.06 fmh2:10 fmh3:0.1 ]", + "[ 9/4 → 19/8 | s:sine note:F1 fmi:4 fmi2:1.3819300457835197 fmi3:2.25 fmh:1.06 fmh2:10 fmh3:0.1 ]", + "[ 19/8 → 5/2 | s:sine note:F1 fmi:4 fmi2:3.346026562154293 fmi3:2.375 fmh:1.06 fmh2:10 fmh3:0.1 ]", + "[ 5/2 → 21/8 | s:sine note:F1 fmi:4 fmi2:1.8344642966985703 fmi3:2.5 fmh:1.06 fmh2:10 fmh3:0.1 ]", + "[ 21/8 → 11/4 | s:sine note:F1 fmi:4 fmi2:0.6407739371061325 fmi3:2.625 fmh:1.06 fmh2:10 fmh3:0.1 ]", + "[ 11/4 → 23/8 | s:sine note:F1 fmi:4 fmi2:2.5329310819506645 fmi3:2.75 fmh:1.06 fmh2:10 fmh3:0.1 ]", + "[ 23/8 → 3/1 | s:sine note:F1 fmi:4 fmi2:0.06501668691635132 fmi3:2.875 fmh:1.06 fmh2:10 fmh3:0.1 ]", + "[ 3/1 → 25/8 | s:sine note:F1 fmi:4 fmi2:0.8691564425826073 fmi3:3 fmh:1.06 fmh2:10 fmh3:0.1 ]", + "[ 25/8 → 13/4 | s:sine note:F1 fmi:4 fmi2:1.3729755133390427 fmi3:3.125 fmh:1.06 fmh2:10 fmh3:0.1 ]", + "[ 13/4 → 27/8 | s:sine note:F1 fmi:4 fmi2:3.9694602862000465 fmi3:3.25 fmh:1.06 fmh2:10 fmh3:0.1 ]", + "[ 27/8 → 7/2 | s:sine note:F1 fmi:4 fmi2:1.6347672045230865 fmi3:3.375 fmh:1.06 fmh2:10 fmh3:0.1 ]", + "[ 7/2 → 29/8 | s:sine note:F1 fmi:4 fmi2:1.639795258641243 fmi3:3.5 fmh:1.06 fmh2:10 fmh3:0.1 ]", + "[ 29/8 → 15/4 | s:sine note:F1 fmi:4 fmi2:3.7565943151712418 fmi3:3.625 fmh:1.06 fmh2:10 fmh3:0.1 ]", + "[ 15/4 → 31/8 | s:sine note:F1 fmi:4 fmi2:3.2486692890524864 fmi3:3.75 fmh:1.06 fmh2:10 fmh3:0.1 ]", + "[ 31/8 → 4/1 | s:sine note:F1 fmi:4 fmi2:2.9446661546826363 fmi3:3.875 fmh:1.06 fmh2:10 fmh3:0.1 ]", +] +`; + exports[`runs examples > example "fmattack" example index 0 1`] = ` [ "[ 0/1 → 1/6 | note:c fmi:4 fmattack:0 ]", @@ -4893,72 +4959,6 @@ exports[`runs examples > example "fmh" example index 0 1`] = ` ] `; -exports[`runs examples > example "fmi" example index 0 1`] = ` -[ - "[ 0/1 → 1/6 | note:c fmi:0 ]", - "[ 1/6 → 1/3 | note:e fmi:0 ]", - "[ 1/3 → 1/2 | note:g fmi:0 ]", - "[ 1/2 → 2/3 | note:b fmi:0 ]", - "[ 2/3 → 5/6 | note:g fmi:0 ]", - "[ 5/6 → 1/1 | note:e fmi:0 ]", - "[ 1/1 → 7/6 | note:c fmi:1 ]", - "[ 7/6 → 4/3 | note:e fmi:1 ]", - "[ 4/3 → 3/2 | note:g fmi:1 ]", - "[ 3/2 → 5/3 | note:b fmi:1 ]", - "[ 5/3 → 11/6 | note:g fmi:1 ]", - "[ 11/6 → 2/1 | note:e fmi:1 ]", - "[ 2/1 → 13/6 | note:c fmi:2 ]", - "[ 13/6 → 7/3 | note:e fmi:2 ]", - "[ 7/3 → 5/2 | note:g fmi:2 ]", - "[ 5/2 → 8/3 | note:b fmi:2 ]", - "[ 8/3 → 17/6 | note:g fmi:2 ]", - "[ 17/6 → 3/1 | note:e fmi:2 ]", - "[ 3/1 → 19/6 | note:c fmi:8 ]", - "[ 19/6 → 10/3 | note:e fmi:8 ]", - "[ 10/3 → 7/2 | note:g fmi:8 ]", - "[ 7/2 → 11/3 | note:b fmi:8 ]", - "[ 11/3 → 23/6 | note:g fmi:8 ]", - "[ 23/6 → 4/1 | note:e fmi:8 ]", -] -`; - -exports[`runs examples > example "fmi" example index 1 1`] = ` -[ - "[ 0/1 → 1/8 | s:sine note:F1 fmi:4 fmi2:0 fmi3:0 fmh:1.06 fmh2:10 fmh3:0.1 ]", - "[ 1/8 → 1/4 | s:sine note:F1 fmi:4 fmi2:2.7408622801303864 fmi3:0.125 fmh:1.06 fmh2:10 fmh3:0.1 ]", - "[ 1/4 → 3/8 | s:sine note:F1 fmi:4 fmi2:1.479038767516613 fmi3:0.25 fmh:1.06 fmh2:10 fmh3:0.1 ]", - "[ 3/8 → 1/2 | s:sine note:F1 fmi:4 fmi2:1.605570062994957 fmi3:0.375 fmh:1.06 fmh2:10 fmh3:0.1 ]", - "[ 1/2 → 5/8 | s:sine note:F1 fmi:4 fmi2:1.041922464966774 fmi3:0.5 fmh:1.06 fmh2:10 fmh3:0.1 ]", - "[ 5/8 → 3/4 | s:sine note:F1 fmi:4 fmi2:0.5425434708595276 fmi3:0.625 fmh:1.06 fmh2:10 fmh3:0.1 ]", - "[ 3/4 → 7/8 | s:sine note:F1 fmi:4 fmi2:0.7833059206604958 fmi3:0.75 fmh:1.06 fmh2:10 fmh3:0.1 ]", - "[ 7/8 → 1/1 | s:sine note:F1 fmi:4 fmi2:1.590524323284626 fmi3:0.875 fmh:1.06 fmh2:10 fmh3:0.1 ]", - "[ 1/1 → 9/8 | s:sine note:F1 fmi:4 fmi2:2.078168660402298 fmi3:1 fmh:1.06 fmh2:10 fmh3:0.1 ]", - "[ 9/8 → 5/4 | s:sine note:F1 fmi:4 fmi2:2.689958058297634 fmi3:1.125 fmh:1.06 fmh2:10 fmh3:0.1 ]", - "[ 5/4 → 11/8 | s:sine note:F1 fmi:4 fmi2:2.914912812411785 fmi3:1.25 fmh:1.06 fmh2:10 fmh3:0.1 ]", - "[ 11/8 → 3/2 | s:sine note:F1 fmi:4 fmi2:0.7312150076031685 fmi3:1.375 fmh:1.06 fmh2:10 fmh3:0.1 ]", - "[ 3/2 → 13/8 | s:sine note:F1 fmi:4 fmi2:2.4336322993040085 fmi3:1.5 fmh:1.06 fmh2:10 fmh3:0.1 ]", - "[ 13/8 → 7/4 | s:sine note:F1 fmi:4 fmi2:1.987018845975399 fmi3:1.625 fmh:1.06 fmh2:10 fmh3:0.1 ]", - "[ 7/4 → 15/8 | s:sine note:F1 fmi:4 fmi2:0.8189515843987465 fmi3:1.75 fmh:1.06 fmh2:10 fmh3:0.1 ]", - "[ 15/8 → 2/1 | s:sine note:F1 fmi:4 fmi2:2.3782287165522575 fmi3:1.875 fmh:1.06 fmh2:10 fmh3:0.1 ]", - "[ 2/1 → 17/8 | s:sine note:F1 fmi:4 fmi2:3.838108479976654 fmi3:2 fmh:1.06 fmh2:10 fmh3:0.1 ]", - "[ 17/8 → 9/4 | s:sine note:F1 fmi:4 fmi2:3.613561175763607 fmi3:2.125 fmh:1.06 fmh2:10 fmh3:0.1 ]", - "[ 9/4 → 19/8 | s:sine note:F1 fmi:4 fmi2:1.3819300457835197 fmi3:2.25 fmh:1.06 fmh2:10 fmh3:0.1 ]", - "[ 19/8 → 5/2 | s:sine note:F1 fmi:4 fmi2:3.346026562154293 fmi3:2.375 fmh:1.06 fmh2:10 fmh3:0.1 ]", - "[ 5/2 → 21/8 | s:sine note:F1 fmi:4 fmi2:1.8344642966985703 fmi3:2.5 fmh:1.06 fmh2:10 fmh3:0.1 ]", - "[ 21/8 → 11/4 | s:sine note:F1 fmi:4 fmi2:0.6407739371061325 fmi3:2.625 fmh:1.06 fmh2:10 fmh3:0.1 ]", - "[ 11/4 → 23/8 | s:sine note:F1 fmi:4 fmi2:2.5329310819506645 fmi3:2.75 fmh:1.06 fmh2:10 fmh3:0.1 ]", - "[ 23/8 → 3/1 | s:sine note:F1 fmi:4 fmi2:0.06501668691635132 fmi3:2.875 fmh:1.06 fmh2:10 fmh3:0.1 ]", - "[ 3/1 → 25/8 | s:sine note:F1 fmi:4 fmi2:0.8691564425826073 fmi3:3 fmh:1.06 fmh2:10 fmh3:0.1 ]", - "[ 25/8 → 13/4 | s:sine note:F1 fmi:4 fmi2:1.3729755133390427 fmi3:3.125 fmh:1.06 fmh2:10 fmh3:0.1 ]", - "[ 13/4 → 27/8 | s:sine note:F1 fmi:4 fmi2:3.9694602862000465 fmi3:3.25 fmh:1.06 fmh2:10 fmh3:0.1 ]", - "[ 27/8 → 7/2 | s:sine note:F1 fmi:4 fmi2:1.6347672045230865 fmi3:3.375 fmh:1.06 fmh2:10 fmh3:0.1 ]", - "[ 7/2 → 29/8 | s:sine note:F1 fmi:4 fmi2:1.639795258641243 fmi3:3.5 fmh:1.06 fmh2:10 fmh3:0.1 ]", - "[ 29/8 → 15/4 | s:sine note:F1 fmi:4 fmi2:3.7565943151712418 fmi3:3.625 fmh:1.06 fmh2:10 fmh3:0.1 ]", - "[ 15/4 → 31/8 | s:sine note:F1 fmi:4 fmi2:3.2486692890524864 fmi3:3.75 fmh:1.06 fmh2:10 fmh3:0.1 ]", - "[ 31/8 → 4/1 | s:sine note:F1 fmi:4 fmi2:2.9446661546826363 fmi3:3.875 fmh:1.06 fmh2:10 fmh3:0.1 ]", -] -`; - exports[`runs examples > example "fmsustain" example index 0 1`] = ` [ "[ 0/1 → 1/6 | note:c fmi:4 fmdecay:0.1 fmsustain:1 ]", diff --git a/website/astro.config.mjs b/website/astro.config.mjs index de08502dd..23b49bc93 100644 --- a/website/astro.config.mjs +++ b/website/astro.config.mjs @@ -73,6 +73,7 @@ export default defineConfig({ workbox: { maximumFileSizeToCacheInBytes: 4194304, // 4MB globPatterns: ['**/*.{js,css,html,ico,png,svg,json,wav,mp3,ogg,ttf,woff2,TTF,otf}'], + globIgnores: ['img/**', '_astro/csound*.js'], runtimeCaching: [ { urlPattern: ({ url }) => @@ -88,7 +89,7 @@ export default defineConfig({ cacheName: 'external-samples', expiration: { maxEntries: 5000, - maxAgeSeconds: 60 * 60 * 24 * 30, // <== 14 days + maxAgeSeconds: 60 * 60 * 24 * 30, // <== 30 days }, cacheableResponse: { statuses: [0, 200], diff --git a/website/src/env.d.ts b/website/src/env.d.ts index 4138c53f3..12c817559 100644 --- a/website/src/env.d.ts +++ b/website/src/env.d.ts @@ -2,3 +2,6 @@ /// declare module 'date-fns'; +declare module '@strudel/*'; +declare module 'dough-synth'; +declare module 'paho-mqtt'; diff --git a/website/src/my_patterns.js b/website/src/my_patterns.js index 5779cc427..bb10e2a86 100644 --- a/website/src/my_patterns.js +++ b/website/src/my_patterns.js @@ -1,7 +1,7 @@ import { getMetadata } from './metadata_parser'; export function getMyPatterns() { - const my = import.meta.glob('../../my-patterns/**', { as: 'raw', eager: true }); + const my = import.meta.glob('../../my-patterns/**', { query: '?raw', eager: true }); return Object.fromEntries( Object.entries(my) .filter(([name]) => name.endsWith('.txt')) diff --git a/website/src/pages/learn/effects.mdx b/website/src/pages/learn/effects.mdx index 9f8a3370c..381482c96 100644 --- a/website/src/pages/learn/effects.mdx +++ b/website/src/pages/learn/effects.mdx @@ -184,9 +184,9 @@ Each filter has 2 parameters: Amplitude modulation changes the amplitude (gain) periodically over time. -## am +## tremolo - + ## tremolosync diff --git a/website/src/pages/learn/factories.mdx b/website/src/pages/learn/factories.mdx index ab77c1028..94e634459 100644 --- a/website/src/pages/learn/factories.mdx +++ b/website/src/pages/learn/factories.mdx @@ -18,7 +18,6 @@ These are the equivalents used by the Mini Notation: | `stack(x, y)` | `"x,y"` | | `stepcat([3,x],[2,y])` | `"x@3 y@2"` | | `polymeter([a, b, c], [x, y])` | `"{a b c, x y}"` | -| `polymeterSteps(2, x, y, z)` | `"{x y z}%2"` | | `silence` | `"~"` | ## cat @@ -45,10 +44,6 @@ These are the equivalents used by the Mini Notation: -## polymeterSteps - - - ## silence diff --git a/website/src/pages/learn/samples.mdx b/website/src/pages/learn/samples.mdx index 6a2f0cb95..afdcce2e1 100644 --- a/website/src/pages/learn/samples.mdx +++ b/website/src/pages/learn/samples.mdx @@ -329,7 +329,7 @@ Sampler effects are functions that can be used to change the behaviour of sample ### begin - + ### end diff --git a/website/src/pages/learn/xen.mdx b/website/src/pages/learn/xen.mdx index 3e6a5b12f..eba817157 100644 --- a/website/src/pages/learn/xen.mdx +++ b/website/src/pages/learn/xen.mdx @@ -22,7 +22,7 @@ These functions allow the use of scales other than your typical chromatic 12 bas {/* TODO (maybe): combine jsdoc things in tune.mjs with here */} - +{/* */} Here's an example of how to configure a basic hexany scale: diff --git a/website/src/repl/util.mjs b/website/src/repl/util.mjs index bd1a85f24..4561f06e9 100644 --- a/website/src/repl/util.mjs +++ b/website/src/repl/util.mjs @@ -1,12 +1,15 @@ -import { code2hash, errorLogger, evalScope, hash2code, logger } from '@strudel/core'; +import * as strudelCore from '@strudel/core'; +import * as strudelWebaudio from '@strudel/webaudio'; import { settingPatterns } from '../settings.mjs'; -import { setVersionDefaults } from '@strudel/webaudio'; -import { getMetadata } from '../metadata_parser'; +import { getMetadata } from '../metadata_parser.js'; import { isTauri } from '../tauri.mjs'; import './Repl.css'; import { createClient } from '@supabase/supabase-js'; import { writeText } from '@tauri-apps/plugin-clipboard-manager'; -import { $featuredPatterns /* , loadDBPatterns */ } from '@src/user_pattern_utils.mjs'; +import { $featuredPatterns } from '@src/user_pattern_utils.mjs'; + +const { setVersionDefaults } = strudelWebaudio; +const { code2hash, errorLogger, evalScope, hash2code, logger } = strudelCore; // Create a single supabase client for interacting with your database export const supabase = createClient( @@ -68,13 +71,13 @@ export async function getRandomTune() { export function loadModules() { let modules = [ - import('@strudel/core'), + strudelCore, import('@strudel/draw'), import('@strudel/edo'), import('@strudel/tonal'), import('@strudel/mini'), import('@strudel/xen'), - import('@strudel/webaudio'), + strudelWebaudio, import('@strudel/codemirror'), import('@strudel/hydra'), import('@strudel/serial'),