Pitch¶

abstract class
pitchtools.
Pitch
¶ Pitch base class.
Lineage¶
Bases¶
abjad.tools.abctools.AbjadValueObject
abjad.tools.abctools.AbjadObject
abjad.tools.abctools.AbjadObject.AbstractBase
builtins.object
Attribute summary¶
accidental 
Accidental of pitch. 
accidental_spelling 
Accidental spelling of Abjad session. 
alteration_in_semitones 
Alteration of pitch in semitones. 
apply_accidental ([accidental]) 
Applies accidental to pitch. 
diatonic_pitch_class_name 
Diatonic pitchclass name of pitch. 
diatonic_pitch_class_number 
Diatonic pitchclass number of pitch. 
diatonic_pitch_name 
Diatonic pitch name of pitch. 
diatonic_pitch_number 
Diatonic pitch number of pitch. 
from_hertz (class_, hertz) 
Creates pitch from hertz. 
hertz 
Gets hertz value of pitch. 
invert ([axis]) 
Inverts pitch about axis. 
is_diatonic_pitch_name (expr) 
Is true when expr is a diatonic pitch name. 
is_diatonic_pitch_number (expr) 
Is true when expr is a diatonic pitch number. 
is_pitch_carrier (expr) 
Is true when expr is an Abjad pitch, note, notehead of chord instance. 
is_pitch_class_octave_number_string (expr) 
Is true when expr is a pitchclass / octave number string. 
is_pitch_name (expr) 
True expr is a pitch name. 
is_pitch_number (expr) 
Is true when expr is a pitch number. 
multiply ([n]) 
Multiplies pitch by n. 
named_pitch 
Named pitch corresponding to pitch. 
named_pitch_class 
Named pitchclass corresponding to pitch. 
numbered_pitch 
Numbered pitch corresponding to pitch. 
numbered_pitch_class 
Numbered pitchclass corresponding to pitch. 
octave 
Octave of pitch. 
octave_number 
Octave number of pitch. 
pitch_class_name 
Pitchclass name corresponding to pitch. 
pitch_class_number 
Pitchclass number of pitch. 
pitch_class_octave_label 
Pitchclass / octave label of pitch. 
pitch_name 
Pitch name of pitch. 
pitch_number 
Pitch number of pitch. 
transpose (expr) 
Transposes pitch by expr. 
__copy__ (\*args) 
Copies Abjad value object. 
__eq__ (expr) 
Is true when all initialization values of Abjad value object equal the initialization values of expr. 
__float__ () 
Changes pitch to float. 
__format__ ([format_specification]) 
Formats pitch. 
__hash__ () 
Hashes Abjad value object. 
__illustrate__ () 
Illustrates pitch. 
__int__ () 
Changes pitch to integer. 
__ne__ (expr) 
Is true when Abjad object does not equal expr. 
__repr__ () 
Gets interpreter representation of Abjad object. 
Readonly properties¶

abstract
Pitch.
accidental
¶ Accidental of pitch.

Pitch.
accidental_spelling
¶ Accidental spelling of Abjad session.
>>> NamedPitch("c").accidental_spelling 'mixed'
Returns string.

abstract
Pitch.
alteration_in_semitones
¶ Alteration of pitch in semitones.

abstract
Pitch.
diatonic_pitch_class_name
¶ Diatonic pitchclass name of pitch.

abstract
Pitch.
diatonic_pitch_class_number
¶ Diatonic pitchclass number of pitch.

abstract
Pitch.
diatonic_pitch_name
¶ Diatonic pitch name of pitch.

abstract
Pitch.
diatonic_pitch_number
¶ Diatonic pitch number of pitch.

Pitch.
hertz
¶ Gets hertz value of pitch.
>>> pitchtools.NamedPitch("a'").hertz 440.0
>>> pitchtools.NamedPitch("c'").hertz 261.62...
>>> pitchtools.NamedPitch("c''").hertz 523.25...
Returns float.

abstract
Pitch.
named_pitch
¶ Named pitch corresponding to pitch.

abstract
Pitch.
named_pitch_class
¶ Named pitchclass corresponding to pitch.

abstract
Pitch.
numbered_pitch
¶ Numbered pitch corresponding to pitch.

abstract
Pitch.
numbered_pitch_class
¶ Numbered pitchclass corresponding to pitch.

abstract
Pitch.
octave
¶ Octave of pitch.
Returns octave.

