spiffyscore

Check-in [c2f128e728]
Login

Check-in [c2f128e728]

Overview
Comment:Added default accidental value of None to Notes
Timelines: family | ancestors | descendants | both | ply
Files: files | file ages | folders
SHA1: c2f128e728901c604c89356d837411f9bb4f939d
User & Date: spiffytech@gmail.com on 2010-11-16 08:37:56
Other Links: branch diff | manifest | tags
Context
2010-11-16
15:57
Now parses roman numerals I-VII instead of notes check-in: 32e6229eaa user: spiffytech@gmail.com tags: ply
08:37
Added default accidental value of None to Notes check-in: c2f128e728 user: spiffytech@gmail.com tags: ply
08:36
Now parses note duration check-in: dc8bbfb68e user: spiffytech@gmail.com tags: ply
Changes

Modified parse.py from [ba81961e5a] to [09e3498be3].

30
31
32
33
34
35
36
37
38


39
40
41
42
43
44
45
46
47
48
49
50

51
52
53
54
55
56
57
30
31
32
33
34
35
36


37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58







-
-
+
+












+







    raise TypeError("Unknown text '%s'" % (t.value,))

t_ignore = " |"

lex.lex()

#lex.input("GFG B'AB,, | g/2fg gab | GFG BAB | d2A AFD")
#s = "GFG B'AB,, | g/2fg gab | GFG BAB | d2A AFD"
s = "GF_G,/2"
s = "GFG B'AB,, | g/2fg gab | GFG BAB | d2A AFD"
#s = "GF_G,/2"
lex.input(s)
for tok in iter(lex.token, None):
    print repr(tok.type), repr(tok.value)


# Parse (yacc)

class Note(object):
    def __init__(self, value, duration=.25, octave=8):
        self.value = value
        self.duration = duration
        self.octave = octave
        self.accidental = None
    def __repr__(self):
        return "Note %s %s %s" % (self.value, self.duration, self.octave)

#def p_element(p):
#    "element : note_element"
#    p[0] = p[1]
#