don't interpret note as n

This commit is contained in:
Felix Roos
2025-06-24 05:43:06 +02:00
parent a9a3d491a2
commit e2a29914c7
2 changed files with 2 additions and 19 deletions
-12
View File
@@ -30,18 +30,6 @@ describe('tonal', () => {
.firstCycleValues.map((h) => h.note),
).toEqual(['C3', 'D3', 'E3']);
});
it('scale with n and note values', () => {
expect(
n(0, 1, 2)
.note(3, 4, 0)
.scale('C major')
.firstCycleValues.map((h) => [h.n, h.note]),
).toEqual([
[0, 'F3'],
[1, 'G3'],
[2, 'C3'],
]);
});
it('scale with colon', () => {
expect(
n(0, 1, 2)
+2 -7
View File
@@ -199,14 +199,9 @@ export const scale = register(
pat
.fmap((value) => {
const isObject = typeof value === 'object';
let step = value;
let step = isObject ? value.n : value;
if (isObject) {
if (typeof value.note !== 'undefined') {
step = value.note;
} else {
step = value.n;
delete value.n; // remove n so it won't cause trouble
}
delete value.n;
}
if (isNote(step)) {
// legacy..