i have looked at your lovely object, it is a good start.
what i am after is that but with the ability to reverse or mute bits.
i have started to have a look at whats going on and have this
// may need to change this to accomodate larger bit depths
reversebits = inlet_reversebits & 0xFF;
// reduce signal to nbits from lokki's object
tmp= (inlet_a & (~((1<<(28-nbits))-1)));
// Bipolar to unipolar signal, may be messed up by not being 8 bit (change either >> or the hex addition)
tmp = (inlet_a >> 1) + 0x04000000;
// Bitwise operation, may be messed up by not being 8 bit (change either >> or the 20)
tmp = tmp ^ (reversebits << 20);
// Suppress DC offset partially
tmp = tmp + ((reversebits/2) << 20);
// Unipolar to bipolar, may be messed up by not being 8 bit (change either >> or the hex subtraction)
tmp = (tmp - 0x04000000) << 1;
// HP filter to suppress entirely DC offset
val = __SMMLA((tmp-val)<<1, hpfreq, val);
outlet_b = tmp-val;
as you can see from my notes binary maths makes my head hurt. tho i am getting better.
so what i have done is taken the bit reduction code from @lokki 's bit reduction object, now i need to adjust the code for the bitwise operators
so progress, but slow.