spiffyscore

Check-in [702d933446]
Login
Overview
Comment:Added lexical support for parens instead of quotes for chords, cleaned up the yacc parser, added lex tokens for syncopation
Timelines: family | ancestors | descendants | both | master
Files: files | file ages | folders
SHA1: 702d933446257117bbc81a7603231aef34066457
User & Date: brian@linux-85dd.site on 2011-02-10 22:34:39
Other Links: branch diff | manifest | tags
Context
2011-02-10
23:50
Program generates a render order for the instruments based on their sync order check-in: 689adc054e user: brian@linux-85dd.site tags: master
22:34
Added lexical support for parens instead of quotes for chords, cleaned up the yacc parser, added lex tokens for syncopation check-in: 702d933446 user: brian@linux-85dd.site tags: master
2010-11-30
17:33
This is what I submitted as my final piece for MUS 306 check-in: 843dabad43 user: spiffytech@gmail.com tags: master
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Modified cfg.py from [019c552e42] to [82bf7ad059].

    11     11   def main():
    12     12       key = "A"
    13     13       bps = 60/60
    14     14       tempo = 1/bps
    15     15       max_duration = 1
    16     16   
    17     17       composition = {
    18         -        "intro1": {
    19         -            "rhythm": {
    20         -                "score_line": "i1 %(time)f %(duration)f 7000 %(octave)d.%(note)s %(octave)d.%(note)s 0 6",
    21         -                "octave": 7,
    22         -                "duration": 4,
    23         -                "grammars": {
    24         -                    "u": ['"I" "ii"/4 "ii"/4 "IV"/2 "V"2 "IV" "ii" x u', '"I" "vii" "III" y u', '"I" "v" "IV" u u'],
    25         -                    "w": ['"i" "VII"2 "VI"/4 "V"/4 "i"/4 "VII"2 "VI" "V" w u'],
    26         -                    "x": ['"III/2" "VI"/2 "III"/2 "vii"2 "i"2 "V" u'],
    27         -                    "y": ['"I" "vi"2 "IV" "V" y y u'],
    28         -                },
    29         -                "score": "u x u y x w u",
    30         -            },
    31         -        },
    32         -        "intro2": {
    33         -            "rhythm": {
    34         -                "score_line": "i1 %(time)f %(duration)f 7000 %(octave)d.%(note)s %(octave)d.%(note)s 0 6",
    35         -                "octave": 7,
    36         -                "duration": 8,
    37         -                "grammars": {
    38         -                    "u": ['"I" "ii"/4 "ii"/4 "IV"/2 "V"2 "IV" "ii" x u', '"I" "vii" "III" y u', '"I" "v" "IV" u u'],
    39         -                    "w": ['"i" "VII"2 "VI"/4 "V"/4 "i"/4 "VII"2 "VI" "V" w u'],
    40         -                    "x": ['"III/2" "VI"/2 "III"/2 "vii"2 "i"2 "V" u'],
    41         -                    "y": ['"I" "vi"2 "IV" "V" y y u'],
    42         -                },
    43         -                "score": "u x u y x w u",
    44         -            },
    45         -            "timbre": {
    46         -                "score_line": "i3 %(time)f %(duration)f 2000 %(octave)d.%(note)s 2 3 5 3",
    47         -                "octave": 6,
    48         -                "duration": 8,
    49         -                "grammars": {  # Notes for this instrument to use in this piece
    50         -                    "u": ['I2 VII2 V2 VI2 I2 IV/2 V/2 III2 u', 'I2 IV2 V2 IV I V2 III2 II2 u']
    51         -                },
    52         -                "score": "u u u u u",
    53         -            },
    54         -        },
    55     18           "overview": {
    56     19               "melody": {  # Instrument 'melody'
    57     20                   "score_line": "i2 %(time)f %(duration)f 7000 %(octave)d.%(note)s 2",
    58     21                   "octave": 8,
    59     22                   "duration": 40,
    60     23                   "grammars": {  # Notes for this instrument to use in this piece
    61     24                       "u": ["I V/2 V/2 V/2 I VII, IV' I IV I VII IV"],
    62         -                    "w": ['III/4 VI/4 II/4 V/4 VI/4 IV/4 VII2'],
    63         -                    "x": ['I/2 I/2 VI IV/2 V2 z I/2 I/2 VI IV/2 V'],
    64         -                },
    65         -                "score": "u u w w w w w x x",
    66         -            },
    67         -            "rhythm": {
    68         -                "score_line": "i1 %(time)f %(duration)f 7000 %(octave)d.%(note)s %(octave)d.%(note)s 0 6",
    69         -                "octave": 7,
    70         -                "duration": 44,
    71         -                "grammars": {
    72         -                    "u": ['"I" "ii"/4 "ii"/4 "IV"/2 "V"2 "IV" "ii" x u', '"I" "vii" "III" y u', '"I" "v" "IV" u u'],
    73         -                    "w": ['"i" "VII"2 "VI"/4 "V"/4 "i"/4 "VII"2 "VI" "V" w u'],
    74         -                    "x": ['"III/2" "VI"/2 "III"/2 "vii"2 "i"2 "V" u'],
    75         -                    "y": ['"I" "vi"2 "IV" "V" y y u'],
    76         -                },
    77         -                "score": "u x u y x w u",
    78         -            },
    79         -            "timbre": {
    80         -                "score_line": "i3 %(time)f %(duration)f 2000 %(octave)d.%(note)s 2 3 5 3",
    81         -                "octave": 6,
    82         -                "duration": 44,
    83         -                "grammars": {  # Notes for this instrument to use in this piece
    84         -                    "u": ['I2 VII2 V2 VI2 I2 IV/2 V/2 III2 u', 'I2 IV2 V2 IV I V2 III2 II2 u']
    85         -                },
    86         -                "score": "u u u u u",
    87         -            },
    88         -        },
    89         -        "a": {  # Movement block 'a' for reuse throughout the piece
    90         -            "melody": {  # Instrument 'melody'
    91         -                "score_line": "i2 %(time)f %(duration)f 7000 %(octave)d.%(note)s 2",
    92         -                "octave": 8,
    93         -                "duration": 40,
    94         -                "grammars": {  # Notes for this instrument to use in this piece
    95         -                    "u": ["I V/2 V/2 V/2 I VII, IV' x", "I IV w", "I VII IV u"],
    96         -                    "w": ['VII I IV V VI VII I IV V VI VII u'],
    97         -                    "x": ['VI/4 III/4 II/4 I/4 w'],
    98         -                },
    99         -                "score": "u",
   100         -            },
   101         -            "rhythm": {
   102         -                "score_line": "i1 %(time)f %(duration)f 7000 %(octave)d.%(note)s %(octave)d.%(note)s 0 6",
   103         -                "octave": 7,
   104         -                "duration": 48,
   105         -                "grammars": {
   106         -                    "u": ['"I" "ii"/4 "ii"/4 "IV"/2 "V"2 "IV" "ii" x u', '"I" "vii" "III" y u', '"I" "v" "IV" u u'],
   107         -                    "w": ['"i" "VII"2 "VI"/4 "V"/4 "i"/4 "VII"2 "VI" "V" w u'],
   108         -                    "x": ['"III/2" "VI"/2 "III"/2 "vii"2 "i"2 "V" u'],
   109         -                    "y": ['"I" "vi"2 "IV" "V" y y u'],
   110         -                },
   111         -                "score": "u x u y x w u",
   112         -            },
   113         -            "timbre": {
   114         -                "score_line": "i3 %(time)f %(duration)f 2000 %(octave)d.%(note)s 2 3 5 3",
   115         -                "octave": 6,
   116         -                "duration": 42,
   117         -                "grammars": {  # Notes for this instrument to use in this piece
   118         -                    "u": ['I2 VII2 V2 VI2 I2 IV/2 V/2 III2 u', 'I2 IV2 V2 IV I V2 III2 II2 u']
   119         -                },
   120         -                "score": "u u u u u",
   121         -            },
   122         -        },
   123         -        "b": {  # Movement block 'a' for reuse throughout the piece
   124         -            "melody": {  # Instrument 'melody'
   125         -                "score_line": "i2 %(time)f %(duration)f 7000 %(octave)d.%(note)s 2",
   126         -                "octave": 8,
   127         -                "duration": 40,
   128         -                "grammars": {  # Notes for this instrument to use in this piece
   129         -                    "u": ['I VII V III u', "y"],
   130         -                    "w": ['VII I IV V VI u', 'w'],
   131         -                    "x": ['VI/4 III/4 II/4 I/4 w', 'x x'],
   132         -                    "y": ["III/4 VI/4 II/4 V/4 VI/4 IV/4 VII2"],
   133         -                },
   134         -                "score": "w w x x w",
   135         -            },
   136         -            "rhythm": {
   137         -                "score_line": "i1 %(time)f %(duration)f 7000 %(octave)d.%(note)s %(octave)d.%(note)s 0 6",
   138         -                "octave": 7,
   139         -                "duration": 44,
   140         -                "grammars": {
   141         -                    "u": ['"I" "V" "vi" "iii" "IV" "I" "IV" "V" u u', "y"],
   142         -                    "y": ['"I" "vi"2 "IV" "V" y y u'],
   143         -                },
   144         -                "score": "u u y y u",
   145         -            },
   146         -            "timbre": {
   147         -                "score_line": "i3 %(time)f %(duration)f 2000 %(octave)d.%(note)s 2 3 5 3",
   148         -                "octave": 6,
   149         -                "duration": 40,
   150         -                "grammars": {  # Notes for this instrument to use in this piece
   151         -                    "u": ['I2 VII2 V2 VI2 I2 IV/2 V/2 III2 u', 'I2 IV2 V2 IV I V2 III2 II2 u']
   152         -                },
   153         -                "score": "u u u u u",
   154         -            },
   155         -        },
   156         -        "zelda1": {  # Movement block 'a' for reuse throughout the piece
   157         -            "melody": {  # Instrument 'melody'
   158         -                "score_line": "i2 %(time)f %(duration)f 7000 %(octave)d.%(note)s 2",
   159         -                "octave": 8,
   160         -                "duration": 50,
   161         -                "grammars": {  # Notes for this instrument to use in this piece
   162         -                    "u": ['I VI/2 VI/2 IV/2 I VI/2 VI/2 IV/2 I VI/2 VI/2 IV/2 w', "y"],
   163         -                    "w": ['VII/2 I/2 II/2 V/2 u'],
   164         -                    "x": ['VI/4 III/4 II/4 I/4 w'],
   165         -                    "y": ["III/4 VI/4 II/4 V/4 VI/4 IV/4 VII2 x"],
   166         -                },
   167         -                "score": "w",
   168         -            },
   169         -            "rhythm": {
   170         -                "score_line": "i1 %(time)f %(duration)f 7000 %(octave)d.%(note)s %(octave)d.%(note)s 0 6",
   171         -                "octave": 7,
   172         -                "duration": 54,
   173         -                "grammars": {
   174         -                    "u": ['"I"/2 "V"/2 "vi"/2 "iii"/2 "IV"/2 "I"/2 "IV"/2 "V"/2 u u', "y"],
   175         -                    "y": ['"I"/2 "vi" "IV"/2 "V"/2 y y u'],
   176         -                },
   177         -                "score": "u u y y u",
   178         -            },
   179         -            "timbre": {
   180         -                "score_line": "i3 %(time)f %(duration)f 2000 %(octave)d.%(note)s 2 3 5 3",
   181         -                "octave": 6,
   182         -                "duration": 54,
   183         -                "grammars": {  # Notes for this instrument to use in this piece
   184         -                    "u": ['I2 VII2 V2 VI2 I2 IV/2 V/2 III2 u', 'I2 IV2 V2 IV I V2 III2 II2 u']
   185         -                },
   186         -                "score": "u u u u u",
   187         -            },
   188         -        },
   189         -        "zelda2": {  # Movement block 'a' for reuse throughout the piece
   190         -            "melody": {  # Instrument 'melody'
   191         -                "score_line": "i2 %(time)f %(duration)f 7000 %(octave)d.%(note)s 2",
   192         -                "octave": 8,
   193         -                "duration": 40,
   194         -                "grammars": {  # Notes for this instrument to use in this piece
   195         -                    "u": ['I/2 I/2 VI IV/2 V2 z I/2 I/2 VI IV/2 V u', "w"],
   196         -                    "w": ['III/2 II/2 IV/2 III/2 V/2 IV/2 VI/2 V/2 w', 'u', 'x'],
   197         -                    "x": ['VII3 z2 V/4 IV/4 V/4 IV/4 V/4 VI/4 II/4 II/4 II/4 I/4 II/2 u', 'w'],
   198     25                   },
   199     26                   "score": "u",
   200     27               },
   201     28               "rhythm": {
   202     29                   "score_line": "i1 %(time)f %(duration)f 7000 %(octave)d.%(note)s %(octave)d.%(note)s 0 6",
   203     30                   "octave": 7,
   204     31                   "duration": 44,
   205     32                   "grammars": {
   206         -                    "u": ['"I"/2 "V"/2 "vi"/2 "iii"/2 "IV"/2 "I"/2 "IV"/2 "V"/2 u u', "y"],
   207         -                    "y": ['"I"/2 "vi" "IV"/2 "V"/2 y y u'],
   208         -                },
   209         -                "score": "u u y y u",
   210         -            },
   211         -            "timbre": {
   212         -                "score_line": "i3 %(time)f %(duration)f 2000 %(octave)d.%(note)s 2 3 5 3",
   213         -                "octave": 6,
   214         -                "duration": 44,
   215         -                "grammars": {  # Notes for this instrument to use in this piece
   216         -                    "u": ['I2 VII2 V2 VI2 I2 IV/2 V/2 III2 u', 'I2 IV2 V2 IV I V2 III2 II2 u']
   217         -                },
   218         -                "score": "u u u u u",
   219         -            },
   220         -        },
   221         -        "timbre_solo": {  # Movement block 'a' for reuse throughout the piece
   222         -            "rhythm": {
   223         -                "score_line": "i1 %(time)f %(duration)f 7000 %(octave)d.%(note)s %(octave)d.%(note)s 0 6",
   224         -                "octave": 7,
   225         -                "duration": 30,
   226         -                "grammars": {
   227         -                    "u": ['"I"/2 "V"/2 "vi"/2 "iii"/2 "IV"/2 "I"/2 "IV"/2 "V"/2 u u', "y"],
   228         -                    "y": ['"I"/2 "vi" "IV"/2 "V"/2 y y u'],
   229         -                },
   230         -                "score": "u u y y u",
   231         -            },
   232         -            "timbre": {
   233         -                "score_line": "i3 %(time)f %(duration)f 2000 %(octave)d.%(note)s 2 3 5 3",
   234         -                "octave": 6,
   235         -                "duration": 30,
   236         -                "grammars": {  # Notes for this instrument to use in this piece
   237         -                    "u": ['I VI/2 VI/2 IV/2 u', "y"],
   238         -                    "w": ['VII/2 I/2 II/2 V/2 u', 'w w', 'u x'],
   239         -                    "x": ['VI/4 III/4 II/4 I/4 w', 'x x', 'x u'],
   240         -                    "y": ["III/4 VI/4 II/4 V/4 VI/4 IV/4 VII2 w", 'y y'],
           33  +                    "u": ['(I) (ii)/4 (ii)/4 (IV)/2 (V)2 (IV) (ii) u', '(I) (vii) (III) u', '(I) (v) (IV) u u'],
   241     34                   },
   242     35                   "score": "u",
   243     36               },
   244     37           },
   245         -        "outro1": {  # Movement block 'a' for reuse throughout the piece
   246         -            "melody": {  # Instrument 'melody'
   247         -                "score_line": "i2 %(time)f %(duration)f 7000 %(octave)d.%(note)s 2",
   248         -                "octave": 8,
   249         -                "duration": 20,
   250         -                "grammars": {  # Notes for this instrument to use in this piece
   251         -                    "u": ['I VII V III u', "y"],
   252         -                    "w": ['VII I IV V VI u', 'w w'],
   253         -                    "x": ['VI/4 III/4 II/4 I/4 w', 'x x'],
   254         -                    "y": ["III/4 VI/4 II/4 V/4 VI/4 IV/4 VII2"],
   255         -                },
   256         -                "score": "w w x x w",
   257         -            },
   258         -            "rhythm": {
   259         -                "score_line": "i1 %(time)f %(duration)f 7000 %(octave)d.%(note)s %(octave)d.%(note)s 0 6",
   260         -                "octave": 7,
   261         -                "duration": 26,
   262         -                "grammars": {
   263         -                    "u": ['"I" "V" "vi" "iii" "IV" "I" "IV" "V" u u', "y"],
   264         -                    "y": ['"I" "vi"2 "IV" "V" y y u'],
   265         -                },
   266         -                "score": "u u y y u",
   267         -            },
   268         -            "timbre": {
   269         -                "score_line": "i3 %(time)f %(duration)f 2000 %(octave)d.%(note)s 2 3 5 3",
   270         -                "octave": 6,
   271         -                "duration": 26,
   272         -                "grammars": {  # Notes for this instrument to use in this piece
   273         -                    "u": ['I2 VII2 V2 VI2 I2 IV/2 V/2 III2 u', 'I2 IV2 V2 IV I V2 III2 II2 u']
   274         -                },
   275         -                "score": "u u u u u",
   276         -            },
   277         -        },
   278         -        "outro2": {
   279         -            "rhythm": {
   280         -                "score_line": "i1 %(time)f %(duration)f 7000 %(octave)d.%(note)s %(octave)d.%(note)s 0 6",
   281         -                "octave": 7,
   282         -                "duration": 4,
   283         -                "grammars": {
   284         -                    "u": ['"I" "V" "vi" "iii" "IV" "I" "IV" "V" u u', "y"],
   285         -                    "y": ['"I" "vi"2 "IV" "V" y y u'],
   286         -                },
   287         -                "score": "u u y y u",
   288         -            },
   289         -        },
   290     38       }
   291     39   
   292     40       max_t = 0  # max time encountered so far. Used for movement timing
   293         -    progression = "intro1 intro2 overview a timbre_solo zelda1 b zelda2 outro1 outro2"
   294         -#    progression = "zelda1"
           41  +    progression = "overview"
   295     42       for comp_name in progression.split():
   296     43           comp_start_time = max_t
   297     44           for instr_name, instr in composition[comp_name].iteritems():
   298     45               generated_score = generate_score(instr["score"], instr["grammars"])  # Fill in the scores by generating them based on the grammars
   299     46   #            print generated_score
   300     47               score = parse.parse(generated_score, default_octave=instr["octave"])  # Return Node/Chord objects
   301     48   

