0
0

Hi,

I would like it very much if someone can tell me how to use DSP in vb, I already have the new FMOD dll with supports stdcall callbacks, but I don’t know how to use the DSP functions in VB.

Things Iam most interested in is an equalizer without the use of DirectX and some reverseB effects.

If someone can send me an example on how to do it would also be great…

Email: hebels13@zonnet.nl

Greetzz,

  • You must to post comments
0
0

Exactly, that is what I am trying to do now. I am having problems with copymemory. For some reason after using copymemory with my callback I must compile the project in P-Code, instead of the standard Native Code, If I compile in native code I get an error with msvbvm60.dll. Its really strange.

  • You must to post comments
0
0

What you have to do is write a callback function which will analyze the digital signal so that you can use DSP on it. And by using the AddressOf function in VB you can use the FMOD DSP functions to call on your Callback function. It is a bit complicated and I have never done it.

  • You must to post comments
0
0

I must have looked over something, but where have you downloaded the stdcall dll?

  • You must to post comments
0
0

[quote="Adion":1ejg7glc]I must have looked over something, but where have you downloaded the stdcall dll?[/quote:1ejg7glc]

You can ask Brett for it with a email, he will send it to you.

  • You must to post comments
0
0

I have the StdCall DLL, and I was wondering if someone might help me with writing a CallBack to display an Oscilloscope like the one in Bretts example. I’m really new to Callbacks so I dont really know where to begin. Thanks.

  • You must to post comments
0
0

Ok, If anyone is interested, I have written my oscilliscope callback and it works pretty good, Heres the code:

This is the callback function to get the data directly from FMOD.
[code:3m8d84hc]

Public Function ScopeCallback(ByVal originalbuffer As Long, ByVal newbuffer As Long, ByVal length As Long, ByVal param As Long) As Long

If UseSpectrum = False Then
    BufSize = length * 2
    'Settings.Mixer_Type <> 0 will detect if the mixer if FPU or not.
    'For a substitute of this you can use FSOUND_GetMixer.'
    If Settings.Mixer_Type <> 0 Then
        ReDim ScopeBufferINT(0 To BufSize) As Integer
        GetScopeINT ScopeBufferINT, newbuffer
    Else
        ReDim ScopeBufferFPU(0 To BufSize) As Single
        GetScopeFPU ScopeBufferFPU, newbuffer
    End If
End If

'VERY IMPORTANT!
ScopeCallback = newbuffer

End Function

[/code:3m8d84hc]

These are the functions that I wrote to convert the buffer into a VB array. GetScopeINT will convert the buffer into an array of integers, and GetScopeFPU will convert the buffer into an array of singles, which is needed if you use the FPU mixer.
[code:3m8d84hc]

Private Function GetScopeINT(ByRef ScopeData() As Integer, ByVal lpBuffer As Long)

CopyMemory ScopeData(0), ByVal lpBuffer, UBound(ScopeData) * 2

End Function

Private Function GetScopeFPU(ByRef ScopeData() As Single, ByVal lpBuffer As Long)

CopyMemory ScopeData(0), ByVal lpBuffer, UBound(ScopeData) * 4

End Function

[/code:3m8d84hc]

If you have any questions ask me!

  • You must to post comments
0
0

This code works great, I already have tried to get the code from your newest player but it didn’t work, now this one works ok 😀

  • You must to post comments
0
0

Good, it is a bit slow though, but that was anticipated because of VB’s inability to handle pointers and such. But I think it is a good example of how it is done! :)

  • You must to post comments
0
0

Looks very good, but to be complete, you should also create the SetScope functions that can be called before returning from the callback, so it can actually be used as a dsp callback (not just reading the data, but also altering it)

  • You must to post comments
Showing 9 results
Your Answer

Please first to submit.