BASS_ATTRIB_MUSIC_VOL_INST attribute

The volume level of an instrument in a MOD music.

BASS_ChannelSetAttribute(
    HMUSIC handle,
    BASS_ATTRIB_MUSIC_VOL_INST + inst,
    float volume
);

Parameters

handleThe MOD music handle.
instThe instrument to set the volume of... 0 = 1st instrument.
volumeThe volume level... 0 (silent) to 1 (full).

Remarks

The volume curve used by this attribute is always linear, eg. 0.5 = 50%. The BASS_CONFIG_CURVE_VOL config option setting has no effect on this. The volume level of all instruments is initially 1 (full). For MOD formats that do not use instruments, read "sample" for "instrument".

During playback, the effect of changes to this attribute are not heard instantaneously, due to buffering. This latency can be reduced via the BASS_ATTRIB_BUFFER attribute.

This attribute can also be used to count the number of instruments in a MOD music.

Example

Count the number of instruments in a MOD music.
int instruments = 0;
float dummy;
while (BASS_ChannelGetAttribute(music, BASS_ATTRIB_MUSIC_VOL_INST + instruments, &dummy))
    instruments++;

See also

BASS_ChannelGetAttribute, BASS_ChannelSetAttribute, BASS_ChannelSlideAttribute, BASS_ATTRIB_MUSIC_VOL_CHAN