Purpose: Stores specific information of a system
MIDI port
Declaration:
typedef
struct INFOPORT {
TCHAR
szPortDescription[DMUS_MAX_DESCRIPTION];
DWORD
dwFlags;
DWORD dwClass;
DWORD
dwType;
DWORD dwMemorySize;
DWORD
dwMaxAudioChannels;
DWORD
dwMaxVoices;
DWORD dwMaxChannelGroups
;
DWORD dwSampleRate;
DWORD
dwEffectFlags;
DWORD dwfShare;
DWORD
dwFeatures;
GUID guidSynthGUID;
}
*LPINFOPORT;
Members:
szPortDescription: String
description of the port in UNICODE/MBCS chars
dwFlags: Port
characteristics
DMUS_PC_AUDIOPATH
Multiple outputs can be connected
to DirectSound for audiopaths.
DMUS_PC_DIRECTSOUND
The port supports streaming wave
data to DirectSound.
DMUS_PC_DLS
The port supports DLS Level 1 sample
collections.
DMUS_PC_DLS2
The port supports DLS Level 2 sample
collections.
DMUS_PC_EXTERNAL
The port connects to devices
outside the host
for example, devices connected over
an external MIDI port such as the MPU-401.
DMUS_PC_GMINHARDWARE
The synthesizer has its own GM
instrument set,
so GM instruments do not need to be
downloaded.
DMUS_PC_GSINHARDWARE
This port contains the Roland
GS sound set in hardware.
DMUS_PC_MEMORYSIZEFIXED
Memory available for DLS
instruments cannot be adjusted.
DMUS_PC_SHAREABLE
More than one port can be created
that uses the same range of channel
groups on the
device. Unless this bit is set, the port can be opened
only
in exclusive mode. In exclusive mode, an
attempt to create a port fails
unless free channel
groups are available to assign to the create
request.
DMUS_PC_SOFTWARESYNTH
The port is a software
synthesizer.
DMUS_PC_WAVE
Streaming and one-shot waves are
supported.
DMUS_PC_XGINHARDWARE
The port contains the Yamaha XG
extensions in hardware
dwClass:
DMUS_PC_INPUTCLASS
Input
port.
DMUS_PC_OUTPUTCLASS
Output
port.
dwType:
DMUS_PORT_WINMM_DRIVER
Windows multimedia
driver.
DMUS_PORT_USER_MODE_SYNTH
User-mode
synthesizer.
DMUS_PORT_KERNEL_MODE
WDM
driver.
dwMemorySize:
Amount of memory available to store DLS
instruments. If the port is using system memory and the amount is
therefore
limited only by the available system
memory, this member contains DMUS_PC_SYSTEMMEMORY.
dwMaxAudioChannels:
Maximum number of
audio channels that can be rendered by the port.
The value
can be -1 if the driver does not support returning this
parameter.
dwMaxVoices:
Maximum
number of voices that can be allocated when this port is
opened.
The value can be -1 if the driver does not
support returning this
parameter.
dwMaxChannelGroups:
Maximum number of audio channels that can be rendered by the
port.
The value can be -1 if the driver does not
support returning this parameter.
dwSampleRate:
Desired sample rate, in hertz.
dwEffectFlags:
DMUS_EFFECT_NONE
No effects are
supported.
DMUS_EFFECT_REVERB
The port supports
reverb.
DMUS_EFFECT_CHORUS
The port supports
chorus.
dwfShare:
If TRUE, all ports
use the channel groups assigned to this port. If FALSE, the port is opened in
exclusive mode, and the use of the same channel groups by other ports is
forbidden.
dwFeatures:
DMUS_PORT_FEATURE_AUDIOPATH: Supports an audiopath connection to DirectSound buffers.
DMUS_PORT_FEATURE_STREAMING: Supports streaming waveforms through the synthesizer.
guidSynthGUID:
Identifier of the port.
This value can be passed to
the IDirectMusic8::CreatePort method to get
an
IDirectMusicPort8 interface for the port.
Purpose: Stores information of an
instrument loaded from a DLS file
Declaration:
typedef
struct INSTRUMENTINFO {
TCHAR
szInstName[MAX_PATH];
DWORD
dwPatchInCollection;
} *LPINSTRUMENTINFO;
Members:
szInstName: Null
terminated string indicating the name of the instrument in UNICODE/MBCS
chars
dwPatchInCollection: Index of the instrument in the
collection
Purpose: Stores information of a system
clock
Declaration:
typedef struct
CLOCKINFO {
DMUS_CLOCKTYPE ctType;
GUID guidClock;
TCHAR szClockDescription[DMUS_MAX_DESCRIPTION];
DWORD dwFlags;
} *LPCLOCKINFO;
Members:
ctType: Type of clock. Can be one of these constants:
DMUS_CLOCK_SYSTEM: Clock is the system clock
DMUS_CLOCK_WAVE: Clock is on a waveform-playback device
guidClock: The clock GUID
szClockDescription: MBCS/UNICODE chars containing the clock description
dwFlags: Flags. Can be 0 or DMUS_CLOCKF_GLOBAL
Purpose: Keeps the current running status of a synthesizer
Declaration:
typedef struct
SYNTHSTATS {
DWORD dwSize;
DWORD dwValidStats;
DWORD dwVoices;
DWORD dwTotalCPU;
DWORD dwCPUPerVoice;
DWORD dwLostNotes;
DWORD dwFreeMemory;
long lPeakVolume;
DWORD dwSynthMemUse;
} *LPSYNTHSTATS;
Members:
dwSize: Size in bytes of the structure
dwValidStats:
Flags that specify which fields in this structure have been filled in by the synthesizer. The following flags have been defined:
DMUS_SYNTHSTATS_VOICES
DMUS_SYNTHSTATS_TOTAL_CPU
DMUS_SYNTHSTATS_CPU_PER_VOICE
DMUS_SYNTHSTATS_FREE_MEMORY
DMUS_SYNTHSTATS_LOST_NOTES
DMUS_SYNTHSTATS_PEAK_VOLUME
dwVoices: Average number of voices playing
dwTotalCPU: Total percentage of the CPU being consumed, multiplied by 100
dwCPUPerVoice: Percentage of the CPU being consumed per voice, multiplied by 100
dwLostNotes: Number of notes lost. Notes can be dropped because of voice-stealing or because too much of the CPU is being consumed
dwFreeMemory: Amount of
memory currently available to store
lPeakVolume: Peak volume, measured in hundredths of decibels
dwSynthMemUse: Memory used by synthesizer waveform data
Purpose: Stores region data for a DLS download
Declaration:
typedef struct
REGION {
RGNRANGE RangeKey;
RGNRANGE RangeVelocity;
} *LPREGION;
Members:
RangeKey: Key range where the instrument must respond
RangeVelocity: Velocity range that the instrument must respond
Purpose: Keeps the instrument articulation parameters
Delcaration:
typedef struct
ARTICPARAMS {
DMUS_LFOPARAMS LFO;
DMUS_VEGPARAMS VolEG;
DMUS_PEGPARAMS PitchEG;
DMUS_MSCPARAMS Misc;
} *LPARTICPARAMS;
Members:
LFO: defines the low-frequency oscillator for a DLS articulation
Members
pcFrequency
Frequency, in pitch units. See Remarks.
tcDelay
Initial delay, in time cents. See Remarks.
gcVolumeScale
Scaling of output to control tremolo, in attenuation units. See Remarks.
pcPitchScale
Scaling of LFO output to control vibrato, in pitch units. See Remarks.
gcMWToVolume
Modulation wheel range to control tremolo, in attenuation units. See Remarks.
pcMWToPitch
Modulation wheel range to control tremolo, in attenuation units. See Remarks.
VolEG: Defines a volume envelope for a DLS level 1 articulation
Members
tcAttack
Attack time, in time cents. See Remarks.
tcDecay
Decay time, in time cents. See Remarks.
ptSustain
Sustain, in hundredths of a percent and shifted left by 16.
tcRelease
Release time, in time cents. See Remarks.
tcVel2Attack
Velocity to attack, in time cents. See Remarks.
tcKey2Decay
Key to decay, in time cents. See Remarks.
PitchEG: Defines the pitch envelope for a DLS level 1 articulation
Members
tcAttack
Attack time, in time cents. See Remarks.
tcDecay
Decay time, in time cents. See Remarks.
ptSustain
Sustain, in hundredths of a percent shifted left by 16.
tcRelease
Release time, in time cents. See Remarks.
tcVel2Attack
Velocity to attack, in time cents. See Remarks.
tcKey2Decay
Key to decay, in time cents. See Remarks.
pcRange
Envelope range, in pitch units. See Remarks.
Misc: Defines the pan for a DLS articulation
Members
ptDefaultPan
Default pan, ranging from –50 through 50 percent, in units of 0.1 percent shifted left by 16.
Remarks
The DLS Level 1 specification defines time cents, pitch cents, and attenuation as 32-bit logarithmic values. See the specification from the MIDI Manufacturers Association for details. For further information see the MMA DLS 1.0 specification document