Microsoft DirectX 8.1 (Visual Basic)

DirectMusicPerformance8

The DirectMusicPerformance8 class overall manager of music playback. The performance maps performance channels to audiopaths, plays segments, dispatches messages, requests and receives event notifications, and sets and retrieves music parameters. It also has several methods for getting information about timing and for converting time and music values from one system to another.

If an application wants to have two or more complete sets of music playing at the same time, it can do so by creating more than one performance object. Separate performances obey separate tempo maps and play completely asynchronously, whereas all segments within one performance play in lock step.

The DirectMusicPerformance8 object is obtained by using the DirectX8.DirectMusicPerformanceCreate method.

The DirectMusicPerformance8 class has the following methods.

Audiopaths

Method Description
CreateAudioPath Creates an audiopath object from a configuration.
CreateStandardAudioPath Creates an audiopath object of a standard type.
GetDefaultAudioPath Retrieves the default audiopath.
SetDefaultAudioPath Sets and activates the default audiopath for the performance.

Initialization and Cleanup

Method Description
InitAudio Initializes the performance and optionally sets up a default audiopath.
CloseDown Closes down the performance.

Messages

Method Description
SendCurvePMSG Sends a performance message containing information about a controller curve.
SendMIDIPMSG Sends a performance message containing information about a MIDI channel message not covered by other methods.
SendNotePMSG Sends a performance message containing information about a note.
SendPatchPMSG Sends a performance message containing information about a MIDI patch change.
SendTempoPMSG Sends a performance message containing information about a tempo change.
SendTimeSigPMSG Sends a performance message containing information about a time signature.
SendTransposePMSG Sends a performance message causing a transposition to begin.

Notification

Method Description
AddNotificationType Causes the performance to generate notification messages whenever events of the requested type occur.
GetNotificationPMSG Retrieves a pending notification message.
RemoveNotificationType Removes a previously added notification type from the performance.
SetNotificationHandle Sets the event handle for notifications.

Parameters

Method Description
GetChordmap Retrieves the chordmap from the performance's control segment.
GetCommand Retrieves a command from the performance's control segment.
GetGrooveLevel Retrieves the groove level from the performance's control segment.
GetMasterAutoDownload Retrieves the setting for automatic downloading of instruments.
GetMasterGrooveLevel Retrieves the value added to all groove levels in the performance.
GetMasterTempo Retrieves a scaling factor that is applied to the tempo.
GetMasterVolume Retrieves the master volume.
GetStyle Retrieves the style underlying the control segment at a given time.
GetTempo Retrieves the tempo at a given time.
GetTimeSig Retrieves the time signature at a given time.
SetMasterAutoDownload Turns automatic downloading of instruments on or off.
SetMasterGrooveLevel Sets a value to be added to all groove levels in the performance.
SetMasterTempo Sets a scaling factor that is applied to the tempo.
SetMasterVolume Adjusts the master volume of the performance.

Segments

Method Description
GetSegmentState Retrieves an object representing the play state of the primary segment.
IsPlaying Ascertains whether a particular segment or segment state is currently playing at the speakers.
PlaySegmentEx Begins playback of a segment.
StopEx Stops playback of an object.

Timing

Method Description
AdjustTime Adjusts the internal performance time forward or backward.
ClockToMusicTime Converts clock time to music time.
GetBumperLength Retrieves the amount of time between the time at which messages are placed in the port buffer and the time at which they begin to be processed by the port.
GetClockTime Retrieves the current time.
GetLatencyTime Retrieves the current latency time.
GetMusicTime Retrieves the current time of the performance, in music time.
GetPrepareTime Retrieves the approximate interval between the time at which messages are prepared and the time at which they are processed and heard.
GetQueueTime Retrieves the current queue (or flush) time.
GetResolvedTime Adjusts a given time to a given boundary.
MusicToClockTime Converts time in music time format to time in clock time format.
SetBumperLength Sets the amount of time between the time at which messages are placed in the port buffer and the time at which they begin to be processed by the port.
SetPrepareTime Sets the approximate interval between the time at which messages are prepared and the time at which they are processed and heard.

Miscellaneous

Method Description
Invalidate Flushes all queued messages whose time stamps are later than the supplied time and causes all tracks of all segments to resend their data from the given time forward.
Reset Resets the port.