rename chordBass > rootNotes
This commit is contained in:
parent
c5089d8c58
commit
1380babcf2
1 changed files with 12 additions and 8 deletions
|
|
@ -37,17 +37,21 @@ Pattern.prototype.voicings = function (range) {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
Pattern.prototype.chordBass = function () { // range = ['G1', 'C3']
|
Pattern.prototype.rootNotes = function (octave = 2) {
|
||||||
|
// range = ['G1', 'C3']
|
||||||
return this._mapNotes((value) => {
|
return this._mapNotes((value) => {
|
||||||
console.log('value',value);
|
const [_, root] = value.value.match(/^([a-gA-G])[b#]?.*$/);
|
||||||
const [_, root] = value.value.match(/^([a-gC-G])[b#]?.*$/);
|
const bassNote = root + octave;
|
||||||
const bassNote = root + '2';
|
|
||||||
return { ...value, value: bassNote };
|
return { ...value, value: bassNote };
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
Pattern.prototype.define('voicings', (range, pat) => pat.voicings(range), { composable: true });
|
Pattern.prototype.define('voicings', (range, pat) => pat.voicings(range), { composable: true });
|
||||||
Pattern.prototype.define('chordBass', (pat) => {
|
Pattern.prototype.define(
|
||||||
console.log('call chordBass ...', pat);
|
'rootNotes',
|
||||||
return pat.chordBass()
|
(pat) => {
|
||||||
}, { composable: true });
|
// console.log('call rootNotes ...', pat);
|
||||||
|
return pat.rootNotes();
|
||||||
|
},
|
||||||
|
{ composable: true }
|
||||||
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue