Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/common1/Generation/GenerationPitch.py
diff options
context:
space:
mode:
Diffstat (limited to 'common1/Generation/GenerationPitch.py')
-rw-r--r--common1/Generation/GenerationPitch.py40
1 files changed, 0 insertions, 40 deletions
diff --git a/common1/Generation/GenerationPitch.py b/common1/Generation/GenerationPitch.py
deleted file mode 100644
index 4c34e8f..0000000
--- a/common1/Generation/GenerationPitch.py
+++ /dev/null
@@ -1,40 +0,0 @@
-import random
-import Drunk
-
-import common.Config as Config
-from common.Generation.GenerationConstants import GenerationConstants
-
-class GenerationPitch:
- def __init__( self ):
- MIN = 0
- MAX = 14
- self.drunkMethod = Drunk.Drunk( MIN, MAX )
- self.droneMethod = Drunk.DroneAndJump( MIN, MAX )
- self.repeatMethod = Drunk.Repeter( MIN, MAX )
- self.loopMethod = Drunk.Loopseg( MIN, MAX )
- self.methodList = [self.drunkMethod, self.droneMethod, self.repeatMethod, self.loopMethod]
-
- def drunkPitchSequence(self, length, parameters, table_pitch, trackId):
- pitchSequence = []
- append = pitchSequence.append
- numberOfPitch = int( ( 1 - (parameters.pitchRegularity[trackId]*.8) ) * 10 + 1 )
- step = -(int(parameters.step[trackId] * 10))
- max = len(table_pitch)-1
- nextValue = self.methodList[parameters.pattern[trackId]].getNextValue
- tonique = GenerationConstants.DEFAULT_TONIQUE
- for i in range(numberOfPitch):
- append((table_pitch[nextValue(step, max)]) + tonique)
- restOfNotes = range( length - numberOfPitch )
- for i in restOfNotes:
- position = i % numberOfPitch
- append( pitchSequence[ position ] )
- return pitchSequence
-
- def drumPitchSequence(self, length, parameters, drumPitch, table_pitch=None):
- pitchSequence = []
- append = pitchSequence.append
- max = len(drumPitch) - 1
- rand = random.randint
- for i in range(length):
- append(drumPitch[ rand( 0, max ) ] )
- return pitchSequence