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 and functions 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 (uint2 div);
  ~ScoreCreationInfo ();
  err_ind addTrack(const char* t, ioref n);
  int addRemainingTracks(ioref n);
  int addRemainingTracksAndLookupNodenames();
  void addMIDI_msg(const MIDI_msg& m);
  void addFunction(void (*func)(void*, ScorePlayer*), void* v, ScheduleTime t);
};
ScoreCreationInfo (FiledataPtr f)
Creates a ScoreCreationInfo which describes how to create a Score from f.
ScoreCreationInfo (uint2 div)
Creates a ScoreCreationInfo which does not use a Filedata; the Score is created from MIDI_msgs and functions alone. div is the number of ticks per quarter note. (Use a MIDI tempo message to specify the number of microseconds per MIDI quarter note, thus setting a relationship between ticks and real time. If no MIDI tempo message is present, the tempo defaults to 500000, which is 120 bpm.)
~ScoreCreationInfo ()
Destroys the ScoreCreationInfo.
err_ind addTrack(const char* t, ioref n)
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. 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)
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. 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()
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. 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 default 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.
void addFunction(void (*func)(void*, ScorePlayer*), void* v, ScheduleTime t)
This method will cause a call to func to be added to the Score produced from this ScoreCreationInfo. func will be called with v and a pointer to the ScorePlayer playing the Score. The function is inserted into the Score at the time t, where t is in units of ticks.

Modified 16 January 1996 pepellet@mit.edu