I'm playing around with FMOD and am interested in the spectrum display (the same as in WinAMP). FMOD dumps the frequency spectrum values into 512 floating point numbers in the range from 0.0 to 1.0 (here's one -> 3D3796C9 ).

What would be the best way to convert those floating point values into integers (say 0 to 128) for use in pixel-plotting or line-drawing routines to display the values?

What would be the best way to convert those floating point values into integers (say 0 to 128) for use in pixel-plotting or line-drawing routines to display the values?

real128 real4 128.0

temp dd ?

for each item:

fld memory_location_of_floating_point_value

fmul real128 ; multiply by 128

f

Thomas

temp dd ?

for each item:

fld memory_location_of_floating_point_value

fmul real128 ; multiply by 128

f

**i**stp temp ; store as integerThomas

That works for me and I now have a nice little display to look at!