# Function Calls

These Music library function calls import and play back MIDI score files.

## MIDI Environment Calls

The following calls control setup of the MIDI environment:

- `CreateScoreContext()` Allocates a score context.
- `DeleteScoreContext()` Deletes a score context.
- `InitScoreDynamics()` Sets up dynamic voice allocation.
- `InitScoreMixer()` Creates and initializes a mixer instrument for MIDI score playback.
- `LoadPIMap()` Loads a program-instrument map from a text file.
- `SetPIMapEntry()` Specifies the instrument to use when a MIDI program change occurs.
- `TermScoreMixer()` Dispose of mixer created by `InitScoreMixer().`
- `UnloadPIMap()` Unloads instrument templates loaded previously with PIMap file.

## MIDI Score Calls

The following calls are used to handle MIDI scores:

- `InterpretMIDIEvent()` Interprets MIDI events within a MIDI object.
- `MFDefineCollection()` Creates a Juggler collection from a MIDI file image in RAM.
- `MFLoadCollection()` Loads a set of sequences from a MIDI file.
- `MFLoadSequence()` Loads a sequence from a MIDI file.
- `MFUnloadCollection()` Unloads a MIDI collection.

## MIDI Playback Calls

The following calls handle playback of MIDI:

- `ChangeScoreControl()` Changes a MIDI control value for a channel.
- `ChangeScoreProgram()` Changes the MIDI program for a channel.
- `InterpretMIDIMessage()` Executes a MIDI message.
- `NoteOffIns()` Turns off a note played by an instrument.
- `NoteOnIns()` Turns on a note for an instrument.
- `ReleaseScoreNote()` Releases a MIDI note, uses voice allocation.
- `StartScoreNote()` Starts a MIDI note, uses voice allocation.
- `StopScoreNote()` Stop a MIDI note without releasing it. Uses voice allocation.