fix rootNotes with accidentals

This commit is contained in:
Felix Roos 2022-03-17 15:02:58 +01:00
parent d87049c7f8
commit eaa250a962

View File

@ -42,7 +42,7 @@ Pattern.prototype.voicings = function (range) {
Pattern.prototype.rootNotes = function (octave = 2) {
// range = ['G1', 'C3']
return this.fmap((value) => {
const [_, root] = value.match(/^([a-gA-G])[b#]?.*$/);
const [_, root] = value.match(/^([a-gA-G][b#]?).*$/);
return root + octave;
});
};