csound::Composition Class Reference

#include <Composition.hpp>

Inheritance diagram for csound::Composition:

Inheritance graph
[legend]
Collaboration diagram for csound::Composition:

Collaboration graph
[legend]

Detailed Description

Base class for user-derived musical compositions. Contains a Score object for collecting generated Events such as notes and control messages, and an Orchestra object for rendering the generated scores.

Public Member Functions

 Composition ()
virtual ~Composition ()
virtual void generate ()
virtual void createCsoundScore (std::string addToScore="", double extendSeconds=5.0)
virtual void render ()
virtual void perform ()
virtual void clear ()
virtual ScoregetScore ()
virtual void setCppSound (CppSound *orchestra)
virtual CppSoundgetCppSound ()
virtual void write (const char *text)
virtual void setTonesPerOctave (double tonesPerOctave)
virtual double getTonesPerOctave () const
virtual void setConformPitches (bool conformPitches)
virtual bool getConformPitches () const
virtual void setCsoundOrchestra (std::string orchestra)
virtual std::string getCsoundOrchestra () const
virtual void setCsoundScoreHeader (std::string header)
virtual std::string getCsoundScoreHeader () const
virtual void arrange (int oldInstrumentNumber, int newInstrumentNumber)
virtual void arrange (int oldInstrumentNumber, int newInstrumentNumber, double gain)
virtual void arrange (int oldInstrumentNumber, int newInstrumentNumber, double gain, double pan)
virtual void removeArrangement ()
virtual void setCsoundCommand (std::string command)
virtual std::string getCsoundCommand () const

Protected Attributes

Score score
double tonesPerOctave
bool conformPitches
CppSound cppSound_
CppSoundcppSound
std::string csoundScoreHeader

Constructor & Destructor Documentation

csound::Composition::Composition (  ) 

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


Member Function Documentation

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

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

Reimplemented in csound::MusicModel.

virtual void csound::Composition::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 void csound::Composition::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::perform (  )  [virtual]

Uses csound to perform the current score.

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

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

Reimplemented in csound::MusicModel.

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

Return the self-contained Score.

virtual void csound::Composition::setCppSound ( CppSound orchestra  )  [virtual]

Sets the self-contained Orchestra.

virtual CppSound* csound::Composition::getCppSound (  )  [virtual]

Return the self-contained Orchestra.

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

Write as if to stdout or stderr.

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

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

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

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

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

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

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

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

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

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

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

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

virtual void csound::Composition::arrange ( int  oldInstrumentNumber,
int  newInstrumentNumber 
) [virtual]

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

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

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

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

Re-assign instrument numbers, adjust gains, and change pans for export to Csound score (convenience wrapper for Score::arrange()).

virtual void csound::Composition::removeArrangement (  )  [virtual]

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

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

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

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

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


Field Documentation

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

Prepended to generated score.


Generated on Sun Nov 9 00:24:48 2008 for Csound and CsoundAC by  doxygen 1.5.6