feat: add voiceOffset (2)
This commit is contained in:
parent
d1fe50e271
commit
35f5a5d11a
3 changed files with 4 additions and 2 deletions
|
|
@ -139,13 +139,13 @@ export const rootNotes = register('rootNotes', function (octave, pat) {
|
|||
export const voicing = register('voicing', function (dictionary, pat) {
|
||||
return pat
|
||||
.fmap((value) => {
|
||||
let { voiceMax: max, voiceBelow: below, chord, ...rest } = value;
|
||||
let { voiceMax: max, voiceBelow: below, voiceOffset: offset, chord, ...rest } = value;
|
||||
let top = max || below;
|
||||
top = top?.note || top || 'c5';
|
||||
if (typeof dictionary === 'string') {
|
||||
dictionary = voicingRegistry[dictionary]?.dictionary;
|
||||
}
|
||||
let notes = voiceBelow(top, chord, dictionary);
|
||||
let notes = voiceBelow(top, chord, dictionary, offset);
|
||||
if (below) {
|
||||
notes = notes.filter((n) => note2midi(n) !== note2midi(top));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue