patternified rootNotes
This commit is contained in:
parent
6c6a7cf136
commit
e694475556
1 changed files with 2 additions and 10 deletions
|
|
@ -39,8 +39,7 @@ Pattern.prototype.voicings = function (range) {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
Pattern.prototype.rootNotes = function (octave = 2) {
|
Pattern.prototype._rootNotes = function (octave = 2) {
|
||||||
// range = ['G1', 'C3']
|
|
||||||
return this.fmap((value) => {
|
return this.fmap((value) => {
|
||||||
const [_, root] = value.match(/^([a-gA-G][b#]?).*$/);
|
const [_, root] = value.match(/^([a-gA-G][b#]?).*$/);
|
||||||
return root + octave;
|
return root + octave;
|
||||||
|
|
@ -48,11 +47,4 @@ Pattern.prototype.rootNotes = function (octave = 2) {
|
||||||
};
|
};
|
||||||
|
|
||||||
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(
|
Pattern.prototype.define('rootNotes', (oct, pat) => pat.rootNotes(oct), { composable: true, patternified: true });
|
||||||
'rootNotes',
|
|
||||||
(pat) => {
|
|
||||||
// console.log('call rootNotes ...', pat);
|
|
||||||
return pat.rootNotes();
|
|
||||||
},
|
|
||||||
{ composable: true }
|
|
||||||
);
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue