Platform SDK: DirectX |
The DirectMusicBandDirectDownload method downloads the DLS data for instruments in the band to a performance object. Once a band has been downloaded, the instruments in the band can be selected, either individually with program change MIDI messages, or all at once by playing a band segment created through a call to the DirectMusicBand.CreateSegment method.
object.Download(performance As DirectMusicPerformance)
If the method fails, it raises an error, and Err.Number can be set to one of the following values:
DMUS_E_NOT_INIT |
DMUS_E_OUTOFMEMORY |
Because a downloaded band uses synthesizer resources, it should be unloaded when no longer needed by using the DirectMusicBand.Unload method.
In the current version of DirectMusic, this method may succeed even though the port does not support DLS.
If DMUS_E_NOT_INIT is raised, it usually means that the performance was not properly connected up to an initialized port. Since this is a complete failure, there is no need to call DirectMusicBand.Unload later.
If the download only partially succeeds, no error is raised but some instruments might not play. The following are some common causes of a partial download: