fix: duck mode with n
+ detect chord obj in rootNotes
This commit is contained in:
parent
0fd9ac6da3
commit
bbb29ebd7c
2 changed files with 8 additions and 6 deletions
|
|
@ -119,12 +119,13 @@ export function renderVoicing({ chord, dictionary, offset = 0, n, mode = 'below'
|
|||
|
||||
const voicingMidi = voicing.map((v) => anchorMidi - targetStep + v);
|
||||
let notes = voicingMidi.map((n) => midi2note(n));
|
||||
|
||||
if (mode === 'duck') {
|
||||
notes = notes.filter((_, i) => voicingMidi[i] !== noteToMidi(anchor));
|
||||
}
|
||||
if (n !== undefined) {
|
||||
return [scaleStep(notes, n)];
|
||||
}
|
||||
if (mode === 'duck') {
|
||||
notes = notes.filter((n) => x2midi(n) !== noteToMidi(anchor));
|
||||
}
|
||||
return notes;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue