Compare commits

...

1302 Commits

Author SHA1 Message Date
Alex McLean 6c51c0261a Merge branch 'main' into stretchyboy-base-function 2026-06-21 20:45:05 +02:00
Felix Roos deefde7b50 hotfix: codeformat 2026-06-21 15:41:50 +02:00
froos d4f63e8de3 Merge pull request 'fix: cache bunny cdn urls #2057' (#2076) from cache-bunny into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/2076
2026-06-21 15:29:56 +02:00
alex 19cb3dedc2 snapshot 2026-06-21 14:02:34 +01:00
alex a7c3407da7 codeformat 2026-06-21 13:54:38 +01:00
Martyn Eggleton 6870b04fb2 Pretty code now 2026-06-21 13:49:11 +01:00
Alex McLean 2b2646a768 Merge branch 'main' into base-function 2026-06-21 14:34:18 +02:00
alex 97ef5bc335 Merge branch 'main' of ssh://codeberg.org/uzu/strudel 2026-06-19 21:30:17 +01:00
alex 85e6d436ef motors workshop page 2026-06-19 21:29:58 +01:00
alex d3e2b7c7b4 motors workshop page 2026-06-19 21:29:49 +01:00
alex def1738259 shortcuts for workshop 2026-06-19 21:29:25 +01:00
Alex McLean 0feeb1e701 Merge pull request 'Add growlist' (#2073) from growlist into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/2073
2026-06-18 13:25:38 +02:00
alex 813cc6c190 format 2026-06-18 12:04:03 +01:00
alex 62d4f84e69 add growlist 2026-06-18 10:55:34 +01:00
stretchyboy 49a1e11cd8 Merge branch 'main' into base-function 2026-06-17 13:58:30 +02:00
Felix Roos 941c97da0d fix: cache bunny cdn urls #2057 2026-06-15 09:15:06 +02:00
Alex McLean 95a9d301a1 Merge pull request 'midikeys-with-channel' (#2063) from eefano/strudel:midikeys-with-channel into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/2063
2026-06-10 13:38:02 +02:00
Martyn Eggleton 475f17ddfd base now accepts Arrays which improve compatibility with rockstar-strudel 2026-06-03 21:56:26 +01:00
Martyn Eggleton bd68c6a0a7 Documentation tweak 2026-06-03 12:36:41 +01:00
eefano 2635716c87 added midikeys third test 2026-06-02 14:56:55 +02:00
eefano 58f956b57e prettier fix 2026-06-02 14:29:28 +02:00
eefano 0ae2c120b3 updated documentation for midikeys 2026-06-02 13:28:23 +02:00
eefano 05a43ef687 included midichan value in midikeys haps 2026-06-02 13:14:30 +02:00
Martyn Eggleton f21aeb55bd The base param can be a pattern. We also add a max number of digits to produce for each n 2026-06-01 14:02:20 +01:00
Martyn Eggleton d83139980b Creates a pattern of numbers in base x from a number or pattern of numbers 2026-05-27 21:23:55 +01:00
Alex McLean 0c61cd7670 Merge pull request 'Don't force SSL for mqtt websocket connections' (#2058) from mqtt-ws into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/2058
2026-05-27 13:35:28 +02:00
alex 13b11efa15 don't force SSL for mqtt websocket connections - fall back on url instead (wss: for SSL, ws: for unencrypted) 2026-05-26 16:11:33 +01:00
froos f73b395648 Merge pull request 'Add error for when name arg in register is a pattern' (#2020) from tyow/localstrudel:registerErrorFix into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/2020
2026-05-07 11:46:59 +02:00
froos 9c47efd3cf Merge pull request 'docs: note that all/each require labeled patterns' (#2015) from bwagner/strudel:fix/all-unlabeled-pattern-docs into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/2015
2026-05-07 11:28:31 +02:00
froos f4066089f4 Merge pull request 'Add flux function' (#1528) from TodePond/strudel:lu/flux into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1528
2026-05-07 10:51:57 +02:00
Felix Roos 0e81987c4e Merge remote-tracking branch 'origin/main' into lu/flux 2026-05-07 10:36:11 +02:00
Felix Roos 23dbe53013 add snapshots 2026-05-07 10:32:58 +02:00
froos 0e4d0484a3 Merge pull request 'Fix the documentation of stretch' (#1670) from vvolhejn/strudel:vv/fix-stretch-docs into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1670
2026-05-07 09:32:37 +02:00
froos 37bf2e4dc7 Merge pull request 'Added .dockerignore' (#2005) from KuboOrk/strudel:docker/add-dockerignore into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/2005
2026-05-07 00:45:30 +02:00
froos e69761397e Merge pull request 'fix midi numbers as notes for osc backend' (#2001) from jagen31/strudel:jagen-midinote-osc into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/2001
2026-05-07 00:20:41 +02:00
froos 10c33f24f5 Merge pull request 'LFO documentation' (#2000) from scrappy_fiddler/strudel:lfo_docs into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/2000
2026-05-07 00:11:54 +02:00
Felix Roos ea0ec7edb9 fix format 2026-05-06 22:14:11 +02:00
froos f900642359 cross-reference signals page 2026-05-06 22:01:58 +02:00
froos 4cc63b8b01 Merge pull request 'fixed bug where withBase would silence a pattern if freq was unset' (#1994) from tyow/localstrudel:withbase-fix into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1994
2026-05-06 21:29:34 +02:00
Alex McLean 26832c0fe7 Merge pull request 'send manual deploy to cold.strudel.cc, and autodeploy to strudel.cc' (#2037) from move-domains into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/2037
2026-04-05 12:42:49 +02:00
alex 01abc8ae79 send manual deploy to cold.strudel.cc, and autodeploy to strudel.cc 2026-04-05 11:37:40 +01:00
Alex McLean 84df683794 Merge pull request 'colorless version display implementation' (#2029) from tyow/localstrudel:versionIndicator into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/2029
2026-04-05 12:12:57 +02:00
Alex McLean ca1aca0c00 Merge branch 'main' into versionIndicator 2026-04-05 12:12:20 +02:00
tyow e8668a1552 improved unofficial detection 2026-03-30 14:51:22 -04:00
tyow 86d65c72f0 colorless version display implementation 2026-03-30 14:39:14 -04:00
Aria 9f19e4616a Merge pull request 'Feature: Add replace and insert code helpers to codemirror' (#2021) from glossing/insert-code-helper into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/2021
2026-03-15 19:25:56 +01:00
Aria e15ce7d402 Add replace and insert code helpers to codemirror 2026-03-14 14:48:57 -05:00
Aria ef5ddc90c2 Merge pull request 'Bug Fix: Fix typo in phase computation' (#1974) from glossing/phases-bugfix into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1974
2026-03-14 20:44:37 +01:00
tyow ae32743f12 format 2026-03-13 14:11:38 -04:00
tyow 7294cd5443 Add error for when name arg in register is a pattern 2026-03-13 14:11:19 -04:00
Bernhard Wagner cdae661b24 docs: note that all/each require labeled patterns 2026-03-09 11:15:14 +01:00
Aria 28af99914f Merge branch 'main' into glossing/phases-bugfix 2026-03-03 18:42:33 +01:00
TodePond 63f42faca8 Update packages/core/pattern.mjs 2026-03-03 11:27:05 +01:00
Václav Volhejn 2624b97500 Merge branch 'main' of ssh://codeberg.org/vvolhejn/strudel into vv/fix-stretch-docs 2026-03-01 11:15:28 +01:00
Václav Volhejn 633b7287c0 Merge branch 'main' of ssh://codeberg.org/vvolhejn/strudel into vv/fix-stretch-docs 2026-03-01 11:13:14 +01:00
KuboOrk 3805ba8f76 Added .dockerignore 2026-02-28 13:39:07 +03:00
jagen31 82e88d4a28 fix midi numbers as notes for osc backend
note -> midinote
2026-02-23 01:24:53 +01:00
scrappy_fiddler 5cd45d5ea1 typo in lfo docs 2026-02-23 00:22:30 +01:00
scrappy_fiddler d930057000 lfo documentation 2026-02-23 00:18:42 +01:00
scrappy_fiddler daf27ed971 added lfo documentation 2026-02-23 00:11:17 +01:00
tyow 8520044f3e fixed bug where withBase would silence a pattern if freq was unset 2026-02-20 13:10:16 -05:00
froos 4a801ab668 Merge pull request 'fix bug where delaytime didn't appear in reference' (#1984) from tyow/localstrudel:delayt into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1984
2026-02-19 23:27:24 +01:00
froos 8f61a0aa90 Merge pull request 'getDuration' (#1980) from tyow/localstrudel:sampleDur into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1980
2026-02-19 23:26:21 +01:00
tyow 1e2705c07f format 2026-02-19 16:01:19 -05:00
tyow 3cefbf80bf moved to sampler 2026-02-19 13:59:30 -05:00
jeromew 81342fb469 Merge pull request '@strudel/transpiler plugin system' (#1985) from jeromew/strudel:transpiler-plugin into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1985
2026-02-19 17:43:31 +01:00
Felix Roos 761e2e347e refactor: localize, remove helpers file when there's no reuse 2026-02-18 23:47:47 +01:00
Felix Roos 3911142443 fix: remove outdated feature note 2026-02-18 20:56:41 +01:00
jeromew bc8517ade7 @strudel/transpiler plugin system 2026-02-18 10:57:25 +00:00
tyow a926346d89 fix bug where delaytime didn't appear in reference 2026-02-17 18:14:16 -05:00
tyow 0f4e6af49d fixed failing test 2026-02-16 17:16:00 -05:00
tyow c20a6673af Added getDuration, need to fix failing test 2026-02-15 16:58:35 +01:00
froos 6b00837a4d Merge pull request 'fix delaytime typo' (#1979) from tyow/localstrudel:delayt into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1979
2026-02-15 15:54:54 +01:00
tyow 807cce521c fix delaytime typo 2026-02-15 08:45:51 -05:00
froos aa49d9dcc2 Merge pull request 'fix: shuffle(1) returns source pattern' (#1968) from tyow/localstrudel:shuffleFix into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1968
2026-02-15 00:24:30 +01:00
froos 60da901952 Merge pull request 'move log2 from composer to registered function' (#1977) from tyow/localstrudel:log2 into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1977
2026-02-14 23:34:53 +01:00
froos 30cc92e863 Merge pull request 'Add packages/edo for edoScale() function' (#1430) from robmckinnon/strudel-edo-fork:main into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1430
2026-02-14 23:19:16 +01:00
froos 91203233c9 Merge pull request 'set and keep documentation' (#1975) from tyow/localstrudel:composerDocs into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1975
2026-02-14 22:49:53 +01:00
tyow c52e8f3b38 move log2 from composer to registered function 2026-02-14 16:40:02 -05:00
tyow d5dbc5c428 typo 2026-02-14 16:16:16 -05:00
tyow 161d2ce056 Added note about pattern alignment 2026-02-14 16:13:37 -05:00
tyow 7cb8a151a4 slight language change 2026-02-13 14:36:22 -05:00
froos 6f108f7f28 Merge pull request 'Edit prebake in settings' (#1958) from JohnBjrk/strudel:edit-prebake-in-settings into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1958
2026-02-13 17:13:37 +01:00
John Björk 7c607c8d06 fix: vim :q command 2026-02-13 16:21:50 +01:00
Felix Roos be0b3c0d8b fix: change default prebake to not use global effect (to prevent glitches) 2026-02-13 13:46:35 +01:00
Felix Roos d3e9b9c020 chore: localize 2026-02-13 13:45:52 +01:00
Felix Roos c16b300144 fix: shove prebake eval out of react 2026-02-13 13:40:51 +01:00
Felix Roos 29a3543918 chore: dedupe cx + cleanup 2026-02-13 13:40:13 +01:00
Felix Roos 1e502c7e8c chore: simplify 2026-02-13 13:21:50 +01:00
Felix Roos 27a22d7609 fix: shove logic out of react 2026-02-13 10:02:58 +01:00
Felix Roos c515ba89a0 fix: don't use id attribute in reusable component.. 2026-02-13 10:02:44 +01:00
Felix Roos 7e3063038e chore: minimize changes 2026-02-13 10:02:14 +01:00
Felix Roos 9bc560b17f fix: cleanup keybinding events 2026-02-13 09:37:34 +01:00
Felix Roos bdeafbaf75 fix: remove prebake specific logic in transpiler 2026-02-13 08:42:20 +01:00
Felix Roos 8984055ea6 fix: remove empty body error -> fall back to silence 2026-02-13 08:40:27 +01:00
Felix Roos 04dcbda9a3 fix: cleanup 2026-02-13 08:36:46 +01:00
tyow d7067f3562 typo 2026-02-12 22:55:30 -05:00
tyow a39c9e6096 Attempt at keep documentation 2026-02-12 21:52:54 -05:00
tyow 9690f78c30 Initial set documentation 2026-02-12 21:13:17 -05:00
Aria cf845ddbab Fix typo in phase computation 2026-02-12 18:30:50 -06:00
froos 3f72b9b97a Merge pull request 'fix: delaytime jsdoc' (#1973) from delaytime-fix into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1973
2026-02-12 00:35:15 +01:00
Felix Roos a347bd607f fix: delaytime jsdoc 2026-02-12 00:12:04 +01:00
yaxu 3966659f18 Update .forgejo/workflows/deploy-hot.yml 2026-02-09 21:25:21 +01:00
yaxu 6d9b899ae4 Update .forgejo/workflows/deploy-hot.yml 2026-02-09 20:56:48 +01:00
yaxu d802907dac Update .forgejo/workflows/deploy-hot.yml 2026-02-09 20:49:38 +01:00
yaxu 2bea102dc1 Update .forgejo/workflows/deploy-hot.yml 2026-02-09 16:04:11 +01:00
yaxu d9e5c5b0c8 See if it runs without this test.. 2026-02-09 15:59:47 +01:00
yaxu 7c1304690f Update .forgejo/workflows/deploy-hot.yml 2026-02-09 15:58:14 +01:00
yaxu 3c366b37ae Update .forgejo/workflows/deploy-hot.yml 2026-02-09 15:57:36 +01:00
Alex McLean 52a206ceca hotfix: try to serve PRs hot 2026-02-09 14:44:50 +00:00
John Björk 23f6ff9bc4 Moved evaluateUserPrebake 2026-02-08 22:47:56 +01:00
John Björk 3e1d02cb3d Added codemirrors deps to website
Moved codemirrors deps to catalog
Added deps to website
Changed deps in codemirror package to use catalog deps
2026-02-08 22:34:33 +01:00
tyow 8a72f21257 add test 2026-02-08 12:45:47 -05:00
froos 2755a7eebf Merge pull request 'Feature: reconnectable MIDI inputs that keep track of last known CC state' (#1852) from unframework/strudel:nm/midi-input-state into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1852
2026-02-08 11:22:27 +01:00
unframework deb69ced9f Fix setting that uses a specific MIDI channel 2026-02-08 06:26:44 +01:00
tyow d5a9019220 shuffleFix 2026-02-07 21:17:49 -05:00
John Björk d0d2459e14 Missed one import - thank you eslint 2026-02-07 23:30:35 +01:00
John Björk a60a54147c Moved PrebakeCodeMirror to its own file 2026-02-07 23:15:12 +01:00
Felix Roos 6707c7893b move prebake nav down 2026-02-07 21:51:00 +01:00
froos 1d0e2bd0c7 Merge pull request 'Added host as prefix to pattern export' (#1962) from JohnBjrk/strudel:add-host-prefix-to-pattern-export into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1962
2026-02-07 21:40:02 +01:00
froos b5ef12a2b1 Merge pull request 'Bug: Set active pattern to viewing on init' (#1961) from JohnBjrk/strudel:fix-active-viewing-pattern-out-of-sync into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1961
2026-02-07 21:38:37 +01:00
froos e3dd4ab126 Merge pull request 'coarse: handle non-integer parameters more smoothly' (#1964) from pulu/strudel:non-integer-coarse into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1964
2026-02-07 16:16:09 +01:00
miranda 751f924a4d coarse: handle non-integer parameters more smoothly 2026-02-07 16:53:06 +02:00
John Björk 7b58bbf12b Remove icon buttons 2026-02-05 16:49:23 +01:00
John Björk b2cfd3dc3d Use ctrl-enter also on mac 2026-02-05 16:49:23 +01:00
John Björk 9f2237e11d Prebake in settings
Update prebake without reload
2026-02-05 16:49:23 +01:00
John Björk 6d99a7f399 Added host as prefix to pattern export 2026-02-05 16:46:18 +01:00
John Björk 5921bec5f4 Set active pattern to viewing on init 2026-02-05 16:35:36 +01:00
froos b4e171f5b4 Merge pull request 'fix 'Maximum call stack size exceeded'' (#1951) from Dsm0/strudel:overflow_fix into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1951
2026-02-05 10:26:30 +01:00
froos 90ad12300a Merge pull request 'feat: Add Helix keybindings' (#1821) from space-shell/strudel:space-shell/helix-keybindings into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1821
2026-02-05 10:12:58 +01:00
froos ffc6d12d87 Merge pull request 'scale & xen parity' (#1955) from tyow/localstrudel:xen-feats into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1955
2026-02-05 09:47:21 +01:00
tyow 1334276ec0 format 2026-02-04 20:29:44 -05:00
tyow cbf472fe0a creation of i control for tune and xen functions 2026-02-04 20:28:19 -05:00
tyow 4439599117 Merge branch 'main' into xen-feats 2026-02-04 15:31:33 -05:00
tyow 32754ef97a formatting uzu/strudel#1944 2026-02-04 12:44:49 -05:00
tyow 67bce82a62 added jsdoc documentation for tune re uzu/strudel#1944 2026-02-04 12:44:35 -05:00
tyow 5da3ae8df4 prelim work on uzu/strudel#1944 2026-02-04 12:42:59 -05:00
tyow eb3818eebb formatting uzu/strudel#1944 2026-02-04 12:34:51 -05:00
tyow e6b824ebff added jsdoc documentation for tune re uzu/strudel#1944 2026-02-04 12:34:28 -05:00
tyow c74dd95bd0 prelim work on uzu/strudel#1944 2026-02-04 12:31:57 -05:00
tyow 897a750f70 tagging 2026-02-02 16:10:47 -05:00
tyow 81d02cf5ae format 2026-02-02 16:08:01 -05:00
tyow a6dc6bb831 withBase 2026-02-02 16:07:40 -05:00
tyow 00a3c1acc0 clarified an example 2026-02-02 13:40:48 -05:00
tyow 8ff51d4468 small fixes 2026-02-01 18:16:19 -05:00
tyow 2e041e8647 added xen example 2026-02-01 13:53:50 -05:00
tyow 55095ba4e8 added examples to ftrans 2026-02-01 13:34:22 -05:00
tyow 530f45a7bb format 2026-02-01 00:39:42 -05:00
tyow 99295275ec ftrans draft 2026-02-01 00:39:22 -05:00
tyow c2e45eb36c code format 2026-01-31 14:07:26 -05:00
tyow 35e32a32e8 added frequency rounding 2026-01-31 14:07:13 -05:00
tyow 8def3f6af6 add note about octave assumption uzu/strudel#1944 2026-01-31 14:06:50 -05:00
tyow aa3698c4f4 Small wording changes, bring up to date with main, uzu/strudel#1944 2026-01-31 14:06:50 -05:00
tyow 6b525b4819 formatting uzu/strudel#1944 2026-01-31 14:06:50 -05:00
tyow 77ced19144 added jsdoc documentation for tune re uzu/strudel#1944 2026-01-31 14:06:28 -05:00
tyow 14cc5d989b feat: added Tune scales to Xen, improved documentation re uzu/strudel#1944 2026-01-31 14:06:28 -05:00
tyow 47ad4bb171 minor: remove space between Xen and Harmonic re uzu/strudel#1944 2026-01-31 14:05:36 -05:00
tyow e3ad6b1f0a added documentation for xen() re: uzu/strudel#1944 2026-01-31 14:05:36 -05:00
tyow 1e771d6150 prelim work on uzu/strudel#1944 2026-01-31 14:05:36 -05:00
froos 3ac4649536 Merge pull request 'improve xen documentation' (#1946) from tyow/localstrudel:xen-docs into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1946
2026-01-31 10:02:54 +01:00
tyow 14be1ddf7f code format 2026-01-30 17:22:52 -05:00
tyow 207ce9cbec added frequency rounding 2026-01-30 16:59:33 -05:00
tyow 3abcc59874 adjust wording 2026-01-30 14:13:36 -05:00
tyow 7fc8f1c5c9 xen/scale parity improvements 2026-01-30 14:12:31 -05:00
Dsm0 016315afbc fix 'Maximum call stack size exceeded' 2026-01-28 17:06:16 -08:00
space-shell b3c0d9179f Merge branch 'main' into space-shell/helix-keybindings 2026-01-28 09:59:38 +01:00
froos 993dc53e92 Merge pull request 'fix: pickF / pickmodF with object lookup' (#1924) from robojumper/strudel:fix/pickF-object-name-lookup into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1924
2026-01-28 00:03:57 +01:00
robojumper 60345db1bd Fix pickF / pickmodF with object lookup 2026-01-27 23:16:29 +01:00
tyow a09349e457 add note about octave assumption uzu/strudel#1944 2026-01-26 17:52:25 -05:00
tyow 71f538b115 Small wording changes, bring up to date with main, uzu/strudel#1944 2026-01-26 17:50:38 -05:00
Alex McLean 70be560a7a Merge pull request 'block based eval' (#1714) from Dsm0/strudel:block-based-eval-squashed into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1714
2026-01-25 23:57:37 +01:00
Alex McLean 269758ebdb Merge branch 'main' into block-based-eval-squashed 2026-01-25 23:49:44 +01:00
froos 98d613fbdf Merge pull request 'add lots of synonyms' (#1801) from TodePond/strudel:lu/synonyms into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1801
2026-01-25 20:30:51 +01:00
Felix Roos f5e21a220b Merge remote-tracking branch 'origin/main' into lu/synonyms 2026-01-25 20:27:52 +01:00
froos f6e6df78a8 Merge pull request 'improve reference tags' (#1945) from reference-tagging into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1945
2026-01-25 14:14:36 +01:00
tyow 05ae80b0ca formatting uzu/strudel#1944 2026-01-24 14:30:15 -05:00
tyow 3bbaf77b20 added jsdoc documentation for tune re uzu/strudel#1944 2026-01-24 14:18:51 -05:00
Felix Roos a9975a2b41 reference: show synonyms in the same row, grayed out, instead of adding a row for each synonym 2026-01-24 02:01:36 +01:00
tyow 2b3f719484 feat: added Tune scales to Xen, improved documentation re uzu/strudel#1944 2026-01-23 18:09:03 -05:00
Felix Roos 4051fd5241 oh snap 2026-01-23 23:52:59 +01:00
Felix Roos 55ffb59b9c tagging a lot of superdough functions 2026-01-23 23:40:51 +01:00
tyow 93cf9fcb6a minor: remove space between Xen and Harmonic re uzu/strudel#1944 2026-01-23 17:18:38 -05:00
tyow a5b867f1b1 added documentation for xen() re: uzu/strudel#1944 2026-01-23 16:32:41 -05:00
tyow d8645e9a71 prelim work on uzu/strudel#1944 2026-01-23 13:36:20 -05:00
Felix Roos b824ad16ae Merge remote-tracking branch 'origin/main' into reference-tagging 2026-01-23 10:00:17 +01:00
space-shell 03b221a2a2 Merge branch 'main' into space-shell/helix-keybindings 2026-01-23 09:17:09 +01:00
froos 28db6d1fd4 Merge pull request 'clean up crumbs of crunchy design' (#1942) from stylez into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1942
2026-01-22 22:15:01 +01:00
Aria dc9cadc979 Merge pull request 'Feat: Make default alignment configurable' (#1941) from glossing/alignment into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1941
Reviewed-by: Switch Angel AKA Jade Rose <daslyfe@noreply.codeberg.org>
2026-01-22 21:50:28 +01:00
Felix Roos f99b13efc2 fix: zen mode lost border 2026-01-22 21:46:48 +01:00
Aria 0001d9c27b Change name to setDefaultJoin 2026-01-22 14:24:45 -06:00
Aria d79d122f68 Add docstring and example 2026-01-22 14:08:26 -06:00
Aria 6e61f3cdb6 Make default alignment configurable 2026-01-22 13:52:57 -06:00
Felix Roos 4993ec4cbf fix: console scroll to bottom on change + more logs + dont wrap 2026-01-22 20:40:35 +01:00
Felix Roos 8e5ca57edd cleanup + pending state 2026-01-22 20:29:03 +01:00
Felix Roos 107a3acd3a rename panel components + fix borders 2026-01-22 20:24:04 +01:00
Felix Roos 1d887e81ef fix: h-full 2026-01-22 20:18:59 +01:00
froos 7f2860eb14 Merge pull request 'crunch up layout' (#1938) from stylez into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1938
2026-01-22 10:28:08 +01:00
Felix Roos 3364b9f05f keep it simple stupid 2026-01-22 10:12:16 +01:00
Felix Roos f9ed71fbf8 fix: import sounds font size 2026-01-22 01:35:19 +01:00
Felix Roos e9ea0bc7cc fix: typo 2026-01-22 01:32:04 +01:00
Felix Roos a87daf3d21 fix: patterns tab performance 2026-01-22 01:31:23 +01:00
Felix Roos 784b9c08ec copmuted settings 2026-01-22 01:16:57 +01:00
Felix Roos 139b5376fc rebrand hide button row to hide footer 2026-01-22 01:16:22 +01:00
Felix Roos a052def314 piping hot (main menu in footer) + border around panel toggle 2026-01-22 00:35:04 +01:00
Felix Roos bcce1fa68a make move sidepanel one layer up, so tabs are at the top and the toggle doesn't float 2026-01-21 23:38:25 +01:00
Felix Roos 9a10cac8e9 fix bottom panel 2026-01-21 23:07:49 +01:00
Felix Roos cf999462b7 fix: export tab placeholder color 2026-01-21 23:02:14 +01:00
Felix Roos 9fc084b291 tweaks: consistent font sizes and row heights, persist selected reference tag, add wrap prop to ButtonGroup 2026-01-21 22:47:15 +01:00
Felix Roos cb46dd7840 make it crunchier: border borders, less padding 2026-01-21 01:31:25 +01:00
froos b684e183a0 Merge pull request 'add muted theme color + tweak pane styles' (#1936) from stylez into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1936
2026-01-21 00:27:43 +01:00
Felix Roos 84e4dde3d7 mini tweaks 2026-01-21 00:15:00 +01:00
Felix Roos 5f8d028d4f cleanup 2026-01-21 00:04:18 +01:00
Felix Roos e3abdd41c0 make panel toggle floating 2026-01-21 00:03:19 +01:00
Felix Roos bce6ffde08 cleanup + tweak bottom panel style 2026-01-20 23:36:09 +01:00
Felix Roos 35a3e32238 no bg on button group 2026-01-20 23:08:31 +01:00
Felix Roos 60b5024f63 remove panel hover + optimize bottom panel 2026-01-20 23:06:04 +01:00
Felix Roos 4f14ff00d5 responsiveness 2026-01-20 22:29:16 +01:00
Felix Roos 3d3130e880 fine tune 2026-01-20 22:19:32 +01:00
Felix Roos 83d542d06a proper strudel icon + toggle menu from top bar 2026-01-20 22:13:03 +01:00
Aria 6105d5027d Merge pull request 'Feat: Add retrig option for LFOs' (#1934) from glossing/lfo-retrig into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1934
2026-01-20 04:37:19 +01:00
Felix Roos 7e34069021 fix more font sizes 2026-01-20 01:06:07 +01:00
Felix Roos b75ca193a2 fix: font sizes 2026-01-20 01:01:20 +01:00
Felix Roos afac1f62ca fix: adapt color-theme attribute on root based on theme 2026-01-20 00:59:43 +01:00
Felix Roos de83805fd9 add muted theme color + use it for inputs and tags 2026-01-20 00:06:44 +01:00
Felix Roos 38b7bcb3d2 style tweaks 2026-01-19 23:00:14 +01:00
Dsm0 c96b1c2faf fixed anonymous label casing 2026-01-19 11:53:08 -08:00
Dsm0 87e723649e fixed highlighting issue 2026-01-19 11:53:08 -08:00
Aria 62bf9abed3 Add retrig option for LFOs 2026-01-19 09:52:49 -08:00
space-shell e35a2000de reverts changelog changes because human... 2026-01-19 10:15:10 +01:00
space-shell 4b8d80016b Remove trailin whitespace from CHANGELOG.md 2026-01-19 10:13:48 +01:00
space-shell d2f2c6df02 Merge branch 'main' into space-shell/helix-keybindings 2026-01-19 10:05:14 +01:00
froos 8ec1d4d034 Merge pull request 'fix: move kabelsalat web to superdough' (#1932) from fix-kabelsalat-dependency into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1932
2026-01-18 22:27:45 +01:00
Felix Roos 6981638f70 fix: move kabelsalat web to superdough 2026-01-18 22:04:49 +01:00
Felix Roos 9bcaaa3ac4 Merge branch 'main' into block-based-eval-squashed 2026-01-18 13:09:00 +01:00
froos f5823ce981 Merge pull request 'Add tags to reference' (#1645) from vvolhejn/strudel:radical-new-docs into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1645
2026-01-18 12:36:49 +01:00
Václav Volhejn f8750901f0 Tag the remaining functions 2026-01-18 12:16:50 +01:00
Václav Volhejn c1fd8c82c6 Merge branch 'radical-new-docs' of ssh://codeberg.org/vvolhejn/strudel into radical-new-docs 2026-01-18 12:08:17 +01:00
Václav Volhejn 6e36bdfff7 Add tags for some of the new functions 2026-01-18 12:08:12 +01:00
Felix Roos 8dbdd0a9b8 Merge branch 'main' into radical-new-docs 2026-01-18 10:39:53 +01:00
froos f4c0281613 Merge pull request 'fix: performance issues when reference is open' (#1926) from robojumper/strudel:fix/reference-performance-issue into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1926
2026-01-18 10:36:00 +01:00
Jade (Rose) Rowland f610965f43 Publish
- @strudel/codemirror@1.3.0
 - @strudel/csound@1.3.0
 - @strudel/midi@1.3.0
 - @strudel/repl@1.3.0
 - @strudel/soundfonts@1.3.0
 - superdough@1.3.0
 - @strudel/web@1.3.0
 - @strudel/webaudio@1.3.0
2026-01-17 19:12:20 -08:00
Jade (Rose) Rowland 17ef84ed70 sp 2026-01-17 19:11:08 -08:00
Jade (Rose) Rowland f0cb96dcad patch 2026-01-17 19:02:25 -08:00
Jade (Rose) Rowland f4f04a7d57 Publish
- @strudel/codemirror@1.2.8
 - @strudel/csound@1.2.8
 - @strudel/midi@1.2.8
 - @strudel/osc@1.3.2
 - @strudel/repl@1.2.9
 - @strudel/soundfonts@1.2.8
 - superdough@1.2.5
 - supradough@1.2.4
 - @strudel/web@1.2.8
 - @strudel/webaudio@1.2.9
2026-01-17 19:01:10 -08:00
Jade (Rose) Rowland a3ac9646f5 inc webaudio 2026-01-17 18:54:39 -08:00
Jade (Rose) Rowland 12b89f9f88 rollback supradough 2026-01-17 16:12:51 -08:00
Jade (Rose) Rowland 166985a055 spr 2026-01-17 16:00:34 -08:00
Jade (Rose) Rowland 85e787214b rollback_supradough 2026-01-17 15:59:38 -08:00
Jade (Rose) Rowland d198910a86 Publish
- @strudel/codemirror@1.2.7
 - @strudel/core@1.2.6
 - @strudel/csound@1.2.7
 - @strudel/draw@1.2.6
 - @strudel/embed@1.1.2
 - @strudel/gamepad@1.2.6
 - @strudel/hydra@1.2.6
 - @strudel/midi@1.2.7
 - @strudel/mini@1.2.6
 - mondolang@1.1.2
 - @strudel/mondo@1.1.6
 - @strudel/motion@1.2.6
 - @strudel/mqtt@1.2.6
 - @strudel/osc@1.3.1
 - @strudel/reference@1.2.2
 - @strudel/repl@1.2.8
 - @strudel/sampler@0.2.4
 - @strudel/serial@1.2.6
 - @strudel/soundfonts@1.2.7
 - superdough@1.2.7
 - supradough@1.2.5
 - @strudel/tonal@1.2.6
 - @strudel/transpiler@1.2.6
 - vite-plugin-bundle-audioworklet@0.1.2
 - @strudel/web@1.2.7
 - @strudel/webaudio@1.2.7
 - @strudel/xen@1.2.6
2026-01-17 15:26:28 -08:00
Aria 8ce6a881e6 Merge pull request 'Make kabelsalat stereo out' (#1927) from glossing/ks-stereo-out into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1927
2026-01-17 21:00:42 +01:00
Aria 7bc8576a68 Make kabelsalat stereo out 2026-01-17 11:16:58 -08:00
Václav Volhejn 99cf256ee2 Clean up 2 2026-01-17 20:11:26 +01:00
Václav Volhejn 42d0bfadce Clean up 2026-01-17 20:08:23 +01:00
Václav Volhejn 22f78fbb2f Merge branch 'radical-new-docs' of ssh://codeberg.org/vvolhejn/strudel into radical-new-docs 2026-01-17 19:24:41 +01:00
Václav Volhejn 77076a1c3e Improve reference search/filtering semantics 2026-01-17 19:12:23 +01:00
Václav Volhejn a1d31df556 Merge branch 'main' of ssh://codeberg.org/vvolhejn/strudel into radical-new-docs 2026-01-17 18:22:56 +01:00
robojumper f9d0e154e8 fix: performance issues when reference is open 2026-01-17 17:51:32 +01:00
froos bbe95b3995 Merge pull request 'update changelog + fix script to not miss entries' (#1916) from changelog-update into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1916
2026-01-16 10:38:03 +01:00
Felix Roos 2dc921e375 fix: add fun fact 2026-01-16 10:14:17 +01:00
Felix Roos 3d13955c41 fix: prefix usernames with @ 2026-01-16 10:08:41 +01:00
Felix Roos ae9638c353 update changelog + fix script to not miss entries 2026-01-16 09:58:14 +01:00
Dsm0 2e7ec9ea27 variable declarations with active patterns now have highlighting 2026-01-15 19:27:54 -08:00
froos 97cd3a5946 Merge pull request 'mondo fix: add registered functions to scope automatically' (#1896) from register_to_scope into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1896
2026-01-15 16:59:13 +01:00
froos ca3452bf52 Merge pull request 'Added docs for pattern search' (#1905) from JohnBjrk/strudel:pattern-search-docs into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1905
2026-01-15 16:58:13 +01:00
froos 7f528870b7 Merge pull request 'Update kabelsalat dependency' (#1911) from jeromew/strudel:kabelsalat into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1911
2026-01-15 16:57:18 +01:00
jeromew 60e5682829 Update kabelsalat dependency 2026-01-15 15:42:34 +00:00
Nick Matantsev bc9e97b9ac Add comments 2026-01-15 00:13:49 -05:00
Nick Matantsev 00f0ef56bc Merge remote-tracking branch 'origin/main' into nm/midi-input-state 2026-01-14 23:55:02 -05:00
Nick Matantsev 44ad05fb20 Whitespace fixes 2026-01-14 23:37:26 -05:00
Aria d605fbbde8 Merge pull request 'Bug Fix: Set pooled values immediately instead of scheduling' (#1907) from glossing/set-pooled-vals-immediately into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1907
2026-01-15 00:24:38 +01:00
Aria 21e6d81d34 Also set values immediately for supersaw and wavetable 2026-01-14 17:00:14 -06:00
Aria 85e79d9932 Set pooled values immediately instead of scheduling 2026-01-14 16:53:11 -06:00
John Björk 71dfbeea88 Fix markdown format 2026-01-14 22:35:10 +01:00
John Björk ffcab7bf6c Added docs for pattern search 2026-01-14 22:25:27 +01:00
Aria c3f6a1d6ba Merge pull request 'Feat: Kabelsalat integration' (#1876) from glossing/kabelsalat into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1876
2026-01-14 20:29:15 +01:00
Aria eb96d3ad63 Merge branch 'main' into glossing/kabelsalat 2026-01-14 19:08:20 +01:00
Aria 06e10cd693 Merge pull request 'Feat: MIDI Keyboard 🎹🐈' (#1828) from glossing/keyboard into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1828
2026-01-14 19:07:48 +01:00
Aria 80875cca95 Expose scheduler state and don't enqueue/trigger midi keys when repl stopped 2026-01-14 11:44:48 -06:00
Aria b954a25b2b Merge branch 'main' into glossing/keyboard 2026-01-14 18:15:31 +01:00
Aria cca346d2c2 Merge pull request 'Bug Fix: Fix race condition between worklet termination and port messages' (#1897) from glossing/diedack into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1897
2026-01-14 18:14:51 +01:00
Aria 3343c7bcf0 Merge branch 'main' into glossing/keyboard 2026-01-13 23:00:59 +01:00
Aria 6e3c5b23dd Merge branch 'main' into glossing/diedack 2026-01-13 21:30:58 +01:00
space-shell 18cc1e4466 Merge branch 'space-shell/helix-keybindings' of codeberg.org:space-shell/strudel into space-shell/helix-keybindings 2026-01-13 19:49:49 +01:00
space-shell 055f009357 feat: Refactor Vim/Helix keybindings with shared helper functions
Factor out the repl-eval and repl-stop event dispatching code into
replEval() and replStop() helper functions that are shared between
Vim and Helix keybindings.

This refactoring:
- Reduces code duplication between Vim :w/:q and Helix :w/:q commands
- Makes the keybinding handlers more maintainable
- Properly implements Helix commands using the commands.of() API
- Ensures consistent behavior across both keybinding modes

The Helix keybindings now properly integrate with the REPL using the
same event dispatch mechanism as Vim, dispatching custom repl-evaluate
and repl-stop events with fallbacks to keyboard events.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-13 19:47:12 +01:00
froos c12a77a0a1 Merge pull request 'Add search/filter in patterns tab' (#1842) from JohnBjrk/strudel:patterns-search into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1842
2026-01-13 04:06:50 +01:00
Felix Roos e5ab6b3c93 fix: short circuit 2026-01-13 03:47:33 +01:00
Felix Roos e82bb6c410 fix: use pattern.id as title fallback 2026-01-13 03:38:09 +01:00
Felix Roos 8b1fb12388 fix: class -> className 2026-01-13 03:32:19 +01:00
Aria 1f1f3288a6 Switch to tracking grace period in node pool; add negative begin and ends 2026-01-12 17:59:33 -06:00
Switch Angel AKA Jade Rose d642c0e12f Merge pull request 'Add shortcut for navigating through labels!' (#1807) from jade/dollar_shortcut into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1807
2026-01-13 00:18:08 +01:00
Aria 1eb657e6fe Merge branch 'main' into glossing/diedack 2026-01-12 20:58:34 +01:00
Aria 7c5f53f9ae Add ack message for worklet death; remove max pool size 2026-01-12 13:51:21 -06:00
Switch Angel AKA Jade Rose efe7c9394f Merge branch 'main' into jade/dollar_shortcut 2026-01-12 20:30:14 +01:00
Jade (Rose) Rowland 35bfd8b3ff curried 2026-01-12 11:28:54 -08:00
Jade (Rose) Rowland c2720a5738 working 2026-01-12 11:26:18 -08:00
Aria 5355a0c563 Ignore non-note messages 2026-01-11 23:34:52 -06:00
Alex McLean 75db9ff16e Merge pull request 'add warm.strudel.cc to faq' (#1891) from faq-warm into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1891
2026-01-12 00:17:36 +01:00
Aria 12cc1e9b5e Add immediate triggering; move time to schedulerState 2026-01-11 14:51:47 -06:00
Aria cd48e67675 Merge branch 'main' into glossing/kabelsalat 2026-01-11 19:59:21 +01:00
Aria 3a284696c9 Merge branch 'main' into glossing/keyboard 2026-01-11 19:59:13 +01:00
Felix Roos 753dc48b69 update changelog 2026-01-11 19:12:45 +01:00
froos 5ee5d4f1b1 Merge pull request 'Fix sounds example to work in the REPL' (#1851) from JesCoding/strudel:jescoding-patch-2 into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1851
2026-01-11 19:00:24 +01:00
alex 31cacc3c29 add warm to faq 2026-01-11 16:23:17 +00:00
JesCoding 8d2bca59c4 Fix sounds example to work in the REPL
`freq` only takes one argument, so switch this to mini-notation
so this can be used in the REPL as indicated in the paragraph below.
Make it so this can be played by the user.

Fix syntax-type typo.
2026-01-11 14:50:30 +00:00
froos f867cbce92 Merge pull request 'Improve hint text when sound search has no results' (#1883) from floy/strudel:improve-help-text-filtered into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1883
2026-01-11 13:52:01 +01:00
floy a659c89385 fix code formatting 2026-01-11 13:25:44 +01:00
Alex McLean 8290e99cf9 Merge pull request 'New page FAQ in "More"' (#1753) from scrappy_fiddler/strudel:documentation into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1753
2026-01-11 13:19:45 +01:00
froos e648ddd9ff Merge pull request 'fix: remove faulty default readme' (#1889) from trim-website-readme into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1889
2026-01-11 12:45:06 +01:00
Felix Roos 9ffd0e496f fix: all doc 2026-01-11 12:33:03 +01:00
Felix Roos 550d7ff6cb fix: react error 2026-01-11 12:32:54 +01:00
yaxu 85fd567fb2 Format and remove link to open document 2026-01-11 12:21:05 +01:00
scrappy_fiddler 20ea2980a2 Merge branch 'main' into documentation 2026-01-11 12:18:42 +01:00
froos af2d4784c6 Merge pull request 'fix/self-hosted-config' (#1880) from alienmind/strudel:fix/self-hosted-config into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1880
2026-01-11 12:15:32 +01:00
froos 526083d7c9 Merge pull request 'Feat: Support External AudioContext Injection' (#1833) from 1d10t/strudel:main into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1833
2026-01-11 12:07:47 +01:00
Alex McLean 8e792e1bfd Merge branch 'main' into documentation 2026-01-11 11:57:19 +01:00
yaxu f3e6f86857 Update website/src/pages/learn/faq.mdx
Trimmed all the DAW talk a little!
2026-01-11 11:55:40 +01:00
Felix Roos 25dbfe4c7d fix: remove faulty default readme 2026-01-11 11:43:04 +01:00
froos 0a586eddb3 Merge pull request 'fix: add trem to top level' (#1887) from trem-toplevel into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1887
2026-01-11 11:37:36 +01:00
froos b6d81ba2a0 Merge pull request 'fix: export start cycle min 0' (#1888) from fix-export-min-cycle into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1888
2026-01-11 11:37:17 +01:00
yaxu 8f3dc8daea Update website/src/pages/learn/faq.mdx 2026-01-11 11:34:55 +01:00
scrappy_fiddler ced434a1cf Merge branch 'main' into documentation 2026-01-11 11:20:51 +01:00
froos 96626fce25 Merge pull request 'fix: repl package init audio properly' (#1836) from fix-repl-audioworklet into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1836
2026-01-11 11:05:43 +01:00
Felix Roos c74707e804 fix: export start cycle min 0 2026-01-11 10:58:13 +01:00
Felix Roos 0174e08639 fix: add trem to top level 2026-01-11 10:50:44 +01:00
Switch Angel AKA Jade Rose af88471f6b Merge branch 'main' into jade/dollar_shortcut 2026-01-11 06:51:47 +01:00
Switch Angel AKA Jade Rose af855a0c77 Merge pull request 'Fix: show reload dialog when uploading prebake script' (#1886) from jade/reloaddialog into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1886
2026-01-11 06:51:23 +01:00
Switch Angel AKA Jade Rose f9a9993c42 Merge branch 'main' into jade/dollar_shortcut 2026-01-11 06:32:29 +01:00
Jade (Rose) Rowland 604a1b770c dialog 2026-01-11 00:27:07 -05:00
Switch Angel AKA Jade Rose 2aa978ca5b Merge pull request 'fixes Serial onTrigger() params #1633' (#1885) from gueejla/strudel:fix-serial-ontrigger into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1885
2026-01-11 06:01:41 +01:00
gueejla 0571a8dc7d fixes Serial onTrigger() params #1633 2026-01-10 22:11:13 -06:00
Switch Angel AKA Jade Rose a8a919f581 Merge pull request 'Perf: Targeted node pools' (#1810) from glossing/basic-node-pool into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1810
2026-01-10 23:12:47 +01:00
Switch Angel AKA Jade Rose bf21c4cf02 Merge branch 'main' into glossing/basic-node-pool 2026-01-10 22:58:28 +01:00
Jade (Rose) Rowland 741ff3f3f0 fix import 2026-01-10 16:55:53 -05:00
Jade (Rose) Rowland 4476921069 use releasenode 2026-01-10 16:46:11 -05:00
Aria 8c5e4a5780 Merge pull request 'Allow top level distortions for the purpose of FX' (#1884) from glossing/naked-distorts into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1884
2026-01-10 20:52:39 +01:00
Aria 34ae1bb305 Merge branch 'main' into glossing/naked-distorts 2026-01-10 20:38:34 +01:00
Aria 0cf11adc2c Allow naked distortions for the purpose of FX 2026-01-10 13:07:54 -06:00
Nick Matantsev 2fe1712dae Merge remote-tracking branch 'upstream/main' into nm/midi-input-state 2026-01-10 12:33:23 -05:00
Aria dab1676761 Add license for time file 2026-01-10 11:26:30 -06:00
Aria d753eedb90 Make latency consistent across all cps 2026-01-10 11:20:17 -06:00
Václav Volhejn 726e5ef14a Fix formatting 2026-01-10 07:18:29 -08:00
Václav Volhejn cc15e3cd36 Merge branch 'main' of ssh://codeberg.org/vvolhejn/strudel into radical-new-docs 2026-01-10 06:58:39 -08:00
floy fd0209dbc0 Show explicit help text when search doesn't match 2026-01-10 15:39:02 +01:00
Václav Volhejn 7c22b29493 Merge branch 'main' of ssh://codeberg.org/vvolhejn/strudel into vv/fix-stretch-docs 2026-01-10 06:34:34 -08:00
floy b4e00538f8 Don't show 'No sounds loaded' text if search is active 2026-01-10 15:30:07 +01:00
Jade (Rose) Rowland 7a5020aa71 format 2026-01-10 01:42:43 -05:00
Jade (Rose) Rowland a205f7d873 rm dead code 2026-01-10 01:42:06 -05:00
Jade (Rose) Rowland 0e9c50bf0a fix import 2026-01-10 01:39:39 -05:00
Jade (Rose) Rowland e837c516c5 merge main 2026-01-10 01:37:14 -05:00
Jade (Rose) Rowland 3b2e9fa0b4 wip 2026-01-10 01:22:50 -05:00
Jade (Rose) Rowland 6a47139e0d wip 2026-01-10 01:07:09 -05:00
Aria 4743334a17 Reduce latency; change name to midikeys; include in i/o learn page 2026-01-09 22:50:16 -06:00
Aria 7cff2050c8 Merge branch 'main' into glossing/kabelsalat 2026-01-09 23:38:25 +01:00
alienmind eefae851d5 fix malformed script src attributes 2026-01-09 16:26:32 +01:00
alienmind 40f9f4cde0 allow alternative URLs for self-hosted strudel 2026-01-09 16:26:32 +01:00
Aria f7f8c56c0a Merge pull request 'Bake in scaling by freq for FM with a gain node' (#1878) from glossing/fm-modulation into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1878
2026-01-09 03:43:35 +01:00
Aria c7e88e1ff2 Merge branch 'main' into glossing/fm-modulation 2026-01-09 03:31:26 +01:00
Aria f6a43f1b10 Make the scaling by freq in FM a separate node so that modulators behave like the fm control 2026-01-08 20:28:53 -06:00
Aria a3b183d304 Merge pull request 'Bug fix: Properly handle subcontrols' (#1877) from glossing/subcontrols into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1877
2026-01-09 02:53:37 +01:00
Aria f7175c0505 Properly handle subcontrols 2026-01-08 19:40:50 -06:00
Aria e6e96c8603 Fix release behavior; add multi-line example 2026-01-08 16:39:10 -06:00
Aria d4b3a3b972 Auto call functions in kabel; clean up end behavior of worklet; move kabel first in chain; write docstring 2026-01-08 12:31:26 -06:00
1d10t a1d1bd0e11 Merge branch 'main' into main 2026-01-08 09:44:32 +01:00
Aria fd2ff255e5 Don't include worklet in autocomplete; use empty object in pure for consistency 2026-01-07 22:59:54 -06:00
Aria 5903070c02 Test cleanup 2026-01-07 13:45:19 -06:00
Aria e92865cecb Handle mini notation without S 2026-01-07 13:32:12 -06:00
Aria a5c4fd5bc1 Merge branch 'main' into glossing/kabelsalat 2026-01-07 13:14:49 -06:00
Aria e26040d154 Merge pull request 'Feat: Add ability to turn mini parsing off with mini-off decorator' (#1786) from glossing/disable-mini into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1786
2026-01-07 20:06:17 +01:00
Aria 17a1b75e5b Merge branch 'main' into glossing/disable-mini 2026-01-07 19:22:35 +01:00
Aria 7df9688bb9 Merge pull request 'Bug Fix: Update loopStart/End to not be offset' (#1826) from glossing/sample-looping-bugfix into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1826
2026-01-07 19:22:22 +01:00
Aria 5caaf423ff Import kabelsalat, update transpiler to handle K and S, add worklet control 2026-01-07 12:19:16 -06:00
Aria d557bb59f0 Merge branch 'main' into glossing/disable-mini 2026-01-06 21:40:05 +01:00
Aria 679e81eb0f Merge branch 'main' into glossing/sample-looping-bugfix 2026-01-06 21:39:52 +01:00
yaxu 37dd834398 Update README.md 2026-01-06 16:33:06 +01:00
yaxu 959e8ac7bc Update README.md 2026-01-06 16:31:51 +01:00
Aria 16524ca805 Merge pull request 'Update modulator docstrings and allow ids to be patterns' (#1874) from glossing/pattern-ids-for-modulators into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1874
2026-01-06 06:35:47 +01:00
Aria b4b0194455 Update docstrings and allow modulator ids to be patterns 2026-01-05 23:17:40 -06:00
space-shell 0ef30d5e8d Merge branch 'main' into space-shell/helix-keybindings 2026-01-05 10:49:16 +01:00
1d10t 8f342262ab Merge branch 'main' into main 2026-01-05 00:37:28 +01:00
Alex McLean fd472a64d9 Merge pull request 'Fix doc link in @strudel/osc README.md' (#1872) from forrcaho/strudel:main into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1872
2026-01-04 17:14:10 +01:00
Forrest Cahoon 58094973b0 Fix doc link in @strudel/osc README.md 2026-01-04 09:39:17 -06:00
1d10t e82602af5a Merge branch 'main' into main 2026-01-04 13:24:39 +01:00
Aria db49b37780 Merge pull request 'Make stretch modulatable' (#1870) from glossing/stretch-node into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1870
2026-01-04 02:01:05 +01:00
Aria bf243c04b9 Make stretch modulatable 2026-01-03 18:27:11 -06:00
Sergey S Yaglov bfef9ba8d2 Merge remote-tracking branch 'upstream/main' 2026-01-04 00:14:23 +03:00
1d10t aa7ba6ae99 update webaudio to main branch 2026-01-03 22:01:37 +01:00
1d10t a86e5751eb reset audioContext to main branch 2026-01-03 21:55:16 +01:00
Aria bc05cffdbc Merge pull request 'Make pan modulatable' (#1865) from glossing/pan-fx into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1865
2026-01-02 18:44:52 +01:00
Aria 7b1e02e8cf Make pan modulatable 2026-01-02 11:43:27 -06:00
scrappy_fiddler 8d79715ce4 Merge branch 'main' into documentation 2026-01-02 00:30:21 +01:00
Alex McLean 257f09da4f Merge pull request 'Fix transpilation example to have same mini-notation' (#1850) from JesCoding/strudel:jescoding-patch-1 into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1850
2026-01-01 21:42:19 +01:00
Alex McLean ecd58fa501 Merge pull request 'fix: missing punctuation' (#1860) from eddyflux/strudel:fix-missing-punctuation into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1860
2026-01-01 21:39:03 +01:00
Aria c4ece4932e Merge pull request 'Fix formatting of docstring' (#1864) from glossing/fx-docstring into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1864
2026-01-01 20:20:33 +01:00
Aria 5c9855bf12 Merge branch 'main' into glossing/fx-docstring 2026-01-01 20:08:54 +01:00
Aria e54b9c3a32 Fix formatting of docstring 2026-01-01 13:07:38 -06:00
Aria 6afe0dc714 Merge pull request 'Feat: FX Chains' (#1861) from glossing/multifx-new into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1861
2026-01-01 19:52:14 +01:00
Aria ebaf7624f9 Fix lfos for vowels, phasers; fix ir index; more informative error message 2026-01-01 12:02:54 -06:00
John Björk aa8209ad4c Refactored handling of trim/lowercase based on PR comments 2026-01-01 12:22:52 +01:00
Aria 882bcc513f Typos and some examples 2025-12-31 15:17:06 -06:00
Aria aec33710b7 Working version 2025-12-31 14:58:31 -06:00
Dsm0 160ef84b47 move evaluate/evaluateBlock to different functions 2025-12-30 20:14:32 -06:00
Dsm0 1a7f464998 requested revisions 1 (and fix failing test) 2025-12-30 18:34:26 -06:00
eddyflux d41ebf190b fix: missing punctuation 2025-12-30 00:22:51 +01:00
Aria 7953fa61e4 Merge pull request 'Bugfix: Fix modulator clamping when min/max not specified' (#1859) from glossing/clamp-bugfix into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1859
2025-12-29 21:59:10 +01:00
Aria 6051b922c0 Fix clamping when min/max not specified 2025-12-29 14:45:49 -06:00
Aria 367e07da0c Merge pull request 'Feature: LFOs and Envelopes' (#1507) from glossing/strudel:glossing/lfo-anything into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1507
2025-12-29 20:54:10 +01:00
Aria 0edede106a Fixes for zzfx and soundfonts 2025-12-29 13:28:26 -06:00
Aria b6264a1513 Merge branch 'main' into glossing/lfo-anything 2025-12-29 20:00:29 +01:00
Aria 680b7d78ec Lots of examples; use id instead of index; waveshaper clamping; one mode for synth 2025-12-29 12:59:48 -06:00
Aria e79b4b8ccb Refactor modulators 2025-12-29 10:41:20 -06:00
Aria 98367868ac Handle min/max when target is LFO; fix vib and tremolo 2025-12-29 10:22:48 -06:00
scrappy_fiddler b648961d30 Merge branch 'main' into documentation 2025-12-29 16:28:57 +01:00
froos 616bc64e70 Merge pull request 'Fix AudioContext change detection. Use AudioNode.context' (#1858) from jeromew/strudel:fix-scope into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1858
2025-12-29 16:07:16 +01:00
jeromew c0f4f47150 Fix AudioContext change detection. Use AudioNode.context 2025-12-29 14:04:40 +00:00
Aria b4496fcc24 More control mapping tweaks 2025-12-28 21:43:08 -05:00
Aria 48f6a41683 Extend to FM, vibrato, etc 2025-12-28 20:13:15 -05:00
froos 7bce739068 Merge pull request 'Say that @license should use SPDX identifier' (#1817) from Wuzzy/strudel:clarify_at_license into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1817
2025-12-28 22:58:37 +01:00
froos 06f9c2dfb5 Merge pull request 'Expose Vim object in order to create custom keybindings' (#1816) from JohnBjrk/strudel:expose-vim-for-custom-keybindings into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1816
2025-12-28 22:56:05 +01:00
Felix Roos 30fe5b47e3 hotfix: fix scope and friends #1847 2025-12-28 22:42:42 +01:00
Alex McLean 1823993e7c Merge branch 'main' into jescoding-patch-1 2025-12-28 17:53:50 +01:00
froos 1935195e9a Merge pull request 'dough repl fixes' (#1855) from vanillarepl into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1855
2025-12-28 14:20:02 +01:00
Felix Roos 300a1bbfd5 fix: actually load code from url 2025-12-28 14:07:27 +01:00
froos 2f43dcab0c Merge pull request 'add basic dough repl' (#1749) from vanillarepl into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1749
2025-12-28 13:40:28 +01:00
Felix Roos 125eece223 fix: import 2025-12-28 13:20:22 +01:00
Felix Roos 53e49952d8 persist code in hash 2025-12-28 13:10:57 +01:00
Felix Roos e286ab2830 no default samples for now + add doughsamples to scope 2025-12-28 13:10:37 +01:00
Felix Roos e4e2d60b28 Merge branch 'main' into vanillarepl 2025-12-28 12:58:45 +01:00
Aria 99bec835f8 Merge branch 'main' into glossing/lfo-anything 2025-12-27 20:54:39 -05:00
Nick Matantsev ee326c709e Fix MIDI input logging 2025-12-25 21:43:06 -05:00
Nick Matantsev a0291e8a42 Fix comments 2025-12-25 21:07:39 -05:00
Nick Matantsev ecada58edc Carry out MIDI input wrapper into dedicated file 2025-12-25 20:59:50 -05:00
Nick Matantsev bb7f587025 Encapsulate more logic 2025-12-25 20:42:11 -05:00
Nick Matantsev dab1a018e4 Support delayed connection and reconnection of MIDI inputs 2025-12-25 20:42:11 -05:00
Nick Matantsev 0c01a997ac Avoid referencing found MIDI device name 2025-12-25 20:42:11 -05:00
Nick Matantsev b8dc50267e Clean up unused state fields 2025-12-25 20:42:11 -05:00
Nick Matantsev 1aaa04ab50 Send stored CC values to controller 2025-12-25 20:42:11 -05:00
Nick Matantsev 1860d31624 Tweak cc init 2025-12-25 20:42:11 -05:00
Nick Matantsev 47557cf06f Move device lookup inside input wrapper 2025-12-25 20:42:11 -05:00
Nick Matantsev 213edfb211 Roll up save/load state into MIDI wrapper 2025-12-25 20:42:11 -05:00
Nick Matantsev 84e59645fd Encapsulate MIDI input handling 2025-12-25 20:42:11 -05:00
Nick Matantsev 4df19f9ff8 Save MIDI-in CC state 2025-12-25 20:42:11 -05:00
JesCoding d349d2a0cd Fix transpilation example to have same mini-notation
This was introduced in https://codeberg.org/uzu/strudel/commit/66f8ca72c1b364f72f25b8cff041cac13b380432
2025-12-24 10:38:21 +01:00
Dsm0 ba7721f53c code formatting 2025-12-23 02:25:18 -08:00
Dsm0 fd1e3d248a block based eval 2025-12-23 01:47:06 -08:00
scrappy_fiddler fc2f5accfe Merge branch 'main' into documentation 2025-12-22 14:05:24 +01:00
space-shell bad81e3850 Merge branch 'main' into space-shell/helix-keybindings 2025-12-22 13:01:22 +01:00
Wuzzy c7a2c2bb9c Say that @license should use SPDX identifier 2025-12-21 10:47:01 +01:00
John Björk 6908ea38e4 Added search/filter in patterns tab
Added pattern as dep to filter memo

Format
2025-12-20 23:10:01 +01:00
froos 5a51b4ec71 Merge pull request 'Document "-" in mini-notation' (#1818) from Wuzzy/strudel:dashtilde into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1818
2025-12-20 22:27:50 +01:00
froos 3922defab9 Merge pull request 'simplify envValAtTime and remove asymmetric behavior (fix #1653)' (#1815) from pulu/strudel:remove-env-asymmetry into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1815
2025-12-20 22:20:26 +01:00
John Björk a9752fb2a4 Exposing Vim from codemirror-vim
Docs for adding keybindings

Only expose Vim from keybindings
2025-12-20 17:20:38 +01:00
froos 0a2f2eaa3d Merge pull request 'fix: visual block selection mode for vim bindings' (#1839) from Dsm0/strudel:visual-block-mode-fix into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1839
2025-12-19 08:11:49 +01:00
Dsm0 0de212c12f fix visual block mode 2025-12-18 22:55:44 -08:00
Felix Roos 181ebee374 fix: repl package init audio properly 2025-12-19 01:25:58 +01:00
froos b376b2616a Merge pull request '[perf] Add audiograph await debugAudiograph() feature' (#1763) from jeromew/strudel:audiograph into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1763
2025-12-19 01:03:52 +01:00
froos 56ecb006fa Merge pull request 'Feature: non-realtime exporting' (#1674) from BANanaD3V/strudel:feat/non-realtime-exporting into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1674
2025-12-19 00:45:39 +01:00
scrappy_fiddler e6c1e97838 Merge branch 'main' into documentation 2025-12-17 20:44:07 +01:00
space-shell a409149dae Merge branch 'main' into space-shell/helix-keybindings 2025-12-15 13:48:44 +01:00
space-shell a6b3b9ef5e updates formatting 2025-12-15 13:22:13 +01:00
Aria 2748189f18 Merge pull request 'Fix: wrong warning in build environments' (#1835) from jeromew/strudel:onenced-warning into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1835
Reviewed-by: Aria <glossing@noreply.codeberg.org>
2025-12-14 19:33:36 +01:00
Alex McLean 63d254daf4 Merge pull request 'delta -> tight/tightx/loose refinements' (#1832) from delta into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1832
2025-12-14 15:09:10 +01:00
jeromew 34991e9602 Fix: wrong warning in build environments 2025-12-14 11:27:41 +00:00
Aria 8df5c80d82 Merge pull request 'Improved randomness' (#1505) from glossing/strudel:glossing/random into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1505
2025-12-14 01:07:35 +01:00
Aria e0344dbd67 Simple seeding for this first iteration 2025-12-13 17:49:19 -06:00
Aria 931d684b19 Merge branch 'main' into glossing/random 2025-12-13 17:28:44 -06:00
Aria 4a7344595d Make legacy the default 2025-12-13 17:28:42 -06:00
Aria 18b3c66eb8 Clean up error messages 2025-12-13 17:15:06 -06:00
Aria 63de46ae96 Update docstrings 2025-12-13 16:44:36 -06:00
Aria c598059dc7 Clean up old code 2025-12-13 16:26:50 -06:00
Aria dec037bed5 Bus fix 2025-12-13 16:23:47 -06:00
Aria 29f7f5c1f8 Allow lfos to modulate other lfos without clamping 2025-12-13 16:07:19 -06:00
Aria bae5571df0 Cleanup 2025-12-13 15:32:27 -06:00
Aria 4b08dd8447 Unify lfo functions 2025-12-13 15:20:51 -06:00
Aria 11e3da0552 Parity with other LFO (sync and dcoffset) 2025-12-13 15:08:48 -06:00
Aria ef2ee0969a Restore old lfo to avoid unifying right now 2025-12-13 14:59:14 -06:00
Aria 12f9af227c Merge branch 'main' into glossing/lfo-upgrades 2025-12-13 14:54:17 -06:00
Aria dc5f6827f9 Change names, cleanup 2025-12-13 14:50:27 -06:00
Aria 8baecf78b9 Add note 2025-12-13 11:37:37 -06:00
alex 8eeebf1e4f try renaming to per / perx / cyclesPer 2025-12-13 16:30:51 +00:00
Sergey S Yaglov adf9596d07 codestyle(webaudio) 2025-12-13 00:28:13 +03:00
1d10t 4e14718e93 feat(webaudio): enable AudioContext sharing for webaudioRepl
- Add support for optional `existingAudioCtx` parameter in `webaudioRepl()` function
- When provided, sets it as the default AudioContext via `setDefaultAudioContext()`
- Allows integration with external systems that manage their own Web Audio API context
- Maintains backward compatibility with existing usage patterns
2025-12-12 21:56:31 +01:00
1d10t 2998de8426 Merge pull request 'feat(superdough/audiocontext): make AudioContext injection optional' (#1) from 1d10t-patch-1 into main
Reviewed-on: https://codeberg.org/1d10t/strudel/pulls/1
2025-12-12 21:28:40 +01:00
1d10t c8b2e1ac9e feat(superdough/audiocontext): make AudioContext injection optional
- Modify `setDefaultAudioContext()` to accept an optional `existingAudioCtx` parameter.
- If provided, it will use the existing context; otherwise, it creates a new one.
- This allows for better integration with external audio systems that manage their own AudioContext.
2025-12-12 21:22:21 +01:00
alex c7789a09e3 Merge branch 'delta' of ssh://codeberg.org/uzu/strudel into delta 2025-12-12 16:50:48 +00:00
alex a53385aa11 delint 2025-12-12 16:50:24 +00:00
Alex McLean 0a5fb8ca1d Merge branch 'main' into delta 2025-12-12 17:49:14 +01:00
alex 99e4999e6a snapshot 2025-12-12 15:46:19 +00:00
alex cd071cb7c0 separate out signal tests, add tests for tight, tightx, loose 2025-12-12 15:46:04 +00:00
alex 8e1fba0436 rename delta to loose, add inverse tight, and exponential tightx 2025-12-12 15:45:36 +00:00
Felix Roos f4df4f679f Merge branch 'main' of https://codeberg.org/uzu/strudel 2025-12-12 15:12:45 +01:00
Alex McLean 1d2a3bdb9c Merge pull request 'Add delta signal for representing the duration of events in patterns that are combined with it' (#1831) from delta into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1831
2025-12-12 10:28:25 +01:00
alex c6e0f0533e add delta 2025-12-11 23:32:10 +00:00
Aria 415b6d5f1d Fix name collision and move modulators into controls to avoid circular import test failure 2025-12-11 15:48:45 -06:00
Aria 4169b764c3 Simpler control handling 2025-12-11 15:28:48 -06:00
Aria e7d1613bfb Broken tests, but otherwise working 2025-12-11 14:42:16 -06:00
Aria 45aa1f5384 Control cleanup 2025-12-11 12:52:40 -06:00
Aria 3a17aeabf3 Some cleanup 2025-12-11 11:41:40 -06:00
Aria 2aeba2e53f Working version of bus 2025-12-11 11:37:20 -06:00
Alex McLean 3608f1ca25 Merge pull request 'Feature: stateful timeline function for jumping between timelines' (#1669) from alternative-timeline into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1669
2025-12-11 18:00:48 +01:00
alex 37990b459f bugfix and tweak doc 2025-12-11 16:51:25 +00:00
alex a34e58aa09 Merge branch 'alternative-timeline' of ssh://codeberg.org/uzu/strudel into alternative-timeline 2025-12-11 16:39:22 +00:00
alex 8cbe4b945c Respond to glossing's review 2025-12-11 16:39:08 +00:00
Alex McLean 6f9a1470e7 Merge branch 'main' into alternative-timeline 2025-12-11 17:19:03 +01:00
Alex McLean 8a3719752f Merge pull request 'Updates relating to LLM, github, etc' (#1830) from llm-guidance into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1830
2025-12-11 16:37:57 +01:00
alex 96835be056 tweaks 2025-12-11 15:07:57 +00:00
alex 960f1de9d2 tweaks 2025-12-11 12:16:54 +00:00
alex 12884cba3a Updates relating to LLM, github, etc 2025-12-11 12:09:26 +00:00
Aria 103b27c21f Working version of keyboard with variable lengths; tests and cleanup 2025-12-10 13:44:49 -06:00
Aria 597c941991 Add keyboard function 2025-12-10 12:01:04 -06:00
Alex McLean 20c513d649 Merge pull request 'fix .as so it doesn't set undefined values' (#1827) from fix-as into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1827
2025-12-10 15:32:43 +01:00
alex e89414e400 fix .as so it doesn't set undefined values 2025-12-10 09:19:12 +00:00
Aria a79491dd16 Update loopbegin/end to not be offset 2025-12-08 16:32:54 -06:00
Aria 765de9daf3 Merge pull request '[perf] propagate onceEnded and releaseAudioNode' (#1809) from jeromew/strudel:fix-perf12 into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1809
Reviewed-by: Aria <glossing@noreply.codeberg.org>
2025-12-08 19:27:30 +01:00
jeromew 132dea8478 Merge branch 'main' into fix-perf12 2025-12-08 18:54:51 +01:00
jeromew b889d19493 Merge branch 'fix-perf12' of https://codeberg.org/jeromew/strudel into fix-perf12 2025-12-08 17:32:47 +00:00
jeromew 71d36b79ed Improve getOscillator/noiseMix release 2025-12-08 17:31:34 +00:00
space-shell ec73c48e2e feat: Add Helix keybindings and Nix development environment
Add support for Helix editor keybindings in the REPL, providing users
with a modern, selection-first modal editing experience as an alternative
to Vim, Emacs, and VSCode keybindings.

Helix Keybindings Integration:

- Add codemirror-helix@^0.5.0 dependency to @strudel/codemirror
- Import and register helix keybindings in keybindings.mjs
- Add 'Helix' option to keybindings selector in Settings UI
- Create comprehensive user documentation at technical-manual/helix.mdx
- Update developer documentation with keybinding integration pattern

The Helix mode provides selection-first editing (select → action) which
differs from Vim's action-motion paradigm, offering an alternative
workflow for modal editing enthusiasts.

Documentation:

- Update CLAUDE.md with Helix support and keybinding addition process
- Create helix.mdx with user-facing documentation and command reference
- Update CHANGELOG.md with December 2025 entry

Testing:

Run `pnpm i` to install new dependencies, then `pnpm dev` to test.
Verify Helix mode works in Settings → Keybindings → Helix.
2025-12-08 09:44:02 +01:00
Aria d7bf5db8be Merge pull request 'Feat: Add channel support to midi in' (#1775) from glossing/midin-channels into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1775
2025-12-07 21:51:39 +01:00
Aria 48231ea12a Merge branch 'main' into glossing/midin-channels 2025-12-07 21:23:57 +01:00
Aria c8a442234e Merge pull request 'Feat: Transient shaper' (#1777) from glossing/transient-processor into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1777
2025-12-07 21:23:42 +01:00
Aria efda32eedb Merge branch 'main' into glossing/transient-processor 2025-12-07 20:29:50 +01:00
Aria 95d04d1149 Merge branch 'main' into glossing/midin-channels 2025-12-07 20:29:39 +01:00
Aria 358b1e3f56 Make sure processor turns off; fix array sizes for JIT 2025-12-07 13:28:57 -06:00
Aria fe7e8f7add Clearer docstring 2025-12-07 13:21:06 -06:00
Aria 45d329d3d1 Merge pull request 'Add vel as a synonym for velocity & update a few docstrings' (#1781) from glossing/controls-various into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1781
2025-12-07 19:15:42 +01:00
Aria 5e99393f5a Merge branch 'main' into glossing/controls-various 2025-12-07 18:54:18 +01:00
Aria 9650c8eb50 Merge pull request '[perf] fix phaser leak of unused biquads' (#1800) from jeromew/strudel:fix-perf10 into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1800
Reviewed-by: Aria <glossing@noreply.codeberg.org>
2025-12-07 18:53:03 +01:00
Aria fab8d2193d Merge branch 'main' into glossing/midin-channels 2025-12-07 18:45:16 +01:00
Aria 150835aa4d Merge branch 'main' into glossing/transient-processor 2025-12-07 18:45:11 +01:00
Aria 76237016a3 Merge branch 'main' into glossing/controls-various 2025-12-07 18:45:02 +01:00
Aria 6f4d8ebacf Merge branch 'main' into fix-perf10 2025-12-07 18:44:47 +01:00
Aria 4374bdf1bd Merge branch 'main' into fix-perf12 2025-12-07 18:44:38 +01:00
Aria 3cecf4a50e Merge pull request 'Bug fix: Remove failing tests due to shabda removal' (#1820) from glossing/shabda-test-fix into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1820
2025-12-07 18:42:49 +01:00
Aria 16b5faf333 Removing failing tests due to shabda removal 2025-12-07 11:23:55 -06:00
Aria c4826b7dfb Merge branch 'main' into glossing/midin-channels 2025-12-07 18:11:59 +01:00
Aria bd61c1dc7e Merge branch 'main' into glossing/transient-processor 2025-12-07 18:11:50 +01:00
Aria ceb3aa797d Merge branch 'main' into glossing/controls-various 2025-12-07 18:11:39 +01:00
Aria 9b3277da1c Merge branch 'main' into fix-perf10 2025-12-07 18:09:00 +01:00
Wuzzy 53c101005c Document "-" in mini-notation 2025-12-07 00:12:40 +01:00
Aria 82ca77be9d Working version 2025-12-06 12:02:11 -06:00
scrappy_fiddler 6402ad5d37 better linebreak in example 2025-12-06 16:55:57 +01:00
scrappy_fiddler ab03ece2b7 prettier 2025-12-06 16:48:40 +01:00
miranda 173e359a65 simplify envValAtTime and remove asymmetric behavior (fix #1653) 2025-12-06 17:46:16 +02:00
scrappy_fiddler bd282f439a everyone wants that trancegate 2025-12-06 16:37:39 +01:00
scrappy_fiddler 177c3a4a2e some items from review 2025-12-06 16:36:25 +01:00
Aria ad43259353 Switch to omod 2025-12-05 13:39:52 -06:00
Aria 32924b3fcf Merge branch 'main' into glossing/lfo-anything 2025-12-05 10:47:17 -06:00
scrappy_fiddler d4d9b4f543 Merge branch 'main' into documentation 2025-12-05 10:22:52 +01:00
Aria 4c99f4866b Use setvalueattime to pin values and prevent bleed 2025-12-04 22:50:28 -06:00
Aria d50af71ba1 Merge branch 'main' into glossing/basic-node-pool 2025-12-04 14:20:41 -06:00
Aria 0664f90178 Remove old comment 2025-12-04 13:07:13 -06:00
Aria 4321814d36 Working version for compressor, filter, supersaw, wavetable 2025-12-04 13:04:33 -06:00
Aria 6610713018 Working version of supersaw, almost on wavetable 2025-12-04 12:40:28 -06:00
Aria 600ab0a83e WIP with compressors, filters, heavy worklets 2025-12-04 12:17:07 -06:00
jeromew 1225d04437 codeformat 2025-12-04 15:29:21 +00:00
jeromew f6f507dd29 propagate releaseAudioNode in packages 2025-12-04 15:26:59 +00:00
jeromew c7586e96ff Add comment on end worklet param 2025-12-04 13:20:17 +00:00
jeromew 46291bf85c Difuse the onceEnded mechanism 2025-12-04 13:17:20 +00:00
jeromew d7e240e2dc Add PeriodicWave & VowelNode support 2025-12-04 12:56:54 +00:00
jeromew 0b711e879c Improve naming & backward compat 2025-12-04 08:23:36 +00:00
Jade (Rose) Rowland f0aac2098a update_shortcut 2025-12-03 22:59:20 -05:00
Jade (Rose) Rowland c1a185e852 fix null case 2025-12-03 15:25:05 -05:00
Jade (Rose) Rowland b9fce15042 working 2025-12-03 15:18:32 -05:00
Aria e01621d0cc Merge pull request 'Feature: Eight FMs' (#1628) from glossing/strudel:glossing/fmsss into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1628
2025-12-03 18:27:27 +01:00
Aria 196f70ab6b Formatting 2025-12-03 11:13:21 -06:00
Aria 1d4f2b81d8 Switch back to explicit exports and use new release mechanism 2025-12-03 11:12:30 -06:00
Aria d28c8dac8e Merge branch 'main' into glossing/fmsss 2025-12-03 10:42:35 -06:00
Aria eb18648a2a Merge pull request '[perf] release unused AudioBufferSourceNode + releaseAudioNode' (#1805) from jeromew/strudel:fix-perf11 into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1805
Reviewed-by: Aria <glossing@noreply.codeberg.org>
2025-12-03 17:35:03 +01:00
jeromew 25c20296a1 Tone down log message when a pure orphan node is found 2025-12-02 13:58:09 +00:00
jeromew 2db30a710b Fix codeformat 2025-12-02 13:54:27 +00:00
jeromew 71d1fe99e4 Fix special case for FeedbackDelayNode 2025-12-02 13:51:16 +00:00
jeromew 0ec9826de5 onceEnded mechanism to clean audioNode.onended callbacks 2025-12-02 09:29:50 +00:00
jeromew af7855402f Accept non-instanciated nodes for better developer experience 2025-12-01 20:43:55 +00:00
scrappy_fiddler 39bff8900f website/src/pages/learn/faq.mdx aktualisiert
updated the section on switch angel's prebake. Now refers to the readme for instructions.
2025-12-01 18:22:26 +01:00
jeromew 68b1cb87ca [perf] release unused AudioBufferSourceNode + releaseAudioNode 2025-12-01 15:29:19 +00:00
jeromew 05ed16e158 Add stop-leak detection. Stoppable nodes that are not stopped 2025-11-30 17:50:56 +00:00
jeromew 24b69ad1bc [perf] Add audiograph await debugAudiograph(); tool 2025-11-30 14:09:03 +00:00
Nikita 5bddb6f48d Move export UI to the panel 2025-11-30 10:13:16 +03:00
Nikita c5250d7794 Add info comment about ascending time order 2025-11-30 10:12:55 +03:00
Nikita 7d890156f4 Fix haps not being sorted by time 2025-11-30 10:12:55 +03:00
Nikita 8f9967c76d Format 2025-11-30 10:12:55 +03:00
Nikita 91ebdd5ea6 Better progress bar UI 2025-11-30 10:12:55 +03:00
Nikita fc74dcdb1a More bug fixes 2025-11-30 10:12:51 +03:00
Lu[ke] Wilson c77675c492 add another synonym 2025-11-29 18:01:27 +00:00
Lu[ke] Wilson 5197af1aa4 Merge remote-tracking branch 'origin/main' into lu/flux 2025-11-29 17:58:41 +00:00
Lu[ke] Wilson 65dd79e374 add lots of synonyms 2025-11-29 17:44:33 +00:00
jeromew b65cc2128f [perf] fix phaser leak of unused biquads 2025-11-29 14:47:03 +00:00
froos 7a3e0fd3fe Merge pull request 'added export to getSuperdoughAudioController() so that its possible to route superdough audio through other webaudio applications.' (#1796) from ndr0n/strudel:exportSuperdoughAudioController into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1796
2025-11-29 01:00:41 +01:00
Alex McLean 4061dd4cf8 Merge pull request 'add revv() for reversing whole patterns' (#1791) from revv into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1791
2025-11-28 23:26:19 +01:00
alex b523205590 Merge branch 'revv' of ssh://codeberg.org/uzu/strudel into revv 2025-11-28 22:03:32 +00:00
alex 956598da18 snapshot 2025-11-28 22:03:21 +00:00
Alex McLean e011f3b982 Merge branch 'main' into revv 2025-11-28 22:37:03 +01:00
alex cb591815ed fix copy paste errors 2025-11-28 21:35:35 +00:00
Alex McLean 6a4fd27f5b Merge branch 'main' into exportSuperdoughAudioController 2025-11-28 22:32:10 +01:00
Aria d30df8d4cf Merge pull request '[perf] Disconnect lfos for phaser and filters' (#1787) from glossing/perf-lfos into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1787
2025-11-28 20:19:14 +01:00
Aria e10cd22c26 Merge branch 'main' into glossing/perf-lfos 2025-11-28 19:59:51 +01:00
Aria 18dc4944bf Typos and cleanup 2025-11-28 12:36:23 -06:00
Felix Roos d84db1e663 hotfix: auto deploy to warm.strudel.cc when main changes 2025-11-28 10:02:57 +01:00
ndr0n a6008e2700 added export to getSuperdoughAudioController() so that its possible to route superdough audio on external application integrations. 2025-11-28 04:03:48 +00:00
froos 2f8cabbb6b Merge pull request 'fix: return silence when no pattern is returned' (#1795) from fix-empty-pattern into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1795
2025-11-27 23:08:50 +01:00
Felix Roos ec26392509 fix: return silence when no pattern is returned 2025-11-27 22:53:38 +01:00
froos 30cd486f37 Merge pull request 'fix(tool/dbpatch): add missing package name' (#1765) from peterpf/strudel:bugfix/add-package-name-for-dbpatch into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1765
2025-11-27 22:47:01 +01:00
froos cde0520ed9 Merge pull request 'add CHANGELOG.md + basic script to generate' (#1794) from changelog into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1794
2025-11-27 22:38:04 +01:00
Felix Roos 405338e4f0 add CHANGELOG.md + basic script to generate 2025-11-27 22:25:32 +01:00
froos afbcaa54d0 Merge pull request '[perf] in noise, let noiseMix do the disconnect when it exists' (#1783) from jeromew/strudel:fix-perf9 into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1783
2025-11-27 22:03:51 +01:00
froos 6a1c6081e0 Merge pull request 'Bug Fix: Retries for sounds tab' (#1754) from glossing/sounds-tab-preview into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1754
2025-11-27 22:01:00 +01:00
Felix Roos 3c4ba667c8 cleanup 2025-11-27 21:29:37 +01:00
Felix Roos 7fcb5262b8 Merge remote-tracking branch 'origin/main' into glossing/sounds-tab-preview 2025-11-27 21:14:22 +01:00
Felix Roos b824c45ba4 Merge remote-tracking branch 'origin/main' into glossing/sounds-tab-preview 2025-11-27 21:11:50 +01:00
froos e47e6c87fc Merge pull request '[hydra] return the hydra object when await initHydra(..) is called' (#1784) from jeromew/strudel:return-hydra into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1784
2025-11-27 20:36:44 +01:00
froos 69b5ba89cb Merge pull request 'Use errorLogger for query and tonal errors' (#1782) from glossing/query-error into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1782
2025-11-27 20:36:12 +01:00
froos 33a51761ce Merge pull request '[perf] level 5 connect-leak on vowel' (#1779) from jeromew/strudel:fix-perf7 into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1779
2025-11-27 20:27:09 +01:00
Alex McLean f4b1baac87 add revv() for reversing whole patterns 2025-11-27 15:34:18 +00:00
Peter Egger d217119391 fix(tool/dbpatch): add missing package name 2025-11-26 19:48:48 +01:00
Switch Angel AKA Jade Rose d5d6284a90 Merge pull request 'feat: add prebake script import button for loading .strudel files' (#1774) from pre_eval into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1774
2025-11-26 08:23:37 +01:00
Switch Angel AKA Jade Rose fb790de26c Merge branch 'main' into pre_eval 2025-11-26 08:05:05 +01:00
Aria ec6f6a1f1c Merge pull request 'Fix Sampler port trampling' (#1717) from Dayglo/strudel:fix-port-trampling into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1717
Reviewed-by: Aria <glossing@noreply.codeberg.org>
2025-11-26 07:39:27 +01:00
W-A-James a126bc9b86 Fix lint 2025-11-25 22:20:55 -05:00
Aria a5c7fcc136 Add back options code (will resolve in another PR) 2025-11-25 22:16:23 -05:00
Aria d70b758065 Remove base url from sample server and properly handle url schemes 2025-11-25 22:16:11 -05:00
W-A-James 9fdba6374c remove extraneous eslint ignore directive 2025-11-25 22:14:19 -05:00
W-A-James af90baea33 Fix trampling of port env variable 2025-11-25 22:14:15 -05:00
Aria 692359309f Typo and formatting 2025-11-25 17:31:11 -06:00
Aria d65b908bda Disconnect lfos for phaser and filters 2025-11-25 17:27:37 -06:00
Aria 743e239e52 Merge pull request 'Feat: Hook up octave and fix example' (#1773) from glossing/hook-up-octave into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1773
2025-11-25 20:59:08 +01:00
Aria f44a96a5ce Merge branch 'main' into glossing/hook-up-octave 2025-11-25 20:50:49 +01:00
Aria b94a686394 Merge pull request '[perf] fix connect-leak in tremolo param' (#1780) from jeromew/strudel:fix-perf8 into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1780
Reviewed-by: Aria <glossing@noreply.codeberg.org>
2025-11-25 20:48:07 +01:00
Aria 728552b669 Merge branch 'main' into fix-perf8 2025-11-25 20:30:18 +01:00
Aria 8b427bc1dd Add oct synonym 2025-11-25 13:19:39 -06:00
Aria 8529516c66 Add ability to turn mini parsing off with midi-off decorator 2025-11-25 13:05:27 -06:00
Aria ae47d767ce Merge branch 'main' into glossing/hook-up-octave 2025-11-25 20:02:43 +01:00
jeromew ab64451d65 [hydra] return the hydra object when await initHydra(..) is called 2025-11-25 10:49:30 +00:00
jeromew 89da9bbdb0 [perf] in noise, let noiseMix do the disconnect when it exists 2025-11-25 10:31:53 +00:00
Aria 2bc208d8f5 Use errorLogger for query and tonal errors 2025-11-24 19:05:42 -06:00
Aria 39e7f70079 Remove synonym 2025-11-24 18:44:29 -06:00
Aria 7e5a907ce5 Add a few more functions to autocomplete 2025-11-24 18:41:25 -06:00
Aria d7afb8a6c0 Add register example 2025-11-24 18:01:20 -06:00
Aria a278f21f1b Allow register in autocomplete, add vel as synonym for velocity, fix some controls 2025-11-24 17:52:00 -06:00
Switch Angel AKA Jade Rose cfeff26d42 Merge pull request 'filter modulation improvements!' (#1769) from filter_mod_improvements into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1769
2025-11-24 17:51:19 +01:00
jeromew e60ecba393 Merge branch 'fix-perf8' of https://codeberg.org/jeromew/strudel into fix-perf8 2025-11-24 16:36:14 +00:00
jeromew f0d49e0e22 [perf] fix connect-leak from audioworklet=>param in lfo/tremolo 2025-11-24 16:35:48 +00:00
Jade (Rose) Rowland 7ee6b933cc add tests 2025-11-24 11:33:21 -05:00
jeromew a3947d1ccf [perf] fix connect-leak from audioworklet=>param in lfo/tremolo 2025-11-24 16:33:20 +00:00
Jade (Rose) Rowland e86850b6d8 frequency mod 2025-11-24 11:19:49 -05:00
jeromew 89a6efb69e [perf] level 5 connect-leak on vowel 2025-11-24 16:10:00 +00:00
Jade (Rose) Rowland 31c694b596 Merge branch 'main' into filter_mod_improvements 2025-11-24 10:44:11 -05:00
Jade (Rose) Rowland 7a4babf6e1 format 2025-11-24 10:40:16 -05:00
Jade (Rose) Rowland d5e5ab83ac fix style 2025-11-24 10:39:37 -05:00
Aria 36587ae747 Switch back to original version 2025-11-23 22:55:36 -06:00
Aria 6c01c16a0c Fix typo 2025-11-23 22:39:21 -06:00
Aria be36898803 Formatting and examples 2025-11-23 22:29:33 -06:00
Aria df047fd48d Optimizations 2025-11-23 22:28:10 -06:00
Aria 68840de188 Working version 2025-11-23 20:58:28 -06:00
Aria 020a6bc75f First pass at transient processor 2025-11-23 20:31:31 -06:00
Jade (Rose) Rowland 20016fd9aa update hash 2025-11-23 20:25:13 -05:00
Aria 7bc6fcbf2a Add channel support to midi in 2025-11-23 18:24:48 -06:00
Switch Angel AKA Jade Rose 132a124644 Merge pull request 'Add o as a synonym for orbit' (#1766) from jade/orbitsynonym into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1766
Reviewed-by: Aria <glossing@noreply.codeberg.org>
2025-11-24 01:20:52 +01:00
Jade (Rose) Rowland 4caacb0de1 only eval if script 2025-11-23 19:12:28 -05:00
Jade (Rose) Rowland 8325b4cfc4 Merge branch 'main' into jade/orbitsynonym 2025-11-23 19:06:16 -05:00
Jade (Rose) Rowland 3b2df0b725 synonym: 2025-11-23 19:05:57 -05:00
Jade (Rose) Rowland f80fdbc38a Merge branch 'pre_eval' of ssh://codeberg.org/uzu/strudel into pre_eval 2025-11-23 18:59:26 -05:00
Jade (Rose) Rowland 3a7b237765 change variable name 2025-11-23 18:59:16 -05:00
Switch Angel AKA Jade Rose f5af55b63b Merge branch 'main' into pre_eval 2025-11-24 00:47:37 +01:00
Jade (Rose) Rowland d5dfbd7aa4 cleanup 2025-11-23 18:45:13 -05:00
Jade (Rose) Rowland 6221099af8 working 2025-11-23 18:09:38 -05:00
froos 22f1512697 Merge pull request '[perf] fix connect-leak in fm modulation' (#1758) from jeromew/strudel:fix-perf6 into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1758
2025-11-23 22:23:24 +01:00
Aria 6c0d550b6b Fix example 2025-11-23 12:25:40 -06:00
Aria cf12e3e1d8 Hook up the octave control 2025-11-23 12:21:55 -06:00
froos 9a05a679aa Merge pull request 'Fix interoperability issue between all and await initHydra()' (#1663) from jeromew/strudel:jeromew-hydra-all into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1663
2025-11-23 09:47:22 +01:00
Switch Angel AKA Jade Rose 321e76166a Merge branch 'main' into filter_mod_improvements 2025-11-23 06:35:22 +01:00
Jade (Rose) Rowland bde17594ce test 2025-11-23 00:33:52 -05:00
Jade (Rose) Rowland 7bbb653963 fixed 2025-11-22 23:42:20 -05:00
Jade (Rose) Rowland 30e672a027 wip 2025-11-22 22:49:23 -05:00
Aria f7f3aa7668 Merge pull request 'Bug fix: Swap l/r gains with temp variable' (#1768) from glossing/stereo-bug into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1768
2025-11-23 04:23:04 +01:00
Aria adc3a9ac6c Swap with temp variable 2025-11-22 20:51:30 -06:00
Switch Angel AKA Jade Rose 2518b2aed2 Merge pull request 'FIX: prevent LFO filter modulation from popping from negative values' (#1767) from lpmod_improvements into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1767
2025-11-23 00:52:27 +01:00
Jade (Rose) Rowland 1d5f3a4f30 prevent filter modulation pops 2025-11-22 18:21:24 -05:00
Jade (Rose) Rowland 2efd56e331 add synonym 2025-11-22 18:10:28 -05:00
Switch Angel AKA Jade Rose 5fa6cb4653 Merge pull request 'prefix "S" for solo' (#1481) from solo into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1481
2025-11-23 00:03:31 +01:00
Jade (Rose) Rowland 19fd0fc649 rm unessecary file 2025-11-22 17:17:41 -05:00
Jade (Rose) Rowland e72e26eb81 add comment 2025-11-22 17:11:17 -05:00
Jade (Rose) Rowland 1c4b05d55f solo search n = 1 2025-11-22 16:40:31 -05:00
jeromew d453c861d3 Merge branch 'fix-perf6' of https://codeberg.org/jeromew/strudel into fix-perf6 2025-11-21 09:01:02 +00:00
jeromew f637b8b0dd [perf] fix connect-leak in fm modulation 2025-11-21 09:00:17 +00:00
Aria 06bf17f444 Merge pull request 'Bug Fix: Use frac due to negative frequencies from FM' (#1759) from glossing/droponelettertosaveears into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1759
2025-11-21 01:56:10 +01:00
Aria 21543956c6 Also for wavetable 2025-11-20 18:30:53 -06:00
Aria 4758effdc6 Use frac due to negative frequencies from FM 2025-11-20 18:22:44 -06:00
Aria 0e3840aff4 Merge branch 'main' into glossing/lfo-anything 2025-11-20 14:40:39 -06:00
Aria a929b36770 Remove room 2025-11-20 14:06:45 -06:00
froos 6f58e74bea Merge pull request '[perf] fix connect-leak added by #1742 when noise() is not used' (#1757) from jeromew/strudel:fix-perf5 into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1757
2025-11-20 19:48:15 +01:00
jeromew 907f03f3bf [perf] fix connect-leak in fm modulation 2025-11-20 17:40:51 +00:00
jeromew 0435711051 [perf] fix connect-leak added by #1742 when noise() is not used 2025-11-20 17:36:00 +00:00
froos 8f6718b9e8 Merge pull request '[perf] fix connect-leak in delay effect' (#1755) from jeromew/strudel:fix-perf4 into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1755
2025-11-20 14:50:59 +01:00
froos aa77255d98 Merge pull request '[perf] fix connect leak when .noise() is in the mix' (#1742) from jeromew/strudel:fix-perf3 into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1742
2025-11-20 14:49:40 +01:00
jeromew 7267990e20 Fix codeformat 2025-11-20 13:35:37 +00:00
jeromew 387e5db0fe Merge branch 'fix-perf3' of https://codeberg.org/jeromew/strudel into fix-perf3 2025-11-20 13:24:03 +00:00
jeromew d9f63b8dfa [perf] fix connect leak when .noise() is in the mix 2025-11-20 13:21:09 +00:00
jeromew 8ed72b4573 [perf] fix connect-leak in delay effect 2025-11-20 13:05:41 +00:00
Aria 2794541dad Clean up send nodes and remove offset 2025-11-19 20:52:51 -06:00
Aria 3e118ce0a8 Fully working version 2025-11-19 20:11:02 -06:00
Aria c3ad0d1789 Fix for curve params 2025-11-19 20:01:17 -06:00
Aria 19b710c401 Mostly working version 2025-11-19 19:44:02 -06:00
Aria 74488f8480 Stray log message 2025-11-19 18:41:56 -06:00
Aria 8144ec46bd Attempt system for sounds tab previews 2025-11-19 18:35:35 -06:00
Aria 0dbca05de0 Ready for testing 2025-11-19 17:24:33 -06:00
Aria f8796d039f Add param guesses 2025-11-19 17:18:38 -06:00
Aria 442f487973 Another major cleanup 90% of first pass 2025-11-19 17:10:05 -06:00
scrappy_fiddler 4ec68fcd1d a little prettier 2025-11-20 00:07:44 +01:00
Aria 7ccdefe1c6 Huge overhaul for config part 1 2025-11-19 16:33:08 -06:00
Aria b73f624058 Trying out alias approach 2025-11-19 15:41:29 -06:00
scrappy_fiddler 7abfcd0f38 Merge branch 'main' into documentation 2025-11-19 22:18:32 +01:00
scrappy_fiddler 4504d1afd0 remove trailing spaces in FAQ 2025-11-19 22:14:23 +01:00
Aria e4466082eb Merge branch 'main' into glossing/upgrading-lfospr 2025-11-19 15:10:02 -06:00
Aria 29b6729246 First pass at improving controls 2025-11-19 15:03:11 -06:00
Felix Roos dd2c808cd7 hotfix: reduce sounds-tab click to play latency 2025-11-19 21:55:35 +01:00
Aria b3df7f438f Merge branch 'main' into glossing/lfo-anything 2025-11-19 14:43:47 -06:00
scrappy_fiddler 69c5df67f5 FAQ is now prettier 2025-11-19 21:40:48 +01:00
scrappy_fiddler a21f0d629e Merge branch 'main' into documentation 2025-11-19 20:24:34 +01:00
scrappy_fiddler 371e6c7d6d tidy up FAQ 2025-11-19 20:17:19 +01:00
scrappy_fiddler 0bb89d1a9f New page FAQ in "More" 2025-11-19 20:09:14 +01:00
Alex McLean 389a63a850 Merge pull request 'wchooseCycles has now notes in an example' (#1748) from scrappy_fiddler/strudel:documentation into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1748
2025-11-18 23:52:43 +01:00
Aria 654c1a86f0 Simplify declarations via globalThis; fix cleanup/stop 2025-11-18 16:02:33 -06:00
Felix Roos 3b1c75d3de fix: linting errors 2025-11-17 23:18:31 +01:00
Felix Roos 48407c309c add basic dough repl 2025-11-17 23:10:10 +01:00
scrappy_fiddler 99beb4454d update snapshot with note example 2025-11-17 20:49:26 +01:00
scrappy_fiddler 30cc46ea66 wchooseCycles has now notes in an example 2025-11-17 20:04:40 +01:00
Aria ac3f477f30 Merge branch 'main' into glossing/fmsss 2025-11-16 22:32:38 -06:00
Aria ea7dc7a732 Merge pull request 'Feature: Partials' (#1659) from glossing/strudel:glossing/partials into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1659
2025-11-17 05:31:53 +01:00
Aria 573cd1ae41 Merge branch 'main' into glossing/fmsss 2025-11-16 22:23:31 -06:00
Aria 641bd2f356 Properly patternify everything 2025-11-16 22:20:17 -06:00
Aria f5ed6dbe79 Top level functions 2025-11-16 20:28:22 -06:00
Aria 7a3bea6f90 Working version 2025-11-16 19:38:59 -06:00
Aria cc10122b71 Testing out approach to allow list patterns in partials 2025-11-16 19:20:42 -06:00
Aria b66c0d18b3 Merge branch 'main' into glossing/partials 2025-11-16 18:44:04 -06:00
Aria 17af92b2df Merge branch 'main' into glossing/random 2025-11-16 15:32:15 -06:00
Aria e90aa5202d Export withseed 2025-11-16 15:28:10 -06:00
Aria fb7f686519 Add seeding 2025-11-16 15:22:34 -06:00
froos 0331c91b80 Merge pull request 'README: update superdough documentation' (#1741) from TristanMlct/strudel:update-readme-superdough into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1741
2025-11-16 22:06:12 +01:00
Aria 4d5ebfc204 Merge pull request 'Feature: Envelope worklet' (#1524) from glossing/strudel:glossing/snappy-envs into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1524
2025-11-16 22:00:42 +01:00
Aria aca500ba73 Merge branch 'main' into glossing/random 2025-11-16 14:42:20 -06:00
Aria 921cb17d33 Merge branch 'main' into glossing/snappy-envs 2025-11-16 14:39:40 -06:00
Aria 832fd04a3d Merge pull request 'Worklet optimizations' (#1730) from glossing/optimizations into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1730
Reviewed-by: Switch Angel AKA Jade Rose <daslyfe@noreply.codeberg.org>
2025-11-16 21:08:53 +01:00
Aria d9c21489f8 Merge branch 'main' into glossing/optimizations 2025-11-16 20:13:31 +01:00
Aria 3962558c09 Some final tweaks 2025-11-16 13:12:47 -06:00
jeromew bfa8fa3c75 [perf] fix connect leak when .noise() is in the mix 2025-11-16 09:23:11 +00:00
Tristan Mlct 91799f2014 README: update superdough documentation 2025-11-15 15:06:44 +01:00
froos f6bb3869de Merge pull request '[perf] disconnect Offline AudioNode connections in generateReverb' (#1740) from jeromew/strudel:fix-perf2 into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1740
2025-11-15 14:59:28 +01:00
froos b9e9c9e9e6 Merge pull request '[perf] disconnect send effect AudioNode when room is used' (#1736) from jeromew/strudel:fix-perf1 into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1736
2025-11-15 14:57:46 +01:00
jeromew 92d87093e0 [perf] disconnect Offline AudioNode connections in generateReverb 2025-11-15 13:39:24 +00:00
jeromew 3e05525dc2 [perf] disconnect send effect AudioNode when room is used 2025-11-14 22:06:39 +00:00
Aria 22807b3833 Use weak references for sound sources 2025-11-14 16:05:09 -06:00
froos 0960741156 Merge pull request '[supradough] fix: unstable filter' (#1593) from supradough-filter-fix into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1593
2025-11-12 21:22:33 +01:00
Alex McLean bbb977afcc Merge pull request 'Fix link syntax in project-start' (#1724) from Kissaki/strudel:kissaki-patch-1 into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1724
2025-11-12 21:12:06 +01:00
Alex McLean 81a4981a68 Merge pull request 'Fix web README sample code' (#1725) from Kissaki/strudel:kissaki-patch-2 into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1725
2025-11-12 21:06:12 +01:00
Alex McLean 90d82c8988 Merge pull request 'Fix typo: 'studel' -> 'strudel'' (#1726) from drhayes/strudel:main into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1726
2025-11-12 20:59:39 +01:00
Aria 2875814a36 Square instead of self-multiply; more voices; more cleanup 2025-11-12 13:56:14 -06:00
Aria 157b05536a Final cleanup 2025-11-12 13:36:01 -06:00
Aria f8c9425569 Simplify spread 2025-11-12 13:13:37 -06:00
Aria be3a88b09c Optimize phase wrap; make voices k-rate 2025-11-12 12:23:40 -06:00
Aria aabf122161 Further optimizations, including detuner 2025-11-12 11:53:38 -06:00
Aria 3c6de3be6d First pass of worklets optimizations 2025-11-12 10:48:20 -06:00
froos 15f7b7c1a2 Merge pull request 'fix for node 24 support in tests - #1718' (#1719) from ausav/strudel:ausav.nodever into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1719
2025-11-12 15:23:36 +01:00
froos b6e382508f Merge pull request 'soundAlias example fix' (#1720) from PepsiiMan/strudel:docfix into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1720
2025-11-11 09:00:47 +01:00
drhayes 3e7ae88043 Fix typo: 'studel' -> 'strudel' 2025-11-10 17:02:55 +01:00
froos 897a2016d0 Merge pull request 'fix: Make Supradough package build' (#1711) from munshkr/strudel:fix/1702-supradough-build into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1711
2025-11-10 08:18:35 +01:00
froos 7a1c1a75b1 Merge pull request 'added docs for spaces in scale names' (#1715) from ondras/strudel:scale-docs into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1715
2025-11-10 08:18:00 +01:00
ondras 7f06f11e96 Merge branch 'main' into scale-docs 2025-11-10 08:08:04 +01:00
Switch Angel AKA Jade Rose 5acb00795e Merge pull request 'Feature: LFOs for Filters' (#1636) from glossing/strudel:glossing/filter-lfo into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1636
2025-11-10 02:44:00 +01:00
Switch Angel AKA Jade Rose f4b68fa2e6 Merge branch 'main' into glossing/filter-lfo 2025-11-10 02:20:20 +01:00
Václav Volhejn 2fa8ed1424 Revert seq synonym refactor 2025-11-09 20:21:19 +01:00
PepsiiMan 1b37f1ed1d soundAlias example fix 2025-11-06 15:33:06 +01:00
ondras f8943dbc94 Merge branch 'main' into scale-docs 2025-11-06 08:16:34 +01:00
Ondřej Žára a3f82f90a9 test fix 2025-11-06 08:15:55 +01:00
Switch Angel AKA Jade Rose 670f75b7e8 Merge pull request 'improvement: sync midi messages to audio context clock' (#1708) from sync_midi_timing into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1708
2025-11-05 17:06:59 +01:00
Jade (Rose) Rowland 79875ebc50 fix branch 2025-11-05 01:26:36 -05:00
Switch Angel AKA Jade Rose a1bd905c06 Merge branch 'main' into sync_midi_timing 2025-11-05 07:25:06 +01:00
Alex Victoria 247bf9b930 fix for node 24 support #1718 2025-11-04 20:54:21 -06:00
froos 8f24ce223f Merge pull request 'Add stick button mappings to gamepad implementation and improve docs' (#1696) from kaosuryoko/strudel:gamepad-stick-button into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1696
2025-11-04 19:36:13 +01:00
froos 51648d3e6e Merge pull request 'Refactor sound stopping and triggering logic in SoundsTab component' (#1688) from IJOL/strudel:bugfix/multi-sample-loading into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1688
2025-11-04 19:29:34 +01:00
froos d4e67e1c20 Merge pull request 'Add setting to toggle pattern auto-start on pattern change' (#1690) from moumar/strudel:pattern-auto-start-setting into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1690
2025-11-04 19:13:20 +01:00
froos edf4739cc6 Merge pull request 'Voicings JSDoc' (#1686) from sharkeys_lunchbox/strudel:main into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1686
2025-11-04 18:58:50 +01:00
froos 3e636bd6f0 Merge branch 'main' into main 2025-11-04 18:55:34 +01:00
Ondřej Žára 4df2cc3086 added docs for spaces in scale names 2025-11-03 22:03:39 +01:00
moumar 809eb7132c codeformat 2025-11-02 15:20:31 +01:00
froos dd6429007e Merge branch 'main' into bugfix/multi-sample-loading 2025-11-02 14:56:30 +01:00
froos e211d5a6bb Merge branch 'main' into pattern-auto-start-setting 2025-11-02 14:44:31 +01:00
Damián Silvani 404d9999f3 fix: Update github.com links 2025-11-02 09:21:40 -03:00
Damián Silvani bc1c83ed64 fix: Add missing vite.config.js to supradough package 2025-11-02 09:21:25 -03:00
Jade (Rose) Rowland 91e1cc136e working 2025-11-01 23:34:10 -04:00
Václav Volhejn b7827cb89f Tag new functions 2025-11-01 21:11:57 +01:00
Václav Volhejn 29fd541f1f Merge branch 'radical-new-docs' of ssh://codeberg.org/vvolhejn/strudel into radical-new-docs 2025-11-01 20:20:07 +01:00
Václav Volhejn 0830a9df69 Add superdirt tags 2025-11-01 20:19:57 +01:00
Switch Angel AKA Jade Rose 92e3a80e65 Merge pull request 'FIX: Loading local samples uses too much memory' (#1706) from jade/fix_sample_loading into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1706
2025-11-01 07:50:39 +01:00
Jade (Rose) Rowland 4f046ae883 cf 2025-11-01 02:40:40 -04:00
Jade (Rose) Rowland 2b575d50b9 temporarily disable sample autocomplete 2025-11-01 02:39:43 -04:00
Jade (Rose) Rowland 7b92874909 fix broken array 2025-11-01 01:55:05 -04:00
Jade (Rose) Rowland 10bfe32a2d rm console 2025-11-01 01:48:42 -04:00
Jade (Rose) Rowland a41b07c67a fixed build 2025-11-01 01:44:32 -04:00
Jade (Rose) Rowland 20027d7208 Merge branch 'jade/fix_sample_loading' of ssh://codeberg.org/uzu/strudel into jade/fix_sample_loading 2025-11-01 01:32:35 -04:00
Jade (Rose) Rowland f38792c569 format 2025-11-01 01:32:24 -04:00
Switch Angel AKA Jade Rose 2c2bfd7070 Merge branch 'main' into jade/fix_sample_loading 2025-11-01 06:31:25 +01:00
Jade (Rose) Rowland 484c5e6cdd working 2025-11-01 01:26:25 -04:00
Jason Dufair a036c4f921 Merge remote-tracking branch 'upstream/main' 2025-10-30 18:57:36 -04:00
froos 85f6472894 Merge branch 'main' into lu/flux 2025-10-28 23:53:44 +01:00
froos 4c35f6a77b Merge pull request 'Bug Fix: Handle scale-for-notes when n also supplied' (#1625) from glossing/strudel:glossing/scale-with-note-and-n into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1625
2025-10-28 22:58:24 +01:00
froos e92f4938cd Merge branch 'main' into glossing/scale-with-note-and-n 2025-10-28 22:54:34 +01:00
froos 12204c9053 Merge pull request 'Repurpose vim shortcuts for usability' (#1624) from dtricks/strudel:feat/vim-shortcuts into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1624
2025-10-28 22:51:15 +01:00
froos 980bf17059 Merge branch 'main' into feat/vim-shortcuts 2025-10-28 22:38:04 +01:00
froos f2009a33aa Merge pull request 'Add support for euclidian in mondo with bd&3:8' (#1630) from TristanCacqueray/strudel:mondian into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1630
2025-10-28 22:35:19 +01:00
froos a65a68b828 Merge branch 'main' into mondian 2025-10-28 22:20:41 +01:00
froos 4159c8394d Merge branch 'main' into radical-new-docs 2025-10-28 22:02:10 +01:00
alex cbe7aaacfb Publish
- @strudel/codemirror@1.2.6
 - @strudel/core@1.2.5
 - @strudel/csound@1.2.6
 - @strudel/draw@1.2.5
 - @strudel/gamepad@1.2.5
 - @strudel/hydra@1.2.5
 - @strudel/midi@1.2.6
 - @strudel/mini@1.2.5
 - @strudel/mondo@1.1.5
 - @strudel/motion@1.2.5
 - @strudel/mqtt@1.2.5
 - @strudel/osc@1.3.0
 - @strudel/repl@1.2.7
 - @strudel/serial@1.2.5
 - @strudel/soundfonts@1.2.6
 - superdough@1.2.6
 - supradough@1.2.4
 - @strudel/tonal@1.2.5
 - @strudel/transpiler@1.2.5
 - @strudel/web@1.2.6
 - @strudel/webaudio@1.2.6
 - @strudel/xen@1.2.5
2025-10-27 15:38:32 +00:00
Jason Dufair c0e7971be7 Merge remote-tracking branch 'upstream/main' 2025-10-27 09:26:47 -04:00
Alex McLean 35014b5190 Merge pull request 'Use bunny cdn for all samples and json files' (#1701) from bunny-cdn into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1701
2025-10-27 10:42:06 +01:00
alex 9ff0449ca3 use json files in dough-samples via bunny cdn 2025-10-27 09:24:17 +00:00
kaosuryoko b491c42af5 Merge branch 'main' into gamepad-stick-button 2025-10-27 00:36:50 +01:00
alex 8398385dcd piano via bunnycdn 2025-10-26 22:18:37 +00:00
Alex McLean 629c2b9301 Merge pull request 'degithub - switch some samples to bunnycdn' (#1697) from bunny-cdn into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1697
2025-10-26 22:52:53 +01:00
alex 5cc93996ce degithub 2025-10-26 21:49:10 +00:00
Greg Ervin ee43d85f29 Add stick button mappings to gamepad implementation and improve docs 2025-10-26 13:31:13 -05:00
Alex McLean 7cef558440 Merge pull request 'Fix ZZFX example' (#1685) from moumar/strudel:fix-zzfx-example into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1685
2025-10-26 17:09:20 +01:00
Alex McLean c261fb6dd6 Merge branch 'main' into fix-zzfx-example 2025-10-26 17:08:56 +01:00
moumar fcd83cce55 Re-evaluate pattern if activated 2025-10-26 14:07:36 +01:00
moumar fddf2ff2a7 Set pattern auto-start to true by default 2025-10-26 14:06:31 +01:00
Jason Dufair 6d4787ee33 Test snapshot 2025-10-24 09:21:04 -04:00
Jason Dufair 1a362bd8ea Fix example 2025-10-24 09:19:02 -04:00
BANanaD3V 03d2f363f1 Merge branch 'main' into feat/non-realtime-exporting 2025-10-24 13:09:09 +02:00
Nikita ff370cf86f Reapply realtimeOptions after export 2025-10-24 14:07:57 +03:00
moumar 28056deb66 Fix ZZFX example
ZZFX example did not produce any sound out of the box, fixed by updating
tremolo param.
2025-10-23 23:15:53 +02:00
moumar 20bbda30f8 Add setting to toggle pattern auto-start on pattern change 2025-10-23 23:15:21 +02:00
Nikita 9cbeaef88d Format 2025-10-23 22:21:40 +03:00
Nikita ca936aada7 Fix incorrect duration calculation 2025-10-23 21:46:13 +03:00
Ignacio Ortega a8c613b7eb Refactor sound stopping and triggering logic in SoundsTab component 2025-10-23 19:04:29 +02:00
Jason Dufair fd0a910bfb Voicings JSDoc 2025-10-23 11:11:21 -04:00
Nikita fe70a2df43 Format 2025-10-23 17:08:11 +03:00
Nikita 6baca67cd3 Fix maxPolyphony and multiChannelOrbits not applying to export 2025-10-23 17:07:53 +03:00
yaxu 7071dec775 revert 39e2221c29
revert add _processParts()
2025-10-23 16:07:42 +02:00
Alex McLean 3d55567445 Merge branch 'main' of ssh://codeberg.org/uzu/strudel 2025-10-23 15:05:50 +01:00
Alex McLean 39e2221c29 add _processParts() 2025-10-23 15:05:39 +01:00
BANanaD3V 85f6454340 Merge branch 'main' into feat/non-realtime-exporting 2025-10-23 16:05:09 +02:00
Alex McLean b8ce920f50 Merge pull request 'Make osc port and host configurable. Changes dependencies.' (#1682) from multiosc into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1682
2025-10-23 15:56:00 +02:00
yaxu ccb5ec1685 Add action to deploy 'beta' version to warm.strudel.cc 2025-10-23 10:41:29 +02:00
yaxu b09230fe90 Update .forgejo/workflows/deploy.yml 2025-10-23 10:40:08 +02:00
yaxu 8f7b439dce Move deploy location to deploy/strudel.cc 2025-10-23 10:39:26 +02:00
Aria c823a37c93 Merge pull request 'Adds back shape to superdough' (#1672) from glossing/strudel:glossing/return-shape-to-sd into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1672
2025-10-23 03:47:30 +02:00
Aria 0c9f535ff5 Merge branch 'main' into glossing/return-shape-to-sd 2025-10-23 03:44:44 +02:00
froos fb5884ab81 Merge pull request 'Fix sampler.mjs githubPath' (#1684) from jeromew/strudel:fix-githubpath into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1684
2025-10-22 22:15:17 +02:00
Nikita 16f885c010 Use errorLogger instead 2025-10-22 23:09:30 +03:00
jeromew ea91d30ce4 Add semicolon 2025-10-22 21:52:53 +02:00
Nikita 5a70599aac Ignore superdough errors when exporting, instead skip sound. 2025-10-22 22:48:04 +03:00
jeromew f0bd5bffaa Fix sampler.mjs githubPath
PR https://codeberg.org/uzu/strudel/pulls/1679 introduced a subtle bug when both other and subpath are empty. The url should not end with '//'
2025-10-22 21:39:08 +02:00
Nikita 7b74a902a2 Remove unneeded imports 2025-10-22 20:05:03 +03:00
Nikita 95700e1196 Fix wavetables breaking after playback 2025-10-22 20:00:36 +03:00
Alex McLean ac37b6a029 Merge pull request 'Fix onPaint for widgets' (#1658) from fix-onpaint into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1658
2025-10-22 16:20:49 +02:00
Nikita e7578be6c5 Remove preloading code and instead await superdough 2025-10-22 17:16:05 +03:00
Nikita 28df4259b8 Merge remote-tracking branch 'upstream/main' into feat/non-realtime-exporting 2025-10-22 16:21:34 +03:00
Nikita 5e27358fe8 Better preloading 2025-10-22 16:19:58 +03:00
froos a986688874 Merge pull request 'Fix a bug introduced by #4e17cfbdd6' (#1679) from milliganf/strudel:main into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1679
2025-10-22 15:19:11 +02:00
froos 4ab8c256b2 Merge branch 'main' into main 2025-10-22 15:18:53 +02:00
alex 06ea5a36e2 Make osc port and host configurable. Changes dependencies. 2025-10-22 10:15:48 +01:00
Nikita daea207aff Better sample loading 2025-10-21 22:42:01 +03:00
Nikita 92d3fe496d Bug fixes 2025-10-21 21:00:30 +03:00
Nikita 98031676d6 Add an EOL character to package.json 2025-10-21 16:44:42 +03:00
Nikita 498624f6fe Make server.js a normal file 2025-10-21 16:35:33 +03:00
Nikita bf702c3b2a Reviewed changes 2025-10-21 16:30:18 +03:00
froos 6e4dae4dfa Merge branch 'main' into feat/non-realtime-exporting 2025-10-21 14:24:09 +02:00
froos 98f5a56ef6 Merge pull request 'feature/autocomplete-sound-names' (#1564) from drdozer/strudel:feature/autocomplete-sound-names into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1564
2025-10-20 22:37:14 +02:00
milliganf 46af6ed9ef Fix a bug introduced by #4e17cfbdd6
When there's no subpath for a Github path, the URL should end with a '/'. Otherwise when we concatenate values on from a sample map it doesn't separate the base URL from the filename.

Signed-off-by: milliganf <m.h.freeson@outlook.com>
2025-10-20 22:30:58 +02:00
froos 752940b3ab Merge branch 'main' into feature/autocomplete-sound-names 2025-10-20 22:17:45 +02:00
froos c727534d29 Merge pull request 'add replicate + use it for ! in mondo' (#1436) from JoStro/strudel:main into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1436
2025-10-20 21:58:11 +02:00
Felix Roos 20e5fdedfb fix: use replicate for ! in mondo 2025-10-20 21:38:43 +02:00
Felix Roos 188f0e9098 snapshot 2025-10-20 21:35:28 +02:00
Felix Roos c2a5562bad add new flavour under replicate 2025-10-20 21:24:13 +02:00
froos 57f2a97b7b Merge branch 'main' into main 2025-10-20 21:21:08 +02:00
Nikita a8ea9a1b63 Update lockfile 2025-10-20 21:26:40 +03:00
Nikita a2b76bde14 Format 2025-10-20 21:24:54 +03:00
Nikita 0f652e8b5b Remove webaudio from core dependencies 2025-10-20 21:24:27 +03:00
Nikita 2a0635879c Format 2025-10-20 20:58:27 +03:00
Nikita f5fc0ff9d1 Remove resetGlobalEffects from AudioContext 2025-10-20 20:58:01 +03:00
Nikita 7774364ac7 Add webaudio as a workspace dependency 2025-10-20 20:36:36 +03:00
Nikita 329289fc35 Revert refreshing deps 2025-10-20 20:33:25 +03:00
Nikita 8b3c0d2a4a Refresh deps 2025-10-20 20:27:31 +03:00
Nikita 120b46c4a5 Add webaudio as a cyclist dependency (do we want that?) 2025-10-20 20:24:42 +03:00
Nikita 4bdaf577c0 Format 2025-10-20 20:22:16 +03:00
Nikita 428a4b3dd7 Revert workletsUrl to use ?audioworklet 2025-10-20 20:21:23 +03:00
Nikita ff83994733 Better export UI 2025-10-20 20:19:52 +03:00
Nikita 418bca79b2 Disable button when exporting & min start cycle is 0 2025-10-19 23:05:33 +03:00
Nikita b3715dc5df WIP export UI 2025-10-19 23:02:20 +03:00
Václav Volhejn 466bf819d8 Fix formatting (trailing space) 2025-10-19 21:38:46 +02:00
Václav Volhejn 7e4cbefc8f Tag crossfade as internals 2025-10-19 21:22:57 +02:00
Václav Volhejn 2483c673a4 Effects -> fx, untag "crossfade" 2025-10-19 21:19:42 +02:00
Václav Volhejn 69360b3ec8 Also tag "noise" 2025-10-19 21:17:25 +02:00
Václav Volhejn 96d0f2053e Add supradough controls 2025-10-19 21:13:14 +02:00
Václav Volhejn b952e4c735 Add superdough tags 2025-10-19 20:54:22 +02:00
Nikita 9a47e0f11e close() doesn't exist for OfflineAudioContext 2025-10-19 19:47:23 +03:00
Nikita 908c0e44ff Fix worklets not loading 2025-10-19 19:44:53 +03:00
Nikita 920776fdfe Re-init audio before and after export 2025-10-19 15:10:31 +03:00
Nikita 0fbde61b2d WIP non-realtime exporting 2025-10-19 14:38:50 +03:00
Aria 4c49cd9297 More examples 2025-10-18 11:24:56 -05:00
Aria 70d2da81d8 Merge branch 'main' into glossing/fmsss 2025-10-18 11:01:23 -05:00
Aria 72423c3a25 Adds back shape to superdough 2025-10-18 10:41:33 -05:00
Václav Volhejn 54fd877be1 Update snapshot 2025-10-18 13:19:18 +02:00
Václav Volhejn 7d948fd1a7 Fix example snapshot 2025-10-18 12:25:15 +02:00
Václav Volhejn 3373fa39a6 Fix the documentation of stretch 2025-10-18 12:14:39 +02:00
alex 92a82ce4bd delint 2025-10-18 10:49:15 +01:00
alex b2ce4591d9 sort exports and add impure.mjs 2025-10-18 10:42:55 +01:00
alex 1be9f40574 timeline feature 2025-10-18 10:42:35 +01:00
Felix Roos 105db2a4ca fix: tonal import in autocomplete + add tonal to codemirror package dependencies 2025-10-18 08:49:31 +02:00
froos be61d08cc6 Merge branch 'main' into feature/autocomplete-sound-names 2025-10-18 08:41:15 +02:00
Switch Angel AKA Jade Rose 6e58c973af Merge pull request 'Bug Fix: Wavetable: phase wrapping at 1 and detune' (#1620) from glossing/strudel:glossing/wrap-phase-typo into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1620
2025-10-18 04:29:19 +02:00
Switch Angel AKA Jade Rose 2473a5391d Merge branch 'main' into glossing/wrap-phase-typo 2025-10-17 04:55:25 +02:00
Aria c02def03b6 Don't tag when scale fails, allow mixed sharps and flats, simplify scale function 2025-10-16 16:26:33 -05:00
froos 4e17cfbdd6 Merge pull request 'github samples: default to "samples" if repository is not specified' (#1644) from prezmop/strudel:main into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1644
2025-10-16 20:26:26 +02:00
prezmop 83c7e63432 update docs 2025-10-16 18:20:22 +02:00
prezmop 909e0154fe default to samples if repo not found 2025-10-16 18:20:13 +02:00
froos ef4e21ac40 Merge pull request 'Docs: add example of custom chained function' (#1642) from dariusk/strudel:main into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1642
2025-10-16 17:33:39 +02:00
froos 857c82e260 Merge branch 'main' into main 2025-10-16 17:25:07 +02:00
froos 0d5dc1f8c1 Merge branch 'main' into glossing/scale-with-note-and-n 2025-10-16 17:19:07 +02:00
jeromew 47c85f8540 fix interoperability of all with hydra
Hydra add methods on Array.prototype which breaks the Array enumeration with for...in.
Use for...of instead
cf https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of#difference_between_for...of_and_for...in for details on the issue

without this fix, it is impossible to use both `await initHydra()` and `all` in the same strudel code. Strudel errors with "Error: got "undefined" instead of pattern."

example code: https://strudel.cc/#YXdhaXQgaW5pdEh5ZHJhKCkKCmFsbChwaWFub3JvbGwpCgokOiBzKCJiZCIp
2025-10-16 14:06:33 +02:00
Aria fd03d1fdfb Update conditional to allow to control user waveforms 2025-10-15 15:14:31 -05:00
Aria 35016b5847 Mention range in docstring 2025-10-15 14:56:20 -05:00
Aria 0fe7edc157 Some examples 2025-10-15 14:53:07 -05:00
Aria d6de160224 Merge branch 'main' into glossing/partials 2025-10-15 13:19:57 -05:00
alex ba93bd1bc5 Fix onPaint for widgets 2025-10-15 18:54:02 +01:00
Aria 3c1a8c8bdb Format 2025-10-14 11:41:11 -05:00
Aria b7e941c649 Merge branch 'main' into glossing/wrap-phase-typo 2025-10-14 11:40:29 -05:00
Aria ac7e9c6978 Typos on envelope values 2025-10-14 11:37:41 -05:00
Aria c13a726129 Merge branch 'main' into glossing/filter-lfo 2025-10-14 11:24:49 -05:00
Switch Angel AKA Jade Rose ded91fab7d Merge pull request 'Feature: Distortion Modes' (#1561) from glossing/strudel:glossing/distortion-modes into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1561
2025-10-13 07:26:50 +02:00
Switch Angel AKA Jade Rose f40d079543 Merge pull request 'Feature: Wavetable FM' (#1623) from glossing/strudel:glossing/wavetable-fm into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1623
2025-10-13 07:05:56 +02:00
Switch Angel AKA Jade Rose d5833dd475 Merge branch 'main' into glossing/wavetable-fm 2025-10-13 07:05:24 +02:00
Switch Angel AKA Jade Rose 99b3c04a76 Merge branch 'main' into glossing/filter-lfo 2025-10-13 07:04:51 +02:00
Switch Angel AKA Jade Rose e3658ec30e Merge pull request 'fix: repair REPL sample sources and URL concat (#1640)' (#1646) from erikfox/strudel:fix-repl-sample-sources-1640 into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1646
2025-10-12 20:43:41 +02:00
Erik Fox 72eaf96b4f fix: repair REPL sample sources and URL concat (#1640) 2025-10-12 12:30:36 -04:00
Václav Volhejn a4212589e5 Recategorize 2025-10-12 16:33:07 +02:00
Václav Volhejn ee1a894f3b Show tags in reference, more compact functions list 2025-10-12 16:28:05 +02:00
Václav Volhejn c62428ca27 Document remaining functions 2025-10-12 16:07:11 +02:00
Darius Kazemi 9c5c71c31a Removing semicolon to be more idiomatic;;; 2025-10-11 17:52:26 -07:00
Darius Kazemi af53bab259 Fixing some syntax and a typo 2025-10-11 17:50:58 -07:00
Darius Kazemi 0065db8569 Docs: add example of custom chained function
This adds a subsection to the "Understand/Coding Syntax" documentation that shows a simple example of converting the previous chain of effects into a custom, reusable chained function. There's also a prompt for the reader to experiment.
2025-10-11 17:40:55 -07:00
Václav Volhejn d516d765d5 Redo frontend for tags 2025-10-11 14:12:45 +02:00
Václav Volhejn 5032b4e966 Rename group -> tags 2025-10-11 14:11:50 +02:00
Alex McLean 7eebf3a466 Merge pull request 'Add control-metadata' (#1634) from control-metadata into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1634
2025-10-10 11:25:00 +02:00
Aria 57fac57677 Remove todo 2025-10-09 22:23:28 -05:00
Aria a3b803c3f3 First pass 2025-10-09 18:28:59 -05:00
Aria 6f703e48e7 Merge branch 'main' into glossing/wrap-phase-typo 2025-10-08 16:44:35 -05:00
Alex McLean 64f16c4f33 placate format gods 2025-10-08 15:35:34 +01:00
Alex McLean ffbbc43c89 add cyclist version to the query metadata 2025-10-08 15:34:51 +01:00
Alex McLean 086596c47c fix setControls to do union with existing controls 2025-10-08 14:52:00 +01:00
Alex McLean fdde05e751 add pattern id to query state controls 2025-10-08 14:51:21 +01:00
Alex McLean 694162a7b1 fix purity of 'withState' so it returns a new pattern 2025-10-08 14:13:33 +01:00
Felix Roos 319a2d7289 fix: tests 2025-10-07 23:05:00 +02:00
Felix Roos 3a7d50924d refactor: add op_precedence to express & with desugar_ops 2025-10-07 22:59:50 +02:00
Alex McLean cbcb25b063 Merge pull request 'Fix MQTT: change the trigger handler to match new hap' (#1629) from jurrchen/strudel:bugfix/mqtt-hap-sig into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1629
2025-10-07 22:59:38 +02:00
Felix Roos f33db5f07f - refactor bjork -> bjorklund
- refactor e -> bjork
- flip & desugared arguments
2025-10-07 22:35:29 +02:00
Tristan de Cacqueray b7fa440bda mondough: interpret & 2025-10-07 18:10:24 +02:00
Tristan de Cacqueray 3dc9b3524c mondo: add & sugar 2025-10-07 17:19:27 +02:00
dtricks f48f8e46e5 fix empty catches 2025-10-06 15:53:44 +02:00
dtricks a79fc3db5b remove unnecessary comments 2025-10-06 15:53:44 +02:00
dtricks 30a2e14959 weird permission change 2025-10-06 15:53:44 +02:00
dtricks cfe17fcba5 wrong unicode char 2025-10-06 15:53:44 +02:00
dtricks 46ba165c7e remove gcc 2025-10-06 15:53:44 +02:00
dtricks 73a9834959 codeformat 2025-10-06 15:53:44 +02:00
dtricks be9368e8a2 feat(codemirror): add Vim :w evaluate, :q stop, and gc/gcc toggle comment via custom events; docs: add Vim shortcuts page and link from REPL manual 2025-10-06 15:53:44 +02:00
Aria 1ae773acc4 Merge branch 'main' into glossing/wrap-phase-typo 2025-10-05 18:21:05 -05:00
Aria 39a73f2499 Merge branch 'main' into glossing/scale-with-note-and-n 2025-10-05 18:20:30 -05:00
froos 53c504f260 Merge branch 'main' into feature/autocomplete-sound-names 2025-10-05 21:50:45 +02:00
Jieren Chen 0d08225983 change the trigger handler to match new hap 2025-10-05 21:45:23 +02:00
froos 00872bd1de Merge pull request 'Fix case sensitivity for synonym search' (#1618) from vvolhejn/strudel:vv/fix-case-sensitivity into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1618
2025-10-05 21:42:18 +02:00
Aria cc4452ce58 Working version of partials and phases 2025-10-04 20:33:25 -05:00
Aria 11dd8a318a Cleanup 2025-10-04 02:13:42 -05:00
Aria 3ef6c7c921 Handle scale-for-notes when n also supplied 2025-10-04 02:07:35 -05:00
Aria 120f89d57f Handle detune in the presence of pitch envelope 2025-10-04 01:37:57 -05:00
Aria bd73d96847 Cleanup 2025-10-03 18:49:49 -05:00
Aria 7cf9db4872 Big matrix refactor 2025-10-03 18:20:41 -05:00
Aria c9381a11f9 Working version 2025-10-03 17:21:05 -05:00
Aria d496919fe5 Import 2025-10-02 22:48:41 -05:00
Aria f369de13d7 Hook up FM to wavetables 2025-10-02 22:45:48 -05:00
Václav Volhejn a4d7803d43 Annotate controls.mjs 2025-10-02 21:59:45 +02:00
Dr Mathew R Pocock 908a703b7f Merge branch 'main' into feature/autocomplete-sound-names 2025-10-02 10:32:16 +02:00
Aria 99e14dae5c Consistency 2025-10-02 01:12:42 -05:00
Aria ac582b4d40 Wrap properly when phase === 1 2025-10-02 01:06:29 -05:00
Václav Volhejn 4a395f372d Annote pattern.mjs and signal.mjs 2025-10-01 23:45:48 +02:00
Václav Volhejn c754dab1ef Order groups 2025-10-01 22:31:03 +02:00
Václav Volhejn df54404733 Group by category 2025-10-01 22:21:03 +02:00
Václav Volhejn b7d98dd370 Fix case sensitivity for synonym search 2025-10-01 21:53:28 +02:00
Alex McLean 0ecacae71e format 2025-10-01 12:02:09 +01:00
yaxu 8cd497abb2 Update website/src/pages/technical-manual/project-start.mdx 2025-10-01 12:54:58 +02:00
Switch Angel AKA Jade Rose 070055d2ef Merge pull request 'Optimize wavetable synth' (#1613) from glossing/strudel:glossing/wavetable-optimizations into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1613
2025-10-01 08:56:33 +02:00
Switch Angel AKA Jade Rose e500ebe268 Merge branch 'main' into glossing/wavetable-optimizations 2025-10-01 08:54:53 +02:00
Aria 72298c5f03 Docstring cleanup 2025-10-01 00:45:26 -05:00
Aria c885d84785 Add comment 2025-10-01 00:39:44 -05:00
Aria a14bf4d97b Add aliases for distort types 2025-10-01 00:36:59 -05:00
Aria c5f1085bd9 WIP 2025-09-30 23:51:59 -05:00
Aria ccbf28f2db Merge branch 'main' into glossing/distortion-modes 2025-09-30 23:25:57 -05:00
Aria 3a7ec18d46 Move invsr to constructor 2025-09-30 23:19:55 -05:00
Aria a2b8407fbb Add back mipmaps; add caching 2025-09-30 23:08:28 -05:00
Switch Angel AKA Jade Rose ac1fd88d8d Merge pull request 'fix: pattern switching' (#1616) from fix_pattern_Switching into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1616
2025-10-01 02:02:30 +02:00
Jade (Rose) Rowland 9f8143e062 format 2025-09-30 19:46:53 -04:00
Jade (Rose) Rowland cdc5e5f3f3 working 2025-09-30 19:45:30 -04:00
Aria bad498a1e5 Remove unused var 2025-09-30 16:21:28 -07:00
Switch Angel AKA Jade Rose f4cf77f5c6 Merge branch 'main' into solo 2025-09-30 08:09:37 +02:00
Aria 4de0c11f8c Remove mipmaps, fix clamping of parameters 2025-09-29 14:15:50 -07:00
Dr Mathew R Pocock 97af50222f Merge branch 'main' into feature/autocomplete-sound-names 2025-09-29 18:10:12 +02:00
Switch Angel AKA Jade Rose f360d394a7 Merge pull request 'fix wavetable JSON' (#1611) from fix_JSON into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1611
2025-09-29 02:10:53 +02:00
Jade (Rose) Rowland 48718daea8 add_vgame 2025-09-28 19:57:19 -04:00
Jade (Rose) Rowland 8d45016ccf working 2025-09-28 19:11:13 -04:00
Switch Angel AKA Jade Rose ec69f6fd77 Merge pull request 'rename wavetable controls to match existing naming conventions' (#1610) from wavetable_controls into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1610
2025-09-28 21:28:15 +02:00
Jade (Rose) Rowland d94f145649 fix vib 2025-09-28 15:23:58 -04:00
Jade (Rose) Rowland bf3fe605d9 fix unison gain 2025-09-28 15:21:06 -04:00
Jade (Rose) Rowland 54ebc97ddc fix tests 2025-09-28 15:07:35 -04:00
Jade (Rose) Rowland c689874bb4 simplify modulators 2025-09-28 14:57:12 -04:00
Jade (Rose) Rowland 23d4bfa9d9 rename controls 2025-09-28 09:19:39 -04:00
Switch Angel AKA Jade Rose 91eb50f1c1 Merge pull request '<Warn: Don't merge until tables uploaded> Feature: Wavetable synth improvements' (#1607) from glossing/strudel:glossing/wavetable-synth into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1607
2025-09-27 23:28:12 +02:00
Aria 5838ade740 Merge branch 'main' into glossing/wavetable-synth 2025-09-27 13:17:05 -07:00
Aria 917d01c47d Add LFOs and envelopes 2025-09-27 12:48:37 -07:00
Switch Angel AKA Jade Rose 0a51718df3 Merge pull request 'wavetable improvements' (#1608) from wt_improvements into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1608
2025-09-27 21:43:09 +02:00
Jade (Rose) Rowland 774372a339 format 2025-09-27 15:29:55 -04:00
Jade (Rose) Rowland 626a99ba5b supports old documented way of loading wavetables: 2025-09-27 15:22:54 -04:00
Aria 8c3ee6db6b Missed deletion 2025-09-27 11:07:04 -07:00
Aria c5c05ebadc Clean up to align with other PR 2025-09-27 11:02:57 -07:00
Aria a8918d55fb Actually update normalizer 2025-09-27 10:45:30 -07:00
Aria 07e3ddbe40 Merge branch 'main' into glossing/distortion-modes 2025-09-27 10:25:51 -07:00
Jade (Rose) Rowland a9957b45e5 suppoert existing wt_ api 2025-09-27 13:22:21 -04:00
Jade (Rose) Rowland 4bd103e612 gain adj 2025-09-27 11:31:43 -04:00
Aria 466234bad6 Merge branch 'main' into glossing/wavetable-synth 2025-09-26 21:22:45 -07:00
Aria 97beaec25a Added examples, fixed samplerate issue on import, added to settings tab, fixed spread, added default wavetables, change default phaserand to 0 2025-09-26 20:46:10 -07:00
Jade (Rose) Rowland 2b3b638943 sample source for WT 2025-09-26 21:47:45 -05:00
Switch Angel AKA Jade Rose e1629e8383 Merge pull request 'create orbit based DJ filter' (#1603) from djf into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1603
2025-09-26 08:48:45 +02:00
Jade (Rose) Rowland 266cb614a8 add better example 2025-09-25 23:44:32 -07:00
Jade (Rose) Rowland dfc4a0818c res adjust 2025-09-25 23:39:08 -07:00
Jade (Rose) Rowland 236ff577a6 Merge branch 'main' into djf 2025-09-25 23:18:22 -07:00
Switch Angel AKA Jade Rose 66a32ac45d Merge pull request 'Feature: Wavetable synth' (#1525) from glossing/strudel:glossing/wavetable-synth into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1525
2025-09-26 08:15:48 +02:00
Aria 8b2c35b7a3 Cleanup 2025-09-25 01:10:41 -07:00
Aria f8f42565ae Typo - add back slight delay in cleanup 2025-09-25 00:40:25 -07:00
Aria 96981c3c1d A bit more cleanup 2025-09-25 00:36:28 -07:00
Aria bd8d207a3d Typo 2025-09-25 00:17:13 -07:00
Aria e3741ae8fa Add control over phase randomization and fix a bug with supersaw 2025-09-25 00:05:50 -07:00
Switch Angel AKA Jade Rose ef87f65bef Merge branch 'main' into glossing/wavetable-synth 2025-09-25 07:21:17 +02:00
Aria b3537a9acb Some cleanup 2025-09-24 22:17:30 -07:00
Aria d3d9f23c3c Remove unnecessary defaulting 2025-09-24 22:06:53 -07:00
Jade (Rose) Rowland c474b8c92e rm comment 2025-09-24 20:33:51 -07:00
Jade (Rose) Rowland da81ba00fb adjust control range 2025-09-24 20:32:45 -07:00
Aria f0669ce3ba Move algorithm into constructor 2025-09-24 17:32:03 -07:00
Jade (Rose) Rowland 28c94efaa9 format 2025-09-24 00:24:25 -07:00
Jade (Rose) Rowland 0633954e24 working 2025-09-24 00:23:05 -07:00
Switch Angel AKA Jade Rose cedf09168f Merge pull request 'fix: time signal' (#1583) from fix_time into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1583
2025-09-23 13:28:19 +02:00
Switch Angel AKA Jade Rose 3373225f53 Merge branch 'main' into fix_time 2025-09-23 13:13:51 +02:00
Jade (Rose) Rowland 1eb9dc73fa fix duck 2025-09-22 00:34:57 -04:00
Jade (Rose) Rowland fdcdc3aaa0 rm deadcode 2025-09-22 00:13:59 -04:00
Jade (Rose) Rowland da926805b3 rm dead code 2025-09-22 00:12:48 -04:00
Jade (Rose) Rowland 82893ffc22 fix import 2025-09-22 00:11:02 -04:00
Jade (Rose) Rowland beafd9c700 format 2025-09-22 00:07:06 -04:00
Jade (Rose) Rowland c5bd2a7487 working 2025-09-21 23:54:04 -04:00
Kissaki 4d39f36868 Fix web README sample code
Looks like the code was copied, and then the wrong string was replaced when creating this code sample.
2025-09-21 18:31:59 +02:00
Kissaki c64aa3bf01 Fix link syntax in project-start 2025-09-21 18:27:05 +02:00
Dr Mathew R Pocock b4d57f12fe Merge branch 'main' into feature/autocomplete-sound-names 2025-09-21 18:13:40 +02:00
froos 118086aff5 Merge pull request 'mondo: fix all + setcpm + setcps' (#1600) from mondo-fixes into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1600
2025-09-21 16:16:05 +02:00
Felix Roos 452827630b move unpure up 2025-09-21 16:13:09 +02:00
Felix Roos 86248328cc fix: mondo setcps / setcpm 2025-09-21 16:09:10 +02:00
Felix Roos 8833d623f7 fix: all function in mondo 2025-09-21 16:06:28 +02:00
froos 3fff4609a0 Merge pull request 'fix: osc error message' (#1597) from osc-debug-flag into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1597
2025-09-19 21:59:42 +02:00
Dr Mathew R Pocock 98a1573e27 Merge branch 'main' into feature/autocomplete-sound-names 2025-09-18 22:54:41 +02:00
Matthew Pocock 7080490c68 Merge handlers and cache regexes in autocomplete
- Merged scalePreColonHandler and scaleAfterColonHandler into single scaleHandler
- Merged modePreColonHandler and modeAfterColonHandler into single modeHandler
- Cached all regex patterns as constants above their respective handler functions
- Eliminated regex compilation overhead on every keystroke/navigation event
- Improved code maintainability by reducing duplication between similar handlers
- Preserved exact same functionality while improving performance

Each handler now follows a consistent pattern of checking after-colon context
first (more specific) then pre-colon context, with all regex patterns
pre-compiled for better performance during intensive autocomplete sessions.
2025-09-18 21:52:40 +01:00
froos e2b5b92a0c Merge pull request 'osc: --debug flag to see incoming messages' (#1595) from osc-debug-flag into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1595
2025-09-18 21:09:55 +02:00
Felix Roos 1c3e07afd3 fix: rephrase error message + bump to 1.2.10 2025-09-18 20:40:25 +02:00
Felix Roos c54fa7d266 chore: bump osc to 1.2.8 2025-09-18 20:39:05 +02:00
Felix Roos a25f763796 docs: add --debug flag to readme 2025-09-18 20:37:19 +02:00
Felix Roos 91ad3d729f feat: osc add --debug flag to log messages + log errors 2025-09-18 20:36:40 +02:00
Felix Roos a0c2edad30 fix: add clamp function 2025-09-18 10:54:41 +02:00
Felix Roos 82c9047195 fix: unstable filter 2025-09-18 10:47:23 +02:00
Matthew Pocock f51ad2cb7e Merge branch 'main' into feature/autocomplete-sound-names 2025-09-17 23:08:06 +01:00
froos 4cb0488839 Merge pull request 'simplify osc usage' (#1588) from osc-server-via-npx into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1588
2025-09-17 14:12:09 +02:00
Felix Roos 663229ecde bump osc to 1.2.8 2025-09-17 13:50:02 +02:00
Felix Roos cdb623cb66 overhaul osc readme 2025-09-17 13:39:35 +02:00
Felix Roos 28d7e0e489 export osc function to be able to do all(osc) 2025-09-17 13:39:28 +02:00
Felix Roos aba594b72a fix: bin field 2025-09-17 12:52:42 +02:00
Felix Roos 5d7c6c3e4b fix: add node shebang + bump osc to 1.2.6 2025-09-17 12:47:41 +02:00
Felix Roos 820744dc27 bump osc to 1.2.5 2025-09-17 12:42:11 +02:00
Felix Roos 5445f0812f configurable port for osc bridge + add bin field 2025-09-17 12:41:46 +02:00
Dr Mathew R Pocock 49868fc119 Merge branch 'main' into feature/autocomplete-sound-names 2025-09-16 21:00:40 +02:00
Jade (Rose) Rowland a68c784753 rm unessecary change 2025-09-16 11:55:31 -04:00
Jade (Rose) Rowland f2b2f9f959 format 2025-09-16 11:53:19 -04:00
Jade (Rose) Rowland 53dd53553a Merge branch 'main' into fix_time 2025-09-16 11:52:54 -04:00
Jade (Rose) Rowland 89b7eac789 fix test 2025-09-16 11:52:36 -04:00
Jade (Rose) Rowland 9cdba1a50e Working 2025-09-16 11:36:21 -04:00
Switch Angel AKA Jade Rose 98b7003504 Merge pull request 'dev: logger errors to console in dev mode' (#1585) from devlog into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1585
2025-09-16 16:59:57 +02:00
Matthew Pocock cb2dc6304f Merge branch 'feature/autocomplete-sound-names' of ssh://codeberg.org/drdozer/strudel into feature/autocomplete-sound-names 2025-09-16 14:51:50 +01:00
Matthew Pocock edb6c0db2e Reordered handlers to be a bit more organised. 2025-09-16 14:45:22 +01:00
Dr Mathew R Pocock a46a055246 Merge branch 'main' into feature/autocomplete-sound-names 2025-09-16 15:42:35 +02:00
Jade (Rose) Rowland 9a8f8a051c rm comment 2025-09-16 01:48:37 -04:00
Jade (Rose) Rowland 3eb40ee7d3 working in dev 2025-09-16 01:44:01 -04:00
Jade (Rose) Rowland 4cc453c640 fix test 2025-09-15 22:09:05 -04:00
Jade (Rose) Rowland 74e27ca94f coerce in correct place 2025-09-15 21:57:56 -04:00
Jade (Rose) Rowland 7dfd7dbcdc rmconsole 2025-09-15 21:47:40 -04:00
Jade (Rose) Rowland 2cba1dcb31 working 2025-09-15 21:46:37 -04:00
Switch Angel AKA Jade Rose 48a6a12648 Merge pull request 'Bug Fix / Feature: Updates to duck to avoid clicks and allow configuration over release/attack' (#1514) from glossing/strudel:glossing/ducking-click into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1514
2025-09-16 03:19:36 +02:00
Dr Mathew R Pocock 71dd45cd4b Merge branch 'main' into feature/autocomplete-sound-names 2025-09-16 02:13:26 +02:00
froos 6bbf7cbe32 Merge pull request 'Feat: Enhance scale function to quantize notes to a named scale' (#1492) from glossing/strudel:glossing/scale-for-notes into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1492
2025-09-15 23:36:30 +02:00
froos 9f36b73081 Merge pull request 'add tic80 font' (#1579) from tic80font into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1579
2025-09-15 22:52:13 +02:00
Matthew Pocock 6ebe84e096 Added completion for chord. 2025-09-15 21:34:15 +01:00
Felix Roos a7e485992e add tic80 font 2025-09-15 20:54:39 +02:00
Matthew Pocock cb011c8bb0 Add autocomplete for mode function
- Added modePreColonHandler for autocomplete of mode values (below, above, duck, root)
- Added modeAfterColonHandler for pitch name completion after colon in mode:anchor syntax
- Follows same pattern as sound/bank/scale handlers for complex expressions
- Supports expressions like '<above [below root]>' with proper fragment matching
- Uses regex pattern (?:[\s\[\{\()<])([\w:]*)$ to handle delimited expressions
2025-09-15 18:44:30 +01:00
drdozer c8875b29c1 Improve autocompletion behavior
- Refactored handlers to use consistent early return pattern for better readability
- Added blocking behavior for unquoted contexts (sound(, scale(, bank()) to guide users toward correct syntax instead of showing irrelevant fallback completions
- Fixed soundHandler to show all sounds when fragment is empty (e.g., sound(""))
- Simplified bankHandler by removing complex quote handling logic in favor of consistent blocking pattern
- Made scale handler regex patterns consistent (removed leading dots)
- All handlers now follow same structure: block unquoted contexts, provide completions for quoted contexts
2025-09-15 14:27:59 +01:00
drdozer 978616833a Merged autocomplete.mjs conflict. 2025-09-15 13:01:16 +01:00
Aria ab74ccfe7c Merge branch 'main' into glossing/ducking-click 2025-09-14 18:28:00 -05:00
Aria 92b2013cf6 Correctly handle silences for non-notes 2025-09-14 17:04:39 -05:00
froos 2e97fb7be2 Merge pull request 'supradough: fix delay + add some jsdoc types' (#1578) from supradough-fixes into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1578
2025-09-15 00:00:18 +02:00
Felix Roos df1934f87b add some typechecking + fix delay 2025-09-14 23:54:51 +02:00
froos d3472feb5c Merge pull request 'added plyWith/plyWithClassic functions' (#1571) from Dsm0/strudel:add_plyWith into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1571
2025-09-14 12:42:57 +02:00
Dsm0 addb6db1c7 updated names + snapshot 2025-09-14 02:21:25 -07:00
froos 566d590453 Merge pull request 'feat: sound alias' (#1494) from Antipathie/strudel:feature/592-sound-alias into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1494
2025-09-14 10:39:11 +02:00
froos e57bd98da0 Merge branch 'main' into feature/592-sound-alias 2025-09-14 10:34:47 +02:00
Dsm0 f5c4373f99 added plyWith/plyWithClassic functions 2025-09-13 17:21:19 -07:00
froos e762291bb7 Merge pull request 'Bug Fix: Allow penv values to be falsy' (#1559) from glossing/strudel:glossing/penv-with-zeros into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1559
2025-09-14 01:20:14 +02:00
froos 1de8123437 Merge branch 'main' into lu/flux 2025-09-14 01:12:28 +02:00
Felix Roos 9da027d377 hotfix: format 2025-09-14 01:11:34 +02:00
froos 96dccdc38b Merge pull request 'Update website/src/pages/workshop/first-sounds.mdx' (#1566) from fesmith/strudel:main into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1566
2025-09-14 01:10:47 +02:00
Felix Roos d6254294b0 fix: bring back tests on external PRs (push doesn't cut it for forks) 2025-09-14 01:09:30 +02:00
froos 339c1bb573 Merge pull request 'fix: autocomplete-styles + html rendering' (#1570) from autocomplete-styles into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1570
2025-09-14 01:07:47 +02:00
Felix Roos 9782795761 fix: autocomplete container style 2025-09-14 01:04:48 +02:00
Felix Roos 2d2b238da9 fix: use template element for string to html 2025-09-14 01:03:14 +02:00
froos f0839e02eb Merge pull request 'Feature: Synonyms in autocomplete and reference' (#1535) from glossing/strudel:glossing/synonyms-in-autocomplete into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1535
2025-09-14 00:49:16 +02:00
Felix Roos a9f7d825c8 hotfix: format 2025-09-14 00:40:54 +02:00
Aria 709b654ed3 Add synonyms to autocomplete 2025-09-13 16:21:09 -05:00
drdozer c265595536 Merge branch 'feature/autocomplete-sound-names' of ssh://codeberg.org/drdozer/strudel into feature/autocomplete-sound-names 2025-09-13 21:36:48 +01:00
drdozer 1670aebad8 Updated the gitignore rules for vscode. 2025-09-13 21:36:24 +01:00
drdozer 39460eb100 Commiting lockfile. 2025-09-13 21:36:24 +01:00
drdozer cd659ac2a1 feat: sound autocomplete matches anywhere in name using includes() 2025-09-13 21:36:24 +01:00
drdozer ed182d4b3f Updated the codemirror packages to be able to access additional imports. 2025-09-13 21:36:24 +01:00
drdozer 90614612e2 feat: add E# and B# to pitchNames for complete enharmonic coverage 2025-09-13 21:36:24 +01:00
drdozer 6b6d4b86a6 refactor: modularize autocomplete context handlers using strategy array 2025-09-13 21:36:24 +01:00
drdozer 0b67473bd3 refactor: modularize autocomplete context handlers using strategy array 2025-09-13 21:36:24 +01:00
drdozer d87ce960d2 feat: implement context-aware autocomplete
Adds context-sensitive autocompletion for:
- Sound names in s("...") and sound("...") after the opening quote or after whitespace/bracket
- Bank names in bank("...") with quote handling and live filtering
- Scale types in .scale("...") after the colon, inserting colon-form for multi-word names
- Pitch names (C, C#, Db, etc.) for scale keys on explicit completion (Ctrl+Space) before the colon
- Blocks fallback completions in scale context before colon to avoid function list cross-talk
2025-09-13 21:36:24 +01:00
Aria 23aa8ef509 Add ability for LFOs to target.. other lfos :devil emoji: 2025-09-13 14:49:36 -05:00
Aria 945b325336 Codeformat, example tests 2025-09-13 14:33:32 -05:00
Aria 502f0b5c23 Merge branch 'main' into glossing/lfo-anything 2025-09-13 14:32:41 -05:00
Aria 69b034349a Codeformat 2025-09-13 14:30:05 -05:00
Aria ed00686804 Codeformat 2025-09-13 14:29:28 -05:00
Aria e10c469749 Merge branch 'main' into glossing/ducking-click 2025-09-13 14:28:35 -05:00
Aria 5f7e10733a Merge branch 'main' into glossing/distortion-modes 2025-09-13 14:23:17 -05:00
froos d81a214c74 Merge pull request 'Docs: add xen package examples' (#1446) from dudymas/strudel:docs/xen/added-tune into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1446
2025-09-13 20:01:47 +02:00
froos e57f240e70 Merge branch 'main' into docs/xen/added-tune 2025-09-13 20:00:35 +02:00
Felix Roos e18296e760 hotfix: word 2025-09-13 19:52:07 +02:00
froos c145355ccc Merge pull request 'Update website/src/pages/learn/code.mdx' (#1391) from anecondev/strudel:main into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1391
2025-09-13 19:51:09 +02:00
fesmith 352a3c39d7 Update website/src/pages/workshop/first-sounds.mdx 2025-09-13 00:00:36 +02:00
drdozer c85a4d4fc1 Merge branch 'feature/autocomplete-sound-names' of ssh://codeberg.org/drdozer/strudel into feature/autocomplete-sound-names 2025-09-12 12:12:02 +01:00
drdozer 7676641c9e Commiting lockfile. 2025-09-12 12:11:36 +01:00
Dr Mathew R Pocock 260d2e499e Merge branch 'main' into feature/autocomplete-sound-names 2025-09-12 13:04:11 +02:00
Felix Roos a46617f3f0 hotfix: use ?audioworklet for supradough worklet import 2025-09-12 10:16:37 +02:00
Felix Roos d164b5e7f5 Revert "Revert "Merge pull request 'supradough poc' (#1362) from supradough into main""
This reverts commit c0bf86d11e.
2025-09-12 10:08:55 +02:00
Felix Roos c0bf86d11e Revert "Merge pull request 'supradough poc' (#1362) from supradough into main"
This reverts commit 6f06683d70, reversing
changes made to 637d714ab2.
2025-09-11 23:19:22 +02:00
Switch Angel AKA Jade Rose 6f06683d70 Merge pull request 'supradough poc' (#1362) from supradough into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1362
2025-09-11 22:52:29 +02:00
drdozer e3409e52d0 Merge branch 'feature/autocomplete-sound-names' of ssh://codeberg.org/drdozer/strudel into feature/autocomplete-sound-names 2025-09-11 21:38:53 +01:00
drdozer 41d6f1b5da feat: sound autocomplete matches anywhere in name using includes() 2025-09-11 21:37:35 +01:00
Dr Mathew R Pocock aca4601734 Merge branch 'main' into feature/autocomplete-sound-names 2025-09-11 21:22:16 +02:00
drdozer 2a00fcdf5d Updated the codemirror packages to be able to access additional imports. 2025-09-11 19:01:22 +01:00
drdozer 9200a67a60 feat: add E# and B# to pitchNames for complete enharmonic coverage 2025-09-11 19:00:05 +01:00
drdozer 80fe5b8140 refactor: modularize autocomplete context handlers using strategy array 2025-09-11 18:59:50 +01:00
drdozer 085e839bfe refactor: modularize autocomplete context handlers using strategy array 2025-09-11 18:59:26 +01:00
drdozer 7ff7e8852b feat: implement context-aware autocomplete
Adds context-sensitive autocompletion for:
- Sound names in s("...") and sound("...") after the opening quote or after whitespace/bracket
- Bank names in bank("...") with quote handling and live filtering
- Scale types in .scale("...") after the colon, inserting colon-form for multi-word names
- Pitch names (C, C#, Db, etc.) for scale keys on explicit completion (Ctrl+Space) before the colon
- Blocks fallback completions in scale context before colon to avoid function list cross-talk
2025-09-11 18:42:23 +01:00
Felix Roos 637d714ab2 Publish
- @strudel/mondo@1.1.4
2025-09-11 19:14:00 +02:00
Felix Roos c42d00f048 hotfix: export mondo getLocations 2025-09-11 19:11:45 +02:00
Felix Roos 702e558d1a Publish
- @strudel/mondo@1.1.3
2025-09-11 17:30:38 +02:00
froos bcc2e8f759 Merge pull request 'fix: exclude mondough dependencies' (#1563) from fix-mondo-package into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1563
2025-09-11 17:29:34 +02:00
Felix Roos 27339715b7 fix: exclude mondough dependencies 2025-09-11 17:22:06 +02:00
Felix Roos 5e2e6411e5 Publish
- @strudel/codemirror@1.2.5
 - @strudel/repl@1.2.6
2025-09-11 08:26:20 +02:00
Aria 9848740e18 Formatting and tests 2025-09-10 21:39:02 -05:00
Aria 51b150b829 Optimize folding for audio rate 2025-09-10 21:27:56 -05:00
froos 0fac16e769 Merge pull request 'add basicSetup for keybindings' (#1462) from Dsm0/strudel:codemirror-keymap-fix into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1462
2025-09-11 00:27:20 +02:00
Aria 38ce593c60 Allow penv values to be falsy 2025-09-09 20:47:09 -05:00
Aria 798eb22d9a Use currentTime for exact scheduling 2025-09-06 10:09:44 -05:00
Aria 9c108862ef Corrected piping 2025-09-05 22:09:50 -05:00
Aria 46a45b4596 Some missing cleanup 2025-09-04 20:51:06 -05:00
Aria 1205573bc6 Merge branch 'main' into glossing/wavetable-synth 2025-09-04 20:31:01 -05:00
Aria 2ccbb0596d Codeformat 2025-09-04 20:27:32 -05:00
Aria 862b88b6c4 Some typos and cleanup 2025-09-04 20:27:05 -05:00
Aria 9b1c23d49f Some tuning experimentally and adding back chebyshev 2025-09-04 20:05:28 -05:00
Aria 42ab65abdb Move things around to allow selection by name and avoid circular imports; fixed chebyshev 2025-09-04 11:47:01 -05:00
Aria bb982e6b9b First pass at modes 2025-09-03 21:55:48 -05:00
Antipathie 56b1ea3fa5 Add soundAlias function 2025-09-03 00:47:45 +02:00
Aria c199b51645 Update autocomplete name to be the label and update ref to use main name as a synonym 2025-09-02 16:29:01 -05:00
Aria 8d2a368da9 Add some more synonyms to controls docs 2025-09-02 16:14:50 -05:00
Aria 052d09e892 Add synonyms to reference 2025-09-02 16:14:38 -05:00
Aria 439a7dc5e6 Include synonyms in autocomplete 2025-09-02 16:05:40 -05:00
Aria 4e2e790864 Set delay and reverb nodes properly 2025-09-01 20:45:53 -05:00
Aria 4f3b40bd7b Merge branch 'main' into glossing/ducking-click 2025-09-01 20:45:00 -05:00
Jade (Rose) Rowland b8e1b8d7ac Merge branch 'main' into supradough 2025-08-31 22:42:07 -04:00
Aria e4070b86f8 More descriptive variables and comments 2025-08-29 14:33:14 -05:00
Lu[ke] Wilson 781c477078 rename to juxFlip 2025-08-29 17:20:18 +01:00
Lu[ke] Wilson e2cdce5ac9 add flux function 2025-08-29 15:35:41 +01:00
Aria fe46e1da53 Update docstring to include new warp modes; save sample server for a separate PR 2025-08-28 16:28:33 -05:00
Aria d1869c18ba Remove internal LFO 2025-08-28 16:25:10 -05:00
Aria 02cd79a6d9 Add wavetable oscillator with scanning, warps, and detune 2025-08-28 16:25:10 -05:00
Aria 9eeb6da3e6 Codeformat 2025-08-28 14:54:09 -05:00
Aria 869141b0a3 Parity with old adsr 2025-08-28 00:31:37 -05:00
Aria ea017e7622 Working version 2025-08-27 20:11:00 -05:00
Aria 763f900c69 First pass at envelopes with curves 2025-08-27 19:19:54 -05:00
Aria cd7865a66f Merge branch 'main' into glossing/lfo-anything 2025-08-27 16:28:26 -05:00
Aria 9c8e39d83d Add.. a lot of doc strings 2025-08-27 16:27:36 -05:00
Aria 022ac95bbd Typo 2025-08-26 12:09:12 -05:00
Aria b3e25cfc52 Merge branch 'main' into glossing/ducking-click 2025-08-26 12:08:58 -05:00
Aria 3d25aa1b91 Rename params, more examples 2025-08-26 12:06:10 -05:00
Aria 0a4b6a01b3 Merge branch 'main' into glossing/random 2025-08-24 21:19:49 -05:00
Aria b3e433291c Turn back on silent 2025-08-24 21:15:47 -05:00
Aria 969c9663ef Update tests for new randomness 2025-08-24 21:15:11 -05:00
Aria 5e4e678800 Test bleed, some docstrings 2025-08-24 21:14:57 -05:00
Aria b8423f0ed1 Add docstring 2025-08-24 12:01:12 -05:00
Aria 5d5159a08f Add option to use old random and a benchmark 2025-08-24 11:56:11 -05:00
Aria 1e96d59ac8 Merge branch 'main' into glossing/random 2025-08-24 11:05:57 -05:00
Aria b8c46d6b26 Added some description and examples of multi-accidentals and negative octaves 2025-08-22 13:23:41 -05:00
Aria 79453ac2c3 Allow negatives and multi-accidentals 2025-08-22 13:17:13 -05:00
Aria b08890bd9e Working version with note names 2025-08-22 11:25:13 -05:00
Aria 938c92fda2 Merge branch 'main' into glossing/scale-for-notes 2025-08-21 15:58:43 -05:00
Aria 9a9fe83f9c Example tests 2025-08-21 14:13:01 -05:00
Aria bf5d9917ab Codeformat and examples 2025-08-21 13:20:12 -05:00
Aria 4f15d681b0 Add release parameter, avoid clicks, some cleanup 2025-08-21 13:12:36 -05:00
Aria 6a9739bed5 Code format and a typo on lfoNum 2025-08-20 13:39:24 -05:00
Aria d8f0d70908 Big refactor; start envelope at current value 2025-08-20 13:22:37 -05:00
Aria e25eab11ad Working version of envelopes 2025-08-20 10:47:57 -05:00
Aria efb337677c Fully working version with multiple LFOs 2025-08-20 10:08:36 -05:00
Aria 4a70ac5a99 Working version of LFOs 2025-08-20 00:38:25 -05:00
Aria 554d6118c6 Merge branch 'main' into glossing/random 2025-08-19 19:10:18 -05:00
Aria 03271ec5fb Remove stray comments 2025-08-19 18:15:24 -05:00
Aria a0760f9468 Merge branch 'main' into glossing/random 2025-08-19 17:46:09 -05:00
Aria 058d950121 Working version of updated randomness 2025-08-15 22:57:59 -05:00
Aria c8c6a2ce08 Add example test and update fastChunk test (which was previously broken) 2025-08-15 13:34:43 -05:00
Aria a4c040e101 Add new tests, organize old tests, fix issue with note 2025-08-06 12:37:55 -05:00
Aria 7046c1f546 Cleanup and simplification; improved docstrings 2025-08-06 10:17:48 -05:00
Aria a4ab8e1b06 First pass at extending scale function to include notes 2025-08-06 00:45:01 -05:00
Felix Roos 7f103e77e3 prefix "S" for solo 2025-07-28 04:05:21 +02:00
daslyfe a26559fd3d Merge branch 'main' into supradough 2025-07-22 06:35:59 +02:00
Dsm0 5448fc6077 removed duplication and unnecessary keymappings in codemirror config 2025-07-16 15:17:34 -07:00
Dsm0 06fafbd8eb Ensure no default extensions conflict with extensions in defaultSettings 2025-07-16 15:03:55 -07:00
Dsm0 10156f0067 add basicSetup for keybindings 2025-07-15 19:13:24 -07:00
Felix Roos 5632d83afb fix: supradough onTrigger after breaking change 2025-07-16 02:21:39 +02:00
Felix Roos a32473d570 Merge remote-tracking branch 'origin/main' into supradough 2025-07-15 22:26:46 +02:00
dudymas e87bb4376f Merge branch 'main' into docs/xen/added-tune 2025-07-05 20:28:09 +02:00
dudymas 0722cf7ded feat(xen/tunejs): support sending a custom tuning 2025-07-05 13:43:42 -04:00
dudymas 37fde8f3e8 docs(website/learn/xen): discussed strumming 2025-07-05 13:43:09 -04:00
dudymas 8655c5b73c Merge branch 'main' into docs/xen/added-tune 2025-07-05 00:50:57 +02:00
dudymas 31c1450edc docs(website/learn/xen): add tune() examples 2025-07-04 18:50:21 -04:00
dudymas cbb4207bab chore(docker): basic support added 2025-07-04 18:50:21 -04:00
JoStro f5ae50c3ce Modify extend to better match behavior of ! operator 2025-07-01 22:07:22 +01:00
robmckinnon ad331c8c2e Show EDO intervals in _pitchwheel() display 2025-06-29 10:49:04 +02:00
robmckinnon 43293dc80f Import packages/edo into strudel 2025-06-29 10:49:04 +02:00
robmckinnon 73965a3a39 Add packages/edo for Equal Division of the Octave scales 2025-06-29 10:49:04 +02:00
anecondev 5efcd14f40 Update website/src/pages/learn/code.mdx
Correct "appended" to "prepended"
2025-06-18 17:07:13 +02:00
froos 8051e56d13 Merge branch 'main' into supradough 2025-06-14 00:35:52 +02:00
Felix Roos 239987af0b snapshot 2025-06-12 10:23:06 +02:00
Felix Roos 8363ba5a41 format 2025-06-12 10:22:35 +02:00
Felix Roos 30f7127a92 Merge remote-tracking branch 'origin/main' into supradough 2025-06-12 10:22:08 +02:00
Felix Roos 14193abe03 improve export: add stereo + measure performance + add bigger pattern for testing 2025-06-12 02:26:50 +02:00
Felix Roos 3caf08e199 up latency 2025-06-12 02:26:08 +02:00
Felix Roos 5cbd38a3e8 improve filter performance making it accept hz directly 2025-06-12 02:25:46 +02:00
Felix Roos bbd7ed0f27 lazy sample loading 2025-06-12 02:25:04 +02:00
Jade (Rose) Rowland 43504d16b6 add chorus 2025-06-10 16:03:42 +02:00
Jade (Rose) Rowland 7e8206dcbc pitched delay 2025-06-10 12:31:21 +02:00
Felix Roos 3963b807eb fix: calling doughsamples multiple times 2025-06-09 22:32:41 +02:00
Felix Roos e99adffc56 vibrato 2025-06-09 22:29:35 +02:00
Felix Roos c9f494d865 fix: node export 2025-06-09 22:10:09 +02:00
Felix Roos e8254735bb apply speed to synths and samples + add normalize flag (for fit) 2025-06-09 19:35:50 +02:00
Jade (Rose) Rowland 3d30007756 supersaw 2025-06-09 15:55:44 +02:00
Jade (Rose) Rowland aeaed50446 gaincurve 2025-06-09 15:18:47 +02:00
Felix Roos 3ac0fdf619 rudimentary sample map loading (doughsamples) 2025-06-09 11:07:57 +02:00
Felix Roos d1b6b6be85 fix: hpf 2025-06-09 09:54:24 +02:00
Felix Roos 1081fc69e9 refactor: stereo sample support + channelwise fx 2025-06-09 09:52:29 +02:00
Felix Roos 73ef43dd2c move things around in init
+ shorten things
2025-06-08 22:56:55 +02:00
Jade (Rose) Rowland 181e51ef0e adjustable envelope curves 2025-06-08 20:26:20 +02:00
Jade (Rose) Rowland 1167fdb910 Merge branch 'supradough' of https://github.com/tidalcycles/strudel into supradough 2025-06-08 19:25:47 +02:00
Jade (Rose) Rowland ec9109dd89 exponential lerp 2025-06-08 19:24:55 +02:00
Felix Roos 55aef18851 buffers can now be repitched (still with aliasing) 2025-06-08 14:43:23 +02:00
Felix Roos 356d4360ec fix: scheduling + sample playback 2025-06-08 09:05:14 +02:00
Felix Roos 0f2aa9569b half working samples 2025-06-08 02:04:49 +02:00
Felix Roos ac7ee376e5 pitch envelope 2025-06-08 00:43:58 +02:00
Felix Roos ab052ce1ac fix: polyblepped sawtooth + fm = death 2025-06-07 23:15:09 +02:00
Felix Roos 5988e3d3b4 fix: hot reloading for dough.mjs (see comment) 2025-06-07 22:42:48 +02:00
Felix Roos 2f2bf5bf29 fix: note2midi for notes without octave 2025-06-07 22:36:54 +02:00
Felix Roos b000f2297d fm 2025-06-07 20:31:47 +02:00
Felix Roos 77463a199a add square alias for pulse 2025-06-07 13:26:43 +02:00
Felix Roos e54449f5f7 white brown pink noise + crackle alias for dust 2025-06-07 13:24:06 +02:00
Felix Roos d743570546 set delay time and feedback from voice 2025-06-07 13:12:35 +02:00
Felix Roos 1dac69635d feedback delay (still hard coded feedback / time values) 2025-06-07 10:40:34 +02:00
Felix Roos 49f38aeddb remove log 2025-06-06 16:26:17 +02:00
Felix Roos 43c05cb504 move supradough to separate package 2025-06-06 16:17:05 +02:00
Felix Roos ccc90d547c ignore dough-export to fix checks 2025-06-06 15:47:19 +02:00
Felix Roos 998a010247 better filter envelopes 2025-06-06 11:21:01 +02:00
Felix Roos e4cd5dc552 rough filter envelope implementation 2025-06-06 10:55:38 +02:00
Felix Roos 6cf0b6f651 hpf + bpf 2025-06-06 10:12:49 +02:00
Felix Roos 794bf86904 distort 2025-06-06 09:56:41 +02:00
Felix Roos 9ed690ce45 pulse osc + velocity 2025-06-06 09:37:40 +02:00
Felix Roos 623bf93368 panning 2025-06-06 08:50:02 +02:00
Felix Roos 0cc18a6468 crush (might be wrong) 2025-06-06 08:27:47 +02:00
Felix Roos 87598e10d1 coarse 2025-06-06 08:17:20 +02:00
Felix Roos ccec7e725a poc: render pattern audio with node script 2025-06-05 11:04:55 +02:00
Felix Roos f0e6c5483c handle invalid spawns + remove logs 2025-06-05 10:30:53 +02:00
Felix Roos 2cbd35f6d2 refactor: make webaudio glue as minimal as possible 2025-06-05 10:26:14 +02:00
Felix Roos 930dabe4d6 dough as a singleton worklet with voice allocation 2025-06-05 09:54:44 +02:00
Jade (Rose) Rowland ff4b7ca171 fix volume 2025-06-04 01:08:36 +01:00
Jade (Rose) Rowland 5129fa6677 fix click 2025-06-04 00:48:32 +01:00
Felix Roos 5336569c25 proper lpf mapping + remove redundant worklet params, 2025-06-01 21:20:28 +02:00
Felix Roos 483843bd0a begin supradough 2025-06-01 18:06:36 +02:00
300 changed files with 28143 additions and 9626 deletions
+5
View File
@@ -0,0 +1,5 @@
{
"devToolbar": {
"enabled": false
}
}
+11
View File
@@ -0,0 +1,11 @@
**/node_modules
**/.angular
**/dist
.astro/
.forgejo/
.idea/
.vscode/
test/
.gitignore
Dockerfile
.dockerignore
+44
View File
@@ -0,0 +1,44 @@
name: Build and Deploy hot PRs
on:
pull_request_target:
types: [labeled]
# Allow one concurrent deployment
concurrency:
group: "warm-pages"
cancel-in-progress: false
jobs:
build:
if: ${{ github.event.label.name == 'serve-hot' }}
runs-on: docker
steps:
- uses: actions/checkout@v4
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
- name: Build
run: pnpm build
- name: Deploy
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
run: |
eval $(ssh-agent -s)
echo "$SSH_PRIVATE_KEY" | ssh-add -
apt update && apt install -y rsync
mkdir -p ~/.ssh
ssh-keyscan matrix.toplap.org > ~/.ssh/known_hosts
rsync -atv --delete --delete-after --progress \
./website/dist/ \
strudel@matrix.toplap.org:/home/strudel/deploy/pr-${{ github.event.pull_request.number }}.hot.strudel.cc
+40
View File
@@ -0,0 +1,40 @@
name: Build and Deploy to warm (strudel.cc)
on:
push:
branches:
- main
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
build:
runs-on: docker
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
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
- name: Build
run: pnpm build
- name: Deploy
run: |
eval $(ssh-agent -s)
echo "$SSH_PRIVATE_KEY" | ssh-add -
apt update && apt install -y rsync
mkdir ~/.ssh
ssh-keyscan matrix.toplap.org > ~/.ssh/known_hosts
rsync -atv --delete --delete-after --progress ./website/dist/ strudel@matrix.toplap.org:/home/strudel/deploy/strudel.cc
+2 -2
View File
@@ -1,4 +1,4 @@
name: Build and Deploy
name: Build and Deploy to cold (cold.strudel.cc)
on: [workflow_dispatch]
@@ -34,4 +34,4 @@ jobs:
apt update && apt install -y rsync
mkdir ~/.ssh
ssh-keyscan matrix.toplap.org > ~/.ssh/known_hosts
rsync -atv --delete --delete-after --progress ./website/dist/ strudel@matrix.toplap.org:/home/strudel/deploy
rsync -atv --delete --delete-after --progress ./website/dist/ strudel@matrix.toplap.org:/home/strudel/deploy/cold.strudel.cc
+2 -2
View File
@@ -1,6 +1,6 @@
name: Strudel tests
on: [push]
on: [push, pull_request]
jobs:
build:
@@ -19,7 +19,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
cache: "pnpm"
- run: pnpm install
- run: pnpm run format-check
- run: pnpm run lint
+14
View File
@@ -45,6 +45,20 @@ tidal-drum-machines
webaudiofontdata
src-tauri/target
### BEGIN Visual Studio Code ###
# Blanket, recursive exclude for .vscode directory and files
.vscode/**/*
# Unexclude specific files and directories within .vscode
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
### END Visual Studio Code ###
# BEGIN JetBrains -> END JetBrains
# for JetBrains IDE users, e.g. WebStorm. Source: https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
+1
View File
@@ -0,0 +1 @@
22
+1081
View File
File diff suppressed because it is too large Load Diff
+22 -17
View File
@@ -4,20 +4,13 @@ Thanks for wanting to contribute!!! There are many ways you can add value to thi
## Move to codeberg
We are currently in the process of moving from github to codeberg -- not everything is working, please bear with us.
To update your local clone, you can run this command:
```
git remote set-url origin git@codeberg.org:uzu/strudel.git
```
Along with many other live coding projects, we have moved from Microsoft's Github platform to Codeberg for ethical reasons. Please don't fork the project back to github.
## Communication Channels
To get in touch with the contributors, either
To get in touch with the community, either
- [join the Tidal Discord Channel](https://discord.com/invite/HGEdXmRkzT) and go to the #strudel channel
- [join the Uzulang Discord Server](https://discord.com/invite/HGEdXmRkzT) and go to the strudel channels (Uzulangs are a family of live coding languages inspired by each other, including TidalCycles as well as Strudel)
- Find related discussions on the [tidal club forum](https://club.tidalcycles.org/)
## Ask a Question
@@ -36,22 +29,35 @@ Use one of the Communication Channels listed above and drop us a line or two!
## Share Music
If you made some music with strudel, you can give back some love and share what you've done!
Your creation could also be part of the random selection in the REPL if you want.
Use one of the Communication Channels listed above.
(There used to be a random selection of contributed patterns in the REPL, but that is unfortunately disabled for now due to abuse)
## Improve the Docs
If you find some weak spots in the [docs](https://strudel.cc/workshop/getting-started/),
you can edit each file directly on codeburg. (we are currently fixing the "Edit this page" links in the right sidebar)
If you find some weak spots in the [docs](https://strudel.cc/workshop/getting-started/), you can edit each file directly on codeberg. There are "Edit this page" links in the right sidebar that take you to the right place.
## Propose a Feature
If you want a specific feature that is not part of strudel yet, feel free to use one of the communication channels above.
Maybe you even want to help with the implementation of that feature!
If you want a specific feature that is not part of strudel yet, feel free to use one of the communication channels above. Please bear in mind that this is a free/open source project, oriented around collaborative discussion. Maybe you even want to help with the implementation of that feature!
## Contribute a feature
Pull requests welcome! Consider starting with discussion or proof-of-concept first, rather than do loads of work on something and then find it doesn't fit the collective goals of the project, or something like that.
At the time of writing we have a PR backlog, and generally prioritise bugfixes and contributions that have arisen through community discussion.
### AI/LLM policy
Strudel is a project handmade by humans, with thought and nuance.
If you have used LLMs (so called 'AI'), please detail that in the pull request. We are still developing our response to the onslaught of LLM technology, but for practical and legal reasons are currently not accepting wholly LLM-generated code. We are also not accepting PRs that add LLM features to strudel itself.
There are #llm-chat and #llm-share channels on our discord. Please do not discuss or share LLM-related things outside of those channels.
## Report a Bug
If you've found a bug, or some behaviour that does not seem right, you are welcome to file an [issue](https://codeberg.org/uzu/strudel/issues).
Please check that it has not been reported before.
## Fix a Bug
@@ -118,8 +124,7 @@ There are also eslint extensions / plugins for most editors.
## Running all CI Checks
When opening a PR, the CI runner will automatically check the code style and eslint, as well as run all tests.
You can run the same check with `pnpm check`
When opening a PR, the CI runner will (once approved by a human) check the code style and eslint, as well as run all tests. You can run the same check with `pnpm check`.
## Package Workflow
+21
View File
@@ -0,0 +1,21 @@
FROM node:24
WORKDIR /app
RUN npm install pnpm --global
COPY pnpm-workspace.yaml ./
COPY package.json pnpm-lock.yaml ./
COPY packages/ ./packages/
COPY examples/ ./examples/
RUN mkdir -p website/public
COPY website/package.json ./website/
RUN pnpm install
COPY . .
EXPOSE 4321
CMD ["pnpm", "dev"]
+5 -2
View File
@@ -1,19 +1,22 @@
# strudel
Live coding patterns on the web
https://strudel.cc/
- Try it here: <https://strudel.cc>
- Docs: <https://strudel.cc/learn>
- Source: https://codeberg.org/uzu/strudel/
* Along with many other live coding projects, we have moved from Microsoft's Github platform to Codeberg for ethical reasons. **Please don't fork the project back to github**.
- Technical Blog Post: <https://loophole-letters.vercel.app/strudel>
- 1 Year of Strudel Blog Post: <https://loophole-letters.vercel.app/strudel1year>
- 2 Years of Strudel Blog Post: <https://strudel.cc/blog/#year-2>
## Running Locally
After cloning the project, you can run the REPL locally:
1. Install [Node.js](https://nodejs.org/)
1. Install [Node.js](https://nodejs.org/) 18 or newer
2. Install [pnpm](https://pnpm.io/installation)
3. Install dependencies by running the following command:
```bash
+1
View File
@@ -42,6 +42,7 @@ export default [
'**/hydra.mjs',
'**/jsdoc-synonyms.js',
'packages/hs2js/src/hs2js.mjs',
'packages/supradough/dough-export.mjs',
'**/samples',
],
},
@@ -1,4 +1,5 @@
<script src="https://unpkg.com/@strudel/repl@1.0.2"></script>
<script src="https://unpkg.com/@strudel/repl@1.2.7"></script>
<!-- <script src="../../packages/repl/dist/index.js"></script> -->
<strudel-editor>
<!--
// @date 23-08-15
+1
View File
@@ -29,6 +29,7 @@ const editor = new StrudelMirror({
import('@strudel/core'),
import('@strudel/draw'),
import('@strudel/mini'),
import('@strudel/edo'),
import('@strudel/tonal'),
import('@strudel/webaudio'),
);
+4
View File
@@ -15,10 +15,14 @@
"@strudel/codemirror": "workspace:*",
"@strudel/core": "workspace:*",
"@strudel/draw": "workspace:*",
"@strudel/edo": "workspace:*",
"@strudel/mini": "workspace:*",
"@strudel/soundfonts": "workspace:*",
"@strudel/tonal": "workspace:*",
"@strudel/transpiler": "workspace:*",
"@strudel/webaudio": "workspace:*"
},
"engines": {
"node": ">=18.0.0"
}
}
+3
View File
@@ -14,5 +14,8 @@
},
"dependencies": {
"@strudel/web": "workspace:*"
},
"engines": {
"node": ">=18.0.0"
}
}
+3
View File
@@ -18,5 +18,8 @@
"@strudel/transpiler": "workspace:*",
"@strudel/webaudio": "workspace:*",
"@strudel/tonal": "workspace:*"
},
"engines": {
"node": ">=18.0.0"
}
}
+3
View File
@@ -13,5 +13,8 @@
},
"devDependencies": {
"vite": "^6.0.11"
},
"engines": {
"node": ">=18.0.0"
}
}
+3
View File
@@ -32,5 +32,8 @@
},
"devDependencies": {
"vite": "^6.0.11"
},
"engines": {
"node": ">=18.0.0"
}
}
+1
View File
@@ -4,6 +4,7 @@ export * from './packages/core/index.mjs';
export * from './packages/csound/index.mjs';
export * from './packages/desktopbridge/index.mjs';
export * from './packages/draw/index.mjs';
export * from './packages/edo/index.mjs';
export * from './packages/embed/index.mjs';
export * from './packages/hydra/index.mjs';
export * from './packages/midi/index.mjs';
+7
View File
@@ -12,6 +12,13 @@ function defineTags(dictionary) {
doclet.synonyms = doclet.synonyms_text.split(/[ ,]+/);
},
});
dictionary.defineTag('tags', {
mustHaveValue: true,
onTagged: function (doclet, tag) {
doclet.tags = tag.value.split(/[ ,]+/);
},
});
}
module.exports = { defineTags: defineTags };
+211
View File
@@ -0,0 +1,211 @@
0 silly argv {
0 silly argv _: [ 'version' ],
0 silly argv private: false,
0 silly argv lernaVersion: '8.1.9',
0 silly argv '$0': 'node_modules/lerna/dist/cli.js'
0 silly argv }
1 notice cli v8.1.9
2 verbose packageConfigs Explicit "packages" configuration found in lerna.json. Resolving packages using the configured glob(s): ["packages/*"]
3 verbose rootPath /Users/jaderose/Documents/Github/cstrudel/strudel
4 info versioning independent
5 silly isAnythingCommitted
6 verbose isAnythingCommitted 1
7 silly getCurrentBranch
8 verbose currentBranch main
9 silly remoteBranchExists
10 silly isBehindUpstream
11 silly isBehindUpstream main is behind origin/main by 0 commit(s) and ahead by 4
12 silly hasTags
13 verbose hasTags true
14 silly git-describe.sync "@strudel/codemirror@1.2.7-4-ga3ac9646" => {"lastTagName":"@strudel/codemirror@1.2.7","lastVersion":"1.2.7","refCount":"4","sha":"a3ac9646","isDirty":false}
15 info Looking for changed packages since @strudel/codemirror@1.2.7
16 silly checking diff packages/codemirror
17 silly no diff found in @strudel/codemirror
18 silly checking diff packages/core
19 silly no diff found in @strudel/core
20 silly checking diff packages/csound
21 silly no diff found in @strudel/csound
22 silly checking diff packages/desktopbridge
23 silly no diff found in @strudel/desktopbridge
24 silly checking diff packages/draw
25 silly no diff found in @strudel/draw
26 silly checking diff packages/embed
27 silly no diff found in @strudel/embed
28 silly checking diff packages/gamepad
29 silly no diff found in @strudel/gamepad
30 silly checking diff packages/hs2js
31 silly no diff found in hs2js
32 silly checking diff packages/hydra
33 silly no diff found in @strudel/hydra
34 silly checking diff packages/midi
35 silly no diff found in @strudel/midi
36 silly checking diff packages/mini
37 silly no diff found in @strudel/mini
38 silly checking diff packages/mondo
39 silly no diff found in mondolang
40 silly checking diff packages/mondough
41 silly no diff found in @strudel/mondo
42 silly checking diff packages/motion
43 silly no diff found in @strudel/motion
44 silly checking diff packages/mqtt
45 silly no diff found in @strudel/mqtt
46 silly checking diff packages/osc
47 silly found diff in packages/osc/server.js
48 verbose filtered diff [ 'packages/osc/server.js' ]
49 silly checking diff packages/reference
50 silly no diff found in @strudel/reference
51 silly checking diff packages/repl
52 silly no diff found in @strudel/repl
53 silly checking diff packages/sampler
54 silly no diff found in @strudel/sampler
55 silly checking diff packages/serial
56 silly no diff found in @strudel/serial
57 silly checking diff packages/soundfonts
58 silly no diff found in @strudel/soundfonts
59 silly checking diff packages/superdough
60 silly found diff in packages/superdough/package.json
61 verbose filtered diff [ 'packages/superdough/package.json' ]
62 silly checking diff packages/supradough
63 silly found diff in packages/supradough/package.json
64 verbose filtered diff [ 'packages/supradough/package.json' ]
65 silly checking diff packages/tidal
66 silly no diff found in @strudel/tidal
67 silly checking diff packages/tonal
68 silly no diff found in @strudel/tonal
69 silly checking diff packages/transpiler
70 silly no diff found in @strudel/transpiler
71 silly checking diff packages/vite-plugin-bundle-audioworklet
72 silly no diff found in vite-plugin-bundle-audioworklet
73 silly checking diff packages/web
74 silly no diff found in @strudel/web
75 silly checking diff packages/webaudio
76 silly found diff in packages/webaudio/package.json
77 verbose filtered diff [ 'packages/webaudio/package.json' ]
78 silly checking diff packages/xen
79 silly no diff found in @strudel/xen
80 verbose updated @strudel/codemirror
81 verbose updated @strudel/csound
82 verbose updated @strudel/midi
83 verbose updated @strudel/osc
84 verbose updated @strudel/repl
85 verbose updated @strudel/soundfonts
86 verbose updated superdough
87 verbose updated supradough
88 verbose updated @strudel/web
89 verbose updated @strudel/webaudio
90 verbose git-describe undefined => "@strudel/codemirror@1.2.7-4-ga3ac9646"
91 silly git-describe parsed => {"lastTagName":"@strudel/codemirror@1.2.7","lastVersion":"1.2.7","refCount":"4","sha":"a3ac9646","isDirty":false}
92 info execute Skipping releases
93 silly lifecycle No script for "preversion" in "@strudel/monorepo", continuing
94 silly lifecycle No script for "preversion" in "@strudel/osc", continuing
95 silly lifecycle No script for "preversion" in "superdough", continuing
96 silly lifecycle No script for "preversion" in "supradough", continuing
97 verbose version supradough has no lockfile. Skipping lockfile update.
98 verbose version @strudel/osc has no lockfile. Skipping lockfile update.
99 verbose version superdough has no lockfile. Skipping lockfile update.
100 silly lifecycle No script for "version" in "supradough", continuing
101 silly lifecycle No script for "version" in "superdough", continuing
102 silly lifecycle No script for "preversion" in "@strudel/codemirror", continuing
103 silly lifecycle No script for "preversion" in "@strudel/webaudio", continuing
104 silly lifecycle No script for "version" in "@strudel/osc", continuing
105 verbose version @strudel/webaudio has no lockfile. Skipping lockfile update.
106 verbose version @strudel/codemirror has no lockfile. Skipping lockfile update.
107 silly lifecycle No script for "version" in "@strudel/codemirror", continuing
108 silly lifecycle No script for "version" in "@strudel/webaudio", continuing
109 silly lifecycle No script for "preversion" in "@strudel/csound", continuing
110 silly lifecycle No script for "preversion" in "@strudel/midi", continuing
111 silly lifecycle No script for "preversion" in "@strudel/soundfonts", continuing
112 silly lifecycle No script for "preversion" in "@strudel/web", continuing
113 verbose version @strudel/csound has no lockfile. Skipping lockfile update.
114 verbose version @strudel/midi has no lockfile. Skipping lockfile update.
115 verbose version @strudel/soundfonts has no lockfile. Skipping lockfile update.
116 verbose version @strudel/web has no lockfile. Skipping lockfile update.
117 silly lifecycle No script for "version" in "@strudel/midi", continuing
118 silly lifecycle No script for "version" in "@strudel/csound", continuing
119 silly lifecycle No script for "version" in "@strudel/soundfonts", continuing
120 silly lifecycle No script for "preversion" in "@strudel/repl", continuing
121 verbose version @strudel/repl has no lockfile. Skipping lockfile update.
122 silly lifecycle No script for "version" in "@strudel/web", continuing
123 silly lifecycle No script for "version" in "@strudel/repl", continuing
124 silly lifecycle No script for "version" in "@strudel/monorepo", continuing
125 verbose version Updating root pnpm-lock.yaml
126 silly version Skipped applying prettier to ignored file: packages/supradough/package.json
127 silly version Skipped applying prettier to ignored file: packages/superdough/package.json
128 silly version Skipped applying prettier to ignored file: packages/osc/package.json
129 silly version Skipped applying prettier to ignored file: packages/codemirror/package.json
130 silly version Skipped applying prettier to ignored file: packages/webaudio/package.json
131 silly version Skipped applying prettier to ignored file: packages/midi/package.json
132 silly version Skipped applying prettier to ignored file: packages/csound/package.json
133 silly version Skipped applying prettier to ignored file: packages/soundfonts/package.json
134 silly version Skipped applying prettier to ignored file: packages/web/package.json
135 silly version Skipped applying prettier to ignored file: packages/repl/package.json
136 silly version Skipped applying prettier to ignored file: pnpm-lock.yaml
137 silly gitAdd [
137 silly gitAdd 'packages/supradough/package.json',
137 silly gitAdd 'packages/superdough/package.json',
137 silly gitAdd 'packages/osc/package.json',
137 silly gitAdd 'packages/codemirror/package.json',
137 silly gitAdd 'packages/webaudio/package.json',
137 silly gitAdd 'packages/midi/package.json',
137 silly gitAdd 'packages/csound/package.json',
137 silly gitAdd 'packages/soundfonts/package.json',
137 silly gitAdd 'packages/web/package.json',
137 silly gitAdd 'packages/repl/package.json',
137 silly gitAdd 'pnpm-lock.yaml'
137 silly gitAdd ]
138 silly gitCommit Publish
138 silly gitCommit
138 silly gitCommit - @strudel/codemirror@1.2.8
138 silly gitCommit - @strudel/csound@1.2.8
138 silly gitCommit - @strudel/midi@1.2.8
138 silly gitCommit - @strudel/osc@1.3.2
138 silly gitCommit - @strudel/repl@1.2.9
138 silly gitCommit - @strudel/soundfonts@1.2.8
138 silly gitCommit - superdough@1.2.5
138 silly gitCommit - supradough@1.2.4
138 silly gitCommit - @strudel/web@1.2.8
138 silly gitCommit - @strudel/webaudio@1.2.9
139 verbose git [
139 verbose git 'commit',
139 verbose git '-F',
139 verbose git '/private/var/folders/hc/yf_zr55547sbcpz5rj7q85sc0000gn/T/3c85b5d4-56ae-40e9-8df7-db2bc1048402/lerna-commit.txt'
139 verbose git ]
140 silly gitTag @strudel/codemirror@1.2.8 git tag %s -m %s
141 verbose git [
141 verbose git 'tag',
141 verbose git '@strudel/codemirror@1.2.8',
141 verbose git '-m',
141 verbose git '@strudel/codemirror@1.2.8'
141 verbose git ]
142 silly gitTag @strudel/csound@1.2.8 git tag %s -m %s
143 verbose git [ 'tag', '@strudel/csound@1.2.8', '-m', '@strudel/csound@1.2.8' ]
144 silly gitTag @strudel/midi@1.2.8 git tag %s -m %s
145 verbose git [ 'tag', '@strudel/midi@1.2.8', '-m', '@strudel/midi@1.2.8' ]
146 silly gitTag @strudel/osc@1.3.2 git tag %s -m %s
147 verbose git [ 'tag', '@strudel/osc@1.3.2', '-m', '@strudel/osc@1.3.2' ]
148 silly gitTag @strudel/repl@1.2.9 git tag %s -m %s
149 verbose git [ 'tag', '@strudel/repl@1.2.9', '-m', '@strudel/repl@1.2.9' ]
150 silly gitTag @strudel/soundfonts@1.2.8 git tag %s -m %s
151 verbose git [
151 verbose git 'tag',
151 verbose git '@strudel/soundfonts@1.2.8',
151 verbose git '-m',
151 verbose git '@strudel/soundfonts@1.2.8'
151 verbose git ]
152 silly gitTag superdough@1.2.5 git tag %s -m %s
153 verbose git [ 'tag', 'superdough@1.2.5', '-m', 'superdough@1.2.5' ]
154 silly gitTag supradough@1.2.4 git tag %s -m %s
155 verbose git [ 'tag', 'supradough@1.2.4', '-m', 'supradough@1.2.4' ]
156 silly gitTag @strudel/web@1.2.8 git tag %s -m %s
157 verbose git [ 'tag', '@strudel/web@1.2.8', '-m', '@strudel/web@1.2.8' ]
158 silly gitTag @strudel/webaudio@1.2.9 git tag %s -m %s
159 verbose git [ 'tag', '@strudel/webaudio@1.2.9', '-m', '@strudel/webaudio@1.2.9' ]
160 error Error: Command failed with exit code 128: git tag superdough@1.2.5 -m superdough@1.2.5
160 error fatal: tag 'superdough@1.2.5' already exists
160 error at makeError (/Users/jaderose/Documents/Github/cstrudel/strudel/node_modules/.pnpm/execa@5.0.0/node_modules/execa/lib/error.js:59:11)
160 error at handlePromise (/Users/jaderose/Documents/Github/cstrudel/strudel/node_modules/.pnpm/execa@5.0.0/node_modules/execa/index.js:114:26)
160 error at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
160 error at async Promise.all (index 6)
160 error at async VersionCommand.gitCommitAndTagVersionForUpdates (/Users/jaderose/Documents/Github/cstrudel/strudel/node_modules/.pnpm/lerna@8.1.9_encoding@0.1.13/node_modules/lerna/dist/index.js:9957:11)
160 error at async VersionCommand.commitAndTagUpdates (/Users/jaderose/Documents/Github/cstrudel/strudel/node_modules/.pnpm/lerna@8.1.9_encoding@0.1.13/node_modules/lerna/dist/index.js:9933:18)
160 error at async Promise.all (index 0)
+5 -1
View File
@@ -48,6 +48,7 @@
"homepage": "https://strudel.cc",
"dependencies": {
"@strudel/core": "workspace:*",
"@strudel/edo": "workspace:*",
"@strudel/mini": "workspace:*",
"@strudel/tonal": "workspace:*",
"@strudel/transpiler": "workspace:*",
@@ -73,5 +74,8 @@
"prettier": "^3.4.2",
"vitest": "^3.0.4",
"vite-plugin-bundle-audioworklet": "workspace:*"
},
"engines": {
"node": ">=18.0.0"
}
}
}
+384 -23
View File
@@ -1,6 +1,11 @@
import jsdoc from '../../doc.json';
import { autocompletion } from '@codemirror/autocomplete';
import { h } from './html';
//TODO: fix tonal scale import
// import { Scale } from '@tonaljs/tonal';
// import { soundMap } from '@strudel/webaudio';
let soundMap = undefined;
import { complex } from '@strudel/tonal';
const escapeHtml = (str) => {
const div = document.createElement('div');
@@ -54,11 +59,12 @@ const buildExamples = (examples) =>
`
: '';
export const Autocomplete = ({ doc, label }) =>
export const Autocomplete = (doc) =>
h`
<div class="autocomplete-info-container">
<div class="autocomplete-info-tooltip">
<h3 class="autocomplete-info-function-name">${label || getDocLabel(doc)}</h3>
<h3 class="autocomplete-info-function-name">${getDocLabel(doc)}</h3>
${doc.synonyms_text ? `<div class="autocomplete-info-function-synonyms">Synonyms: ${doc.synonyms_text}</div>` : ''}
${doc.description ? `<div class="autocomplete-info-function-description">${doc.description}</div>` : ''}
${buildParamsList(doc.params)}
${buildExamples(doc.examples)}
@@ -74,29 +80,384 @@ const isValidDoc = (doc) => {
const hasExcludedTags = (doc) =>
['superdirtOnly', 'noAutocomplete'].some((tag) => doc.tags?.find((t) => t.originalTitle === tag));
const jsdocCompletions = jsdoc.docs
.filter((doc) => isValidDoc(doc) && !hasExcludedTags(doc))
// https://codemirror.net/docs/ref/#autocomplete.Completion
.map((doc) => ({
label: getDocLabel(doc),
// detail: 'xxx', // An optional short piece of information to show (with a different style) after the label.
info: () => Autocomplete({ doc }),
type: 'function', // https://codemirror.net/docs/ref/#autocomplete.Completion.type
}));
export function bankCompletions() {
// TODO: FIX IMPORT
const soundDict = soundMap?.get() ?? {};
const banks = new Set();
for (const key of Object.keys(soundDict)) {
const [bank, suffix] = key.split('_');
if (suffix && bank) banks.add(bank);
}
return Array.from(banks)
.sort()
.map((name) => ({ label: name, type: 'bank' }));
}
// Attempt to get all scale names from Tonal TODO: FIX IMPORT
let scaleCompletions = [];
// try {
// scaleCompletions = (Scale.names ? Scale.names() : []).map((name) => ({ label: name, type: 'scale' }));
// } catch (e) {
// console.warn('[autocomplete] Could not load scale names from Tonal:', e);
// }
// Valid mode values for voicing
const modeCompletions = [
{ label: 'below', type: 'mode' },
{ label: 'above', type: 'mode' },
{ label: 'duck', type: 'mode' },
{ label: 'root', type: 'mode' },
];
// Valid chord symbols from ireal dictionary plus empty string for major triads
const chordSymbols = ['', ...Object.keys(complex)].sort();
const chordSymbolCompletions = chordSymbols.map((symbol) => {
if (symbol === '') {
return {
label: 'major',
apply: '',
type: 'chord-symbol',
};
}
return {
label: symbol,
apply: symbol,
type: 'chord-symbol',
};
});
export const getSynonymDoc = (doc, synonym) => {
const synonyms = doc.synonyms || [];
const docLabel = getDocLabel(doc);
// Swap `doc.name` in for `s` in the list of synonyms
const synonymsWithDoc = [docLabel, ...synonyms].filter((x) => x && x !== synonym);
return {
...doc,
name: synonym,
longname: synonym,
synonyms: synonymsWithDoc,
synonyms_text: synonymsWithDoc.join(', '),
};
};
const jsdocCompletions = (() => {
const seen = new Set(); // avoid repetition
const completions = [];
for (const doc of jsdoc.docs) {
if (!isValidDoc(doc) || hasExcludedTags(doc)) continue;
const docLabel = getDocLabel(doc);
// Remove duplicates
const synonyms = doc.synonyms || [];
let labels = [docLabel, ...synonyms];
for (const label of labels) {
// https://codemirror.net/docs/ref/#autocomplete.Completion
if (label && !seen.has(label)) {
seen.add(label);
completions.push({
label,
info: () => Autocomplete(getSynonymDoc(doc, label)),
type: 'function', // https://codemirror.net/docs/ref/#autocomplete.Completion.type
});
}
}
}
return completions;
})();
// --- Handler functions for each context ---
const pitchNames = [
'C',
'C#',
'Db',
'D',
'D#',
'Eb',
'E',
'E#',
'Fb',
'F',
'F#',
'Gb',
'G',
'G#',
'Ab',
'A',
'A#',
'Bb',
'B',
'B#',
'Cb',
];
// Cached regex patterns for scaleHandler
const SCALE_NO_QUOTES_REGEX = /scale\(\s*$/;
const SCALE_AFTER_COLON_REGEX = /scale\(\s*['"][^'"]*:[^'"]*$/;
const SCALE_PRE_COLON_REGEX = /scale\(\s*['"][^'"]*$/;
const SCALE_PITCH_MATCH_REGEX = /([A-Ga-g][#b]*)?$/;
const SCALE_SPACES_TO_COLON_REGEX = /\s+/g;
function scaleHandler(context) {
// First check for scale context without quotes - block with empty completions
let scaleNoQuotesContext = context.matchBefore(SCALE_NO_QUOTES_REGEX);
if (scaleNoQuotesContext) {
return {
from: scaleNoQuotesContext.to,
options: [],
};
}
// Check for after-colon context first (more specific)
let scaleAfterColonContext = context.matchBefore(SCALE_AFTER_COLON_REGEX);
if (scaleAfterColonContext) {
const text = scaleAfterColonContext.text;
const colonIdx = text.lastIndexOf(':');
if (colonIdx !== -1) {
const fragment = text.slice(colonIdx + 1);
const filteredScales = scaleCompletions.filter((s) => s.label.startsWith(fragment));
const options = filteredScales.map((s) => ({
...s,
apply: s.label.replace(SCALE_SPACES_TO_COLON_REGEX, ':'),
}));
const from = scaleAfterColonContext.from + colonIdx + 1;
return {
from,
options,
};
}
}
// Then check for pre-colon context
let scalePreColonContext = context.matchBefore(SCALE_PRE_COLON_REGEX);
if (scalePreColonContext) {
if (!scalePreColonContext.text.includes(':')) {
if (context.explicit) {
const text = scalePreColonContext.text;
const match = text.match(SCALE_PITCH_MATCH_REGEX);
const fragment = match ? match[0] : '';
const filtered = pitchNames.filter((p) => p.toLowerCase().startsWith(fragment.toLowerCase()));
const from = scalePreColonContext.to - fragment.length;
const options = filtered.map((p) => ({ label: p, type: 'pitch' }));
return { from, options };
} else {
return { from: scalePreColonContext.to, options: [] };
}
}
}
return null;
}
// Cached regex patterns for soundHandler
const SOUND_NO_QUOTES_REGEX = /(s|sound)\(\s*$/;
const SOUND_WITH_QUOTES_REGEX = /(s|sound)\(\s*['"][^'"]*$/;
const SOUND_FRAGMENT_MATCH_REGEX = /(?:[\s[{(<])([\w]*)$/;
function soundHandler(context) {
// First check for sound context without quotes - block with empty completions
let soundNoQuotesContext = context.matchBefore(SOUND_NO_QUOTES_REGEX);
if (soundNoQuotesContext) {
return {
from: soundNoQuotesContext.to,
options: [],
};
}
// Then check for sound context with quotes - provide completions
let soundContext = context.matchBefore(SOUND_WITH_QUOTES_REGEX);
if (!soundContext) return null;
const text = soundContext.text;
const quoteIdx = Math.max(text.lastIndexOf('"'), text.lastIndexOf("'"));
if (quoteIdx === -1) return null;
const inside = text.slice(quoteIdx + 1);
const fragMatch = inside.match(SOUND_FRAGMENT_MATCH_REGEX);
const fragment = fragMatch ? fragMatch[1] : inside;
const soundNames = Object.keys(soundMap?.get() ?? {}).sort();
const filteredSounds = soundNames.filter((name) => name.includes(fragment));
let options = filteredSounds.map((name) => ({ label: name, type: 'sound' }));
const from = soundContext.to - fragment.length;
return {
from,
options,
};
}
// Cached regex patterns for bankHandler
const BANK_NO_QUOTES_REGEX = /bank\(\s*$/;
const BANK_WITH_QUOTES_REGEX = /bank\(\s*['"][^'"]*$/;
function bankHandler(context) {
// First check for bank context without quotes - block with empty completions
let bankNoQuotesContext = context.matchBefore(BANK_NO_QUOTES_REGEX);
if (bankNoQuotesContext) {
return {
from: bankNoQuotesContext.to,
options: [],
};
}
// Then check for bank context with quotes - provide completions
let bankMatch = context.matchBefore(BANK_WITH_QUOTES_REGEX);
if (!bankMatch) return null;
const text = bankMatch.text;
const quoteIdx = Math.max(text.lastIndexOf('"'), text.lastIndexOf("'"));
if (quoteIdx === -1) return null;
const inside = text.slice(quoteIdx + 1);
const fragment = inside;
let banks = bankCompletions();
const filteredBanks = banks.filter((b) => b.label.startsWith(fragment));
const from = bankMatch.to - fragment.length;
return {
from,
options: filteredBanks,
};
}
// Cached regex patterns for modeHandler
const MODE_NO_QUOTES_REGEX = /mode\(\s*$/;
const MODE_AFTER_COLON_REGEX = /mode\(\s*['"][^'"]*:[^'"]*$/;
const MODE_PRE_COLON_REGEX = /mode\(\s*['"][^'"]*$/;
const MODE_FRAGMENT_MATCH_REGEX = /(?:[\s[{(<])([\w:]*)$/;
function modeHandler(context) {
// First check for mode context without quotes - block with empty completions
let modeNoQuotesContext = context.matchBefore(MODE_NO_QUOTES_REGEX);
if (modeNoQuotesContext) {
return {
from: modeNoQuotesContext.to,
options: [],
};
}
// Check for after-colon context first (more specific)
let modeAfterColonContext = context.matchBefore(MODE_AFTER_COLON_REGEX);
if (modeAfterColonContext) {
const text = modeAfterColonContext.text;
const colonIdx = text.lastIndexOf(':');
if (colonIdx !== -1) {
const fragment = text.slice(colonIdx + 1);
// For anchor after colon, we can suggest pitch names
const filtered = pitchNames.filter((p) => p.toLowerCase().startsWith(fragment.toLowerCase()));
const options = filtered.map((p) => ({ label: p, type: 'pitch' }));
const from = modeAfterColonContext.from + colonIdx + 1;
return {
from,
options,
};
}
}
// Then check for pre-colon context
let modeContext = context.matchBefore(MODE_PRE_COLON_REGEX);
if (!modeContext) return null;
const text = modeContext.text;
const quoteIdx = Math.max(text.lastIndexOf('"'), text.lastIndexOf("'"));
if (quoteIdx === -1) return null;
const inside = text.slice(quoteIdx + 1);
const fragMatch = inside.match(MODE_FRAGMENT_MATCH_REGEX);
const fragment = fragMatch ? fragMatch[1] : inside;
const filteredModes = modeCompletions.filter((m) => m.label.startsWith(fragment));
const from = modeContext.to - fragment.length;
return {
from,
options: filteredModes,
};
}
// Cached regex patterns for chordHandler
const CHORD_NO_QUOTES_REGEX = /chord\(\s*$/;
const CHORD_WITH_QUOTES_REGEX = /chord\(\s*['"][^'"]*$/;
const CHORD_FRAGMENT_MATCH_REGEX = /(?:[\s[{(<])([\w#b+^:-]*)$/;
function chordHandler(context) {
// First check for chord context without quotes - block with empty completions
let chordNoQuotesContext = context.matchBefore(CHORD_NO_QUOTES_REGEX);
if (chordNoQuotesContext) {
return {
from: chordNoQuotesContext.to,
options: [],
};
}
// Then check for chord context with quotes - provide completions
let chordContext = context.matchBefore(CHORD_WITH_QUOTES_REGEX);
if (!chordContext) return null;
const text = chordContext.text;
const quoteIdx = Math.max(text.lastIndexOf('"'), text.lastIndexOf("'"));
if (quoteIdx === -1) return null;
const inside = text.slice(quoteIdx + 1);
// Use same fragment matching as sound/mode for expressions like "<G Am>"
const fragMatch = inside.match(CHORD_FRAGMENT_MATCH_REGEX);
const fragment = fragMatch ? fragMatch[1] : inside;
// Check if fragment contains any pitch name at start (for root + symbol)
let rootMatch = null;
let symbolFragment = fragment;
for (const pitch of pitchNames) {
if (fragment.toLowerCase().startsWith(pitch.toLowerCase())) {
rootMatch = pitch;
symbolFragment = fragment.slice(pitch.length);
break;
}
}
if (rootMatch) {
// We have a root, now complete chord symbols
const filteredSymbols = chordSymbolCompletions.filter((s) =>
s.label.toLowerCase().startsWith(symbolFragment.toLowerCase()),
);
// Create completions that replace the entire chord, not just the symbol part
const options = filteredSymbols;
const from = chordContext.to - symbolFragment.length;
return { from, options };
} else {
// No root yet, complete with pitch names
const filteredPitches = pitchNames.filter((p) => p.toLowerCase().startsWith(fragment.toLowerCase()));
const options = filteredPitches.map((p) => ({ label: p, type: 'pitch' }));
const from = chordContext.to - fragment.length;
return { from, options };
}
}
// Cached regex patterns for fallbackHandler
const FALLBACK_WORD_REGEX = /\w*/;
function fallbackHandler(context) {
const word = context.matchBefore(FALLBACK_WORD_REGEX);
if (word && word.from === word.to && !context.explicit) return null;
if (word) {
return {
from: word.from,
options: jsdocCompletions,
};
}
return null;
}
const handlers = [
soundHandler,
bankHandler,
chordHandler,
scaleHandler,
modeHandler,
// this handler *must* be last
fallbackHandler,
];
export const strudelAutocomplete = (context) => {
const word = context.matchBefore(/\w*/);
if (word.from === word.to && !context.explicit) return null;
return {
from: word.from,
options: jsdocCompletions,
/* options: [
{ label: 'match', type: 'keyword' },
{ label: 'hello', type: 'variable', info: '(World)' },
{ label: 'magic', type: 'text', apply: '⠁⭒*.✩.*⭒⠁', detail: 'macro' },
], */
};
for (const handler of handlers) {
const result = handler(context);
if (result) {
return result;
}
}
return null;
};
export const isAutoCompletionEnabled = (enabled) =>
+63
View File
@@ -0,0 +1,63 @@
import {
keymap,
highlightSpecialChars,
drawSelection,
highlightActiveLine,
dropCursor,
rectangularSelection,
crosshairCursor,
lineNumbers,
highlightActiveLineGutter,
} from '@codemirror/view';
import {
defaultHighlightStyle,
syntaxHighlighting,
bracketMatching,
foldGutter,
foldKeymap,
} from '@codemirror/language';
import { defaultKeymap, history, historyKeymap } from '@codemirror/commands';
import { searchKeymap, highlightSelectionMatches } from '@codemirror/search';
import { completionKeymap, closeBracketsKeymap } from '@codemirror/autocomplete';
// Taken + slightly modified from https://github.com/codemirror/basic-setup/blob/main/src/codemirror.ts
export const basicSetup = (() => [
// lineNumbers(),
// highlightActiveLineGutter(),
highlightSpecialChars(),
history(),
// foldGutter(),
// drawSelection(),
dropCursor(),
// EditorState.allowMultipleSelections.of(true),
// indentOnInput(),
// syntaxHighlighting(defaultHighlightStyle, { fallback: true }),
// autocompletion(),
rectangularSelection(),
crosshairCursor(),
// highlightActiveLine(),
// highlightSelectionMatches(),
keymap.of([
...closeBracketsKeymap,
...defaultKeymap,
// ...searchKeymap,
...historyKeymap,
// ...foldKeymap,
// ...completionKeymap,
]),
])();
/// A minimal set of extensions to create a functional editor. Only
/// includes [the default keymap](#commands.defaultKeymap), [undo
/// history](#commands.history), [special character
/// highlighting](#view.highlightSpecialChars), [custom selection
/// drawing](#view.drawSelection), and [default highlight
/// style](#language.defaultHighlightStyle).
export const minimalSetup = (() => [
highlightSpecialChars(),
history(),
drawSelection(),
syntaxHighlighting(defaultHighlightStyle, { fallback: true }),
keymap.of([...defaultKeymap, ...historyKeymap]),
])();
+51
View File
@@ -0,0 +1,51 @@
// Block-based evaluation utilities
export function getBlockRegions(code) {
const chars = code.split('');
let i = 0,
blanks = [],
blockStart = 0,
regions = [];
while (i < chars.length) {
const isBlank = chars[i] === '\n';
if (isBlank) {
blanks.push(i);
} else if (chars[i].trim() !== '') {
if (blanks.length > 1) {
regions.push([blockStart, blanks[0]]);
blockStart = i;
}
blanks = [];
}
i++;
}
regions.push([blockStart, blanks.length ? blanks[0] : i]);
return regions;
}
export function getBlockAt(code, cursor) {
const regions = getBlockRegions(code);
for (const [start, end] of regions) {
if (cursor >= start && cursor <= end) {
return [start, end];
}
}
return null;
}
export const evalBlock = (strudelMirror) => {
const { state } = strudelMirror.editor;
const code = state.doc.toString();
const cursor = state.selection.main.head;
const range = getBlockAt(code, cursor);
if (range) {
const [a, b] = range;
const block = code.slice(a, b);
if (block) {
// Flash the block being evaluated
strudelMirror.flash(200, { from: a, to: b });
strudelMirror.repl.evaluateBlock(block, true, { range });
}
}
return true;
};
+169 -45
View File
@@ -1,31 +1,34 @@
import { closeBrackets } from '@codemirror/autocomplete';
export { toggleComment, toggleBlockComment, toggleLineComment, toggleBlockCommentByLine } from '@codemirror/commands';
// import { search, highlightSelectionMatches } from '@codemirror/search';
import { history, indentWithTab } from '@codemirror/commands';
import { javascript } from '@codemirror/lang-javascript';
import { defaultHighlightStyle, syntaxHighlighting, bracketMatching } from '@codemirror/language';
import { indentWithTab, toggleLineComment } from '@codemirror/commands';
import { javascript, javascriptLanguage } from '@codemirror/lang-javascript';
import { bracketMatching, defaultHighlightStyle, syntaxHighlighting } from '@codemirror/language';
import { Compartment, EditorState, Prec } from '@codemirror/state';
import {
drawSelection,
EditorView,
highlightActiveLineGutter,
highlightActiveLine,
highlightActiveLineGutter,
keymap,
lineNumbers,
drawSelection,
} from '@codemirror/view';
import { repl, registerControl } from '@strudel/core';
import { Drawer, cleanupDraw } from '@strudel/draw';
import { persistentAtom } from '@nanostores/persistent';
import { logger, registerControl, repl } from '@strudel/core';
import { cleanupDraw, cleanupDrawContext, Drawer } from '@strudel/draw';
import { isAutoCompletionEnabled } from './autocomplete.mjs';
import { isTooltipEnabled } from './tooltip.mjs';
import { basicSetup } from './basicSetup.mjs';
import { evalBlock } from './block_utilities.mjs';
import { flash, isFlashEnabled } from './flash.mjs';
import { highlightMiniLocations, isPatternHighlightingEnabled, updateMiniLocations } from './highlight.mjs';
import { keybindings } from './keybindings.mjs';
import { initTheme, activateTheme, theme } from './themes.mjs';
import { sliderPlugin, updateSliderWidgets } from './slider.mjs';
import { widgetPlugin, updateWidgets } from './widget.mjs';
import { persistentAtom } from '@nanostores/persistent';
import { jumpToCharacter } from './labelJump.mjs';
import { getSliderWidgets, sliderPlugin, updateSliderWidgets } from './slider.mjs';
import { activateTheme, initTheme, theme } from './themes.mjs';
import { isTooltipEnabled } from './tooltip.mjs';
import { getActiveWidgets, updateWidgets, widgetPlugin } from './widget.mjs';
const extensions = {
export { toggleBlockComment, toggleBlockCommentByLine, toggleComment, toggleLineComment } from '@codemirror/commands';
export const extensions = {
isLineWrappingEnabled: (on) => (on ? EditorView.lineWrapping : []),
isBracketMatchingEnabled: (on) => (on ? bracketMatching({ brackets: '()[]{}<>' }) : []),
isBracketClosingEnabled: (on) => (on ? closeBrackets() : []),
@@ -46,7 +49,7 @@ const extensions = {
]
: [],
};
const compartments = Object.fromEntries(Object.keys(extensions).map((key) => [key, new Compartment()]));
export const compartments = Object.fromEntries(Object.keys(extensions).map((key) => [key, new Compartment()]));
export const defaultSettings = {
keybindings: 'codemirror',
@@ -61,6 +64,7 @@ export const defaultSettings = {
isLineWrappingEnabled: false,
isTabIndentationEnabled: false,
isMultiCursorEnabled: false,
isBlockBasedEvalEnabled: false,
theme: 'strudelTheme',
fontFamily: 'monospace',
fontSize: 18,
@@ -72,7 +76,7 @@ export const codemirrorSettings = persistentAtom('codemirror-settings', defaultS
});
// https://codemirror.net/docs/guide/
export function initEditor({ initialCode = '', onChange, onEvaluate, onStop, root, mondo }) {
export function initEditor({ initialCode = '', onChange, onEvaluate, onStop, root, mondo, strudelMirror }) {
const settings = codemirrorSettings.get();
const initialSettings = Object.keys(compartments).map((key) =>
compartments[key].of(extensions[key](parseBooleans(settings[key]))),
@@ -85,24 +89,43 @@ export function initEditor({ initialCode = '', onChange, onEvaluate, onStop, roo
/* search(),
highlightSelectionMatches(), */
...initialSettings,
basicSetup,
mondo ? [] : javascript(),
javascriptLanguage.data.of({
closeBrackets: { brackets: ['(', '[', '{', "'", '"', '<'] },
bracketMatching: { brackets: ['(', '[', '{', "'", '"', '<'] },
}),
sliderPlugin,
widgetPlugin,
// indentOnInput(), // works without. already brought with javascript extension?
// bracketMatching(), // does not do anything
// indentOnInput(), // works without. already brought with javascript
// extension? bracketMatching(), // does not do anything
syntaxHighlighting(defaultHighlightStyle),
history(),
EditorView.updateListener.of((v) => onChange(v)),
drawSelection({ cursorBlinkRate: 0 }),
Prec.highest(
keymap.of([
{
key: 'Ctrl-Enter',
run: () => onEvaluate?.(),
run: () => {
// issue with referencing settings, this works more reliably
if (strudelMirror?.isBlockBasedEvalEnabled) {
evalBlock(strudelMirror);
return true;
} else {
return onEvaluate?.();
}
},
},
{
key: 'Alt-Enter',
run: () => onEvaluate?.(),
run: () => {
if (strudelMirror?.isBlockBasedEvalEnabled) {
evalBlock(strudelMirror);
return true;
} else {
return onEvaluate?.();
}
},
},
{
key: 'Ctrl-.',
@@ -113,14 +136,22 @@ export function initEditor({ initialCode = '', onChange, onEvaluate, onStop, roo
preventDefault: true,
run: () => onStop?.(),
},
{
key: 'Alt-w',
run: (view) => jumpToCharacter(view, '$', 1),
},
{
key: 'Alt-q',
run: (view) => jumpToCharacter(view, '$', -1),
},
/* {
key: 'Ctrl-Shift-.',
run: () => (onPanic ? onPanic() : onStop?.()),
},
{
key: 'Ctrl-Shift-Enter',
run: () => (onReEvaluate ? onReEvaluate() : onEvaluate?.()),
}, */
key: 'Ctrl-Shift-.',
run: () => (onPanic ? onPanic() : onStop?.()),
},
{
key: 'Ctrl-Shift-Enter',
run: () => (onReEvaluate ? onReEvaluate() : onEvaluate?.()),
}, */
]),
),
],
@@ -156,6 +187,7 @@ export class StrudelMirror {
this.onDraw = onDraw || this.draw;
this.id = id || s4();
this.solo = solo;
this.isBlockBasedEvalEnabled = false; // Will be updated via updateSettings()
this.drawer = new Drawer((haps, time, _, painters) => {
const currentFrame = haps.filter((hap) => hap.isActive(time));
@@ -186,28 +218,43 @@ export class StrudelMirror {
cleanupDraw(true, id);
}
},
beforeEval: async () => {
cleanupDraw(true, id);
beforeEval: async ({ blockBased } = {}) => {
// Only clean up all drawings for full evaluation
// Block-based eval should preserve animations (like .scope()) from other blocks
if (!blockBased) {
cleanupDraw(true, id);
}
await this.prebaked;
await replOptions?.beforeEval?.();
},
afterEval: (options) => {
// remember for when highlighting is toggled on
this.miniLocations = options.meta?.miniLocations;
this.widgets = options.meta?.widgets;
this.miniLocations = options.meta?.miniLocations || [];
this.widgets = options.meta?.widgets || [];
const sliders = this.widgets.filter((w) => w.type === 'slider');
updateSliderWidgets(this.editor, sliders);
const widgets = this.widgets.filter((w) => w.type !== 'slider');
updateWidgets(this.editor, widgets);
updateMiniLocations(this.editor, this.miniLocations);
// range-aware update for block-based evaluation
const range = options.range && options.range.length >= 2 ? options.range : null;
updateSliderWidgets(this.editor, sliders, range);
updateWidgets(this.editor, widgets, range);
updateMiniLocations(this.editor, this.miniLocations, range);
replOptions?.afterEval?.(options);
// if no painters are set (.onPaint was not called), then we only need the present moment (for highlighting)
// if no painters are set (.onPaint was not called), then we only need
// the present moment (for highlighting)
const drawTime = options.pattern.getPainters().length ? this.drawTime : [0, 0];
this.drawer.setDrawTime(drawTime);
// invalidate drawer after we've set the appropriate drawTime
this.drawer.invalidate(this.repl.scheduler);
// Clean up draw context if a non-inline widget was removed
if (options.widgetRemoved) {
cleanupDrawContext(id);
}
},
});
this.cleanupDrawContext = () => cleanupDrawContext(id);
this.editor = initEditor({
root,
initialCode,
@@ -220,7 +267,9 @@ export class StrudelMirror {
onEvaluate: () => this.evaluate(),
onStop: () => this.stop(),
mondo: replOptions.mondo,
strudelMirror: this,
});
const cmEditor = this.root.querySelector('.cm-editor');
if (cmEditor) {
this.root.style.display = 'block';
@@ -240,6 +289,39 @@ export class StrudelMirror {
}
};
document.addEventListener('start-repl', this.onStartRepl);
// Handle global evaluation requests (e.g., from Vim :w)
this.onEvaluateRequest = (e) => {
try {
if (e.detail.view !== this.editor) {
return; // ignore events from other editors
}
// Evaluate current editor on repl-evaluate
logger('[repl] evaluate via event');
this.evaluate();
e?.cancelable && e.preventDefault?.();
} catch (err) {
console.error('Error handling repl-evaluate event', err);
}
};
document.addEventListener('repl-evaluate', this.onEvaluateRequest);
document.addEventListener('repl-stop', this.onStopRequest);
// Toggle comments requested from Vim (gc)
this.onToggleComment = (e) => {
try {
if (e.detail.view !== this.editor) {
return; // ignore events from other editors
}
// Honor selections; toggleLineComment handles both selections and
// single line
toggleLineComment(this.editor);
e?.cancelable && e.preventDefault?.();
} catch (err) {
console.error('Error handling repl-toggle-comment event', err);
}
};
document.addEventListener('repl-toggle-comment', this.onToggleComment);
}
draw(haps, time, painters) {
painters?.forEach((painter) => painter(this.drawContext, time, haps, this.drawTime));
@@ -259,13 +341,27 @@ export class StrudelMirror {
console.warn('first frame could not be painted');
}
}
async evaluate() {
async evaluate(autostart = true) {
this.flash();
await this.repl.evaluate(this.code);
await this.repl.evaluate(this.code, autostart);
}
async stop() {
this.repl.scheduler.stop();
this.repl.stop();
}
// Listen for global stop requests (e.g., from Vim :q)
onStopRequest = (e) => {
try {
if (e.detail.view !== this.editor) {
return; // ignore events from other editors
}
this.stop();
e?.cancelable && e.preventDefault?.();
} catch (err) {
console.error('Error handling repl-stop event', err);
}
};
async toggle() {
if (this.repl.scheduler.started) {
this.repl.stop();
@@ -273,8 +369,8 @@ export class StrudelMirror {
this.evaluate();
}
}
flash(ms) {
flash(this.editor, ms);
flash(ms, range) {
flash(this.editor, ms, range);
}
highlight(haps, time) {
highlightMiniLocations(this.editor, time, haps);
@@ -306,6 +402,10 @@ export class StrudelMirror {
setLineWrappingEnabled(enabled) {
this.reconfigureExtension('isLineWrappingEnabled', enabled);
}
setBlockBasedEvalEnabled(enabled) {
this.reconfigureExtension('isBlockBasedEvalEnabled', enabled);
}
setBracketMatchingEnabled(enabled) {
this.reconfigureExtension('isBracketMatchingEnabled', enabled);
}
@@ -327,6 +427,10 @@ export class StrudelMirror {
for (let key in extensions) {
this.reconfigureExtension(key, settings[key]);
}
// Update block-based eval setting on the instance
if (settings.isBlockBasedEvalEnabled !== undefined) {
this.isBlockBasedEvalEnabled = parseBooleans(settings.isBlockBasedEvalEnabled);
}
const updated = { ...codemirrorSettings.get(), ...settings };
codemirrorSettings.set(updated);
}
@@ -340,12 +444,31 @@ export class StrudelMirror {
this.setFontSize(value);
}
}
setCode(code) {
const changes = { from: 0, to: this.editor.state.doc.length, insert: code };
replaceCode(code, from, to) {
const changes = { from, to, insert: code };
this.editor.dispatch({ changes });
}
insertCode(code, position) {
this.replaceCode(code, position, position);
}
setCode(code) {
this.replaceCode(code, 0, this.editor.state.doc.length);
}
// used for debugging but could serve other purposes
getActiveWidgets() {
return getActiveWidgets(this.editor);
}
getSliderWidgets() {
return getSliderWidgets(this.editor);
}
getMiniLocations() {
return this.miniLocations;
}
clear() {
this.onStartRepl && document.removeEventListener('start-repl', this.onStartRepl);
this.onEvaluateRequest && document.removeEventListener('repl-evaluate', this.onEvaluateRequest);
this.onStopRequest && document.removeEventListener('repl-stop', this.onStopRequest);
this.onToggleComment && document.removeEventListener('repl-toggle-comment', this.onToggleComment);
}
getCursorLocation() {
return this.editor.state.selection.main.head;
@@ -360,7 +483,7 @@ export class StrudelMirror {
}
}
function parseBooleans(value) {
export function parseBooleans(value) {
return { true: true, false: false }[value] ?? value;
}
@@ -374,6 +497,7 @@ function s4() {
/**
* Overrides the css of highlighted events. Make sure to use single quotes!
* @name markcss
* @tag visualization
* @example
* note("c a f e")
* .markcss('text-decoration:underline')
+5 -3
View File
@@ -14,7 +14,8 @@ export const flashField = StateField.define({
const mark = Decoration.mark({
attributes: { style: `background-color: rgba(255,255,255, .4); filter: invert(10%)` },
});
flash = Decoration.set([mark.range(0, tr.newDoc.length)]);
const range = e.value.range || { from: 0, to: tr.newDoc.length };
flash = Decoration.set([mark.range(range.from, range.to)]);
} else {
flash = Decoration.set([]);
}
@@ -29,8 +30,9 @@ export const flashField = StateField.define({
provide: (f) => EditorView.decorations.from(f),
});
export const flash = (view, ms = 200) => {
view.dispatch({ effects: setFlash.of(true) });
export const flash = (view, ms = 200, range) => {
const flashData = range ? { range } : true;
view.dispatch({ effects: setFlash.of(flashData) });
setTimeout(() => {
view.dispatch({ effects: setFlash.of(false) });
}, ms);
+164 -63
View File
@@ -3,8 +3,9 @@ import { Decoration, EditorView } from '@codemirror/view';
export const setMiniLocations = StateEffect.define();
export const showMiniLocations = StateEffect.define();
export const updateMiniLocations = (view, locations) => {
view.dispatch({ effects: setMiniLocations.of(locations) });
export const displayMiniLocations = StateEffect.define();
export const updateMiniLocations = (view, locations, range = null) => {
view.dispatch({ effects: setMiniLocations.of({ locations, range }) });
};
export const highlightMiniLocations = (view, atTime, haps) => {
view.dispatch({ effects: showMiniLocations.of({ atTime, haps }) });
@@ -21,23 +22,54 @@ const miniLocations = StateField.define({
for (let e of tr.effects) {
if (e.is(setMiniLocations)) {
// this is called on eval, with the mini locations obtained from the transpiler
// codemirror will automatically remap the marks when the document is edited
// create a mark for each mini location, adding the range to the spec to find it later
const marks = e.value
.filter(([from]) => from < tr.newDoc.length)
.map(([from, to]) => [from, Math.min(to, tr.newDoc.length)])
.map(
(range) =>
Decoration.mark({
id: range.join(':'),
// this green is only to verify that the decoration moves when the document is edited
// it will be removed later, so the mark is not visible by default
attributes: { style: `background-color: #00CA2880` },
}).range(...range), // -> Decoration
);
//block-based eval case
if (e.value.range) {
const stateMiniLocations = getMiniLocationsFromDecorations(locations);
locations = Decoration.set(marks, true); // -> DecorationSet === RangeSet<Decoration>
const normalized = e.value.locations
.filter(([from]) => from < tr.newDoc.length)
.map(([from, to]) => [from, Math.min(to, tr.newDoc.length)]);
const newIds = new Set(normalized.map((r) => r.join(':')));
const marks = normalized.map((range) => {
const id = range.join(':');
return Decoration.mark({
id,
// this green is only to verify that the decoration moves when the document is edited
// it will be removed later, so the mark is not visible by default
attributes: { style: `background-color: #00CA2880` },
}).range(...range); // -> Decoration
});
const previousMarks = stateMiniLocations
.filter(({ id }) => !newIds.has(id))
.map(({ from, to, id }) =>
Decoration.mark({
id,
attributes: { style: `background-color: #00CA2880` },
}).range(from, to),
);
locations = Decoration.set(previousMarks.concat(marks), true); // -> DecorationSet === RangeSet<Decoration>
} else {
// this is called on eval, with the mini locations obtained from the transpiler
// codemirror will automatically remap the marks when the document is edited
// create a mark for each mini location, adding the range to the spec to find it later
const marks = e.value.locations
.filter(([from]) => from < tr.newDoc.length)
.map(([from, to]) => [from, Math.min(to, tr.newDoc.length)])
.map(
(range) =>
Decoration.mark({
id: range.join(':'),
// this green is only to verify that the decoration moves when the document is edited
// it will be removed later, so the mark is not visible by default
attributes: { style: `background-color: #00CA2880` },
}).range(...range), // -> Decoration
);
locations = Decoration.set(marks, true); // -> DecorationSet === RangeSet<Decoration>
}
}
}
@@ -75,12 +107,83 @@ const visibleMiniLocations = StateField.define({
},
});
// // Derive the set of decorations from the miniLocations and visibleLocations
const miniLocationHighlights = EditorView.decorations.compute([miniLocations, visibleMiniLocations], (state) => {
const iterator = state.field(miniLocations).iter();
const { haps } = state.field(visibleMiniLocations);
const builder = new RangeSetBuilder();
const displayMiniLocationsState = StateField.define({
create() {
return true; // default to showing miniLocations
},
update(display, tr) {
for (let e of tr.effects) {
if (e.is(displayMiniLocations)) {
display = e.value;
}
}
return display;
},
});
// // Derive the set of decorations from the miniLocations and visibleLocations
const miniLocationHighlights = EditorView.decorations.compute(
[miniLocations, visibleMiniLocations, displayMiniLocationsState],
(state) => {
// Check if miniLocations display is disabled
const shouldDisplay = state.field(displayMiniLocationsState);
if (!shouldDisplay) {
return Decoration.none; // Return empty decorations if display is disabled
}
const iterator = state.field(miniLocations).iter();
const { haps } = state.field(visibleMiniLocations);
const builder = new RangeSetBuilder();
while (iterator.value) {
const {
from,
to,
value: {
spec: { id },
},
} = iterator;
if (haps.has(id)) {
const hap = haps.get(id);
const color = hap.value?.color ?? 'var(--foreground)';
const style = hap.value?.markcss || `outline: solid 2px ${color}`;
// Get explicit channels for color values
/*
const swatch = document.createElement('div');
swatch.style.color = color;
document.body.appendChild(swatch);
let channels = getComputedStyle(swatch)
.color.match(/^rgba?\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})(?:,\s*(\d*(?:\.\d+)?))?\)$/)
.slice(1)
.map((c) => parseFloat(c || 1));
document.body.removeChild(swatch);
// Get percentage of event
const percent = 1 - (atTime - hap.whole.begin) / hap.whole.duration;
channels[3] *= percent;
*/
builder.add(
from,
to,
Decoration.mark({
// attributes: { style: `outline: solid 2px rgba(${channels.join(', ')})` },
attributes: { style },
}),
);
}
iterator.next();
}
return builder.finish();
},
);
const getMiniLocationsFromDecorations = (decorations) => {
const iterator = decorations.iter();
const miniLocationsArray = [];
while (iterator.value) {
const {
from,
@@ -89,50 +192,48 @@ const miniLocationHighlights = EditorView.decorations.compute([miniLocations, vi
spec: { id },
},
} = iterator;
if (haps.has(id)) {
const hap = haps.get(id);
const color = hap.value?.color ?? 'var(--foreground)';
const style = hap.value?.markcss || `outline: solid 2px ${color}`;
// Get explicit channels for color values
/*
const swatch = document.createElement('div');
swatch.style.color = color;
document.body.appendChild(swatch);
let channels = getComputedStyle(swatch)
.color.match(/^rgba?\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})(?:,\s*(\d*(?:\.\d+)?))?\)$/)
.slice(1)
.map((c) => parseFloat(c || 1));
document.body.removeChild(swatch);
// Get percentage of event
const percent = 1 - (atTime - hap.whole.begin) / hap.whole.duration;
channels[3] *= percent;
*/
builder.add(
from,
to,
Decoration.mark({
// attributes: { style: `outline: solid 2px rgba(${channels.join(', ')})` },
attributes: { style },
}),
);
}
miniLocationsArray.push({
from,
to,
id,
});
iterator.next();
}
return miniLocationsArray;
};
return builder.finish();
});
export const getMiniLocations = (state) => {
const decorations = state.field(miniLocations);
return getMiniLocationsFromDecorations(decorations);
};
export const highlightExtension = [miniLocations, visibleMiniLocations, miniLocationHighlights];
export const getActiveMiniLocations = (state) => {
const miniLocations = getMiniLocations(state);
const { haps } = state.field(visibleMiniLocations);
const activeMiniLocations = miniLocations.filter((location) => haps.has(location.id));
return activeMiniLocations;
};
export const highlightExtension = [
miniLocations,
visibleMiniLocations,
displayMiniLocationsState,
miniLocationHighlights,
];
export const isPatternHighlightingEnabled = (on, config) => {
on &&
config &&
setTimeout(() => {
updateMiniLocations(config.editor, config.miniLocations);
}, 100);
return on ? Prec.highest(highlightExtension) : [];
// NOTE:
// Modified this function to always return the highlightExtension, and instead just toggle whether or not the miniLocations are displayed.
// This is because block based evaluation only updates regions of miniLocations, and those updates need to be kept track of constantly.
// The setTimeout was also removed because it conflicted with the range-specific updates required by
// block based evaluation.
// Not sure if this is the best approach, but for block based eval I can't think of a better way to do it.
if (config) {
// Toggle the display state for miniLocations
config.editor.dispatch({ effects: displayMiniLocations.of(on) });
}
return Prec.highest(highlightExtension);
};
+3 -2
View File
@@ -1,6 +1,7 @@
const parser = typeof DOMParser !== 'undefined' ? new DOMParser() : null;
export let html = (string) => {
return parser?.parseFromString(string, 'text/html').querySelectorAll('*');
const template = document.createElement('template');
template.innerHTML = string.trim();
return template.content.childNodes;
};
let parseChunk = (chunk) => {
if (Array.isArray(chunk)) return chunk.flat().join('');
+2
View File
@@ -4,3 +4,5 @@ export * from './flash.mjs';
export * from './slider.mjs';
export * from './themes.mjs';
export * from './widget.mjs';
export { Vim } from './keybindings.mjs';
export * from './basicSetup.mjs';
+168 -4
View File
@@ -1,10 +1,13 @@
import { Prec } from '@codemirror/state';
import { defaultKeymap } from '@codemirror/commands';
import { Prec, EditorState } from '@codemirror/state';
import { keymap, ViewPlugin } from '@codemirror/view';
// import { searchKeymap } from '@codemirror/search';
import { emacs } from '@replit/codemirror-emacs';
import { vim } from '@replit/codemirror-vim';
import { vim, Vim } from '@replit/codemirror-vim';
// import { vim } from './vim_test.mjs';
import { vscodeKeymap } from '@replit/codemirror-vscode-keymap';
import { defaultKeymap, historyKeymap } from '@codemirror/commands';
import { helix, commands } from 'codemirror-helix';
import { logger } from '@strudel/core';
const vscodePlugin = ViewPlugin.fromClass(
class {
@@ -18,14 +21,175 @@ const vscodePlugin = ViewPlugin.fromClass(
);
const vscodeExtension = (options) => [vscodePlugin].concat(options ?? []);
function replEval(view) {
try {
// Dispatch a dedicated evaluate event first
let handled = false;
try {
const ev = new CustomEvent('repl-evaluate', { detail: { source: 'vim', view }, cancelable: true });
handled = document.dispatchEvent(ev) === false; // false means preventDefault was called
} catch (e) {
console.error('Error dispatching repl-evaluate event', e);
}
if (handled) {
return;
}
// Try Ctrl+Enter first if not handled by custom event
const ctrlEnter = new KeyboardEvent('keydown', {
key: 'Enter',
code: 'Enter',
ctrlKey: true,
bubbles: true,
cancelable: true,
});
view?.dom?.dispatchEvent?.(ctrlEnter);
// If not handled (no handler called preventDefault), try Alt+Enter as
// fallback
if (!ctrlEnter.defaultPrevented) {
const altEnter = new KeyboardEvent('keydown', {
key: 'Enter',
code: 'Enter',
altKey: true,
bubbles: true,
cancelable: true,
});
view?.dom?.dispatchEvent?.(altEnter);
}
} catch (e) {
console.error('Error dispatching repl evaluation event', e);
}
}
function replStop(view) {
try {
// First try dispatching our custom stop event, then fallback to Alt+.
let handled = false;
try {
const ev = new CustomEvent('repl-stop', { detail: { source: 'vim', view }, cancelable: true });
handled = document.dispatchEvent(ev) === false;
} catch (e) {
console.error('Error dispatching repl-stop event', e);
}
if (!handled) {
const altDot = new KeyboardEvent('keydown', {
key: '.',
code: 'Period',
altKey: true,
bubbles: true,
cancelable: true,
});
view?.dom?.dispatchEvent?.(altDot);
}
} catch (e) {
console.error('Error dispatching repl stop event', e);
}
}
// Map Vim :w to trigger the same action as evaluation. We dispatch a custom
// event 'repl-evaluate' that the editor listens for, and also simulate
// Ctrl+Enter/Alt+Enter as a fallback. We log to the Strudel logger so it
// appears in the Console panel.
try {
if (Vim && typeof Vim.defineEx === 'function') {
// Map gc to toggle line comments by dispatching a custom event that our
// CodeMirror integration listens to. This avoids depending on Vim's
// internal actions and works with current selections/visual mode.
try {
Vim.defineAction('strudelToggleComment', (cm) => {
const view = cm.cm6;
try {
const ev = new CustomEvent('repl-toggle-comment', { detail: { source: 'vim', view }, cancelable: true });
document.dispatchEvent(ev);
} catch (e) {
console.error('strudelToggleComment dispatch failed', e);
}
});
Vim.mapCommand('gc', 'action', 'strudelToggleComment', {}, { context: 'normal' });
Vim.mapCommand('gc', 'action', 'strudelToggleComment', {}, { context: 'visual' });
} catch (e) {
console.error('Vim gc mapping failed', e);
}
// :q to pause/stop
Vim.defineEx('quit', 'q', (cm) => {
const view = cm.cm6;
logger('[vim] :q — stopping repl');
replStop(view);
});
// :w to evaluate
Vim.defineEx('write', 'w', (cm) => {
const view = cm.cm6;
try {
view.focus?.();
// Let the app know this came from Vim :w
try {
logger('[vim] :w — evaluating code');
} catch (e) {
console.error('Error logging Vim :w evaluation', e);
}
replEval(view);
} catch (e) {
console.error('Error dispatching :w evaluation event', e);
}
});
}
} catch (e) {
console.error('Vim ex command setup failed (defineEx missing or Vim unavailable)', e);
}
// Map Helix :w to trigger the same action as evaluation. We dispatch a custom
// event 'repl-evaluate' that the editor listens for, and also simulate
// Ctrl+Enter/Alt+Enter as a fallback. We log to the Strudel logger so it
// appears in the Console panel.
const helixCommands = commands.of([
{
// :w to evaluate
name: 'write',
aliases: ['w'],
help: 'Repl-eval',
handler(view, args) {
try {
view?.focus?.(); // Let the app know this came from Helix :w
logger('[helix] :w — evaluating code');
replEval(view);
} catch (e) {
console.error('Error dispatching helix :w evaluation event', e);
}
},
},
{
// :q to pause/stop
name: 'quit',
aliases: ['q'],
help: 'Repl-stop',
handler(view, args) {
try {
view?.focus?.(); // Let the app know this came from Helix :q
logger('[helix] :q — stopping repl');
replStop(view);
} catch (e) {
console.error('Error dispatching helix :q stop event', e);
}
},
},
]);
const keymaps = {
vim,
emacs,
codemirror: () => keymap.of(defaultKeymap),
vscode: vscodeExtension,
helix: () => [helix(), helixCommands],
};
export { Vim } from '@replit/codemirror-vim';
export function keybindings(name) {
const active = keymaps[name];
return [active ? active() : [], keymap.of(historyKeymap)];
const extensions = active ? [Prec.high(active())] : [];
if (name === 'vim') {
extensions.push(EditorState.allowMultipleSelections.of(true));
}
return extensions;
}
+31
View File
@@ -0,0 +1,31 @@
import { EditorSelection } from '@codemirror/state';
import { SearchCursor } from '@codemirror/search';
export function jumpToCharacter(view, character, direction = 1) {
const { state, dispatch } = view;
const pos = state.selection.main.head;
const cursor = new SearchCursor(state.doc, character);
let characterPositions = [];
let jumpPos;
while (!cursor.next().done) {
characterPositions.push(cursor.value.to);
}
if (!characterPositions.length) {
return false;
}
if (direction > 0) {
jumpPos = characterPositions.find((x) => x > pos + 1) ?? characterPositions.at(0); // Loop back around for convenience
} else {
jumpPos = characterPositions.reverse().find((x) => x < pos + 1) ?? characterPositions.at(0);
}
if (jumpPos == null) {
return false;
}
dispatch({
selection: EditorSelection.cursor(jumpPos - 1),
scrollIntoView: true,
});
return true;
}
+17 -10
View File
@@ -1,6 +1,6 @@
{
"name": "@strudel/codemirror",
"version": "1.2.4",
"version": "1.3.0",
"description": "Codemirror Extensions for Strudel",
"main": "index.mjs",
"publishConfig": {
@@ -32,24 +32,31 @@
},
"homepage": "https://codeberg.org/uzu/strudel#readme",
"dependencies": {
"@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",
"@codemirror/autocomplete": "catalog:",
"@codemirror/commands": "catalog:",
"@codemirror/lang-javascript": "catalog:",
"@codemirror/language": "catalog:",
"@codemirror/search": "catalog:",
"@codemirror/state": "catalog:",
"@codemirror/view": "catalog:",
"@lezer/highlight": "^1.2.1",
"@nanostores/persistent": "^0.10.2",
"@replit/codemirror-emacs": "^6.1.0",
"@replit/codemirror-vim": "^6.2.1",
"@replit/codemirror-vim": "^6.3.0",
"@replit/codemirror-vscode-keymap": "^6.0.2",
"codemirror-helix": "^0.5.0",
"@strudel/core": "workspace:*",
"@strudel/draw": "workspace:*",
"@strudel/tonal": "workspace:*",
"@strudel/transpiler": "workspace:*",
"nanostores": "^0.11.3"
"@tonaljs/tonal": "^4.10.0",
"nanostores": "^0.11.3",
"superdough": "workspace:*"
},
"devDependencies": {
"vite": "^6.0.11"
},
"engines": {
"node": ">=18.0.0"
}
}
+107 -17
View File
@@ -2,11 +2,11 @@ import { ref, pure } from '@strudel/core';
import { WidgetType, ViewPlugin, Decoration } from '@codemirror/view';
import { StateEffect } from '@codemirror/state';
// Global state storage for all widget types
export let sliderValues = {};
const getSliderID = (from) => `slider_${from}`;
export class SliderWidget extends WidgetType {
constructor(value, min, max, from, to, step, view) {
constructor(value, min, max, from, to, step, view, id) {
super();
this.value = value;
this.min = min;
@@ -16,10 +16,21 @@ export class SliderWidget extends WidgetType {
this.to = to;
this.step = step;
this.view = view;
this.id = id || `${from}:${to}`; // Range-based ID for stability
}
eq() {
return false;
eq(other) {
if (!(other instanceof SliderWidget)) {
return false;
}
return (
this.id === other.id &&
this.from === other.from &&
this.to === other.to &&
this.value === other.value &&
this.min === other.min &&
this.max === other.max
);
}
toDOM() {
@@ -38,6 +49,7 @@ export class SliderWidget extends WidgetType {
slider.from = this.from;
slider.originalFrom = this.originalFrom;
slider.to = this.to;
slider.id = this.id; // Store range-based ID in DOM element
slider.style = 'width:64px;margin-right:4px;transform:translateY(4px)';
this.slider = slider;
slider.addEventListener('input', (e) => {
@@ -49,7 +61,7 @@ export class SliderWidget extends WidgetType {
slider.originalValue = insert;
slider.value = insert;
this.view.dispatch({ changes: change });
const id = getSliderID(slider.originalFrom); // matches id generated in transpiler
const id = slider.id; // Use range-based ID
window.postMessage({ type: 'cm-slider', value: Number(next), id });
});
return wrap;
@@ -62,19 +74,60 @@ export class SliderWidget extends WidgetType {
export const setSliderWidgets = StateEffect.define();
export const updateSliderWidgets = (view, widgets) => {
view.dispatch({ effects: setSliderWidgets.of(widgets) });
export const setSliderWidgetsInRange = StateEffect.define();
export const updateSliderWidgets = (view, widgets, range = null) => {
if (range) {
// range argument passed for block-based evaluation
view.dispatch({ effects: setSliderWidgetsInRange.of({ widgets, range }) });
} else {
view.dispatch({ effects: setSliderWidgets.of(widgets) });
}
};
function getSliders(widgetConfigs, view) {
return widgetConfigs
.filter((w) => w.type === 'slider')
.map(({ from, to, value, min, max, step }) => {
return Decoration.widget({
widget: new SliderWidget(value, min, max, from, to, step, view),
side: 0,
}).range(from /* , to */);
});
return (
widgetConfigs
.filter((w) => w.type === 'slider')
// Deduplicate sliders that might appear multiple times (e.g., during paste operations)
.filter((slider, index, self) => index === self.findIndex((s) => s.from === slider.from && s.to === slider.to))
.sort((a, b) => a.from - b.from)
.map(({ from, to, value, min, max, step, id }) => {
return Decoration.widget({
widget: new SliderWidget(value, min, max, from, to, step, view, id),
side: 0,
}).range(from /* , to */);
})
);
}
export function getSliderWidgets(view) {
if (!view || !view.state) {
return [];
}
const sliderPluginInstance = view.plugin(sliderPlugin);
if (!sliderPluginInstance || !sliderPluginInstance.decorations) {
return [];
}
const sliderWidgets = [];
sliderPluginInstance.decorations.between(0, view.state.doc.length, (from, to, decoration) => {
if (decoration.widget instanceof SliderWidget) {
sliderWidgets.push({
type: 'slider',
from: decoration.widget.from,
to: decoration.widget.to,
value: decoration.widget.value,
min: decoration.widget.min,
max: decoration.widget.max,
step: decoration.widget.step,
});
}
});
return sliderWidgets;
}
export const sliderPlugin = ViewPlugin.fromClass(
@@ -101,7 +154,42 @@ export const sliderPlugin = ViewPlugin.fromClass(
}
}
for (let e of tr.effects) {
if (e.is(setSliderWidgets)) {
if (e.is(setSliderWidgetsInRange)) {
// Block-aware slider update logic
const { widgets, range } = e.value;
const [rangeStart, rangeEnd] = range;
// Get existing slider widgets that should be preserved
const existingSliders = [];
this.decorations.between(0, update.view.state.doc.length, (from, to, decoration) => {
if (decoration.widget instanceof SliderWidget) {
// Preserve sliders outside the evaluation range
// Use strict > for rangeEnd because when code is deleted, slider positions
// map to the deletion boundary (rangeEnd), and those should be removed, not preserved
if (from < rangeStart || from > rangeEnd) {
existingSliders.push({
from,
to,
value: decoration.widget.value,
min: decoration.widget.min,
max: decoration.widget.max,
step: decoration.widget.step,
id: decoration.widget.id || `${from}:${to}`,
type: 'slider',
});
}
}
});
// Merge preserved sliders with new widgets
const mergedWidgets = [...existingSliders, ...widgets]
.filter(
(slider, index, self) => index === self.findIndex((s) => s.type === 'slider' && s.id === slider.id),
)
.sort((a, b) => a.from - b.from);
this.decorations = Decoration.set(getSliders(mergedWidgets, update.view));
} else if (e.is(setSliderWidgets)) {
this.decorations = Decoration.set(getSliders(e.value, update.view));
}
}
@@ -117,6 +205,7 @@ export const sliderPlugin = ViewPlugin.fromClass(
* Displays a slider widget to allow the user manipulate a value
*
* @name slider
* @tags external_io, visualization
* @param {number} value Initial value
* @param {number} min Minimum value - optional, defaults to 0
* @param {number} max Maximum value - optional, defaults to 1
@@ -131,6 +220,7 @@ export let sliderWithID = (id, value, min, max) => {
sliderValues[id] = value; // sync state at eval time (code -> state)
return ref(() => sliderValues[id]); // use state at query time
};
// update state when sliders are moved
if (typeof window !== 'undefined') {
window.addEventListener('message', (e) => {
@@ -139,7 +229,7 @@ if (typeof window !== 'undefined') {
// update state when slider is moved
sliderValues[e.data.id] = e.data.value;
} else {
console.warn(`slider with id "${e.data.id}" is not registered. Only ${Object.keys(sliderValues)}`);
console.error(`slider with id "${e.data.id}" is not registered. Only ${Object.keys(sliderValues)}`);
}
}
});
+1
View File
@@ -198,6 +198,7 @@ export function activateTheme(name) {
const themeSettings = settings[name] || settings.strudelTheme;
// set css variables
themeStyle.innerHTML = `:root {
color-scheme: ${themeSettings.light ? 'light' : 'dark'};
${Object.entries(themeSettings)
// important to override fallback
.map(([key, value]) => `--${key}: ${value} !important;`)
+3 -1
View File
@@ -17,13 +17,15 @@ export const settings = {
background: 'white',
lineBackground: 'transparent',
foreground: deepPurple,
muted: deepPurple + '50',
caret: '#797977',
selection: yellowPink,
selectionMatch: '#2B323D',
gutterBackground: grey,
gutterBackground: pinkAccent,
gutterForeground: lightGrey,
gutterBorder: 'transparent',
lineHighlight: pinkAccent,
light: true,
};
export default createTheme({
+1
View File
@@ -31,6 +31,7 @@ const palette = palettes['Sour Watermelon B'];
export const settings = {
background: palette[3],
foreground: palette[1],
muted: palette[1] + '50',
caret: palette[0],
selection: palette[0],
selectionMatch: palette[1],
+2
View File
@@ -8,6 +8,7 @@ export const settings = {
background: '#282b2e',
lineBackground: '#282b2e99',
foreground: '#a9b7c6',
muted: '#a9b7c650',
caret: '#00FF00',
selection: '#343739',
selectionMatch: '#343739',
@@ -19,6 +20,7 @@ export default createTheme({
settings: {
background: '#282b2e',
foreground: '#a9b7c6',
muted: '#a9b7c650',
caret: '#00FF00',
selection: '#4e5254',
selectionMatch: '#4e5254',
+1
View File
@@ -12,6 +12,7 @@ export const settings = {
background: hex[0],
lineBackground: 'transparent',
foreground: hex[1],
muted: hex[2],
selection: hex[2],
selectionMatch: hex[0],
gutterBackground: hex[0],
+2
View File
@@ -11,6 +11,7 @@ export const settings = {
background: '#272C35',
lineBackground: '#272C3599',
foreground: 'hsl(220, 14%, 71%)',
muted: 'hsl(220, 14%, 41%)',
caret: '#797977',
selection: '#ffffff30',
selectionMatch: '#2B323D',
@@ -25,6 +26,7 @@ export default createTheme({
settings: {
background: '#272C35',
foreground: '#9d9b97',
muted: 'hsl(220, 14%, 41%)',
caret: '#797977',
selection: '#3d4c64',
selectionMatch: '#3d4c64',
+2
View File
@@ -5,6 +5,7 @@ export const settings = {
background: '#21202e',
lineBackground: '#21202e99',
foreground: '#edecee',
muted: '#edecee50',
caret: '#a277ff',
selection: '#3d375e7f',
selectionMatch: '#3d375e7f',
@@ -18,6 +19,7 @@ export default createTheme({
settings: {
background: '#21202e',
foreground: '#edecee',
muted: '#edecee50',
caret: '#a277ff',
selection: '#5a51898f',
selectionMatch: '#5a51898f',
+2
View File
@@ -6,6 +6,7 @@ export const settings = {
background: '#FFFFFF',
lineBackground: '#FFFFFF99',
foreground: '#000000',
muted: '#00000050',
caret: '#FBAC52',
selection: '#FFD420',
selectionMatch: '#FFD420',
@@ -20,6 +21,7 @@ export default createTheme({
settings: {
background: '#FFFFFF',
foreground: '#000000',
muted: '#00000050',
caret: '#FBAC52',
selection: '#FFD420',
selectionMatch: '#FFD420',
+2 -1
View File
@@ -2,7 +2,8 @@ import { tags as t } from '@lezer/highlight';
import { createTheme } from './theme-helper.mjs';
export const settings = {
background: 'black',
foreground: 'white', // whats that?
foreground: 'white',
muted: '#ffffff50',
caret: 'white',
selection: '#ffffff20',
selectionMatch: '#036dd626',
+2 -1
View File
@@ -3,7 +3,8 @@ import { createTheme } from './theme-helper.mjs';
export const settings = {
background: '#051DB5',
lineBackground: '#051DB550',
foreground: 'white', // whats that?
foreground: 'white',
muted: '#ffffff50',
caret: 'white',
selection: 'rgba(128, 203, 196, 0.5)',
selectionMatch: '#036dd626',
+1
View File
@@ -11,6 +11,7 @@ export const settings = {
background: hex[0],
lineBackground: 'transparent',
foreground: hex[2],
muted: hex[3],
selection: hex[3],
selectionMatch: hex[0],
gutterBackground: hex[0],
+2
View File
@@ -9,6 +9,7 @@ export const settings = {
background: '#242424',
lineBackground: '#24242499',
foreground: '#f8f8f2',
muted: '#f8f8f250',
caret: '#FFFFFF',
selection: 'rgba(255, 255, 255, 0.1)',
selectionMatch: 'rgba(255, 255, 255, 0.2)',
@@ -23,6 +24,7 @@ export default createTheme({
settings: {
background: '#242424',
foreground: '#f8f8f2',
muted: '#f8f8f250',
caret: '#FFFFFF',
selection: 'rgba(255, 255, 255, 0.1)',
selectionMatch: 'rgba(255, 255, 255, 0.2)',
+2
View File
@@ -11,6 +11,7 @@ export const settings = {
background: '#282a36',
lineBackground: '#282a3699',
foreground: '#f8f8f2',
muted: '#f8f8f250',
caret: '#f8f8f0',
selection: 'rgba(255, 255, 255, 0.1)',
selectionMatch: 'rgba(255, 255, 255, 0.2)',
@@ -27,6 +28,7 @@ export default createTheme({
settings: {
background: '#282a36',
foreground: '#f8f8f2',
muted: '#f8f8f250',
caret: '#f8f8f0',
selection: 'rgba(255, 255, 255, 0.1)',
selectionMatch: 'rgba(255, 255, 255, 0.2)',
+2
View File
@@ -10,6 +10,7 @@ export const settings = {
background: '#2a2734',
lineBackground: '#2a273499',
foreground: '#eeebff',
muted: '#eeebff50',
caret: '#ffad5c',
selection: 'rgba(255, 255, 255, 0.1)',
gutterBackground: '#2a2734',
@@ -22,6 +23,7 @@ export default createTheme({
settings: {
background: '#2a2734',
foreground: '#6c6783',
muted: '#eeebff50',
caret: '#ffad5c',
selection: '#9a86fd',
selectionMatch: '#9a86fd',
+2
View File
@@ -6,6 +6,7 @@ export const settings = {
background: '#fff',
lineBackground: '#ffffff99',
foreground: '#000',
muted: '#00000050',
caret: '#FFFFFF',
selection: '#d7d4f0',
selectionMatch: '#d7d4f0',
@@ -20,6 +21,7 @@ export default createTheme({
settings: {
background: '#fff',
foreground: '#000',
muted: '#00000050',
caret: '#FFFFFF',
selection: '#d7d4f0',
selectionMatch: '#d7d4f0',
+1
View File
@@ -23,6 +23,7 @@ export const settings = {
background: hex[0],
lineBackground: 'transparent',
foreground: hex[10],
muted: hex[7],
selection: hex[8],
selectionMatch: hex[0],
gutterBackground: hex[3],
+2
View File
@@ -5,6 +5,7 @@ export const settings = {
background: '#0d1117',
lineBackground: '#0d111799',
foreground: '#c9d1d9',
muted: '#c9d1d950',
caret: '#c9d1d9',
selection: '#003d73',
selectionMatch: '#003d73',
@@ -16,6 +17,7 @@ export default createTheme({
settings: {
background: '#0d1117',
foreground: '#c9d1d9',
muted: '#c9d1d950',
caret: '#c9d1d9',
selection: '#003d73',
selectionMatch: '#003d73',
+2
View File
@@ -6,6 +6,7 @@ export const settings = {
background: '#fff',
lineBackground: '#ffffff99',
foreground: '#24292e',
muted: '#24292e50',
selection: '#BBDFFF',
selectionMatch: '#BBDFFF',
gutterBackground: '#fff',
@@ -17,6 +18,7 @@ export default createTheme({
settings: {
background: '#fff',
foreground: '#24292e',
muted: '#24292e50',
selection: '#BBDFFF',
selectionMatch: '#BBDFFF',
gutterBackground: '#fff',
+1
View File
@@ -13,6 +13,7 @@ export const settings = {
background: hex[0],
lineBackground: 'transparent',
foreground: hex[2],
muted: hex[2] + '50',
selection: hex[4],
selectionMatch: hex[0],
gutterBackground: hex[0],
+2
View File
@@ -10,6 +10,7 @@ export const settings = {
background: '#282828',
lineBackground: '#28282899',
foreground: '#ebdbb2',
muted: '#ebdbb250',
caret: '#ebdbb2',
selection: '#bdae93',
selectionMatch: '#bdae93',
@@ -23,6 +24,7 @@ export default createTheme({
settings: {
background: '#282828',
foreground: '#ebdbb2',
muted: '#ebdbb250',
caret: '#ebdbb2',
selection: '#b99d555c',
selectionMatch: '#b99d555c',
+2
View File
@@ -11,6 +11,7 @@ export const settings = {
background: '#fbf1c7',
lineBackground: '#fbf1c799',
foreground: '#3c3836',
muted: '#3c383650',
caret: '#af3a03',
selection: '#ebdbb2',
selectionMatch: '#bdae93',
@@ -25,6 +26,7 @@ export default createTheme({
settings: {
background: '#fbf1c7',
foreground: '#3c3836',
muted: '#3c383650',
caret: '#af3a03',
selection: '#bdae9391',
selectionMatch: '#bdae9391',
+2
View File
@@ -5,6 +5,7 @@ export const settings = {
background: '#212121',
lineBackground: '#21212199',
foreground: '#bdbdbd',
muted: '#bdbdbd50',
caret: '#a0a4ae',
selection: '#d7d4f0',
selectionMatch: '#d7d4f0',
@@ -19,6 +20,7 @@ export default createTheme({
settings: {
background: '#212121',
foreground: '#bdbdbd',
muted: '#bdbdbd50',
caret: '#a0a4ae',
selection: '#d7d4f063',
selectionMatch: '#d7d4f063',
+3 -1
View File
@@ -5,7 +5,8 @@ export const settings = {
light: true,
background: '#FAFAFA',
lineBackground: '#FAFAFA99',
foreground: '#90A4AE',
foreground: '#6182B8',
muted: '#6182B850',
caret: '#272727',
selection: '#80CBC440',
selectionMatch: '#FAFAFA',
@@ -19,6 +20,7 @@ export default createTheme({
settings: {
background: '#FAFAFA',
foreground: '#90A4AE',
muted: '#6182B850',
caret: '#272727',
selection: '#80CBC440',
selectionMatch: '#80CBC440',
+2
View File
@@ -5,6 +5,7 @@ export const settings = {
background: '#272822',
lineBackground: '#27282299',
foreground: '#FFFFFF',
muted: '#FFFFFF50',
caret: '#FFFFFF',
selection: '#49483E',
selectionMatch: '#49483E',
@@ -18,6 +19,7 @@ export default createTheme({
settings: {
background: '#272822',
foreground: '#FFFFFF',
muted: '#FFFFFF50',
caret: '#FFFFFF',
selection: '#49483E',
selectionMatch: '#49483E',
+2
View File
@@ -6,6 +6,7 @@ export const settings = {
background: '#f2f1f8',
lineBackground: '#f2f1f899',
foreground: '#0c006b',
muted: '#0c006b50',
caret: '#5c49e9',
selection: '#d5d1f2',
selectionMatch: '#d5d1f2',
@@ -19,6 +20,7 @@ export default createTheme({
settings: {
background: '#f2f1f8',
foreground: '#0c006b',
muted: '#0c006b50',
caret: '#5c49e9',
selection: '#d5d1f2',
selectionMatch: '#d5d1f2',
+2
View File
@@ -5,6 +5,7 @@ export const settings = {
background: '#2e3440',
lineBackground: '#2e344099',
foreground: '#FFFFFF',
muted: '#FFFFFF50',
caret: '#FFFFFF',
selection: '#3b4252',
selectionMatch: '#e5e9f0',
@@ -20,6 +21,7 @@ export default createTheme({
settings: {
background: '#2e3440',
foreground: '#FFFFFF',
muted: '#FFFFFF50',
caret: '#FFFFFF',
selection: '#00000073',
selectionMatch: '#00000073',
+1
View File
@@ -13,6 +13,7 @@ export const settings = {
background: hex[0],
lineBackground: 'transparent',
foreground: hex[2],
muted: hex[2] + '50',
selection: hex[4],
selectionMatch: hex[0],
gutterBackground: hex[0],
+2
View File
@@ -5,6 +5,7 @@ export const settings = {
background: '#002b36',
lineBackground: '#002b3699',
foreground: '#93a1a1',
muted: '#93a1a150',
caret: '#839496',
selection: '#173541',
selectionMatch: '#aafe661a',
@@ -45,6 +46,7 @@ export default createTheme({
settings: {
background: c.background,
foreground: c.foreground,
muted: c.muted,
caret: c.cursor,
selection: c.selection,
selectionMatch: c.selection,
+2
View File
@@ -8,6 +8,7 @@ export const settings = {
background: '#fdf6e3',
lineBackground: '#fdf6e399',
foreground: '#657b83',
muted: '#657b8350',
caret: '#586e75',
selection: '#dfd9c8',
selectionMatch: '#dfd9c8',
@@ -19,6 +20,7 @@ export const settings = {
const c = {
background: '#FDF6E3',
foreground: '#657B83',
muted: '#657b8350',
selection: '#EEE8D5',
selectionMatch: '#EEE8D5',
cursor: '#657B83',
+1
View File
@@ -13,6 +13,7 @@ export const settings = {
background: '#000000',
lineBackground: 'transparent',
foreground: hex[4],
muted: hex[6],
selection: hex[6],
gutterBackground: hex[0],
gutterForeground: hex[5],
+1
View File
@@ -5,6 +5,7 @@ export const settings = {
background: '#222',
lineBackground: '#22222299',
foreground: '#fff',
muted: '#8a919966',
caret: '#ffcc00',
selection: 'rgba(128, 203, 196, 0.5)',
selectionMatch: '#036dd626',
+2
View File
@@ -5,6 +5,7 @@ export const settings = {
background: '#303841',
lineBackground: '#30384199',
foreground: '#FFFFFF',
muted: '#FFFFFF50',
caret: '#FBAC52',
selection: '#4C5964',
selectionMatch: '#3A546E',
@@ -18,6 +19,7 @@ export default createTheme({
settings: {
background: '#303841',
foreground: '#FFFFFF',
muted: '#FFFFFF50',
caret: '#FBAC52',
selection: '#4C5964',
selectionMatch: '#3A546E',
+2 -1
View File
@@ -9,7 +9,8 @@ let colorD = '#f8fc55';
export const settings = {
background: '#000000',
foreground: colorA, // whats that?
foreground: colorA,
muted: colorA + '50',
caret: colorC,
selection: colorD,
selectionMatch: colorA,
+4 -2
View File
@@ -4,7 +4,8 @@ import { createTheme } from './theme-helper.mjs';
export const settings = {
background: '#24283b',
lineBackground: '#24283b99',
foreground: '#7982a9',
foreground: '#f9f2f9',
muted: '#f9f2f950',
caret: '#c0caf5',
selection: '#6f7bb630',
selectionMatch: '#1f2335',
@@ -18,7 +19,8 @@ export default createTheme({
theme: 'dark',
settings: {
background: '#24283b',
foreground: '#7982a9',
foreground: '#f9f2f9',
muted: '#f9f2f950',
caret: '#c0caf5',
selection: '#6f7bb630',
selectionMatch: '#343b5f',
+4 -2
View File
@@ -4,7 +4,8 @@ import { createTheme } from './theme-helper.mjs';
export const settings = {
background: '#1a1b26',
lineBackground: '#1a1b2699',
foreground: '#787c99',
foreground: '#f8fcf9',
muted: '#f8fcf950',
caret: '#c0caf5',
selection: '#515c7e40',
selectionMatch: '#16161e',
@@ -18,7 +19,8 @@ export default createTheme({
theme: 'dark',
settings: {
background: '#1a1b26',
foreground: '#787c99',
foreground: '#f8fcf9',
muted: '#f8fcf950',
caret: '#c0caf5',
selection: '#515c7e40',
selectionMatch: '#16161e',
+2
View File
@@ -6,6 +6,7 @@ export const settings = {
background: '#e1e2e7',
lineBackground: '#e1e2e799',
foreground: '#3760bf',
muted: '#3760bf50',
caret: '#3760bf',
selection: '#99a7df',
selectionMatch: '#99a7df',
@@ -20,6 +21,7 @@ export default createTheme({
settings: {
background: '#e1e2e7',
foreground: '#3760bf',
muted: '#3760bf50',
caret: '#3760bf',
selection: '#99a7df',
selectionMatch: '#99a7df',
+2
View File
@@ -5,6 +5,7 @@ export const settings = {
background: '#1e1e1e',
lineBackground: '#1e1e1e99',
foreground: '#fff',
muted: '#ffffff50',
caret: '#c6c6c6',
selection: '#6199ff2f',
selectionMatch: '#72a1ff59',
@@ -19,6 +20,7 @@ export default createTheme({
settings: {
background: '#1e1e1e',
foreground: '#fff',
muted: '#ffffff50',
caret: '#c6c6c6',
selection: '#6199ff2f',
selectionMatch: '#72a1ff59',
+2
View File
@@ -5,6 +5,7 @@ export const settings = {
background: '#ffffff',
lineBackground: '#ffffff50',
foreground: '#383a42',
muted: '#383a4250',
caret: '#000',
selection: '#add6ff',
selectionMatch: '#a8ac94',
@@ -20,6 +21,7 @@ export default createTheme({
settings: {
background: '#ffffff',
foreground: '#383a42',
muted: '#383a4250',
caret: '#000',
selection: '#add6ff',
selectionMatch: '#a8ac94',
+2 -1
View File
@@ -2,7 +2,8 @@ import { tags as t } from '@lezer/highlight';
import { createTheme } from './theme-helper.mjs';
export const settings = {
background: 'white',
foreground: 'black', // whats that?
foreground: 'black',
muted: '#00000050',
caret: 'black',
selection: 'rgba(128, 203, 196, 0.5)',
selectionMatch: '#ffffff26',
+2
View File
@@ -6,6 +6,7 @@ export const settings = {
background: '#fff',
lineBackground: '#ffffff99',
foreground: '#3D3D3D',
muted: '#3D3D3D50',
selection: '#BBDFFF',
selectionMatch: '#BBDFFF',
gutterBackground: '#fff',
@@ -18,6 +19,7 @@ export default createTheme({
settings: {
background: '#fff',
foreground: '#3D3D3D',
muted: '#3D3D3D50',
selection: '#BBDFFF',
selectionMatch: '#BBDFFF',
gutterBackground: '#fff',
+5 -4
View File
@@ -1,6 +1,6 @@
import { hoverTooltip } from '@codemirror/view';
import jsdoc from '../../doc.json';
import { Autocomplete } from './autocomplete.mjs';
import { Autocomplete, getSynonymDoc } from './autocomplete.mjs';
const getDocLabel = (doc) => doc.name || doc.longname;
@@ -52,10 +52,11 @@ export const strudelTooltip = hoverTooltip(
let entry = jsdoc.docs.filter((doc) => getDocLabel(doc) === word)[0];
if (!entry) {
// Try for synonyms
entry = jsdoc.docs.filter((doc) => doc.synonyms && doc.synonyms.includes(word))[0];
if (!entry) {
const doc = jsdoc.docs.filter((doc) => doc.synonyms && doc.synonyms.includes(word))[0];
if (!doc) {
return null;
}
entry = getSynonymDoc(doc, word);
}
return {
@@ -66,7 +67,7 @@ export const strudelTooltip = hoverTooltip(
create(view) {
let dom = document.createElement('div');
dom.className = 'strudel-tooltip';
const ac = Autocomplete({ doc: entry, label: word });
const ac = Autocomplete(entry);
dom.appendChild(ac);
return { dom };
},
+194 -46
View File
@@ -1,55 +1,111 @@
import { StateEffect, StateField } from '@codemirror/state';
import { Decoration, EditorView, WidgetType } from '@codemirror/view';
import { Decoration, EditorView, WidgetType, ViewPlugin } from '@codemirror/view';
import { getWidgetID, registerWidgetType } from '@strudel/transpiler';
import { Pattern } from '@strudel/core';
export const addWidget = StateEffect.define({
map: ({ from, to }, change) => {
return { from: change.mapPos(from), to: change.mapPos(to) };
},
});
export const setWidgets = StateEffect.define();
export const updateWidgets = (view, widgets) => {
view.dispatch({ effects: addWidget.of(widgets) });
export const setWidgetsInRange = StateEffect.define();
export const updateWidgets = (view, widgets, range = null) => {
if (range) {
// range argument passed for block-based evaluation
view.dispatch({ effects: setWidgetsInRange.of({ widgets, range }) });
} else {
view.dispatch({ effects: setWidgets.of(widgets) });
}
};
function getWidgets(widgetConfigs) {
return (
widgetConfigs
// codemirror throws an error if we don't sort
.sort((a, b) => a.to - b.to)
.map((widgetConfig) => {
function getWidgets(widgetConfigs, view) {
const filtered = widgetConfigs
// Filter to widget configs only (exclude sliders)
.filter((w) => w && w.type && w.type !== 'slider')
// Deduplicate widgets by ID, matching slider behavior for stable widget identity
.filter((widget, index, self) => index === self.findIndex((w) => w.type === widget.type && w.id === widget.id));
// Filter out widgets whose range is encompassed by another widget
// const nonEncompassed = filterEncompassedWidgets(filtered);
return filtered
.sort((a, b) => (a.to || 0) - (b.to || 0))
.map((widgetConfig) => {
try {
return Decoration.widget({
widget: new BlockWidget(widgetConfig),
widget: new BlockWidget(widgetConfig, view),
side: 0,
block: true,
}).range(widgetConfig.to);
})
);
}).range(widgetConfig.to || widgetConfig.from || 0);
} catch (error) {
console.error('error creating widget', error);
return null;
}
})
.filter(Boolean); // Remove any null results from failed creations
}
const widgetField = StateField.define(
/* <DecorationSet> */ {
create() {
return Decoration.none;
},
update(widgets, tr) {
widgets = widgets.map(tr.changes);
for (let e of tr.effects) {
if (e.is(addWidget)) {
try {
widgets = widgets.update({
filter: () => false,
add: getWidgets(e.value),
});
} catch (error) {
console.log('err', error);
export const widgetPlugin = ViewPlugin.fromClass(
class {
decorations; //: DecorationSet
constructor(view /* : EditorView */) {
this.decorations = Decoration.set([]);
}
update(update /* : ViewUpdate */) {
update.transactions.forEach((tr) => {
if (tr.docChanged) {
this.decorations = this.decorations.map(tr.changes);
const iterator = this.decorations.iter();
// Apply changes to iterator.from and iterator.to if docChanged
while (iterator.value) {
// when the widgets are moved, we need to tell the dom node the current position
// this is important because the widget functions have to work with the dom node
if (iterator.value?.widget instanceof BlockWidget) {
iterator.value.widget.from = iterator.from;
iterator.value.widget.to = iterator.to;
}
iterator.next();
}
}
}
return widgets;
},
provide: (f) => EditorView.decorations.from(f),
for (let e of tr.effects) {
if (e.is(setWidgetsInRange)) {
// Block-aware widget update logic
const { widgets, range } = e.value;
const [rangeStart, rangeEnd] = range;
// Get existing widget widgets that should be preserved
const existingWidgets = [];
this.decorations.between(0, update.view.state.doc.length, (from, to, decoration) => {
if (decoration.widget instanceof BlockWidget) {
// Preserve widgets outside the evaluation range
// Use strict > for rangeEnd because when code is deleted, widget positions
// map to the deletion boundary (rangeEnd), and those should be removed, not preserved
if (from < rangeStart || from > rangeEnd) {
existingWidgets.push({
from: decoration.widget.from,
to: decoration.widget.to,
type: decoration.widget.type,
index: decoration.widget.index,
id: decoration.widget.id,
});
}
}
});
// Merge preserved widgets with new widgets, deduplicating by ID
const mergedWidgets = [...existingWidgets, ...widgets].filter(
(widget, index, self) => index === self.findIndex((w) => w.type === widget.type && w.id === widget.id),
);
this.decorations = Decoration.set(getWidgets(mergedWidgets, update.view));
} else if (e.is(setWidgets)) {
this.decorations = Decoration.set(getWidgets(e.value, update.view));
}
}
});
}
},
{
decorations: (v) => v.decorations,
},
);
@@ -60,24 +116,116 @@ export function setWidget(id, el) {
}
export class BlockWidget extends WidgetType {
constructor(widgetConfig) {
constructor(widgetConfig, view) {
super();
// Graceful handling of invalid configs like sliders
if (!widgetConfig || typeof widgetConfig !== 'object') {
widgetConfig = { type: 'unknown', from: 0, to: 0 };
}
this.from = widgetConfig.from || 0;
this.originalFrom = widgetConfig.from || 0;
this.to = widgetConfig.to || this.from;
this.originalTo = widgetConfig.to || this.from;
this.type = widgetConfig.type || 'unknown';
this.index = widgetConfig.index || 0;
this.view = view;
// Use range-based ID for stability, similar to sliders
this.id = widgetConfig.id || getWidgetID?.(widgetConfig);
this.widgetConfig = widgetConfig;
}
eq() {
return true;
eq(other) {
if (!(other instanceof BlockWidget)) {
return false;
}
return (
this.id === other.id &&
this.from === other.from &&
this.to === other.to &&
this.type === other.type &&
this.index === other.index
);
}
toDOM() {
const id = getWidgetID(this.widgetConfig);
const el = widgetElements[id];
return el;
let wrap = document.createElement('span');
wrap.setAttribute('aria-hidden', 'true');
wrap.className = 'cm-widget-container';
let el = widgetElements[this.id];
if (el) {
// Ensure the element has the correct ID
el.id = this.id;
wrap.appendChild(el);
} else {
// Create a placeholder element if the widget element doesn't exist
// This prevents CodeMirror errors when widget is missing
const placeholder = document.createElement('span');
placeholder.setAttribute('aria-hidden', 'true');
placeholder.className = 'cm-widget-placeholder';
placeholder.style.cssText = 'display: none;'; // Hide placeholder
placeholder.id = this.id;
wrap.appendChild(placeholder);
}
return wrap;
}
ignoreEvent(e) {
return true;
}
}
export const widgetPlugin = [widgetField];
export function getActiveWidgets(view) {
if (!view || !view.state) {
return [];
}
const widgetPluginInstance = view.plugin(widgetPlugin);
if (!widgetPluginInstance || !widgetPluginInstance.decorations) {
return [];
}
const widgets = [];
widgetPluginInstance.decorations.between(0, view.state.doc.length, (from, to, decoration) => {
if (decoration.widget instanceof BlockWidget) {
widgets.push({
type: decoration.widget.type,
from: decoration.widget.from,
to: decoration.widget.to,
index: decoration.widget.index,
id: decoration.widget.id,
});
}
});
return widgets;
}
export function getAllWidgetIds(view) {
if (!view || !view.state) {
return [];
}
const widgetPluginInstance = view.plugin(widgetPlugin);
if (!widgetPluginInstance || !widgetPluginInstance.decorations) {
return [];
}
const widgetIds = [];
widgetPluginInstance.decorations.between(0, view.state.doc.length, (from, to, decoration) => {
if (decoration.widget instanceof BlockWidget) {
widgetIds.push(decoration.widget.id);
}
});
return widgetIds;
}
// widget implementer API to create a new widget type
export function registerWidget(type, fn) {
+49
View File
@@ -0,0 +1,49 @@
import { describe, bench } from 'vitest';
import { calculateSteps, rand, useRNG } from '../index.mjs';
const testingResolution = 128;
const _generateRandomPattern = () => rand.iter(testingResolution).fast(testingResolution).firstCycle();
describe('old random', () => {
calculateSteps(true);
bench(
'+tactus',
() => {
useRNG('legacy');
_generateRandomPattern();
},
{
time: 1000,
teardown() {
useRNG('legacy');
},
},
);
calculateSteps(false);
bench(
'-tactus',
() => {
useRNG('precise');
_generateRandomPattern();
},
{
time: 1000,
teardown() {
useRNG('legacy');
},
},
);
});
describe('random', () => {
calculateSteps(true);
bench('+tactus', _generateRandomPattern, { time: 1000 });
calculateSteps(false);
bench('-tactus', _generateRandomPattern, { time: 1000 });
});
calculateSteps(true);
+1381 -100
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -57,7 +57,7 @@ export class Cyclist {
}
// query the pattern for events
const haps = this.pattern.queryArc(begin, end, { _cps: this.cps });
const haps = this.pattern.queryArc(begin, end, { _cps: this.cps, cyclist: 'cyclist' });
haps.forEach((hap) => {
if (hap.hasOnset()) {
+1
View File
@@ -15,6 +15,7 @@ import Fraction, { gcd } from './fraction.mjs';
* - "-" hold previous value
* - "." silence
*
* @tags visualization
* @param {Pattern} pattern the pattern to use
* @param {number} chars max number of characters (approximately)
* @returns string
+12 -7
View File
@@ -35,18 +35,18 @@ const right = function (n, x) {
return result;
};
const _bjork = function (n, x) {
const _bjorklund = function (n, x) {
const [ons, offs] = n;
return Math.min(ons, offs) <= 1 ? [n, x] : _bjork(...(ons > offs ? left(n, x) : right(n, x)));
return Math.min(ons, offs) <= 1 ? [n, x] : _bjorklund(...(ons > offs ? left(n, x) : right(n, x)));
};
export const bjork = function (ons, steps) {
export const bjorklund = function (ons, steps) {
const inverted = ons < 0;
const absOns = Math.abs(ons);
const offs = steps - absOns;
const ones = Array(absOns).fill([1]);
const zeros = Array(offs).fill([0]);
const result = _bjork([absOns, offs], [ones, zeros]);
const result = _bjorklund([absOns, offs], [ones, zeros]);
const pattern = flatten(result[1][0]).concat(flatten(result[1][1]));
return inverted ? pattern.map((x) => 1 - x) : pattern;
};
@@ -61,6 +61,7 @@ export const bjork = function (ons, steps) {
*
* @memberof Pattern
* @name euclid
* @tags temporal
* @param {number} pulses the number of onsets/beats
* @param {number} steps the number of steps to fill
* @returns Pattern
@@ -73,6 +74,7 @@ export const bjork = function (ons, steps) {
* Like `euclid`, but has an additional parameter for 'rotating' the resulting sequence.
* @memberof Pattern
* @name euclidRot
* @tags temporal
* @param {number} pulses the number of onsets/beats
* @param {number} steps the number of steps to fill
* @param {number} rotation offset in steps
@@ -128,7 +130,7 @@ export const bjork = function (ons, steps) {
*/
const _euclidRot = function (pulses, steps, rotation) {
const b = bjork(pulses, steps);
const b = bjorklund(pulses, steps);
if (rotation) {
return rotate(b, -rotation);
}
@@ -139,7 +141,7 @@ export const euclid = register('euclid', function (pulses, steps, pat) {
return pat.struct(_euclidRot(pulses, steps, 0));
});
export const e = register('e', function (euc, pat) {
export const bjork = register('bjork', function (euc, pat) {
if (!Array.isArray(euc)) {
euc = [euc];
}
@@ -156,6 +158,7 @@ export const { euclidrot, euclidRot } = register(['euclidrot', 'euclidRot'], fun
* so there will be no gaps.
* @name euclidLegato
* @memberof Pattern
* @tags temporal
* @param {number} pulses the number of onsets/beats
* @param {number} steps the number of steps to fill
* @param rotation offset in steps
@@ -187,6 +190,7 @@ export const euclidLegato = register(['euclidLegato'], function (pulses, steps,
* the resulting sequence
* @name euclidLegatoRot
* @memberof Pattern
* @tags temporal
* @param {number} pulses the number of onsets/beats
* @param {number} steps the number of steps to fill
* @param {number} rotation offset in steps
@@ -208,6 +212,7 @@ export const euclidLegatoRot = register(['euclidLegatoRot'], function (pulses, s
* @name euclidish
* @synonyms eish
* @memberof Pattern
* @tags temporal
* @param {number} pulses the number of onsets
* @param {number} steps the number of steps to fill
* @param {number} groove exists between the extremes of 0 (straight euclidian) and 1 (straight pulse)
@@ -216,6 +221,6 @@ export const euclidLegatoRot = register(['euclidLegatoRot'], function (pulses, s
* .pan(sine.slow(8))
*/
export const { euclidish, eish } = register(['euclidish', 'eish'], function (pulses, steps, perc, pat) {
const morphed = _morph(bjork(pulses, steps), new Array(pulses).fill(1), perc);
const morphed = _morph(bjorklund(pulses, steps), new Array(pulses).fill(1), perc);
return pat.struct(morphed).setSteps(steps);
});
+28
View File
@@ -5,6 +5,34 @@ This program is free software: you can redistribute it and/or modify it under th
*/
export const strudelScope = {};
// Make strudelScope available globally so transpiled code can access it
globalThis.strudelScope = strudelScope;
// Track user-defined keys (from block-based eval) so we can clear them without removing strudel functions
export const userDefinedKeys = new Set();
globalThis.userDefinedKeys = userDefinedKeys;
/**
* Clears all user-defined variables and functions from the scope.
* This removes variables created during block-based evaluation.
* @name clearScope
* @example
* // After defining variables in blocks:
* // let myVar = 5
* // function myFunc() { return 10; }
* clearScope() // removes myVar and myFunc from scope
*/
export const clearScope = () => {
for (const key of userDefinedKeys) {
delete strudelScope[key];
delete globalThis[key];
}
userDefinedKeys.clear();
// Return silence if available (for use in pattern expressions), otherwise undefined
return globalThis.silence;
};
// Make clearScope available globally
globalThis.clearScope = clearScope;
export const evalScope = async (...args) => {
const results = await Promise.allSettled(args);
+2
View File
@@ -126,6 +126,8 @@ export const lcm = (...fractions) => {
);
};
export const isFraction = (x) => x instanceof Fraction;
fraction._original = Fraction;
export default fraction;
+90
View File
@@ -0,0 +1,90 @@
/*
stateful.mjs - File of shame for stateful, impure and otherwise illegal pattern methods
Copyright (C) 2025 Strudel contributors - see <https://codeberg.org/uzu/strudel/src/branch/main/packages/core/index.mjs>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { register, reify, Pattern } from './pattern.mjs';
let timelines = {};
export const reset_state = function () {
reset_timelines();
};
export const reset_timelines = function () {
timelines = {};
};
/***
* Allows you to switch a pattern between different 'timelines'. This is particularly useful when
* live coding, for example when you want to cue a pattern up to play from its start.
*
* Timelines are specified by number, so that if you had a pattern like
* `n("<0 1 2 3>").s("num").timeline(1)` playing, then changed the '1'
* to '2', it would always align '0' to the nearest cycle. You will likely want to trigger
* an evaluation a little bit before the cycle starts, to avoid missing events.
*
* After the first use, a timeline will continue with the same 'offset'. That is, if you change
* a pattern without changing its timeline number, it will stay on that timeline without resetting.
*
* Rather than incrementing a timeline to reset it, it's easier to negate it, e.g. by switching between `-2`
* and `2`. This is because when you negate a timeline it will always reset.
*
* You can also pattern the timeline if you want, to create strange resetting patterns.
* @param {number | Pattern} timeline The timeline that the pattern should play on.
* @example
* n("<0 1 2 3>(3,8)")
* .sound("num")
* // resets the timeline every two cycles, by negating the timeline.
* // in a lot of cases this will be edited by a human live coder
* // rather than patterned!
* .timeline("<2 -2>".slow(2))
*/
export const timeline = register(
'timeline',
function (tpat, pat) {
tpat = reify(tpat);
const f = function (state) {
// Is this called from the scheduler? (rather than from e.g. the visualiser)
const scheduler = !!state.controls.cyclist;
const timehaps = tpat.query(state);
const result = [];
for (const timehap of timehaps) {
const tlid = timehap.value;
let offset;
if (tlid === 0) {
offset = 0;
} else if (tlid in timelines) {
offset = timelines[tlid];
} else {
const timearc = timehap.wholeOrPart();
if (!scheduler || state.span.begin.lt(timearc.midpoint())) {
offset = timearc.begin;
} else {
// Sync to end of timearc if we first see it over halfway into its
// timespan. Allows 'cuing up' next timeline when live coding.
offset = timearc.end;
}
}
if (scheduler) {
// update state
timelines[tlid] = offset;
if (tlid !== 0) {
delete timelines[-tlid];
}
}
const pathaps = pat
.late(offset)
.query(state.setSpan(timehap.part))
.map((h) => h.setContext(h.combineContext(timehap)));
result.push(...pathaps);
}
return result;
};
return new Pattern(f, pat._steps);
},
false,
);
+13 -12
View File
@@ -1,6 +1,6 @@
/*
index.mjs - <short description TODO>
Copyright (C) 2022 Strudel contributors - see <https://codeberg.org/uzu/strudel/src/branch/main/packages/core/index.mjs>
Copyright (C) 2025 Strudel contributors - see <https://codeberg.org/uzu/strudel/src/branch/main/packages/core/index.mjs>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
@@ -11,20 +11,21 @@ import createClock from './zyklus.mjs';
import { logger } from './logger.mjs';
export { Fraction, controls, createClock };
export * from './controls.mjs';
export * from './hap.mjs';
export * from './pattern.mjs';
export * from './signal.mjs';
export * from './pick.mjs';
export * from './state.mjs';
export * from './timespan.mjs';
export * from './util.mjs';
export * from './speak.mjs';
export * from './evaluate.mjs';
export * from './repl.mjs';
export * from './cyclist.mjs';
export * from './evaluate.mjs';
export * from './hap.mjs';
export * from './impure.mjs';
export * from './logger.mjs';
export * from './time.mjs';
export * from './pattern.mjs';
export * from './pick.mjs';
export * from './repl.mjs';
export * from './signal.mjs';
export * from './speak.mjs';
export * from './state.mjs';
export * from './schedulerState.mjs';
export * from './timespan.mjs';
export * from './ui.mjs';
export * from './util.mjs';
export { default as drawLine } from './drawLine.mjs';
// below won't work with runtime.mjs (json import fails)
/* import * as p from './package.json';
+3 -2
View File
@@ -5,8 +5,9 @@ let debounce = 1000,
lastTime;
export function errorLogger(e, origin = 'cyclist') {
//TODO: add some kind of debug flag that enables this while in dev mode
// console.error(e);
if (process.env.NODE_ENV === 'development') {
console.error(e);
}
logger(`[${origin}] error: ${e.message}`);
}
+1 -2
View File
@@ -38,8 +38,7 @@ export class NeoCyclist {
if (this.started === false) {
return;
}
const haps = this.pattern.queryArc(begin, end, { _cps: this.cps });
const haps = this.pattern.queryArc(begin, end, { _cps: this.cps, cyclist: 'neocyclist' });
haps.forEach((hap) => {
if (hap.hasOnset()) {
const timeUntilTrigger = cycleToSeconds(hap.whole.begin - this.cycle, this.cps);
+4 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@strudel/core",
"version": "1.2.4",
"version": "1.2.6",
"description": "Port of Tidal Cycles to JavaScript",
"main": "index.mjs",
"type": "module",
@@ -37,5 +37,8 @@
"devDependencies": {
"vite": "^6.0.11",
"vitest": "^3.0.4"
},
"engines": {
"node": ">=18.0.0"
}
}
+836 -131
View File
File diff suppressed because it is too large Load Diff
+40 -22
View File
@@ -28,6 +28,7 @@ const _pick = function (lookup, pat, modulo = true) {
/** * Picks patterns (or plain values) either from a list (by index) or a lookup table (by name).
* Similar to `inhabit`, but maintains the structure of the original patterns.
* @tags combiners
* @param {Pattern} pat
* @param {*} xs
* @returns {Pattern}
@@ -57,6 +58,7 @@ const __pick = register('pick', function (lookup, pat) {
* it wraps around, rather than sticking at the maximum value.
* For example, if you pick the fifth pattern of a list of three, you'll get the
* second one.
* @tags combiners
* @param {Pattern} pat
* @param {*} xs
* @returns {Pattern}
@@ -67,32 +69,38 @@ export const pickmod = register('pickmod', function (lookup, pat) {
});
/** * pickF lets you use a pattern of numbers to pick which function to apply to another pattern.
* @tags combiners, functional
* @param {Pattern} pat
* @param {Pattern} lookup a pattern of indices
* @param {function[]} funcs the array of functions from which to pull
* @param {Pattern} lookup a pattern of indices or names
* @param {function[] | object} lookup the array or lookup object of functions from which to pull
* @returns {Pattern}
* @example
* s("bd [rim hh]").pickF("<0 1 2>", [rev,jux(rev),fast(2)])
* @example
* note("<c2 d2>(3,8)").s("square")
* .pickF("<0 2> 1", [jux(rev),fast(2),x=>x.lpf(800)])
* .pickF("<0 2> 1", [jux(rev), fast(2), x=>x.lpf(800)])
* @example
* note("<c2 d2>(3,8)").s("square")
* .pickF("<jr l> f", { jr:jux(rev), f:fast(2), l:x=>x.lpf(800) })
*/
export const pickF = register('pickF', function (lookup, funcs, pat) {
return pat.apply(pick(lookup, funcs));
export const pickF = register('pickF', function (pickPattern, lookup, pat) {
return pat.apply(pick(lookup, pickPattern));
});
/** * The same as `pickF`, but if you pick a number greater than the size of the functions list,
* it wraps around, rather than sticking at the maximum value.
* @tags combiners
* @param {Pattern} pat
* @param {Pattern} lookup a pattern of indices
* @param {function[]} funcs the array of functions from which to pull
* @param {Pattern} lookup a pattern of indices or names
* @param {function[] | object} lookup the array or lookup object of functions from which to pull
* @returns {Pattern}
*/
export const pickmodF = register('pickmodF', function (lookup, funcs, pat) {
return pat.apply(pickmod(lookup, funcs));
export const pickmodF = register('pickmodF', function (pickPattern, lookup, pat) {
return pat.apply(pickmod(lookup, pickPattern));
});
/** * Similar to `pick`, but it applies an outerJoin instead of an innerJoin.
* @tags combiners
* @param {Pattern} pat
* @param {*} xs
* @returns {Pattern}
@@ -103,6 +111,7 @@ export const pickOut = register('pickOut', function (lookup, pat) {
/** * The same as `pickOut`, but if you pick a number greater than the size of the list,
* it wraps around, rather than sticking at the maximum value.
* @tags combiners
* @param {Pattern} pat
* @param {*} xs
* @returns {Pattern}
@@ -112,6 +121,7 @@ export const pickmodOut = register('pickmodOut', function (lookup, pat) {
});
/** * Similar to `pick`, but the choosen pattern is restarted when its index is triggered.
* @tags combiners
* @param {Pattern} pat
* @param {*} xs
* @returns {Pattern}
@@ -122,6 +132,7 @@ export const pickRestart = register('pickRestart', function (lookup, pat) {
/** * The same as `pickRestart`, but if you pick a number greater than the size of the list,
* it wraps around, rather than sticking at the maximum value.
* @tags combiners
* @param {Pattern} pat
* @param {*} xs
* @returns {Pattern}
@@ -138,6 +149,7 @@ export const pickmodRestart = register('pickmodRestart', function (lookup, pat)
});
/** * Similar to `pick`, but the choosen pattern is reset when its index is triggered.
* @tags combiners
* @param {Pattern} pat
* @param {*} xs
* @returns {Pattern}
@@ -148,6 +160,7 @@ export const pickReset = register('pickReset', function (lookup, pat) {
/** * The same as `pickReset`, but if you pick a number greater than the size of the list,
* it wraps around, rather than sticking at the maximum value.
* @tags combiners
* @param {Pattern} pat
* @param {*} xs
* @returns {Pattern}
@@ -157,19 +170,22 @@ export const pickmodReset = register('pickmodReset', function (lookup, pat) {
});
/** Picks patterns (or plain values) either from a list (by index) or a lookup table (by name).
* Similar to `pick`, but cycles are squeezed into the target ('inhabited') pattern.
* @name inhabit
* @synonyms pickSqueeze
* @param {Pattern} pat
* @param {*} xs
* @returns {Pattern}
* @example
* "<a b [a,b]>".inhabit({a: s("bd(3,8)"),
b: s("cp sd")
})
* @example
* s("a@2 [a b] a".inhabit({a: "bd(3,8)", b: "sd sd"})).slow(4)
*/
* Similar to `pick`, but cycles are squeezed into the target ('inhabited') pattern.
* @name inhabit
* @tags combiners
* @synonyms pickSqueeze
* @param {Pattern} pat
* @param {*} xs
* @returns {Pattern}
* @example
* let a = s("bd(3,8)")
* let b = s("cp sd")
* "<a b [a,b]>".inhabit({ a, b })
* @example
* s("a@2 [a b] a"
* .inhabit({a: "bd(3,8)", b: "sd sd"}))
* .slow(4)
*/
export const { inhabit, pickSqueeze } = register(['inhabit', 'pickSqueeze'], function (lookup, pat) {
return _pick(lookup, pat, false).squeezeJoin();
});
@@ -180,6 +196,7 @@ export const { inhabit, pickSqueeze } = register(['inhabit', 'pickSqueeze'], fun
* second one.
* @name inhabitmod
* @synonyms pickmodSqueeze
* @tags combiners
* @param {Pattern} pat
* @param {*} xs
* @returns {Pattern}
@@ -192,6 +209,7 @@ export const { inhabitmod, pickmodSqueeze } = register(['inhabitmod', 'pickmodSq
/**
* Pick from the list of values (or patterns of values) via the index using the given
* pattern of integers. The selected pattern will be compressed to fit the duration of the selecting event
* @tags combiners
* @param {Pattern} pat
* @param {*} xs
* @returns {Pattern}
+350 -32
View File
@@ -2,9 +2,16 @@ import { NeoCyclist } from './neocyclist.mjs';
import { Cyclist } from './cyclist.mjs';
import { evaluate as _evaluate } from './evaluate.mjs';
import { errorLogger, logger } from './logger.mjs';
import { setTime } from './time.mjs';
import {
setCpsFunc,
setIsStarted,
setPattern as exposeSchedulerPattern,
setTime,
setTriggerFunc,
} from './schedulerState.mjs';
import { evalScope } from './evaluate.mjs';
import { register, Pattern, isPattern, silence, stack } from './pattern.mjs';
import { reset_state } from './impure.mjs';
export function repl({
defaultOutput,
@@ -31,6 +38,7 @@ export function repl({
pattern: undefined,
miniLocations: [],
widgets: [],
sliders: [],
pending: false,
started: false,
};
@@ -51,7 +59,11 @@ export function repl({
getTime,
onToggle: (started) => {
updateState({ started });
setIsStarted(started);
onToggle?.(started);
if (!started) {
reset_state();
}
},
setInterval,
clearInterval,
@@ -61,48 +73,246 @@ export function repl({
// NeoCyclist uses a shared worker to communicate between instances, which is not supported on mobile chrome
const scheduler =
sync && typeof SharedWorker != 'undefined' ? new NeoCyclist(schedulerOptions) : new Cyclist(schedulerOptions);
setTriggerFunc(schedulerOptions.onTrigger);
setCpsFunc(() => scheduler.cps);
let pPatterns = {};
let anonymousIndex = 0;
let allTransform;
let eachTransform;
// Block-based evaluation state
let codeBlocks = {};
let lastActiveVisualizerLabel = null;
// Track which patterns belong to which blocks: { blockRange: [patternKeys] }
let blockPatterns = new Map();
// Helper function to collect properties from all code blocks (handles both labeled and anonymous blocks)
function collectFromBlocks(property) {
return Object.entries(codeBlocks).flatMap(([key, block]) => {
if (key === '$') {
// Anonymous blocks are stored as an array of block objects
return Array.isArray(block) ? block.flatMap((b) => b[property] || []) : [];
}
// Labeled blocks are stored as single block objects
return block[property] || [];
});
}
// Helper function to process a single labeled block
function processLabeledBlock(labels, i, code, options, meta) {
const label = labels[i];
const nextLabel = labels[i + 1] || { index: code.length, end: code.length };
const labelCode = code.slice(label.index, nextLabel.index);
const labelRange = [label.index + options.range[0], label.end + options.range[0]];
// Calculate the full block range (from label start to next label start)
const blockStart = label.index + options.range[0];
const blockEnd = nextLabel.index + options.range[0];
const blockWidgets = (meta?.widgets || []).filter((widget) => {
const widgetPos = widget.from ?? widget.index ?? 0;
return widgetPos >= blockStart && widgetPos < blockEnd;
});
const blockSliders = (meta?.sliders || []).filter((slider) => {
const sliderPos = slider.from ?? slider.index ?? 0;
return sliderPos >= blockStart && sliderPos < blockEnd;
});
const blockMiniLocations = (meta?.miniLocations || []).filter((loc) => {
// const locStart = loc.start ?? loc.from ?? 0;
// mini locations can be either [start, end] arrays or objects with start/from
const locStart = Array.isArray(loc) ? loc[0] : (loc.start ?? loc.from ?? 0);
return locStart >= blockStart && locStart < blockEnd;
});
handleSingleLabelBlock(
label,
labelCode,
{ ...options, range: labelRange },
{ widgets: blockWidgets, sliders: blockSliders, miniLocations: blockMiniLocations },
);
}
// helper
function cleanupConflictingRanges(codeBlocks, currentKey, newRange) {
for (const [existingKey, existingBlock] of Object.entries(codeBlocks)) {
if (existingKey === currentKey) continue;
if (!existingBlock.range) continue;
const [existingStart, existingEnd] = existingBlock.range;
const [newStart, newEnd] = newRange;
// If ranges overlap (not just touch), remove the stale block
if (!(newEnd <= existingStart || newStart >= existingEnd)) {
delete codeBlocks[existingKey];
}
}
}
// helper
function handleSingleLabelBlock(label, code, options, meta) {
// Detect if this block contains a non-inline widget
// The activeVisualizer is now provided by the transpiler for all labels
const activeVisualizer = label.activeVisualizer || null;
if (activeVisualizer !== null) {
lastActiveVisualizerLabel = label.name;
}
// Store the entire code block under the label name
codeBlocks[label.name] = {
code: code,
range: options.range,
labels: [label.name],
miniLocations: meta?.miniLocations || [],
widgets: meta?.widgets || [],
sliders: meta?.sliders || [],
activeVisualizer: activeVisualizer, // Store the widget type if present, null otherwise
};
// Clean up any blocks with conflicting ranges (including declaration blocks)
cleanupConflictingRanges(codeBlocks, label.name, options.range);
}
// helper
// These blocks return silence but may contain mini notation strings that need highlighting
function handleDeclarationBlock(code, options, meta) {
const range = options.range || [];
if (range.length < 2) return;
const blockKey = `_decl:${range[0]}:${range[1]}`;
codeBlocks[blockKey] = {
code: code,
range: range,
labels: [],
miniLocations: meta?.miniLocations || [],
widgets: meta?.widgets || [],
sliders: meta?.sliders || [],
activeVisualizer: null,
};
// Clean up any overlapping declaration blocks
cleanupConflictingRanges(codeBlocks, blockKey, range);
}
const hush = function () {
pPatterns = {};
anonymousIndex = 0;
allTransform = undefined;
eachTransform = undefined;
codeBlocks = {};
blockPatterns.clear();
lastActiveVisualizerLabel = null; // Reset 'all' visualizer tracking
return silence;
};
// helper to get a patternified pure value out
function unpure(pat) {
if (pat._Pattern) {
return pat.__pure;
}
return pat;
}
const setPattern = async (pattern, autostart = true) => {
pattern = editPattern?.(pattern) || pattern;
await scheduler.setPattern(pattern, autostart);
exposeSchedulerPattern(pattern);
return pattern;
};
setTime(() => scheduler.now()); // TODO: refactor?
const stop = () => scheduler.stop();
// Helper function to apply pattern transformations (solo, each, all)
// this should be abstracted more
function applyPatternTransforms(pattern) {
const allPatterns = Object.values(pPatterns);
if (allPatterns.length) {
let patterns = [];
let soloActive = false;
for (const [key, value] of Object.entries(pPatterns)) {
// handle soloed patterns ex: S$: s("bd!4")
const isSolod = key.length > 1 && key.startsWith('S');
if (isSolod && soloActive === false) {
// first time we see a soloed pattern, clear existing patterns
patterns = [];
soloActive = true;
}
if (!soloActive || (soloActive && isSolod)) {
const valWithState = value.withState((state) => state.setControls({ id: key }));
patterns.push(valWithState);
}
}
if (eachTransform) {
// Explicit lambda so only element (not index and array) are passed
patterns = patterns.map((x) => eachTransform(x));
}
pattern = stack(...patterns);
} else if (eachTransform) {
pattern = eachTransform(pattern);
}
if (allTransforms.length) {
for (const transform of allTransforms) {
pattern = transform(pattern);
}
}
if (!isPattern(pattern)) {
pattern = silence;
}
return pattern;
}
const stop = () => {
codeBlocks = {};
blockPatterns.clear();
pPatterns = {};
lastActiveVisualizerLabel = null; // Reset 'all' visualizer tracking
updateState({
miniLocations: [],
widgets: [],
sliders: [],
});
scheduler.stop();
};
const start = () => scheduler.start();
const pause = () => scheduler.pause();
const toggle = () => scheduler.toggle();
const setCps = (cps) => scheduler.setCps(cps);
const setCps = (cps) => {
scheduler.setCps(unpure(cps));
return silence;
};
/**
* Changes the global tempo to the given cycles per minute
*
* @name setcpm
* @tags temporal
* @alias setCpm
* @param {number} cpm cycles per minute
* @example
* setcpm(140/4) // =140 bpm in 4/4
* $: s("bd*4,[- sd]*2").bank('tr707')
*/
const setCpm = (cpm) => scheduler.setCps(cpm / 60);
const setCpm = (cpm) => {
scheduler.setCps(unpure(cpm) / 60);
return silence;
};
// TODO - not documented as jsdoc examples as the test framework doesn't simulate enough context for `each` and `all`..
/** Applies a function to all the running patterns. Note that the patterns are groups together into a single `stack` before the function is applied. This is probably what you want, but see `each` for
let allTransforms = [];
/**
* Applies a function to all the running patterns. Note that the patterns are grouped together into a single `stack` before the function is applied. This is probably what you want, but see `each` for
* a version that applies the function to each pattern separately.
*
* **Note:** Patterns must be labeled (e.g. with `$:`) to be picked up by `all`. An unlabeled
* pattern such as `note("c4")` is not registered and will produce no audio when `all` is present.
* Use `$: note("c4")` instead.
* ```
* $: sound("bd - cp sd")
* $: sound("hh*8")
@@ -113,18 +323,24 @@ export function repl({
* $: sound("hh*8")
* all(x => x.pianoroll())
* ```
*
* @tags combiners
*/
let allTransforms = [];
const all = function (transform) {
allTransforms.push(transform);
return silence;
};
/** Applies a function to each of the running patterns separately. This is intended for future use with upcoming 'stepwise' features. See `all` for a version that applies the function to all the patterns stacked together into a single pattern.
*
* **Note:** Patterns must be labeled (e.g. with `$:`) to be picked up by `each`. An unlabeled
* pattern such as `note("c4")` is not registered and will produce no audio when `each` is present.
* Use `$: note("c4")` instead.
* ```
* $: sound("bd - cp sd")
* $: sound("hh*8")
* each(fast("<2 3>"))
* ```
* @tags combiners
*/
const each = function (transform) {
eachTransform = transform;
@@ -138,9 +354,9 @@ export function repl({
// allows muting a pattern x with x_ or _x
return silence;
}
if (id === '$') {
if (id.includes('$')) {
// allows adding anonymous patterns with $:
id = `$${anonymousIndex}`;
id = `${id}${anonymousIndex}`;
anonymousIndex++;
}
pPatterns[id] = this;
@@ -183,7 +399,7 @@ export function repl({
});
};
const evaluate = async (code, autostart = true, shouldHush = true) => {
const evaluate = async (code, autostart = true) => {
if (!code) {
throw new Error('no code to evaluate');
}
@@ -191,45 +407,34 @@ export function repl({
updateState({ code, pending: true });
await injectPatternMethods();
setTime(() => scheduler.now()); // TODO: refactor?
await beforeEval?.({ code });
await beforeEval?.({ code, blockBased: false });
allTransforms = []; // reset all transforms
shouldHush && hush();
codeBlocks = {};
hush();
if (mondo) {
code = `mondolang\`${code}\``;
}
let { pattern, meta } = await _evaluate(code, transpiler, transpilerOptions);
if (Object.keys(pPatterns).length) {
let patterns = Object.values(pPatterns);
if (eachTransform) {
// Explicit lambda so only element (not index and array) are passed
patterns = patterns.map((x) => eachTransform(x));
}
pattern = stack(...patterns);
} else if (eachTransform) {
pattern = eachTransform(pattern);
}
if (allTransforms.length) {
for (let i in allTransforms) {
pattern = allTransforms[i](pattern);
}
}
if (!isPattern(pattern)) {
const message = `got "${typeof evaluated}" instead of pattern`;
throw new Error(message + (typeof evaluated === 'function' ? ', did you forget to call a function?' : '.'));
}
pattern = applyPatternTransforms(pattern);
logger(`[eval] code updated`);
pattern = await setPattern(pattern, autostart);
updateState({
miniLocations: meta?.miniLocations || [],
widgets: meta?.widgets || [],
sliders: meta?.sliders || [],
activeCode: code,
pattern,
evalError: undefined,
schedulerError: undefined,
pending: false,
});
afterEval?.({ code, pattern, meta });
afterEval?.({ code, pattern, meta, range: undefined, widgetRemoved: false });
return pattern;
} catch (err) {
logger(`[eval] error: ${err.message}`, 'error');
@@ -238,8 +443,121 @@ export function repl({
onEvalError?.(err);
}
};
const evaluateBlock = async (code, autostart = true, options = {}) => {
if (!code) {
throw new Error('no code to evaluate');
}
try {
updateState({ code, pending: true });
await injectPatternMethods();
setTime(() => scheduler.now()); // TODO: refactor?
await beforeEval?.({ code, blockBased: true });
allTransforms = []; // reset all transforms
const transpilerOptionsWithBlock = {
...transpilerOptions,
blockBased: true,
range: options.range || [],
};
if (mondo) {
code = `mondolang\`${code}\``;
}
let { pattern, meta } = await _evaluate(code, transpiler, transpilerOptionsWithBlock);
// Track activeVisualizer cleanup: check if any block's visualizer was removed
let widgetRemoved = false;
const labels = meta.labels || [];
// Check for anonymous labels (labels starting with '$')
const hasAnonymousLabel = labels.some((label) => label.name.startsWith('$'));
// Store code blocks in dictionary using labels as keys
if (hasAnonymousLabel) {
// variable/function declarations that don't return patterns are allowed,
// but anonymous pattern blocks pose an issue for block-based evaluation
// if an anonymous pattern is evaluated multiple times it will just stack and get louder and louder
// it's very common for users to write code prefixed with '$'
// but to modify and override existing patterns, the patterns must be labeled,
// otherwise we'll have no idea of which pattern is being overridden
// (we probably need to update the docs on this)
// we could easily enable it, but it would confuse a lot of people
throw new Error(
'anonymous labels disabled for block based evaluation (see https://strudel.cc/blog/#label-notation)',
);
} else if (labels.length > 0) {
for (let i = 0; i < labels.length; i++) {
// processing transpiler output instead of code is simply to avoid
// extra regex in detecting whether or not an inline widget has been commented out
processLabeledBlock(labels, i, meta.output, options, meta);
}
} else {
// Declaration block (variable/function that returns silence)
// Store it so its miniLocations are preserved for highlighting patterns stored in variables
handleDeclarationBlock(code, options, meta);
}
meta.miniLocations = collectFromBlocks('miniLocations');
meta.widgets = collectFromBlocks('widgets');
meta.sliders = collectFromBlocks('sliders');
// Track activeVisualizer cleanup: check if any block's visualizer was removed
const blocksToUpdate = labels.map((label) => label.name);
// this is the hackiest bit
for (const [key, block] of Object.entries(codeBlocks)) {
if (blocksToUpdate.includes(key)) {
// This block was just updated
if (block.activeVisualizer !== null) {
// Block now has a visualizer, update tracking
lastActiveVisualizerLabel = key;
} else if (lastActiveVisualizerLabel === key) {
// This block lost its visualizer, trigger cleanup
widgetRemoved = true;
lastActiveVisualizerLabel = null;
}
}
}
pPatterns = Object.fromEntries(
Object.entries(pPatterns).filter(([key]) => {
return Object.keys(codeBlocks).includes(key);
}),
);
pattern = applyPatternTransforms(pattern);
logger(`[eval] code updated`);
pattern = await setPattern(pattern, autostart);
updateState({
miniLocations: meta?.miniLocations || [],
widgets: meta?.widgets || [],
sliders: meta?.sliders || [],
activeCode: code,
pattern,
evalError: undefined,
schedulerError: undefined,
pending: false,
});
afterEval?.({ code, pattern, meta, range: options.range, widgetRemoved });
return pattern;
} catch (err) {
logger(`[eval] error: ${err.message}`, 'error');
console.error(err);
updateState({ evalError: err, pending: false });
onEvalError?.(err);
}
};
const setCode = (code) => updateState({ code });
return { scheduler, evaluate, start, stop, pause, setCps, setPattern, setCode, toggle, state };
return { scheduler, evaluate, evaluateBlock, start, stop, pause, setCps, setPattern, setCode, toggle, state };
}
export const getTrigger =
+53
View File
@@ -0,0 +1,53 @@
/*
schedulerState.mjs - Module to pipe out various parameters from the scheduler for global consumption
Copyright (C) 2026 Strudel contributors - see <https://codeberg.org/uzu/strudel/src/branch/main/packages/core/schedulerState.mjs>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
let time;
let cpsFunc;
let pattern;
let triggerFunc;
let isStarted;
export function getTime() {
if (!time) {
throw new Error('no time set! use setTime to define a time source');
}
return time();
}
export function setTime(func) {
time = func;
}
export function setCpsFunc(func) {
cpsFunc = func;
}
export function getCps() {
return cpsFunc?.();
}
export function setPattern(pat) {
pattern = pat;
}
export function getPattern() {
return pattern;
}
export function setTriggerFunc(func) {
triggerFunc = func;
}
export function getTriggerFunc() {
return triggerFunc;
}
export function setIsStarted(val) {
isStarted = !!val;
}
export function getIsStarted() {
return isStarted;
}
+284 -41
View File
@@ -16,7 +16,7 @@ export function steady(value) {
}
export const signal = (func) => {
const query = (state) => [new Hap(undefined, state.span, func(state.span.begin))];
const query = (state) => [new Hap(undefined, state.span, func(state.span.begin, state.controls))];
return new Pattern(query);
};
@@ -24,6 +24,7 @@ export const signal = (func) => {
* A sawtooth signal between 0 and 1.
*
* @return {Pattern}
* @tags generators
* @example
* note("<c3 [eb3,g3] g2 [g3,bb3]>*8")
* .clip(saw.slow(2))
@@ -38,6 +39,7 @@ export const saw = signal((t) => t % 1);
* A sawtooth signal between -1 and 1 (like `saw`, but bipolar).
*
* @return {Pattern}
* @tags generators
*/
export const saw2 = saw.toBipolar();
@@ -45,6 +47,7 @@ export const saw2 = saw.toBipolar();
* A sawtooth signal between 1 and 0 (like `saw`, but flipped).
*
* @return {Pattern}
* @tags generators
* @example
* note("<c3 [eb3,g3] g2 [g3,bb3]>*8")
* .clip(isaw.slow(2))
@@ -59,6 +62,7 @@ export const isaw = signal((t) => 1 - (t % 1));
* A sawtooth signal between 1 and -1 (like `saw2`, but flipped).
*
* @return {Pattern}
* @tags generators
*/
export const isaw2 = isaw.toBipolar();
@@ -66,12 +70,14 @@ export const isaw2 = isaw.toBipolar();
* A sine signal between -1 and 1 (like `sine`, but bipolar).
*
* @return {Pattern}
* @tags generators
*/
export const sine2 = signal((t) => Math.sin(Math.PI * 2 * t));
/**
* A sine signal between 0 and 1.
* @return {Pattern}
* @tags generators
* @example
* n(sine.segment(16).range(0,15))
* .scale("C:minor")
@@ -83,6 +89,7 @@ export const sine = sine2.fromBipolar();
* A cosine signal between 0 and 1.
*
* @return {Pattern}
* @tags generators
* @example
* n(stack(sine,cosine).segment(16).range(0,15))
* .scale("C:minor")
@@ -94,12 +101,14 @@ export const cosine = sine._early(Fraction(1).div(4));
* A cosine signal between -1 and 1 (like `cosine`, but bipolar).
*
* @return {Pattern}
* @tags generators
*/
export const cosine2 = sine2._early(Fraction(1).div(4));
/**
* A square signal between 0 and 1.
* @return {Pattern}
* @tags generators
* @example
* n(square.segment(4).range(0,7)).scale("C:minor")
*
@@ -110,6 +119,7 @@ export const square = signal((t) => Math.floor((t * 2) % 2));
* A square signal between -1 and 1 (like `square`, but bipolar).
*
* @return {Pattern}
* @tags generators
*/
export const square2 = square.toBipolar();
@@ -117,6 +127,7 @@ export const square2 = square.toBipolar();
* A triangle signal between 0 and 1.
*
* @return {Pattern}
* @tags generators
* @example
* n(tri.segment(8).range(0,7)).scale("C:minor")
*
@@ -127,6 +138,7 @@ export const tri = fastcat(saw, isaw);
* A triangle signal between -1 and 1 (like `tri`, but bipolar).
*
* @return {Pattern}
* @tags generators
*/
export const tri2 = fastcat(saw2, isaw2);
@@ -134,6 +146,7 @@ export const tri2 = fastcat(saw2, isaw2);
* An inverted triangle signal between 1 and 0 (like `tri`, but flipped).
*
* @return {Pattern}
* @tags generators
* @example
* n(itri.segment(8).range(0,7)).scale("C:minor")
*
@@ -144,6 +157,7 @@ export const itri = fastcat(isaw, saw);
* An inverted triangle signal between -1 and 1 (like `itri`, but bipolar).
*
* @return {Pattern}
* @tags generators
*/
export const itri2 = fastcat(isaw2, saw2);
@@ -151,6 +165,7 @@ export const itri2 = fastcat(isaw2, saw2);
* A signal representing the cycle time.
*
* @return {Pattern}
* @tags generators
*/
export const time = signal(id);
@@ -158,6 +173,7 @@ export const time = signal(id);
* The mouse's x position value ranges from 0 to 1.
* @name mousex
* @return {Pattern}
* @tags external_io
* @example
* n(mousex.segment(4).range(0,7)).scale("C:minor")
*
@@ -167,6 +183,7 @@ export const time = signal(id);
* The mouse's y position value ranges from 0 to 1.
* @name mousey
* @return {Pattern}
* @tags external_io
* @example
* n(mousey.segment(4).range(0,7)).scale("C:minor")
*
@@ -186,41 +203,102 @@ export const mouseY = signal(() => _mouseY);
export const mousex = signal(() => _mouseX);
export const mouseX = signal(() => _mouseX);
// random signals
// Random number generators
const xorwise = (x) => {
// Produce "Avalanche effect" where flipping a single bit of x
// results in all output bits flipping with probability 0.5
// See e.g. https://github.com/aappleby/smhasher/blob/0ff96f7835817a27d0487325b6c16033e2992eb5/src/MurmurHash3.cpp#L68-L77
const _murmurHashFinalizer = (x) => {
x |= 0;
x ^= x >>> 16;
x = Math.imul(x, 0x85ebca6b);
x ^= x >>> 13;
x = Math.imul(x, 0xc2b2ae35);
x ^= x >>> 16;
return x >>> 0; // unsigned
};
// Convert t to a 32 bit integer, preserving temporal resolution down to 1/2^29
const _tToT = (t) => {
return Math.floor(t * 536870912);
};
// Used to decorrelate nearby T, i, and seed prior to hashing
const _decorrelate = (T, i = 0, seed = 0) => {
const lowBits = (T >>> 0) >>> 0;
const highBits = Math.floor(T / 4294967296) >>> 0; // 2^32
let key = lowBits ^ Math.imul(highBits ^ 0x85ebca6b, 0xc2b2ae35);
key ^= Math.imul(i ^ 0x7f4a7c15, 0x9e3779b9);
key ^= Math.imul(seed ^ 0x165667b1, 0x27d4eb2d);
return key >>> 0;
};
const randAt = (T, i = 0, seed = 0) => {
return _murmurHashFinalizer(_decorrelate(T, i, seed)) / 4294967296; // 2^32
};
// n samples at time t
const timeToRands = (t, n, seed = 0) => {
const T = _tToT(t);
if (n === 1) {
return randAt(T, 0, seed);
}
const out = new Array(n);
for (let i = 0; i < n; i++) out[i] = randAt(T, i, seed);
return out;
};
// Old random signals. Currently the default, but can also be chosen via
// `useRNG('legacy')`
// stretch 300 cycles over the range of [0,2**29 == 536870912) then apply the xorshift algorithm
const __xorwise = (x) => {
const a = (x << 13) ^ x;
const b = (a >> 17) ^ a;
return (b << 5) ^ b;
};
// stretch 300 cycles over the range of [0,2**29 == 536870912) then apply the xorshift algorithm
const _frac = (x) => x - Math.trunc(x);
const timeToIntSeed = (x) => xorwise(Math.trunc(_frac(x / 300) * 536870912));
const intSeedToRand = (x) => (x % 536870912) / 536870912;
const timeToRand = (x) => Math.abs(intSeedToRand(timeToIntSeed(x)));
const timeToRandsPrime = (seed, n) => {
const __frac = (x) => x - Math.trunc(x);
const __timeToIntSeed = (x) => __xorwise(Math.trunc(__frac(x / 300) * 536870912));
const __intSeedToRand = (x) => (x % 536870912) / 536870912;
const __timeToRandsPrime = (seed, n) => {
if (n === 1) {
return Math.abs(__intSeedToRand(seed));
}
const result = [];
// eslint-disable-next-line
for (let i = 0; i < n; ++i) {
result.push(intSeedToRand(seed));
seed = xorwise(seed);
for (let i = 0; i < n; i++) {
result.push(__intSeedToRand(seed));
seed = __xorwise(seed);
}
return result;
};
const __timeToRands = (t, n) => __timeToRandsPrime(__timeToIntSeed(t), n);
const timeToRands = (t, n) => timeToRandsPrime(timeToIntSeed(t), n);
// End old random
let RNG_MODE = 'legacy';
export const getRandsAtTime = (t, n = 1, seed = 0) => {
return RNG_MODE === 'legacy' ? __timeToRands(t + seed, n) : timeToRands(t, n, seed);
};
/**
* Sets which random number generator to use. Historically Strudel would
* use `useRNG('legacy')`, which remains the default. To use a new more statistically
* precise RNG, try `useRNG('precise')`.
*
* @name useRNG
* @tags generators, math
* @param {string} mod - Mode. One of 'legacy', 'precise'
* @example
* useRNG('legacy')
* // Repeats every 300 cycles
* $: n(irand(50)).seg(16).scale("C:minor").ribbon(88, 32)
* $: n(irand(50)).seg(16).scale("C:minor").ribbon(388, 32)
*/
export const useRNG = (mode = 'legacy') => (RNG_MODE = mode);
/**
* A discrete pattern of numbers from 0 to n-1
* @tags generators
* @example
* n(run(4)).scale("C4:pentatonic")
* // n("0 1 2 3").scale("C4:pentatonic")
@@ -228,23 +306,25 @@ const timeToRands = (t, n) => timeToRandsPrime(timeToIntSeed(t), n);
export const run = (n) => saw.range(0, n).round().segment(n);
/**
* Creates a pattern from a binary number.
* Creates a binary pattern from a number.
*
* @name binary
* @tags generators
* @param {number} n - input number to convert to binary
* @example
* "hh".s().struct(binary(5))
* // "hh".s().struct("1 0 1")
*/
export const binary = (n) => {
const nBits = reify(n).log2(0).floor().add(1);
const nBits = reify(n).log2().floor().add(1);
return binaryN(n, nBits);
};
/**
* Creates a pattern from a binary number, padded to n bits long.
* Creates a binary pattern from a number, padded to n bits long.
*
* @name binaryN
* @tags generators
* @param {number} n - input number to convert to binary
* @param {number} nBits - pattern length, defaults to 16
* @example
@@ -258,10 +338,60 @@ export const binaryN = (n, nBits = 16) => {
return reify(n).segment(nBits).brshift(bitPos).band(pure(1));
};
/**
* Creates a binary list pattern from a number.
*
* @name binaryL
* @tags generators
* @param {number} n - input number to convert to binary
* s("saw").seg(8)
* .partials(binaryL(irand(4096).add(1)))
*/
export const binaryL = (n) => {
const nBits = reify(n).log2().floor().add(1);
return binaryNL(n, nBits);
};
/**
* Creates a binary list pattern from a number, padded to n bits long.
*
* @name binaryNL
* @tags generators
* @param {number} n - input number to convert to binary
* @param {number} nBits - pattern length, defaults to 16
*/
export const binaryNL = (n, nBits = 16) => {
return reify(n)
.withValue((v) => (bits) => {
const bList = [];
for (let i = bits - 1; i >= 0; i--) {
bList.push((v >> i) & 1);
}
return bList;
})
.appLeft(reify(nBits));
};
/**
* Creates a list of random numbers of the given length
*
* @name randL
* @tags generators
* @param {number} n Number of random numbers to sample
* @example
* s("saw").seg(16).n(irand(12)).scale("F1:minor")
* .partials(randL(8))
*/
export const randL = (n) => {
return signal((t) => (nVal) => getRandsAtTime(t, nVal).map(Math.abs)).appLeft(reify(n));
};
export const randrun = (n) => {
return signal((t) => {
return signal((t, controls) => {
// Without adding 0.5, the first cycle is always 0,1,2,3,...
const rands = timeToRands(t.floor().add(0.5), n);
let rands = getRandsAtTime(t.floor().add(0.5), n, controls.randSeed);
// Support n = 1
if (!Array.isArray(rands)) rands = [rands];
const nums = rands
.map((n, i) => [n, i])
.sort((a, b) => (a[0] > b[0]) - (a[0] < b[0]))
@@ -280,6 +410,7 @@ const _rearrangeWith = (ipat, n, pat) => {
* Slices a pattern into the given number of parts, then plays those parts in random order.
* Each part will be played exactly once per cycle.
* @name shuffle
* @tags temporal
* @example
* note("c d e f").sound("piano").shuffle(4)
* @example
@@ -293,6 +424,7 @@ export const shuffle = register('shuffle', (n, pat) => {
* Slices a pattern into the given number of parts, then plays those parts at random. Similar to `shuffle`,
* but parts might be played more than once, or not at all, per cycle.
* @name scramble
* @tags temporal
* @example
* note("c d e f").sound("piano").scramble(4)
* @example
@@ -302,18 +434,53 @@ export const scramble = register('scramble', (n, pat) => {
return _rearrangeWith(_irand(n)._segment(n), n, pat);
});
/**
* Modify a pattern by applying a function to the `randomSeed` control if present
*
* @tags math
* @param {Function} func Function from seed (or undefined) to seed (or undefined)
* @param {Pattern} pat Pattern to update
* @returns Pattern
*/
export const withSeed = (func, pat) => {
return new Pattern((state) => {
let { randSeed, ...controls } = state.controls;
randSeed = func(randSeed);
return pat.query(state.setControls({ ...controls, randSeed }));
}, pat._steps);
};
/**
* Change the seed for random signals. Normally, random signals depend on time,
* so two patterns at the same time will have the same random values. Specifying
* a new seed changes the signal output by `rand`. This also affects other functions
* that use randomness, like `shuffle` and `sometimes`.
*
* @name seed
* @tags math
* @param {number} n A new seed. Can be any number.
* @example
* $: s("hh*4").degrade();
* $: s("bd*4").degrade().seed(1); // Will degrade different events from the hi-hat
*/
export const seed = register('seed', (n, pat) => {
return withSeed(() => n, pat);
});
/**
* A continuous pattern of random numbers, between 0 and 1.
*
* @name rand
* @tags generators
* @example
* // randomly change the cutoff
* s("bd*4,hh*8").cutoff(rand.range(500,8000))
*
*/
export const rand = signal(timeToRand);
export const rand = signal((t, controls) => getRandsAtTime(t, 1, controls.randSeed));
/**
* A continuous pattern of random numbers, between -1 and 1
* @tags generators
*/
export const rand2 = rand.toBipolar();
@@ -323,6 +490,7 @@ export const _brandBy = (p) => rand.fmap((x) => x < p);
* A continuous pattern of 0 or 1 (binary random), with a probability for the value being 1
*
* @name brandBy
* @tags generators
* @param {number} probability - a number between 0 and 1
* @example
* s("hh*10").pan(brandBy(0.2))
@@ -333,6 +501,7 @@ export const brandBy = (pPat) => reify(pPat).fmap(_brandBy).innerJoin();
* A continuous pattern of 0 or 1 (binary random)
*
* @name brand
* @tags generators
* @example
* s("hh*10").pan(brand)
*/
@@ -344,6 +513,7 @@ export const _irand = (i) => rand.fmap((x) => Math.trunc(x * i));
* A continuous pattern of random integers, between 0 and n-1.
*
* @name irand
* @tags generators
* @param {number} n max value (exclusive)
* @example
* // randomly select scale notes from 0 - 7 (= C to C)
@@ -366,6 +536,7 @@ export const __chooseWith = (pat, xs) => {
/**
* Choose from the list of values (or patterns of values) using the given
* pattern of numbers, which should be in the range of 0..1
* @tags temporal
* @param {Pattern} pat
* @param {*} xs
* @returns {Pattern}
@@ -379,6 +550,7 @@ export const chooseWith = (pat, xs) => {
/**
* As with {chooseWith}, but the structure comes from the chosen values, rather
* than the pattern you're using to choose with.
* @tags temporal
* @param {Pattern} pat
* @param {*} xs
* @returns {Pattern}
@@ -389,6 +561,7 @@ export const chooseInWith = (pat, xs) => {
/**
* Chooses randomly from the given list of elements.
* @tags temporal
* @param {...any} xs values / patterns to choose from.
* @returns {Pattern} - a continuous pattern.
* @example
@@ -404,6 +577,7 @@ export const chooseOut = choose;
* Chooses from the given list of values (or patterns of values), according
* to the pattern that the method is called on. The pattern should be in
* the range 0 .. 1.
* @tags temporal
* @param {...any} xs
* @returns {Pattern}
*/
@@ -414,6 +588,7 @@ Pattern.prototype.choose = function (...xs) {
/**
* As with choose, but the pattern that this method is called on should be
* in the range -1 .. 1
* @tags temporal
* @param {...any} xs
* @returns {Pattern}
*/
@@ -423,6 +598,7 @@ Pattern.prototype.choose2 = function (...xs) {
/**
* Picks one of the elements at random each cycle.
* @tags temporal
* @synonyms randcat
* @returns {Pattern}
* @example
@@ -465,6 +641,7 @@ const wchooseWith = (...args) => _wchooseWith(...args).outerJoin();
/**
* Chooses randomly from the given list of elements by giving a probability to each element
* @tags temporal
* @param {...any} pairs arrays of value and weight
* @returns {Pattern} - a continuous pattern.
* @example
@@ -474,12 +651,13 @@ export const wchoose = (...pairs) => wchooseWith(rand, ...pairs);
/**
* Picks one of the elements at random each cycle by giving a probability to each element
* @tags temporal
* @synonyms wrandcat
* @returns {Pattern}
* @example
* wchooseCycles(["bd",10], ["hh",1], ["sd",1]).s().fast(8)
* @example
* wchooseCycles(["bd bd bd",5], ["hh hh hh",3], ["sd sd sd",1]).fast(4).s()
* wchooseCycles(["c c c",5], ["a a a",3], ["f f f",1]).fast(4).note()
* @example
* // The probability can itself be a pattern
* wchooseCycles(["bd(3,8)","<5 0>"], ["hh hh hh",3]).fast(4).s()
@@ -488,58 +666,56 @@ export const wchooseCycles = (...pairs) => _wchooseWith(rand.segment(1), ...pair
export const wrandcat = wchooseCycles;
function _perlin(t) {
function _perlin(t, seed = 0) {
let ta = Math.floor(t);
let tb = ta + 1;
const smootherStep = (x) => 6.0 * x ** 5 - 15.0 * x ** 4 + 10.0 * x ** 3;
const interp = (x) => (a) => (b) => a + smootherStep(x) * (b - a);
const v = interp(t - ta)(timeToRand(ta))(timeToRand(tb));
const ra = getRandsAtTime(ta, 1, seed);
const rb = getRandsAtTime(tb, 1, seed);
const v = interp(t - ta)(ra)(rb);
return v;
}
export const perlinWith = (tpat) => {
return tpat.fmap(_perlin);
};
function _berlin(t) {
function _berlin(t, seed = 0) {
const prevRidgeStartIndex = Math.floor(t);
const nextRidgeStartIndex = prevRidgeStartIndex + 1;
const prevRidgeBottomPoint = timeToRand(prevRidgeStartIndex);
const nextRidgeTopPoint = timeToRand(nextRidgeStartIndex) + prevRidgeBottomPoint;
const prevRidgeBottomPoint = getRandsAtTime(prevRidgeStartIndex, 1, seed);
const height = getRandsAtTime(nextRidgeStartIndex, 1, seed);
const nextRidgeTopPoint = prevRidgeBottomPoint + height;
const currentPercent = (t - prevRidgeStartIndex) / (nextRidgeStartIndex - prevRidgeStartIndex);
const interp = (a, b, t) => {
return a + (b - a) * t;
return a + t * (b - a);
};
return interp(prevRidgeBottomPoint, nextRidgeTopPoint, currentPercent) / 2;
}
export const berlinWith = (tpat) => {
return tpat.fmap(_berlin);
};
/**
* Generates a continuous pattern of [perlin noise](https://en.wikipedia.org/wiki/Perlin_noise), in the range 0..1.
*
* @tags generators
* @name perlin
* @example
* // randomly change the cutoff
* s("bd*4,hh*8").cutoff(perlin.range(500,8000))
*
*/
export const perlin = perlinWith(time.fmap((v) => Number(v)));
export const perlin = signal((t, controls) => _perlin(t, controls.randSeed));
/**
* Generates a continuous pattern of [berlin noise](conceived by Jame Coyne and Jade Rowland as a joke but turned out to be surprisingly cool and useful,
* like perlin noise but with sawtooth waves), in the range 0..1.
*
* @tags generators
* @name berlin
* @example
* // ascending arpeggios
* n("0!16".add(berlin.fast(4).mul(14))).scale("d:minor")
*
*/
export const berlin = berlinWith(time.fmap((v) => Number(v)));
export const berlin = signal((t, controls) => _berlin(t, controls.randSeed));
export const degradeByWith = register(
'degradeByWith',
@@ -553,6 +729,7 @@ export const degradeByWith = register(
* 0 = 0% chance of removal
* 1 = 100% chance of removal
*
* @tags temporal
* @name degradeBy
* @memberof Pattern
* @param {number} amount - a number between 0 and 1
@@ -578,6 +755,7 @@ export const degradeBy = register(
*
* Randomly removes 50% of events from the pattern. Shorthand for `.degradeBy(0.5)`
*
* @tags temporal
* @name degrade
* @memberof Pattern
* @returns Pattern
@@ -594,6 +772,7 @@ export const degrade = register('degrade', (pat) => pat._degradeBy(0.5), true, t
* 1 = 0% chance of removal
* Events that would be removed by degradeBy are let through by undegradeBy and vice versa (see second example).
*
* @tags temporal
* @name undegradeBy
* @memberof Pattern
* @param {number} amount - a number between 0 and 1
@@ -622,6 +801,7 @@ export const undegradeBy = register(
* Inverse of `degrade`: Randomly removes 50% of events from the pattern. Shorthand for `.undegradeBy(0.5)`
* Events that would be removed by degrade are let through by undegrade and vice versa (see second example).
*
* @tags temporal
* @name undegrade
* @memberof Pattern
* @returns Pattern
@@ -640,6 +820,7 @@ export const undegrade = register('undegrade', (pat) => pat._undegradeBy(0.5), t
* Randomly applies the given function by the given probability.
* Similar to `someCyclesBy`
*
* @tags temporal
* @name sometimesBy
* @memberof Pattern
* @param {number | Pattern} probability - a number between 0 and 1
@@ -659,6 +840,7 @@ export const sometimesBy = register('sometimesBy', function (patx, func, pat) {
*
* Applies the given function with a 50% chance
*
* @tags temporal
* @name sometimes
* @memberof Pattern
* @param {function} function - the transformation to apply
@@ -680,6 +862,7 @@ export const sometimes = register('sometimes', function (func, pat) {
* @param {number | Pattern} probability - a number between 0 and 1
* @param {function} function - the transformation to apply
* @returns Pattern
* @tags temporal
* @example
* s("bd,hh*8").someCyclesBy(.3, x=>x.speed("0.5"))
*/
@@ -702,6 +885,7 @@ export const someCyclesBy = register('someCyclesBy', function (patx, func, pat)
* @name someCycles
* @memberof Pattern
* @returns Pattern
* @tags temporal
* @example
* s("bd,hh*8").someCycles(x=>x.speed("0.5"))
*/
@@ -716,6 +900,7 @@ export const someCycles = register('someCycles', function (func, pat) {
* @name often
* @memberof Pattern
* @returns Pattern
* @tags temporal
* @example
* s("hh*8").often(x=>x.speed("0.5"))
*/
@@ -730,6 +915,7 @@ export const often = register('often', function (func, pat) {
* @name rarely
* @memberof Pattern
* @returns Pattern
* @tags temporal
* @example
* s("hh*8").rarely(x=>x.speed("0.5"))
*/
@@ -741,6 +927,7 @@ export const rarely = register('rarely', function (func, pat) {
*
* Shorthand for `.sometimesBy(0.1, fn)`
*
* @tags temporal
* @name almostNever
* @memberof Pattern
* @returns Pattern
@@ -755,6 +942,7 @@ export const almostNever = register('almostNever', function (func, pat) {
*
* Shorthand for `.sometimesBy(0.9, fn)`
*
* @tags temporal
* @name almostAlways
* @memberof Pattern
* @returns Pattern
@@ -769,6 +957,7 @@ export const almostAlways = register('almostAlways', function (func, pat) {
*
* Shorthand for `.sometimesBy(0, fn)` (never calls fn)
*
* @tags temporal
* @name never
* @memberof Pattern
* @returns Pattern
@@ -783,6 +972,7 @@ export const never = register('never', function (_, pat) {
*
* Shorthand for `.sometimesBy(1, fn)` (always calls fn)
*
* @tags temporal
* @name always
* @memberof Pattern
* @returns Pattern
@@ -811,6 +1001,7 @@ export function _keyDown(keyname) {
* Do something on a keypress, or array of keypresses
* [Key name reference](https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values)
*
* @tags external_io
* @name whenKey
* @memberof Pattern
* @returns Pattern
@@ -827,6 +1018,7 @@ export const whenKey = register('whenKey', function (input, func, pat) {
* returns true when a key or array of keys is held
* [Key name reference](https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values)
*
* @tags external_io
* @name keyDown
* @memberof Pattern
* @returns Pattern
@@ -837,3 +1029,54 @@ export const whenKey = register('whenKey', function (input, func, pat) {
export const keyDown = register('keyDown', function (pat) {
return pat.fmap(_keyDown);
});
/**
* A pattern measuring the duration of events,
* in cycles per event. `cyclesPer` doesn't have structure itself, but takes structure, and therefore
* event durations, from the pattern that it is combined with.
* For example `cyclesPer.struct("1 1 [1 1] 1")` would give the same as `"0.25 0.25 [0.125 0.125] 0.25"`.
* See also its reciprocal, `per`, also known as `perCycle`.
*
* @tags temporal
* @example
* // Shorter events are lower in pitch
* sound("saw saw [saw saw] saw")
* .note(cyclesPer.range(50, 100))
* @example
* sound("bd sd [bd bd] sd*4 [- sd] [bd [bd bd]]")
* .note(cyclesPer.add(20))
*/
export const cyclesPer = new Pattern(function (state) {
return [new Hap(undefined, state.span, state.span.duration)];
});
/**
* A pattern measuring the 'shortness' of events, or in other words, the duration of pattern events,
* in events per cycle. `per` doesn't have structure itself, but takes structure, and therefore
* event durations, from the pattern that it is combined with.
* For example `per.struct("1 1 [1 1] 1")` would give the same as `"4 4 [8 8] 4"`.
* See also its reciprocal, `cyclesPer`.
* @tags temporal
* @synonyms perCycle
* @example
* // Shorter events are more distorted
* n("0 0*2 0 0*2 0 [0 0 0]@2").sound("bd")
* .distort(per.div(2))
*/
export const per = new Pattern(function (state) {
return [new Hap(undefined, state.span, Fraction(1).div(state.span.duration))];
});
export const perCycle = per;
/**
* Like `per` but measures the shortness of events according to an exponential curve. In
* particular, where the event duration halves, the
* returned value increases by one. `perx.struct("1 1 [1 [1 1]] 1")` would therefore be
* the same as `"3 3 [4 [5 5]] 3"`.
* @tags temporal
*/
export const perx = new Pattern(function (state) {
const n = Fraction(1).div(state.span.duration);
return [new Hap(undefined, state.span, Math.log(n) / Math.log(2) + 1)];
});
+2 -2
View File
@@ -19,9 +19,9 @@ export class State {
return this.setSpan(func(this.span));
}
// Returns new State with different controls
// Returns new State with added controls.
setControls(controls) {
return new State(this.span, controls);
return new State(this.span, { ...this.controls, ...controls });
}
}
+8 -8
View File
@@ -1,14 +1,14 @@
import { bjork } from '../euclid.mjs';
import { bjorklund } from '../euclid.mjs';
import { describe, expect, it } from 'vitest';
import { fastcat } from '../pattern.mjs';
describe('bjork', () => {
it('should apply bjorklund to ons and steps', () => {
expect(bjork(3, 8)).toStrictEqual([1, 0, 0, 1, 0, 0, 1, 0]);
expect(bjork(-3, 8)).toStrictEqual([0, 1, 1, 0, 1, 1, 0, 1]);
expect(bjork(8, 8)).toStrictEqual([1, 1, 1, 1, 1, 1, 1, 1]);
expect(bjork(-8, 8)).toStrictEqual([0, 0, 0, 0, 0, 0, 0, 0]);
expect(bjork(5, 8)).toStrictEqual([1, 0, 1, 1, 0, 1, 1, 0]);
describe('bjorklund', () => {
it('should apply bjorklundlund to ons and steps', () => {
expect(bjorklund(3, 8)).toStrictEqual([1, 0, 0, 1, 0, 0, 1, 0]);
expect(bjorklund(-3, 8)).toStrictEqual([0, 1, 1, 0, 1, 1, 0, 1]);
expect(bjorklund(8, 8)).toStrictEqual([1, 1, 1, 1, 1, 1, 1, 1]);
expect(bjorklund(-8, 8)).toStrictEqual([0, 0, 0, 0, 0, 0, 0, 0]);
expect(bjorklund(5, 8)).toStrictEqual([1, 0, 1, 1, 0, 1, 1, 0]);
});
});
+12 -14
View File
@@ -586,6 +586,18 @@ describe('Pattern', () => {
.map((a) => a.value),
).toStrictEqual(['c', 'b', 'a']);
});
it('Does not reverse the order of cycles', () => {
expect(fastcat('a', 'b', 'c', 'd').slow(2).rev().fast(2).sortHapsByPart().firstCycle()).toStrictEqual(
fastcat('b', 'a', 'd', 'c').firstCycle(),
);
});
});
describe('revv()', () => {
it('Does reverse the order of cycles', () => {
expect(fastcat('a', 'b', 'c', 'd').slow(2).revv().fast(2).sortHapsByPart().firstCycle()).toStrictEqual(
fastcat('d', 'c', 'b', 'a').firstCycle(),
);
});
});
describe('sequence()', () => {
it('Can work like fastcat', () => {
@@ -728,20 +740,6 @@ describe('Pattern', () => {
);
});
});
describe('signal()', () => {
it('Can make saw/saw2', () => {
expect(saw.struct(true, true, true, true).firstCycle()).toStrictEqual(
sequence(0, 1 / 4, 1 / 2, 3 / 4).firstCycle(),
);
expect(saw2.struct(true, true, true, true).firstCycle()).toStrictEqual(sequence(-1, -0.5, 0, 0.5).firstCycle());
});
it('Can make isaw/isaw2', () => {
expect(isaw.struct(true, true, true, true).firstCycle()).toStrictEqual(sequence(1, 0.75, 0.5, 0.25).firstCycle());
expect(isaw2.struct(true, true, true, true).firstCycle()).toStrictEqual(sequence(1, 0.5, 0, -0.5).firstCycle());
});
});
describe('_setContext()', () => {
it('Can set the hap context', () => {
expect(
+67
View File
@@ -0,0 +1,67 @@
/*
signal.test.mjs - <short description TODO>
Copyright (C) 2022 Strudel contributors - see <https://codeberg.org/uzu/strudel/src/branch/main/packages/core/test/pattern.test.mjs>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import Fraction from 'fraction.js';
import { describe, it, expect, vi } from 'vitest';
import { saw, saw2, isaw, isaw2, per, perx, cyclesPer } from '../signal.mjs';
import { fastcat, sequence, State, TimeSpan, Hap, note } from '../index.mjs';
const st = (begin, end) => new State(ts(begin, end));
const ts = (begin, end) => new TimeSpan(Fraction(begin), Fraction(end));
const hap = (whole, part, value, context = {}) => new Hap(whole, part, value, context);
const third = Fraction(1, 3);
const twothirds = Fraction(2, 3);
const sameFirst = (a, b) => {
return expect(a.sortHapsByPart().firstCycle()).toStrictEqual(b.sortHapsByPart().firstCycle());
};
describe('signal()', () => {
it('Can make saw/saw2', () => {
expect(saw.struct(true, true, true, true).firstCycle()).toStrictEqual(
sequence(0, 1 / 4, 1 / 2, 3 / 4).firstCycle(),
);
expect(saw2.struct(true, true, true, true).firstCycle()).toStrictEqual(sequence(-1, -0.5, 0, 0.5).firstCycle());
});
it('Can make isaw/isaw2', () => {
expect(isaw.struct(true, true, true, true).firstCycle()).toStrictEqual(sequence(1, 0.75, 0.5, 0.25).firstCycle());
expect(isaw2.struct(true, true, true, true).firstCycle()).toStrictEqual(sequence(1, 0.5, 0, -0.5).firstCycle());
});
});
describe('cyclesPer', () => {
it('gives cycles per hap', () => {
sameFirst(
cyclesPer.struct(true, true, true, fastcat(true, true)),
sequence(0.25, 0.25, 0.25, fastcat(0.125, 0.125)).fmap(Fraction),
);
});
});
describe('per', () => {
it('gives haps per cycle', () => {
sameFirst(per.struct(true, true, true, fastcat(true, true)), sequence(4, 4, 4, fastcat(8, 8)).fmap(Fraction));
});
});
describe('perx', () => {
it('gives exponential haps per cycle', () => {
sameFirst(
perx.struct(true, true, true, fastcat(true, fastcat(true, true))),
sequence(3, 3, 3, fastcat(4, fastcat(5, 5))),
);
});
});
describe('shuffle', () => {
it('returns original pattern if input is 1', () => {
expect(note('c d e f').sound('piano').shuffle(1).firstCycle()).toEqual(note('c d e f').sound('piano').firstCycle());
});
});
-11
View File
@@ -1,11 +0,0 @@
let time;
export function getTime() {
if (!time) {
throw new Error('no time set! use setTime to define a time source');
}
return time();
}
export function setTime(func) {
time = func;
}

Some files were not shown because too many files have changed in this diff Show More