BASS_ATTRIB_MIDI_TRACK_VOL attribute
The volume level of a track in a MIDI stream.
BASS_ChannelSetAttribute( HSTREAM handle, BASS_ATTRIB_MIDI_TRACK_VOL + track, float volume );
Parameters
handle | The MIDI stream handle. |
track | The track to set the volume of... 0 = first track. |
volume | The volume level... 0 = silent, 1.0 = normal/default. |
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.During playback, the effect of changes to this attribute are not heard instantaneously, due to buffering. To reduce the delay, use the BASS_CONFIG_BUFFER config option to reduce the buffer length.
This attribute can also be used to count the number of tracks in a MIDI file stream. MIDI streams created via BASS_MIDI_StreamCreate do not have any tracks.
Example
Count the number of tracks in a MIDI stream.int tracks=0; float dummy; while (BASS_ChannelGetAttribute(handle, BASS_ATTRIB_MIDI_TRACK_VOL+tracks, &dummy;)) tracks++;
See also
BASS_MIDI_StreamEventBASS_ChannelGetAttribute, BASS_ChannelSetAttribute, BASS_ChannelSlideAttribute