spiffyscore

Check-in [4aeb057ae0]
Login
Overview
Comment:Now parses chord length
Timelines: family | ancestors | descendants | both | ply
Files: files | file ages | folders
SHA1:4aeb057ae0280185788e41edb33f2a264b78b3f2
User & Date: spiffytech@gmail.com on 2010-11-16 16:36:19
Other Links: manifest | tags
Context
2010-11-16
18:37
Now prints csound code, both notes and chords, replicating the functionality of the original Minimaly Functional Version check-in: 9bd31df856 user: spiffytech@gmail.com tags: ply
16:36
Now parses chord length check-in: 4aeb057ae0 user: spiffytech@gmail.com tags: ply
16:34
Now parses chords check-in: 3d9a81ddef user: spiffytech@gmail.com tags: ply
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Modified parse.py from [486dbc368e] to [8130e10658].

    34     34   def t_error(t):
    35     35       raise TypeError("Unknown text '%s'" % (t.value,))
    36     36   
    37     37   lex.lex()
    38     38   
    39     39   #lex.input("GFG B'AB,, | g/2fg gab | GFG BAB | d2A AFD")
    40     40   #s = "GFG B'AB,, | g/2fg gab | GFG BAB | d2A AFD"
    41         -s = '''I IV V VI I "I" "ii"'''
           41  +s = '''I IV V VI I "I" "ii"/2'''
    42     42   #s = "GF_G,/2"
    43     43   lex.input(s)
    44     44   for tok in iter(lex.token, None):
    45     45       print repr(tok.type), repr(tok.value)
    46     46   
    47     47   
    48     48   # Parse (yacc)
................................................................................
    83     83       '''
    84     84       p[0] = p[1]
    85     85   
    86     86   
    87     87   def p_note_length(p):
    88     88       ''' note : note NOTE_LENGTH
    89     89       '''
           90  +    new_note = p[1]
           91  +    new_note.duration = p[2]
           92  +    p[0] = new_note
           93  +
           94  +def p_chord_length(p):
           95  +    ''' chord : chord NOTE_LENGTH
           96  +    '''
    90     97       new_note = p[1]
    91     98       new_note.duration = p[2]
    92     99       p[0] = new_note
    93    100   
    94    101   
    95    102   def p_chord(p):
    96    103       '''chord : QUOTE pitch QUOTE