DirectX SDK

DirectMusicPerformance.SetPort

The DirectMusicPerformance.SetPort method sets the active port for the performance. This method must be called after the performance is initialized and before any instruments are downloaded or any segment is played.

object.SetPort(index As Long, numGroups As Long)

Parameters

object
Object expression that resolves to a DirectMusicPerformance object.
index
Index of the port. Must be in the range from 1 through the value returned by DirectMusicPerformance.GetPortCount, or –1 for the default port.
numGroups
Number of channel groups on the port. Must be less than or equal to the number of channel groups reported in the lMaxChannelGroups member of the DMUS_PORTCAPS type returned by the DirectMusicPerformance.GetPortCaps method.

Remarks

Each channel group consists of 16 channels. Allocate enough channel groups to accommodate all performance channels in the segments that you intend to play. For MIDI files, one channel group is sufficient. The Microsoft Software Synthesizer supports up to 1000 channel groups.