diff options
author | Oli2 <olivier.belanger@umontreal.ca> | 2007-03-19 04:07:19 (GMT) |
---|---|---|
committer | Oli2 <olivier.belanger@umontreal.ca> | 2007-03-19 04:07:19 (GMT) |
commit | d03f173fd666c1816d164aa0789f315e76766e95 (patch) | |
tree | 253bd9283e61d88b55ed9a149cdfc3b8316511dc /Generation | |
parent | fee28b6dc278577e26895c6b38056bfe900c7ab5 (diff) |
sequencer is waiting for a note to start recording
Diffstat (limited to 'Generation')
-rw-r--r-- | Generation/GenerationRythm.py | 10 | ||||
-rwxr-xr-x | Generation/Generator.py | 4 |
2 files changed, 3 insertions, 11 deletions
diff --git a/Generation/GenerationRythm.py b/Generation/GenerationRythm.py index 06dc1ab..d3d1e62 100644 --- a/Generation/GenerationRythm.py +++ b/Generation/GenerationRythm.py @@ -102,15 +102,13 @@ class GenerationRythm: downBeats = [x for x in GenerationConstants.DRUM_PUNCH_ACCENTS[ beatsPerPage ]] for downBeat in downBeats: upBeats.append( downBeat + Config.TICKS_PER_BEAT / 2 ) - #upBeats.append( ( downBeat[ 0 ] + Config.TICKS_PER_BEAT , downBeat[ 1 ] ) ) if Config.INSTRUMENTS[ trackInstrument ].instrumentRegister == Config.LOW: - registerDensity =1.5 + registerDensity = 1.5 downBeatRecurence = 4 downBeats = [x for x in GenerationConstants.DRUM_LOW_ACCENTS[ beatsPerPage ]] for downBeat in downBeats: upBeats.append( downBeat + Config.TICKS_PER_BEAT / 2 ) - #upBeats.append( ( downBeat[ 0 ] + Config.TICKS_PER_BEAT / 2 , downBeat[ 1 ] ) ) if Config.INSTRUMENTS[ trackInstrument ].instrumentRegister == Config.MID: registerDensity = 1 @@ -118,7 +116,6 @@ class GenerationRythm: downBeats = [x for x in GenerationConstants.DRUM_MID_ACCENTS[ beatsPerPage ]] for downBeat in downBeats: upBeats.append( downBeat + Config.TICKS_PER_BEAT / 4 ) - #upBeats.append( ( downBeat[ 0 ] + Config.TICKS_PER_BEAT / 4 , downBeat[ 1 ] ) ) if Config.INSTRUMENTS[ trackInstrument ].instrumentRegister == Config.HIGH: registerDensity = 1.5 @@ -126,7 +123,6 @@ class GenerationRythm: downBeats = [x for x in GenerationConstants.DRUM_HIGH_ACCENTS[ beatsPerPage ]] for downBeat in downBeats: upBeats.append( downBeat + Config.TICKS_PER_BEAT / 4 ) - #upBeats.append( ( downBeat[ 0 ] + Config.TICKS_PER_BEAT / 4 , downBeat[ 1 ] ) ) for i in range( int( density * registerDensity * len( downBeats ) ) ): if random.random() < ( parameters.rythmRegularity * downBeatRecurence ) and binSelection.count( 1 ) < len( downBeats ): @@ -141,8 +137,6 @@ class GenerationRythm: length = len(downBeats) - 1 for i in range( countDown ): -# while onsetTime in rythmSequence or onsetTime == None: -# onsetTime = Utils.prob2( downBeats ) ran1 = random.randint(0, length) ran2 = random.randint(0, length) randMin = min(ran1, ran2) @@ -152,8 +146,6 @@ class GenerationRythm: length = len(upBeats) - 1 for i in range( len( binSelection ) - countDown ): -# while onsetTime in rythmSequence or onsetTime == None: -# onsetTime = Utils.prob2( upBeats ) ran1 = random.randint(0, length) ran2 = random.randint(0, length) randMin = min(ran1, ran2) diff --git a/Generation/Generator.py b/Generation/Generator.py index 22c23de..2da4725 100755 --- a/Generation/Generator.py +++ b/Generation/Generator.py @@ -100,7 +100,7 @@ def generator1( numOfNotes = range(len(rythmSequence)) for i in numOfNotes: if drumPitch: - if ( random.random() * fillDrum ) > ( parameters.silence * .7 ): + if ( random.random() * fillDrum ) > ( parameters.silence * .5 ): if fillDrum != 1: if rythmSequence[i] not in trackOnsets or pitchSequence[i] not in trackPitchs: trackNotes.append( CSoundNote( rythmSequence[i], pitchSequence[i], gainSequence[i], GenerationConstants.DEFAULT_PAN, durationSequence[i], trackId, Config.INSTRUMENTS[instrument[ trackId ]].instrumentId, 0.002, 0.098, 0.1, 0, 1000, False, 'edit' ) ) @@ -108,7 +108,7 @@ def generator1( trackNotes.append( CSoundNote( rythmSequence[i], pitchSequence[i], gainSequence[i], GenerationConstants.DEFAULT_PAN, durationSequence[i], trackId, Config.INSTRUMENTS[instrument[ trackId ]].instrumentId, 0.002, 0.098, 0.1, 0, 1000, False, 'edit' ) ) else: if random.random() > parameters.silence: - trackNotes.append( CSoundNote( rythmSequence[i], pitchSequence[i], gainSequence[i], GenerationConstants.DEFAULT_PAN, durationSequence[i], trackId, Config.INSTRUMENTS[instrument[ trackId ]].instrumentId, 0.002, 0.098, 0.1, 0, 1000, False, 'edit' ) ) + trackNotes.append( CSoundNote( rythmSequence[i], pitchSequence[i], gainSequence[i], GenerationConstants.DEFAULT_PAN, durationSequence[i], trackId, Config.INSTRUMENTS[instrument[ trackId ]].instrumentId, 0.002, 0.1, 0.1, 0, 1000, False, 'edit' ) ) trackDictionary[ trackId ][ pageId ] = trackNotes |