Public Member Functions | Static Public Member Functions | Data Fields | Protected Attributes

csound::ScoreModel Class Reference

#include <ScoreModel.hpp>

Inherits csound::Composition, and csound::Node.

Inherited by csound::MusicModel.

Public Member Functions

Static Public Member Functions

Data Fields

Protected Attributes


Detailed Description

Base class for compositions that use the principle of a music graph to generate a score. A music graph is a directed acyclic graph of nodes including empty nodes, nodes that contain only child nodes, score nodes, event generator nodes, event transformer nodes, and others. Each node is associated with a local transformation of coordinate system in music space using a 12 x 12 homogeneous matrix. To generate the score, the music graph is traversed depth first, and each node postconcatenates its local transformation of coordinate system with the coordinate system of its parent to derive a new local coordinate system, which is applied to all child events.


Constructor & Destructor Documentation

csound::ScoreModel::ScoreModel (  ) 
virtual csound::ScoreModel::~ScoreModel (  )  [virtual]

Member Function Documentation

virtual void csound::Node::addChild ( Node node  )  [virtual, inherited]
virtual void csound::ScoreModel::clear (  )  [virtual]

Clears the score.

Reimplemented from csound::Node.

Reimplemented in csound::MusicModel.

virtual void csound::Composition::clear (  )  [virtual, inherited]

Clear all contents of this. Probably should be overridden in derived classes.

virtual ublas::matrix<double> csound::Node::createTransform (  )  [virtual, inherited]
virtual double& csound::Node::element ( size_t  row,
size_t  column 
) [virtual, inherited]
virtual void csound::Composition::generate (  )  [virtual, inherited]

Generate performance events and store them in the score. Must be overidden in derived classes.

virtual void csound::ScoreModel::generate (  )  [virtual]

Generates a score based on a music graph defined by the child nodes of this.

Reimplemented in csound::MusicModel.

static std::string csound::ScoreModel::generateFilename (  )  [static]

Generates a versioned filename.

Reimplemented in csound::MusicModel.

virtual bool csound::Composition::getConformPitches (  )  const [virtual, inherited]

Returns whether or not the pitches in generated scores will be conformed to the nearest equally tempered pitch.

virtual std::string csound::ScoreModel::getFilename (  )  const [virtual]

Returns the filename of this, which is used as a base for derived filenames (soundfile, MIDI file, etc.).

Reimplemented in csound::MusicModel.

virtual ublas::matrix<double> csound::Node::getLocalCoordinates (  )  const [virtual, inherited]

Returns the local transformation of coordinate system.

Reimplemented in csound::Random.

virtual std::string csound::ScoreModel::getMidiFilename (  )  [virtual]

Returns a MIDI filename based on the filename of this, by appending ".mid" to the filename.

Reimplemented in csound::MusicModel.

virtual std::string csound::ScoreModel::getOutputSoundfileName (  )  [virtual]

Returns a soundfile name based on the filename of this, by appending ".wav" to the filename.

Reimplemented in csound::MusicModel.

virtual Score& csound::Composition::getScore (  )  [virtual, inherited]

Return the self-contained Score.

virtual long csound::ScoreModel::getThis (  )  [virtual]

Returns the address of this as a long integer.

Reimplemented in csound::MusicModel.

virtual Node* csound::ScoreModel::getThisNode (  )  [virtual]

Returns the address of this as a Node pointer.

Reimplemented in csound::MusicModel.

virtual double csound::Composition::getTonesPerOctave (  )  const [virtual, inherited]

Returns the number of equally tempered intervals per octave (the default is 12, 0 means non-equally tempered).

virtual void csound::ScoreModel::initialize (  )  [virtual]

Reimplemented in csound::MusicModel.

virtual void csound::Composition::perform (  )  [virtual, inherited]

Performs the current score. The default implementation does nothing.

virtual void csound::Node::produceOrTransform ( Score score,
size_t  beginAt,
size_t  endAt,
const ublas::matrix< double > &  coordinates 
) [virtual, inherited]

The default implementation does nothing.

Reimplemented in csound::Cell, csound::Hocket, csound::MCRM, csound::Random, csound::Rescale, csound::ScoreNode, and csound::VoiceleadingNode.

virtual void csound::Composition::render (  )  [virtual, inherited]

Convenience function that erases the existing score, invokes generate(), and invokes perform().

virtual void csound::Composition::setConformPitches ( bool  conformPitches  )  [virtual, inherited]

Sets whether or not the pitches in generated scores will be conformed to the nearest equally tempered pitch.

virtual void csound::Node::setElement ( size_t  row,
size_t  column,
double  value 
) [virtual, inherited]
virtual void csound::ScoreModel::setFilename ( std::string  filename  )  [virtual]

Sets the filename of this -- basically, the title of the composition.

Reimplemented in csound::MusicModel.

virtual void csound::Composition::setTonesPerOctave ( double  tonesPerOctave  )  [virtual, inherited]

Sets the number of equally tempered intervals per octave (the default is 12, 0 means non-equally tempered).

virtual ublas::matrix<double> csound::Node::traverse ( const ublas::matrix< double > &  globalCoordinates,
Score score 
) [virtual, inherited]

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.

Reimplemented in csound::Hocket, and csound::Sequence.

virtual void csound::Composition::write ( const char *  text  )  [virtual, inherited]

Write as if to stderr.


Field Documentation

std::vector<Node *> csound::Node::children [inherited]

Child Nodes, if any.

bool csound::Composition::conformPitches [protected, inherited]
std::string csound::ScoreModel::filename [protected]
ublas::matrix<double> csound::Node::localCoordinates [protected, inherited]
Score csound::Composition::score [protected, inherited]
double csound::Composition::tonesPerOctave [protected, inherited]