Esempio n. 1
0
    def visit_Tandem(self, obj):
        if obj.type == "clef":
            data = CLEFS[obj.data]['lily']
        elif obj.type == "key-signature":
            data = "{0} \\major".format(music.notename_to_lily(music.key_name(obj.data)))
        elif obj.type in ["key"]:
            data = None
        else:
            data = obj.data

        obj_type = TANDEM_TABLE.get(obj.type)
        obj_type_lily = obj_type['lily'] if obj_type else ""

        if obj_type_lily and data is not None:
            return "{0} {1}\n".format(obj_type_lily if obj_type_lily else "", data)
        else:
            return ""
Esempio n. 2
0
 def visit_Note(self, obj):
     name = music.notename_to_lily(obj.name, obj.octave)
     dur = music.frac_to_dur(obj.duration)
     return "{0}{1}".format(name,  dur)
Esempio n. 3
0
 def visit_Note(self, obj):
     name = music.notename_to_lily(obj.name, obj.octave)
     dur = music.frac_to_dur(obj.duration)
     articulations = [NOTE_TABLE[a]['lily'] for a in obj.articulations]
     return "{0}{1}{2}".format(name, dur, "".join(articulations))
Esempio n. 4
0
def test_notename_to_lily_d2s0():
    assert music.notename_to_lily("D##", 0) == "disis,,,"
Esempio n. 5
0
def test_notename_to_lily_d2s7():
    assert music.notename_to_lily("D##", 7) == "disis''''"
Esempio n. 6
0
def test_notename_to_lily_c2f5():
    assert music.notename_to_lily("Cbb", 5) == "ceses''"
Esempio n. 7
0
def test_notename_to_lily_c2f4():
    assert music.notename_to_lily("Cbb", 4) == "ceses'"
Esempio n. 8
0
def test_notename_to_lily_c2f3():
    assert music.notename_to_lily("Cbb", 3) == "ceses"
Esempio n. 9
0
def test_notename_to_lily_c2f2():
    assert music.notename_to_lily("Cbb", 2) == "ceses,"
Esempio n. 10
0
def test_notename_to_lily_c2f1():
    assert music.notename_to_lily("Cbb", 1) == "ceses,,"