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?
Posted on 2002-04-01 08:51:09 by gscundiff
real128 real4 128.0
temp dd ?

for each item:

fld memory_location_of_floating_point_value
fmul real128 ; multiply by 128
fistp temp ; store as integer

Thomas
Posted on 2002-04-01 09:19:05 by Thomas
That works for me and I now have a nice little display to look at!
Posted on 2002-04-02 03:27:38 by gscundiff