Public Member Functions |
| virtual void | addChild (Node *node) |
| virtual void | addRule (std::string command, std::string replacement) |
| virtual void | clear () |
| virtual ublas::matrix< double > | createTransform () |
| virtual double & | element (size_t row, size_t column) |
| virtual void | generate () |
| virtual double | getAngle () const |
| virtual std::string | getAxiom () const |
| virtual int | getIterationCount () const |
| virtual ublas::matrix< double > | getLocalCoordinates () const |
| | Returns the local transformation of coordinate system.
|
| virtual std::string | getReplacement (std::string command) |
| virtual Score & | getScore () |
| | Lindenmayer () |
| virtual void | produceOrTransform (Score &score, size_t beginAt, size_t endAt, const ublas::matrix< double > &coordinates) |
| | The default implementation does nothing.
|
| virtual void | setAngle (double angle) |
| virtual void | setAxiom (std::string axiom) |
| virtual void | setElement (size_t row, size_t column, double value) |
| virtual void | setIterationCount (int count) |
| virtual ublas::matrix< double > | traverse (const ublas::matrix< double > &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 | ~Lindenmayer () |
Data Fields |
| std::vector< Node * > | children |
| | Child Nodes, if any.
|
| std::string | importFilename |
Protected Member Functions |
| virtual ublas::matrix< double > | createRotation (int dimension1, int dimension2, double angle) const |
| virtual int | getDimension (char dimension) const |
| virtual void | initialize () |
| virtual void | interpret (std::string command, bool render) |
| virtual void | rewrite () |
| virtual void | updateActual (Event &event) |
Protected Attributes |
| double | angle |
| std::string | axiom |
| clock_t | beganAt |
| clock_t | elapsed |
| clock_t | endedAt |
| int | iterationCount |
| ublas::matrix< double > | localCoordinates |
std::map< std::string,
std::string > | rules |
| Score | score |
| Event | turtle |
| Event | turtleOrientation |
| std::stack< Event > | turtleOrientationStack |
| std::stack< Event > | turtleStack |
| Event | turtleStep |
| std::stack< Event > | turtleStepStack |
This class implements a Lindenmayer system in music space for a turtle that writes either notes into a score, or Jones-Parks grains into a memory soundfile.
The Z dimension of note space is used for chirp rate. The actions of the turtle are rescaled to fit the specified bounding hypercube. The turtle commands are represented by letters (all n default to 1):
-
G = Write the current state of the turtle into the soundfile as a grain.
-
Mn = Translate the turtle by adding to its state its step times its orientation times n.
-
Rabn = Rotate the turtle from dimension a to dimension b by angle 2 pi / (angleCount * n)
-
Uan = Vary the turtle state on dimension a by a normalized (-1 through +1) uniformly distributed random variable times n.
-
Gan = Vary the turtle state on dimension a by a normalized (-1 through +1) Gaussian random variable times n.
-
T=an = Assign to dimension a of the turtle state the value n.
-
T*an = Multiply dimension a of the turtle state by n.
-
T/an = Divide dimension a of the turtle state by n.
-
T+an = Add to dimension a of the turtle state the value n.
-
T-an = Subtract from dimension a of the turtle state the value n.
-
S=an = Assign to dimension a of the turtle step the value n.
-
S*an = Multiply dimension a of the turtle step by n.
-
S/an = Divide dimension a of the turtle step by n.
-
S+an = Add to dimension a of the turtle step the value n.
-
S-an = Subtract from dimension a of the turtle step the value n.
-
[ = Push the current state of the turtle state onto a stack.
-
] = Pop the current state of the turtle from the stack.
The abbreviations for the dimensions are:
-
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