Share via


WAVEFORMAT_MIDI_MESSAGE

The WAVEFORMAT_MIDI_MESSAGE structure specifies the timing information of a MIDI file.

Syntax

typedef struct _WAVEFORMAT_MIDI_MESSAGE {
  UINT32 DeltaTicks;
  DWORD MidiMsg;
} WAVEFORMAT_MIDI_MESSAGE;

Members

  • DeltaTicks
    Number of ticks to wait before playing a message after the previous message has finished playing.

  • MidiMsg
    32-bit MIDI message value that is consistent with the MIDI messages used in desktop-based operating systems. The message is packed into a DWORD value with the first byte of the message in the low-order byte range, as indicated in the following table.

    Word Byte Usage
    High High-order Must be 0.
    High Low-order The second byte of MIDI data (optional).
    Low High-order The first byte of MIDI data (optional).
    Low Low-order The MIDI status.

    The two MIDI data bytes are optional depending on the MIDI status byte. When a series of messages have the same status byte, you can omit the status byte from each message after the first in the series, creating a running status. Running status messages should be packed as indicated in the following table.

    Word Byte Usage
    High High-order Must be 0.
    High Low-order Not used.
    Low High-order The second byte of MIDI data (optional).
    Low Low-order The first byte of MIDI data.

    The high-order byte of the DWORD value is also used for proprietary messages by storing into the DWORD value one of the message values described in the following table.

    Value Description
    MIDI_MESSAGE_UPDATETEMPO Tells the MIDI player to update the tempo based on the rate specified within the MIDI file. The lower 24 bits (bits 23–0) of this value contain the new setting to be used as m_USecPerQuarterNote.
    MIDI_MESSAGE_FREQGENON Starts playing a sine wave at the specified frequency. Bits 15–0 contain the value of the frequency to be played, and bits 22–16 contain the 7-bit velocity (volume) to be used. (A velocity of 0 indicates the frequency should be turned off.)
    MIDI_MESSAGE_FREQGENOFF Stops playing the specified frequency. Bits 15–0 contain the frequency value to be stopped.

Requirements

Smartphone: Windows Mobile 2002 and later
OS Versions: Windows CE 3.0 and later
Header: wfmtmidi.h

See Also

WAVEFORMAT_MIDI

Last updated on Friday, April 22, 2005

© 2005 Microsoft Corporation. All rights reserved.

Send feedback on this topic to the authors.