Пример #1
0
 def reset(self):
   ''' reset all ivars to default values '''
   self.scale = [sg.get_scale('C-MAJOR')]
   self.degree = 1
   self.duration = fractions.Fraction(1,1)
   self.register = 5
   self.prevregister = 5
   self.volume = 12000
   self.tempo = 120
   self.instrument = None # replace with PIANO
   self.deltadegree = 'same'
   self.statestack = []
Пример #2
0
 def reset(self):
     ''' reset all ivars to default values '''
     self.scale = [sg.get_scale('C-MAJOR')]
     self.degree = 1
     self.duration = fractions.Fraction(1, 1)
     self.register = 5
     self.prevregister = 5
     self.volume = 12000
     self.tempo = 120
     self.instrument = None  # replace with PIANO
     self.deltadegree = 'same'
     self.statestack = []
Пример #3
0
def scales():
  reldesc = 'Attempts to relatively push the scale %s onto the scalestack.'
  absdesc = 'Absolutely pushes the scale %s onto the scalestack.'
  
  for m in sg.modetable.keys():
    mode = sg.get_mode(m)
    for tonic in sg.pitchnames:
      n = '%s-%s' % (tonic, mode.name)
      sg.new_scale(n, mode, tonic)
  
  def make_scalechanger_lambda(scale, relative): 
    return lambda sg: sg.note.change_scale(scale, relative=relative)
    
  for s in sg.scaletable.keys():
    scale = sg.get_scale(s)
    sg.new_scalechanger(scale.name + '$', reldesc % scale.name, make_scalechanger_lambda(scale, True))
    sg.new_scalechanger(scale.name, absdesc % scale.name, make_scalechanger_lambda(scale, False))