41 Commits

Author SHA1 Message Date
Alex McLean
34e9d73908
Improve performance of ! (replicate) (#1084)
* Implement ! with weighted repeatCycles
* reimplement repeatCycles without array filling
2024-05-02 23:37:32 +01:00
Alex McLean
2fd2bdba60
Feature: tactus marking (#1021)
* rename `beat` option to `stackBy` to `repeat`
* fix parse error reporting
* rename `weight` to `tactus` (it might in the end be pulse, step, or tap)
* tactus marking with ^
* and add some tests
2024-03-27 12:06:05 +00:00
Alex McLean
398533877c
Beat-oriented functionality (#976)
* annotate pure values with their value, allowing single mininotation values to maintain their labels as pure
* Don't use any 'patternified' arguments if they're all 'pure'
* allow pattern weights (roughly, beats-per-cycle) to be inferred where possible, including from mininotation and across many transformations (e.g. `fast` with a 'pure' factor)
* Add `beatCat`, similar to `timeCat` but funkier
* `silence` has a weight of 1, add alternative `nothing` with a weight of 0, and `gap` function with weight argument
* preserve weight across applicative operations (weight comes with the structure)
* add `stack` alternatives that take advantage of pattern weights to align patterns differently - `stackLeft`, `stackRight`, `stackCentre`, `stackExpand`, with `stackBy` with an argument for patterning the alignment.
2024-03-16 17:24:37 +00:00
Alex McLean
8e41332dfa
alias - for ~ (#981) 2024-03-06 11:14:48 +00:00
Alex McLean
491c99c348
Mini-notation additions towards tidal compatibility (#926)
- `.` feet now work, e.g. `"a b c . d e . f"` is the same as `"[a b c] [d e] [f]"`
- `_` elongation now works, e.g. `"a _ _ b"` is the same as `"a@3 b"` (`"a @ @ b"` also works, like in tidal)
- standalone `!` now works, e.g. `"a ! ! b"` is the same as `"a!3 b"`

Reworks #47 and #49
Ref #30
2024-01-19 14:10:47 +00:00
Felix Roos
96bafa7f0b the big rename: @strudel.cycles/* -> @strudel/* 2024-01-18 09:54:37 +01:00
Felix Roos
ca3eda8fc7 support , in < > 2024-01-03 21:54:10 +01:00
Felix Roos
ecf837636b show line where mini notation parse errors happen 2023-12-31 15:06:30 +01:00
Felix Roos
94fcea1040 codeformat 2023-12-30 23:21:34 +01:00
Alex McLean
fd316c81c0
support mininotation '..' range operator, fixes #715 (#716)
* support mininotation .. range operator, fixes #715

* remove logs
2023-10-01 13:20:49 +01:00
Felix Roos
0b5d905120 fix: adaptive highlighting
- transpiler now uses m function with globalOffset
- patternifyAST now accepts global offset
- patternifyAST now calls .withLoc with global leaf location
- .withLoc replaces .withLocation + .withMiniLocation
- simple locs (offsets) are now used everywhere
- some tests fail, seems some haps have reordered...
- wip: Repl still uses hardcoded updateMiniLocations
- todo: find way to call updateMiniLocations dynamically
2023-07-03 05:15:32 +02:00
Felix Roos
c7e882e001 mini: leaf location retrieval
- add onEnter callback for patternifyAST
- add leaf node location helpers
- add tests
2023-07-01 23:52:31 +02:00
Felix Roos
12228c56d9 improve api for web package 2023-05-07 22:36:26 +02:00
Ian Clester
4e2a5e1663 Add pairwise independence test, tweak randOffset 2023-03-20 22:27:35 -04:00
Ian Clester
c98b0e9687 Format code with prettier 2023-03-20 19:19:42 -04:00
Ian Clester
4b51f1a3fc Sync up ? with degrade() 2023-03-20 15:26:27 -04:00
Ian Clester
5490b01004 Maintain random seed state in parser, not globally 2023-03-20 14:59:43 -04:00
Alex McLean
bf72908dc9
Support list syntax in mininotation (#512)
fixes #504

* support list syntax in mininotation
* support compound controls
* remove redundant : splitting of s/n and note/n from webaudio
* patternable scale names
2023-03-04 18:06:18 +00:00
Alex McLean
f57fe182ed
Support for multiple mininotation operators WIP (#350)
* support for multiple operators
* fix false test failures by sorting by part
* snapshot
2023-01-09 22:23:27 +00:00
Alex McLean
db7ef01dbb
Patternify euclid, fast, slow and polymeter step parameters in mininotation (#341)
* patternify the mininotation bjorklund, and fast (*) slow (/) and pattern step (%) parameters
* simplify replicate (!), should be closer to tidal now
* highlight atoms rather than elements
* tests
2023-01-02 20:28:07 +00:00
Alex McLean
8bb460701f
Tidy parser, implement polymeters (#336)
* rename parser stuff to be more explicit and fit with tidal concepts. qualify all strudel function calls
* Add {,}%n polymeter support, with a few tests
2022-12-31 21:42:49 +00:00
Felix Roos
fb14865785 fix: can now multiply floats in mini notation
- fixes #314
2022-12-29 14:02:50 +01:00
Felix Roos
b4f4d6cea2 fix whitespace trimming 2022-12-12 00:45:47 +01:00
Felix Roos
94651731a5 hotfix: uncomment essential line :) 2022-12-12 00:23:03 +01:00
Felix Roos
1b06795ffe remove whitespace from highlighted region 2022-12-11 23:14:47 +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
09b15a07c6 use register for degradeBy / undegradeBy 2022-12-10 19:25:51 +01:00
Felix Roos
e2898ee5bf add eslint + fix lint errors 2022-11-24 15:30:11 +01:00
Felix Roos
67ee493e56 remove cross import + code format 2022-11-04 20:15:11 +01: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
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
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
alex
ee514ee8ba redo headers 2022-04-28 14:38:41 +01:00
alex
f75da0e2e3 separate out strudel.mjs, make index.mjs aggregate module 2022-04-13 17:25:02 +01:00
Felix Roos
75097594b2 rename org to strudel.cycles 2022-03-27 21:42:54 +02:00
Felix Roos
0a8397b3dc replace relative imports with package imports 2022-03-25 22:43:55 +01:00
Felix Roos
9458faf5b0 fix pattern checks for minified code 2022-03-25 22:32:42 +01:00
Felix Roos
2338a1ee7d fix more deps 2022-03-25 18:51:20 +01:00
Felix Roos
6f60a3a1d5 start packaging 2022-03-25 14:39:25 +01:00