Score


A Score represents a sequence of MIDI messages which may be played by a ScorePlayer. Right now, the only way to create a Score is to read one from a file, but eventually there may be other ways to create and manipulate Scores.

class Score {
public:
  typedef PerChannel<bool> ChannelUseMap;
  typedef UtilPtr<ChannelUseMap> ChannelUseMapPtr;
  Score();
  Score(char*);
  Score(const Filedata*);
  Score(const Recorder*);
  ~Score();
  int getNumEvents() const;
  ScoreTime getLength() const;
  ChannelUseMapPtr getChannels() const;
};
Score()
This constructor creates an empty Score, which does nothing when played. Since there is currently to way to modify a Score, this is not very interesting.
Score(char* f)
This constructor creates a Score containing the data in the standard MIDI file f. This is just a convenience function to save the user from having to create a Filedata explicitly, but it does the same thing.
Score(const Filedata* f)
This contructor creates a Score from the data in f. The data from f is copied, so the user can free f anytime after the constructor returns. (This is why a UtilPtr is not needed.)
Score(const Recorder* r)
This contructor creates a Score from the data in r. The data from r is copied, so the user can free r anytime after the constructor returns. (This is why a UtilPtr is not needed.) r can continue to be used for recording data, but any new data recorded will not be reflected in this Score.
~Score()
The destructor destroys the Score.
int getNumEvents() const
This member function returns the total number of events in the Score.
ScoreTime getLength() const
This member function returns the total time length of the Score when played at the default speed.
ChannelUseMapPtr getChannels() const
This member function returns all of the virtual channels which the Score uses for each node.

Modified 26 October 1995 pepellet@mit.edu