realbasic-nug
[Top] [All Lists]

Re: Porting MIDI variable-length quantity C code to REALbasic

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Porting MIDI variable-length quantity C code to REALbasic
From: Mark Nutter <manutter51 at yahoo dot com>
Date: Mon, 31 Jan 2005 05:41:01 -0800 (PST)
Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
Delivered-to: realbasic-nug at lists dot realsoftware dot com
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=AqQ/ds2qCP0wvdwtAVbT/0Js6d8bbFoZZdSuFJlilH3UDDUbAf/h19zIqBhfe/ZCZcOSDgZrH7kjaUOwVVXUzmdSyR7Hg9JB8Eo6YP9URlu0FfF3KoYeSBT1ux8P3bD+ccFVT07C74zwwFhT+28PlzqR0MF4opxae4ud/ajRUc4= ;
--- Philip Regan <pregan at mac dot com> wrote:

> Hi, Mark--
>  
>  
>  I put your methods into a simple app that displays
> the values on
>  screen. it works great with no changes to the code.
> My only question
>  is that I have to write these as hex values. The
> requires double
>  digits for all hex values, and your method leaves
> bytes less than 10
>  as only single digits. For example "0" is "0" and
> not "00 as is shown
>  in the spec.
>  
>  
>  Can I just add an if..then statement to it to place
> a leading digit to
>  any value less than 10 in the same way I would do
> if it were a string?

That will make it display as double digits, but are
you sure that's what you want to do?  Adding a zero is
only something you need to do when converting binary
data into a string (i.e. to display to the end user). 
To write to a standard MIDI file or send to a MIDI
device, you should be sending the raw bytes, not
converted to a string.  I may just be misunderstanding
what you are saying, but I thought I'd throw that out
as a caveat.

Mark



                
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - Easier than ever with enhanced search. Learn more.
http://info.mail.yahoo.com/mail_250
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>