Platform SDK: DirectX

Setting and Retrieving Global Parameters

[C++]

By using the IDirectMusicPerformance::SetGlobalParam and IDirectMusicPerformance::GetGlobalParam methods, you can set and retrieve parameters that affect the entire performance, rather than a single track.

The parameter to be set or retrieved is identified by a GUID in the rguidType parameter of the method. Each parameter is associated with a particular data type, whose size is given in the dwSize parameter. The predefined GUIDs and their data types are shown in the following table.

Parameter type GUID (rguidType)
and Data (*pParam)
Description
GUID_PerfAutoDownload
BOOL
This parameter controls whether instruments are automatically downloaded when a segment is played. By default, it is off. See Downloading and Unloading Bands.
GUID_PerfMasterGrooveLevel
char
The master groove level is a value that is always added to the groove level established by the command track. The resulting value is adjusted, if necessary, to fall within the range from 1 through 100.
GUID_PerfMasterTempo
float
The master tempo is a scaling factor that is applied to the tempo by the final output tool. By default, it is 1. A value of 0.5 would halve the tempo, and a value of 2.0 would double it. This value can be set in the range from DMUS_MASTERTEMPO_MIN through DMUS_MASTERTEMPO_MAX.
GUID_PerfMasterVolume
long
The master volume is an amplification or attenuation factor, in hundredths of a decibel, applied to the default volume of the entire performance. The range of permitted values is determined by the port. Legacy hardware MIDI ports do not support changing master volume.

Applications can also use custom types of global parameters. To create a new type, establish a GUID and a data type for it.

When a parameter is set, the performance allocates memory for the data in a linked list of items identified by GUID. The data can be retrieved by a call to IDirectMusicPerformance::GetGlobalParam. Even predefined parameters have to be set before they can be retrieved. GetGlobalParam fails if SetGlobalParam has never been called on the parameter.

[Visual Basic]

The DirectMusicPerformance class has the following methods for setting and retrieving global parameters, which affect the entire performance:

GetMasterAutoDownload
SetMasterAutoDownload
This parameter controls whether instruments are automatically downloaded when a segment is played. By default, it is off. See Downloading and Unloading Bands.
GetMasterGrooveLevel
SetMasterGrooveLevel
The master groove level is a value that is always added to the groove level established by the command track. The resulting value is adjusted, if necessary, to fall within the range from 1 through 100.
GetMasterTempo
SetMasterTempo
The master tempo is a scaling factor that is applied to the tempo by the final output tool. By default, it is 1. A value of 0.5 would halve the tempo, and a value of 2.0 would double it. This value can be set in the range from 0.25 through 2.0.
GetMasterVolume
SetMasterVolume
The master volume is an amplification or attenuation factor, in hundredths of a decibel, applied to the default volume of the entire performance. The range of permitted values is determined by the port. Legacy hardware MIDI ports do not support changing master volume.