digging this so far, using it in a new patch and controlling the muted/inversed bits with an envelope, pretty interesting results!
OTO BISCUIT - rebuild in axoloti
Yes, it's planned ! I have to explain how objects work before.
Thank you for your answer.
Could you not just copy the sign bit before applying bitwise operations, then replace the sign bit as it was?
There's a useful post in this thread
showing how to do various operations on individual bits. I'm not sure if the sign bit is at position 0 or 31 (should be easy enough to find out though).
Just a thought.
a|x
Be careful, the most significant bit (position 31) is the sign bit, but if it's set (negative), it extends...
decimal -1 is binary 1111111111111111
decimal 0 is binary 0000000000000000
decimal 1 is binary 0000000000000001
This is "two's complement", and is used (nearly) everywhere to represent negative integers.
Ah, so bitwise operations would operate differently on the positive and negative halves of the waveform.
Will have to have another few read-throughs of that linked page. Not getting it, at the moment..
a|x
Just got my Axoloti and a bitcrusher was the first use I thought to patch up.
Seeing the quantize object couldn't be adjusted in real time I've patched 12 instances via a couple of mux's to give 1 to 12 bit depth. Also added a crossfade to blend between the original signal and bitcrushed version.
Waiting on some stereo splitters before I can use it as an effect, so the patch has a sine generator as source for now.
The patch could be tidier with a 12 input mux. Not been able to get that working yet. I get an error possibly down to [buffer_index] being lower than the number of inlets I've made.
Got my stereo splitters so I've been testing this out as an insert effect.
I've found using the usb power gives major noise issues once you go below 8 bit. Using the dc power jack this is solved,only issue I've found is a kind of "ghost note" sounds once there is no audio at the input. Bit like a 1 second delay but only applies to the last sound. Again this only appears below 8 bit.
Using the logic/decode/bin 8 object routed to 4 leds to give a display of the bit depth in binary is a nice addition.
I'm getting phasing artifacts when using the crossfade between dry and processed signal. Going to try and reduce this by introducing a delay to the dry signal.
Been quietly beavering away at my take on this.
Currently working on the physical controls side of thing but will be back with some questions and some videos soon.
In the mean time just wanted to say thanks to @JeromeB for the bitwise objects.
So I am loving your bit wise objects.
But I have a few wishes. Don't worry I'm prepared to do the learning and work if I need to, but I thought I would ask first. As I'm still fairly new to code.
I want to be able to change the bit depth.
So have a dial to set bit depth and be able to do the but wise operations at different depths.
I guess it would have to be done in one object.
Any info links or suggestions would be great.
check this: https://sebiik.github.io/community.axoloti.com.backup/t/lokki-contributions/2169/15?u=lokki
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.
i still don't get it sorry. you can use my object in conjunction with the others and manipulate them all via external control...
Just an idea : do not reduce entry signal, but convert a n-bits mask to a 16 bits mask and apply this mask to the entry signal, no ?
I'm not sure, but just a quantize object on the input signal and a left shift register operator on the mask can be the solution.