The MIDI sequencer supports the following set of commands:
MIDI Sequencer
Command | Description |
capability item | Requests information about the capabilities of the MIDI sequencer. One of the following items is required: |
can eject Returns false. Sequencers cannot eject. | |
can play Returns true. | |
can record Returns true if the sequencer can record MIDI data. The MCISEQ sequencer cannot record and returns false. | |
can save Returns true if the sequencer can save MIDI data. The MCISEQ sequencer cannot save data and returns false. | |
compound device Returns true; sequencers are compound devices. | |
device type Returns sequencer. | |
has audio Returns true. Sequencers support playback. | |
has video Returns false. Sequencers do not support video. | |
uses files Returns true. Sequencers use files for operation. | |
close | Closes the sequencer element and the port and file associated with it. |
info item | Fills a user-supplied buffer with information. One of the following optional item modifies info: |
product Returns the product name of the sequencer. The MCISEQ sequencer returns MIDI Sequencer. | |
open items | Initializes the sequencer. The following optional items modify open: |
alias device_ alias Specifies an alternate name for the sequencer element. If specified, it must also be used for subsequent references. | |
shareable Initializes the sequencer element as shareable. Subsequent attempts to open it fail unless you specify shareable in both the original and subsequent open commands. MCI returns an invalid device error if it is already open and not shareable. Files cannot be shared when using the MCISEQ sequencer. | |
type device_ type Specifies the device type of the device element. MCI reserves sequencer for the MIDI sequencer device type. As an alternative to type, MCI can use the [mci extension] entries in the SYSTEM.INI file to select the sequencer based on the extension used by the device element. | |
pause | Pauses playing. |
play items | Starts playing the sequencer. The following optional items modify play: |
from position to position Specifies the positions to start and stop playing. If from is omitted, play starts at the current position; if to is omitted, play stops at the end of the file. | |
record items | Starts recording MIDI data. All data recorded after a file is opened is discarded if the file is closed without saving it. (The MCISEQ sequencer does not support recording.) The following optional items modify record: |
insert Specifies that new data is added to the device element. | |
from position to position Specifies the positions to start and stop recording. If from is omitted, the device starts recording at the current position; if to is omitted, the device records until a stop or pause command is received. | |
overwrite Specifies that new data will replace data in the device element. | |
resume | Resumes playing or recording. The MCISEQ sequencer does not support this option. |
save item | Saves the MCI element. (The MCISEQ sequencer does not support this option.) The following item modifies save: |
filename The filename specifies the destination path and file. | |
seek item | Moves to the specified position in the file. One of the following items is required: |
to position Specifies the final position for the seek. | |
to start Specifies to seek to the start of the sequence. | |
to end Specifies to seek to the end of the sequence. | |
set items | Sets the various control items: |
audio all off, audio all on Enables or disables audio output. The MCISEQ sequencer does not support this option. | |
audio left off, audio left on Enables or disables output to the left audio channel. The MCISEQ sequencer does not support this option. | |
audio right off, audio right on Enables or disables output to the right audio channel. The MCISEQ sequencer does not support this option. | |
master MIDI Sets the MIDI sequencer as the synchronization source. Synchronization data is sent in MIDI format. The MCISEQ sequencer does not support this option. | |
master none Inhibits the sequencer from sending synchronization data. The MCISEQ sequencer does not support this option. | |
master SMPTE Sets the MIDI sequencer as the synchronization source. Synchronization data is sent in SMPTE format. The MCISEQ sequencer does not support this option. | |
offset time Sets the SMPTE offset time. The offset is the beginning time of a SMPTE based sequence. The time is expressed as hh:mm:ss:ff, where hh is hours, mm is minutes, ss is seconds, and ff is frames. | |
port port_number Sets the MIDI port receiving the MIDI messages. This command will fail if the port you are trying to open is being used by another application. | |
port mapper Sets the MIDI mapper as the port receiving the MIDI messages. This command will fail if the MIDI mapper or a port it needs is being used by another application. | |
port none Disables the sending of MIDI messages. This command also closes a MIDI port. | |
slave file Sets the MIDI sequencer to use file data as the synchronization source. This is the default. | |
slave MIDI Sets the MIDI sequencer to use incoming data MIDI for the synchronization source. The sequencer recognizes synchronization data with the MIDI format. The MCISEQ sequencer does not support this option. | |
slave none Sets the MIDI sequencer to ignore synchronization data. | |
slave SMPTE Sets the MIDI sequencer to use incoming MIDI data for the synchronization source. The sequencer recognizes synchronization data with the SMPTE format. The MCISEQ sequencer does not support this option. | |
tempo tempo_value Sets the tempo of the sequence according to the current time format. For a ppqn-based file, the tempo_value is interpreted as beats per minute. For a SMPTE-based file, the tempo_value is interpreted as frames per second. | |
time format milliseconds Sets the time format to milliseconds. All position information is specified as milliseconds following this command. The sequence file sets the default format to ppqn or SMPTE. You can abbreviate milliseconds as ms. | |
time format song pointer Sets the time format to song pointer (sixteenth notes). This can only be performed for a sequence of division type ppqn. | |
time format SMPTE 24 Sets the time format to SMPTE 24 frame rate. All position information is specified in SMPTE format following this command. The sequence file sets the default format to ppqn or SMPTE. | |
time format SMPTE 25 Sets the time format to SMPTE 25 frame rate. All position information is specified in SMPTE format following this command. The sequence file sets the default format to ppqn or SMPTE. | |
time format SMPTE 30 Sets the time format to SMPTE 30 frame rate. All position information is specified in SMPTE format following this command. The sequence file sets the default format to ppqn or SMPTE. | |
time format SMPTE 30 drop Sets the time format to SMPTE 30 drop frame rate. All position information is specified in SMPTE format following this command. The sequence file sets the default format to ppqn or SMPTE. | |
status item | Obtains status information for the MIDI sequencer. One of the following items modifies status: |
current track Returns the current track number. The MCISEQ sequencer returns 1. | |
division type Returns one of the following file division type: PPQN, SMPTE 24 frame, SMPTE 25 frame, SMPTE 30 drop frame, or SMPTE 30 frame. Use this information to determine the format of the MIDI file, and the meaning of tempo and position information. | |
length Returns the length of a sequence in the current time format. For ppqn files, this will be song pointer units. For SMPTE files, this will be expressed as hh:mm:ss:ff, where hh is hours, mm is minutes, ss is seconds, and ff is frames. | |
length track track_number Returns the length of the sequence in the current time format. For ppqn files, this will be song pointer units. For SMPTE files, this will be expressed as hh:mm:ss:ff, where hh is hours, mm is minutes, ss is seconds, and ff is frames. | |
master Returns midi, none, or smpte depending on the type of synchronization set. | |
media present The sequencer returns true. | |
mode Returns not ready, paused, playing, seeking, or stopped. | |
number of tracks Returns the number of tracks. MCISEQ returns 1. | |
offset Returns the offset of a SMPTE-based file. The offset is the start time of a SMPTE based sequence. The time is returned as hh:mm:ss:ff, where hh is hours, mm is minutes, ss is seconds, and ff is frames. | |
port Returns the MIDI port number assigned to the sequence. | |
position Returns the current position of a sequence in the current time format. For ppqn files, this will be song pointer units. For SMPTE files, this will be in colon form hh:mm:ss:ff, where hh is hours, mm is minutes, ss is seconds, and ff is frames. | |
position track track_number Returns the current position of the track specified by track_number in the current time format. For ppqn files, this will be song pointer units. For SMPTE files, this will be in colon form hh:mm:ss:ff, where hh is hours, mm is minutes, ss is seconds, and ff is frames. The MCISEQ sequencer returns 0. | |
ready Returns true if the device is ready. | |
slave Returns file, midi, none, or smpte depending on the type of synchronization set. | |
start position Returns the starting position of the media or device element. | |
tempo Returns the current tempo of a sequence in the current time format. For files with ppqn format, the tempo is in beats per minute. For files with SMPTE format, the tempo is in frames per second. | |
time format Returns the time format. | |
stop | Stops playing. |