Differences From Artifact [e38fca44a4081b93]:
- Executable file
cfg.py
- 2010-11-12 20:23:05 - part of checkin [00f4ddc9f3] on branch ply - Now prints score file header (function table), so I can just >> to foo.sco (user: spiffytech@gmail.com) [annotate]
To Artifact [14f13b1d15cd9a4c]:
- Executable file
cfg.py
- 2010-11-12 20:27:20 - part of checkin [3cd7a5dcd0] on branch ply - Added a few grammars, added G# to csound note conversion list (user: spiffytech@gmail.com) [annotate]
3 import os 3 import os
4 import random 4 import random
5 import sys 5 import sys
6 import time 6 import time
7 random.seed(time.time()) 7 random.seed(time.time())
8 8
9 grammars = { 9 grammars = {
10 "u": ["I V I IV u", "e"], | 10 "u": ["I V I IV u", "I IV", "I VII IV" , "e"],
11 "e": [""], 11 "e": [""],
12 } 12 }
13 13
14 14
15 def main(): 15 def main():
16 score = "u u u" 16 score = "u u u"
17 key = "C" | 17 key = "G#"
18 score = generate_score(score) 18 score = generate_score(score)
19 score = keyify_score(score, key) 19 score = keyify_score(score, key)
20 score = generate_csound_score(score) 20 score = generate_csound_score(score)
21 print "f1 0 256 10 1 0 3 ; sine wave function table" 21 print "f1 0 256 10 1 0 3 ; sine wave function table"
22 for line in score: 22 for line in score:
23 print line 23 print line
24 24
................................................................................................................................................................................
70 "C#": "01", 70 "C#": "01",
71 "D": "02", 71 "D": "02",
72 "D#": "03", 72 "D#": "03",
73 "E": "04", 73 "E": "04",
74 "F": "05", 74 "F": "05",
75 "F#": "06", 75 "F#": "06",
76 "G": "07", 76 "G": "07",
77 "F#": "08", | 77 "G#": "08",
78 "A": "09", 78 "A": "09",
79 "A#": "10", 79 "A#": "10",
80 "B": "11", 80 "B": "11",
81 } 81 }
82 t = 0 82 t = 0
83 csound_score = [] 83 csound_score = []
84 for token in score: 84 for token in score: