NamedIntervalClass

class pitchtools.NamedIntervalClass(*arguments)

Named interval-class.

Initializes descending major second from string:

>>> NamedIntervalClass('-M9')
NamedIntervalClass('-M2')

Initializes descending major second from quality string and number of semitones:

>>> NamedIntervalClass(('major', -9))
NamedIntervalClass('-M2')

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.IntervalClass.IntervalClass" [color=3, group=2, label=IntervalClass, shape=oval, style=bold]; "abjad.tools.pitchtools.NamedIntervalClass.NamedIntervalClass" [color=black, fontcolor=white, group=2, label=<<B>NamedIntervalClass</B>>, shape=box, style="filled, rounded"]; "abjad.tools.pitchtools.NamedInversionEquivalentIntervalClass.NamedInversionEquivalentIntervalClass" [color=3, group=2, label=NamedInversionEquivalentIntervalClass, shape=box]; "abjad.tools.pitchtools.IntervalClass.IntervalClass" -> "abjad.tools.pitchtools.NamedIntervalClass.NamedIntervalClass"; "abjad.tools.pitchtools.NamedIntervalClass.NamedIntervalClass" -> "abjad.tools.pitchtools.NamedInversionEquivalentIntervalClass.NamedInversionEquivalentIntervalClass"; } subgraph cluster_builtins { graph [label=builtins]; "builtins.object" [color=2, group=1, label=object, shape=box]; } "abjad.tools.abctools.AbjadValueObject.AbjadValueObject" -> "abjad.tools.pitchtools.IntervalClass.IntervalClass"; "builtins.object" -> "abjad.tools.abctools.AbjadObject.AbstractBase"; }

Bases

Attribute summary

direction_number Direction number of named interval-class.
direction_string Direction word of named interval-class.
direction_symbol Direction symbol of named interval-class.
from_pitch_carriers(class_, pitch_carrier_1, ...) Makes named interval-class from pitch_carrier_1 and pitch_carrier_2.
number Number of interval-class.
quality_string Quality string of named interval-class.
__abs__() Absolute value of named interval-class.
__copy__(*arguments) Copies Abjad value object.
__eq__(argument) Is true when argument is a named interval-class with direction number, quality string and number equal to those of this named interval-class.
__float__() Changes named interval-class to float.
__format__([format_specification]) Formats Abjad object.
__hash__() Hashes named interval-class.
__int__() Changes named interval-class to integer.
__lt__(argument) Is true when argument is a named interval class with a number greater than that of this named interval.
__ne__(argument) Is true when named interval-class does not equal argument.
__repr__() Gets interpreter representation of Abjad object.
__str__() String representation of named interval-class.

Read-only properties

NamedIntervalClass.direction_number

Direction number of named interval-class.

Returns -1, 0 or 1.

NamedIntervalClass.direction_string

Direction word of named interval-class.

Returns string.

NamedIntervalClass.direction_symbol

Direction symbol of named interval-class.

Returns string.

(IntervalClass).number

Number of interval-class.

Returns number.

NamedIntervalClass.quality_string

Quality string of named interval-class.

Returns string.

Class & static methods

classmethod NamedIntervalClass.from_pitch_carriers(class_, pitch_carrier_1, pitch_carrier_2)

Makes named interval-class from pitch_carrier_1 and pitch_carrier_2.

>>> NamedIntervalClass.from_pitch_carriers(
...     NamedPitch(-2),
...     NamedPitch(12),
...     )
NamedIntervalClass('+M2')

Returns named interval-class.

Special methods

NamedIntervalClass.__abs__()

Absolute value of named interval-class.

Returns new named interval-class.

(AbjadValueObject).__copy__(*arguments)

Copies Abjad value object.

Returns new Abjad value object.

NamedIntervalClass.__eq__(argument)

Is true when argument is a named interval-class with direction number, quality string and number equal to those of this named interval-class. Otherwise false.

Returns true or false.

NamedIntervalClass.__float__()

Changes named interval-class to float.

Returns float.

(AbjadObject).__format__(format_specification='')

Formats Abjad object.

Set format_specification to ‘’ or ‘storage’. Interprets ‘’ equal to ‘storage’.

Returns string.

NamedIntervalClass.__hash__()

Hashes named interval-class.

Returns integer.

NamedIntervalClass.__int__()

Changes named interval-class to integer.

Returns integer.

NamedIntervalClass.__lt__(argument)

Is true when argument is a named interval class with a number greater than that of this named interval.

NamedIntervalClass.__ne__(argument)

Is true when named interval-class does not equal argument. Otherwise false.

Returns true or false.

(AbjadObject).__repr__()

Gets interpreter representation of Abjad object.

Returns string.

NamedIntervalClass.__str__()

String representation of named interval-class.

Returns string.