diff options
author | Oli <olivier.belanger@umontreal.ca> | 2007-10-09 05:42:59 (GMT) |
---|---|---|
committer | Oli <olivier.belanger@umontreal.ca> | 2007-10-09 05:42:59 (GMT) |
commit | 7400fb60ca6b454330996cc5b2c425b8c1e366c9 (patch) | |
tree | 00f74d6b7a4eca2245b782771296a688140dd679 /common/Generation | |
parent | d823a57aec432898701f136da37e7aecabf3ac34 (diff) |
work on meta algo, amplitude scaled on transposition
Diffstat (limited to 'common/Generation')
-rwxr-xr-x | common/Generation/Drunk.py | 2 | ||||
-rwxr-xr-x | common/Generation/GenerationConstants.py | 13 | ||||
-rwxr-xr-x | common/Generation/Generator.py | 2 |
3 files changed, 9 insertions, 8 deletions
diff --git a/common/Generation/Drunk.py b/common/Generation/Drunk.py index 1bc3bbb..fb7b765 100755 --- a/common/Generation/Drunk.py +++ b/common/Generation/Drunk.py @@ -84,7 +84,7 @@ class Repeter( Drunk ): return self.lastValue def getStepSize( self, direction, maxStepSize, maxValue ): - if random.randint( 0, 100 ) < 20: + if random.randint( 0, 100 ) < 35: return Drunk.getStepSize( self, direction, maxStepSize, maxValue ) else: return Drunk.getStepSize( self, direction, 0, maxValue ) diff --git a/common/Generation/GenerationConstants.py b/common/Generation/GenerationConstants.py index b961f4b..55b9527 100755 --- a/common/Generation/GenerationConstants.py +++ b/common/Generation/GenerationConstants.py @@ -31,12 +31,13 @@ class GenerationConstants: # Default parameters for algorithmic generation - RYTHM_DENSITY_BANK = [.25, .88, .72, 1, .25] - RYTHM_REGU_BANK = [.75, .8, .85, .4, .5] - PITCH_REGU_BANK = [.5, .8, 0, .85, .9] - PITCH_STEP_BANK = [.5, .3, 1, .22, .85] - DURATION_BANK = [.8, 1, .8, 1, 1] - SILENCE_BANK = [.2, .5, .25, .55, .12] + RYTHM_DENSITY_BANK = [.38, .26, .82, 1, 1, .91, 1, .91, .91, .32, 1, 1, .83, .6] + RYTHM_REGU_BANK = [.94, .95, .89, 1, 1, .75, 1, .75, .84, .93, 1, 1, .87, .62] + PITCH_REGU_BANK = [.04, 0, 0, .36, .35, .57, 0, 0, 0, 0, .28, .77, 0, 0] + PITCH_STEP_BANK = [.28, .48, .39, .4, 1, .55, .29, .15, .4, .26, .25, 1, .33, .22] + DURATION_BANK = [1, 1, 1, 1, 1, 1, 1, 1, .65, .86, 1, 1, .82, 1] + SILENCE_BANK = [.07, 0, .17, 0, .17, .17, .2, .32, .33, .08, .06, .11, .11, .06] + PATTERN_BANK = [0,0,0,1,1,1,2,2,2,2,3,3,3,3] SCALE_BANK = [MAJOR, NATURAL_MINOR, LYDIEN, HARMONIC_MINOR, MYXOLYDIEN] chooseDefault = random.randint(0,4) diff --git a/common/Generation/Generator.py b/common/Generation/Generator.py index acc605c..8e92780 100755 --- a/common/Generation/Generator.py +++ b/common/Generation/Generator.py @@ -67,7 +67,7 @@ def generator1( def makeDurationSequence( onsetList, parameters, table_duration, barLength, currentInstrument ): durationSequence = [] - if Config.INSTRUMENTS[currentInstrument].soundClass == 'drum': + if Config.INSTRUMENTS[currentInstrument].name[0:4] == 'drum': duration = GenerationConstants.DOUBLE_TICK_DUR / 2 durationSequence = [duration] * len(onsetList) return durationSequence |