PitchClass

abstract class pitchtools.PitchClass

Abstract pitch-class.

>>> import abjad

Lineage

digraph InheritanceGraph { graph [background=transparent, bgcolor=transparent, color=lightslategrey, fontname=Arial, outputorder=edgesfirst, overlap=prism, penwidth=2, rankdir=LR, root="__builtin__.object", splines=spline, style="dotted, rounded", truecolor=true]; node [colorscheme=pastel19, fontname=Arial, fontsize=12, penwidth=2, style="filled, rounded"]; edge [color=lightsteelblue2, penwidth=2]; subgraph cluster_abctools { graph [label=abctools]; "abjad.tools.abctools.AbjadObject.AbjadObject" [color=1, group=0, label=AbjadObject, shape=box]; "abjad.tools.abctools.AbjadObject.AbstractBase" [color=1, group=0, label=AbstractBase, shape=box]; "abjad.tools.abctools.AbjadValueObject.AbjadValueObject" [color=1, group=0, label=AbjadValueObject, shape=box]; "abjad.tools.abctools.AbjadObject.AbjadObject" -> "abjad.tools.abctools.AbjadValueObject.AbjadValueObject"; "abjad.tools.abctools.AbjadObject.AbstractBase" -> "abjad.tools.abctools.AbjadObject.AbjadObject"; } subgraph cluster_pitchtools { graph [label=pitchtools]; "abjad.tools.pitchtools.NamedPitchClass.NamedPitchClass" [color=3, group=2, label=NamedPitchClass, shape=box]; "abjad.tools.pitchtools.NumberedPitchClass.NumberedPitchClass" [color=3, group=2, label=NumberedPitchClass, shape=box]; "abjad.tools.pitchtools.PitchClass.PitchClass" [color=black, fontcolor=white, group=2, label=<<B>PitchClass</B>>, shape=oval, style="filled, rounded"]; "abjad.tools.pitchtools.PitchClass.PitchClass" -> "abjad.tools.pitchtools.NamedPitchClass.NamedPitchClass"; "abjad.tools.pitchtools.PitchClass.PitchClass" -> "abjad.tools.pitchtools.NumberedPitchClass.NumberedPitchClass"; } subgraph cluster_builtins { graph [label=builtins]; "builtins.object" [color=2, group=1, label=object, shape=box]; } "abjad.tools.abctools.AbjadValueObject.AbjadValueObject" -> "abjad.tools.pitchtools.PitchClass.PitchClass"; "builtins.object" -> "abjad.tools.abctools.AbjadObject.AbstractBase"; }

Bases

Attribute summary

accidental Gets accidental of pitch-class.
invert([axis]) Inverts pitch-class about axis.
is_diatonic_pitch_class_name(argument) Is true when argument is a diatonic pitch-class name.
is_diatonic_pitch_class_number(argument) Is true when argument is a diatonic pitch-class number.
is_pitch_class_name(argument) Is true when argument is a pitch-class name.
is_pitch_class_number(argument) Is true when argument is a pitch-class number.
multiply([n]) Multiplies pitch-class by n.
pitch_class_label Gets pitch-class label of pitch-class.
transpose([n]) Transposes pitch-class by index n.
__copy__(*arguments) Copies Abjad value object.
__eq__(argument) Is true when all initialization values of Abjad value object equal the initialization values of argument.
__float__() Coerce to float.
__format__([format_specification]) Formats pitch-class.
__ge__(other[, NotImplemented]) Return a >= b.
__gt__(other[, NotImplemented]) Return a > b.
__hash__() Hashes Abjad value object.
__le__(other[, NotImplemented]) Return a <= b.
__lt__(argument) Is true when pitch-class is less than argument.
__ne__(argument) Is true when Abjad object does not equal argument.
__repr__() Gets interpreter representation of Abjad object.

Read-only properties

abstract PitchClass.accidental

Gets accidental of pitch-class.

abstract PitchClass.pitch_class_label

Gets pitch-class label of pitch-class.

Methods

abstract PitchClass.invert(axis=None)

Inverts pitch-class about axis.

Returns new pitch-class.

abstract PitchClass.multiply(n=1)

Multiplies pitch-class by n.

Returns new pitch-class.

abstract PitchClass.transpose(n=0)

Transposes pitch-class by index n.

Returns new pitch-class.

Class & static methods

static PitchClass.is_diatonic_pitch_class_name(argument)

Is true when argument is a diatonic pitch-class name. Otherwise false.

>>> abjad.PitchClass.is_diatonic_pitch_class_name('g')
True
>>> abjad.PitchClass.is_diatonic_pitch_class_name('G')
True
>>> abjad.PitchClass.is_diatonic_pitch_class_name('Allegro')
False

The regex ^[a-g,A-G]$ underlies this predicate.

Returns true or false.

static PitchClass.is_diatonic_pitch_class_number(argument)

Is true when argument is a diatonic pitch-class number. Otherwise false.

>>> abjad.PitchClass.is_diatonic_pitch_class_number(0)
True
>>> abjad.PitchClass.is_diatonic_pitch_class_number(-5)
False

The diatonic pitch-class numbers are equal to the set [0, 1, 2, 3, 4, 5, 6].

Returns true or false.

static PitchClass.is_pitch_class_name(argument)

Is true when argument is a pitch-class name. Otherwise false.

>>> abjad.PitchClass.is_pitch_class_name('fs')
True
>>> abjad.PitchClass.is_pitch_class_name('fqs')
True
>>> abjad.PitchClass.is_pitch_class_name('f,,')
False

The regex ^([a-g,A-G])(([s]{1,2}|[f]{1,2}|t?q?[fs]|)!?)$ underlies this predicate.

Returns true or false.

static PitchClass.is_pitch_class_number(argument)

Is true when argument is a pitch-class number. Otherwise false.

>>> abjad.PitchClass.is_pitch_class_number(1)
True
>>> abjad.PitchClass.is_pitch_class_number(1.5)
True
>>> abjad.PitchClass.is_pitch_class_number(12)
False

The pitch-class numbers are equal to the set [0, 0.5, ..., 11, 11.5].

Returns true or false.

Special methods

(AbjadValueObject).__copy__(*arguments)

Copies Abjad value object.

Returns new Abjad value object.

(AbjadValueObject).__eq__(argument)

Is true when all initialization values of Abjad value object equal the initialization values of argument.

Returns true or false.

PitchClass.__float__()

Coerce to float.

Returns float.

PitchClass.__format__(format_specification='')

Formats pitch-class.

Set format_specification to ‘’, ‘lilypond’ or ‘storage’.

Returns string.

PitchClass.__ge__(other, NotImplemented=NotImplemented)

Return a >= b. Computed by @total_ordering from (not a < b).

PitchClass.__gt__(other, NotImplemented=NotImplemented)

Return a > b. Computed by @total_ordering from (not a < b) and (a != b).

(AbjadValueObject).__hash__()

Hashes Abjad value object.

Returns integer.

PitchClass.__le__(other, NotImplemented=NotImplemented)

Return a <= b. Computed by @total_ordering from (a < b) or (a == b).

abstract PitchClass.__lt__(argument)

Is true when pitch-class is less than argument.

Returns true or false.

(AbjadObject).__ne__(argument)

Is true when Abjad object does not equal argument. Otherwise false.

Returns true or false.

(AbjadObject).__repr__()

Gets interpreter representation of Abjad object.

Returns string.