RR & binary formats (Re: Reading MP3 tags

Dar Scott dsc at swcp.com
Sun Aug 3 23:22:01 EDT 2003


On Sunday, August 3, 2003, at 09:05 PM, Victor Eijkhout wrote:

>> Fortunately the spec makes it pretty easy.
>
> Mp3 is a binary format. Is that header you are reading 7-bit ascii?  
> Would RR be able to handle 8-bit data?
>
> I was wondering the other day if I could use revolution to write an  
> sf2 (soundfont) editor. Just splitting up and combining existing  
> soundfonts. Naively I thought that RR wouldn't be able to handle  
> binary data. Maybe it could.
>
> Anyone any thoughts?

Yes.  Revolution can be used to process any arbitrary binary file.  (Of  
course, it is faster at some things than others.)

A binary file can be considered a sequence of bytes.  Each byte  
corresponds to a character in Revolution.  Use charToNum() to get the  
numerical value.  Use numToChar to go the other way.  These are basic  
and reliable.

That is all that is really needed, but Revolution provides more:   
binaryDecode, binaryEncode, baseConvert, bitAnd, bitOr, bitXor, bitNot.

Dar Scott

************************************************************************ 
****
   Dar Scott Consulting    http://www.swcp.com/dsc/    Programming  
Services
************************************************************************ 
****




More information about the use-livecode mailing list