abstract
Pitch.
octave_number
¶ Octave number of pitch.
Returns integer.

abstract
Pitch.
pitch_class_name
¶ Pitchclass name corresponding to pitch.
Returns string.

abstract
Pitch.
pitch_class_number
¶ Pitchclass number of pitch.
Returns number

abstract
Pitch.
pitch_class_octave_label
¶ Pitchclass / octave label of pitch.

abstract
Pitch.
pitch_name
¶ Pitch name of pitch.
Returns string.

abstract
Pitch.
pitch_number
¶ Pitch number of pitch.
Returns number.
Methods¶

abstract
Pitch.
apply_accidental
(accidental=None)¶ Applies accidental to pitch.
Returns new pitch.

abstract
Pitch.
invert
(axis=None)¶ Inverts pitch about axis.
Interprets axis of none equal to middle C.
Returns new pitch.

abstract
Pitch.
multiply
(n=1)¶ Multiplies pitch by n.

abstract
Pitch.
transpose
(expr)¶ Transposes pitch by expr.
Returns new pitch.
Class & static methods¶

classmethod
Pitch.
from_hertz
(class_, hertz)¶ Creates pitch from hertz.
>>> pitchtools.NamedPitch.from_hertz(440) NamedPitch("a'")
>>> pitchtools.NumberedPitch.from_hertz(440) NumberedPitch(9)
>>> pitchtools.NamedPitch.from_hertz(519) NamedPitch("c'")
Returns new pitch.

static
Pitch.
is_diatonic_pitch_name
(expr)¶ Is true when expr is a diatonic pitch name. Otherwise false.
>>> pitchtools.Pitch.is_diatonic_pitch_name("c''") True
The regex
(^[ag,AG])(,+'+)$
underlies this predicate.Returns true or false.

static
Pitch.
is_diatonic_pitch_number
(expr)¶ Is true when expr is a diatonic pitch number. Otherwise false.
>>> pitchtools.Pitch.is_diatonic_pitch_number(7) True
The diatonic pitch numbers are equal to the set of integers.
Returns true or false.

static
Pitch.
is_pitch_carrier
(expr)¶ Is true when expr is an Abjad pitch, note, notehead of chord instance. Otherwise false.
>>> note = Note("c'4") >>> pitchtools.Pitch.is_pitch_carrier(note) True
Returns true or false.

static
Pitch.
is_pitch_class_octave_number_string
(expr)¶ Is true when expr is a pitchclass / octave number string. Otherwise false:
>>> pitchtools.Pitch.is_pitch_class_octave_number_string('C#2') True
Quartertone accidentals are supported.
The regex
^([AG])([#]{1,2}[b]{1,2}[#]?[+][b]?[~])([]?[09]+)$
underlies this predicate.Returns true or false.

static
Pitch.
is_pitch_name
(expr)¶ True expr is a pitch name. Otherwise false.
>>> pitchtools.Pitch.is_pitch_name('c,') True
The regex
^([ag,AG])(([s]{1,2}[f]{1,2}t?q?[f,s])!?)(,+'+)$
underlies this predicate.Returns true or false.

static
Pitch.
is_pitch_number
(expr)¶ Is true when expr is a pitch number. Otherwise false.
>>> pitchtools.Pitch.is_pitch_number(13) True
The pitch numbers are equal to the set of all integers in union with the set of all integers plus of minus
0.5
.Returns true or false.
Special methods¶

(
AbjadValueObject
).__copy__
(*args)¶ Copies Abjad value object.
Returns new Abjad value object.

(
AbjadValueObject
).__eq__
(expr)¶ Is true when all initialization values of Abjad value object equal the initialization values of expr.
Returns true or false.

abstract
Pitch.
__float__
()¶ Changes pitch to float.
Returns float.

Pitch.
__format__
(format_specification='')¶ Formats pitch.
Set format_specification to ‘’, ‘lilypond’ or ‘storage’.
Returns string.

(
AbjadValueObject
).__hash__
()¶ Hashes Abjad value object.
Returns integer.

Pitch.
__illustrate__
()¶ Illustrates pitch.
Returns LilyPond file.

abstract
Pitch.
__int__
()¶ Changes pitch to integer.
Returns integer.

(
AbjadObject
).__ne__
(expr)¶ Is true when Abjad object does not equal expr. Otherwise false.
Returns true or false.

(
AbjadObject
).__repr__
()¶ Gets interpreter representation of Abjad object.
Returns string.