spiffyscore

Check-in [c2f128e728]
Login
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
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

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

    30     30       raise TypeError("Unknown text '%s'" % (t.value,))
    31     31   
    32     32   t_ignore = " |"
    33     33   
    34     34   lex.lex()
    35     35   
    36     36   #lex.input("GFG B'AB,, | g/2fg gab | GFG BAB | d2A AFD")
    37         -#s = "GFG B'AB,, | g/2fg gab | GFG BAB | d2A AFD"
    38         -s = "GF_G,/2"
           37  +s = "GFG B'AB,, | g/2fg gab | GFG BAB | d2A AFD"
           38  +#s = "GF_G,/2"
    39     39   lex.input(s)
    40     40   for tok in iter(lex.token, None):
    41     41       print repr(tok.type), repr(tok.value)
    42     42   
    43     43   
    44     44   # Parse (yacc)
    45     45   
    46     46   class Note(object):
    47     47       def __init__(self, value, duration=.25, octave=8):
    48     48           self.value = value
    49     49           self.duration = duration
    50     50           self.octave = octave
           51  +        self.accidental = None
    51     52       def __repr__(self):
    52     53           return "Note %s %s %s" % (self.value, self.duration, self.octave)
    53     54   
    54     55   #def p_element(p):
    55     56   #    "element : note_element"
    56     57   #    p[0] = p[1]
    57     58   #