[PD] [OT] Converting hex values to individual bytes

Mathieu Bouchard matju at artengine.ca
Wed Jul 20 19:21:29 CEST 2005


On Wed, 20 Jul 2005, B. Bogart wrote:

> I could sit here for a couple hours to figure it out, but I thought
> someone on the list would have a short cut for me. Oh and according to
> the documentation (and testing) the following is correct:
> Hex value | decimal message
> ----------+------------------
> 0x7c87    = 55,67,56,55 (min)
> 0x8379    = 56,51,55,57 (max)

here's an external for that:

GridFlow::FObject.subclass("hexascii",1,1) {
  def _0_float(f)
    a = "%04X" % (f.to_i&0xffff)
    send_out 0,a[0],a[1],a[2],a[3]
  end
}

,-o--------o--------o--------o-. ,---. irc.freenode.net #dataflow |
| The Diagram is the Program tm| | ,-o-------------o--------------o-.
`-o------------o-------------o-' | | Mathieu Bouchard (Montréal QC) |
  | téléphone:+1.514.383.3801`---' `-o-- http://artengine.ca/matju -'




More information about the Pd-list mailing list