Core module Index

class sator.setrowbase.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.setrowbase.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, **kwargs)[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_permutation()[source]

A generator that yields ordered objects that represent each permutation of the given object.

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

class sator.setbase.SetBase(*args, **kwargs)[source]

Base class for PCSet and PSet

exception OnlySetableMethod[source]

Exception to raise if the argument used can not be made into a set

SetBase.abstract_compliment[source]

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

SetBase.args_are_sets(f, *args, **kwargs)[source]

Decorator to help with set methods. Ensures that args are sets

SetBase.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.

SetBase.cardinality[source]

Returns the cardinality of the given object.

SetBase.clear()[source]

Remove all pitches/pitch classes from the object.

SetBase.difference(*args, **kwargs)[source]

Return an instance that represents the difference of the current PSet or PCSet and another as the first and only positional argument.

SetBase.ds[source]

Degrees of symmetry (number of Tn/TnI operations for which this set is invariant)

SetBase.each_card()[source]

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

classmethod SetBase.each_card_in_mod(card, mod)[source]

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

SetBase.each_prime()[source]

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

classmethod SetBase.each_prime_in_card_mod(card, mod)[source]

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

SetBase.each_set()[source]

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

SetBase.forte[source]

Returns the Forte name for the given object.

static SetBase.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 SetBase.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])
SetBase.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.

SetBase.icv[source]

Returns the interval class vector of the given object.

SetBase.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.

SetBase.intersection(*args, **kwargs)[source]

Return an instance that represents the intersection of the current PSet or PCSet and another as the first and only positional argument.

SetBase.invariance_vector[source]

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

SetBase.isdisjoint(*args, **kwargs)[source]

Return True if the current PSet or PCSet is disjoint with another object taken as the first and only positional argument, otherwise False

SetBase.issubset(*args, **kwargs)[source]

Return True if the current PSet or PCSet is a subset of another object taken as the first and only positional argument, otherwise False.

SetBase.issuperset(*args, **kwargs)[source]

Return True if the current PSet or PCSet is a superset of another object taken as the first and only positional argument, otherwise False

SetBase.literal_compliment[source]

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

SetBase.m_vector(m)[source]

Find David Lewin’s M-vector. (Also described in Composition with Pitch Classes - Robert Morris) Finds the number of each set-class with cardinality m which are subsets of a given pitch class. The ICV is equivalent to the m-vector of a pitch class when m is 2.

SetBase.mpartner[source]

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

SetBase.pcint[source]

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

SetBase.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)).

SetBase.prime_operation[source]

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

SetBase.setint[source]

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

SetBase.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().

SetBase.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.

SetBase.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()

SetBase.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.

SetBase.symmetric_difference(*args, **kwargs)[source]

Return an instance that represents the symmetric_difference of the current PSet or PCSet and another as the first and only positional argument.

SetBase.union(*args, **kwargs)[source]

Return an instance that represents the union of the current PSet or PCSet and another as the first and only positional argument.

SetBase.zpartner[source]

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

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

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

H()[source]

Hexatonic Pole (Cohn)

N()[source]

Nebenverwandt

exception NotNeoR[source]

Can not be transformed by a Neo-Riemannian operator

PSet.S()[source]

Slide

PSet.cycle(ts)[source]

Cycle through a list of transformations until the original set is reached.

PSet.paths(other)[source]

A breadth first tree search to find the shortest path(s) from the given object to another. Takes one argument as the goal set, returns a list with one or more strings indicating the transformations between the given set and the goal set.

PSet.root[source]

Find the root(s) of an ordered pitch set, using Paul Hindemith’s method

PSet.transform(ts)[source]

Returns the given object after performing the list of transformations given as a string argument. If the string is empty, the given object is returned.

class sator.pcset.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.

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