Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

latest changes #814

Closed
wants to merge 322 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
322 commits
Select commit Hold shift + click to select a range
4b64168
fix: imports
felixroos Oct 3, 2023
0471292
cache noise
felixroos Oct 3, 2023
376cf09
rename zzfx noise to znoise
felixroos Oct 3, 2023
9c9323e
snapshot
felixroos Oct 3, 2023
d1ffdd5
Merge pull request #713 from Bubobubobubobubo/noise
felixroos Oct 3, 2023
020e859
fix: slider crash on some platforms
felixroos Oct 4, 2023
767ba71
Merge pull request #723 from tidalcycles/slider-afterthoughts
felixroos Oct 4, 2023
a4386a6
Merge branch 'main' into reverb
felixroos Oct 4, 2023
508af7e
update internal reverb param names
felixroos Oct 4, 2023
ce842f7
simplify createReverb
felixroos Oct 4, 2023
3c4f835
consistent naming + simplify
felixroos Oct 4, 2023
75099ab
remove unused reverb method
felixroos Oct 4, 2023
0b888ac
Merge pull request #718 from Bubobubobubobubo/reverb
felixroos Oct 4, 2023
d6c8838
Integrate with the new impulse generation functionality
vasilymilovidov Oct 4, 2023
1d4eb59
fix: reverbGen.mjs
vasilymilovidov Oct 5, 2023
11b0a00
Merge branch 'main' into reverb
vasilymilovidov Oct 5, 2023
2f0798d
fix: formatting
vasilymilovidov Oct 5, 2023
4718bfa
fix: reverb regenerate loophole
felixroos Oct 6, 2023
e2569ed
Merge pull request #726 from tidalcycles/reverb-perf-pitfall
felixroos Oct 6, 2023
b297888
consume n with scale
felixroos Oct 7, 2023
296cd83
snapshot
felixroos Oct 7, 2023
daf965f
Merge pull request #727 from tidalcycles/fix-n-scale
felixroos Oct 7, 2023
b25b9d8
fix: conflicts
vasilymilovidov Oct 7, 2023
2d750a1
fix: conflicts
vasilymilovidov Oct 7, 2023
d24cf8e
Merge branch 'main' into reverb
vasilymilovidov Oct 7, 2023
130ad44
add compressor + postgain
felixroos Oct 7, 2023
444d583
fix: hashes in urls
felixroos Oct 8, 2023
3415465
Merge pull request #728 from tidalcycles/fix-sample-url-special-chars
felixroos Oct 8, 2023
0a3692e
compressor docs
felixroos Oct 8, 2023
08ce821
format
felixroos Oct 8, 2023
56c1441
snapshot
felixroos Oct 8, 2023
a4fc408
Merge pull request #729 from tidalcycles/compressor
felixroos Oct 8, 2023
f34937d
fix: roomsize not required
felixroos Oct 9, 2023
54ed415
Merge pull request #731 from tidalcycles/reverb-fix
felixroos Oct 9, 2023
6544e81
fix: reverb sampleRate
felixroos Oct 9, 2023
d3b96dd
Merge pull request #732 from tidalcycles/reverb-fix-sr
felixroos Oct 9, 2023
e59f06f
Merge branch 'main' into reverb
felixroos Oct 9, 2023
5c76f2b
bump superdough to 0.9.10
felixroos Oct 9, 2023
57b166d
fix: pitched sample as ir
felixroos Oct 9, 2023
a2ee70a
Merge pull request #717 from vasilymilovidov/reverb
felixroos Oct 9, 2023
d702825
vite-vanilla-repl readme fix
felixroos Oct 13, 2023
f751d97
Merge pull request #737 from tidalcycles/readme-fix
felixroos Oct 13, 2023
4fa0a90
Merge branch 'main' of https://github.com/tidalcycles/strudel
felixroos Oct 14, 2023
2898201
Add shabda shortcut (#406)
ilesinge Oct 14, 2023
1721209
Update samples/shabda documentation
ilesinge Oct 14, 2023
fed4c51
Prettier doc file
ilesinge Oct 14, 2023
6b5de5f
fixed
daslyfe Oct 17, 2023
d3edc62
document function
daslyfe Oct 18, 2023
912a661
fixed example test failure
daslyfe Oct 18, 2023
d9db526
add recipes
felixroos Oct 20, 2023
7b8a35a
add understand cycles
felixroos Oct 20, 2023
f51c01d
move stuff around
felixroos Oct 20, 2023
80c98b6
fix: loud example
felixroos Oct 20, 2023
2cc60c6
format
felixroos Oct 20, 2023
db6efec
Merge pull request #742 from tidalcycles/recipes
felixroos Oct 20, 2023
8699748
Merge pull request #741 from daslyfe/bugfix_choose_with
felixroos Oct 20, 2023
1b07244
Add test snapshots for shabda shortcut
ilesinge Oct 20, 2023
048502e
Merge branch 'main' into astro-3
felixroos Oct 20, 2023
a23765a
fix: trailing slash confusion
felixroos Oct 20, 2023
624e685
fix: trailing slash confusion
felixroos Oct 20, 2023
7e28de1
Merge pull request #743 from tidalcycles/fix-slash-confusion
felixroos Oct 20, 2023
8f4344f
fix: try different trailing slash behavior
felixroos Oct 20, 2023
a3e0189
Merge pull request #744 from tidalcycles/fix-slash-confusion
felixroos Oct 20, 2023
46cdbd5
completely revert config mess
felixroos Oct 20, 2023
e99c299
Merge pull request #745 from tidalcycles/fix-slash-confusion
felixroos Oct 20, 2023
072ae72
Fix krill build command in README
ilesinge Oct 21, 2023
cb8edd9
Support international alphabets in mininotation
ilesinge Oct 21, 2023
87f37e3
Add a human-readable error message for invalid char in step
ilesinge Oct 21, 2023
2ad6324
Merge pull request #748 from ilesinge/fix_krill_readme
felixroos Oct 21, 2023
9b9f031
Revert error message length limitation
ilesinge Oct 21, 2023
5430147
use new vite-pwa-astro version from file
felixroos Oct 22, 2023
0509580
Merge pull request #753 from tidalcycles/fix-trailing-slash-bug
felixroos Oct 22, 2023
7f3cded
basic hydra integration
felixroos Oct 26, 2023
9009ecc
add play function
felixroos Oct 26, 2023
19f1aad
Merge pull request #751 from ilesinge/alphabet_samples
felixroos Oct 26, 2023
535dfb5
Merge pull request #740 from ilesinge/shabda_shortcut
felixroos Oct 26, 2023
b14aa90
also return pat
felixroos Oct 26, 2023
5958c69
Merge pull request #758 from tidalcycles/play-function
felixroos Oct 26, 2023
1a45682
Merge branch 'main' into hydra-integration
felixroos Oct 26, 2023
0f7b3e9
add docs + fix hydra for mini repl
felixroos Oct 26, 2023
22c9829
add H function to plug patterns into Hydra
felixroos Oct 26, 2023
8754b02
document H function
felixroos Oct 26, 2023
3ce50d8
ignore hydra.mjs in linter
felixroos Oct 26, 2023
4761e25
Merge pull request #759 from tidalcycles/hydra-integration
felixroos Oct 26, 2023
9fc87fe
add px in zen mode to fix logo overlap
felixroos Oct 27, 2023
a57c2b9
fix: flip scope in y direction
felixroos Oct 27, 2023
c085694
fix: additive synthesis
felixroos Oct 27, 2023
1c7c823
Merge pull request #762 from tidalcycles/fix-addivite-synthesis-phases
felixroos Oct 27, 2023
d84c917
fix: scale offset
felixroos Oct 27, 2023
cdbfb2c
Merge pull request #764 from tidalcycles/fix-scale-offset2
felixroos Oct 27, 2023
248757a
Merge pull request #760 from tidalcycles/zen-fix
felixroos Oct 27, 2023
1e1d5ef
Document striate function
ilesinge Oct 28, 2023
6c23309
Merge pull request #766 from ilesinge/document_striate
felixroos Oct 28, 2023
2633f4f
Document adsr function
ilesinge Oct 28, 2023
af915be
replace strudel.tidalcycles.org with strudel.cc
felixroos Oct 28, 2023
f16cb8f
Merge pull request #768 from tidalcycles/strudel-cc
felixroos Oct 28, 2023
4a57d3a
functions
daslyfe Oct 31, 2023
fd6c713
move to signal file with other choose functions
daslyfe Oct 31, 2023
36ef03a
use 0.1.4 @vite-pwa/astro
felixroos Nov 1, 2023
41a9098
use new flag
felixroos Nov 1, 2023
2bb45af
Merge pull request #772 from tidalcycles/update-vite-pwa
felixroos Nov 1, 2023
9e649a1
snapshots
felixroos Nov 1, 2023
34bd0e1
add doc chapters
felixroos Nov 1, 2023
158fa85
Merge pull request #771 from daslyfe/add_pick_and_squeeze_functions
felixroos Nov 1, 2023
16bb920
Merge pull request #767 from ilesinge/document_adsr
felixroos Nov 1, 2023
d4c12dc
integrated vscode bindings
Dsm0 Nov 1, 2023
9ceab0f
Fix chunk, add fastChunk and repeatCycles (#712)
yaxu Nov 1, 2023
2fd4836
Merge branch 'main' into vscode-bindings
Dsm0 Nov 1, 2023
b141e1e
(hopefully) fixed broken lock file
Dsm0 Nov 1, 2023
1e5edfc
Update CONTRIBUTING.md
felixroos Nov 1, 2023
0c2838c
fixed style issues
Dsm0 Nov 1, 2023
8d3ba2a
fix: share copy to clipboard + alert
felixroos Nov 2, 2023
9ec5d33
Merge pull request #774 from tidalcycles/tauri-clipboard
felixroos Nov 2, 2023
638f5c7
rename bindings key
felixroos Nov 2, 2023
8d8a1f5
Merge pull request #773 from Dsm0/vscode-bindings
felixroos Nov 2, 2023
c25c269
Merge branch 'main' into astro-3
felixroos Nov 2, 2023
326571b
remove obsolete config
felixroos Nov 2, 2023
419cf6c
update to astro 3
felixroos Nov 2, 2023
7768654
no double !
felixroos Nov 2, 2023
0ecc6c1
Merge pull request #775 from tidalcycles/astro-3
felixroos Nov 2, 2023
b3f8df1
initial commit
daslyfe Nov 5, 2023
8c5837e
add xfade + docs
felixroos Nov 5, 2023
d775296
snapshot
felixroos Nov 5, 2023
ec611aa
Merge pull request #780 from tidalcycles/xfade
felixroos Nov 5, 2023
7ad0ec1
fix: namespace mini-repl styles
felixroos Nov 5, 2023
83fec57
Merge pull request #781 from tidalcycles/fix-styles
felixroos Nov 5, 2023
3533336
Implement optional hover tooltip with function documentation
ilesinge Nov 5, 2023
624e540
Add pianoroll function documentation
ilesinge Nov 5, 2023
0d06840
Add label function documentation
ilesinge Nov 5, 2023
f045fb4
Add color function documentation
ilesinge Nov 5, 2023
8fa7bf7
Fix pianoroll documentation
ilesinge Nov 5, 2023
e9265ef
Add function params in reference tab
ilesinge Nov 5, 2023
a05d3a4
Merge pull request #785 from ilesinge/reference_parameters
felixroos Nov 5, 2023
8fe4dca
Update pianoroll documentation
ilesinge Nov 5, 2023
a9efda3
tweaking to make it sound good
daslyfe Nov 5, 2023
62eb9ce
Merge pull request #783 from ilesinge/hover_tooltip
felixroos Nov 5, 2023
52e2b90
fix: scope pos
felixroos Nov 5, 2023
26d87b6
document scope functions
felixroos Nov 5, 2023
c4f26c3
snapshot
felixroos Nov 5, 2023
5807dbf
Merge pull request #786 from tidalcycles/fix-scope-flip
felixroos Nov 5, 2023
2ef35a8
samples loading shortcuts:
felixroos Nov 6, 2023
395ae4d
Merge pull request #788 from tidalcycles/github-shortcut
felixroos Nov 6, 2023
07da9a9
don't use anchor links for reference
felixroos Nov 6, 2023
682ac25
Merge pull request #791 from tidalcycles/fix-ref-anchors
felixroos Nov 6, 2023
9cbf307
change to bus effect experiment
daslyfe Nov 7, 2023
b88f58c
Update first-sounds.mdx
bwagner Nov 7, 2023
bd59533
Merge pull request #794 from bwagner/patch-1
felixroos Nov 7, 2023
eed2c30
Update first-effects.mdx
bwagner Nov 7, 2023
df277d6
Update pattern-effects.mdx
bwagner Nov 7, 2023
23dd9d4
Update recap.mdx
bwagner Nov 7, 2023
4a16cd8
FIXES: table
bwagner Nov 7, 2023
0edd54d
cleaning up
daslyfe Nov 8, 2023
bee36a7
cleaning up
daslyfe Nov 8, 2023
f0a582d
cleaning up
daslyfe Nov 8, 2023
51c63fa
turn off of depth is 0
daslyfe Nov 8, 2023
2e4d28b
update doc
daslyfe Nov 8, 2023
65d07db
create free running lfos for different orbits
daslyfe Nov 8, 2023
c89f912
Merge branch 'tidalcycles:main' into phaser
daslyfe Nov 8, 2023
4b4290e
add more parameters
daslyfe Nov 8, 2023
06eb8b5
fixed doc
daslyfe Nov 8, 2023
791a363
snapshots
felixroos Nov 8, 2023
df636cf
phaser shortcuts
felixroos Nov 9, 2023
ac359a0
doc: phaser synonyms
felixroos Nov 9, 2023
3ecb701
add params to superdough readme
felixroos Nov 9, 2023
2682fd3
add to doc page
felixroos Nov 9, 2023
858a026
dedupe / move supertdirt phaser controls
felixroos Nov 9, 2023
c028686
Merge pull request #797 from bwagner/patch-4
felixroos Nov 9, 2023
d2a0665
Merge pull request #796 from bwagner/patch-3
felixroos Nov 9, 2023
035f6c8
Merge pull request #795 from bwagner/patch-2
felixroos Nov 9, 2023
9dbd073
Merge pull request #784 from ilesinge/document_pianoroll
felixroos Nov 9, 2023
5aac042
Merge branch 'main' into global-vibrato
felixroos Nov 9, 2023
8583508
format
felixroos Nov 9, 2023
7c8a8b8
simplify
felixroos Nov 9, 2023
0052d34
refactor: move vibrato up + cleanup oscillator
felixroos Nov 9, 2023
2a09f9e
fix: sampler broke without vibrato
felixroos Nov 9, 2023
400b210
Merge pull request #706 from Bubobubobubobubo/global-vibrato
felixroos Nov 9, 2023
d02450c
Merge pull request #662 from gogins/main
felixroos Nov 9, 2023
d25851a
support multiple named serial connections, change default baudrate to…
yaxu Nov 10, 2023
e4b0011
Parse the synonyms tag in source documentation
ilesinge Nov 11, 2023
bbc2925
Use synonyms in Tooltip
ilesinge Nov 11, 2023
6ba2b76
Show synonyms in API reference
ilesinge Nov 11, 2023
2aff31f
Simplify JSDoc
ilesinge Nov 11, 2023
bfff38a
Fix code format of JSDoc synonym plugin
ilesinge Nov 11, 2023
24e1881
Ignore jsdoc-synonyms by eslint
ilesinge Nov 11, 2023
1b0427e
Document wordfall
ilesinge Nov 11, 2023
2d6654b
Document slider
ilesinge Nov 11, 2023
e52e257
Document euclidLegatoRot
ilesinge Nov 11, 2023
8a7ff9e
Add snapshot for euclidLegatoRot
ilesinge Nov 11, 2023
ff0af15
remove unwanted cm6 outline for strudelTheme
kasparsj Nov 12, 2023
b7dd9b7
Merge remote-tracking branch 'origin/main' into phaser
felixroos Nov 13, 2023
1aaaaba
Merge pull request #798 from daslyfe/phaser
felixroos Nov 13, 2023
7f1919e
move fix to Repl.css
kasparsj Nov 14, 2023
9ef177e
Merge branch 'main' into fix-strudelTheme-outline
kasparsj Nov 14, 2023
8d5ef45
fix codeformat
kasparsj Nov 15, 2023
49aa9cf
Merge pull request #802 from kasparsj/fix-strudelTheme-outline
felixroos Nov 15, 2023
ef14074
add option to disable active line highlighting in Code Settings
kasparsj Nov 15, 2023
2d1fcf4
fix typo
kasparsj Nov 15, 2023
ee7cd8c
remove pseudo note variables
felixroos Nov 16, 2023
a7b799f
p and q methods + all function
felixroos Nov 16, 2023
f43f627
+ add hush
felixroos Nov 16, 2023
a448717
fix tests
felixroos Nov 16, 2023
cb9ef3e
add q1 .. q9 shortcuts
felixroos Nov 17, 2023
265f01e
add p1 .. p9 shortcuts as well
felixroos Nov 17, 2023
476bda8
Initial work on crackle
Bubobubobubobubo Nov 17, 2023
fb28083
Fixing density and adding documentation
Bubobubobubobubo Nov 17, 2023
2a18df6
Fix documentation
Bubobubobubobubo Nov 17, 2023
6e92c49
Run prettier
Bubobubobubobubo Nov 17, 2023
a84cfb5
bump superdough
felixroos Nov 17, 2023
47a6af2
Merge pull request #805 from tidalcycles/pq-functions
felixroos Nov 17, 2023
08ebb52
Merge pull request #804 from kasparsj/highlight-active-line-opt
felixroos Nov 17, 2023
a3bf697
Mark optional slider params
Nov 17, 2023
b73ea7f
Merge pull request #801 from ilesinge/add_doc
felixroos Nov 17, 2023
f74d1be
Merge branch 'main' of https://github.com/tidalcycles/strudel
felixroos Nov 17, 2023
c0f56be
add options param to initHydra
kasparsj Nov 17, 2023
83561a0
Update README.md
felixroos Nov 17, 2023
0975224
fix: multiple repls
felixroos Nov 17, 2023
dd8be65
Merge pull request #813 from tidalcycles/fix-multiple-repls
felixroos Nov 17, 2023
049aa35
hsl + hsla functions
felixroos Nov 18, 2023
f759999
pianoroll smear as float
felixroos Nov 18, 2023
3e02f0a
Merge pull request #815 from tidalcycles/color-hsl
felixroos Nov 18, 2023
b27f8e4
hotfix: build
felixroos Nov 18, 2023
de00212
fix hydra performance issues
atfornes Nov 22, 2023
66fd20a
add hydra audio capture option
atfornes Nov 22, 2023
ebc6723
enable hydra options update
atfornes Nov 22, 2023
a58ac96
add Hydra audio example to documentation
atfornes Nov 22, 2023
0a280e9
prettier code formatting
atfornes Nov 22, 2023
e0e896d
improve hydra audio detection initialization
atfornes Nov 22, 2023
d71877f
Move jsdoc files to subfolder
Nov 22, 2023
2868a5f
Update the undocumented functions file
Nov 22, 2023
ecc8e0a
More code beauty please
Nov 22, 2023
c606f86
Merge pull request #806 from Bubobubobubobubo/noises
felixroos Nov 24, 2023
4fd3e6e
fix: entry.name mutation bug
felixroos Nov 24, 2023
458c97b
list synonyms in Autocomplete
felixroos Nov 24, 2023
18e9ceb
populate autocomplete with all synonyms
felixroos Nov 24, 2023
5e7e1ff
Merge pull request #800 from ilesinge/improve_doc
felixroos Nov 24, 2023
69e99fa
Merge pull request #808 from kasparsj/hydra-options
felixroos Nov 24, 2023
fb7a9e2
format
felixroos Nov 24, 2023
71b4e14
Merge branch 'main' into atfornesmain
felixroos Nov 24, 2023
456be92
else clause
felixroos Nov 24, 2023
9045ce0
comment
felixroos Nov 24, 2023
508a6c9
default hydra config without audio detection
atfornes Nov 24, 2023
f7a283f
add feedStrudel option + smarter reinit logic
felixroos Nov 24, 2023
407510e
document feedStrudel
felixroos Nov 25, 2023
54b5d69
Merge pull request #818 from atfornes/main
felixroos Nov 25, 2023
dacd1e6
Add and style algolia search
ilesinge Nov 26, 2023
020c326
Codeformat for search
ilesinge Nov 26, 2023
c26e5bb
Merge pull request #827 from ilesinge/add_search
felixroos Nov 30, 2023
b16f235
Update first-sounds.mdx
drewgbarnes Dec 1, 2023
b374cdf
Merge pull request #830 from drewgbarnes/patch-1
felixroos Dec 2, 2023
1bca05e
FIXES: palindrome abc -> abccba (#831)
bwagner Dec 5, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,7 @@ vite.config.js
**/*.json
**/dev-dist
**/dist
/src-tauri/target/**/*
/src-tauri/target/**/*
reverbGen.mjs
hydra.mjs
jsdoc-synonyms.js
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ To get in touch with the contributors, either
## Ask a Question

If you have any questions about strudel, make sure you've glanced through the
[docs](https://strudel.tidalcycles.org/learn/) to find out if it answers your question.
[docs](https://strudel.cc/learn/) to find out if it answers your question.
If not, use one of the Communication Channels above!

Don't be afraid to ask! Your question might be of great value for other people too.
Expand All @@ -31,7 +31,7 @@ Use one of the Communication Channels listed above.

## Improve the Docs

If you find some weak spots in the [docs](https://strudel.tidalcycles.org/workshop/getting-started/),
If you find some weak spots in the [docs](https://strudel.cc/workshop/getting-started/),
you can edit each file directly on github via the "Edit this page" link located in the right sidebar.

## Propose a Feature
Expand Down Expand Up @@ -83,7 +83,7 @@ Please report any problems you've had with the setup instructions!

To make sure the code changes only where it should, we are using prettier to unify the code style.

- You can format all files at once by running `pnpm prettier` from the project root
- You can format all files at once by running `pnpm codeformat` from the project root
- Run `pnpm format-check` from the project root to check if all files are well formatted

If you use VSCode, you can
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

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/>
- Docs: <https://strudel.tidalcycles.org/learn/>
- Try it here: <https://strudel.cc>
- Docs: <https://strudel.cc/learn>
- Technical Blog Post: <https://loophole-letters.vercel.app/strudel>
- 1 Year of Strudel Blog Post: <https://loophole-letters.vercel.app/strudel1year>

Expand All @@ -30,7 +30,6 @@ There are multiple npm packages you can use to use strudel, or only parts of it,
- [`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.
Expand Down
17 changes: 17 additions & 0 deletions jsdoc/jsdoc-synonyms.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
jsdoc-synonyms.js - Add support for @synonym tag
Copyright (C) 2023 Strudel contributors - see <https://github.com/tidalcycles/strudel/blob/main/packages/midi/midi.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/>.
*/

function defineTags(dictionary) {
dictionary.defineTag('synonyms', {
mustHaveValue: true,
onTagged: function (doclet, tag) {
doclet.synonyms_text = tag.value;
doclet.synonyms = doclet.synonyms_text.split(/[ ,]+/);
},
});
}

module.exports = { defineTags: defineTags };
2 changes: 1 addition & 1 deletion jsdoc.config.json → jsdoc/jsdoc.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"includePattern": ".+\\.(js(doc|x)?|mjs)$",
"excludePattern": "node_modules|shift-parser|shift-reducer|shift-traverser|dist"
},
"plugins": ["plugins/markdown"],
"plugins": ["plugins/markdown", "jsdoc/jsdoc-synonyms"],
"opts": {
"destination": "./out/",
"recurse": true
Expand Down
6 changes: 4 additions & 2 deletions undocumented.mjs → jsdoc/undocumented.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ async function getUndocumented(path, docs) {
}

// read doc.json file
const { docs } = JSON.parse(await readFile(resolve(__dirname, 'doc.json'), 'utf8'));
const { docs } = JSON.parse(await readFile(resolve(__dirname, '..', 'doc.json'), 'utf8'));

const paths = dependencyTree.toList({
filename: 'index.mjs',
Expand All @@ -76,7 +76,9 @@ const paths = dependencyTree.toList({
// const paths = ['../packages/core/pattern.mjs', '../packages/core/hap.mjs'].map((rel) => resolve(__dirname, rel));

const undocumented = Object.fromEntries(
await Promise.all(paths.map(async (path) => [path, await getUndocumented(path, docs)])),
await Promise.all(
paths.map(async (path) => [path.replace(resolve(__dirname, '..'), ''), await getUndocumented(path, docs)]),
),
);

console.log(JSON.stringify(undocumented, null, 2));
2 changes: 1 addition & 1 deletion my-patterns/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ If you want to automatically deploy your site on push, go to `deploy.yml` and ch
## running locally

- install dependencies with `npm run setup`
- run dev server with `npm run repl` and open `http://localhost:3000/strudel/swatch/`
- run dev server with `npm run repl` and open `http://localhost:4321/strudel/swatch/`

## tests fail?

Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
"build": "npm run prebuild && cd website && npm run build",
"preview": "cd website && npm run preview",
"osc": "cd packages/osc && npm run server",
"jsdoc": "jsdoc packages/ -c jsdoc.config.json",
"jsdoc-json": "jsdoc packages/ --template ./node_modules/jsdoc-json --destination doc.json -c jsdoc.config.json",
"jsdoc": "jsdoc packages/ -c jsdoc/jsdoc.config.json",
"jsdoc-json": "jsdoc packages/ --template ./node_modules/jsdoc-json --destination doc.json -c jsdoc/jsdoc.config.json",
"lint": "eslint . --ext mjs,js --quiet",
"codeformat": "prettier --write .",
"format-check": "prettier --check .",
"report-undocumented": "npm run jsdoc-json && node undocumented.mjs > undocumented.json",
"report-undocumented": "npm run jsdoc-json && node jsdoc/undocumented.mjs > undocumented.json",
"check": "npm run format-check && npm run lint && npm run test",
"iclc": "cd paper && pandoc --template=pandoc/iclc.html --citeproc --number-sections iclc2023.md -o iclc2023.html && pandoc --template=pandoc/iclc.latex --citeproc --number-sections iclc2023.md -o iclc2023.pdf"
},
Expand All @@ -43,7 +43,7 @@
"bugs": {
"url": "https://github.com/tidalcycles/strudel/issues"
},
"homepage": "https://strudel.tidalcycles.org",
"homepage": "https://strudel.cc",
"dependencies": {
"@strudel.cycles/core": "workspace:*",
"@strudel.cycles/mini": "workspace:*",
Expand Down
1 change: 1 addition & 0 deletions packages/codemirror/index.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './codemirror.mjs';
export * from './highlight.mjs';
export * from './flash.mjs';
export * from './slider.mjs';
144 changes: 144 additions & 0 deletions packages/codemirror/slider.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
import { ref, pure } from '@strudel.cycles/core';
import { WidgetType, ViewPlugin, Decoration } from '@codemirror/view';
import { StateEffect, StateField } from '@codemirror/state';

export let sliderValues = {};
const getSliderID = (from) => `slider_${from}`;

export class SliderWidget extends WidgetType {
constructor(value, min, max, from, to, step, view) {
super();
this.value = value;
this.min = min;
this.max = max;
this.from = from;
this.originalFrom = from;
this.to = to;
this.step = step;
this.view = view;
}

eq() {
return false;
}

toDOM() {
let wrap = document.createElement('span');
wrap.setAttribute('aria-hidden', 'true');
wrap.className = 'cm-slider'; // inline-flex items-center
let slider = wrap.appendChild(document.createElement('input'));
slider.type = 'range';
slider.min = this.min;
slider.max = this.max;
slider.step = this.step ?? (this.max - this.min) / 1000;
slider.originalValue = this.value;
// to make sure the code stays in sync, let's save the original value
// becuase .value automatically clamps values so it'll desync with the code
slider.value = slider.originalValue;
slider.from = this.from;
slider.originalFrom = this.originalFrom;
slider.to = this.to;
slider.style = 'width:64px;margin-right:4px;transform:translateY(4px)';
this.slider = slider;
slider.addEventListener('input', (e) => {
const next = e.target.value;
let insert = next;
//let insert = next.toFixed(2);
const to = slider.from + slider.originalValue.length;
let change = { from: slider.from, to, insert };
slider.originalValue = insert;
slider.value = insert;
this.view.dispatch({ changes: change });
const id = getSliderID(slider.originalFrom); // matches id generated in transpiler
window.postMessage({ type: 'cm-slider', value: Number(next), id });
});
return wrap;
}

ignoreEvent(e) {
return true;
}
}

export const setWidgets = StateEffect.define();

export const updateWidgets = (view, widgets) => {
view.dispatch({ effects: setWidgets.of(widgets) });
};

function getWidgets(widgetConfigs, view) {
return widgetConfigs.map(({ from, to, value, min, max, step }) => {
return Decoration.widget({
widget: new SliderWidget(value, min, max, from, to, step, view),
side: 0,
}).range(from /* , to */);
});
}

export const sliderPlugin = ViewPlugin.fromClass(
class {
decorations; //: DecorationSet

constructor(view /* : EditorView */) {
this.decorations = Decoration.set([]);
}

update(update /* : ViewUpdate */) {
update.transactions.forEach((tr) => {
if (tr.docChanged) {
this.decorations = this.decorations.map(tr.changes);
const iterator = this.decorations.iter();
while (iterator.value) {
// when the widgets are moved, we need to tell the dom node the current position
// this is important because the updateSliderValue function has to work with the dom node
if (iterator.value?.widget?.slider) {
iterator.value.widget.slider.from = iterator.from;
iterator.value.widget.slider.to = iterator.to;
}
iterator.next();
}
}
for (let e of tr.effects) {
if (e.is(setWidgets)) {
this.decorations = Decoration.set(getWidgets(e.value, update.view));
}
}
});
}
},
{
decorations: (v) => v.decorations,
},
);

/**
* Displays a slider widget to allow the user manipulate a value
*
* @name slider
* @param {number} value Initial value
* @param {number} min Minimum value - optional, defaults to 0
* @param {number} max Maximum value - optional, defaults to 1
* @param {number} step Step size - optional
*/
export let slider = (value) => {
console.warn('slider will only work when the transpiler is used... passing value as is');
return pure(value);
};
// function transpiled from slider = (value, min, max)
export let sliderWithID = (id, value, min, max) => {
sliderValues[id] = value; // sync state at eval time (code -> state)
return ref(() => sliderValues[id]); // use state at query time
};
// update state when sliders are moved
if (typeof window !== 'undefined') {
window.addEventListener('message', (e) => {
if (e.data.type === 'cm-slider') {
if (sliderValues[e.data.id] !== undefined) {
// update state when slider is moved
sliderValues[e.data.id] = e.data.value;
} else {
console.warn(`slider with id "${e.data.id}" is not registered. Only ${Object.keys(sliderValues)}`);
}
}
});
}
Loading
Loading