Scripting a text to binary digits converter

-=>JB<=- sundown at pacifier.com
Tue Jan 3 06:22:05 EST 2012


I don't think the binaryEncode function will return the same
binary or ascii number that you get using the baseConvert
function.  The dictionary states it returns the same thing as
the pack() function used by perl.  I do not know perl so I am
not sure what they are doing.

Can anyone explain what the pack() function for perl is
used for?

The dictionary says,

charToNum(binaryEncode("B*","01111111")) -- returns 127

And it does return 127 as stated.  This looks like you are taking a
binary code number and converting it to ascii but  01111111 isn't
 the same binary sequence for 127 that would be used with
baseConvert so what is this 127 from?

-=>JB<=-



On Jan 2, 2012, at 4:16 PM, Kurt Kaufman wrote:

> More fun with LC's binaryEncode functions (see the card script):
> 
> http://www.kkef.org/MIDIBuilder031212.rev
> 
> It must be pretty quick to accept from user input an ascii representation of a musical note, convert it to binary from which a MIDI file is constructed and played, then add the input to an 
> as-yet open-ended MIDI sequence (whose current length must be properly specified before attempting to update or play)- all in a fraction of a second.
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
> 




More information about the use-livecode mailing list