# MIDI files and PIMap files

To play a MIDI file on the 3DO Station, you need the following files:

- The MIDI file itself

- The PIMap (program-instrument map file), which tells the 3DO system how to match MIDI numbers with sounds

- Compiled patches (.ins) or samples referred to in the PIMap

This section discusses the PIMap file format, including the currently supported flags and an example file.

## Working with PIMaps

A PIMap associates MIDI program numbers with 3DO instruments.

### Parts of a PIMap

A PIMap consists of several lines, separated by carriage returns. Each line contains:

- MIDI program number (1-128)
- Filename

  - If the filename ends in .aiff, .aif, or .aifc, it is considered to be the name of a sample file and the file is attached to the appropriate sample player instrument.

  - If the filename does not end in .aiff, .aif, or .aifc, it is assumed to be an instrument name. For example, if the file ends in .ins, it is a compiled ARIA patch.

- Optional flags

### Currently supported flags

The following table lists the flags that are currently supported as part of a PIMap:

    Table 1:  Flags in a PIMap.
    --------------------------------------------------------
    Flag   |Description
    --------------------------------------------------------
    -f     |Play sample file using a fixed-rate sample
           |player that uses fewer ticks than a
           |variable-rate player would
    --------------------------------------------------------
    -m n   |Set maximum number of voices (default is 1)
    --------------------------------------------------------
    -l n   |Set low note for a sample
    --------------------------------------------------------
    -b n   |Set base note for a sample
    --------------------------------------------------------
    -h n   |Set high note for a sample
    --------------------------------------------------------
    -p n   |Set priority for instrument, default = 100, max
           |= 200
    --------------------------------------------------------
    -d     |Set a detune value. This works only on
           |instruments that use the default sample playback
           |module (sampler.dsp); not on compiled ARIA
           |instruments.
    --------------------------------------------------------

Note: The base note is the "home" note of the sample and is not necessarily the lowest (bass) note.

### PIMap example

The example below shows a small PIMap file. The following points are of interest:

- The PIMap file assigns the appropriate samples to the different ranges of the instrument.

- Each .aiff file covers no more than a half octave, as you can see when you look at the low notes, base notes, and high notes assigned to the different .aiff files.

- The gong is fixed pitch.

- The clarinet is set up as a multisample with octave spacing.

- The organ has its MaxVoices set to 4 to make it possible to play chords.

- The sample bell.aiff is played by the instrument varmono16.dsp because the instrument is specified before the sample is specified.

- The instrument ending in .ins (windnoise.ins) is a compiled ARIA instrument.

Example 1: PIMap example file.

``

    1 clarinet1.aiff -l 30 -b 48 -h 53
    1 clarinet2.aiff -l 54 -b 60 -h 66
    1 clarinet3.aiff -l 67 -b 72 -h 84
    2 gong.aiff -f
    3 bass.aiff -p 150
    4 organ.aiff -m 4
    5 varmono16.dsp
    5 bell.aiff
    6 sawenv.dsp
    7 windnoise.ins

Note: In addition to .aiff files, you can also use instruments you previously created in ARIA (.ins files). The last line of the example above illustrates this.