spiffyscore

Check-in [6bfc2449ff]
Login

Check-in [6bfc2449ff]

Overview
Comment:Generates a score randomly. Too little guarantee of program length (lots of empty or single-phrase strings)
Timelines: family | descendants | ply | trunk
Files: files | file ages | folders
SHA1: 6bfc2449ff2cdddfb1c1e6c77ef4525b1f6dac94
User & Date: spiffytech@gmail.com on 2010-11-04 20:07:05
Other Links: branch diff | manifest | tags
Context
2011-10-20
18:44
Yay, first alpha release. program supports syncing and basic section/subsection ordering. Leaf check-in: ba64e400ba user: brian tags: trunk, v0.1
2010-11-12
20:00
Program now generates a single voice with a I IV V pattern and spits out (among other things) the csound-ified score check-in: 338933c1a8 user: spiffytech@gmail.com tags: ply
2010-11-04
20:07
Generates a score randomly. Too little guarantee of program length (lots of empty or single-phrase strings) check-in: 6bfc2449ff user: spiffytech@gmail.com tags: ply, trunk
Changes

Added cfg.py version [8ccb7c15cb].





























































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env python

import os
import random
import sys
import time
random.seed(time.time())

grammars = {
    "u": ["I V I IV u", "e"],
    "e": [""],
}

score = "u"

print score
while 1:
    found_substitution = False
    for key,value in grammars.iteritems():
        print "key, value =", key, value
        if score.find(key) != -1:
            print "here"
            found_substitution = True
            while score.find(key) != -1:
                score = score.replace(key, random.choice(grammars[key]), 1)
                print score
                time.sleep(.25)
    if found_substitution is False:
        break
print score