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
This commit is contained in:
parent
4bfeaa47bf
commit
bf72908dc9
11 changed files with 458 additions and 208 deletions
|
|
@ -18,6 +18,7 @@ const applyOptions = (parent, code) => (pat, i) => {
|
|||
const ast = parent.source_[i];
|
||||
const options = ast.options_;
|
||||
const ops = options?.ops;
|
||||
|
||||
if (ops) {
|
||||
for (const op of ops) {
|
||||
switch (op.type_) {
|
||||
|
|
@ -66,6 +67,11 @@ const applyOptions = (parent, code) => (pat, i) => {
|
|||
pat = strudel.reify(pat).degradeBy(op.arguments_.amount === null ? 0.5 : op.arguments_.amount);
|
||||
break;
|
||||
}
|
||||
case 'tail': {
|
||||
const friend = patternifyAST(op.arguments_.element, code);
|
||||
pat = pat.fmap((a) => (b) => Array.isArray(a) ? [...a, b] : [a, b]).appLeft(friend);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
console.warn(`operator "${op.type_}" not implemented`);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue