# CompoundOperator¶

class `abjad.pitch.CompoundOperator.``CompoundOperator`(operators=None, *, show_identity_operators=None)

Compound operator.

Rotation followed by transposition:

```>>> operator = abjad.CompoundOperator()
>>> operator = operator.rotate(n=1, stravinsky=True)
>>> operator = operator.transpose(n=2)
```
```>>> str(operator)
'T2rs1'
```
```>>> pitch_classes = abjad.PitchClassSegment([0, 1, 4, 7])
>>> operator(pitch_classes)
PitchClassSegment([2, 7, 8, 11])
```

Attributes Summary

 `__add__` Composes compound operator and operator. `__call__` Calls compound operator on argument. `__radd__` Composes operator and compound operator. `__str__` Gets string representation of compound operator. `duplicate` Configures compound operator to duplicate pitches by counts, with optional indices and period. `invert` Configures compound operator to invert pitches about axis. `multiply` Configures compound operator to multiply pitch-classes by index n. `operators` Gets operators. `retrograde` Configures compound operator to retrograde pitches. `rotate` Configures compound operator to rotate pitches by index n. `show_identity_operators` Is true when string representation of operator should show identity operators. `transpose` Configures compound operator to transpose pitches by index n.

Special methods

`__add__`(operator)

Composes compound operator and operator.

```>>> operator = abjad.CompoundOperator()
>>> operator = operator.transpose(n=1)
>>> operator = operator.multiply(n=5)
>>> str(operator)
'M5T1'
```
```>>> inversion = abjad.Inversion()
>>> transposition = abjad.Transposition(n=1)
```
```>>> operator_1 = inversion + retrograde
>>> str(operator_1)
'IR'
```
```>>> operator_2 = inversion + transposition
>>> str(operator_2)
'IT1'
```
```>>> operator_3 = operator_1 + operator_2
>>> str(operator_3)
'IRIT1'
```
```>>> abjad.f(operator_3)
operators=[
n=1,
),
],
)
```

Returns new compound operator.

`__call__`(argument)

Calls compound operator on argument.

```>>> operator = abjad.CompoundOperator()
>>> operator = operator.rotate(n=1, stravinsky=True)
>>> operator = operator.transpose(n=2)
>>> str(operator)
'T2rs1'
```
```>>> segment = abjad.PitchClassSegment([0, 1, 4, 7])
``` ```>>> transform = operator(segment)
``` ```>>> transform
PitchClassSegment([2, 7, 8, 11])
```

Returns new object with type equal to that of argument.

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

`(AbjadObject).``__format__`(format_specification='')

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

Returns string.

`(AbjadValueObject).``__hash__`()

Hashes Abjad value object.

Returns integer.

`__radd__`(operator)

Composes operator and compound operator.

Returns new compound operator.

`(AbjadObject).``__repr__`()

Gets interpreter representation of Abjad object.

Returns string.

`__str__`()

Gets string representation of compound operator.

Gets string:

```>>> operator = abjad.CompoundOperator()
>>> operator = operator.rotate(n=1)
>>> operator = operator.transpose(n=2)
```
```>>> str(operator)
'T2r1'
```

Gets string of empty operator:

```>>> operator = abjad.CompoundOperator()
```
```>>> str(operator)
''
```

Returns string.

Methods

`duplicate`(counts=None, indices=None, period=None)

Configures compound operator to duplicate pitches by counts, with optional indices and period.

```>>> operator = abjad.CompoundOperator()
>>> operator = operator.duplicate(counts=1)
operators=[
counts=1,
),
],
)
```

Returns new compound operator.

`invert`(axis=None)

Configures compound operator to invert pitches about axis.

```>>> operator = abjad.CompoundOperator()
>>> operator = operator.invert(axis=2)
operators=[
),
],
)
```

Returns new compound operator.

`multiply`(n=1)

Configures compound operator to multiply pitch-classes by index n.

```>>> operator = abjad.CompoundOperator()
>>> operator = operator.multiply(n=3)
operators=[
n=3,
),
],
)
```

Returns new compound operator.

`retrograde`(period=None)

Configures compound operator to retrograde pitches.

```>>> operator = abjad.CompoundOperator()
>>> operator = operator.retrograde()
operators=[
],
)
```

Returns new compound operator.

`rotate`(n=0, period=None, stravinsky=None)

Configures compound operator to rotate pitches by index n.

```>>> operator = abjad.CompoundOperator()
>>> operator = operator.rotate(n=-1)
operators=[
n=-1,
),
],
)
```

Returns new compound operator.

`transpose`(n=0)

Configures compound operator to transpose pitches by index n.

```>>> operator = abjad.CompoundOperator()
>>> operator = operator.transpose(n=1)
```
```>>> abjad.f(operator)
operators=[
n=1,
),
],
)
```

Returns new compound operator.

`operators`

Gets operators.

Gets operators:

```>>> operator = abjad.CompoundOperator()
>>> operator = operator.rotate(n=1)
>>> operator = operator.transpose(n=2)
```
```>>> for operator_ in operator.operators:
...     operator_
...
Rotation(n=1)
Transposition(n=2)
```

Returns list of operators.

`show_identity_operators`

Is true when string representation of operator should show identity operators.

Does not show identity operators:

```>>> operator = abjad.CompoundOperator()
>>> operator = operator.transpose(n=0)
>>> operator = operator.multiply(n=5)
```
```>>> str(operator)
'M5'
```

Shows identity operators:

```>>> operator = abjad.CompoundOperator(
...     show_identity_operators=True,
...     )
>>> operator = operator.transpose(n=0)
>>> operator = operator.multiply(n=5)
```
```>>> str(operator)
'M5T0'
```

Defaults to none.

Set to true, false or none.

Returns true, false or none.