Base class for Tone rows and PC sets
Perform M on the object in place. If an argument is provided, also transpose the object in place by that amount.
Base class for PC/pitch sets and tone rows
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.
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])
Same as the instance method but takes one positional arg as the modulus
A generator that yields ordered objects that represent each permutation of the given object.
Invert the object in place. If an argument is provided, also transpose the object in place by that amount.
Returns a list of objects for each possible transposition of the given object after inversion.
Returns a list of objects for each possible transposition of the given object after M.
Returns a list of objects for each possible transposition of the given object after MI.
Takes one argument as the new modulus of the system. Without an argument, returns the current modulus.
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.
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.
Base class for PCSet and PSet
Exception to raise if the argument used can not be made into a set
Returns a PCSet of the abstract compliment of the given object.
Decorator to help with set methods. Ensures that args are sets
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.
Return an instance that represents the difference of the current PSet or PCSet and another as the first and only positional argument.
Degrees of symmetry (number of Tn/TnI operations for which this set is invariant)
Yields every set with the same cardinality as the given object, taking into account the object’s modulus.
Same as the instance method but takes two args for cardinality and modulus respectively
Yields every unique prime form with a given cardinality in the given modulus
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 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])
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.
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.
Return an instance that represents the intersection of the current PSet or PCSet and another as the first and only positional argument.
A property that returns the list of (n, m) pairs that produce an invariant set via TnMm
Return True if the current PSet or PCSet is disjoint with another object taken as the first and only positional argument, otherwise False
Return True if the current PSet or PCSet is a subset of another object taken as the first and only positional argument, otherwise False.
Return True if the current PSet or PCSet is a superset of another object taken as the first and only positional argument, otherwise False
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.
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)).
A property that returns (n, m) to perform on the given object via TnMm in order to obtain its prime form.
Yields the subsets of the given object which have a unique set-class. Takes an optional limit argument with the same behavior as subsets().
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.
Yields the supersets of the given object which have a unique set-class. Takes an optional limit argument with the same behavior as supersets()
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.
Return an instance that represents the symmetric_difference of the current PSet or PCSet and another as the first and only positional argument.
A class for pitch sets, which adds pitch set only methods.