spiffyscore

Check-in [ff85cece1d]
Login
Overview
Comment:Can now set an instrument's default octave beside the instrument's score
Timelines: family | ancestors | descendants | both | master
Files: files | file ages | folders
SHA1: ff85cece1dc2388809b14e8cfc4a74eff1442616
User & Date: spiffytech@gmail.com on 2010-11-18 03:10:24
Other Links: branch diff | manifest | tags
Context
2010-11-18
16:06
Did some composing stuff check-in: 1987470dfc user: spiffytech@gmail.com tags: master
03:10
Can now set an instrument's default octave beside the instrument's score check-in: ff85cece1d user: spiffytech@gmail.com tags: master
03:04
Bug: octave modifiers (,') were acting as (up,down) not (down,up) check-in: e6bf0dbf82 user: spiffytech@gmail.com tags: master
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Modified cfg.py from [2306af4935] to [8500dd2d15].

    14     14       tempo = 1/bps
    15     15       max_duration = 1
    16     16   
    17     17       composition = {
    18     18           "a": {  # Movement block 'a' for reuse throughout the piece
    19     19               "bassline": {  # Instrument 'melody'
    20     20                   "score_line": "i1 %(time)f %(duration)f 10000 %(octave)d.%(note)s",
    21         -                "octave": 6,
           21  +                "octave": 5,
    22     22                   "grammars": {  # Notes for this instrument to use in this piece
    23         -                    "u": ["I,/2 z/2 I,/2 z/2 I,/2 z/2 V,/2 z/2 u u", "e"],
           23  +                    "u": ["I/2 z/2 I/2 z/2 I/2 z/2 V/2 z/2 u u", "e"],
    24     24                       "e": [""],
    25     25                   },
    26     26                   "score": "u u u u u",
    27     27               },
    28     28           },
    29     29       }
    30     30   

Modified parse.py from [40393160ad] to [668286027e].

   127    127           p[0] = p[2]
   128    128   
   129    129       def p_octave(p):
   130    130           '''pitch : pitch OCTAVE
   131    131           '''
   132    132           count = len(p[2])
   133    133           increment_or_decrement = 1 if p[2][0] == "'" else -1
   134         -        print "octave=", default_octave
   135         -        octave = default_octave + (count * increment_or_decrement)
          134  +        octave = p[1].octave + (count * increment_or_decrement)
   136    135           p[1].octave = octave
   137    136           p[0] = p[1]
   138    137   
   139    138       def p_pitch(p):
   140    139           '''pitch : BASENOTE
   141    140           '''
   142         -        p[0] = Note(p[1])
          141  +        p[0] = Note(p[1], octave=default_octave)
   143    142   
   144    143       def p_rest(p):
   145    144           ''' rest : REST
   146    145                   | REST NOTE_LENGTH
   147    146           '''
   148    147           p[0] = Rest()
   149    148           if len(p) > 2:

Modified test.sco from [c2061b1574] to [5fa24f6626].

     1         -octave= 6
     2         -octave= 6
     3         -octave= 6
     4         -octave= 6
     5         -octave= 6
     6         -octave= 6
     7         -octave= 6
     8         -octave= 6
     9         -octave= 6
    10         -octave= 6
    11         -octave= 6
    12         -octave= 6
    13         -octave= 6
    14         -octave= 6
    15         -octave= 6
    16         -octave= 6
    17      1   f1  0  512  10  1
    18      2   i1 0.000000 0.500000 10000 5.09
    19      3   i1 1.000000 0.500000 10000 5.09
    20      4   i1 2.000000 0.500000 10000 5.09
    21      5   i1 3.000000 0.500000 10000 5.04
    22      6   i1 4.000000 0.500000 10000 5.09
    23      7   i1 5.000000 0.500000 10000 5.09
................................................................................
    27     11   i1 9.000000 0.500000 10000 5.09
    28     12   i1 10.000000 0.500000 10000 5.09
    29     13   i1 11.000000 0.500000 10000 5.04
    30     14   i1 12.000000 0.500000 10000 5.09
    31     15   i1 13.000000 0.500000 10000 5.09
    32     16   i1 14.000000 0.500000 10000 5.09
    33     17   i1 15.000000 0.500000 10000 5.04
           18  +i1 16.000000 0.500000 10000 5.09
           19  +i1 17.000000 0.500000 10000 5.09
           20  +i1 18.000000 0.500000 10000 5.09
           21  +i1 19.000000 0.500000 10000 5.04
           22  +i1 20.000000 0.500000 10000 5.09
           23  +i1 21.000000 0.500000 10000 5.09
           24  +i1 22.000000 0.500000 10000 5.09
           25  +i1 23.000000 0.500000 10000 5.04
           26  +i1 24.000000 0.500000 10000 5.09
           27  +i1 25.000000 0.500000 10000 5.09
           28  +i1 26.000000 0.500000 10000 5.09
           29  +i1 27.000000 0.500000 10000 5.04
           30  +i1 28.000000 0.500000 10000 5.09
           31  +i1 29.000000 0.500000 10000 5.09
           32  +i1 30.000000 0.500000 10000 5.09
           33  +i1 31.000000 0.500000 10000 5.04
           34  +i1 32.000000 0.500000 10000 5.09
           35  +i1 33.000000 0.500000 10000 5.09
           36  +i1 34.000000 0.500000 10000 5.09
           37  +i1 35.000000 0.500000 10000 5.04
           38  +i1 36.000000 0.500000 10000 5.09
           39  +i1 37.000000 0.500000 10000 5.09
           40  +i1 38.000000 0.500000 10000 5.09
           41  +i1 39.000000 0.500000 10000 5.04
           42  +i1 40.000000 0.500000 10000 5.09
           43  +i1 41.000000 0.500000 10000 5.09
           44  +i1 42.000000 0.500000 10000 5.09
           45  +i1 43.000000 0.500000 10000 5.04
           46  +i1 44.000000 0.500000 10000 5.09
           47  +i1 45.000000 0.500000 10000 5.09
           48  +i1 46.000000 0.500000 10000 5.09
           49  +i1 47.000000 0.500000 10000 5.04
           50  +i1 48.000000 0.500000 10000 5.09
           51  +i1 49.000000 0.500000 10000 5.09
           52  +i1 50.000000 0.500000 10000 5.09
           53  +i1 51.000000 0.500000 10000 5.04
           54  +i1 52.000000 0.500000 10000 5.09
           55  +i1 53.000000 0.500000 10000 5.09
           56  +i1 54.000000 0.500000 10000 5.09
           57  +i1 55.000000 0.500000 10000 5.04
           58  +i1 56.000000 0.500000 10000 5.09
           59  +i1 57.000000 0.500000 10000 5.09
           60  +i1 58.000000 0.500000 10000 5.09
           61  +i1 59.000000 0.500000 10000 5.04
           62  +i1 60.000000 0.500000 10000 5.09
           63  +i1 61.000000 0.500000 10000 5.09
           64  +i1 62.000000 0.500000 10000 5.09
           65  +i1 63.000000 0.500000 10000 5.04
           66  +i1 64.000000 0.500000 10000 5.09
           67  +i1 65.000000 0.500000 10000 5.09
           68  +i1 66.000000 0.500000 10000 5.09
           69  +i1 67.000000 0.500000 10000 5.04
           70  +i1 68.000000 0.500000 10000 5.09
           71  +i1 69.000000 0.500000 10000 5.09
           72  +i1 70.000000 0.500000 10000 5.09
           73  +i1 71.000000 0.500000 10000 5.04
           74  +i1 72.000000 0.500000 10000 5.09
           75  +i1 73.000000 0.500000 10000 5.09
           76  +i1 74.000000 0.500000 10000 5.09
           77  +i1 75.000000 0.500000 10000 5.04
           78  +i1 76.000000 0.500000 10000 5.09
           79  +i1 77.000000 0.500000 10000 5.09
           80  +i1 78.000000 0.500000 10000 5.09
           81  +i1 79.000000 0.500000 10000 5.04
           82  +i1 80.000000 0.500000 10000 5.09
           83  +i1 81.000000 0.500000 10000 5.09
           84  +i1 82.000000 0.500000 10000 5.09
           85  +i1 83.000000 0.500000 10000 5.04
           86  +i1 84.000000 0.500000 10000 5.09
           87  +i1 85.000000 0.500000 10000 5.09
           88  +i1 86.000000 0.500000 10000 5.09
           89  +i1 87.000000 0.500000 10000 5.04

Modified todo.org from [f88a59ddf7] to [d5cbe62893].

     1         -* Features [2/9]
            1  +* Features [3/9]
     2      2   - [X] Top-down composition
     3      3   - [ ] Coordinate the melody and rhythm
     4      4   - [ ] Set maximum song length of movement
     5      5   - [ ] Set minimum song length of movement
     6      6   - [ ] Get all tracks to end at the same time
     7      7   - [ ] Need to support all chord types
     8      8   - [X] Doesn't handle rest notes
     9      9   - [ ] Handle full ABC BNF (yeah, right...)
    10         -- [ ] Set instrument octave in score file
           10  +- [X] Set instrument octave in score file
    11     11   
    12     12   * Bugs [4/5]
    13     13   - [X] TLD resets clock for each movement
    14     14   - [X] TLD doesn't accept an ordering for the movements
    15     15   - [X] Doesn't handle minor chords    
    16     16   - [X] Calculated duration is absolute, not relative to BPM
    17     17   - [ ] Chords don't respect octaves
    18     18   
    19     19   
    20     20   * Structure [1/3]    
    21     21   - [ ] Chords should be composed of Notes, not ordinary arrays
    22     22   - [ ] Generate score with proper generation tools
    23     23   - [X] Store csound score lines with instruments