Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mir_eval/chord.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ def reduce_extended_quality(quality):
# which is in turn derived from the context-free grammar of
# Harte et al., 2005.
CHORD_RE = re.compile(
r"""^((N|X)|(([A-G](b*|#*))((:(maj|min|dim|aug|1|5|sus2|sus4|maj6|min6|7|maj7|min7|dim7|hdim7|minmaj7|aug7|9|maj9|min9|11|maj11|min11|13|maj13|min13)(\((\*?((b*|#*)([1-9]|1[0-3]?))(,\*?((b*|#*)([1-9]|1[0-3]?)))*)\))?)|(:\((\*?((b*|#*)([1-9]|1[0-3]?))(,\*?((b*|#*)([1-9]|1[0-3]?)))*)\)))?((/((b*|#*)([1-9]|1[0-3]?)))?)?))$"""
r"""^((N|X)|(([A-G](b*|#*))((:(maj|min|dim|aug|1|5|sus2|sus4|maj6|min6|7|maj7|min7|dim7|hdim7|minmaj7|aug7|9|maj9|min9|b9|#9|11|#11|maj11|min11|13|maj13|min13|b13)(\((\*?((b*|#*)([1-9]|1[0-3]?))(,\*?((b*|#*)([1-9]|1[0-3]?)))*)\))?)|(:\((\*?((b*|#*)([1-9]|1[0-3]?))(,\*?((b*|#*)([1-9]|1[0-3]?)))*)\)))?((/((b*|#*)([1-9]|1[0-3]?)))?)?))$"""
) # nopep8


Expand Down
6 changes: 6 additions & 0 deletions tests/test_chord.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,3 +638,9 @@ def test_validate():
# Test that error is thrown on different-length labels
with pytest.raises(ValueError):
mir_eval.chord.validate([], ["C"])

# @maximoskp
# make testing for all chord types
# quals = mir_eval.chord.QUALITIES
# for q in quals.keys():
# c = mir_eval.chord.encode('C' + (len(q) > 0)*':' + q, reduce_extended_chords=True)