The processing granularity of a channel.
BASS_ChannelSetAttribute( DWORD handle, BASS_ATTRIB_GRANULE, float unit );
|handle||The channel handle... a HMUSIC, HSTREAM, HRECORD.|
|unit||The processing unit size in sample frames... 0 = none.|
Each processing cycle will be on a whole number of units, not necessarily only one unit, and the number of units can vary between cycles depending on how much space there is in the channel's playback buffer (or captured data in a recording buffer). There might not be a whole number of units at the end of a file or when a stream stalls.
When granularity is enabled (non-0), it can change the timing of any DSP/FX changes that are made in mixtime sync callbacks. That is because the DSP/FX processing is done on the entire block of data at the end of the processing cycle then (rather than splitting it at the sync positions), to maintain the specified granularity, resulting in the changes effectively being applied at the start of the processing cycle.
The default value is 0 (none). Changes take immediate effect.
BASS_ChannelSetAttribute(stream, BASS_ATTRIB_GRANULE, 512);