| Trees | Indices | Help |
|
|---|
|
|
Chord processing utilities.
A library of utility functions used throughout the Jazz Parser relating to chord processing in the input.
Author: Mark Granroth-Wilding <mark.granroth-wilding@ed.ac.uk>
|
|||
|
ChordError Raised when there's a problem recognising or processing a chord. |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
logger = logging.getLogger("main_logger")
|
|||
ly_note_to_int =
|
|||
ly_note_to_base_int =
|
|||
int_to_ly_note =
|
|||
int_to_note_name =
|
|||
ROMAN_NUMERALS =
|
|||
__package__ =
|
|||
|
|||
Given a chord numeral (e.g. "I" or "bVII"), returns the integer that corresponds to this chord root. Returns None if input is either a chord variable ("X", "Y") or itself None. If strict is set, doesn't allow variable names. |
Given an internal integer representation of a chord root (i.e. a note of the scale), returns the roman numeral as a string. This will always use the same convention for #s and bs, so may not be the same as the numeral that generated the note number. The input numbers 0-11 correspond to I-VII in the scale. The input need to be in this range. Outside it, numbers will be mapped into this range by "% 12". Returns "X" if input is None. |
Like int_to_chord_numeral, but outputs a pitch class name instead of roman numeral. Returns "X" if input is None. |
The grammar generalises over chord names, using X to mean "any roman numeral chord root". When a chord name comes as input to the parser, say "IIm", we look up not "IIm", but "Xm". Given any chord name, this function returns the generalised chord name to look up in the grammar. |
|
|||
ly_note_to_int
|
ly_note_to_base_int
|
int_to_ly_note
|
int_to_note_name
|
ROMAN_NUMERALS
|
| Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Mon Nov 26 16:04:56 2012 | http://epydoc.sourceforge.net |