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.

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.

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.

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

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

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

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.

# TODO: make a subclass of IntervalNetwork and remove the ._net aspect.

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.

(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).

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: