From 78dcab27784bbf50f2d817442a6342e501dcf5bd Mon Sep 17 00:00:00 2001 From: Felix Roos Date: Thu, 13 Jul 2023 11:24:57 +0200 Subject: [PATCH] fix: control interference --- packages/tonal/voicings.mjs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/tonal/voicings.mjs b/packages/tonal/voicings.mjs index 30d5b3e5..dea0fff2 100644 --- a/packages/tonal/voicings.mjs +++ b/packages/tonal/voicings.mjs @@ -191,14 +191,15 @@ export const rootNotes = register('rootNotes', function (octave, pat) { export const voicing = register('voicing', function (pat) { return pat .fmap((value) => { - let { dictionary = 'default', ...rest } = value; + // destructure voicing controls out + let { dictionary = 'default', chord, anchor, offset, mode, n, ...rest } = value; dictionary = typeof dictionary === 'string' ? voicingRegistry[dictionary] : { dictionary, mode: 'below', anchor: 'c5' }; - let notes = renderVoicing({ ...dictionary, ...rest }); + let notes = renderVoicing({ ...dictionary, chord, anchor, offset, mode, n }); return stack(...notes) .note() - .set(rest); + .set(rest); // rest does not include voicing controls anymore! }) .outerJoin(); });