spiffyscore

Check-in [1560bc634c]
Login
Overview
Comment:Added back in section ordering support
Timelines: family | ancestors | descendants | both | feature/abc
Files: files | file ages | folders
SHA1: 1560bc634c7c6dec751c0500506291957dcb091f
User & Date: brian on 2011-09-22 17:44:23
Other Links: branch diff | manifest | tags
Context
2011-09-22
17:46
Added back in section ordering support check-in: 6dd4fffb1d user: brian tags: feature/abc
17:44
Added back in section ordering support check-in: 1560bc634c user: brian tags: feature/abc
17:04
Finally broke the program out into functions. It's now much cleaner and easier to underntand. check-in: 3cac4f013d user: brian tags: feature/abc
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Modified cfg.py from [77ab4fec9b] to [b052479df1].

    30     30                   "score_line": "i2 %(time)f %(duration)f 7000 %(octave)d.%(note)s 2",
    31     31                   "octave": 8,
    32     32                   "duration": 10,
    33     33                   "grammars": {  # Notes for this instrument to use in this piece
    34     34                       "u": ["C C C C F/2 F/2 F/2 (u)", "D D G/2 A/2 D D (u)"],
    35     35                   },
    36     36               },
           37  +            "harmony": {  # Instrument 'melody'
           38  +                "score_line": "i2 %(time)f %(duration)f 7000 %(octave)d.%(note)s 2",
           39  +                "octave": 8,
           40  +                "duration": 10,
           41  +                "grammars": {  # Notes for this instrument to use in this piece
           42  +                    "u": ["C C C C F/2 F/2 F/2 (u)", "D D G/2 A/2 D D (u)"],
           43  +                },
           44  +            },
    37     45           },
    38     46       }
    39     47       print '''f1 0 512 10 1
    40     48   f2 0 8192 10 .24 .64 .88 .76 .06 .5 .34 .08
    41     49   f3 0 1025 10 1
    42     50   t 0 60
    43     51       '''
    44     52   
    45     53       start = 0
    46         -    for section in composition.values():
           54  +    for section in ["verse1", "verse2"]:
           55  +        section = composition[section]
    47     56   #        for subsection in section
    48     57           instrs = []
    49     58           for instr in section.values():
    50     59               sync = None
    51     60               max_time = instr["duration"]
    52     61               instr_score = render_instr(instr, sync, max_time)
    53     62               instrs.append(instr_score)

Modified test.sco from [4da964b4dc] to [00c6c84bf8].

     1         -f1  0  512  10  1
     2         -            f2 0 8192 10 .24 .64 .88 .76 .06 .5 .34 .08
     3         -            f3 0 1025 10 1
     4         -            t 0 60
            1  +f1 0 512 10 1
            2  +f2 0 8192 10 .24 .64 .88 .76 .06 .5 .34 .08
            3  +f3 0 1025 10 1
            4  +t 0 60
     5      5       
     6      6   i2 0.000000 0.250000 7000 8.00 2
     7      7   i2 0.250000 0.500000 7000 8.07 2
     8      8   i2 0.750000 0.500000 7000 8.07 2
     9      9   i2 1.250000 0.500000 7000 8.07 2
    10     10   i2 1.750000 0.250000 7000 8.00 2
    11     11   i2 2.000000 0.250000 7000 7.11 2
