Added chord names

Chord names, parsing notes from roman numerals, method for resolving pitch classes from midi notes (not in use yet).
This commit is contained in:
2023-02-08 20:43:57 +02:00
parent 4bcdb2568a
commit 8d49e5d5c2
6 changed files with 318 additions and 27 deletions

View File

@ -30,7 +30,7 @@ from .classes import (
)
from .common import flatten, sum_dict
from .defaults import DEFAULT_DURS
from .scale import parse_roman
from .scale import parse_roman, chord_from_roman_numeral
# pylint: disable=locally-disabled, unused-argument, too-many-public-methods, invalid-name
@ -114,8 +114,9 @@ class ZiffersTransformer(Transformer):
numeral = items[0].value
if len(items)>1:
name = items[1]
return RomanNumeral(text=numeral, value=parse_roman(numeral), chord_type=name)
return RomanNumeral(value=parse_roman(numeral), text=numeral)
notes = chord_from_roman_numeral(numeral,name)
return RomanNumeral(text=numeral, value=parse_roman(numeral), chord_type=name, notes=notes)
return RomanNumeral(value=parse_roman(numeral), text=numeral, notes=chord_from_roman_numeral(numeral))
def chord_name(self,item):
"""Return name for chord"""