Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/Generation
diff options
context:
space:
mode:
authorOli <olpc@localhost.localdomain>2007-02-21 09:04:26 (GMT)
committer Oli <olpc@localhost.localdomain>2007-02-21 09:04:26 (GMT)
commit4c0f600aebf6397c7432c87f5c6c403c94530ee3 (patch)
tree7efd74f7c497f55fbe7d9f61ff4d0cfb138a01ad /Generation
parent0d028f321fabc110cbb8c195abfd3e2cb6bcb762 (diff)
scales update
Diffstat (limited to 'Generation')
-rwxr-xr-xGeneration/GenerationConstants.py15
-rwxr-xr-xGeneration/GenerationParametersWindow.py27
2 files changed, 31 insertions, 11 deletions
diff --git a/Generation/GenerationConstants.py b/Generation/GenerationConstants.py
index dbcff25..56e815b 100755
--- a/Generation/GenerationConstants.py
+++ b/Generation/GenerationConstants.py
@@ -28,16 +28,17 @@ class GenerationConstants:
HARMONIC_MINOR_SCALE = 1
NATURAL_MINOR_SCALE =2
PHRYGIEN_SCALE = 3
- PENTATONIC_SCALE = 4
- BLUES_SCALE = 5
-
-
+ DORIEN_SCALE = 4
+ LYDIEN_SCALE = 5
+ MYXOLYDIEN_SCALE = 6
+
SCALES = { MAJOR_SCALE : [ -12, -10, -8, -7, -5, -3, -1, 0, 2, 4, 5, 7, 9, 11, 12 ],
HARMONIC_MINOR_SCALE : [ -12, -10, -9, -7, -5, -4, -1, 0, 2, 3, 5, 7, 8, 11, 12 ],
NATURAL_MINOR_SCALE : [ -12, -10, -9, -7, -5, -4, -2, 0, 2, 3, 5, 7, 8, 10, 12 ],
- PENTATONIC_SCALE : [ -12, -10, -7, -5, -3, 0, 2, 5, 7, 9, 12 ],
- BLUES_SCALE : [ -12, -10, -9, -8, -7, -5, -3, -2, 0, 2, 3, 4, 5, 7, 9, 10, 12 ],
- PHRYGIEN_SCALE : [ -12, -11, -9, -7, -5, -4, -2, 0, 1, 3, 5, 7, 8, 10, 12 ] }
+ PHRYGIEN_SCALE : [ -12, -11, -9, -7, -5, -4, -2, 0, 1, 3, 5, 7, 8, 10, 12 ],
+ DORIEN_SCALE : [ -12, -10, -9, -7, -5, -3, -2, 0, 2, 3, 5, 7, 9, 10, 12 ],
+ LYDIEN_SCALE : [ -12, -10, -8, -6, -5, -3, -1, 0, 2, 4, 6, 7, 9, 11, 12 ],
+ MYXOLYDIEN_SCALE : [ -12, -10, -8, -7, -5, -3, -2, 0, 2, 4, 5, 7, 9, 10, 12 ]}
DEFAULT_SCALE = MAJOR_SCALE
diff --git a/Generation/GenerationParametersWindow.py b/Generation/GenerationParametersWindow.py
index e5c0f37..d2cae6c 100755
--- a/Generation/GenerationParametersWindow.py
+++ b/Generation/GenerationParametersWindow.py
@@ -14,6 +14,7 @@ class GenerationParametersWindow( gtk.Window ):
self.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_DIALOG)
self.set_position( gtk.WIN_POS_CENTER )
self.set_default_size(30, 300)
+ self.move(300, 20)
self.set_border_width(0)
self.set_decorated(False)
self.mainBox = RoundVBox(fillcolor="#FFF", bordercolor="#FFF")
@@ -26,7 +27,7 @@ class GenerationParametersWindow( gtk.Window ):
self.pitchMethod = GenerationConstants.DEFAULT_PITCH_METHOD
self.pattern = GenerationConstants.DEFAULT_PATTERN
self.scale = GenerationConstants.DEFAULT_SCALE
- self.sourceVariation = 0
+ self.sourceVariation = 1
self.generateFunction = generateFunction
self.variateFunction = variateFunction
self.setupWindow()
@@ -167,7 +168,7 @@ class GenerationParametersWindow( gtk.Window ):
arrowImg.set_from_file(Config.IMAGE_ROOT + 'flecheAlgo.png')
varPitchBox.pack_start(arrowImg, False, False)
- listOfPitchVar = ['copy', 'reverse', 'shuffle', 'sort', 'invert', 'markov']
+ listOfPitchVar = ['copy', 'markov', 'reverse', 'sort', 'shuffle', 'invert']
for var in listOfPitchVar:
button = ImageButton(Config.IMAGE_ROOT + var + '.png', Config.IMAGE_ROOT + var + 'Down.png', Config.IMAGE_ROOT + var + 'Over.png')
button.connect('pressed', self.handlePitchVariationButton, listOfPitchVar.index(var))
@@ -219,6 +220,19 @@ class GenerationParametersWindow( gtk.Window ):
methodBox.pack_start(iButton, False, False)
metaAlgoBox.pack_start(methodBox, False, False, 5)
+ scaleBox = gtk.HBox()
+ self.firstButton = None
+ scaleNames = ['majorKey', 'minorHarmKey', 'minorKey', 'phrygienKey', 'dorienKey', 'lydienKey', 'myxoKey']
+ for scale in scaleNames:
+ iButton = ImageRadioButton(self.firstButton, Config.IMAGE_ROOT + scale + '.png', Config.IMAGE_ROOT + scale + 'Down.png', Config.IMAGE_ROOT + scale + 'Over.png')
+ if self.firstButton == None:
+ self.firstButton = iButton
+ iButton.connect('clicked' , self.handleScale , scaleNames.index(scale))
+ scaleBox.pack_start(iButton, False, False)
+ metaAlgoBox.pack_start(scaleBox, False, False)
+
+
+
self.mainBox.pack_start(metaAlgoBox)
# Create melodic rythm methods box
@@ -418,6 +432,10 @@ class GenerationParametersWindow( gtk.Window ):
if widget.get_active():
self.pattern = method
+ def handleScale( self, widget, scale ):
+ if widget.get_active():
+ self.scale = scale
+
def rythmMethodCallback( self, widget, rythmMethod ):
if widget.get_active():
self.rythmMethod = rythmMethod
@@ -427,8 +445,9 @@ class GenerationParametersWindow( gtk.Window ):
self.pitchMethod = pitchMethod
def scaleCallback( self, widget, scale ):
- if widget.get_active():
- self.scale = scale
+ pass
+# if widget.get_active():
+# self.scale = scale
def patternCallback( self, widget, data ):
pass