Previous topic

music21.scala

Next topic

music21.search

Table Of Contents

Table Of Contents

This Page

music21.scale

The various Scale objects provide a bi-directional object representation of octave repeating and non-octave repeating scales built by network of Interval objects as modeled in BoundIntervalNetwork.

The main public interface to these resources are subclasses of ConcreteScale, such as MajorScale, MinorScale, and MelodicMinorScale.

More unusual scales are also available, such as OctatonicScale, SieveScale, and RagMarwa.

All ConcreteScale subclasses provide the ability to get a pitches across any range, get a pitch for scale step, get a scale step for pitch, and, for any given pitch ascend or descend to the next pitch. In all cases Pitch objects are returned.

>>> sc1 = scale.MajorScale('a')
>>> [str(p) for p in sc1.getPitches('g2', 'g4')]
['G#2', 'A2', 'B2', 'C#3', 'D3', 'E3', 'F#3', 'G#3', 'A3', 'B3', 'C#4', 'D4', 'E4', 'F#4']
>>> sc2 = scale.MelodicMinorScale('a')
>>> [str(p) for p in sc2.getPitches('g2', 'g4', direction='descending')]
['G4', 'F4', 'E4', 'D4', 'C4', 'B3', 'A3', 'G3', 'F3', 'E3', 'D3', 'C3', 'B2', 'A2', 'G2']
>>> [str(p) for p in sc2.getPitches('g2', 'g4', direction='ascending')]
['G#2', 'A2', 'B2', 'C3', 'D3', 'E3', 'F#3', 'G#3', 'A3', 'B3', 'C4', 'D4', 'E4', 'F#4']

ConcreteScale

class music21.scale.ConcreteScale(tonic=None, pitches=None)

A concrete scale is specific scale formation with a defined pitch collection (a tonic Pitch) that may or may not be bound by specific range. For example, a specific Major Scale, such as G Major, from G2 to G4.

This class is can either be used directly or more commonly as a base class for all concrete scales.

Here we treat a diminished triad as a scale:

>>> myscale = scale.ConcreteScale(pitches = ["C4", "E-4", "G-4", "A4"])
>>> myscale.getTonic()
<music21.pitch.Pitch C4>
>>> myscale.next("G-2")
<music21.pitch.Pitch A2>
>>> [str(p) for p in myscale.getPitches("E-5","G-7")]
['E-5', 'G-5', 'A5', 'C6', 'E-6', 'G-6', 'A6', 'C7', 'E-7', 'G-7']

A scale that lasts two octaves and uses quarter tones (D~)

>>> complexscale = scale.ConcreteScale(pitches = ["C#3", "E-3", "F3", "G3", "B3", "D~4", "F#4", "A4", "C#5"])
>>> complexscale.getTonic()
<music21.pitch.Pitch C#3>
>>> complexscale.next("G3", direction=scale.DIRECTION_DESCENDING)
<music21.pitch.Pitch F3>
>>> [str(p) for p in complexscale.getPitches("C3","C7")]
['C#3', 'E-3', 'F3', 'G3', 'B3', 'D~4', 'F#4', 
 'A4', 'C#5', 'E-5', 'F5', 'G5', 'B5', 'D~6', 'F#6', 'A6']

Descending form:

>>> [str(p) for p in complexscale.getPitches("C7","C5")]
['A6', 'F#6', 'D~6', 'B5', 'G5', 'F5', 'E-5', 'C#5']

ConcreteScale bases

ConcreteScale read-only properties

ConcreteScale.abstract

Return the AbstractScale instance governing this ConcreteScale.

>>> sc1 = scale.MajorScale('d')
>>> sc2 = scale.MajorScale('b-')
>>> sc1 == sc2
False
>>> sc1.abstract == sc2.abstract
True
ConcreteScale.chord

Return a Chord object from this harmony over a default range. Use the getChord() method if you need greater control over the parameters of the chord.

ConcreteScale.isConcrete

Return True if the scale is Concrete, that is, it has a defined Tonic.

>>> sc1 = scale.MajorScale('c')
>>> sc1.isConcrete
True
>>> sc2 = scale.MajorScale()    
>>> sc2.isConcrete
False
ConcreteScale.name

Return or construct the name of this scale.

>>> sc = scale.DiatonicScale() # abstract, as no defined tonic
>>> sc.name
'Abstract diatonic'
ConcreteScale.pitches

Get a default pitch list from this scale.

Read-only properties inherited from Music21Object:

ConcreteScale read/write properties

Read/write properties inherited from Music21Object:

ConcreteScale methods

ConcreteScale.derive(other, comparisonAttribute='pitchClass')

Return the closest-matching ConcreteScale based on the pitch collection provided as a Stream, a ConcreteScale, or a list of Pitch objects.

How the “closest-matching” scale is defined still needs to be refined and will probably change in the future.

>>> sc1 = scale.MajorScale()
>>> sc1.derive(['c#', 'e', 'g#'])
<music21.scale.MajorScale B major>
>>> sc1.derive(['e-', 'b-', 'd'], comparisonAttribute='name')
<music21.scale.MajorScale B- major>
ConcreteScale.deriveAll(other, comparisonAttribute='pitchClass')

Return a list of all Scales of the same class as self where all the pitches in other are contained.

Similar to “deriveRanked” but only returns those scales no matter how many which contain all the pitches.

Just returns a list in order.

If you are working with Diatonic Scales, you will probably want to change the comparisonAttribute to name.

>>> sc1 = scale.MajorScale()
>>> sc1.deriveAll(['c', 'e', 'b'])
[<music21.scale.MajorScale G major>, <music21.scale.MajorScale C major>]
>>> [sc.name for sc in sc1.deriveAll(['d-', 'e', 'b'])]
['B major', 'A major', 'E major', 'D major', 'C- major']
>>> sc1.deriveAll(['d-', 'e', 'b'], comparisonAttribute='name')
[]

Find all instances of this pentatonic scale in major scales:

>>> scList = sc1.deriveAll(['c#', 'd#', 'f#', 'g#', 'a#'], comparisonAttribute = 'name')
>>> [sc.name for sc in scList]
['B major', 'F# major', 'C# major']
ConcreteScale.deriveByDegree(degree, pitch)

Given a scale degree and a pitch, return a new ConcreteScale that satisfies that condition.

Find a major scale with C as the 7th degree:

>>> sc1 = scale.MajorScale()
>>> sc1.deriveByDegree(7, 'c')
<music21.scale.MajorScale D- major>

TODO: Does not yet work for directional scales

ConcreteScale.deriveRanked(other, resultsReturned=4, comparisonAttribute='pitchClass', removeDuplicates=False)

Return a list of closest-matching ConcreteScale objects based on this AbstractScale, provided as a Stream, a ConcreteScale, or a list of Pitch objects. Returned integer values represent the number of mathces.

If you are working with Diatonic Scales, you will probably want to change the comparisonAttribute to name.

>>> sc1 = scale.MajorScale()
>>> sc1.deriveRanked(['c', 'e', 'b'])
[(3, <music21.scale.MajorScale G major>), (3, <music21.scale.MajorScale C major>), (2, <music21.scale.MajorScale B major>), (2, <music21.scale.MajorScale A major>)]
>>> sc1.deriveRanked(['d-', 'e', 'b'])
[(3, <music21.scale.MajorScale B major>), (3, <music21.scale.MajorScale A major>), (3, <music21.scale.MajorScale E major>), (3, <music21.scale.MajorScale D major>)]        
>>> sc1.deriveRanked(['d-', 'e', 'b'], comparisonAttribute='name')
[(2, <music21.scale.MajorScale B major>), (2, <music21.scale.MajorScale A major>), (2, <music21.scale.MajorScale G major>), (2, <music21.scale.MajorScale E major>)]
>>> sc1.deriveRanked(['c', 'e', 'e', 'e', 'b'])
[(5, <music21.scale.MajorScale G major>), (5, <music21.scale.MajorScale C major>), (4, <music21.scale.MajorScale B major>), (4, <music21.scale.MajorScale A major>)]
>>> sc1.deriveRanked(['c#', 'e', 'g#'])
[(3, <music21.scale.MajorScale B major>), (3, <music21.scale.MajorScale A major>), (3, <music21.scale.MajorScale E major>), (3, <music21.scale.MajorScale C- major>)]

