Is bitxor~ broken, or am I doin it wrong?


    Apr 09 2017 | 12:33 am
    So recently I started to experiment with using bitwise operations with two oscillators as a form of weird distortion, and it seems to work pretty well when I use bitand~ and bitor~. When I tried connecting my oscillators to bitxor~, however, there was only 3 things that seemed to happen: A). Nothing. Zero output. B). The left inlet passes thru, unchanged. C). If one input is greater than 2 and the other is less than 1, I get a signal output that's somewhere in the quintillions (I think, I honestly didn't bother counting the digits). This *looks* like a bug to me, but at the same time I figure it's totally possible that I'm misunderstanding how it's supposed to be used. Anyone have any insight?

    • Apr 09 2017 | 4:47 am
      theoretically, these operators should only work on the discrete values zero and one -- anything else is "not defined". however, the max rule for xor~ is if a value is zero it will let the other value through; if both values are non-zero the output is zero. but these rules only apply for values between -1 and +1 These operators are normally used for logical decision making, ie deciding how to route a signal depending on the state of another signal etc, so really any hacking outside of its intended use is dependent on your own creativity given the limitations of the objects in question...
    • Apr 09 2017 | 5:54 am
      Well, I'm not referring to the signal rate conditionals, which you seem to be thinking of. As I said in the original post, and displayed in the included patch, I'm working with the bitwise objects, bitand~, bitor~, and bitxor~.
    • Apr 09 2017 | 7:51 am
      sorry, my bad, your absolutely right; I guess it might depend on how a 32-bit signal is represented, whether it's big or little endian and which bits the mantissa uses-- I don't know those details, and btw the help file refers to 32-bit signals, but since max 6 they as far as I understand signals are 64-bit, so maybe because of this there is some unpredictable behaviour involved...
    • Apr 09 2017 | 11:08 am
      both 32 and 64 bit are easy to predict, but one might find interesting errors in bitwise op patches when switching resolutions :)