external/libmodplug-0.8.9.0/src/load_pat.cpp
// return relative position in samples for the rate starting with offset start ending with offset end
return relative position in samples for the rate starting with offset start ending with offset end
return relative position in samples for the rate starting with offset start ending with offset end
static int pat_envelope_rpos(int rate, int start, int end)
{
	int r, p, t, s;
	r = 3 - ((rate >> 6) & 3) * 3;
	p = rate & 0x3f;
	if( !p ) return 0;
	t = end - start;
	if( !t ) return 0;
	if (t < 0) t = -t;
	s = (t << r)/ p;
	return s;
}
static int pat_envelope_rpos ( int rate , int start , int end ) { int r , p , t , s ; r = 3 - ( ( rate >> 6 ) & 3 ) * 3 ; p = rate & 0x3f ; if ( ! p ) return 0 ; t = end - start ; if ( ! t ) return 0 ; if ( t < 0 ) t = - t ; s = ( t << r ) / p ; return s ; }
return relative position in samples for the rate starting with offset start ending with offset end
return relative position in samples for the rate starting with offset start ending with offset end
// rate byte is 3 bits exponent and 6 bits increment size //   eeiiiiii // every 8 to the power ee the volume is incremented/decremented by iiiiii // Thank you Gravis for this weirdness...