frac32buffer Signal in
frac32buffer Signal out
bin12 p1
frac32.u.map noisegate
int32_t reversebits;
int32_t tmp;
int32_t hp_freq;
int32_t val;
int32_t noisegate;
reversebits = 0;
tmp = 0;
hp_freq = 0x000B29A4; // MTOF(8,176Hz)
val = 0;
noisegate = param_noisegate;
reversebits = param_p1 & 0xFFF;
tmp = (inlet_a >> 1) + 0x04000000; // Bipolar to unipolar signal
tmp = tmp + (noisegate >> 7); // Noise gate
tmp = tmp & ~(reversebits << 15); // Bitwise operation
tmp = tmp + ((reversebits / 2) << 15); // Suppress DC offset partially
tmp = (tmp - 0x04000000) << 1; // Unipolar to bipolar
// HP filter to suppress entirely DC offset
val = ___SMMLA((tmp - val) << 1, hp_freq, val);
outlet_b = tmp - val;