csound::Score Class Reference

#include <Score.hpp>

Public Member Functions

Static Public Member Functions

Data Fields

Protected Member Functions


Detailed Description

Base class for collections of events in music space. Can order events by time.

The implementation is a std::vector of Events. The elements of the vector are value objects, not references.


Constructor & Destructor Documentation

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

Member Function Documentation

virtual void csound::Score::append ( double  time,
double  duration,
double  status,
double  channel,
double  key,
double  velocity,
double  phase = 0,
double  pan = 0,
double  depth = 0,
double  height = 0,
double  pitches = 4095 
) [virtual]
virtual void csound::Score::append ( Event  event  )  [virtual]
virtual void csound::Score::arrange ( int  oldInstrumentNumber,
int  newInstrumentNumber,
double  gain,
double  pan 
) [virtual]

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

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

Re-assign instrument number and adjust gain for export to Csound score.

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

Re-assign instrument number for export to Csound score.

void csound::Score::createMusicModel (  )  [protected]
virtual void csound::Score::dump ( std::ostream &  stream  )  [virtual]
virtual void csound::Score::findScale (  )  [virtual]
virtual std::string csound::Score::getCsoundScore ( double  tonesPerOctave = 12.0,
bool  conformPitches = false 
) [virtual]

Translate the Silence events in this to a Csound score, that is, to a list of i statements. The Silence events are rounded off to the nearest equally tempered pitch by the specified number of tones per octave; if this argument is zero, the pitch is not tempered. The Silence events are conformed to the nearest pitch-class set in the pitch-class set dimension of the event, if the conform pitches argument is true; otherwise, the pitches are not conformed.

virtual double csound::Score::getDuration (  )  [virtual]
virtual std::vector<double> csound::Score::getPitches ( size_t  begin,
size_t  end,
size_t  divisionsPerOctave = 12 
) const [virtual]

Return a vector containing the MIDI key numbers in the specified segment of the score.

virtual std::vector<double> csound::Score::getPT ( size_t  begin,
size_t  end,
double  lowest,
double  range,
size_t  divisionsPerOctave = 12 
) const [virtual]

For the specified segment of the score, return the indexes for the prime chord and its transposition, within the specified range.

See: http://ruccas.org/pub/Gogins/music_atoms.pdf

virtual std::vector<double> csound::Score::getPTV ( size_t  begin,
size_t  end,
double  lowest,
double  range,
size_t  divisionsPerOctave = 12 
) const [virtual]

For the specified segment of the score, return the indexes for the prime chord, its transposition, and their voicing within the specified range. Each of these indexes forms an additive cyclic group.

See: http://ruccas.org/pub/Gogins/music_atoms.pdf

static void csound::Score::getScale ( std::vector< Event > &  score,
int  dimension,
size_t  beginAt,
size_t  endAt,
double &  minimum,
double &  range 
) [static]
virtual std::vector<double> csound::Score::getVoicing ( size_t  begin,
size_t  end,
size_t  divisionsPerOctave = 12 
) const [virtual]

Iterate over each note from the beginning to end of the segment; sort the unique pitches; return those unique pitches which also have unique pitch-class sets, in order from lowest to highest in pitch; this has the effect of returning the "inversion" or "voicing", in the musician's informal sense, of the pitches in that segment of the score.

virtual int csound::Score::indexAfterTime ( double  time  )  [virtual]

Return the index of the first event after the specified time, that is return "end" for the time; if the time is not found, return the size of the score. Iterating from indexAtTime(t1) to indexAfterTime(t2) is guaranteed to iterate over all and only those events included from and including t1 and up to but not including t2.

virtual int csound::Score::indexAtTime ( double  time  )  [virtual]

Return the index of the first event at or after the specified time, that is, return "begin" for the time; if the time is not found, return the size of the score. Iterating from indexAtTime(t1) to indexAfterTime(t2) is guaranteed to iterate over all and only those events included between t1 and t2.

virtual double csound::Score::indexToTime ( size_t  index  )  [virtual]

Return the time of the first event at or after the specified index; if the index is not found, return DBL_MAX.

virtual void csound::Score::initialize (  )  [virtual]
virtual void csound::Score::load ( MidiFile midiFile  )  [virtual]
virtual void csound::Score::load ( std::istream &  stream  )  [virtual]
virtual void csound::Score::load ( std::string  filename  )  [virtual]
virtual void csound::Score::removeArrangement (  )  [virtual]

Remove instrument number, gain, and pan assignments.

