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