frac32.bipolar randCycle
frac32.bipolar cycle
frac32.bipolar nbSeeds
frac32buffer.bipolar out
frac32.u.map randCycle
frac32.u.map cycle
frac32.u.map nbSeeds
int32_t seeds[8];
uint32_t rand1;
int32_t rand2;
int32_t c;
rand1 = 0xA4351354;
c = 1;
seeds[0] = 1619257628;
seeds[1] = -1395685624;
seeds[2] = 865345254;
seeds[3] = -1745292324;
seeds[4] = 1326545629;
seeds[5] = -945295624;
seeds[6] = 1927256324;
seeds[7] = -1345283714;
int32_t randCycle = __USAT(param_randCycle + inlet_randCycle, 27);
int32_t cycle = __USAT(param_cycle + inlet_cycle, 27);
int32_t nbSeeds = __USAT(param_nbSeeds + inlet_nbSeeds, 27);
// random selection of seed
c--;
if (c <= 0) {
rand1 = rand1 * 69069 + 1;
// q31 q27 q26
c = ___SMMLA(rand1 & 0x7FFFFFFF, randCycle, cycle >> 1) >> 18;
rand1 = rand1 * 69069 + 1;
// q31 q27 q26
rand2 = seeds[___SMMUL(rand1 & 0x7FFFFFFF, nbSeeds) >> (26 - 3)];
}
outlet_out = (rand2 = rand2 * 69069 + 1) >> (31 - 27);