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
This commit is contained in:
parent
d8677c6261
commit
491c99c348
4 changed files with 223 additions and 103 deletions
|
|
@ -107,6 +107,9 @@ export function patternifyAST(ast, code, onEnter, offset = 0) {
|
|||
if (alignment === 'rand') {
|
||||
return strudel.chooseInWith(strudel.rand.early(randOffset * ast.arguments_.seed).segment(1), children);
|
||||
}
|
||||
if (alignment === 'feet') {
|
||||
return strudel.fastcat(...children);
|
||||
}
|
||||
const weightedChildren = ast.source_.some((child) => !!child.options_?.weight);
|
||||
if (weightedChildren) {
|
||||
const weightSum = ast.source_.reduce((sum, child) => sum + (child.options_?.weight || 1), 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue