Compare commits

..

1879 Commits

Author SHA1 Message Date
Felix Roos 90a58858ca Publish
- @strudel/codemirror@0.8.4
 - @strudel.cycles/core@0.8.2
 - @strudel.cycles/csound@0.8.0
 - @strudel.cycles/eval@0.8.0
 - @strudel.cycles/midi@0.8.0
 - @strudel.cycles/mini@0.8.2
 - @strudel.cycles/osc@0.8.0
 - @strudel.cycles/react@0.8.0
 - @strudel.cycles/serial@0.8.0
 - @strudel.cycles/soundfonts@0.8.2
 - @strudel.cycles/tonal@0.8.2
 - @strudel.cycles/tone@0.8.0
 - @strudel.cycles/transpiler@0.8.2
 - @strudel/web@0.8.3
 - @strudel.cycles/webaudio@0.8.2
 - @strudel.cycles/webdirt@0.8.0
 - @strudel.cycles/xen@0.8.0
2023-06-30 08:17:19 +02:00
Felix Roos 8149b85a55 Merge pull request #627 from tidalcycles/fix-clock-drift
fix: midi clock drift
2023-06-30 08:14:40 +02:00
Felix Roos e79b6c514a Merge pull request #621 from tidalcycles/tauri-fs
desktop: play samples from disk
2023-06-29 22:02:27 +02:00
Felix Roos aaa894d74b Merge pull request #620 from tidalcycles/loopAt
cps dependent functions
2023-06-29 21:59:42 +02:00
Felix Roos b55721f16f fix: midi clock drift 2023-06-29 21:58:15 +02:00
Felix Roos b39d948d71 fix: build 2023-06-29 12:32:59 +02:00
Felix Roos 0fee279e3d rename fay to fit 2023-06-29 12:05:31 +02:00
Felix Roos c7d8a9cb82 fix: playFile import 2023-06-29 12:05:09 +02:00
Felix Roos b50075f102 feat: can now load disk samples via samples
+ encapsulate file logic from FilesTab
2023-06-29 10:47:20 +02:00
Felix Roos fb3ca9f960 feat: register fn for sample prefix handling 2023-06-29 10:46:32 +02:00
Felix Roos 058b971870 can now play samples from file system
- ui still wip
2023-06-29 02:02:00 +02:00
Felix Roos 610ea414c1 expose tauri fs api 2023-06-29 02:01:22 +02:00
Felix Roos cc6997baec - encapsulate sample map handling
- add resolveUrl param
2023-06-29 02:00:59 +02:00
Felix Roos d126c28b85 fix: loopAt with cps 1 for fallback 2023-06-28 22:25:49 +02:00
Felix Roos c1649b9dc0 - fix: loopAt for non default cps value
- add fay to repitch samples to fit hap duration
- add setcpm function
2023-06-28 22:13:05 +02:00
Felix Roos b0a8d12112 Merge pull request #520 from paikwiki/patch-1
Fix typo on packages.mdx
2023-06-26 22:45:04 +02:00
Felix Roos b5160d38cb another dummy commit 2023-06-26 22:43:14 +02:00
Felix Roos 360e9b5936 dummy commit 2023-06-26 22:41:47 +02:00
Felix Roos 85a6cd828e Merge pull request #606 from tidalcycles/setting-patterning
patterning ui settings
2023-06-26 22:35:02 +02:00
Felix Roos e698f19a64 Merge pull request #614 from tidalcycles/spirals
add spiral viz
2023-06-26 22:32:46 +02:00
Felix Roos 83c1b580dd Merge pull request #613 from vasilymilovidov/tauri
tauri test
2023-06-26 22:17:46 +02:00
vvm 9273e1f8ed fix tauri icons 2023-06-26 13:13:22 +04:00
vvm 5287825279 tauri workflow fixes 2023-06-26 11:27:21 +04:00
vvm 5567959afd add tauri github workflow 2023-06-26 01:58:16 +04:00
Felix Roos eaab36b051 add spiral viz 2023-06-25 14:23:18 +02:00
vvm 9a4f3af580 add README 2023-06-24 02:34:02 +04:00
vvm b83664dfce add build optimizations 2023-06-24 02:32:57 +04:00
vvm 349f7ae965 init 2023-06-23 21:14:55 +04:00
vvm 6f41716ab5 init 2023-06-23 21:06:10 +04:00
Felix Roos abeb62dea8 Merge pull request #612 from tidalcycles/fix-links
fix: doc links
2023-06-23 09:59:43 +02:00
Felix Roos 7cfed80443 Merge pull request #598 from tidalcycles/clip-support-floats
clip now works like legato in tidal
2023-06-23 09:55:18 +02:00
Felix Roos 36aa7d9b25 Merge pull request #607 from tidalcycles/doc-fixes
tonal fixes
2023-06-18 10:36:17 +02:00
Felix Roos 2a449ad3c0 rename tonal api -> tonal functions 2023-06-18 10:32:51 +02:00
Felix Roos a71c5957cc fix: better fix 2023-06-16 14:23:39 +02:00
Felix Roos eef6c7d55e quick fix: typo 2023-06-16 14:20:49 +02:00
Felix Roos 3872322da1 allow patterning theme + font settings 2023-06-16 13:45:13 +02:00
Felix Roos f1e850a62a fix: doc links 2023-06-16 09:20:29 +02:00
Felix Roos 8d9278419d fix: flatten scale lists 2023-06-15 20:19:31 +02:00
Felix Roos 0862827a51 Merge pull request #581 from roipoussiere/line_wrap
editor: enable line wrapping
2023-06-15 12:51:40 +02:00
Roipoussiere f37a220a05 add checkbox in settings to enable line wrapping 2023-06-15 11:52:29 +02:00
Felix Roos aa51c2b6dd Merge remote-tracking branch 'upstream/main' into line_wrap 2023-06-15 10:59:52 +02:00
Felix Roos 92da70a7ae Merge remote-tracking branch 'origin/main' into clip-support-floats 2023-06-15 10:46:10 +02:00
Felix Roos a55862fc25 Merge pull request #602 from tidalcycles/ratio-function
add ratio function
2023-06-15 10:22:46 +02:00
Felix Roos 09b14a5702 add ratio function 2023-06-14 23:19:04 +02:00
Felix Roos 260b831815 refactor: legato -> clip 2023-06-14 00:22:55 +02:00
Felix Roos 665cf6ac65 Merge pull request #588 from roipoussiere/enable_autocomplete
enable auto-completion
2023-06-12 23:24:28 +02:00
Felix Roos 5e90021698 update snapshot 2023-06-12 23:12:40 +02:00
Felix Roos 16aeb7e12c docs: update clip entry 2023-06-12 23:11:07 +02:00
Felix Roos b4cbec173b only accept undefined for clip 2023-06-12 22:58:25 +02:00
Felix Roos 8c9e06c329 - clip now works like legato in tidal
- supports floats
- hap.duration now respects clip value
- hap.endClipped is now end*clip
- visualizations show clipped length
- clip(0) will now be silence
2023-06-12 22:39:32 +02:00
Felix Roos e4a35fdd72 Merge pull request #597 from tidalcycles/cursor-fix
improve cursor
2023-06-11 22:04:17 +02:00
Felix Roos 370d82e66c + disable cursor blink
+ make cursor thicker
2023-06-11 20:21:11 +02:00
Felix Roos 876e851517 Merge pull request #570 from dariacotocu/branch-daria
Solmization added
2023-06-11 20:00:45 +02:00
Felix Roos 190fe37a9f move solmization logic from midi2note to sol2note 2023-06-11 19:55:24 +02:00
Felix Roos 623661f8d2 Merge remote-tracking branch 'upstream/main' into branch-daria 2023-06-11 19:54:55 +02:00
Felix Roos f31bc3f8c5 Merge pull request #591 from tidalcycles/fix-fast0
fix: division by zero
2023-06-11 19:45:00 +02:00
Felix Roos 12fc48544c Merge pull request #596 from tidalcycles/fix-option-dot
Fix option dot
2023-06-11 19:44:40 +02:00
Felix Roos 3b4e44a9fd fix: main repl option-dot on mac 2023-06-11 13:55:11 +02:00
Felix Roos 7850fb727e fix: allow f for flat notes like tidal 2023-06-11 13:23:45 +02:00
Felix Roos 9b3122837e fix: division by zero 2023-06-11 13:15:52 +02:00
Felix Roos d4c59cc73b fix:typo + remove notes 2023-06-11 11:21:19 +02:00
Felix Roos fe36bf54b2 Merge commit '4d8308a763a632cc4dd93ed2a2ab129eb957af72' 2023-06-09 21:39:14 +02:00
Felix Roos 4d8308a763 fix: link goes to wrong language 2023-06-09 21:33:32 +02:00
Felix Roos 11f26c1e2c Merge pull request #587 from tidalcycles/workshop-new
New Workshop
2023-06-09 21:02:11 +02:00
Felix Roos e10104d401 bring de improvements to en workshop 2023-06-09 20:59:40 +02:00
Roipoussiere 5e09c3c318 add autocompletion extension from useMemo 2023-06-09 18:28:16 +02:00
Felix Roos 576b88221d Merge remote-tracking branch 'origin/main' into workshop-new 2023-06-09 18:00:16 +02:00
Felix Roos 7dc2a0091b more detail 2023-06-09 17:59:08 +02:00
Felix Roos 89a4a85589 more friendly heading 2023-06-09 17:58:05 +02:00
Felix Roos a3baf07a5c Merge pull request #580 from roipoussiere/music_metadata
Music metadata
2023-06-09 17:31:58 +02:00
Roipoussiere 8e6909478c autocompletion: lint 2023-06-09 16:42:31 +02:00
Roipoussiere 2d2d0cabb3 Add option in settings to enable autocompletion 2023-06-09 16:38:48 +02:00
Roipoussiere 6f04a1b8fa autocomplete: add vanilla js completion 2023-06-09 14:52:07 +02:00
Roipoussiere a9ad3a56ad autocomplete: avoid tabs overlapping 2023-06-09 14:30:20 +02:00
Roipoussiere 3069b14e9c enable autocompletion 2023-06-09 13:41:40 +02:00
Felix Roos ae868c6372 hide gutter in mini repl 2023-06-09 00:46:04 +02:00
Felix Roos c287ff554c optimize sounds chapter after teach test 2023-06-09 00:26:40 +02:00
Felix Roos 3ccbd35fad add label support to pianoroll 2023-06-09 00:25:54 +02:00
Felix Roos 51cc69208f fix: repl link to docs was old 2023-06-09 00:25:14 +02:00
Felix Roos 1fec2f7a46 fix: build 2023-06-08 21:31:32 +02:00
Felix Roos ffffdd2d7d fix: format 2023-06-08 20:55:26 +02:00
Felix Roos f8c3e3d5aa add missing sounds by hand 2023-06-08 20:43:45 +02:00
Felix Roos eccce6fa84 remove dirt samples
+ load a small selection for workshop instead
2023-06-08 17:48:54 +02:00
Felix Roos 44be6cee2c Merge pull request #585 from srenatus/typo
learn/tonal: fix typo in "scaleTran[s]pose"
2023-06-08 09:33:34 +02:00
Stephan Renatus 799afd511a learn/tonal: fix typo in "scaleTran[s]pose" 2023-06-08 08:17:38 +02:00
Felix Roos 37c4541468 translate link 2023-06-07 21:50:26 +02:00
Felix Roos 119a66acd0 - translate getting-started
- fix de links
- link english docs / german workshop
2023-06-07 21:49:57 +02:00
Felix Roos 105193a452 replace tutorial with workshop
+ move parts of tutorial to more
+ move more before Pattern Functions
2023-06-07 21:22:01 +02:00
Felix Roos 02d793e9e0 Merge remote-tracking branch 'origin/main' into workshop-new 2023-06-07 20:19:34 +02:00
Felix Roos 90647a8ba8 Merge pull request #582 from roipoussiere/line_numbers
repl: add option to display line numbers
2023-06-07 20:19:11 +02:00
Felix Roos 06950a6bd8 translate rest of workshop to german 2023-06-07 16:50:54 +02:00
Roipoussiere 0c2147d9c5 repl: add option to display line numbers 2023-06-07 15:34:57 +02:00
Roipoussiere 51e8174689 metadata: add quotes syntax for titles 2023-06-07 12:26:23 +02:00
Roipoussiere 185318a70c metadata: fix typos 2023-06-07 11:02:38 +02:00
Felix Roos a88759ba94 translate notes chapter 2023-06-06 22:43:51 +02:00
Roipoussiere 96ac054392 metadata: improve doc 2023-06-06 21:34:53 +02:00
Roipoussiere bd7f4dd73f metadata: add tests 2023-06-06 21:34:53 +02:00
Roipoussiere 2e22152089 metadata: allow several values and one-liners 2023-06-06 21:34:53 +02:00
Roipoussiere 98a89aea11 lint: metadata parsing 2023-06-06 21:34:53 +02:00
Roipoussiere 372e33c066 doc: add section about metadata 2023-06-06 21:34:53 +02:00
Roipoussiere 52641db590 load titles from metadata in examples page 2023-06-06 21:34:53 +02:00
Roipoussiere f9ad5f0d01 add tunes metadata 2023-06-06 21:34:53 +02:00
Roipoussiere 3db1c7a521 swatch: look for song titles in code metadata 2023-06-06 21:34:53 +02:00
Roipoussiere b6d1f96930 editor: enable line wrapping 2023-06-06 13:29:55 +02:00
Felix Roos 61a9b01062 started german translation of workshop 2023-06-05 23:48:04 +02:00
Felix Roos f0faf5b42e Merge remote-tracking branch 'origin/main' into workshop-new 2023-06-05 22:48:50 +02:00
Felix Roos 11733d5e05 Merge pull request #563 from tidalcycles/vanilla-highlighting
Vanilla JS Refactoring
2023-06-05 21:35:49 +02:00
Felix Roos c4a38d9008 + pattern effects chapter
+ recap page
+ only load mini repls when visible
2023-05-30 06:16:02 +02:00
Felix Roos 0edd7e14b7 add compound adsr + ds controls 2023-05-29 12:39:36 +02:00
Felix Roos 8b7bb7b6ae add adsr section to effects chapter 2023-05-29 12:39:17 +02:00
Felix Roos 39d5955e58 add function recap to sounds chapter 2023-05-29 12:39:05 +02:00
Felix Roos 536327f403 effects chapter mostly finished 2023-05-29 02:18:36 +02:00
Felix Roos 8679dc63be pianoroll: also reflect gain in transparency 2023-05-29 02:18:27 +02:00
Felix Roos 1e9979ae18 start fleshing out effects chapter 2023-05-28 12:42:24 +02:00
Felix Roos d2dffe3186 MiniRepl: consume font settings 2023-05-28 12:42:15 +02:00
Felix Roos 9971867e2f clamp function 2023-05-28 12:41:53 +02:00
Felix Roos 8c93e578a0 clamp delayfeedback 2023-05-28 12:41:46 +02:00
Felix Roos 1ba5d2e1ca finish notes chapter 2023-05-27 21:52:44 +02:00
Felix Roos ed792fc0d4 continue notes chapter 2023-05-27 16:29:05 +02:00
Felix Roos 4e575c44b3 begin first notes page 2023-05-27 13:31:18 +02:00
Felix Roos fc06181217 - add claviature flag to minirepl
- bring back option+dot on macos
- consume more editor settings in minirepl
2023-05-27 13:30:57 +02:00
Felix Roos 0d6fcf78d8 hide mini repl headers + improve workshop 2023-05-26 16:05:53 +02:00
Felix Roos 82225f0b81 started workshop pages 2023-05-26 14:12:53 +02:00
Felix Roos 2177e13b49 Merge branch 'vanilla-highlighting' into workshop 2023-05-25 21:38:34 +02:00
Daria Cotocu b63f4eb503 Update solmization.test.js 2023-05-24 18:58:11 +01:00
Daria Cotocu cd7bc09f9c Update solmization.test.js 2023-05-24 18:43:24 +01:00
Daria Cotocu ccf775e976 Format code 2023-05-24 17:57:05 +01:00
Daria Cotocu 811346e83d Solmization added 2023-05-24 17:24:34 +01:00
Felix Roos d3240a75d0 fix: dupe style.css to Repl.css
for some reason they were missing after update
+ darken line backgrounds
+ change preview port to keep workbox out of dev server
2023-05-12 11:56:50 +02:00
Felix Roos d93e396ce5 fix: nano-repl 2023-05-12 10:21:05 +02:00
Felix Roos d74cc234c4 fix: thinner outline for highlights with .color 2023-05-12 10:06:55 +02:00
Felix Roos 0fda83d8de bump soundfonts 2023-05-12 10:00:55 +02:00
Felix Roos a1ec8545fb format 2023-05-10 13:03:06 +02:00
Felix Roos 087f574355 update web readme + add more html examples 2023-05-10 12:49:45 +02:00
Felix Roos 1de784b817 add headless-serverless-buildless example 2023-05-10 12:20:27 +02:00
Felix Roos db79c05d9a bump web pkg dependencies 2023-05-10 12:11:51 +02:00
Felix Roos 1fdb1f0da6 bump webaudio package 2023-05-10 12:09:20 +02:00
Felix Roos e2bfaa6233 remove soundfonts from web package for now 2023-05-10 12:06:16 +02:00
Felix Roos 6089849d35 rename init to initStrudel + add to window 2023-05-10 11:53:26 +02:00
Felix Roos 6e02bf59e9 Revert "refactor: remove old draw logic"
This reverts commit 95719654f3.
2023-05-10 11:44:55 +02:00
Felix Roos 12228c56d9 improve api for web package 2023-05-07 22:36:26 +02:00
Felix Roos 3b631cb6af add @strudel/web umbrella package + example 2023-05-07 11:56:35 +02:00
Felix Roos b27a58df7e bump more packages to 0.8.0 2023-05-05 23:58:47 +02:00
Felix Roos 308f139193 bump codemirror again to get new core version 2023-05-05 23:52:55 +02:00
Felix Roos 692fc4e11d revert rename core package 2023-05-05 23:52:04 +02:00
Felix Roos b52f65c4d7 rename core package + bump to 0.8.0 2023-05-05 23:50:06 +02:00
Felix Roos 299275e368 lockfile 2023-05-05 23:47:15 +02:00
Felix Roos bb71c519db bump codemirror package 2023-05-05 23:46:42 +02:00
Felix Roos 9ec7109dc8 + simplify vanilla setup drastically
+ move repl + drawer boilerplate inside StrudelMirror
2023-05-05 23:43:07 +02:00
Felix Roos 5b67fccb1b vanilla-repl-cm6: draw first frame 2023-05-05 16:17:22 +02:00
Felix Roos 9807c4b7a1 move Framer + Drawer to core
... from vite-vanilla-repl-cm6
2023-05-05 16:06:11 +02:00
Felix Roos 9039600f6d bump codemirror to 0.8.1 2023-05-05 15:31:19 +02:00
Felix Roos b5b0156e08 fix: codemirror reeval 2023-05-05 15:31:04 +02:00
Felix Roos 352e647d37 add build script for codemirror package 2023-05-05 15:15:45 +02:00
Felix Roos e6b66f2525 lockfile 2023-05-05 15:14:46 +02:00
Felix Roos f5075906e2 add codemirror package
+ use it in vite-vanilla-repl-cm6
2023-05-05 15:13:17 +02:00
Felix Roos a6f57bced8 prettier 2023-05-05 12:00:13 +02:00
Felix Roos d35bf9591c vanilla-repl-cm6: better theme 2023-05-05 11:54:09 +02:00
Felix Roos d96f3f9dd4 vanilla-repl-cm6: style + codesplitting 2023-05-05 11:09:44 +02:00
Felix Roos 1f4c2f8c5a draw scheduler in vanilla js 2023-05-05 10:52:21 +02:00
Felix Roos 95719654f3 refactor: remove old draw logic
+ pianoroll now uses .onPaint
2023-05-05 09:52:07 +02:00
Felix Roos 4b921c47f5 vanilla-repl-cm6: add flash effect 2023-05-05 09:11:40 +02:00
Felix Roos f069f53fae vanilla-repl-cm6: add keybindings 2023-05-05 09:06:27 +02:00
Felix Roos 1494cc38fc add vite-vanilla-repl-cm6 2023-05-05 08:55:43 +02:00
Felix Roos a035412956 Merge pull request #559 from tidalcycles/patchday
Patchday
2023-05-05 08:34:36 +02:00
Felix Roos 08662ea831 Merge pull request #557 from tidalcycles/some-voicings
add basic triads and guidetone voicings
2023-05-02 21:48:32 +02:00
Felix Roos d97103268b add basic triads and guidetone voicings 2023-05-02 21:40:20 +02:00
Felix Roos a959e2e34d update remaining packages 2023-04-30 08:30:29 +02:00
Felix Roos 602bfbdd79 update a bunch of minor versions 2023-04-30 08:20:51 +02:00
Felix Roos 0785bdd37a update lerna 2023-04-30 08:04:56 +02:00
Felix Roos 8b62b6e1b1 update codemirror + tailwindcss 2023-04-30 08:02:06 +02:00
Felix Roos d1c8ebd15b remove c8 2023-04-30 07:55:23 +02:00
Felix Roos 13088e4001 - remove gh-pages
- update peggy
- rebuild parser
2023-04-30 07:48:08 +02:00
Felix Roos 5c6fa1c82b update vite to v4 2023-04-29 08:10:12 +02:00
Felix Roos fd81867e7b fix: controls import broke on ssr 2023-04-29 07:45:21 +02:00
Felix Roos 78293e64dd lockfile 2023-04-29 07:45:09 +02:00
Felix Roos 930fc10aec bump some minor versions 2023-04-29 07:45:04 +02:00
Felix Roos 0b2a4fda44 update supabase-js 2023-04-29 07:24:03 +02:00
Felix Roos efdce6d4cd update astro 2023-04-29 06:55:34 +02:00
Felix Roos c0b0ea4493 remove preact 2023-04-29 06:25:19 +02:00
Felix Roos 0fcec0a0ca upgrade jsdoc 2023-04-28 13:05:50 +02:00
Felix Roos c0701d8a35 Merge remote-tracking branch 'origin/main' into patchday 2023-04-28 12:50:20 +02:00
Felix Roos ae51092044 Merge pull request #556 from tidalcycles/fix-prebake
fix: make soundfonts import dynamic
2023-04-28 12:46:56 +02:00
Felix Roos b7fcccb8db fix: make soundfonts import dynamic
- it broke the whole docs page
2023-04-28 12:42:07 +02:00
Felix Roos b21a52f5f3 update @vite-pwa/astro 2023-04-28 12:23:10 +02:00
Felix Roos 2bdcfe13e6 update @vitest/ui 2023-04-28 12:20:35 +02:00
Felix Roos 12a97ec429 update nanostores 2023-04-28 12:18:45 +02:00
Felix Roos 99298ce9f2 update vite-plugin-pwa 2023-04-28 12:14:07 +02:00
Felix Roos a0ed25d373 use vitests@^0.28.0 in packages 2023-04-28 12:12:05 +02:00
Felix Roos dc6c29c668 update vitest to ^0.28.0 2023-04-28 12:08:48 +02:00
Felix Roos 3a85f28b5c install with pnpm 8.3.1 2023-04-28 10:33:47 +02:00
Felix Roos 95c44b1ce2 Merge pull request #553 from tidalcycles/highlighting-colors
fix: colorable highlighting
2023-04-22 15:43:22 +02:00
Felix Roos b88e0ecb78 fix: colorable highlighting 2023-04-22 15:25:00 +02:00
Felix Roos c26f6b72d9 Merge pull request #550 from tidalcycles/fix-soundfont-loading
fix: load soundfonts in prebake
2023-04-06 00:11:02 +02:00
Felix Roos 6cd3cc96a3 fix: do not prebake in tests
+ pull piano function to separate file for tests
2023-04-06 00:08:23 +02:00
Felix Roos c138cf0b76 fix: load soundfonts in prebake 2023-04-06 00:00:49 +02:00
Felix Roos 8edb086178 Merge pull request #548 from tidalcycles/stop-pause
fix: reset time on stop
2023-03-29 22:23:07 +02:00
Felix Roos 0f74b5a4b1 Merge pull request #547 from tidalcycles/fix-mini-whitespace
fix: allow whitespace at the end of a mini pattern
2023-03-29 22:16:37 +02:00
Felix Roos 6de2feff05 fix: reset time on stop 2023-03-29 22:05:13 +02:00
Felix Roos a9811ee955 fix: allow whitespace at the end of a mini pattern
- fixes #546
2023-03-29 21:57:55 +02:00
Felix Roos 98b6c11a82 Merge pull request #544 from tidalcycles/fonts
add firacode font
2023-03-24 22:10:55 +01:00
Felix Roos 3df2929d12 dummy commit (github cert error :-/) 2023-03-24 22:06:40 +01:00
Felix Roos 30d1f423cb fix: remove loading state on eval error 2023-03-24 21:50:50 +01:00
Felix Roos e0c5566f35 add 2 FiraCode fonts 2023-03-24 21:23:37 +01:00
Felix Roos c5a2ae47d7 Merge pull request #542 from tidalcycles/loading-animation
feat: add loader bar to animate loading state
2023-03-24 12:54:20 +01:00
Felix Roos 17654b885b feat: add loader bar to animate loading state 2023-03-24 12:41:00 +01:00
Felix Roos acaf0ca0af Merge pull request #539 from tidalcycles/setcps-reset-only-on-shuffle
do not reset cps before eval #517
2023-03-23 22:39:26 +01:00
Felix Roos 6a201be1fd Merge remote-tracking branch 'origin/main' into setcps-reset-only-on-shuffle 2023-03-23 22:35:57 +01:00
Felix Roos 8617b9164e do not reset cps before eval #517 2023-03-23 22:34:25 +01:00
Felix Roos 991e5f1b3c Merge pull request #538 from tidalcycles/improve-loading
improve initial loading + wait before eval
2023-03-23 22:27:31 +01:00
Felix Roos 55c533c947 improve initial loading + wait before eval 2023-03-23 21:56:20 +01:00
Felix Roos d17543d5d9 Merge pull request #537 from tidalcycles/fix-keypress-period
fix period key for dvorak + remove duplicated code
2023-03-23 21:40:19 +01:00
Felix Roos 73169563c4 fix period key for dvorak + remove duplicated code 2023-03-23 21:37:38 +01:00
Felix Roos d351cb9f7f Merge pull request #535 from tidalcycles/update-lerna
Update lerna
2023-03-23 11:44:56 +01:00
Felix Roos 251be60630 update package publishing guide 2023-03-23 11:39:33 +01:00
Felix Roos 18d7222804 Publish
- @strudel.cycles/core@0.7.2
 - @strudel.cycles/csound@0.7.1
 - @strudel.cycles/eval@0.7.1
 - @strudel.cycles/midi@0.7.1
 - @strudel.cycles/mini@0.7.2
 - @strudel.cycles/osc@0.7.1
 - @strudel.cycles/react@0.7.1
 - @strudel.cycles/serial@0.7.1
 - @strudel.cycles/soundfonts@0.7.1
 - @strudel.cycles/tonal@0.7.1
 - @strudel.cycles/tone@0.7.1
 - @strudel.cycles/transpiler@0.7.1
 - @strudel.cycles/webaudio@0.7.1
 - @strudel.cycles/webdirt@0.7.1
 - @strudel.cycles/xen@0.7.1
2023-03-23 11:34:07 +01:00
Felix Roos ff1c37d361 bump core + mini to 0.7.1 2023-03-23 11:26:23 +01:00
Felix Roos 3abe6db3de Publish
- @strudel.cycles/core@0.7.0
 - @strudel.cycles/csound@0.7.0
 - @strudel.cycles/eval@0.7.0
 - @strudel.cycles/midi@0.7.0
 - @strudel.cycles/mini@0.7.0
 - @strudel.cycles/osc@0.7.0
 - @strudel.cycles/react@0.7.0
 - @strudel.cycles/serial@0.7.0
 - @strudel.cycles/soundfonts@0.7.0
 - @strudel.cycles/tonal@0.7.0
 - @strudel.cycles/tone@0.7.0
 - @strudel.cycles/transpiler@0.7.0
 - @strudel.cycles/webaudio@0.7.0
 - @strudel.cycles/webdirt@0.7.0
 - @strudel.cycles/xen@0.7.0
2023-03-23 11:21:02 +01:00
Felix Roos b9ca9d3b06 update lerna 2023-03-23 11:17:21 +01:00
Felix Roos 9bbc04843d Merge pull request #534 from tidalcycles/soundfont-freq-support
feat: add freq support to gm soundfonts
2023-03-23 10:21:55 +01:00
Felix Roos ddf61a6438 Merge pull request #531 from ijc8/main
Maintain random seed state in parser, not globally
2023-03-23 10:18:58 +01:00
Felix Roos ba35a81e9b - feat: add freq support to gm soundfonts
- refactor: toMidi -> noteToMidi
- refactor: fromMidi -> midiToFreq
2023-03-23 10:18:24 +01:00
Felix Roos 13133583ca Merge pull request #527 from bwagner/main
FIXES: alias pm for polymeter
2023-03-21 22:35:17 +01:00
Felix Roos e91b981740 Merge pull request #529 from revolunet/patch-1
fix(footer): fix link to tidalcycles
2023-03-21 22:29:06 +01:00
Bernhard Wagner 1458ee64ec FIXES: alias pm for polymeter 2023-03-21 21:20:57 +01:00
Ian Clester 4e2a5e1663 Add pairwise independence test, tweak randOffset 2023-03-20 22:27:35 -04:00
Ian Clester c98b0e9687 Format code with prettier 2023-03-20 19:19:42 -04:00
Ian Clester 4e25990de9 Uncomment test for random choice operator (|) 2023-03-20 17:46:57 -04:00
Ian Clester 4b51f1a3fc Sync up ? with degrade() 2023-03-20 15:26:27 -04:00
Ian Clester 5490b01004 Maintain random seed state in parser, not globally 2023-03-20 14:59:43 -04:00
Julien Bouquillon 43176e1f1d fix(footer): fix link to tidalcycles 2023-03-20 01:38:21 +01:00
Bernhard Wagner fffd3c07ca FIXES: alias pm for polymeter
(return statement was missing)
2023-03-18 22:12:12 +01:00
Felix Roos 952bd38e70 Merge pull request #525 from bwagner/patch-4
Update intro.mdx
2023-03-18 20:25:21 +01:00
Felix Roos 8589f5cc89 Merge pull request #524 from bwagner/patch-3
Update samples.mdx
2023-03-18 20:24:38 +01:00
Bernhard Wagner ec594d52f8 Update intro.mdx
shortly -> concisely
2023-03-18 19:31:57 +01:00
Bernhard Wagner 848cbf9c60 Update samples.mdx
fixes few typos and the former `samples` tab is now `sounds`
2023-03-18 15:37:59 +01:00
Felix Roos e02be7dd9a Merge pull request #521 from tidalcycles/fix-envelope
fix: envelopes in chrome
2023-03-17 09:03:10 +01:00
Felix Roos 33d35e47a6 fix: envelope in chrome 2023-03-17 08:56:05 +01:00
Felix Roos 18d62b32c2 Merge pull request #516 from tidalcycles/source-nodes
registerSound API + improved sounds tab + regroup soundfonts
2023-03-16 16:13:30 +01:00
Felix Roos 58ed51b49c snapshot 2023-03-16 15:49:56 +01:00
Felix Roos 9f9fe529e4 fix only tune that uses soundfonts 2023-03-16 15:49:08 +01:00
Felix Roos aad721890a pass duration to source callback 2023-03-16 15:48:59 +01:00
Felix Roos e63a5d10c8 regroup sounds
- extra tab for drum-machines
- combine synths and soundfonts
2023-03-16 15:21:16 +01:00
Felix Roos 15681262de use only _ for easier copying via double click 2023-03-16 15:19:38 +01:00
Felix Roos b5d3aa81f9 format 2023-03-16 12:25:08 +01:00
Felix Roos a688061616 group soundfonts into readable names 2023-03-16 12:23:58 +01:00
Felix Roos f788d347ec add envelope to soundfonts 2023-03-15 23:02:05 +01:00
Felix Roos a33ce67dd4 fix: endless preview 2023-03-15 23:01:56 +01:00
Felix Roos 8a22c5627a fix: cut glitches due to envelope release trouble 2023-03-15 22:42:03 +01:00
Felix Roos 7b529a30f4 style sounds tab 2023-03-14 22:54:12 +01:00
Felix Roos 4910b34f26 Merge pull request #518 from tidalcycles/fonts
add 2 illegible fonts
2023-03-14 21:54:52 +01:00
paikwiki 74ad521fc9 Fix typo on packages.mdx
I found a broken link.

Because it omits protocol, page move to wrong page(https://strudel.tidalcycles.org/github.com/tidalcycles/strudel)

I add protocol(https://) on that link.
2023-03-14 13:01:40 +09:00
Felix Roos 6a73b43e3a add 2 illegible fonts 2023-03-12 21:16:46 +01:00
Felix Roos b59b26460d soundfont list curation part 2 2023-03-12 20:48:29 +01:00
Felix Roos aa324ae25d start curating the soundfont list 2023-03-10 11:33:55 +01:00
Felix Roos ff412f6396 level down soundfonts
+ do not load in prebake (breaks static rendering)
+ instead load on import
2023-03-09 23:19:19 +01:00
Felix Roos ac148b2f32 register soundfonts as sounds too 2023-03-09 22:48:40 +01:00
Felix Roos 6f5d096e6d rename setSound to registerSound 2023-03-09 21:32:40 +01:00
Felix Roos ff1e6714c6 document setSound api 2023-03-09 21:27:24 +01:00
Felix Roos 41d82eaadf add cleanup to sound tab 2023-03-09 10:53:35 +01:00
Felix Roos be6b011204 proper audio node cleanup
+ cleanup onTriggerSample
2023-03-09 10:46:45 +01:00
Felix Roos 65e48c05f0 sounds onset and offset can be triggered independently
+ sounds tab now supports mousedown / mouseup to listen
2023-03-09 08:35:20 +01:00
Felix Roos cee08ea67d sounds list can now filter out defaults 2023-03-08 00:33:21 +01:00
Felix Roos 35ef26c013 can now pass meta data to setSound
+ added types for synth and sample
+ list sample count for samples in sounds tab (as before)
2023-03-07 21:43:01 +01:00
Felix Roos b08a0b8102 use nanostore for soundmap
+ rename tab samples to sounds
+ listed sounds are now reactive
2023-03-06 23:11:09 +01:00
Felix Roos 220342154b Merge pull request #474 from bwagner/main
Update README.md
2023-03-06 22:55:00 +01:00
Bernhard Wagner ef7182cd76 Merge branch 'tidalcycles:main' into main 2023-03-06 20:15:16 +01:00
Felix Roos 6059c69995 first draft of soundMap to register keys for s
+ refactor sampler to use it
+ refactor synth to use it
+ add 'source' control
+ wip: samples tab
+ wip: webadirt ?
+ wip: soundfonts
2023-03-05 23:27:37 +01:00
Felix Roos 892d8ba152 Merge pull request #508 from tidalcycles/arrange
add arrange function
2023-03-05 14:52:30 +01:00
Felix Roos da11069f75 Merge pull request #514 from tidalcycles/react-update
update react to 18
2023-03-05 14:29:08 +01:00
Alex McLean bf72908dc9 Support list syntax in mininotation (#512)
fixes #504

* support list syntax in mininotation
* support compound controls
* remove redundant : splitting of s/n and note/n from webaudio
* patternable scale names
2023-03-04 18:06:18 +00:00
Felix Roos 81ab5c78e2 update react to 18 2023-03-03 20:38:20 +01:00
Felix Roos de503c7d63 add snapshot 2023-03-03 20:30:35 +01:00
Felix Roos 487ccb90a1 add arrange function 2023-03-03 20:17:23 +01:00
Felix Roos 4bfeaa47bf Merge pull request #502 from tidalcycles/scale-space-alternative
can now use : as a replacement for space in scales
2023-03-03 12:40:23 +01:00
Felix Roos 9a4d8036a6 add test 2023-03-03 12:38:11 +01:00
Felix Roos a50bd6375d use : instead of _ 2023-03-03 12:37:25 +01:00
Felix Roos 14508e91a9 can now use _ as a replacement for space in scales 2023-03-02 20:39:06 +01:00
Alex McLean 2d5064bd5b Reinstate slice and splice (#500)
Reinstate slice/splice, fixing up "unit" param using new global cps
2023-03-02 14:44:41 +00:00
Felix Roos fdc4819e39 Merge pull request #501 from tidalcycles/nano-repl-highlighting-fix
fix: nano-repl highlighting
2023-03-02 14:49:30 +01:00
Felix Roos efddbb616b fix: nano-repl highlighting 2023-03-02 14:47:15 +01:00
Alex McLean db4d0f26a8 Add control aliases (#497)
* add and simplify control aliases, fixes #496
* roomsize now alias of room
* simplify webaudio param handling
---------

Co-authored-by: Felix Roos <flix91@gmail.com>
2023-03-02 13:17:12 +00:00
Felix Roos 06cffbc31b add readme to nano repl 2023-03-01 12:57:33 +01:00
Felix Roos 3cfb0f4c76 Merge pull request #493 from tidalcycles/cps
implement cps in scheduler
2023-03-01 09:27:26 +01:00
Felix Roos 436ba067bc reset cps before eval 2023-03-01 09:23:01 +01:00
Felix Roos f8724bf47e comment out cps ui 2023-03-01 00:05:23 +01:00
Felix Roos 1f7e293204 add setcps to global scope 2023-02-28 23:56:11 +01:00
Felix Roos 86d2652258 pass cps to hap trigger 2023-02-28 23:54:56 +01:00
Felix Roos f5c0cc2e2d no need to warn if evalScope is called more often 2023-02-28 23:54:40 +01:00
Felix Roos 4463d4a417 Update README.md 2023-02-28 23:25:40 +01:00
Felix Roos df35a5c9b1 Merge pull request #491 from tidalcycles/refactor-react
react style fixes
2023-02-28 23:06:29 +01:00
Felix Roos dda93b3c13 Update @strudel.cycles/react to 0.6.4 2023-02-28 23:02:52 +01:00
Felix Roos 5de40b6bf5 fix disabled button take 2 2023-02-28 23:02:28 +01:00
Felix Roos dcbe799d25 Merge pull request #490 from tidalcycles/refactor-react
refactor react package
2023-02-28 22:57:19 +01:00
Felix Roos a5641aef03 Update @strudel.cycles/react to 0.6.3 2023-02-28 22:52:57 +01:00
Felix Roos 668f97a4c8 refactor react package for publishing 2023-02-28 22:48:50 +01:00
Felix Roos e9d577496b fix disabled button 2023-02-28 22:48:06 +01:00
Felix Roos 66fba947ac Update @strudel.cycles/react to 0.6.2 2023-02-28 22:40:52 +01:00
Felix Roos 18c7e02609 fix: minirepl styles for package 2023-02-28 22:40:18 +01:00
Felix Roos 7e1351507a add variables to react tailwind config 2023-02-28 22:17:24 +01:00
Felix Roos 032acbd27c comment out autocomplete 2023-02-28 22:11:17 +01:00
Felix Roos 8b51f0fbd2 Update @strudel.cycles/react to 0.6.1 2023-02-28 21:57:03 +01:00
Felix Roos ead5942ef0 implement cps + add baasic tempo control ui 2023-02-28 13:00:35 +01:00
Felix Roos cfe369d9fe Merge pull request #488 from tidalcycles/algolia
add algolia creds + optimize sidebar for crawling
2023-02-27 23:47:34 +01:00
Felix Roos 2750a3c130 fix pseudo relative links 2023-02-27 22:59:50 +01:00
Felix Roos a7f6d6ecac add algolia config 2023-02-27 22:59:38 +01:00
Felix Roos 3680282450 Merge pull request #485 from tidalcycles/app-height-fix
fix app height
2023-02-27 19:28:09 +01:00
Felix Roos 3b3435c999 change 1px 2023-02-27 19:24:49 +01:00
Felix Roos e2ae6278c2 Merge pull request #484 from tidalcycles/revert-wip-390
Revert "Another attempt at composable functions - WIP (#390)"
2023-02-27 16:04:20 +01:00
Alex McLean 37d6723e3c Update mini-notation.mdx (#365)
`x!n` is no longer an alias for `[x*n]@n` and the behaviour is a bit different. Probably best to remove this line in case it confuses someone?
2023-02-27 14:45:19 +00:00
Felix Roos 961bbf6f55 Revert "Another attempt at composable functions - WIP (#390)"
This reverts commit cbae355896.
2023-02-27 15:20:49 +01:00
Felix Roos fc71d349ed Merge pull request #482 from tidalcycles/docs
docs: packages + offline
2023-02-27 12:52:09 +01:00
Felix Roos 97c8ab0f71 fix format 2023-02-27 12:49:23 +01:00
Felix Roos 28534ea547 add screenshots 2023-02-27 12:47:38 +01:00
Felix Roos 1a75b79a33 better offline docs
fixes https://github.com/tidalcycles/strudel/issues/424
2023-02-27 12:34:17 +01:00
Felix Roos 75dfb0af35 add dependencygraph 2023-02-27 11:12:21 +01:00
Felix Roos 073fa09648 packages doc 2023-02-27 11:10:47 +01:00
Felix Roos 3015e7b203 Merge pull request #480 from tidalcycles/fix-array-args
Fix array args
2023-02-25 14:26:49 +01:00
Felix Roos 7ac0cdc0f9 fix: lint error 2023-02-25 14:18:23 +01:00
Felix Roos 49234183a3 Merge remote-tracking branch 'origin/main' into fix-array-args 2023-02-25 14:13:55 +01:00
Felix Roos ed7763df92 fix: reify after sequence to preserve array
ref https://github.com/tidalcycles/strudel/issues/383#issuecomment-1399514090
2023-02-25 14:13:39 +01:00
Felix Roos b818a02f76 Merge pull request #478 from tidalcycles/midi-fleshout
midi cc support
2023-02-25 12:33:22 +01:00
Felix Roos 886f8449fd add midichan + docs 2023-02-25 12:23:01 +01:00
Felix Roos 5de6643604 midi: support ccn and ccv 2023-02-24 10:15:21 +01:00
Felix Roos 6283273d81 add helper hap.ensureObjectValue 2023-02-24 10:15:06 +01:00
Bernhard Wagner 5506d18bc5 Update README.md
npm -> pnpm
2023-02-23 18:28:11 +01:00
Felix Roos c8f8f02a46 Merge pull request #473 from tidalcycles/fix-hashes
fix: hash links
2023-02-23 00:11:04 +01:00
Felix Roos 4c5d6f1d6c fix: hash links 2023-02-23 00:04:53 +01:00
Felix Roos f349e36345 Merge pull request #467 from tidalcycles/vim-mode
settings tab with vim / emacs modes + additional themes and fonts
2023-02-22 22:54:39 +01:00
Felix Roos 1574c4ab13 Merge pull request #471 from bwagner/patch-1
Update input-output.mdx
2023-02-22 22:53:22 +01:00
Felix Roos 0dc9bc3ab6 Merge pull request #464 from bwagner/main
FIXES: freqs instead of pitches
2023-02-22 22:52:49 +01:00
Felix Roos 0006d57a4a move isZen to nanostore
+ correctly parse non strings in store
2023-02-22 22:47:33 +01:00
Felix Roos 70f7e73b9a store footer tab + latest code in nanostore 2023-02-22 22:23:54 +01:00
Felix Roos b67b049802 refactor settings to nanostores 2023-02-22 22:04:39 +01:00
Felix Roos ff99dbcd22 customizable font family 2023-02-22 20:28:22 +01:00
Felix Roos 0198697737 Merge pull request #472 from tidalcycles/osc-fix
fix: osc should not return a promise
2023-02-22 20:01:00 +01:00
Felix Roos a742a71f67 fix: osc should not return a promise 2023-02-22 19:50:37 +01:00
Felix Roos 8f6c1531fa more contrast for blackscreen theme 2023-02-22 19:45:06 +01:00
Bernhard Wagner d9f56f11cb Merge pull request #1 from tidalcycles/main
a
2023-02-22 17:15:00 +01:00
Bernhard Wagner 7ff877464f Update input-output.mdx
npm -> pnpm
2023-02-22 17:06:15 +01:00
Alex McLean 7c367eb1e8 slice and splice (#466)
Implements `slice` and `splice` from tidal, intended for beat slicing
2023-02-22 11:51:31 +00:00
Felix Roos 20848aac09 fix store import 2023-02-19 23:28:46 +01:00
Felix Roos 7716574076 use terminal font for console + samples 2023-02-19 23:28:33 +01:00
Felix Roos 89cd0c769b fix bluescreen line bg 2023-02-19 23:27:56 +01:00
Felix Roos a21b3d788f add settings reset button 2023-02-19 22:32:28 +01:00
Felix Roos 7994ba8b38 get rid of all hard coded colors 2023-02-19 22:18:32 +01:00
Felix Roos 81b4cb2f16 more themes + fonts 2023-02-19 22:18:12 +01:00
Felix Roos 14af1df6a3 define font + fix app height 2023-02-19 20:04:30 +01:00
Felix Roos ac3bd7d7db rename algoboy theme + add font 2023-02-19 20:04:19 +01:00
Felix Roos 632e8e9634 use css var for highlighting color 2023-02-19 20:03:12 +01:00
Felix Roos 1e3f09f69b add some custom themes 2023-02-19 18:53:35 +01:00
Felix Roos f3f18ffca7 fix app height for ios 2023-02-19 13:50:08 +01:00
Felix Roos ceb3aa0627 add emacs mode + fontSize slider 2023-02-19 13:49:55 +01:00
Felix Roos 014555fe5d add vim toggle to settings
+ added persistent global state store
+ refactored themes to use the new store
2023-02-19 01:51:31 +01:00
Alex McLean fdb76867a7 weave and weaveWith (#465)
Added weave and weaveWith from tidal
2023-02-18 00:00:18 +00:00
Felix Roos 57157fde9c Merge branch 'main' into docs 2023-02-17 21:53:02 +01:00
Felix Roos 4a3540cf2b encapsulate footer components 2023-02-17 21:48:45 +01:00
Felix Roos 540bd938f2 remove unused Footer
+ fix AvatarList (still unused)
2023-02-17 21:48:34 +01:00
Bernhard Wagner c6fbebd996 FIXES: freqs instead of pitches 2023-02-17 19:05:09 +01:00
Felix Roos 18d3a7e23a add vim extension (hard coded) 2023-02-17 10:41:49 +01:00
Alex McLean cbae355896 Another attempt at composable functions - WIP (#390)
Summary of changes:

- Made unary functions composable, including controls. So e.g. s("bd sd").every(3,fast(2).iter(4).n(4)) works the same as s("bd sd").every(3,x => x.fast(2).iter(4).n(4))
- Made operators/alignments composable too, so s("bd sd").every(3, set.squeeze.n(3, 4)) works
- Patterns are not treated as functions, so s("bd sd").every(3, n(5)) is an annoying runtime error. s("bd sd").every(3, set.n(5)) does work though.

Other minor changes:

- standardised alignment 'squeezeOut' as lowercase 'squeezeout'
- made firstCycleValues turn haps sorted in order of 'part'
2023-02-16 23:15:21 +00:00
Felix Roos 924e8a764a Merge pull request #461 from bwagner/main
FIXES: Warning about jsxBracketSameLine deprecation
2023-02-16 20:38:45 +01:00
Bernhard Wagner 40e629cb0e ADDS: Continuation to Testing 2023-02-16 15:24:44 +01:00
Bernhard Wagner 99ec261f79 ADDS: Continuation to Docs 2023-02-16 15:23:34 +01:00
Bernhard Wagner 9daea5bbc2 ADDS: Continuation to REPL 2023-02-16 15:22:35 +01:00
Bernhard Wagner 4704c03d48 ADDS: Continuation to Strudel vs Tidal 2023-02-16 15:21:25 +01:00
Bernhard Wagner 9dbf52bedb ADDS: Continuation to Pattern Alignment 2023-02-16 15:20:26 +01:00
Bernhard Wagner cfd04ab7fa ADDS: Continuation to Patterns 2023-02-16 15:19:14 +01:00
Bernhard Wagner 33dbf75e3b ADDS: Continuation to Offline 2023-02-16 15:18:32 +01:00
Bernhard Wagner 8ffaeeb171 ADDS: Continuation to MIDI and OSC 2023-02-16 15:16:51 +01:00
Bernhard Wagner 451828e5d4 ADDS: Continuation to Tonal Modifiers 2023-02-16 15:15:54 +01:00
Bernhard Wagner 176877f2b8 ADDS: Continuation to Accumulation Modifiers 2023-02-16 15:14:38 +01:00
Bernhard Wagner 61b0d08b5f ADDS: Continuation to Conditional Modifiers 2023-02-16 15:12:37 +01:00
Bernhard Wagner f50a6ce1ae ADDS: Continuation to Signals 2023-02-16 15:11:28 +01:00
Bernhard Wagner 8549d6ea8b ADDS: Continuation to Control Parameters 2023-02-16 15:09:37 +01:00
Bernhard Wagner 90a90a87a5 ADDS: Continuation to Time Modifiers 2023-02-16 15:08:45 +01:00
Bernhard Wagner 760bdea521 ADDS: Continuation to Pattern Constructors 2023-02-16 15:07:03 +01:00
Bernhard Wagner 0fd783e83f ADDS: Continuation to Functional JavaScript API 2023-02-16 15:03:58 +01:00
Bernhard Wagner 42caa9058b ADDS: Continuation to Synths 2023-02-16 15:00:17 +01:00
Bernhard Wagner 9ab315ac2c ADDS: Continuation to Samples 2023-02-16 14:58:02 +01:00
Bernhard Wagner a08ad07537 ADDS: Continuation to Csound 2023-02-16 14:55:01 +01:00
Bernhard Wagner c6ce763f7c FIXES: Warning about jsxBracketSameLine deprecation 2023-02-16 14:46:33 +01:00
Felix Roos 70d1eb17a7 Merge branch 'main' into vim-mode 2023-02-16 11:41:01 +01:00
Felix Roos 0393205eda Merge pull request #438 from bwagner/patch-8
Update synths.mdx
2023-02-14 22:11:02 +01:00
Bernhard Wagner 5c05a5a63e Update synths.mdx
in future -> in the future
ADDS: Continuation to Audio Effects.
2023-02-14 22:08:40 +01:00
Felix Roos b01d9f849b Merge pull request #437 from bwagner/patch-5
Update mini-notation.mdx
2023-02-14 19:54:41 +01:00
Felix Roos 0ab904275c Merge pull request #436 from bwagner/patch-4
Update code.mdx
2023-02-14 19:54:24 +01:00
Bernhard Wagner 5f82a86801 Update mini-notation.mdx
descreases -> decreases
twice a cycle -> twice per cycle
2023-02-14 19:40:03 +01:00
Bernhard Wagner 13a5d8de86 Update code.mdx
The code example says "sine", but the description says "sawtooth".
2023-02-14 19:08:47 +01:00
Felix Roos f024b71808 Update CONTRIBUTING.md
add more infos on code style, eslint and tests
2023-02-14 18:16:39 +01:00
Felix Roos cd35a17904 Merge pull request #433 from tidalcycles/fix-anchors
Fix anchors
2023-02-13 00:43:29 +01:00
Felix Roos be3f68ed06 fix comment 2023-02-13 00:42:16 +01:00
Felix Roos 64b8fd9584 fix: right sidebar anchors earlier 2023-02-13 00:41:42 +01:00
Felix Roos b001d1d0f1 update lockfile 2023-02-13 00:37:20 +01:00
Felix Roos 64ad75c79e fix: anchor links
fixes https://github.com/tidalcycles/strudel/issues/432
+ fix style regression in mini repl
2023-02-13 00:35:40 +01:00
Felix Roos 12eb361d69 remove slash before anchor link 2023-02-12 20:13:59 +01:00
Felix Roos dd51bd0a2f Merge pull request #427 from tidalcycles/docs
autocomplete preparations
2023-02-11 21:02:11 +01:00
Felix Roos 0fb478a7c8 no autocomplete until upstream merge 2023-02-11 20:55:35 +01:00
Felix Roos 9694ecf55b autocomplete dark / light 2023-02-11 13:02:04 +01:00
Felix Roos fe80478b8a Merge remote-tracking branch 'origin/main' into docs 2023-02-10 23:18:04 +01:00
Felix Roos a253c26bee Merge pull request #431 from tidalcycles/themes
Themes
2023-02-10 23:14:47 +01:00
Felix Roos a500f983f5 Merge branch 'main' into themes 2023-02-10 22:59:52 +01:00
Felix Roos 3579b6f8f3 dynamic highlight color
+ refactor hooks
2023-02-10 22:52:34 +01:00
Felix Roos 14cb954213 themed minirepl
+ add strudelTheme
+ add lineBackground with opacity
+ add some missing light flags
+ add fallback css variables for non js context
2023-02-10 21:42:27 +01:00
Felix Roos 6170eef441 format 2023-02-10 20:09:23 +01:00
Felix Roos ddb9af4d57 themify rest of layout (except minirepls) 2023-02-10 20:07:36 +01:00
Felix Roos 6db2c0bf93 only invert prose for dark themes 2023-02-10 18:34:02 +01:00
Felix Roos 46f70e6a5e persisted theme + add all settings 2023-02-10 12:54:15 +01:00
Felix Roos 0b994a1b0f switchable css variables for theming 2023-02-10 11:32:36 +01:00
Felix Roos 0326244956 update themes 2023-02-10 09:25:58 +01:00
Felix Roos ea1b2252fc remove unused descriptions
+ fix some titles
+ comment out unfinished packages page
+ start offline page
2023-02-09 21:42:48 +01:00
Felix Roos 0da25ea7cc Merge pull request #429 from tidalcycles/minirepl-keyboard-support
minirepl: add keyboard shortcuts
2023-02-09 19:22:56 +01:00
Felix Roos 3209afa4ff minirepl: add keyboard shortcuts 2023-02-09 19:20:44 +01:00
Felix Roos 33e2631e5d update snapshot 2023-02-09 18:48:34 +01:00
Felix Roos f02a41b675 fix param description 2023-02-09 18:44:41 +01:00
Felix Roos f497d7b212 reactify autocomplete info 2023-02-09 18:37:29 +01:00
Felix Roos 0f18f5eb81 remove logs 2023-02-09 14:16:37 +01:00
Felix Roos 8da81104aa doc: note 2023-02-09 12:42:37 +01:00
Felix Roos 97cbdc6b0f use jsdoc in autocomplete, still not context aware
+ add noAutocomplete flags
+ add superdirtOnly flags
2023-02-09 12:19:38 +01:00
Felix Roos 7f53f4e36b Merge branch 'main' into docs 2023-02-09 08:57:20 +01:00
Felix Roos c350f262e6 Merge pull request #425 from tidalcycles/pwa
add cdn.freesound to cache list
2023-02-09 08:56:42 +01:00
Felix Roos 3e727893bf basic theme picker 2023-02-08 23:43:02 +01:00
Felix Roos 2a2c7437e4 add cdn.freesound to cache list 2023-02-08 21:18:03 +01:00
Felix Roos 4f0885d3af Merge branch 'main' into themes 2023-02-08 20:49:20 +01:00
Felix Roos 5656cd2fc6 Merge pull request #421 from tidalcycles/pwa
add more offline caching
2023-02-08 20:36:00 +01:00
Felix Roos b6e42876ad fix cache rule + disable service worker in dev 2023-02-08 20:32:03 +01:00
Felix Roos 3671344867 add freesound + shabda to offline cache rule 2023-02-08 20:26:44 +01:00
Felix Roos 30b149053c basic theme switcher 2023-02-08 18:54:34 +01:00
Felix Roos cdd40df9d3 disable sw in dev 2023-02-08 18:54:19 +01:00
Felix Roos 9d661808ba Merge pull request #419 from tidalcycles/pwa
add caching strategy for missing file types + cache all samples loaded from github
2023-02-07 22:08:01 +01:00
Felix Roos 6a5d849b3c add caching strategy for missing file types
+ cache all samples loaded from github
2023-02-07 21:50:08 +01:00
Felix Roos 25bbd73a90 Merge pull request #417 from tidalcycles/pwa
PWA with offline support
2023-02-06 23:29:56 +01:00
Felix Roos 3d27a5f8c7 format 2023-02-06 21:06:33 +01:00
Felix Roos 44ef372399 update og meta data 2023-02-06 21:05:28 +01:00
Felix Roos fd09dff381 basic pwa setup 2023-02-06 20:57:34 +01:00
Felix Roos 10580a0bec change rocket to strudel 2023-02-06 20:21:09 +01:00
Felix Roos f3f87b0a46 dont lint json 2023-02-06 20:20:45 +01:00
Felix Roos ac606bcf71 Update README.md 2023-02-05 23:16:38 +01:00
alex bb50df07e7 iclc reviews 2023-02-05 21:01:02 +00:00
Felix Roos f7ac033e1c Merge pull request #411 from tidalcycles/docs
improve samples doc
2023-02-05 17:27:32 +01:00
Felix Roos a1043352c1 Merge pull request #413 from tidalcycles/remove-google
google gtfo
2023-02-05 17:27:09 +01:00
Felix Roos e15fecf6cf google gtfo 2023-02-05 17:19:32 +01:00
Felix Roos 3e99f345ef better headings 2023-02-05 16:40:29 +01:00
Felix Roos 0a77770ef3 remove double directive 2023-02-05 16:37:00 +01:00
Felix Roos 379b8392dd add snapshot 2023-02-05 16:32:51 +01:00
Felix Roos 0fdae70461 improve samples doc 2023-02-05 16:28:43 +01:00
Felix Roos 087423c754 Merge pull request #409 from tidalcycles/docs
improve effects doc
2023-02-05 16:27:59 +01:00
Felix Roos ce64c98fb7 add adsr image link 2023-02-05 15:08:17 +01:00
Felix Roos e11a8a9dbb Merge pull request #410 from bwagner/patch-3
Update effects.mdx
2023-02-05 14:56:03 +01:00
Bernhard Wagner ef4a68a24d Update effects.mdx
Wether -> Whether
2023-02-05 14:54:27 +01:00
Felix Roos 0ec65c85d3 fix examples + snapshots 2023-02-05 14:52:01 +01:00
Felix Roos 74326f226d format 2023-02-05 14:42:08 +01:00
Felix Roos 554e0d7a39 remove envelope section from synths page 2023-02-05 14:38:47 +01:00
Felix Roos 1b99ac92dd categorize effects + add envelope doc
+ use short, more logical filter params as default
2023-02-05 14:34:59 +01:00
Felix Roos ff0b77908a Merge branch 'main' into docs 2023-02-05 14:34:16 +01:00
Felix Roos 83d19638ba Merge pull request #407 from tidalcycles/shabda-doc
add shabda doc
2023-02-03 19:54:47 +01:00
Felix Roos a7d484b1a8 add shabda doc 2023-02-03 19:53:01 +01:00
Felix Roos d87beb37b8 Merge pull request #405 from tidalcycles/fix-share-on-subpath
fix: share url on subpath
2023-02-02 21:45:56 +01:00
Felix Roos dcdb383960 fix: share url on subpath
fixes https://github.com/tidalcycles/strudel/issues/389
2023-02-02 21:43:24 +01:00
Felix Roos 478a7e95ea Merge pull request #404 from tidalcycles/csound-update
update csound + fix sound output
2023-02-02 21:35:45 +01:00
Felix Roos f7b3b582cc update csound + fix sound output
see https://github.com/csound/csound/issues/1690#issuecomment-1414301145
2023-02-02 21:31:44 +01:00
Felix Roos d1719dc277 Merge pull request #403 from tidalcycles/downgrade-csound
pin @csound/browser to 6.18.3 + bump
2023-02-02 19:53:36 +01:00
Felix Roos 9d8c812aa3 pin @csound/browser to 6.18.3 + bump 2023-02-02 19:51:16 +01:00
Felix Roos 2e390acce9 hotfix: deploy workflow install command 2023-02-01 23:04:13 +01:00
Felix Roos e04797d891 Merge pull request #400 from tidalcycles/awaitable-audio-init
release webaudio
2023-02-01 22:47:26 +01:00
Felix Roos fb6195b081 bump webaudio 2023-02-01 22:45:53 +01:00
Felix Roos c6491a3ccd Merge pull request #399 from tidalcycles/awaitable-audio-init
can now await initAudio + initAudioOnFirstClick
2023-02-01 22:45:16 +01:00
Felix Roos 014ae2107e can now await initAudio + initAudioOnFirstClick 2023-02-01 22:42:25 +01:00
Felix Roos 1457eb9d19 Merge pull request #398 from tidalcycles/fix-minirepl-styles
fix: minirepl styles
2023-02-01 22:32:18 +01:00
Felix Roos 6f5f8cc7d8 fix: minirepl styles 2023-02-01 22:30:24 +01:00
Felix Roos 9ec3fee455 Merge pull request #396 from tidalcycles/pnpm
proper builds + use pnpm workspaces
2023-02-01 22:17:18 +01:00
Felix Roos 2d52168c26 trash obsolete package-lock files 2023-02-01 20:43:16 +01:00
Felix Roos aa5dd7920f organize tasks 2023-02-01 20:38:56 +01:00
Felix Roos d60956e82a update contribution guide to pnpm
+ update root tasks
2023-02-01 20:33:13 +01:00
Alex McLean 91fd3fb5ca add missing snapshots 2023-02-01 15:51:42 +00:00
Alex McLean 46f3b662a7 add pattern methods hurry, press and pressBy (#397) 2023-02-01 15:49:55 +00:00
Felix Roos 54a61dcdae overhaul the remaining readmes 2023-02-01 16:29:18 +01:00
Felix Roos b58f5232c7 add nano-repl as workspace 2023-02-01 16:09:50 +01:00
Felix Roos 9a5bda862c update examples 2023-02-01 16:09:33 +01:00
Felix Roos 7f67adb639 bump eval 2023-02-01 15:49:05 +01:00
Felix Roos 48fd943622 fix: eval dependency + add deprecation note 2023-02-01 15:40:57 +01:00
Felix Roos 08350d00be remove sc prefix to fix build 2023-02-01 15:35:21 +01:00
Felix Roos 84bf4a2686 add pretest 2023-01-30 22:53:53 +01:00
Felix Roos 2823456e96 update lockfile 2023-01-30 22:50:44 +01:00
Felix Roos a373629fc2 fix: gh actions use pnpm 2023-01-30 22:48:24 +01:00
Felix Roos 0aa2f72a3a update core examples 2023-01-29 23:27:35 +01:00
Felix Roos c032f6dde1 add prepublishOnly everywhere 2023-01-29 00:14:07 +01:00
Felix Roos f448d8f334 rename website package 2023-01-29 00:08:29 +01:00
Felix Roos a5d4a43753 xen build 2023-01-28 23:19:33 +01:00
Felix Roos 52e01321ec webdirt build 2023-01-28 23:18:25 +01:00
Felix Roos 19692e0122 webaudio build 2023-01-28 23:14:56 +01:00
Felix Roos cd1da3cb81 transpiler build 2023-01-28 23:12:00 +01:00
Felix Roos ffaa8f4ab3 tone build 2023-01-28 23:09:25 +01:00
Felix Roos f3da9d680d bump 2023-01-28 23:07:55 +01:00
Felix Roos 6118bd24f2 tonal build 2023-01-28 23:06:59 +01:00
Felix Roos fddbb2e2ac soundfonts build 2023-01-28 23:04:30 +01:00
Felix Roos cb7156b091 serial build 2023-01-28 23:01:20 +01:00
Felix Roos b5914a3f12 react build 2023-01-28 22:58:40 +01:00
Felix Roos 348d576ff3 remove dist folder 2023-01-28 22:49:13 +01:00
Felix Roos 7507654749 osc build 2023-01-28 22:40:10 +01:00
Felix Roos c25aad0c4a midi build 2023-01-28 22:35:08 +01:00
Felix Roos 4aa32415cd eval build 2023-01-28 22:32:48 +01:00
Felix Roos cde23bbf98 csound build 2023-01-28 22:27:18 +01:00
Felix Roos 555fe0b629 bump mini 2023-01-28 22:16:33 +01:00
Felix Roos be44c28fd3 add mini build 2023-01-28 22:16:04 +01:00
Felix Roos 657091307e remove unused deps 2023-01-28 22:12:11 +01:00
Felix Roos 458dc6e07d add core build 2023-01-28 22:05:11 +01:00
Felix Roos cfaecf9fcb migrate lerna to pnpm
https://lerna.js.org/docs/recipes/using-pnpm-with-lerna
2023-01-28 22:01:35 +01:00
Felix Roos 902f722d4c add import linting + fix checks 2023-01-28 21:00:42 +01:00
Felix Roos ea2d8b2773 use workspace protocol everywhere 2023-01-28 20:37:56 +01:00
Felix Roos b319754dc3 fix website build 2023-01-28 20:31:23 +01:00
Felix Roos 35f2040717 use pnpm workspaces 2023-01-28 20:14:26 +01:00
Felix Roos 4121fc926e write more about packages / monorepo setup 2023-01-28 17:59:59 +01:00
Felix Roos fd9ab987e6 Merge branch 'main' into docs 2023-01-28 14:23:01 +01:00
Felix Roos 6c3a235b08 Merge pull request #379 from urswilke/add-tidal-drum-patterns-to-examples
Add tidal-drum-patterns to examples
2023-01-27 14:40:40 +01:00
Felix Roos 07cb861385 Merge pull request #388 from tidalcycles/ribbon
add ribbon + test + docs
2023-01-27 14:39:56 +01:00
Alex McLean 217e348fc3 Notes are not essential :) (#393)
* Notes are not essential :)

* Update notes.mdx
2023-01-27 11:10:37 +00:00
Felix Roos ad917afba4 Merge pull request #391 from tidalcycles/docs
document csound
2023-01-21 17:18:12 +01:00
Felix Roos 9539c6d317 fix: left sidebar scroll 2023-01-21 17:14:18 +01:00
Felix Roos e946e1e01e add csound docs 2023-01-21 17:05:57 +01:00
Felix Roos fea1e71a99 Merge remote-tracking branch 'origin/main' into docs 2023-01-21 15:57:54 +01:00
Felix Roos 9731eb8c5b add ribbon + test + docs 2023-01-19 12:25:12 +01:00
Felix Roos e058ae54ef Merge pull request #387 from tidalcycles/rename-a-to-angle
Rename a to angle
2023-01-19 12:04:50 +01:00
Felix Roos ba6714f384 add draw examples 2023-01-19 12:00:00 +01:00
Felix Roos 0a0a761e23 rename a to angle 2023-01-19 11:59:43 +01:00
Felix Roos 88e8368022 Merge pull request #386 from tidalcycles/run
add run + test + docs
2023-01-19 11:49:38 +01:00
Felix Roos 468ccc6288 add run + test + docs 2023-01-19 11:47:11 +01:00
Felix Roos 77e0237148 Merge pull request #385 from tidalcycles/docs-use-note-instead-of-n
docs: use note instead of n to mitigate confusion
2023-01-19 11:32:55 +01:00
Felix Roos ffdfb07f72 docs: use note instead of n to mitigate confusion 2023-01-19 11:27:54 +01:00
Felix Roos 203ed88024 Merge pull request #384 from tidalcycles/update-my-patterns-readme
update my-patterns instructions
2023-01-18 17:10:08 +01:00
Felix Roos 9923bcd16f update my-patterns instructions 2023-01-18 17:01:27 +01:00
urswilke 0179ec051f Revert "run: npm test"
This reverts commit 00709539e9bdfbc1404e984f28453f0a54b5638e.
2023-01-16 23:19:46 +01:00
urswilke 05b6353355 move drum patterns in a new file 2023-01-16 23:11:17 +01:00
urswilke 47c6ed8829 Revert "import patterns created by new method in:"
This reverts commit b266e975755e035b85c0869a30219c80a84db856.
2023-01-16 23:06:43 +01:00
urswilke ff9ebd64e3 run: npm test 2023-01-16 22:41:12 +01:00
urswilke cd2b098b81 import patterns created by new method in:
https://github.com/urswilke/read_beats/commit/ecd8c03b5e29544819831459f4b4ac48d954640f
2023-01-16 22:41:12 +01:00
Felix Roos 7000a4cead Merge pull request #377 from tidalcycles/draw-fixes
Draw fixes
2023-01-15 23:19:42 +01:00
Felix Roos 5aa983b45b do less work when not drawing 2023-01-15 23:11:49 +01:00
Felix Roos 800989419b catch all query errors by default 2023-01-15 22:50:56 +01:00
Felix Roos 362679954a Merge pull request #372 from tidalcycles/local-draw
improve new draw logic
2023-01-14 11:07:07 +01:00
Felix Roos 2732d64beb fix: another dependency array 2023-01-14 10:58:30 +01:00
Felix Roos 88684d6d9e fix dependency array 2023-01-14 10:48:52 +01:00
Felix Roos 9afddf0850 fix sentence 2023-01-14 01:30:56 +01:00
Felix Roos a2d7d6e81f fix: mini repl could eval before modules are ready 2023-01-14 01:27:22 +01:00
Felix Roos 49bcb5e19f fix minor bugs 2023-01-13 16:35:24 +01:00
Felix Roos 3744ea6218 fix: warnings 2023-01-13 15:17:23 +01:00
Felix Roos b2c6d87633 MiniRepl: add punchcard flag for implicit vis
+ reintroduce editPattern
+ add punchcards to mini-notation.mdx
2023-01-13 15:13:39 +01:00
Felix Roos e4f538b674 fix option handling 2023-01-13 13:00:11 +01:00
Felix Roos ea0e0b4396 reset canvas when pattern changes
+ rename noteroll -> punchcard
2023-01-13 12:57:35 +01:00
Felix Roos 1ac784dc7a localize draw logic 2023-01-13 12:03:34 +01:00
Felix Roos d980c9ca4c Merge branch 'main' into docs 2023-01-13 01:52:36 +01:00
Felix Roos 6a2a60df0d hotfix: tests 2023-01-12 17:43:20 +01:00
Felix Roos ee9b89b6d5 add more synonyms 2023-01-12 17:40:58 +01:00
Felix Roos 68cc109933 burn down that undocumented list 2023-01-12 17:25:01 +01:00
Felix Roos 1015bb0fdc Merge pull request #369 from tidalcycles/docs
document more functions + change arp join
2023-01-12 14:40:58 +01:00
Felix Roos 7da94dd109 reformat headings
+ add another note about single quotes
2023-01-12 14:22:41 +01:00
Felix Roos 171808cf2c add note about single quote strings 2023-01-12 14:19:18 +01:00
Felix Roos 78d14cdfea automatically print synonyms in doc 2023-01-12 13:10:22 +01:00
Felix Roos 19982a2ffb remove unused package 2023-01-12 13:00:22 +01:00
Felix Roos 79904560fc fix: snapshot 2023-01-12 12:48:05 +01:00
Felix Roos 28aee1c58d fix polymeter doc 2023-01-12 12:43:41 +01:00
Felix Roos d4512f360b fix: double slash 2023-01-12 12:40:20 +01:00
Felix Roos 48d0ffe868 add script that finds all undocumented exports 2023-01-12 12:35:04 +01:00
Felix Roos 62af12f3b9 remove experimental class properties 2023-01-12 12:32:27 +01:00
Felix Roos efa4bfef2f fix snapshot 2023-01-12 02:23:06 +01:00
Felix Roos fc3ead4c01 Merge branch 'main' into docs 2023-01-12 02:20:16 +01:00
Felix Roos ca9c813b40 format 2023-01-12 02:18:09 +01:00
Felix Roos e3b0f47c40 hide internals for now 2023-01-12 02:15:42 +01:00
Felix Roos bf13e42092 update snap 2023-01-12 01:57:14 +01:00
Felix Roos 4345fda9bc more doc 2023-01-12 01:56:46 +01:00
Felix Roos 4059e9faa9 more doc 2023-01-12 00:10:58 +01:00
Felix Roos 95fcce1bcf fix: snapshot 2023-01-11 23:38:40 +01:00
Felix Roos 86cde9716a arpWith example 2023-01-11 23:37:59 +01:00
Felix Roos 6e315a50ed breaking: arp use innerJoin instead of squeezeJoin 2023-01-11 23:28:17 +01:00
Felix Roos 500c0b6534 doc: arp + arpWith 2023-01-11 23:26:03 +01:00
Felix Roos db75dca118 doc: split accumulation and conditions 2023-01-11 23:05:17 +01:00
Felix Roos d5f37e2cbe add internals doc 2023-01-11 22:48:47 +01:00
Felix Roos a120a9895b fix: right sidebar width 2023-01-11 22:48:33 +01:00
Felix Roos e9c1db020f hotfix: remove mocked .out 2023-01-11 22:11:22 +01:00
alex 08cd319a0b Revert "Merge branch 'main' into main"
This reverts commit 896ec69329, reversing
changes made to 32e64bbb6e.
2023-01-10 19:45:23 +00:00
Alex McLean 896ec69329 Merge branch 'main' into main 2023-01-10 18:23:45 +00:00
Alex McLean 32e64bbb6e Typo 2023-01-09 23:49:16 +00:00
Felix Roos 0974540e5f fix: typo 2023-01-10 00:21:54 +01:00
Felix Roos e06963e616 Merge pull request #364 from urswilke/patch-2
add https to url
2023-01-10 00:03:46 +01:00
Felix Roos a675815529 hotfix: preview command + build peg without logs 2023-01-09 23:55:45 +01:00
alex 3d48135b32 09 2023-01-09 22:47:25 +00:00
urswilke 8f09e7f097 add https to url 2023-01-09 23:44:49 +01:00
Felix Roos e8b09f1124 Merge pull request #360 from tidalcycles/docs
doc structuring
2023-01-09 23:37:34 +01:00
Felix Roos 57ba353594 snaps 2023-01-09 23:31:30 +01:00
Felix Roos b695e090cd docs: control params 2023-01-09 23:27:30 +01:00
Felix Roos 69ecb7b54f support logs in mini repl
+ pass hap to logger
+ add editPattern hook to repl + useStrudel
+ do not throw when webaudio gets plain values
2023-01-09 23:26:20 +01:00
Alex McLean f57fe182ed Support for multiple mininotation operators WIP (#350)
* support for multiple operators
* fix false test failures by sorting by part
* snapshot
2023-01-09 22:23:27 +00:00
Felix Roos 10ee11c886 docs: improve time modifiers page
+ polymeter + euclidRot
+ rename Factories to Pattern Constructors
2023-01-09 20:39:00 +01:00
Alex McLean 45842b1f05 Fix .out(), renaming webaudio's out() to webaudio() (#361)
* breaking test for out()

* rename webaudio's out() to webaudio(), fixes #359
2023-01-08 23:40:15 +00:00
Felix Roos 9ca5f9ad48 some corrections
+ n should not be recommended for notes as it does not work for samples
2023-01-09 00:19:29 +01:00
Felix Roos bb00036a30 further sidebar reorganizing 2023-01-09 00:17:57 +01:00
Felix Roos 4a2a540500 Update README.md 2023-01-08 23:55:07 +01:00
Felix Roos 09217216dc format 2023-01-08 23:48:32 +01:00
Felix Roos 22a64c4931 update snapshots 2023-01-08 23:46:39 +01:00
Felix Roos 93f520b941 Merge remote-tracking branch 'origin/main' into docs 2023-01-08 23:44:27 +01:00
alex c84714dc3a 08 2023-01-08 13:25:22 +00:00
alex a7aa09a13e 07 2023-01-07 23:15:50 +00:00
alex efa1cdfcb2 07 2023-01-07 23:12:19 +00:00
Felix Roos 70695daae8 remove quotes around inline code snippets 2023-01-07 22:12:53 +01:00
Felix Roos 62fdba0600 pull apart functional docs 2023-01-07 22:12:35 +01:00
Felix Roos 5733e00908 add hideDescription flag to JsDoc 2023-01-07 22:11:47 +01:00
alex e56abaefd7 06 2023-01-07 00:02:39 +00:00
Felix Roos c71e893e8e Merge pull request #356 from tidalcycles/docs
docs: tidal comparison + add global fx + add missing sampler fx
2023-01-06 22:02:31 +01:00
Felix Roos 3992356517 casing 2023-01-06 21:58:35 +01:00
Felix Roos dbb84ef129 write more tidal comparison 2023-01-06 21:56:17 +01:00
Felix Roos 8781fa2e33 add filter synonyms 2023-01-06 21:37:31 +01:00
Felix Roos 605a1365d3 update snapshots 2023-01-06 21:15:32 +01:00
Felix Roos ebb1bbc966 improve effects doc 2023-01-06 21:14:19 +01:00
Felix Roos d4518f7a6e began tidal comparison page 2023-01-06 12:50:35 +01:00
Alex McLean 68c9008019 Fix Bjorklund (#343)
* port Rohan Drape's Bjorklund implementation, add Toussaint's tests
* fix euclidLegato, simplifying a bit now that bjork results should always begin with an 'on'
* migrate euclid numbers in tunes
- 3,4 +1
- 5,8 -1
- 6,8 +3

Co-authored-by: Felix Roos <flix91@gmail.com>
2023-01-06 11:31:32 +00:00
Felix Roos cafde1e910 Merge branch 'main' into docs 2023-01-06 11:49:49 +01:00
alex 41f5f3fe6e 05 2023-01-05 23:58:48 +00:00
alex cf12ecfa34 04 2023-01-04 23:36:40 +00:00
Felix Roos 4fa668927f Merge pull request #345 from tidalcycles/fix-prebake-base-path
Fix prebake base path
2023-01-04 20:29:35 +01:00
Felix Roos 24d2b5b4bd Merge pull request #347 from tidalcycles/fix-midi
fixes #346
2023-01-04 19:55:48 +01:00
Felix Roos 4da2e003e1 fixes #346 2023-01-04 19:52:51 +01:00
Felix Roos 205debde9c more links to fix 2023-01-03 23:40:40 +01:00
Felix Roos ba6c7b0901 fix examples route 2023-01-03 23:32:37 +01:00
Felix Roos 8e5d02fd25 do not include url in base pth 2023-01-03 23:32:28 +01:00
Felix Roos 11d3251c67 add base path + use relative links 2023-01-03 23:02:41 +01:00
alex 9ec5787b4d 03 2023-01-03 21:26:56 +00:00
Felix Roos 027c669ad7 make prebake relative to BASE_URL 2023-01-03 22:17:44 +01:00
Alex McLean 405c12ba3f deploy on push 2023-01-03 10:47:20 +00:00
Alex McLean 64fd53a8e5 tweak 2023-01-03 10:43:54 +00:00
alex 069d63e3cf 02 2023-01-02 23:33:48 +00:00
Alex McLean 66049e0e25 Merge pull request #2 from tidalcycles/main
downstream
2023-01-02 21:07:18 +00:00
Alex McLean db7ef01dbb Patternify euclid, fast, slow and polymeter step parameters in mininotation (#341)
* patternify the mininotation bjorklund, and fast (*) slow (/) and pattern step (%) parameters
* simplify replicate (!), should be closer to tidal now
* highlight atoms rather than elements
* tests
2023-01-02 20:28:07 +00:00
Felix Roos 1a6b649fd6 Merge pull request #340 from tidalcycles/animate
more animate functions + mini repl fix
2023-01-02 00:30:16 +01:00
Felix Roos 548619775e rename .. 2023-01-02 00:28:38 +01:00
Felix Roos 4b79a75f39 fix: mini repls were broken 2023-01-02 00:24:33 +01:00
Felix Roos 28912fff97 animate: rescale + move + zoom 2023-01-01 18:47:45 +01:00
alex 98a83ddcc0 01c 2023-01-01 17:22:16 +00:00
alex e9d965ce7a 01b 2023-01-01 14:22:19 +00:00
alex b7624813cc custom domain 2023-01-01 11:49:20 +00:00
Alex McLean 734e451bd9 Merge pull request #1 from tidalcycles/main
pull from upstream
2023-01-01 11:42:58 +00:00
Alex McLean 7a96436085 move /my-patterns to /swatch (#338) 2023-01-01 11:34:11 +00:00
Felix Roos 670af8fb1b Merge pull request #337 from tidalcycles/animate
animation options
2023-01-01 12:22:55 +01:00
Felix Roos 0abd062e5c fix: smear 0 special case 2023-01-01 12:18:46 +01:00
Felix Roos 1286468d5a animation options
+ do not sync by default
2023-01-01 12:11:39 +01:00
alex 0f3da5be4a 01 2023-01-01 10:05:58 +00:00
Alex McLean 9170269e06 Update README.md 2023-01-01 00:34:53 +00:00
Alex McLean 8bb460701f Tidy parser, implement polymeters (#336)
* rename parser stuff to be more explicit and fit with tidal concepts. qualify all strudel function calls
* Add {,}%n polymeter support, with a few tests
2022-12-31 21:42:49 +00:00
Felix Roos c0a7173ca4 Merge pull request #335 from tidalcycles/animate
animate mvp
2022-12-31 16:51:53 +01:00
Felix Roos 949e15d8c6 controllable smear + sync flag 2022-12-31 16:41:13 +01:00
Felix Roos 0caedeb481 animate mvp 2022-12-31 16:23:45 +01:00
Felix Roos 83ca8d95be Merge pull request #334 from tidalcycles/docs
testing + docs docs
2022-12-30 20:16:09 +01:00
Felix Roos 8483868783 docs: testing + docs 2022-12-30 19:54:02 +01:00
Felix Roos 6961388545 Merge branch 'main' into docs 2022-12-30 17:43:54 +01:00
Felix Roos 8ef1ae5202 Merge pull request #333 from tidalcycles/embed-route
Embed mode improvements
2022-12-29 21:11:15 +01:00
Felix Roos 26b8f93cea roll back hh rhythm 2022-12-29 21:08:11 +01:00
Felix Roos a576523976 simplify meltingsubmarine tune 2022-12-29 21:02:04 +01:00
Felix Roos cf21c4085b simplify embedded mode 2022-12-29 21:01:28 +01:00
Felix Roos 204f655d6d Merge pull request #332 from tidalcycles/fix-mini-multiply-floats
fix: can now multiply floats in mini notation
2022-12-29 14:06:19 +01:00
Felix Roos fb14865785 fix: can now multiply floats in mini notation
- fixes #314
2022-12-29 14:02:50 +01:00
Felix Roos 5cd052cc59 Merge pull request #331 from tidalcycles/my-patterns
improve displaying 's' in pianoroll
2022-12-29 13:50:07 +01:00
Felix Roos af49c4117c add color to some tunes 2022-12-29 13:25:20 +01:00
Felix Roos dd736130a0 improve pianoroll value mapping 2022-12-29 13:03:28 +01:00
Felix Roos cee8bda676 Merge pull request #330 from tidalcycles/my-patterns
my-patterns: fix paths + update readme
2022-12-28 17:35:35 +01:00
Felix Roos 6420a72ceb fix paths + update readme 2022-12-28 17:33:14 +01:00
Felix Roos 380e7c7899 Merge pull request #329 from tidalcycles/my-patterns
my-patterns build + deploy
2022-12-28 17:11:40 +01:00
Felix Roos 16b4058a8b fix build + simplify logic + add deploy note 2022-12-28 17:09:18 +01:00
Felix Roos e3fba0257f Merge pull request #328 from tidalcycles/my-patterns
add my-patterns
2022-12-28 15:43:31 +01:00
Felix Roos cb8b65f6f3 add my-patterns 2022-12-28 15:39:42 +01:00
Felix Roos 3944a8ed54 Merge pull request #327 from tidalcycles/docs
add examples route
2022-12-28 14:47:13 +01:00
Felix Roos 2ceafe6379 Merge pull request #326 from tidalcycles/eval-fix-node
fix: workaround Object.assign globalThis
2022-12-28 14:44:30 +01:00
Felix Roos 9f058bd88a add examples page with prerendered swatches 2022-12-28 14:40:53 +01:00
Felix Roos 1dd0ff13d8 Merge remote-tracking branch 'origin/eval-fix-node' into docs 2022-12-28 14:02:55 +01:00
Felix Roos 6061f10230 fix: workaround Object.assign globalThis
- see comment
2022-12-28 13:57:27 +01:00
Felix Roos ea59fafb52 Merge pull request #324 from tidalcycles/docs
mini repl improvements
2022-12-26 23:29:47 +01:00
Felix Roos 2ff71126de add withCanvas 2022-12-26 23:25:57 +01:00
Felix Roos 6d522e1743 Merge remote-tracking branch 'origin/main' into docs 2022-12-26 23:13:51 +01:00
Felix Roos b37f3c819d remove color magic for now 2022-12-26 23:12:16 +01:00
Felix Roos 1b41994e5f codeformat 2022-12-26 23:01:18 +01:00
Felix Roos 4fd4b0d713 Merge pull request #323 from tidalcycles/notes-without-octave
support notes without octave
2022-12-26 23:00:34 +01:00
Felix Roos 7b43ed702e only start animation loop when canvas is visible
+ add some placeholder files
2022-12-26 22:59:41 +01:00
Felix Roos 56cd77942b remove old graphic 2022-12-26 22:50:10 +01:00
Felix Roos 37dc723b4b react package build... 2022-12-26 22:44:23 +01:00
Felix Roos d7ea37c917 add technical manual to docs 2022-12-26 22:43:02 +01:00
Felix Roos c1d2bf9b9f fix anchor links 2022-12-26 22:16:46 +01:00
Felix Roos 36f837730a better color support 2022-12-26 22:13:41 +01:00
Felix Roos b8f0a1dd82 fix format 2022-12-26 21:04:15 +01:00
Felix Roos 2d1b62a978 begin reimplementing draw logic for parallel use 2022-12-26 20:58:57 +01:00
Felix Roos 0792d0d59d add scheduler.now to get phase starting from 0 2022-12-26 20:55:21 +01:00
Felix Roos 8c6da1a658 Merge branch 'main' into docs 2022-12-26 13:31:06 +01:00
Felix Roos 26be10f937 hotfix: css + sn -> sd 2022-12-26 12:43:08 +01:00
Felix Roos ef4d9a13ed Merge pull request #320 from jarmitage/main
tutorial updates
2022-12-26 12:37:36 +01:00
Jack Armitage 320d987ede wut 2022-12-26 11:32:55 +00:00
Jack Armitage 51a4c4d13b codeformat 2022-12-26 11:30:01 +00:00
Felix Roos aaf3ae5f9c microrhythm experiment 2022-12-26 11:25:27 +01:00
Jack Armitage 858f4f74b3 tutorial updates 2022-12-25 16:21:18 +00:00
Felix Roos 3feed90039 translate parts of tidal "How-tos" 2022-12-24 00:14:26 +01:00
Felix Roos b46330fc7a proper setup minirepl 2022-12-24 00:12:54 +01:00
Felix Roos 5ca7ce1f75 Merge commit 'd1d9b37ec764dd7377754d88e72996ef887beb82' into docs 2022-12-23 23:06:54 +01:00
Felix Roos d1d9b37ec7 supper notes without octave 2022-12-23 23:01:07 +01:00
Felix Roos 823115c4ec Merge pull request #318 from tidalcycles/reference-tab-sort
Reference tab sort
2022-12-23 18:26:30 +01:00
Felix Roos 8fe3fda27f update snapshots 2022-12-23 18:24:40 +01:00
Felix Roos 63fffd7493 docs: envelope functions 2022-12-23 17:57:01 +01:00
Felix Roos 243a350e2b fix: #317 2022-12-23 17:32:25 +01:00
Felix Roos 8c09e7ba36 hotfix: go to repl link 2022-12-23 01:05:17 +01:00
Felix Roos d89502f91f hotfix: make sure jsdoc is built before build 2022-12-23 01:01:45 +01:00
Felix Roos 847602f933 hotfix: add missing npm ci 2022-12-23 00:58:48 +01:00
Felix Roos 8fcf8fe39c Revert "hotfix: build task for ci"
This reverts commit d59eec9296.
2022-12-23 00:57:59 +01:00
Felix Roos d59eec9296 hotfix: build task for ci 2022-12-23 00:54:43 +01:00
Felix Roos b9122ebc34 Merge pull request #315 from tidalcycles/astro-build
Astro build
2022-12-23 00:49:56 +01:00
Felix Roos 38e066ee49 fix import 2022-12-23 00:47:33 +01:00
Felix Roos 232a04a1a2 docs: mobile nav 2022-12-23 00:41:47 +01:00
Felix Roos dcb145635c add tutorial redirect
+ place learn link last in repl header
+ fix all old links to /tutorial
2022-12-22 23:47:11 +01:00
Felix Roos c9b73c68a6 fix pretest task 2022-12-22 23:32:19 +01:00
Felix Roos 08f7925ea9 delete now obsolete repl + tutorial folders 2022-12-22 23:28:34 +01:00
Felix Roos ed79ec7940 copy potentially useful files from old tutorial 2022-12-22 23:22:48 +01:00
Felix Roos 869a44dd04 autolink headings 2022-12-22 23:19:38 +01:00
Felix Roos 6a9e9ebc4c responsiveness 2022-12-22 23:07:14 +01:00
Felix Roos f18a2a11fa make repl and doc styles more similar 2022-12-22 22:49:41 +01:00
Felix Roos 9aaaa755c7 fix import + update build task 2022-12-22 17:23:35 +01:00
Felix Roos 818cd9044b integrate repl into astro website
+ update build and setup tasks + workflow
+ move repl test folder to root
+ move docs and repl to website/src
2022-12-22 17:20:51 +01:00
Felix Roos 006ca12b6d rename folder 2022-12-22 15:36:24 +01:00
Felix Roos b5f9ab7c20 slight layout fixes 2022-12-20 22:47:49 +01:00
Felix Roos 0981f95f16 style left sidebar 2022-12-20 22:26:12 +01:00
Felix Roos f64ef32eaa more styling 2022-12-20 22:19:30 +01:00
Felix Roos 7a19659c9e remove theme.css + cooler bg 2022-12-20 21:57:41 +01:00
Felix Roos b1202fcd55 split tutorial into multiple pages
+ improve layout a bit
2022-12-20 21:38:08 +01:00
Felix Roos b8f991eddb simplify writing mdx files 2022-12-20 20:42:42 +01:00
Felix Roos d0013f55a2 format 2022-12-20 19:50:32 +01:00
Felix Roos 7efaff4f6f basic style for toc + further cleanup 2022-12-20 19:47:28 +01:00
Felix Roos bc7a84e462 basic astro docs 2022-12-19 23:23:31 +01:00
Felix Roos 61657bd1b1 Merge pull request #307 from tidalcycles/obj-support-scale
object support for .scale
2022-12-19 21:02:37 +01:00
Felix Roos fc63f4f89c Merge pull request #312 from tidalcycles/jsdoc-component
Jsdoc component
2022-12-19 21:02:21 +01:00
Felix Roos 2c44c252d7 fixed namespaced anchor links 2022-12-19 20:59:47 +01:00
Felix Roos 613fc6e3ef fix anchor icon color 2022-12-19 20:57:42 +01:00
Felix Roos 0a9604d10e throw out nunjucks 2022-12-19 20:48:57 +01:00
Felix Roos 1cabedc65e Merge pull request #311 from tidalcycles/fix-clipboard
fix: copy share link to clipboard was broken for some browers
2022-12-19 20:31:46 +01:00
Felix Roos 4e5a0d9e02 fix: #309 2022-12-19 20:30:01 +01:00
Alex McLean bf373d894d ICLC2023 paper (#306)
Paper submission for the international conference on live coding
2022-12-19 11:11:24 +00:00
Felix Roos e6bbad84c1 Merge pull request #308 from tidalcycles/pianoroll-freq-support
support freq in pianoroll
2022-12-15 21:23:22 +01:00
Felix Roos 4de477d46c support freq in pianoroll 2022-12-15 21:21:20 +01:00
Felix Roos 264cab3c9b add scale test 2022-12-15 20:35:10 +01:00
Felix Roos 7f9ef59bea Merge branch 'main' into obj-support-scale 2022-12-15 17:49:24 +01:00
Felix Roos 8ebbef4cbb fix core deps after release trouble 2022-12-13 22:46:35 +01:00
Felix Roos 0c98a84242 bump root to 0.5.0 2022-12-13 22:38:58 +01:00
Felix Roos 2bbdd21b2f Publish
- @strudel.cycles/csound@0.5.1
 - @strudel.cycles/eval@0.5.0
 - @strudel.cycles/midi@0.5.0
 - @strudel.cycles/mini@0.5.0
 - @strudel.cycles/react@0.5.0
 - @strudel.cycles/soundfonts@0.5.0
 - @strudel.cycles/tonal@0.5.0
 - @strudel.cycles/tone@0.5.0
 - @strudel.cycles/transpiler@0.5.0
 - @strudel.cycles/webaudio@0.5.0
 - @strudel.cycles/webdirt@0.5.0
 - @strudel.cycles/xen@0.5.0
2022-12-13 22:38:08 +01:00
Felix Roos 794cfe949b bump already published packages 2022-12-13 22:36:13 +01:00
Felix Roos 6a5010a2d6 bump csound 2022-12-13 22:28:16 +01:00
Felix Roos 61559fee9d Revert "Publish"
This reverts commit 2118a20408.
2022-12-13 22:24:12 +01:00
Felix Roos 2118a20408 Publish
- @strudel.cycles/core@0.5.0
 - @strudel.cycles/csound@0.4.0
 - @strudel.cycles/eval@0.5.0
 - @strudel.cycles/midi@0.5.0
 - @strudel.cycles/mini@0.5.0
 - @strudel.cycles/osc@0.4.0
 - @strudel.cycles/react@0.5.0
 - @strudel.cycles/serial@0.3.0
 - @strudel.cycles/soundfonts@0.5.0
 - @strudel.cycles/tonal@0.5.0
 - @strudel.cycles/tone@0.5.0
 - @strudel.cycles/transpiler@0.5.0
 - @strudel.cycles/webaudio@0.5.0
 - @strudel.cycles/webdirt@0.5.0
 - @strudel.cycles/xen@0.5.0
2022-12-13 22:22:27 +01:00
Felix Roos b0bc20cb83 hotfix: code format
- PR was issued before prettier check, now ci fails
2022-12-13 22:10:09 +01:00
Felix Roos 2cd77b075b Merge pull request #303 from gogins/main
Updated csoundm to use the register facility .
2022-12-13 22:07:27 +01:00
Felix Roos 03450c6085 Merge pull request #305 from tidalcycles/estlint-prettier-check
add lint + prettier check before test
2022-12-13 21:57:03 +01:00
Felix Roos 5d3c522da2 run prettier + lint separately (improves output) 2022-12-13 21:53:45 +01:00
Felix Roos bf1ba6efc0 code format 2022-12-13 21:32:03 +01:00
Felix Roos 67ad82d52e add lint + prettier check before test 2022-12-13 21:27:16 +01:00
Felix Roos f437d976f8 Merge pull request #301 from tidalcycles/support-freq-in-sampler
add freq support to sampler
2022-12-13 21:21:43 +01:00
gogins c94443faaa Updated csoundm to use . 2022-12-12 20:54:03 -05:00
Felix Roos c6d57f6a56 fix non note samples 2022-12-12 20:53:11 +01:00
Felix Roos 09b06da403 fix error message 2022-12-12 20:45:15 +01:00
Felix Roos df73ce8a60 add freq support to sampler 2022-12-12 20:41:09 +01:00
Felix Roos 8b22c2e04f Merge pull request #300 from tidalcycles/fix-trim
fix whitespace trimming
2022-12-12 00:48:41 +01:00
Felix Roos b4f4d6cea2 fix whitespace trimming 2022-12-12 00:45:47 +01:00
Felix Roos cdf7b2acf1 Merge branch 'main' of https://github.com/tidalcycles/strudel 2022-12-12 00:23:22 +01:00
Felix Roos 94651731a5 hotfix: uncomment essential line :) 2022-12-12 00:23:03 +01:00
Alex McLean 56424d29a3 .defragmentHaps() (#299) 2022-12-11 23:21:53 +00:00
Felix Roos c5083b2aef Merge pull request #298 from tidalcycles/dont-highlight-whitespace
remove whitespace from highlighted region
2022-12-11 23:17:48 +01:00
Felix Roos 1b06795ffe remove whitespace from highlighted region 2022-12-11 23:14:47 +01:00
Felix Roos 6679cd60ce scale now supports running on object values with n 2022-12-11 22:45:36 +01:00
Felix Roos 843a3c16ba Merge pull request #297 from tidalcycles/package-update
update vitest
2022-12-11 22:03:26 +01:00
Felix Roos df40204a57 update vitest 2022-12-11 21:58:58 +01:00
Felix Roos 210910eb6e hotfix: lastOf was undefined 2022-12-11 21:56:05 +01:00
Felix Roos ef427758da Merge pull request #287 from tidalcycles/numeral-union
can now add bare numbers to numeral object props
2022-12-11 21:44:16 +01:00
Felix Roos def6bbf683 add test 2022-12-11 21:43:05 +01:00
Felix Roos 5f37a4a21c Merge pull request #295 from tidalcycles/refactor-bootstrap
Move stuff to new register function
2022-12-11 21:27:58 +01:00
Felix Roos dc869987f9 Merge pull request #296 from tidalcycles/prettier-task
add prettier task
2022-12-11 20:07:12 +01:00
Felix Roos b98d2201e5 add prettier task 2022-12-11 19:37:36 +01:00
Felix Roos 8dd6440bb8 update snapshots 2022-12-11 13:46:22 +01:00
Felix Roos a2d83c48eb comment out pipe operator test 2022-12-11 13:28:54 +01:00
Felix Roos a0ae8f4a07 "fix" voice leading 2022-12-11 13:28:24 +01:00
Felix Roos 719dcbcd4d fix some tests 2022-12-11 12:06:00 +01:00
Felix Roos caa207e868 dont use random seedState for now 2022-12-11 11:55:14 +01:00
Felix Roos 306004ecd2 make mini "?" behave like .degradeBy + add comment 2022-12-11 00:13:30 +01:00
Felix Roos bcac3c5b84 fix typo 2022-12-11 00:08:13 +01:00
Felix Roos ccc90108df snapshots 2022-12-10 22:59:39 +01:00
Felix Roos b9781915a4 remove bootstrap + Pattern.patternify 2022-12-10 22:58:07 +01:00
Felix Roos 1890e65b75 refactor speak 2022-12-10 22:56:08 +01:00
Felix Roos 2f4da3ed52 refactor csound 2022-12-10 22:47:24 +01:00
Felix Roos 27a6ac0c0b refactor xen and tone packages 2022-12-10 22:39:51 +01:00
Felix Roos b81a66f07e refactor uses of voicings
+ fix usages of scaleTranspose
2022-12-10 21:47:58 +01:00
Felix Roos bc43fc9585 refactor tonal functions to 'register' 2022-12-10 21:34:38 +01:00
Felix Roos 4f7c013c78 refactor most signal functions 2022-12-10 21:03:36 +01:00
Felix Roos 09b15a07c6 use register for degradeBy / undegradeBy 2022-12-10 19:25:51 +01:00
Alex McLean 4340f024d3 Reorganise pattern.mjs with a 'toplevel first' regime (#286)
'toplevel first' regime
* loopAt has its optional cps parameter removed, with loopAtCps added for supporting that usage.
* rename bitlevel operations e.g. _and -> band

Co-authored-by: Felix Roos <flix91@gmail.com>
2022-12-10 14:39:03 +00:00
Alex McLean 98e9780819 Fancy hap show, include part in snapshots (#291)
* fix _mod import

* prettier hap show, use both whole and parts in snapshots, rebuild snapshots
2022-12-10 10:56:16 +00:00
Felix Roos a45d63595f delete bare value before numeral union 2022-12-09 11:00:28 +01:00
Felix Roos 5fbd1453b4 can now add bare numbers to numeral object props 2022-12-09 10:40:31 +01:00
Alex McLean f827201ee0 Switch 'operators' from .whatHow to .what.how, and make sure there are toplevel curried functions for all of them. Rename util.mod to util._mod, to make room for toplevel 'operator' of that name. (#285) 2022-12-07 19:07:55 +00:00
Felix Roos 485a96962a Merge pull request #281 from tidalcycles/arp
implement collect + arp function
2022-12-04 12:51:01 +01:00
Felix Roos 98a104f731 update snapshot 2022-12-04 11:58:19 +01:00
Felix Roos ff987f14d7 add arp example tune 2022-12-04 11:57:40 +01:00
Felix Roos 4dd08268dc implement collect + arp function 2022-12-04 11:38:11 +01:00
Felix Roos c18a13d4fc Merge pull request #278 from tidalcycles/do-not-recompile-orc
do not recompile orc
2022-12-02 13:38:27 +01:00
Felix Roos 7a79995727 do not recompile orc 2022-12-02 13:34:05 +01:00
Felix Roos 01eca562c5 Merge pull request #275 from tidalcycles/csound
add basic csound output
2022-12-02 12:49:26 +01:00
Felix Roos f491d0c0c4 fix loadOrc in tests 2022-12-02 12:22:32 +01:00
Felix Roos edf2287e13 Merge remote-tracking branch 'origin/main' into csound 2022-12-02 12:20:12 +01:00
Felix Roos fcaab633c1 Merge pull request #277 from tidalcycles/tune-licenses
add licenses / credits to all tunes + remove some
2022-12-02 12:18:41 +01:00
Felix Roos 33b6579b5d update snapshots 2022-12-02 12:17:15 +01:00
Felix Roos 72a8e4bc22 add licenses / credits to all tunes + remove some 2022-12-02 12:11:28 +01:00
Felix Roos c67b02b7b0 update tunes 2022-12-02 12:09:58 +01:00
Felix Roos 486cd00384 added loadOrc + removed livecode.orc by default 2022-12-02 12:09:21 +01:00
Alex McLean caea7bb39d Support sending CRC16 bytes with serial messages (#276)
Optionally add a crc16 checksum.
Optionally support sending names in name/value pairs as single characters
2022-12-02 10:45:01 +00:00
Felix Roos e8fb7ee683 now passing controls as string keymap 2022-12-02 11:38:47 +01:00
Felix Roos e4ee4211c8 delete strudel unrealted example 2022-12-01 15:10:22 +01:00
Felix Roos 3fa3ebee14 Merge remote-tracking branch 'origin/main' into csound 2022-12-01 15:05:23 +01:00
Felix Roos 8e531f400e allow defining csound on the window 2022-12-01 15:00:16 +01:00
Felix Roos 5727c0dc8a clean up tunes + also load presets.orc 2022-12-01 14:56:50 +01:00
Felix Roos f599088cdf cleanup 2022-12-01 14:44:53 +01:00
Felix Roos d78da55f54 lazy init + add livecode.org 2022-12-01 14:36:00 +01:00
Felix Roos 9052ff71e6 get rid of csound warning on reevaluation:
- only compile on init, use evalCode after
- pull presets into csd file
- use custom logging
2022-12-01 12:34:26 +01:00
Felix Roos 713da887ca Merge branch 'tonal-update' into csound 2022-12-01 12:32:05 +01:00
Felix Roos ad5950697e Merge pull request #273 from tidalcycles/fix-tutorial-bugs
release version bumps
2022-11-29 23:41:39 +01:00
Felix Roos 85d0d06cab Merge branch 'main' into fix-tutorial-bugs 2022-11-29 23:37:35 +01:00
Felix Roos be6ec558e3 Merge pull request #271 from tidalcycles/eslint
add eslint
2022-11-29 23:34:50 +01:00
Felix Roos dd2f60810a Merge pull request #272 from tidalcycles/tonal-update
tonal update with fixed memory leak
2022-11-29 23:34:26 +01:00
Felix Roos 6c0b86d8f4 update tonal, fixes #269 2022-11-29 23:31:23 +01:00
Felix Roos 517ada6dbf tiny time improvement 2022-11-29 23:02:09 +01:00
Felix Roos 0a098e3008 mock csound 2022-11-29 22:04:46 +01:00
Felix Roos c40078ffc9 improve csound bindings:
- better timing
- can now pass instrument to .csound(...)
- can now write instruments with csound(...)
2022-11-29 21:59:22 +01:00
Felix Roos 729e0afdbe fix typo 2022-11-29 00:10:21 +01:00
Felix Roos eab86840d3 baasic csound output 2022-11-29 00:05:51 +01:00
Felix Roos 43aa2247f1 baasic csound output 2022-11-29 00:05:36 +01:00
Felix Roos afe17a507e update tonal: not working... 2022-11-28 23:00:15 +01:00
Felix Roos e621020474 continue tutorial 2022-11-28 21:33:17 +01:00
Felix Roos ac2aa7f288 add csound minimal example 2022-11-28 20:48:52 +01:00
Felix Roos 805bd7e930 simplify without-audio example 2022-11-24 20:56:09 +01:00
Felix Roos f9bf2122b7 add without-audio example 2022-11-24 20:13:54 +01:00
Felix Roos 4e3e533e13 repl: optional eval callbacks 2022-11-24 20:13:04 +01:00
Felix Roos 611c429912 lint before test 2022-11-24 15:31:47 +01:00
Felix Roos e2898ee5bf add eslint + fix lint errors 2022-11-24 15:30:11 +01:00
Alex McLean e1a532500e Tidying up core (#256)
* remove _ prefixes except for functions to be patternified
* categorise pattern methods
* experimental support for `.add.squeeze` and friends as alternative to `.addSqueeze`
* `every` is now an alias for `firstOf` with additional `lastOf` (which every will become an alias for next)
2022-11-22 08:51:25 +00:00
Felix Roos 4cf412b93d Merge pull request #266 from tidalcycles/faster-fast
fix performance bottleneck
2022-11-21 22:15:48 +01:00
Felix Roos 54c9c434e0 fix examples snapshot 2022-11-21 22:09:26 +01:00
Felix Roos de19f3e5fe fix tune snapshots 2022-11-21 22:08:17 +01:00
Felix Roos 8304993481 fix: #194 2022-11-21 21:59:08 +01:00
Felix Roos 4c838aeaca hotfix: weird audion bug 2022-11-17 11:13:49 +01:00
Felix Roos 4ec1145dce Publish
- @strudel.cycles/core@0.4.1
 - @strudel.cycles/eval@0.4.1
 - @strudel.cycles/midi@0.4.1
 - @strudel.cycles/mini@0.4.1
 - @strudel.cycles/osc@0.3.1
 - @strudel.cycles/react@0.4.2
 - @strudel.cycles/soundfonts@0.4.2
 - @strudel.cycles/tonal@0.4.1
 - @strudel.cycles/tone@0.4.1
 - @strudel.cycles/transpiler@0.4.1
 - @strudel.cycles/webaudio@0.4.2
 - @strudel.cycles/webdirt@0.4.1
 - @strudel.cycles/xen@0.4.1
2022-11-17 11:09:54 +01:00
Felix Roos 547d925065 Merge pull request #263 from tidalcycles/fix-tutorial-bugs
fix tutorial bugs
2022-11-17 11:08:37 +01:00
Felix Roos 874633051b fix: snapshot 2022-11-17 10:56:46 +01:00
Felix Roos 2293f1ba15 fix: worklets now work in the tutorial again 2022-11-17 10:52:07 +01:00
Felix Roos 483c3f61b5 midi now works in the tutorial 2022-11-17 10:49:44 +01:00
Felix Roos 83263968f2 fix: rootNotes example 2022-11-17 10:41:32 +01:00
Felix Roos f279c61792 fix: each example 2022-11-17 10:19:04 +01:00
Felix Roos 9717c696d8 add s for sharp (fixes notes example) 2022-11-17 10:16:29 +01:00
Felix Roos 94a594c777 fix sample examples 2022-11-17 10:15:59 +01:00
Felix Roos f1ae8a17cf fix: could play multiple mini repl at once 2022-11-17 10:07:19 +01:00
Felix Roos add9c43827 Merge pull request #254 from tidalcycles/binaries
Binaries
2022-11-16 13:15:28 +01:00
Felix Roos d3f6a5c296 package-lock 2022-11-16 13:13:50 +01:00
Felix Roos 4aea78b7c0 Merge branch 'main' into binaries 2022-11-16 13:13:11 +01:00
Felix Roos 4313fe670d hotfix: fix share #261 2022-11-13 21:32:46 +01:00
Felix Roos 2e8a1b67ea hotfix: fix prebuild 2022-11-13 20:53:28 +01:00
Felix Roos e73044c533 Publish
- @strudel.cycles/react@0.4.1
 - @strudel.cycles/soundfonts@0.4.1
 - @strudel.cycles/webaudio@0.4.1
2022-11-13 20:48:52 +01:00
Felix Roos 418f09e364 hotfix: remove webaudio build for now 2022-11-13 20:48:32 +01:00
Felix Roos 08f207a396 package-lock 2022-11-13 20:44:05 +01:00
Felix Roos 4f57060708 Publish
- @strudel.cycles/core@0.4.0
 - @strudel.cycles/eval@0.4.0
 - @strudel.cycles/midi@0.4.0
 - @strudel.cycles/mini@0.4.0
 - @strudel.cycles/osc@0.3.0
 - @strudel.cycles/react@0.4.0
 - @strudel.cycles/serial@0.2.0
 - @strudel.cycles/soundfonts@0.4.0
 - @strudel.cycles/tonal@0.4.0
 - @strudel.cycles/tone@0.4.0
 - @strudel.cycles/transpiler@0.4.0
 - @strudel.cycles/webaudio@0.4.0
 - @strudel.cycles/webdirt@0.4.0
 - @strudel.cycles/xen@0.4.0
2022-11-13 20:43:00 +01:00
Felix Roos 1507724ecd hotfix: webaudio main file 2022-11-13 20:42:17 +01:00
Felix Roos 4bc2f64b24 Merge pull request #255 from tidalcycles/repl-refactoring
Repl refactoring
2022-11-13 20:20:32 +01:00
Felix Roos 839ba31dfb remove refactoring notes 2022-11-13 18:49:16 +01:00
Felix Roos 2341452d91 fix: highlighting error 2022-11-13 18:44:00 +01:00
Felix Roos 7ab263b514 floating error message 2022-11-13 17:11:14 +01:00
Felix Roos 45b5b5960f remove hideHeader function 2022-11-13 16:54:45 +01:00
Felix Roos 1b8ec1f01c secret zen mode 2022-11-13 15:47:11 +01:00
Felix Roos c92cb1c096 better draw cleanup + began reference tab 2022-11-13 14:50:48 +01:00
Felix Roos 8f31fbe275 proper draw cleanup 2022-11-13 13:58:36 +01:00
Felix Roos aa76419eda fix activeFooter state 2022-11-13 12:25:30 +01:00
Felix Roos 21503c0c38 separate header + footer components 2022-11-13 12:12:19 +01:00
Felix Roos d957b19f55 fix first highlights 2022-11-13 02:00:09 +01:00
Felix Roos 122c4242ce use new transpiler in test runtime 2022-11-13 01:43:54 +01:00
Felix Roos e769ed2fd8 move draw stuff from tone to core + fix getPhase 2022-11-13 01:42:00 +01:00
Felix Roos c722904831 prevent flicker 2022-11-13 00:30:48 +01:00
Felix Roos c93faa9564 show intro only when coming to root url 2022-11-13 00:30:18 +01:00
Felix Roos ce6495a46d unfriend intro readers 2022-11-12 23:38:02 +01:00
Felix Roos 04f2b905af basic intro tab 2022-11-12 21:28:07 +01:00
Felix Roos b668a2c0d2 refactor onTrigger 2022-11-12 20:17:57 +01:00
Felix Roos 5fc8f10602 basic samples tab 2022-11-12 20:17:01 +01:00
Felix Roos a27f399a9e tabbed footer 2022-11-12 17:50:10 +01:00
Felix Roos ff5d14fb63 can now have multiple triggers
+ Pattern.log now makes sense
2022-11-12 16:52:00 +01:00
Felix Roos 27fb2d2d5b remove onLog callbacks 2022-11-12 12:07:02 +01:00
Felix Roos 0b9d59bf0e logger works now outside of react
+ dynamic sample loading logs
+ remove old sampler code
2022-11-12 11:50:39 +01:00
Felix Roos 23e059a065 scheduler error handling + style 2022-11-11 23:35:46 +01:00
Felix Roos 45c7b29a96 big style update + new log system 2022-11-11 22:46:20 +01:00
Felix Roos 3e6c3fda60 update todos 2022-11-10 22:30:12 +01:00
Felix Roos 1a1363ef77 scheduler error handling 2022-11-10 22:25:58 +01:00
Felix Roos b5c51e231b lazy midi init + remove useWebMidi hook 2022-11-10 22:25:28 +01:00
Felix Roos 22711dd7be remove log 2022-11-10 22:05:08 +01:00
Felix Roos 1ba4d3d5d1 only connect via osc when .osc is called 2022-11-10 22:04:22 +01:00
Felix Roos 823ab73585 cleaner error when midi is unsupported 2022-11-10 22:04:02 +01:00
Felix Roos 66c444efac add sourcemaps 2022-11-10 22:03:34 +01:00
Felix Roos b688b8921a init audio on first click to remove warning 2022-11-10 22:03:23 +01:00
Felix Roos 00550ddab5 pass all params to onTrigger 2022-11-10 22:02:08 +01:00
Felix Roos 42fedec088 fix logger 2022-11-10 22:01:55 +01:00
Felix Roos ff3bc0e8c2 fix core log 2022-11-10 22:01:49 +01:00
Felix Roos dde7dff870 fix: hash urls 2022-11-10 21:11:25 +01:00
Felix Roos 25ffc9cf96 add logger 2022-11-10 21:10:33 +01:00
Felix Roos eca92cf5b5 fix: web midi 2022-11-10 18:12:38 +01:00
Felix Roos 372bdf8be7 fix: highlighting sync 2022-11-10 17:15:10 +01:00
Felix Roos c7c90b0647 fix mini repl + improve repl api 2022-11-10 16:36:51 +01:00
Felix Roos 14c2da4fa2 started refac repl to new scheduler + transpiler 2022-11-10 12:07:36 +01:00
Felix Roos 64275cfd22 revert server changes 2022-11-10 10:12:52 +01:00
Felix Roos f0b099d9f7 Merge remote-tracking branch 'origin/main' into binaries 2022-11-10 10:11:47 +01:00
Felix Roos c99d957bc8 Merge pull request #250 from tidalcycles/webaudio-build
Webaudio build
2022-11-08 23:35:10 +01:00
Felix Roos 51b14d55ec fix webaudio main file + add buildless repl 2022-11-08 23:29:27 +01:00
Felix Roos f92d9994df Publish
- @strudel.cycles/soundfonts@0.3.3
 - @strudel.cycles/webaudio@0.3.3
2022-11-08 23:17:43 +01:00
Felix Roos 431e1b87bd add webaudio cjs + esm build task 2022-11-08 23:16:24 +01:00
Felix Roos 3ec2fc6030 Publish
- @strudel.cycles/midi@0.3.3
 - @strudel.cycles/mini@0.3.3
 - @strudel.cycles/react@0.3.3
 - @strudel.cycles/tonal@0.3.3
 - @strudel.cycles/tone@0.3.3
2022-11-08 22:52:46 +01:00
Felix Roos 99f416bf6b hotfix: fix chord-voicings dependency 2022-11-08 22:51:28 +01:00
Felix Roos 89acc4870b Publish
- @strudel.cycles/core@0.3.2
 - @strudel.cycles/eval@0.3.2
 - @strudel.cycles/midi@0.3.2
 - @strudel.cycles/mini@0.3.2
 - @strudel.cycles/react@0.3.2
 - @strudel.cycles/soundfonts@0.3.2
 - @strudel.cycles/tonal@0.3.2
 - @strudel.cycles/tone@0.3.2
 - @strudel.cycles/transpiler@0.3.2
 - @strudel.cycles/webaudio@0.3.2
 - @strudel.cycles/webdirt@0.3.2
 - @strudel.cycles/xen@0.3.2
2022-11-08 22:45:44 +01:00
Felix Roos 314c739c3a Merge pull request #249 from tidalcycles/use-acorn
new transpiler based on acorn
2022-11-08 22:43:31 +01:00
Felix Roos 30b18fc997 add transpiler readme 2022-11-08 22:32:42 +01:00
Felix Roos 168ac60853 use tune that works without transpiler 2022-11-08 21:25:21 +01:00
Felix Roos dff0c0c3b0 vanilla-repl: use mini for all strings
+ skip transpiler
2022-11-08 21:17:00 +01:00
Felix Roos ea3e9de7ab feat: can now set a string parser for reify 2022-11-08 21:16:23 +01:00
Felix Roos c93fd900bc fix: tests 2022-11-08 21:04:41 +01:00
Felix Roos a761aa9a37 use new transpiler in nano-repl 2022-11-08 20:53:47 +01:00
Felix Roos f37eb92d93 support line,column,offset format 2022-11-08 20:53:26 +01:00
Felix Roos 2c7cc5d325 core evaluate now works without transpiler 2022-11-08 20:23:30 +01:00
Felix Roos 16659c82d2 test with old transpiler for now 2022-11-08 19:54:57 +01:00
Felix Roos 4ed3ca4128 use new transpiler in vite-vanilla-repl 2022-11-08 19:50:27 +01:00
Felix Roos 9b2899c8fb transpiler package to replace eval package 2022-11-06 23:15:01 +01:00
Felix Roos fada7fc9cc Publish
- @strudel.cycles/eval@0.3.1
 - @strudel.cycles/midi@0.3.1
 - @strudel.cycles/mini@0.3.1
 - @strudel.cycles/react@0.3.1
 - @strudel.cycles/soundfonts@0.3.1
 - @strudel.cycles/tonal@0.3.1
 - @strudel.cycles/tone@0.3.1
 - @strudel.cycles/webaudio@0.3.1
 - @strudel.cycles/webdirt@0.3.1
 - @strudel.cycles/xen@0.3.1
2022-11-06 19:53:24 +01:00
Felix Roos 2be5bca42b hotfix: core dependencies 2022-11-06 19:51:56 +01:00
Felix Roos b1ebf6367c Publish
- @strudel.cycles/core@0.3.1
 - @strudel.cycles/eval@0.3.0
 - @strudel.cycles/midi@0.3.0
 - @strudel.cycles/mini@0.3.0
 - @strudel.cycles/react@0.3.0
 - @strudel.cycles/soundfonts@0.3.0
 - @strudel.cycles/tonal@0.3.0
 - @strudel.cycles/tone@0.3.0
 - @strudel.cycles/webaudio@0.3.0
 - @strudel.cycles/webdirt@0.3.0
 - @strudel.cycles/xen@0.3.0
2022-11-06 19:39:30 +01:00
Felix Roos 57e373f578 hotfix: npmignore react examples 2022-11-06 19:39:05 +01:00
Felix Roos 5c01874a32 release: bump core 0.3.0 2022-11-06 19:37:49 +01:00
Felix Roos dd89e11633 hotfix: npm ignore examples folder 2022-11-06 19:36:01 +01:00
Felix Roos 4e51f19780 Publish
- @strudel.cycles/embed@0.2.0
 - @strudel.cycles/osc@0.2.0
2022-11-06 19:30:53 +01:00
Felix Roos 33d37d8dee Revert "Publish"
This reverts commit 60ce34af43.
2022-11-06 19:28:11 +01:00
Felix Roos 60ce34af43 Publish
- @strudel.cycles/core@0.3.0
 - @strudel.cycles/embed@0.2.0
 - @strudel.cycles/eval@0.3.0
 - @strudel.cycles/midi@0.3.0
 - @strudel.cycles/mini@0.3.0
 - @strudel.cycles/osc@0.2.0
 - @strudel.cycles/react@0.3.0
 - @strudel.cycles/soundfonts@0.3.0
 - @strudel.cycles/tonal@0.3.0
 - @strudel.cycles/tone@0.3.0
 - @strudel.cycles/webaudio@0.3.0
 - @strudel.cycles/webdirt@0.3.0
 - @strudel.cycles/xen@0.3.0
2022-11-06 19:12:57 +01:00
Felix Roos 2602ff6e34 hotfix: revert lerna upgrade 2022-11-06 19:10:09 +01:00
Felix Roos ef5cd36a37 Merge pull request #248 from tidalcycles/general-purpose-scheduler
General purpose scheduler
2022-11-06 19:03:19 +01:00
Felix Roos 7d47f5aba3 remove old clockworker + scheduler 2022-11-06 17:35:53 +01:00
Felix Roos 33cb506c71 add vanilla repl link to githack 2022-11-06 16:09:47 +01:00
Felix Roos 5fb36acb04 rebuild with correct base 2022-11-06 16:06:54 +01:00
Felix Roos 5f985f359b add vanilla repl build 2022-11-06 16:03:49 +01:00
Felix Roos 09045d5387 add vite vanilla js repl example 2022-11-06 15:50:53 +01:00
Felix Roos 371af755df move evaluate logic without transpiler to core
+ breaking change: evalScope is now imported from core
+ breaking change: deprecated extend is now removed
+ add repl.mjs
2022-11-06 12:12:43 +01:00
Felix Roos 0485632e22 Merge remote-tracking branch 'origin/main' into general-purpose-scheduler 2022-11-06 11:06:32 +01:00
Felix Roos c3d6de2412 Merge pull request #243 from tidalcycles/shared-tests
snapshot tests on shared snippets
2022-11-06 11:05:23 +01:00
Felix Roos 36d49b11d9 Merge pull request #247 from tidalcycles/some-tunes
added some tunes
2022-11-06 11:03:41 +01:00
Felix Roos 866277510e fix: samples function did not work in tests 2022-11-06 00:44:23 +01:00
Felix Roos da8e00eb4e Merge remote-tracking branch 'origin/main' into some-tunes 2022-11-06 00:38:05 +01:00
Felix Roos cd30b2af3f Merge pull request #246 from tidalcycles/readme-tlc
patchday
2022-11-06 00:37:11 +01:00
Felix Roos 38b3337d35 add amensister 2022-11-06 00:31:59 +01:00
Felix Roos 84d34aa12b update shift packages 2022-11-05 12:09:00 +01:00
Felix Roos 96b7b68900 add scheduled example 2022-11-05 11:34:15 +01:00
Felix Roos 2a6ffbf5a4 update lerna 2022-11-05 11:33:59 +01:00
Felix Roos 1ac99e260b update plugin-react + osc-js 2022-11-05 11:20:53 +01:00
Felix Roos 519062c8d0 update tailwind 2022-11-04 23:03:54 +01:00
Felix Roos 78d7cdf662 update more things 2022-11-04 21:05:24 +01:00
Felix Roos a191b1e811 update vite in repl 2022-11-04 21:01:04 +01:00
Felix Roos b372161874 update vite in react package 2022-11-04 20:58:36 +01:00
Felix Roos 5bbec7b17c package-lock 2022-11-04 20:46:06 +01:00
Felix Roos 54b847a8ef update tailwind + react 2022-11-04 20:45:45 +01:00
Felix Roos a40a0f730f update codemirror 2022-11-04 20:43:16 +01:00
Felix Roos a677b94297 update webmidi + remove tone piano 2022-11-04 20:36:33 +01:00
Felix Roos d102528d0a Merge pull request #244 from tidalcycles/readme-tlc
Readme + TLC
2022-11-04 20:28:22 +01:00
Felix Roos 854692f975 use only node 18 to save some energy 2022-11-04 20:25:31 +01:00
Felix Roos bdc321df4d update browserslist 2022-11-04 20:24:42 +01:00
Felix Roos 230e8e9d4d revert auto formatted snippet 2022-11-04 20:21:08 +01:00
Felix Roos 96c49689ec improve readmes 2022-11-04 20:15:46 +01:00
Felix Roos 698f560d56 export controls from core root 2022-11-04 20:15:36 +01:00
Felix Roos 67ee493e56 remove cross import + code format 2022-11-04 20:15:11 +01:00
Felix Roos 4fc7ef698a code format 2022-11-04 20:14:57 +01:00
Felix Roos 89434fc3bd replace old snippet 2022-11-04 20:14:47 +01:00
Felix Roos 6129f9afe8 fix: mini repl test tune 2022-11-04 20:13:25 +01:00
Felix Roos e5f38dbbc6 dbdump script 2022-11-04 17:30:19 +01:00
Felix Roos 5534db95bc exclude shared test for now 2022-11-03 19:01:23 +01:00
Felix Roos 37c45424fd all shared tests now pass 2022-11-03 18:57:27 +01:00
Felix Roos ed44f4ed0c add shared tunes test 2022-11-03 16:18:29 +01:00
Felix Roos f829f35cfa Merge pull request #242 from tidalcycles/example-tests
in source example tests
2022-11-03 15:16:03 +01:00
Felix Roos 3033acadbb remove log 2022-11-03 14:57:46 +01:00
Felix Roos 5c2a8a68c0 render doc.json before testing 2022-11-03 14:52:24 +01:00
Felix Roos e9544f8f92 test all in source examples 2022-11-03 14:47:27 +01:00
Felix Roos 1a6743dba9 hotfix: #241 2022-11-03 12:52:01 +01:00
Felix Roos 06d6621c14 Merge pull request #240 from tidalcycles/load-samples-from-url
feat: support github: links
2022-11-02 23:16:43 +01:00
Felix Roos d7b82edae3 feat: support github: links 2022-11-02 23:13:00 +01:00
Felix Roos 5eae156134 Merge pull request #239 from tidalcycles/load-samples-from-url
Load samples from url
2022-11-02 21:26:44 +01:00
Felix Roos d8843e6057 refactor prebake 2022-11-02 21:07:47 +01:00
Felix Roos cf7c734778 feat: can now load samples via url 2022-11-02 12:29:34 +01:00
Felix Roos 240a8930ef Merge pull request #238 from tidalcycles/object-arithmetic
Object arithmetic
2022-11-02 11:42:32 +01:00
Felix Roos 4f3046593a fix: test 2022-11-01 21:54:25 +01:00
Felix Roos a0bd5bdd35 simplify asNumber 2022-11-01 21:45:40 +01:00
Felix Roos e3bc63e4fa fix: osc notes 2022-11-01 21:45:25 +01:00
Felix Roos fbf7c6293f get rid of asNumber on arithmetic functions 2022-11-01 21:38:16 +01:00
Felix Roos e128b02da1 support object arithmetic 2022-11-01 21:31:39 +01:00
Felix Roos 2168dbc6fc flat rave 2022-11-01 17:09:18 +01:00
Felix Roos 97db895354 use new bank function 2022-11-01 00:38:38 +01:00
Felix Roos 48fc68bfdb Merge remote-tracking branch 'origin/tidal-drum-machines' into some-tunes 2022-11-01 00:36:53 +01:00
Felix Roos 3741ffbb59 Merge pull request #237 from tidalcycles/tidal-drum-machines
Tidal drum machines
2022-11-01 00:36:14 +01:00
Felix Roos caf58492f2 move sample data to json files 2022-10-31 23:58:12 +01:00
Felix Roos 0c5bdd0205 make bank a normal param 2022-10-31 23:30:50 +01:00
Felix Roos ae6da0d6ef Merge pull request #236 from tidalcycles/fix-mono
fx on stereo speakers
2022-10-31 21:39:23 +01:00
Felix Roos bdbb4cb495 add all drum machines + soundbank helper 2022-10-31 20:55:23 +01:00
Felix Roos 566c358e8d drum demo 2022-10-31 20:35:34 +01:00
Felix Roos 324cffe6df 808 + 909 2022-10-31 20:34:47 +01:00
Felix Roos dadb8119e8 fix: reverb mono 2022-10-31 20:34:07 +01:00
Felix Roos 335d54b5f4 fix: multichannel worklets 2022-10-31 20:33:42 +01:00
Felix Roos 0fd851999f little fluty tune 2022-10-30 20:38:12 +01:00
Felix Roos 50f88798d8 Merge remote-tracking branch 'origin/main' into some-tunes 2022-10-30 19:36:16 +01:00
Felix Roos 8033cfc49d add sample demo tune 2022-10-30 19:36:06 +01:00
Felix Roos 882f450ee8 Merge pull request #235 from tidalcycles/vcsl-samples
add vcsl sample library
2022-10-30 19:10:32 +01:00
Felix Roos 4d60a582fe note default to 36 2022-10-30 18:49:26 +01:00
Felix Roos 7ef3d33d0e add vcsl sample library 2022-10-30 15:52:51 +01:00
Alex McLean 24328ee8ae Fix zero length queries WIP (#234)
* failing tests for zero-width queries

* support zero width timespans in splitArcs. Fixes one test, breaks a load more..

* fix fastGap
2022-10-29 23:23:10 +01:00
Felix Roos d45c380389 add two tunes 2022-10-29 22:19:11 +02:00
Felix Roos fbb3d144a1 hotfix: missing note calls in some tunes 2022-10-29 18:07:46 +02:00
Felix Roos 7e7e299bce Merge remote-tracking branch 'origin/main' into general-purpose-scheduler 2022-10-29 17:56:30 +02:00
Felix Roos d18116fcbe Merge pull request #232 from tidalcycles/out-by-default
Out by default
2022-10-29 17:54:05 +02:00
Felix Roos e38513f077 more fixes 2022-10-29 17:51:46 +02:00
Felix Roos 08c4c641ec add note calls everywhere 2022-10-29 17:38:54 +02:00
Felix Roos 5d7e46b246 started removing primitive haps from tutorial 2022-10-29 14:58:50 +02:00
Felix Roos dac906a79d fix sample name 2022-10-27 21:20:09 +02:00
Felix Roos ecfeac4d63 clearer error 2022-10-27 21:20:01 +02:00
Felix Roos db1fc399a1 add baseDir to prebake + obj params 2022-10-27 21:19:50 +02:00
Felix Roos 60616a5228 remove old defaultSynth 2022-10-27 21:19:17 +02:00
Felix Roos 699c8d5b60 different default adsr for synths and samples 2022-10-27 20:55:12 +02:00
Felix Roos 4264f013af remove webdirt + tone from tutorial
+ do not load webdirt in repl
2022-10-27 20:51:14 +02:00
Felix Roos ecc4e1803c remove all occurrences of .out() 2022-10-27 19:47:07 +02:00
Felix Roos 5c230c2d65 use webaudio output by default 2022-10-27 19:40:00 +02:00
Felix Roos 6af681354b support primitive notes + tame default gain 2022-10-27 19:39:33 +02:00
Alex McLean 5f381cf153 Patternify range (#231)
* patternify range

* patternify range

* fix test
2022-10-26 22:53:49 +01:00
Felix Roos 2ed290a214 Merge pull request #228 from tidalcycles/just-another-docs-branch
Just another docs branch
2022-10-26 21:42:12 +02:00
Felix Roos cf11472348 Merge pull request #230 from tidalcycles/reafactor-tunes
Refactor tunes away from tone
2022-10-26 21:41:12 +02:00
Felix Roos 2c14514c56 update snapshot 2022-10-26 21:37:41 +02:00
Felix Roos 053e6d8325 refactor remaining usages of tone 2022-10-26 21:30:27 +02:00
Felix Roos 603c55fda7 doc: in source value modifiers 2022-10-26 20:29:12 +02:00
MysteryHouse 113adcc5cc Core util tests (#226)
* Error message formatting, deprecate unused functions
* Add 'test-coverage' script
* Additional test coverage for core util module
* Additional tests for core util module

by @mystery-house
2022-10-20 08:26:28 +01:00
Alex McLean a5bf8f6732 fix fastgap for events that go across cycle boundaries (#225) 2022-10-06 21:35:45 +01:00
Felix Roos c4b482634f doc: begin end 2022-09-25 23:35:30 +02:00
Felix Roos 4b083d6f81 add reverb link 2022-09-25 23:23:37 +02:00
Felix Roos 04973d153b doc: legato gain velocity 2022-09-25 22:39:16 +02:00
Felix Roos 69ce7c78a4 doc: euclid + euclidLegato 2022-09-25 22:09:39 +02:00
Felix Roos b64cf197f2 doc: improve chop + loopAt examples 2022-09-25 21:57:56 +02:00
Felix Roos a8b0279853 Merge remote-tracking branch 'origin/main' into reafactor-tunes 2022-09-25 21:18:03 +02:00
Felix Roos e715e2ba2f Merge remote-tracking branch 'origin/main' into general-purpose-scheduler 2022-09-25 21:16:37 +02:00
Felix Roos 985de36647 Merge remote-tracking branch 'origin/main' into just-another-docs-branch 2022-09-25 21:16:05 +02:00
Felix Roos b7b576e38b Merge pull request #224 from tidalcycles/reverb
Reverb
2022-09-25 21:15:36 +02:00
Felix Roos 5018669ded roomsize 2022-09-25 20:08:02 +02:00
Felix Roos c5342d3eb0 snaps 2022-09-25 16:40:50 +02:00
Felix Roos 0e7a0b5754 more tunes 2022-09-25 16:37:10 +02:00
Felix Roos 933ef02df0 really simple reverb 2022-09-25 16:36:59 +02:00
Alex McLean 513e0d748d focus tweak for squeezeJoin - another go at fixing #216 (#221)
Fixes squeezeJoin, and in the process struct/keepif. fixes #216

Co-authored-by: Felix Roos <flix91@gmail.com>
2022-09-24 23:27:25 +01:00
Felix Roos 852f01fddd Merge pull request #222 from tidalcycles/negative-speed
support negative speeds
2022-09-24 23:17:21 +02:00
Felix Roos 9ebada63e9 support negative speeds 2022-09-24 23:14:43 +02:00
Felix Roos dbda70eee9 Merge pull request #213 from tidalcycles/feedbackdelay
Feedback Delay
2022-09-24 21:55:14 +02:00
Felix Roos 18bd10dfed clean up getDelay args 2022-09-24 21:51:55 +02:00
Felix Roos f76d03a0dc delay as global send via orbit 2022-09-24 21:45:23 +02:00
Alex McLean 86ba5c9c1a Merge pull request #220 from tidalcycles/fix-squeezeJoin
Fix squeeze join
2022-09-23 11:06:16 +01:00
alex 5b56fbed97 adjust use of focus in squeezeJoin - fixes #216 2022-09-23 08:00:53 +01:00
alex dfdd918ea0 attempt at fixing #216 2022-09-22 22:52:02 +01:00
Felix Roos df2c7ec1a1 doc: chop + loopAt 2022-09-22 23:20:15 +02:00
Felix Roos 0d179f2042 tutorial is now dark 2022-09-22 23:20:03 +02:00
Felix Roos 63c6a9735c Merge branch 'main' into general-purpose-scheduler 2022-09-22 21:25:44 +02:00
Felix Roos f7e3f7d187 Merge branch 'main' into feedbackdelay 2022-09-22 21:25:12 +02:00
Felix Roos cc54da5980 Merge pull request #219 from tidalcycles/webaudio-output
encapsulate webaudio output
2022-09-22 21:23:11 +02:00
Felix Roos ca82796081 getDestination collides with tone
-> do not export for now (not needed)
-> can be refactored when tone is removed
-> also prevent loading worklets in node
2022-09-22 21:19:44 +02:00
Felix Roos d092068bd2 migrate to encapsulated out 2022-09-22 20:24:59 +02:00
Felix Roos 0c1529237c Merge commit '6dbb2cb98a41edc6ad6b3458a6f7067044cb66cd' into general-purpose-scheduler 2022-09-22 19:54:58 +02:00
Felix Roos 6dbb2cb98a encapsulate out
+ encapsulate destination
+ error handling
to simplify merge scheduler branch
2022-09-22 19:50:07 +02:00
Felix Roos ead763b909 Merge remote-tracking branch 'origin/main' into reafactor-tunes 2022-09-22 19:24:28 +02:00
Felix Roos 415139851e Merge remote-tracking branch 'origin/HEAD' into just-another-docs-branch 2022-09-22 19:22:35 +02:00
Felix Roos 5c99b72e2f Merge remote-tracking branch 'origin/HEAD' into feedbackdelay 2022-09-22 19:22:08 +02:00
Felix Roos 82cb6c93cf Merge pull request #218 from tidalcycles/webdirt-feature-parity
samples now have envelopes
2022-09-22 19:18:18 +02:00
Felix Roos d21734ccf2 update snapshots 2022-09-22 19:15:53 +02:00
Felix Roos 91934006d5 adjust default envelope 2022-09-22 19:09:38 +02:00
Felix Roos 014c258c57 sample adsr support 2022-09-22 15:33:06 +02:00
Felix Roos 5e76bc3f2f Merge pull request #217 from tidalcycles/webdirt-feature-parity
sampler features + fixes
2022-09-22 00:03:30 +02:00
Felix Roos 7f6940f3a5 cut precision 2022-09-21 22:47:16 +02:00
Felix Roos 8d5682deb0 cut + loop 2022-09-21 22:44:56 +02:00
Felix Roos 819abbfa7a fix sample slicing + unit + nudge 2022-09-21 22:25:35 +02:00
Felix Roos 227ad332b8 add missing params to echo 2022-09-19 23:42:04 +02:00
Felix Roos 17c83e1a85 Merge pull request #215 from tidalcycles/just-another-docs-branch
Just another docs PR
2022-09-19 23:32:55 +02:00
Felix Roos 5d699496ca doc: chunk + chunkBack 2022-09-19 23:30:37 +02:00
Felix Roos e4f4fe81ae doc: iterBack 2022-09-19 23:21:55 +02:00
Felix Roos abe28367fb doc: iter 2022-09-19 23:19:39 +02:00
Felix Roos cc394d9f74 doc: echo + echoWith 2022-09-19 23:13:36 +02:00
Felix Roos 476b51ee31 fix deployment permissions 2022-09-19 22:40:04 +02:00
Felix Roos ec823ade14 do everything in one step 2022-09-19 22:35:56 +02:00
Felix Roos 0c3777f7d7 wait for build before deploy 2022-09-19 22:31:41 +02:00
Felix Roos a679e47c0d fix workflow 2022-09-19 22:27:56 +02:00
Felix Roos 1e82735241 rename deploy workflow 2022-09-19 22:26:34 +02:00
Felix Roos a09ec6b0b5 deployment: next try 2022-09-19 22:22:11 +02:00
Felix Roos 0134a50ffa add update button 2022-09-19 22:09:23 +02:00
Felix Roos 1da005e811 deploy after build 2022-09-19 21:58:12 +02:00
Felix Roos 8ab912429b build: npm i inside tutorial 2022-09-19 21:54:34 +02:00
Felix Roos 88d12223a5 build: add npm i in repl folder 2022-09-19 21:52:31 +02:00
Felix Roos 6c363d9c4b add rollup-plugin-visualizer in root pkg 2022-09-19 21:50:38 +02:00
Felix Roos 6d3d9659e2 try build workflow 2022-09-19 21:48:47 +02:00
Felix Roos 8977c5cef4 revert exponential adsr 2022-09-18 22:55:33 +02:00
Felix Roos d3645f6c63 fix tests 2022-09-18 22:42:30 +02:00
Felix Roos dbb057621d refactor caverave + throw out some tunes 2022-09-18 22:40:19 +02:00
Felix Roos 3a65bc0650 improve adsr 2022-09-18 22:39:40 +02:00
Felix Roos 1eb6ff8c17 add feedback delay effect 2022-09-18 21:17:16 +02:00
Felix Roos 505cc01a18 remove empty heading 2022-09-17 23:59:16 +02:00
Felix Roos fdc4bb455f fix: formatting 2022-09-17 23:54:28 +02:00
Felix Roos c1a27aa6e4 Merge pull request #212 from tidalcycles/even-more-docs
Even more docs
2022-09-17 23:47:43 +02:00
Felix Roos a14c7233d4 fix: tests 2022-09-17 23:40:56 +02:00
Felix Roos c786d77b07 make polyrhythm alias of stack #211 2022-09-17 23:38:42 +02:00
Felix Roos e4913dfb73 mark tone + webdirt deprecated
+ add superdirt param list
2022-09-17 23:35:35 +02:00
Felix Roos dfd33bab8e dedupe accumulation modifiers 2022-09-17 23:16:13 +02:00
Felix Roos 19b8f073b1 dedupe most of core api doc 2022-09-17 22:46:30 +02:00
Felix Roos b38b16f70e doc: early, late, each, every, rev + doc structure 2022-09-17 21:45:39 +02:00
Felix Roos dd69e4caff doc: rand irand perlin 2022-09-17 21:03:58 +02:00
Felix Roos 762a17d949 fix: remove TLA 2022-09-17 15:42:34 +02:00
Felix Roos d90cb23f22 Merge pull request #207 from tidalcycles/webaudio-guide
Webaudio guide
2022-09-17 15:36:53 +02:00
Felix Roos 1ccc391c8e proper disconnect onend 2022-09-17 15:32:36 +02:00
Felix Roos cafcead62e doc: web audio effects 2022-09-17 15:18:57 +02:00
Felix Roos 71ca46b21b remove headings for generated doc 2022-09-17 15:18:38 +02:00
Felix Roos acf339ad13 load worklets on startup 2022-09-17 15:18:16 +02:00
Felix Roos de4726ec8d improve sampler section 2022-09-16 23:59:46 +02:00
Felix Roos e58aff41f9 begin webaudio tutorial 2022-09-16 23:25:42 +02:00
Felix Roos 3c8acf9e0e comment out timeout:
it will cut of samples that are longer than hap..
2022-09-16 23:25:33 +02:00
Felix Roos 782e8522c5 add all default samples to mini repl 2022-09-16 23:24:47 +02:00
Felix Roos dd4464cb08 fix build: dont add sourcemaps 2022-09-16 11:05:38 +02:00
Felix Roos 3fdfd12448 hotfix: disconnect chain after use 2022-09-16 00:53:43 +02:00
Felix Roos a11d23ba62 hotfix: out should not be async 2022-09-16 00:30:37 +02:00
Felix Roos 6bab362171 Merge pull request #205 from tidalcycles/coarse-crush-shape
Coarse crush shape
2022-09-16 00:21:28 +02:00
Felix Roos 5d28c5c825 add license info 2022-09-16 00:17:42 +02:00
Felix Roos b9173ebe50 add coarse, crush and shape 2022-09-16 00:14:28 +02:00
Felix Roos 0a1577ff43 refactor kalimba 2022-09-15 21:17:39 +02:00
Felix Roos a616d6fd3e Merge pull request #201 from tidalcycles/vowel
add vowel to .out
2022-09-15 21:04:28 +02:00
Felix Roos 149b2ab9f9 make vowel work with node 2022-09-15 20:11:10 +02:00
Felix Roos 4406dd88d1 add vowel 2022-09-15 20:09:07 +02:00
Felix Roos 48a950faf8 Merge pull request #200 from tidalcycles/build-analyze
add rollup-plugin-visualizer to build
2022-09-15 16:55:52 +02:00
Felix Roos 0ffbb5cb2c ignore stats 2022-09-15 16:54:27 +02:00
Felix Roos f4c31bcf2c Merge pull request #199 from tidalcycles/docs-update
document random functions
2022-09-14 23:46:39 +02:00
Felix Roos f0e412a443 doc: chooseCycles + mini shorthands 2022-09-14 23:40:48 +02:00
Felix Roos ce91d36b7a doc: random functions 2022-09-14 23:16:24 +02:00
Felix Roos a022e5bb93 add missing external deps to react pkg 2022-09-14 21:55:09 +02:00
Felix Roos 8e61673bd6 doc: degradeBy 2022-09-14 21:54:42 +02:00
Felix Roos 88e39d22f1 add drums to mini repl 2022-09-14 21:53:41 +02:00
Felix Roos 1441374f6e Create README.md 2022-09-13 22:45:03 +02:00
Felix Roos d1cedaa3e8 add dependencies graphic
npx depcruise --include-only "^packages" -X "node_modules" --output-type dot packages | dot -T svg > dependencies.svg
2022-09-13 22:40:52 +02:00
Felix Roos 5b721f6453 package-lock 2022-09-10 23:32:33 +02:00
Felix Roos a5f05b4715 hotfix: regression of #196
- samples loaded as arrays would not be repitched
2022-09-10 23:19:23 +02:00
Felix Roos 96f49f117a add build analyzer 2022-09-10 23:04:21 +02:00
Felix Roos 88e1211762 Merge pull request #196 from tidalcycles/fix-numbers-in-sampler
Fix numbers in sampler
2022-09-09 22:04:40 +02:00
Felix Roos 59e1664223 pull in midi logic 2022-09-09 22:02:24 +02:00
Felix Roos 42922a0d75 fix: support numbers in piano / sampler 2022-09-09 21:56:07 +02:00
Felix Roos 4f8a2a0900 another round of scheduling 2022-08-26 23:58:39 +02:00
Felix Roos 9a2a26e904 add a little dot 2022-08-23 21:56:38 +02:00
Felix Roos 067c3433b6 add nano-repl build 2022-08-23 21:55:06 +02:00
Felix Roos d0b07c4890 fix latency issues for larger intervals 2022-08-23 21:52:24 +02:00
Felix Roos 24f8f48a2f nano repl now supports highlighting 2022-08-23 21:24:25 +02:00
Felix Roos acafcc9888 build react pkg 2022-08-23 21:23:44 +02:00
Felix Roos ec4cfe6f86 use new getTime callback in repl + mini repl 2022-08-23 21:23:28 +02:00
Felix Roos 7b0c80c8be getTime callback for highlighting time 2022-08-23 21:23:01 +02:00
Felix Roos 29029714ee expose pattern form useStrudel 2022-08-23 21:22:28 +02:00
Felix Roos cd1203d1e2 fix pause + remove logs 2022-08-23 20:56:09 +02:00
Felix Roos 4dfc34515c fix nano-repl prod build 2022-08-23 18:23:36 +02:00
Felix Roos 11a9f3ced3 no top level await + no evaluate on mount 2022-08-23 18:04:35 +02:00
Felix Roos 5be1a7000c cleanup 2022-08-23 17:56:01 +02:00
Felix Roos 9059c1b850 scheduler is now finally tight 2022-08-23 17:55:10 +02:00
Felix Roos ec60fe42be fix scheduler again.. add comments 2022-08-23 11:30:00 +02:00
Felix Roos 275931969e scheduler error correction failed attempt 2022-08-22 22:15:32 +02:00
Felix Roos e37e0f189a build react package 2022-08-21 11:22:30 +02:00
Felix Roos 8103943396 wait for ctx.resume 2022-08-21 11:21:36 +02:00
Felix Roos 9497c99e9e merge evaluator and scheduler hooks + use getTime 2022-08-21 11:21:19 +02:00
Felix Roos 2172d1a767 scheduler error correction via getTime 2022-08-21 11:20:15 +02:00
Felix Roos e72c47869a comment out stuff that uses tone.js 2022-08-18 20:50:20 +02:00
Felix Roos 5ea2124e91 webaudio error handling 2022-08-18 20:46:42 +02:00
Felix Roos 0c08919bfa add codemirror + keyboard shortcuts 2022-08-18 16:16:23 +02:00
Felix Roos a7562c3803 add useKeydown helper 2022-08-18 16:15:44 +02:00
Felix Roos 5f4d8f6862 add tailwind 2022-08-18 16:15:23 +02:00
Felix Roos 9c7d0951b7 pause action + started flag 2022-08-18 16:13:50 +02:00
Felix Roos 75e57c75cf add master gain + panic 2022-08-18 16:13:27 +02:00
Felix Roos 04502b05d4 better default tune + fix dirty state 2022-08-18 15:16:29 +02:00
Felix Roos e3e3a8404a nano-repl add modules + proper eval 2022-08-18 00:27:16 +02:00
Felix Roos 48bf17614f fix: runtime error reify undefined 2022-08-18 00:26:57 +02:00
Felix Roos 1941b1ff65 add react nano-repl example 2022-08-17 23:59:40 +02:00
Felix Roos 46aa3d275a package-lock 2022-08-17 23:58:47 +02:00
Felix Roos d667e790b9 export new hooks 2022-08-17 23:58:34 +02:00
Felix Roos bc345b569b add hooks for scheduler and evaluator 2022-08-17 23:57:49 +02:00
Felix Roos ee84b4e013 export webaudio out as separate function 2022-08-17 23:56:36 +02:00
Felix Roos e77129fa51 scheduler error callback 2022-08-17 23:55:06 +02:00
Felix Roos 591855919e working default tune 2022-08-17 21:29:57 +02:00
Felix Roos 7af6188a8a move scheduler to core + move audioctx to userland 2022-08-17 21:26:00 +02:00
Felix Roos 1cd31cfce9 fix getFrequency for .note 2022-08-17 21:25:04 +02:00
Felix Roos 227dda921c bump to 0.0.4 2022-08-14 18:06:50 +02:00
Felix Roos bdf2047ea1 add npte for new packages 2022-08-14 18:05:08 +02:00
Felix Roos 0522996b7f bump soundfont package for rerelease 2022-08-14 18:02:06 +02:00
Felix Roos e9e25ef8d8 Publish
- @strudel.cycles/core@0.2.0
 - @strudel.cycles/eval@0.2.0
 - @strudel.cycles/midi@0.2.0
 - @strudel.cycles/mini@0.2.0
 - @strudel.cycles/react@0.2.0
 - @strudel.cycles/soundfonts@0.2.0
 - @strudel.cycles/tonal@0.2.0
 - @strudel.cycles/tone@0.2.0
 - @strudel.cycles/webaudio@0.2.0
 - @strudel.cycles/webdirt@0.2.0
 - @strudel.cycles/xen@0.2.0
2022-08-14 17:56:28 +02:00
Felix Roos a08325c975 add soundfont2 dependency 2022-08-14 17:51:07 +02:00
Felix Roos 4d8adde9d5 Merge pull request #185 from bpow/mini-notation-random-offsets
change "stride"/"offset" of successive degradeBy/chooseIn
2022-08-14 17:40:41 +02:00
Felix Roos f2b2f4f226 Merge pull request #183 from tidalcycles/soundfont-file-support
Soundfont file support
2022-08-14 16:04:14 +02:00
Felix Roos 40bbc57269 Merge pull request #190 from tidalcycles/fix-legacy-frequency
fix regression: old way of setting frequencies was broken
2022-08-14 15:55:50 +02:00
Felix Roos 48526824d6 support old way of setting frequencies 2022-08-14 15:51:01 +02:00
Felix Roos 745c37f2d1 Merge pull request #189 from tidalcycles/fix-188
wait for prebake to finish before evaluating
2022-08-14 15:45:53 +02:00
Felix Roos 0e185b7335 wait for prebake to finish before evaluating 2022-08-14 15:43:17 +02:00
Felix Roos 596ae696f9 Merge branch 'main' into soundfont-file-support 2022-08-14 14:53:53 +02:00
Felix Roos b5e2bdf0f9 Merge pull request #186 from tidalcycles/fix-codemirror-bug
Fix codemirror bug
2022-08-14 11:30:59 +02:00
Felix Roos 4e09cc14b6 fix #178 2022-08-14 11:27:13 +02:00
Bradford Powell 58dc46b445 change "stride"/"offset" of successive degradeBy/chooseIn
This avoids (without fixing) #184).

Note that the offset in tidal is currently 0.0001, but using this
would result in excess correlation between sequential uses of
random, which would manifest in failure of the 'supports the randome
choice operator with nesting' test. So I just used 0.0002 instead
2022-08-13 21:55:17 -04:00
Felix Roos f34d0a29e8 memo all things codemirror 2022-08-13 18:39:38 +02:00
Felix Roos 365a90e72e Merge remote-tracking branch 'origin/main' into soundfont-file-support 2022-08-13 16:31:50 +02:00
Felix Roos 72f4d3efa8 Merge pull request #181 from tidalcycles/optimize-scheduler
scheduler improvements
2022-08-13 16:29:53 +02:00
Felix Roos 98f4d4de8b remove cps-sketch build 2022-08-13 16:28:31 +02:00
Felix Roos 57f84748ec Merge remote-tracking branch 'origin/HEAD' into optimize-scheduler 2022-08-13 16:26:39 +02:00
Felix Roos 4fb57d2818 Merge pull request #175 from tidalcycles/vitest
replace mocha with vitest
2022-08-12 23:10:35 +02:00
Felix Roos aff819069f relative script src 2022-08-12 22:32:37 +02:00
Felix Roos af585588af rebuild example for cps control 2022-08-12 22:30:32 +02:00
Felix Roos eaf6617a43 allow changing cps from a hap 2022-08-12 22:28:19 +02:00
Felix Roos 4b294c4aff build example 2022-08-12 22:03:35 +02:00
Felix Roos c2354bffa2 use phase to allow smooth tempo changes 2022-08-12 22:01:09 +02:00
Felix Roos ea1ffca4ae remove lastEnd 2022-08-12 01:27:01 +02:00
Felix Roos 86a68d78c1 test build 2022-08-12 00:57:36 +02:00
Felix Roos 2e4a3516c8 example: import from modules 2022-08-12 00:53:40 +02:00
Felix Roos e71fec0e95 change theme 2022-08-11 23:15:27 +02:00
Felix Roos 9478915cf4 work on scheduler:
- simplify clockworker (no audioContext)
- tick based scheduler with cps
- support cps in .out
2022-08-11 22:58:37 +02:00
Felix Roos f955d77d71 use vitest snapshot feature for tunes 2022-08-10 00:17:58 +02:00
Felix Roos c1255bfa88 vitest config via file 2022-08-10 00:17:29 +02:00
Felix Roos 9aaeee2026 disable isolate 2022-08-09 23:49:15 +02:00
Felix Roos 27b3a4083b try with isolate + add task for ui 2022-08-09 23:45:33 +02:00
Felix Roos 2f1d963126 dont use beforeAll 2022-08-09 23:45:19 +02:00
Felix Roos 235e82a348 make tests a little bit faster 2022-08-09 23:28:36 +02:00
Felix Roos 17d0b7d291 bump vitest + remove mocha 2022-08-09 23:09:02 +02:00
Felix Roos 22c60fb894 move tunes test to vitest 2022-08-09 23:08:01 +02:00
Felix Roos dc3a873abc extend -> evalScope in runtime 2022-08-09 23:07:41 +02:00
Felix Roos 543d5f0619 test with evalScope instead of extend 2022-08-09 23:07:24 +02:00
Felix Roos 8b088ab6c2 migrate mini test 2022-08-09 23:06:16 +02:00
Felix Roos 29009e14f4 Merge remote-tracking branch 'origin/HEAD' into vitest 2022-08-09 22:08:45 +02:00
Felix Roos bf3e90baf5 add contributor avatars 2022-08-08 22:49:41 +02:00
Felix Roos 3986c407ff cache loaded soundfonts 2022-08-07 23:53:14 +02:00
Felix Roos 8bd56d29d6 add sfumato soundfont player 2022-08-07 21:30:02 +02:00
Felix Roos 467b3db824 handle objects in getPlayableNoteValue 2022-08-07 21:21:44 +02:00
Felix Roos 6025dd6f79 Merge pull request #165 from bpow/randomness
incorporate elements of randomness to the mini notation
2022-08-07 00:59:07 +02:00
Bradford Powell 984f3d2781 add a "tune" and snapshot using the | and ? operators 2022-08-06 18:22:03 -04:00
Bradford Powell 0a558b963d add probabilistic tests for the ? and | mini-notation operators
The tests are probabilistic, so it is possible that if the
pseudo-random number generator changes in the future, we might
get results that fail. They work for the current PRNG, though,
and use boundaries for the number of values of different types
such that there should only be about a 1% probability that the
tests would fail by chance assuming that the PRNG returns
evenly distributed values.
2022-08-06 18:22:03 -04:00
Bradford Powell 1227d98904 add a non-probabilistic test for the ? operator
This really just tests that the ? operator faithfully gets represented
as degradeBy(0.5)
2022-08-06 18:22:03 -04:00
Bradford Powell f533e4a5d0 Change offset for "stateful random" streams
This would no longer match with Tidal (which uses
0.0001), but reduces the correlation among the
the different random streams in the mini-notation's
parsing of ? and |
2022-08-06 18:22:03 -04:00
Bradford Powell 0b00ad98e6 claim victory over the ? and | notations 2022-08-06 18:22:03 -04:00
Bradford Powell 8988408d18 update krill-parser for the changes to .pegjs file 2022-08-06 18:22:02 -04:00
Bradford Powell f858d89f7b implement random choice in mini notation
this will require update to krill-parser.js (aggregated
in later commit) to work properly
2022-08-06 18:22:02 -04:00
Bradford Powell 964ee68974 implement "?" operator in minilanguage (for degradeBy)
this will require update to krill-parser.js (aggregated
in later commit) to work properly
2022-08-06 18:22:02 -04:00
Felix Roos 8244ba7754 hotfix: prebake flag to skip fetch 2022-08-07 00:14:27 +02:00
Felix Roos 21b2184750 Merge pull request #177 from tidalcycles/soft-errors
fix some annoying bugs
2022-08-06 23:32:16 +02:00
Felix Roos 8d1c98f03e always throw error for invalid notes 2022-08-06 21:37:41 +02:00
Felix Roos 684bab99a9 Merge remote-tracking branch 'origin/main' into soft-errors 2022-08-06 21:32:47 +02:00
Felix Roos 7a4a8a4581 run all tests at once 2022-08-06 21:29:36 +02:00
Felix Roos b8843a0eb6 readd mocha dep to root package 2022-08-06 12:32:42 +02:00
Felix Roos 563dfbea43 remove mocha from packages 2022-08-06 12:30:14 +02:00
Felix Roos 488ebf8f1a replace old tests
+ ignore tune test for now
+ add happy-dom
2022-08-06 12:22:11 +02:00
Felix Roos 03158bd689 test tonal tone xen 2022-08-06 11:20:11 +02:00
Felix Roos 765f2df18e vitest eval + mini 2022-08-06 10:48:44 +02:00
Felix Roos a15d8553e0 refactor pattern tests 2022-08-06 01:31:50 +02:00
Felix Roos 3a790b03ac refactor drawLine + fraction test 2022-08-06 00:53:10 +02:00
Felix Roos 90e5e03531 refactor value.test 2022-08-06 00:50:10 +02:00
Felix Roos a4158c16f0 refactor core util.test 2022-08-06 00:47:49 +02:00
Felix Roos ffc0b364ca add vitest 2022-08-06 00:47:36 +02:00
Felix Roos 1efb8f6681 Merge pull request #173 from tidalcycles/replace-react-codemirror
Replace react-codemirror6 with @uiw/react-codemirror
2022-08-06 00:27:16 +02:00
Felix Roos 55b2d7f68f add onSelectionChange callback 2022-08-05 23:50:42 +02:00
Felix Roos 7f0e98ea93 remove old overrides 2022-08-05 23:38:45 +02:00
Felix Roos 67c21c18cf set background to 222 + remove log 2022-08-05 23:23:51 +02:00
Felix Roos 0cd82c7e57 tutorial styles 2022-08-05 23:23:17 +02:00
Felix Roos 1942c36443 fix style import 2022-08-05 23:18:03 +02:00
Felix Roos 93251582ab replace react-codemirror 2022-08-05 23:05:33 +02:00
Felix Roos decd2d6625 fixes #130 + #156 2022-08-05 16:10:37 +02:00
Felix Roos 6824dcb89b Merge pull request #99 from tidalcycles/configurable-shapeshifter
add more shapeshifter flags
2022-08-04 22:19:46 +02:00
Felix Roos eeac075a29 Merge branch 'main' into configurable-shapeshifter 2022-08-04 22:13:52 +02:00
Felix Roos b864b1dec3 Merge pull request #171 from debrisapron/dynamic-import
Amend shapeshifter to allow use of dynamic import
2022-08-04 22:06:38 +02:00
DEBRIS APRON 130fb9c217 Amend shapeshifter to allow use of dynamic import 2022-08-03 17:32:23 -07:00
Felix Roos 688a3d29fd Merge pull request #164 from tidalcycles/talk-fixes
Talk fixes
2022-08-02 23:43:07 +02:00
Felix Roos 800f2f466b darken repl background
+ dont highlight active line
2022-08-02 23:39:07 +02:00
Felix Roos 655a9ff1a4 Merge remote-tracking branch 'origin/HEAD' into talk-fixes 2022-08-02 23:17:02 +02:00
Felix Roos 12f8902c5f Merge pull request #163 from tidalcycles/pianoroll-fixes
Pianoroll fixes
2022-08-02 23:04:34 +02:00
Felix Roos 9cdb1a53f9 Merge pull request #169 from tidalcycles/fix-jsdoc
fix: jsdoc comments
2022-08-02 22:57:43 +02:00
Felix Roos f5efa18e96 fix: jsdoc comments 2022-08-02 22:56:04 +02:00
Alex McLean fcebde5abd Merge pull request #166 from tidalcycles/chooseCycles
add chooseInWith/chooseCycles
2022-07-30 22:51:11 +01:00
alex 7fbd4527e5 chooseInWith, choose2, randcat, and some reformatting 2022-07-30 22:24:26 +01:00
alex d79716c3f8 add chooseInWith/chooseCycles 2022-07-30 09:27:43 +01:00
Felix Roos 884811fd99 darken mini repl bg 2022-07-29 00:19:06 +02:00
Felix Roos 712a2ae018 .out error handling 2022-07-29 00:05:20 +02:00
Felix Roos 4f460eeb32 style errors, fixed backdrop + hide console 2022-07-29 00:03:46 +02:00
Felix Roos 913416a9d5 style fixes + hide-console option
- thicker highlighting outline
- only shade actual characters, not whole lines
- strudel hide-console will now hide console
2022-07-29 00:00:41 +02:00
Felix Roos fd61001b4d getFreq + midi2note helpers 2022-07-28 23:55:17 +02:00
Felix Roos ce4d2c17a7 minirepl optimizations:
- can now evaluate on init
- support disable-highlighting
- support keyboard shortcuts
- support flash
2022-07-28 23:55:05 +02:00
Felix Roos a42ebd7aaf log helpers 2022-07-28 23:46:30 +02:00
Felix Roos f38718004f pianoroll optimizations
- fix flickering due to global alpha mutation
- change default inactive color
- add smear option
- add playheadColor option
2022-07-28 22:27:54 +02:00
Felix Roos 1ddf968750 fix: draw playhead only once 2022-07-28 22:26:14 +02:00
Felix Roos 71dc108b2d Merge pull request #162 from larkob/euclidian
update to tutorial documentation
2022-07-28 19:26:41 +02:00
Lars Kobbe 82728be44b remove edit and pipe function (duplicate of layer and apply) 2022-07-25 22:20:06 +02:00
Lars Kobbe bebfa23cc9 add Euclidian, remove append 2022-07-24 21:20:38 +02:00
Felix Roos 1dad987073 Merge pull request #150 from larkob/prebake-emusp12
add webdirt drum samples to prebake for general availability
2022-07-12 18:58:46 +02:00
Lars Kobbe 6728abf595 added flag for node 16 LTS compatibility 2022-07-12 11:03:15 +02:00
Lars Kobbe 669fce36e9 use fetch instead of import 2022-07-12 09:46:18 +02:00
Lars Kobbe b11003c472 added json assertion 2022-07-12 08:37:21 +02:00
Alex McLean 187f80bfc9 Merge pull request #151 from tidalcycles/paper-update
Final update to demo.pdf
2022-07-12 07:34:16 +01:00
Lars Kobbe 611d216bb0 added EMuSP12 samples to prebake 2022-07-11 23:57:49 +02:00
Felix Roos 8a1cd32d50 Merge pull request #148 from tidalcycles/webaudio-optimizations
Sampler optimizations and more
2022-06-28 21:54:34 +02:00
Felix Roos 2a18b27114 rerun snapshots 2022-06-28 21:51:11 +02:00
Felix Roos 55f91143d9 rename choke -> clip 2022-06-28 21:50:08 +02:00
Felix Roos cf564a7d06 fix tests 2022-06-27 23:52:02 +02:00
Felix Roos b55067ad60 load piano samples locally 2022-06-27 23:32:45 +02:00
Felix Roos a437c698eb style version log + check if already loaded 2022-06-27 23:17:46 +02:00
Felix Roos f8ada70fe7 add tune 2022-06-27 22:40:59 +02:00
Felix Roos 196d9db3fa log core version + add warning to isPattern 2022-06-27 22:40:50 +02:00
Felix Roos e29eaf3785 fix splitSN 2022-06-27 00:57:27 +02:00
Felix Roos 7048ea473f migrate tone piano to own piano 2022-06-27 00:50:24 +02:00
Felix Roos 720b1eeb27 fix soundfonts + samples without base 2022-06-27 00:49:58 +02:00
Felix Roos 4e282dac5b migrate underground plumber 2022-06-27 00:26:29 +02:00
Felix Roos 42343254b1 fix single sampels 2022-06-27 00:26:21 +02:00
Felix Roos e98829c96b tame oscillator gain 2022-06-27 00:26:11 +02:00
Felix Roos 5791f12a28 add prebake script with piano 2022-06-27 00:04:33 +02:00
Felix Roos fe9a6e8fdd draw note property if set 2022-06-27 00:03:26 +02:00
Felix Roos dd3f4e4751 support "s" as "#" alternative inside note names 2022-06-27 00:03:06 +02:00
Felix Roos a89fa766ea support colon sign as normal char 2022-06-27 00:02:33 +02:00
Felix Roos 39c2cf6c72 add build:parser script once more.. 2022-06-27 00:01:59 +02:00
Felix Roos c1ce72469c webaudio optimizations
- samples with obejct format for pitch declaration
- support note to repitch samples
- support choke to fit samples to hap duration
- support "legacy" context.velocity in .out
- support ":" inside s or note to set n
- fix sample fadeout for soundfonts and choke
- move gain before filters
2022-06-27 00:01:28 +02:00
Felix Roos eca76dd7c4 refactor share for build without top level await 2022-06-26 13:05:36 +02:00
Felix Roos 621b2d8fc9 Merge pull request #146 from tidalcycles/share-link
can now generate short link for sharing
2022-06-26 12:58:53 +02:00
Felix Roos 4039b962b4 can now generate short link for sharing 2022-06-26 12:49:29 +02:00
Felix Roos 70cc0b93f0 build 2022-06-25 23:53:31 +02:00
Felix Roos 81e90cd4e4 small fixes 2022-06-25 23:53:27 +02:00
alex 80bd3be0a1 more citations 2022-06-24 22:40:13 +01:00
alex 829a794df7 Merge branch 'paper-update' of github.com:tidalcycles/strudel into paper-update 2022-06-24 22:39:59 +01:00
alex 00997408b8 build 2022-06-24 22:22:56 +01:00
alex 4d3bdfc52f improved ciations 2022-06-24 22:22:44 +01:00
alex b14d0926ed improved ciations 2022-06-24 22:22:28 +01:00
Felix Roos 59b46db8db add sound chapter, trim down future chapter 2022-06-24 23:16:12 +02:00
alex a240284727 paper updates 2022-06-24 21:29:18 +01:00
Felix Roos 3d314324e0 Merge pull request #144 from tidalcycles/flash-effect
flash effect on ctrl enter
2022-06-24 22:16:03 +02:00
Felix Roos b9829bb696 flash effect on ctrl enter 2022-06-24 21:13:17 +02:00
Felix Roos 85f03fb1d0 Merge pull request #142 from tidalcycles/pianoroll-object-support
Pianoroll Object Support
2022-06-22 20:18:17 +02:00
Felix Roos 69810303e5 remove old code 2022-06-22 20:17:12 +02:00
Felix Roos 5b0e31acf3 add tune 2022-06-22 20:13:41 +02:00
alex f0a934e014 Publish
- @strudel.cycles/serial@0.1.3
 - @strudel.cycles/soundfonts@0.1.1
 - @strudel.cycles/webaudio@0.1.4
2022-06-22 13:35:13 +01:00
alex 328e4db1a2 bump 2022-06-21 22:00:08 +01:00
Alex McLean a708265e14 Merge pull request #141 from tidalcycles/serial-twiddles
Serial twiddles
2022-06-21 21:57:27 +01:00
alex a0618f7f47 remove console logging 2022-06-21 21:47:29 +01:00
alex f2bd9fae01 remove hackery 2022-06-21 21:46:23 +01:00
Felix Roos 64f717f81b object support for pianoroll 2022-06-21 22:38:05 +02:00
Felix Roos fd17377c18 Merge pull request #139 from tidalcycles/soundfonts
Soundfont Support
2022-06-21 22:20:04 +02:00
alex 6698fdb6e6 Merge branch 'main' into serial-twiddles 2022-06-21 17:03:02 +01:00
alex e2eab1ee5d Publish
- @strudel.cycles/core@0.1.2
 - @strudel.cycles/eval@0.1.3
 - @strudel.cycles/midi@0.1.3
 - @strudel.cycles/mini@0.1.3
 - @strudel.cycles/react@0.1.4
 - @strudel.cycles/tonal@0.1.3
 - @strudel.cycles/tone@0.1.3
 - @strudel.cycles/webaudio@0.1.3
 - @strudel.cycles/webdirt@0.1.2
 - @strudel.cycles/xen@0.1.3
2022-06-21 16:41:54 +01:00
alex aee9bf7cc2 remove async from serial, default baudrate to 38400 2022-06-21 15:54:18 +01:00
Alex McLean 63d9d554b9 Merge pull request #140 from tidalcycles/fix-createParam
Fix createParam()
2022-06-21 13:11:50 +01:00
alex f6c04f9e74 no need to involve controls[name] 2022-06-21 12:53:00 +01:00
alex e167300194 add created param to controls 2022-06-21 12:15:35 +01:00
Felix Roos 319400ab13 remove unused sf control 2022-06-20 22:20:22 +02:00
Felix Roos 38b1717fac load fonts from forked version 2022-06-20 22:00:14 +02:00
Felix Roos d5938a016c fix looping fonts 2022-06-20 20:55:20 +02:00
Felix Roos 3ac592b18a Publish
- @strudel.cycles/core@0.1.1
 - @strudel.cycles/embed@0.1.1
 - @strudel.cycles/eval@0.1.2
 - @strudel.cycles/midi@0.1.2
 - @strudel.cycles/mini@0.1.2
 - @strudel.cycles/osc@0.1.1
 - @strudel.cycles/react@0.1.3
 - @strudel.cycles/serial@0.1.1
 - @strudel.cycles/tonal@0.1.2
 - @strudel.cycles/tone@0.1.2
 - @strudel.cycles/webaudio@0.1.2
 - @strudel.cycles/webdirt@0.1.1
 - @strudel.cycles/xen@0.1.2
2022-06-20 20:04:21 +02:00
Felix Roos 82d6103907 began soundfont implementation 2022-06-20 20:02:55 +02:00
Felix Roos b353db67d4 began soundfonts package 2022-06-19 15:31:19 +02:00
Felix Roos 5334abebaa hotfix: no sound in ios webkit 2022-06-19 11:50:00 +02:00
Felix Roos ad053361dc Merge pull request #138 from tidalcycles/webaudio-rewrite
Webaudio rewrite
2022-06-18 23:24:41 +02:00
Felix Roos ad62ccd8c7 allow _base prop for samples loader 2022-06-18 23:06:37 +02:00
Felix Roos ecd93c9a92 cache gist by default for faster eval 2022-06-18 23:06:21 +02:00
Felix Roos 774c02afab update tune 2022-06-18 21:44:32 +02:00
Felix Roos 18f1f7d83d simplify url 2022-06-18 18:31:13 +02:00
Felix Roos 9eb3266891 add comments to tune 2022-06-18 18:29:58 +02:00
Felix Roos c3a3a68054 add snapshot 2022-06-18 17:27:57 +02:00
Felix Roos 925fb30e05 fix cracks + add tune 2022-06-18 17:25:36 +02:00
alex 363895761e Merge branch 'main' of github.com:tidalcycles/strudel 2022-06-18 13:19:38 +01:00
alex c191accc64 add top-level chop 2022-06-18 13:19:14 +01:00
Felix Roos 71b6b83ab3 samples: support speed, begin and end 2022-06-18 13:56:41 +02:00
Felix Roos d532f8007e move sampler to webaudio
+ add basic sample playback to .out
2022-06-18 13:11:25 +02:00
Felix Roos 44574af3eb use closures to simplify api 2022-06-18 00:56:58 +02:00
Felix Roos faa4019b27 dont use tone audio context 2022-06-18 00:54:36 +02:00
Felix Roos c1e934d171 regenerate snapshots - update webaudio ones 2022-06-18 00:39:25 +02:00
Felix Roos 5fd88f9213 fix snapshots for objects 2022-06-18 00:38:51 +02:00
Felix Roos 2bb095d47d add controls to tune test 2022-06-17 23:40:38 +02:00
Felix Roos a4a30e8b60 add new tune 2022-06-17 23:26:07 +02:00
Felix Roos 4c05876066 rewrite webaudio + migrate tunes + empty setters 2022-06-17 23:23:51 +02:00
alex 23be3e5ba3 hackery 2022-06-17 14:45:58 +01:00
Felix Roos f69d776cf6 prepare webaudio rewrite 2022-06-16 23:53:29 +02:00
Felix Roos 25795eaecc Merge pull request #136 from tidalcycles/on-trigger
add onTrigger helper
2022-06-16 21:58:37 +02:00
Felix Roos 3e1e92a6f1 add onTrigger helper 2022-06-16 21:01:35 +02:00
Felix Roos f2f3511a2f Merge pull request #134 from tidalcycles/scheduler-improvements
Scheduler improvements
2022-06-16 20:48:23 +02:00
Felix Roos 0ce70f4d0d Merge pull request #135 from tidalcycles/trigger-simplification
remove cycle + delta from onTrigger
2022-06-16 20:48:06 +02:00
Felix Roos cac5d96c16 remove cycle + delta from onTrigger 2022-06-16 20:38:21 +02:00
Felix Roos 25d6ff1c90 can now set latency on the scheduler 2022-06-16 20:37:13 +02:00
Felix Roos 87de8c0800 automatically run onTrigger in scheduler 2022-06-16 20:36:59 +02:00
alex 34ba762b42 funky serialisation for serial 2022-06-16 13:54:53 +01:00
Felix Roos badc4bcc2f Update README.md
remove unused import
2022-06-16 14:11:25 +02:00
Felix Roos 729b4e18ab Update README.md
replace extend with evalScope
2022-06-16 14:10:29 +02:00
alex c3f03f50b3 package locks 2022-06-16 10:30:02 +01:00
alex 8fd4cfe0a3 Merge branch 'main' of github.com:yaxu/strudel into main 2022-06-16 10:17:54 +01:00
alex 8dee07082d add tutorial to setup 2022-06-16 10:17:47 +01:00
Alex McLean 11e33f5c70 Update README.md 2022-06-16 10:10:13 +01:00
Alex McLean 3d68b0c566 Update README.md 2022-06-16 10:10:01 +01:00
Felix Roos fb8dd537e0 node 16 compat 2022-06-15 21:34:56 +02:00
alex affce4a4a1 re-add serial 2022-06-15 16:21:56 +01:00
alex a479a5740b declare from/to with let, as they can be changed 2022-06-15 16:15:57 +01:00
Felix Roos 8e68b4e001 fix: WebDirt import 2022-06-14 08:39:22 +02:00
Felix Roos d10b6f04cf Merge pull request #110 from tidalcycles/create-param
add createParam + createParams
2022-06-13 21:28:27 +02:00
Felix Roos 052f2db0ea Merge pull request #131 from tidalcycles/pianoroll-enhancements
Pianoroll enhancements
2022-06-13 21:27:08 +02:00
Felix Roos 4b9a6ffee5 ignore samples 2022-06-13 21:24:40 +02:00
Felix Roos 6d6784d429 remove old comments 2022-06-05 23:59:44 +02:00
Felix Roos b3d2d3028c disable autorange by default 2022-06-05 23:47:24 +02:00
Felix Roos 68814dd97c pianoroll: hideNegative flag 2022-06-05 23:38:33 +02:00
Felix Roos ac39a609d7 pianoroll: flipTime + flipValues 2022-06-05 23:38:22 +02:00
Felix Roos ba5cf5ba83 replace from to with cycles / playhead 2022-06-05 23:38:07 +02:00
Felix Roos 394e77c152 pianoroll: autorange + fold + vertical 2022-06-05 23:37:49 +02:00
Felix Roos c7fdf5245a more flexible pianoroll 2022-06-05 23:37:24 +02:00
Felix Roos 6d91b2d984 Merge pull request #129 from stephendwolff/main
Fix link to contributing to tutorial docs
2022-06-05 13:06:02 +02:00
Stephen Wolff 36a401c6a7 Update CONTRIBUTING.md 2022-06-04 13:40:30 +01:00
Stephen Wolff cbb59eafc8 Update CONTRIBUTING.md
fix link
2022-06-04 13:35:06 +01:00
Felix Roos 5cd80b5817 fix: #122 was still not fixed for async patterns 2022-06-02 00:58:20 +02:00
Felix Roos 6306cc9c34 delete doc.json (build artifact) 2022-06-02 00:23:53 +02:00
Felix Roos e335b07efe Merge pull request #121 from tidalcycles/webdirt
Webdirt
2022-06-02 00:20:45 +02:00
Felix Roos e86144255c Merge remote-tracking branch 'origin/HEAD' into webdirt 2022-06-02 00:19:10 +02:00
Felix Roos e2c4a3b591 Merge pull request #124 from tidalcycles/ctrl-enter-fix
fix: #122 ctrl enter would add newline
2022-06-01 23:56:04 +02:00
Felix Roos 81c20e6792 fix: #122 ctrl enter would add newline 2022-06-01 23:53:30 +02:00
Felix Roos 204941c1e4 Merge pull request #123 from tidalcycles/tab-switch-bug
fix: #108
2022-06-01 18:21:56 +02:00
Felix Roos 307afa5c52 fix: #108 2022-06-01 18:19:57 +02:00
Felix Roos 92dc50e348 minor style tweaks 2022-05-30 23:34:56 +02:00
Felix Roos 5c6c5c9608 add samples helper
+ dont play samples after load
2022-05-30 23:33:49 +02:00
Felix Roos e27b8aeb66 fix cache + add cache reset 2022-05-29 22:44:26 +02:00
Felix Roos 7274a455a8 save sample list to local storage 2022-05-29 22:18:07 +02:00
Felix Roos 91dfef52ea basic sample loader from github 2022-05-29 21:06:07 +02:00
Felix Roos 9147b4e39f Update README.md 2022-05-29 18:13:07 +02:00
Felix Roos 052159ce6f rename readme 2022-05-29 18:10:04 +02:00
Felix Roos ea6d728b89 link webdirt - superdirt controls 2022-05-29 15:07:01 +02:00
Felix Roos 093049a1f8 hopefully fix sample folder for deployed version 2022-05-29 12:27:25 +02:00
Felix Roos 17fa8d904e support webdirt in minirepl
+ add section in tutorial
2022-05-29 11:51:26 +02:00
Felix Roos a996a7043d remove splitLanes from branch 2022-05-29 09:58:04 +02:00
Felix Roos 822659f7fd Merge commit 'd132a9bec58f40ccdea411ec971a0343aa1b0743' into webdirt 2022-05-29 09:56:38 +02:00
Felix Roos e1fb0acff7 pass all value props to webdirt + list available 2022-05-29 09:55:58 +02:00
Felix Roos d132a9bec5 Merge pull request #117 from tidalcycles/in-source-doc
In source doc
2022-05-29 09:54:59 +02:00
Felix Roos f9f1b55185 add webdirt with some default samples 2022-05-29 00:50:01 +02:00
Felix Roos 15b32abadf add dummy function with todo 2022-05-28 23:45:42 +02:00
Felix Roos 93e565f8df document non random signal functions 2022-05-28 23:43:42 +02:00
Felix Roos 69703072df hotfix: add missing osc import 2022-05-25 22:37:39 +02:00
Felix Roos ad3a324719 Merge branch 'in-source-doc' into binaries 2022-05-25 21:55:53 +02:00
Felix Roos 8c9e178206 add build script for binaries 2022-05-25 21:24:05 +02:00
Felix Roos 8a812dd853 reorder stuff 2022-05-24 22:48:49 +02:00
Felix Roos 7250824e6b add superdirt params 2022-05-24 22:35:06 +02:00
Felix Roos cc1a61d607 use nunjucks filters 2022-05-24 20:40:12 +02:00
Felix Roos e7fe1ab567 delete old mdx 2022-05-24 20:37:53 +02:00
Felix Roos cad24714d4 use tutorial.mdx with nunjucks 2022-05-24 20:37:29 +02:00
Felix Roos 4acdabe439 can now generate mdx from nunjucks 2022-05-24 00:03:59 +02:00
Felix Roos b5b0fbbd38 small fixes 2022-05-24 00:03:50 +02:00
Felix Roos 2680eed681 hide api doc by default 2022-05-22 21:57:04 +02:00
Felix Roos 1b8a12dd2a doc 2022-05-22 21:52:46 +02:00
Felix Roos b0c6236c24 even more doc 2022-05-22 21:42:30 +02:00
Felix Roos 8646410e6f add n + todos 2022-05-22 16:23:51 +02:00
Felix Roos b2743108f1 dont render attack yet 2022-05-22 16:01:17 +02:00
Felix Roos 4be798d15a more doc 2022-05-22 15:59:56 +02:00
Felix Roos 4c4d0b426e even more control doc + more logical grouping 2022-05-22 12:26:45 +02:00
Felix Roos 58104b5a3a document more controls 2022-05-22 11:53:29 +02:00
Felix Roos 68a3842c8c document more controls 2022-05-22 08:35:45 +02:00
Felix Roos 987cc63764 test control doc 2022-05-21 22:51:56 +02:00
Felix Roos a8672ec432 fix repl imports 2022-05-21 22:51:42 +02:00
Felix Roos a9f5bd679d jsdoc voicings 2022-05-21 21:57:37 +02:00
Felix Roos f2b5dcf466 tonal jsdoc 2022-05-21 21:52:45 +02:00
Felix Roos 6b26f999e4 autogenerate doc on build tutorial 2022-05-20 22:15:05 +02:00
Felix Roos f2a70396d1 add autogenerated api doc to bottom of tutorial 2022-05-20 21:56:55 +02:00
Felix Roos b50daed0d0 Merge remote-tracking branch 'origin/main' into in-source-doc 2022-05-20 21:46:14 +02:00
Felix Roos e664834fd9 Merge pull request #116 from tidalcycles/repl-package
react package + vite build
2022-05-20 11:49:10 +02:00
Felix Roos 4c49e30763 delete docs as now deploying to gh-pages branch 2022-05-20 11:47:34 +02:00
Felix Roos 2d2c671e6f Publish
- @strudel.cycles/eval@0.1.1
 - @strudel.cycles/midi@0.1.1
 - @strudel.cycles/mini@0.1.1
 - @strudel.cycles/react@0.1.2
 - @strudel.cycles/tonal@0.1.1
 - @strudel.cycles/tone@0.1.1
 - @strudel.cycles/webaudio@0.1.1
 - @strudel.cycles/xen@0.1.1
2022-05-20 11:45:07 +02:00
Felix Roos d2f47262de bump core deps 2022-05-20 11:43:39 +02:00
Felix Roos cb13eb7f3b remove now redundant style 2022-05-20 00:15:10 +02:00
Felix Roos 96825f9fcc Publish
- @strudel.cycles/react@0.1.1
2022-05-20 00:09:30 +02:00
Felix Roos 7eeae4292c add missing styles + fix demo 2022-05-20 00:08:50 +02:00
Felix Roos a29c5f1bd8 Publish
- @strudel.cycles/eval@0.1.0
 - @strudel.cycles/midi@0.1.0
 - @strudel.cycles/mini@0.1.0
 - @strudel.cycles/react@0.1.0
 - @strudel.cycles/tonal@0.1.0
 - @strudel.cycles/tone@0.1.0
 - @strudel.cycles/webaudio@0.1.0
 - @strudel.cycles/xen@0.1.0
2022-05-19 19:42:22 +02:00
Felix Roos b7a2386874 messed up everything 2022-05-19 19:40:47 +02:00
Felix Roos 43a0c7e604 fix cp error 2022-05-19 19:36:00 +02:00
Felix Roos 73d8afd61b revert unpublished versions 2022-05-19 19:34:02 +02:00
Felix Roos 87162a9f31 Publish
- @strudel.cycles/core@0.1.0
 - @strudel.cycles/embed@0.1.0
 - @strudel.cycles/eval@0.1.0
 - @strudel.cycles/midi@0.1.0
 - @strudel.cycles/mini@0.1.0
 - @strudel.cycles/osc@0.1.0
 - @strudel.cycles/react@0.1.0
 - @strudel.cycles/serial@0.1.0
 - @strudel.cycles/tonal@0.1.0
 - @strudel.cycles/tone@0.1.0
 - @strudel.cycles/webaudio@0.1.0
 - @strudel.cycles/xen@0.1.0
2022-05-19 19:13:46 +02:00
Felix Roos c643f10530 tutorial toc 2022-05-19 17:16:28 +02:00
Felix Roos ae81f6d573 MiniRepl: hideOutsideView flag 2022-05-19 08:39:51 +02:00
Felix Roos 44ba1f85c3 clear out before build 2022-05-18 20:40:24 +02:00
Felix Roos f34301b427 fix deploy out 2022-05-18 20:10:41 +02:00
Felix Roos 666cbf6568 add todos 2022-05-18 00:28:24 +02:00
Felix Roos f31a5a4bbb remove old todo 2022-05-18 00:25:51 +02:00
Felix Roos bbf0565007 delete react logo 2022-05-18 00:23:49 +02:00
Felix Roos c41ac9a413 add basic readme 2022-05-18 00:22:26 +02:00
Felix Roos ab1dd27875 hide todo 2022-05-18 00:21:11 +02:00
Felix Roos 788a4c9143 fix tests 2022-05-18 00:18:12 +02:00
Felix Roos 43c2f46196 small fixes 2022-05-18 00:07:37 +02:00
Felix Roos fdb60a3fc1 migrate public files + add deploy script 2022-05-17 22:55:12 +02:00
Felix Roos 6c6ea3ab9f fix favicon 2022-05-17 22:47:35 +02:00
Felix Roos 806c8925c9 new build script + fix draw 2022-05-17 22:45:23 +02:00
Felix Roos ed35f967b0 migrate repl + move imports out of minirepl 2022-05-17 22:27:22 +02:00
Felix Roos 0bcc01ed0e add missing deps 2022-05-17 21:55:37 +02:00
Felix Roos b7fac65a87 add description 2022-05-17 21:45:22 +02:00
Felix Roos 605cb98b8e package meta 2022-05-17 21:43:28 +02:00
Felix Roos b8a0559012 react packaging 2022-05-17 21:40:17 +02:00
Felix Roos fb2f63ee26 unify barrel exports 2022-05-17 21:38:47 +02:00
Felix Roos b59f36f40b basic react package build config 2022-05-17 00:32:57 +02:00
Felix Roos 2a618b42b7 add evalScope + deprecate extend 2022-05-17 00:31:20 +02:00
Felix Roos aa3db09f22 tone barrel export 2022-05-17 00:23:13 +02:00
Felix Roos 9fa01aa6ff add barrel exports 2022-05-17 00:22:50 +02:00
Felix Roos 999251e137 Merge remote-tracking branch 'origin/main' into repl-package 2022-05-15 22:55:31 +02:00
Felix Roos 55d5cc9308 fix asNumber 2022-05-15 22:55:12 +02:00
Alex McLean 58301c380b Merge pull request #113 from tidalcycles/osc-timing
Osc timing improvements
2022-05-15 21:29:25 +01:00
Alex McLean ee45337d89 Merge pull request #114 from tidalcycles/more-functions
loopAt
2022-05-15 21:28:24 +01:00
alex f2e1ee1aac Fix osc timing, and send cps, cycle and delta 2022-05-15 18:49:32 +01:00
alex ee5bc0f3a6 loopAt 2022-05-15 18:38:26 +01:00
Felix Roos 273cb81da0 use Function instead of eval
- fixes scope issues (e.g. seq duplication)
- should be much safer and much faster
2022-05-15 00:35:17 +02:00
Felix Roos 1cbf4c8c7e fix name collision 2022-05-14 23:39:31 +02:00
Felix Roos 446ddc2c11 pull out tutorial 2022-05-14 22:11:29 +02:00
Felix Roos 42d3510c74 migrate tutorial 2022-05-14 21:28:10 +02:00
Felix Roos 92c17d6376 migrate missing files + fix tests 2022-05-14 20:51:00 +02:00
Felix Roos 645ea30b53 use vite for repl 2022-05-14 20:33:55 +02:00
Felix Roos 0d63ec9146 basic react package 2022-05-14 20:27:05 +02:00
Alex McLean 9588272639 Merge pull request #112 from tidalcycles/more-functions
`.brak()`, `.inside()` and `.outside()`
2022-05-09 20:09:46 +02:00
alex aca3bea56b Implement inside/outside 2022-05-09 18:43:02 +01:00
alex a8d676641b brak() fix 2022-05-09 17:24:49 +02:00
alex 4fd843f8cf Implement brak() 2022-05-09 16:56:08 +02:00
Felix Roos 608283ba65 doc: euclid 2022-05-07 10:29:16 +02:00
Felix Roos f5e5ef8662 doc: drawLine 2022-05-07 10:27:14 +02:00
alex d5a1832f31 document some mathematical pattern methods 2022-05-06 15:42:48 +02:00
alex 73b0a3a0ef build 2022-05-06 15:29:05 +02:00
alex 6dedeae6e1 fix run-license call 2022-05-06 15:28:40 +02:00
Alex McLean 14487ed5cf Merge pull request #105 from tidalcycles/in-source-doc
In source doc
2022-05-06 15:18:41 +02:00
Felix Roos e7def57c5b add createParam + createParams 2022-05-05 20:54:49 +02:00
alex 5419b0896c more docs 2022-05-05 18:45:31 +02:00
alex f8f744dd87 standardise on hap rather than event, especially in function names 2022-05-05 17:20:36 +01:00
alex b0dfb44e96 add license to those extracted during javascript minification (temporary hack) 2022-05-05 16:45:32 +01:00
Felix Roos cdc068bb47 build 2022-05-04 23:02:05 +02:00
Felix Roos 09c5c07bfb Merge pull request #109 from tidalcycles/embed-style
Embed style
2022-05-04 22:59:30 +02:00
Felix Roos 56962196ea configure jsdoc to parse all package files 2022-05-04 22:47:13 +02:00
Felix Roos 8b4af5ce9d local testing comments 2022-05-04 22:03:09 +02:00
Felix Roos 8034eb14b6 embedded styles 2022-05-04 22:03:00 +02:00
Felix Roos 2739c89475 Merge remote-tracking branch 'origin/main' into in-source-doc 2022-05-03 08:10:19 +02:00
Alex McLean cf79083edb Merge pull request #88 from tidalcycles/reset
Reset, Restart and other composers
2022-05-03 00:40:22 +01:00
Alex McLean cbe9c9248d Merge branch 'main' into reset 2022-05-03 00:39:25 +01:00
Felix Roos e0c77a5fa8 try out jsdoc-json 2022-05-02 23:17:50 +02:00
Felix Roos 339e91b026 Merge remote-tracking branch 'origin/HEAD' into in-source-doc 2022-05-02 23:08:15 +02:00
Felix Roos 25bfdd80e3 Update README.md
add more link for all packages
2022-05-02 22:48:50 +02:00
Felix Roos 68c6d340ce Merge pull request #106 from tidalcycles/embed
/embed package: web component for repl
2022-05-02 22:47:20 +02:00
Felix Roos 91261b8b3f bump 2022-05-02 22:40:58 +02:00
Felix Roos 6e8bd1ff33 fix example 2022-05-02 22:40:40 +02:00
Felix Roos b01865f0f5 add basic embed package 2022-05-02 22:33:31 +02:00
alex 4319b6d2d1 Merge branch 'main' of github.com:tidalcycles/strudel 2022-05-02 21:27:15 +01:00
alex 53d82e5126 Prettify 2022-05-02 21:27:02 +01:00
Alex McLean 90b74a72ad Add link to packages/serial 2022-05-02 21:22:30 +01:00
alex c23f9b8629 reflect licence change to AGPL 2022-05-02 21:15:25 +01:00
Felix Roos d752d0eb5e Merge remote-tracking branch 'origin/main' into embed 2022-05-02 22:06:02 +02:00
Felix Roos 65fbdba047 Merge pull request #104 from tidalcycles/tune-tests
Tune tests
2022-05-02 22:05:33 +02:00
alex 6273b34254 Support string concatenation for add() and variants 2022-05-02 09:40:06 +01:00
alex 4779dd13c0 _asNumber: support old 'silent' parameter, renamed
as 'dropfails'
2022-05-02 09:22:00 +01:00
alex 469db7d5bd Add ption for asNumber to return original event
on fail.
Make numerical composers use asNumber.
2022-05-01 23:17:21 +01:00
alex 42269cf72b add bossa snapshot 2022-05-01 23:15:22 +01:00
Felix Roos 38bb0ca041 add cycles for all tunes 2022-05-01 23:22:54 +02:00
alex 1949071259 Merge branch 'tune-tests' into reset 2022-05-01 22:19:40 +01:00
Felix Roos a119b83b65 more readable tune test + longer snaps 2022-05-01 23:13:54 +02:00
Felix Roos c939a8a0c1 fix shoot 2022-05-01 22:47:58 +02:00
Felix Roos 5f26773c61 add repl test to root package 2022-05-01 22:35:35 +02:00
Felix Roos 6cac8ba108 basic snapshot test for tunes 2022-05-01 22:34:11 +02:00
Felix Roos 3eebccd566 add showWhole 2022-05-01 22:22:07 +02:00
alex f81190bf35 try adding some pattern docs 2022-05-01 20:46:30 +01:00
alex 065f4191f0 Rename TrigZero -> Trigzero, + more composer tests 2022-05-01 17:34:47 +01:00
alex b2d58ce0bd Use this.duration for things 2022-05-01 17:06:26 +01:00
alex 41b7939dac More composer tests 2022-05-01 17:02:40 +01:00
alex 68c63cca7e Merge branch 'main' into reset 2022-05-01 16:08:42 +01:00
Felix Roos 2348d056cb test jsdoc 2022-05-01 15:40:54 +02:00
Felix Roos f469e48970 build 2022-05-01 14:36:30 +02:00
Felix Roos 7e52fdd5ca Merge pull request #97 from tidalcycles/codemirror-6
Codemirror 6
2022-05-01 14:33:10 +02:00
Felix Roos 29fceff9b3 handle edge case 2022-05-01 14:13:20 +02:00
Felix Roos bdb5dabba5 patch holes in highlighting query span
+ make sure disable-highlighting works again
2022-05-01 11:33:25 +02:00
alex 3fe705427f binary composer fixes 2022-04-30 19:21:37 +01:00
alex 21a1fe5056 Merge branch 'codemirror-6' into reset 2022-04-30 19:13:41 +01:00
alex e40bdad6c3 Add binary composers 2022-04-30 19:12:24 +01:00
alex dcbe24d45c Merge branch 'main' into reset 2022-04-30 19:02:48 +01:00
Felix Roos d4607c68f7 highlight only events with onsets 2022-04-30 11:14:16 +02:00
alex 026ae3c8e1 reset -> trig, restart -> trigZero, then alias reset -> keepTrig, restart -> keepTrigZero 2022-04-30 09:23:42 +01:00
Felix Roos f6d128842a filter out inactive events 2022-04-29 21:56:15 +02:00
Felix Roos a6dac6ded3 Merge remote-tracking branch 'origin/HEAD' into codemirror-6 2022-04-29 21:33:15 +02:00
Felix Roos 4fcec82917 support custom dynamic highlight color 2022-04-29 21:27:12 +02:00
Felix Roos 9e46b3cd00 fix: dont highlight out of range 2022-04-29 21:14:37 +02:00
Felix Roos d56f151edb Merge branch 'main' of https://github.com/tidalcycles/strudel 2022-04-29 20:39:32 +02:00
Felix Roos 4b49c95e73 fix: .wave 2022-04-29 20:39:28 +02:00
Felix Roos cf922b036e remove old codemirror packages + styles 2022-04-29 20:38:49 +02:00
alex f7dedd6244 Try without the special case for reset/restart 2022-04-29 17:08:00 +01:00
alex 7af3c33814 Tidy and add 'keepif' 2022-04-29 17:03:38 +01:00
alex 8cd3be6f67 Merge branch 'main' into reset 2022-04-29 16:50:50 +01:00
alex 86e8ed2ac0 Trying a different naming scheme for composers 2022-04-29 16:46:17 +01:00
Felix Roos 0d1e7f5c17 fix: .wave 2022-04-29 16:27:43 +02:00
Felix Roos fc9a9e33d2 use cm6 in tutorial
+ move highlighting to hook
+ optimize tutorial loading time
2022-04-29 16:27:23 +02:00
Felix Roos f00e28ced3 Merge pull request #102 from mindofmatthew/codemirror-6-highlights
Work on Codemirror 6 highlighting
2022-04-28 23:45:53 +02:00
Alex McLean 4c29677d5b Merge pull request #101 from tidalcycles/agpl-license
Change to Affero GPL
2022-04-28 14:46:06 +01:00
alex 07b8dc3f76 Merge branch 'agpl-license' of github.com:tidalcycles/strudel into agpl-license 2022-04-28 14:43:13 +01:00
alex ee514ee8ba redo headers 2022-04-28 14:38:41 +01:00
alex 97a0fb3e18 add AGPL headers 2022-04-28 11:06:39 +01:00
Matthew ef42ca692a Work on Codemirror 6 highlighting 2022-04-27 20:57:08 -04:00
alex 9ca49c587c Change to Affero GPL 2022-04-27 09:34:47 +01:00
Alex McLean 3b38d936a8 Merge pull request #98 from tidalcycles/paper
Paper
2022-04-25 23:13:07 +01:00
Felix Roos 0d325a3ec4 add more shapeshifter flags 2022-04-25 22:52:16 +02:00
Felix Roos 7f8cdfa361 revert sound function 2022-04-25 22:49:31 +02:00
Felix Roos 8da4217d69 remove old patched osc-js 2022-04-25 22:48:59 +02:00
Felix Roos d3a04071eb remove duplicate range 2022-04-25 22:47:30 +02:00
Felix Roos 0c5903d822 Merge remote-tracking branch 'origin/HEAD' into paper 2022-04-25 22:43:41 +02:00
Felix Roos f97f8be5a4 Merge remote-tracking branch 'origin/main' into codemirror-6 2022-04-25 22:32:49 +02:00
Alex McLean d2ec9768f1 Merge pull request #90 from tidalcycles/more-functions
Fiddles with cat/stack
2022-04-25 21:10:21 +01:00
Felix Roos 37218e8764 match font size of old editor 2022-04-25 22:04:51 +02:00
Felix Roos 069fff673a fix some bugs 2022-04-25 22:00:18 +02:00
Felix Roos 5aed046b34 fix z-index 2022-04-25 21:32:25 +02:00
Felix Roos 5dea15ade9 remove background color from cm6 theme 2022-04-25 21:25:13 +02:00
Felix Roos 10487683d3 tiny bit of style 2022-04-25 20:46:12 +02:00
Felix Roos 12967f2819 use codemirror 6 2022-04-25 20:34:09 +02:00
alex 07b22a2c28 Tweaks, more inspirations, and figure 2022-04-25 10:41:16 +01:00
alex fe13a7fe34 build 2022-04-24 22:35:00 +01:00
alex 602cac5a35 tweak copyright 2022-04-24 22:34:46 +01:00
alex 11f697fa9c Tweak copyright 2022-04-24 22:34:29 +01:00
alex d5957035fa fix citations, build 2022-04-24 22:16:23 +01:00
alex b80d7d226b Merge branch 'paper' of github.com:tidalcycles/strudel into paper 2022-04-24 21:54:17 +01:00
alex 8564dafbfb Merge branch 'main' into paper 2022-04-24 21:54:11 +01:00
Felix Roos dc66dab237 future outlook + links 2022-04-24 21:36:03 +02:00
Felix Roos a32d77b24d Merge commit '47717e872b87f497990d7c1d6c3d54bfb96f2003' into paper 2022-04-24 21:00:54 +02:00
Felix Roos 23836e2345 fix reset / restart default method 2022-04-24 21:00:11 +02:00
alex 1a5c95d084 Merge branch 'more-functions' of github.com:tidalcycles/strudel into more-functions 2022-04-24 17:51:41 +01:00
alex 6a6464b0f7 Remove append, fixes #89 2022-04-24 17:51:31 +01:00
alex 60027e664f Try 'keep' instead of 'const' 2022-04-24 14:38:33 +01:00
alex 27ff329981 Prettify 2022-04-24 11:30:13 +01:00
alex df5ffb4736 Tidy up composers, supporting function patterns 2022-04-24 11:27:52 +01:00
alex a194b908e7 Export unionWithObj 2022-04-24 11:26:33 +01:00
alex 79f5faa544 Merge branch 'reset' of github.com:tidalcycles/strudel into reset 2022-04-24 01:04:14 +01:00
alex 5c3f095ef2 Experimental rejig of the pattern composers.
Now `restart` is `setRestart`, use `constRestart` for the old behavior.
Same for `reset`.
2022-04-24 01:02:32 +01:00
Felix Roos 283e5fde69 fix drawLine polyrhythm 2022-04-24 01:40:26 +02:00
Felix Roos f96ca562a2 fix restart overlap 2022-04-24 01:27:44 +02:00
Felix Roos 58a936cf33 test silence 2022-04-24 00:59:38 +02:00
Felix Roos a0d6fc47e0 improve drawLine 2022-04-24 00:56:16 +02:00
Felix Roos dd03ad6c14 support stack in drawLine 2022-04-24 00:34:04 +02:00
Felix Roos 2bbd306b94 drawLine test 2022-04-23 23:47:52 +02:00
Felix Roos 766cccf335 refactor event.duration references 2022-04-23 23:36:26 +02:00
Felix Roos 9e2e5ce581 log + drawLine 2022-04-23 23:28:43 +02:00
Felix Roos e747c0b060 remove featurelist as it's now kept up to date in #31 2022-04-23 21:08:58 +02:00
Felix Roos 67bef933be migrate tutorial cat -> seq 2022-04-23 20:38:51 +02:00
Felix Roos f1c0d8c8f8 refactor cat -> seq 2022-04-23 20:27:40 +02:00
Felix Roos dd2552eda8 add seq to factories for highlighting 2022-04-23 20:27:16 +02:00
Felix Roos ab9871640a add todo 2022-04-23 17:38:29 +02:00
alex 615f71b099 Fix evaluate test with new cat behaviour ref #87 2022-04-23 11:11:45 +01:00
alex ff418c9f0c seq -> sequence shorthand ref #87 2022-04-23 11:10:05 +01:00
alex 4c43d3d850 Make sequence a fastcat alias and change cat to be a slowcat ref #87 2022-04-23 11:01:12 +01:00
alex a4cacc079e Support subpattern sequences in stack like slowcat in ref #87 2022-04-23 09:47:12 +01:00
alex 9df20fcbc5 support catting subpatterns, fixes #87 2022-04-23 09:38:05 +01:00
alex f4dd549a41 Merge branch 'main' into more-functions 2022-04-23 09:21:47 +01:00
alex cc445e89a3 cat/append/fastcat/slowcat as pattern methods 2022-04-23 09:21:40 +01:00
Felix Roos 08f8a7a17c restart example 2022-04-22 23:47:05 +02:00
Felix Roos ab14d70c6c rename to restart 2022-04-22 23:01:37 +02:00
Felix Roos ecfc6fd31e simplify 2022-04-22 22:52:11 +02:00
Felix Roos 0fae8b2b10 first take at reset 2022-04-22 22:21:43 +02:00
Felix Roos c38e4f7206 helper functions 2022-04-22 22:21:36 +02:00
alex 47717e872b test for negative time, ref #85 2022-04-22 17:06:15 +01:00
alex 903c065e26 Use mathematical mod in slowcat, fixes #85 2022-04-22 17:02:21 +01:00
alex 3742bf384c Remove recursion from mod 2022-04-22 17:01:28 +01:00
alex 1029f8674c fix the fix for echo 2022-04-22 12:35:43 +01:00
alex c801660b2a use rational multiplication in echo 2022-04-22 12:30:16 +01:00
alex 48d4541ed7 build 2022-04-22 12:12:11 +01:00
Alex McLean 8007ea6a7e Merge pull request #83 from tidalcycles/pattern-composers
Add pattern composers, implements #82
2022-04-22 12:08:11 +01:00
alex 8e441ecb19 fix striate: union -> set 2022-04-22 12:07:23 +01:00
alex c305e82f5c Merge branch 'main' into pattern-composers 2022-04-22 11:52:36 +01:00
alex 87cfa30508 Extra test for ply (and prettify) 2022-04-22 11:51:41 +01:00
alex 2c224d5092 Make comparisons rational in _compress 2022-04-22 11:46:34 +01:00
Felix Roos 72eeaf446e fix: cycleArg imprecise fraction operation 2022-04-22 12:40:23 +02:00
Felix Roos 51a806b0ba Merge branch 'main' of https://github.com/tidalcycles/strudel 2022-04-22 11:49:42 +02:00
Felix Roos 52840f9141 add tune + fix another 2022-04-22 11:48:57 +02:00
alex 974503160d squeezeflip, tests for add including failing one.. 2022-04-22 09:51:44 +01:00
alex d9e3ff3256 Tests for set, setFlip and setSqueeze 2022-04-22 09:27:23 +01:00
alex b510ab0371 Make set work for primative patterns, allow ops accept sequence 2022-04-22 09:26:39 +01:00
Felix Roos 5eba78d795 Merge pull request #84 from mindofmatthew/tidying
Tidy up a couple of old files
2022-04-21 20:57:45 +02:00
Matthew Kaney 884c13a22d Remove old files 2022-04-21 13:14:37 -04:00
Alex McLean 90c5605409 Merge pull request #76 from tidalcycles/more-functions
add `striate()`
2022-04-21 14:21:29 +01:00
alex 3ae6443c59 Tidy test and console logs 2022-04-21 14:17:28 +01:00
alex b370c405da Add pattern composers, implements #82 2022-04-21 14:13:26 +01:00
Felix Roos 36d1a68b9a build 2022-04-20 20:22:50 +02:00
Felix Roos 58bbbecb2d package-lock 2022-04-20 20:19:56 +02:00
Felix Roos 1cdff32b5c Merge pull request #77 from tidalcycles/webaudio-compat
Webaudio in REPL
2022-04-20 20:17:26 +02:00
Felix Roos 7dbdb005b0 fix adsr + add example tune 2022-04-20 20:15:36 +02:00
Felix Roos e6c15dc3c5 add waa example 2022-04-19 21:46:44 +02:00
Felix Roos 1778d19bde Merge remote-tracking branch 'origin/main' into webaudio-compat 2022-04-19 21:35:08 +02:00
alex 56c3c0462c build 2022-04-19 18:16:00 +01:00
Alex McLean 80102353d6 Merge pull request #80 from tidalcycles/webserial
Basic webserial support
2022-04-19 14:31:34 +01:00
alex d7dc158861 Tidy up 2022-04-19 14:28:16 +01:00
alex b52c42c31d First go at serial output 2022-04-19 13:40:01 +01:00
Felix Roos f8739e341b respect midi numbers 2022-04-18 18:57:28 +02:00
Felix Roos 1ead12a2a3 patternify filter 2022-04-18 18:57:02 +02:00
Felix Roos c2feb6e214 remove logs 2022-04-18 18:45:18 +02:00
Felix Roos 3d74b8a2fa Merge commit '83a46c68dc6583ad36b256bc0d03e0913ecbc1f0' into webaudio-compat 2022-04-18 18:33:47 +02:00
Felix Roos 83a46c68dc webaudio@0.0.6 2022-04-18 15:03:11 +02:00
Felix Roos bcefce9df7 package-lock 2022-04-18 14:54:19 +02:00
Felix Roos dcb5af3339 fix: core imports in scheduler 2022-04-18 14:51:47 +02:00
alex 1d56d79757 add striate() 2022-04-17 23:18:01 +01:00
alex 0b370bd40d Make intersection_e actually raise an exception 2022-04-17 18:38:34 +01:00
alex 07a5ae83b5 build 2022-04-17 18:31:20 +01:00
Alex McLean cc60addbaa Merge pull request #75 from tidalcycles/more-tests
Try to fix appLeft / appRight
2022-04-17 18:29:48 +01:00
alex 30b7429169 Fix appLeft/appRight to discard nonmatching events 2022-04-17 18:28:55 +01:00
alex 28ebf6559e Fix steady() 2022-04-17 18:25:38 +01:00
alex 1c6e3dd9a6 A couple of tests for continuous haps/patterns 2022-04-17 18:23:34 +01:00
Felix Roos 6bba661e24 experiment with passing time to withAudioNode 2022-04-17 12:01:13 +02:00
alex eccb20c3b7 Fix choose and add weighted wchoose 2022-04-16 23:23:15 +01:00
Felix Roos f210c4425b make webaudio compatible with repl
+ rename osc to wave
+ migrate repl.html
2022-04-16 21:39:14 +02:00
Felix Roos e0e3ab941e remove experimental tone tutorial 2022-04-16 21:38:23 +02:00
Felix Roos 9cc568fe3e remove tonejs experimental features 2022-04-16 21:36:10 +02:00
Felix Roos a638f9505f test fromMidi + getFrequency 2022-04-16 21:34:19 +02:00
Felix Roos 1b35dd0c55 add preliminary getFrequency 2022-04-16 21:34:05 +02:00
alex d394b4939f build 2022-04-16 18:34:11 +01:00
alex c751d4eb79 Make sure random numbers are positive 2022-04-16 18:32:17 +01:00
alex bb147abb7f Merge branch 'main' of github.com:tidalcycles/strudel 2022-04-16 15:06:02 +01:00
alex 1c3793e2ef Add someCycles and someCyclesBy 2022-04-16 15:05:56 +01:00
alex 1274641f89 Tweak applicative 2022-04-16 15:05:37 +01:00
Felix Roos 803b50535f add repl link 2022-04-16 15:49:40 +02:00
Felix Roos 028af735c9 remove mini for now 2022-04-16 15:46:48 +02:00
Felix Roos d42cd6efaf Publish
- @strudel.cycles/mini@0.0.7
 - @strudel.cycles/webaudio@0.0.5
2022-04-16 15:37:05 +02:00
Felix Roos 2cf129408b use skypack in example 2022-04-16 15:36:49 +02:00
Felix Roos 0ed1c75c38 fix core dependency 2022-04-16 15:35:01 +02:00
Felix Roos 5588b62b40 Publish
- @strudel.cycles/webaudio@0.0.4
2022-04-16 15:24:40 +02:00
Felix Roos 03cb80b75b add core dependeny 2022-04-16 15:24:24 +02:00
Felix Roos 86a3fd6e22 Publish
- @strudel.cycles/webaudio@0.0.3
2022-04-16 15:17:30 +02:00
Felix Roos 27ebe7ba73 stub change 2022-04-16 15:17:02 +02:00
Felix Roos 0ce2dcacef Publish
- @strudel.cycles/core@0.0.5
 - @strudel.cycles/eval@0.0.5
 - @strudel.cycles/midi@0.0.6
 - @strudel.cycles/mini@0.0.6
 - @strudel.cycles/tonal@0.0.5
 - @strudel.cycles/tone@0.0.6
 - @strudel.cycles/xen@0.0.5
2022-04-16 15:14:29 +02:00
Felix Roos 6c8fc6bb21 core publish 2022-04-16 15:12:06 +02:00
Felix Roos 0e26d4e741 Publish
- @strudel.cycles/core@0.0.4
 - @strudel.cycles/eval@0.0.4
 - @strudel.cycles/midi@0.0.5
 - @strudel.cycles/mini@0.0.5
 - @strudel.cycles/osc@0.0.2
 - @strudel.cycles/tonal@0.0.4
 - @strudel.cycles/tone@0.0.5
 - @strudel.cycles/webaudio@0.0.2
 - @strudel.cycles/xen@0.0.4
2022-04-16 15:10:49 +02:00
alex 3d6f01c872 build 2022-04-16 12:39:02 +01:00
alex 4894588284 fix degrade/undegrade 2022-04-16 12:37:47 +01:00
alex 7adea0ac65 build 2022-04-16 12:29:05 +01:00
Alex McLean 138c84cd5f Merge pull request #74 from tidalcycles/more-functions
More random functions
2022-04-16 12:26:57 +01:00
alex d283791f77 Merge branch 'more-functions' of github.com:tidalcycles/strudel into more-functions 2022-04-16 12:24:27 +01:00
alex 911d9d17d6 undegrade, sometimes, sometimesBy, sometimesByPre, often, rarely, almostNever, almostAlways, never, always 2022-04-16 12:19:42 +01:00
alex 8abbaf2e56 undegrade, sometimes, sometimesBy, sometimesByPre, often, rarely, almostNever, almostAlways, never, always 2022-04-16 12:18:44 +01:00
alex dca8b46abf add degrade/degradeBy 2022-04-16 11:40:47 +01:00
Alex McLean 2b968c4387 Merge pull request #73 from tidalcycles/more-functions
Port `perlin` noise, `rangex`, and `palindrome`
2022-04-16 10:13:25 +01:00
alex c88508ace3 tidy 2022-04-16 10:12:01 +01:00
alex b4adbcd6cb Merge branch 'main' into more-functions 2022-04-16 10:10:00 +01:00
alex 031b93f062 fix palindrome 2022-04-16 10:09:47 +01:00
alex f1ac9c4443 perlin noise 2022-04-16 10:03:00 +01:00
alex 544e32e0f8 add 'constant' 2022-04-16 10:02:35 +01:00
Felix Roos f8f806e8eb Merge pull request #26 from tidalcycles/webaudio
webaudio package
2022-04-16 10:26:06 +02:00
Felix Roos 2aed40d99b add example info 2022-04-16 10:24:09 +02:00
Felix Roos d0443a7f41 Merge remote-tracking branch 'origin/HEAD' into webaudio 2022-04-16 10:21:41 +02:00
Felix Roos 1d83ad5282 add randomBells 2022-04-16 00:13:18 +02:00
alex 8fda84c15a palindrome 2022-04-15 22:42:03 +01:00
alex 939bc643be rangex 2022-04-15 22:41:39 +01:00
alex c163039c6e build 2022-04-15 22:06:02 +01:00
Felix Roos 9c6652b19d remove old imports 2022-04-15 21:45:55 +02:00
Felix Roos 2510399017 Merge remote-tracking branch 'origin/HEAD' into webaudio 2022-04-15 20:54:33 +02:00
Felix Roos 9d2cbbaa2c fix notes example 2022-04-15 20:40:58 +02:00
Alex McLean f47d4d0c9d Merge pull request #70 from tidalcycles/more-functions
More randomness, fix `rand`, and add `brand`, `irand` and `choose`
2022-04-15 19:18:06 +01:00
alex f41d89515c Merge branch 'main' into more-functions 2022-04-15 19:15:32 +01:00
alex ea16d6b050 Add choose, fix rand to be unipolar. 2022-04-15 16:05:48 +01:00
alex 19f7dc1657 add brand (boolean rand) and brandBy 2022-04-15 15:05:30 +01:00
alex b674014377 Ignore continuous haps (those without a whole) 2022-04-15 15:04:16 +01:00
Alex McLean 802ed9d481 Merge pull request #69 from tidalcycles/more-functions
First effort at rand()
2022-04-15 10:29:51 +01:00
alex 1f1b20041c Merge branch 'main' of github.com:tidalcycles/strudel into more-functions 2022-04-15 10:15:12 +01:00
alex 3ae0762f62 First effort at rand() 2022-04-15 10:14:51 +01:00
alex 89934886f7 initial demo submission 2022-04-15 08:55:53 +01:00
Felix Roos 233cc4bdc4 update task instructions 2022-04-15 09:33:46 +02:00
alex f278c85f2a more citations 2022-04-14 20:55:07 +01:00
Felix Roos 8dde34565a add speakerman 2022-04-14 19:06:33 +02:00
Felix Roos 14774ae687 build 2022-04-14 18:26:53 +02:00
Felix Roos ed4156530b add build script 2022-04-14 18:18:53 +02:00
Felix Roos 45e8cd104b package-lock 2022-04-14 17:42:51 +02:00
Felix Roos fc195eae1e Merge pull request #68 from tidalcycles/osc-fixed
use new fixed version of osc-js package
2022-04-14 17:41:18 +02:00
Felix Roos 18d8049f37 use new fixed version of osc-js package 2022-04-14 17:37:44 +02:00
alex 21e328569b A bit more blah blah 2022-04-14 09:12:56 +01:00
Felix Roos ff32485f67 fix header 2022-04-14 00:35:15 +02:00
Felix Roos d718eb0be2 add readme 2022-04-14 00:32:45 +02:00
Felix Roos 325eec2c6f refactor scheduler constructor + add onEvent 2022-04-14 00:32:41 +02:00
Felix Roos 5629c0ee72 npm i 2022-04-14 00:32:09 +02:00
alex 369604aa42 Merge branch 'main' of github.com:tidalcycles/strudel into paper 2022-04-13 23:16:07 +01:00
Felix Roos db20ff93c7 fix lockfile 2022-04-14 00:15:27 +02:00
Felix Roos 192eb28ac7 Merge remote-tracking branch 'origin/main' into webaudio 2022-04-14 00:12:47 +02:00
alex 023da097a1 A bit of background 2022-04-13 23:09:53 +01:00
Felix Roos 02738a0694 Merge pull request #67 from tidalcycles/speak
Speech output
2022-04-14 00:09:17 +02:00
Felix Roos 61892bdf3d fix minirepl import 2022-04-13 23:58:51 +02:00
Felix Roos 02ece1183e export patternify 2022-04-13 23:58:44 +02:00
Felix Roos 38fe310a7c fix import 2022-04-13 23:58:34 +02:00
Felix Roos 70fbbd65e9 Merge remote-tracking branch 'origin/main' into speak 2022-04-13 23:58:24 +02:00
Alex McLean 2973223fb1 Merge pull request #62 from tidalcycles/tidy-modules
Separate out strudel.mjs, make index.mjs aggregate module
2022-04-13 22:55:32 +01:00
Felix Roos 1dd19c0831 add speak output 2022-04-13 23:25:55 +02:00
Felix Roos 16e2c97e0c export patternify helpers 2022-04-13 23:25:18 +02:00
alex 050296d0c2 make separate signal module 2022-04-13 17:41:48 +01:00
alex f75da0e2e3 separate out strudel.mjs, make index.mjs aggregate module 2022-04-13 17:25:02 +01:00
Alex McLean 0396c3f475 Merge pull request #61 from tidalcycles/more-functions
More functions
2022-04-13 16:26:45 +01:00
alex 97044fee16 build 2022-04-13 16:25:58 +01:00
alex ca4bffe5a1 compress 2022-04-13 16:20:34 +01:00
alex 0df67fa920 patternify zoom 2022-04-13 16:04:57 +01:00
alex ec3371c4ff Allow linger to accept non-fractions 2022-04-13 15:59:36 +01:00
alex dcc5f66691 Merge branch 'main' of github.com:tidalcycles/strudel into more-functions 2022-04-13 15:51:36 +01:00
alex ec10f349bd Add _zoom and linger 2022-04-13 15:51:23 +01:00
Alex McLean 3b9e854042 Merge pull request #56 from tidalcycles/more-functions
More functions
2022-04-13 09:04:29 +01:00
alex 9eba883978 move some utilities to utils.mjs 2022-04-13 09:03:31 +01:00
alex fb826bed70 sort classes to top of export list 2022-04-13 08:44:38 +01:00
alex 2797856f50 sort exports 2022-04-13 08:40:04 +01:00
alex ad69fa19b6 Prettify 2022-04-13 08:38:08 +01:00
alex 0ad80c1af9 fix citations 2022-04-12 23:49:21 +01:00
Felix Roos 2060e86875 add queryArc + update readme 2022-04-13 00:25:53 +02:00
Felix Roos 87605ca25e Merge branch 'main' of https://github.com/tidalcycles/strudel 2022-04-13 00:15:39 +02:00
Felix Roos 3cd10bf4b3 package-lock 2022-04-13 00:15:36 +02:00
Felix Roos 6bdb0fee55 fix server import 2022-04-13 00:15:09 +02:00
alex 7182894eb6 reference links 2022-04-12 23:14:06 +01:00
Felix Roos 42e2531e8d readme additions 2022-04-13 00:09:04 +02:00
Felix Roos 171f845069 add setup script 2022-04-12 23:54:56 +02:00
Felix Roos f9b043dc7e remove osc-js folder + remove umd stuff 2022-04-12 23:54:13 +02:00
Felix Roos e069e66952 patch osc for client 2022-04-12 23:42:46 +02:00
Felix Roos c9d7a2f313 osc instructions 2022-04-12 22:58:13 +02:00
alex c69af72060 Merge branch 'main' of github.com:tidalcycles/strudel 2022-04-12 21:49:32 +01:00
alex 4111a12cbf hard temporary fork of osc-js 2022-04-12 21:48:48 +01:00
alex 57c1c4e016 more info 2022-04-12 21:48:29 +01:00
alex 324dcd7ef8 use local osc.js 2022-04-12 21:48:11 +01:00
Felix Roos c604f920a0 add root scripts 2022-04-12 20:14:48 +02:00
Felix Roos f8cbd67557 fix: disable highlighting 2022-04-12 20:14:08 +02:00
alex 3c31891774 Add range2 2022-04-12 17:53:40 +01:00
alex 0e5dc4f368 add range 2022-04-12 17:48:09 +01:00
alex e75d8048fe rename range > listRange and remove from exports 2022-04-12 16:54:27 +01:00
alex 7c10d171f6 patternify jux, add juxBy 2022-04-12 16:49:27 +01:00
Alex McLean 5aa01ce91c Merge pull request #27 from tidalcycles/osc
OSC and SuperDirt support
2022-04-12 16:04:04 +01:00
Alex McLean 86bb92d3be Merge pull request #50 from tidalcycles/chop
Implement `chop()`
2022-04-12 12:24:14 +01:00
alex e199564415 Patternify chop() 2022-04-12 12:22:04 +01:00
alex 51db0eaf40 Test and fix chop / squeezebind 2022-04-12 12:16:02 +01:00
alex 83c9200e7d Prettify 2022-04-12 12:01:19 +01:00
alex 529d448383 squeezeBind itself + tidying 2022-04-12 12:00:39 +01:00
alex 8ea59067ce rename inner <> outer bind and join 2022-04-12 11:55:56 +01:00
Alex McLean ac5c844f0b Merge pull request #48 from tidalcycles/squeezejoin
First run at squeezeBind, ref #32
2022-04-12 11:37:32 +01:00
alex b10e0c3a15 Add ply() 2022-04-12 11:31:20 +01:00
alex c2cc6b6dc8 Working squeezeBind 2022-04-12 11:22:53 +01:00
alex 357b0ee467 First run at squeezeBind, ref #32 2022-04-12 10:53:22 +01:00
Alex McLean ac409965d5 Merge pull request #44 from tidalcycles/fix-polymeter
Fix polymeter
2022-04-11 23:03:37 +01:00
alex c596fe33a9 Fix polymeter 2022-04-11 23:01:26 +01:00
Felix Roos 914bc117a1 some loose references 2022-04-11 23:26:17 +02:00
Felix Roos 4dbe366978 just a little plumber tune 2022-04-11 23:25:13 +02:00
Felix Roos 7ca8c8d298 fix "every" example 2022-04-11 23:07:53 +02:00
Felix Roos cf7b2b2acf Merge pull request #40 from tidalcycles/compose
Compose
2022-04-11 22:39:43 +02:00
Felix Roos 81598aefce remove ramda dep + update lockfiles 2022-04-11 22:37:28 +02:00
Felix Roos 9effc166bb use own compose 2022-04-11 22:32:53 +02:00
Felix Roos de3c453763 add pipe + compose 2022-04-11 22:31:02 +02:00
Alex McLean 9da114d965 Merge branch 'main' into osc 2022-04-11 21:10:37 +01:00
Felix Roos 3f603eb84f Merge pull request #38 from bwagner/patch-2
Update tutorial.mdx
2022-04-11 21:49:34 +02:00
Bernhard Wagner 3f1df8faa6 Update tutorial.mdx 2022-04-11 18:08:23 +02:00
Felix Roos 2a3af80deb Merge pull request #37 from bwagner/patch-1
Update tutorial.mdx
2022-04-11 08:43:44 +02:00
Bernhard Wagner abfff8bcf1 Update tutorial.mdx
seperating -> separating
2022-04-11 08:34:11 +02:00
Felix Roos c6d7dabada Create CONTRIBUTING.md 2022-04-10 01:01:02 +02:00
Felix Roos 0c61bb0063 Update featurelist.md
tick some boxes
2022-04-09 22:10:27 +02:00
Felix Roos 0f003abf52 Merge remote-tracking branch 'origin/HEAD' into paper 2022-04-09 18:35:44 +02:00
Felix Roos 80393bf765 Publish
- @strudel.cycles/core@0.0.3
 - @strudel.cycles/eval@0.0.3
 - @strudel.cycles/midi@0.0.4
 - @strudel.cycles/mini@0.0.4
 - @strudel.cycles/tonal@0.0.3
 - @strudel.cycles/tone@0.0.4
 - @strudel.cycles/xen@0.0.3
2022-04-05 23:44:40 +02:00
Felix Roos f43ecf1a85 fix readme instructions 2022-04-05 23:41:10 +02:00
Felix Roos a242c0654b dont create defaultSynth on start 2022-04-05 23:40:21 +02:00
Felix Roos fb1976a6bc add .range 2022-04-05 23:37:27 +02:00
Felix Roos 0e7b345010 some more sprinkles of text 2022-04-05 23:37:14 +02:00
Felix Roos fd28cfc4f8 dont create defaultSynth on start 2022-04-05 23:36:37 +02:00
Felix Roos b20467d6e3 add more shapeshifter flags 2022-04-03 00:45:51 +02:00
Felix Roos 068b95eacb add shapeshifter snippets 2022-04-03 00:44:30 +02:00
Felix Roos 95e4239fd5 pattern comparison snippets 2022-04-03 00:04:00 +02:00
Felix Roos 05c900d291 patch osc-js browser version 2022-04-03 00:03:18 +02:00
Felix Roos f698078f94 add sound synonm 2022-04-03 00:03:05 +02:00
Felix Roos a54b6f0359 Merge remote-tracking branch 'origin/osc' into paper 2022-04-03 00:02:21 +02:00
Felix Roos c8e9fe519f osc timing now hopefully works everywhere 2022-04-02 22:41:04 +02:00
Felix Roos 0c726d835d fix keybindings on safari 2022-04-02 22:40:35 +02:00
Felix Roos 86b1e992a1 fix absolute time 2022-04-02 21:46:56 +02:00
alex c3b15fffa4 remove duplication 2022-04-02 18:48:30 +01:00
alex 7bbac0ed23 newline 2022-04-02 18:40:27 +01:00
alex 1fb1d15d4c add all the superdirt controls 2022-04-02 18:38:20 +01:00
alex 64ea9b7c8b controls (renamed from packages/osc/superdirt.mjs 2022-04-02 17:32:36 +01:00
Felix Roos 5a03386ad5 package-lock 2022-04-02 18:14:10 +02:00
alex acca363a4e move osc/superdirt to core/controls 2022-04-02 16:06:42 +01:00
alex e28a411408 Make param args a sequence, remove some redundancy 2022-04-02 16:03:50 +01:00
alex 89a7bd4e7d superdirt parameters 2022-04-01 23:17:52 +01:00
alex 46b2e82b43 formatting 2022-04-01 23:15:54 +01:00
alex 723b239fda formatting 2022-04-01 23:15:39 +01:00
Felix Roos bfb757b3b1 remove logs 2022-04-01 21:02:11 +02:00
Felix Roos 7fb9c3bf1e move core repl + add package 2022-04-01 20:54:54 +02:00
alex bf7c8cebc4 tidy 2022-04-01 15:38:06 +01:00
alex ac01a621be workaround for osc-js timestamp bug, reduce latency 2022-04-01 15:37:50 +01:00
Felix Roos 47a046ca1d begin webaudio package 2022-04-01 15:44:17 +02:00
Felix Roos 4ef70d2a15 Merge branch 'osc' of https://github.com/tidalcycles/strudel into osc 2022-03-29 22:17:46 +02:00
Felix Roos ee0d835cd8 add core examples 2022-03-29 22:16:36 +02:00
alex 330263028e it seems the custom handler wasn't being used 2022-03-29 17:04:00 +01:00
alex d0d19778a4 try sending osc in timestamped bundle with added latency 2022-03-29 17:03:30 +01:00
alex 0bfbd87bbf try to send osc as timestamped bundle 2022-03-29 16:39:52 +01:00
alex ba095d8e7f Stop failing on no tests 2022-03-29 15:36:56 +01:00
alex 0b8919de61 send actual osc parameters 2022-03-29 08:12:34 +01:00
alex 7fca7e6bd9 attempt to send an OSC message 2022-03-28 22:10:20 +01:00
alex 69884c61b4 first (broken) attempt 2022-03-28 21:41:49 +01:00
Felix Roos ed6cf2ecf1 enlarge button 2022-03-28 21:24:44 +02:00
Felix Roos 0be0347f8b basic communication with superdirt 2022-03-28 21:22:24 +02:00
601 changed files with 91175 additions and 61296 deletions
+20
View File
@@ -0,0 +1,20 @@
krill-parser.js
krill.pegjs
.eslintrc.json
server.js
tidal-sniffer.js
*.jsx
tunejs.js
out/**
postcss.config.js
postcss.config.cjs
tailwind.config.js
tailwind.config.cjs
vite.config.js
/**/dist/**/*
!**/*.mjs
**/*.tsx
**/*.ts
**/*.json
**/dev-dist
**/dist
+17
View File
@@ -0,0 +1,17 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": ["eslint:recommended"],
"overrides": [],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["import"],
"rules": {
"no-unused-vars": ["warn", { "destructuredArrayIgnorePattern": ".", "ignoreRestSiblings": false }],
"import/no-extraneous-dependencies": ["error", {"devDependencies": true}]
}
}
+49
View File
@@ -0,0 +1,49 @@
name: Build and Deploy
on: [workflow_dispatch]
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
deployments: write
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v2
with:
version: 7
- uses: actions/setup-node@v3
with:
node-version: 18
cache: "pnpm"
- name: Install Dependencies
run: pnpm install
- name: Build
run: pnpm build
- name: Setup Pages
uses: actions/configure-pages@v2
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
# Upload entire repository
path: "./website/dist"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
+62
View File
@@ -0,0 +1,62 @@
name: Tauri Builder
on:
push:
tags:
- "v*"
workflow_dispatch:
jobs:
release:
strategy:
fail-fast: false
matrix:
platform: [macos-latest, ubuntu-latest, windows-latest]
include:
- os: ubuntu-latest
rust_target: x86_64-unknown-linux-gnu
- os: macos-latest
rust_target: x86_64-apple-darwin
- os: macos-latest
rust_target: aarch64-apple-darwin
- os: windows-latest
rust_target: x86_64-pc-windows-msvc
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8.6.2
- name: Node.js setup
uses: actions/setup-node@v3
with:
node-version: latest
# node-version-file: '.nvmrc'
- name: Install Rust (Stable)
run:
curl https://sh.rustup.rs -sSf | sh -s -- -y
- name: Install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
- name: Install app dependencies from lockfile and build web
run: pnpm install
- name: Build the app
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# tauri-action replaces \_\_VERSION\_\_ with the app version
tagName: ${{ github.ref_name }}
releaseName: "Strudel v__VERSION__"
releaseBody: |
See the assets to download this version and install.
releaseDraft: true
prerelease: false
+13 -8
View File
@@ -7,13 +7,18 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16, 17]
node-version: [18]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm install
- run: npm test
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v2
with:
version: 7
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- run: pnpm install
- run: pnpm run format-check
- run: pnpm run lint
- run: pnpm test
+18 -1
View File
@@ -1,4 +1,5 @@
dist
out
!docs/dist
dist-*
cabal-dev
@@ -26,4 +27,20 @@ node_modules/
.DS_Store
repl-parcel
mytunes.ts
doc
doc
out
.parcel-cache
repl_old
tutorial.rendered.mdx
doc.json
talk/public/EmuSP12
talk/public/samples
server/samples/old
repl/stats.html
coverage
public/icons/apple-splash-*
dev-dist
Dirt-Samples
tidal-drum-machines
webaudiofontdata
src-tauri/target
+12
View File
@@ -0,0 +1,12 @@
*.md
*.json
*.yml
*.
**/out
**/dist
packages/mini/krill-parser.js
packages/xen/tunejs.js
paper
pnpm-lock.yaml
pnpm-workspace.yaml
**/dev-dist
+14 -15
View File
@@ -1,16 +1,15 @@
{
"printWidth": 120,
"useTabs": false,
"tabWidth": 2,
"semi": true,
"singleQuote": true,
"jsxSingleQuote": false,
"trailingComma": "all",
"bracketSpacing": true,
"jsxBracketSameLine": false,
"arrowParens": "always",
"proseWrap": "preserve",
"htmlWhitespaceSensitivity": "css",
"endOfLine": "lf"
}
"printWidth": 120,
"useTabs": false,
"tabWidth": 2,
"semi": true,
"singleQuote": true,
"jsxSingleQuote": false,
"trailingComma": "all",
"bracketSpacing": true,
"bracketSameLine": false,
"arrowParens": "always",
"proseWrap": "preserve",
"htmlWhitespaceSensitivity": "css",
"endOfLine": "lf"
}
+5 -1
View File
@@ -2,5 +2,9 @@
"cSpell.words": [
"subspan",
"vals"
]
],
"yaml.schemas": {
"https://json.schemastore.org/github-workflow.json": "file:///home/felix/projects/strudel/.github/workflows/deploy.yml"
},
"testing.automaticallyOpenPeekView": "never"
}
+149
View File
@@ -0,0 +1,149 @@
# 🌀 Contributing to Strudel 🌀
Thanks for wanting to contribute!!! There are many ways you can add value to this project
## Communication Channels
To get in touch with the contributors, either
- open a [github discussion](https://github.com/tidalcycles/strudel/discussions) or
- [join the Tidal Discord Channel](https://discord.gg/remJ6gQA) and go to the #strudel channel
- Find related discussions on the [tidal club forum](https://club.tidalcycles.org/)
## Ask a Question
If you have any questions about strudel, make sure you've glanced through the
[docs](https://strudel.tidalcycles.org/learn/) to find out if it answers your question.
If not, use one of the Communication Channels above!
Don't be afraid to ask! Your question might be of great value for other people too.
## Give Feedback
No matter if you've used the Strudel REPL or if you are using the strudel packages, we are happy to hear some feedback.
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.
## Improve the Docs
If you find some weak spots in the [docs](https://strudel.tidalcycles.org/workshop/getting-started/),
you can edit each file directly on github via the "Edit this page" link located in the right sidebar.
## 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!
## 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://github.com/tidalcycles/strudel/issues).
Please check that it has not been reported before.
## Fix a Bug
To fix a bug that has been reported,
1. check that nobody else is already fixing it and respond to the issue to let people know you're on it
2. fork the repository
3. make sure you've setup the project (see below)
4. hopefully fix the bug
5. make sure the tests pass
6. send a pull request
## Write Tests
There are still many tests that have not been written yet! Reading and writing tests is a great opportunity to get familiar with the codebase.
You can find the tests in each package in the `test` folder. To run all tests, run `pnpm test` from the root folder.
## Project Setup
To get the project up and running for development, make sure you have installed:
- [git](https://git-scm.com/)
- [node](https://nodejs.org/en/) >= 18
- [pnpm](https://pnpm.io/) (`npm i pnpm -g`)
then, do the following:
```sh
git clone https://github.com/tidalcycles/strudel.git && cd strudel
pnpm i # install at root to symlink packages
pnpm start # start repl
```
Those commands might look slightly different for your OS.
Please report any problems you've had with the setup instructions!
## Code Style
To make sure the code changes only where it should, we are using prettier to unify the code style.
- You can format all files at once by running `pnpm prettier` from the project root
- Run `pnpm format-check` from the project root to check if all files are well formatted
If you use VSCode, you can
1. install [the prettier extension](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)
2. open command palette and run "Format Document With..."
3. Choose "Configure Default Formatter..."
4. Select prettier
## ESLint
To prevent unwanted runtime errors, this project uses [eslint](https://eslint.org/).
- You can check for lint errors by running `pnpm lint`
There are also eslint extensions / plugins for most editors.
## Running Tests
- Run all tests with `pnpm test`
- Run all tests with UI using `pnpm test-ui`
## 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`
## Package Workflow
The project is split into multiple [packages](https://github.com/tidalcycles/strudel/tree/main/packages) with independent versioning.
When you run `pnpm i` on the root folder, [pnpm workspaces](https://pnpm.io/workspaces) will install all dependencies of all subpackages. This will allow any js file to import `@strudel.cycles/<package-name>` to get the local version,
allowing to develop multiple packages at the same time.
## Package Publishing
To publish all packages that have been changed since the last release, run:
```sh
npm login
# this will increment all the versions in package.json files of non private packages to selected versions
npx lerna version --no-private
# publish all packages inside /packages using pnpm! don't use lerna to publish!!
pnpm --filter "./packages/**" publish --dry-run
# the last command was only a dry-run, make sure everything looks ok, if yes, run the same command without flag
```
To manually publish a single package, increase the version in the `package.json`, then run `pnpm publish`.
Important: Always publish with `pnpm`, as `npm` does not support overriding main files in `publishConfig`, which is done in all the packages.
### New Packages
To add a new package, you have to publish it manually the first time, using:
```sh
cd packages/<package-name> && pnpm publish --access public
```
## Have Fun
Remember to have fun, and that this project is driven by the passion of volunteers!
+64 -77
View File
@@ -1,5 +1,5 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
@@ -7,17 +7,15 @@
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
@@ -26,44 +24,34 @@ them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
@@ -72,7 +60,7 @@ modification follow.
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
@@ -549,35 +537,45 @@ to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
@@ -635,40 +633,29 @@ the "copyright" line and a pointer to where the full notice is found.
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
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 General Public License for more details.
GNU Affero General Public License for more details.
You should have received a copy of the GNU General Public License
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/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
For more information on this, and how to apply and follow the GNU AGPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.
+33 -22
View File
@@ -2,42 +2,53 @@
[![Strudel test status](https://github.com/tidalcycles/strudel/actions/workflows/test.yml/badge.svg)](https://github.com/tidalcycles/strudel/actions)
An experiment in making a [Tidal](https://github.com/tidalcycles/tidal/) using web technologies. This is unstable software, please tread carefully.
An experiment in making a [Tidal](https://github.com/tidalcycles/tidal/) using web technologies. This software is slowly stabilising, but please continue to tread carefully.
Try it here: https://strudel.tidalcycles.org/
- Try it here: <https://strudel.tidalcycles.org/>
- Docs: <https://strudel.tidalcycles.org/learn/>
- Technical Blog Post: <https://loophole-letters.vercel.app/strudel>
- 1 Year of Strudel Blog Post: <https://loophole-letters.vercel.app/strudel1year>
Tutorial: https://strudel.tidalcycles.org/tutorial/
## Running Locally
## Local development
Run the REPL locally:
After cloning the project, you can run the REPL locally:
```bash
npm install
npx lerna bootstrap
cd repl
npm install
npm run start
pnpm run setup
pnpm run repl
```
## Publish Packages
## Using Strudel In Your Project
To publish, just run:
There are multiple npm packages you can use to use strudel, or only parts of it, in your project:
```sh
npx lerna version
```
- [`core`](./packages/core/): tidal pattern engine
- [`mini`](./packages/mini): mini notation parser + core binding
- [`eval`](./packages/eval): user code evaluator. syntax sugar + highlighting
- [`tone`](./packages/tone): bindings for Tone.js instruments and effects
- [`osc`](./packages/osc): bindings to communicate via OSC
- [`midi`](./packages/midi): webmidi bindings
- [`serial`](./packages/serial): webserial bindings
- [`tonal`](./packages/tonal): tonal functions
- [`xen`](./packages/xen): microtonal / xenharmonic functions
- ... [and there are more](./packages/)
This will publish all packages that changed since the last version.
Click on the package names to find out more about each one.
## Style
## Contributing
For now, please try to copy the style of surrounding code. VS Code users can install the 'prettier' add-on which will use the .prettierrc configuration file for automatic formatting.
There are many ways to contribute to this project! See [contribution guide](./CONTRIBUTING.md).
<a href="https://github.com/tidalcycles/strudel/graphs/contributors">
<img src="https://contrib.rocks/image?repo=tidalcycles/strudel" />
</a>
Made with [contrib.rocks](https://contrib.rocks).
## Community
There is a #strudel channel on the TidalCycles discord: https://discord.com/invite/HGEdXmRkzT
There is a #strudel channel on the TidalCycles discord: <https://discord.com/invite/HGEdXmRkzT>
You can also ask questions and find related discussions on the tidal club forum: https://club.tidalcycles.org/
You can also ask questions and find related discussions on the tidal club forum: <https://club.tidalcycles.org/>
The discord and forum is shared with the haskell (tidal) and python (vortex) siblings of this project.
The discord and forum is shared with the haskell (tidal) and python (vortex) siblings of this project.
+1806
View File
File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 150 KiB

View File
-16
View File
@@ -1,16 +0,0 @@
{
"files": {
"main.css": "/static/css/main.0d689283.css",
"main.js": "/static/js/main.77e38ada.js",
"static/js/787.8f7ec9e0.chunk.js": "/static/js/787.8f7ec9e0.chunk.js",
"static/media/logo.svg": "/static/media/logo.ac95051720b3dccfe511e0e02d8e1029.svg",
"index.html": "/index.html",
"main.0d689283.css.map": "/static/css/main.0d689283.css.map",
"main.77e38ada.js.map": "/static/js/main.77e38ada.js.map",
"787.8f7ec9e0.chunk.js.map": "/static/js/787.8f7ec9e0.chunk.js.map"
},
"entrypoints": [
"static/css/main.0d689283.css",
"static/js/main.77e38ada.js"
]
}
-1
View File
@@ -1 +0,0 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Strudel REPL"/><title>Strudel REPL</title><script defer="defer" src="/static/js/main.77e38ada.js"></script><link href="/static/css/main.0d689283.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-2
View File
@@ -1,2 +0,0 @@
"use strict";(self.webpackChunk_strudel_repl=self.webpackChunk_strudel_repl||[]).push([[787],{787:function(e,t,n){n.r(t),n.d(t,{getCLS:function(){return y},getFCP:function(){return g},getFID:function(){return C},getLCP:function(){return P},getTTFB:function(){return D}});var i,r,a,o,u=function(e,t){return{name:e,value:void 0===t?-1:t,delta:0,entries:[],id:"v2-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12)}},c=function(e,t){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){if("first-input"===e&&!("PerformanceEventTiming"in self))return;var n=new PerformanceObserver((function(e){return e.getEntries().map(t)}));return n.observe({type:e,buffered:!0}),n}}catch(e){}},f=function(e,t){var n=function n(i){"pagehide"!==i.type&&"hidden"!==document.visibilityState||(e(i),t&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0)},s=function(e){addEventListener("pageshow",(function(t){t.persisted&&e(t)}),!0)},m=function(e,t,n){var i;return function(r){t.value>=0&&(r||n)&&(t.delta=t.value-(i||0),(t.delta||void 0===i)&&(i=t.value,e(t)))}},v=-1,p=function(){return"hidden"===document.visibilityState?0:1/0},d=function(){f((function(e){var t=e.timeStamp;v=t}),!0)},l=function(){return v<0&&(v=p(),d(),s((function(){setTimeout((function(){v=p(),d()}),0)}))),{get firstHiddenTime(){return v}}},g=function(e,t){var n,i=l(),r=u("FCP"),a=function(e){"first-contentful-paint"===e.name&&(f&&f.disconnect(),e.startTime<i.firstHiddenTime&&(r.value=e.startTime,r.entries.push(e),n(!0)))},o=window.performance&&performance.getEntriesByName&&performance.getEntriesByName("first-contentful-paint")[0],f=o?null:c("paint",a);(o||f)&&(n=m(e,r,t),o&&a(o),s((function(i){r=u("FCP"),n=m(e,r,t),requestAnimationFrame((function(){requestAnimationFrame((function(){r.value=performance.now()-i.timeStamp,n(!0)}))}))})))},h=!1,T=-1,y=function(e,t){h||(g((function(e){T=e.value})),h=!0);var n,i=function(t){T>-1&&e(t)},r=u("CLS",0),a=0,o=[],v=function(e){if(!e.hadRecentInput){var t=o[0],i=o[o.length-1];a&&e.startTime-i.startTime<1e3&&e.startTime-t.startTime<5e3?(a+=e.value,o.push(e)):(a=e.value,o=[e]),a>r.value&&(r.value=a,r.entries=o,n())}},p=c("layout-shift",v);p&&(n=m(i,r,t),f((function(){p.takeRecords().map(v),n(!0)})),s((function(){a=0,T=-1,r=u("CLS",0),n=m(i,r,t)})))},E={passive:!0,capture:!0},w=new Date,L=function(e,t){i||(i=t,r=e,a=new Date,F(removeEventListener),S())},S=function(){if(r>=0&&r<a-w){var e={entryType:"first-input",name:i.type,target:i.target,cancelable:i.cancelable,startTime:i.timeStamp,processingStart:i.timeStamp+r};o.forEach((function(t){t(e)})),o=[]}},b=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){L(e,t),r()},i=function(){r()},r=function(){removeEventListener("pointerup",n,E),removeEventListener("pointercancel",i,E)};addEventListener("pointerup",n,E),addEventListener("pointercancel",i,E)}(t,e):L(t,e)}},F=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,b,E)}))},C=function(e,t){var n,a=l(),v=u("FID"),p=function(e){e.startTime<a.firstHiddenTime&&(v.value=e.processingStart-e.startTime,v.entries.push(e),n(!0))},d=c("first-input",p);n=m(e,v,t),d&&f((function(){d.takeRecords().map(p),d.disconnect()}),!0),d&&s((function(){var a;v=u("FID"),n=m(e,v,t),o=[],r=-1,i=null,F(addEventListener),a=p,o.push(a),S()}))},k={},P=function(e,t){var n,i=l(),r=u("LCP"),a=function(e){var t=e.startTime;t<i.firstHiddenTime&&(r.value=t,r.entries.push(e),n())},o=c("largest-contentful-paint",a);if(o){n=m(e,r,t);var v=function(){k[r.id]||(o.takeRecords().map(a),o.disconnect(),k[r.id]=!0,n(!0))};["keydown","click"].forEach((function(e){addEventListener(e,v,{once:!0,capture:!0})})),f(v,!0),s((function(i){r=u("LCP"),n=m(e,r,t),requestAnimationFrame((function(){requestAnimationFrame((function(){r.value=performance.now()-i.timeStamp,k[r.id]=!0,n(!0)}))}))}))}},D=function(e){var t,n=u("TTFB");t=function(){try{var t=performance.getEntriesByType("navigation")[0]||function(){var e=performance.timing,t={entryType:"navigation",startTime:0};for(var n in e)"navigationStart"!==n&&"toJSON"!==n&&(t[n]=Math.max(e[n]-e.navigationStart,0));return t}();if(n.value=n.delta=t.responseStart,n.value<0||n.value>performance.now())return;n.entries=[t],e(n)}catch(e){}},"complete"===document.readyState?setTimeout(t,0):addEventListener("load",(function(){return setTimeout(t,0)}))}}}]);
//# sourceMappingURL=787.8f7ec9e0.chunk.js.map
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-56
View File
@@ -1,56 +0,0 @@
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
/**
* @license Fraction.js v4.2.0 05/03/2022
* https://www.xarg.org/2014/03/rational-numbers-in-javascript/
*
* Copyright (c) 2021, Robert Eisele (robert@xarg.org)
* Dual licensed under the MIT or GPL Version 2 licenses.
**/
/**
* Tone.js
* @author Yotam Mann
* @license http://opensource.org/licenses/MIT MIT License
* @copyright 2014-2019 Yotam Mann
*/
/** @license React v0.20.2
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/** @license React v17.0.2
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/** @license React v17.0.2
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/** @license React v17.0.2
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-1
View File
@@ -1 +0,0 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><link rel="icon" href="/tutorial/favicon.e3ab9dd9.ico"><link rel="stylesheet" type="text/css" href="/tutorial/index.999678aa.css"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="description" content="Strudel REPL"><title>Strudel Tutorial</title></head><body> <div id="root"></div> <noscript>You need to enable JavaScript to run this app.</noscript> <script src="/tutorial/index.097d520a.js" defer></script> </body></html>
-128
View File
@@ -1,128 +0,0 @@
# Tidal Features in Strudel
## Basics
- [ ] drawLine
- [ ] setcps
- [ ] naming patterns? block based evaluation?
- [ ] once
- [ ] silence
- [x] hush
- [ ] panic
## Concatenation
https://tidalcycles.org/docs/patternlib/tour/concatenation
- [x] cat: is synonym to fastcat in strudel, while [in tidal, cat is slowcat](https://tidalcycles.org/docs/patternlib/tour/concatenation#cat)
- [x] fastcat
- [x] timeCat: why is this camel case?
- [ ] randcat
- [x] append: but is like fastAppend in tidal
- [ ] fastAppend
- [ ] slowAppend
- [ ] wedge
- [ ] brak
- [ ] flatpat
## Accumulation
- [ ] overlay => like stack? "The overlay function is similar to cat" => wrong?
- [ ] `<>` operator (=== overlay)
- [x] stack
- [x] superimpose => strudel supports multiple args => is this layer?
- [ ] layer => is this like superimpose but with multiple args?
- [ ] steps ?
- [ ] iter, iter'
## Alteration
- [ ] range, rangex
- [ ] quantise
- [ ] ply
- [ ] stutter
- [ ] stripe, slowstripe
- [ ] palindrome = every(2, rev)
- [ ] trunc
- [ ] linger
- [ ] chunk, chunk'
- [ ] shuffle
- [ ] scramble
- [ ] rot
- [ ] step / step'
- [ ] lindenmeyer
- [ ] spread / spreadf / fastspread
- [ ] spreadChoose / spreadr
## conditions
- [x] every
- [ ] every'
- [ ] whenmod
- [ ] sometimes, sometimesBy, someCycles, someCyclesBy
- [ ] choose, chooseby, wchoose, wchooseby
- [x] struct
- [x] mask
- [ ] sew
- [ ] stitch
- [ ] select, selectF
- [ ] pickF
- [ ] squeeze
- [ ] euclid, euclidInv, euclidFull
- [ ] ifp
## Time
- [x] fast
- [x] fastGap
- [x] slow
- [ ] hurry
- [ ] compress: is this compressSpan?
- [ ] zoom
- [ ] within
- [x] off
- [ ] rotL / rotR
- [x] rev
- [ ] jux / juxBy
- [ ] swingBy / swing
- [ ] ghost
- [ ] inside / outside
## Harmony & Melody
- [x] scale
- [ ] scaleList
- [ ] getScale
- [ ] toScale
- [ ] chordList
- [ ] arpeggiate
- [ ] arp
## Transitions
- [ ] anticipate / anticipateIn
- [ ] clutch / clutchIn
- [ ] histpan
- [ ] interpolate / interpolateIn
- [ ] jump / jumpIn / jumpIn' / jumpMod
- [ ] wait / waitT
- [ ] wash / washIn
- [ ] xfade / xfadeIn
## Sampling
- [ ] chop
- [ ] striate / striateBy
- [ ] loopAt
- [ ] segment
- [ ] discretise
## Randomness
- [ ] rand / irand
- [ ] perlin / perlinWith / perlin2 / perlin2With
## Composition
- [ ] ur
- [ ] seqP / seqPLoop
-14
View File
@@ -1,14 +0,0 @@
<!DOCTYPE html>
<script>import("./strudel.js").then(m => strudel = m)
</script>
<html>
<head>
<title>Bingo</title>
</head>
<body>
<button onclick="foo()">hello</button>
<button onclick="bar()">hello</button>
<script type="module" src="./strudel.js"></script>
</body>
</html>
+17
View File
@@ -0,0 +1,17 @@
// this barrel export is currently only used to find undocumented exports
export * from './packages/core/index.mjs';
export * from './packages/csound/index.mjs';
export * from './packages/embed/index.mjs';
export * from './packages/eval/index.mjs';
export * from './packages/midi/index.mjs';
export * from './packages/mini/index.mjs';
export * from './packages/osc/index.mjs';
export * from './packages/react/index.mjs';
export * from './packages/serial/index.mjs';
export * from './packages/soundfonts/index.mjs';
export * from './packages/tonal/index.mjs';
export * from './packages/tone/index.mjs';
export * from './packages/transpiler/index.mjs';
export * from './packages/webaudio/index.mjs';
export * from './packages/webdirt/index.mjs';
export * from './packages/xen/index.mjs';
+11
View File
@@ -0,0 +1,11 @@
{
"source": {
"includePattern": ".+\\.(js(doc|x)?|mjs)$",
"excludePattern": "node_modules|shift-parser|shift-reducer|shift-traverser|dist"
},
"plugins": ["plugins/markdown"],
"opts": {
"destination": "./out/",
"recurse": true
}
}
+3 -1
View File
@@ -2,5 +2,7 @@
"packages": [
"packages/*"
],
"version": "independent"
"version": "independent",
"npmClient": "pnpm",
"useWorkspaces": true
}
+59
View File
@@ -0,0 +1,59 @@
# my-patterns
This directory can be used to save your own patterns, which then get
made into a pattern swatch.
Example: <https://felixroos.github.io/strudel/swatch/>
## deploy
### 1. fork the [strudel repo on github](https://github.com/tidalcycles/strudel.git)
### 2. clone your fork to your machine `git clone https://github.com/<your-username>/strudel.git strudel && cd strudel`
### 3. create a separate branch like `git branch patternuary && git checkout patternuary`
### 4. save one or more .txt files in the my-patterns folder
### 5. edit `website/public/CNAME` to contain `<your-username>.github.io/strudel`
### 6. edit `website/astro.config.mjs` to use site: `https://<your-username>.github.io` and base `/strudel`, like this
```js
const site = 'https://<your-username>.github.io';
const base = '/strudel';
```
### 7. commit & push the changes
```sh
git add . && git commit -m "site config" && git push --set-upstream origin
```
### 8. deploy to github pages
- go to settings -> pages and select "Github Actions" as source
- go to settings -> environments -> github-pages and press the edit button next to `main` and type in `patternuary` (under "Deployment branches")
- go to Actions -> `Build and Deploy` and click `Run workflow` with branch `patternuary`
### 9. view your patterns at `<your-username>.github.io/strudel/swatch/`
Alternatively, github pages allows you to use a custom domain, like https://mycooldomain.org/swatch/. [See their documentation for details](https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site).
### 10. optional: automatic deployment
If you want to automatically deploy your site on push, go to `deploy.yml` and change `workflow_dispatch` to `push`.
## running locally
- install dependencies with `npm run setup`
- run dev server with `npm run repl` and open `http://localhost:3000/strudel/swatch/`
## tests fail?
Your tests might fail if the code does not follow prettiers format.
In that case, run `npm run codeformat`. To disable that, remove `npm run format-check` from `test.yml`
## updating your fork
To update your fork, you can pull the main branch and merge it into your `patternuary` branch.
-14978
View File
File diff suppressed because it is too large Load Diff
+46 -10
View File
@@ -1,16 +1,32 @@
{
"name": "@strudel.cycles/monorepo",
"version": "0.0.1",
"version": "0.5.0",
"private": true,
"description": "Port of tidalcycles to javascript",
"main": "strudel.mjs",
"scripts": {
"test": "npm run test --workspaces --if-present",
"bootstrap": "lerna bootstrap"
"setup": "pnpm i",
"pretest": "npm run jsdoc-json",
"prebuild": "npm run jsdoc-json",
"prestart": "npm run jsdoc-json",
"test": "npm run pretest && vitest run --version",
"test-ui": "npm run pretest && vitest --ui",
"test-coverage": "npm run pretest && vitest --coverage",
"snapshot": "npm run pretest && vitest run -u --silent",
"repl": "npm run prestart && cd website && npm run dev",
"start": "npm run prestart && cd website && npm run dev",
"dev": "npm run prestart && cd website && npm run dev",
"build": "npm run prebuild && cd website && npm run build",
"preview": "cd website && npm run preview",
"osc": "cd packages/osc && npm run server",
"jsdoc": "jsdoc packages/ -c jsdoc.config.json",
"jsdoc-json": "jsdoc packages/ --template ./node_modules/jsdoc-json --destination doc.json -c jsdoc.config.json",
"lint": "eslint . --ext mjs,js --quiet",
"codeformat": "prettier --write .",
"format-check": "prettier --check .",
"report-undocumented": "npm run jsdoc-json && node undocumented.mjs > undocumented.json",
"check": "npm run format-check && npm run lint && npm run test",
"iclc": "cd paper && pandoc --template=pandoc/iclc.html --citeproc --number-sections iclc2023.md -o iclc2023.html && pandoc --template=pandoc/iclc.latex --citeproc --number-sections iclc2023.md -o iclc2023.pdf"
},
"workspaces": [
"packages/*"
],
"repository": {
"type": "git",
"url": "git+https://github.com/tidalcycles/strudel.git"
@@ -23,14 +39,34 @@
"algorave"
],
"author": "Alex McLean <alex@slab.org> (https://slab.org)",
"license": "GPL-3.0-or-later",
"license": "AGPL-3.0-or-later",
"bugs": {
"url": "https://github.com/tidalcycles/strudel/issues"
},
"homepage": "https://strudel.tidalcycles.org",
"dependencies": {
"@strudel.cycles/core": "workspace:*",
"@strudel.cycles/mini": "workspace:*",
"@strudel.cycles/tonal": "workspace:*",
"@strudel.cycles/transpiler": "workspace:*",
"@strudel.cycles/webaudio": "workspace:*",
"@strudel.cycles/xen": "workspace:*",
"acorn": "^8.8.1",
"dependency-tree": "^9.0.0"
},
"devDependencies": {
"@tauri-apps/cli": "^1.4.0",
"@vitest/ui": "^0.28.0",
"canvas": "^2.11.2",
"eslint": "^8.39.0",
"eslint-plugin-import": "^2.27.5",
"events": "^3.3.0",
"lerna": "^4.0.0",
"mocha": "^9.1.4"
"jsdoc": "^4.0.2",
"jsdoc-json": "^2.0.2",
"jsdoc-to-markdown": "^8.0.0",
"lerna": "^6.6.1",
"prettier": "^2.8.8",
"rollup-plugin-visualizer": "^5.8.1",
"vitest": "^0.28.0"
}
}
+15
View File
@@ -0,0 +1,15 @@
# Packages
Each folder represents one of the @strudel.cycles/* packages [published to npm](https://www.npmjs.com/org/strudel.cycles).
To understand how those pieces connect, refer to the [Technical Manual](https://github.com/tidalcycles/strudel/wiki/Technical-Manual) or the individual READMEs.
This is a graphical view of all the packages: [full screen](https://raw.githubusercontent.com/tidalcycles/strudel/main/dependencies.svg)
![dependencies](https://raw.githubusercontent.com/tidalcycles/strudel/main/dependencies.svg)
Generated with
```sh
npx depcruise --include-only "^packages" -X "node_modules" --output-type dot packages | dot -T svg > dependencygraph.svg
```
+3
View File
@@ -0,0 +1,3 @@
# @strudel/codemirror
This package contains helpers and extensions to use codemirror6. See [vite-vanilla-repl-cm6](../core/examples/vite-vanilla-repl-cm6/main.js) as an example of using it.
+199
View File
@@ -0,0 +1,199 @@
import { EditorState } from '@codemirror/state';
import { EditorView, keymap, Decoration, lineNumbers, highlightActiveLineGutter } from '@codemirror/view';
import { defaultKeymap } from '@codemirror/commands';
import { syntaxHighlighting, defaultHighlightStyle } from '@codemirror/language';
import { javascript } from '@codemirror/lang-javascript';
import { StateField, StateEffect } from '@codemirror/state';
import { oneDark } from './themes/one-dark';
import { repl, Drawer } from '@strudel.cycles/core';
// https://codemirror.net/docs/guide/
export function initEditor({ initialCode = '', onChange, onEvaluate, onStop, theme = oneDark, root }) {
let state = EditorState.create({
doc: initialCode,
extensions: [
theme,
javascript(),
lineNumbers(),
highlightField,
highlightActiveLineGutter(),
syntaxHighlighting(defaultHighlightStyle),
keymap.of(defaultKeymap),
flashField,
EditorView.updateListener.of((v) => onChange(v)),
keymap.of([
{
key: 'Ctrl-Enter',
run: () => onEvaluate(),
},
{
key: 'Ctrl-.',
run: () => onStop(),
},
]),
],
});
return new EditorView({
state,
parent: root,
});
}
//
// highlighting
//
export const setHighlights = StateEffect.define();
export const highlightField = StateField.define({
create() {
return Decoration.none;
},
update(highlights, tr) {
try {
for (let e of tr.effects) {
if (e.is(setHighlights)) {
const { haps } = e.value;
const marks =
haps
.map((hap) =>
(hap.context.locations || []).map(({ start, end }) => {
// const color = hap.context.color || e.value.color || '#FFCA28';
let from = tr.newDoc.line(start.line).from + start.column;
let to = tr.newDoc.line(end.line).from + end.column;
const l = tr.newDoc.length;
if (from > l || to > l) {
return; // dont mark outside of range, as it will throw an error
}
const mark = Decoration.mark({
attributes: { style: `outline: 2px solid #FFCA28;` },
});
return mark.range(from, to);
}),
)
.flat()
.filter(Boolean) || [];
highlights = Decoration.set(marks, true);
}
}
return highlights;
} catch (err) {
// console.warn('highlighting error', err);
return Decoration.set([]);
}
},
provide: (f) => EditorView.decorations.from(f),
});
// helper to simply trigger highlighting for given haps
export function highlightHaps(view, haps) {
view.dispatch({ effects: setHighlights.of({ haps }) });
}
//
// flash
//
export const setFlash = StateEffect.define();
const flashField = StateField.define({
create() {
return Decoration.none;
},
update(flash, tr) {
try {
for (let e of tr.effects) {
if (e.is(setFlash)) {
if (e.value) {
const mark = Decoration.mark({ attributes: { style: `background-color: #FFCA2880` } });
flash = Decoration.set([mark.range(0, tr.newDoc.length)]);
} else {
flash = Decoration.set([]);
}
}
}
return flash;
} catch (err) {
console.warn('flash error', err);
return flash;
}
},
provide: (f) => EditorView.decorations.from(f),
});
export const flash = (view, ms = 200) => {
view.dispatch({ effects: setFlash.of(true) });
setTimeout(() => {
view.dispatch({ effects: setFlash.of(false) });
}, ms);
};
export class StrudelMirror {
constructor(options) {
const { root, initialCode = '', onDraw, drawTime = [-2, 2], prebake, ...replOptions } = options;
this.code = initialCode;
this.drawer = new Drawer((haps, time) => {
const currentFrame = haps.filter((hap) => time >= hap.whole.begin && time <= hap.endClipped);
this.highlight(currentFrame);
onDraw?.(haps, time, currentFrame);
}, drawTime);
const prebaked = prebake();
prebaked.then(async () => {
if (!onDraw) {
return;
}
const { scheduler, evaluate } = await this.repl;
// draw first frame instantly
prebaked.then(async () => {
await evaluate(this.code, false);
this.drawer.invalidate(scheduler);
onDraw?.(this.drawer.visibleHaps, 0, []);
});
});
this.repl = repl({
...replOptions,
onToggle: async (started) => {
replOptions?.onToggle?.(started);
const { scheduler } = await this.repl;
if (started) {
this.drawer.start(scheduler);
} else {
this.drawer.stop();
}
},
beforeEval: async () => {
await prebaked;
},
afterEval: (options) => {
replOptions?.afterEval?.(options);
this.drawer.invalidate();
},
});
this.editor = initEditor({
root,
initialCode,
onChange: (v) => {
this.code = v.state.doc.toString();
},
onEvaluate: () => this.evaluate(),
onStop: () => this.stop(),
});
}
async evaluate() {
const { evaluate } = await this.repl;
this.flash();
await evaluate(this.code);
}
async stop() {
const { scheduler } = await this.repl;
scheduler.stop();
}
flash(ms) {
flash(this.editor, ms);
}
highlight(haps) {
highlightHaps(this.editor, haps);
}
}
+47
View File
@@ -0,0 +1,47 @@
{
"name": "@strudel/codemirror",
"version": "0.8.4",
"description": "Codemirror Extensions for Strudel",
"main": "codemirror.mjs",
"publishConfig": {
"main": "dist/index.js",
"module": "dist/index.mjs"
},
"scripts": {
"build": "vite build",
"prepublishOnly": "npm run build"
},
"type": "module",
"repository": {
"type": "git",
"url": "git+https://github.com/tidalcycles/strudel.git"
},
"keywords": [
"tidalcycles",
"strudel",
"pattern",
"livecoding",
"algorave"
],
"author": "Felix Roos <flix91@gmail.com>",
"contributors": [
"Alex McLean <alex@slab.org>"
],
"license": "AGPL-3.0-or-later",
"bugs": {
"url": "https://github.com/tidalcycles/strudel/issues"
},
"homepage": "https://github.com/tidalcycles/strudel#readme",
"dependencies": {
"@codemirror/commands": "^6.2.4",
"@codemirror/lang-javascript": "^6.1.7",
"@codemirror/language": "^6.6.0",
"@codemirror/state": "^6.2.0",
"@codemirror/view": "^6.10.0",
"@lezer/highlight": "^1.1.4",
"@strudel.cycles/core": "workspace:*"
},
"devDependencies": {
"vite": "^4.3.3"
}
}
+139
View File
@@ -0,0 +1,139 @@
import { EditorView } from '@codemirror/view';
import { HighlightStyle, syntaxHighlighting } from '@codemirror/language';
import { tags as t } from '@lezer/highlight';
// Using https://github.com/one-dark/vscode-one-dark-theme/ as reference for the colors
const chalky = '#e5c07b',
coral = '#e06c75',
cyan = '#56b6c2',
invalid = '#ffffff',
ivory = '#abb2bf',
stone = '#7d8799', // Brightened compared to original to increase contrast
malibu = '#61afef',
sage = '#98c379',
whiskey = '#d19a66',
violet = '#c678dd',
darkBackground = '#21252b',
highlightBackground = '#2c313a',
background = '#282c34',
tooltipBackground = '#353a42',
selection = '#3E4451',
cursor = '#528bff';
/// The colors used in the theme, as CSS color strings.
export const color = {
chalky,
coral,
cyan,
invalid,
ivory,
stone,
malibu,
sage,
whiskey,
violet,
darkBackground,
highlightBackground,
background,
tooltipBackground,
selection,
cursor,
};
/// The editor theme styles for One Dark.
export const oneDarkTheme = EditorView.theme(
{
'&': {
color: ivory,
backgroundColor: background,
},
'.cm-content': {
caretColor: cursor,
},
'.cm-cursor, .cm-dropCursor': { borderLeftColor: cursor },
'&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection':
{ backgroundColor: selection },
'.cm-panels': { backgroundColor: darkBackground, color: ivory },
'.cm-panels.cm-panels-top': { borderBottom: '2px solid black' },
'.cm-panels.cm-panels-bottom': { borderTop: '2px solid black' },
'.cm-searchMatch': {
backgroundColor: '#72a1ff59',
outline: '1px solid #457dff',
},
'.cm-searchMatch.cm-searchMatch-selected': {
backgroundColor: '#6199ff2f',
},
'.cm-activeLine': { backgroundColor: '#6699ff0b' },
'.cm-selectionMatch': { backgroundColor: '#aafe661a' },
'&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket': {
backgroundColor: '#bad0f847',
},
'.cm-gutters': {
backgroundColor: background,
color: stone,
border: 'none',
},
'.cm-activeLineGutter': {
backgroundColor: highlightBackground,
},
'.cm-foldPlaceholder': {
backgroundColor: 'transparent',
border: 'none',
color: '#ddd',
},
'.cm-tooltip': {
border: 'none',
backgroundColor: tooltipBackground,
},
'.cm-tooltip .cm-tooltip-arrow:before': {
borderTopColor: 'transparent',
borderBottomColor: 'transparent',
},
'.cm-tooltip .cm-tooltip-arrow:after': {
borderTopColor: tooltipBackground,
borderBottomColor: tooltipBackground,
},
'.cm-tooltip-autocomplete': {
'& > ul > li[aria-selected]': {
backgroundColor: highlightBackground,
color: ivory,
},
},
},
{ dark: true },
);
/// The highlighting style for code in the One Dark theme.
export const oneDarkHighlightStyle = HighlightStyle.define([
{ tag: t.keyword, color: violet },
{ tag: [t.name, t.deleted, t.character, t.propertyName, t.macroName], color: coral },
{ tag: [t.function(t.variableName), t.labelName], color: malibu },
{ tag: [t.color, t.constant(t.name), t.standard(t.name)], color: whiskey },
{ tag: [t.definition(t.name), t.separator], color: ivory },
{ tag: [t.typeName, t.className, t.number, t.changed, t.annotation, t.modifier, t.self, t.namespace], color: chalky },
{ tag: [t.operator, t.operatorKeyword, t.url, t.escape, t.regexp, t.link, t.special(t.string)], color: cyan },
{ tag: [t.meta, t.comment], color: stone },
{ tag: t.strong, fontWeight: 'bold' },
{ tag: t.emphasis, fontStyle: 'italic' },
{ tag: t.strikethrough, textDecoration: 'line-through' },
{ tag: t.link, color: stone, textDecoration: 'underline' },
{ tag: t.heading, fontWeight: 'bold', color: coral },
{ tag: [t.atom, t.bool, t.special(t.variableName)], color: whiskey },
{ tag: [t.processingInstruction, t.string, t.inserted], color: sage },
{ tag: t.invalid, color: invalid },
]);
/// Extension to enable the One Dark theme (both the editor theme and
/// the highlight style).
export const oneDark = [oneDarkTheme, syntaxHighlighting(oneDarkHighlightStyle)];
+19
View File
@@ -0,0 +1,19 @@
import { defineConfig } from 'vite';
import { dependencies } from './package.json';
import { resolve } from 'path';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [],
build: {
lib: {
entry: resolve(__dirname, 'codemirror.mjs'),
formats: ['es', 'cjs'],
fileName: (ext) => ({ es: 'index.mjs', cjs: 'index.js' }[ext]),
},
rollupOptions: {
external: [...Object.keys(dependencies)],
},
target: 'esnext',
},
});
+1
View File
@@ -0,0 +1 @@
examples
+7 -4
View File
@@ -11,18 +11,18 @@ npm i @strudel.cycles/core --save
## Example
```js
import { sequence, State, TimeSpan } from '@strudel.cycles/core';
import { sequence } from '@strudel.cycles/core';
const pattern = sequence('a', ['b', 'c']);
const events = pattern.query(new State(new TimeSpan(0, 2)));
const events = pattern.queryArc(0, 1);
const spans = events.map(
(event) => `${event.value}: ${event.whole.begin.toFraction()} - ${event.whole.end.toFraction()} `,
);
```
spans:
yields:
```log
a: 0 - 1/2
@@ -33,4 +33,7 @@ b: 3/2 - 7/4
c: 7/4 - 2
```
[play with @strudel.cycles/core on codesandbox](https://codesandbox.io/s/strudel-core-test-qmz6qr?file=/src/index.js).
- [play with @strudel.cycles/core on codesandbox](https://codesandbox.io/s/strudel-core-test-forked-9ywhv7?file=/src/index.js).
- [open color pattern example](https://raw.githack.com/tidalcycles/strudel/main/packages/core/examples/canvas.html)
- [open minimal repl example](https://raw.githack.com/tidalcycles/strudel/main/packages/core/examples/vanilla.html)
- [open minimal vite example](./examples/vite-vanilla-repl/)
+68
View File
@@ -0,0 +1,68 @@
import { Pattern, getDrawContext, silence, register, pure } from './index.mjs';
import controls from './controls.mjs'; // do not import from index.mjs as it breaks for some reason..
const { createParams } = controls;
let clearColor = '#22222210';
Pattern.prototype.animate = function ({ callback, sync = false, smear = 0.5 } = {}) {
window.frame && cancelAnimationFrame(window.frame);
const ctx = getDrawContext();
const { clientWidth: ww, clientHeight: wh } = ctx.canvas;
let smearPart = smear === 0 ? '99' : Number((1 - smear) * 100).toFixed(0);
smearPart = smearPart.length === 1 ? `0${smearPart}` : smearPart;
clearColor = `#200010${smearPart}`;
const render = (t) => {
let frame;
/* if (sync) {
t = scheduler.now();
frame = this.queryArc(t, t);
} else { */
t = Math.round(t);
frame = this.slow(1000).queryArc(t, t);
// }
ctx.fillStyle = clearColor;
ctx.fillRect(0, 0, ww, wh);
frame.forEach((f) => {
let { x, y, w, h, s, r, angle = 0, fill = 'darkseagreen' } = f.value;
w *= ww;
h *= wh;
if (r !== undefined && angle !== undefined) {
const radians = angle * 2 * Math.PI;
const [cx, cy] = [(ww - w) / 2, (wh - h) / 2];
x = cx + Math.cos(radians) * r * cx;
y = cy + Math.sin(radians) * r * cy;
} else {
x *= ww - w;
y *= wh - h;
}
const val = { ...f.value, x, y, w, h };
ctx.fillStyle = fill;
if (s === 'rect') {
ctx.fillRect(x, y, w, h);
} else if (s === 'ellipse') {
ctx.beginPath();
ctx.ellipse(x + w / 2, y + h / 2, w / 2, h / 2, 0, 0, 2 * Math.PI);
ctx.fill();
}
callback && callback(ctx, val, f);
});
window.frame = requestAnimationFrame(render);
};
window.frame = requestAnimationFrame(render);
return silence;
};
export const { x, y, w, h, angle, r, fill, smear } = createParams('x', 'y', 'w', 'h', 'angle', 'r', 'fill', 'smear');
export const rescale = register('rescale', function (f, pat) {
return pat.mul(x(f).w(f).y(f).h(f));
});
export const moveXY = register('moveXY', function (dx, dy, pat) {
return pat.add(x(dx).y(dy));
});
export const zoomIn = register('zoomIn', function (f, pat) {
const d = pure(1).sub(f).div(2);
return pat.rescale(f).move(d, d);
});
+175
View File
@@ -0,0 +1,175 @@
export const colorMap = {
aliceblue: '#f0f8ff',
antiquewhite: '#faebd7',
aqua: '#00ffff',
aquamarine: '#7fffd4',
azure: '#f0ffff',
beige: '#f5f5dc',
bisque: '#ffe4c4',
black: '#000000',
blanchedalmond: '#ffebcd',
blue: '#0000ff',
blueviolet: '#8a2be2',
brown: '#a52a2a',
burlywood: '#deb887',
cadetblue: '#5f9ea0',
chartreuse: '#7fff00',
chocolate: '#d2691e',
coral: '#ff7f50',
cornflowerblue: '#6495ed',
cornsilk: '#fff8dc',
crimson: '#dc143c',
cyan: '#00ffff',
darkblue: '#00008b',
darkcyan: '#008b8b',
darkgoldenrod: '#b8860b',
darkgray: '#a9a9a9',
darkgreen: '#006400',
darkgrey: '#a9a9a9',
darkkhaki: '#bdb76b',
darkmagenta: '#8b008b',
darkolivegreen: '#556b2f',
darkorange: '#ff8c00',
darkorchid: '#9932cc',
darkred: '#8b0000',
darksalmon: '#e9967a',
darkseagreen: '#8fbc8f',
darkslateblue: '#483d8b',
darkslategray: '#2f4f4f',
darkslategrey: '#2f4f4f',
darkturquoise: '#00ced1',
darkviolet: '#9400d3',
deeppink: '#ff1493',
deepskyblue: '#00bfff',
dimgray: '#696969',
dimgrey: '#696969',
dodgerblue: '#1e90ff',
firebrick: '#b22222',
floralwhite: '#fffaf0',
forestgreen: '#228b22',
fuchsia: '#ff00ff',
gainsboro: '#dcdcdc',
ghostwhite: '#f8f8ff',
gold: '#ffd700',
goldenrod: '#daa520',
gray: '#808080',
green: '#008000',
greenyellow: '#adff2f',
grey: '#808080',
honeydew: '#f0fff0',
hotpink: '#ff69b4',
indianred: '#cd5c5c',
indigo: '#4b0082',
ivory: '#fffff0',
khaki: '#f0e68c',
lavender: '#e6e6fa',
lavenderblush: '#fff0f5',
lawngreen: '#7cfc00',
lemonchiffon: '#fffacd',
lightblue: '#add8e6',
lightcoral: '#f08080',
lightcyan: '#e0ffff',
lightgoldenrodyellow: '#fafad2',
lightgray: '#d3d3d3',
lightgreen: '#90ee90',
lightgrey: '#d3d3d3',
lightpink: '#ffb6c1',
lightsalmon: '#ffa07a',
lightseagreen: '#20b2aa',
lightskyblue: '#87cefa',
lightslategray: '#778899',
lightslategrey: '#778899',
lightsteelblue: '#b0c4de',
lightyellow: '#ffffe0',
lime: '#00ff00',
limegreen: '#32cd32',
linen: '#faf0e6',
magenta: '#ff00ff',
maroon: '#800000',
mediumaquamarine: '#66cdaa',
mediumblue: '#0000cd',
mediumorchid: '#ba55d3',
mediumpurple: '#9370db',
mediumseagreen: '#3cb371',
mediumslateblue: '#7b68ee',
mediumspringgreen: '#00fa9a',
mediumturquoise: '#48d1cc',
mediumvioletred: '#c71585',
midnightblue: '#191970',
mintcream: '#f5fffa',
mistyrose: '#ffe4e1',
moccasin: '#ffe4b5',
navajowhite: '#ffdead',
navy: '#000080',
oldlace: '#fdf5e6',
olive: '#808000',
olivedrab: '#6b8e23',
orange: '#ffa500',
orangered: '#ff4500',
orchid: '#da70d6',
palegoldenrod: '#eee8aa',
palegreen: '#98fb98',
paleturquoise: '#afeeee',
palevioletred: '#db7093',
papayawhip: '#ffefd5',
peachpuff: '#ffdab9',
peru: '#cd853f',
pink: '#ffc0cb',
plum: '#dda0dd',
powderblue: '#b0e0e6',
purple: '#800080',
red: '#ff0000',
rosybrown: '#bc8f8f',
royalblue: '#4169e1',
saddlebrown: '#8b4513',
salmon: '#fa8072',
sandybrown: '#f4a460',
seagreen: '#2e8b57',
seashell: '#fff5ee',
sienna: '#a0522d',
silver: '#c0c0c0',
skyblue: '#87ceeb',
slateblue: '#6a5acd',
slategray: '#708090',
slategrey: '#708090',
snow: '#fffafa',
springgreen: '#00ff7f',
steelblue: '#4682b4',
tan: '#d2b48c',
teal: '#008080',
thistle: '#d8bfd8',
tomato: '#ff6347',
turquoise: '#40e0d0',
violet: '#ee82ee',
wheat: '#f5deb3',
white: '#ffffff',
whitesmoke: '#f5f5f5',
yellow: '#ffff00',
yellowgreen: '#9acd32',
};
export function convertColorToNumber(color) {
// Convert color to lowercase for easier matching
color = color.toLowerCase();
// If the color is a hex code, convert it to a number
if (color[0] === '#') {
return convertHexToNumber(color);
}
// If the color is a named color, return the corresponding number
if (colorMap[color] !== undefined) {
return convertHexToNumber(colorMap[color]);
}
// If the color is not recognized, return null
return -1;
}
export function convertHexToNumber(hex) {
// Remove the leading '#' from the hex code
hex = hex.slice(1);
// Convert the hex code to a number
return parseInt(hex, 16);
}
+826
View File
@@ -0,0 +1,826 @@
/*
controls.mjs - <short description TODO>
Copyright (C) 2022 Strudel contributors - see <https://github.com/tidalcycles/strudel/blob/main/packages/core/controls.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 { Pattern, register, sequence } from './pattern.mjs';
import { zipWith } from './util.mjs';
const controls = {};
const generic_params = [
/**
* Select a sound / sample by name. When using mininotation, you can also optionally supply 'n' and 'gain' parameters
* separated by ':'.
*
* @name s
* @param {string | Pattern} sound The sound / pattern of sounds to pick
* @synonyms sound
* @example
* s("bd hh")
* @example
* s("bd:0 bd:1 bd:0:0.3 bd:1:1.4")
*
*/
[['s', 'n', 'gain'], 'sound'],
/**
* Define a custom webaudio node to use as a sound source.
*
* @name source
* @param {function} getSource
* @synonyms src
*
*/
['source', 'src'],
/**
* Selects the given index from the sample map.
* Numbers too high will wrap around.
* `n` can also be used to play midi numbers, but it is recommended to use `note` instead.
*
* @name n
* @param {number | Pattern} value sample index starting from 0
* @example
* s("bd sd,hh*3").n("<0 1>")
*/
// also see https://github.com/tidalcycles/strudel/pull/63
['n'],
/**
* Plays the given note name or midi number. A note name consists of
*
* - a letter (a-g or A-G)
* - optional accidentals (b or #)
* - optional octave number (0-9). Defaults to 3
*
* Examples of valid note names: `c`, `bb`, `Bb`, `f#`, `c3`, `A4`, `Eb2`, `c#5`
*
* You can also use midi numbers instead of note names, where 69 is mapped to A4 440Hz in 12EDO.
*
* @name note
* @example
* note("c a f e")
* @example
* note("c4 a4 f4 e4")
* @example
* note("60 69 65 64")
*/
[['note', 'n']],
/**
* A pattern of numbers that speed up (or slow down) samples while they play. Currently only supported by osc / superdirt.
*
* @name accelerate
* @param {number | Pattern} amount acceleration.
* @superdirtOnly
* @example
* s("sax").accelerate("<0 1 2 4 8 16>").slow(2).osc()
*
*/
['accelerate'],
/**
* Controls the gain by an exponential amount.
*
* @name gain
* @param {number | Pattern} amount gain.
* @example
* s("hh*8").gain(".4!2 1 .4!2 1 .4 1")
*
*/
['gain'],
/**
* Like {@link gain}, but linear.
*
* @name amp
* @param {number | Pattern} amount gain.
* @superdirtOnly
* @example
* s("bd*8").amp(".1*2 .5 .1*2 .5 .1 .5").osc()
*
*/
['amp'],
/**
* Amplitude envelope attack time: Specifies how long it takes for the sound to reach its peak value, relative to the onset.
*
* @name attack
* @param {number | Pattern} attack time in seconds.
* @synonyms att
* @example
* note("c3 e3").attack("<0 .1 .5>")
*
*/
['attack', 'att'],
/**
* Select the sound bank to use. To be used together with `s`. The bank name (+ "_") will be prepended to the value of `s`.
*
* @name bank
* @param {string | Pattern} bank the name of the bank
* @example
* s("bd sd").bank('RolandTR909') // = s("RolandTR909_bd RolandTR909_sd")
*
*/
['bank'],
/**
* Amplitude envelope decay time: the time it takes after the attack time to reach the sustain level.
* Note that the decay is only audible if the sustain value is lower than 1.
*
* @name decay
* @param {number | Pattern} time decay time in seconds
* @example
* note("c3 e3").decay("<.1 .2 .3 .4>").sustain(0)
*
*/
['decay'],
/**
* Amplitude envelope sustain level: The level which is reached after attack / decay, being sustained until the offset.
*
* @name sustain
* @param {number | Pattern} gain sustain level between 0 and 1
* @synonyms sus
* @example
* note("c3 e3").decay(.2).sustain("<0 .1 .4 .6 1>")
*
*/
['sustain', 'sus'],
/**
* Amplitude envelope release time: The time it takes after the offset to go from sustain level to zero.
*
* @name release
* @param {number | Pattern} time release time in seconds
* @synonyms rel
* @example
* note("c3 e3 g3 c4").release("<0 .1 .4 .6 1>/2")
*
*/
['release', 'rel'],
['hold'],
// TODO: in tidal, it seems to be normalized
/**
* Sets the center frequency of the **b**and-**p**ass **f**ilter. When using mininotation, you
* can also optionally supply the 'bpq' parameter separated by ':'.
*
* @name bpf
* @param {number | Pattern} frequency center frequency
* @synonyms bandf, bp
* @example
* s("bd sd,hh*3").bpf("<1000 2000 4000 8000>")
*
*/
[['bandf', 'bandq'], 'bpf', 'bp'],
// TODO: in tidal, it seems to be normalized
/**
* Sets the **b**and-**p**ass **q**-factor (resonance).
*
* @name bpq
* @param {number | Pattern} q q factor
* @synonyms bandq
* @example
* s("bd sd").bpf(500).bpq("<0 1 2 3>")
*
*/
// currently an alias of 'bandq' https://github.com/tidalcycles/strudel/issues/496
// ['bpq'],
['bandq', 'bpq'],
/**
* a pattern of numbers from 0 to 1. Skips the beginning of each sample, e.g. `0.25` to cut off the first quarter from each sample.
*
* @memberof Pattern
* @name begin
* @param {number | Pattern} amount between 0 and 1, where 1 is the length of the sample
* @example
* samples({ rave: 'rave/AREUREADY.wav' }, 'github:tidalcycles/Dirt-Samples/master/')
* s("rave").begin("<0 .25 .5 .75>")
*
*/
['begin'],
/**
* The same as .begin, but cuts off the end off each sample.
*
* @memberof Pattern
* @name end
* @param {number | Pattern} length 1 = whole sample, .5 = half sample, .25 = quarter sample etc..
* @example
* s("bd*2,oh*4").end("<.1 .2 .5 1>")
*
*/
['end'],
/**
* Loops the sample (from `begin` to `end`) the specified number of times.
* Note that the tempo of the loop is not synced with the cycle tempo.
*
* @name loop
* @param {number | Pattern} times How often the sample is looped
* @example
* s("bd").loop("<1 2 3 4>").osc()
*
*/
['loop'],
// TODO: currently duplicated with "native" legato
// TODO: superdirt legato will do more: https://youtu.be/dQPmE1WaD1k?t=419
/**
* a pattern of numbers from 0 to 1. Skips the beginning of each sample, e.g. `0.25` to cut off the first quarter from each sample.
*
* @name legato
* @param {number | Pattern} duration between 0 and 1, where 1 is the length of the whole hap time
* @noAutocomplete
* @example
* "c4 eb4 g4 bb4".legato("<0.125 .25 .5 .75 1 2 4>")
*
*/
// ['legato'],
// ['clhatdecay'],
/**
* bit crusher effect.
*
* @name crush
* @param {number | Pattern} depth between 1 (for drastic reduction in bit-depth) to 16 (for barely no reduction).
* @example
* s("<bd sd>,hh*3").fast(2).crush("<16 8 7 6 5 4 3 2>")
*
*/
['crush'],
/**
* fake-resampling for lowering the sample rate. Caution: This effect seems to only work in chromium based browsers
*
* @name coarse
* @param {number | Pattern} factor 1 for original 2 for half, 3 for a third and so on.
* @example
* s("bd sd,hh*4").coarse("<1 4 8 16 32>")
*
*/
['coarse'],
/**
* choose the channel the pattern is sent to in superdirt
*
* @name channel
* @param {number | Pattern} channel channel number
*
*/
['channel'],
/**
* In the style of classic drum-machines, `cut` will stop a playing sample as soon as another samples with in same cutgroup is to be played. An example would be an open hi-hat followed by a closed one, essentially muting the open.
*
* @name cut
* @param {number | Pattern} group cut group number
* @example
* s("rd*4").cut(1)
*
*/
['cut'],
/**
* Applies the cutoff frequency of the **l**ow-**p**ass **f**ilter.
*
* When using mininotation, you can also optionally add the 'lpq' parameter, separated by ':'.
*
* @name lpf
* @param {number | Pattern} frequency audible between 0 and 20000
* @synonyms cutoff, ctf, lp
* @example
* s("bd sd,hh*3").lpf("<4000 2000 1000 500 200 100>")
* @example
* s("bd*8").lpf("1000:0 1000:10 1000:20 1000:30")
*
*/
[['cutoff', 'resonance'], 'ctf', 'lpf', 'lp'],
/**
* Applies the cutoff frequency of the **h**igh-**p**ass **f**ilter.
*
* When using mininotation, you can also optionally add the 'hpq' parameter, separated by ':'.
*
* @name hpf
* @param {number | Pattern} frequency audible between 0 and 20000
* @synonyms hp, hcutoff
* @example
* s("bd sd,hh*4").hpf("<4000 2000 1000 500 200 100>")
* @example
* s("bd sd,hh*4").hpf("<2000 2000:25>")
*
*/
// currently an alias of 'hcutoff' https://github.com/tidalcycles/strudel/issues/496
// ['hpf'],
[['hcutoff', 'hresonance'], 'hpf', 'hp'],
/**
* Controls the **h**igh-**p**ass **q**-value.
*
* @name hpq
* @param {number | Pattern} q resonance factor between 0 and 50
* @synonyms hresonance
* @example
* s("bd sd,hh*4").hpf(2000).hpq("<0 10 20 30>")
*
*/
['hresonance', 'hpq'],
/**
* Controls the **l**ow-**p**ass **q**-value.
*
* @name lpq
* @param {number | Pattern} q resonance factor between 0 and 50
* @synonyms resonance
* @example
* s("bd sd,hh*4").lpf(2000).lpq("<0 10 20 30>")
*
*/
// currently an alias of 'resonance' https://github.com/tidalcycles/strudel/issues/496
['resonance', 'lpq'],
/**
* DJ filter, below 0.5 is low pass filter, above is high pass filter.
*
* @name djf
* @param {number | Pattern} cutoff below 0.5 is low pass filter, above is high pass filter
* @example
* n("0 3 7 [10,24]").s('superzow').octave(3).djf("<.5 .25 .5 .75>").osc()
*
*/
['djf'],
// ['cutoffegint'],
// TODO: does not seem to work
/**
* Sets the level of the delay signal.
*
* When using mininotation, you can also optionally add the 'delaytime' and 'delayfeedback' parameter,
* separated by ':'.
*
*
* @name delay
* @param {number | Pattern} level between 0 and 1
* @example
* s("bd").delay("<0 .25 .5 1>")
* @example
* s("bd bd").delay("0.65:0.25:0.9 0.65:0.125:0.7")
*
*/
[['delay', 'delaytime', 'delayfeedback']],
/**
* Sets the level of the signal that is fed back into the delay.
* Caution: Values >= 1 will result in a signal that gets louder and louder! Don't do it
*
* @name delayfeedback
* @param {number | Pattern} feedback between 0 and 1
* @synonyms delayfb, dfb
* @example
* s("bd").delay(.25).delayfeedback("<.25 .5 .75 1>").slow(2)
*
*/
['delayfeedback', 'delayfb', 'dfb'],
/**
* Sets the time of the delay effect.
*
* @name delaytime
* @param {number | Pattern} seconds between 0 and Infinity
* @synonyms delayt, dt
* @example
* s("bd").delay(.25).delaytime("<.125 .25 .5 1>").slow(2)
*
*/
['delaytime', 'delayt', 'dt'],
/* // TODO: test
* Specifies whether delaytime is calculated relative to cps.
*
* @name lock
* @param {number | Pattern} enable When set to 1, delaytime is a direct multiple of a cycle.
* @example
* s("sd").delay().lock(1).osc()
*
*/
['lock'],
/**
* Set detune of oscillators. Works only with some synths, see <a target="_blank" href="https://tidalcycles.org/docs/patternlib/tutorials/synthesizers">tidal doc</a>
*
* @name detune
* @param {number | Pattern} amount between 0 and 1
* @synonyms det
* @superdirtOnly
* @example
* n("0 3 7").s('superzow').octave(3).detune("<0 .25 .5 1 2>").osc()
*
*/
['detune', 'det'],
/**
* Set dryness of reverb. See {@link room} and {@link size} for more information about reverb.
*
* @name dry
* @param {number | Pattern} dry 0 = wet, 1 = dry
* @example
* n("[0,3,7](3,8)").s("superpiano").room(.7).dry("<0 .5 .75 1>").osc()
* @superdirtOnly
*
*/
['dry'],
// TODO: does not seem to do anything
/*
* Used when using {@link begin}/{@link end} or {@link chop}/{@link striate} and friends, to change the fade out time of the 'grain' envelope.
*
* @name fadeTime
* @param {number | Pattern} time between 0 and 1
* @example
* s("oh*4").end(.1).fadeTime("<0 .2 .4 .8>").osc()
*
*/
['fadeTime', 'fadeOutTime'],
// TODO: see above
['fadeInTime'],
/**
* Set frequency of sound.
*
* @name freq
* @param {number | Pattern} frequency in Hz. the audible range is between 20 and 20000 Hz
* @example
* freq("220 110 440 110").s("superzow").osc()
* @example
* freq("110".mul.out(".5 1.5 .6 [2 3]")).s("superzow").osc()
*
*/
['freq'],
// TODO: https://tidalcycles.org/docs/configuration/MIDIOSC/control-voltage/#gate
['gate', 'gat'],
// ['hatgrain'],
// ['lagogo'],
// ['lclap'],
// ['lclaves'],
// ['lclhat'],
// ['lcrash'],
// TODO:
// https://tidalcycles.org/docs/reference/audio_effects/#leslie-1
// https://tidalcycles.org/docs/reference/audio_effects/#leslie
/**
* Emulation of a Leslie speaker: speakers rotating in a wooden amplified cabinet.
*
* @name leslie
* @param {number | Pattern} wet between 0 and 1
* @example
* n("0,4,7").s("supersquare").leslie("<0 .4 .6 1>").osc()
* @superdirtOnly
*
*/
['leslie'],
/**
* Rate of modulation / rotation for leslie effect
*
* @name lrate
* @param {number | Pattern} rate 6.7 for fast, 0.7 for slow
* @example
* n("0,4,7").s("supersquare").leslie(1).lrate("<1 2 4 8>").osc()
* @superdirtOnly
*
*/
// TODO: the rate seems to "lag" (in the example, 1 will be fast)
['lrate'],
/**
* Physical size of the cabinet in meters. Be careful, it might be slightly larger than your computer. Affects the Doppler amount (pitch warble)
*
* @name lsize
* @param {number | Pattern} meters somewhere between 0 and 1
* @example
* n("0,4,7").s("supersquare").leslie(1).lrate(2).lsize("<.1 .5 1>").osc()
* @superdirtOnly
*
*/
['lsize'],
// ['lfo'],
// ['lfocutoffint'],
// ['lfodelay'],
// ['lfoint'],
// ['lfopitchint'],
// ['lfoshape'],
// ['lfosync'],
// ['lhitom'],
// ['lkick'],
// ['llotom'],
// ['lophat'],
// ['lsnare'],
['degree'], // TODO: what is this? not found in tidal doc
['mtranspose'], // TODO: what is this? not found in tidal doc
['ctranspose'], // TODO: what is this? not found in tidal doc
['harmonic'], // TODO: what is this? not found in tidal doc
['stepsPerOctave'], // TODO: what is this? not found in tidal doc
['octaveR'], // TODO: what is this? not found in tidal doc
// TODO: why is this needed? what's the difference to late / early? Answer: it's in seconds, and delays the message at
// OSC time (so can't be negative, at least not beyond the latency value)
['nudge'],
// TODO: the following doc is just a guess, it's not documented in tidal doc.
/**
* Sets the default octave of a synth.
*
* @name octave
* @param {number | Pattern} octave octave number
* @example
* n("0,4,7").s('supersquare').octave("<3 4 5 6>").osc()
* @superDirtOnly
*/
['octave'],
['offset'], // TODO: what is this? not found in tidal doc
// ['ophatdecay'],
// TODO: example
/**
* An `orbit` is a global parameter context for patterns. Patterns with the same orbit will share the same global effects.
*
* @name orbit
* @param {number | Pattern} number
* @example
* stack(
* s("hh*3").delay(.5).delaytime(.25).orbit(1),
* s("~ sd").delay(.5).delaytime(.125).orbit(2)
* )
*/
['orbit'],
['overgain'], // TODO: what is this? not found in tidal doc Answer: gain is limited to maximum of 2. This allows you to go over that
['overshape'], // TODO: what is this? not found in tidal doc. Similar to above, but limited to 1
/**
* Sets position in stereo.
*
* @name pan
* @param {number | Pattern} pan between 0 and 1, from left to right (assuming stereo), once round a circle (assuming multichannel)
* @example
* s("[bd hh]*2").pan("<.5 1 .5 0>")
*
*/
['pan'],
// TODO: this has no effect (see example)
/*
* Controls how much multichannel output is fanned out
*
* @name panspan
* @param {number | Pattern} span between -inf and inf, negative is backwards ordering
* @example
* s("[bd hh]*2").pan("<.5 1 .5 0>").panspan("<0 .5 1>").osc()
*
*/
['panspan'],
// TODO: this has no effect (see example)
/*
* Controls how much multichannel output is spread
*
* @name pansplay
* @param {number | Pattern} spread between 0 and 1
* @example
* s("[bd hh]*2").pan("<.5 1 .5 0>").pansplay("<0 .5 1>").osc()
*
*/
['pansplay'],
['panwidth'],
['panorient'],
// ['pitch1'],
// ['pitch2'],
// ['pitch3'],
// ['portamento'],
// TODO: LFO rate see https://tidalcycles.org/docs/patternlib/tutorials/synthesizers/#supersquare
['rate'],
// TODO: slide param for certain synths
['slide'],
// TODO: detune? https://tidalcycles.org/docs/patternlib/tutorials/synthesizers/#supersquare
['semitone'],
// TODO: dedup with synth param, see https://tidalcycles.org/docs/reference/synthesizers/#superpiano
// ['velocity'],
['voice'], // TODO: synth param
/**
* Sets the level of reverb.
*
* When using mininotation, you can also optionally add the 'size' parameter, separated by ':'.
*
* @name room
* @param {number | Pattern} level between 0 and 1
* @example
* s("bd sd").room("<0 .2 .4 .6 .8 1>")
* @example
* s("bd sd").room("<0.9:1 0.9:4>")
*
*/
[['room', 'size']],
/**
* Sets the room size of the reverb, see {@link room}.
*
* @name roomsize
* @param {number | Pattern} size between 0 and 10
* @synonyms size, sz
* @example
* s("bd sd").room(.8).roomsize("<0 1 2 4 8>")
*
*/
// TODO: find out why :
// s("bd sd").room(.8).roomsize("<0 .2 .4 .6 .8 [1,0]>").osc()
// .. does not work. Is it because room is only one effect?
['size', 'sz', 'roomsize'],
// ['sagogo'],
// ['sclap'],
// ['sclaves'],
// ['scrash'],
/**
* Wave shaping distortion. CAUTION: it might get loud
*
* @name shape
* @param {number | Pattern} distortion between 0 and 1
* @example
* s("bd sd,hh*4").shape("<0 .2 .4 .6 .8>")
*
*/
['shape'],
/**
* Changes the speed of sample playback, i.e. a cheap way of changing pitch.
*
* @name speed
* @param {number | Pattern} speed -inf to inf, negative numbers play the sample backwards.
* @example
* s("bd").speed("<1 2 4 1 -2 -4>")
* @example
* speed("1 1.5*2 [2 1.1]").s("piano").clip(1)
*
*/
['speed'],
/**
* Used in conjunction with {@link speed}, accepts values of "r" (rate, default behavior), "c" (cycles), or "s" (seconds). Using `unit "c"` means `speed` will be interpreted in units of cycles, e.g. `speed "1"` means samples will be stretched to fill a cycle. Using `unit "s"` means the playback speed will be adjusted so that the duration is the number of seconds specified by `speed`.
*
* @name unit
* @param {number | string | Pattern} unit see description above
* @example
* speed("1 2 .5 3").s("bd").unit("c").osc()
* @superdirtOnly
*
*/
['unit'],
/**
* Made by Calum Gunn. Reminiscent of some weird mixture of filter, ring-modulator and pitch-shifter. The SuperCollider manual defines Squiz as:
*
* "A simplistic pitch-raising algorithm. It's not meant to sound natural; its sound is reminiscent of some weird mixture of filter, ring-modulator and pitch-shifter, depending on the input. The algorithm works by cutting the signal into fragments (delimited by upwards-going zero-crossings) and squeezing those fragments in the time domain (i.e. simply playing them back faster than they came in), leaving silences inbetween. All the parameters apart from memlen can be modulated."
*
* @name squiz
* @param {number | Pattern} squiz Try passing multiples of 2 to it - 2, 4, 8 etc.
* @example
* squiz("2 4/2 6 [8 16]").s("bd").osc()
* @superdirtOnly
*
*/
['squiz'],
// ['stutterdepth'], // TODO: what is this? not found in tidal doc
// ['stuttertime'], // TODO: what is this? not found in tidal doc
// ['timescale'], // TODO: what is this? not found in tidal doc
// ['timescalewin'], // TODO: what is this? not found in tidal doc
// ['tomdecay'],
// ['vcfegint'],
// ['vcoegint'],
// TODO: Use a rest (~) to override the effect <- vowel
/**
*
* Formant filter to make things sound like vowels.
*
* @name vowel
* @param {string | Pattern} vowel You can use a e i o u.
* @example
* note("c2 <eb2 <g2 g1>>").s('sawtooth')
* .vowel("<a e i <o u>>")
*
*/
['vowel'],
/* // TODO: find out how it works
* Made by Calum Gunn. Divides an audio stream into tiny segments, using the signal's zero-crossings as segment boundaries, and discards a fraction of them. Takes a number between 1 and 100, denoted the percentage of segments to drop. The SuperCollider manual describes the Waveloss effect this way:
*
* Divide an audio stream into tiny segments, using the signal's zero-crossings as segment boundaries, and discard a fraction of them (i.e. replace them with silence of the same length). The technique was described by Trevor Wishart in a lecture. Parameters: the filter drops drop out of out of chunks. mode can be 1 to drop chunks in a simple deterministic fashion (e.g. always dropping the first 30 out of a set of 40 segments), or 2 to drop chunks randomly but in an appropriate proportion.)
*
* mode: ?
* waveloss: ?
*
* @name waveloss
*/
['waveloss'],
// TODO: midi effects?
['dur'],
// ['modwheel'],
['expression'],
['sustainpedal'],
/* // TODO: doesn't seem to do anything
*
* Tremolo Audio DSP effect
*
* @name tremolodepth
* @param {number | Pattern} depth between 0 and 1
* @example
* n("0,4,7").tremolodepth("<0 .3 .6 .9>").osc()
*
*/
['tremolodepth', 'tremdp'],
['tremolorate', 'tremr'],
// TODO: doesn't seem to do anything
['phaserdepth', 'phasdp'],
['phaserrate', 'phasr'],
['fshift'],
['fshiftnote'],
['fshiftphase'],
['triode'],
['krush'],
['kcutoff'],
['octer'],
['octersub'],
['octersubsub'],
['ring'],
['ringf'],
['ringdf'],
['distort'],
['freeze'],
['xsdelay'],
['tsdelay'],
['real'],
['imag'],
['enhance'],
['partials'],
['comb'],
['smear'],
['scram'],
['binshift'],
['hbrick'],
['lbrick'],
['midichan'],
['control'],
['ccn'],
['ccv'],
['polyTouch'],
['midibend'],
['miditouch'],
['ctlNum'],
['frameRate'],
['frames'],
['hours'],
['midicmd'],
['minutes'],
['progNum'],
['seconds'],
['songPtr'],
['uid'],
['val'],
['cps'],
/**
* Multiplies the duration with the given number. Also cuts samples off at the end if they exceed the duration.
* In tidal, this would be done with legato, [which has a complicated history in strudel](https://github.com/tidalcycles/strudel/issues/111).
* For now, if you're coming from tidal, just think clip = legato.
*
* @name clip
* @param {number | Pattern} factor >= 0
* @example
* note("c a f e").s("piano").clip("<.5 1 2>")
*
*/
['clip'],
];
// TODO: slice / splice https://www.youtube.com/watch?v=hKhPdO0RKDQ&list=PL2lW1zNIIwj3bDkh-Y3LUGDuRcoUigoDs&index=13
controls.createParam = function (names) {
const name = Array.isArray(names) ? names[0] : names;
var withVal;
if (Array.isArray(names)) {
withVal = (xs) => {
if (Array.isArray(xs)) {
const result = {};
xs.forEach((x, i) => {
if (i < names.length) {
result[names[i]] = x;
}
});
return result;
} else {
return { [name]: xs };
}
};
} else {
withVal = (x) => ({ [name]: x });
}
const func = (...pats) => sequence(...pats).withValue(withVal);
const setter = function (...pats) {
if (!pats.length) {
return this.fmap(withVal);
}
return this.set(func(...pats));
};
Pattern.prototype[name] = setter;
return func;
};
generic_params.forEach(([names, ...aliases]) => {
const name = Array.isArray(names) ? names[0] : names;
controls[name] = controls.createParam(names);
aliases.forEach((alias) => {
controls[alias] = controls[name];
Pattern.prototype[alias] = Pattern.prototype[name];
});
});
controls.createParams = (...names) =>
names.reduce((acc, name) => Object.assign(acc, { [name]: controls.createParam(name) }), {});
controls.adsr = register('adsr', (adsr, pat) => {
adsr = !Array.isArray(adsr) ? [adsr] : adsr;
const [attack, decay, sustain, release] = adsr;
return pat.set({ attack, decay, sustain, release });
});
controls.ds = register('ds', (ds, pat) => {
ds = !Array.isArray(ds) ? [ds] : ds;
const [decay, sustain] = ds;
return pat.set({ decay, sustain });
});
export default controls;
+93
View File
@@ -0,0 +1,93 @@
/*
cyclist.mjs - <short description TODO>
Copyright (C) 2022 Strudel contributors - see <https://github.com/tidalcycles/strudel/blob/main/packages/core/cyclist.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 createClock from './zyklus.mjs';
import { logger } from './logger.mjs';
export class Cyclist {
constructor({ interval, onTrigger, onToggle, onError, getTime, latency = 0.1 }) {
this.started = false;
this.cps = 1;
this.lastTick = 0; // absolute time when last tick (clock callback) happened
this.lastBegin = 0; // query begin of last tick
this.lastEnd = 0; // query end of last tick
this.getTime = getTime; // get absolute time
this.onToggle = onToggle;
this.latency = latency; // fixed trigger time offset
const round = (x) => Math.round(x * 1000) / 1000;
this.clock = createClock(
getTime,
// called slightly before each cycle
(phase, duration, tick) => {
if (tick === 0) {
this.origin = phase;
}
try {
const time = getTime();
const begin = this.lastEnd;
this.lastBegin = begin;
const end = round(begin + duration * this.cps);
this.lastEnd = end;
const haps = this.pattern.queryArc(begin, end);
const tickdeadline = phase - time; // time left till phase begins
this.lastTick = time + tickdeadline;
haps.forEach((hap) => {
if (hap.part.begin.equals(hap.whole.begin)) {
const deadline = (hap.whole.begin - begin) / this.cps + tickdeadline + latency;
const duration = hap.duration / this.cps;
onTrigger?.(hap, deadline, duration, this.cps);
}
});
} catch (e) {
logger(`[cyclist] error: ${e.message}`);
onError?.(e);
}
},
interval, // duration of each cycle
);
}
now() {
const secondsSinceLastTick = this.getTime() - this.lastTick - this.clock.duration;
return this.lastBegin + secondsSinceLastTick * this.cps; // + this.clock.minLatency;
}
setStarted(v) {
this.started = v;
this.onToggle?.(v);
}
start() {
if (!this.pattern) {
throw new Error('Scheduler: no pattern set! call .setPattern first.');
}
logger('[cyclist] start');
this.clock.start();
this.setStarted(true);
}
pause() {
logger('[cyclist] pause');
this.clock.pause();
this.setStarted(false);
}
stop() {
logger('[cyclist] stop');
this.clock.stop();
this.lastEnd = 0;
this.setStarted(false);
}
setPattern(pat, autostart = false) {
this.pattern = pat;
if (autostart && !this.started) {
this.start();
}
}
setCps(cps = 1) {
this.cps = cps;
}
log(begin, end, haps) {
const onsets = haps.filter((h) => h.hasOnset());
console.log(`${begin.toFixed(4)} - ${end.toFixed(4)} ${Array(onsets.length).fill('I').join('')}`);
}
}
+161
View File
@@ -0,0 +1,161 @@
/*
draw.mjs - <short description TODO>
Copyright (C) 2022 Strudel contributors - see <https://github.com/tidalcycles/strudel/blob/main/packages/core/draw.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 { Pattern, getTime, State, TimeSpan } from './index.mjs';
export const getDrawContext = (id = 'test-canvas') => {
let canvas = document.querySelector('#' + id);
if (!canvas) {
canvas = document.createElement('canvas');
canvas.id = id;
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
canvas.style = 'pointer-events:none;width:100%;height:100%;position:fixed;top:0;left:0';
document.body.prepend(canvas);
}
return canvas.getContext('2d');
};
Pattern.prototype.draw = function (callback, { from, to, onQuery }) {
if (window.strudelAnimation) {
cancelAnimationFrame(window.strudelAnimation);
}
const ctx = getDrawContext();
let cycle,
events = [];
const animate = (time) => {
const t = getTime();
if (from !== undefined && to !== undefined) {
const currentCycle = Math.floor(t);
if (cycle !== currentCycle) {
cycle = currentCycle;
const begin = currentCycle + from;
const end = currentCycle + to;
setTimeout(() => {
events = this.query(new State(new TimeSpan(begin, end)))
.filter(Boolean)
.filter((event) => event.part.begin.equals(event.whole.begin));
onQuery?.(events);
}, 0);
}
}
callback(ctx, events, t, time);
window.strudelAnimation = requestAnimationFrame(animate);
};
requestAnimationFrame(animate);
return this;
};
export const cleanupDraw = (clearScreen = true) => {
const ctx = getDrawContext();
clearScreen && ctx.clearRect(0, 0, window.innerWidth, window.innerHeight);
if (window.strudelAnimation) {
cancelAnimationFrame(window.strudelAnimation);
}
if (window.strudelScheduler) {
clearInterval(window.strudelScheduler);
}
};
Pattern.prototype.onPaint = function (onPaint) {
// this is evil! TODO: add pattern.context
this.context = { onPaint };
return this;
};
// const round = (x) => Math.round(x * 1000) / 1000;
// encapsulates starting and stopping animation frames
export class Framer {
constructor(onFrame, onError) {
this.onFrame = onFrame;
this.onError = onError;
}
start() {
const self = this;
let frame = requestAnimationFrame(function updateHighlights(time) {
try {
self.onFrame(time);
} catch (err) {
self.onError(err);
}
frame = requestAnimationFrame(updateHighlights);
});
self.cancel = () => {
cancelAnimationFrame(frame);
};
}
stop() {
if (this.cancel) {
this.cancel();
}
}
}
// syncs animation frames to a cyclist scheduler
// see vite-vanilla-repl-cm6 for an example
export class Drawer {
constructor(onDraw, drawTime) {
let [lookbehind, lookahead] = drawTime; // e.g. [-2, 2]
lookbehind = Math.abs(lookbehind);
this.visibleHaps = [];
this.lastFrame = null;
this.drawTime = drawTime;
this.framer = new Framer(
() => {
if (!this.scheduler) {
console.warn('Drawer: no scheduler');
return;
}
// calculate current frame time (think right side of screen for pianoroll)
const phase = this.scheduler.now() + lookahead;
// first frame just captures the phase
if (this.lastFrame === null) {
this.lastFrame = phase;
return;
}
// query haps from last frame till now. take last 100ms max
const haps = this.scheduler.pattern.queryArc(Math.max(this.lastFrame, phase - 1 / 10), phase);
this.lastFrame = phase;
this.visibleHaps = (this.visibleHaps || [])
// filter out haps that are too far in the past (think left edge of screen for pianoroll)
.filter((h) => h.whole.end >= phase - lookbehind - lookahead)
// add new haps with onset (think right edge bars scrolling in)
.concat(haps.filter((h) => h.hasOnset()));
const time = phase - lookahead;
onDraw(this.visibleHaps, time, this);
},
(err) => {
console.warn('draw error', err);
},
);
}
invalidate(scheduler = this.scheduler) {
if (!scheduler) {
return;
}
this.scheduler = scheduler;
const t = scheduler.now();
let [_, lookahead] = this.drawTime;
const [begin, end] = [Math.max(t, 0), t + lookahead + 0.1];
// remove all future haps
this.visibleHaps = this.visibleHaps.filter((h) => h.whole.begin < t);
// query future haps
const futureHaps = scheduler.pattern.queryArc(begin, end); // +0.1 = workaround for weird holes in query..
// append future haps
this.visibleHaps = this.visibleHaps.concat(futureHaps);
}
start(scheduler) {
this.scheduler = scheduler;
this.invalidate();
this.framer.start();
}
stop() {
if (this.framer) {
this.framer.stop();
}
}
}
+62
View File
@@ -0,0 +1,62 @@
/*
drawLine.mjs - <short description TODO>
Copyright (C) 2022 Strudel contributors - see <https://github.com/tidalcycles/strudel/blob/main/packages/core/drawLine.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, { gcd } from './fraction.mjs';
/**
* Intended for a debugging, drawLine renders the pattern as a string, where each character represents the same time span.
* Should only be used with single characters as values, otherwise the character slots will be messed up.
* Character legend:
*
* - "|" cycle separator
* - "-" hold previous value
* - "." silence
*
* @param {Pattern} pattern the pattern to use
* @param {number} chars max number of characters (approximately)
* @returns string
* @example
* const line = drawLine("0 [1 2 3]", 10); // |0--123|0--123
* console.log(line);
* silence;
*/
function drawLine(pat, chars = 60) {
let cycle = 0;
let pos = Fraction(0);
let lines = [''];
let emptyLine = ''; // this will be the "reference" empty line, which will be copied into extra lines
while (lines[0].length < chars) {
const haps = pat.queryArc(cycle, cycle + 1);
const durations = haps.filter((hap) => hap.hasOnset()).map((hap) => hap.duration);
const charFraction = gcd(...durations);
const totalSlots = charFraction.inverse(); // number of character slots for the current cycle
lines = lines.map((line) => line + '|'); // add pipe character before each cycle
emptyLine += '|';
for (let i = 0; i < totalSlots; i++) {
const [begin, end] = [pos, pos.add(charFraction)];
const matches = haps.filter((hap) => hap.whole.begin.lte(begin) && hap.whole.end.gte(end));
const missingLines = matches.length - lines.length;
if (missingLines > 0) {
lines = lines.concat(Array(missingLines).fill(emptyLine));
}
lines = lines.map((line, i) => {
const hap = matches[i];
if (hap) {
const isOnset = hap.whole.begin.eq(begin);
const char = isOnset ? '' + hap.value : '-';
return line + char;
}
return line + '.';
});
emptyLine += '.';
pos = pos.add(charFraction);
}
cycle++;
}
return lines.join('\n');
}
export default drawLine;
+156 -14
View File
@@ -1,29 +1,171 @@
import { Pattern, timeCat } from './strudel.mjs';
import bjork from 'bjork';
import { rotate } from './util.mjs';
/*
euclid.mjs - Bjorklund/Euclidean/Diaspora rhythms
Copyright (C) 2023 Rohan Drape and strudel contributors
See <https://github.com/tidalcycles/strudel/blob/main/packages/core/euclid.mjs> for authors of this file.
The Bjorklund algorithm implementation is ported from the Haskell Music Theory Haskell module by Rohan Drape -
https://rohandrape.net/?t=hmt
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 { Pattern, timeCat, register, silence } from './pattern.mjs';
import { rotate, flatten, splitAt, zipWith } from './util.mjs';
import Fraction from './fraction.mjs';
const euclid = (pulses, steps, rotation = 0) => {
const b = bjork(steps, pulses);
const left = function (n, x) {
const [ons, offs] = n;
const [xs, ys] = x;
const [_xs, __xs] = splitAt(offs, xs);
return [
[offs, ons - offs],
[zipWith((a, b) => a.concat(b), _xs, ys), __xs],
];
};
const right = function (n, x) {
const [ons, offs] = n;
const [xs, ys] = x;
const [_ys, __ys] = splitAt(ons, ys);
const result = [
[ons, offs - ons],
[zipWith((a, b) => a.concat(b), xs, _ys), __ys],
];
return result;
};
const _bjork = function (n, x) {
const [ons, offs] = n;
return Math.min(ons, offs) <= 1 ? [n, x] : _bjork(...(ons > offs ? left(n, x) : right(n, x)));
};
export const bjork = function (ons, steps) {
const offs = steps - ons;
const x = Array(ons).fill([1]);
const y = Array(offs).fill([0]);
const result = _bjork([ons, offs], [x, y]);
return flatten(result[1][0]).concat(flatten(result[1][1]));
};
/**
* Changes the structure of the pattern to form an euclidean rhythm.
* Euclidian rhythms are rhythms obtained using the greatest common
* divisor of two numbers. They were described in 2004 by Godfried
* Toussaint, a canadian computer scientist. Euclidian rhythms are
* really useful for computer/algorithmic music because they can
* describe a large number of rhythms with a couple of numbers.
*
* @memberof Pattern
* @name euclid
* @param {number} pulses the number of onsets / beats
* @param {number} steps the number of steps to fill
* @returns Pattern
* @example
* // The Cuban tresillo pattern.
* note("c3").euclid(3,8)
*/
/**
* Like `euclid`, but has an additional parameter for 'rotating' the resulting sequence.
* @memberof Pattern
* @name euclidRot
* @param {number} pulses the number of onsets / beats
* @param {number} steps the number of steps to fill
* @param {number} rotation offset in steps
* @returns Pattern
* @example
* // A Samba rhythm necklace from Brazil
* note("c3").euclidRot(3,16,14)
*/
/**
* @example // A thirteenth century Persian rhythm called Khafif-e-ramal.
* note("c3").euclid(2,5)
* @example // The archetypal pattern of the Cumbia from Colombia, as well as a Calypso rhythm from Trinidad.
* note("c3").euclid(3,4)
* @example // Another thirteenth century Persian rhythm by the name of Khafif-e-ramal, as well as a Rumanian folk-dance rhythm.
* note("c3").euclidRot(3,5,2)
* @example // A Ruchenitza rhythm used in a Bulgarian folk-dance.
* note("c3").euclid(3,7)
* @example // The Cuban tresillo pattern.
* note("c3").euclid(3,8)
* @example // Another Ruchenitza Bulgarian folk-dance rhythm.
* note("c3").euclid(4,7)
* @example // The Aksak rhythm of Turkey.
* note("c3").euclid(4,9)
* @example // The metric pattern used by Frank Zappa in his piece titled Outside Now.
* note("c3").euclid(4,11)
* @example // Yields the York-Samai pattern, a popular Arab rhythm.
* note("c3").euclid(5,6)
* @example // The Nawakhat pattern, another popular Arab rhythm.
* note("c3").euclid(5,7)
* @example // The Cuban cinquillo pattern.
* note("c3").euclid(5,8)
* @example // A popular Arab rhythm called Agsag-Samai.
* note("c3").euclid(5,9)
* @example // The metric pattern used by Moussorgsky in Pictures at an Exhibition.
* note("c3").euclid(5,11)
* @example // The Venda clapping pattern of a South African childrens song.
* note("c3").euclid(5,12)
* @example // The Bossa-Nova rhythm necklace of Brazil.
* note("c3").euclid(5,16)
* @example // A typical rhythm played on the Bendir (frame drum).
* note("c3").euclid(7,8)
* @example // A common West African bell pattern.
* note("c3").euclid(7,12)
* @example // A Samba rhythm necklace from Brazil.
* note("c3").euclidRot(7,16,14)
* @example // A rhythm necklace used in the Central African Republic.
* note("c3").euclid(9,16)
* @example // A rhythm necklace of the Aka Pygmies of Central Africa.
* note("c3").euclidRot(11,24,14)
* @example // Another rhythm necklace of the Aka Pygmies of the upper Sangha.
* note("c3").euclidRot(13,24,5)
*/
const _euclidRot = function (pulses, steps, rotation) {
const b = bjork(pulses, steps);
if (rotation) {
return rotate(b, -rotation);
}
return b;
};
Pattern.prototype.euclid = function (pulses, steps, rotation = 0) {
return this.struct(euclid(pulses, steps, rotation));
};
export const euclid = register('euclid', function (pulses, steps, pat) {
return pat.struct(_euclidRot(pulses, steps, 0));
});
Pattern.prototype.euclidLegato = function (pulses, steps, rotation = 0) {
const bin_pat = euclid(pulses, steps, rotation);
const firstOne = bin_pat.indexOf(1);
const gapless = rotate(bin_pat, firstOne)
export const { euclidrot, euclidRot } = register(['euclidrot', 'euclidRot'], function (pulses, steps, rotation, pat) {
return pat.struct(_euclidRot(pulses, steps, rotation));
});
/**
* Similar to `euclid`, but each pulse is held until the next pulse,
* so there will be no gaps.
* @name euclidLegato
* @memberof Pattern
* @example
* n("g2").decay(.1).sustain(.3).euclidLegato(3,8)
*/
const _euclidLegato = function (pulses, steps, rotation, pat) {
if (pulses < 1) {
return silence;
}
const bin_pat = _euclidRot(pulses, steps, rotation);
const gapless = bin_pat
.join('')
.split('1')
.slice(1)
.map((s) => [s.length + 1, true]);
return this.struct(timeCat(...gapless)).late(Fraction(firstOne).div(steps));
return pat.struct(timeCat(...gapless));
};
export default euclid;
export const euclidLegato = register(['euclidLegato'], function (pulses, steps, pat) {
return _euclidLegato(pulses, steps, 0, pat);
});
export const euclidLegatoRot = register(['euclidLegatoRot'], function (pulses, steps, rotation, pat) {
return _euclidLegato(pulses, steps, rotation, pat);
});
+52
View File
@@ -0,0 +1,52 @@
/*
evaluate.mjs - <short description TODO>
Copyright (C) 2022 Strudel contributors - see <https://github.com/tidalcycles/strudel/blob/main/packages/eval/evaluate.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 { isPattern } from './index.mjs';
export const evalScope = async (...args) => {
const results = await Promise.allSettled(args);
const modules = results.filter((result) => result.status === 'fulfilled').map((r) => r.value);
results.forEach((result, i) => {
if (result.status === 'rejected') {
console.warn(`evalScope: module with index ${i} could not be loaded:`, result.reason);
}
});
// Object.assign(globalThis, ...modules);
// below is a fix for above commented out line
// same error as https://github.com/vitest-dev/vitest/issues/1807 when running this on astro server
modules.forEach((module) => {
Object.entries(module).forEach(([name, value]) => {
globalThis[name] = value;
});
});
};
function safeEval(str, options = {}) {
const { wrapExpression = true, wrapAsync = true } = options;
if (wrapExpression) {
str = `{${str}}`;
}
if (wrapAsync) {
str = `(async ()=>${str})()`;
}
const body = `"use strict";return (${str})`;
return Function(body)();
}
export const evaluate = async (code, transpiler) => {
if (transpiler) {
code = transpiler(code); // transform syntactically correct js code to semantically usable code
}
// if no transpiler is given, we expect a single instruction (!wrapExpression)
const options = { wrapExpression: !!transpiler };
let evaluated = await safeEval(code, options);
if (!isPattern(evaluated)) {
console.log('evaluated', evaluated);
const message = `got "${typeof evaluated}" instead of pattern`;
throw new Error(message + (typeof evaluated === 'function' ? ', did you forget to call a function?' : '.'));
}
return { mode: 'javascript', pattern: evaluated };
};
+2 -2
View File
@@ -1,13 +1,13 @@
<input
type="text"
id="text"
value="cat('a', 'b')"
value="seq('a', ['b', 'c'])"
style="width: 100%; font-size: 2em; outline: none; margin-bottom: 10px"
spellcheck="false"
/>
<div id="output"></div>
<script type="module">
const strudel = await import('https://cdn.skypack.dev/@strudel.cycles/core@0.0.2');
const strudel = await import('https://cdn.skypack.dev/@strudel.cycles/core@0.6.8');
Object.assign(window, strudel); // assign all strudel functions to global scope to use with eval
const input = document.getElementById('text');
const getEvents = () => {
+4 -5
View File
@@ -2,13 +2,13 @@
<input
type="text"
id="text"
value="cat('lime', slowcat('steelblue','darkblue'),'yellow','salmon','black').every(2,rev).fast(16)"
style="width: 100%; font-size: 1.5em; background: black; color: white; outline: none; position: absolute; top: 0"
value="seq('tomato', 'indigo', ['white', 'steelblue']).fast(4)"
style="width: 100%; font-size: 2em; background: black; color: white; outline: none; position: absolute; top: 0"
spellcheck="false"
/>
<canvas id="canvas"></canvas>
<script type="module">
const strudel = await import('https://cdn.skypack.dev/@strudel.cycles/core@0.0.2');
const strudel = await import('https://cdn.skypack.dev/@strudel.cycles/core@0.6.8');
// this adds all strudel functions to the global scope, to be used by eval
Object.assign(window, strudel);
// setup elements
@@ -25,10 +25,9 @@
function paint(code) {
const pattern = eval(code); // run code
const events = pattern.firstCycle(); // query first cycle
ctx.clearRect(0, 0, canvas.width, canvas.height); // clear canvas
events.forEach((event) => {
ctx.fillStyle = event.value;
ctx.fillRect(event.whole.begin * canvas.width, 0, event.duration * canvas.width, canvas.height);
ctx.fillRect(event.whole.begin * canvas.width, 0, event.duration.valueOf() * canvas.width, canvas.height);
});
}
</script>
-237
View File
@@ -1,237 +0,0 @@
<div style="position: absolute; top: 0; right: 0; padding: 4px">
<button id="start" style="margin-bottom: 4px; font-size: 2em">start</button><br />
<button id="stop" style="font-size: 2em">stop</button>
</div>
<textarea
style="font-size: 2em; background: #e8d565; color: #323230; height: 100%; width: 100%; outline: none; border: 0"
id="text"
spellcheck="false"
>
Loading...</textarea
>
<script type="module">
document.body.style = 'margin: 0';
import * as strudel from 'https://cdn.skypack.dev/@strudel.cycles/core@0.0.2';
import 'https://cdn.skypack.dev/@strudel.cycles/core@0.0.2/euclid.mjs';
const { cat, State, TimeSpan } = strudel;
let pattern;
Object.assign(window, strudel); // add strudel to eval scope
const input = document.getElementById('text');
let initialCode = `sequence(880, [440, 660], 440, 660)
.div(slowcat(3,2).slow(2))
.off(1/8,mul(2))
.off(1/4,mul(3))
.legato(2)
.slow(2)`;
try {
initialCode = atob(decodeURIComponent(window.location.href.split('#')[1]));
} catch (err) {
console.warn('failed to decode', err);
}
input.value = initialCode;
const evaluate = () => {
try {
pattern = eval(input.value);
window.location.hash = '#' + encodeURIComponent(btoa(input.value)); // update url hash
} catch (err) {
console.warn(err);
}
};
input.addEventListener('input', () => evaluate());
// helpers to create a worker dynamically without needing a server / extra file
const stringifyFunction = (func) => '(' + func + ')();';
const urlifyFunction = (func) =>
URL.createObjectURL(new Blob([stringifyFunction(func)], { type: 'text/javascript' }));
const createWorker = (func) => new Worker(urlifyFunction(func));
const interval = 0.1;
const lookahead = 0.5;
// this class is basically the tale of two clocks
class Metro {
worker;
audioContext;
interval = 0.2; // query span
lastEnd = 0;
constructor(audioContext, callback, interval = this.interval) {
this.audioContext = audioContext;
this.interval = interval;
this.worker = createWorker(() => {
// we cannot use closures here!
let interval;
let timerID = null; // this is clock #1 (the sloppy js clock)
const clear = () => {
if (timerID) {
clearInterval(timerID);
timerID = null;
}
};
const start = () => {
clear();
if (!interval) {
throw new Error('no interval set! call worker.postMessage({interval}) before starting.');
}
timerID = setInterval(() => postMessage('tick'), interval * 1000);
};
self.onmessage = function (e) {
if (e.data == 'start') {
start();
} else if (e.data.interval) {
interval = e.data.interval;
if (timerID) {
start();
}
} else if (e.data == 'stop') {
clear();
}
};
});
this.worker.postMessage({ interval });
const round = (n, d) => Math.round(n * d) / d;
const precision = 100;
this.worker.onmessage = (e) => {
if (e.data === 'tick') {
const begin = this.lastEnd || this.audioContext.currentTime;
const end = this.audioContext.currentTime + this.interval; // DONT reference begin here!
this.lastEnd = end;
// callback with query span, using clock #2 (the audio clock)
callback(begin, end);
}
};
}
start() {
console.log('start...');
this.audioContext.resume();
this.worker.postMessage('start');
}
stop() {
console.log('stop...');
this.worker.postMessage('stop');
}
}
const audioContext = new AudioContext();
const metro = new Metro(
audioContext,
(begin, end) => {
pattern.query(new State(new TimeSpan(begin, end))).forEach((e) => {
if (!e.part.begin.equals(e.whole.begin)) {
return;
}
if (e.context.createAudioNode) {
e.context.createAudioNode(e);
} else {
// fallback sine wave
const attack = 0.01;
const decay = 0.05;
const sustain = 0.5;
const release = 0.01;
const velocity = (e.context?.velocity || 1) * 0.1;
const osc = audioContext.createOscillator();
osc.type = 'sine';
osc.frequency.value = e.value;
osc.start(e.whole.begin);
const envelope = adsr(attack, decay, sustain, release, velocity, e.whole.begin, e.whole.end);
osc.stop(e.whole.end + release);
osc.connect(envelope);
envelope.connect(audioContext.destination);
}
});
},
interval,
lookahead,
);
const adsr = (attack, decay, sustain, release, velocity, begin, end) => {
const gainNode = audioContext.createGain();
gainNode.gain.setValueAtTime(0, begin);
gainNode.gain.linearRampToValueAtTime(velocity, begin + attack); // attack
gainNode.gain.linearRampToValueAtTime(sustain * velocity, begin + attack + decay); // sustain start
gainNode.gain.setValueAtTime(sustain * velocity, end); // sustain end
gainNode.gain.linearRampToValueAtTime(0, end + release); // release
// for some reason, using exponential ramping creates little cracklings
return gainNode;
};
strudel.Pattern.prototype.withAudioNode = function (createAudioNode) {
return this._withEvent((event) => {
return event.setContext({
...event.context,
createAudioNode: (e) => createAudioNode(e, event.context.createAudioNode?.(event)),
});
});
};
strudel.Pattern.prototype._osc = function (type) {
return this.withAudioNode((e) => {
const osc = audioContext.createOscillator();
osc.type = type;
osc.frequency.value = e.value; // expects frequency..
osc.start(e.whole.begin.valueOf() + lookahead);
osc.stop(e.whole.end.valueOf() + lookahead); // release?
// osc.connect(audioContext.destination);
return osc;
});
};
strudel.Pattern.prototype.define('osc', (type, pat) => pat.osc(type), { patternified: true });
strudel.Pattern.prototype.adsr = function (a = 0.01, d = 0.05, s = 1, r = 0.01) {
return this.withAudioNode((e, node) => {
const velocity = e.context?.velocity || 1;
const envelope = adsr(
a,
d,
s,
r,
velocity,
e.whole.begin.valueOf() + lookahead,
e.whole.end.valueOf() + lookahead,
);
node?.connect(envelope);
return envelope;
});
};
strudel.Pattern.prototype.filter = function (type = 'lowshelf', frequency = 1000, gain = 25) {
return this.withAudioNode((e, node) => {
const filter = audioContext.createBiquadFilter();
filter.type = type;
filter.frequency.value = frequency;
filter.gain.value = gain;
node?.connect(filter);
return filter;
});
};
strudel.Pattern.prototype.out = function () {
const master = audioContext.createGain();
master.gain.value = 0.1;
master.connect(audioContext.destination);
return this.withAudioNode((e, node) => {
if (!node) {
console.warn('out: no source! call .osc() first');
}
node?.connect(master);
});
};
document.getElementById('start').addEventListener('click', () => metro.start());
document.getElementById('stop').addEventListener('click', () => metro.stop());
evaluate(); // evaluate initial code
/*
sequence(1,3/2,1,2).stack(
stack(5,3,4).velocity(.8).slow(2).legato(.2)
//.echo(3, 1/4, .5)
).mul(110) // frequencies
.div(slowcat(slowcat(2,5/4, 3/2),slowcat(3,4/3)).slow(2))
.echoWith(
16, // n of partials / cutoff
tri2.slow(128).div(2), // time between partials
(x,n)=>x // n = partial index 0..n
.mul((n+1)*3/2)
.legato(2)
.velocity(1/((n+1)**1.6)) // amplitude falloff
).legato(2) // note length
*/
</script>
+83
View File
@@ -0,0 +1,83 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Buildless Vanilla Strudel REPL</title>
</head>
<body style="margin: 0; background: #222">
<div style="display: grid; height: 100vh; grid-template-rows: 32px auto">
<button id="start" style="width: 100vw; height: 32px">evaluate</button>
<textarea
id="text"
style="font-size: 2em; border: 0; color: white; background: transparent; outline: none; padding: 20px"
spellcheck="false"
></textarea>
</div>
<div id="output"></div>
<script type="module">
import { controls, repl, evalScope } from 'https://cdn.skypack.dev/@strudel.cycles/core@0.6.8';
import { mini } from 'https://cdn.skypack.dev/@strudel.cycles/mini@0.6.0';
import { transpiler } from 'https://cdn.skypack.dev/@strudel.cycles/transpiler@0.6.0';
import {
getAudioContext,
webaudioOutput,
initAudioOnFirstClick,
} from 'https://cdn.skypack.dev/@strudel.cycles/webaudio@0.6.0';
initAudioOnFirstClick();
const ctx = getAudioContext();
const input = document.getElementById('text');
input.innerHTML = getTune();
evalScope(
controls,
import('https://cdn.skypack.dev/@strudel.cycles/core@0.6.8'),
import('https://cdn.skypack.dev/@strudel.cycles/mini@0.6.0'),
import('https://cdn.skypack.dev/@strudel.cycles/tonal@0.6.0'),
import('https://cdn.skypack.dev/@strudel.cycles/webaudio@0.6.0'),
);
const { evaluate } = repl({
defaultOutput: webaudioOutput,
getTime: () => ctx.currentTime,
transpiler,
});
document.getElementById('start').addEventListener('click', () => evaluate(input.value));
function getTune() {
return `await samples('github:tidalcycles/Dirt-Samples/master')
stack(
// amen
n("0 1 2 3 4 5 6 7")
.sometimes(x=>x.ply(2))
.rarely(x=>x.speed("2 | -2"))
.sometimesBy(.4, x=>x.delay(".5"))
.s("amencutup")
.slow(2)
.room(.5)
,
// bass
sine.add(saw.slow(4)).range(0,7).segment(8)
.superimpose(x=>x.add(.1))
.scale('G0 minor').note()
.s("sawtooth").decay(.1).sustain(0)
.gain(.4).cutoff(perlin.range(300,3000).slow(8)).resonance(10)
.degradeBy("0 0.1 .5 .1")
.rarely(add(note("12")))
,
// chord
note("Bb3,D4".superimpose(x=>x.add(.2)))
.s('sawtooth').cutoff(1000).struct("<~@3 [~ x]>")
.decay(.05).sustain(.0).delay(.8).delaytime(.125).room(.8)
,
// alien
s("breath").room(1).shape(.6).chop(16).rev().mask("<x ~@7>")
,
n("0 1").s("east").delay(.5).degradeBy(.8).speed(rand.range(.5,1.5))
).reset("<x@7 x(5,8)>")`;
}
</script>
</body>
</html>
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
@@ -0,0 +1,8 @@
# vite-vanilla-repl-cm6
This folder demonstrates how to set up a strudel repl using vite and vanilla JS + codemirror. Run it using:
```sh
npm i
npm run dev
```
@@ -0,0 +1,22 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite Vanilla Strudel REPL</title>
</head>
<body>
<main>
<nav>
<button id="play">eval</button>
<button id="stop">stop</button>
</nav>
<div class="container">
<div id="editor"></div>
<div id="output"></div>
</div>
<canvas id="roll"></canvas>
</main>
<script type="module" src="./main.js"></script>
</body>
</html>
@@ -0,0 +1,39 @@
import { StrudelMirror } from '@strudel/codemirror';
import { funk42 } from './tunes';
import { drawPianoroll, evalScope, controls } from '@strudel.cycles/core';
import './style.css';
import { initAudioOnFirstClick } from '@strudel.cycles/webaudio';
import { transpiler } from '@strudel.cycles/transpiler';
import { getAudioContext, webaudioOutput, registerSynthSounds } from '@strudel.cycles/webaudio';
import { registerSoundfonts } from '@strudel.cycles/soundfonts';
// init canvas
const canvas = document.getElementById('roll');
canvas.width = canvas.width * 2;
canvas.height = canvas.height * 2;
const drawContext = canvas.getContext('2d');
const drawTime = [-2, 2]; // time window of drawn haps
const editor = new StrudelMirror({
defaultOutput: webaudioOutput,
getTime: () => getAudioContext().currentTime,
transpiler,
root: document.getElementById('editor'),
initialCode: funk42,
drawTime,
onDraw: (haps, time) => drawPianoroll({ haps, time, ctx: drawContext, drawTime, fold: 0 }),
prebake: async () => {
initAudioOnFirstClick(); // needed to make the browser happy (don't await this here..)
const loadModules = evalScope(
controls,
import('@strudel.cycles/core'),
import('@strudel.cycles/mini'),
import('@strudel.cycles/tonal'),
import('@strudel.cycles/webaudio'),
);
await Promise.all([loadModules, registerSynthSounds(), registerSoundfonts()]);
},
});
document.getElementById('play').addEventListener('click', () => editor.evaluate());
document.getElementById('stop').addEventListener('click', () => editor.stop());
@@ -0,0 +1,23 @@
{
"name": "vite-vanilla-repl-cm6",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"devDependencies": {
"vite": "^4.3.2"
},
"dependencies": {
"@strudel/codemirror": "workspace:*",
"@strudel.cycles/core": "workspace:*",
"@strudel.cycles/mini": "workspace:*",
"@strudel.cycles/soundfonts": "workspace:*",
"@strudel.cycles/tonal": "workspace:*",
"@strudel.cycles/transpiler": "workspace:*",
"@strudel.cycles/webaudio": "workspace:*"
}
}
@@ -0,0 +1,31 @@
body,
html {
margin: 0;
height: 100%;
background: #282c34;
}
main {
height: 100%;
display: flex;
flex-direction: column;
}
.container {
flex-grow: 1;
max-height: 100%;
position: relative;
overflow: auto;
}
#editor {
overflow: auto;
}
.cm-editor {
height: 100%;
}
#roll {
height: 300px;
}
@@ -0,0 +1,112 @@
export const bumpStreet = `// froos - "22 bump street", licensed with CC BY-NC-SA 4.0
await samples('github:felixroos/samples/main')
await samples('https://strudel.tidalcycles.org/tidal-drum-machines.json', 'github:ritchse/tidal-drum-machines/main/machines/')
"<[0,<6 7 9>,13,<17 20 22 26>]!2>/2"
// make it 22 edo
.fmap(v => Math.pow(2,v/22))
// mess with the base frequency
.mul("<300 [300@3 200]>/8").freq()
.layer(
// chords
x=>x.div(freq(2)).s("flute").euclidLegato("<3 2>",8)
.shape(.4).lpf(sine.range(800,4000).slow(8)),
// adlibs
x=>x.arp("{0 3 2 [1 3]}%1.5")
.s('xylo').mul(freq(2))
.delay(.5).delayfeedback(.4).juxBy(.5, rev)
.hpf(sine.range(200,3000).slow(8)),
// bass
x=>x.arp("[0 [2 1?]](5,8)").s('sawtooth').div(freq(4))
.lpf(sine.range(400,2000).slow(8)).lpq(8).shape(.4)
.off(1/8, x=>x.mul(freq(2)).degradeBy(.5)).gain(.3)
).clip(1).release(.2)
.stack(
// drums
s("bd sd:<2 1>, [~ hh]*2, [~ rim]").bank('RolandTR909')
.off(1/8, x=>x.speed(2).gain(.4)).sometimes(ply(2)).gain(.8)
.mask("<0@4 1@12>/4")
.reset("<x@15 [x(3,8) x*[4 8]]>")
// wait for it...
).fast(2/3)
//.crush(6) // remove "//" if you dare`;
export const trafficFlam = `// froos - "traffic flam", licensed with CC BY-NC-SA 4.0
await samples('github:felixroos/samples/main')
await samples('https://strudel.tidalcycles.org/tidal-drum-machines.json', 'github:ritchse/tidal-drum-machines/main/machines/')
addVoicings('hip', {
m11: ['2M 3m 4P 7m'],
'^7#11': ['3M 4A 5P 7M'],
}, ['C4', 'C6'])
stack(
stack(
"<Bbm11 A^7#11>/2".voicings('hip').note()
.s("gm_epiano1:2")
.arp("[<[0 1 2 3] [3 2 1 0]> ~@5]/2")
.release(2).late(.25).lpf(2000),
"<Bb1 A1>/2".note().s('gm_acoustic_bass'),
n("<0 2 3>(3,8)".off(1/8, add(4)))
.scale("<Bb4:minor A4:lydian>/2")
.s('gm_electric_guitar_jazz')
.decay(sine.range(.05, .2).slow(32)).sustain(0)
.delay(.5).lpf(sine.range(100,5000).slow(64))
.gain(.7).room(.5).pan(sine.range(0,1).slow(11))
).add(perlin.range(0,.25).note()),
stack(
s("bd:1(3,8) rim").bank('RolandTR707').slow(2).room("<0 <.1 .6>>")
.when("<0@7 1>",x=>x.echoWith(3, .0625, (x,i) => x.speed(1+i*.24))),
s("rim*4").end(.05).bank('RolandTR808').speed(.8).room(.2)
)
)
.late("[0 .05]*2").late(12)
`;
export const funk42 = `// froos - how to funk in 42 lines of code
// adapted from "how to funk in two minutes" by marc rebillet https://www.youtube.com/watch?v=3vBwRfQbXkg
// thanks to peach for the transcription: https://www.youtube.com/watch?v=8eiPXvIgda4
await samples('github:felixroos/samples/main')
await samples('https://strudel.tidalcycles.org/tidal-drum-machines.json', 'github:ritchse/tidal-drum-machines/main/machines/')
setcps(.5)
let drums = stack(
s("bd*2, ~ sd").bank('RolandTR707').room("0 .1"),
s("hh*4").begin(.2).release(.02).end(.25).release(.02)
.gain(.3).bank('RolandTR707').late(.02).room(.5),
//s("shaker_small").struct("[x x*2]*2").speed(".8,.9").release(.02)
).fast(2)
let wurli = note(\`<
[[a2,g3,[b3 c4],e4] ~ [g3,c4,e4](3,8)@4 ~@2]!3
[[e2,e3,a3,b3,e4]@3 [e2,e3,ab3,b3,e4]@5]>\`)
.s("gm_epiano1:5").decay(.2).sustain("<[1 0@7]!3 1>")
.gain("<[.8@2 .4@14]!3 .7>").room(.3)
let organ = note("<[~@3 [a3,d4,f#4]@2 [[a3,c4,e4]@2 ~] ~@2]!3 ~>".add(12))
.s("gm_percussive_organ:2").gain(.6).lpf(1800).pan(.2).room(.3);
let clav = note(\`<
[~@3 a2 [g3,[b3 c4],e4]@2 ~ a2 [g3,b3,e4] ~@2 [g3,c4,e4] ~@4]!3
[~@3 e3 [[a3 b3],c3,e3]@2 ~ e2 [e3,a3]@3 [b3,e3] ~@2 [b3,e3]@2]>\`)
.s("gm_clavinet:1").decay("<.25!3 [.25 .4]>").sustain(0)
.gain(.7).pan(.8).room(.2);
let bass = note(\`<
[a1 [~ [g2 a2]] [g1 g#1] [a1 [g2 a2]]]
[a1 [~ [g2 a2]] [e3 d3] [c3 [g3 a3]]]
[a1 [~ [g2 a2]] [g1 g#1] [a1 [g2 a2]]]
[e2@6 e1@5 e1 [[d2 e3] g1]@4]
>\`).s("gm_electric_bass_pick:1").release(.1)
stack(
drums
,wurli
,organ
,clav
,bass
)`;
@@ -0,0 +1 @@
!dist
@@ -0,0 +1,8 @@
# vite-vanilla-repl
This folder demonstrates how to set up a strudel repl using vite and vanilla JS. Run it using:
```sh
npm i
npm run dev
```
@@ -0,0 +1 @@
import{b as s,h as i,m,a as n,c as p,p as t}from"./index.4cbc0a10.js";export{s as SyntaxError,i as h,m as mini,n as minify,p as parse,t as patternifyAST};
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
import{g as s,f as d,i as t,n as r,l as u,j as o,d as f,k as p,r as g,s as i,w as l,e as m}from"./index.4cbc0a10.js";export{s as getAudioContext,d as getCachedBuffer,t as getLoadedBuffer,r as getLoadedSamples,u as loadBuffer,o as loadGithubSamples,f as panic,p as resetLoadedSamples,g as reverseBuffer,i as samples,l as webaudioOutput,m as webaudioOutputTrigger};
@@ -0,0 +1,36 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite Vanilla Strudel REPL</title>
<script type="module" crossorigin src="/tidalcycles/strudel/use-acorn/packages/core/examples/vite-vanilla-repl/dist/assets/index.4cbc0a10.js"></script>
</head>
<body style="margin: 0; background: #222">
<div style="display: grid; height: 100vh">
<textarea
id="text"
style="font-size: 2em; border: 0; color: white; background: transparent; outline: none; padding: 20px"
spellcheck="false"
></textarea>
</div>
<button
id="start"
style="
position: absolute;
border-radius: 10px;
top: 20px;
right: 20px;
padding: 20px;
border: 2px solid white;
background: transparent;
color: white;
cursor: pointer;
"
>
evaluate
</button>
<div id="output"></div>
</body>
</html>
@@ -0,0 +1,35 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite Vanilla Strudel REPL</title>
</head>
<body style="margin: 0; background: #222">
<div style="display: grid; height: 100vh">
<textarea
id="text"
style="font-size: 2em; border: 0; color: white; background: transparent; outline: none; padding: 20px"
spellcheck="false"
></textarea>
</div>
<button
id="start"
style="
position: absolute;
border-radius: 10px;
top: 20px;
right: 20px;
padding: 20px;
border: 2px solid white;
background: transparent;
color: white;
cursor: pointer;
"
>
evaluate
</button>
<div id="output"></div>
<script type="module" src="./main.js"></script>
</body>
</html>
@@ -0,0 +1,28 @@
import { controls, repl, evalScope } from '@strudel.cycles/core';
import { getAudioContext, webaudioOutput, initAudioOnFirstClick } from '@strudel.cycles/webaudio';
import { transpiler } from '@strudel.cycles/transpiler';
import tune from './tune.mjs';
const ctx = getAudioContext();
const input = document.getElementById('text');
input.innerHTML = tune;
initAudioOnFirstClick();
evalScope(
controls,
import('@strudel.cycles/core'),
import('@strudel.cycles/mini'),
import('@strudel.cycles/webaudio'),
import('@strudel.cycles/tonal'),
);
const { evaluate } = repl({
defaultOutput: webaudioOutput,
getTime: () => ctx.currentTime,
transpiler,
});
document.getElementById('start').addEventListener('click', () => {
ctx.resume();
console.log('eval', input.value);
evaluate(input.value);
});
@@ -0,0 +1,22 @@
{
"name": "vite-vanilla-repl",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build-githack": "vite build --base /tidalcycles/strudel/use-acorn/packages/core/examples/vite-vanilla-repl/dist/",
"build": "vite build",
"preview": "vite preview"
},
"devDependencies": {
"vite": "^4.3.3"
},
"dependencies": {
"@strudel.cycles/core": "workspace:*",
"@strudel.cycles/mini": "workspace:*",
"@strudel.cycles/transpiler": "workspace:*",
"@strudel.cycles/webaudio": "workspace:*",
"@strudel.cycles/tonal": "workspace:*"
}
}
@@ -0,0 +1,31 @@
export default `await samples('github:tidalcycles/Dirt-Samples/master')
stack(
// amen
n("0 1 2 3 4 5 6 7")
.sometimes(x=>x.ply(2))
.rarely(x=>x.speed("2 | -2"))
.sometimesBy(.4, x=>x.delay(".5"))
.s("amencutup")
.slow(2)
.room(.5)
,
// bass
sine.add(saw.slow(4)).range(0,7).segment(8)
.superimpose(x=>x.add(.1))
.scale('G0 minor').note()
.s("sawtooth").decay(.1).sustain(0)
.gain(.4).cutoff(perlin.range(300,3000).slow(8)).resonance(10)
.degradeBy("0 0.1 .5 .1")
.rarely(add(note("12")))
,
// chord
note("Bb3,D4".superimpose(x=>x.add(.2)))
.s('sawtooth').cutoff(1000).struct("<~@3 [~ x]>")
.decay(.05).sustain(.0).delay(.8).delaytime(.125).room(.8)
,
// alien
s("breath").room(1).shape(.6).chop(16).rev().mask("<x ~@7>")
,
n("0 1").s("east").delay(.5).degradeBy(.8).speed(rand.range(.5,1.5))
).reset("<x@7 x(5,8)>")`;
+21 -3
View File
@@ -1,5 +1,11 @@
/*
fraction.mjs - <short description TODO>
Copyright (C) 2022 Strudel contributors - see <https://github.com/tidalcycles/strudel/blob/main/packages/core/fraction.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 { TimeSpan } from './strudel.mjs';
import { TimeSpan } from './timespan.mjs';
// Returns the start of the cycle.
Fraction.prototype.sam = function () {
@@ -16,6 +22,11 @@ Fraction.prototype.wholeCycle = function () {
return new TimeSpan(this.sam(), this.nextSam());
};
// The position of a time value relative to the start of its cycle.
Fraction.prototype.cyclePos = function () {
return this.sub(this.sam());
};
Fraction.prototype.lt = function (other) {
return this.compare(other) < 0;
};
@@ -44,7 +55,8 @@ Fraction.prototype.min = function (other) {
return this.lt(other) ? this : other;
};
Fraction.prototype.show = function () {
Fraction.prototype.show = function (/* excludeWhole = false */) {
// return this.toFraction(excludeWhole);
return this.s * this.n + '/' + this.d;
};
@@ -62,11 +74,17 @@ const fraction = (n) => {
-> those farey sequences turn out to make pattern querying ~20 times slower! always use strings!
-> still, some optimizations could be done: .mul .div .add .sub calls still use numbers
*/
n = String(n);
// n = String(n); // this is actually faster but imprecise...
}
return Fraction(n);
};
export const gcd = (...fractions) => {
return fractions.reduce((gcd, fraction) => gcd.gcd(fraction), fraction(1));
};
fraction._original = Fraction;
export default fraction;
// "If you concern performance, cache Fraction.js objects and pass arrays/objects.“
+8 -2
View File
@@ -1,6 +1,12 @@
/*
gist.js - <short description TODO>
Copyright (C) 2022 Strudel contributors - see <https://github.com/tidalcycles/strudel/blob/main/packages/core/gist.js>
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/>.
*/
// this is a shortcut to eval code from a gist
// why? to be able to shorten strudel code + e.g. be able to change instruments after links have been generated
export default (route) =>
fetch(`https://gist.githubusercontent.com/${route}?cachebust=${Date.now()}`)
export default (route, cache = true) =>
fetch(`https://gist.githubusercontent.com/${route}?cachebust=${cache ? '' : Date.now()}`)
.then((res) => res.text())
.then((code) => eval(code));
+148
View File
@@ -0,0 +1,148 @@
/*
hap.mjs - <short description TODO>
Copyright (C) 2022 Strudel contributors - see <https://github.com/tidalcycles/strudel/blob/main/packages/core/hap.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/>.
*/
export class Hap {
/*
Event class, representing a value active during the timespan
'part'. This might be a fragment of an event, in which case the
timespan will be smaller than the 'whole' timespan, otherwise the
two timespans will be the same. The 'part' must never extend outside of the
'whole'. If the event represents a continuously changing value
then the whole will be returned as None, in which case the given
value will have been sampled from the point halfway between the
start and end of the 'part' timespan.
The context is to store a list of source code locations causing the event.
The word 'Event' is more or less a reserved word in javascript, hence this
class is named called 'Hap'.
*/
constructor(whole, part, value, context = {}, stateful = false) {
this.whole = whole;
this.part = part;
this.value = value;
this.context = context;
this.stateful = stateful;
if (stateful) {
console.assert(typeof this.value === 'function', 'Stateful values must be functions');
}
}
get duration() {
return this.whole.end.sub(this.whole.begin).mul(typeof this.value?.clip === 'number' ? this.value?.clip : 1);
}
get endClipped() {
return this.whole.begin.add(this.duration);
}
wholeOrPart() {
return this.whole ? this.whole : this.part;
}
withSpan(func) {
// Returns a new hap with the function f applies to the hap timespan.
const whole = this.whole ? func(this.whole) : undefined;
return new Hap(whole, func(this.part), this.value, this.context);
}
withValue(func) {
// Returns a new hap with the function f applies to the hap value.
return new Hap(this.whole, this.part, func(this.value), this.context);
}
hasOnset() {
// Test whether the hap contains the onset, i.e that
// the beginning of the part is the same as that of the whole timespan."""
return this.whole != undefined && this.whole.begin.equals(this.part.begin);
}
resolveState(state) {
if (this.stateful && this.hasOnset()) {
console.log('stateful');
const func = this.value;
const [newState, newValue] = func(state);
return [newState, new Hap(this.whole, this.part, newValue, this.context, false)];
}
return [state, this];
}
spanEquals(other) {
return (this.whole == undefined && other.whole == undefined) || this.whole.equals(other.whole);
}
equals(other) {
return (
this.spanEquals(other) &&
this.part.equals(other.part) &&
// TODO would == be better ??
this.value === other.value
);
}
show(compact = false) {
const value =
typeof this.value === 'object'
? compact
? JSON.stringify(this.value).slice(1, -1).replaceAll('"', '').replaceAll(',', ' ')
: JSON.stringify(this.value)
: this.value;
var spans = '';
if (this.whole == undefined) {
spans = '~' + this.part.show;
} else {
var is_whole = this.whole.begin.equals(this.part.begin) && this.whole.end.equals(this.part.end);
if (!this.whole.begin.equals(this.part.begin)) {
spans = this.whole.begin.show() + ' ⇜ ';
}
if (!is_whole) {
spans += '(';
}
spans += this.part.show();
if (!is_whole) {
spans += ')';
}
if (!this.whole.end.equals(this.part.end)) {
spans += ' ⇝ ' + this.whole.end.show();
}
}
return '[ ' + spans + ' | ' + value + ' ]';
}
showWhole(compact = false) {
return `${this.whole == undefined ? '~' : this.whole.show()}: ${
typeof this.value === 'object'
? compact
? JSON.stringify(this.value).slice(1, -1).replaceAll('"', '').replaceAll(',', ' ')
: JSON.stringify(this.value)
: this.value
}`;
}
combineContext(b) {
const a = this;
return { ...a.context, ...b.context, locations: (a.context.locations || []).concat(b.context.locations || []) };
}
setContext(context) {
return new Hap(this.whole, this.part, this.value, context);
}
ensureObjectValue() {
/* if (isNote(hap.value)) {
// supports primitive hap values that look like notes
hap.value = { note: hap.value };
} */
if (typeof this.value !== 'object') {
throw new Error(
`expected hap.value to be an object, but got "${this.value}". Hint: append .note() or .s() to the end`,
'error',
);
}
}
}
export default Hap;
+42
View File
@@ -0,0 +1,42 @@
/*
index.mjs - <short description TODO>
Copyright (C) 2022 Strudel contributors - see <https://github.com/tidalcycles/strudel/blob/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 controls from './controls.mjs';
export * from './euclid.mjs';
import Fraction from './fraction.mjs';
import { logger } from './logger.mjs';
export { Fraction, controls };
export * from './hap.mjs';
export * from './pattern.mjs';
export * from './signal.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 './logger.mjs';
export * from './time.mjs';
export * from './draw.mjs';
export * from './animate.mjs';
export * from './pianoroll.mjs';
export * from './spiral.mjs';
export * from './ui.mjs';
export { default as drawLine } from './drawLine.mjs';
export { default as gist } from './gist.js';
// below won't work with runtime.mjs (json import fails)
/* import * as p from './package.json';
export const version = p.version; */
logger('🌀 @strudel.cycles/core loaded 🌀');
if (globalThis._strudelLoaded) {
console.warn(
`@strudel.cycles/core was loaded more than once...
This might happen when you have multiple versions of strudel installed.
Please check with "npm ls @strudel.cycles/core".`,
);
}
globalThis._strudelLoaded = true;
+18
View File
@@ -0,0 +1,18 @@
export const logKey = 'strudel.log';
export function logger(message, type, data = {}) {
console.log(`%c${message}`, 'background-color: black;color:white;border-radius:15px');
if (typeof document !== 'undefined' && typeof CustomEvent !== 'undefined') {
document.dispatchEvent(
new CustomEvent(logKey, {
detail: {
message,
type,
data,
},
}),
);
}
}
logger.key = logKey;
-1654
View File
File diff suppressed because it is too large Load Diff
+14 -8
View File
@@ -1,11 +1,17 @@
{
"name": "@strudel.cycles/core",
"version": "0.0.2",
"version": "0.8.2",
"description": "Port of Tidal Cycles to JavaScript",
"main": "strudel.mjs",
"main": "index.mjs",
"type": "module",
"publishConfig": {
"main": "dist/index.js",
"module": "dist/index.mjs"
},
"scripts": {
"test": "mocha --colors"
"test": "vitest run",
"build": "vite build",
"prepublishOnly": "pnpm build"
},
"repository": {
"type": "git",
@@ -19,17 +25,17 @@
"algorave"
],
"author": "Alex McLean <alex@slab.org> (https://slab.org)",
"license": "GPL-3.0-or-later",
"license": "AGPL-3.0-or-later",
"bugs": {
"url": "https://github.com/tidalcycles/strudel/issues"
},
"homepage": "https://strudel.tidalcycles.org",
"dependencies": {
"bjork": "^0.0.1",
"fraction.js": "^4.2.0",
"ramda": "^0.28.0"
"fraction.js": "^4.2.0"
},
"gitHead": "0e26d4e741500f5bae35b023608f062a794905c2",
"devDependencies": {
"mocha": "^9.2.2"
"vite": "^4.3.3",
"vitest": "^0.28.0"
}
}
File diff suppressed because it is too large Load Diff
+328
View File
@@ -0,0 +1,328 @@
/*
pianoroll.mjs - <short description TODO>
Copyright (C) 2022 Strudel contributors - see <https://github.com/tidalcycles/strudel/blob/main/packages/tone/pianoroll.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 { Pattern, noteToMidi, getDrawContext, freqToMidi, isNote } from './index.mjs';
const scale = (normalized, min, max) => normalized * (max - min) + min;
const getValue = (e) => {
let { value } = e;
if (typeof e.value !== 'object') {
value = { value };
}
let { note, n, freq, s } = value;
if (freq) {
return freqToMidi(freq);
}
note = note ?? n;
if (typeof note === 'string') {
return noteToMidi(note);
}
if (typeof note === 'number') {
return note;
}
if (s) {
return '_' + s;
}
return value;
};
Pattern.prototype.pianoroll = function ({
cycles = 4,
playhead = 0.5,
overscan = 1,
flipTime = 0,
flipValues = 0,
hideNegative = false,
// inactive = '#C9E597',
// inactive = '#FFCA28',
inactive = '#7491D2',
active = '#FFCA28',
// background = '#2A3236',
background = 'transparent',
smear = 0,
playheadColor = 'white',
minMidi = 10,
maxMidi = 90,
autorange = 0,
timeframe: timeframeProp,
fold = 0,
vertical = 0,
labels = 0,
} = {}) {
const ctx = getDrawContext();
const w = ctx.canvas.width;
const h = ctx.canvas.height;
let from = -cycles * playhead;
let to = cycles * (1 - playhead);
if (timeframeProp) {
console.warn('timeframe is deprecated! use from/to instead');
from = 0;
to = timeframeProp;
}
const timeAxis = vertical ? h : w;
const valueAxis = vertical ? w : h;
let timeRange = vertical ? [timeAxis, 0] : [0, timeAxis]; // pixel range for time
const timeExtent = to - from; // number of seconds that fit inside the canvas frame
const valueRange = vertical ? [0, valueAxis] : [valueAxis, 0]; // pixel range for values
let valueExtent = maxMidi - minMidi + 1; // number of "slots" for values, overwritten if autorange true
let barThickness = valueAxis / valueExtent; // pixels per value, overwritten if autorange true
let foldValues = [];
flipTime && timeRange.reverse();
flipValues && valueRange.reverse();
this.draw(
(ctx, events, t) => {
ctx.fillStyle = background;
ctx.globalAlpha = 1; // reset!
if (!smear) {
ctx.clearRect(0, 0, w, h);
ctx.fillRect(0, 0, w, h);
}
const inFrame = (event) =>
(!hideNegative || event.whole.begin >= 0) && event.whole.begin <= t + to && event.endClipped >= t + from;
events.filter(inFrame).forEach((event) => {
const isActive = event.whole.begin <= t && event.endClipped > t;
ctx.fillStyle = event.context?.color || inactive;
ctx.strokeStyle = event.context?.color || active;
ctx.globalAlpha = event.context.velocity ?? event.value?.gain ?? 1;
const timePx = scale((event.whole.begin - (flipTime ? to : from)) / timeExtent, ...timeRange);
let durationPx = scale(event.duration / timeExtent, 0, timeAxis);
const value = getValue(event);
const valuePx = scale(
fold ? foldValues.indexOf(value) / foldValues.length : (Number(value) - minMidi) / valueExtent,
...valueRange,
);
let margin = 0;
const offset = scale(t / timeExtent, ...timeRange);
let coords;
if (vertical) {
coords = [
valuePx + 1 - (flipValues ? barThickness : 0), // x
timeAxis - offset + timePx + margin + 1 - (flipTime ? 0 : durationPx), // y
barThickness - 2, // width
durationPx - 2, // height
];
} else {
coords = [
timePx - offset + margin + 1 - (flipTime ? durationPx : 0), // x
valuePx + 1 - (flipValues ? 0 : barThickness), // y
durationPx - 2, // widith
barThickness - 2, // height
];
}
isActive ? ctx.strokeRect(...coords) : ctx.fillRect(...coords);
if (labels) {
const label = event.value.note ?? event.value.s + (event.value.n ? `:${event.value.n}` : '');
ctx.font = `${barThickness * 0.75}px monospace`;
ctx.strokeStyle = 'black';
ctx.fillStyle = isActive ? 'white' : 'black';
ctx.textBaseline = 'top';
ctx.fillText(label, ...coords);
}
});
ctx.globalAlpha = 1; // reset!
const playheadPosition = scale(-from / timeExtent, ...timeRange);
// draw playhead
ctx.strokeStyle = playheadColor;
ctx.beginPath();
if (vertical) {
ctx.moveTo(0, playheadPosition);
ctx.lineTo(valueAxis, playheadPosition);
} else {
ctx.moveTo(playheadPosition, 0);
ctx.lineTo(playheadPosition, valueAxis);
}
ctx.stroke();
},
{
from: from - overscan,
to: to + overscan,
onQuery: (events) => {
const { min, max, values } = events.reduce(
({ min, max, values }, e) => {
const v = getValue(e);
return {
min: v < min ? v : min,
max: v > max ? v : max,
values: values.includes(v) ? values : [...values, v],
};
},
{ min: Infinity, max: -Infinity, values: [] },
);
if (autorange) {
minMidi = min;
maxMidi = max;
valueExtent = maxMidi - minMidi + 1;
}
foldValues = values.sort((a, b) => String(a).localeCompare(String(b)));
barThickness = fold ? valueAxis / foldValues.length : valueAxis / valueExtent;
},
},
);
return this;
};
// this function allows drawing a pianoroll without ties to Pattern.prototype
// it will probably replace the above in the future
export function pianoroll({
time,
haps,
cycles = 4,
playhead = 0.5,
flipTime = 0,
flipValues = 0,
hideNegative = false,
// inactive = '#C9E597',
// inactive = '#FFCA28',
inactive = '#7491D2',
active = '#FFCA28',
// background = '#2A3236',
background = 'transparent',
smear = 0,
playheadColor = 'white',
minMidi = 10,
maxMidi = 90,
autorange = 0,
timeframe: timeframeProp,
fold = 0,
vertical = 0,
labels = false,
ctx,
} = {}) {
const w = ctx.canvas.width;
const h = ctx.canvas.height;
let from = -cycles * playhead;
let to = cycles * (1 - playhead);
if (timeframeProp) {
console.warn('timeframe is deprecated! use from/to instead');
from = 0;
to = timeframeProp;
}
const timeAxis = vertical ? h : w;
const valueAxis = vertical ? w : h;
let timeRange = vertical ? [timeAxis, 0] : [0, timeAxis]; // pixel range for time
const timeExtent = to - from; // number of seconds that fit inside the canvas frame
const valueRange = vertical ? [0, valueAxis] : [valueAxis, 0]; // pixel range for values
let valueExtent = maxMidi - minMidi + 1; // number of "slots" for values, overwritten if autorange true
let barThickness = valueAxis / valueExtent; // pixels per value, overwritten if autorange true
let foldValues = [];
flipTime && timeRange.reverse();
flipValues && valueRange.reverse();
// onQuery
const { min, max, values } = haps.reduce(
({ min, max, values }, e) => {
const v = getValue(e);
return {
min: v < min ? v : min,
max: v > max ? v : max,
values: values.includes(v) ? values : [...values, v],
};
},
{ min: Infinity, max: -Infinity, values: [] },
);
if (autorange) {
minMidi = min;
maxMidi = max;
valueExtent = maxMidi - minMidi + 1;
}
// foldValues = values.sort((a, b) => a - b);
foldValues = values.sort((a, b) => String(a).localeCompare(String(b)));
barThickness = fold ? valueAxis / foldValues.length : valueAxis / valueExtent;
ctx.fillStyle = background;
ctx.globalAlpha = 1; // reset!
if (!smear) {
ctx.clearRect(0, 0, w, h);
ctx.fillRect(0, 0, w, h);
}
/* const inFrame = (event) =>
(!hideNegative || event.whole.begin >= 0) && event.whole.begin <= time + to && event.whole.end >= time + from; */
haps
// .filter(inFrame)
.forEach((event) => {
const isActive = event.whole.begin <= time && event.whole.end > time;
const color = event.value?.color || event.context?.color;
ctx.fillStyle = color || inactive;
ctx.strokeStyle = color || active;
ctx.globalAlpha = event.context.velocity ?? event.value?.gain ?? 1;
const timePx = scale((event.whole.begin - (flipTime ? to : from)) / timeExtent, ...timeRange);
let durationPx = scale(event.duration / timeExtent, 0, timeAxis);
const value = getValue(event);
const valuePx = scale(
fold ? foldValues.indexOf(value) / foldValues.length : (Number(value) - minMidi) / valueExtent,
...valueRange,
);
let margin = 0;
const offset = scale(time / timeExtent, ...timeRange);
let coords;
if (vertical) {
coords = [
valuePx + 1 - (flipValues ? barThickness : 0), // x
timeAxis - offset + timePx + margin + 1 - (flipTime ? 0 : durationPx), // y
barThickness - 2, // width
durationPx - 2, // height
];
} else {
coords = [
timePx - offset + margin + 1 - (flipTime ? durationPx : 0), // x
valuePx + 1 - (flipValues ? 0 : barThickness), // y
durationPx - 2, // widith
barThickness - 2, // height
];
}
isActive ? ctx.strokeRect(...coords) : ctx.fillRect(...coords);
if (labels) {
const label = event.value.note ?? event.value.s + (event.value.n ? `:${event.value.n}` : '');
ctx.font = `${barThickness * 0.75}px monospace`;
ctx.strokeStyle = 'black';
ctx.fillStyle = isActive ? 'white' : 'black';
ctx.textBaseline = 'top';
ctx.fillText(label, ...coords);
}
});
ctx.globalAlpha = 1; // reset!
const playheadPosition = scale(-from / timeExtent, ...timeRange);
// draw playhead
ctx.strokeStyle = playheadColor;
ctx.beginPath();
if (vertical) {
ctx.moveTo(0, playheadPosition);
ctx.lineTo(valueAxis, playheadPosition);
} else {
ctx.moveTo(playheadPosition, 0);
ctx.lineTo(playheadPosition, valueAxis);
}
ctx.stroke();
return this;
}
export function getDrawOptions(drawTime, options = {}) {
let [lookbehind, lookahead] = drawTime;
lookbehind = Math.abs(lookbehind);
const cycles = lookahead + lookbehind;
const playhead = lookbehind / cycles;
return { fold: 1, ...options, cycles, playhead };
}
Pattern.prototype.punchcard = function (options) {
return this.onPaint((ctx, time, haps, drawTime) =>
pianoroll({ ctx, time, haps, ...getDrawOptions(drawTime, options) }),
);
};
/* Pattern.prototype.pianoroll = function (options) {
return this.onPaint((ctx, time, haps, drawTime) =>
pianoroll({ ctx, time, haps, ...getDrawOptions(drawTime, { fold: 0, ...options }) }),
);
}; */
export function drawPianoroll(options) {
const { drawTime, ...rest } = options;
pianoroll({ ...getDrawOptions(drawTime), ...rest });
}
+97
View File
@@ -0,0 +1,97 @@
import { Cyclist } from './cyclist.mjs';
import { evaluate as _evaluate } from './evaluate.mjs';
import { logger } from './logger.mjs';
import { setTime } from './time.mjs';
import { evalScope } from './evaluate.mjs';
import { register } from './pattern.mjs';
export function repl({
interval,
defaultOutput,
onSchedulerError,
onEvalError,
beforeEval,
afterEval,
getTime,
transpiler,
onToggle,
editPattern,
}) {
const scheduler = new Cyclist({
interval,
onTrigger: getTrigger({ defaultOutput, getTime }),
onError: onSchedulerError,
getTime,
onToggle,
});
const setPattern = (pattern, autostart = true) => {
pattern = editPattern?.(pattern) || pattern;
scheduler.setPattern(pattern, autostart);
};
setTime(() => scheduler.now()); // TODO: refactor?
const evaluate = async (code, autostart = true) => {
if (!code) {
throw new Error('no code to evaluate');
}
try {
await beforeEval?.({ code });
let { pattern } = await _evaluate(code, transpiler);
logger(`[eval] code updated`);
setPattern(pattern, autostart);
afterEval?.({ code, pattern });
return pattern;
} catch (err) {
// console.warn(`[repl] eval error: ${err.message}`);
logger(`[eval] error: ${err.message}`, 'error');
onEvalError?.(err);
}
};
const stop = () => scheduler.stop();
const start = () => scheduler.start();
const pause = () => scheduler.pause();
const setCps = (cps) => scheduler.setCps(cps);
const setCpm = (cpm) => scheduler.setCps(cpm / 60);
// the following functions use the cps value, which is why they are defined here..
const loopAt = register('loopAt', (cycles, pat) => {
return pat.loopAtCps(cycles, scheduler.cps);
});
const fit = register('fit', (pat) =>
pat.withHap((hap) =>
hap.withValue((v) => ({
...v,
speed: scheduler.cps / hap.whole.duration, // overwrite speed completely?
unit: 'c',
})),
),
);
evalScope({
loopAt,
fit,
setCps,
setcps: setCps,
setCpm,
setcpm: setCpm,
});
return { scheduler, evaluate, start, stop, pause, setCps, setPattern };
}
export const getTrigger =
({ getTime, defaultOutput }) =>
async (hap, deadline, duration, cps) => {
try {
if (!hap.context.onTrigger || !hap.context.dominantTrigger) {
await defaultOutput(hap, deadline, duration, cps);
}
if (hap.context.onTrigger) {
// call signature of output / onTrigger is different...
await hap.context.onTrigger(getTime() + deadline, hap, getTime(), cps);
}
} catch (err) {
logger(`[cyclist] error: ${err.message}`, 'error');
}
};
+483
View File
@@ -0,0 +1,483 @@
/*
signal.mjs - <short description TODO>
Copyright (C) 2022 Strudel contributors - see <https://github.com/tidalcycles/strudel/blob/main/packages/core/signal.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 { Hap } from './hap.mjs';
import { Pattern, fastcat, reify, silence, stack, register } from './pattern.mjs';
import Fraction from './fraction.mjs';
import { id } from './util.mjs';
export function steady(value) {
// A continuous value
return new Pattern((state) => [new Hap(undefined, state.span, value)]);
}
export const signal = (func) => {
const query = (state) => [new Hap(undefined, state.span, func(state.span.midpoint()))];
return new Pattern(query);
};
export const isaw = signal((t) => 1 - (t % 1));
export const isaw2 = isaw.toBipolar();
/**
* A sawtooth signal between 0 and 1.
*
* @return {Pattern}
* @example
* "c3 [eb3,g3] g2 [g3,bb3]".note().clip(saw.slow(4))
* @example
* saw.range(0,8).segment(8).scale('C major').slow(4).note()
*
*/
export const saw = signal((t) => t % 1);
export const saw2 = saw.toBipolar();
export const sine2 = signal((t) => Math.sin(Math.PI * 2 * t));
/**
* A sine signal between 0 and 1.
*
* @return {Pattern}
* @example
* sine.segment(16).range(0,15).slow(2).scale('C minor').note()
*
*/
export const sine = sine2.fromBipolar();
/**
* A cosine signal between 0 and 1.
*
* @return {Pattern}
* @example
* stack(sine,cosine).segment(16).range(0,15).slow(2).scale('C minor').note()
*
*/
export const cosine = sine._early(Fraction(1).div(4));
export const cosine2 = sine2._early(Fraction(1).div(4));
/**
* A square signal between 0 and 1.
*
* @return {Pattern}
* @example
* square.segment(2).range(0,7).scale('C minor').note()
*
*/
export const square = signal((t) => Math.floor((t * 2) % 2));
export const square2 = square.toBipolar();
/**
* A triangle signal between 0 and 1.
*
* @return {Pattern}
* @example
* tri.segment(8).range(0,7).scale('C minor').note()
*
*/
export const tri = fastcat(isaw, saw);
export const tri2 = fastcat(isaw2, saw2);
export const time = signal(id);
// random signals
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 result = [];
for (let i = 0; i < n; ++n) {
result.push(intSeedToRand(seed));
seed = xorwise(seed);
}
return result;
};
const timeToRands = (t, n) => timeToRandsPrime(timeToIntSeed(t), n);
/**
*
*/
/**
* A discrete pattern of numbers from 0 to n-1
* @example
* run(4).scale('C4 major').note()
* // "0 1 2 3".scale('C4 major').note()
*/
export const run = (n) => saw.range(0, n).floor().segment(n);
/**
* A continuous pattern of random numbers, between 0 and 1.
*
* @name rand
* @example
* // randomly change the cutoff
* s("bd sd,hh*4").cutoff(rand.range(500,2000))
*
*/
export const rand = signal(timeToRand);
/**
* A continuous pattern of random numbers, between -1 and 1
*/
export const rand2 = rand.toBipolar();
export const _brandBy = (p) => rand.fmap((x) => x < p);
export const brandBy = (pPat) => reify(pPat).fmap(_brandBy).innerJoin();
export const brand = _brandBy(0.5);
export const _irand = (i) => rand.fmap((x) => Math.trunc(x * i));
/**
* A continuous pattern of random integers, between 0 and n-1.
*
* @name irand
* @param {number} n max value (exclusive)
* @example
* // randomly select scale notes from 0 - 7 (= C to C)
* irand(8).struct("x(3,8)").scale('C minor').note()
*
*/
export const irand = (ipat) => reify(ipat).fmap(_irand).innerJoin();
export const __chooseWith = (pat, xs) => {
xs = xs.map(reify);
if (xs.length == 0) {
return silence;
}
return pat.range(0, xs.length).fmap((i) => xs[Math.floor(i)]);
};
/**
* 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
* @param {Pattern} pat
* @param {*} xs
* @returns {Pattern}
*/
export const chooseWith = (pat, xs) => {
return __chooseWith(pat, xs).outerJoin();
};
/**
* As with {chooseWith}, but the structure comes from the chosen values, rather
* than the pattern you're using to choose with.
* @param {Pattern} pat
* @param {*} xs
* @returns {Pattern}
*/
export const chooseInWith = (pat, xs) => {
return __chooseWith(pat, xs).innerJoin();
};
/**
* Chooses randomly from the given list of elements.
* @param {...any} xs values / patterns to choose from.
* @returns {Pattern} - a continuous pattern.
*/
export const choose = (...xs) => chooseWith(rand, xs);
/**
* 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.
* @param {...any} xs
* @returns {Pattern}
*/
Pattern.prototype.choose = function (...xs) {
return chooseWith(this, xs);
};
/**
* As with choose, but the pattern that this method is called on should be
* in the range -1 .. 1
* @param {...any} xs
* @returns {Pattern}
*/
Pattern.prototype.choose2 = function (...xs) {
return chooseWith(this.fromBipolar(), xs);
};
/**
* Picks one of the elements at random each cycle.
* @returns {Pattern}
* @example
* chooseCycles("bd", "hh", "sd").s().fast(4)
* @example
* "bd | hh | sd".s().fast(4)
*/
export const chooseCycles = (...xs) => chooseInWith(rand.segment(1), xs);
export const randcat = chooseCycles;
const _wchooseWith = function (pat, ...pairs) {
const values = pairs.map((pair) => reify(pair[0]));
const weights = [];
let accum = 0;
for (const pair of pairs) {
accum += pair[1];
weights.push(accum);
}
const total = accum;
const match = function (r) {
const find = r * total;
return values[weights.findIndex((x) => x > find, weights)];
};
return pat.fmap(match);
};
const wchooseWith = (...args) => _wchooseWith(...args).outerJoin();
export const wchoose = (...pairs) => wchooseWith(rand, ...pairs);
export const wchooseCycles = (...pairs) => _wchooseWith(rand, ...pairs).innerJoin();
// this function expects pat to be a pattern of floats...
export const perlinWith = (pat) => {
const pata = pat.fmap(Math.floor);
const patb = pat.fmap((t) => Math.floor(t) + 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);
return pat.sub(pata).fmap(interp).appBoth(pata.fmap(timeToRand)).appBoth(patb.fmap(timeToRand));
};
/**
* Generates a continuous pattern of [perlin noise](https://en.wikipedia.org/wiki/Perlin_noise), in the range 0..1.
*
* @name perlin
* @example
* // randomly change the cutoff
* s("bd sd,hh*4").cutoff(perlin.range(500,2000))
*
*/
export const perlin = perlinWith(time.fmap((v) => Number(v)));
export const degradeByWith = register('degradeByWith', (withPat, x, pat) =>
pat.fmap((a) => (_) => a).appLeft(withPat.filterValues((v) => v > x)),
);
/**
* Randomly removes events from the pattern by a given amount.
* 0 = 0% chance of removal
* 1 = 100% chance of removal
*
* @name degradeBy
* @memberof Pattern
* @param {number} amount - a number between 0 and 1
* @returns Pattern
* @example
* s("hh*8").degradeBy(0.2)
* @example
* s("[hh?0.2]*8")
*/
export const degradeBy = register('degradeBy', function (x, pat) {
return pat._degradeByWith(rand, x);
});
/**
*
* Randomly removes 50% of events from the pattern. Shorthand for `.degradeBy(0.5)`
*
* @name degrade
* @memberof Pattern
* @returns Pattern
* @example
* s("hh*8").degrade()
* @example
* s("[hh?]*8")
*/
export const degrade = register('degrade', (pat) => pat._degradeBy(0.5));
/**
* Inverse of {@link Pattern#degradeBy}: Randomly removes events from the pattern by a given amount.
* 0 = 100% chance of removal
* 1 = 0% chance of removal
* Events that would be removed by degradeBy are let through by undegradeBy and vice versa (see second example).
*
* @name undegradeBy
* @memberof Pattern
* @param {number} amount - a number between 0 and 1
* @returns Pattern
* @example
* s("hh*8").undegradeBy(0.2)
*/
export const undegradeBy = register('undegradeBy', function (x, pat) {
return pat._degradeByWith(
rand.fmap((r) => 1 - r),
x,
);
});
export const undegrade = register('undegrade', (pat) => pat._undegradeBy(0.5));
/**
*
* Randomly applies the given function by the given probability.
* Similar to {@link Pattern#someCyclesBy}
*
* @name sometimesBy
* @memberof Pattern
* @param {number | Pattern} probability - a number between 0 and 1
* @param {function} function - the transformation to apply
* @returns Pattern
* @example
* s("hh(3,8)").sometimesBy(.4, x=>x.speed("0.5"))
*/
export const sometimesBy = register('sometimesBy', function (patx, func, pat) {
return reify(patx)
.fmap((x) => stack(pat._degradeBy(x), func(pat._undegradeBy(1 - x))))
.innerJoin();
});
/**
*
* Applies the given function with a 50% chance
*
* @name sometimes
* @memberof Pattern
* @param {function} function - the transformation to apply
* @returns Pattern
* @example
* s("hh*4").sometimes(x=>x.speed("0.5"))
*/
export const sometimes = register('sometimes', function (func, pat) {
return pat._sometimesBy(0.5, func);
});
/**
*
* Randomly applies the given function by the given probability on a cycle by cycle basis.
* Similar to {@link Pattern#sometimesBy}
*
* @name someCyclesBy
* @memberof Pattern
* @param {number | Pattern} probability - a number between 0 and 1
* @param {function} function - the transformation to apply
* @returns Pattern
* @example
* s("hh(3,8)").someCyclesBy(.3, x=>x.speed("0.5"))
*/
export const someCyclesBy = register('someCyclesBy', function (patx, func, pat) {
return reify(patx)
.fmap((x) =>
stack(
pat._degradeByWith(rand._segment(1), x),
func(pat._degradeByWith(rand.fmap((r) => 1 - r)._segment(1), 1 - x)),
),
)
.innerJoin();
});
/**
*
* Shorthand for `.someCyclesBy(0.5, fn)`
*
* @name someCycles
* @memberof Pattern
* @returns Pattern
* @example
* s("hh(3,8)").someCycles(x=>x.speed("0.5"))
*/
export const someCycles = register('someCycles', function (func, pat) {
return pat._someCyclesBy(0.5, func);
});
/**
*
* Shorthand for `.sometimesBy(0.75, fn)`
*
* @name often
* @memberof Pattern
* @returns Pattern
* @example
* s("hh*8").often(x=>x.speed("0.5"))
*/
export const often = register('often', function (func, pat) {
return pat.sometimesBy(0.75, func);
});
/**
*
* Shorthand for `.sometimesBy(0.25, fn)`
*
* @name rarely
* @memberof Pattern
* @returns Pattern
* @example
* s("hh*8").rarely(x=>x.speed("0.5"))
*/
export const rarely = register('rarely', function (func, pat) {
return pat.sometimesBy(0.25, func);
});
/**
*
* Shorthand for `.sometimesBy(0.1, fn)`
*
* @name almostNever
* @memberof Pattern
* @returns Pattern
* @example
* s("hh*8").almostNever(x=>x.speed("0.5"))
*/
export const almostNever = register('almostNever', function (func, pat) {
return pat.sometimesBy(0.1, func);
});
/**
*
* Shorthand for `.sometimesBy(0.9, fn)`
*
* @name almostAlways
* @memberof Pattern
* @returns Pattern
* @example
* s("hh*8").almostAlways(x=>x.speed("0.5"))
*/
export const almostAlways = register('almostAlways', function (func, pat) {
return pat.sometimesBy(0.9, func);
});
/**
*
* Shorthand for `.sometimesBy(0, fn)` (never calls fn)
*
* @name never
* @memberof Pattern
* @returns Pattern
* @example
* s("hh*8").never(x=>x.speed("0.5"))
*/
export const never = register('never', function (_, pat) {
return pat;
});
/**
*
* Shorthand for `.sometimesBy(1, fn)` (always calls fn)
*
* @name always
* @memberof Pattern
* @returns Pattern
* @example
* s("hh*8").always(x=>x.speed("0.5"))
*/
export const always = register('always', function (func, pat) {
return func(pat);
});
+38
View File
@@ -0,0 +1,38 @@
/*
speak.mjs - <short description TODO>
Copyright (C) 2022 Strudel contributors - see <https://github.com/tidalcycles/strudel/blob/main/packages/core/speak.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 } from './index.mjs';
let synth;
try {
synth = window?.speechSynthesis;
} catch (err) {
console.warn('cannot use window: not in browser?');
}
let allVoices = synth?.getVoices();
// console.log('voices', allVoices);
function triggerSpeech(words, lang, voice) {
synth.cancel();
const utterance = new SpeechSynthesisUtterance(words);
utterance.lang = lang;
allVoices = synth.getVoices();
const voices = allVoices.filter((v) => v.lang.includes(lang));
if (typeof voice === 'number') {
utterance.voice = voices[voice % voices.length];
} else if (typeof voice === 'string') {
utterance.voice = voices.find((voice) => voice.name === voice);
}
// console.log(utterance.voice?.name, utterance.voice?.lang);
speechSynthesis.speak(utterance);
}
export const speak = register('speak', function (lang, voice, pat) {
return pat.onTrigger((_, hap) => {
triggerSpeech(hap.value, lang, voice);
});
});
+117
View File
@@ -0,0 +1,117 @@
import { Pattern } from './index.mjs';
// polar coords -> xy
function fromPolar(angle, radius, cx, cy) {
const radians = ((angle - 90) * Math.PI) / 180;
return [cx + Math.cos(radians) * radius, cy + Math.sin(radians) * radius];
}
const xyOnSpiral = (angle, margin, cx, cy, rotate = 0) => fromPolar((angle + rotate) * 360, margin * angle, cx, cy); // TODO: logSpiral
// draw spiral / segment of spiral
function spiralSegment(options) {
let {
ctx,
from = 0,
to = 3,
margin = 50,
cx = 100,
cy = 100,
rotate = 0,
thickness = margin / 2,
color = '#0000ff30',
cap = 'round',
stretch = 1,
fromOpacity = 1,
toOpacity = 1,
} = options;
from *= stretch;
to *= stretch;
rotate *= stretch;
ctx.lineWidth = thickness;
ctx.lineCap = cap;
ctx.strokeStyle = color;
ctx.globalAlpha = fromOpacity;
ctx.beginPath();
let [sx, sy] = xyOnSpiral(from, margin, cx, cy, rotate);
ctx.moveTo(sx, sy);
const increment = 1 / 60;
let angle = from;
while (angle <= to) {
const [x, y] = xyOnSpiral(angle, margin, cx, cy, rotate);
//ctx.lineWidth = angle*thickness;
ctx.globalAlpha = ((angle - from) / (to - from)) * toOpacity;
ctx.lineTo(x, y);
angle += increment;
}
ctx.stroke();
}
Pattern.prototype.spiral = function (options = {}) {
const {
stretch = 1,
size = 80,
thickness = size / 2,
cap = 'butt', // round butt squar,
inset = 3, // start angl,
playheadColor = '#ffffff90',
playheadLength = 0.02,
playheadThickness = thickness,
padding = 0,
steady = 1,
inactiveColor = '#ffffff20',
colorizeInactive = 0,
fade = true,
// logSpiral = true,
} = options;
function spiral({ ctx, time, haps, drawTime }) {
ctx.clearRect(0, 0, ctx.canvas.clientWidth, ctx.canvas.clientHeight);
const [cx, cy] = [ctx.canvas.width / 2, ctx.canvas.height / 2];
const settings = {
margin: size / stretch,
cx,
cy,
stretch,
cap,
thickness,
};
const playhead = {
...settings,
thickness: playheadThickness,
from: inset - playheadLength,
to: inset,
color: playheadColor,
};
const [min] = drawTime;
const rotate = steady * time;
haps.forEach((hap) => {
const isActive = hap.whole.begin <= time && hap.endClipped > time;
const from = hap.whole.begin - time + inset;
const to = hap.endClipped - time + inset - padding;
const { color } = hap.context;
const opacity = fade ? 1 - Math.abs((hap.whole.begin - time) / min) : 1;
spiralSegment({
ctx,
...settings,
from,
to,
rotate,
color: colorizeInactive || isActive ? color : inactiveColor,
fromOpacity: opacity,
toOpacity: opacity,
});
});
spiralSegment({
ctx,
...playhead,
rotate,
});
}
return this.onPaint((ctx, time, haps, drawTime) => spiral({ ctx, time, haps, drawTime }));
};
+28
View File
@@ -0,0 +1,28 @@
/*
state.mjs - <short description TODO>
Copyright (C) 2022 Strudel contributors - see <https://github.com/tidalcycles/strudel/blob/main/packages/core/state.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/>.
*/
export class State {
constructor(span, controls = {}) {
this.span = span;
this.controls = controls;
}
// Returns new State with different span
setSpan(span) {
return new State(span, this.controls);
}
withSpan(func) {
return this.setSpan(func(this.span));
}
// Returns new State with different controls
setControls(controls) {
return new State(this.span, controls);
}
}
export default State;
File diff suppressed because it is too large Load Diff
+28
View File
@@ -0,0 +1,28 @@
/*
controls.test.mjs - <short description TODO>
Copyright (C) 2023 Strudel contributors - see <https://github.com/tidalcycles/strudel/blob/main/packages/core/test/controls.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 controls from '../controls.mjs';
import { mini } from '../../mini/mini.mjs';
import { describe, it, expect } from 'vitest';
describe('controls', () => {
it('should support controls', () => {
expect(controls.s('bd').firstCycleValues).toEqual([{ s: 'bd' }]);
});
it('should support compound controls', () => {
expect(controls.s(mini('bd:3')).firstCycleValues).toEqual([{ s: 'bd', n: 3 }]);
expect(controls.s(mini('bd:3 sd:4:1.4')).firstCycleValues).toEqual([
{ s: 'bd', n: 3 },
{ s: 'sd', n: 4, gain: 1.4 },
]);
});
it('should support ignore extra elements in compound controls', () => {
expect(controls.s(mini('bd:3:0.4 sd:4:0.5:3:17')).firstCycleValues).toEqual([
{ s: 'bd', n: 3, gain: 0.4 },
{ s: 'sd', n: 4, gain: 0.5 },
]);
});
});
+46
View File
@@ -0,0 +1,46 @@
/*
drawLine.test.mjs - <short description TODO>
Copyright (C) 2022 Strudel contributors - see <https://github.com/tidalcycles/strudel/blob/main/packages/core/test/drawLine.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 { fastcat, stack, slowcat, silence, pure } from '../pattern.mjs';
import { describe, it, expect } from 'vitest';
import drawLine from '../drawLine.mjs';
describe('drawLine', () => {
it('supports equal lengths', () => {
expect(drawLine(fastcat(0), 4)).toEqual('|0|0');
expect(drawLine(fastcat(0, 1), 4)).toEqual('|01|01');
expect(drawLine(fastcat(0, 1, 2), 6)).toEqual('|012|012');
});
it('supports unequal lengths', () => {
expect(drawLine(fastcat(0, [1, 2]), 10)).toEqual('|0-12|0-12');
expect(drawLine(fastcat(0, [1, 2, 3]), 10)).toEqual('|0--123|0--123');
expect(drawLine(fastcat(0, 1, [2, 3]), 10)).toEqual('|0-1-23|0-1-23');
});
it('supports unequal silence', () => {
expect(drawLine(fastcat(0, silence, [1, 2]), 10)).toEqual('|0-..12|0-..12');
});
it('supports polyrhythms', () => {
// assert.equal(drawLine(fastcat(pure(0).fast(2), pure(1).fast(3)), 10), '|0--0--1-1-1-');
expect(drawLine(fastcat(pure(0).fast(2), pure(1).fast(3)), 10)).toEqual('|0--0--1-1-1-');
});
it('supports multiple lines', () => {
expect(drawLine(fastcat(0, stack(1, 2)), 10)).toEqual(`|01|01|01|01
|.2|.2|.2|.2`);
expect(drawLine(fastcat(0, 1, stack(2, 3)), 10)).toEqual(`|012|012|012
|..3|..3|..3`);
expect(drawLine(fastcat(0, stack(1, 2, 3)), 10)).toEqual(`|01|01|01|01
|.2|.2|.2|.2
|.3|.3|.3|.3`);
expect(drawLine(fastcat(0, 1, stack(2, 3, 4)), 10)).toEqual(`|012|012|012
|..3|..3|..3
|..4|..4|..4`);
});
it('supports unequal cycle lengths', () => {
expect(drawLine(slowcat(0, [1, 2]), 10)).toEqual(`|0|12|0|12`);
});
});
+15
View File
@@ -0,0 +1,15 @@
/*
fraction.test.mjs - <short description TODO>
Copyright (C) 2022 Strudel contributors - see <https://github.com/tidalcycles/strudel/blob/main/packages/core/test/fraction.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, { gcd } from '../fraction.mjs';
import { describe, it, expect } from 'vitest';
describe('gcd', () => {
it('should work', () => {
const F = Fraction._original;
expect(gcd(F(1 / 6), F(1 / 4)).toFraction()).toEqual('1/12');
});
});
File diff suppressed because it is too large Load Diff
+40
View File
@@ -0,0 +1,40 @@
/*test for issue 302 support alternative solmization types */
import { sol2note } from '../util.mjs';
import { test } from 'vitest';
import assert from 'assert';
test('solmization - letters', () => {
const result = sol2note(60, 'letters');
const expected = 'C4';
assert.equal(result, expected);
});
test('solmization - solfeggio', () => {
const result = sol2note(60, 'solfeggio');
const expected = 'Do4';
assert.equal(result, expected);
});
test('solmization - indian', () => {
const result = sol2note(60, 'indian');
const expected = 'Sa4';
assert.equal(result, expected);
});
test('solmization - german', () => {
const result = sol2note(60, 'german');
const expected = 'C4';
assert.equal(result, expected);
});
test('solmization - byzantine', () => {
const result = sol2note(60, 'byzantine');
const expected = 'Ni4';
assert.equal(result, expected);
});
test('solmization - japanese', () => {
const result = sol2note(60, 'japanese');
const expected = 'I4';
assert.equal(result, expected);
});
+202 -52
View File
@@ -1,85 +1,235 @@
import { strict as assert } from 'assert';
import { isNote, tokenizeNote, toMidi, mod } from '../util.mjs';
/*
util.test.mjs - Tests for the core 'util' module
Copyright (C) 2022 Strudel contributors - see <https://github.com/tidalcycles/strudel/blob/main/packages/core/test/util.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 { pure } from '../pattern.mjs';
import {
isNote,
tokenizeNote,
noteToMidi,
midiToFreq,
freqToMidi,
_mod,
compose,
getFrequency,
getPlayableNoteValue,
parseNumeral,
parseFractional,
numeralArgs,
fractionalArgs,
} from '../util.mjs';
import { describe, it, expect } from 'vitest';
describe('isNote', () => {
it('should recognize notes without accidentals', () => {
'C3 D3 E3 F3 G3 A3 B3 C4 D5 c5 d5 e5'.split(' ').forEach((note) => {
assert.equal(isNote(note), true);
expect(isNote(note)).toBe(true);
});
});
it('should recognize notes with accidentals', () => {
'C#3 D##3 Eb3 Fbb3 Bb5'.split(' ').forEach((note) => {
assert.equal(isNote(note), true);
expect(isNote(note)).toBe(true);
});
});
it('should recognize notes without octave', () => {
expect(isNote('C')).toBe(true);
expect(isNote('Bb')).toBe(true);
});
it('should not recognize invalid notes', () => {
assert.equal(isNote('H5'), false);
assert.equal(isNote('C'), false);
assert.equal(isNote('X'), false);
assert.equal(isNote(1), false);
expect(isNote('H5')).toBe(false);
expect(isNote('X')).toBe(false);
expect(isNote(1)).toBe(false);
});
});
describe('isNote', () => {
it('should tokenize notes without accidentals', () => {
assert.deepStrictEqual(tokenizeNote('C3'), ['C', '', 3]);
assert.deepStrictEqual(tokenizeNote('D3'), ['D', '', 3]);
assert.deepStrictEqual(tokenizeNote('E3'), ['E', '', 3]);
assert.deepStrictEqual(tokenizeNote('F3'), ['F', '', 3]);
assert.deepStrictEqual(tokenizeNote('G3'), ['G', '', 3]);
assert.deepStrictEqual(tokenizeNote('A3'), ['A', '', 3]);
assert.deepStrictEqual(tokenizeNote('B3'), ['B', '', 3]);
assert.deepStrictEqual(tokenizeNote('C4'), ['C', '', 4]);
assert.deepStrictEqual(tokenizeNote('D5'), ['D', '', 5]);
expect(tokenizeNote('C3')).toStrictEqual(['C', '', 3]);
expect(tokenizeNote('D3')).toStrictEqual(['D', '', 3]);
expect(tokenizeNote('E3')).toStrictEqual(['E', '', 3]);
expect(tokenizeNote('F3')).toStrictEqual(['F', '', 3]);
expect(tokenizeNote('G3')).toStrictEqual(['G', '', 3]);
expect(tokenizeNote('A3')).toStrictEqual(['A', '', 3]);
expect(tokenizeNote('B3')).toStrictEqual(['B', '', 3]);
expect(tokenizeNote('C4')).toStrictEqual(['C', '', 4]);
expect(tokenizeNote('D5')).toStrictEqual(['D', '', 5]);
});
it('should tokenize notes with accidentals', () => {
assert.deepStrictEqual(tokenizeNote('C#3'), ['C', '#', 3]);
assert.deepStrictEqual(tokenizeNote('D##3'), ['D', '##', 3]);
assert.deepStrictEqual(tokenizeNote('Eb3'), ['E', 'b', 3]);
assert.deepStrictEqual(tokenizeNote('Fbb3'), ['F', 'bb', 3]);
assert.deepStrictEqual(tokenizeNote('Bb5'), ['B', 'b', 5]);
expect(tokenizeNote('C#3')).toStrictEqual(['C', '#', 3]);
expect(tokenizeNote('D##3')).toStrictEqual(['D', '##', 3]);
expect(tokenizeNote('Eb3')).toStrictEqual(['E', 'b', 3]);
expect(tokenizeNote('Fbb3')).toStrictEqual(['F', 'bb', 3]);
expect(tokenizeNote('Bb5')).toStrictEqual(['B', 'b', 5]);
});
it('should tokenize notes without octave', () => {
assert.deepStrictEqual(tokenizeNote('C'), ['C', '', undefined]);
assert.deepStrictEqual(tokenizeNote('C#'), ['C', '#', undefined]);
assert.deepStrictEqual(tokenizeNote('Bb'), ['B', 'b', undefined]);
assert.deepStrictEqual(tokenizeNote('Bbb'), ['B', 'bb', undefined]);
expect(tokenizeNote('C')).toStrictEqual(['C', '', undefined]);
expect(tokenizeNote('C#')).toStrictEqual(['C', '#', undefined]);
expect(tokenizeNote('Bb')).toStrictEqual(['B', 'b', undefined]);
expect(tokenizeNote('Bbb')).toStrictEqual(['B', 'bb', undefined]);
});
it('should not tokenize invalid notes', () => {
assert.deepStrictEqual(tokenizeNote('X'), []);
assert.deepStrictEqual(tokenizeNote('asfasf'), []);
assert.deepStrictEqual(tokenizeNote(123), []);
expect(tokenizeNote('X')).toStrictEqual([]);
expect(tokenizeNote('asfasf')).toStrictEqual([]);
expect(tokenizeNote(123)).toStrictEqual([]);
});
});
describe('toMidi', () => {
describe('noteToMidi', () => {
it('should turn notes into midi', () => {
assert.equal(toMidi('A4'), 69);
assert.equal(toMidi('C4'), 60);
assert.equal(toMidi('Db4'), 61);
assert.equal(toMidi('C3'), 48);
assert.equal(toMidi('Cb3'), 47);
assert.equal(toMidi('Cbb3'), 46);
assert.equal(toMidi('C#3'), 49);
assert.equal(toMidi('C#3'), 49);
assert.equal(toMidi('C##3'), 50);
expect(noteToMidi('A4')).toEqual(69);
expect(noteToMidi('C4')).toEqual(60);
expect(noteToMidi('Db4')).toEqual(61);
expect(noteToMidi('C3')).toEqual(48);
expect(noteToMidi('Cb3')).toEqual(47);
expect(noteToMidi('Cbb3')).toEqual(46);
expect(noteToMidi('C#3')).toEqual(49);
expect(noteToMidi('C#3')).toEqual(49);
expect(noteToMidi('C##3')).toEqual(50);
});
it('should throw an error when given a non-note', () => {
expect(() => noteToMidi('Q')).toThrowError(`not a note: "Q"`);
expect(() => noteToMidi('Z')).toThrowError(`not a note: "Z"`);
});
});
describe('midiToFreq', () => {
it('should turn midi into frequency', () => {
expect(midiToFreq(69)).toEqual(440);
expect(midiToFreq(57)).toEqual(220);
});
});
describe('freqToMidi', () => {
it('should turn frequency into midi', () => {
expect(freqToMidi(440)).toEqual(69);
expect(freqToMidi(220)).toEqual(57);
});
});
describe('getFrequency', () => {
const happify = (val, context = {}) => pure(val).firstCycle()[0].setContext(context);
it('should turn note into frequency', () => {
expect(getFrequency(happify('a4'))).toEqual(440);
expect(getFrequency(happify('a3'))).toEqual(220);
});
it('should turn midi into frequency', () => {
expect(getFrequency(happify(69, { type: 'midi' }))).toEqual(440);
expect(getFrequency(happify(57, { type: 'midi' }))).toEqual(220);
});
it('should return frequencies unchanged', () => {
expect(getFrequency(happify(440, { type: 'frequency' }))).toEqual(440);
expect(getFrequency(happify(432, { type: 'frequency' }))).toEqual(432);
});
it('should turn object with a "freq" property into frequency', () => {
expect(getFrequency(happify({ freq: 220 }))).toEqual(220);
expect(getFrequency(happify({ freq: 440 }))).toEqual(440);
});
it('should throw an error when given a non-note', () => {
expect(() => getFrequency(happify('Q'))).toThrowError(`not a note or frequency: Q`);
expect(() => getFrequency(happify('Z'))).toThrowError(`not a note or frequency: Z`);
});
});
describe('mod', () => {
describe('_mod', () => {
it('should work like regular modulo with positive numbers', () => {
assert.equal(mod(0, 3), 0);
assert.equal(mod(1, 3), 1);
assert.equal(mod(2, 3), 2);
assert.equal(mod(3, 3), 0);
assert.equal(mod(4, 3), 1);
assert.equal(mod(4, 2), 0);
expect(_mod(0, 3)).toEqual(0);
expect(_mod(1, 3)).toEqual(1);
expect(_mod(2, 3)).toEqual(2);
expect(_mod(3, 3)).toEqual(0);
expect(_mod(4, 3)).toEqual(1);
expect(_mod(4, 2)).toEqual(0);
});
it('should work with negative numbers', () => {
assert.equal(mod(-1, 3), 2);
assert.equal(mod(-2, 3), 1);
assert.equal(mod(-3, 3), 0);
assert.equal(mod(-4, 3), 2);
assert.equal(mod(-5, 3), 1);
assert.equal(mod(-3, 2), 1);
expect(_mod(-1, 3)).toEqual(2);
expect(_mod(-2, 3)).toEqual(1);
expect(_mod(-3, 3)).toEqual(0);
expect(_mod(-4, 3)).toEqual(2);
expect(_mod(-5, 3)).toEqual(1);
expect(_mod(-3, 2)).toEqual(1);
});
});
describe('compose', () => {
const add1 = (a) => a + 1;
it('should compose', () => {
expect(compose(add1, add1)(0)).toEqual(2);
expect(compose(add1)(0)).toEqual(1);
});
const addS = (s) => (a) => a + s;
it('should compose left to right', () => {
expect(compose(addS('a'), addS('b'))('')).toEqual('ab');
expect(compose(addS('a'), addS('b'))('x')).toEqual('xab');
});
});
describe('getPlayableNoteValue', () => {
const happify = (val, context = {}) => pure(val).firstCycle()[0].setContext(context);
it('should return object "note" property', () => {
expect(getPlayableNoteValue(happify({ note: 'a4' }))).toEqual('a4');
});
it('should return object "n" property', () => {
expect(getPlayableNoteValue(happify({ n: 'a4' }))).toEqual('a4');
});
it('should return object "value" property', () => {
expect(getPlayableNoteValue(happify({ value: 'a4' }))).toEqual('a4');
});
it('should turn midi into frequency', () => {
expect(getPlayableNoteValue(happify(57, { type: 'midi' }))).toEqual(220);
});
it('should return frequency value', () => {
expect(getPlayableNoteValue(happify(220, { type: 'frequency' }))).toEqual(220);
});
it('should throw an error if value is not an object, number, or string', () => {
expect(() => getPlayableNoteValue(happify(false))).toThrowError(`not a note: false`);
expect(() => getPlayableNoteValue(happify(undefined))).toThrowError(`not a note: undefined`);
});
});
describe('parseNumeral', () => {
it('should parse numbers as is', () => {
expect(parseNumeral(4)).toBe(4);
expect(parseNumeral(0)).toBe(0);
expect(parseNumeral(20)).toBe(20);
expect(parseNumeral('20')).toBe(20);
expect(parseNumeral(1.5)).toBe(1.5);
});
it('should parse notes', () => {
expect(parseNumeral('c')).toBe(48);
expect(parseNumeral('c4')).toBe(60);
expect(parseNumeral('c#4')).toBe(61);
expect(parseNumeral('db4')).toBe(61);
});
it('should throw an error for unknown strings', () => {
expect(() => parseNumeral('xyz')).toThrowError('cannot parse as numeral: "xyz"');
});
});
describe('parseFractional', () => {
it('should parse numbers as is', () => {
expect(parseFractional(4)).toBe(4);
expect(parseFractional(0)).toBe(0);
expect(parseFractional(20)).toBe(20);
expect(parseFractional('20')).toBe(20);
expect(parseFractional(1.5)).toBe(1.5);
});
it('should parse fractional shorthands values', () => {
expect(parseFractional('w')).toBe(1);
expect(parseFractional('h')).toBe(0.5);
expect(parseFractional('q')).toBe(0.25);
expect(parseFractional('e')).toBe(0.125);
});
it('should throw an error for unknown strings', () => {
expect(() => parseFractional('xyz')).toThrowError('cannot parse as fractional: "xyz"');
});
});
describe('numeralArgs', () => {
it('should convert function arguments to numbers', () => {
const add = numeralArgs((a, b) => a + b);
expect(add('c4', 2)).toBe(62);
});
});
describe('fractionalArgs', () => {
it('should convert function arguments to numbers', () => {
const add = fractionalArgs((a, b) => a + b);
expect(add('q', 2)).toBe(2.25);
});
});
+20 -8
View File
@@ -1,18 +1,30 @@
import { strict as assert } from 'assert';
/*
value.test.mjs - <short description TODO>
Copyright (C) 2022 Strudel contributors - see <https://github.com/tidalcycles/strudel/blob/main/packages/core/test/value.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 { describe, it, expect } from 'vitest';
import { map, valued, mul } from '../value.mjs';
import controls from '../controls.mjs';
const { n } = controls;
describe('Value', () => {
it('unionWith', () => {
const { value } = valued({ freq: 2000, distortion: 1.2 }).unionWith({ distortion: 2 }, mul);
assert.deepStrictEqual(value, { freq: 2000, distortion: 2.4 });
expect(value).toStrictEqual({ freq: 2000, distortion: 2.4 });
});
it('experiments', () => {
assert.equal(map(mul(5), valued(3)).value, 15);
assert.equal(map(mul(null), valued(3)).value, 0);
assert.equal(map(mul(3), valued(null)).value, null);
assert.equal(valued(3).map(mul).ap(3).value, 9);
assert.equal(valued(mul).ap(3).ap(3).value, 9);
assert.equal(valued(3).mul(3).value, 9);
expect(map(mul(5), valued(3)).value).toEqual(15);
expect(map(mul(null), valued(3)).value).toEqual(0);
expect(map(mul(3), valued(null)).value).toEqual(null);
expect(valued(3).map(mul).ap(3).value).toEqual(9);
expect(valued(mul).ap(3).ap(3).value).toEqual(9);
expect(valued(3).mul(3).value).toEqual(9);
});
it('union bare numbers for numeral props', () => {
expect(n(3).cutoff(500).add(10).firstCycleValues).toEqual([{ n: 13, cutoff: 510 }]);
expect(n(3).cutoff(500).mul(2).firstCycleValues).toEqual([{ n: 6, cutoff: 1000 }]);
});
});
+11
View File
@@ -0,0 +1,11 @@
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;
}
+117
View File
@@ -0,0 +1,117 @@
/*
timespan.mjs - <short description TODO>
Copyright (C) 2022 Strudel contributors - see <https://github.com/tidalcycles/strudel/blob/main/packages/core/timespan.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.mjs';
export class TimeSpan {
constructor(begin, end) {
this.begin = Fraction(begin);
this.end = Fraction(end);
}
get spanCycles() {
const spans = [];
var begin = this.begin;
const end = this.end;
const end_sam = end.sam();
// Support zero-width timespans
if (begin.equals(end)) {
return [new TimeSpan(begin, end)];
}
while (end.gt(begin)) {
// If begin and end are in the same cycle, we're done.
if (begin.sam().equals(end_sam)) {
spans.push(new TimeSpan(begin, this.end));
break;
}
// add a timespan up to the next sam
const next_begin = begin.nextSam();
spans.push(new TimeSpan(begin, next_begin));
// continue with the next cycle
begin = next_begin;
}
return spans;
}
get duration() {
return this.end.sub(this.begin);
}
cycleArc() {
// Shifts a timespan to one of equal duration that starts within cycle zero.
// (Note that the output timespan probably does not start *at* Time 0 --
// that only happens when the input Arc starts at an integral Time.)
const b = this.begin.cyclePos();
const e = b.add(this.duration);
return new TimeSpan(b, e);
}
withTime(func_time) {
// Applies given function to both the begin and end time of the timespan"""
return new TimeSpan(func_time(this.begin), func_time(this.end));
}
withEnd(func_time) {
// Applies given function to the end time of the timespan"""
return new TimeSpan(this.begin, func_time(this.end));
}
withCycle(func_time) {
// Like withTime, but time is relative to relative to the cycle (i.e. the
// sam of the start of the timespan)
const sam = this.begin.sam();
const b = sam.add(func_time(this.begin.sub(sam)));
const e = sam.add(func_time(this.end.sub(sam)));
return new TimeSpan(b, e);
}
intersection(other) {
// Intersection of two timespans, returns None if they don't intersect.
const intersect_begin = this.begin.max(other.begin);
const intersect_end = this.end.min(other.end);
if (intersect_begin.gt(intersect_end)) {
return undefined;
}
if (intersect_begin.equals(intersect_end)) {
// Zero-width (point) intersection - doesn't intersect if it's at the end of a
// non-zero-width timespan.
if (intersect_begin.equals(this.end) && this.begin.lt(this.end)) {
return undefined;
}
if (intersect_begin.equals(other.end) && other.begin.lt(other.end)) {
return undefined;
}
}
return new TimeSpan(intersect_begin, intersect_end);
}
intersection_e(other) {
// Like 'sect', but raises an exception if the timespans don't intersect.
const result = this.intersection(other);
if (result == undefined) {
throw 'TimeSpans do not intersect';
}
return result;
}
midpoint() {
return this.begin.add(this.duration.div(Fraction(2)));
}
equals(other) {
return this.begin.equals(other.begin) && this.end.equals(other.end);
}
show() {
return this.begin.show() + ' → ' + this.end.show();
}
}
export default TimeSpan;

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