Compare commits

..

923 Commits

Author SHA1 Message Date
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 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 89934886f7 initial demo submission 2022-04-15 08:55:53 +01:00
alex f278c85f2a more citations 2022-04-14 20:55:07 +01:00
alex 21e328569b A bit more blah blah 2022-04-14 09:12:56 +01:00
alex 369604aa42 Merge branch 'main' of github.com:tidalcycles/strudel into paper 2022-04-13 23:16:07 +01:00
alex 023da097a1 A bit of background 2022-04-13 23:09:53 +01:00
alex 0ad80c1af9 fix citations 2022-04-12 23:49:21 +01:00
alex 7182894eb6 reference links 2022-04-12 23:14:06 +01:00
Felix Roos 914bc117a1 some loose references 2022-04-11 23:26:17 +02:00
Felix Roos 0f003abf52 Merge remote-tracking branch 'origin/HEAD' into paper 2022-04-09 18:35:44 +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
395 changed files with 75636 additions and 43249 deletions
+14
View File
@@ -0,0 +1,14 @@
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
vite.config.js
/**/dist/**/*
!**/*.mjs
+16
View File
@@ -0,0 +1,16 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": ["eslint:recommended"],
"overrides": [],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [],
"rules": {
"no-unused-vars": ["warn", { "destructuredArrayIgnorePattern": ".", "ignoreRestSiblings": false }]
}
}
+46
View File
@@ -0,0 +1,46 @@
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: actions/setup-node@v3
with:
node-version: 16
cache: "npm"
- name: Install Dependencies
run: npm ci && cd repl && npm ci && cd ../tutorial && npm ci
- name: Build
run: npm run build
- name: Setup Pages
uses: actions/configure-pages@v2
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
# Upload entire repository
path: "./out"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
+10 -8
View File
@@ -7,13 +7,15 @@ 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: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- run: npm install
- run: npm run format-check
- run: npm run lint
- run: npm test
+11 -1
View File
@@ -1,4 +1,5 @@
dist
out
!docs/dist
dist-*
cabal-dev
@@ -27,4 +28,13 @@ node_modules/
repl-parcel
mytunes.ts
doc
.parcel-cache
out
.parcel-cache
repl_old
tutorial.rendered.mdx
doc.json
talk/public/EmuSP12
talk/public/samples
server/samples/old
repl/stats.html
coverage
+8
View File
@@ -0,0 +1,8 @@
*.md
*.json
*.yml
*.
**/out
**/dist
packages/mini/krill-parser.js
packages/xen/tunejs.js
+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,
"jsxBracketSameLine": false,
"arrowParens": "always",
"proseWrap": "preserve",
"htmlWhitespaceSensitivity": "css",
"endOfLine": "lf"
}
+4 -1
View File
@@ -2,5 +2,8 @@
"cSpell.words": [
"subspan",
"vals"
]
],
"yaml.schemas": {
"https://json.schemastore.org/github-workflow.json": "file:///home/felix/projects/strudel/.github/workflows/deploy.yml"
}
}
+20 -10
View File
@@ -12,7 +12,7 @@ To get in touch with the contributors, either
## Ask a Question
If you have any questions about strudel, make sure you've read the
If you have any questions about strudel, make sure you've read the
[tutorial](https://strudel.tidalcycles.org/tutorial/) to find out if it answers your question.
If not, use one of the Communication Channels above!
@@ -31,8 +31,9 @@ Use one of the Communication Channels listed above.
## Improve the Tutorial
If you find some weak spots in the [tutorial](https://strudel.tidalcycles.org/),
you are welcome to improve them by editing [this file](https://github.com/tidalcycles/strudel/blob/main/repl/src/tutorial/tutorial.mdx).
If you find some weak spots in the [tutorial](https://strudel.tidalcycles.org/),
you are welcome to improve them by editing [this file](https://github.com/tidalcycles/strudel/blob/main/tutorial/tutorial.mdx).
This will even work without setting up a development environment, only a github account is required.
## Propose a Feature
@@ -50,11 +51,11 @@ Please check that it has not been reported before.
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
3. fork the repository
4. make sure you've setup the project (see below)
5. hopefully fix the bug
6. make sure the tests pass
7. send a pull request
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
@@ -78,7 +79,7 @@ cd repl && npm i # install repl dependencies
npm run start # start repl
```
Those commands might look slightly different for your OS.
Those commands might look slightly different for your OS.
Please report any problems you've had with the setup instructions!
## Code Style
@@ -95,7 +96,7 @@ If you use VSCode, you can
The project is split into multiple [packages](https://github.com/tidalcycles/strudel/tree/main/packages) with independent versioning.
When you run `npm i` on the root folder, [npm workspaces](https://docs.npmjs.com/cli/v7/using-npm/workspaces) will symlink all packages
in the `node_modules` folder. This will allow any js file to import `@strudel.cycles/<package-name>` to get the local version,
in the `node_modules` folder. This will allow any js file to import `@strudel.cycles/<package-name>` to get the local version,
which allows developing multiple packages at the same time
## Package Publishing
@@ -103,9 +104,18 @@ which allows developing multiple packages at the same time
To publish all packages that have been changed since the last release, run:
```sh
npm login
npx lerna publish
```
### New Packages
To add a new package, you have to publish it manually the first time, using:
```sh
cd packages/<package-name> && npm 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>.
+9 -1
View File
@@ -2,7 +2,7 @@
[![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/>
- Tutorial: <https://strudel.tidalcycles.org/tutorial/>
@@ -27,8 +27,10 @@ There are multiple npm packages you can use to use strudel, or only parts of it,
- [`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/)
Click on the package names to find out more about each one.
@@ -36,6 +38,12 @@ Click on the package names to find out more about each one.
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>
+1806
View File
File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 150 KiB

View File
-1
View File
@@ -1 +0,0 @@
strudel.tidalcycles.org
-16
View File
@@ -1,16 +0,0 @@
{
"files": {
"main.css": "/static/css/main.0d689283.css",
"main.js": "/static/js/main.7e790d7f.js",
"static/js/787.1c52cb78.chunk.js": "/static/js/787.1c52cb78.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.7e790d7f.js.map": "/static/js/main.7e790d7f.js.map",
"787.1c52cb78.chunk.js.map": "/static/js/787.1c52cb78.chunk.js.map"
},
"entrypoints": [
"static/css/main.0d689283.css",
"static/js/main.7e790d7f.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.7e790d7f.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>
-15
View File
@@ -1,15 +0,0 @@
{
"short_name": "Strudel REPL",
"name": "Strudel REPL - Tidal Patterns in JavaScript",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
-3
View File
@@ -1,3 +0,0 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:
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_cycles_repl=self.webpackChunk_strudel_cycles_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.1c52cb78.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

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.757e9f9d.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.a0cd6c24.js" defer></script> </body></html>
-131
View File
@@ -1,131 +0,0 @@
# Tidal Features in Strudel
## Basics
- [ ] drawLine
- [ ] setcps
- [ ] naming patterns? block based evaluation?
- [ ] once
- [x] 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
- [x] layer
- [ ] steps ?
- [x] iter
- [x] iter' = iterBack
## Alteration
- [ ] range, rangex
- [ ] quantise
- [ ] ply
- [x] stutter = echo
- [ ] stripe, slowstripe
- [ ] palindrome = every(2, rev)
- [ ] trunc
- [ ] linger
- [x] 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
- [x] euclid, euclidLegato
- [ ] euclidInv, euclidFull
- [ ] ifp
## Time
- [x] fast
- [x] fastGap
- [x] slow
- [ ] hurry
- [ ] compress: is this compressSpan?
- [ ] zoom
- [ ] within
- [x] off
- [ ] rotL / rotR
- [x] rev
- [x] 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
- [x] segment
- [ ] discretise
## Randomness
- [ ] rand / irand
- [ ] perlin / perlinWith / perlin2 / perlin2With
## Composition
- [ ] ur
- [ ] seqP / seqPLoop
+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
}
}
+9660 -5643
View File
File diff suppressed because it is too large Load Diff
+28 -8
View File
@@ -1,16 +1,27 @@
{
"name": "@strudel.cycles/monorepo",
"version": "0.0.1",
"version": "0.0.4",
"private": true,
"description": "Port of tidalcycles to javascript",
"main": "strudel.mjs",
"scripts": {
"test": "npm run test --workspaces --if-present",
"pretest": "cd tutorial && npm run jsdoc-json",
"test": "vitest run --version",
"test-ui": "vitest --ui",
"test-coverage": "vitest --coverage",
"bootstrap": "lerna bootstrap",
"setup": "npm i && npm run bootstrap && cd repl && npm i",
"repl": "cd repl && npm run start",
"setup": "npm i && npm run bootstrap && cd repl && npm i && cd ../tutorial && npm i",
"snapshot": "vitest run -u --silent",
"repl": "cd repl && npm run dev",
"osc": "cd packages/osc && npm run server",
"build": "cd repl && npm run build"
"build": "rm -rf out && cd repl && npm run build && cd ../tutorial && npm run build",
"preview": "npx serve ./out",
"deploy": "NODE_DEBUG=gh-pages gh-pages -d out",
"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 .",
"check": "npm run format-check && npm run lint && npm run test"
},
"workspaces": [
"packages/*"
@@ -27,14 +38,23 @@
"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",
"devDependencies": {
"@vitest/ui": "^0.25.7",
"c8": "^7.12.0",
"eslint": "^8.28.0",
"events": "^3.3.0",
"gh-pages": "^4.0.0",
"jsdoc": "^3.6.10",
"jsdoc-json": "^2.0.2",
"jsdoc-to-markdown": "^7.1.1",
"lerna": "^4.0.0",
"mocha": "^9.1.4"
"prettier": "^2.8.1",
"rollup-plugin-visualizer": "^5.8.1",
"vitest": "^0.25.7"
}
}
+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
```
+1
View File
@@ -0,0 +1 @@
examples
+613 -109
View File
@@ -1,101 +1,450 @@
/*
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, sequence } from './pattern.mjs';
const controls = {};
const generic_params = [
/**
* Select a sound / sample by name.
*
* <details style={{display:'none'}}>
* <summary>show all sounds</summary>
*
* 808 (6) 808bd (25) 808cy (25) 808hc (5) 808ht (5) 808lc (5) 808lt (5) 808mc (5) 808mt (5) 808oh (5) 808sd (25) 909 (1) ab (12) ade (10) ades2 (9) ades3 (7) ades4 (6) alex (2) alphabet (26) amencutup (32) armora (7) arp (2) arpy (11) auto (11) baa (7) baa2 (7) bass (4) bass0 (3) bass1 (30) bass2 (5) bass3 (11) bassdm (24) bassfoo (3) battles (2) bd (24) bend (4) bev (2) bin (2) birds (10) birds3 (19) bleep (13) blip (2) blue (2) bottle (13) breaks125 (2) breaks152 (1) breaks157 (1) breaks165 (1) breath (1) bubble (8) can (14) casio (3) cb (1) cc (6) chin (4) circus (3) clak (2) click (4) clubkick (5) co (4) coins (1) control (2) cosmicg (15) cp (2) cr (6) crow (4) d (4) db (13) diphone (38) diphone2 (12) dist (16) dork2 (4) dorkbot (2) dr (42) dr2 (6) dr55 (4) dr_few (8) drum (6) drumtraks (13) e (8) east (9) electro1 (13) em2 (6) erk (1) f (1) feel (7) feelfx (8) fest (1) fire (1) flick (17) fm (17) foo (27) future (17) gab (10) gabba (4) gabbaloud (4) gabbalouder (4) glasstap (3) glitch (8) glitch2 (8) gretsch (24) gtr (3) h (7) hand (17) hardcore (12) hardkick (6) haw (6) hc (6) hh (13) hh27 (13) hit (6) hmm (1) ho (6) hoover (6) house (8) ht (16) if (5) ifdrums (3) incoming (8) industrial (32) insect (3) invaders (18) jazz (8) jungbass (20) jungle (13) juno (12) jvbass (13) kicklinn (1) koy (2) kurt (7) latibro (8) led (1) less (4) lighter (33) linnhats (6) lt (16) made (7) made2 (1) mash (2) mash2 (4) metal (10) miniyeah (4) monsterb (6) moog (7) mouth (15) mp3 (4) msg (9) mt (16) mute (28) newnotes (15) noise (1) noise2 (8) notes (15) numbers (9) oc (4) odx (15) off (1) outdoor (6) pad (3) padlong (1) pebbles (1) perc (6) peri (15) pluck (17) popkick (10) print (11) proc (2) procshort (8) psr (30) rave (8) rave2 (4) ravemono (2) realclaps (4) reverbkick (1) rm (2) rs (1) sax (22) sd (2) seawolf (3) sequential (8) sf (18) sheffield (1) short (5) sid (12) sine (6) sitar (8) sn (52) space (18) speakspell (12) speech (7) speechless (10) speedupdown (9) stab (23) stomp (10) subroc3d (11) sugar (2) sundance (6) tabla (26) tabla2 (46) tablex (3) tacscan (22) tech (13) techno (7) tink (5) tok (4) toys (13) trump (11) ul (10) ulgab (5) uxay (3) v (6) voodoo (5) wind (10) wobble (1) world (3) xmas (1) yeah (31)
*
* <a href="https://tidalcycles.org/docs/configuration/Audio%20Samples/default_library" target="_blank">more info</a>
*
* </details>
*
* @name s
* @param {string | Pattern} sound The sound / pattern of sounds to pick
* @example
* s("bd hh")
*
*/
['s', 's', 'sound'],
/**
* The note or sample number to choose for a synth or sampleset
* Note names currently not working yet, but will hopefully soon. Just stick to numbers for now
*
* @name n
* @param {string | number | Pattern} value note name, note number or sample number
* @example
* s('superpiano').n("<0 1 2 3>").osc()
* @example
* s('superpiano').n("<c4 d4 e4 g4>").osc()
* @example
* n("0 1 2 3").s('east').osc()
*/
// also see https://github.com/tidalcycles/strudel/pull/63
['f', 'n', 'The note or sample number to choose for a synth or sampleset'],
['f', 'note', 'The note or pitch to play a sound or synth with'],
//['s', 'toArg', 'for internal sound routing'],
// ["f", "from", "for internal sound routing"),
//['f', 'to', 'for internal sound routing'],
/**
* 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.
* @example
* s("sax").accelerate("<0 1 2 4 8 16>").slow(2).osc()
*
*/
['f', 'accelerate', 'a pattern of numbers that speed up (or slow down) samples while they play.'],
['f', 'amp', 'like @gain@, but linear.'],
[
'f',
'attack',
'a pattern of numbers to specify the attack time (in seconds) of an envelope applied to each sample.',
],
['f', 'bandf', 'a pattern of numbers from 0 to 1. Sets the center frequency of the band-pass filter.'],
['f', 'bandq', 'a pattern of anumbers from 0 to 1. Sets the q-factor of the band-pass filter.'],
[
'f',
'begin',
'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.',
],
['f', 'legato', 'controls the amount of overlap between two adjacent sounds'],
// ['f', 'clhatdecay', ''],
[
'f',
'crush',
'bit crushing, a pattern of numbers from 1 (for drastic reduction in bit-depth) to 16 (for barely no reduction).',
],
[
'f',
'coarse',
'fake-resampling, a pattern of numbers for lowering the sample rate, i.e. 1 for original 2 for half, 3 for a third and so on.',
],
['i', 'channel', 'choose the channel the pattern is sent to in superdirt'],
[
'i',
'cut',
'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.',
],
['f', 'cutoff', 'a pattern of numbers from 0 to 1. Applies the cutoff frequency of the low-pass filter.'],
// ['f', 'cutoffegint', ''],
['f', 'decay', ''],
['f', 'delay', 'a pattern of numbers from 0 to 1. Sets the level of the delay signal.'],
['f', 'delayfeedback', 'a pattern of numbers from 0 to 1. Sets the amount of delay feedback.'],
['f', 'delaytime', 'a pattern of numbers from 0 to 1. Sets the length of the delay.'],
['f', 'detune', ''],
['f', 'djf', 'DJ filter, below 0.5 is low pass filter, above is high pass filter.'],
[
'f',
'dry',
'when set to `1` will disable all reverb for this pattern. See `room` and `size` for more information about reverb.',
],
[
'f',
'end',
'the same as `begin`, but cuts the end off samples, shortening them; e.g. `0.75` to cut off the last quarter of each sample.',
],
[
'f',
'fadeTime',
"Used when using begin/end or chop/striate and friends, to change the fade out time of the 'grain' envelope.",
],
[
'f',
'fadeInTime',
'As with fadeTime, but controls the fade in time of the grain envelope. Not used if the grain begins at position 0 in the sample.',
],
['f', 'freq', ''],
/**
* 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")
*
*/
[
'f',
'gain',
'a pattern of numbers that specify volume. Values less than 1 make the sound quieter. Values greater than 1 make the sound louder. For the linear equivalent, see @amp@.',
],
['f', 'gate', ''],
// ['f', 'hatgrain', ''],
/**
* Like {@link gain}, but linear.
*
* @name amp
* @param {number | Pattern} amount gain.
* @example
* s("bd*8").amp(".1*2 .5 .1*2 .5 .1 .5").osc()
*
*/
['f', 'amp', 'like @gain@, but linear.'],
// TODO: find out why 0 does not work, and it generally seems not right
/*
* A pattern of numbers to specify the attack time of an envelope applied to each sample.
*
* @name attack
* @param {number | Pattern} attack time in seconds.
* @example
* n("c5 e5").s('superpiano').attack("<0 .1>").osc()
*
*/
[
'f',
'hcutoff',
'a pattern of numbers from 0 to 1. Applies the cutoff frequency of the high-pass filter. Also has alias @hpf@',
'attack',
'a pattern of numbers to specify the attack time (in seconds) of an envelope applied to each sample.',
],
/**
* 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")
*
*/
['f', 'bank', 'selects sound bank to use'],
// TODO: find out how this works?
/*
* Envelope decay time = the time it takes after the attack time to reach the sustain level.
*
* @name decay
* @param {number | Pattern} time decay time in seconds
* @example
* s("sax").cut(1).decay("<.1 .2 .3 .4>").sustain(0).osc()
*
*/
['f', 'decay', ''],
['f', 'sustain', ''],
[
'f',
'release',
'a pattern of numbers to specify the release time (in seconds) of an envelope applied to each sample.',
],
[
'f',
'hold',
'a pattern of numbers to specify the hold time (in seconds) of an envelope applied to each sample. Only takes effect if `attack` and `release` are also specified.',
],
// TODO: in tidal, it seems to be normalized
/**
* Sets the center frequency of the band-pass filter.
*
* @name bandf
* @param {number | Pattern} frequency center frequency
* @example
* s("bd sd,hh*3").bandf("<1000 2000 4000 8000>")
*
*/
['f', 'bandf', 'A pattern of numbers from 0 to 1. Sets the center frequency of the band-pass filter.'],
// TODO: in tidal, it seems to be normalized
/**
* Sets the q-factor of the band-pass filter
*
* @name bandq
* @param {number | Pattern} q q factor
* @example
* s("bd sd").bandf(500).bandq("<0 1 2 3>")
*
*/
['f', 'bandq', 'a pattern of anumbers from 0 to 1. Sets the q-factor of the band-pass filter.'],
/**
* 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>")
*
*/
[
'f',
'begin',
'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.',
],
/**
* 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>")
*
*/
[
'f',
'end',
'the same as `begin`, but cuts the end off samples, shortening them; e.g. `0.75` to cut off the last quarter of each sample.',
],
/**
* 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()
*
*/
['f', 'loop', 'loops the sample (from `begin` to `end`) the specified number of times.'],
// 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
* @example
* "c4 eb4 g4 bb4".legato("<0.125 .25 .5 .75 1 2 4>")
*
*/
// ['f', 'legato', 'controls the amount of overlap between two adjacent sounds'],
// ['f', '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>")
*
*/
[
'f',
'crush',
'bit crushing, a pattern of numbers from 1 (for drastic reduction in bit-depth) to 16 (for barely no reduction).',
],
/**
* 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>")
*
*/
[
'f',
'coarse',
'fake-resampling, a pattern of numbers for lowering the sample rate, i.e. 1 for original 2 for half, 3 for a third and so on.',
],
/**
* choose the channel the pattern is sent to in superdirt
*
* @name channel
* @param {number | Pattern} channel channel number
*
*/
['i', 'channel', 'choose the channel the pattern is sent to in superdirt'],
/**
* 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("bd sax").cut(1).osc()
*
*/
[
'i',
'cut',
'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.',
],
/**
* Applies the cutoff frequency of the low-pass filter.
*
* @name cutoff
* @param {number | Pattern} frequency audible between 0 and 20000
* @example
* s("bd sd,hh*3").cutoff("<4000 2000 1000 500 200 100>")
*
*/
// TODO: add lpf synonym
['f', 'cutoff', 'a pattern of numbers from 0 to 1. Applies the cutoff frequency of the low-pass filter.'],
/**
* Applies the cutoff frequency of the high-pass filter.
*
* @name hcutoff
* @param {number | Pattern} frequency audible between 0 and 20000
* @example
* s("bd sd,hh*4").hcutoff("<4000 2000 1000 500 200 100>")
*
*/
// TODO: add hpf synonym
[
'f',
'hcutoff',
'a pattern of numbers from 0 to 1. Applies the cutoff frequency of the high-pass filter. Also has alias @hpf@',
],
/**
* Applies the resonance of the high-pass filter.
*
* @name hresonance
* @param {number | Pattern} q resonance factor between 0 and 50
* @example
* s("bd sd,hh*4").hcutoff(2000).hresonance("<0 10 20 30>")
*
*/
[
'f',
'hresonance',
'a pattern of numbers from 0 to 1. Applies the resonance of the high-pass filter. Has alias @hpq@',
],
// TODO: add hpq synonym
/**
* Applies the cutoff frequency of the low-pass filter.
*
* @name resonance
* @param {number | Pattern} q resonance factor between 0 and 50
* @example
* s("bd sd,hh*4").cutoff(2000).resonance("<0 10 20 30>")
*
*/
['f', 'resonance', 'a pattern of numbers from 0 to 1. Specifies the resonance of the low-pass filter.'],
// TODO: add lpq synonym?
/**
* 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()
*
*/
['f', 'djf', 'DJ filter, below 0.5 is low pass filter, above is high pass filter.'],
// ['f', 'cutoffegint', ''],
// TODO: does not seem to work
/*
* Sets the level of the delay signal.
*
* @name delay
* @param {number | Pattern} level between 0 and 1
* @example
* s("bd").delay("<0 .5 .75 1>").osc()
*
*/
['f', 'delay', 'a pattern of numbers from 0 to 1. Sets the level of the delay signal.'],
['f', 'delayfeedback', 'a pattern of numbers from 0 to 1. Sets the amount of delay feedback.'],
['f', 'delaytime', 'a pattern of numbers from 0 to 1. Sets the length of the delay.'],
/* // 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()
*
*/
[
'f',
'lock',
'A pattern of numbers. Specifies whether delaytime is calculated relative to cps. When set to 1, delaytime is a direct multiple of a cycle.',
],
/**
* 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
* @example
* n("0 3 7").s('superzow').octave(3).detune("<0 .25 .5 1 2>").osc()
*
*/
['f', 'detune', ''],
/**
* 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()
*
*/
[
'f',
'dry',
'when set to `1` will disable all reverb for this pattern. See `room` and `size` for more information about reverb.',
],
// 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()
*
*/
[
'f',
'fadeTime',
"Used when using begin/end or chop/striate and friends, to change the fade out time of the 'grain' envelope.",
],
// TODO: see above
[
'f',
'fadeInTime',
'As with fadeTime, but controls the fade in time of the grain envelope. Not used if the grain begins at position 0 in the sample.',
],
/**
* 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()
*
*/
['f', 'freq', ''],
// TODO: https://tidalcycles.org/docs/configuration/MIDIOSC/control-voltage/#gate
['f', 'gate', ''],
// ['f', 'hatgrain', ''],
// ['f', 'lagogo', ''],
// ['f', 'lclap', ''],
// ['f', 'lclaves', ''],
// ['f', 'lclhat', ''],
// ['f', '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()
*
*/
['f', '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()
*
*/
// TODO: the rate seems to "lag" (in the example, 1 will be fast)
['f', '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()
*
*/
['f', 'lsize', ''],
// ['f', 'lfo', ''],
// ['f', 'lfocutoffint', ''],
@@ -107,47 +456,86 @@ const generic_params = [
// ['f', 'lhitom', ''],
// ['f', 'lkick', ''],
// ['f', 'llotom', ''],
[
'f',
'lock',
'A pattern of numbers. Specifies whether delaytime is calculated relative to cps. When set to 1, delaytime is a direct multiple of a cycle.',
],
['f', 'loop', 'loops the sample (from `begin` to `end`) the specified number of times.'],
// ['f', 'lophat', ''],
// ['f', 'lsnare', ''],
['f', 'n', 'The note or sample number to choose for a synth or sampleset'],
['f', 'note', 'The note or pitch to play a sound or synth with'],
['f', 'degree', ''],
['f', 'mtranspose', ''],
['f', 'ctranspose', ''],
['f', 'harmonic', ''],
['f', 'stepsPerOctave', ''],
['f', 'octaveR', ''],
['f', 'degree', ''], // TODO: what is this? not found in tidal doc
['f', 'mtranspose', ''], // TODO: what is this? not found in tidal doc
['f', 'ctranspose', ''], // TODO: what is this? not found in tidal doc
['f', 'harmonic', ''], // TODO: what is this? not found in tidal doc
['f', 'stepsPerOctave', ''], // TODO: what is this? not found in tidal doc
['f', 'octaveR', ''], // TODO: what is this? not found in tidal doc
// TODO: why is this needed? what's the difference to late / early?
[
'f',
'nudge',
'Nudges events into the future by the specified number of seconds. Negative numbers work up to a point as well (due to internal latency)',
],
// 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()
*/
['i', 'octave', ''],
['f', 'offset', ''],
['f', 'offset', ''], // TODO: what is this? not found in tidal doc
// ['f', 'ophatdecay', ''],
// TODO: example
/**
* a pattern of numbers. An `orbit` is a global parameter context for patterns. Patterns with the same orbit will share hardware output bus offset and global effects, e.g. reverb and delay. The maximum number of orbits is specified in the superdirt startup, numbers higher than maximum will wrap around.
*
* @name orbit
* @param {number | Pattern} number
*
*/
[
'i',
'orbit',
'a pattern of numbers. An `orbit` is a global parameter context for patterns. Patterns with the same orbit will share hardware output bus offset and global effects, e.g. reverb and delay. The maximum number of orbits is specified in the superdirt startup, numbers higher than maximum will wrap around.',
],
['f', 'overgain', ''],
['f', 'overshape', ''],
['f', 'overgain', ''], // TODO: what is this? not found in tidal doc
['f', 'overshape', ''], // TODO: what is this? not found in tidal doc
/**
* 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>")
*
*/
[
'f',
'pan',
'a pattern of numbers between 0 and 1, from left to right (assuming stereo), once round a circle (assuming multichannel)',
],
// 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()
*
*/
[
'f',
'panspan',
'a pattern of numbers between -inf and inf, which controls how much multichannel output is fanned out (negative is backwards ordering)',
],
// 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()
*
*/
[
'f',
'pansplay',
@@ -167,68 +555,168 @@ const generic_params = [
// ['f', 'pitch2', ''],
// ['f', 'pitch3', ''],
// ['f', 'portamento', ''],
// TODO: LFO rate see https://tidalcycles.org/docs/patternlib/tutorials/synthesizers/#supersquare
['f', 'rate', "used in SuperDirt softsynths as a control rate or 'speed'"],
[
'f',
'release',
'a pattern of numbers to specify the release time (in seconds) of an envelope applied to each sample.',
],
['f', 'resonance', 'a pattern of numbers from 0 to 1. Specifies the resonance of the low-pass filter.'],
['f', 'room', 'a pattern of numbers from 0 to 1. Sets the level of reverb.'],
// ['f', 'sagogo', ''],
// ['f', 'sclap', ''],
// ['f', 'sclaves', ''],
// ['f', 'scrash', ''],
// TODO: slide param for certain synths
['f', 'slide', ''],
// TODO: detune? https://tidalcycles.org/docs/patternlib/tutorials/synthesizers/#supersquare
['f', 'semitone', ''],
[
'f',
'shape',
'wave shaping distortion, a pattern of numbers from 0 for no distortion up to 1 for loads of distortion.',
],
// TODO: dedup with synth param, see https://tidalcycles.org/docs/reference/synthesizers/#superpiano
// ['f', 'velocity', ''],
['f', 'voice', ''], // TODO: synth param
/**
* Sets the level of reverb.
*
* @name room
* @param {number | Pattern} level between 0 and 1
* @example
* s("bd sd").room("<0 .2 .4 .6 .8 1>").osc()
*
*/
['f', 'room', 'a pattern of numbers from 0 to 1. Sets the level of reverb.'],
/**
* Sets the room size of the reverb, see {@link room}.
*
* @name size
* @param {number | Pattern} size between 0 and 1
* @example
* s("bd sd").room(.8).size("<0 .2 .4 .6 .8 1>").osc()
*
*/
// TODO: find out why :
// s("bd sd").room(.8).size("<0 .2 .4 .6 .8 [1,0]>").osc()
// .. does not work. Is it because room is only one effect?
[
'f',
'size',
'a pattern of numbers from 0 to 1. Sets the perceptual size (reverb time) of the `room` to be used in reverb.',
],
['f', 'slide', ''],
[
'f',
'roomsize',
'a pattern of numbers from 0 to 1. Sets the perceptual size (reverb time) of the `room` to be used in reverb.',
],
// ['f', 'sagogo', ''],
// ['f', 'sclap', ''],
// ['f', 'sclaves', ''],
// ['f', '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>")
*
*/
[
'f',
'shape',
'wave shaping distortion, a pattern of numbers from 0 for no distortion up to 1 for loads of distortion.',
],
/**
* 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>").osc()
* @example
* speed("1 1.5*2 [2 1.1]").s("sax").cut(1).osc()
*
*/
[
'f',
'speed',
'a pattern of numbers which changes the speed of sample playback, i.e. a cheap way of changing pitch. Negative values will play the sample backwards!',
],
['f', 'squiz', ''],
['f', 'stutterdepth', ''],
['f', 'stuttertime', ''],
['f', 'sustain', ''],
['f', 'timescale', ''],
['f', 'timescalewin', ''],
// ['f', 'tomdecay', ''],
/**
* 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()
*
*/
[
's',
'unit',
'used in conjunction with `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`.',
],
['f', 'velocity', ''],
/**
* 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()
*
*/
['f', 'squiz', ''],
['f', 'stutterdepth', ''], // TODO: what is this? not found in tidal doc
['f', 'stuttertime', ''], // TODO: what is this? not found in tidal doc
['f', 'timescale', ''], // TODO: what is this? not found in tidal doc
['f', 'timescalewin', ''], // TODO: what is this? not found in tidal doc
// ['f', 'tomdecay', ''],
// ['f', 'vcfegint', ''],
// ['f', 'vcoegint', ''],
['f', 'voice', ''],
// 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>>")
*
*/
[
's',
'vowel',
'formant filter to make things sound like vowels, a pattern of either `a`, `e`, `i`, `o` or `u`. Use a rest (`~`) for no effect.',
],
/* // 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
*/
['f', 'waveloss', ''],
// TODO: midi effects?
['f', 'dur', ''],
// ['f', 'modwheel', ''],
['f', 'expression', ''],
['f', '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()
*
*/
// TODO: tremdp alias
['f', 'tremolodepth', "Tremolo Audio DSP effect | params are 'tremolorate' and 'tremolodepth'"],
['f', 'tremolorate', "Tremolo Audio DSP effect | params are 'tremolorate' and 'tremolodepth'"],
// TODO: doesn't seem to do anything
['f', 'phaserdepth', "Phaser Audio DSP effect | params are 'phaserrate' and 'phaserdepth'"],
['f', 'phaserrate', "Phaser Audio DSP effect | params are 'phaserrate' and 'phaserdepth'"],
['f', 'fshift', 'frequency shifter'],
['f', 'fshiftnote', 'frequency shifter'],
['f', 'fshiftphase', 'frequency shifter'],
['f', 'triode', 'tube distortion'],
['f', 'krush', 'shape/bass enhancer'],
['f', 'kcutoff', ''],
@@ -271,18 +759,34 @@ const generic_params = [
['f', 'uid', ''],
['f', 'val', ''],
['f', 'cps', ''],
['f', 'clip', ''],
];
// TODO: slice / splice https://www.youtube.com/watch?v=hKhPdO0RKDQ&list=PL2lW1zNIIwj3bDkh-Y3LUGDuRcoUigoDs&index=13
const _name = (name, ...pats) => sequence(...pats).withValue((x) => ({ [name]: x }));
const _setter = (func) =>
const _setter = (func, name) =>
function (...pats) {
if (!pats.length) {
return this.fmap((value) => ({ [name]: value }));
}
return this.set(func(...pats));
};
generic_params.forEach(([type, name, description]) => {
controls[name] = (...pats) => _name(name, ...pats);
Pattern.prototype[name] = _setter(controls[name]);
Pattern.prototype[name] = _setter(controls[name], name);
});
// create custom param
controls.createParam = (name) => {
const func = (...pats) => _name(name, ...pats);
Pattern.prototype[name] = _setter(func, name);
return (...pats) => _name(name, ...pats);
};
controls.createParams = (...names) =>
names.reduce((acc, name) => Object.assign(acc, { [name]: controls.createParam(name) }), {});
export default controls;
+87
View File
@@ -0,0 +1,87 @@
/*
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 {
worker;
pattern;
started = false;
cps = 1; // TODO
getTime;
phase = 0;
constructor({ interval, onTrigger, onToggle, onError, getTime, latency = 0.1 }) {
this.getTime = getTime;
this.onToggle = onToggle;
this.latency = latency;
const round = (x) => Math.round(x * 1000) / 1000;
this.clock = createClock(
getTime,
(phase, duration, tick) => {
if (tick === 0) {
this.origin = phase;
}
const begin = round(phase - this.origin);
this.phase = begin - latency;
const end = round(begin + duration);
const time = getTime();
try {
const haps = this.pattern.queryArc(begin, end); // get Haps
haps.forEach((hap) => {
if (hap.part.begin.equals(hap.whole.begin)) {
const deadline = hap.whole.begin + this.origin - time + latency;
const duration = hap.duration * 1;
onTrigger?.(hap, deadline, duration);
}
});
} catch (e) {
logger(`[cyclist] error: ${e.message}`);
onError?.(e);
}
}, // called slightly before each cycle
interval, // duration of each cycle
);
}
getPhase() {
return this.getTime() - this.origin - this.latency;
}
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.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('')}`);
}
}
+61
View File
@@ -0,0 +1,61 @@
/*
draw.mjs - <short description TODO>
Copyright (C) 2022 Strudel contributors - see <https://github.com/tidalcycles/strudel/blob/main/packages/tone/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;z-index:5';
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);
}
};
+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;
+75
View File
@@ -1,3 +1,9 @@
/*
euclid.mjs - <short description TODO>
Copyright (C) 2022 Strudel contributors - see <https://github.com/tidalcycles/strudel/blob/main/packages/core/euclid.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, timeCat } from './pattern.mjs';
import bjork from 'bjork';
import { rotate } from './util.mjs';
@@ -11,10 +17,79 @@ const euclid = (pulses, steps, rotation = 0) => {
return b;
};
/**
* 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 accurately
* describe a large number of rhythms used in the most important music world traditions.
*
* @memberof Pattern
* @name euclid
* @param {number} pulses the number of onsets / beats
* @param {number} steps the number of steps to fill
* @param {number} rotation (optional) offset in steps
* @returns Pattern
* @example
* // The Cuban tresillo pattern.
* note("c3").euclid(3,8)
*/
/**
* @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").euclid(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").euclid(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").euclid(11,24,14)
* @example // Another rhythm necklace of the Aka Pygmies of the upper Sangha.
* note("c3").euclid(13,24,5)
*/
Pattern.prototype.euclid = function (pulses, steps, rotation = 0) {
return this.struct(euclid(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)
*/
Pattern.prototype.euclidLegato = function (pulses, steps, rotation = 0) {
const bin_pat = euclid(pulses, steps, rotation);
const firstOne = bin_pat.indexOf(1);
+53
View File
@@ -0,0 +1,53 @@
/*
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';
let scoped = false;
export const evalScope = async (...args) => {
if (scoped) {
console.warn('evalScope was called more than once.');
}
scoped = true;
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);
};
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 (!scoped) {
await evalScope(); // at least scope Pattern.prototype.boostrap
}
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 };
};
+1 -1
View File
@@ -27,7 +27,7 @@
const events = pattern.firstCycle(); // query first cycle
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>
+90
View File
@@ -0,0 +1,90 @@
<div style="position: absolute; bottom: 0; right: 0; padding: 4px; width: 100vw; display: flex">
<button id="start" style="font-size: 2em">start</button>
<button id="stop" style="font-size: 2em">stop</button>
<button id="slower" style="font-size: 2em">slower</button>
<button id="faster" style="font-size: 2em">faster</button>
</div>
<textarea
style="font-size: 2em; background: #052b49; color: #fff; 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 '@strudel.cycles/core';
const { cat, State, TimeSpan, Scheduler, getPlayableNoteValue, getFreq } = strudel;
Object.assign(window, strudel); // add strudel to eval scope
const ctx = new AudioContext();
const scheduler = new Scheduler({
// audioContext: getAudioContext(),
interval: 0.1,
onTrigger: (hap, time, duration) => {
const freq = getFrequency(hap);
const osc = ctx.createOscillator();
const gain = 0.2;
osc.frequency.value = freq;
osc.type = 'triangle';
const onset = ctx.currentTime + time;
const offset = onset + duration;
const attack = 0.05;
const release = 0.05;
osc.start(onset);
osc.stop(offset + release);
const g = ctx.createGain();
g.gain.setValueAtTime(gain, onset);
g.gain.linearRampToValueAtTime(gain, onset + attack);
g.gain.setValueAtTime(gain, offset - release);
g.gain.linearRampToValueAtTime(0, offset);
osc.connect(g);
g.connect(ctx.destination);
},
});
let initialCode = `stack('c4','e4',cat('g4','a4','b4','a4'))
.add(cat(0,1,2,3,4,3,2,1).slow(8))
.fast(2)
.cps(tri.range(1,8).slow(32))`;
try {
const base64 = decodeURIComponent(window.location.href.split('#')[1]);
initialCode = atob(base64);
} catch (err) {
console.warn('failed to decode', err);
}
const input = document.getElementById('text');
input.value = initialCode;
const evaluate = () => {
try {
const pattern = eval(input.value);
scheduler.setPattern(pattern);
window.location.hash = '#' + encodeURIComponent(btoa(input.value)); // update url hash
} catch (err) {
console.warn(err);
}
};
evaluate();
input.addEventListener('input', () => evaluate());
document.getElementById('start').addEventListener('click', async () => {
await ctx.resume();
scheduler.start();
});
document.getElementById('stop').addEventListener('click', () => scheduler.stop());
document.getElementById('slower').addEventListener('click', () => scheduler.setCps(scheduler.cps - 0.1));
document.getElementById('faster').addEventListener('click', () => scheduler.setCps(scheduler.cps + 0.1));
</script>
<!--
sequence(1,2).mul(55/2) // frequencies
.mul(slowcat(1,2))
.mul(slowcat(1,3/2,4/3,5/3).slow(8))
.fast(3)
.freq()
.velocity(.5)
.s('sawtooth')
.cutoff(800)
.out()
-->
+44
View File
@@ -0,0 +1,44 @@
<input
type="text"
id="text"
value="seq('c3','eb3','g3').note().s('sawtooth').out()"
style="width: 100%; font-size: 2em; outline: none; margin-bottom: 10px"
spellcheck="false"
/>
<button id="start">play</button>
<div id="output"></div>
<script type="module">
const strudel = await import('https://cdn.skypack.dev/@strudel.cycles/core@latest');
const controls = await import('https://cdn.skypack.dev/@strudel.cycles/core@latest/controls.mjs');
const { getAudioContext, Scheduler } = await import('https://cdn.skypack.dev/@strudel.cycles/webaudio@latest');
let scheduler;
const audioContext = getAudioContext();
const latency = 0.2;
Object.assign(window, strudel);
Object.assign(window, controls.default);
scheduler = new Scheduler({
audioContext,
interval: 0.1,
latency,
onEvent: (hap) => {
if (!hap.context.onTrigger) {
console.warn('no output chosen. use one of .out() .webdirt() .osc()');
}
},
});
let started;
document.getElementById('start').addEventListener('click', async () => {
const code = document.getElementById('text').value;
const pattern = eval(code);
const events = pattern._firstCycleValues;
console.log(code, '->', events);
scheduler.setPattern(pattern);
if (!started) {
scheduler.start();
started = true;
}
});
</script>
+96
View File
@@ -0,0 +1,96 @@
<!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">
<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">
import { controls, repl, evalScope } from 'https://cdn.skypack.dev/@strudel.cycles/core@0.3.2';
import { mini } from 'https://cdn.skypack.dev/@strudel.cycles/mini@0.3.2';
import { transpiler } from 'https://cdn.skypack.dev/@strudel.cycles/transpiler@0.3.2';
import { getAudioContext, webaudioOutput } from 'https://cdn.skypack.dev/@strudel.cycles/webaudio@0.3.3';
const ctx = getAudioContext();
const input = document.getElementById('text');
input.innerHTML = getTune();
evalScope(
controls,
import('https://cdn.skypack.dev/@strudel.cycles/core@0.3.2'),
import('https://cdn.skypack.dev/@strudel.cycles/mini@0.3.2'),
import('https://cdn.skypack.dev/@strudel.cycles/tonal@0.3.3'),
import('https://cdn.skypack.dev/@strudel.cycles/webaudio@0.3.3'),
);
const { evaluate } = repl({
defaultOutput: webaudioOutput,
getTime: () => ctx.currentTime,
transpiler,
});
document.getElementById('start').addEventListener('click', () => {
ctx.resume();
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 @@
!dist
@@ -0,0 +1,10 @@
# 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
```
or view it [live on githack](https://rawcdn.githack.com/tidalcycles/strudel/5fb36acb046ead7cd6ad3cd10f532e7f585f536a/packages/core/examples/vite-vanilla-repl/dist/index.html)
@@ -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,29 @@
import { controls, repl, evalScope, setStringParser } from '@strudel.cycles/core';
import { mini } from '@strudel.cycles/mini';
import { getAudioContext, webaudioOutput } 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;
evalScope(
controls,
import('@strudel.cycles/core'),
import('@strudel.cycles/mini'),
import('@strudel.cycles/webaudio'),
import('@strudel.cycles/tonal'),
);
setStringParser(mini);
const { evaluate } = repl({
defaultOutput: webaudioOutput,
getTime: () => ctx.currentTime,
// transpiler,
});
document.getElementById('start').addEventListener('click', () => {
ctx.resume();
evaluate(input.value);
});
+885
View File
@@ -0,0 +1,885 @@
{
"name": "vite-vanilla-repl",
"version": "0.0.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "vite-vanilla-repl",
"version": "0.0.0",
"devDependencies": {
"vite": "^3.2.0"
}
},
"node_modules/@esbuild/android-arm": {
"version": "0.15.13",
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.15.13.tgz",
"integrity": "sha512-RY2fVI8O0iFUNvZirXaQ1vMvK0xhCcl0gqRj74Z6yEiO1zAUa7hbsdwZM1kzqbxHK7LFyMizipfXT3JME+12Hw==",
"cpu": [
"arm"
],
"dev": true,
"optional": true,
"os": [
"android"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/linux-loong64": {
"version": "0.15.13",
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.15.13.tgz",
"integrity": "sha512-+BoyIm4I8uJmH/QDIH0fu7MG0AEx9OXEDXnqptXCwKOlOqZiS4iraH1Nr7/ObLMokW3sOCeBNyD68ATcV9b9Ag==",
"cpu": [
"loong64"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild": {
"version": "0.15.13",
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.15.13.tgz",
"integrity": "sha512-Cu3SC84oyzzhrK/YyN4iEVy2jZu5t2fz66HEOShHURcjSkOSAVL8C/gfUT+lDJxkVHpg8GZ10DD0rMHRPqMFaQ==",
"dev": true,
"hasInstallScript": true,
"bin": {
"esbuild": "bin/esbuild"
},
"engines": {
"node": ">=12"
},
"optionalDependencies": {
"@esbuild/android-arm": "0.15.13",
"@esbuild/linux-loong64": "0.15.13",
"esbuild-android-64": "0.15.13",
"esbuild-android-arm64": "0.15.13",
"esbuild-darwin-64": "0.15.13",
"esbuild-darwin-arm64": "0.15.13",
"esbuild-freebsd-64": "0.15.13",
"esbuild-freebsd-arm64": "0.15.13",
"esbuild-linux-32": "0.15.13",
"esbuild-linux-64": "0.15.13",
"esbuild-linux-arm": "0.15.13",
"esbuild-linux-arm64": "0.15.13",
"esbuild-linux-mips64le": "0.15.13",
"esbuild-linux-ppc64le": "0.15.13",
"esbuild-linux-riscv64": "0.15.13",
"esbuild-linux-s390x": "0.15.13",
"esbuild-netbsd-64": "0.15.13",
"esbuild-openbsd-64": "0.15.13",
"esbuild-sunos-64": "0.15.13",
"esbuild-windows-32": "0.15.13",
"esbuild-windows-64": "0.15.13",
"esbuild-windows-arm64": "0.15.13"
}
},
"node_modules/esbuild-android-64": {
"version": "0.15.13",
"resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.15.13.tgz",
"integrity": "sha512-yRorukXBlokwTip+Sy4MYskLhJsO0Kn0/Fj43s1krVblfwP+hMD37a4Wmg139GEsMLl+vh8WXp2mq/cTA9J97g==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"android"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-android-arm64": {
"version": "0.15.13",
"resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.15.13.tgz",
"integrity": "sha512-TKzyymLD6PiVeyYa4c5wdPw87BeAiTXNtK6amWUcXZxkV51gOk5u5qzmDaYSwiWeecSNHamFsaFjLoi32QR5/w==",
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"android"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-darwin-64": {
"version": "0.15.13",
"resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.15.13.tgz",
"integrity": "sha512-WAx7c2DaOS6CrRcoYCgXgkXDliLnFv3pQLV6GeW1YcGEZq2Gnl8s9Pg7ahValZkpOa0iE/ojRVQ87sbUhF1Cbg==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-darwin-arm64": {
"version": "0.15.13",
"resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.15.13.tgz",
"integrity": "sha512-U6jFsPfSSxC3V1CLiQqwvDuj3GGrtQNB3P3nNC3+q99EKf94UGpsG9l4CQ83zBs1NHrk1rtCSYT0+KfK5LsD8A==",
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-freebsd-64": {
"version": "0.15.13",
"resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.15.13.tgz",
"integrity": "sha512-whItJgDiOXaDG/idy75qqevIpZjnReZkMGCgQaBWZuKHoElDJC1rh7MpoUgupMcdfOd+PgdEwNQW9DAE6i8wyA==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"freebsd"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-freebsd-arm64": {
"version": "0.15.13",
"resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.15.13.tgz",
"integrity": "sha512-6pCSWt8mLUbPtygv7cufV0sZLeylaMwS5Fznj6Rsx9G2AJJsAjQ9ifA+0rQEIg7DwJmi9it+WjzNTEAzzdoM3Q==",
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"freebsd"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-linux-32": {
"version": "0.15.13",
"resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.15.13.tgz",
"integrity": "sha512-VbZdWOEdrJiYApm2kkxoTOgsoCO1krBZ3quHdYk3g3ivWaMwNIVPIfEE0f0XQQ0u5pJtBsnk2/7OPiCFIPOe/w==",
"cpu": [
"ia32"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-linux-64": {
"version": "0.15.13",
"resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.15.13.tgz",
"integrity": "sha512-rXmnArVNio6yANSqDQlIO4WiP+Cv7+9EuAHNnag7rByAqFVuRusLbGi2697A5dFPNXoO//IiogVwi3AdcfPC6A==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-linux-arm": {
"version": "0.15.13",
"resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.15.13.tgz",
"integrity": "sha512-Ac6LpfmJO8WhCMQmO253xX2IU2B3wPDbl4IvR0hnqcPrdfCaUa2j/lLMGTjmQ4W5JsJIdHEdW12dG8lFS0MbxQ==",
"cpu": [
"arm"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-linux-arm64": {
"version": "0.15.13",
"resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.15.13.tgz",
"integrity": "sha512-alEMGU4Z+d17U7KQQw2IV8tQycO6T+rOrgW8OS22Ua25x6kHxoG6Ngry6Aq6uranC+pNWNMB6aHFPh7aTQdORQ==",
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-linux-mips64le": {
"version": "0.15.13",
"resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.15.13.tgz",
"integrity": "sha512-47PgmyYEu+yN5rD/MbwS6DxP2FSGPo4Uxg5LwIdxTiyGC2XKwHhHyW7YYEDlSuXLQXEdTO7mYe8zQ74czP7W8A==",
"cpu": [
"mips64el"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-linux-ppc64le": {
"version": "0.15.13",
"resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.15.13.tgz",
"integrity": "sha512-z6n28h2+PC1Ayle9DjKoBRcx/4cxHoOa2e689e2aDJSaKug3jXcQw7mM+GLg+9ydYoNzj8QxNL8ihOv/OnezhA==",
"cpu": [
"ppc64"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-linux-riscv64": {
"version": "0.15.13",
"resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.15.13.tgz",
"integrity": "sha512-+Lu4zuuXuQhgLUGyZloWCqTslcCAjMZH1k3Xc9MSEJEpEFdpsSU0sRDXAnk18FKOfEjhu4YMGaykx9xjtpA6ow==",
"cpu": [
"riscv64"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-linux-s390x": {
"version": "0.15.13",
"resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.15.13.tgz",
"integrity": "sha512-BMeXRljruf7J0TMxD5CIXS65y7puiZkAh+s4XFV9qy16SxOuMhxhVIXYLnbdfLrsYGFzx7U9mcdpFWkkvy/Uag==",
"cpu": [
"s390x"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-netbsd-64": {
"version": "0.15.13",
"resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.15.13.tgz",
"integrity": "sha512-EHj9QZOTel581JPj7UO3xYbltFTYnHy+SIqJVq6yd3KkCrsHRbapiPb0Lx3EOOtybBEE9EyqbmfW1NlSDsSzvQ==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"netbsd"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-openbsd-64": {
"version": "0.15.13",
"resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.15.13.tgz",
"integrity": "sha512-nkuDlIjF/sfUhfx8SKq0+U+Fgx5K9JcPq1mUodnxI0x4kBdCv46rOGWbuJ6eof2n3wdoCLccOoJAbg9ba/bT2w==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"openbsd"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-sunos-64": {
"version": "0.15.13",
"resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.15.13.tgz",
"integrity": "sha512-jVeu2GfxZQ++6lRdY43CS0Tm/r4WuQQ0Pdsrxbw+aOrHQPHV0+LNOLnvbN28M7BSUGnJnHkHm2HozGgNGyeIRw==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"sunos"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-windows-32": {
"version": "0.15.13",
"resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.15.13.tgz",
"integrity": "sha512-XoF2iBf0wnqo16SDq+aDGi/+QbaLFpkiRarPVssMh9KYbFNCqPLlGAWwDvxEVz+ywX6Si37J2AKm+AXq1kC0JA==",
"cpu": [
"ia32"
],
"dev": true,
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-windows-64": {
"version": "0.15.13",
"resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.15.13.tgz",
"integrity": "sha512-Et6htEfGycjDrtqb2ng6nT+baesZPYQIW+HUEHK4D1ncggNrDNk3yoboYQ5KtiVrw/JaDMNttz8rrPubV/fvPQ==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-windows-arm64": {
"version": "0.15.13",
"resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.15.13.tgz",
"integrity": "sha512-3bv7tqntThQC9SWLRouMDmZnlOukBhOCTlkzNqzGCmrkCJI7io5LLjwJBOVY6kOUlIvdxbooNZwjtBvj+7uuVg==",
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">=12"
}
},
"node_modules/fsevents": {
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
"integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
"dev": true,
"hasInstallScript": true,
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
}
},
"node_modules/function-bind": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==",
"dev": true
},
"node_modules/has": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
"integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
"dev": true,
"dependencies": {
"function-bind": "^1.1.1"
},
"engines": {
"node": ">= 0.4.0"
}
},
"node_modules/is-core-module": {
"version": "2.11.0",
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz",
"integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==",
"dev": true,
"dependencies": {
"has": "^1.0.3"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/nanoid": {
"version": "3.3.4",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz",
"integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==",
"dev": true,
"bin": {
"nanoid": "bin/nanoid.cjs"
},
"engines": {
"node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
}
},
"node_modules/path-parse": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
"integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
"dev": true
},
"node_modules/picocolors": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz",
"integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==",
"dev": true
},
"node_modules/postcss": {
"version": "8.4.18",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.18.tgz",
"integrity": "sha512-Wi8mWhncLJm11GATDaQKobXSNEYGUHeQLiQqDFG1qQ5UTDPTEvKw0Xt5NsTpktGTwLps3ByrWsBrG0rB8YQ9oA==",
"dev": true,
"funding": [
{
"type": "opencollective",
"url": "https://opencollective.com/postcss/"
},
{
"type": "tidelift",
"url": "https://tidelift.com/funding/github/npm/postcss"
}
],
"dependencies": {
"nanoid": "^3.3.4",
"picocolors": "^1.0.0",
"source-map-js": "^1.0.2"
},
"engines": {
"node": "^10 || ^12 || >=14"
}
},
"node_modules/resolve": {
"version": "1.22.1",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz",
"integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==",
"dev": true,
"dependencies": {
"is-core-module": "^2.9.0",
"path-parse": "^1.0.7",
"supports-preserve-symlinks-flag": "^1.0.0"
},
"bin": {
"resolve": "bin/resolve"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/rollup": {
"version": "2.79.1",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.79.1.tgz",
"integrity": "sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw==",
"dev": true,
"bin": {
"rollup": "dist/bin/rollup"
},
"engines": {
"node": ">=10.0.0"
},
"optionalDependencies": {
"fsevents": "~2.3.2"
}
},
"node_modules/source-map-js": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz",
"integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==",
"dev": true,
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/supports-preserve-symlinks-flag": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz",
"integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==",
"dev": true,
"engines": {
"node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/vite": {
"version": "3.2.2",
"resolved": "https://registry.npmjs.org/vite/-/vite-3.2.2.tgz",
"integrity": "sha512-pLrhatFFOWO9kS19bQ658CnRYzv0WLbsPih6R+iFeEEhDOuYgYCX2rztUViMz/uy/V8cLCJvLFeiOK7RJEzHcw==",
"dev": true,
"dependencies": {
"esbuild": "^0.15.9",
"postcss": "^8.4.18",
"resolve": "^1.22.1",
"rollup": "^2.79.1"
},
"bin": {
"vite": "bin/vite.js"
},
"engines": {
"node": "^14.18.0 || >=16.0.0"
},
"optionalDependencies": {
"fsevents": "~2.3.2"
},
"peerDependencies": {
"less": "*",
"sass": "*",
"stylus": "*",
"sugarss": "*",
"terser": "^5.4.0"
},
"peerDependenciesMeta": {
"less": {
"optional": true
},
"sass": {
"optional": true
},
"stylus": {
"optional": true
},
"sugarss": {
"optional": true
},
"terser": {
"optional": true
}
}
}
},
"dependencies": {
"@esbuild/android-arm": {
"version": "0.15.13",
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.15.13.tgz",
"integrity": "sha512-RY2fVI8O0iFUNvZirXaQ1vMvK0xhCcl0gqRj74Z6yEiO1zAUa7hbsdwZM1kzqbxHK7LFyMizipfXT3JME+12Hw==",
"dev": true,
"optional": true
},
"@esbuild/linux-loong64": {
"version": "0.15.13",
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.15.13.tgz",
"integrity": "sha512-+BoyIm4I8uJmH/QDIH0fu7MG0AEx9OXEDXnqptXCwKOlOqZiS4iraH1Nr7/ObLMokW3sOCeBNyD68ATcV9b9Ag==",
"dev": true,
"optional": true
},
"esbuild": {
"version": "0.15.13",
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.15.13.tgz",
"integrity": "sha512-Cu3SC84oyzzhrK/YyN4iEVy2jZu5t2fz66HEOShHURcjSkOSAVL8C/gfUT+lDJxkVHpg8GZ10DD0rMHRPqMFaQ==",
"dev": true,
"requires": {
"@esbuild/android-arm": "0.15.13",
"@esbuild/linux-loong64": "0.15.13",
"esbuild-android-64": "0.15.13",
"esbuild-android-arm64": "0.15.13",
"esbuild-darwin-64": "0.15.13",
"esbuild-darwin-arm64": "0.15.13",
"esbuild-freebsd-64": "0.15.13",
"esbuild-freebsd-arm64": "0.15.13",
"esbuild-linux-32": "0.15.13",
"esbuild-linux-64": "0.15.13",
"esbuild-linux-arm": "0.15.13",
"esbuild-linux-arm64": "0.15.13",
"esbuild-linux-mips64le": "0.15.13",
"esbuild-linux-ppc64le": "0.15.13",
"esbuild-linux-riscv64": "0.15.13",
"esbuild-linux-s390x": "0.15.13",
"esbuild-netbsd-64": "0.15.13",
"esbuild-openbsd-64": "0.15.13",
"esbuild-sunos-64": "0.15.13",
"esbuild-windows-32": "0.15.13",
"esbuild-windows-64": "0.15.13",
"esbuild-windows-arm64": "0.15.13"
}
},
"esbuild-android-64": {
"version": "0.15.13",
"resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.15.13.tgz",
"integrity": "sha512-yRorukXBlokwTip+Sy4MYskLhJsO0Kn0/Fj43s1krVblfwP+hMD37a4Wmg139GEsMLl+vh8WXp2mq/cTA9J97g==",
"dev": true,
"optional": true
},
"esbuild-android-arm64": {
"version": "0.15.13",
"resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.15.13.tgz",
"integrity": "sha512-TKzyymLD6PiVeyYa4c5wdPw87BeAiTXNtK6amWUcXZxkV51gOk5u5qzmDaYSwiWeecSNHamFsaFjLoi32QR5/w==",
"dev": true,
"optional": true
},
"esbuild-darwin-64": {
"version": "0.15.13",
"resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.15.13.tgz",
"integrity": "sha512-WAx7c2DaOS6CrRcoYCgXgkXDliLnFv3pQLV6GeW1YcGEZq2Gnl8s9Pg7ahValZkpOa0iE/ojRVQ87sbUhF1Cbg==",
"dev": true,
"optional": true
},
"esbuild-darwin-arm64": {
"version": "0.15.13",
"resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.15.13.tgz",
"integrity": "sha512-U6jFsPfSSxC3V1CLiQqwvDuj3GGrtQNB3P3nNC3+q99EKf94UGpsG9l4CQ83zBs1NHrk1rtCSYT0+KfK5LsD8A==",
"dev": true,
"optional": true
},
"esbuild-freebsd-64": {
"version": "0.15.13",
"resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.15.13.tgz",
"integrity": "sha512-whItJgDiOXaDG/idy75qqevIpZjnReZkMGCgQaBWZuKHoElDJC1rh7MpoUgupMcdfOd+PgdEwNQW9DAE6i8wyA==",
"dev": true,
"optional": true
},
"esbuild-freebsd-arm64": {
"version": "0.15.13",
"resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.15.13.tgz",
"integrity": "sha512-6pCSWt8mLUbPtygv7cufV0sZLeylaMwS5Fznj6Rsx9G2AJJsAjQ9ifA+0rQEIg7DwJmi9it+WjzNTEAzzdoM3Q==",
"dev": true,
"optional": true
},
"esbuild-linux-32": {
"version": "0.15.13",
"resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.15.13.tgz",
"integrity": "sha512-VbZdWOEdrJiYApm2kkxoTOgsoCO1krBZ3quHdYk3g3ivWaMwNIVPIfEE0f0XQQ0u5pJtBsnk2/7OPiCFIPOe/w==",
"dev": true,
"optional": true
},
"esbuild-linux-64": {
"version": "0.15.13",
"resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.15.13.tgz",
"integrity": "sha512-rXmnArVNio6yANSqDQlIO4WiP+Cv7+9EuAHNnag7rByAqFVuRusLbGi2697A5dFPNXoO//IiogVwi3AdcfPC6A==",
"dev": true,
"optional": true
},
"esbuild-linux-arm": {
"version": "0.15.13",
"resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.15.13.tgz",
"integrity": "sha512-Ac6LpfmJO8WhCMQmO253xX2IU2B3wPDbl4IvR0hnqcPrdfCaUa2j/lLMGTjmQ4W5JsJIdHEdW12dG8lFS0MbxQ==",
"dev": true,
"optional": true
},
"esbuild-linux-arm64": {
"version": "0.15.13",
"resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.15.13.tgz",
"integrity": "sha512-alEMGU4Z+d17U7KQQw2IV8tQycO6T+rOrgW8OS22Ua25x6kHxoG6Ngry6Aq6uranC+pNWNMB6aHFPh7aTQdORQ==",
"dev": true,
"optional": true
},
"esbuild-linux-mips64le": {
"version": "0.15.13",
"resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.15.13.tgz",
"integrity": "sha512-47PgmyYEu+yN5rD/MbwS6DxP2FSGPo4Uxg5LwIdxTiyGC2XKwHhHyW7YYEDlSuXLQXEdTO7mYe8zQ74czP7W8A==",
"dev": true,
"optional": true
},
"esbuild-linux-ppc64le": {
"version": "0.15.13",
"resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.15.13.tgz",
"integrity": "sha512-z6n28h2+PC1Ayle9DjKoBRcx/4cxHoOa2e689e2aDJSaKug3jXcQw7mM+GLg+9ydYoNzj8QxNL8ihOv/OnezhA==",
"dev": true,
"optional": true
},
"esbuild-linux-riscv64": {
"version": "0.15.13",
"resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.15.13.tgz",
"integrity": "sha512-+Lu4zuuXuQhgLUGyZloWCqTslcCAjMZH1k3Xc9MSEJEpEFdpsSU0sRDXAnk18FKOfEjhu4YMGaykx9xjtpA6ow==",
"dev": true,
"optional": true
},
"esbuild-linux-s390x": {
"version": "0.15.13",
"resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.15.13.tgz",
"integrity": "sha512-BMeXRljruf7J0TMxD5CIXS65y7puiZkAh+s4XFV9qy16SxOuMhxhVIXYLnbdfLrsYGFzx7U9mcdpFWkkvy/Uag==",
"dev": true,
"optional": true
},
"esbuild-netbsd-64": {
"version": "0.15.13",
"resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.15.13.tgz",
"integrity": "sha512-EHj9QZOTel581JPj7UO3xYbltFTYnHy+SIqJVq6yd3KkCrsHRbapiPb0Lx3EOOtybBEE9EyqbmfW1NlSDsSzvQ==",
"dev": true,
"optional": true
},
"esbuild-openbsd-64": {
"version": "0.15.13",
"resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.15.13.tgz",
"integrity": "sha512-nkuDlIjF/sfUhfx8SKq0+U+Fgx5K9JcPq1mUodnxI0x4kBdCv46rOGWbuJ6eof2n3wdoCLccOoJAbg9ba/bT2w==",
"dev": true,
"optional": true
},
"esbuild-sunos-64": {
"version": "0.15.13",
"resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.15.13.tgz",
"integrity": "sha512-jVeu2GfxZQ++6lRdY43CS0Tm/r4WuQQ0Pdsrxbw+aOrHQPHV0+LNOLnvbN28M7BSUGnJnHkHm2HozGgNGyeIRw==",
"dev": true,
"optional": true
},
"esbuild-windows-32": {
"version": "0.15.13",
"resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.15.13.tgz",
"integrity": "sha512-XoF2iBf0wnqo16SDq+aDGi/+QbaLFpkiRarPVssMh9KYbFNCqPLlGAWwDvxEVz+ywX6Si37J2AKm+AXq1kC0JA==",
"dev": true,
"optional": true
},
"esbuild-windows-64": {
"version": "0.15.13",
"resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.15.13.tgz",
"integrity": "sha512-Et6htEfGycjDrtqb2ng6nT+baesZPYQIW+HUEHK4D1ncggNrDNk3yoboYQ5KtiVrw/JaDMNttz8rrPubV/fvPQ==",
"dev": true,
"optional": true
},
"esbuild-windows-arm64": {
"version": "0.15.13",
"resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.15.13.tgz",
"integrity": "sha512-3bv7tqntThQC9SWLRouMDmZnlOukBhOCTlkzNqzGCmrkCJI7io5LLjwJBOVY6kOUlIvdxbooNZwjtBvj+7uuVg==",
"dev": true,
"optional": true
},
"fsevents": {
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
"integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
"dev": true,
"optional": true
},
"function-bind": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==",
"dev": true
},
"has": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
"integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
"dev": true,
"requires": {
"function-bind": "^1.1.1"
}
},
"is-core-module": {
"version": "2.11.0",
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz",
"integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==",
"dev": true,
"requires": {
"has": "^1.0.3"
}
},
"nanoid": {
"version": "3.3.4",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz",
"integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==",
"dev": true
},
"path-parse": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
"integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
"dev": true
},
"picocolors": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz",
"integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==",
"dev": true
},
"postcss": {
"version": "8.4.18",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.18.tgz",
"integrity": "sha512-Wi8mWhncLJm11GATDaQKobXSNEYGUHeQLiQqDFG1qQ5UTDPTEvKw0Xt5NsTpktGTwLps3ByrWsBrG0rB8YQ9oA==",
"dev": true,
"requires": {
"nanoid": "^3.3.4",
"picocolors": "^1.0.0",
"source-map-js": "^1.0.2"
}
},
"resolve": {
"version": "1.22.1",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz",
"integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==",
"dev": true,
"requires": {
"is-core-module": "^2.9.0",
"path-parse": "^1.0.7",
"supports-preserve-symlinks-flag": "^1.0.0"
}
},
"rollup": {
"version": "2.79.1",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.79.1.tgz",
"integrity": "sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw==",
"dev": true,
"requires": {
"fsevents": "~2.3.2"
}
},
"source-map-js": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz",
"integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==",
"dev": true
},
"supports-preserve-symlinks-flag": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz",
"integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==",
"dev": true
},
"vite": {
"version": "3.2.2",
"resolved": "https://registry.npmjs.org/vite/-/vite-3.2.2.tgz",
"integrity": "sha512-pLrhatFFOWO9kS19bQ658CnRYzv0WLbsPih6R+iFeEEhDOuYgYCX2rztUViMz/uy/V8cLCJvLFeiOK7RJEzHcw==",
"dev": true,
"requires": {
"esbuild": "^0.15.9",
"fsevents": "~2.3.2",
"postcss": "^8.4.18",
"resolve": "^1.22.1",
"rollup": "^2.79.1"
}
}
}
}
@@ -0,0 +1,15 @@
{
"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": "^3.2.0"
}
}
@@ -0,0 +1,39 @@
/* 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)>")`;
*/
export default `stack(
n("c3 [eb3,g3]")
.delay("<0 .5>")
.delaytime(".16 | .33")
.delayfeedback(".6 | .8")
).sometimes(x=>x.speed("-1"))`;
+65
View File
@@ -0,0 +1,65 @@
<!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">
<textarea
id="text"
style="font-size: 2em; border: 0; color: white; background: transparent; outline: none; padding: 20px"
spellcheck="false"
>
// LOADING</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">
import { controls, repl, evalScope } from 'https://cdn.skypack.dev/@strudel.cycles/core@0.4.1';
import { transpiler } from 'https://cdn.skypack.dev/@strudel.cycles/transpiler@0.4.1';
const modules = [
import('https://cdn.skypack.dev/@strudel.cycles/core@0.4.1'),
import('https://cdn.skypack.dev/@strudel.cycles/mini@0.4.1'),
];
const input = document.getElementById('text');
Promise.all(modules).then(() => {
input.innerHTML = `note("<c3 [d3 e3]>").cutoff(1000)`;
document.getElementById('start').addEventListener('click', () => {
evaluate(input.value);
});
});
evalScope(controls, ...modules);
const { evaluate } = repl({
defaultOutput: (hap, deadline, duration) => {
console.log(deadline, duration, hap.value);
},
getTime: () => Date.now() / 1000,
transpiler,
beforeEval: (code) => console.log('evaluate', code),
afterEval: (code) => {},
});
</script>
</body>
</html>
+15 -2
View File
@@ -1,3 +1,9 @@
/*
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 './timespan.mjs';
@@ -49,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;
};
@@ -67,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));
+51 -10
View File
@@ -1,3 +1,8 @@
/*
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 {
/*
@@ -9,7 +14,10 @@ export class Hap {
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 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) {
@@ -24,7 +32,7 @@ export class Hap {
}
get duration() {
return this.whole.end.sub(this.whole.begin).valueOf();
return this.whole.end.sub(this.whole.begin);
}
wholeOrPart() {
@@ -32,18 +40,18 @@ export class Hap {
}
withSpan(func) {
// Returns a new event with the function f applies to the event timespan.
// 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 event with the function f applies to the event value.
// 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 event contains the onset, i.e that
// 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);
}
@@ -71,10 +79,43 @@ export class Hap {
);
}
show() {
return (
'(' + (this.whole == undefined ? '~' : this.whole.show()) + ', ' + this.part.show() + ', ' + this.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) {
@@ -87,4 +128,4 @@ export class Hap {
}
}
export default Hap;
export default Hap;
+31 -3
View File
@@ -1,11 +1,39 @@
export * from './controls.mjs';
/*
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';
export {Fraction};
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 './value.mjs';
export * from './speak.mjs';
export * from './evaluate.mjs';
export * from './repl.mjs';
export * from './logger.mjs';
export * from './time.mjs';
export * from './draw.mjs';
export * from './pianoroll.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 CustomEvent !== 'undefined') {
document.dispatchEvent(
new CustomEvent(logKey, {
detail: {
message,
type,
data,
},
}),
);
}
}
logger.key = logKey;
+3 -3
View File
@@ -1,13 +1,13 @@
{
"name": "@strudel.cycles/core",
"version": "0.0.5",
"version": "0.5.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@strudel.cycles/core",
"version": "0.0.3",
"license": "GPL-3.0-or-later",
"version": "0.1.0",
"license": "AGPL-3.0-or-later",
"dependencies": {
"bjork": "^0.0.1",
"fraction.js": "^4.2.0"
+3 -6
View File
@@ -1,11 +1,11 @@
{
"name": "@strudel.cycles/core",
"version": "0.0.5",
"version": "0.5.0",
"description": "Port of Tidal Cycles to JavaScript",
"main": "index.mjs",
"type": "module",
"scripts": {
"test": "mocha --colors"
"test": "vitest run"
},
"repository": {
"type": "git",
@@ -19,7 +19,7 @@
"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"
},
@@ -28,8 +28,5 @@
"bjork": "^0.0.1",
"fraction.js": "^4.2.0"
},
"devDependencies": {
"mocha": "^9.2.2"
},
"gitHead": "0e26d4e741500f5bae35b023608f062a794905c2"
}
+1617 -752
View File
File diff suppressed because it is too large Load Diff
+147
View File
@@ -0,0 +1,147 @@
/*
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, toMidi, getDrawContext } from './index.mjs';
const scale = (normalized, min, max) => normalized * (max - min) + min;
const getValue = (e) => {
let value = typeof e.value === 'object' ? e.value.note ?? e.value.n : e.value;
if (typeof value === 'string') {
value = toMidi(value);
}
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,
} = {}) {
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;
}
if (!autorange && fold) {
console.warn('disabling autorange has no effect when fold is enabled');
}
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.whole.end >= t + from;
events.filter(inFrame).forEach((event) => {
const isActive = event.whole.begin <= t && event.whole.end > t;
ctx.fillStyle = event.context?.color || inactive;
ctx.strokeStyle = event.context?.color || active;
ctx.globalAlpha = event.context.velocity ?? 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);
});
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) => a - b);
barThickness = fold ? valueAxis / foldValues.length : valueAxis / valueExtent;
},
},
);
return this;
};
+59
View File
@@ -0,0 +1,59 @@
import { Cyclist } from './cyclist.mjs';
import { evaluate as _evaluate } from './evaluate.mjs';
import { logger } from './logger.mjs';
import { setTime } from './time.mjs';
export function repl({
interval,
defaultOutput,
onSchedulerError,
onEvalError,
beforeEval,
afterEval,
getTime,
transpiler,
onToggle,
}) {
const scheduler = new Cyclist({
interval,
onTrigger: async (hap, deadline, duration) => {
try {
if (!hap.context.onTrigger || !hap.context.dominantTrigger) {
await defaultOutput(hap, deadline, duration);
}
if (hap.context.onTrigger) {
const cps = 1;
// call signature of output / onTrigger is different...
await hap.context.onTrigger(getTime() + deadline, hap, getTime(), cps);
}
} catch (err) {
logger(`[cyclist] error: ${err.message}`, 'error');
}
},
onError: onSchedulerError,
getTime,
onToggle,
});
setTime(() => scheduler.getPhase()); // TODO: refactor?
const evaluate = async (code, autostart = true) => {
if (!code) {
throw new Error('no code to evaluate');
}
try {
beforeEval?.({ code });
const { pattern } = await _evaluate(code, transpiler);
logger(`[eval] code updated`);
scheduler.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();
return { scheduler, evaluate, start, stop, pause };
}
+350 -84
View File
@@ -1,5 +1,11 @@
/*
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 } from './pattern.mjs';
import { Pattern, fastcat, reify, silence, stack, register } from './pattern.mjs';
import Fraction from './fraction.mjs';
import { id } from './util.mjs';
@@ -14,19 +20,63 @@ export const signal = (func) => {
};
export const isaw = signal((t) => 1 - (t % 1));
export const isaw2 = isaw._toBipolar();
export const isaw2 = isaw.toBipolar();
/**
* A sawtooth signal between 0 and 1.
*
* @return {Pattern}
* @example
* "c3 [eb3,g3] g2 [g3,bb3]".legato(saw.slow(4)).note()
* @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 saw2 = saw.toBipolar();
export const sine2 = signal((t) => Math.sin(Math.PI * 2 * t));
export const sine = sine2._fromBipolar();
/**
* 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();
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);
@@ -60,25 +110,112 @@ const timeToRandsPrime = (seed, n) => {
const timeToRands = (t, n) => timeToRandsPrime(timeToIntSeed(t), 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) => {
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)]).outerJoin();
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 = [];
@@ -88,19 +225,20 @@ const _wchooseWith = function (pat, ...pairs) {
weights.push(accum);
}
const total = accum;
const match = function(r) {
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()
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);
@@ -109,101 +247,229 @@ export const perlinWith = (pat) => {
return pat.sub(pata).fmap(interp).appBoth(pata.fmap(timeToRand)).appBoth(patb.fmap(timeToRand));
};
export const perlin = perlinWith(time);
/**
* 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)));
Pattern.prototype._degradeByWith = function (withPat, x) {
return this.fmap((a) => (_) => a).appLeft(withPat._filterValues((v) => v > x));
};
export const degradeByWith = register('degradeByWith', (withPat, x, pat) =>
pat.fmap((a) => (_) => a).appLeft(withPat.filterValues((v) => v > x)),
);
Pattern.prototype._degradeBy = function (x) {
return this._degradeByWith(rand, 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);
});
Pattern.prototype.degrade = function () {
return this._degradeBy(0.5);
};
/**
*
* 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));
Pattern.prototype._undegradeBy = function (x) {
return this._degradeByWith(
/**
* 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,
);
};
});
Pattern.prototype.undegrade = function () {
return this._undegradeBy(0.5);
};
export const undegrade = register('undegrade', (pat) => pat._undegradeBy(0.5));
Pattern.prototype._sometimesBy = function (x, func) {
return stack(this._degradeBy(x), func(this._undegradeBy(1 - x)));
};
/**
*
* 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"))
*/
Pattern.prototype.sometimesBy = function (patx, func) {
const pat = this;
export const sometimesBy = register('sometimesBy', function (patx, func, pat) {
return reify(patx)
.fmap((x) => pat._sometimesBy(x, func))
.fmap((x) => stack(pat._degradeBy(x), func(pat._undegradeBy(1 - x))))
.innerJoin();
};
});
Pattern.prototype._sometimesByPre = function (x, func) {
return stack(this._degradeBy(x), func(this).undegradeBy(1 - x));
};
/**
*
* 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);
});
Pattern.prototype.sometimesByPre = function (patx, func) {
const pat = this;
/**
*
* 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) => pat._sometimesByPre(x, func))
.fmap((x) =>
stack(
pat._degradeByWith(rand._segment(1), x),
func(pat._degradeByWith(rand.fmap((r) => 1 - r)._segment(1), 1 - x)),
),
)
.innerJoin();
};
});
Pattern.prototype.sometimes = function (func) {
return this._sometimesBy(0.5, func);
};
/**
*
* 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);
});
Pattern.prototype.sometimesPre = function (func) {
return this._sometimesByPre(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);
});
Pattern.prototype._someCyclesBy = function (x, func) {
return stack(
this._degradeByWith(rand._segment(1), x),
func(this._degradeByWith(rand.fmap((r) => 1 - r)._segment(1), 1 - x)),
);
};
/**
*
* 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);
});
Pattern.prototype.someCyclesBy = function (patx, func) {
const pat = this;
return reify(patx)
.fmap((x) => pat._someCyclesBy(x, func))
.innerJoin();
};
/**
*
* 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);
});
Pattern.prototype.someCycles = function (func) {
return this._someCyclesBy(0.5, 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);
});
Pattern.prototype.often = function (func) {
return this.sometimesBy(0.75, 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;
});
Pattern.prototype.rarely = function (func) {
return this.sometimesBy(0.25, func);
};
Pattern.prototype.almostNever = function (func) {
return this.sometimesBy(0.1, func);
};
Pattern.prototype.almostAlways = function (func) {
return this.sometimesBy(0.9, func);
};
Pattern.prototype.never = function (func) {
return this;
};
Pattern.prototype.always = function (func) {
return func(this);
};
Pattern.prototype.patternified.push('degradeBy', 'undegradeBy');
/**
*
* 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);
});
+19 -14
View File
@@ -1,10 +1,22 @@
import { Pattern, patternify2 } from './index.mjs';
/*
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?');
}
const synth = window?.speechSynthesis;
let allVoices = synth?.getVoices();
// console.log('voices', allVoices);
function speak(words, lang, voice) {
function triggerSpeech(words, lang, voice) {
synth.cancel();
const utterance = new SpeechSynthesisUtterance(words);
utterance.lang = lang;
@@ -19,15 +31,8 @@ function speak(words, lang, voice) {
speechSynthesis.speak(utterance);
}
Pattern.prototype._speak = function (lang, voice) {
return this._withEvent((event) => {
const onTrigger = (time, event) => {
speak(event.value, lang, voice);
};
return event.setContext({ ...event.context, onTrigger });
export const speak = register('speak', function (lang, voice, pat) {
return pat.onTrigger((_, hap) => {
triggerSpeech(hap.value, lang, voice);
});
};
Pattern.prototype.speak = function (lang, voice) {
return patternify2(Pattern.prototype._speak)(reify(lang), reify(voice), this);
};
});
+6
View File
@@ -1,3 +1,9 @@
/*
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;
+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
+179 -62
View File
@@ -1,114 +1,231 @@
import { strict as assert } from 'assert';
/*
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, toMidi, fromMidi, mod, compose, getFrequency } from '../util.mjs';
import {
isNote,
tokenizeNote,
toMidi,
fromMidi,
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 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('C')).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', () => {
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(toMidi('A4')).toEqual(69);
expect(toMidi('C4')).toEqual(60);
expect(toMidi('Db4')).toEqual(61);
expect(toMidi('C3')).toEqual(48);
expect(toMidi('Cb3')).toEqual(47);
expect(toMidi('Cbb3')).toEqual(46);
expect(toMidi('C#3')).toEqual(49);
expect(toMidi('C#3')).toEqual(49);
expect(toMidi('C##3')).toEqual(50);
});
it('should throw an error when given a non-note', () => {
expect(() => toMidi('Q')).toThrowError(`not a note: "Q"`);
expect(() => toMidi('Z')).toThrowError(`not a note: "Z"`);
});
});
describe('fromMidi', () => {
it('should turn midi into frequency', () => {
assert.equal(fromMidi(69), 440);
assert.equal(fromMidi(57), 220);
expect(fromMidi(69)).toEqual(440);
expect(fromMidi(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', () => {
const happify = (val, context = {}) => pure(val).firstCycle()[0].setContext(context);
assert.equal(getFrequency(happify('a4')), 440);
assert.equal(getFrequency(happify('a3')), 220);
assert.equal(getFrequency(happify(440, { type: 'frequency' })), 440); // TODO: migrate when values are objects..
assert.equal(getFrequency(happify(432, { type: 'frequency' })), 432);
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', () => {
assert.equal(compose(add1, add1)(0), 2);
assert.equal(compose(add1)(0), 1);
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', () => {
assert.equal(compose(addS('a'), addS('b'))(''), 'ab');
assert.equal(compose(addS('a'), addS('b'))('x'), 'xab');
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('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;
}
+18 -3
View File
@@ -1,3 +1,9 @@
/*
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 {
@@ -12,6 +18,11 @@ export class TimeSpan {
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)) {
@@ -28,12 +39,16 @@ export class TimeSpan {
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.end.sub(this.begin));
const e = b.add(this.duration);
return new TimeSpan(b, e);
}
@@ -87,7 +102,7 @@ export class TimeSpan {
}
midpoint() {
return this.begin.add(this.end.sub(this.begin).div(Fraction(2)));
return this.begin.add(this.duration.div(Fraction(2)));
}
equals(other) {
@@ -95,7 +110,7 @@ export class TimeSpan {
}
show() {
return this.begin.show() + ' -> ' + this.end.show();
return this.begin.show() + ' ' + this.end.show();
}
}
+10 -8
View File
@@ -1,16 +1,17 @@
import { Tone } from './tone.mjs';
/*
ui.mjs - <short description TODO>
Copyright (C) 2022 Strudel contributors - see <https://github.com/tidalcycles/strudel/blob/main/packages/tone/ui.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 const hideHeader = () => {
document.getElementById('header').style = 'display:none';
};
import { getTime } from './time.mjs';
function frame(callback) {
if (window.strudelAnimation) {
cancelAnimationFrame(window.strudelAnimation);
}
const animate = (animationTime) => {
const toneTime = Tone.getTransport().seconds;
callback(animationTime, toneTime);
callback(animationTime, getTime());
window.strudelAnimation = requestAnimationFrame(animate);
};
requestAnimationFrame(animate);
@@ -41,10 +42,11 @@ export const backgroundImage = function (src, animateOptions = {}) {
);
};
export const cleanup = () => {
export const cleanupUi = () => {
const container = document.getElementById('code');
if (container) {
container.style = '';
container.className = 'grow relative'; // has to match App.tsx
// TODO: find a way to remove that duplication..
container.className = 'grow flex text-gray-100 relative overflow-auto cursor-text pb-0'; // has to match App.tsx
}
};
+123 -20
View File
@@ -1,10 +1,16 @@
/*
util.mjs - <short description TODO>
Copyright (C) 2022 Strudel contributors - see <https://github.com/tidalcycles/strudel/blob/main/packages/core/util.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/>.
*/
// returns true if the given string is a note
export const isNote = (name) => /^[a-gA-G][#b]*[0-9]$/.test(name);
export const isNote = (name) => /^[a-gA-G][#bs]*[0-9]$/.test(name);
export const tokenizeNote = (note) => {
if (typeof note !== 'string') {
return [];
}
const [pc, acc = '', oct] = note.match(/^([a-gA-G])([#b]*)([0-9])?$/)?.slice(1) || [];
const [pc, acc = '', oct] = note.match(/^([a-gA-G])([#bs]*)([0-9])?$/)?.slice(1) || [];
if (!pc) {
return [];
}
@@ -18,40 +24,94 @@ export const toMidi = (note) => {
throw new Error('not a note: "' + note + '"');
}
const chroma = { c: 0, d: 2, e: 4, f: 5, g: 7, a: 9, b: 11 }[pc.toLowerCase()];
const offset = acc?.split('').reduce((o, char) => o + { '#': 1, b: -1 }[char], 0) || 0;
const offset = acc?.split('').reduce((o, char) => o + { '#': 1, b: -1, s: 1 }[char], 0) || 0;
return (Number(oct) + 1) * 12 + chroma + offset;
};
export const fromMidi = (n) => {
return Math.pow(2, (n - 69) / 12) * 440;
};
// modulo that works with negative numbers e.g. mod(-1, 3) = 2
// const mod = (n: number, m: number): number => (n < 0 ? mod(n + m, m) : n % m);
export const mod = (n, m) => (n < 0 ? mod(n + m, m) : n % m);
export const freqToMidi = (freq) => {
return (12 * Math.log(freq / 440)) / Math.LN2 + 69;
};
export const getPlayableNoteValue = (event) => {
let { value: note, context } = event;
export const valueToMidi = (value, fallbackValue) => {
if (typeof value !== 'object') {
throw new Error('valueToMidi: expected object value');
}
let { freq, note } = value;
if (typeof freq === 'number') {
return freqToMidi(freq);
}
if (typeof note === 'string') {
return toMidi(note);
}
if (typeof note === 'number') {
return note;
}
if (!fallbackValue) {
throw new Error('valueToMidi: expected freq or note to be set');
}
return fallbackValue;
};
/**
* @deprecated does not appear to be referenced or invoked anywhere in the codebase
*/
export const getFreq = (noteOrMidi) => {
if (typeof noteOrMidi === 'number') {
return fromMidi(noteOrMidi);
}
return fromMidi(toMidi(noteOrMidi));
};
/**
* @deprecated does not appear to be referenced or invoked anywhere in the codebase
*/
export const midi2note = (n) => {
const oct = Math.floor(n / 12) - 1;
const pc = ['C', 'Db', 'D', 'Eb', 'E', 'F', 'Gb', 'G', 'Ab', 'A', 'Bb', 'B'][n % 12];
return pc + oct;
};
// modulo that works with negative numbers e.g. _mod(-1, 3) = 2. Works on numbers (rather than patterns of numbers, as @mod@ from pattern.mjs does)
export const _mod = (n, m) => ((n % m) + m) % m;
export const getPlayableNoteValue = (hap) => {
let { value, context } = hap;
let note = value;
if (typeof note === 'object' && !Array.isArray(note)) {
note = note.note || note.n || note.value;
if (note === undefined) {
throw new Error(`cannot find a playable note for ${JSON.stringify(value)}`);
}
}
// if value is number => interpret as midi number as long as its not marked as frequency
if (typeof note === 'number' && context.type !== 'frequency') {
note = fromMidi(event.value);
} else if (typeof note === 'string' && !isNote(note)) {
throw new Error('not a note: ' + note);
note = fromMidi(hap.value);
} else if (typeof note === 'number' && context.type === 'frequency') {
note = hap.value; // legacy workaround.. will be removed in the future
} else if (typeof note !== 'string' || !isNote(note)) {
throw new Error('not a note: ' + JSON.stringify(note));
}
return note;
};
export const getFrequency = (event) => {
let { value, context } = event;
export const getFrequency = (hap) => {
let { value, context } = hap;
// if value is number => interpret as midi number as long as its not marked as frequency
if (typeof value === 'object' && value.freq) {
return value.freq;
if (typeof value === 'object') {
if (value.freq) {
return value.freq;
}
return getFreq(value.note || value.n || value.value);
}
if (typeof value === 'number' && context.type !== 'frequency') {
value = fromMidi(event.value);
value = fromMidi(hap.value);
} else if (typeof value === 'string' && isNote(value)) {
value = fromMidi(toMidi(event.value));
value = fromMidi(toMidi(hap.value));
} else if (typeof value !== 'number') {
throw new Error('not a note or frequency:' + value);
throw new Error('not a note or frequency: ' + value);
}
return value;
};
@@ -80,9 +140,9 @@ export const constant = (a, b) => a;
export const listRange = (min, max) => Array.from({ length: max - min + 1 }, (_, i) => i + min);
export function curry(func, overload) {
export function curry(func, overload, arity = func.length) {
const fn = function curried(...args) {
if (args.length >= func.length) {
if (args.length >= arity) {
return func.apply(this, args);
} else {
const partial = function (...args2) {
@@ -100,3 +160,46 @@ export function curry(func, overload) {
}
return fn;
}
export function parseNumeral(numOrString) {
const asNumber = Number(numOrString);
if (!isNaN(asNumber)) {
return asNumber;
}
if (isNote(numOrString)) {
return toMidi(numOrString);
}
throw new Error(`cannot parse as numeral: "${numOrString}"`);
}
export function mapArgs(fn, mapFn) {
return (...args) => fn(...args.map(mapFn));
}
export function numeralArgs(fn) {
return mapArgs(fn, parseNumeral);
}
export function parseFractional(numOrString) {
const asNumber = Number(numOrString);
if (!isNaN(asNumber)) {
return asNumber;
}
const specialValue = {
pi: Math.PI,
w: 1,
h: 0.5,
q: 0.25,
e: 0.125,
s: 0.0625,
t: 1 / 3,
f: 0.2,
x: 1 / 6,
}[numOrString];
if (typeof specialValue !== 'undefined') {
return specialValue;
}
throw new Error(`cannot parse as fractional: "${numOrString}"`);
}
export const fractionalArgs = (fn) => mapArgs(fn, parseFractional);
+14 -1
View File
@@ -1,6 +1,19 @@
/*
value.mjs - <short description TODO>
Copyright (C) 2022 Strudel contributors - see <https://github.com/tidalcycles/strudel/blob/main/packages/core/value.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 { curry } from './util.mjs';
function unionWithObj(a, b, func) {
export function unionWithObj(a, b, func) {
if (typeof b?.value === 'number') {
// https://github.com/tidalcycles/strudel/issues/262
const numKeys = Object.keys(a).filter((k) => typeof a[k] === 'number');
const numerals = Object.fromEntries(numKeys.map((k) => [k, b.value]));
b = Object.assign(b, numerals);
delete b.value;
}
const common = Object.keys(a).filter((k) => Object.keys(b).includes(k));
return Object.assign({}, a, b, Object.fromEntries(common.map((k) => [k, func(a[k], b[k])])));
}
+49
View File
@@ -0,0 +1,49 @@
// will move to https://github.com/felixroos/zyklus
// TODO: started flag
function createClock(
getTime,
callback, // called slightly before each cycle
duration = 0.05, // duration of each cycle
interval = 0.1, // interval between callbacks
overlap = 0.1, // overlap between callbacks
) {
let tick = 0; // counts callbacks
let phase = 0; // next callback time
let precision = 10 ** 4; // used to round phase
let minLatency = 0.01;
const setDuration = (setter) => (duration = setter(duration));
overlap = overlap || interval / 2;
const onTick = () => {
const t = getTime();
const lookahead = t + interval + overlap; // the time window for this tick
if (phase === 0) {
phase = t + minLatency;
}
// callback as long as we're inside the lookahead
while (phase < lookahead) {
phase = Math.round(phase * precision) / precision;
phase >= t && callback(phase, duration, tick);
phase < t && console.log('TOO LATE', phase); // what if latency is added from outside?
phase += duration; // increment phase by duration
tick++;
}
};
let intervalID;
const start = () => {
clear(); // just in case start was called more than once
onTick();
intervalID = setInterval(onTick, interval * 1000);
};
const clear = () => intervalID !== undefined && clearInterval(intervalID);
const pause = () => clear();
const stop = () => {
tick = 0;
phase = 0;
clear();
};
const getPhase = () => phase;
// setCallback
return { setDuration, start, stop, pause, duration, getPhase };
}
export default createClock;
+170
View File
@@ -0,0 +1,170 @@
import { getFrequency, logger, register } from '@strudel.cycles/core';
import { getAudioContext } from '@strudel.cycles/webaudio';
import csd from './project.csd?raw';
// import livecodeOrc from './livecode.orc?raw';
import presetsOrc from './presets.orc?raw';
let csoundLoader, _csound;
// initializes csound + can be used to reevaluate given instrument code
export async function loadCSound(code = '') {
await init();
if (code) {
code = `${code}`;
// ^ ^
// wrapping in backticks makes sure it works when calling as templated function
await _csound?.evalCode(code);
}
}
export const loadcsound = loadCSound;
export const loadCsound = loadCSound;
export const csound = register('csound', (instrument, pat) => {
instrument = instrument || 'triangle';
init(); // not async to support csound inside other patterns + to be able to call pattern methods after it
// TODO: find a alternative way to wait for csound to load (to wait with first time playback)
return pat.onTrigger((time, hap) => {
if (!_csound) {
logger('[csound] not loaded yet', 'warning');
return;
}
if (typeof hap.value !== 'object') {
throw new Error('csound only support objects as hap values');
}
let { gain = 0.8 } = hap.value;
gain *= 0.2;
const freq = Math.round(getFrequency(hap));
const controls = Object.entries({ ...hap.value, freq })
.flat()
.join('/');
// TODO: find out how to send a precise ctx based time
// http://www.csounds.com/manual/html/i.html
const params = [
`"${instrument}"`, // p1: instrument name
time - getAudioContext().currentTime, //.toFixed(precision), // p2: starting time in arbitrary unit called beats
hap.duration + 0, // p3: duration in beats
// instrument specific params:
freq, //.toFixed(precision), // p4: frequency
gain, // p5: gain
`"${controls}"`, // p6 controls as string (like superdirt osc message)
];
const msg = `i ${params.join(' ')}`;
_csound.inputMessage(msg);
});
});
function eventLogger(type, args) {
const [msg] = args;
if (
type === 'message' &&
(['[commit: HEAD]'].includes(msg) ||
msg.startsWith('--Csound version') ||
msg.startsWith('libsndfile') ||
msg.startsWith('sr =') ||
msg.startsWith('0dBFS') ||
msg.startsWith('audio buffered') ||
msg.startsWith('writing') ||
msg.startsWith('SECTION 1:'))
) {
// ignore
return;
}
let logType = 'info';
if (msg.startsWith('error:')) {
logType = 'error';
}
logger(`[csound] ${msg || ''}`, logType);
}
async function load() {
if (window.__csound__) {
// Allows using some other csound instance.
// In that case, the external Csound is responsible
// for compiling an orchestra and starting to perform.
logger('[load] Using external Csound', 'warning');
_csound = window.__csound__;
return _csound;
} else {
const { Csound } = await import('@csound/browser');
_csound = await Csound({ audioContext: getAudioContext() });
_csound.removeAllListeners('message');
['message'].forEach((k) => _csound.on(k, (...args) => eventLogger(k, args)));
await _csound.setOption('-m0d'); // see -m flag https://csound.com/docs/manual/CommandFlags.html
await _csound.setOption('--sample-accurate');
await _csound.compileCsdText(csd);
// await _csound.compileOrc(livecodeOrc);
await _csound.compileOrc(presetsOrc);
await _csound.start();
return _csound;
}
}
async function init() {
csoundLoader = csoundLoader || load();
return csoundLoader;
}
let orcCache = {};
export async function loadOrc(url) {
await init();
if (typeof url !== 'string') {
throw new Error('loadOrc: expected url string');
}
if (url.startsWith('github:')) {
const [_, path] = url.split('github:');
url = `https://raw.githubusercontent.com/${path}`;
}
if (!orcCache[url]) {
orcCache[url] = fetch(url)
.then((res) => res.text())
.then((code) => _csound.compileOrc(code));
}
await orcCache[url];
}
/**
* Sends notes to Csound for rendering with MIDI semantics. The hap value is
* translated to these Csound pfields:
*
* p1 -- Csound instrument either as a number (1-based, can be a fraction),
* or as a string name.
* p2 -- time in beats (usually seconds) from start of performance.
* p3 -- duration in beats (usually seconds).
* p4 -- MIDI key number (as a real number, not an integer but in [0, 127].
* p5 -- MIDI velocity (as a real number, not an integer but in [0, 127].
* p6 -- Strudel controls, as a string.
*/
export const csoundm = register('csoundm', (instrument, pat) => {
let p1 = instrument;
if (typeof instrument === 'string') {
p1 = `"{instrument}"`;
}
init(); // not async to support csound inside other patterns + to be able to call pattern methods after it
return pat.onTrigger((tidal_time, hap) => {
if (!_csound) {
logger('[csound] not loaded yet', 'warning');
return;
}
if (typeof hap.value !== 'object') {
throw new Error('csound only support objects as hap values');
}
// Time in seconds counting from now.
const p2 = tidal_time - getAudioContext().currentTime;
const p3 = hap.duration.valueOf() + 0;
const frequency = getFrequency(hap);
// Translate frequency to MIDI key number _without_ rounding.
const C4 = 261.62558;
let octave = Math.log(frequency / C4) / Math.log(2.0) + 8.0;
const p4 = octave * 12.0 - 36.0;
// We prefer floating point precision, but over the MIDI range [0, 127].
const p5 = 127 * (hap.context?.velocity ?? 0.9);
// The Strudel controls as a string.
const p6 = Object.entries({ ...hap.value, frequency })
.flat()
.join('/');
const i_statement = `i ${p1} ${p2} ${p3} ${p4} ${p5} "${p6}"`;
console.log('[csoundm]:', i_statement);
_csound.inputMessage(i_statement);
});
});
File diff suppressed because it is too large Load Diff
+32
View File
@@ -0,0 +1,32 @@
{
"name": "@strudel.cycles/csound",
"version": "0.5.1",
"description": "csound bindings for strudel",
"main": "csound.mjs",
"scripts": {
"test": "echo \"No tests present.\" && exit 0"
},
"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": {
"@csound/browser": "^6.18.3"
}
}
+96
View File
@@ -0,0 +1,96 @@
; returns value of given key in given "string map"
; keymap("freq", "note/c3/freq/220/gain/0.5")
; yields "220"
opcode keymap, S, SS
Skey, Smap xin
idelimiter = strindex(Smap, strcat(Skey, "/"))
ifrom = idelimiter + strlen(Skey) + 1
Svalue = strsub(Smap, ifrom, strlen(Smap))
Svalue = strsub(Svalue, 0, strindex(Svalue, "/"))
xout Svalue
endop
; TODO add incredibly dope synths
instr organ
iduration = p3
ifreq = p4
igain = p5
ioct = octcps(ifreq)
asig = vco2(igain, ifreq, 12, .5) ; my edit
kpwm = oscili(.1, 5)
asig = vco2(igain, ifreq, 4, .5 + kpwm)
asig += vco2(igain/4, ifreq * 2)
; filter
; idepth = 2
; acut = transegr:a(0, .005, 0, idepth, .06, -4.2, 0.001, .01, -4.2, 0) ; filter envelope
; asig = zdf_2pole(asig, cpsoct(ioct + acut), 0.5)
; amp envelope
iattack = .001
irelease = .05
asig *= linsegr:a(0, iattack, 1, iduration, 1, irelease, 0)
out(asig, asig)
endin
instr triangle
iduration = p3
ifreq = p4
igain = p5
ioct = octcps(ifreq)
asig = vco2(igain, ifreq, 12, .5)
; amp envelope
iattack = .001
irelease = .05
asig *= linsegr:a(0, iattack, 1, iduration, 1, irelease, 0)
out(asig, asig)
endin
instr pad
iduration = p3
ifreq = p4
igain = p5
ioct = octcps(ifreq)
asig = vco2(igain, ifreq, 0)
; amp envelope
iattack = .5
irelease = .1
asig *= linsegr:a(0, iattack, 1, iduration, 1, irelease, 0)
idepth = 2
acut = transegr:a(0, .005, 0, idepth, .06, -4.2, 0.001, .01, -4.2, 0)
asig = zdf_2pole(asig, 1000, 2)
out(asig, asig)
endin
gisine ftgen 0, 0, 4096, 10, 1
instr bow
kpres = 2
krat = 0.16
kvibf = 6.12723
kvib linseg 0, 0.5, 0, 1, 1, p3-0.5, 1
kvamp = kvib * 0.01
asig wgbow .7, p4, kpres, krat, kvibf, kvamp, gisine
asig = asig*p5
outs asig, asig
endin
instr Meta
Smap = strget(p6)
Sinstrument = keymap("s", Smap)
schedule(Sinstrument, 0, p3, p4, p5)
; TODO find a way to pipe Sinstrument through effects
endin
+10
View File
@@ -0,0 +1,10 @@
<CsoundSynthesizer>
<CsInstruments>
sr=48000
ksmps=64
nchnls=2
0dbfs=1
</CsInstruments>
</CsoundSynthesizer>
+33
View File
@@ -0,0 +1,33 @@
# @strudel.cycles/embed
This package contains a embeddable web component for the Strudel REPL.
## Usage
Either install with `npm i @strudel.cycles/embed` or just use a cdn to import the script:
```html
<script src="https://unpkg.com/@strudel.cycles/embed@latest"></script>
<strudel-repl>
<!--
note(`[[e5 [b4 c5] d5 [c5 b4]]
[a4 [a4 c5] e5 [d5 c5]]
[b4 [~ c5] d5 e5]
[c5 a4 a4 ~]
[[~ d5] [~ f5] a5 [g5 f5]]
[e5 [~ c5] e5 [d5 c5]]
[b4 [b4 c5] d5 e5]
[c5 a4 a4 ~]],
[[e2 e3]*4]
[[a2 a3]*4]
[[g#2 g#3]*2 [e2 e3]*2]
[a2 a3 a2 a3 a2 a3 b1 c2]
[[d2 d3]*4]
[[c2 c3]*4]
[[b1 b2]*2 [e2 e3]*2]
[[a1 a2]*4]`).slow(16)
-->
</strudel-repl>
```
Note that the Code is placed inside HTML comments to prevent the browser from treating it as HTML.
+18
View File
@@ -0,0 +1,18 @@
class Strudel extends HTMLElement {
constructor() {
super();
}
connectedCallback() {
setTimeout(() => {
const code = (this.innerHTML + '').replace('<!--', '').replace('-->', '').trim();
const iframe = document.createElement('iframe');
const src = `https://strudel.tidalcycles.org/#${encodeURIComponent(btoa(code))}`;
// const src = `http://localhost:3000/#${encodeURIComponent(btoa(code))}`;
iframe.setAttribute('src', src);
iframe.setAttribute('width', '600');
iframe.setAttribute('height', '400');
this.appendChild(iframe);
});
}
}
customElements.define('strudel-repl', Strudel);
+22
View File
@@ -0,0 +1,22 @@
<script src="https://unpkg.com/@strudel.cycles/embed@latest"></script>
<!-- <script src="./embed.js"></script> -->
<strudel-repl>
<!--
note(`[[e5 [b4 c5] d5 [c5 b4]]
[a4 [a4 c5] e5 [d5 c5]]
[b4 [~ c5] d5 e5]
[c5 a4 a4 ~]
[[~ d5] [~ f5] a5 [g5 f5]]
[e5 [~ c5] e5 [d5 c5]]
[b4 [b4 c5] d5 e5]
[c5 a4 a4 ~]],
[[e2 e3]*4]
[[a2 a3]*4]
[[g#2 g#3]*2 [e2 e3]*2]
[a2 a3 a2 a3 a2 a3 b1 c2]
[[d2 d3]*4]
[[c2 c3]*4]
[[b1 b2]*2 [e2 e3]*2]
[[a1 a2]*4]`).slow(16)
-->
</strudel-repl>
+24
View File
@@ -0,0 +1,24 @@
{
"name": "@strudel.cycles/embed",
"version": "0.2.0",
"description": "Embeddable Web Component to load a Strudel REPL into an iframe",
"main": "embed.js",
"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>",
"license": "AGPL-3.0-or-later",
"bugs": {
"url": "https://github.com/tidalcycles/strudel/issues"
},
"homepage": "https://github.com/tidalcycles/strudel#readme"
}
+6 -3
View File
@@ -12,10 +12,13 @@ npm i @strudel.cycles/eval --save
## Example
```js
import { evaluate, extend } from '@strudel.cycles/eval';
import * as strudel from '@strudel.cycles/core';
import { evalScope } from '@strudel.cycles/core';
import { evaluate } from '@strudel.cycles/eval';
extend(strudel); // add strudel to eval scope
evalScope(
import('@strudel.cycles/core'),
// import other strudel packages here
); // add strudel to eval scope
async function run(code) {
const { pattern } = await evaluate(code);
+8 -17
View File
@@ -1,21 +1,12 @@
/*
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 { evaluate as _evaluate } from '@strudel.cycles/core';
import shapeshifter from './shapeshifter.mjs';
import * as strudel from '@strudel.cycles/core';
const { isPattern } = strudel;
export const extend = (...args) => {
// TODO: find a way to make args available to eval without adding it to global scope...
// sadly, "with" does not work in strict mode
Object.assign(globalThis, ...args);
};
export const evaluate = async (code) => {
const shapeshifted = shapeshifter(code); // transform syntactically correct js code to semantically usable code
let evaluated = await eval(shapeshifted);
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 };
return _evaluate(code, shapeshifter);
};
+1
View File
@@ -0,0 +1 @@
export * from './evaluate.mjs';
+3 -3
View File
@@ -1,13 +1,13 @@
{
"name": "@strudel.cycles/eval",
"version": "0.0.5",
"version": "0.5.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@strudel.cycles/eval",
"version": "0.0.3",
"license": "GPL-3.0-or-later",
"version": "0.1.1",
"license": "AGPL-3.0-or-later",
"dependencies": {
"estraverse": "^5.3.0",
"shift-ast": "^6.1.0",
+10 -10
View File
@@ -1,19 +1,19 @@
{
"name": "@strudel.cycles/eval",
"version": "0.0.5",
"version": "0.5.0",
"description": "Code evaluator for strudel",
"main": "evaluate.mjs",
"main": "index.mjs",
"type": "module",
"directories": {
"test": "test"
},
"scripts": {
"test": "mocha --colors"
"test": "vitest run"
},
"repository": {
"type": "git",
"url": "git+https://github.com/tidalcycles/strudel.git"
},
"type": "module",
"keywords": [
"tidalcycles",
"strudel",
@@ -22,18 +22,18 @@
"algorave"
],
"author": "Felix Roos <flix91@gmail.com>",
"license": "GPL-3.0-or-later",
"license": "AGPL-3.0-or-later",
"bugs": {
"url": "https://github.com/tidalcycles/strudel/issues"
},
"homepage": "https://github.com/tidalcycles/strudel#readme",
"dependencies": {
"@strudel.cycles/core": "^0.0.5",
"@strudel.cycles/core": "^0.4.1",
"estraverse": "^5.3.0",
"shift-ast": "^6.1.0",
"shift-codegen": "^7.0.3",
"shift-parser": "^7.0.3",
"shift-spec": "^2018.0.2",
"shift-ast": "^7.0.0",
"shift-codegen": "^8.1.0",
"shift-parser": "^8.0.0",
"shift-spec": "^2019.0.0",
"shift-traverser": "^1.0.0"
}
}
+46 -15
View File
@@ -1,3 +1,9 @@
/*
shapeshifter.mjs - <short description TODO>
Copyright (C) 2022 Strudel contributors - see <https://github.com/tidalcycles/strudel/blob/main/packages/eval/shapeshifter.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 { parseScriptWithLocation } from './shift-parser/index.js'; // npm module does not work in the browser
import traverser from './shift-traverser/index.js'; // npm module does not work in the browser */
import { parseScriptWithLocation } from 'shift-parser';
@@ -23,10 +29,13 @@ const isNote = (name) => /^[a-gC-G][bs]?[0-9]$/.test(name);
const addLocations = true;
export const addMiniLocations = true;
export const minifyStrings = true;
export const wrappedAsync = false; // this is now handled by core evaluate by default
export const shouldAddReturn = true;
export default (_code) => {
const { code, addReturn } = wrapAsync(_code);
const ast = parseScriptWithLocation(code);
const ast = parseScriptWithLocation(disguiseImports(code));
const artificialNodes = [];
const parents = [];
const shifted = replace(ast.tree, {
@@ -38,18 +47,18 @@ export default (_code) => {
}
// replace template string `xxx` with mini(`xxx`)
if (isBackTickString(node)) {
if (minifyStrings && isBackTickString(node)) {
return minifyWithLocation(node, node, ast.locations, artificialNodes);
}
// allows to use top level strings, which are normally directives... but we don't need directives
if (node.directives?.length === 1 && !node.statements?.length) {
if (minifyStrings && node.directives?.length === 1 && !node.statements?.length) {
const str = new LiteralStringExpression({ value: node.directives[0].rawValue });
const wrapped = minifyWithLocation(str, node.directives[0], ast.locations, artificialNodes);
return { ...node, directives: [], statements: [wrapped] };
}
// replace double quote string "xxx" with mini('xxx')
if (isStringWithDoubleQuotes(node, ast.locations, code)) {
if (minifyStrings && isStringWithDoubleQuotes(node, ast.locations, code)) {
return minifyWithLocation(node, node, ast.locations, artificialNodes);
}
@@ -117,19 +126,35 @@ export default (_code) => {
},
});
// add return to last statement (because it's wrapped in an async function artificially)
addReturn(shifted);
const generated = codegen(shifted);
if (shouldAddReturn) {
addReturn(shifted);
}
const generated = undisguiseImports(codegen(shifted));
return generated;
};
// renames all import statements to "_mport" as Shift doesn't support dynamic import.
// there shouldn't be any side-effects from this as this change does not affect
// the syntax & will be undone by the equivalent replace in "undisguiseImports".
function disguiseImports(code) {
return code.replaceAll('import', '_mport'); // Must be the same length!
}
// Rename the renamed import statements back to "import"
function undisguiseImports(code) {
return code.replaceAll('_mport', 'import');
}
function wrapAsync(code) {
// wrap code in async to make await work on top level => this will create 1 line offset to locations
// this is why line offset is -1 in getLocationObject calls below
code = `(async () => {
if (wrappedAsync) {
code = `(async () => {
${code}
})()`;
}
const addReturn = (ast) => {
const body = ast.statements[0].expression.callee.body; // actual code ast inside async function body
const body = wrappedAsync ? ast.statements[0].expression.callee.body : ast;
body.statements = body.statements
.slice(0, -1)
.concat([new ReturnStatement({ expression: body.statements.slice(-1)[0] })]);
@@ -200,13 +225,13 @@ function isPatternArg(parents) {
function hasModifierCall(parent) {
// TODO: modifiers are more than composables, for example every is not composable but should be seen as modifier..
// need all prototypes of Pattern
return (
parent?.type === 'StaticMemberExpression' && Object.keys(Pattern.prototype.composable).includes(parent.property)
);
return parent?.type === 'StaticMemberExpression';
// && Object.keys(Pattern.prototype.composable).includes(parent.property)
}
const factories = Object.keys(Pattern.prototype.factories).concat(['mini']);
function isPatternFactory(node) {
return node?.type === 'CallExpression' && Object.keys(Pattern.prototype.factories).includes(node.callee.name);
return node?.type === 'CallExpression' && factories.includes(node.callee.name);
}
function canBeOverloaded(node) {
@@ -233,9 +258,14 @@ function reifyWithLocation(literalNode, node, locations, artificialNodes) {
// with this, the reified pattern can pass its location to the event, to know where to highlight when it's active
function minifyWithLocation(literalNode, node, locations, artificialNodes) {
const args = getLocationArguments(node, locations);
const wrapped = wrapFunction('mini', literalNode);
if (!addMiniLocations) {
artificialNodes.push(wrapped);
return wrapped;
}
const withLocation = new CallExpression({
callee: new StaticMemberExpression({
object: wrapFunction('mini', literalNode),
object: wrapped,
property: 'withMiniLocation',
}),
arguments: args,
@@ -246,17 +276,18 @@ function minifyWithLocation(literalNode, node, locations, artificialNodes) {
function getLocationArguments(node, locations) {
const loc = locations.get(node);
const lineOffset = wrappedAsync ? -1 : 0;
return [
new ArrayExpression({
elements: [
new LiteralNumericExpression({ value: loc.start.line - 1 }), // the minus 1 assumes the code has been wrapped in async iife
new LiteralNumericExpression({ value: loc.start.line + lineOffset }), // the minus 1 assumes the code has been wrapped in async iife
new LiteralNumericExpression({ value: loc.start.column }),
new LiteralNumericExpression({ value: loc.start.offset }),
],
}),
new ArrayExpression({
elements: [
new LiteralNumericExpression({ value: loc.end.line - 1 }), // the minus 1 assumes the code has been wrapped in async iife
new LiteralNumericExpression({ value: loc.end.line + lineOffset }), // the minus 1 assumes the code has been wrapped in async iife
new LiteralNumericExpression({ value: loc.end.column }),
new LiteralNumericExpression({ value: loc.end.offset }),
],
+6
View File
@@ -1,3 +1,9 @@
/*
index.js - <short description TODO>
Copyright (C) 2022 Strudel contributors - see <https://github.com/tidalcycles/strudel/blob/main/packages/eval/shift-traverser/index.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/>.
*/
/*
Copyright (C) 2014 Yusuke Suzuki <utatane.tea@gmail.com>

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