Author Topic: spectrum display  (Read 14810 times)

RevG

  • Posts: 454
spectrum display
« on: 29 Jun '03 - 18:32 »
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

  • Posts: 232
Re: spectrum display
« Reply #1 on: 29 Jun '03 - 22:36 »
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

  • Posts: 454
Re: spectrum display
« Reply #2 on: 29 Jun '03 - 23:50 »
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

  • Guest
Re: spectrum display
« Reply #3 on: 30 Jun '03 - 07:16 »
Quote

I 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

  • Posts: 232
Re: spectrum display
« Reply #4 on: 1 Jul '03 - 02:25 »
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

  • Posts: 454
Re: spectrum display
« Reply #5 on: 1 Jul '03 - 03:47 »
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

  • Guest
Re: spectrum display
« Reply #6 on: 1 Jul '03 - 07:24 »
I think Winamp has 19, so that would be cool for me, too.

RevG

  • Posts: 454
Re: spectrum display
« Reply #7 on: 26 Jul '03 - 01:19 »
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

  • Posts: 232
Re: spectrum display
« Reply #8 on: 26 Jul '03 - 14:26 »
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

  • Posts: 232
Re: spectrum display
« Reply #9 on: 29 Jul '03 - 17:42 »
Just a few more bugs to iron out:-
A little taster ;)



Added some peaks - optional of course :o
« Last Edit: 30 Jul '03 - 18:25 by bigjim »

RevG

  • Posts: 454
Re: spectrum display
« Reply #10 on: 29 Jul '03 - 20:14 »
Awesome man! I can't tell you how much I appreciate your help on this  ;D

Greg

bigjim

  • Posts: 232
Re: spectrum display
« Reply #11 on: 1 Aug '03 - 03:26 »
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:
« Last Edit: 1 Aug '03 - 03:27 by bigjim »

Chris

  • Posts: 1810
Re: spectrum display
« Reply #12 on: 1 Aug '03 - 13:17 »
@ 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
« Last Edit: 1 Aug '03 - 13:24 by Chris »

bigjim

  • Posts: 232
Re: spectrum display
« Reply #13 on: 1 Aug '03 - 13:55 »
Hmmm- that gives me an idea.

A turbocharged heaxagonal decibel measurment device.

Ill start work straight away :D

Chris

  • Posts: 1810
Re: spectrum display
« Reply #14 on: 1 Aug '03 - 14:02 »
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
« Last Edit: 1 Aug '03 - 18:30 by Chris »

Guess

  • Guest
Re: spectrum display
« Reply #15 on: 6 Aug '03 - 08:16 »
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

  • Posts: 232
Re: spectrum display
« Reply #16 on: 7 Aug '03 - 00:03 »
I understand the rest however not the most crucial bit:- guess/anyone?

Quote

if PeakBar make look Gradation

bigjim

  • Posts: 232
Re: spectrum display
« Reply #17 on: 7 Aug '03 - 22:18 »
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
« Last Edit: 7 Aug '03 - 22:19 by bigjim »

Peter_Hebels

  • Posts: 119
Re: spectrum display
« Reply #18 on: 7 Aug '03 - 22:57 »
Maybe this code can help you, I have found it on Planet Source Code.

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

bigjim

  • Posts: 232
Re: spectrum display
« Reply #19 on: 8 Aug '03 - 16:10 »
Thanx Peter I think ive got the idea now ;D

Well- back to the coding ::)