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.
Anyone?
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...
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.
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.
Exactly!!
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. :-)
Hi all,
I found this topic after learning about the Xaoc Devices 8-bit modules and doing research on bit manipulation. Not being a specialist, I thought that audio bits could be manipulated without converting the signal by using waveshaping / [clip~] or DC trickery to affect a portion of the amplitude of a signal and then recombining them.
For instance, splitting a sine wave into two parts: the first part would contain only amplitude data between 0 and 1, and the second part would contain those below 0 and above -1. This way, we can delay, filter, etc., each portion we created with waveshaping.
Correct me if I am wrong, as I doubt my knowledge on the matter. Otherwise, if someone else is interested in the subject i'd love to learn more.
of course, that´s how it is done. as (most) software enviroments do not allow multirate or different bit rates at the same time, you can only pretend a different rate by applying math functions.
only the output scale will be different from how you would convert to another bitrate stream or file, the rest is the same.
for "2 bits unsigned" you should be fine with [>=~ 0.] as you said. for "5 bits" you could try something like [*~ 31.] - [trunc~] - [/~ 31.] applied to both poles separately.
(degrade~ probably uses bitwise operations after converting float to int.)