Csound and CsoundAC API
5.17
|
Chords represent simultaneously sounding pitches. More...
#include <ChordSpace.hpp>
Public Types | |
enum | { PITCH = 0, DURATION = 1, LOUDNESS = 2, INSTRUMENT = 3, PAN = 4, COUNT = 5 } |
Public Member Functions | |
virtual Chord | ceiling () const |
Returns a new chord whose pitches are the ceilings of this chord's pitches. | |
Chord () | |
virtual bool | contains (double pitch_) const |
Returns whether or not the chord contains the pitch. | |
virtual size_t | count (double pitch) const |
virtual Chord | cycle (int stride=1) const |
Returns a copy of the chord cyclically permuted by a stride, by default 1. | |
virtual double | distanceToOrigin () const |
Returns the Euclidean distance of this chord from its space's origin. | |
virtual double | distanceToUnisonDiagonal () const |
Returns the distance of this chord from its space's unison diagonal. | |
virtual Chord | eI () const |
Returns the equivalent of the chord within the representative fundamental domain of inversional equivalence. | |
virtual Chord | eO () const |
Returns the equivalent of the chord within the representative fundamental domain of octave equivalence. | |
virtual Chord | eOP () const |
Returns the equivalent of the chord within the representative fundamental domain of octave and permutational equivalence. | |
virtual Chord | eOPI () const |
Returns the equivalent of the chord within the representative fundamental domain of octave, permutational, and inversional equivalence. | |
virtual Chord | eOPT () const |
Returns the equivalent of the chord within the representative fundamental domain of octave, permutational, and transpositional equivalence. | |
virtual Chord | eOPTT (double g=1.0) const |
virtual Chord | eP () const |
Returns the equivalent of the chord within the representative fundamental domain of permutational equivalence. | |
virtual Chord | epcs () const |
Returns the equivalent of the chord under pitch-class equivalence, i.e. | |
virtual Chord | eR (double range) const |
Returns the equivalent of the chord within the representative fundamental domain of a range equivalence. | |
virtual Chord | eRP (double range) const |
Returns the equivalent of the chord within the representative fundamental domain of range and permutational equivalence. | |
virtual Chord | eRPI (double range) const |
Returns the equivalent of the chord within the representative fundamental domain of range, permutational, and inversional equivalence. | |
virtual Chord | eRPT (double range) const |
Returns the equivalent of the chord within the representative fundamental domain of range, permutational, and transpositional equivalence; the same as set-class type, or chord type. | |
virtual Chord | eRPTT (double range, double g=1.0) const |
virtual Chord | et () const |
Returns the equivalent of the chord within the fundamental domain of transposition to 0. | |
virtual Chord | eT () const |
Returns the equivalent of the chord within the representative fundamental domain of transpositonal equivalence. | |
virtual Chord | eTT (double g=1.0) const |
Returns the equivalent of the chord within the representative fundamental domain of transpositonal equivalence and the equal temperament generated by g. | |
virtual Chord | eV () const |
Returns the equivalent of the chord within the representative fundamental domain of voicing equivalence. | |
virtual Chord | floor () const |
Returns a new chord whose pitches are the floors of this chord's pitches. | |
virtual double | getDuration (int voice=0) const |
virtual double | getInstrument (int voice=0) const |
virtual double | getLoudness (int voice=0) const |
virtual double | getPan (int voice=0) const |
virtual double | getPitch (int voice) const |
virtual Chord | I (double center=0.0) const |
Inverts the chord by another chord that is on the unison diagonal, by default the origin. | |
virtual bool | iseI (Chord *inverse=0) const |
Returns whether the chord is within the representative fundamental domain of inversional equivalence. | |
virtual bool | iseO () const |
Returns whether the chord is within the representative fundamental domain of octave equivalence. | |
virtual bool | iseOP () const |
Returns whether the chord is within the representative fundamental domain of octave and permutational equivalence. | |
virtual bool | iseOPI () const |
Returns whether the chord is within the representative fundamental domain of octave, permutational, and inversional equivalence. | |
virtual bool | iseOPT () const |
Returns whether the chord is within the representative fundamental domain of octave, permutational, and transpositional equivalence. | |
virtual bool | iseOPTT (double g=1.0) const |
virtual bool | iseP () const |
Returns whether the chord is within the representative fundamental domain of permutational equivalence. | |
virtual bool | isepcs () const |
Returns whether the chord is within the fundamental domain of pitch-class equivalence, i.e. | |
virtual bool | iseR (double range) const |
Returns whether the chord is within the representative fundamental domain of the indicated range equivalence. | |
virtual bool | iseRP (double range) const |
Returns whether the chord is within the representative fundamental domain of range and permutational equivalence. | |
virtual bool | iseRPI (double range) const |
Returns whether the chord is within the representative fundamental domain of range, permutational, and inversional equivalence. | |
virtual bool | iseRPT (double range) const |
Returns whether the chord is within the representative fundamental domain of range, permutational, and transpositional equivalence. | |
virtual bool | iseRPTT (double range, double g=1.0) const |
virtual bool | iset () const |
Returns whether the chord is within the fundamental domain of transposition to 0. | |
virtual bool | iseT () const |
Returns whether the chord is within the representative fundamental domain of transpositional equivalence. | |
virtual bool | iseTT (double g=1.0) const |
Returns whether the chord is within the representative fundamental domain of translational equivalence and the equal temperament generated by g. | |
virtual bool | iseV () const |
Returns whether the chord is within the representative fundamental domain of voicing equivalence. | |
virtual double | layer () const |
Returns the sum of the pitches in the chord. | |
virtual std::vector< double > | max () const |
Returns the highest pitch in the chord, and also its voice index. | |
virtual Chord | maximallyEven () const |
Returns the maximally even chord in the chord's space, e.g. | |
virtual double | maximumInterval () const |
virtual std::vector< double > | min () const |
Returns the lowest pitch in the chord, and also its voice index. | |
virtual double | minimumInterval () const |
virtual bool | operator< (const Chord &other) const |
virtual bool | operator<= (const Chord &other) const |
virtual bool | operator== (const Chord &other) const |
virtual bool | operator> (const Chord &other) const |
virtual bool | operator>= (const Chord &other) const |
virtual Chord | origin () const |
Returns the origin of the chord's space. | |
virtual std::vector< Chord > | permutations () const |
Returns the permutations of the pitches in a chord. | |
virtual void | resize (size_t voices) |
virtual void | setDuration (double value, int voice=-1) |
virtual void | setInstrument (double value, int voice=-1) |
virtual void | setLoudness (double value, int voice=-1) |
virtual void | setPan (double value, int voice=-1) |
virtual void | setPitch (int voice, double value) |
virtual Chord | T (double interval) const |
Transposes the chord by the indicated interval (may be a fraction). | |
virtual std::string | toString () const |
Returns a string representation of the chord. | |
virtual Chord | v (int direction=1) const |
Returns a copy of the chord 'inverted' in the musician's sense, i.e. | |
virtual size_t | voices () const |
virtual std::vector< Chord > | voicings () const |
Returns all the 'inversions' (in the musician's sense) or octavewise revoicings of the chord. | |
virtual | ~Chord () |
Chords represent simultaneously sounding pitches.
The pitches are represented as semitones with 0 at the origin and middle C as 60. Each voice also has a duration, velocity, channel, and pan. Eigen matrices are accessed (row, column) and stored as columns vectors, so a Chord is accessed (voice, attribute).
|
inline |
|
inlinevirtual |
|
inlinevirtual |
Returns a new chord whose pitches are the ceilings of this chord's pitches.
References setPitch().
|
inlinevirtual |
Returns whether or not the chord contains the pitch.
References csound::eq_epsilon().
|
inlinevirtual |
References csound::eq_epsilon().
|
inlinevirtual |
Returns a copy of the chord cyclically permuted by a stride, by default 1.
The direction of rotation is by default the same as musicians' first inversion, second inversion, and so on; but negative sign will reverse the direction of rotation.
Referenced by permutations(), and v().
|
inlinevirtual |
Returns the Euclidean distance of this chord from its space's origin.
References csound::euclidean().
|
inlinevirtual |
Returns the distance of this chord from its space's unison diagonal.
References csound::euclidean(), and setPitch().
|
inlinevirtual |
Returns the equivalent of the chord within the representative fundamental domain of inversional equivalence.
References csound::I().
|
inlinevirtual |
Returns the equivalent of the chord within the representative fundamental domain of octave equivalence.
References csound::OCTAVE().
|
inlinevirtual |
Returns the equivalent of the chord within the representative fundamental domain of octave and permutational equivalence.
References csound::OCTAVE().
|
inlinevirtual |
Returns the equivalent of the chord within the representative fundamental domain of octave, permutational, and inversional equivalence.
References csound::OCTAVE().
|
inlinevirtual |
Returns the equivalent of the chord within the representative fundamental domain of octave, permutational, and transpositional equivalence.
References csound::OCTAVE().
|
inlinevirtual |
References csound::OCTAVE().
|
inlinevirtual |
Returns the equivalent of the chord within the representative fundamental domain of permutational equivalence.
The implementation
uses a bubble sort to swap out of order voices in the Eigen matrix.
References getPitch(), and csound::gt_epsilon().
Referenced by eRP().
|
inlinevirtual |
Returns the equivalent of the chord under pitch-class equivalence, i.e.
the pitch-class set of the chord.
References csound::epc(), and setPitch().
|
inlinevirtual |
Returns the equivalent of the chord within the representative fundamental domain of a range equivalence.
References csound::gt_epsilon(), iseR(), layer(), max(), csound::OCTAVE(), and setPitch().
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
Returns the equivalent of the chord within the representative fundamental domain of range, permutational, and transpositional equivalence; the same as set-class type, or chord type.
References eT(), iseV(), voices(), and voicings().
|
inlinevirtual |
References iseV(), voices(), and voicings().
|
inlinevirtual |
Returns the equivalent of the chord within the fundamental domain of transposition to 0.
References csound::T().
|
inlinevirtual |
Returns the equivalent of the chord within the representative fundamental domain of transpositonal equivalence.
References csound::T().
Referenced by eRPT().
|
inlinevirtual |
Returns the equivalent of the chord within the representative fundamental domain of transpositonal equivalence and the equal temperament generated by g.
I.e., returns the chord transposed such that its layer is 0 or, under transposition, the positive layer closest to 0. NOTE: Does NOT return the result under any other equivalence class.
References getPitch(), and T().
Referenced by iseTT().
|
inlinevirtual |
Returns the equivalent of the chord within the representative fundamental domain of voicing equivalence.
References csound::ge_epsilon(), getPitch(), csound::OCTAVE(), and voices().
|
inlinevirtual |
Returns a new chord whose pitches are the floors of this chord's pitches.
References setPitch().
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
Referenced by eP(), eTT(), csound::euclidean(), eV(), operator<(), operator==(), operator>(), and v().
|
inlinevirtual |
Inverts the chord by another chord that is on the unison diagonal, by default the origin.
NOTE: Does NOT return the result under any equivalence class.
References csound::I(), and setPitch().
Referenced by eRPI().
|
inlinevirtual |
Returns whether the chord is within the representative fundamental domain of inversional equivalence.
References csound::I().
|
inlinevirtual |
Returns whether the chord is within the representative fundamental domain of octave equivalence.
References csound::OCTAVE().
|
inlinevirtual |
Returns whether the chord is within the representative fundamental domain of octave and permutational equivalence.
References csound::OCTAVE().
|
inlinevirtual |
Returns whether the chord is within the representative fundamental domain of octave, permutational, and inversional equivalence.
References csound::OCTAVE().
|
inlinevirtual |
Returns whether the chord is within the representative fundamental domain of octave, permutational, and transpositional equivalence.
References csound::OCTAVE().
|
inlinevirtual |
References csound::OCTAVE().
|
inlinevirtual |
Returns whether the chord is within the representative fundamental domain of permutational equivalence.
References csound::le_epsilon().
|
inlinevirtual |
Returns whether the chord is within the fundamental domain of pitch-class equivalence, i.e.
is a pitch-class set.
References csound::epc(), and csound::eq_epsilon().
|
inlinevirtual |
Returns whether the chord is within the representative fundamental domain of the indicated range equivalence.
References csound::le_epsilon().
Referenced by eR().
|
inlinevirtual |
Returns whether the chord is within the representative fundamental domain of range and permutational equivalence.
|
inlinevirtual |
Returns whether the chord is within the representative fundamental domain of range, permutational, and inversional equivalence.
References csound::I().
Referenced by eRPI().
|
inlinevirtual |
Returns whether the chord is within the representative fundamental domain of range, permutational, and transpositional equivalence.
|
inlinevirtual |
|
inlinevirtual |
Returns whether the chord is within the fundamental domain of transposition to 0.
|
inlinevirtual |
Returns whether the chord is within the representative fundamental domain of transpositional equivalence.
References csound::eq_epsilon().
|
inlinevirtual |
Returns whether the chord is within the representative fundamental domain of translational equivalence and the equal temperament generated by g.
References eTT().
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
Returns the highest pitch in the chord, and also its voice index.
References csound::gt_epsilon().
Referenced by eR().
|
inlinevirtual |
Returns the maximally even chord in the chord's space, e.g.
the augmented triad for 3 dimensions.
References csound::OCTAVE(), and setPitch().
|
inlinevirtual |
References csound::gt_epsilon().
|
inlinevirtual |
Returns the lowest pitch in the chord, and also its voice index.
References csound::lt_epsilon().
|
inlinevirtual |
References csound::lt_epsilon().
|
inlinevirtual |
References getPitch(), csound::gt_epsilon(), csound::lt_epsilon(), and voices().
|
inlinevirtual |
|
inlinevirtual |
References csound::eq_epsilon(), getPitch(), and voices().
|
inlinevirtual |
References getPitch(), csound::gt_epsilon(), csound::lt_epsilon(), and voices().
|
inlinevirtual |
|
inlinevirtual |
Returns the origin of the chord's space.
References resize().
|
inlinevirtual |
Returns the permutations of the pitches in a chord.
The permutations starting from any particular permutation are always returned in the same order.
References cycle().
|
inlinevirtual |
Referenced by origin().
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
Referenced by ceiling(), distanceToUnisonDiagonal(), epcs(), eR(), floor(), I(), maximallyEven(), T(), and v().
|
inlinevirtual |
Transposes the chord by the indicated interval (may be a fraction).
NOTE: Does NOT return the result under any equivalence class.
References setPitch(), and csound::T().
Referenced by eTT().
|
inlinevirtual |
Returns a string representation of the chord.
Quadratic complexity, but short enough not to matter.
|
inlinevirtual |
Returns a copy of the chord 'inverted' in the musician's sense, i.e.
revoiced by cyclically permuting the chord and adding (or subtracting) an octave to the highest (or lowest) voice. The revoicing will move the chord up or down in pitch. A positive direction is the same as a musician's first inversion, second inversion, etc.
References cycle(), getPitch(), csound::OCTAVE(), and setPitch().
Referenced by voicings().
|
inlinevirtual |
Referenced by eRPT(), eRPTT(), csound::euclidean(), eV(), operator<(), operator==(), and operator>().