예제 #1
0
파일: emit.py 프로젝트: kroger/aristoxenus
    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 ""
예제 #2
0
파일: lily.py 프로젝트: mdsmus/aristoxenus
 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)
예제 #3
0
파일: emit.py 프로젝트: kroger/aristoxenus
 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))
예제 #4
0
def test_notename_to_lily_d2s0():
    assert music.notename_to_lily("D##", 0) == "disis,,,"
예제 #5
0
def test_notename_to_lily_d2s7():
    assert music.notename_to_lily("D##", 7) == "disis''''"
예제 #6
0
def test_notename_to_lily_c2f5():
    assert music.notename_to_lily("Cbb", 5) == "ceses''"
예제 #7
0
def test_notename_to_lily_c2f4():
    assert music.notename_to_lily("Cbb", 4) == "ceses'"
예제 #8
0
def test_notename_to_lily_c2f3():
    assert music.notename_to_lily("Cbb", 3) == "ceses"
예제 #9
0
def test_notename_to_lily_c2f2():
    assert music.notename_to_lily("Cbb", 2) == "ceses,"
예제 #10
0
def test_notename_to_lily_c2f1():
    assert music.notename_to_lily("Cbb", 1) == "ceses,,"