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.pitch" { graph [label="abjad.pitch"]; node [color=1]; "abjad.pitch.Inversion.Inversion" [URL="../api/abjad/pitch/Inversion.html#abjad.pitch.Inversion.Inversion", color=black, fontcolor=white, label=Inversion, target=_top]; } subgraph "cluster_abjad.system" { graph [label="abjad.system"]; node [color=2]; "abjad.system.AbjadObject.AbjadObject" [URL="../api/abjad/pitch/../system/AbjadObject.html#abjad.system.AbjadObject.AbjadObject", label="Abjad\nObject", target=_top]; "abjad.system.AbjadValueObject.AbjadValueObject" [URL="../api/abjad/pitch/../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="", label=object, target=_top]; } "abjad.system.AbjadValueObject.AbjadValueObject" -> "abjad.pitch.Inversion.Inversion"; "builtins.object" -> "abjad.system.AbjadObject.AbjadObject"; }

class abjad.pitch.Inversion.Inversion(*, axis=None)

Inversion operator.

>>> abjad.Inversion()
>>> abjad.Inversion(axis=15)

Object model of twelve-tone inversion operator.

Attributes Summary

__add__ Composes inversion and operator.
__call__ Calls inversion on argument.
__radd__ Right-addition not defined on inversion.
__str__ Gets string representation of operator.
axis Gets axis of inversion.

Special methods


Composes inversion and operator.

Example segment:

>>> items = [0, 2, 4, 5]
>>> segment = abjad.PitchClassSegment(items=items)

Example operators:

>>> inversion = abjad.Inversion()
>>> transposition = abjad.Transposition(n=3)

Transposition followed by inversion:

>>> operator = inversion + transposition
>>> str(operator)
>>> segment_ = operator(segment)

Inversion followed by transposition:

>>> operator = transposition + inversion
>>> str(operator)
>>> segment_ = operator(segment)

Returns compound operator:

>>> abjad.f(operator)

Calls inversion on argument.

Inverts numbered pitch-class:

>>> inversion = abjad.Inversion()
>>> pitch_class = abjad.NumberedPitchClass(1)
>>> inversion(pitch_class)

Inverts numbered pitch:

>>> inversion = abjad.Inversion()
>>> pitch = abjad.NumberedPitch(15)
>>> inversion(pitch)

Inverts named pitch:

>>> inversion = abjad.Inversion()
>>> pitch = abjad.NamedPitch("d'")
>>> inversion(pitch)

Inverts named pitch class:

>>> inversion = abjad.Inversion()
>>> pitch_class = abjad.NamedPitchClass('d')
>>> inversion(pitch_class)

Inverts pitch segment:

>>> inversion = abjad.Inversion()
>>> segment = abjad.PitchSegment("c' d' e'")
>>> inversion(segment)
PitchSegment("c' bf af")

Inverts pitch class segment:

>>> inversion = abjad.Inversion()
>>> segment = abjad.PitchClassSegment("c d e")
>>> inversion(segment)
PitchClassSegment("c bf af")

Inverts pitch class set:

>>> inversion = abjad.Inversion()
>>> setting = abjad.PitchClassSet("c d e")
>>> inversion(setting)
PitchClassSet(['c', 'af', 'bf'])

Returns new object with type equal to that of argument.


Copies Abjad value object.

Returns new Abjad value object.


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

Returns true or false.


Formats Abjad object.

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

Returns string.


Hashes Abjad value object.

Returns integer.


Right-addition not defined on inversion.

>>> abjad.Inversion().__radd__(abjad.Inversion())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/josiah/Source/", line 215, in __radd__
    raise NotImplementedError(message)
NotImplementedError: right-addition not defined on Inversion.

Raises not implemented error.


Gets interpreter representation of Abjad object.

Returns string.


Gets string representation of operator.

>>> str(abjad.Inversion())
>>> str(abjad.Inversion(axis=15))

Read-only properties


Gets axis of inversion.

>>> inversion = abjad.Inversion()
>>> inversion.axis is None
>>> inversion = abjad.Inversion(axis=15)
>>> inversion.axis

Returns named pitch or none.