pctheory.group

class OperatorGroup

Represents a group of operators. Only compatible with mod 12 and mod 24 systems.

property name

Represents the name of the group, as a str

property utos

Gets the set of unordered tone operators (UTOs, traditionally “twelve-tone operators” for mod-12) in the group.

__init__(self, utos: list = None, mod: int = 12)

Creates an OperatorGroup

Parameters:
  • utos (list) – A list of operators (traditionally, TTOs) that define the group.

  • mod (int) – The number of pitch classes in the system of the group (chromatic: 12, microtonal: 24)

__contains__(self, uto: transformations.UTO)

Overloaded in to check the presence of a given operator in the group.

Parameters:

uto (UTO) – An operator

Returns:

True or False

Return type:

bool

__iter__(self)

Returns an iterator for the group.

Returns:

An iterator

__list__(self)

Converts the group to a list

Returns:

A list of the operators in the group

Return type:

list

__str__(self)

Returns a string representation of the group names

Returns:

The group name

Return type:

str

__repr__(self)

Returns a string representation of the group names

Returns:

The group name

Return type:

str

get_orbits(self)

Gets the orbits of the group

Returns:

The orbits, as a list of sets

Return type:

list

left_coset(self, uto)

Gets a left coset of the group

Parameters:

uto (UTO) – A UTO

Returns:

The left coset

Return type:

list

load_utos(self, utos: list)

Loads UTOs into the group :param list utos: UTOs

right_coset(self, uto)

Gets a right coset of the group

Parameters:

uto (UTO) – A UTO

Returns:

The right coset

Return type:

list