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

csound::MusicModel Class Reference

#include <MusicModel.hpp>

Inherits csound::ScoreModel.

Public Member Functions

Static Public Member Functions

Data Fields

Protected Attributes


Detailed Description

A ScoreModel that uses Csound to render generated scores, via the CppSound class.


Constructor & Destructor Documentation

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

Member Function Documentation

virtual void csound::Node::addChild ( Node node  )  [virtual, inherited]
virtual void csound::MusicModel::arrange ( int  oldInstrumentNumber,
int  newInstrumentNumber 
) [virtual]

Re-assign instrument number for export to Csound score (convenience wrapper for Score::arrange()).

virtual void csound::MusicModel::arrange ( int  oldInstrumentNumber,
int  newInstrumentNumber,
double  gain 
) [virtual]

Re-assign instrument number and adjust gain for export to Csound score (convenience wrapper for Score::arrange()).

virtual void csound::MusicModel::arrange ( int  oldInstrumentNumber,
int  newInstrumentNumber,
double  gain,
double  pan 
) [virtual]

Re-assign instrument number, adjust gain, and change pan for export to Csound score (convenience wrapper for Score::arrange()).

virtual void csound::MusicModel::arrange ( int  silenceInstrumentNumber,
std::string  csoundInstrumentName 
) [virtual]

Re-assign instrument by name for export to Csound score.

virtual void csound::MusicModel::arrange ( int  silenceInstrumentNumber,
std::string  csoundInstrumentName,
double  gain 
) [virtual]

Re-assign instrument by name and adjust gains for export to Csound score.

virtual void csound::MusicModel::arrange ( int  silenceInstrumentNumber,
std::string  csoundInstrumentName,
double  gain,
double  pan 
) [virtual]

Re-assign instrument by name, adjust gain, and change pan for export to Csound score.

virtual void csound::MusicModel::clear (  )  [virtual]

Clear all contents of this.

Reimplemented from csound::ScoreModel.

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

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

virtual void csound::MusicModel::createCsoundScore ( std::string  addToScore = "",
double  extendSeconds = 5.0 
) [virtual]

Translate the generated score to a Csound score and export it for performance. The time given by extendSeconds is used for a concluding e statement.

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::MusicModel::generate (  )  [virtual]

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

Reimplemented from csound::ScoreModel.

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

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

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

Generates a versioned filename.

Reimplemented from csound::ScoreModel.

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 CppSound* csound::MusicModel::getCppSound (  )  [virtual]

Return the self-contained Orchestra.

virtual std::string csound::MusicModel::getCsoundCommand (  )  const [virtual]

Return Csound command line (convenience wrapper for CppSound::getCommand()).

virtual std::string csound::MusicModel::getCsoundOrchestra (  )  const [virtual]

Return the Csound orchestra (convenience wrapper for CppSound::getOrchestra()).

virtual std::string csound::MusicModel::getCsoundScoreHeader (  )  const [virtual]

Return the Csound score header that is prepended to generated scores.

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

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

Reimplemented from csound::ScoreModel.

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::MusicModel::getMidiFilename (  )  [virtual]

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

Reimplemented from csound::ScoreModel.

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

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

Reimplemented from csound::ScoreModel.

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

Return the self-contained Score.

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

Returns the address of this as a long integer.

Reimplemented from csound::ScoreModel.

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

Returns the address of this as a Node pointer.

Reimplemented from csound::ScoreModel.

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::MusicModel::initialize (  )  [virtual]

Reimplemented from csound::ScoreModel.

virtual void csound::MusicModel::perform (  )  [virtual]

Uses csound to perform the current score.

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::MusicModel::removeArrangement (  )  [virtual]

Remove instrument number, gain, and pan assignments (convenience wrapper for Score::removeArrangement()).

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

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

virtual void csound::MusicModel::render (  )  [virtual]

Convenience function that erases the existing score, appends optional text to it, invokes generate(), invokes createCsoundScore(), 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::MusicModel::setCppSound ( CppSound orchestra  )  [virtual]

Sets the self-contained Orchestra.

virtual void csound::MusicModel::setCsoundCommand ( std::string  command  )  [virtual]

Set Csound command line (convenience wrapper for CppSound::setCommand()).

virtual void csound::MusicModel::setCsoundOrchestra ( std::string  orchestra  )  [virtual]

Set the Csound orchestra (convenience wrapper for CppSound::setOrchestra()).

virtual void csound::MusicModel::setCsoundScoreHeader ( std::string  header  )  [virtual]

Set a Csound score fragment to be prepended to the generated score (createCsoundScore is called with it).

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

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

Reimplemented from csound::ScoreModel.

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]

Pointer to a Csound object that is used to render scores. Defaults to the internal Csound object, but can be re-set to an external Csound object.

Self-contained Csound object.

std::string csound::MusicModel::csoundScoreHeader [protected]

Prepended to generated score.

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