don't interpret note as n
This commit is contained in:
parent
a9a3d491a2
commit
e2a29914c7
2 changed files with 2 additions and 19 deletions
|
|
@ -30,18 +30,6 @@ describe('tonal', () => {
|
||||||
.firstCycleValues.map((h) => h.note),
|
.firstCycleValues.map((h) => h.note),
|
||||||
).toEqual(['C3', 'D3', 'E3']);
|
).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', () => {
|
it('scale with colon', () => {
|
||||||
expect(
|
expect(
|
||||||
n(0, 1, 2)
|
n(0, 1, 2)
|
||||||
|
|
|
||||||
|
|
@ -199,14 +199,9 @@ export const scale = register(
|
||||||
pat
|
pat
|
||||||
.fmap((value) => {
|
.fmap((value) => {
|
||||||
const isObject = typeof value === 'object';
|
const isObject = typeof value === 'object';
|
||||||
let step = value;
|
let step = isObject ? value.n : value;
|
||||||
if (isObject) {
|
if (isObject) {
|
||||||
if (typeof value.note !== 'undefined') {
|
delete value.n;
|
||||||
step = value.note;
|
|
||||||
} else {
|
|
||||||
step = value.n;
|
|
||||||
delete value.n; // remove n so it won't cause trouble
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (isNote(step)) {
|
if (isNote(step)) {
|
||||||
// legacy..
|
// legacy..
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue