BASS_CONFIG_MIDI_VOICES config option

The maximum number of samples to play at a time.

BASS_SetConfig(
    BASS_CONFIG_MIDI_VOICES,
    DWORD voices
);

Parameters

voicesMaximum number of samples to play at a time... 1 (min) - 100000 (max).

Remarks

This setting determines the maximum number of samples that can play together in a single MIDI stream. This is not necessarily the same thing as the maximum number of notes, due to presets possibly containing multiple layered samples, ie. multiple samples may be played for a single note. When the voice limit is hit, the voice with the lowest volume level will be killed, which will usually be one that is already fading out following a note release.

The more voices that are used, the more CPU that is required. So this option can be used to restrict that, for example on a lower spec system. The BASS_ATTRIB_MIDI_CPU attribute can also be used to limit CPU usage.

Changing this setting only affects subsequently created MIDI streams, not any that already exist. The voice limit of an existing MIDI stream can be changed via the BASS_ATTRIB_MIDI_VOICES attribute.

Platform-specific

The default setting is 100, except on Android and iOS where it is 40, and Windows CE where it is 30. The maximum setting is 1000 on those 3 platforms.

See also

BASS_MIDI_StreamCreateFile, BASS_ATTRIB_MIDI_CPU, BASS_ATTRIB_MIDI_VOICES

BASS_GetConfig, BASS_SetConfig