[PD] bytes2bits?

Andre Schmidt andre at vju.info
Wed Jul 31 17:01:38 CEST 2002


(i assume that this code is ok)
i found something usefull for lingo [director]
(copy as movie/global script)

*****************************
on i2bi num, divisor
  set hiNum = num / divisor
  set loNum = num mod divisor
  set divisor = sqrt (divisor)
  set opStr = EMPTY
  if (divisor > 1) then
    set opStr = opStr & i2bi (hiNum, divisor)
    set opStr = opStr & i2bi (loNum, divisor)
  else
    return (string (hiNum) & string (loNum))
  end if
  return opStr
end
******************************

an by typing "put i2bi(65535,256)" in the message window you get "1111111111111111"

so i was wondering how do i do this on pd ?

or if any1 with c skills&time to make a small extern ;)

thnx
-andre
  ----- Original Message ----- 
  From: Andre Schmidt 
  To: PD-LiST 
  Sent: Tuesday, July 30, 2002 11:54 PM
  Subject: Re: [PD] bytes2bits?


  heh, it was too easy when you got simple info...
  http://www.goshen.edu/compsci/mis200/decbinary.htm

  +good ref.table for tae...
  http://www.celticrover.com/bgtt/binary.asp

  ok, the patch is simple and has the result output reversed, so if some1 knows how do i revert the output elegantly... (not pack/unpack)

  "bytes2bits4_xgui.pd" is a test using "byte2bits.pd" (+ "remap.pd") for xgui (you need zexy)...
  (it remaps adc~dfreq~snapshot~ to 0-255 and displays the 8bits as lines x2)...

  "8bit-gem004c.pd" is the same, only for gem so rotating&scaling in 3d... (VERY messy)

  cheers
  -andre
  ps. can i pan/rotate the gem camera arount the center of view ?
  pss. can i force the gemwin to "stay on top" ?

  ----- Original Message ----- 
    From: Andre Schmidt 
    To: PD-LiST 
    Sent: Tuesday, July 30, 2002 8:08 AM
    Subject: [PD] bytes2bits?


    hi,

    that bits2bytes was easy, but i cant get bytes2bits to work properly...
    i remember doing this (WAY) back with pascal but cant figure out how to do it in pd...
    would be very nice if some1 could show me how to convert bytes (0-255) to a list of "0" & "1"...

    the attachment is how far i got...
    hope i'm even on the right path :)

    thnx
    -andre
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20020731/3df44edf/attachment.htm>


More information about the Pd-list mailing list