Page 1 of 1

MaxMod Stream Format

Posted: Mon Mar 28, 2011 1:02 am
by digithree
In the MaxMod streaming example the actual sample data is derived from the function sinLerp() which returns a "4.12 fixed point number with the range [-1, 1]". This implies that the stream data format is also in 4.12 fixed format.

My question is what is the format for raw sound data to be put in the stream? Is it signed or unsigned? Is it a fixed 4.12 number between -1 and 1 (or possibly between -15.999999999999 and 15.999999999999 which would logically be the minimum and maximum values for a signed 4.12 number)?

As an aside, if sinLerp and other trig functions return signed values in 4.12, shouldn't one of those bits (the most signifigant bit usually isn't it) be the sign bit? So shouldn't it be 3.12 or 4.11 for a signed number?

Thanks :)

Re: MaxMod Stream Format

Posted: Mon Mar 28, 2011 2:38 am
by elhobbs
You assumed quite a bit there. Doesn't the sample indicate that it generates noise - nothing is implied by the data. The data should be in the format you specified as parameters - PCM stereo or mono, 8 or 16 bit, and it will play at the requested rate.

Re: MaxMod Stream Format

Posted: Tue Mar 29, 2011 10:14 pm
by digithree
I suppose that's logical. I'll stick to PCM format then.