How do i get binary gates from a signal?
and vice versa?
My google sense tells me this will be impossible to find. Search terms: max msp, dac, adc, raw bits, signal etc. Hard. Thus my question:
Is there an external to convert a signal into the bits it’s made of? A virtual "digital adc", if you will, with one inlet and 24 outlets. Or preferably a selectable amount of outlets to avoid terrible patchcord messes. And of course an inverted version, a "digital dac".
Any ideas? I’d love patching one up, I just have no idea about how dacs or adcs work…
you should be able to do that with the MSP bitwise operators, no?
Not that I know of. They do bitwise stuff that is cool but I want to manipulate the individual bits as 0-1 signals.
Roman is right, the bitwise operators are designed to do exactly that.
Sorry, I didn’t have Max available when I first replied. I’m assuming you want to deal with integer values in your signal? If so, here’s how to handle an 8-bit number…
----------begin_max5_patcher---------- 752.3oc0YFsbhCBE.843WQFdbmtNAHPR121uic5rSzPqriRbL3rtsS8aeSfP U6jpwfdq9RRCvPN4vkKP80QAnIkaDUnveD9qvffWGEDXJpoff1mCPKx2Lcdd koYHk3ukS9C5AaUZwFso34k4EKDUUgXWUkq0yEZ8+VJrcOBE9XaUOUpzp7El JP+bkLeNZuZpjuXpAGMNps3k45oyjpm+8JwTss6L01dkSL+c53n2eEp0Kjp5 2uAZbagxByarl+uSIncszhpsoME91nQMWdnmJQ7RQ9zsnSwJ0bMl4t1MqjNX E2MqQCf05dXhX01OcPpR9rpY3HD8T8PptOiYKWIpDJctVVp16ilEwsiJoM2h ZubP+0wH8hxBw9ZnlGym5wBEXQ1XgTavPzwCF5PvDZ2BlbSK3XJTBNl5qfiu GELkCkfobeEL6BJ3tyvOQpyUEaCwjzijju09WzT8t42VujfOe6vubI6Ogc3w .KG2bSqbbQrmibR.SNTBvxwMuZ3xI8BJGvRbQxfJwEIy2DWYvk3hCbzmSNCN 5iFc0mZ9ssgDFeLndws0c69gImeLC4pqkkyxqJWssI3G+E3l1oSYmuZv2i4q nT6Z5IYW87UDeyWEcOtSVh6Dx3qsfwLOELN6dTv3L1de1WSAm5qeSAaAWnOm faxMevtAtsBC8wDbyKGtaf6LTPeJgTeUC6dbQWbrYw.Bge0WSvyTVIvcDgvu hc6M7Hu3a5.uyKDhb7SxakS6Mx.1Y7oChL8EZtT8weQDCOMken+pJWuZpyOt eTgvcHUHpzRkYd29MBePilIKJDl5e2OxhkkRktEhvG6bzruLQv8fIBAVl5im hu8PpIQ+4vDNaLqNLkQatkt6APXk6AqXFvvl3ArDBrvRFDqDCqzcO.ApM+Cj FtWy.1qod.KkCLr9DwFSAFVexEvhtbvx6CrTXS7mzGl.dwnz9vDCTl9PpjOg oLPYB2qwtHXYpOw3Xf8DqOLkBJSw8.oDOHp9g2F8e73wwAO -----------end_max5_patcher-----------
Ah. Very grateful. I guess reversing it should be just as easy? No time to try now. I’ll probably figure it out. Thanks!
You’re welcome :)
Although it is do-able, I think reversing this process will throw up a number of ugly problems unless you know exactly what you’re doing. The above technique relies on [bitand~]’s ability to convert a floating-point number into an integer internally.
The binary representation of an integer is very different to that of a float. See W!k!p3d!a for more details.
You’d probably be better off just using the 8 exponent bits (and forgoing the costly "convert to integer representation" process that I had [bitand~] performing earlier). If you’re struggling with the concept, I’ll knock up a patch when I next have Max handy.
If you manually pack bits into a floating point number, it’s possible to create some unusual ‘numbers’ (NaN, -infinity, +infinity). Max/MSP objects don’t play nicely with such values.
I’m curious… What are you using this for?
I do a lot of signal-rate stuff that uses a fair bit of logic, but I’ve never had the need to do what you’re attempting. Either there’s an easier way to do what you want, or you’re doing something seriously tech and exciting!!!
…Ok, i have no idea how to convert the bits into "analog" again. My bad.
Basically i just want to do crazy stuff with them. Not tech so much as stupid I guess. Things like:
Take, say 12 bits and do CA style rule manipulations,
delay individual bits by different amount of samples per bit,
do bit0 XOR bit1 OR bit2 AND bit3 XOR bit4,
shuffle them about randomly,
invert them randomly,
invert them based on logic,
shift right or left based on total number of 1s,
interleave/shuffle bits from two sounds
delay them for a set amount of samples based on CA rules…
I don’t know. I hope that when i get them all out things should start falling into place.
If it’s easier to do this some other way I’d of course do it that way but I have no idea what that would be.
Nan, inf and -inf should be ok with a bitshift~, no? Most things will probably sound crap-ish but that’s kind of the point.
So if you’d like to throw together a patch I’d be very grateful. If I get something cool out of it I could always post it here.
OK, I had a quick look and it’s not totally straightforward. Let me puzzle something out and I’ll get back to you – maybe not straight away.
Independent per-bit delay sounds intriguing…
I suspect all this twiddling will probably result in very same-y crust, but who knows? Time to play…
But back to your main problem, recombining…
It ought to be a case of simply [bitor~]ing all the signals back together. You’ll need a whole bunch of [bitor~]s though.
Yes, most modes will probably sound same-same. But you never know. The delay part is most intriguing, yes!
Anything like this? I’m just guessing basically.
----------begin_max5_patcher---------- 1180.3oc6Z98bipBEG+YyeEY84tc.722+B1mt+CzoSFiRaXuFzQIY6d2Y2+1 WCpUH0TroEFYl9BsAvCe4CmyQD8Wqbb2V9Dtwc8+r9t0NN+ZkiCupSU3z+aG 28oOkUj1v6lKE+ixse28ltlX3mX7pqVWdHa29ehSqa9xPqjbdas8+qv3gJen jxno6w7l9Ft3HlQxRW+u3C3gtTkxx1QnOtoFmw5DmWH3VvMC+IgWhf2BVeuf YaH+O2rPTaycUSOrmPKvLt3giUVdfMTKPbTw08y89IeqgIE3i35FRIUvFNti ZKvmqIdYnOWZ9wfQs0hzGKJy9Obtvv43lie3sXixJLcr+7dHUH2SBspF2for TVuvEG2zCErMSSL41eHMCewK90WEcberljWROoFISbp5gw8t0vfS5+T43Df2 CZZ0DWLqrrXaZ8QRCYaAVZAo0uMkR1mxZkRmvPfmuNx9pZBkIYKLMs0F6Zxp KKJjLUWKGmnkb7QRF9Gjb1NtsFwlTjjfCjTDkT8mEYw8SGf24gOh0246x9YU OBcaHORSa048BcZhXHTTWXChi7wRoqSJfAH2fPPCTnkrx86wcr00cn5euZ0v +LtvVPnCLZ88q5ZsO5qI8HNeS6bsUtaRYrZx1CrtNKFMpx4cV9kEkaSK5C2e tythl3E98ZKXY0Hr3ks.48kIdKgUV+moRA6+FRAqxG6UxQ26l4itpbznA6Kj 9RbLBBDFiyy8ctSpInZfgnpuAnp+hgpgFhpPCPU3RgpI5FpftMoAzITAABiw RvUEXFpp2zpfkVZUngnpuAn5xIsJxPTEZ.ptXRqFoYn16+n0zpHeutwveg.0 Xy.UslUsGpnnkBTCMDT80JT6GifEBTCLDT+PxopM7T0NzaZYTylph1mCdWYQ NtdpaA8APqaL5+Mi0FnW2oXEFcavUr3.ldwA84AS94ASt.NXRoHd4n91Pj+b oirLPrgYrr7dNZyH9hUWom24YHesSv6RujfKks7ry17lqjocl8Rny280mt9f dmSvbOIWwY0EtwpOLgaT+3Iidu3KNYVmArd3DTAm7hz.m7h7DLpUvIjJN4qC N4acbBnhSPcvIunt3tPagSIJvDJVCXBkjXYtSwpvTfNvTPrkgoHUXBoCLghr LLEp.SvDcfotybxhvTfJLEpALc5A+rKLoZGlCOQ6GKl7rscD3oBS5Xi3Pfsg IU6u7csM7qetN4Gdx4SetbO09zPno7Pc1vSiN7bsqkkdNtgQnOefF2M9Tbm0 wcj7b4yMfyYRdUIgxj+xXTsroOcCsTcirTcCrScmXmxN1NkcjcJ6P6T1A1or sz633Ymx9i79Me94vdoOGVNfk2.W2qo77009WV4KWOkhJtzMgktsvKWHmdQ7 Eu5zYqo1QCBUooSBGZVMojSAFWSIpjTnQkTxb7lBMq2TvbzjuY0T3bzTfwi5 hUHoDi6eGoBR.iKoPURBZbIEnRRHiJon43ciLq2MZNZBZVMAlglRLqjfyAS. imXxWgjhLdHmmBEEaTEMm6mX1MwEOCEEYTEMm8ADZbOazLTjg2lqBEY9M4Bl ght1Us1e76U+E7b5i7. -----------end_max5_patcher-----------
Oh, and bitwise surround panning! Four sources, four speakers, and all the bits swapped around consecutively. Could be fun.
it will probably sound like crap, but you can always tell the audience: "but it is bitwise
surround panning! dont you understand the concept!?!"
maybe it is almost as cool as the converting the ASCII of the american constitution
into audio and then pan it hard to the right.
Any progress? I haven’t thought much about it, got no idea how to do it.
(I have bought a G2 engine though, so I can do some stuff in 8 bits there as soon as it gets here.)
Btw actually I think the bitwise surround stuff could be nice with simple sounds for drony stuff! Maybe just not drumkits and choir music.
any news ? I’m interesting too. :-)
Forums > MaxMSP