PitchClass

abstract class pitchtools.PitchClass

Pitch-class base class.

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 Accidental of pitch-class.
alteration_in_semitones Alteration of pitch-class in semitones.
apply_accidental([accidental]) Applies accidental to pitch-class.
diatonic_pitch_class_name Diatonic pitch-class name corresponding to pitch-class.
diatonic_pitch_class_number Diatonic pitch-class number corresponding to 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) True argument is a pitch-class number.
multiply([n]) Multiplies pitch-class by n.
named_pitch_class Named pitch-class corresponding to pitch-class.
numbered_pitch_class Numbered pitch-class corresponding to pitch-class.
pitch_class_label Pitch-class label of pitch-class.
pitch_class_name Pitch-class name of pitch-class.
pitch_class_number Pitch-class number 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.
__format__([format_specification]) Formats pitch-class.
__hash__() Hashes Abjad value object.
__ne__(argument) Is true when Abjad object does not equal argument.
__repr__() Gets interpreter representation of Abjad object.

Read-only properties

abstract PitchClass.accidental

Accidental of pitch-class.

abstract PitchClass.alteration_in_semitones

Alteration of pitch-class in semitones.

abstract PitchClass.diatonic_pitch_class_name

Diatonic pitch-class name corresponding to pitch-class.

abstract PitchClass.diatonic_pitch_class_number

Diatonic pitch-class number corresponding to pitch-class.

abstract PitchClass.named_pitch_class

Named pitch-class corresponding to pitch-class.

abstract PitchClass.numbered_pitch_class

Numbered pitch-class corresponding to pitch-class.

abstract PitchClass.pitch_class_label

Pitch-class label of pitch-class.

abstract PitchClass.pitch_class_name

Pitch-class name of pitch-class.

abstract PitchClass.pitch_class_number

Pitch-class number of pitch-class.

Methods

abstract PitchClass.apply_accidental(accidental=None)

Applies accidental to pitch-class.

Returns new pitch-class.

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.

>>> pitchtools.PitchClass.is_diatonic_pitch_class_name('c')
True

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.

>>> pitchtools.PitchClass.is_diatonic_pitch_class_number(0)
True
>>> pitchtools.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.

>>> pitchtools.PitchClass.is_pitch_class_name('fs')
True

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)

True argument is a pitch-class number. Otherwise false.

>>> pitchtools.PitchClass.is_pitch_class_number(1)
True

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.__format__(format_specification='')

Formats pitch-class.

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

Returns string.

(AbjadValueObject).__hash__()

Hashes Abjad value object.

Returns integer.

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