From 07bcaa65a9c35668701acd44f4bc1fed328cb674 Mon Sep 17 00:00:00 2001 From: "Jade (Rose) Rowland" Date: Fri, 6 Sep 2024 00:16:30 -0400 Subject: [PATCH 01/12] create meta params --- packages/core/controls.mjs | 43 +++++++++++++++++++++++++++++++++++ packages/superdough/synth.mjs | 5 ++-- 2 files changed, 46 insertions(+), 2 deletions(-) diff --git a/packages/core/controls.mjs b/packages/core/controls.mjs index 5a2752944..e0057c675 100644 --- a/packages/core/controls.mjs +++ b/packages/core/controls.mjs @@ -73,6 +73,49 @@ export function registerControl(names, ...aliases) { */ export const { s, sound } = registerControl(['s', 'n', 'gain'], 'sound'); +/** + * generic macro param for a sound synth + * + * @name z1 + * @synonyms z + * @param {number | Pattern} + * @example + * n(run(8)).scale("D:pentatonic").s("supersaw").x(".01 .75").release(0.5) + * + */ +export const { z1, z } = registerControl(['z1', 'z2', 'z3', 'z4'], 'z'); + +/** + * generic macro param for a sound synth + * + * @name z2 + * @param {number | Pattern} + * @example + * n(run(8)).scale("D:pentatonic").s("supersaw").x2("2 .7").release(0.5) + * + */ +export const { z2 } = registerControl('z2'); + +/** + * generic macro param for a sound synth + * + * @name z3 + * @param {number | Pattern} + * @example + * n(run(8)).scale("D:pentatonic").s("supersaw").x3(".1 .75").release(0.5) + * + */ +export const { z4 } = registerControl('z3'); + +/** + * generic macro param for a sound synth + * + * @name x4 + * @param {number | Pattern} + * + */ +export const { x4 } = registerControl('z4'); + /** * Define a custom webaudio node to use as a sound source. * diff --git a/packages/superdough/synth.mjs b/packages/superdough/synth.mjs index 621a6e598..113fb4e5e 100644 --- a/packages/superdough/synth.mjs +++ b/packages/superdough/synth.mjs @@ -73,8 +73,9 @@ export function registerSynthSounds() { 'supersaw', (begin, value, onended) => { const ac = getAudioContext(); - let { duration, n, unison = 5, spread = 0.6, detune } = value; - detune = detune ?? n ?? 0.18; + const {z1, z2, z3} = value; + let { duration, n, unison = z2 ?? 5, spread = z3 ?? 0.6, detune, } = value; + detune = detune ?? n ?? z1 ?? 0.18; const frequency = getFrequencyFromValue(value); const [attack, decay, sustain, release] = getADSRValues( From 96802a271cd8bda2eb14cdb76da944dbef977099 Mon Sep 17 00:00:00 2001 From: "Jade (Rose) Rowland" Date: Sun, 13 Oct 2024 23:24:54 -0400 Subject: [PATCH 02/12] feat: menu pinning --- website/src/components/Udels/UdelsEditor.jsx | 4 +- website/src/docs/Icon.jsx | 2 +- website/src/repl/components/ReplEditor.jsx | 7 +- .../src/repl/components/panel/ConsoleTab.jsx | 2 +- website/src/repl/components/panel/Panel.jsx | 201 +++++++++++------- .../src/repl/components/panel/PatternsTab.jsx | 4 +- .../src/repl/components/panel/SoundsTab.jsx | 2 +- 7 files changed, 139 insertions(+), 83 deletions(-) diff --git a/website/src/components/Udels/UdelsEditor.jsx b/website/src/components/Udels/UdelsEditor.jsx index 2d05640f3..47e7a3286 100644 --- a/website/src/components/Udels/UdelsEditor.jsx +++ b/website/src/components/Udels/UdelsEditor.jsx @@ -1,5 +1,5 @@ import Loader from '@src/repl/components/Loader'; -import { Panel } from '@src/repl/components/panel/Panel'; +import { HorizontalPanel, } from '@src/repl/components/panel/Panel'; import { Code } from '@src/repl/components/Code'; import BigPlayButton from '@src/repl/components/BigPlayButton'; import UserFacingErrorMessage from '@src/repl/components/UserFacingErrorMessage'; @@ -20,7 +20,7 @@ export default function UdelsEditor(Props) { - + ); } diff --git a/website/src/docs/Icon.jsx b/website/src/docs/Icon.jsx index 48b05d87f..8a58da127 100644 --- a/website/src/docs/Icon.jsx +++ b/website/src/docs/Icon.jsx @@ -52,7 +52,7 @@ export function Icon({ type }) { d="M52.5 440.6c-9.5 7.9-22.8 9.7-34.1 4.4S0 428.4 0 416V96C0 83.6 7.2 72.3 18.4 67s24.5-3.6 34.1 4.4l192 160L256 241V96c0-17.7 14.3-32 32-32s32 14.3 32 32V416c0 17.7-14.3 32-32 32s-32-14.3-32-32V271l-11.5 9.6-192 160z" clipRule="evenodd" /> - ), + ), }[type] } diff --git a/website/src/repl/components/ReplEditor.jsx b/website/src/repl/components/ReplEditor.jsx index 83317bf37..f0b11ff42 100644 --- a/website/src/repl/components/ReplEditor.jsx +++ b/website/src/repl/components/ReplEditor.jsx @@ -1,5 +1,5 @@ import Loader from '@src/repl/components/Loader'; -import { Panel } from '@src/repl/components/panel/Panel'; +import { HorizontalPanel, VerticalPanel } from '@src/repl/components/panel/Panel'; import { Code } from '@src/repl/components/Code'; import UserFacingErrorMessage from '@src/repl/components/UserFacingErrorMessage'; import { Header } from './Header'; @@ -15,16 +15,17 @@ export default function ReplEditor(Props) { const settings = useSettings(); const { panelPosition } = settings; + return (
- {panelPosition === 'right' && } + {panelPosition === 'right' && }
- {panelPosition === 'bottom' && } + {panelPosition === 'bottom' && }
); } diff --git a/website/src/repl/components/panel/ConsoleTab.jsx b/website/src/repl/components/panel/ConsoleTab.jsx index e1bbbe647..02e40e489 100644 --- a/website/src/repl/components/panel/ConsoleTab.jsx +++ b/website/src/repl/components/panel/ConsoleTab.jsx @@ -2,7 +2,7 @@ import cx from '@src/cx.mjs'; export function ConsoleTab({ log }) { return ( -
+