This class contains facilities for voiceleading, harmonic progression, and identifying chord types.
More...
|
static bool | addOctave (const std::vector< double > &lowestVoicing, std::vector< double > &newVoicing, size_t maximumPitch, size_t divisionsPerOctave) |
| Add an octave to a voicing; can be iterated to enumerate the voicings of a chord. More...
|
|
static bool | areParallel (const std::vector< double > &chord1, const std::vector< double > &chord2) |
|
static std::vector< double > | chordToPTV (const std::vector< double > &chord, size_t lowestPitch, size_t highestPitch, size_t divisionsPerOctave=12) |
| Return the voiced chord for the prime chord index P, transposition T, and voicing index V within the specified range for the indicated number of tones per octave. More...
|
|
static const std::vector
< double > & | closer (const std::vector< double > &source, const std::vector< double > &destination1, const std::vector< double > &destination2, bool avoidParallels) |
| Return the closer, first by smoothness then by simplicity., of the voiceleadings between source and either destination1 or destination2, optionally avoiding parallel fifths. More...
|
|
static const std::vector< double > | closest (const std::vector< double > &source, const std::vector< std::vector< double > > &destinations, bool avoidParallels) |
| Return the closest voiceleading within the specified range, first by smoothness then by simplicity, between the source chord any of the destination chords, optionally avoiding parallel fifths. More...
|
|
static double | closestPitch (double pitch, const std::vector< double > &pitches) |
| Return the pitch in pitches that is closest to the specified pitch. More...
|
|
static double | conformToPitchClassSet (double pitch, const std::vector< double > &pcs, size_t divisionsPerOctave=12) |
| Return the pitch that results from making the minimum adjustment to the pitch-class of the pitch argument that is required to make its pitch-class the same as one of the pitch-classes in the pitch-class set argument. More...
|
|
static double | cToM (double C, size_t divisionsPerOctaven=12) |
| Return M = sum over pitch-classes of (2 ^ pitch-class) (multiplicative monoid for pitch-class sets) for C = (sum over pitch-classes of (pitch-class ^ 2)) - 1 (additive cyclic group for non-empty pitch-class sets). More...
|
|
static double | cToP (double C, size_t divisionsPerOctave=12) |
| Return C = (sum over pitch-classes of (pitch-class ^ 2)) - 1 (additive cyclic group for non-empty pitch-class sets) for P = index of prime chords. More...
|
|
static double | euclideanDistance (const std::vector< double > &chord1, const std::vector< double > &chord2) |
| Return the Euclidean distance between two chords, which must have the same number of voices. More...
|
|
static double | I (double p, double n) |
| Return the pitch-class inversion of pitch p by n semitones. More...
|
|
static std::vector< double > | I (const std::vector< double > &c, double n) |
| Return the pitch-class inversion of chord c by n semitones. More...
|
|
static bool | Iform (const std::vector< double > &X, const std::vector< double > &Y, double g=1.0) |
| Return whether chord Y is an inverted form of chord X; g is the generator of inversions. More...
|
|
static void | initializePrimeChordsForDivisionsPerOctave (size_t divisionsPerOctave) |
|
static std::vector
< std::vector< double > > | inversions (const std::vector< double > &chord) |
| Return as many inversions of the pitch-classes in the chord as there are voices in the chord. More...
|
|
static std::vector< double > | invert (const std::vector< double > &chord) |
| Invert by rotating the chord and adding an octave to its last pitch. More...
|
|
static std::vector< double > | K (const std::vector< double > &c) |
| Invert chord c by exchange. More...
|
|
static double | mToC (double M, size_t divisionsPerOctave) |
| Return C = (sum over pitch-classes of (pitch-class ^ 2)) - 1 (additive cyclic group for non-empty pitch-class sets) for M = sum over pitch-classes of (2 ^ pitch-class) (multiplicative monoid for pitch-class sets). More...
|
|
static std::vector< double > | mToPitchClassSet (double pcn, size_t divisionsPerOctave=12) |
| Convert a pitch-class set number M = sum over pitch-classes of (2 ^ pitch-class) to a pitch-class set chord. More...
|
|
static double | nameToC (std::string name, size_t divisionsPerOctave_) |
| Return C = (sum over pitch-classes of (pitch-class ^ 2)) - 1 (additive cyclic group for pitch-class sets) for the named pitch-class set. More...
|
|
static std::vector
< std::vector< double > > | nonBijectiveVoicelead (const std::vector< double > &sourceChord, const std::vector< double > &targetPitchClassSet, size_t divisionsPerOctave=12) |
| Return the closest crossing-free, non-bijective voiceleading from the source chord to the pitch-classes in the target chord, using Dimitri Tymoczko's linear programming algorithm. More...
|
|
static std::vector< double > | normalChord (const std::vector< double > &chord) |
| Return the normal chord: that inversion of the pitch-classes in the chord which is closest to the orthogonal axis of the Tonnetz for that chord. More...
|
|
static std::vector< double > | orderedPcs (const std::vector< double > &chord, size_t divisionsPerOctave=12) |
| Return a copy of the chord where each pitch is replaced by its corresponding pitch-class. More...
|
|
static std::vector< double > | pAndTtoPitchClassSet (double prime, double transposition, size_t divisionsPerOctave=12) |
| Convert a prime chord number and transposition to a pitch-class set. More...
|
|
static double | pc (double pitch, size_t divisionsPerOctave=12) |
| Return the pitch-class of the pitch. More...
|
|
static std::vector< double > | pcs (const std::vector< double > &chord, size_t divisionsPerOctave=12) |
| Return the chord as the list of its pitch-classes. More...
|
|
static double | pitchClassSetToM (const std::vector< double > &chord, size_t divisionsPerOctave=12) |
| Convert a chord to a pitch-class set number M = sum over pitch-classes of (2 ^ pitch-class). More...
|
|
static std::vector< double > | pitchClassSetToPandT (const std::vector< double > &pcs, size_t divisionsPerOctave=12) |
| Convert a pitch-class set to a prime chord number and a transposition. More...
|
|
static std::vector< double > | primeChord (const std::vector< double > &chord) |
| Return the prime chord: that inversion of the pitch-classes in the chord which is closest to the orthogonal axis of the Tonnetz for that chord, transposed so that its lowest pitch is at the origin. More...
|
|
static double | pToC (double Z, size_t divisionsPerOctave=12) |
| Return P = index of prime chords for C = (sum over pitch-classes of (pitch-class ^ 2)) - 1 (additive cyclic group for non-empty pitch-class sets). More...
|
|
static std::vector< double > | pToPrimeChord (double P, size_t divisionsPerOctave=12) |
| Return the prime chord for the index P. More...
|
|
static std::vector< double > | ptvToChord (size_t P, size_t T, size_t V_, size_t lowest, size_t range, size_t divisionsPerOctave=12) |
| Return the voiced chord for the prime chord index P, transposition T, and voicing index V within the specified range for the indicated number of tones per octave. More...
|
|
static std::vector< double > | Q (const std::vector< double > &c, double n, const std::vector< double > &s, double g=1.0) |
| Contextually transpose chord c with respect to chord s by n semitones; g is the generator of transpositions. More...
|
|
static std::vector< double > | recursiveVoicelead (const std::vector< double > &source, const std::vector< double > &targetPitchClassSet, double lowest, double range, bool avoidParallels, size_t divisionsPerOctave=12) |
| Return the closest voiceleading within the specified range, first by smoothness then by simplicity, between the source chord and the target pitch-class set, optionally avoiding parallel fifths. More...
|
|
static std::vector< double > | rotate (const std::vector< double > &chord) |
| Return the chord with the first note rotated to the last note. More...
|
|
static std::vector
< std::vector< double > > | rotations (const std::vector< double > &chord) |
| Return the set of all rotations of the chord. More...
|
|
static const std::vector
< double > & | simpler (const std::vector< double > &source, const std::vector< double > &destination1, const std::vector< double > &destination2, bool avoidParallels) |
| Return the simpler (fewer motions) of the voiceleadings between source chord and either destination1 or destination2, optionally avoiding parallel fifths. More...
|
|
static double | smoothness (const std::vector< double > &chord1, const std::vector< double > &chord2) |
| Return the smoothness (distance by taxicab or L1 norm) of the voiceleading between chord1 and chord2. More...
|
|
static std::vector< double > | sortByAscendingDistance (const std::vector< double > &chord, size_t divisionsPerOctave=12) |
| Return a copy of the chord sorted by ascending distance from its first pitch-class. More...
|
|
static double | T (double p, double n) |
| Return the pitch-class transposition of pitch p by n semitones. More...
|
|
static std::vector< double > | T (const std::vector< double > &c, double n) |
| Return the pitch-class transposition of chord c by n semitones. More...
|
|
static bool | Tform (const std::vector< double > &X, const std::vector< double > &Y, double g=1.0) |
| Return whether chord Y is a transposed form of chord X; g is the generator of transpositions. More...
|
|
static std::vector< double > | toOrigin (const std::vector< double > &chord) |
| Return the chord transposed so its lowest pitch is at the origin. More...
|
|
static std::vector< double > | transpose (const std::vector< double > &chord, double semitones) |
| Return the chord transposed by the indicated number of semitones. More...
|
|
static std::vector< double > | uniquePcs (const std::vector< double > &chord, size_t divisionsPerOctave=12) |
| Return the chord as the list of its pitch-classes. More...
|
|
static std::vector< double > | voicelead (const std::vector< double > &source, const std::vector< double > &targetPitchClassSet, double lowest, double range, bool avoidParallels, size_t divisionsPerOctave=12) |
| Return the closest voiceleading within the specified range, first by smoothness then by simplicity, between the source chord and the target pitch-class set, optionally avoiding parallel fifths. More...
|
|
static std::vector< double > | voiceleading (const std::vector< double > &chord1, const std::vector< double > &chord2) |
| Return the voice-leading vector (difference) between chord1 and chord2. More...
|
|
static std::vector
< std::vector< double > > | voicings (const std::vector< double > &chord, double lowest, double highest, size_t divisionsPerOctave) |
| Return an enumeration of all voicings of the chord that are greater than or equal to the lowest pitch, and less than the highest pitch, by adding octaves. More...
|
|
static std::vector< double > | wrap (const std::vector< double > &chord, size_t lowestPitch, size_t highestPitch, size_t divisionsPerOctave=12) |
| Wrap chord tones that exceed the highest pitch around to the bottom of the range orbifold. More...
|
|