diff options
author | Oli2 <olivier.belanger@umontreal.ca> | 2007-03-26 00:54:51 (GMT) |
---|---|---|
committer | Oli2 <olivier.belanger@umontreal.ca> | 2007-03-26 00:54:51 (GMT) |
commit | 6f15b03182e97c28ca7b7680f1a1e4df752d5e8f (patch) | |
tree | 9fa1c6533ef4d5c98dded617f15ecc00a9409453 /Generation | |
parent | 629057f09d592517cd2f62d6e70824fcd9970622 (diff) |
generator little change
Diffstat (limited to 'Generation')
-rwxr-xr-x | Generation/Generator.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Generation/Generator.py b/Generation/Generator.py index 066aab7..7ed18dc 100755 --- a/Generation/Generator.py +++ b/Generation/Generator.py @@ -146,6 +146,7 @@ def generator1( barLength = Config.TICKS_PER_BEAT * nbeats[ pageId ] trackOfNotes = [] pageCycle = selectedPageCount % 4 # this should be fix in the meta algo + if instrument[ trackId ][0:4] == 'drum': if pageCycle in [1,2]: trackDictionary[ trackId ][ pageId ] = [ n for n in trackDictionary[ trackId ][ lastPageId ] ] @@ -165,8 +166,10 @@ def generator1( pageGenerate( parameters, trackId, pageId, trackOfNotes, drumPitch ) else: - pageGenerate( parameters, trackId, pageId, trackOfNotes, drumPitch = None ) - + if (selectedPageCount % 2) == 0 or random.randint(0, 5) < 2 or selectedPageCount == 0: + pageGenerate( parameters, trackId, pageId, trackOfNotes, drumPitch = None ) + else: + trackDictionary[ trackId ][ pageId ] = [ n for n in trackDictionary[ trackId ][ lastPageId ] ] selectedPageCount += 1 lastPageId = pageId |