I use the GetSpectrum to show 32 spectrum bars.
Can anyone help me with which frequencies I should include ?
Only taking the first 32 values is not the best solution I think.
And can anyone tell me how these frquencies are related to the 512 values returned by GetSpectrum ?
I looked in the documentation, and if the output rate is 44100 then the value interval would be 22050 / 512 = 43 Hz
Am I way off here ?
But the most important issue is input on the values I should include in my spectrum bars.
- Anonymous asked 14 years ago
Blitting is acutally slower then using rectfill, and other api draw routines. If you go with a do loop its better to use sleep(x) api then in a constant loop, otherwize you will eat up lots of cpu constantly. A good engine might do something like…
x = GetTimer
xx = GetTimer
xxx = xx – x
This will cause the app to sleep for the same amount of time it takes to preform the drawing, Thus for slower comps it wouldn’t eat mass cpu time, you could further expand the rountines to use less cpu based if it is a extremly fast machine, ect…
As for speeding up your drawing routines, you might want to look at the DirectX SDK, or other such Graphics SDK’s.
Just a thought.
Thanks for the Speed advice, i’ll give that a shot soon. I use the blt function rather than recfill because i can get nice gradients and then even the eq display is skinnable,( if your into that thing), Re: the Gravity dropoff, if you pump the normal specturm into say 30 bars jumping up and down, it looks good, however i wanted a smoother display, so i made the bars will gradually decend after peaking until a highter value is received, the effect is the whole display will jump around in time to the music, and yes it might not be as acurate , but it looks very nice. Also i’ve taken to manipulating to values – Thats is-adjusting each bar according the values of the bars next to it. This way the eq will be nice and smooth and rounded. I think i’ll have to post i piccy and the code. You’d be suprised how fast this runs in vb. oh – my pc specs are p3-400, 128megs,1 inch dust.
Lol, 1 inch of dust. hehe. Yeah, I do somewhat of the same thing with my VU, because if I just output the raw values it goes way too fast and sloppy. But, I think the spectrum I have is smooth enough, so I kept it like that. Also, I think blitting it would decrease speed so my bars are a solid color.
You were right, and I was wrong 😆
I have a big spectrum window function in my program. When using the small one, it uses 7-8%, with the big one it uses 27-33%, and in full screen 75-80%
I use a PIII-450MHz
640 MB RAM
So it seems like it’s the FillRect routine that’s slow.
Any suggestions how to speed this up ?
To the people who requested the spectrum or scratching effect code, please be patient, had a heavy weekend with my mate Jack Daniels and his sister Sambooka. Computer remained OFF whilst in recovery. I don;t bother with the Internet thing at home, Will post the stuff tomorrow.
…RE….Anybody done any serious Audio development with fmod like building a sample sequencer etc, have started development of a 16 track audio sequencer . Everybody just seems to be trying to build the perfect MP3 Player? (pst. it’s been done!)
Well, fillrect is a lot faster than internal VB functions I think. But if you want to try it out you could always mess around with the Line function of VB. And also, If you are using the Timer control for the spectrum analyzer, you might try using an API timer, which are a lot more reliable than VB timers.
Yeah, lol. I believe the perfect MP3 player is Sonique, which is not powered by FMOD. It uses AudioEnlightenment, which is a kickass mpeg decoder written by Tony Million I think… Anyways, I’m not really trying to make the perfect MP3 player, I’m just working on it because I’d rather use a program that I wrote and know what’s in it than some 3rd party program with spyware and crap like that.
This may not be the best way to create a specturm, i’ve been using fmod in my own player for awile. My spectrum runs in a constant loop . Ie
~Draw some stuff
I also use Bltbit to construct my specturm, I also calculate a nice gravity dropoff and an option to smooth the apperance of the display, looks very nice and fast as hell. Email me @ firstname.lastname@example.org is you would like the whole source -code,
..just that after posting my emails address i had…well now…33 requests for my code, and yet only 2 people bothering to contribute to the forum. I wonder what these guy are doing with fmod?????, would be interesting to know…..#
:), Clubing tonight, Yeeeeeeee
Please login first to submit.