Core module Index

class sator.core.PCBase[source]

Base class for Tone rows and PC sets

m(sub_n=0)[source]

Perform M on the object in place. If an argument is provided, also transpose the object in place by that amount.

mi(sub_n=0)[source]

Perform M and I on the object in place. If an argument is provided, also transpose the object in play by that amount.

t_m(sub_n, sub_m)[source]

Perform TnMm on the object in place, where n and m are positional arguments. If n is not provided, it defaults to 0. If m is not provided it defaults to the default_m of the object.

class sator.core.PCSet(*args, **kwargs)[source]

A Class for pitch class sets which adds pitch class only methods

c()[source]

Change the given object in place to its literal compliment.

z()[source]

Change the given object in place to its Z-partner if possible. Otherwise leave the object unchanged.

class sator.core.PPCSetBase(*args, **kwargs)[source]

Base class for PCSet and PSet

abstract_compliment[source]

Returns a PCSet of the abstract compliment of the given object.

canon(t, i, m)[source]

Takes arguments in the form of (T, I, M) where each is a boolean. These arguments determine which TTO’s are canonical. These TTO’s are used to determine an object’s set-class. (The default canonical operators are T and I, hence the common name Tn/TnI type). Ex:

a.canon(True, False, False)

a.prime would now give the Tn-type, and ignore inversion as an operation for determining set-class membership.

cardinality[source]

Returns the cardinality of the given object.

clear()[source]

Remove all pitches/pitch classes from the object.

each_card()[source]

Yields every set with the same cardinality as the given object, taking into account the object’s modulus.

classmethod each_card_in_mod(card, mod)[source]

Same as the instance method but takes two args for cardinality and modulus respectively

each_prime()[source]

Yields each unique set-class in the modulus of the given object.

classmethod each_prime_in_card_mod(card, mod)[source]

Yields every unique prime form with a given cardinality in the given modulus

each_set()[source]

Yields every possible set in the modulus of the given object.

forte[source]

Returns the Forte name for the given object.

static forte_name(fname)[source]

A static method that returns a PCSet object with the fort-name provided as a string argument. Returns an empty PCSet if the argument is not a string with a valid Forte name.

static fromint(integer, modulus=12)[source]

Static method that returns a PCSet object with pc’s generated from their integer representation.

Ex:
0 = [], 1 = [0], 2 = [1], 3 = [0, 1], 4 = [2], 5 = [0, 2] PCSet.fromint(5) returns PCSet([0, 2])
get_canon[source]

Returns a three tuple showing which TTO’s are canonical for the given object. These are in the order (T, I, M). Refer to canon() for details on how these settings are used.

icv[source]

Returns the interval class vector of the given object.

insert(place, pitch)[source]

Given arguments (place, pitch) insert the pitch at the place position. Take care to inspect the object’s pitches attribute rather than it’s __repr__, which uses the ppc attribute and may truncate duplicates. If the position is too great, the pitch will be appended at the end.

invariance_vector[source]

A property that returns the list of (n, m) pairs that produce an invariant set via TnMm

literal_compliment[source]

Returns a PCSet of the literal compliment of the given object.

mpartner[source]

Return a PCSet for the M-partner of the given object.

pcint[source]

Returns the integer representation of a given object in prime form.

prime[source]

Return a PCSet that represents the given object in prime form, taking into account its canonical TTO’s (set these with .canon(T, I, M)).

prime_operation[source]

A property that returns (n, m) to perform on the given object via TnMm in order to obtain its prime form.

setint[source]

Returns the integer representation for the unique PC’s in a given object

subprimes(limit=0)[source]

Yields the subsets of the given object which have a unique set-class. Takes an optional limit argument with the same behavior as subsets().

subsets(limit=0)[source]

Yields the subsets of the given object. Takes an optional argument, which limits the subsets to those with a cardinality >= the limit. With no argument, returns all subsets.

superprimes(limit=0)[source]

Yields the supersets of the given object which have a unique set-class. Takes an optional limit argument with the same behavior as supersets()

supersets(limit=0)[source]

Yields the supersets of the given object. Takes an optional argument, which limits the supersets to those with a cardinality <= the limit. With no argument, returns all supersets.

zpartner[source]

Property that returns the Z-partner of the given object if it exists, otherwise returns None.

class sator.core.PSet(*args, **kwargs)[source]

A class for pitch sets, which adds pitch set only methods.

class sator.core.SetRowBase(*args, **kwargs)[source]

Base class for PC/pitch sets and tone rows

all_rotations[source]

Return a flat list of objects for each possible TTO of the given object

copy(pitches=None)[source]

Use to copy a ToneRow/PSet/PCSet with all data attributes.

default_m(new_m=None)[source]

Takes one argument as the new default argument for M operations. (The default for Mod 12 is 5) Without an argument, returns the current default m.

each_n()[source]

Yields a number for each possible member in the object considering its modulus. (An object with a modulus of 12 would return [0, 1, 2...11])

classmethod each_n_in_mod(mod)[source]

Same as the instance method but takes one positional arg as the modulus

each_tto()[source]

Yields an (n, m) pair for each TTO that can be performed on the given object

i(sub_n=0)[source]

Invert the object in place. If an argument is provided, also transpose the object in place by that amount.

i_rotations[source]

Returns a list of objects for each possible transposition of the given object after inversion.

m_rotations[source]

Returns a list of objects for each possible transposition of the given object after M.

mi_rotations[source]

Returns a list of objects for each possible transposition of the given object after MI.

mod(new_mod=None)[source]

Takes one argument as the new modulus of the system. Without an argument, returns the current modulus.

multiset(value=None)[source]

Takes one boolean argument and determines if the object is a multiset. (The default for all objects is False. ToneRows cannot be multisets) Without an argument, returns the current setting.

ordered(value=None)[source]

Takes one boolean argument and determines if the object is ordered. (The default for PCSets is False. The default for PSets is True.) Without an argument, returns the current setting.

pcs[source]

Returns the pitch classes of the current set/row

ppc[source]

Returns the pitches or pcs of a ToneRow, PCSet, or PSet taking into account the ordered and multiset settings.

t(sub_n)[source]

Transpose the object in place by the argument provided.

t_rotations[source]

Returns a list of objects for each possible transposition of the given object.

uo_pcs[source]

Returns unordered pitch classes in ascending order

uo_pitches[source]

Returns the unordered pitches in ascending order

sator.core.transpose(a, n)[source]
sator.core.invert(a, n=0)[source]
sator.core.multiply(a, m=5)[source]
sator.core.transpose_multiply(a, n, m=5)[source]

Project Versions

Previous topic

Similarity Relations

This Page