From d38a8ab1fa6f59fc9148f0da7806e5d87096f779 Mon Sep 17 00:00:00 2001 From: Felix Roos Date: Sun, 16 Apr 2023 23:55:12 +0200 Subject: [PATCH] more slides --- iclc2023/slides/package.json | 4 +- iclc2023/slides/src/MiniComparison.jsx | 6 +- iclc2023/slides/src/SlideRepl.jsx | 1 + iclc2023/slides/src/Slides.jsx | 23 ++- iclc2023/slides/src/SyntaxComparison.jsx | 42 +++-- iclc2023/slides/src/slides/bad.mdx | 5 + iclc2023/slides/src/slides/csound.mdx | 65 +++++++ iclc2023/slides/src/slides/docs.mdx | 1 + iclc2023/slides/src/slides/future.mdx | 8 + iclc2023/slides/src/slides/good.mdx | 10 ++ iclc2023/slides/src/slides/repl-features.mdx | 6 +- iclc2023/slides/src/slides/usage.mdx | 1 + iclc2023/slides/vite.config.js | 12 +- pnpm-lock.yaml | 170 ++++++++++++++++--- website/src/repl/prebake.mjs | 16 -- 15 files changed, 294 insertions(+), 76 deletions(-) create mode 100644 iclc2023/slides/src/slides/bad.mdx create mode 100644 iclc2023/slides/src/slides/csound.mdx create mode 100644 iclc2023/slides/src/slides/docs.mdx create mode 100644 iclc2023/slides/src/slides/future.mdx create mode 100644 iclc2023/slides/src/slides/good.mdx diff --git a/iclc2023/slides/package.json b/iclc2023/slides/package.json index c661acaf7..e65d15d5d 100644 --- a/iclc2023/slides/package.json +++ b/iclc2023/slides/package.json @@ -16,6 +16,7 @@ "@strudel.cycles/react": "workspace:*", "@strudel.cycles/soundfonts": "workspace:*", "@strudel.cycles/tonal": "workspace:*", + "@strudel.cycles/csound": "workspace:*", "@strudel.cycles/webaudio": "workspace:*", "@uiw/codemirror-themes-all": "^4.19.8", "escodegen": "^2.0.0", @@ -23,7 +24,8 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "react-syntax-highlighter": "^15.5.0", - "remark-gfm": "^3.0.1" + "remark-gfm": "^3.0.1", + "vite-plugin-top-level-await": "^1.3.0" }, "devDependencies": { "@tailwindcss/typography": "^0.5.8", diff --git a/iclc2023/slides/src/MiniComparison.jsx b/iclc2023/slides/src/MiniComparison.jsx index 431e17b60..c79405aa7 100644 --- a/iclc2023/slides/src/MiniComparison.jsx +++ b/iclc2023/slides/src/MiniComparison.jsx @@ -13,11 +13,7 @@ const snippets = [ function MiniComparison() { return ( <> -

- User Code: Mini Notation -> JavaScript -
- External DSL -

+

User Code: Mini Notation -> JavaScript

(
diff --git a/iclc2023/slides/src/SlideRepl.jsx b/iclc2023/slides/src/SlideRepl.jsx index 677445103..7c553afc3 100644 --- a/iclc2023/slides/src/SlideRepl.jsx +++ b/iclc2023/slides/src/SlideRepl.jsx @@ -13,6 +13,7 @@ if (typeof window !== 'undefined') { import('@strudel.cycles/mini'), import('@strudel.cycles/webaudio'), import('@strudel.cycles/soundfonts'), + import('@strudel.cycles/csound'), ); } diff --git a/iclc2023/slides/src/Slides.jsx b/iclc2023/slides/src/Slides.jsx index 8a29281b9..a145e95b1 100644 --- a/iclc2023/slides/src/Slides.jsx +++ b/iclc2023/slides/src/Slides.jsx @@ -7,14 +7,19 @@ function cx(...classes) { } // https://vitejs.dev/guide/features.html#glob-import const slideImports = import.meta.glob('./slides/*.mdx'); +//const slideImports = import.meta.glob('./slides/*.mdx', { eager: true }); +console.log('load slides...', slideImports); const loadedMDXFiles = await Promise.all( Object.entries(slideImports).map(async ([path, load]) => { + //Object.entries(slideImports).map(async ([path, m]) => { const segments = path.split('/'); const filename = segments[segments.length - 1].slice(0, -4); // expects .mdx at the end return [filename, (await load()).default]; + //return [filename, m.default]; }), ); +console.log('load done!'); const order = [ 'cover', @@ -39,10 +44,14 @@ const order = [ // Output 'events-audio', 'outputs', + 'csound', // // pattern alignment? // flexible typing? // future outlook? + 'bad', + 'good', + 'future', 'end', ]; @@ -57,7 +66,7 @@ export const next = () => slideIndex.set((parseInt(slideIndex.get()) + 1) % slid function Slides() { const activeIndex = parseInt(useStore(slideIndex)); - useEvent('click', (e) => { + /*useEvent('click', (e) => { if (!e.ctrlKey) { return; } @@ -67,7 +76,7 @@ function Slides() { } else { next(); } - }); + });*/ /*useEvent('keydown', (e) => { if (e.key === 'Home') { prev(); @@ -88,10 +97,18 @@ function Slides() { )} >
- {Math.abs(i - activeIndex) < 2 && } + {Math.abs(i - activeIndex) <= 1 && }
))} +
+
prev()}> + < +
+
next()}> + > +
+
-

