spiffyscore

Diff
Login

Differences From Artifact [a8d0994825]:

To Artifact [bcac1af73f]:


120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142










143
144
145
146
147
148
149
150
        note.syncopate = p[2]


    def p_accidental(p):
        '''note : ACCIDENTAL note
        '''
        if p[1] == "^":
            p[2].value += "#"
        else:
            p[2].value += "b"
        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)
        p[0] = p[1]

    def p_note(p):
        '''note : BASENOTE
        '''










        p[0] = Note(p[1], octave=default_octave)

    def p_rest(p):
        ''' rest : REST
                 | REST NOTE_LENGTH
        '''
        p[0] = Rest()
        if len(p) > 2:







|

<
|












>
>
>
>
>
>
>
>
>
>
|







120
121
122
123
124
125
126
127
128

129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
        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)
        p[0] = p[1]

    def p_note(p):
        '''note : BASENOTE
        '''
        notes = {
            "C": 0,
            "D": 2,
            "E": 4,
            "F": 5,
            "G": 7,
            "A": 9,
            "B": 11
        }
        n = notes[p[1]]
        p[0] = Note(n, octave=default_octave)

    def p_rest(p):
        ''' rest : REST
                 | REST NOTE_LENGTH
        '''
        p[0] = Rest()
        if len(p) > 2: