# MFLoadCollection

Loads a set of sequences from a MIDI file.

### Synopsis

`Err MFLoadCollection( MIDIFileParser *mfpptr, char *filename, Collection *ColPtr )`

### Description

This function loads a set of sequences from a Format 1 MIDI file and turns them into a Juggler collection for playback using the Juggler. To use this function, you must first create a Juggler collection using `CreateObject()`. The function then creates an appropriate number of Juggler sequences to contain the sequences found in the MIDI file.

The function translates the MIDI messages in each file sequence into MIDI events in appropriate Juggler sequences within the collection. To work, the function must have a MIDIFileParser data structure to keep track of the MIDI sequence's original settings.

Note that this function also accept Format 0 MIDI files, treating them as a one-track Format 1 MIDI file.

### Arguments

mfpptr
  Pointer to a MIDIFileParser data structure.

filename
  Pointer to a character string containing the name of the Format 1 MIDI file from which to load the sequences.

ColPtr
  Pointer to a Juggler collection in which to store the converted MIDI sequences.

### Return Value

This function returns 0 if successful or an error code (a negative value) if an error occurs.

### Implementation

Library call implemented in music.lib V20.

### Associated Files

score.h, music.lib

### See Also

``CreateObject`(), MFLoadSequence(), MFUnloadCollection()`