Fix tactus marking in mininotation (#1144)
* more tactus tweaks * format
This commit is contained in:
parent
f514cd85b1
commit
4c3457438d
3 changed files with 18 additions and 5 deletions
|
|
@ -14,7 +14,7 @@ const applyOptions = (parent, enter) => (pat, i) => {
|
|||
const ast = parent.source_[i];
|
||||
const options = ast.options_;
|
||||
const ops = options?.ops;
|
||||
|
||||
const tactus_source = pat.__tactus_source;
|
||||
if (ops) {
|
||||
for (const op of ops) {
|
||||
switch (op.type_) {
|
||||
|
|
@ -39,6 +39,7 @@ const applyOptions = (parent, enter) => (pat, i) => {
|
|||
} else {
|
||||
pat = pat.euclid(enter(op.arguments_.pulse), enter(op.arguments_.step));
|
||||
}
|
||||
console.log(op.arguments_.step);
|
||||
break;
|
||||
}
|
||||
case 'degradeBy': {
|
||||
|
|
@ -69,7 +70,7 @@ const applyOptions = (parent, enter) => (pat, i) => {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
pat.__tactus_source = pat.__tactus_source || tactus_source;
|
||||
return pat;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -210,12 +210,14 @@ describe('mini', () => {
|
|||
});
|
||||
it('supports ^ tactus marking', () => {
|
||||
expect(mini('a [^b c]').tactus).toEqual(Fraction(4));
|
||||
expect(mini('[^b c]!3').tactus).toEqual(Fraction(6));
|
||||
expect(mini('[a b c] [d [e f]]').tactus).toEqual(Fraction(2));
|
||||
expect(mini('^[a b c] [d [e f]]').tactus).toEqual(Fraction(2));
|
||||
expect(mini('[a b c] [d [^e f]]').tactus).toEqual(Fraction(8));
|
||||
expect(mini('[a b c] [^d [e f]]').tactus).toEqual(Fraction(4));
|
||||
expect(mini('[^a b c] [^d [e f]]').tactus).toEqual(Fraction(12));
|
||||
expect(mini('[^a b c] [d [^e f]]').tactus).toEqual(Fraction(24));
|
||||
expect(mini('[^a b c d e]').tactus).toEqual(Fraction(5));
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue