Ejemplo n.º 1
0
 def rn2letter(self, sym):
     if sym in ROMAN2LETTER_RELABELS:
         formatted_sym = ROMAN2LETTER_RELABELS[sym]
     elif sym in self._rn2letter:
         formatted_sym = self._rn2letter[sym]
         print 'rn2letter retrieved', sym, formatted_sym
     else:
         formatted_sym = roman2letter(sym)
     return formatted_sym
Ejemplo n.º 2
0
def check_roman_vs_letters():
    data = get_data()
    syms = data.syms
    from music21_chord_tools import roman2letter, letter2roman
    mismatches = {}
    for sym in syms:
        letter = roman2letter(sym)
        roman = letter2roman(letter)
        if sym != roman:
            mismatches[roman] = sym
            print '------ mismatch'
    print mismatches
Ejemplo n.º 3
0
def make_rn2letter_dict():
    data = get_data()
    syms = data.syms
    conversion_dict = {}
    from music21_chord_tools import roman2letter
    for sym in syms:
        # print sym
        conversion_dict[sym] = roman2letter(sym)

    fname = 'rn2letter.pkl'
    with open(fname, 'wb') as p:
        pickle.dump(conversion_dict, p)