Scripting a text to binary digits converter
sundown at pacifier.com
Tue Jan 3 05:22:05 CST 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
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?
On Jan 2, 2012, at 4:16 PM, Kurt Kaufman wrote:
> More fun with LC's binaryEncode functions (see the card script):
> 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:
More information about the use-livecode