spectrum display

Started by RevG,

RevG

Hi,

I have been trying to create a spectrum display that resembles winamps spectrum. I haven't been able to get it to look properly. I have attached an image of the spectrum I am trying to create.



I am assuming someone else has probably already done this or something similar. So could someone post some source code or offer some insight into how to accomplish this type of a spectrum display?

Thanks in advance,
Greg

bigjim

Hi RevG-

You can get various activex coponents that help you do this-

however if your talking bout delphi then i could give you an example how to write a spectrum that looks very similar to the one you want- It is quite easy once you understand the concept.

What language are you developing in?

I could possibly give you a vb example instead of delphi if that helps.

RevG

I am actually using c++, but a delphi example would be great. It wouldn't be too difficult for me to translate to c++.

If you could post a delphi example of something similar to the image I posted, that would be perfect!

I appreciate your help! Thanks very much :)
Greg

Sebastian_Mares

QuoteI could possibly give you a vb example instead of delphi if that helps.

I would like the VB example if it is OK for you. :)

bigjim

just wondering:

how many bands(bars) did you want- or did you want a variable amount?

almost done- just making it look pretty ;D

RevG

Variable would be awesome, but I don't want to take up a whole bunch of your time, so if you just made it have about 16 bands or whatever is easiest for you that would be great!

Again, I really appreciate your efforts in helping me :) Thanks! :)

Greg

Sebastian_Mares

I think Winamp has 19, so that would be cool for me, too.

RevG

Hey bigjim,  just wondering if you finished the delphi sample for the spectrum display.

Even if you aren't done, if you could just show some pseudo code on how to go about making the bands look like the image I provided, that would great.

Thanks,
Greg

bigjim

Sorry for the long wait as always- i was ill and also had a couple of other things to do but ill tidy up the code and post it shortly ;D

bigjim

#9
Just a few more bugs to iron out:-
A little taster ;)



Added some peaks - optional of course :o

RevG

Awesome man! I can't tell you how much I appreciate your help on this  ;D

Greg

bigjim

#11
Hooah- finished/ as far as finished is 8)

Ive written the spectrum as an object so you can just include the pas file in your projects and use when needed :D

Feel free to tweak the object code if you like - but ive added plenty of properties to the object for you to play with- ie Peak Colour 1, Peak Colour 2, Bar Colour 1, Bar Colour 2, etc. Peak FallOff Rate, Bar Falloff Rate, so on, so on.

So basically it is pick up and use ;D

Ive included an example on how to open a file play it and visulaise it using the object after sorting the data :P

Grab the zip from my website @
http://www.ingenious.demon.co.uk
Its in the programming section called Ingenious Spectrum

Have fun- contact me if any probs :laugh:

Chris

#12
@ BigJim..Congratulation.....fast and very good design....
and now you next project....an LevelMeter..... :laugh: :laugh: :laugh: :laugh:
What do you think is it possible ??
but then we will nee a comp than can draw vertikal and horizontal
Greets Chris

bigjim

Hmmm- that gives me an idea.

A turbocharged heaxagonal decibel measurment device.

Ill start work straight away :D

Chris

#14
hehehe
mm we will only need your spectrum with only ONE bar
(maybe with the two options
horizontal,vertikal and the frequenz that will draw
Greets chris

Guess

Hi BigJim, a nice Spectrum I like it, but
What do U think, if PeakBar make look Gradation
maybe next Ur Improve that...delphi2me

English not native....sorry..!!
Best mrBassX ;)

bigjim

I understand the rest however not the most crucial bit:- guess/anyone?

Quoteif PeakBar make look Gradation

bigjim

#17
Just seen the code Peter posted in thread:

http://www.un4seen.com/YaBB.cgi?board=bass&action=display&num=1060286570

Its good and may suit your needs just as well as mine.

However most of my code has being converted but if someone can give me a few hints about vb classes it would be much appreciated. It would save me from trailing round the net :evil:

Basically anybody know anything in respect to contructors and destructors in VB. I got class.inititialize however you cant mod it to your own parameters- or does vb not support custom class contructors?

Anyway ill just keep trundling through and if i cant figure it ill just write it into a set of functions which you can replicate for multi instance as the only reason im writing it to a class is for the use of multi instance ;D

Peter_Hebels

Maybe this code can help you, I have found it on Planet Source Code.

http://home.zonnet.nl/hebels13/constructos.zip

bigjim

Thanx Peter I think ive got the idea now ;D

Well- back to the coding ::)