Test that a Concrete Scale (that is, with no _abstract defined) still has similar characteristics to the original.

Create a scale like a Harmonic minor but with flat 2 and sharp 4

>>> e = scale.ConcreteScale(pitches=['A4', 'B-4', 'C5', 'D#5', 'E5', 'F5', 'G#5', 'A5'])
>>> f = e.deriveRanked(['C','E','G'])
>>> f
[(3, <music21.scale.ConcreteScale E Concrete>), (3, <music21.scale.ConcreteScale D- Concrete>), (3, <music21.scale.ConcreteScale C# Concrete>), (2, <music21.scale.ConcreteScale B Concrete>)]
>>> ' '.join([str(p) for p in f[0][1].pitches])
'E4 F4 G4 A#4 B4 C5 D#5 E5'
ConcreteScale.findMissing(other, comparisonAttribute='pitchClass', minPitch=None, maxPitch=None, direction='ascending', alteredDegrees={})

Given another object of the forms that extractPitches takes (e.g., a Stream, a ConcreteScale, a list of Pitch objects), return a list of pitches that are found in this Scale but are not found in the provided object.

>>> sc1 = scale.MajorScale('g4')
>>> [str(p) for p in sc1.findMissing(['d'])]
['G4', 'A4', 'B4', 'C5', 'E5', 'F#5', 'G5']
ConcreteScale.getChord(minPitch=None, maxPitch=None, direction='ascending', **keywords)

Return a realized chord containing all the pitches in this scale within a particular inclusive range defined by two pitches.

All keyword arguments are passed on to the Chord, permitting specification of quarterLength and similar parameters.

ConcreteScale.getDegreeMaxUnique()

Convenience routine to get this from the AbstractScale.

ConcreteScale.getPitches(minPitch=None, maxPitch=None, direction=None)

Return a list of Pitch objects, using a deepcopy of a cached version if available.

ConcreteScale.getScalaStorage()

Return a configured ScalaStorage Object for this scale. It can be used to find interval distances in cents between degrees.

ConcreteScale.getScaleDegreeAndAccidentalFromPitch(pitchTarget, direction='ascending', comparisonAttribute='name')

Given a scale (or Key object) and a pitch, return a two-element tuple of the degree of the scale and an accidental (or None) needed to get this pitch.

>>> cmaj = key.Key('C')
>>> cmaj.getScaleDegreeAndAccidentalFromPitch(pitch.Pitch('E'))
(3, None)
>>> cmaj.getScaleDegreeAndAccidentalFromPitch(pitch.Pitch('E-'))
(3, <accidental flat>)

The Direction of a melodic minor scale is significant

>>> amin = scale.MelodicMinorScale('a')
>>> amin.getScaleDegreeAndAccidentalFromPitch(pitch.Pitch('G'), direction=scale.DIRECTION_DESCENDING)
(7, None)
>>> amin.getScaleDegreeAndAccidentalFromPitch(pitch.Pitch('G'), direction=scale.DIRECTION_ASCENDING)
(7, <accidental flat>)
>>> amin.getScaleDegreeAndAccidentalFromPitch(pitch.Pitch('G-'), direction=scale.DIRECTION_ASCENDING)
(7, <accidental double-flat>)

Returns (None, None) if for some reason this scale does not have this step (a whole-tone scale, for instance)

ConcreteScale.getScaleDegreeFromPitch(pitchTarget, direction='ascending', comparisonAttribute='name')

For a given pitch, return the appropriate scale degree. If no scale degree is available, None is returned.

Note – by default it will find based on note name not on PitchClass because this is used so commonly by tonal functions. So if it’s important that D# and E- are the same, set the comparisonAttribute to pitchClass

>>> sc = scale.MajorScale('e-')
>>> sc.getScaleDegreeFromPitch('e-2')
1
>>> sc.getScaleDegreeFromPitch('d')
7
>>> sc.getScaleDegreeFromPitch('d#', comparisonAttribute='name') is None
True
>>> sc.getScaleDegreeFromPitch('d#', comparisonAttribute='pitchClass')
1
>>> sc.getScaleDegreeFromPitch('e') == None
True
>>> sc.getScaleDegreeFromPitch('e', comparisonAttribute='step')
1
>>> sc = scale.HarmonicMinorScale('a')
>>> sc.getScaleDegreeFromPitch('c')
3
>>> sc.getScaleDegreeFromPitch('g#')
7
>>> sc.getScaleDegreeFromPitch('g') is None
True
>>> cmaj = key.Key('C')
>>> cmaj.getScaleDegreeFromPitch(pitch.Pitch('E-'), direction=scale.DIRECTION_ASCENDING, comparisonAttribute = 'step')
3
ConcreteScale.getTonic()

Return the tonic.

>>> sc = scale.ConcreteScale(tonic = 'e-4')
>>> sc.getTonic()
<music21.pitch.Pitch E-4>
ConcreteScale.intervalBetweenDegrees(degreeStart, degreeEnd, direction='ascending', equateTermini=True)

Given two degrees, provide the interval as an interval.Interval object.

>>> sc = scale.MajorScale('e-')
>>> sc.intervalBetweenDegrees(3, 7)
<music21.interval.Interval P5>
ConcreteScale.isNext(other, pitchOrigin, direction='ascending', stepSize=1, getNeighbor=True, comparisonAttribute='name')

Given another pitch, as well as an origin and a direction, determine if this other pitch is in the next in the scale.

>>> sc1 = scale.MajorScale('g')
>>> sc1.isNext('d4', 'c4', 'ascending')
True
ConcreteScale.match(other, comparisonAttribute='name')

Given another object of the forms that extractPitchList can take, (e.g., a Stream, a ConcreteScale, a list of Pitch objects), return a named dictionary of pitch lists with keys ‘matched’ and ‘notMatched’.

>>> sc1 = scale.MajorScale('g')
>>> sc2 = scale.MajorScale('d')
>>> sc3 = scale.MajorScale('a')
>>> sc4 = scale.MajorScale('e')
>>> from pprint import pprint as pp
>>> pp(sc1.match(sc2))
{'matched': [<music21.pitch.Pitch D4>, <music21.pitch.Pitch E4>, 
             <music21.pitch.Pitch F#4>, <music21.pitch.Pitch G4>, 
             <music21.pitch.Pitch A4>, <music21.pitch.Pitch B4>],
'notMatched': [<music21.pitch.Pitch C#5>]}
>>> pp(sc2.match(sc3))
{'matched': [<music21.pitch.Pitch A4>, <music21.pitch.Pitch B4>, 
             <music21.pitch.Pitch C#5>, <music21.pitch.Pitch D5>, 
             <music21.pitch.Pitch E5>, <music21.pitch.Pitch F#5>],
'notMatched': [<music21.pitch.Pitch G#5>]}
>>> pp(sc1.match(sc4))
{'matched': [<music21.pitch.Pitch E4>, <music21.pitch.Pitch F#4>, 
             <music21.pitch.Pitch A4>, <music21.pitch.Pitch B4>],
 'notMatched': [<music21.pitch.Pitch G#4>, 
                <music21.pitch.Pitch C#5>, 
                <music21.pitch.Pitch D#5>]}
ConcreteScale.next(pitchOrigin=None, direction='ascending', stepSize=1, getNeighbor=True)

Get the next pitch above (or if direction is ‘descending’, below) a pitchOrigin or None. If the pitchOrigin is None, the tonic pitch is returned. This is useful when starting a chain of iterative calls.

The direction attribute may be either ascending or descending. Default is ascending. Optionally, positive or negative integers may be provided as directional stepSize scalars.

An optional stepSize argument can be used to set the number of scale steps that are stepped through. Thus, .next(stepSize=2) will give not the next pitch in the scale, but the next after this one.

The getNeighbor will return a pitch from the scale if pitchOrigin is not in the scale. This value can be True, ‘ascending’, or ‘descending’.

>>> sc = scale.MajorScale('e-')
>>> print(sc.next('e-5'))
F5
>>> print(sc.next('e-5', stepSize=2))
G5
>>> print(sc.next('e-6', stepSize=3))
A-6

This uses the getNeighbor attribute to find the next note above f#5 in the E-flat major scale:

>>> sc.next('f#5')
<music21.pitch.Pitch G5>
>>> sc = scale.HarmonicMinorScale('g')
>>> sc.next('g4', 'descending')
<music21.pitch.Pitch F#4>
>>> sc.next('F#4', 'descending')
<music21.pitch.Pitch E-4>
>>> sc.next('E-4', 'descending')
<music21.pitch.Pitch D4>
>>> sc.next('E-4', 'ascending', 1)
<music21.pitch.Pitch F#4>
>>> sc.next('E-4', 'ascending', 2)
<music21.pitch.Pitch G4>
ConcreteScale.pitchFromDegree(degree, minPitch=None, maxPitch=None, direction='ascending', equateTermini=True)

Given a scale degree, return a deepcopy of the appropriate pitch.

>>> sc = scale.MajorScale('e-')
>>> sc.pitchFromDegree(2)
<music21.pitch.Pitch F4>
>>> sc.pitchFromDegree(7)
<music21.pitch.Pitch D5>
ConcreteScale.pitchesFromScaleDegrees(degreeTargets, minPitch=None, maxPitch=None, direction='ascending')

Given one or more scale degrees, return a list of all matches over the entire range.

>>> sc = scale.MajorScale('e-')
>>> sc.pitchesFromScaleDegrees([3,7])
[<music21.pitch.Pitch G4>, <music21.pitch.Pitch D5>]
>>> [str(p) for p in sc.pitchesFromScaleDegrees([3,7], 'c2', 'c6')]
['D2', 'G2', 'D3', 'G3', 'D4', 'G4', 'D5', 'G5']
>>> sc = scale.HarmonicMinorScale('a')
>>> [str(p) for p in sc.pitchesFromScaleDegrees([3,7], 'c2', 'c6')]
['C2', 'G#2', 'C3', 'G#3', 'C4', 'G#4', 'C5', 'G#5', 'C6']
ConcreteScale.romanNumeral(degree)

Return a RomanNumeral object built on the specified scale degree.

>>> sc1 = scale.MajorScale('a-4')
>>> h1 = sc1.romanNumeral(1)
>>> h1.root()
<music21.pitch.Pitch A-4>
>>> h5 = sc1.romanNumeral(5)
>>> h5.root()
<music21.pitch.Pitch E-5>
>>> h5
<music21.roman.RomanNumeral V in A- major>
ConcreteScale.show(fmt=None, app=None, direction='ascending')

Show the scale in a format. Here, prepare scala format if requested.

ConcreteScale.solfeg(pitchTarget=None, direction='ascending', variant='music21', chromatic=True)

Returns the chromatic solfege (or diatonic if chromatic is False) for a given pitch in a given scale.

The variant method lets one specify either the default music21 or humdrum solfeg representation for altered notes.

>>> eflatMaj = key.Key('E-')
>>> eflatMaj.solfeg(pitch.Pitch('G'))
'mi'
>>> eflatMaj.solfeg(pitch.Pitch('A'))
'fi'
>>> eflatMaj.solfeg(pitch.Pitch('A'), chromatic=False)
'fa'        
>>> eflatMaj.solfeg(pitch.Pitch('G#'), variant='music21') #default
'mis'
>>> eflatMaj.solfeg(pitch.Pitch('G#'), variant='humdrum')
'my'
ConcreteScale.transpose(value, inPlace=False)

Transpose this Scale by the given interval

note: it does not makes sense to transpose an abstract scale; thus, only concrete scales can be transposed.

>>> sc1 = scale.MajorScale('C')
>>> sc2 = sc1.transpose('p5')
>>> sc2
<music21.scale.MajorScale G major>
>>> sc3 = sc2.transpose('p5')
>>> sc3
<music21.scale.MajorScale D major>
ConcreteScale.tune(streamObj, minPitch=None, maxPitch=None, direction=None)

Given a Stream object containing Pitches, match all pitch names and or pitch space values and replace the target pitch with copies of pitches stored in this scale.

This is always applied recursively to all sub-Streams.

ConcreteScale.write(fmt=None, fp=None, direction='ascending')

Write the scale in a format. Here, prepare scala format if requested.

Methods inherited from Scale:

Methods inherited from Music21Object:

ConcreteScale instance variables

Instance variables inherited from Scale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object:

AbstractScale

class music21.scale.AbstractScale

An abstract scale is specific scale formation, but does not have a defined pitch collection or pitch reference. For example, all Major scales can be represented by an AbstractScale; a ConcreteScale, however, is a specific Major Scale, such as G Major.

These classes provide an interface to, and create and manipulate, the stored BoundIntervalNetwork object. Thus, they are rarely created or manipulated directly by most users.

The AbstractScale additionally stores an _alteredDegrees dictionary. Subclasses can define altered nodes in AbstractScale that are passed to the BoundIntervalNetwork.

AbstractScale bases

AbstractScale read-only properties

AbstractScale.networkxGraph

Return a networks Graph object representing a realized version of this BoundIntervalNetwork.

Read-only properties inherited from Scale:

Read-only properties inherited from Music21Object:

AbstractScale read/write properties

Read/write properties inherited from Music21Object:

AbstractScale methods

AbstractScale.buildNetworkFromPitches(pitchList)

Builds the network (list of motions) for an abstract scale from a list of pitch.Pitch objects. If the concluding note (usually the “octave”) is not given, then it’ll be created automatically.

Here we treat the augmented triad as a scale:

>>> p1 = pitch.Pitch("C4")
>>> p2 = pitch.Pitch("E4")
>>> p3 = pitch.Pitch("G#4")
>>> absc = scale.AbstractScale()
>>> absc.buildNetworkFromPitches([p1, p2, p3])
>>> absc.octaveDuplicating
True
>>> absc._net
<music21.intervalNetwork.BoundIntervalNetwork object at 0x...>

Now see it return a new “scale” of the augmentedTriad on D5

>>> absc._net.realizePitch('D5')
[<music21.pitch.Pitch D5>, <music21.pitch.Pitch F#5>, 
 <music21.pitch.Pitch A#5>, <music21.pitch.Pitch D6>]
AbstractScale.fixDefaultOctaveForPitchList(pitchList)

Suppose you have a set of octaveless Pitches that you use to make a scale.

Something like:

>>> pitchListStrs = "a b c d e f g a".split()
>>> pitchList = [pitch.Pitch(p) for p in pitchListStrs]

Here’s the problem, between pitchList[1] and pitchList[2] the .implicitOctave stays the same, so the .ps drops:

>>> (pitchList[1].implicitOctave, pitchList[2].implicitOctave)
(4, 4)        
>>> (pitchList[1].ps, pitchList[2].ps)
(71.0, 60.0)

Hence this helper method that makes it so that for octaveless pitches ONLY, each one has a .ps above the previous:

>>> sc = scale.AbstractScale()
>>> pitchList2 = sc.fixDefaultOctaveForPitchList(pitchList)
>>> (pitchList2[1].implicitOctave, pitchList2[2].implicitOctave, pitchList2[3].implicitOctave)
(4, 5, 5)        
>>> (pitchList2[1].ps, pitchList2[2].ps)
(71.0, 72.0)

Note that the list is modified inPlace:

>>> pitchList is pitchList2
True
>>> pitchList[2] is pitchList2[2]
True
AbstractScale.getDegreeMaxUnique()

Return the maximum number of scale steps, or the number to use as a modulus.

AbstractScale.getIntervals(stepOfPitch=None, minPitch=None, maxPitch=None, direction='ascending', reverse=False)

Realize the abstract scale as a list of pitch objects, given a pitch object, the step of that pitch object, and a min and max pitch.

AbstractScale.getNewTonicPitch(pitchReference, nodeName, direction='ascending', minPitch=None, maxPitch=None)

Define a pitch target and a node.

AbstractScale.getPitchFromNodeDegree(pitchReference, nodeName, nodeDegreeTarget, direction='ascending', minPitch=None, maxPitch=None, equateTermini=True)

Get a pitch for desired scale degree.

AbstractScale.getRealization(pitchObj, stepOfPitch, minPitch=None, maxPitch=None, direction='ascending', reverse=False)

Realize the abstract scale as a list of pitch objects, given a pitch object, the step of that pitch object, and a min and max pitch.

AbstractScale.getRelativeNodeDegree(pitchReference, nodeName, pitchTarget, comparisonAttribute='pitchClass', direction='ascending')

Expose functionality from BoundIntervalNetwork, passing on the stored alteredDegrees dictionary.

AbstractScale.getScalaStorage(direction='ascending')

Get the interval sequence as a :class:~music21.scala.ScalaStorage object for a particular scale:

AbstractScale.nextPitch(pitchReference, nodeName, pitchOrigin, direction='ascending', stepSize=1, getNeighbor=True)

Expose functionality from BoundIntervalNetwork, passing on the stored alteredDegrees dictionary.

AbstractScale.plot(*args, **keywords)

Create and display a plot.

AbstractScale.realizePitchByDegree(pitchReference, nodeId, nodeDegreeTargets, direction='ascending', minPitch=None, maxPitch=None)

Given one or more scale degrees, return a list of all matches over the entire range. See realizePitchByDegree(). in intervalNetwork.BoundIntervalNetwork.

Create an abstract pentatonic scale:

>>> pitchList = ["C#4","D#4","F#4","G#4","A#4"]
>>> absc = scale.AbstractScale()
>>> absc.buildNetworkFromPitches([pitch.Pitch(p) for p in pitchList])
AbstractScale.show(fmt=None, app=None, direction='ascending')

Show the scale in a format. Here, prepare scala format if requested.

AbstractScale.write(fmt=None, fp=None, direction='ascending')

Write the scale in a format. Here, prepare scala format if requested.

Methods inherited from Scale:

Methods inherited from Music21Object:

AbstractScale instance variables

Instance variables inherited from Scale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object:

AbstractCyclicalScale

class music21.scale.AbstractCyclicalScale(mode=None)

A scale of any size built with an interval list of any form. The resulting scale may be non octave repeating.

AbstractCyclicalScale bases

AbstractCyclicalScale read-only properties

Read-only properties inherited from AbstractScale:

Read-only properties inherited from Scale:

Read-only properties inherited from Music21Object:

AbstractCyclicalScale read/write properties

Read/write properties inherited from Music21Object:

AbstractCyclicalScale methods

Methods inherited from AbstractScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

AbstractCyclicalScale instance variables

Instance variables inherited from AbstractScale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Scale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object:

AbstractDiatonicScale

class music21.scale.AbstractDiatonicScale(mode=None)

AbstractDiatonicScale bases

AbstractDiatonicScale read-only properties

Read-only properties inherited from AbstractScale:

Read-only properties inherited from Scale:

Read-only properties inherited from Music21Object:

AbstractDiatonicScale read/write properties

Read/write properties inherited from Music21Object:

AbstractDiatonicScale methods

Methods inherited from AbstractScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

AbstractDiatonicScale instance variables

Instance variables inherited from AbstractScale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Scale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object:

AbstractHarmonicMinorScale

class music21.scale.AbstractHarmonicMinorScale(mode=None)

A true bi-directional scale that with the augmented second to a leading tone.

This is the only scale to use the “_alteredDegrees” property.

AbstractHarmonicMinorScale bases

AbstractHarmonicMinorScale read-only properties

Read-only properties inherited from AbstractScale:

Read-only properties inherited from Scale:

Read-only properties inherited from Music21Object:

AbstractHarmonicMinorScale read/write properties

Read/write properties inherited from Music21Object:

AbstractHarmonicMinorScale methods

Methods inherited from AbstractScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

AbstractHarmonicMinorScale instance variables

Instance variables inherited from AbstractScale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Scale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object:

AbstractMelodicMinorScale

class music21.scale.AbstractMelodicMinorScale(mode=None)

A directional scale.

AbstractMelodicMinorScale bases

AbstractMelodicMinorScale read-only properties

Read-only properties inherited from AbstractScale:

Read-only properties inherited from Scale:

Read-only properties inherited from Music21Object:

AbstractMelodicMinorScale read/write properties

Read/write properties inherited from Music21Object:

AbstractMelodicMinorScale methods

Methods inherited from AbstractScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

AbstractMelodicMinorScale instance variables

Instance variables inherited from AbstractScale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Scale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object:

AbstractOctatonicScale

class music21.scale.AbstractOctatonicScale(mode=None)

Abstract scale representing the two octatonic scales.

AbstractOctatonicScale bases

AbstractOctatonicScale read-only properties

Read-only properties inherited from AbstractScale:

Read-only properties inherited from Scale:

Read-only properties inherited from Music21Object:

AbstractOctatonicScale read/write properties

Read/write properties inherited from Music21Object:

AbstractOctatonicScale methods

Methods inherited from AbstractScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

AbstractOctatonicScale instance variables

Instance variables inherited from AbstractScale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Scale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object:

AbstractOctaveRepeatingScale

class music21.scale.AbstractOctaveRepeatingScale(mode=None)

A scale of any size built with an interval list that assumes octave completion. An additional interval to complete the octave will be added to the provided intervals. This does not guarantee that the octave will be repeated in one octave, only the next octave above the last interval will be provided.

AbstractOctaveRepeatingScale bases

AbstractOctaveRepeatingScale read-only properties

Read-only properties inherited from AbstractScale:

Read-only properties inherited from Scale:

Read-only properties inherited from Music21Object:

AbstractOctaveRepeatingScale read/write properties

Read/write properties inherited from Music21Object:

AbstractOctaveRepeatingScale methods

Methods inherited from AbstractScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

AbstractOctaveRepeatingScale instance variables

Instance variables inherited from AbstractScale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Scale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object:

AbstractRagAsawari

class music21.scale.AbstractRagAsawari

A pseudo raga-scale.

AbstractRagAsawari bases

AbstractRagAsawari read-only properties

Read-only properties inherited from AbstractScale:

Read-only properties inherited from Scale:

Read-only properties inherited from Music21Object:

AbstractRagAsawari read/write properties

Read/write properties inherited from Music21Object:

AbstractRagAsawari methods

Methods inherited from AbstractScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

AbstractRagAsawari instance variables

Instance variables inherited from AbstractScale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Scale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object:

AbstractRagMarwa

class music21.scale.AbstractRagMarwa

A pseudo raga-scale.

AbstractRagMarwa bases

AbstractRagMarwa read-only properties

Read-only properties inherited from AbstractScale:

Read-only properties inherited from Scale:

Read-only properties inherited from Music21Object:

AbstractRagMarwa read/write properties

Read/write properties inherited from Music21Object:

AbstractRagMarwa methods

Methods inherited from AbstractScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

AbstractRagMarwa instance variables

Instance variables inherited from AbstractScale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Scale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object:

AbstractWeightedHexatonicBlues

class music21.scale.AbstractWeightedHexatonicBlues

A dynamic, probabilistic mixture of minor pentatonic and a hexatonic blues scale

AbstractWeightedHexatonicBlues bases

AbstractWeightedHexatonicBlues read-only properties

Read-only properties inherited from AbstractScale:

Read-only properties inherited from Scale:

Read-only properties inherited from Music21Object:

AbstractWeightedHexatonicBlues read/write properties

Read/write properties inherited from Music21Object:

AbstractWeightedHexatonicBlues methods

Methods inherited from AbstractScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

AbstractWeightedHexatonicBlues instance variables

Instance variables inherited from AbstractScale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Scale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object:

ChromaticScale

class music21.scale.ChromaticScale(tonic=None)

A concrete cyclical scale, based on a cycle of half steps. These intervals do not have to be octave completing, and thus may produce scales that do no

>>> sc = scale.ChromaticScale('g2') 
>>> [str(p) for p in sc.pitches]
['G2', 'A-2', 'A2', 'B-2', 'B2', 'C3', 'C#3', 'D3', 'E-3', 'E3', 'F3', 'F#3', 'G3']
>>> [str(p) for p in sc.getPitches('g2', 'g6')]
['G2', 'A-2', ..., 'F#3', 'G3', 'A-3', ..., 'F#4', 'G4', 'A-4', ..., 'G5', ..., 'F#6', 'G6']
>>> sc.abstract.getDegreeMaxUnique()
12
>>> sc.pitchFromDegree(1) 
<music21.pitch.Pitch G2>
>>> sc.pitchFromDegree(2) 
<music21.pitch.Pitch A-2>
>>> sc.pitchFromDegree(3) 
<music21.pitch.Pitch A2>
>>> sc.pitchFromDegree(8) 
<music21.pitch.Pitch D3>
>>> sc.pitchFromDegree(12) 
<music21.pitch.Pitch F#3>
>>> sc.getScaleDegreeFromPitch('g2', comparisonAttribute='pitchClass')
1
>>> sc.getScaleDegreeFromPitch('F#6', comparisonAttribute='pitchClass')
12

ChromaticScale bases

ChromaticScale read-only properties

Read-only properties inherited from ConcreteScale:

Read-only properties inherited from Music21Object:

ChromaticScale read/write properties

Read/write properties inherited from Music21Object:

ChromaticScale methods

Methods inherited from ConcreteScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

ChromaticScale instance variables

Instance variables inherited from ConcreteScale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Scale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object:

CyclicalScale

class music21.scale.CyclicalScale(tonic=None, intervalList=['m2'])

A concrete cyclical scale, based on a cycle of intervals. These intervals do not have to be octave completing, and thus may produce scales that do no

>>> sc = scale.CyclicalScale('c4', 'p5') # can give one list
>>> sc.pitches
[<music21.pitch.Pitch C4>, <music21.pitch.Pitch G4>]
>>> [str(p) for p in sc.getPitches('g2', 'g6')] 
['B-2', 'F3', 'C4', 'G4', 'D5', 'A5', 'E6']
>>> sc.getScaleDegreeFromPitch('g4') # as single interval cycle, all are 1
1
>>> sc.getScaleDegreeFromPitch('b-2', direction='bi')
1

CyclicalScale bases

CyclicalScale read-only properties

Read-only properties inherited from ConcreteScale:

Read-only properties inherited from Music21Object:

CyclicalScale read/write properties

Read/write properties inherited from Music21Object:

CyclicalScale methods

Methods inherited from ConcreteScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

CyclicalScale instance variables

Instance variables inherited from ConcreteScale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Scale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object:

DiatonicScale

class music21.scale.DiatonicScale(tonic=None)

A concrete diatonic scale. Each DiatonicScale has one instance of a AbstractDiatonicScale.

DiatonicScale bases

DiatonicScale read-only properties

Read-only properties inherited from ConcreteScale:

Read-only properties inherited from Music21Object:

DiatonicScale read/write properties

Read/write properties inherited from Music21Object:

DiatonicScale methods

DiatonicScale.getDominant()

Return the dominant.

>>> sc = scale.MajorScale('e-')
>>> sc.getDominant()
<music21.pitch.Pitch B-4>
>>> sc = scale.MajorScale('F#')
>>> sc.getDominant()
<music21.pitch.Pitch C#5>
DiatonicScale.getLeadingTone()

Return the leading tone.

>>> sc = scale.MinorScale('c')
>>> sc.getLeadingTone()
<music21.pitch.Pitch B4>

Note that the leading tone isn’t necessarily the same as the 7th scale degree in minor:

>>> sc.pitchFromDegree(7)
<music21.pitch.Pitch B-4>
DiatonicScale.getParallelMajor()

Return a concrete relative major scale

>>> sc1 = scale.MinorScale(pitch.Pitch('g'))
>>> [str(p) for p in sc1.pitches]
['G4', 'A4', 'B-4', 'C5', 'D5', 'E-5', 'F5', 'G5']
>>> sc2 = sc1.getParallelMajor()
>>> [str(p) for p in sc2.pitches]
['G4', 'A4', 'B4', 'C5', 'D5', 'E5', 'F#5', 'G5']
DiatonicScale.getParallelMinor()

Return a parallel minor scale based on this concrete scale.

>>> sc1 = scale.MajorScale(pitch.Pitch('a'))
>>> [str(p) for p in sc1.pitches]
['A4', 'B4', 'C#5', 'D5', 'E5', 'F#5', 'G#5', 'A5']
>>> sc2 = sc1.getParallelMinor()
>>> [str(p) for p in sc2.pitches]
['A4', 'B4', 'C5', 'D5', 'E5', 'F5', 'G5', 'A5']

Running getParallelMinor() again doesn’t change anything

>>> sc3 = sc2.getParallelMinor()
>>> [str(p) for p in sc3.pitches]
['A4', 'B4', 'C5', 'D5', 'E5', 'F5', 'G5', 'A5']
DiatonicScale.getRelativeMajor()

Return a concrete relative major scale

>>> sc1 = scale.MinorScale(pitch.Pitch('g'))
>>> [str(p) for p in sc1.pitches]
['G4', 'A4', 'B-4', 'C5', 'D5', 'E-5', 'F5', 'G5']
>>> sc2 = sc1.getRelativeMajor()
>>> [str(p) for p in sc2.pitches]
['B-4', 'C5', 'D5', 'E-5', 'F5', 'G5', 'A5', 'B-5']

Though it’s unlikely you would want to do it, getRelativeMajor works on other diatonic scales than just Major and Minor.

>>> sc2 = scale.DorianScale('d')
>>> [str(p) for p in sc2.pitches]
['D4', 'E4', 'F4', 'G4', 'A4', 'B4', 'C5', 'D5']
>>> [str(p) for p in sc2.getRelativeMajor().pitches]
['C5', 'D5', 'E5', 'F5', 'G5', 'A5', 'B5', 'C6']
DiatonicScale.getRelativeMinor()

Return a relative minor scale based on this concrete scale.

>>> sc1 = scale.MajorScale(pitch.Pitch('a'))
>>> [str(p) for p in sc1.pitches]
['A4', 'B4', 'C#5', 'D5', 'E5', 'F#5', 'G#5', 'A5']
>>> sc2 = sc1.getRelativeMinor()
>>> [str(p) for p in sc2.pitches]
['F#5', 'G#5', 'A5', 'B5', 'C#6', 'D6', 'E6', 'F#6']
DiatonicScale.getTonic()

Return the tonic of the diatonic scale.

>>> sc = scale.MajorScale('e-')
>>> sc.getTonic()
<music21.pitch.Pitch E-4>
>>> sc = scale.MajorScale('F#')
>>> sc.getTonic()
<music21.pitch.Pitch F#4>

If no tonic has been defined, it will return an Exception. (same is true for getDominant, getLeadingTone, etc.)

>>> sc = scale.DiatonicScale()
>>> sc.getTonic()
Traceback (most recent call last):
IntervalNetworkException: pitchReference cannot be None

Methods inherited from ConcreteScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

DiatonicScale instance variables

Instance variables inherited from ConcreteScale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Scale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object:

DorianScale

class music21.scale.DorianScale(tonic=None)

A natural minor scale, or the Aeolian mode.

>>> sc = scale.DorianScale(pitch.Pitch('d'))
>>> [str(p) for p in sc.pitches]
['D4', 'E4', 'F4', 'G4', 'A4', 'B4', 'C5', 'D5']

DorianScale bases

DorianScale read-only properties

Read-only properties inherited from ConcreteScale:

Read-only properties inherited from Music21Object:

DorianScale read/write properties

Read/write properties inherited from Music21Object:

DorianScale methods

Methods inherited from DiatonicScale:

Methods inherited from ConcreteScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

DorianScale instance variables

Instance variables inherited from DiatonicScale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from ConcreteScale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Scale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object:

HarmonicMinorScale

class music21.scale.HarmonicMinorScale(tonic=None)

A harmonic minor scale

>>> sc = scale.HarmonicMinorScale('e4')
>>> [str(p) for p in sc.pitches]
['E4', 'F#4', 'G4', 'A4', 'B4', 'C5', 'D#5', 'E5']
>>> sc.getTonic()
<music21.pitch.Pitch E4>
>>> sc.getDominant()
<music21.pitch.Pitch B4>
>>> sc.pitchFromDegree(1) # scale degree 1 is treated as lowest
<music21.pitch.Pitch E4>
>>> sc = scale.HarmonicMinorScale()
>>> sc.deriveRanked(['C', 'E', 'G'], comparisonAttribute='name')
[(3, <music21.scale.HarmonicMinorScale F harmonic minor>), (3, <music21.scale.HarmonicMinorScale E harmonic minor>), (2, <music21.scale.HarmonicMinorScale B harmonic minor>), (2, <music21.scale.HarmonicMinorScale A harmonic minor>)]    

HarmonicMinorScale bases

HarmonicMinorScale read-only properties

Read-only properties inherited from ConcreteScale:

Read-only properties inherited from Music21Object:

HarmonicMinorScale read/write properties

Read/write properties inherited from Music21Object:

HarmonicMinorScale methods

Methods inherited from DiatonicScale:

Methods inherited from ConcreteScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

HarmonicMinorScale instance variables

Instance variables inherited from DiatonicScale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from ConcreteScale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Scale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object:

HypoaeolianScale

class music21.scale.HypoaeolianScale(tonic=None)

A hypoaeolian scale

>>> sc = scale.HypoaeolianScale(pitch.Pitch('a'))
>>> [str(p) for p in sc.pitches]
['E4', 'F4', 'G4', 'A4', 'B4', 'C5', 'D5', 'E5']
>>> sc = scale.HypoaeolianScale(pitch.Pitch('c'))
>>> [str(p) for p in sc.pitches]
['G3', 'A-3', 'B-3', 'C4', 'D4', 'E-4', 'F4', 'G4']

HypoaeolianScale bases

HypoaeolianScale read-only properties

Read-only properties inherited from ConcreteScale:

Read-only properties inherited from Music21Object:

HypoaeolianScale read/write properties

Read/write properties inherited from Music21Object:

HypoaeolianScale methods

Methods inherited from DiatonicScale:

Methods inherited from ConcreteScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

HypoaeolianScale instance variables

Instance variables inherited from DiatonicScale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from ConcreteScale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Scale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object:

HypodorianScale

class music21.scale.HypodorianScale(tonic=None)

A hypodorian scale

>>> sc = scale.HypodorianScale(pitch.Pitch('d'))
>>> [str(p) for p in sc.pitches]
['A3', 'B3', 'C4', 'D4', 'E4', 'F4', 'G4', 'A4']
>>> sc = scale.HypodorianScale(pitch.Pitch('c'))
>>> [str(p) for p in sc.pitches]
['G3', 'A3', 'B-3', 'C4', 'D4', 'E-4', 'F4', 'G4']

HypodorianScale bases

HypodorianScale read-only properties

Read-only properties inherited from ConcreteScale:

Read-only properties inherited from Music21Object:

HypodorianScale read/write properties

Read/write properties inherited from Music21Object:

HypodorianScale methods

Methods inherited from DiatonicScale:

Methods inherited from ConcreteScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

HypodorianScale instance variables

Instance variables inherited from DiatonicScale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from ConcreteScale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Scale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object:

HypolocrianScale

class music21.scale.HypolocrianScale(tonic=None)

A hypolocrian scale

>>> sc = scale.HypolocrianScale(pitch.Pitch('b'))
>>> [str(p) for p in sc.pitches]
['F4', 'G4', 'A4', 'B4', 'C5', 'D5', 'E5', 'F5']
>>> sc = scale.HypolocrianScale(pitch.Pitch('c'))
>>> [str(p) for p in sc.pitches]
['G-3', 'A-3', 'B-3', 'C4', 'D-4', 'E-4', 'F4', 'G-4']

HypolocrianScale bases

HypolocrianScale read-only properties

Read-only properties inherited from ConcreteScale:

Read-only properties inherited from Music21Object:

HypolocrianScale read/write properties

Read/write properties inherited from Music21Object:

HypolocrianScale methods

Methods inherited from DiatonicScale:

Methods inherited from ConcreteScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

HypolocrianScale instance variables

Instance variables inherited from DiatonicScale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from ConcreteScale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Scale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object:

HypolydianScale

class music21.scale.HypolydianScale(tonic=None)

A hypolydian scale

>>> sc = scale.HypolydianScale(pitch.Pitch('f'))
>>> [str(p) for p in sc.pitches]
['C4', 'D4', 'E4', 'F4', 'G4', 'A4', 'B4', 'C5']
>>> sc = scale.HypolydianScale(pitch.Pitch('c'))
>>> [str(p) for p in sc.pitches]
['G3', 'A3', 'B3', 'C4', 'D4', 'E4', 'F#4', 'G4']

HypolydianScale bases

HypolydianScale read-only properties

Read-only properties inherited from ConcreteScale:

Read-only properties inherited from Music21Object:

HypolydianScale read/write properties

Read/write properties inherited from Music21Object:

HypolydianScale methods

Methods inherited from DiatonicScale:

Methods inherited from ConcreteScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

HypolydianScale instance variables

Instance variables inherited from DiatonicScale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from ConcreteScale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Scale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object:

HypomixolydianScale

class music21.scale.HypomixolydianScale(tonic=None)

A hypolydian scale

>>> sc = scale.HypomixolydianScale(pitch.Pitch('g'))
>>> [str(p) for p in sc.pitches]
['D4', 'E4', 'F4', 'G4', 'A4', 'B4', 'C5', 'D5']
>>> sc = scale.HypomixolydianScale(pitch.Pitch('c'))
>>> [str(p) for p in sc.pitches]
['G3', 'A3', 'B-3', 'C4', 'D4', 'E4', 'F4', 'G4']

HypomixolydianScale bases

HypomixolydianScale read-only properties

Read-only properties inherited from ConcreteScale:

Read-only properties inherited from Music21Object:

HypomixolydianScale read/write properties

Read/write properties inherited from Music21Object:

HypomixolydianScale methods

Methods inherited from DiatonicScale:

Methods inherited from ConcreteScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

HypomixolydianScale instance variables

Instance variables inherited from DiatonicScale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from ConcreteScale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Scale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object:

HypophrygianScale

class music21.scale.HypophrygianScale(tonic=None)

A hypophrygian scale

>>> sc = scale.HypophrygianScale(pitch.Pitch('e'))
>>> sc.abstract.octaveDuplicating
True
>>> [str(p) for p in sc.pitches]
['B3', 'C4', 'D4', 'E4', 'F4', 'G4', 'A4', 'B4']
>>> sc.getTonic()
<music21.pitch.Pitch E4>
>>> sc.getDominant()
<music21.pitch.Pitch A4>
>>> sc.pitchFromDegree(1) # scale degree 1 is treated as lowest
<music21.pitch.Pitch B3>

HypophrygianScale bases

HypophrygianScale read-only properties

Read-only properties inherited from ConcreteScale:

Read-only properties inherited from Music21Object:

HypophrygianScale read/write properties

Read/write properties inherited from Music21Object:

HypophrygianScale methods

Methods inherited from DiatonicScale:

Methods inherited from ConcreteScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

HypophrygianScale instance variables

Instance variables inherited from DiatonicScale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from ConcreteScale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Scale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object:

LocrianScale

class music21.scale.LocrianScale(tonic=None)

A locrian scale

>>> sc = scale.LocrianScale(pitch.Pitch('b'))
>>> [str(p) for p in sc.pitches]
['B4', 'C5', 'D5', 'E5', 'F5', 'G5', 'A5', 'B5']
>>> sc = scale.LocrianScale(pitch.Pitch('c'))
>>> [str(p) for p in sc.pitches]
['C4', 'D-4', 'E-4', 'F4', 'G-4', 'A-4', 'B-4', 'C5']

LocrianScale bases

LocrianScale read-only properties

Read-only properties inherited from ConcreteScale:

Read-only properties inherited from Music21Object:

LocrianScale read/write properties

Read/write properties inherited from Music21Object:

LocrianScale methods

Methods inherited from DiatonicScale:

Methods inherited from ConcreteScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

LocrianScale instance variables

Instance variables inherited from DiatonicScale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from ConcreteScale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Scale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object:

LydianScale

class music21.scale.LydianScale(tonic=None)

A lydian scale

>>> sc = scale.LydianScale(pitch.Pitch('f'))
>>> [str(p) for p in sc.pitches]
['F4', 'G4', 'A4', 'B4', 'C5', 'D5', 'E5', 'F5']
>>> sc = scale.LydianScale(pitch.Pitch('c'))
>>> [str(p) for p in sc.pitches]
['C4', 'D4', 'E4', 'F#4', 'G4', 'A4', 'B4', 'C5']

LydianScale bases

LydianScale read-only properties

Read-only properties inherited from ConcreteScale:

Read-only properties inherited from Music21Object:

LydianScale read/write properties

Read/write properties inherited from Music21Object:

LydianScale methods

Methods inherited from DiatonicScale:

Methods inherited from ConcreteScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

LydianScale instance variables

Instance variables inherited from DiatonicScale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from ConcreteScale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Scale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object:

MajorScale

class music21.scale.MajorScale(tonic=None)

A Major Scale

>>> sc = scale.MajorScale(pitch.Pitch('d'))
>>> sc.pitchFromDegree(7).name
'C#'

MajorScale bases

MajorScale read-only properties

Read-only properties inherited from ConcreteScale:

Read-only properties inherited from Music21Object:

MajorScale read/write properties

Read/write properties inherited from Music21Object:

MajorScale methods

Methods inherited from DiatonicScale:

Methods inherited from ConcreteScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

MajorScale instance variables

Instance variables inherited from DiatonicScale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from ConcreteScale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Scale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object:

MelodicMinorScale

class music21.scale.MelodicMinorScale(tonic=None)

A melodic minor scale

>>> sc = scale.MelodicMinorScale('e4')

MelodicMinorScale bases

MelodicMinorScale read-only properties

Read-only properties inherited from ConcreteScale:

Read-only properties inherited from Music21Object:

MelodicMinorScale read/write properties

Read/write properties inherited from Music21Object:

MelodicMinorScale methods

Methods inherited from DiatonicScale:

Methods inherited from ConcreteScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

MelodicMinorScale instance variables

Instance variables inherited from DiatonicScale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from ConcreteScale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Scale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object:

MinorScale

class music21.scale.MinorScale(tonic=None)

A natural minor scale, or the Aeolian mode.

>>> sc = scale.MinorScale(pitch.Pitch('g'))
>>> [str(p) for p in sc.pitches]
['G4', 'A4', 'B-4', 'C5', 'D5', 'E-5', 'F5', 'G5']

MinorScale bases

MinorScale read-only properties

Read-only properties inherited from ConcreteScale:

Read-only properties inherited from Music21Object:

MinorScale read/write properties

Read/write properties inherited from Music21Object:

MinorScale methods

Methods inherited from DiatonicScale:

Methods inherited from ConcreteScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

MinorScale instance variables

Instance variables inherited from DiatonicScale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from ConcreteScale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Scale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object:

MixolydianScale

class music21.scale.MixolydianScale(tonic=None)

A mixolydian scale

>>> sc = scale.MixolydianScale(pitch.Pitch('g'))
>>> [str(p) for p in sc.pitches]
['G4', 'A4', 'B4', 'C5', 'D5', 'E5', 'F5', 'G5']
>>> sc = scale.MixolydianScale(pitch.Pitch('c'))
>>> [str(p) for p in sc.pitches]
['C4', 'D4', 'E4', 'F4', 'G4', 'A4', 'B-4', 'C5']

MixolydianScale bases

MixolydianScale read-only properties

Read-only properties inherited from ConcreteScale:

Read-only properties inherited from Music21Object:

MixolydianScale read/write properties

Read/write properties inherited from Music21Object:

MixolydianScale methods

Methods inherited from DiatonicScale:

Methods inherited from ConcreteScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

MixolydianScale instance variables

Instance variables inherited from DiatonicScale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from ConcreteScale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Scale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object:

OctatonicScale

class music21.scale.OctatonicScale(tonic=None, mode=None)

A concrete Octatonic scale. Two modes

OctatonicScale bases

OctatonicScale read-only properties

Read-only properties inherited from ConcreteScale:

Read-only properties inherited from Music21Object:

OctatonicScale read/write properties

Read/write properties inherited from Music21Object:

OctatonicScale methods

Methods inherited from ConcreteScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

OctatonicScale instance variables

Instance variables inherited from ConcreteScale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Scale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object:

OctaveRepeatingScale

class music21.scale.OctaveRepeatingScale(tonic=None, intervalList=['m2'])

A concrete cyclical scale, based on a cycle of intervals. These intervals do not have to be octave completing, and thus may produce scales that do no

>>> sc = scale.OctaveRepeatingScale('c4', ['m3', 'M3']) #
>>> sc.pitches
[<music21.pitch.Pitch C4>, <music21.pitch.Pitch E-4>, 
 <music21.pitch.Pitch G4>, <music21.pitch.Pitch C5>]
>>> [str(p) for p in sc.getPitches('g2', 'g6')] 
['G2', 'C3', 'E-3', 'G3', 'C4', 'E-4', 'G4', 'C5', 'E-5', 'G5', 'C6', 'E-6', 'G6']
>>> sc.getScaleDegreeFromPitch('c4')
1
>>> sc.getScaleDegreeFromPitch('e-')
2

OctaveRepeatingScale bases

OctaveRepeatingScale read-only properties

Read-only properties inherited from ConcreteScale:

Read-only properties inherited from Music21Object:

OctaveRepeatingScale read/write properties

Read/write properties inherited from Music21Object:

OctaveRepeatingScale methods

Methods inherited from ConcreteScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

OctaveRepeatingScale instance variables

Instance variables inherited from ConcreteScale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Scale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object:

PhrygianScale

class music21.scale.PhrygianScale(tonic=None)

A phrygian scale

>>> sc = scale.PhrygianScale(pitch.Pitch('e'))
>>> [str(p) for p in sc.pitches]
['E4', 'F4', 'G4', 'A4', 'B4', 'C5', 'D5', 'E5']

PhrygianScale bases

PhrygianScale read-only properties

Read-only properties inherited from ConcreteScale:

Read-only properties inherited from Music21Object:

PhrygianScale read/write properties

Read/write properties inherited from Music21Object:

PhrygianScale methods

Methods inherited from DiatonicScale:

Methods inherited from ConcreteScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

PhrygianScale instance variables

Instance variables inherited from DiatonicScale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from ConcreteScale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Scale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object:

RagAsawari

class music21.scale.RagAsawari(tonic=None)

A concrete pseudo-raga scale.

>>> sc = scale.RagAsawari('c2') 
>>> [str(p) for p in sc.pitches]
['C2', 'D2', 'F2', 'G2', 'A-2', 'C3']
>>> [str(p) for p in sc.getPitches(direction='descending')]
['C3', 'B-2', 'A-2', 'G2', 'F2', 'E-2', 'D2', 'C2']

RagAsawari bases

RagAsawari read-only properties

Read-only properties inherited from ConcreteScale:

Read-only properties inherited from Music21Object:

RagAsawari read/write properties

Read/write properties inherited from Music21Object:

RagAsawari methods

Methods inherited from ConcreteScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

RagAsawari instance variables

Instance variables inherited from ConcreteScale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Scale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object:

RagMarwa

class music21.scale.RagMarwa(tonic=None)

A concrete pseudo-raga scale.

>>> sc = scale.RagMarwa('c2') 

this gets a pitch beyond the terminus b/c of descending form max

>>> [str(p) for p in sc.pitches]
['C2', 'D-2', 'E2', 'F#2', 'A2', 'B2', 'A2', 'C3', 'D-3']

RagMarwa bases

RagMarwa read-only properties

Read-only properties inherited from ConcreteScale:

Read-only properties inherited from Music21Object:

RagMarwa read/write properties

Read/write properties inherited from Music21Object:

RagMarwa methods

Methods inherited from ConcreteScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

RagMarwa instance variables

Instance variables inherited from ConcreteScale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Scale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object:

ScalaScale

class music21.scale.ScalaScale(tonic=None, scalaString=None)

A scale created from a Scala scale .scl file. Any file in the Scala archive can be given by name. Additionally, a file path to a Scala .scl file, or a raw string representation, can be used.

>>> sc = scale.ScalaScale('g4', 'mbira banda')
>>> [str(p) for p in sc.pitches]
['G4', 'A4(-15c)', 'B4(-11c)', 'C#5(-7c)', 'D~5(+6c)', 'E5(+14c)', 'F~5(+1c)', 'A-5(+2c)']

if only a single string is given and it’s too long to be a tonic or it ends in .scl, assume it’s the name of a scala scale and set the tonic to C4

>>> sc = scale.ScalaScale('pelog_9')
>>> [str(p) for p in sc.pitches]
['C4', 'D`4(-17c)', 'D~4(+17c)', 'F~4(-17c)', 'G`4(+17c)', 'A-4', 'A~4(-17c)', 'C5']

If no scale with that name can be found then it raises an exception:

>>> sc = scale.ScalaScale('badFileName.scl')
Traceback (most recent call last):
ScaleException: Could not find a file named badFileName.scl in the scala database

ScalaScale bases

ScalaScale read-only properties

Read-only properties inherited from ConcreteScale:

Read-only properties inherited from Music21Object:

ScalaScale read/write properties

Read/write properties inherited from Music21Object:

ScalaScale methods

Methods inherited from ConcreteScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

ScalaScale instance variables

Instance variables inherited from ConcreteScale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Scale:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object:

Scale

class music21.scale.Scale

Generic base class for all scales, both abstract and concrete.

Scale bases

Scale read-only properties

Scale.isConcrete

To be concrete, a Scale must have a defined tonic. An abstract Scale is not Concrete, nor is a Concrete scale without a defined tonic.

Scale.name

Return or construct the name of this scale.

Read-only properties inherited from Music21Object:

Scale read/write properties

Read/write properties inherited from Music21Object:

Scale methods

Scale.extractPitchList(other, comparisonAttribute='nameWithOctave', removeDuplicates=True)

Utility function:

Given a data format as “other” (a ConcreteScale, Chord, Stream, List of Pitches, or single Pitch), extract all unique Pitches using comparisonAttribute to test for them.

>>> pStrList = ['A4','D4','E4','F-4','D4','D5', 'A', 'D#4']
>>> pList = [pitch.Pitch(p) for p in pStrList]
>>> nList = [note.Note(p) for p in pStrList]
>>> s = stream.Stream()
>>> for n in nList:
...     s.append(n)
>>> sc = scale.Scale()

Here we only remove the second ‘D4’ because the default comparison is nameWithOctave

>>> [str(p) for p in sc.extractPitchList(pList)]
['A4', 'D4', 'E4', 'F-4', 'D5', 'A', 'D#4']

Now we remove the F-4, D5, and A also because we are working with comparisonAttribute=pitchClass. Note that we’re using a Stream as other now...

>>> [str(p) for p in sc.extractPitchList(s, comparisonAttribute='pitchClass')]
['A4', 'D4', 'E4', 'D#4']

Now let’s get rid of all but one diatonic D by using step() as our comparisonAttribute. Note that we can just give a list of strings as well, and they become Pitch objects:

>>> [str(p) for p in sc.extractPitchList(pStrList, comparisonAttribute='step')]
['A4', 'D4', 'E4', 'F-4']

Methods inherited from Music21Object:

Scale instance variables

Instance variables inherited from Music21Object:

SieveScale

class music21.scale.SieveScale(tonic=None, sieveString='2@0', eld=1)

A scale created from a Xenakis sieve logical string, based on the Sieve object definition. The complete period of the sieve is realized as intervals and used to create a scale.

>>> sc = scale.SieveScale('c4', '3@0') 
>>> sc.pitches
[<music21.pitch.Pitch C4>, <music21.pitch.Pitch E-4>]
>>> sc = scale.SieveScale('d4', '3@0') 
>>> sc.pitches
[<music21.pitch.Pitch D4>, <music21.pitch.Pitch F4>]
>>> sc = scale.SieveScale('c2', '(-3@2 & 4) | (-3@1 & 4@1) | (3@2 & 4@2) | (-3 & 4@3)') 
>>> [str(p) for p in sc.pitches]
['C2', 'D2', 'E2', 'F2', 'G2', 'A2', 'B2', 'C3']

SieveScale bases

SieveScale read-only properties

Read-only properties inherited from ConcreteScale:

Read-only properties inherited from Music21Object:

SieveScale read/write properties

Read/write properties inherited from Music21Object:

SieveScale methods

Methods inherited from ConcreteScale: