BASS MIDI

BASS_ATTRIB_MIDI_SRC attribute


The sample rate conversion quality of a MIDI stream's samples.

BASS_ChannelSetAttribute(
    DWORD handle,
    BASS_ATTRIB_MIDI_SRC,
    float quality
);

Parameters

handleThe MIDI stream handle.
qualityThe sample rate conversion quality... 0 = linear interpolation, 1 = 8 point sinc interpolation, 2 = 16 point sinc interpolation.

Remarks

The samples in a soundfont will usually need to be played at rates that are different to their original rates. This attribute determines how that is done. The linear interpolation option uses less CPU, but the sinc interpolation gives better sound quality (less aliasing), with the quality and CPU usage increasing with the number of points.

When this attribute setting is changed, the BASS_MIDI_SINCINTER flag is automatically set or unset on the MIDI stream accordingly, and vice versa. Changes can be made at any time, but the effect of changes during playback will not be heard instantaneously due to buffering.

Platform-specific

On Android and iOS, sinc interpolation requires a NEON supporting CPU. Sinc interpolation is not available on Windows CE. 16 point sinc interpolation is only available on Windows/OSX/Linux and requires an SSE2 supporting CPU.

See also

BASS_ChannelGetAttribute, BASS_ChannelSetAttribute, BASS_ATTRIB_SRC