10 band equalizer (like in Winamp)

Started by Sebastian_Mares,

Sebastian_Mares

Does anyone has a VB code for a 10 band equalizer?

Thank you!

Ryzer

This will do it, you still need to put more bands to it like it says in the comments, 3 are set, you do 4 to 10.

All you need to have is 10 sliders in an array:
sEQ1(0) to sEQ1(9)

Greetz,
Ryzer

               'Get current sample rate of a Handle
                Dim f As Long
                Call BASS_ChannelGetAttributes(chan1, f, vbNull, vbNull)
                
                'Set the EQ effect + 1st Band
                Call BASS_FX_DSP_Set(chan1, BASS_FX_DSPFXEQ)
                Call BASS_FX_DSP_Set(chan1, BASS_FX_DSPFXEQ)
                Call BASS_FX_DSP_Set(chan1, BASS_FX_DSPFXEQ)
                Call BASS_FX_DSP_Set(chan1, BASS_FX_DSPFXEQ)
                Call BASS_FX_DSP_Set(chan1, BASS_FX_DSPFXEQ)
                Call BASS_FX_DSP_Set(chan1, BASS_FX_DSPFXEQ)
                Call BASS_FX_DSP_Set(chan1, BASS_FX_DSPFXEQ)
                Call BASS_FX_DSP_Set(chan1, BASS_FX_DSPFXEQ)
                Call BASS_FX_DSP_Set(chan1, BASS_FX_DSPFXEQ)
                Call BASS_FX_DSP_Set(chan1, BASS_FX_DSPFXEQ)
                
                Dim eq As BASS_FX_DSPEQ
                
                eq.eqFreq = f
                eq.eqBandwidth = 2.5
                eq.eqGain = 0
                
            'number one
                eq.eqBand = 0
                eq.eqCenter = 125
                Call BASS_FX_DSP_SetParameters(chan1, BASS_FX_DSPFXEQ, eq)

            'number two                
                eq.eqBand = 1
                eq.eqCenter = 1000
                Call BASS_FX_DSP_SetParameters(chan1, BASS_FX_DSPFXEQ, eq)

            'number three                
                eq.eqBand = 2
                eq.eqCenter = 8000
                Call BASS_FX_DSP_SetParameters(chan1, BASS_FX_DSPFXEQ, eq)
            
            'JUST MAKE NUMBER 4 TO 10 HOW YOU WOULD LIKE IT, CHANGE THE EQCENTER VALUE
            '4
            '5
            '6
            '7
            '8
            '9
            '10


                'Update EQ Gain
                Dim i As Integer
                
                For i = 0 To 9
                    Call sEQ1_Change(i)
                Next i

Sebastian_Mares


Ryzer

The frequency of the EQ slider in HZ
so 125 = 125hz
1000 = 1Khz
8000 = 8Khz
etc...

So there you choose the frequency of your 10 sliders.
You can offcourse always change the freq of the first 3 sliders that are already given

Ryzer

btw the code I gave was the initialisation of the EQ,
put it in form_load or something

here is the code for the sliders:

Private Sub sEQ1_Change(Index As Integer)
    Dim eq As BASS_FX_DSPEQ
   
    eq.eqBand = Index   'Band values you would like to get
   
    Call BASS_FX_DSP_GetParameters(chan1, BASS_FX_DSPFXEQ, eq)
        eq.eqGain = 10 - sEQ1(Index).value
    Call BASS_FX_DSP_SetParameters(chan1, BASS_FX_DSPFXEQ, eq)
End Sub