This commit is contained in:
Felix Roos 2022-03-17 22:19:37 +01:00
parent e694475556
commit 1182d0e45d
5 changed files with 27 additions and 15 deletions

View file

@ -24,13 +24,11 @@ Pattern.prototype.voicings = function(range) {
}));
});
};
Pattern.prototype.rootNotes = function(octave = 2) {
Pattern.prototype._rootNotes = function(octave = 2) {
return this.fmap((value) => {
const [_, root] = value.match(/^([a-gA-G][b#]?).*$/);
return root + octave;
});
};
Pattern.prototype.define("voicings", (range, pat) => pat.voicings(range), {composable: true});
Pattern.prototype.define("rootNotes", (pat) => {
return pat.rootNotes();
}, {composable: true});
Pattern.prototype.define("rootNotes", (oct, pat) => pat.rootNotes(oct), {composable: true, patternified: true});