Modified parse.py from [9c47a4ff24] to [3ec57c3fbe].

    15     15           self.value = value
    16     16           self.duration = duration
    17     17           self.chord_type = chord_type
    18     18           self.octave = octave
    19     19       def __repr__(self):
    20     20           return "Chord %s %s %s" % (self.value, self.duration, self.chord_type, self.octave)
    21     21   
    22         -
    23     22   class Rest():
    24     23       def __init__(self, duration=.25):
    25     24           self.duration = duration
    26     25       def __repr__(self):
    27     26           return "Rest node %s" % self.duration
    28     27   
    29     28   
................................................................................
    32     31       tokens = (
    33     32           "NOTE_LENGTH",
    34     33           "BASENOTE",
    35     34           "ACCIDENTAL",
    36     35           "REST",
    37     36           "OCTAVE",
    38     37           "CHORD_TYPE",
    39         -        "QUOTE",
           38  +        "PAREN",
           39  +        "SYNCOPATE",
    40     40       )
    41     41   
    42     42       t_ignore = " |"
    43     43   
    44     44       #t_BASENOTE = r"[A-Ga-g]"
    45     45       t_BASENOTE = r"I+V?|VI*|i+v?|vi*"
    46     46       t_ACCIDENTAL = r"\^{1,2}|_{1,2}|="
    47     47       t_REST = r"z"
    48     48       t_OCTAVE = r"'+|,+"
    49     49       t_CHORD_TYPE = r"m|7|m7|0|o|\+|mb5|sus|sus4|maj7|mmaj7|7sus4|dim|dim7|7b5|m7b5|6|b6|m6|mb6|46|maj9|9|add9|7b9|m9"
    50         -    t_QUOTE = '"'
           50  +    t_PAREN = "\(|\)"
           51  +    t_SYNCOPATE = "\+|-"
    51     52   
    52     53       def t_NOTE_LENGTH(t):
    53     54           r"/?\d+"
    54     55           multiplier = float(t.value.strip("/"))
    55     56           if t.value.startswith("/"):
    56     57               multiplier = 1/multiplier
    57     58           t.value = multiplier
    58     59           return t
    59     60   
    60     61       def t_error(t):
    61     62           raise TypeError("Unknown text '%s'" % (t.value,))
    62     63   
    63     64       lex.lex()
    64         -
    65         -    #lex.input("GFG B'AB,, | g/2fg gab | GFG BAB | d2A AFD")
    66         -    #s = "GFG B'AB,, | g/2fg gab | GFG BAB | d2A AFD"
    67         -    #s = '''I IV V VI I "I" "ii"/2'''
    68         -    #s = "GF_G,/2"
    69     65       lex.input(score)
    70         -    #for tok in iter(lex.token, None):
    71         -    #    print repr(tok.type), repr(tok.value)
    72     66   
    73     67   
    74     68       # Parse (yacc)
    75     69   
    76         -
    77         -    def p_pitch_list(p):
           70  +    def p_note_list(p):
    78     71           '''score : score note
    79         -            | score chord
    80         -            | score rest
           72  +                 | score chord
           73  +                 | score rest
    81     74           '''
    82     75           p[0] = p[1] + [p[2]]
    83     76   
    84     77       def p_score(p):
    85     78           '''score : note
    86         -            | chord
    87         -            | rest
           79  +                 | chord
           80  +                 | rest
    88     81           '''
    89     82           p[0] = [p[1]]
    90     83   
    91     84   
    92         -    def p_note(p):
    93         -        '''note : pitch
           85  +    def p_chord_length(p):
           86  +        ''' chord : chord NOTE_LENGTH
    94     87           '''
    95         -        p[0] = p[1]
           88  +        new_note = p[1]
           89  +        new_note.duration = p[2]
           90  +        p[0] = new_note
    96     91   
    97     92   
    98     93       def p_note_length(p):
    99     94           ''' note : note NOTE_LENGTH
   100     95           '''
   101     96           new_note = p[1]
   102     97           new_note.duration = p[2]
   103     98           p[0] = new_note
   104     99   
   105         -    def p_chord_length(p):
   106         -        ''' chord : chord NOTE_LENGTH
   107         -        '''
   108         -        new_note = p[1]
   109         -        new_note.duration = p[2]
   110         -        p[0] = new_note
   111         -
   112    100   
   113    101       def p_chord(p):
   114         -        '''chord : QUOTE pitch QUOTE
   115         -                | QUOTE pitch CHORD_TYPE QUOTE
          102  +        '''chord : PAREN note PAREN
          103  +                 | PAREN note CHORD_TYPE PAREN
   116    104           '''
   117    105           pitch = p[2].value
   118    106           pitch = pitch.upper()
   119    107           p[0] = Chord(value=pitch, octave=default_octave)
   120    108           if len(p) > 3:
   121    109               p[0].chord_type = p[3]
   122    110   
          111  +
          112  +    def p_note_syncopate(p):
          113  +        ''' note : note SYNCOPATE
          114  +        '''
          115  +        note.syncopate = p[2]
          116  +
   123    117   
   124    118       def p_accidental(p):
   125         -        '''pitch : ACCIDENTAL pitch
          119  +        '''note : ACCIDENTAL note
   126    120           '''
   127    121           p[2].accidental = p[1]
   128    122           p[0] = p[2]
   129    123   
   130         -    def p_pitch_octave(p):
   131         -        '''pitch : pitch OCTAVE
          124  +    def p_octave(p):
          125  +        '''note : note OCTAVE
   132    126           '''
   133    127           count = len(p[2])
   134    128           increment_or_decrement = 1 if p[2].startswith("'") else -1
   135    129           p[1].octave += (count * increment_or_decrement)
   136    130           p[0] = p[1]
   137    131   
   138         -    def p_pitch(p):
   139         -        '''pitch : BASENOTE
          132  +    def p_note(p):
          133  +        '''note : BASENOTE
   140    134           '''
   141    135           p[0] = Note(p[1], octave=default_octave)
   142    136   
   143    137       def p_rest(p):
   144    138           ''' rest : REST
   145         -                | REST NOTE_LENGTH
          139  +                 | REST NOTE_LENGTH
   146    140           '''
   147    141           p[0] = Rest()
   148    142           if len(p) > 2:
   149    143               p[0].duration = p[2]
   150    144   
   151    145       def p_error(p):
   152    146           raise Exception("Syntax error at '%s' of element type %s" % (p.value, p.type))
   153    147           
   154    148       yacc.yacc()
   155    149   
   156         -    #print yacc.parse("GFG B'AB,, | g/2fg gab | GFG BAB | d2A AFD")
   157    150       return yacc.parse(score)

Modified todo.org from [bc98f41fc3] to [510751b73f].

     6      6   - [ ] Need to support all chord types
     7      7   - [X] Doesn't handle rest notes
     8      8   - [ ] Handle full ABC BNF (yeah, right, that's gonna happen...)
     9      9   - [X] Set instrument octave in score file
    10     10   - [ ] Output score to separate file
    11     11   - [ ] Support parallel voices - ensure e.g. a certain chord progression is always
    12     12     accompanied by a certain melody
           13  +- [ ] Syncopation
           14  +- [ ] Sustain option for notes (give score notation a sustain symbol, and use it to set how long after the notes's duration to keep holding. With sustain, the next note's start time isn't done by when the current note ends. 
    13     15   
    14     16   * Bugs [5/6]
    15     17   - [X] TLD resets clock for each movement
    16     18   - [X] TLD doesn't accept an ordering for the movements
    17     19   - [X] Doesn't handle minor chords    
    18     20   - [X] Calculated duration is absolute, not relative to BPM
    19     21   - [X] Chords don't respect octaves