Csound and CsoundAC API
5.17
|
Translates images in various RGB formats to scores. More...
#include <ImageToScore.hpp>
Public Member Functions | |
virtual void | addChild (Node *node) |
virtual void | clear () |
virtual ublas::matrix< double > | createTransform () |
virtual double & | element (size_t row, size_t column) |
virtual void | generate () |
virtual std::string | getImageFilename () const |
virtual ublas::matrix< double > | getLocalCoordinates () const |
Returns the local transformation of coordinate system. | |
virtual size_t | getMaximumVoiceCount () const |
virtual double | getMinimumValue () const |
virtual Score & | getScore () |
ImageToScore (void) | |
virtual void | produceOrTransform (Score &score, size_t beginAt, size_t endAt, const ublas::matrix< double > &coordinates) |
The default implementation does nothing. | |
virtual void | setElement (size_t row, size_t column, double value) |
virtual void | setImageFilename (std::string imageFilename) |
virtual void | setMaximumVoiceCount (size_t maximumVoiceCount) |
virtual void | setMinimumValue (double minimumValue) |
virtual ublas::matrix< double > | traverse (const ublas::matrix< double > &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 | ~ImageToScore (void) |
Data Fields | |
std::vector< Node * > | children |
Child Nodes, if any. | |
std::string | importFilename |
Protected Member Functions | |
virtual void | getPixel (size_t x, size_t y, double &hue, double &saturation, double &value) const |
virtual void | translate (double x, double y, double hue, double value, Event &event) const |
Static Protected Member Functions | |
static void | rgbToHsv (double r, double g, double b, double &h, double &s, double &v) |
Protected Attributes | |
Fl_Image * | image |
std::string | imageFilename |
ublas::matrix< double > | localCoordinates |
size_t | maximumVoiceCount |
double | minimumValue |
Score | score |
Translates images in various RGB formats to scores.
Hue is mapped to instrument, value is mapped to loudness.
csound::ImageToScore::ImageToScore | ( | void | ) |
virtual csound::ImageToScore::~ImageToScore | ( | void | ) | [virtual] |
virtual void csound::Node::addChild | ( | Node * | node | ) | [virtual, inherited] |
virtual void csound::Node::clear | ( | ) | [virtual, inherited] |
Reimplemented in csound::ChordLindenmayer, csound::Lindenmayer, csound::MusicModel, and csound::ScoreModel.
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::ImageToScore::generate | ( | ) | [virtual] |
virtual std::string csound::ImageToScore::getImageFilename | ( | ) | const [virtual] |
virtual ublas::matrix<double> csound::Node::getLocalCoordinates | ( | ) | const [virtual, inherited] |
Returns the local transformation of coordinate system.
virtual size_t csound::ImageToScore::getMaximumVoiceCount | ( | ) | const [virtual] |
virtual double csound::ImageToScore::getMinimumValue | ( | ) | const [virtual] |
virtual void csound::ImageToScore::getPixel | ( | size_t | x, |
size_t | y, | ||
double & | hue, | ||
double & | saturation, | ||
double & | value | ||
) | const [protected, virtual] |
virtual Score& csound::ScoreNode::getScore | ( | ) | [virtual, inherited] |
virtual void csound::ScoreNode::produceOrTransform | ( | Score & | score, |
size_t | beginAt, | ||
size_t | endAt, | ||
const ublas::matrix< double > & | compositeCordinates | ||
) | [virtual, inherited] |
The default implementation does nothing.
Derived nodes that produce notes from scratch should transform them using the composite transformation of coordinate system, which is passed in from the traverse() function.
Reimplemented from csound::Node.
Reimplemented in csound::MCRM, csound::Rescale, csound::Cell, and csound::Hocket.
static void csound::ImageToScore::rgbToHsv | ( | double | r, |
double | g, | ||
double | b, | ||
double & | h, | ||
double & | s, | ||
double & | v | ||
) | [static, protected] |
virtual void csound::Node::setElement | ( | size_t | row, |
size_t | column, | ||
double | value | ||
) | [virtual, inherited] |
virtual void csound::ImageToScore::setImageFilename | ( | std::string | imageFilename | ) | [virtual] |
virtual void csound::ImageToScore::setMaximumVoiceCount | ( | size_t | maximumVoiceCount | ) | [virtual] |
virtual void csound::ImageToScore::setMinimumValue | ( | double | minimumValue | ) | [virtual] |
virtual void csound::ImageToScore::translate | ( | double | x, |
double | y, | ||
double | hue, | ||
double | value, | ||
Event & | event | ||
) | const [protected, virtual] |
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::Sequence, and csound::Hocket.
std::vector<Node *> csound::Node::children [inherited] |
Child Nodes, if any.
Fl_Image* csound::ImageToScore::image [protected] |
std::string csound::ImageToScore::imageFilename [protected] |
std::string csound::ScoreNode::importFilename [inherited] |
ublas::matrix<double> csound::Node::localCoordinates [protected, inherited] |
size_t csound::ImageToScore::maximumVoiceCount [protected] |
double csound::ImageToScore::minimumValue [protected] |
Score csound::ScoreNode::score [protected, inherited] |