예제 #1
0
    def __init__(self, scaleValue='C', scaleMode='major'):
        '''
        Acts as a wrapper for :class:`~music21.scale.Scale`. Used to represent the
        concept of a figured bass scale, with a scale value and mode.
        
        
        Accepted scale types: major, minor, dorian, phrygian, and hypophrygian.
        A FiguredBassScale is raised if an invalid scale type is provided.
        
        >>> from music21.figuredBass import realizerScale
        >>> fbScale = realizerScale.FiguredBassScale()
        >>> fbScale.realizerScale
        <music21.scale.MajorScale C major>
        >>> fbScale.keySig
        <music21.key.KeySignature of no sharps or flats>

        >>> fbScale = realizerScale.FiguredBassScale('d', 'minor')
        >>> fbScale.realizerScale
        <music21.scale.MinorScale D minor>
        >>> fbScale.keySig
        <music21.key.KeySignature of 1 flat>
        '''
        try:
            foo = scaleModes[scaleMode]
            self.realizerScale = foo(scaleValue)
            self.keySig = key.KeySignature(
                key.pitchToSharps(scaleValue, scaleMode))
        except KeyError:
            raise FiguredBassScaleException("Unsupported scale type-> " +
                                            scaleMode)
예제 #2
0
 def __init__(self, scaleValue='C', scaleMode='major'):
     try:
         foo = scaleModes[scaleMode]
         self.realizerScale = foo(scaleValue)
         self.keySig = key.KeySignature(key.pitchToSharps(scaleValue, scaleMode))
     except KeyError:
         raise FiguredBassScaleException('Unsupported scale type-> ' + scaleMode)
예제 #3
0
    def __init__(self, scaleValue='C', scaleMode='major'):
        '''
        Acts as a wrapper for :class:`~music21.scale.Scale`. Used to represent the
        concept of a figured bass scale, with a scale value and mode.
        
        
        Accepted scale types: major, minor, dorian, phrygian, and hypophrygian.
        A FiguredBassScale is raised if an invalid scale type is provided.
        
        >>> from music21.figuredBass import realizerScale
        >>> fbScale = realizerScale.FiguredBassScale()
        >>> fbScale.realizerScale
        <music21.scale.MajorScale C major>
        >>> fbScale.keySig
        <music21.key.KeySignature of no sharps or flats>

        >>> fbScale = realizerScale.FiguredBassScale('d', 'minor')
        >>> fbScale.realizerScale
        <music21.scale.MinorScale D minor>
        >>> fbScale.keySig
        <music21.key.KeySignature of 1 flat>
        '''
        try:
            foo = scaleModes[scaleMode]
            self.realizerScale = foo(scaleValue)
            self.keySig = key.KeySignature(key.pitchToSharps(scaleValue, scaleMode))
        except KeyError:
            raise FiguredBassScaleException("Unsupported scale type-> " + scaleMode)
예제 #4
0
 def __init__(self, scaleValue='C', scaleMode='major'):
     try:
         foo = scaleModes[scaleMode]
         self.realizerScale = foo(scaleValue)
         self.keySig = key.KeySignature(key.pitchToSharps(scaleValue, scaleMode))
     except KeyError:
         raise FiguredBassScaleException("Unsupported scale type-> " + scaleMode)
예제 #5
0
 def __init__(self, scaleValue, scaleMode = 'major'):
     '''
     Constructs a FiguredBassScale object, with a scaleValue (key) and a scaleMode (major is default).
     '''
     self._scaleValue = convertToPitch(scaleValue) #If scale value provided as string, convert to pitch
     self._scaleMode = scaleMode
     self._keySig = key.KeySignature(key.pitchToSharps(self._scaleValue,self._scaleMode))
     self._scale = self._constructScale()
예제 #6
0
 def __init__(self, scaleValue, scaleMode='major'):
     '''
     Constructs a FiguredBassScale object, with a scaleValue (key) and a scaleMode (major is default).
     '''
     self._scaleValue = convertToPitch(
         scaleValue)  #If scale value provided as string, convert to pitch
     self._scaleMode = scaleMode
     self._keySig = key.KeySignature(
         key.pitchToSharps(self._scaleValue, self._scaleMode))
     self._scale = self._constructScale()