-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
I'm looking for an object or a simple abstraction to decode the bit values of a integer ( Ex: 5 = 101, so bit 0 = 1, bit 1 = 0, bit 2 = 1). If it doesn't exist, I can program a simple external.
Marc
On Sun, 6 Jul 2003, Marc Lavallée wrote:
I'm looking for an object or a simple abstraction to decode the bit values of a integer ( Ex: 5 = 101, so bit 0 = 1, bit 1 = 0, bit 2 = 1). If it doesn't exist, I can program a simple external. Marc
see attachment
Mathieu Bouchard http://artengine.ca/matju
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Sun, 6 Jul 2003, Marc Lavallée wrote:
I'm looking for an object or a simple abstraction to decode the bit values of a integer ( Ex: 5 = 101, so bit 0 = 1, bit 1 = 0, bit 2 = 1). If it doesn't exist, I can program a simple external. Marc
Le 7 Juillet 2003 00:24, Mathieu Bouchard a écrit :
see attachment
Interesting solution, but I need to get the values of specific bits, not a "stream of bits". I found a good solution (attached). Sleep helps sometimes...
Marc
i've had a similar object kicking around in my library for a while, i also have a similar object for recombining bits.
attached.
pix.
On Mon, 07 Jul 2003 07:56:10 -0400 Marc Lavallée odradek@videotron.ca wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Sun, 6 Jul 2003, Marc Lavallée wrote:
I'm looking for an object or a simple abstraction to decode the bit values of a integer ( Ex: 5 = 101, so bit 0 = 1, bit 1 = 0, bit 2 = 1). If it doesn't exist, I can program a simple external. Marc
Le 7 Juillet 2003 00:24, Mathieu Bouchard a écrit :
see attachment
Interesting solution, but I need to get the values of specific bits, not a "stream of bits". I found a good solution (attached). Sleep helps sometimes...
Marc -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux)
iD8DBQE/CV/aQdzoeKQ0PccRApyYAJ4r6xnUn72rPQiWxGz0liIgDtxY+gCg4Xv1 sEIVYlv40BgY9KsmkKESsr4= =Nw31 -----END PGP SIGNATURE-----
--
it's also possible to create an object that's using bitwise AND operations:
such as:
inlet |______________________.. | | .. & N1 & N2 .. | | .. == N1 == N2 .. | | .. outlet outlet
with Nx=1,2,4,8,16,32,64...
it should work similar to pix abstraction, but i suppose that's cheaper ;-)
and it's easyer if you are only looking for a single bit...
btw, why isn't it allowed to create an expr like: expr ( ( $f1 & (2^$f2) ) == 2^$f2)
Tim mailto:TimBlechmann@gmx.net ICQ: 96771783 http://www.nyds-exp-discogs.tk -- The only people for me are the mad ones, the ones who are mad to live, mad to talk, mad to be saved, desirous of everything at the same time, the ones who never yawn or say a commonplace thing, but burn, burn, burn, like fabulous yellow roman candles exploding like spiders across the stars and in the middle you see the blue centerlight pop and everybody goes "Awww!" Jack Kerouac
On Tue, 8 Jul 2003, Tim Blechmann wrote:
it's also possible to create an object that's using bitwise AND operations:
such as:
inlet |______________________.. | | .. & N1 & N2 .. | | .. == N1 == N2 .. | | .. outlet outlet
with Nx=1,2,4,8,16,32,64...
it should work similar to pix abstraction, but i suppose that's cheaper ;-)
and it's easyer if you are only looking for a single bit...
Guess I can't stop promoting k_cext:
[ k_cext 1 16; int i; RANGE(i, 0, 16) BEGIN; . O(i, (I(0) & (1<<i))>0); ENDRANGE ]
:)
morning Marc,
On 6 July 2003 at 22:10:58, Marc Lavallée wrote:
I'm looking for an object or a simple abstraction to decode the bit values of a integer ( Ex: 5 = 101, so bit 0 = 1, bit 1 = 0, bit 2 = 1). If it doesn't exist, I can program a simple external.
I've never seen (or heard of) such an object, but you could use PD's binary bitwise operators &, |, ~ for this purpose, giving them suitable constants (2**n) as arguments / right-inlet inputs.
If you need more bits than will fit into a single t_float (here on linux seems to be ca. 30 bits), it might be easier to program an external which handles lists of floats as long bit-vectors...
marmosets, Bryan