0
0

Hi there !

Is it possible to use the spectrum analyzer for good-looking
demo camera rumble effects ? For example at the moment
where a big bass beat appears, the camera in my 3D demo
rumbles or spins around ?

Ho can I do it ? Is this right ?…

FSOUND_DSP_SetActive(FSOUND_DSP_GetFFTUnit(),TRUE);

FSOUND_STREAM *Music1;

Music1= FSOUND_Stream_OpenFile(“music.mp3”, FSOUND_16BITS | FSOUND_STEREO | FSOUND_LOOP_NORMAL,0);

FSOUND_SetVolume(FSOUND_ALL,255);
FSOUND_Stream_Play(FSOUND_FREE,Music1);

float *SpectrumBuffer;
SpectrumBuffer= FSOUND_DSP_GetSpectrum( );

And how can I use the values in SpectrumBuffer
to create this effect now ?

Thanx for replies !!! :)

  • You must to post comments
0
0

Okay!
Thanx Adion for your explanation. Then it is like it is.
But perhaps then it is not a big prob to change the FMODs FFT-Transformation-Samples from 1024 to xy by a function in FMOD 4.0 ?

  • You must to post comments
0
0

Oh yeah, that sounds good ๐Ÿ˜€ !!!

  • You must to post comments
0
0

Ooh no what’s this…I get values for SpectrumBuffer[0]
above 1.0 ! What’s going on there ?

I thought they only reach from 0.0 up to 1.0 ?

  • You must to post comments
0
0

by the way, is it possible to use only the SpectrumBuffer fields,
which represent the bass beat ?

If yes, which fields ?

SpectrumBuffer[0] to SpectrumBuffer[32] ? :)

  • You must to post comments
0
0

What Brett is talking about is adding up the [u:3ednagjc]last[/u:3ednagjc] 32 values, so 480 -512. Then once you get the added values of the last 32 values of SpectrumBuffer you divide the whle thing by 32 to get an average which will range from 0-1. And then with this data you can write a routine to do the effect that you need.

  • You must to post comments
0
0

I’m using the SpectrumBuffer[0] up to SpectrumBuffer[128] now
and this looks really cool. Nevertheless I tried your version
SpectrumBuffer[480] up to SpectrumBuffer[512] and get
NO effect…so I think 480-512 is not a good interval.

Anyway thanx for your ideas !

  • You must to post comments
0
0

Yeah, now that I think of it, the lower end of the spectrum is never very busy, but if you’re trying to get a bass value then you shouldn’t use upper spectrum values. You might try 96 – 128, it might give you better results.

  • You must to post comments
0
0

Most of the bass and kick-bass is in the first 10 spectrum values, so I think it would be good enough to only use these values.

  • You must to post comments
0
0

btw. the scale is linear, isn’t it?
So if I use 44.1 kHz, the [0] is 1 Hz, [511] is 22050, and [256] is about 11025?

So [x] = Nyquist/512 * x Hz ?

As mentioned in another forum’s topic, I would be lucky when it would be possible to scale it optionally logarithmic, because (nearly) nobody needs a constant frequence-difference of 43 Hz at 44.1kHz samplingrate.
21533 Hz [500] & 21576 [501]
There is 43 Hz just a minimal part of a semitone.
But around 100 or 200 Hz a more narrow scale would be nice, there is 43 Hz the half of an octave!

FMOD 4.0 ๐Ÿ˜› (?)

  • You must to post comments
0
0

The fft transform works linear.
You could transform the data to logarithmic data yourself.
If you want more precision in the lower part, you will have to do a fft transform on a larger piece of data, which means there will be some more lag.
The fft that fmod does at the moment is done on 1024 samples.

  • You must to post comments
Showing 10 results
Your Answer

Please first to submit.