virtual void csound::Score::rescale ( int  dimension,
bool  rescaleMinimum,
double  minimum,
bool  rescaleRange = false,
double  range = 0.0 
) [virtual]
virtual void csound::Score::rescale ( Event event  )  [virtual]
virtual void csound::Score::rescale (  )  [virtual]
virtual void csound::Score::save ( MidiFile midiFile  )  [virtual]

Save as a MIDI file, format 1.

virtual void csound::Score::save ( std::ostream &  stream  )  [virtual]

Save as a MIDI file, format 1.

virtual void csound::Score::save ( std::string  filename  )  [virtual]

Save as a MIDI file, format 1.

virtual void csound::Score::setDuration ( double  targetDuration  )  [virtual]

Multiply existing times and durations by (targetDuration / getDuration()), i.e. stretch or shrink musical time.

virtual void csound::Score::setPitchClassSet ( size_t  begin,
size_t  end,
const std::vector< double > &  pcs,
size_t  divisionsPerOctave = 12 
) [virtual]

Set the pitches of the specified segment of the score to the specified pitch-class set. Each pitch in the score is moved to the closest pitch-class in the specified set.

virtual void csound::Score::setPitches ( size_t  begin,
size_t  end,
const std::vector< double > &  pitches 
) [virtual]

Set the pitches of the specified segment of the score to the specified pitches. Each pitch in the score is moved to the closest pitch in the specified pitches.

virtual void csound::Score::setPT ( size_t  begin,
size_t  end,
double  prime,
double  transposition,
double  lowest,
double  range,
size_t  divisionsPerOctave = 12 
) [virtual]

For the specified segment of the score, adjust the pitches to match the specified indexes for the prime chord and its transposition within the specified range.

See: http://ruccas.org/pub/Gogins/music_atoms.pdf

virtual void csound::Score::setPTV ( size_t  begin,
size_t  end,
double  prime,
double  transposition,
double  voicing,
double  lowest,
double  range,
size_t  divisionsPerOctave = 12 
) [virtual]

For the specified segment of the score, adjust the pitches to match the specified indexes for the prime chord, its transposition, and their voicing within the specified range. Each of these indexes forms an additive cyclic group.

See: http://ruccas.org/pub/Gogins/music_atoms.pdf

static void csound::Score::setScale ( std::vector< Event > &  score,
int  dimension,
bool  rescaleMinimum,
bool  rescaleRange,
size_t  beginAt,
size_t  endAt,
double  targetMinimum,
double  targetRange 
) [static]
virtual void csound::Score::setVoicing ( size_t  begin,
size_t  end,
const std::vector< double > &  voicing,
double  range,
size_t  divisionsPerOctave = 12 
) [virtual]

Move the pitches in the segment as little as possible to make them have the same ordering of pitch-class sets as the voicing, from the bottom to the top of the range. This has the effect of "inverting" or "re-voicing", in the musician's informal sense, the pitches in that segment of the score.

virtual void csound::Score::sort (  )  [virtual]

Sort all events in the score by time, instrument number, pitch, duration, loudness, and other dimensions as given by Event::SORT_ORDER.

virtual std::string csound::Score::toString (  )  [virtual]
virtual void csound::Score::voicelead ( size_t  beginSource,
size_t  endSource,
size_t  beginTarget,
size_t  endTarget,
const std::vector< double > &  targetPitches,
double  lowest,
double  range,
bool  avoidParallelFifths,
size_t  divisionsPerOctave = 12 
) [virtual]

Performs voice-leading between the specified segments of the score within the specified range, using the specified target pitches. The voice-leading is first the closest by taxicab norm, and then the simplest in motion, optionally avoiding parallel fifths. Only the pitches of the target notes are affected. If necessary, the number of pitches in the target chord is adjusted to match the source.

See: http://ruccas.org/pub/Gogins/music_atoms.pdf

virtual void csound::Score::voicelead ( size_t  beginSource,
size_t  endSource,
size_t  beginTarget,
size_t  endTarget,
double  lowest,
double  range,
bool  avoidParallelFifths,
size_t  divisionsPerOctave = 12 
) [virtual]

Performs voice-leading between the specified segments of the score within the specified range. The voice-leading is first the closest by taxicab norm, and then the simplest in motion, optionally avoiding parallel fifths. Only the pitches of the target notes are affected. If necessary, the number of pitches in the target chord is adjusted to match the source.

See: http://ruccas.org/pub/Gogins/music_atoms.pdf


Field Documentation

std::map<int, double> csound::Score::gains
std::map<int, double> csound::Score::pans
std::map<int, double> csound::Score::reassignments
std::vector<bool> csound::Score::rescaleMinima
std::vector<bool> csound::Score::rescaleRanges

Generated by  doxygen 1.6.2