SetPIMapEntry
Specifies the instrument to use when a MIDI program change occurs.
Synopsis
Err SetPIMapEntry( ScoreContext *scon, int32 ProgramNum,Item InsTemplate, int32 MaxVoices, int32 Priority )
Description
This function specifies the instrument type to use when a MIDI program change occurs.
This function directly sets a PIMap entry, assigning an instrument template, a maximum voice value, and an instrument priority to a MIDI program number. When a MIDI program change occurs, a new instrument specified by the instrument template is used for notes played after the program change.
The variable "ProgramNum" ranges from 0 to 127 (unlike some synthesizers, which range program numbers from 1 to 128). It must not exceed the number of programs allocated in CreateScoreContext()
.
Note that it's easier to create a full PIMap using LoadPIMap()
.
Arguments
- scon
- A pointer to the ScoreContext data structure whose PIMap is to be changed.
- ProgramNum
- Value indicating a program number, ranging from 0127; not to exceed the maximum number allocated in
CreateScoreContext()
.
- InsTemplate
- The item number of an instrument template.
- MaxVoices
- The maximum number of voices that can play simultaneously for this program.
- Priority
- An instrument priority value from 0 to 200.
Return Value
This function returns 0 if all went well; or an error code (less then 0) indicating that an error occurred.
Implementation
Library call implemented in music.lib V20.
Associated Files
score.h, music.lib
See Also
LoadPIMap
(), UnloadPIMap()