0
0

Heres a screenshot of my new proggy made with FMOD 3.6. It should show how to utilize all of the new functions in vb.

[img:3acuvolb]http://members.aol.com/libertyed1986/DMPFinal.jpg[/img:3acuvolb]

Download it here:
[url:3acuvolb]http://members.aol.com/libertyed1986/DMPFinal.zip[/url:3acuvolb]

  • You must to post comments
0
0

Wow, that’s really strange because I’m running a PII 266 mhz and it runs fast. So I dont know what the problem could be. Perhaps you have a low ammount of memory?

  • You must to post comments
0
0

Not many, for now. Just those which are useful for my player, like FSOUND_Stream_SetEndCallback, FSOUND_DSP_Create, FMUSIC_SetRowCallback and FMUSIC_SetOrderCallback

  • You must to post comments
0
0

I have a newer example than this one. Here is the link:
[url:18xa5l3s]http://www.fmod.org/forum/viewtopic.php?t=1162[/url:18xa5l3s]

  • You must to post comments
0
0

Wow, that has to be one of the most completely commented coding I have ever seen. Great job man, that really helps me in learning how to use FMOD.

  • You must to post comments
0
0

Ok, I have a new build of my program. This new build supports module files. But, I’m having some problems and before I upload it I want to ask some questions. I have everything working (play, pause, stop, etc.) for module files but, how do I get the total length of the file??? Because in order to make a progress bar of the file I need to kinow the length of the file. Also, do modules support Stereo VU?? because for some reason I am only getting the left channel VU for module files. And, is there any way to have Spectrum analysis on Module files??

Thanks.

  • You must to post comments
0
0

i can’t download your program, can you attach to me, thank you.
My mail tethien63@yahoo.co.uk

  • You must to post comments
0
0

It is looking quite good, but I have a few comments :

It is not necessary to copy dll’s and ocx’s to the windows/system directory.
I think brett even recommended once to keep the fmod.dll in the same directory as the application, so you are sure the fmod.dll version is the same as you expect.
When dll’s and ocx’s are in the application (.exe) directory they will also be found. (when I open the sample in VB, and press play, it works withouth any problems, and I haven’t used register.bat)

When you don’t have any tag information about a song (so it is Unknown – Unknown) it might be usefull to display the filename.

For the spectrum analyser, it might be a little bit faster if you also use FillRect for the peaks, instead of 5 SetPixelV calls. (Not really that important, and probably won’t give you a large speed increase)

Everything else looks nice about it.

  • You must to post comments
0
0

Hehe! Getting length of modules isn’t as easy as it is with stream files! Modules are much more complex than simple stream files. KarLKoX gave me a dll file which was able to calculate (this is the right term) the length of a mod/s3m/xm or it file. However you can’t implement a progess bar just with knowing the length of module, because you can’t give FMOD an absolute value in ms. However you can use patterns. For every pattern the slide may drop a position, so you can also use it for seeking.

  • You must to post comments
0
0

I know I’m nagging 😳
But will you be able to make VB callback functions for 3.61?

  • You must to post comments
0
0

So, what would this DLL do? Will it give me the length in ms or in something else? And how could I use this for seeking? I wish FMOD had more functions for modules, and spectrum analysis is working for modules now but I found that in order to have spectrum analysis you must load a stream into FMOD first. This might be a bug but I’m not sure. Thanks.

A new screenshot with the updated Spectrum Analyzer:
[img:fp1igkli]http://members.aol.com/libertyed1986/dmpfinalnew.jpg[/img:fp1igkli]

  • You must to post comments
0
0

Wow, thanks for the great comments. Adion, so, do I really need the register.bat file??? I only put it there because I thought that those files might need to be copied to the system folder, but if they dont then I will get rid of it alltogether. I’ll add the filename for no tag info too. Brett, that would be great if you did that, thansk for the good comments.

  • You must to post comments
0
0

That DLL will just give you the length of the module in ms. You cannot use it for any other purpose.

  • You must to post comments
0
0

I haven’t used the register.bat and I can run the example withouth any problem (and I didn’t have those ocx’s)

Some more suggestions:
1)Maybe you can add a total time of the song as well?

and

2)Now you only use the first 22 numbers of the spectrum data, which means it doesn’t show the higher frequency sounds.
What you need to do if you want to show spectrum data in bands is to add more values for the higher bands.
(So the first band is the first spectrum value, the second band is the second spectrum value + the third,…)
I’ll send you some code that I’ve written to do this that looks good.

[edit]You don’t have a e-mail adress in your profile, so I’ll post the code here[/edit]