- Haskell -> JavaScript -
- Internal DSL / Fluent Interface -

+

Haskell -> JavaScript

( -
-

{label}

-
-
- - -
-
- {js.map((c, j) => ( -
- - -
- ))} + steps={snippets + .map(([hs, js, label]) => ( +
+

{label}

+
+
+ + +
+
+ {js.map((c, j) => ( +
+ + +
+ ))} +
-
- ))} + )) + .concat([<>Fluent Interface: Just chain all the things!])} /> ); diff --git a/iclc2023/slides/src/slides/bad.mdx b/iclc2023/slides/src/slides/bad.mdx new file mode 100644 index 000000000..668e255bc --- /dev/null +++ b/iclc2023/slides/src/slides/bad.mdx @@ -0,0 +1,5 @@ +# What's bad + +- Dynamic Typing in JS +- Performance on lower end devices +- Fractions and Hot Paths \ No newline at end of file diff --git a/iclc2023/slides/src/slides/csound.mdx b/iclc2023/slides/src/slides/csound.mdx new file mode 100644 index 000000000..be4ffaf83 --- /dev/null +++ b/iclc2023/slides/src/slides/csound.mdx @@ -0,0 +1,65 @@ +import { SlideRepl } from '../SlideRepl.jsx'; + +# CSound Example + +## Loading ORC instruments + +/2".voicings('lefthand')) +.cutoff(sine.range(500,2000).round().slow(16)) +.euclidLegato(3,8).csound('FM1'), + +note("/2").ply(8).csound('Bass') +.gain("1 4 1 4"), + +note("0 7 [4 3] 2".fast(2/3) +.off(".25 .125", add("<2 4 -3 -1>")) +.slow(2).scale('A4 minor')) +.legato(.25).csound('SynHarp'), + +s("bd*2,[~ hh]*2,~ cp").bank('RolandTR909') +)`} +hideHeader +/> + +## Synthesis + +" +.off(1/4, add(2)) +.off(1/2, add(6)) +.scale('D minor') +.note() +//.pianoroll() +.csound('CoolSynth')`} +hideHeader +/> diff --git a/iclc2023/slides/src/slides/docs.mdx b/iclc2023/slides/src/slides/docs.mdx new file mode 100644 index 000000000..5c7fe4953 --- /dev/null +++ b/iclc2023/slides/src/slides/docs.mdx @@ -0,0 +1 @@ +# Strudel Docs \ No newline at end of file diff --git a/iclc2023/slides/src/slides/future.mdx b/iclc2023/slides/src/slides/future.mdx new file mode 100644 index 000000000..646814071 --- /dev/null +++ b/iclc2023/slides/src/slides/future.mdx @@ -0,0 +1,8 @@ +# Future Outlook + +- alternative audio backends + - supercollider wasm? + - web audio modules +- pluggable ui controls +- block based evaluation +- live collaboration diff --git a/iclc2023/slides/src/slides/good.mdx b/iclc2023/slides/src/slides/good.mdx new file mode 100644 index 000000000..c4c0746a9 --- /dev/null +++ b/iclc2023/slides/src/slides/good.mdx @@ -0,0 +1,10 @@ +# What's good + +- Low barrier of entry for non-techies +- good for teaching music / coding +- beginner friendly syntax (slightly more verbose) +- beginner friendly visualizations +- portable (runs on most devices) +- sharable +- lower barrier of entry for contributors +- strudel features feeding back into tidal \ No newline at end of file diff --git a/iclc2023/slides/src/slides/repl-features.mdx b/iclc2023/slides/src/slides/repl-features.mdx index d27eb68e4..abee40d00 100644 --- a/iclc2023/slides/src/slides/repl-features.mdx +++ b/iclc2023/slides/src/slides/repl-features.mdx @@ -1,13 +1,13 @@ # Strudel REPL: Features -- Outputs: Web Audio, MIDI, OSC, CSound, Serial, .. - Visual Feedback - Examples to shuffle through -- Sharable URLs +- Share-Link Generator - Sound Browser - Console - Reference -- Offline Support (+ installable PWA) - Themable + Custom Fonts +- Offline Support (+ installable PWA) +- Outputs: Web Audio, MIDI, OSC, CSound, Serial, .. ![illegible](./img/illegible.png) diff --git a/iclc2023/slides/src/slides/usage.mdx b/iclc2023/slides/src/slides/usage.mdx index f6a4dbbda..4adeab7e9 100644 --- a/iclc2023/slides/src/slides/usage.mdx +++ b/iclc2023/slides/src/slides/usage.mdx @@ -3,6 +3,7 @@ import Highlight from '../Highlight.jsx'; # Ways to use Strudel - "Strudel REPL" at [strudel.tidalcycles.org](https://strudel.tidalcycles.org) +- strudel on [flok.cc](https://flok.cc/) for collaboration - `@strudel.cycles/*` npm packages for your own projects - Embeddable [Web Component](https://github.com/tidalcycles/strudel/tree/main/packages/embed#strudelcyclesembed) - Browser Plugin for [Mastodon](https://github.com/mortuosplango/topfenstrudel) + Discourse Plugin: diff --git a/iclc2023/slides/vite.config.js b/iclc2023/slides/vite.config.js index 1462a7b7e..46b11e919 100644 --- a/iclc2023/slides/vite.config.js +++ b/iclc2023/slides/vite.config.js @@ -2,6 +2,7 @@ import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; import mdx from '@mdx-js/rollup'; import gfm from 'remark-gfm'; +import topLevelAwait from 'vite-plugin-top-level-await'; const options = { // See https://mdxjs.com/advanced/plugins @@ -11,7 +12,16 @@ const options = { // https://vitejs.dev/config/ export default defineConfig({ - plugins: [react(), mdx(options)], + plugins: [ + react(), + mdx(options), + topLevelAwait({ + // The export name of top-level await promise for each chunk module + promiseExportName: '__tla', + // The function to generate import names of top-level await promise in each chunk module + promiseImportName: (i) => `__tla_${i}`, + }), + ], build: { target: 'esnext', //browsers can handle the latest ES features }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7b9338950..cd3461020 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -57,6 +57,7 @@ importers: '@nanostores/persistent': ^0.7.0 '@nanostores/react': ^0.4.1 '@strudel.cycles/core': workspace:* + '@strudel.cycles/csound': workspace:* '@strudel.cycles/react': workspace:* '@strudel.cycles/soundfonts': workspace:* '@strudel.cycles/tonal': workspace:* @@ -76,11 +77,13 @@ importers: remark-gfm: ^3.0.1 tailwindcss: ^3.2.7 vite: ^4.2.0 + vite-plugin-top-level-await: ^1.3.0 dependencies: '@mdx-js/rollup': 2.3.0 '@nanostores/persistent': 0.7.0_nanostores@0.7.4 '@nanostores/react': 0.4.1_nkfnbc2tpc77iht7asm3uqwau4 '@strudel.cycles/core': link:../../packages/core + '@strudel.cycles/csound': link:../../packages/csound '@strudel.cycles/react': link:../../packages/react '@strudel.cycles/soundfonts': link:../../packages/soundfonts '@strudel.cycles/tonal': link:../../packages/tonal @@ -92,6 +95,7 @@ importers: react-dom: 18.2.0_react@18.2.0 react-syntax-highlighter: 15.5.0_react@18.2.0 remark-gfm: 3.0.1 + vite-plugin-top-level-await: 1.3.0_vite@4.2.0 devDependencies: '@tailwindcss/typography': 0.5.9_tailwindcss@3.2.7 '@types/react': 18.0.28 @@ -2170,7 +2174,6 @@ packages: cpu: [arm] os: [android] requiresBuild: true - dev: true optional: true /@esbuild/android-arm64/0.16.17: @@ -2187,7 +2190,6 @@ packages: cpu: [arm64] os: [android] requiresBuild: true - dev: true optional: true /@esbuild/android-x64/0.16.17: @@ -2204,7 +2206,6 @@ packages: cpu: [x64] os: [android] requiresBuild: true - dev: true optional: true /@esbuild/darwin-arm64/0.16.17: @@ -2221,7 +2222,6 @@ packages: cpu: [arm64] os: [darwin] requiresBuild: true - dev: true optional: true /@esbuild/darwin-x64/0.16.17: @@ -2238,7 +2238,6 @@ packages: cpu: [x64] os: [darwin] requiresBuild: true - dev: true optional: true /@esbuild/freebsd-arm64/0.16.17: @@ -2255,7 +2254,6 @@ packages: cpu: [arm64] os: [freebsd] requiresBuild: true - dev: true optional: true /@esbuild/freebsd-x64/0.16.17: @@ -2272,7 +2270,6 @@ packages: cpu: [x64] os: [freebsd] requiresBuild: true - dev: true optional: true /@esbuild/linux-arm/0.16.17: @@ -2289,7 +2286,6 @@ packages: cpu: [arm] os: [linux] requiresBuild: true - dev: true optional: true /@esbuild/linux-arm64/0.16.17: @@ -2306,7 +2302,6 @@ packages: cpu: [arm64] os: [linux] requiresBuild: true - dev: true optional: true /@esbuild/linux-ia32/0.16.17: @@ -2323,7 +2318,6 @@ packages: cpu: [ia32] os: [linux] requiresBuild: true - dev: true optional: true /@esbuild/linux-loong64/0.15.18: @@ -2348,7 +2342,6 @@ packages: cpu: [loong64] os: [linux] requiresBuild: true - dev: true optional: true /@esbuild/linux-mips64el/0.16.17: @@ -2365,7 +2358,6 @@ packages: cpu: [mips64el] os: [linux] requiresBuild: true - dev: true optional: true /@esbuild/linux-ppc64/0.16.17: @@ -2382,7 +2374,6 @@ packages: cpu: [ppc64] os: [linux] requiresBuild: true - dev: true optional: true /@esbuild/linux-riscv64/0.16.17: @@ -2399,7 +2390,6 @@ packages: cpu: [riscv64] os: [linux] requiresBuild: true - dev: true optional: true /@esbuild/linux-s390x/0.16.17: @@ -2416,7 +2406,6 @@ packages: cpu: [s390x] os: [linux] requiresBuild: true - dev: true optional: true /@esbuild/linux-x64/0.16.17: @@ -2433,7 +2422,6 @@ packages: cpu: [x64] os: [linux] requiresBuild: true - dev: true optional: true /@esbuild/netbsd-x64/0.16.17: @@ -2450,7 +2438,6 @@ packages: cpu: [x64] os: [netbsd] requiresBuild: true - dev: true optional: true /@esbuild/openbsd-x64/0.16.17: @@ -2467,7 +2454,6 @@ packages: cpu: [x64] os: [openbsd] requiresBuild: true - dev: true optional: true /@esbuild/sunos-x64/0.16.17: @@ -2484,7 +2470,6 @@ packages: cpu: [x64] os: [sunos] requiresBuild: true - dev: true optional: true /@esbuild/win32-arm64/0.16.17: @@ -2501,7 +2486,6 @@ packages: cpu: [arm64] os: [win32] requiresBuild: true - dev: true optional: true /@esbuild/win32-ia32/0.16.17: @@ -2518,7 +2502,6 @@ packages: cpu: [ia32] os: [win32] requiresBuild: true - dev: true optional: true /@esbuild/win32-x64/0.16.17: @@ -2535,7 +2518,6 @@ packages: cpu: [x64] os: [win32] requiresBuild: true - dev: true optional: true /@eslint/eslintrc/1.4.1: @@ -3373,6 +3355,16 @@ packages: rollup: 3.12.0 dev: true + /@rollup/plugin-virtual/3.0.1: + resolution: {integrity: sha512-fK8O0IL5+q+GrsMLuACVNk2x21g3yaw+sG2qn16SnUd3IlBsQyvWxLMGHmCmXRMecPjGRSZ/1LmZB4rjQm68og==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0 + peerDependenciesMeta: + rollup: + optional: true + dev: false + /@rollup/pluginutils/3.1.0_rollup@2.79.1: resolution: {integrity: sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==} engines: {node: '>= 8.0.0'} @@ -3477,6 +3469,118 @@ packages: string.prototype.matchall: 4.0.8 dev: true + /@swc/core-darwin-arm64/1.3.51: + resolution: {integrity: sha512-DM15fJgaXQ+BOoTlMCBoRBSzkpC2V8vAXaAvh3BZ+BI6/03FUQ0j9CMIaSkss3VOv+WwqzllmcT71C/oVDQ7Tg==} + engines: {node: '>=10'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: false + optional: true + + /@swc/core-darwin-x64/1.3.51: + resolution: {integrity: sha512-EPAneufZfFQUkpkf2m8Ap8TajLvjWI+UmDQz54QaofLaigXgrnLoqTtnZHBfDbUTApGYz3GaqjfZ2fMLGiISLQ==} + engines: {node: '>=10'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: false + optional: true + + /@swc/core-linux-arm-gnueabihf/1.3.51: + resolution: {integrity: sha512-sASxO3lJjlY5g8S25yCQirDOW6zqBNeDSUCBrulaVxttx0PcL64kc6qaOlM3HKlNO4W1P7RW/mGFR4bBov+yIg==} + engines: {node: '>=10'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@swc/core-linux-arm64-gnu/1.3.51: + resolution: {integrity: sha512-z8yHRUK+5mRxSQkw9uND8QSt8lTrW0X8blmP12Q7c7RKWOHqIaGS60a3VvLuTal7k48K4YTstSevIrGwGK88sA==} + engines: {node: '>=10'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@swc/core-linux-arm64-musl/1.3.51: + resolution: {integrity: sha512-lMlp09lv6qDURvETw4AAZAjaJfvjwHjiAuB+JuZrgP3zdxB21M6cMas3EjAGXtNabpU1FJu+8Lsys6/GBBjsPQ==} + engines: {node: '>=10'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@swc/core-linux-x64-gnu/1.3.51: + resolution: {integrity: sha512-6zK4tDr6do6RFTJv38Rb8ZjBLdfSN7GeuyOJpblz1Qu62RqyY2Zf3fxuCZY9tkoEepZ0MvU0d4D7HhAUYKj20A==} + engines: {node: '>=10'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@swc/core-linux-x64-musl/1.3.51: + resolution: {integrity: sha512-ZwW+X9XdEiAszX+zfaLdOVfi5rQP3vnVwuNAiuX9eq5jHdfOKfKaNtJaGTD8w8NgMavaBM5AMaCHshFVNF0vRw==} + engines: {node: '>=10'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@swc/core-win32-arm64-msvc/1.3.51: + resolution: {integrity: sha512-w+IX4xCIZH6RQG7RrOOrrHqIqM7JIj9BDZHM9LAYC5MIbDinwjnSUXz7bpn0L1LRusvPtmbTulLuSkmVBSSwAg==} + engines: {node: '>=10'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: false + optional: true + + /@swc/core-win32-ia32-msvc/1.3.51: + resolution: {integrity: sha512-Bzv/h0HkoKkTWOOoHtehId/6AS5hLBbWE5czzcQc8SWs+BNNV8zjWoq1oYn7/gLLEhdKaBAxv9q7RHzOfBx28A==} + engines: {node: '>=10'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: false + optional: true + + /@swc/core-win32-x64-msvc/1.3.51: + resolution: {integrity: sha512-dTKAdSd0e2Sfz3Sl3m6RGLQbk6jdSIh8TlFomF4iiHDHq4PxLTzjaOVvKUAP5wux9DtBnAgZeSHMuQfM4aL9oA==} + engines: {node: '>=10'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: false + optional: true + + /@swc/core/1.3.51: + resolution: {integrity: sha512-/fdKlrs2NacLeOKrVZjCPfw5GeUIyBcJg0GDBn0+qwC3Y6k85m4aswK1sfRDF3nzyeXXoBr7YBb+/cSdFq9pVw==} + engines: {node: '>=10'} + requiresBuild: true + peerDependencies: + '@swc/helpers': ^0.5.0 + peerDependenciesMeta: + '@swc/helpers': + optional: true + optionalDependencies: + '@swc/core-darwin-arm64': 1.3.51 + '@swc/core-darwin-x64': 1.3.51 + '@swc/core-linux-arm-gnueabihf': 1.3.51 + '@swc/core-linux-arm64-gnu': 1.3.51 + '@swc/core-linux-arm64-musl': 1.3.51 + '@swc/core-linux-x64-gnu': 1.3.51 + '@swc/core-linux-x64-musl': 1.3.51 + '@swc/core-win32-arm64-msvc': 1.3.51 + '@swc/core-win32-ia32-msvc': 1.3.51 + '@swc/core-win32-x64-msvc': 1.3.51 + dev: false + /@tailwindcss/forms/0.5.3_tailwindcss@3.2.4: resolution: {integrity: sha512-y5mb86JUoiUgBjY/o6FJSFZSEttfb3Q5gllE4xoKjAAD+vBrnIhE4dViwUuow3va8mpH4s9jyUbUbrRGoRdc2Q==} peerDependencies: @@ -6357,7 +6461,6 @@ packages: '@esbuild/win32-arm64': 0.17.12 '@esbuild/win32-ia32': 0.17.12 '@esbuild/win32-x64': 0.17.12 - dev: true /escalade/3.1.1: resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} @@ -11598,7 +11701,6 @@ packages: hasBin: true optionalDependencies: fsevents: 2.3.2 - dev: true /run-async/2.4.1: resolution: {integrity: sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==} @@ -13032,6 +13134,11 @@ packages: hasBin: true dev: true + /uuid/9.0.0: + resolution: {integrity: sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==} + hasBin: true + dev: false + /uvu/0.5.6: resolution: {integrity: sha512-+g8ENReyr8YsOc6fv/NVJs2vFdHBnBNdfE49rshrTzDWOlUx4Gq7KOS2GD8eqhy2j+Ejq29+SbKH8yjkAqXqoA==} engines: {node: '>=8'} @@ -13135,6 +13242,20 @@ packages: - supports-color dev: true + /vite-plugin-top-level-await/1.3.0_vite@4.2.0: + resolution: {integrity: sha512-owIfsgWudMlQODWJSwp0sQB3AZZu3qsMygeBjZy8CyjEk6OB9AGd8lHqmgwrcEqgvy9N58lYxSBLVk3/4ejEiA==} + peerDependencies: + vite: '>=2.8' + dependencies: + '@rollup/plugin-virtual': 3.0.1 + '@swc/core': 1.3.51 + uuid: 9.0.0 + vite: 4.2.0 + transitivePeerDependencies: + - '@swc/helpers' + - rollup + dev: false + /vite/3.2.5: resolution: {integrity: sha512-4mVEpXpSOgrssFZAOmGIr85wPHKvaDAcXqxVxVRZhljkJOMZi1ibLibzjLHzJvcok8BMguLc7g1W6W/GqZbLdQ==} engines: {node: ^14.18.0 || >=16.0.0} @@ -13266,7 +13387,6 @@ packages: rollup: 3.19.1 optionalDependencies: fsevents: 2.3.2 - dev: true /vitefu/0.2.4_vite@3.2.5: resolution: {integrity: sha512-fanAXjSaf9xXtOOeno8wZXIhgia+CZury481LsDaV++lSvcU2R9Ch2bPh3PYFyoHW+w9LqAeYRISVQjUIew14g==} diff --git a/website/src/repl/prebake.mjs b/website/src/repl/prebake.mjs index a9ad87c9e..66ef2a2eb 100644 --- a/website/src/repl/prebake.mjs +++ b/website/src/repl/prebake.mjs @@ -1,4 +1,3 @@ -import { Pattern, noteToMidi, valueToMidi } from '@strudel.cycles/core'; import { registerSoundfonts } from '@strudel.cycles/soundfonts'; import { registerSynthSounds, samples } from '@strudel.cycles/webaudio'; import './piano.mjs'; @@ -22,18 +21,3 @@ export async function prebake() { // samples('github:tidalcycles/Dirt-Samples/master'), ]); } - -const maxPan = noteToMidi('C8'); -const panwidth = (pan, width) => pan * width + (1 - width) / 2; - -Pattern.prototype.piano = function () { - return this.clip(1) - .s('piano') - .release(0.1) - .fmap((value) => { - const midi = valueToMidi(value); - // pan by pitch - const pan = panwidth(Math.min(Math.round(midi) / maxPan, 1), 0.5); - return { ...value, pan: (value.pan || 1) * pan }; - }); -};