bass_fxp dsp EQ problem :-(

Started by Ryzer,

Ryzer

Hi,

I'm creating a class for mu DJ studio containing functions and properties to control a channel with bass. Everything worked fine until I added DSP Equalizer from the newest bass_fx (my bass version is the newest since I downloaded today). I'm working in Visual Basic 6.

Here are the form subs I use to test:

Dim WithEvents Channel1 As clsChannel

Private Sub Form_Load()
Set Channel1 = New clsChannel
Channel1.InitBass (Me.hWnd)
Channel1.OpenFile "F:\test.mp3"
Channel1.Play
Channel1.PositionInSec = 60
Channel1.Volume = 100
Channel1.Pitch = 0
Channel1.EnableEQ = True
End Sub

Private Sub Form_Unload(Cancel As Integer)
Channel1.FreeBass
End Sub

Now the problem is: since I added "Channel1.EnableEQ = True" my musis plays for about a second and I don't hear anything anymore after that...

here are the EnableEQ propertie LET and GET:

Public Property Get EnableEQ() As Boolean
    EnableEQ = ChannelEQ
End Property

Public Property Let EnableEQ(Enabled As Boolean)
    If Enabled = True Then
        Dim EQ As BASS_FX_DSPPEAKEQ
   
        Dim F As Long
        Call BASS_ChannelGetAttributes(Handle, F, 0, 0)
       
        Call BASS_FX_DSP_Set(Handle, BASS_FX_DSPFX_PEAKEQ)
        Call BASS_FX_DSP_Set(Handle, BASS_FX_DSPFX_PEAKEQ)
        Call BASS_FX_DSP_Set(Handle, BASS_FX_DSPFX_PEAKEQ)
       
        EQ.lFreq = F
        EQ.fBandwidth = 2.5
        EQ.fQ = 0
        EQ.fGain = 0
       
        EQ.lBand = 0
        EQ.fCenter = 125
        Call BASS_FX_DSP_SetParameters(Handle, BASS_FX_DSPFX_PEAKEQ, EQ)
       
        EQ.lBand = 1
        EQ.fCenter = 1000
        Call BASS_FX_DSP_SetParameters(Handle, BASS_FX_DSPFX_PEAKEQ, EQ)
       
        EQ.lBand = 2
        EQ.fCenter = 8000
        Call BASS_FX_DSP_SetParameters(Handle, BASS_FX_DSPFX_PEAKEQ, EQ)
       
        Me.EqBass = 19
        Me.EqMid = 5
        Me.EqTrebble = 5
       
        ChannelEQ = True
    Else
        Call BASS_FX_DSP_Remove(Handle, BASS_FX_DSPFX_PEAKEQ)
        ChannelEQ = False
    End If
End Property

and finnaly the properties to set the DSP equaliser values:

Public Property Get EqBass() As Long
    Dim EQ As BASS_FX_DSPPEAKEQ
    EQ.lBand = 0
    Call BASS_FX_DSP_GetParameters(Handle, BASS_FX_DSPFX_PEAKEQ, EQ)
    EqBass = EQ.fGain
End Property

Public Property Let EqBass(EqValue As Long)
    Dim EQ As BASS_FX_DSPPEAKEQ
    EQ.lBand = 0
    Call BASS_FX_DSP_GetParameters(Handle, BASS_FX_DSPFX_PEAKEQ, EQ)
    EQ.fGain = EqValue
    Call BASS_FX_DSP_SetParameters(Handle, BASS_FX_DSPFX_PEAKEQ, EQ)
End Property

Public Property Get EqMid() As Long
    Dim EQ As BASS_FX_DSPPEAKEQ
    EQ.lBand = 1
    Call BASS_FX_DSP_GetParameters(Handle, BASS_FX_DSPFX_PEAKEQ, EQ)
    EqBass = EQ.fGain
End Property

Public Property Let EqMid(EqValue As Long)
    Dim EQ As BASS_FX_DSPPEAKEQ
    EQ.lBand = 1
    Call BASS_FX_DSP_GetParameters(Handle, BASS_FX_DSPFX_PEAKEQ, EQ)
    EQ.fGain = EqValue
    Call BASS_FX_DSP_SetParameters(Handle, BASS_FX_DSPFX_PEAKEQ, EQ)
End Property

Public Property Get EqTrebble() As Long
    Dim EQ As BASS_FX_DSPPEAKEQ
    EQ.lBand = 2
    Call BASS_FX_DSP_GetParameters(Handle, BASS_FX_DSPFX_PEAKEQ, EQ)
    EqBass = EQ.fGain
End Property

Public Property Let EqTrebble(EqValue As Long)
    Dim EQ As BASS_FX_DSPPEAKEQ
    EQ.lBand = 2
    Call BASS_FX_DSP_GetParameters(Handle, BASS_FX_DSPFX_PEAKEQ, EQ)
    EQ.fGain = EqValue
    Call BASS_FX_DSP_SetParameters(Handle, BASS_FX_DSPFX_PEAKEQ, EQ)
End Property

Can anyone see what the problem is??
Thanks!

Ryzer

I really need some help here can some plz look at it  :'(

(: JOBnik! :)

#2
Hi ;D

Could you please send me the whole thing and I'll take a look at it :)
Send the class and an example :)

Have fun!

8) JOBnik! 8)

Ryzer

Holy Crap  ;D I got it to work  :D

Thanks anyway (I don't know what the problem was however lol)

Ryzer

Ok it failed again  :(
JobNIK still interested in taking a look at it?
Thanks

(: JOBnik! :)

Hi ;D

Yep, of course :) feel free to send me to check it out ;)

Have fun!

8) JOBnik! 8)

(: JOBnik! :)

Hi ;D

I've found the problem in your application :)
All you have to do is to add:

ChDrive App.Path
ChDir App.Path


In your function:
Private Sub djOpen_Click(Index As Integer)
After this line:
If Err.Number = 32755 Then Exit Sub

Because the CommonDialog is actually changing the current
path of Windows itself and VB's, so what happens is the BASS_FX.DLL is not being found :)

Have fun!

8) JOBnik! 8)

CatHerder454

or put bassfx dll in your system folder

c:\windows\system or c:\windows\system32 probably  ;)

Ryzer

Thanks it works :)

PS: Sorry for the late reply but I had problems with my PC...