[code:2wuyddct]
Public Function vis_GetSpectrumCount(ByVal a As Long, Optional ByVal Width = 32)
If Width = 32 Then
If a = 0 Then d = 1
If a = 1 Then d = 1
If a = 2 Then d = 1
If a = 3 Then d = 1
If a = 4 Then d = 1
If a = 5 Then d = 2
If a = 6 Then d = 2
If a = 7 Then d = 2
If a = 8 Then d = 2
If a = 9 Then d = 3
If a = 10 Then d = 3
If a = 11 Then d = 4
If a = 12 Then d = 4
If a = 13 Then d = 5
If a = 14 Then d = 5
If a = 15 Then d = 6
If a = 16 Then d = 6
If a = 17 Then d = 8
If a = 18 Then d = 8
If a = 19 Then d = 9
If a = 20 Then d = 10
If a = 21 Then d = 11
If a = 22 Then d = 12
If a = 23 Then d = 14
If a = 24 Then d = 15
If a = 25 Then d = 17
If a = 26 Then d = 18
If a = 27 Then d = 20
If a = 28 Then d = 21
If a = 29 Then d = 24
If a = 30 Then d = 25
If a = 31 Then d = 27
ElseIf Width = 16 Then
If a = 0 Then d = 2
If a = 1 Then d = 2
If a = 2 Then d = 3
If a = 3 Then d = 4
If a = 4 Then d = 5
If a = 5 Then d = 7
If a = 6 Then d = 9
If a = 7 Then d = 11
If a = 8 Then d = 14
If a = 9 Then d = 17
If a = 10 Then d = 21
If a = 11 Then d = 30 ’26
If a = 12 Then d = 35 ’32
If a = 13 Then d = 40 ’38
If a = 14 Then d = 50 ’45
If a = 15 Then d = 60 ’52
End If
vis_GetSpectrumCount = d
End Function

Public Sub vis_SimplifySpectrum(ByRef src() As Single, ByRef dst() As Single)
Dim up As Long, a As Long, d As Long, c As Long, cnt As Double, wdth As Long
Static max16(15) As Double
Static max32(31) As Double

Dim tmpDbl As Double
up = UBound(dst)
If up >= 31 Then
wdth = 32
ElseIf up >= 15 Then
wdth = 16
Else
Exit Sub
End If

For a = 0 To UBound(dst)
d = vis_GetSpectrumCount(a, wdth)

cnt = 0
For c = 1 To d
    If UBound(src) >= b Then
        cnt = cnt + src(b)
    End If
    b = b + 1
Next

If cnt > 0 Then
    If cnt > 0 Then tmpDbl = sqr(cnt)
    If wdth = 16 Then
        If tmpDbl > max16(a) Then max16(a) = tmpDbl
        If max16(a) > 0 Then
            tmpDbl = tmpDbl / max16(a)
        Else
            tmpDbl = 0
        End If
    ElseIf wdth = 32 Then
        If tmpDbl > max32(a) Then max32(a) = tmpDbl
        If max32(a) > 0 Then
            tmpDbl = tmpDbl / max32(a)
        Else
            tmpDbl = 0
        End If
    End If
Else
    tmpDbl = 0
End If
dst(a) = tmpDbl

Next

End Sub
[/code:2wuyddct]

Simply pass two arrays to the vis_SimplifySpectrum function :
One declared like
Dim src_spectrum(500) As Single
Which you have already send to GetSpectrum

And a second one like
Dim dst_spectrum(15) As Single, with either 16 or 32 elements

After you have passed it to vis_SimplifySpectrum, you will get dst_spectrum with values between 0 and 1 which you can draw.

[edit2] This function does not yet smooth the spectrum, so you could change
dst(a) = tmpDbl
to
dst(a) = (dst(a) + tmpDbl) / 2
[/edit2]

  • You must to post comments
0
0

Alright, could you send me a copy of it??? Thanks.

  • You must to post comments
0
0

Oh, I see, I might implement that. Also, if you click the time display it should give you total time for the song and remaining time. And if you click on the song in the playlist it will give you the approximate time of the file from the ID3, so I am a little bit confused on what you mean about the total time of the song, because I already have it. But I will take a look at your code and see what I can do.

  • You must to post comments
0
0

Hello… I was playing around with your project example and was curious how I’d increase the thickness of the bars and peak bar used in the visual spectrum? So if I were to use a picturebox of greater width, I’d have the bars fill up the spectrum appropriately.

Thanks,
Sterg

  • You must to post comments
0
0

Oh, I am a little confused, could you explain what vis_GetSpectrumCount does?

  • You must to post comments
0
0

You could try to edit the GetrSpectrumCount function to allow for more bars, but that would be hard. And since I didnt write that function I dont know how you would do it. You could just try to plot the raw spectrum data without going through the simplified spectrum, but it wouldn’t be as precise.

  • You must to post comments
0
0

Oh, ok. Nevermind, I just saw what it does. Now I feel stupid. hehe.

  • You must to post comments
0
0

Ok, I have remade my example with a brand new GUI (better I think) and support for changing FMOD settings. So check it out and tell me what you think.

[url:1iw98ed2]http://members.aol.com/libertyed1986/dmp4.zip[/url:1iw98ed2]

  • You must to post comments
Showing 1 - 20 of 23 results
Your Answer

Please first to submit.