53 Ri = NUMERATOR / (hl-ll);
64 Ri = NUMERATOR / (hl-ll);
78 Ri = NUMERATOR / (hl-ll);
90 typename IntegerType<
sizeof(T)>::unsigned_type sub = in-hl;
97 typename IntegerType<
sizeof(T)>::unsigned_type q = ((
typename IntegerType<
sizeof(T)+
sizeof(T)>::unsigned_type) sub*Ri) >> SHIFT;
98 typename IntegerType<
sizeof(T)>::unsigned_type r = sub - q*R;
99 if (q&0b1)
return ll+r;
105 typename IntegerType<
sizeof(T)>::unsigned_type sub = ll-in;
106 typename IntegerType<
sizeof(T)>::unsigned_type q = ((
typename IntegerType<
sizeof(T)+
sizeof(T)>::unsigned_type) sub*Ri) >> SHIFT;
107 typename IntegerType<
sizeof(T)>::unsigned_type r = sub - q*R;
108 if (q&0b1)
return hl-r;
119 static const uint8_t SHIFT = (
sizeof(
T) << 3);
void setHighLimit(T highLimit)
Set the high limit where the wave will start to be folded back the other way.
void setLimits(T lowLimit, T highLimit)
Set the low and the high limits at the same time.
void setLowLimit(T lowLimit)
Set the low limit where the wave will start to be folded back the other way.
T next(T in)
Return the next folded sample.
#define AudioOutputStorage_t
The type used to store a single channel of a single frame, internally.