ScoreCreationInfo


A ScoreCreationInfo is an object which describes how to create a Score from a Filedata. It allows a great deal of control over what is done with each track, and also allows additional MIDI_msgs to be inserted. The basic way you would use a ScoreCreationInfo is to create a ScoreCreationInfo from a Filedata, then call the various methods of ScoreCreationInfo to add tracks from the Filedata, or individual MIDI_msgs, and then you would create a Score from the ScoreCreationInfo.

class ScoreCreationInfo {
  ScoreCreationInfo (FiledataPtr f);
  ~ScoreCreationInfo ();
  err_ind addTrack(const char* t, ioref n, uint2 sp);
  int addRemainingTracks(ioref n, uint2 sp);
  int addRemainingTracksAndLookupNodenames(uint2 sp);
  void addMIDI_msg(const MIDI_msg& m);
ScoreCreationInfo (FiledataPtr f)
Creates a ScoreCreationInfo which describes how to create a Score from f. If you wish to create a Score from MIDI_msgs alone, you may specify NULL as the FiledataPtr.
~ScoreCreationInfo ()
Destroys the ScoreCreationInfo.
err_ind addTrack(const char* t, ioref n, uint2 sp)
Causes the track named t to be added to the Score which will be created from this ScoreCreationInfo. All the MIDI_msgs added from t will have their node member initialized to n and their special member initialized to sp. Returns no_err if a track named t exists, and err if it does not. It is not an error to add the same track more than once, although it has no effect.
int addRemainingTracks(ioref n, uint2 sp)
Causes all of the tracks which have not already been added using addTrack() to be added to the Score which will be created from this ScoreCreationInfo. All the MIDI_msgs added from these tracks will have their node member initialized to n and their special member initialized to sp. Returns the number of tracks which addRemainingTracks added. (i. e. the number of tracks which had not already been added.) Calling addRemainingTracks additional times will return zero and have no effect.
int addRemainingTracksAndLookupNodenames(uint2 sp)
Causes all of the tracks which have not already been added using addTrack() to be added to the Score which will be created from this ScoreCreationInfo. All the MIDI_msgs added from these tracks will have their special member initialized to sp. For each track, addRemainingTracksAndLookupNodenames will use oap->output_refnum() to attempt to find a node which has the same name as the track. If such a node exists, the node member of each MIDI_msg in the track will be initialized to that node; otherwise it will be initialized to the deafault node. Returns the number of tracks which addRemainingTracksAndLookupNodenames added. (i. e. the number of tracks which had not already been added.) Calling addRemainingTracksAndLookupNodenames additional times will return zero and have no effect.
void addMIDI_msg(const MIDI_msg& m)
This method will causes the MIDI_msg m to be added to the Score produced from this ScoreCreationInfo. All of the members are assumed to be already initialized; none of the members are changed. The time member is interpreted to be a time in units of ticks, and determines where in the Score the MIDI_msg will be inserted.

Modified 15 January 1996 pepellet@mit.edu