diff options
author | Oli2 <olivier.belanger@umontreal.ca> | 2007-03-13 02:43:53 (GMT) |
---|---|---|
committer | Oli2 <olivier.belanger@umontreal.ca> | 2007-03-13 02:43:53 (GMT) |
commit | 4e75fcdf8026c0ab9d7ea6fe013b819e5b217c46 (patch) | |
tree | 4f750818450a23226804ee3f3cb1d70c9ccf5045 /Generation | |
parent | f090233c10a1498fd5e328deaf6c1280f6f9fe39 (diff) |
algo onset values
Diffstat (limited to 'Generation')
-rwxr-xr-x | Generation/GenerationConstants.py | 2 | ||||
-rw-r--r-- | Generation/GenerationRythm.py | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/Generation/GenerationConstants.py b/Generation/GenerationConstants.py index 38bcf1e..a68b9f8 100755 --- a/Generation/GenerationConstants.py +++ b/Generation/GenerationConstants.py @@ -8,7 +8,7 @@ class GenerationConstants: PHRASE_LENGTH = 4 PHRASE_COMPLEXITY = .5 - TABLE_ONSET_VALUES = [ 3, 6, 3, 4, 3, 6, 12, 6, 8, 6, 12, 18, 12, 24, 18, 36, 24, 36, 48 ] + TABLE_ONSET_VALUES = [ 3, 3, 6, 3, 6, 4, 3, 6, 6, 12, 6, 12, 8, 6, 12, 18, 12, 24, 12, 18, 36, 24, 36, 24, 48 ] # scaling constants MAJOR = 0 diff --git a/Generation/GenerationRythm.py b/Generation/GenerationRythm.py index b9f4eaa..06dc1ab 100644 --- a/Generation/GenerationRythm.py +++ b/Generation/GenerationRythm.py @@ -13,7 +13,7 @@ class GenerationRythm: onsetLen = len(GenerationConstants.TABLE_ONSET_VALUES) onsetValue = int( ( 1 - parameters.density ) * onsetLen ) - onsetDeviation = int( ( 1 - parameters.rythmRegularity ) * 8 ) + onsetDeviation = int( ( 1 - parameters.rythmRegularity ) * 20 ) currentOnsetValue = onsetValue + ( random.randint( 0, onsetDeviation ) - ( onsetDeviation / 2 ) ) if currentOnsetValue < 0: currentOnsetValue = 0 @@ -23,7 +23,6 @@ class GenerationRythm: currentOnsetValue = currentOnsetValue onsetDelta = GenerationConstants.TABLE_ONSET_VALUES[ currentOnsetValue ] - print currentOnsetValue, onsetDelta for i in range( int( barLength / Config.TICKS_PER_BEAT * 8 ) ): if self.count == 0: currentOnsetValue = onsetValue + ( random.randint( 0, onsetDeviation ) - ( onsetDeviation / 2 ) ) @@ -34,7 +33,7 @@ class GenerationRythm: else: currentOnsetValue = currentOnsetValue onsetDelta = GenerationConstants.TABLE_ONSET_VALUES[ currentOnsetValue ] - print currentOnsetValue, onsetDelta + self.makeCellule(onsetDelta, GenerationConstants.DOUBLE_TICK_DUR, GenerationConstants.DOUBLE_HOW_MANY) self.makeCellule(onsetDelta, GenerationConstants.HALF_TRIPLET_TICK_DUR, GenerationConstants.HALF_TRIPLET_HOW_MANY) self.makeCellule(onsetDelta, GenerationConstants.HOLE_TRIPLET_TICK_DUR, GenerationConstants.HOLE_TRIPLET_HOW_MANY) |