pgmassign Real-time MIDI:Input pgmassign pgmassign Assigns an instrument number to a specified MIDI program. Description Assigns an instrument number to a specified (or all) MIDI program(s). By default, the instrument is the same as the program number. If the selected instrument is zero or negative or does not exist, the program change is ignored. This opcode is normally used in the orchestra header. Although, like massign, it also works in instruments. Syntax pgmassign ipgm, inst[, ichn] pgmassign ipgm, "insname"[, ichn] Initialization ipgm -- MIDI program number (1 to 128). A value of zero selects all programs. inst -- instrument number. If set to zero, or negative, MIDI program changes to ipgm are ignored. Currently, assignment to an instrument that does not exist has the same effect. This may be changed in a later release to print an error message. insname -- A string (in double-quotes) representing a named instrument. ichn (optional, defaults to zero) -- channel number. If zero, program changes are assigned on all channels. You can disable the turning on of any instruments by using the following in the header: massign 0, 0 pgmassign 0, 0 Examples Here is an example of the pgmassign opcode. It uses the file pgmassign.csd. Example of the pgmassign opcode. See the sections Real-time Audio and Command Line Flags for more information on using command line flags. Here is an example of the pgmassign opcode that will ignore program change events. It uses the file pgmassign_ignore.csd. Example of the pgmassign opcode that will ignore program change events. Here is an advanced example of the pgmassign opcode. It uses the file pgmassign_advanced.csd. Do not forget that you must include the -F flag when using an external MIDI file like pgmassign_advanced.mid. An advanced example of the pgmassign opcode. See also MIDI input and Initialization Orchestra Header Statements Credits Author: &nameistvan; May 2002 New in version 4.20