Index: cfg.py ================================================================== --- cfg.py +++ cfg.py @@ -16,13 +16,13 @@ composition = { "a": { # Movement block 'a' for reuse throughout the piece "bassline": { # Instrument 'melody' "score_line": "i1 %(time)f %(duration)f 10000 %(octave)d.%(note)s", - "octave": 6, + "octave": 5, "grammars": { # Notes for this instrument to use in this piece - "u": ["I,/2 z/2 I,/2 z/2 I,/2 z/2 V,/2 z/2 u u", "e"], + "u": ["I/2 z/2 I/2 z/2 I/2 z/2 V/2 z/2 u u", "e"], "e": [""], }, "score": "u u u u u", }, }, Index: parse.py ================================================================== --- parse.py +++ parse.py @@ -129,19 +129,18 @@ def p_octave(p): '''pitch : pitch OCTAVE ''' count = len(p[2]) increment_or_decrement = 1 if p[2][0] == "'" else -1 - print "octave=", default_octave - octave = default_octave + (count * increment_or_decrement) + octave = p[1].octave + (count * increment_or_decrement) p[1].octave = octave p[0] = p[1] def p_pitch(p): '''pitch : BASENOTE ''' - p[0] = Note(p[1]) + p[0] = Note(p[1], octave=default_octave) def p_rest(p): ''' rest : REST | REST NOTE_LENGTH ''' Index: test.sco ================================================================== --- test.sco +++ test.sco @@ -1,21 +1,5 @@ -octave= 6 -octave= 6 -octave= 6 -octave= 6 -octave= 6 -octave= 6 -octave= 6 -octave= 6 -octave= 6 -octave= 6 -octave= 6 -octave= 6 -octave= 6 -octave= 6 -octave= 6 -octave= 6 f1 0 512 10 1 i1 0.000000 0.500000 10000 5.09 i1 1.000000 0.500000 10000 5.09 i1 2.000000 0.500000 10000 5.09 i1 3.000000 0.500000 10000 5.04 @@ -29,5 +13,77 @@ i1 11.000000 0.500000 10000 5.04 i1 12.000000 0.500000 10000 5.09 i1 13.000000 0.500000 10000 5.09 i1 14.000000 0.500000 10000 5.09 i1 15.000000 0.500000 10000 5.04 +i1 16.000000 0.500000 10000 5.09 +i1 17.000000 0.500000 10000 5.09 +i1 18.000000 0.500000 10000 5.09 +i1 19.000000 0.500000 10000 5.04 +i1 20.000000 0.500000 10000 5.09 +i1 21.000000 0.500000 10000 5.09 +i1 22.000000 0.500000 10000 5.09 +i1 23.000000 0.500000 10000 5.04 +i1 24.000000 0.500000 10000 5.09 +i1 25.000000 0.500000 10000 5.09 +i1 26.000000 0.500000 10000 5.09 +i1 27.000000 0.500000 10000 5.04 +i1 28.000000 0.500000 10000 5.09 +i1 29.000000 0.500000 10000 5.09 +i1 30.000000 0.500000 10000 5.09 +i1 31.000000 0.500000 10000 5.04 +i1 32.000000 0.500000 10000 5.09 +i1 33.000000 0.500000 10000 5.09 +i1 34.000000 0.500000 10000 5.09 +i1 35.000000 0.500000 10000 5.04 +i1 36.000000 0.500000 10000 5.09 +i1 37.000000 0.500000 10000 5.09 +i1 38.000000 0.500000 10000 5.09 +i1 39.000000 0.500000 10000 5.04 +i1 40.000000 0.500000 10000 5.09 +i1 41.000000 0.500000 10000 5.09 +i1 42.000000 0.500000 10000 5.09 +i1 43.000000 0.500000 10000 5.04 +i1 44.000000 0.500000 10000 5.09 +i1 45.000000 0.500000 10000 5.09 +i1 46.000000 0.500000 10000 5.09 +i1 47.000000 0.500000 10000 5.04 +i1 48.000000 0.500000 10000 5.09 +i1 49.000000 0.500000 10000 5.09 +i1 50.000000 0.500000 10000 5.09 +i1 51.000000 0.500000 10000 5.04 +i1 52.000000 0.500000 10000 5.09 +i1 53.000000 0.500000 10000 5.09 +i1 54.000000 0.500000 10000 5.09 +i1 55.000000 0.500000 10000 5.04 +i1 56.000000 0.500000 10000 5.09 +i1 57.000000 0.500000 10000 5.09 +i1 58.000000 0.500000 10000 5.09 +i1 59.000000 0.500000 10000 5.04 +i1 60.000000 0.500000 10000 5.09 +i1 61.000000 0.500000 10000 5.09 +i1 62.000000 0.500000 10000 5.09 +i1 63.000000 0.500000 10000 5.04 +i1 64.000000 0.500000 10000 5.09 +i1 65.000000 0.500000 10000 5.09 +i1 66.000000 0.500000 10000 5.09 +i1 67.000000 0.500000 10000 5.04 +i1 68.000000 0.500000 10000 5.09 +i1 69.000000 0.500000 10000 5.09 +i1 70.000000 0.500000 10000 5.09 +i1 71.000000 0.500000 10000 5.04 +i1 72.000000 0.500000 10000 5.09 +i1 73.000000 0.500000 10000 5.09 +i1 74.000000 0.500000 10000 5.09 +i1 75.000000 0.500000 10000 5.04 +i1 76.000000 0.500000 10000 5.09 +i1 77.000000 0.500000 10000 5.09 +i1 78.000000 0.500000 10000 5.09 +i1 79.000000 0.500000 10000 5.04 +i1 80.000000 0.500000 10000 5.09 +i1 81.000000 0.500000 10000 5.09 +i1 82.000000 0.500000 10000 5.09 +i1 83.000000 0.500000 10000 5.04 +i1 84.000000 0.500000 10000 5.09 +i1 85.000000 0.500000 10000 5.09 +i1 86.000000 0.500000 10000 5.09 +i1 87.000000 0.500000 10000 5.04 Index: todo.org ================================================================== --- todo.org +++ todo.org @@ -1,15 +1,15 @@ -* Features [2/9] +* Features [3/9] - [X] Top-down composition - [ ] Coordinate the melody and rhythm - [ ] Set maximum song length of movement - [ ] Set minimum song length of movement - [ ] Get all tracks to end at the same time - [ ] Need to support all chord types - [X] Doesn't handle rest notes - [ ] Handle full ABC BNF (yeah, right...) -- [ ] Set instrument octave in score file +- [X] Set instrument octave in score file * Bugs [4/5] - [X] TLD resets clock for each movement - [X] TLD doesn't accept an ordering for the movements - [X] Doesn't handle minor chords