Mode

digraph InheritanceGraph { graph [bgcolor=transparent, color=lightsteelblue2, fontname=Arial, fontsize=10, outputorder=edgesfirst, overlap=prism, penwidth=2, rankdir=LR, splines=spline, style="dashed, rounded", truecolor=true]; node [colorscheme=pastel19, fontname=Arial, fontsize=10, height=0, penwidth=2, shape=box, style="filled, rounded", width=0]; edge [color=lightslategrey, penwidth=1]; subgraph "cluster_abjad.indicators" { graph [label="abjad.indicators"]; node [color=1]; "abjad.indicators.Mode.Mode" [URL="../api/abjad/indicators/Mode.html#abjad.indicators.Mode.Mode", color=black, fontcolor=white, label=Mode, target=_top]; } subgraph "cluster_abjad.system" { graph [label="abjad.system"]; node [color=2]; "abjad.system.AbjadObject.AbjadObject" [URL="../api/abjad/indicators/../system/AbjadObject.html#abjad.system.AbjadObject.AbjadObject", label="Abjad\nObject", target=_top]; "abjad.system.AbjadValueObject.AbjadValueObject" [URL="../api/abjad/indicators/../system/AbjadValueObject.html#abjad.system.AbjadValueObject.AbjadValueObject", label="Abjad\nValue\nObject", target=_top]; "abjad.system.AbjadObject.AbjadObject" -> "abjad.system.AbjadValueObject.AbjadValueObject"; } subgraph cluster_builtins { graph [label=builtins]; node [color=3]; "builtins.object" [URL="https://docs.python.org/3.6/library/functions.html#object", label=object, target=_top]; } "abjad.system.AbjadValueObject.AbjadValueObject" -> "abjad.indicators.Mode.Mode"; "builtins.object" -> "abjad.system.AbjadObject.AbjadObject"; }

class abjad.indicators.Mode.Mode(mode_name='dorian')

Mode.

Initializes from string:

>>> abjad.Mode('major')
Mode('major')

Initializes from other mode:

>>> mode = abjad.Mode('dorian')
>>> abjad.Mode(mode)
Mode('dorian')

Attributes Summary

__eq__ Is true when argument is a mode with mode name equal to that of this mode.
__hash__ Hashes mode.
__len__ Length of mode.
__str__ String representation of mode.
mode_name Gets mode name.
named_interval_segment Gets named interval segment.

Special methods

(AbjadValueObject).__copy__(*arguments)

Copies Abjad value object.

Returns new Abjad value object.

__eq__(argument)

Is true when argument is a mode with mode name equal to that of this mode.

>>> mode_1 = abjad.Mode('major')
>>> mode_2 = abjad.Mode('major')
>>> mode_3 = abjad.Mode('dorian')
>>> mode_1 == mode_1
True
>>> mode_1 == mode_2
True
>>> mode_1 == mode_3
False
>>> mode_2 == mode_1
True
>>> mode_2 == mode_2
True
>>> mode_2 == mode_3
False
>>> mode_3 == mode_1
False
>>> mode_3 == mode_2
False
>>> mode_3 == mode_3
True

Returns true or false.

(AbjadObject).__format__(format_specification='')

Formats Abjad object.

Set format_specification to '' or 'storage'. Interprets '' equal to 'storage'.

Returns string.

__hash__()

Hashes mode.

Required to be explicitly redefined on Python 3 if __eq__ changes.

Returns integer.

__len__()

Length of mode.

>>> len(abjad.Mode('dorian'))
7

Returns nonnegative integer.

(AbjadObject).__repr__()

Gets interpreter representation of Abjad object.

Returns string.

__str__()

String representation of mode.

>>> str(abjad.Mode('dorian'))
'dorian'

Returns string.


Read-only properties

mode_name

Gets mode name.

>>> abjad.Mode('major').mode_name
'major'
>>> abjad.Mode('dorian').mode_name
'dorian'

Returns string.

named_interval_segment

Gets named interval segment.

>>> mode = abjad.Mode('major')
>>> str(mode.named_interval_segment)
'<+M2, +M2, +m2, +M2, +M2, +M2, +m2>'
>>> mode = abjad.Mode('dorian')
>>> str(mode.named_interval_segment)
'<+M2, +m2, +M2, +M2, +M2, +m2, +M2>'

Returns named interval segment.