Overview
| Comment: | Fixed program to now handle notes with accidentals |
|---|---|
| Timelines: | family | ancestors | descendants | both | feature/diskin2 |
| Files: | files | file ages | folders |
| SHA1: |
b5a8b202425e299491f6a7e3d9f1dd75 |
| User & Date: | brian on 2011-11-03 18:34:00.738 |
| Other Links: | branch diff | manifest | tags |
Context
|
2011-11-03
| ||
| 18:49 | By magic, fixed problem with not all bass notes playing via diskin2 Closed-Leaf check-in: 1bc01ba9c9 user: brian tags: feature/diskin2 | |
| 18:34 | Fixed program to now handle notes with accidentals check-in: b5a8b20242 user: brian tags: feature/diskin2 | |
|
2011-11-01
| ||
| 19:46 | Got diskin2 sample method partially working; it won't play all of the files, though check-in: c9abf46a9f user: brian tags: feature/diskin2 | |
Changes
Modified parse.py
from [2afbfc4534]
to [a8d0994825].
1 2 3 4 5 6 7 8 9 10 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | - |
#!/usr/bin/env python
import tree
from ply import lex, yacc
class Note():
def __init__(self, value, duration=1, octave=8):
self.value = value
self.duration = duration
self.octave = octave
|
| ︙ | |||
42 43 44 45 46 47 48 | 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | - + |
"NODE",
)
t_ignore = " |"
t_BASENOTE = r"[A-Ga-g]"
# t_BASENOTE = r"I+V?|VI*|i+v?|vi*"
|
| ︙ | |||
120 121 122 123 124 125 126 | 119 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
'''
|
| ︙ | |||
151 152 153 154 155 156 157 158 159 160 161 162 163 | 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 | + + |
def p_node(p):
'''node : NODE
'''
p[0] = tree.Tree(p[1].strip("(").strip(")"))
def p_error(p):
# import ipdb
# ipdb.set_trace()
print p
raise Exception("Syntax error at '%s' of element type %s" % (p.value, p.type))
yacc.yacc()
return yacc.parse(score)
|
Modified spiffyscore.py
from [7509ae0a18]
to [d189f30210].
| ︙ | |||
117 118 119 120 121 122 123 | 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 | + - - - + + + |
# },
"follow_instr": { # Instrument 'melody'
"score_line": "i3 %(time)f %(duration)f 7000 %(octave)d.%(note)s",
# "sync": "lead_instr",
"octave": 2,
"duration": 30,
"grammars": { # Notes for this instrument to use in this piece
"u": ["A ^A B C ^C D ^D E F ^F G ^G"],
|
| ︙ | |||
253 254 255 256 257 258 259 | 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 | - + - + - + - + - + + |
total += n.duration
return total
def generate_csound_score(score, score_line, t):
csound_note_values = {
"C": "00",
|