Public Member Functions |
virtual void | addChild (Node *node) |
virtual void | addRule (std::string command, std::string replacement) |
virtual void | apply (Score &score, const VoiceleadingOperation &priorOperation, const VoiceleadingOperation ¤tOperation) |
| Apply the current voice-leading operation to the score, within the specified range of notes.
|
virtual void | applyVoiceleadingOperations () |
virtual void | C (double time, double C_) |
| Beginning at the specified time and continuing to the beginning of the next operation or the end of the score, whichever comes first, conform notes produced by this node or its children to the specified prime chord and transposition.
|
virtual void | C (double time, std::string C_) |
| Same as PT, except that a single number is used in place of the P and T numbers.
|
| ChordLindenmayer () |
virtual void | CL (double time, double C_, bool avoidParallels=true) |
| Same as CV, except the chord is specified by jazz-type name (e.g.
|
virtual void | CL (double time, std::string C_, bool avoidParallels=true) |
| Same as PTL, except the chord is specified by a single number instead of P and T numbers.
|
virtual void | clear () |
virtual Eigen::MatrixXd | createRotation (int dimension1, int dimension2, double angle) const |
virtual Eigen::MatrixXd | createTransform () |
virtual void | CV (double time, double C_, double V_) |
| Same as C, except the chord can be specified by jazz-type name (e.g.
|
virtual void | CV (double time, std::string C_, double V_) |
| Same as PTV, except the chord is specified by a single number instead of the P and T numbers.
|
virtual double & | element (size_t row, size_t column) |
| Returns a reference to the indicated element of the local transformation of coordinate system.
|
virtual double | equivalence (double &value, char equivalenceClass) const |
| Returns the result of applying the equivalence class to the value, both in the argument and as the return value; there may be no effect.
|
virtual void | fixStatus () |
virtual void | generate () |
| Scores are generated as follows:
|
virtual void | generateLindenmayerSystem () |
virtual double | getAngle () const |
virtual std::string | getAxiom () const |
virtual int | getDimension (char dimension) const |
virtual int | getIterationCount () const |
virtual Eigen::MatrixXd | getLocalCoordinates () const |
| Returns the local transformation of coordinate system.
|
virtual std::vector< double > | getModality () const |
virtual std::string | getReplacement (std::string command) |
virtual void | initialize () |
virtual void | interpret (std::string command) |
virtual void | K (double time) |
| Find the C of the previous segment, and contextually invert it; apply the resulting C to the current segment.
|
virtual void | KL (double time, bool avoidParallels=true) |
| Find the C of the previous segment, and contextually invert it; apply the resulting C to the current segment, using the closest voiceleading from the pitches of the previous segment.
|
virtual void | KV (double time, double V_) |
| Find the C of the previous segment, and contextually invert it; apply the resulting C to the current segment with voicing V.
|
virtual void | L (double time, bool avoidParallels=true) |
| Beginning at the specified time and continuing to the beginning of the next operation or the end of the score, whichever comes first, conform notes produced by this node or its children to the smoothest voice-leading from the pitches of the previous segment.
|
virtual char | parseCommand (const std::string &command, std::string &operation, char &target, char &equivalenceClass, size_t &dimension, size_t &dimension1, double &scalar, std::vector< double > &vector) |
virtual void | produceOrTransform (Score &score, size_t beginAt, size_t endAt, const Eigen::MatrixXd &compositeCordinates) |
| Applies all of the stored voice-leading operations to the specified range of notes in the score.
|
virtual void | PT (double time, double P_, double T) |
| Beginning at the specified time and continuing to the beginning of the next operation or the end of the score, whichever comes first, conform notes produced by this node or its children to the specified prime chord and transposition.
|
virtual void | PTL (double time, double P_, double T, bool avoidParallels=true) |
| Beginning at the specified time and continuing to the beginning of the next operation or the end of the score, whichever comes first, conform notes produced by this node or its children to the specified chord; the voicing of the chord will be the smoothest voice-leading from the pitches of the previous chord.
|
virtual void | PTV (double time, double P_, double T, double V_) |
| Beginning at the specified time and continuing to the beginning of the next operation or the end of the score, whichever comes first, conform notes produced by this node or its children to the specified prime chord, transposition, and voicing.
|
virtual void | Q (double time, double Q_) |
| Find the C of the previous segment, and contextually transpose it; apply the resulting C to the current segment.
|
virtual void | QL (double time, double Q_, bool avoidParallels=true) |
| Find the C of the previous segment, and contextually transpose it; apply the resulting C to the current segment, using the closest voiceleading from the pitches of the previous segment.
|
virtual void | QV (double time, double Q_, double V_) |
| Find the C of the previous segment, and contextually transpose it; apply the resulting C to the current segment with voicing V.
|
virtual void | setAngle (double angle) |
virtual void | setAxiom (std::string axiom) |
virtual void | setElement (size_t row, size_t column, double value) |
| Sets the indicated element of the local transformation of coordinate system.
|
virtual void | setIterationCount (int count) |
virtual void | setModality (const std::vector< double > &pcs) |
virtual void | tieOverlappingNotes () |
virtual void | transform (Score &score, bool rescaleTime=false) |
| Apply all of the voice-leading operations stored within this node to the score.
|
virtual Eigen::MatrixXd | traverse (const Eigen::MatrixXd &globalCoordinates, Score &score) |
| The default implementation postconcatenates its own local coordinate system with the global coordinates, then passes the score and the product of coordinate systems to each child, thus performing a depth-first traversal of the music graph.
|
virtual void | V (double time, double V_) |
| Beginning at the specified time and continuing to the beginning of the next operation or the end of the score, whichever comes first, conform notes produced by this node or its children to the specified voicing of the chord.
|
virtual void | writeScore () |
virtual | ~ChordLindenmayer () |
This class implements a Lindenmayer system that generates a score by moving a turtle around in various implicit music spaces.
The turtle consists of:
-
N, a note, i.e. a vector of real numbers in score space.
-
S, a step, i.e. an increment by which to move N (also a vector in score space).
-
O, an orientation, i.e. a direction to move N (also a vector).
-
C, a chord, i.e. a vector of voices in chord space.
-
M, a modality used as a reference for neo-Riemannian operations upon chords (also a vector).
-
V, a chord voicing, i.e. the index of the octavewise permutation of C within a range.
-
B, the bass of the range.
-
R, the size of the range.
In accordance with both mathematical music theory and the practice of composers, operations on elements of music take place in spaces whose geometry changes fluidly depending upon the musical context. A paradigmatic example is transposition, which may apply to individual notes, or to chords, or to larger parts of scores; as an even more indicative example, transposition may apply to pitch under octave equivalence (pitch-classes), to pitch under range equivalence (transposition on a staff), or simply to pitch as a real number.
Consequently, the independent parts of an operation in this Lindenmayer system are specified by commands in the format OTEDX, where:
-
O = the operation proper (e.g. sum or product).
-
T = the target, or part of the turtle to which the operation applies, and which has an implicit rank (e.g. scalar, vector, tensor).
-
E = its equivalence class (e.g. octave or range).
-
D = the individual dimension of the operation (e.g. pitch or time).
-
X = the operand.
Of course, some operations apply in all ranks, dimensions, and equivalence classes; other operations, only to one dimension or one class.
Commands are as follows (x is a real scalar; for chords, v is a real vector "(x1,..,xn)" or a jazz-style chord name ("F#7b9")):
-
[ = Push the active turtle onto a stack (start a branch).
-
] = Pop the active turtle from the stack (return to the branching point).
-
Fx = Move the turtle "forward" x steps along its current orientation: N := N + (S * O) * x.
-
ROdex = Rotate the turtle orientation from dimension d to dimension e by angle x: R = makeRotation(d, e, x); O := R * O.
-
oNEdx = Apply algebraic operation o to turtle note dimension d with operand x: N[d] := N[d] + S[d] o x.
-
oSEdx = Apply algebraic operation o to turtle step dimension d with operand x: S[d] := S[d] o x.
-
oCEix = Apply algebraic operation o to voice i of the turtle chord with operand x: C[i] := C[i] o x.
-
oCEv = Apply algebraic operation o to the turtle chord with operand x: C := C o x (x may be a vector or chord name).
-
oMEv = Apply algebraic operation o to the turtle modality with operand x: M := M o x (x may be a vector or chord name).
-
oVx = Apply algebraic operation o to the voicing index of the turtle chord with operand x: V := V o x. Of necessity the equivalence class is the range of the score.
-
ICOx = Invert the turtle chord by reflecting it around pitch-class x.
-
KCO = Apply Neo-Riemannian inversion by exchange to the turtle chord.
-
QCOx = Apply Neo-Riemannian contextual transposition by x pitch-classes (with reference to the turtle's modality) to the turtle chord.
-
VC+ = Add a voice (doubling the root) to the turtle chord.
-
VC- = Remove a voice from the turtle chord.
-
WN = Write the current turtle note to the score.
-
WCV = Write the current turtle chord and voicing to the score.
-
WCNV = Write the current turtle chord and voicing to the score, after first applying the turtle note to each voice in the chord.
-
AC = Apply the current turtle chord to the score, starting at the current time and continuing to the next A command.
-
ACN = Apply the current turtle chord to the score, after first applying the turtle note to each voice in the chord, starting at the current time and continuing to the next A command.
-
ACL = Apply the current turtle chord to the score, using the closest voice-leading from the previous chord (if any), starting at the current time and continuing to the next A command.
-
ACNL = Apply the current turtle chord to the score, after first applying the turtle note to each voice in the chord, using the closest voice-leading from the previous chord (if any), starting at the current time and continuing to the next A command.
-
A0 = End application of the previous A command.
Dimensions of notes:
-
i = instrument.
-
t = time.
-
d = duration.
-
k = MIDI key number.
-
v = MIDI velocity number.
-
p = phase.
-
x = pan.
-
y = height.
-
z = depth.
-
s = pitch-class set as Mason number (deprecated here).
Algebraic operations:
-
= = Assign.
-
+ = Add.
-
- = Subtract.
-
* = Multiply.
-
/ = Divide.
Equivalence classes:
-
0 = None.
-
O = The octave (12).
-
R = The range of the turtle.