[futurebasic] Re: [FB] Thankyou Apple ( a bit foxed by 16 bit fixed)

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : February 2003 : Group Archive : Group : All Groups

From: Robert Purves <robert.purves@...>
Date: Fri, 7 Feb 2003 00:35:00 +1300
Ian Mann wrote:

> Just trying to implement playthrough volumes with the Sequence Grabber.
> SGSetChannelVolume (Channel, Volume)
>
> Apple obviously thought -" Hmm this looks too easy... let's confuse 
> them with a new data type"
>
> ... volume setting of your channel represented as a 16-bit, fixed 
> point number. The high-order 8 bits contain the integer part of the 
> value, the low-order 8 bits contain the fractional part. Volume values 
> range from -1.0 to 1.0. Negative values play no sound but preserve the 
> absolute value of the volume setting.

The easiest way would be to ignore all that guff about fixed point 
(which describes a format known as 8.8). Just do this:

dim as short  volume

and treat volume as ranging from 0 (off) to 32767 (loudest). There are 
32767 different positive volume values. This must be substantially more 
than the number of audibly different levels, so to hear a difference 
you would probably need to change volume by 100-200.


> I am hoping that I can set up a range of values
>
> &x0000000000000000
> &x0000000000000001
> &x0000000000000010
> &x0000000000000100
> &x0000000000001000
> &x0000000000010000
> &x0000000000100000
> &x0000000001000000
> &x0000000010000000

It's not clear to me what you are trying to accomplish here.

Robert P.