................................................................................
    16     16   i2 3.250000 0.250000 7000 8.11 2
    17     17   i2 3.500000 0.250000 7000 8.04 2
    18     18   i2 3.750000 0.250000 7000 8.09 2
    19     19   i2 4.000000 0.250000 7000 8.02 2
    20     20   i2 4.250000 0.250000 7000 8.07 2
    21     21   i2 4.500000 0.250000 7000 8.05 2
    22     22   i2 4.750000 0.250000 7000 8.05 2
    23         -i2 5.000000 0.250000 7000 8.00 2
    24         -i2 5.250000 0.500000 7000 8.07 2
    25         -i2 5.750000 0.500000 7000 8.07 2
    26         -i2 6.250000 0.500000 7000 8.07 2
    27         -i2 6.750000 0.250000 7000 8.00 2
    28         -i2 7.000000 0.250000 7000 7.11 2
    29         -i2 7.250000 0.250000 7000 9.05 2
           23  +i2 5.000000 2.000000 7000 8.11 2
           24  +i2 7.000000 0.250000 7000 8.00 2
           25  +i2 7.250000 0.250000 7000 8.00 2
    30     26   i2 7.500000 0.250000 7000 8.00 2
    31         -i2 7.750000 0.250000 7000 8.05 2
    32         -i2 8.000000 0.250000 7000 8.00 2
    33         -i2 8.250000 0.250000 7000 8.11 2
    34         -i2 8.500000 0.250000 7000 8.04 2
    35         -i2 8.750000 0.250000 7000 8.09 2
    36         -i2 9.000000 0.250000 7000 8.02 2
    37         -i2 9.250000 0.250000 7000 8.07 2
    38         -i2 9.500000 0.250000 7000 8.05 2
    39         -i2 9.750000 0.250000 7000 8.05 2
    40         -i2 10.000000 2.000000 7000 8.11 2
    41         -i2 12.000000 0.250000 7000 8.00 2
    42         -i2 12.250000 0.250000 7000 8.00 2
    43         -i2 12.500000 0.250000 7000 8.00 2
    44         -i2 12.750000 0.250000 7000 8.00 2
    45         -i2 13.000000 0.500000 7000 8.05 2
    46         -i2 13.500000 0.500000 7000 8.05 2
    47         -i2 14.000000 0.250000 7000 8.00 2
    48         -i2 14.250000 0.250000 7000 8.00 2
    49         -i2 14.500000 0.250000 7000 8.00 2
    50         -i2 14.750000 0.250000 7000 8.00 2
    51         -i2 15.000000 0.500000 7000 8.05 2
    52         -i2 15.500000 0.500000 7000 8.05 2
    53         -i2 16.000000 0.250000 7000 8.00 2
    54         -i2 16.250000 0.250000 7000 8.00 2
    55         -i2 16.500000 0.250000 7000 8.00 2
    56         -i2 16.750000 0.250000 7000 8.00 2
    57         -i2 17.000000 0.500000 7000 8.05 2
    58         -i2 17.500000 0.500000 7000 8.05 2
    59         -i2 18.000000 0.250000 7000 8.00 2
    60         -i2 18.250000 0.250000 7000 8.00 2
    61         -i2 18.500000 0.250000 7000 8.00 2
    62         -i2 18.750000 0.250000 7000 8.00 2
    63         -i2 19.000000 0.500000 7000 8.05 2
    64         -i2 19.500000 0.500000 7000 8.05 2
    65         -i2 20.000000 0.250000 7000 8.00 2
    66         -i2 20.250000 0.250000 7000 8.00 2
    67         -i2 20.500000 0.250000 7000 8.00 2
    68         -i2 20.750000 0.250000 7000 8.00 2
    69         -i2 21.000000 0.500000 7000 8.05 2
    70         -i2 21.500000 0.500000 7000 8.05 2
    71         -i2 22.000000 0.500000 7000 8.05 2
           27  +i2 7.750000 0.250000 7000 8.00 2
           28  +i2 8.000000 0.500000 7000 8.05 2
           29  +i2 8.500000 0.500000 7000 8.05 2
           30  +i2 9.000000 0.250000 7000 8.00 2
           31  +i2 9.250000 0.250000 7000 8.00 2
           32  +i2 9.500000 0.250000 7000 8.00 2
           33  +i2 9.750000 0.250000 7000 8.00 2
           34  +i2 10.000000 0.500000 7000 8.05 2
           35  +i2 10.500000 0.500000 7000 8.05 2
           36  +i2 11.000000 0.500000 7000 8.05 2
           37  +i2 7.000000 0.250000 7000 8.02 2
           38  +i2 7.250000 0.250000 7000 8.02 2
           39  +i2 7.500000 0.500000 7000 8.07 2
           40  +i2 8.000000 0.500000 7000 8.09 2
           41  +i2 8.500000 0.250000 7000 8.02 2
           42  +i2 8.750000 3.000000 7000 8.02 2