music21.scale

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

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=scale.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=scale.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: str | Pitch | Note | None = None, pitches: list[music21.pitch.Pitch | str] | None = None, **keywords)

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.nextPitch('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.nextPitch('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']

Equality

Two ConcreteScales are the same if they satisfy all general Music21Object equality methods and their Abstract scales, their tonics, and their boundRanges are the same:

ConcreteScale bases

ConcreteScale read-only properties

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

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

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:

Read-only properties inherited from ProtoM21Object:

ConcreteScale read/write 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

Abstract scales can also be set afterwards:

>>> scVague = scale.ConcreteScale()
>>> scVague.abstract = scale.AbstractDiatonicScale('major')
>>> scVague.tonic = pitch.Pitch('D')
>>> [p.name for p in scVague.getPitches()]
['D', 'E', 'F#', 'G', 'A', 'B', 'C#', 'D']
>>> scVague.abstract = scale.AbstractOctatonicScale()
>>> [p.name for p in scVague.getPitches()]
['D', 'E', 'F', 'G', 'A-', 'B-', 'C-', 'D-', 'D']
  • Changed in v6: changing .abstract is now allowed.

Read/write properties inherited from Music21Object:

ConcreteScale methods

ConcreteScale.__eq__(other)

For concrete equality, the stored abstract objects must evaluate as equal, as well as local attributes.

>>> sc1 = scale.MajorScale('c')
>>> sc2 = scale.MajorScale('c')
>>> sc3 = scale.MinorScale('c')
>>> sc4 = scale.MajorScale('g')
>>> sc5 = scale.MajorScale()  # an abstract scale, as no tonic defined
>>> sc1 == sc2
True
>>> sc1 == sc3
False
>>> sc1 == sc4
False
>>> sc1.abstract == sc4.abstract  # can compare abstract forms
True
>>> sc4 == sc5  # implicit abstract comparison
True
>>> sc5 == sc2  # implicit abstract comparison
True
>>> sc5 == sc3  # implicit abstract comparison
False
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 has changed in the past 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, pitchRef)

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 matches.

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>)]

With the default of comparing by pitchClass, D- is fine for B major because C# is in the B major scale.

>>> 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>)]

Comparing based on enharmonic-sensitive spelling, has fewer hits for all of these scales:

>>> 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>)]

Notice that we check how many of the pitches are in the scale and do not de-duplicate pitches.

>>> 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>)]

If removeDuplicates is given, the E’s will get less weight:

