pctheory.pcarray

class RotationalArray

Represents a rotational array

property array

Gets the rotational array

property pcseg

Gets the pcseg

__init__(self, pcseg=None)

Creates a rotational array

Parameters:

pcseg – A pcseg to import

__repr__(self)

Gets a string representation of the RotationalArray

Returns:

The representation

Return type:

str

__str__(self)

Gets the RotationalArray as a string

Returns:

The array

Return type:

str

__getitem__(self, i: int, j: int)

Gets the pc at the specified row and column

Parameters:
  • i (int) – The row

  • j (int) – The column

Returns:

The pc

Return type:

PitchClass

get_column(self, j: int)

Gets a column of the rotational array

Parameters:

j (int) – The column index

Returns:

The column

Return type:

list

get_row(self, i: int)

Gets a row of the rotational array

Parameters:

i (int) – The row index

Returns:

The row

Return type:

list

import_pcseg(self, pcseg: list)

Imports a pcseg

Parameters:

pcseg (list) – A pcseg

str_simple_array(array, col_delimiter=' ', row_delimiter='\n')

Converts an array of pcs to string

Parameters:
  • array – The array to convert

  • col_delimiter – The column delimiter

  • row_delimiter – The row delimiter

Returns:

The string

Return type:

str

make_array_chain(array, length: int)

Makes a chain of arrays

Parameters:
  • array – An array

  • length – The length

  • alt_ret – Whether or not to alternately retrograde the arrays.

Returns:

A chained array

Return type:

list