csound::MusicModel Class Reference
#include <MusicModel.hpp>
Inherits csound::Composition, and csound::Node.
Public Member Functions
- virtual void addChild (Node *node)
- virtual void arrange (int silenceInstrumentNumber, std::string csoundInstrumentName, double gain, double pan)
- virtual void arrange (int silenceInstrumentNumber, std::string csoundInstrumentName, double gain)
- virtual void arrange (int silenceInstrumentNumber, std::string csoundInstrumentName)
- virtual void arrange (int oldInstrumentNumber, int newInstrumentNumber, double gain, double pan)
- virtual void arrange (int oldInstrumentNumber, int newInstrumentNumber, double gain)
- virtual void arrange (int oldInstrumentNumber, int newInstrumentNumber)
- virtual void clear ()
- virtual void createCsoundScore (std::string addToScore="", double extendSeconds=5.0)
- virtual ublas::matrix< double > createTransform ()
- virtual double & element (size_t row, size_t column)
- virtual void generate ()
- virtual bool getConformPitches () const
- virtual CppSound * getCppSound ()
- virtual std::string getCsoundCommand () const
- virtual std::string getCsoundOrchestra () const
- virtual std::string getCsoundScoreHeader () const
- virtual std::string getFilename () const
- virtual ublas::matrix< double > getLocalCoordinates () const
- virtual std::string getMidiFilename ()
- virtual std::string getOutputSoundfileName ()
- virtual Score & getScore ()
- virtual long getThis ()
- virtual Node * getThisNode ()
- virtual double getTonesPerOctave () const
- virtual void initialize ()
- MusicModel ()
- virtual void perform ()
- virtual void produceOrTransform (Score &score, size_t beginAt, size_t endAt, const ublas::matrix< double > &coordinates)
- virtual void removeArrangement ()
- virtual void render ()
- virtual void setConformPitches (bool conformPitches)
- virtual void setCppSound (CppSound *orchestra)
- virtual void setCsoundCommand (std::string command)
- virtual void setCsoundOrchestra (std::string orchestra)
- virtual void setCsoundScoreHeader (std::string header)
- virtual void setElement (size_t row, size_t column, double value)
- virtual void setFilename (std::string filename)
- virtual void setTonesPerOctave (double tonesPerOctave)
- virtual ublas::matrix< double > traverse (const ublas::matrix< double > &globalCoordinates, Score &score)
- virtual void write (const char *text)
- virtual ~MusicModel ()
Static Public Member Functions
Data Fields
Protected Attributes
Private 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::MusicModel::MusicModel |
( |
|
) |
|
virtual csound::MusicModel::~MusicModel |
( |
|
) |
[virtual] |
Member Function Documentation
virtual void csound::Node::addChild |
( |
Node * |
node |
) |
[virtual, inherited] |
virtual void csound::Composition::arrange |
( |
int |
silenceInstrumentNumber, |
|
|
std::string |
csoundInstrumentName, |
|
|
double |
gain, |
|
|
double |
pan | |
|
) |
| | [virtual, inherited] |
Re-assign instrument by name, adjust gain, and change pan for export to Csound score.
virtual void csound::Composition::arrange |
( |
int |
silenceInstrumentNumber, |
|
|
std::string |
csoundInstrumentName, |
|
|
double |
gain | |
|
) |
| | [virtual, inherited] |
Re-assign instrument by name and adjust gains for export to Csound score.
virtual void csound::Composition::arrange |
( |
int |
silenceInstrumentNumber, |
|
|
std::string |
csoundInstrumentName | |
|
) |
| | [virtual, inherited] |
Re-assign instrument by name for export to Csound score.
virtual void csound::Composition::arrange |
( |
int |
oldInstrumentNumber, |
|
|
int |
newInstrumentNumber, |
|
|
double |
gain, |
|
|
double |
pan | |
|
) |
| | [virtual, inherited] |
Re-assign instrument number, adjust gain, and change pan for export to Csound score (convenience wrapper for Score::arrange()).
virtual void csound::Composition::arrange |
( |
int |
oldInstrumentNumber, |
|
|
int |
newInstrumentNumber, |
|
|
double |
gain | |
|
) |
| | [virtual, inherited] |
Re-assign instrument number and adjust gain for export to Csound score (convenience wrapper for Score::arrange()).
virtual void csound::Composition::arrange |
( |
int |
oldInstrumentNumber, |
|
|
int |
newInstrumentNumber | |
|
) |
| | [virtual, inherited] |
Re-assign instrument number for export to Csound score (convenience wrapper for Score::arrange()).
virtual void csound::MusicModel::clear |
( |
|
) |
[virtual] |
Clear all contents of this. Probably should be overridden in derived classes.
Reimplemented from csound::Composition.
virtual void csound::Composition::createCsoundScore |
( |
std::string |
addToScore = "" , |
|
|
double |
extendSeconds = 5.0 | |
|
) |
| | [virtual, inherited] |
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] |
Generate performance events and store them in the score. Must be overidden in derived classes.
Reimplemented from csound::Composition.
static std::string csound::MusicModel::generateFilename |
( |
|
) |
[static] |
virtual bool csound::Composition::getConformPitches |
( |
|
) |
const [virtual, inherited] |
virtual CppSound* csound::Composition::getCppSound |
( |
|
) |
[virtual, inherited] |
Return the self-contained Orchestra.
virtual std::string csound::Composition::getCsoundCommand |
( |
|
) |
const [virtual, inherited] |
virtual std::string csound::Composition::getCsoundOrchestra |
( |
|
) |
const [virtual, inherited] |
virtual std::string csound::Composition::getCsoundScoreHeader |
( |
|
) |
const [virtual, inherited] |
Return the Csound score header that is prepended to generated scores.
virtual std::string csound::MusicModel::getFilename |
( |
|
) |
const [virtual] |
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] |
virtual std::string csound::MusicModel::getOutputSoundfileName |
( |
|
) |
[virtual] |
virtual Score& csound::Composition::getScore |
( |
|
) |
[virtual, inherited] |
Return the self-contained Score.
virtual long csound::MusicModel::getThis |
( |
|
) |
[virtual] |
virtual Node* csound::MusicModel::getThisNode |
( |
|
) |
[virtual] |
virtual double csound::Composition::getTonesPerOctave |
( |
|
) |
const [virtual, inherited] |
virtual void csound::MusicModel::initialize |
( |
|
) |
[virtual] |
virtual void csound::Composition::perform |
( |
|
) |
[virtual, inherited] |
Uses csound to perform the current score.
virtual void csound::Node::produceOrTransform |
( |
Score & |
score, |
|
|
size_t |
beginAt, |
|
|
size_t |
endAt, |
|
|
const ublas::matrix< double > & |
coordinates | |
|
) |
| | [virtual, inherited] |
virtual void csound::Composition::removeArrangement |
( |
|
) |
[virtual, inherited] |
virtual void csound::Composition::render |
( |
|
) |
[virtual, inherited] |
virtual void csound::Composition::setConformPitches |
( |
bool |
conformPitches |
) |
[virtual, inherited] |
virtual void csound::Composition::setCppSound |
( |
CppSound * |
orchestra |
) |
[virtual, inherited] |
Sets the self-contained Orchestra.
virtual void csound::Composition::setCsoundCommand |
( |
std::string |
command |
) |
[virtual, inherited] |
virtual void csound::Composition::setCsoundOrchestra |
( |
std::string |
orchestra |
) |
[virtual, inherited] |
virtual void csound::Composition::setCsoundScoreHeader |
( |
std::string |
header |
) |
[virtual, inherited] |
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] |
virtual void csound::Composition::setTonesPerOctave |
( |
double |
tonesPerOctave |
) |
[virtual, inherited] |
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 stdout or stderr.
Field Documentation
Prepended to generated score.