spiffyscore

Check-in [bf135b5321]
Login
Overview
Comment:Fixed a bug that prevented sharps and flats from working
Timelines: family | ancestors | descendants | both | develop
Files: files | file ages | folders
SHA1: bf135b5321a32d06a8953b74eafbd80e84af8b4f
User & Date: brian on 2011-11-27 02:26:33
Other Links: branch diff | manifest | tags
Context
2011-11-27
02:56
Fixed chord support check-in: 8f28834102 user: brian tags: develop
02:26
Fixed a bug that prevented sharps and flats from working check-in: bf135b5321 user: brian tags: develop
02:03
Added a volume offset parameter to each instrument. Fixed a bug that kept instruments from always being rendered, and one that broke midi files. check-in: 821ac3e4d6 user: brian tags: develop
Changes

Modified parse.py from [ce9611a745] to [4cca2f3d0c].

120
121
122
123
124
125
126
127
128

129
130
131
132
133
134
135
136
        note.syncopate = p[2]


    def p_accidental(p):
        '''note : ACCIDENTAL note
        '''
        if p[1] == "^":
            p[0] = p[2].value + 1
        else:

            p[0] = p[2].value - 1

    def p_octave(p):
        '''note : note OCTAVE
        '''
        count = len(p[2])
        increment_or_decrement = 1 if p[2].startswith("'") else -1
        p[1].octave += (count * increment_or_decrement)







|

>
|







120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
        note.syncopate = p[2]


    def p_accidental(p):
        '''note : ACCIDENTAL note
        '''
        if p[1] == "^":
            p[2].value += 1
        else:
            p[2].value -= 1
        p[0] = p[2]

    def p_octave(p):
        '''note : note OCTAVE
        '''
        count = len(p[2])
        increment_or_decrement = 1 if p[2].startswith("'") else -1
        p[1].octave += (count * increment_or_decrement)

Modified spiffyscore.py from [58892e1cd4] to [8b19298d3a].

17
18
19
20
21
22
23








24
25
26
27
28
29
30
31
random.seed(time.time())
mymidi = midifile(15)

def main():
    composition = {
        "intro": {
            "body": {








                "pan_flute": {  # Instrument 'melody'
                    "channel": 8,
                    "octave": 5,
                    "duration": 60,
                    "grammars": {  # Notes for this instrument to use in this piece
                        "u": ["C2' B2 | A3 D3 || B | C' | D | C2' C2' | z | (u)", "C2' C2' | C2' C2' | (x)"],
                        "v": ["G2 F2 | E2 F2 | D5 (u)", "B/4 C/4' B/4 A/4 | D2 D2 | z | (u)"],
                        "x": ["z4 | (v)"],







>
>
>
>
>
>
>
>
|







17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
random.seed(time.time())
mymidi = midifile(15)

def main():
    composition = {
        "intro": {
            "body": {
                "percusion": {
                    "channel": 14,
                    "octave": 4,
                    "duration": 60,
                    "grammars": {
                        "u": ["A ^A (u)"]
                    }
                },
                "pan_flute": {
                    "channel": 8,
                    "octave": 5,
                    "duration": 60,
                    "grammars": {  # Notes for this instrument to use in this piece
                        "u": ["C2' B2 | A3 D3 || B | C' | D | C2' C2' | z | (u)", "C2' C2' | C2' C2' | (x)"],
                        "v": ["G2 F2 | E2 F2 | D5 (u)", "B/4 C/4' B/4 A/4 | D2 D2 | z | (u)"],
                        "x": ["z4 | (v)"],