>>> sc1.deriveRanked(['C', 'E', 'E', 'E', 'B'], removeDuplicates=True)
[(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(['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>)]

A Concrete Scale created from pitches still has similar characteristics to the original.

Here we 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'])

Notice the G# is allowed to be chosen even though we are specifically looking for scales with a G natural in them. Once no scale matched all three pitches, which scale that matches two pitches is arbitrary.

>>> bestScales = e.deriveRanked(['C', 'E', 'G'], resultsReturned=6)
>>> bestScales
[(3, <music21.scale.ConcreteScale E Concrete>),
 (3, <music21.scale.ConcreteScale D- Concrete>),
 (3, <music21.scale.ConcreteScale C# Concrete>),
 (2, <music21.scale.ConcreteScale B Concrete>),
 (2, <music21.scale.ConcreteScale A Concrete>),
 (2, <music21.scale.ConcreteScale G# Concrete>)]
>>> eConcrete = bestScales[0][1]
>>> ' '.join([str(p) for p in eConcrete.pitches])
'E4 F4 G4 A#4 B4 C5 D#5 E5'
ConcreteScale.findMissing(other, comparisonAttribute='pitchClass', minPitch=None, maxPitch=None, direction=Direction.ASCENDING, alteredDegrees=None)

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=Direction.ASCENDING, **keywords) music21.chord.Chord

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: str | Pitch | None = None, maxPitch: str | Pitch | None = None, direction: Direction | None = None) list[music21.pitch.Pitch]

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

ConcreteScale.getScalaData()

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

ConcreteScale.getScaleDegreeAndAccidentalFromPitch(pitchTarget, direction=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, <music21.pitch.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, <music21.pitch.Accidental flat>)
>>> aMin.getScaleDegreeAndAccidentalFromPitch(pitch.Pitch('G-'),
...                                           direction=scale.Direction.ASCENDING)
(7, <music21.pitch.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=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 use a find algorithm that is based on the note’s .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') is 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=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: Direction = Direction.ASCENDING, stepSize=1, getNeighbor: Direction | bool = 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', scale.Direction.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: Direction | int = Direction.ASCENDING, stepSize=1, getNeighbor: Direction | bool = True)

See nextPitch(). This function is a deprecated alias for that method.

This routine was named and created before music21 aspired to have full subclass substitution. Thus, is shadows the .next() function of Music21Object without performing similar functionality.

The routine is formally deprecated in v9 and will be removed in v10.

ConcreteScale.nextPitch(pitchOrigin=None, direction: Direction | int = Direction.ASCENDING, stepSize=1, getNeighbor: Direction | bool = True)

Get the next pitch above (or below if direction is Direction.DESCENDING) 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, .nextPitch(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, Direction.ASCENDING, or Direction.DESCENDING.

>>> sc = scale.MajorScale('e-')
>>> print(sc.nextPitch('e-5'))
F5
>>> print(sc.nextPitch('e-5', stepSize=2))
G5
>>> print(sc.nextPitch('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.nextPitch('f#5')
<music21.pitch.Pitch G5>
>>> sc = scale.HarmonicMinorScale('g')
>>> sc.nextPitch('g4', scale.Direction.DESCENDING)
<music21.pitch.Pitch F#4>
>>> sc.nextPitch('F#4', scale.Direction.DESCENDING)
<music21.pitch.Pitch E-4>
>>> sc.nextPitch('E-4', scale.Direction.DESCENDING)
<music21.pitch.Pitch D4>
>>> sc.nextPitch('E-4', scale.Direction.ASCENDING, 1)
<music21.pitch.Pitch F#4>
>>> sc.nextPitch('E-4', scale.Direction.ASCENDING, 2)
<music21.pitch.Pitch G4>
ConcreteScale.pitchFromDegree(degree: int, minPitch=None, maxPitch=None, direction: Direction = Direction.ASCENDING, equateTermini: bool = 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=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=Direction.ASCENDING)

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

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

Returns the chromatic solfeg (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('A')
'fi'
>>> eflatMaj.solfeg('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 make sense to transpose an abstract scale, since it is merely a collection of intervals. 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>
>>> sc3.transpose('p5', inPlace=True)
>>> sc3
<music21.scale.MajorScale A major>
ConcreteScale.tune(streamObj, minPitch=None, maxPitch=None, direction=None) 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=Direction.ASCENDING)

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

Methods inherited from Scale:

Methods inherited from Music21Object:

Methods inherited from ProtoM21Object:

ConcreteScale instance variables

Instance variables inherited from Music21Object:

AbstractScale

class music21.scale.AbstractScale(**keywords)

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 IntervalNetwork 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 IntervalNetwork.

Equality

Two abstract scales are the same if they have the same class and the same tonicDegree and octaveDuplicating attributes and the same intervalNetwork, and it satisfies all other music21 superclass attributes.

>>> as1 = scale.AbstractOctatonicScale()
>>> as2 = scale.AbstractOctatonicScale()
>>> as1 == as2
True
>>> as2.tonicDegree = 5
>>> as1 == as2
False
>>> as1 == scale.AbstractDiatonicScale()
False

AbstractScale bases

AbstractScale read-only properties

Read-only properties inherited from Scale:

Read-only properties inherited from Music21Object:

Read-only properties inherited from ProtoM21Object:

AbstractScale read/write properties

Read/write properties inherited from Music21Object:

AbstractScale methods

AbstractScale.buildNetwork()

Calling the buildNetwork, with or without parameters, is main job of the AbstractScale class. This needs to be subclassed by a derived class

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')
>>> abstractScale = scale.AbstractScale()
>>> abstractScale.buildNetworkFromPitches([p1, p2, p3])
>>> abstractScale.octaveDuplicating
True
>>> abstractScale._net
<music21.scale.intervalNetwork.IntervalNetwork object at 0x...>

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

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

It is also possible to use implicit octaves:

>>> abstract_scale = scale.AbstractScale()
>>> abstract_scale.buildNetworkFromPitches(['C', 'F'])
>>> abstract_scale.octaveDuplicating
True
>>> abstract_scale._net.realizePitch('G')
[<music21.pitch.Pitch G4>, <music21.pitch.Pitch C5>, <music21.pitch.Pitch G5>]
static 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 staticmethod that makes it so that for octaveless pitches ONLY, each one has a .ps above the previous:

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

Note that the list is modified inPlace:

>>> pitchList is pl2
True
>>> pitchList[2] is pl2[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=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=Direction.ASCENDING, minPitch=None, maxPitch=None)

Define a pitch target and a node.

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

Get a pitch for desired scale degree.

AbstractScale.getRealization(pitchObj, stepOfPitch, minPitch=None, maxPitch=None, direction=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=Direction.ASCENDING)

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

AbstractScale.getScalaData(direction=Direction.ASCENDING)

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

AbstractScale.nextPitch(pitchReference, nodeName, pitchOrigin, direction: Direction = Direction.ASCENDING, stepSize=1, getNeighbor: Direction | bool = True)

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

AbstractScale.realizePitchByDegree(pitchReference, nodeId, nodeDegreeTargets, direction=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.IntervalNetwork.

Create an abstract pentatonic scale:

>>> pitchList = ['C#4', 'D#4', 'F#4', 'G#4', 'A#4']
>>> abstractScale = scale.AbstractScale()
>>> abstractScale.buildNetworkFromPitches([pitch.Pitch(p) for p in pitchList])
AbstractScale.show(fmt=None, app=None, direction=Direction.ASCENDING, **keywords)

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

AbstractScale.write(fmt=None, fp=None, direction=Direction.ASCENDING, **keywords)

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

Methods inherited from Scale:

Methods inherited from Music21Object:

Methods inherited from ProtoM21Object:

AbstractScale instance variables

Instance variables inherited from Music21Object:

AbstractCyclicalScale

class music21.scale.AbstractCyclicalScale(mode=None, **keywords)

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 Scale:

Read-only properties inherited from Music21Object:

Read-only properties inherited from ProtoM21Object:

AbstractCyclicalScale read/write properties

Read/write properties inherited from Music21Object:

AbstractCyclicalScale methods

AbstractCyclicalScale.buildNetwork(mode)

Here, mode is the list of intervals.

Methods inherited from AbstractScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

Methods inherited from ProtoM21Object:

AbstractCyclicalScale instance variables

Instance variables inherited from Music21Object:

AbstractDiatonicScale

class music21.scale.AbstractDiatonicScale(mode: str | None = None, **keywords)

An abstract representation of a Diatonic scale w/ or without mode.

>>> as1 = scale.AbstractDiatonicScale('major')
>>> as1.type
'Abstract diatonic'
>>> as1.mode
'major'
>>> as1.octaveDuplicating
True

Equality

AbstractDiatonicScales must satisfy all the characteristics of a general AbstractScale but also need to have equal dominantDegrees.

>>> as1 = scale.AbstractDiatonicScale('major')
>>> as2 = scale.AbstractDiatonicScale('lydian')
>>> as1 == as2
False

Note that their modes do not need to be the same. For instance for the case of major and Ionian which have the same networks:

>>> as3 = scale.AbstractDiatonicScale('ionian')
>>> (as1.mode, as3.mode)
('major', 'ionian')
>>> as1 == as3
True

AbstractDiatonicScale bases

AbstractDiatonicScale read-only properties

Read-only properties inherited from Scale:

Read-only properties inherited from Music21Object:

Read-only properties inherited from ProtoM21Object:

AbstractDiatonicScale read/write properties

Read/write properties inherited from Music21Object:

AbstractDiatonicScale methods

AbstractDiatonicScale.buildNetwork(mode=None)

Given subclass dependent parameters, build and assign the IntervalNetwork.

>>> sc = scale.AbstractDiatonicScale()
>>> sc.buildNetwork('Lydian')  # N.B. case-insensitive name
>>> [str(p) for p in sc.getRealization('f4', 1, 'f2', 'f6')]
['F2', 'G2', 'A2', 'B2', 'C3', 'D3', 'E3',
 'F3', 'G3', 'A3', 'B3', 'C4', 'D4', 'E4',
 'F4', 'G4', 'A4', 'B4', 'C5', 'D5', 'E5',
 'F5', 'G5', 'A5', 'B5', 'C6', 'D6', 'E6', 'F6']

Unknown modes raise an exception:

>>> sc.buildNetwork('blues-like')
Traceback (most recent call last):
music21.scale.ScaleException: Cannot create a
    scale of the following mode: 'blues-like'
  • Changed in v6: case-insensitive modes

Methods inherited from AbstractScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

Methods inherited from ProtoM21Object:

AbstractDiatonicScale instance variables

Instance variables inherited from Music21Object:

AbstractHarmonicMinorScale

class music21.scale.AbstractHarmonicMinorScale(mode: str | None = None, **keywords)

A true bidirectional scale that with the augmented second to a leading tone.

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

mode is not used

AbstractHarmonicMinorScale bases

AbstractHarmonicMinorScale read-only properties

Read-only properties inherited from Scale:

Read-only properties inherited from Music21Object:

Read-only properties inherited from ProtoM21Object:

AbstractHarmonicMinorScale read/write properties

Read/write properties inherited from Music21Object:

AbstractHarmonicMinorScale methods

AbstractHarmonicMinorScale.buildNetwork()

Calling the buildNetwork, with or without parameters, is main job of the AbstractScale class. This needs to be subclassed by a derived class

Methods inherited from AbstractScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

Methods inherited from ProtoM21Object:

AbstractHarmonicMinorScale instance variables

Instance variables inherited from Music21Object:

AbstractMelodicMinorScale

class music21.scale.AbstractMelodicMinorScale(mode: str | None = None, **keywords)

A directional scale.

mode is not used.

AbstractMelodicMinorScale bases

AbstractMelodicMinorScale read-only properties

Read-only properties inherited from Scale:

Read-only properties inherited from Music21Object:

Read-only properties inherited from ProtoM21Object:

AbstractMelodicMinorScale read/write properties

Read/write properties inherited from Music21Object:

AbstractMelodicMinorScale methods

AbstractMelodicMinorScale.buildNetwork()

Calling the buildNetwork, with or without parameters, is main job of the AbstractScale class. This needs to be subclassed by a derived class

Methods inherited from AbstractScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

Methods inherited from ProtoM21Object:

AbstractMelodicMinorScale instance variables

Instance variables inherited from Music21Object:

AbstractOctatonicScale

class music21.scale.AbstractOctatonicScale(mode=None, **keywords)

Abstract scale representing the two octatonic scales.

AbstractOctatonicScale bases

AbstractOctatonicScale read-only properties

Read-only properties inherited from Scale:

Read-only properties inherited from Music21Object:

Read-only properties inherited from ProtoM21Object:

AbstractOctatonicScale read/write properties

Read/write properties inherited from Music21Object:

AbstractOctatonicScale methods

AbstractOctatonicScale.buildNetwork(mode=None)

Given subclass dependent parameters, build and assign the IntervalNetwork.

>>> sc = scale.AbstractDiatonicScale()
>>> sc.buildNetwork('lydian')
>>> [str(p) for p in sc.getRealization('f4', 1, 'f2', 'f6')]
['F2', 'G2', 'A2', 'B2', 'C3', 'D3', 'E3',
 'F3', 'G3', 'A3', 'B3', 'C4', 'D4', 'E4',
 'F4', 'G4', 'A4', 'B4', 'C5', 'D5', 'E5',
 'F5', 'G5', 'A5', 'B5', 'C6', 'D6', 'E6', 'F6']

Methods inherited from AbstractScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

Methods inherited from ProtoM21Object:

AbstractOctatonicScale instance variables

Instance variables inherited from Music21Object:

AbstractOctaveRepeatingScale

class music21.scale.AbstractOctaveRepeatingScale(mode=None, **keywords)

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 Scale:

Read-only properties inherited from Music21Object:

Read-only properties inherited from ProtoM21Object:

AbstractOctaveRepeatingScale read/write properties

Read/write properties inherited from Music21Object:

AbstractOctaveRepeatingScale methods

AbstractOctaveRepeatingScale.buildNetwork(mode)

Here, mode is the list of intervals.

Methods inherited from AbstractScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

Methods inherited from ProtoM21Object:

AbstractOctaveRepeatingScale instance variables

Instance variables inherited from Music21Object:

AbstractRagAsawari

class music21.scale.AbstractRagAsawari(**keywords)

A pseudo raga-scale.

AbstractRagAsawari bases

AbstractRagAsawari read-only properties

Read-only properties inherited from Scale:

Read-only properties inherited from Music21Object:

Read-only properties inherited from ProtoM21Object:

AbstractRagAsawari read/write properties

Read/write properties inherited from Music21Object:

AbstractRagAsawari methods

AbstractRagAsawari.buildNetwork()

Calling the buildNetwork, with or without parameters, is main job of the AbstractScale class. This needs to be subclassed by a derived class

Methods inherited from AbstractScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

Methods inherited from ProtoM21Object:

AbstractRagAsawari instance variables

Instance variables inherited from Music21Object:

AbstractRagMarwa

class music21.scale.AbstractRagMarwa(**keywords)

A pseudo raga-scale.

AbstractRagMarwa bases

AbstractRagMarwa read-only properties

Read-only properties inherited from Scale:

Read-only properties inherited from Music21Object:

Read-only properties inherited from ProtoM21Object:

AbstractRagMarwa read/write properties

Read/write properties inherited from Music21Object:

AbstractRagMarwa methods

AbstractRagMarwa.buildNetwork()

Calling the buildNetwork, with or without parameters, is main job of the AbstractScale class. This needs to be subclassed by a derived class

Methods inherited from AbstractScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

Methods inherited from ProtoM21Object:

AbstractRagMarwa instance variables

Instance variables inherited from Music21Object:

AbstractWeightedHexatonicBlues

class music21.scale.AbstractWeightedHexatonicBlues(**keywords)

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

AbstractWeightedHexatonicBlues bases

AbstractWeightedHexatonicBlues read-only properties

Read-only properties inherited from Scale:

Read-only properties inherited from Music21Object:

Read-only properties inherited from ProtoM21Object:

AbstractWeightedHexatonicBlues read/write properties

Read/write properties inherited from Music21Object:

AbstractWeightedHexatonicBlues methods

AbstractWeightedHexatonicBlues.buildNetwork()

Calling the buildNetwork, with or without parameters, is main job of the AbstractScale class. This needs to be subclassed by a derived class

Methods inherited from AbstractScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

Methods inherited from ProtoM21Object:

AbstractWeightedHexatonicBlues instance variables

Instance variables inherited from Music21Object:

ChromaticScale

class music21.scale.ChromaticScale(tonic=None, **keywords)

A concrete cyclical scale, based on a cycle of half steps.

>>> 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:

Read-only properties inherited from ProtoM21Object:

ChromaticScale read/write properties

Read/write properties inherited from ConcreteScale:

Read/write properties inherited from Music21Object:

ChromaticScale methods

Methods inherited from ConcreteScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

Methods inherited from ProtoM21Object:

ChromaticScale instance variables

Instance variables inherited from Music21Object:

CyclicalScale

class music21.scale.CyclicalScale(tonic: str | Pitch | Note | None = None, intervalList: list | None = None, **keywords)

A concrete cyclical scale, based on a cycle of intervals.

>>> 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=scale.Direction.BI)
1

No intervalList defaults to a single minor second:

>>> sc2 = scale.CyclicalScale()
>>> sc2.pitches
[<music21.pitch.Pitch C4>, <music21.pitch.Pitch D-4>]

CyclicalScale bases

CyclicalScale read-only properties

Read-only properties inherited from ConcreteScale:

Read-only properties inherited from Music21Object:

Read-only properties inherited from ProtoM21Object:

CyclicalScale read/write properties

Read/write properties inherited from ConcreteScale:

Read/write properties inherited from Music21Object:

CyclicalScale methods

Methods inherited from ConcreteScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

Methods inherited from ProtoM21Object:

CyclicalScale instance variables

Instance variables inherited from Music21Object:

DiatonicScale

class music21.scale.DiatonicScale(tonic: str | Pitch | Note | None = None, **keywords)

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:

Read-only properties inherited from ProtoM21Object:

DiatonicScale read/write properties

Read/write properties inherited from ConcreteScale:

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):
music21.scale.intervalNetwork.IntervalNetworkException: pitchReference cannot be None

Methods inherited from ConcreteScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

Methods inherited from ProtoM21Object:

DiatonicScale instance variables

Instance variables inherited from Music21Object:

DorianScale

class music21.scale.DorianScale(tonic=None, **keywords)

A scale built on the Dorian (D-D white-key) 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:

Read-only properties inherited from ProtoM21Object:

DorianScale read/write properties

Read/write properties inherited from ConcreteScale:

Read/write properties inherited from Music21Object:

DorianScale methods

Methods inherited from DiatonicScale:

Methods inherited from ConcreteScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

Methods inherited from ProtoM21Object:

DorianScale instance variables

Instance variables inherited from Music21Object:

HarmonicMinorScale

class music21.scale.HarmonicMinorScale(tonic=None, **keywords)

The harmonic minor collection, realized as a scale.

(The usage of this collection as a scale, is quite ahistorical for Western European classical music, but it is common in other parts of the world, but where the term “HarmonicMinor” would not be appropriate).

>>> 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
<music21.scale.HarmonicMinorScale Abstract harmonic minor>
>>> 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>)]

Note that G and D are also equally good as B and A, but the system arbitrarily chooses among ties.

HarmonicMinorScale bases

HarmonicMinorScale read-only properties

Read-only properties inherited from ConcreteScale:

Read-only properties inherited from Music21Object:

Read-only properties inherited from ProtoM21Object:

HarmonicMinorScale read/write properties

Read/write properties inherited from ConcreteScale:

Read/write properties inherited from Music21Object:

HarmonicMinorScale methods

Methods inherited from DiatonicScale:

Methods inherited from ConcreteScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

Methods inherited from ProtoM21Object:

HarmonicMinorScale instance variables

Instance variables inherited from Music21Object:

HypoaeolianScale

class music21.scale.HypoaeolianScale(tonic=None, **keywords)

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:

Read-only properties inherited from ProtoM21Object:

HypoaeolianScale read/write properties

Read/write properties inherited from ConcreteScale:

Read/write properties inherited from Music21Object:

HypoaeolianScale methods

Methods inherited from DiatonicScale:

Methods inherited from ConcreteScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

Methods inherited from ProtoM21Object:

HypoaeolianScale instance variables

Instance variables inherited from Music21Object:

HypodorianScale

class music21.scale.HypodorianScale(tonic=None, **keywords)

A hypodorian scale: a dorian scale where the given pitch is scale degree 4.

>>> 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:

Read-only properties inherited from ProtoM21Object:

HypodorianScale read/write properties

Read/write properties inherited from ConcreteScale:

Read/write properties inherited from Music21Object:

HypodorianScale methods

Methods inherited from DiatonicScale:

Methods inherited from ConcreteScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

Methods inherited from ProtoM21Object:

HypodorianScale instance variables

Instance variables inherited from Music21Object:

HypolocrianScale

class music21.scale.HypolocrianScale(tonic=None, **keywords)

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:

Read-only properties inherited from ProtoM21Object:

HypolocrianScale read/write properties

Read/write properties inherited from ConcreteScale:

Read/write properties inherited from Music21Object:

HypolocrianScale methods

Methods inherited from DiatonicScale:

Methods inherited from ConcreteScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

Methods inherited from ProtoM21Object:

HypolocrianScale instance variables

Instance variables inherited from Music21Object:

HypolydianScale

class music21.scale.HypolydianScale(tonic=None, **keywords)

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:

Read-only properties inherited from ProtoM21Object:

HypolydianScale read/write properties

Read/write properties inherited from ConcreteScale:

Read/write properties inherited from Music21Object:

HypolydianScale methods

Methods inherited from DiatonicScale:

Methods inherited from ConcreteScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

Methods inherited from ProtoM21Object:

HypolydianScale instance variables

Instance variables inherited from Music21Object:

HypomixolydianScale

class music21.scale.HypomixolydianScale(tonic=None, **keywords)

A hypomixolydian 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:

Read-only properties inherited from ProtoM21Object:

HypomixolydianScale read/write properties

Read/write properties inherited from ConcreteScale:

Read/write properties inherited from Music21Object:

HypomixolydianScale methods

Methods inherited from DiatonicScale:

Methods inherited from ConcreteScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

Methods inherited from ProtoM21Object:

HypomixolydianScale instance variables

Instance variables inherited from Music21Object:

HypophrygianScale

class music21.scale.HypophrygianScale(tonic=None, **keywords)

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:

Read-only properties inherited from ProtoM21Object:

HypophrygianScale read/write properties

Read/write properties inherited from ConcreteScale:

Read/write properties inherited from Music21Object:

HypophrygianScale methods

Methods inherited from DiatonicScale:

Methods inherited from ConcreteScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

Methods inherited from ProtoM21Object:

HypophrygianScale instance variables

Instance variables inherited from Music21Object:

LocrianScale

class music21.scale.LocrianScale(tonic=None, **keywords)

A so-called “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:

Read-only properties inherited from ProtoM21Object:

LocrianScale read/write properties

Read/write properties inherited from ConcreteScale:

Read/write properties inherited from Music21Object:

LocrianScale methods

Methods inherited from DiatonicScale:

Methods inherited from ConcreteScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

Methods inherited from ProtoM21Object:

LocrianScale instance variables

Instance variables inherited from Music21Object:

LydianScale

class music21.scale.LydianScale(tonic=None, **keywords)

A Lydian scale (that is, the F-F white-key scale; does not have the probability of B- emerging as in a historical Lydian collection).

>>> 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:

Read-only properties inherited from ProtoM21Object:

LydianScale read/write properties

Read/write properties inherited from ConcreteScale:

Read/write properties inherited from Music21Object:

LydianScale methods

Methods inherited from DiatonicScale:

Methods inherited from ConcreteScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

Methods inherited from ProtoM21Object:

LydianScale instance variables

Instance variables inherited from Music21Object:

MajorScale

class music21.scale.MajorScale(tonic=None, **keywords)

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:

Read-only properties inherited from ProtoM21Object:

MajorScale read/write properties

Read/write properties inherited from ConcreteScale:

Read/write properties inherited from Music21Object:

MajorScale methods

Methods inherited from DiatonicScale:

Methods inherited from ConcreteScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

Methods inherited from ProtoM21Object:

MajorScale instance variables

Instance variables inherited from Music21Object:

MelodicMinorScale

class music21.scale.MelodicMinorScale(tonic=None, **keywords)

A melodic minor scale, which is not the same ascending or descending

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

MelodicMinorScale bases

MelodicMinorScale read-only properties

Read-only properties inherited from ConcreteScale:

Read-only properties inherited from Music21Object:

Read-only properties inherited from ProtoM21Object:

MelodicMinorScale read/write properties

Read/write properties inherited from ConcreteScale:

Read/write properties inherited from Music21Object:

MelodicMinorScale methods

Methods inherited from DiatonicScale:

Methods inherited from ConcreteScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

Methods inherited from ProtoM21Object:

MelodicMinorScale instance variables

Instance variables inherited from Music21Object:

MinorScale

class music21.scale.MinorScale(tonic=None, **keywords)

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:

Read-only properties inherited from ProtoM21Object:

MinorScale read/write properties

Read/write properties inherited from ConcreteScale:

Read/write properties inherited from Music21Object:

MinorScale methods

Methods inherited from DiatonicScale:

Methods inherited from ConcreteScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

Methods inherited from ProtoM21Object:

MinorScale instance variables

Instance variables inherited from Music21Object:

MixolydianScale

class music21.scale.MixolydianScale(tonic=None, **keywords)

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:

Read-only properties inherited from ProtoM21Object:

MixolydianScale read/write properties

Read/write properties inherited from ConcreteScale:

Read/write properties inherited from Music21Object:

MixolydianScale methods

Methods inherited from DiatonicScale:

Methods inherited from ConcreteScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

Methods inherited from ProtoM21Object:

MixolydianScale instance variables

Instance variables inherited from Music21Object:

OctatonicScale

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

A concrete Octatonic scale in one of two modes

OctatonicScale bases

OctatonicScale read-only properties

Read-only properties inherited from ConcreteScale:

Read-only properties inherited from Music21Object:

Read-only properties inherited from ProtoM21Object:

OctatonicScale read/write properties

Read/write properties inherited from ConcreteScale:

Read/write properties inherited from Music21Object:

OctatonicScale methods

Methods inherited from ConcreteScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

Methods inherited from ProtoM21Object:

OctatonicScale instance variables

Instance variables inherited from Music21Object:

OctaveRepeatingScale

class music21.scale.OctaveRepeatingScale(tonic=None, intervalList: list | None = None, **keywords)

A concrete cyclical scale, based on a cycle of intervals.

>>> 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

No intervalList defaults to a single minor second:

>>> sc2 = scale.OctaveRepeatingScale()
>>> sc2.pitches
[<music21.pitch.Pitch C4>, <music21.pitch.Pitch D-4>, <music21.pitch.Pitch C5>]

OctaveRepeatingScale bases

OctaveRepeatingScale read-only properties

Read-only properties inherited from ConcreteScale:

Read-only properties inherited from Music21Object:

Read-only properties inherited from ProtoM21Object:

OctaveRepeatingScale read/write properties

Read/write properties inherited from ConcreteScale:

Read/write properties inherited from Music21Object:

OctaveRepeatingScale methods

Methods inherited from ConcreteScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

Methods inherited from ProtoM21Object:

OctaveRepeatingScale instance variables

Instance variables inherited from Music21Object:

PhrygianScale

class music21.scale.PhrygianScale(tonic=None, **keywords)

A Phrygian scale (E-E white key)

>>> 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:

Read-only properties inherited from ProtoM21Object:

PhrygianScale read/write properties

Read/write properties inherited from ConcreteScale:

Read/write properties inherited from Music21Object:

PhrygianScale methods

Methods inherited from DiatonicScale:

Methods inherited from ConcreteScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

Methods inherited from ProtoM21Object:

PhrygianScale instance variables

Instance variables inherited from Music21Object:

RagAsawari

class music21.scale.RagAsawari(tonic=None, **keywords)

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=scale.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:

Read-only properties inherited from ProtoM21Object:

RagAsawari read/write properties

Read/write properties inherited from ConcreteScale:

Read/write properties inherited from Music21Object:

RagAsawari methods

Methods inherited from ConcreteScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

Methods inherited from ProtoM21Object:

RagAsawari instance variables

Instance variables inherited from Music21Object:

RagMarwa

class music21.scale.RagMarwa(tonic=None, **keywords)

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:

Read-only properties inherited from ProtoM21Object:

RagMarwa read/write properties

Read/write properties inherited from ConcreteScale:

Read/write properties inherited from Music21Object:

RagMarwa methods

Methods inherited from ConcreteScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

Methods inherited from ProtoM21Object:

RagMarwa instance variables

Instance variables inherited from Music21Object:

ScalaScale

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

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)', 'G#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', 'C#~4(-17c)', 'D~4(+17c)', 'F~4(-17c)',
 'F#~4(+17c)', 'G#4(-0c)', 'A~4(-17c)', 'C5(-0c)']

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

>>> sc = scale.ScalaScale('badFileName.scl')
Traceback (most recent call last):
music21.scale.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:

Read-only properties inherited from ProtoM21Object:

ScalaScale read/write properties

Read/write properties inherited from ConcreteScale:

Read/write properties inherited from Music21Object:

ScalaScale methods

Methods inherited from ConcreteScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

Methods inherited from ProtoM21Object:

ScalaScale instance variables

Instance variables inherited from Music21Object:

Scale

class music21.scale.Scale(**keywords)

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

>>> s = scale.Scale()
>>> s.type
'Scale'
>>> s.name  # default same as type.
'Scale'
>>> s.isConcrete
False

Not a useful class on its own. See its subclasses.

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. Thus, is always false.

Scale.name

Return or construct the name of this scale

Read-only properties inherited from Music21Object:

Read-only properties inherited from ProtoM21Object:

Scale read/write properties

Read/write properties inherited from Music21Object:

Scale methods

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

Utility function and staticmethod

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)

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

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

Note that octaveless notes like the ‘A’ get a default octave. In general, it is better to work with octave-possessing pitches.

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 scale.Scale.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. Oh, we will also show that extractPitchList works on any scale:

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

Methods inherited from Music21Object:

Methods inherited from ProtoM21Object:

Scale instance variables

Instance variables inherited from Music21Object:

SieveScale

class music21.scale.SieveScale(tonic=None, sieveString='2@0', eld: int | float = 1, **keywords)

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:

Read-only properties inherited from ProtoM21Object:

SieveScale read/write properties

Read/write properties inherited from ConcreteScale:

Read/write properties inherited from Music21Object:

SieveScale methods

Methods inherited from ConcreteScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

Methods inherited from ProtoM21Object:

SieveScale instance variables

Instance variables inherited from Music21Object:

WeightedHexatonicBlues

class music21.scale.WeightedHexatonicBlues(tonic=None, **keywords)

A concrete scale based on a dynamic mixture of a minor pentatonic and the hexatonic blues scale.

WeightedHexatonicBlues bases

WeightedHexatonicBlues read-only properties

Read-only properties inherited from ConcreteScale:

Read-only properties inherited from Music21Object:

Read-only properties inherited from ProtoM21Object:

WeightedHexatonicBlues read/write properties

Read/write properties inherited from ConcreteScale:

Read/write properties inherited from Music21Object:

WeightedHexatonicBlues methods

Methods inherited from ConcreteScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

Methods inherited from ProtoM21Object:

WeightedHexatonicBlues instance variables

Instance variables inherited from Music21Object:

WholeToneScale

class music21.scale.WholeToneScale(tonic=None, **keywords)

A concrete whole-tone scale.

>>> sc = scale.WholeToneScale('g2')
>>> [str(p) for p in sc.pitches]
['G2', 'A2', 'B2', 'C#3', 'D#3', 'E#3', 'G3']
>>> [str(p) for p in sc.getPitches('g2', 'g5')]
['G2', 'A2', 'B2', 'C#3', 'D#3', 'E#3', 'G3', 'A3', 'B3', 'C#4',
 'D#4', 'E#4', 'G4', 'A4', 'B4', 'C#5', 'D#5', 'E#5', 'G5']
>>> sc.abstract.getDegreeMaxUnique()
6
>>> sc.pitchFromDegree(1)
<music21.pitch.Pitch G2>
>>> sc.pitchFromDegree(2)
<music21.pitch.Pitch A2>
>>> sc.pitchFromDegree(6)
<music21.pitch.Pitch E#3>
>>> sc.getScaleDegreeFromPitch('g2', comparisonAttribute='pitchClass')
1
>>> sc.getScaleDegreeFromPitch('F6', comparisonAttribute='pitchClass')
6

WholeToneScale bases

WholeToneScale read-only properties

Read-only properties inherited from ConcreteScale:

Read-only properties inherited from Music21Object:

Read-only properties inherited from ProtoM21Object:

WholeToneScale read/write properties

Read/write properties inherited from ConcreteScale:

Read/write properties inherited from Music21Object:

WholeToneScale methods

Methods inherited from ConcreteScale:

Methods inherited from Scale:

Methods inherited from Music21Object:

Methods inherited from ProtoM21Object:

WholeToneScale instance variables

Instance variables inherited from Music21Object: