Csound and CsoundAC API  5.17
Public Member Functions | Data Fields | Protected Attributes | Static Private Attributes
csound::Rescale Class Reference

Rescales all child events to fit a bounding hypercube in music space. More...

#include <Rescale.hpp>

+ Inheritance diagram for csound::Rescale:

Public Member Functions

virtual void addChild (Node *node)
virtual void clear ()
virtual Eigen::MatrixXd createTransform ()
virtual double & element (size_t row, size_t column)
 Returns a reference to the indicated element of the local transformation of coordinate system.
virtual Eigen::MatrixXd getLocalCoordinates () const
 Returns the local transformation of coordinate system.
virtual void getRescale (int dimension, bool &rescaleMinimum, bool &rescaleRange, double &targetMinimum, double &targetRange)
virtual ScoregetScore ()
virtual void initialize ()
virtual void produceOrTransform (Score &score, size_t beginAt, size_t endAt, const Eigen::MatrixXd &coordinates)
 This function is called by the traverse() function.
 Rescale ()
virtual void setElement (size_t row, size_t column, double value)
 Sets the indicated element of the local transformation of coordinate system.
virtual void setRescale (int dimension, bool rescaleMinimum, bool rescaleRange, double targetMinimum, double targetRange)
virtual Eigen::MatrixXd traverse (const Eigen::MatrixXd &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 ~Rescale ()

Data Fields

std::vector< Node * > children
 Child Nodes, if any.
double duration
 If not 0, the score is rescaled to this duration.
std::string importFilename

Protected Attributes

Eigen::MatrixXd localCoordinates
Score score

Static Private Attributes

static std::map< std::string,
size_t > 
dimensions
static bool initialized

Detailed Description

Rescales all child events to fit a bounding hypercube in music space.

No, some, or all dimensions may be rescaled to fit the minimum alone, the range alone, or both the minimum and the range.

Constructor & Destructor Documentation

csound::Rescale::Rescale ( )
virtual csound::Rescale::~Rescale ( )
virtual

Member Function Documentation

virtual void csound::Node::addChild ( Node node)
virtualinherited
virtual void csound::Node::clear ( )
virtualinherited
virtual Eigen::MatrixXd csound::Node::createTransform ( )
virtualinherited
virtual double& csound::Node::element ( size_t  row,
size_t  column 
)
virtualinherited

Returns a reference to the indicated element of the local transformation of coordinate system.

virtual Eigen::MatrixXd csound::Node::getLocalCoordinates ( ) const
virtualinherited

Returns the local transformation of coordinate system.

virtual void csound::Rescale::getRescale ( int  dimension,
bool &  rescaleMinimum,
bool &  rescaleRange,
double &  targetMinimum,
double &  targetRange 
)
virtual
virtual Score& csound::ScoreNode::getScore ( )
virtualinherited
virtual void csound::Rescale::initialize ( )
virtual
virtual void csound::Rescale::produceOrTransform ( Score collectingScore,
size_t  beginAt,
size_t  endAt,
const Eigen::MatrixXd &  compositeCordinates 
)
virtual

This function is called by the traverse() function.

The default implementation does nothing. If a derived node produces new Events, then it must transform them by the composite coordinates, then append them to the collecting score. If a derived node transforms Events produced by child Nodes, then it must transform only Events in the collecting score starting at the startAt index and continuing up to, but not including, the endAt index. These bookmarks, in turn, must be set in the Traverse function by all Nodes that produce events.

Reimplemented from csound::ScoreNode.

virtual void csound::Node::setElement ( size_t  row,
size_t  column,
double  value 
)
virtualinherited

Sets the indicated element of the local transformation of coordinate system.

virtual void csound::Rescale::setRescale ( int  dimension,
bool  rescaleMinimum,
bool  rescaleRange,
double  targetMinimum,
double  targetRange 
)
virtual
virtual Eigen::MatrixXd csound::Node::traverse ( const Eigen::MatrixXd &  globalCoordinates,
Score score 
)
virtualinherited

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::Koch, csound::Stack, csound::Intercut, csound::Hocket, and csound::Sequence.

Field Documentation

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

Child Nodes, if any.

std::map<std::string, size_t> csound::Rescale::dimensions
staticprivate
double csound::ScoreNode::duration
inherited

If not 0, the score is rescaled to this duration.

std::string csound::ScoreNode::importFilename
inherited
bool csound::Rescale::initialized
staticprivate
Eigen::MatrixXd csound::Node::localCoordinates
protectedinherited
Score csound::ScoreNode::score
protectedinherited