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)
|