|

Authoring Guidelines
for Scalable Mobile Content: Mobile XMF, SP-MIDI, and Mobile DLS (PDF)
RMF - Composing for Mobile Devices (PDF)
SP-MIDI Best Practices
Note: This Best Practices Document was updated April, 2003, but was originally written for use without a dedicated SP-MIDI tool. Now that the Beatnik Mobile Sound Builder is available, please be aware that most of the steps below will be avoided or simplified.
SP-MIDI, the Scalable Polyphony variant of the Musical Instrument Digital Interface specification, defines a flexible method by which a MIDI file can play predictably on devices with varying capabilities. These devices may vary in terms of memory, processing speed, and may have different polyphony capabilities.
The following example illustrates how SP-MIDI works. For example, let's say a composer has written a song that contains piano, bass, drums, synth, and saxophone, with a maximum polyphony of 16 simultaneous voices. On a device capable of producing 16 voices of polyphony, all the instruments will play. If the piano and drums each use up to four simultaneous voices and the composer chooses to give those instruments the highest priority, they will both simultaneously play on an eight-voice device. If the piano was given the highest priority, a four-voice device will only play the piano part.
The SP-MIDI Specification presents information for both content creators and developers who wish to incorporate SP-MIDI into their products. This document provides content creators with the necessary information to create their own SP-MIDI files with the help of some Beatnik tools.
You'll learn:
- Basic concepts such as polyphony, MIP, and channel priority
- How to analyze a MIDI file's polyphony
- How to create a MIP message
- How to test the scaled versions
- Some advanced techniques using SP-MIDI
Basic Concepts
Polyphony
Polyphony generally refers to the number of MIDI voices simultaneously playing, which according to the SP-MIDI Specification, refers to how many MIDI notes are on at the same time. Note that some playback devices treat voices as the number of sounds, vs. MIDI notes, that are simultaneously present. For example, if you are using an instrument with a long release, even though the device has received a MIDI off message, SP-MIDI still treats the continued sound of the note as a voice in it's allocation.
Maximum Instantaneous Polyphony (MIP)
Maximum Instantaneous Polyphony specifies the total number of voices required for accurate playback of a given MIDI channel with all MIDI channels of higher priority. Each channel used in a SP-MIDI file requires a MIP value. Collectively, all the MIP values in a file make up the MIP table that represents a cumulative polyphony requirement based on each channel's priority, as defined by the content creator.
Channel Priority
Channel Priority is the composer-specified order in which channels are muted for playback on devices with different available polyphony.
MIP Message
The MIP Message is a Universal Real-time System Exclusive that contains the Channel Priority and MIP table information. When placed at the very beginning of a MIDI sequence, the MIP message tells the device that this sequence is SP-MIDI compliant and specifies how the device should playback the sequence.
Analyzing a MIDI File's Polyphony
On a channel-by-channel basis, analyze the maximum number of voices used. You can do this in your sequencer by looking through the piano roll and counting the maximum number of notes playing at the same time. Since this can be quite tedious, we recommend using the Beatnik Mobile Sound Builder to monitor polyphony. Each channel's peak and realtime polyphony is displayed clearly. Take a look at the MSB documentation for more details.
Creating MIP Messages
Once you know how many voices each channel uses, you need to decide the priority of your channels. Let's say you decide that no matter what, you always want to hear the piano. If piano is on channel 5, then channel 5 has a priority of one. Decide the priority of the remaining channels accordingly. Using the Beatnik Mobile Sound Builder, you can easily rearrange the priority of your channels, and the MIP values will be calculated accordingly, allowing you to skip the next step entirely.
Now, you need to calculate the MIP value for each channel. The table below shows that the MIP value for a particular channel is the maximum number of voices that could be played when that channel and all channels of a higher priority are playing. The combination of the channel priority and MIP is what tells the device which channels to play. For example, if a device is set to play only four voices, it will play only channel 5. However, if it is set to play eight voices, it will play channels 5 and 2, since the ten voices required to play all of the instruments exceeds the device capacity.
|
Channel priority
|
Instrument
|
Channel
|
Max polyphony/ channel
|
MIP
|
|
1
|
Piano
|
5
|
4
|
4
|
|
2
|
Flute
|
2
|
1
|
5
|
|
3
|
Percussion
|
10
|
5
|
10
|
Manual MIP Customization
You may want to adjust the MIP values to allow your file play on a wider range of devices. Using the above example, you may want to change the MIP of Channel 10 to eight, and rely on the device's own note-stealing algorithm to reduce the number of voices, if necessary. In Mobile Sound Builder, you can observe how many voices are actually used when all three channels are on. If that number never exceeds eight, then notes will not be stolen, and it is safe to change the MIP.
Putting it all together: The MIP Message Syntax
Once you have assembled all of the MIP values and decided on a channel priority, you will need to create a system exclusive command that contains this information, and place it at the beginning of your MIDI sequence.
In your MIDI sequencer, insert a system exclusive command at the beginning of your sequence and type in your MIP message based on the following syntax. Export the sequence as a .mid file and voila! You now have a SP-MIDI file! Remember - if you're using Mobile Sound Builder, you won't need to worry about any of this - the MIP message is automatically exported with the MIDI file.
The MIP Message Syntax looks like this
F0 7F <device ID> S1 S2 {cc vv}{cc vv} {cc vv}
{cc vv} {cc vv} F7
|
F0 7F
|
Universal Real Time SysEx header |
|
<device ID>
|
ID of target device (7F = all devices) |
|
S1
|
sub-ID#1 = 0B (Scalable Polyphony MIDI) |
|
S2
|
sub-ID#2 = 01 (MIP Message) |
|
cc
|
Midi channel number (0x00= ch 1, 0x01 = ch2, etc.) |
|
vv
|
Maximum Instantaneous Polyphony (MIP) value of the previous cc value |
|
F7
|
EOX |
Scalability Testing
In Mobile Sound Builder, you can set up Device Profiles to emulate different devices. Easily create a set of 5, 8, 16 and 32 vioce profiles and switch between them to make sure your SP-MIDI optimizations are what you expect!
Advanced Techniques
Using more than one MIP message
If your composition varies greatly from the beginning to the end, you may opt to insert more than one MIP Message in the sequence. The device will observe these messages and play the file accordingly. Place additional MIP Messages anywhere you want to change the way the device chooses which channels to play. In Mobile Sound Builder, you can copy an SP-MIDI Sysex message to your clipboard and bring it into your sequencer.
Build it from scratch
While these instructions give you an idea of how to reformat an existing file to work in a SPMIDI environment, a more flexible approach is to write a composition designed for SPMIDI from the beginning. When you are conscious of the need to limit voices, you will end up with a clean, versatile composition that will sound great on any device!
|