From 4671d343c4f1abdad5e7f42874ec9ce3eb6b2940 Mon Sep 17 00:00:00 2001 From: Felix Roos Date: Fri, 21 Aug 2026 14:05:35 +0200 Subject: [PATCH 1/6] update dough to fix fit --- packages/dough/package.json | 2 +- pnpm-lock.yaml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/dough/package.json b/packages/dough/package.json index abbb543be..81ff5c375 100644 --- a/packages/dough/package.json +++ b/packages/dough/package.json @@ -31,7 +31,7 @@ "dependencies": { "@strudel/core": "workspace:*", "@strudel/webaudio": "workspace:*", - "dough-synth": "0.2.4" + "dough-synth": "0.2.7" }, "devDependencies": { "vite": "^6.0.11" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c667981ce..a8c6e82a6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -312,8 +312,8 @@ importers: specifier: workspace:* version: link:../webaudio dough-synth: - specifier: 0.2.4 - version: 0.2.4 + specifier: 0.2.7 + version: 0.2.7 devDependencies: vite: specifier: ^6.0.11 @@ -4072,8 +4072,8 @@ packages: resolution: {integrity: sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==} engines: {node: '>=12'} - dough-synth@0.2.4: - resolution: {integrity: sha512-qMnMKVj1B2ivUgobNCwqJqNzZHOMN+5339OmCOk07zIDEK7iCYdufa+ZDE2BEgmKrWDyhGS7oTNFjHtTwzEv9w==} + dough-synth@0.2.7: + resolution: {integrity: sha512-Kj0tnDqu9Q8a9E8HepU5BN9lZcy+kYIYka7rn0o8NGfeSdxSe4m9luz7Hel0zqt33FCStk1nLPYsGmbdPfj3gA==} hasBin: true dset@3.1.4: @@ -11794,7 +11794,7 @@ snapshots: dotenv@16.4.7: {} - dough-synth@0.2.4: {} + dough-synth@0.2.7: {} dset@3.1.4: {} From 58dfe9a55c62aa16b55af8291a5693e7c6408826 Mon Sep 17 00:00:00 2001 From: Felix Roos Date: Tue, 25 Aug 2026 11:21:59 +0200 Subject: [PATCH 2/6] update dough --- packages/dough/package.json | 2 +- pnpm-lock.yaml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/dough/package.json b/packages/dough/package.json index 81ff5c375..104fd034d 100644 --- a/packages/dough/package.json +++ b/packages/dough/package.json @@ -31,7 +31,7 @@ "dependencies": { "@strudel/core": "workspace:*", "@strudel/webaudio": "workspace:*", - "dough-synth": "0.2.7" + "dough-synth": "0.2.8" }, "devDependencies": { "vite": "^6.0.11" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a8c6e82a6..50e3f0bfe 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -312,8 +312,8 @@ importers: specifier: workspace:* version: link:../webaudio dough-synth: - specifier: 0.2.7 - version: 0.2.7 + specifier: 0.2.8 + version: 0.2.8 devDependencies: vite: specifier: ^6.0.11 @@ -4072,8 +4072,8 @@ packages: resolution: {integrity: sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==} engines: {node: '>=12'} - dough-synth@0.2.7: - resolution: {integrity: sha512-Kj0tnDqu9Q8a9E8HepU5BN9lZcy+kYIYka7rn0o8NGfeSdxSe4m9luz7Hel0zqt33FCStk1nLPYsGmbdPfj3gA==} + dough-synth@0.2.8: + resolution: {integrity: sha512-Z5ibipaKr1cEkz95uXO89U2nBV+ytnm/9GR558YjPxS8QqtG/eTT239Bv1YoVg1nMH5a5dVh738sXFQ0BdWfvQ==} hasBin: true dset@3.1.4: @@ -11794,7 +11794,7 @@ snapshots: dotenv@16.4.7: {} - dough-synth@0.2.7: {} + dough-synth@0.2.8: {} dset@3.1.4: {} From c5fd80902bc0a286b75b2ff97f6069f0e2449490 Mon Sep 17 00:00:00 2001 From: Felix Roos Date: Wed, 26 Aug 2026 15:23:00 +0200 Subject: [PATCH 3/6] update dough to 0.3.0 + add group, voices, glide --- packages/dough/dough.mjs | 6 +++++- packages/dough/package.json | 2 +- pnpm-lock.yaml | 10 +++++----- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/packages/dough/dough.mjs b/packages/dough/dough.mjs index 908138bae..745bdf60b 100644 --- a/packages/dough/dough.mjs +++ b/packages/dough/dough.mjs @@ -4,12 +4,16 @@ Copyright (C) 2022 Strudel contributors - see . */ -import { register, noteToMidi } from '@strudel/core'; +import { register, noteToMidi, registerControl } from '@strudel/core'; import { Dough, doughsamples } from 'dough-synth'; import { getAudioContext, ensureMinimalOutput } from '@strudel/webaudio'; import wasm from 'dough-synth/dough.wasm?url'; import workletCode from 'dough-synth/dough.js?raw'; +export const { group } = registerControl('group'); +export const { voices } = registerControl('voices'); +export const { glide } = registerControl('glide'); + Object.assign(globalThis, { doughsamples }); let D; diff --git a/packages/dough/package.json b/packages/dough/package.json index 104fd034d..4fb496701 100644 --- a/packages/dough/package.json +++ b/packages/dough/package.json @@ -31,7 +31,7 @@ "dependencies": { "@strudel/core": "workspace:*", "@strudel/webaudio": "workspace:*", - "dough-synth": "0.2.8" + "dough-synth": "0.3.0" }, "devDependencies": { "vite": "^6.0.11" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 50e3f0bfe..6d42e108f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -312,8 +312,8 @@ importers: specifier: workspace:* version: link:../webaudio dough-synth: - specifier: 0.2.8 - version: 0.2.8 + specifier: 0.3.0 + version: 0.3.0 devDependencies: vite: specifier: ^6.0.11 @@ -4072,8 +4072,8 @@ packages: resolution: {integrity: sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==} engines: {node: '>=12'} - dough-synth@0.2.8: - resolution: {integrity: sha512-Z5ibipaKr1cEkz95uXO89U2nBV+ytnm/9GR558YjPxS8QqtG/eTT239Bv1YoVg1nMH5a5dVh738sXFQ0BdWfvQ==} + dough-synth@0.3.0: + resolution: {integrity: sha512-23mwuF0QZOGngsiB+H1EW9ZOV2kciqHBJpi2kjZoWYOATi2v43trpai2UoY6vtWUR6raeAKYmazm4+Z5Sh8eUA==} hasBin: true dset@3.1.4: @@ -11794,7 +11794,7 @@ snapshots: dotenv@16.4.7: {} - dough-synth@0.2.8: {} + dough-synth@0.3.0: {} dset@3.1.4: {} From 2cc9bf25681f811e2e9b77a1c6aec7f17e538af5 Mon Sep 17 00:00:00 2001 From: Felix Roos Date: Tue, 13 Oct 2026 18:37:29 +0200 Subject: [PATCH 4/6] update dough to 0.4.1 --- packages/dough/package.json | 2 +- pnpm-lock.yaml | 29 ++++++++++++++++++++++++----- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/packages/dough/package.json b/packages/dough/package.json index 4fb496701..7dc73a962 100644 --- a/packages/dough/package.json +++ b/packages/dough/package.json @@ -31,7 +31,7 @@ "dependencies": { "@strudel/core": "workspace:*", "@strudel/webaudio": "workspace:*", - "dough-synth": "0.3.0" + "dough-synth": "0.4.1" }, "devDependencies": { "vite": "^6.0.11" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 58eba5679..c4c045c9f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -318,8 +318,8 @@ importers: specifier: workspace:* version: link:../webaudio dough-synth: - specifier: 0.3.0 - version: 0.3.0 + specifier: 0.4.1 + version: 0.4.1 devDependencies: vite: specifier: ^6.0.11 @@ -4078,8 +4078,8 @@ packages: resolution: {integrity: sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==} engines: {node: '>=12'} - dough-synth@0.3.0: - resolution: {integrity: sha512-23mwuF0QZOGngsiB+H1EW9ZOV2kciqHBJpi2kjZoWYOATi2v43trpai2UoY6vtWUR6raeAKYmazm4+Z5Sh8eUA==} + dough-synth@0.4.1: + resolution: {integrity: sha512-hxBsfOBwTIlJMhSB/Pk2xNNc7YTAVTgexn5Y7GRv/Kn2qBkMxwLxHJNvhsUhklQhVvzny/aCihxb0EOq4tv5Bw==} hasBin: true dset@3.1.4: @@ -8030,6 +8030,18 @@ packages: utf-8-validate: optional: true + ws@8.22.0: + resolution: {integrity: sha512-Ydggc987+RO0AnWtZ/7Wq9FtNvcrL1b/RO0ud9mWjUPgDrsAAwQSF51sm2hm1XofbU/4jkpGEsLFsZZxU+1DOg==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: '>=5.0.2' + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + xmlcreate@2.0.4: resolution: {integrity: sha512-nquOebG4sngPmGPICTS5EnxqhKbCmz5Ox5hsszI2T6U5qdrJizBc+0ilYSEjTSzU0yZcmvppztXe/5Al5fUwdg==} @@ -11800,7 +11812,12 @@ snapshots: dotenv@16.4.7: {} - dough-synth@0.3.0: {} + dough-synth@0.4.1: + dependencies: + ws: 8.22.0 + transitivePeerDependencies: + - bufferutil + - utf-8-validate dset@3.1.4: {} @@ -16698,6 +16715,8 @@ snapshots: ws@8.18.3: {} + ws@8.22.0: {} + xmlcreate@2.0.4: {} xtend@4.0.2: {} From c398620439dfc678119191f0d56b907728e36ad7 Mon Sep 17 00:00:00 2001 From: Felix Roos Date: Tue, 13 Oct 2026 18:37:38 +0200 Subject: [PATCH 5/6] add groupmod + gmod --- packages/dough/dough.mjs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/dough/dough.mjs b/packages/dough/dough.mjs index 942e8fbe0..78ac4dc1b 100644 --- a/packages/dough/dough.mjs +++ b/packages/dough/dough.mjs @@ -4,7 +4,7 @@ Copyright (C) 2022 Strudel contributors - see . */ -import { register, noteToMidi, registerControl } from '@strudel/core'; +import { register, noteToMidi, registerControl, stack, Pattern } from '@strudel/core'; import { Dough, doughsamples } from 'dough-synth'; import { getAudioContext, ensureMinimalOutput } from '@strudel/webaudio'; import wasm from 'dough-synth/dough.wasm?url'; @@ -77,3 +77,12 @@ export const dough = register('dough', (pat) => { ensureMinimalOutput(); return pat.onSchedule(doughOutput); }); + +export const groupmod = register('groupmod', function (modulator, pat) { + const modpat = modulator + .withValue((vm) => pat.withValue(({ group }) => ({ ...vm, group }))) + .outerJoin() + .set({ dough: 'update_group' }); + return stack(pat.set(modulator), modpat); +}); +Pattern.prototype.gmod = Pattern.prototype.groupmod; From ff80bae275a89a8f2bd7385ac32db41d0dd80cd4 Mon Sep 17 00:00:00 2001 From: Felix Roos Date: Tue, 13 Oct 2026 20:52:05 +0200 Subject: [PATCH 6/6] move common dough things to lib.mjs --- packages/dough/dough.mjs | 29 +++++------------------------ packages/dough/lib.mjs | 28 ++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 24 deletions(-) create mode 100644 packages/dough/lib.mjs diff --git a/packages/dough/dough.mjs b/packages/dough/dough.mjs index 78ac4dc1b..4701ce205 100644 --- a/packages/dough/dough.mjs +++ b/packages/dough/dough.mjs @@ -4,15 +4,13 @@ Copyright (C) 2022 Strudel contributors - see . */ -import { register, noteToMidi, registerControl, stack, Pattern } from '@strudel/core'; +import { register } from '@strudel/core'; import { Dough, doughsamples } from 'dough-synth'; import { getAudioContext, ensureMinimalOutput } from '@strudel/webaudio'; import wasm from 'dough-synth/dough.wasm?url'; import workletCode from 'dough-synth/dough.js?raw'; - -export const { group } = registerControl('group'); -export const { voices } = registerControl('voices'); -export const { glide } = registerControl('glide'); +import { hap2dough } from './lib.mjs'; +export * from './lib.mjs'; Object.assign(globalThis, { doughsamples }); @@ -46,16 +44,8 @@ export async function doughOutput(hap, targetTime, cps = 1) { if (!offset) { return; // not ready } - hap.ensureObjectValue(); - const event = { - dough: 'play', - ...hap.value, - time: targetTime - offset, - duration: hap.duration / cps, - }; - if (typeof event.note === 'string') { - event.note = noteToMidi(event.note); - } + const t = targetTime - offset; + const event = hap2dough(hap, t, cps); D.evaluate(event); } @@ -77,12 +67,3 @@ export const dough = register('dough', (pat) => { ensureMinimalOutput(); return pat.onSchedule(doughOutput); }); - -export const groupmod = register('groupmod', function (modulator, pat) { - const modpat = modulator - .withValue((vm) => pat.withValue(({ group }) => ({ ...vm, group }))) - .outerJoin() - .set({ dough: 'update_group' }); - return stack(pat.set(modulator), modpat); -}); -Pattern.prototype.gmod = Pattern.prototype.groupmod; diff --git a/packages/dough/lib.mjs b/packages/dough/lib.mjs new file mode 100644 index 000000000..4ceb05441 --- /dev/null +++ b/packages/dough/lib.mjs @@ -0,0 +1,28 @@ +import { register, registerControl, stack, Pattern, noteToMidi } from '@strudel/core'; + +export const { group } = registerControl('group'); +export const { voices } = registerControl('voices'); +export const { glide } = registerControl('glide'); + +export const groupmod = register('groupmod', function (modulator, pat) { + const modpat = modulator + .withValue((vm) => pat.withValue(({ group }) => ({ ...vm, group }))) + .outerJoin() + .set({ dough: 'update_group' }); + return stack(pat.set(modulator), modpat); +}); +Pattern.prototype.gmod = Pattern.prototype.groupmod; + +export function hap2dough(hap, time, cps) { + hap.ensureObjectValue(); + const event = { + dough: 'play', + ...hap.value, + time, + duration: hap.duration / cps, + }; + if (typeof event.note === 'string') { + event.note = noteToMidi(event.note); + } + return event; +}