How do I turn off an effect?

Started by Phil75,

Phil75

Hello  :)

I applied an 3-band equalizer on a Mixer Stream :

            hMixerMasterEQ = Bass.BASS_ChannelSetFX(hMixerMaster, BASSFXType.BASS_FX_BFX_PEAKEQ, 0)
            eq = New BASS_BFX_PEAKEQ
            eq.fQ = 0F
            eq.fBandwidth = 2.5F
            eq.lChannel = BASSFXChan.BASS_BFX_CHANALL
            eq.lBand = 0
            eq.fCenter = 125.0F
            Bass.BASS_FXSetParameters(hMixerMasterEQ, eq)
            eq.lBand = 1
            eq.fCenter = 800.0F
            Bass.BASS_FXSetParameters(hMixerMasterEQ, eq)
            eq.lBand = 2
            eq.fCenter = 4000.0F
            Bass.BASS_FXSetParameters(hMixerMasterEQ, eq)

In the program, I added a CheckBox to enable or disable the Equalizer :

If Me.ckbBypassEQ.Checked = True Then
    hMixerMasterEQ = Bass.BASS_ChannelRemoveFX(hMixerMaster, hMixerMasterEQ)
Else
    hMixerMasterEQ = Bass.BASS_ChannelSetFX(hMixerMaster, BASSFXType.BASS_FX_BFX_PEAKEQ, 0)
End If

But it seems that "BASS_ChannelRemoveFX" also removes the Bands.

Is there an easier way to disable an effect?
For example, as with "BassVst", the "BASS_VST_SetBypass" method.

Ian @ un4seen

You would need to call BASS_FXSetParameters again to reapply the parameters/bands after each BASS_ChannelSetFX call.

There is a new BASS_FXSetBypass function coming in BASS 2.4.18. If you're interested in that, it's also in the latest build available here:

    www.un4seen.com/stuff/bass.zip

It isn't included in BASS.Net yet, but perhaps you can "import" it yourself in the meantime? Perhaps something like this:

<DllImport("bass.dll")>
Public Shared Function BASS_FXSetBypass(handle As Integer, bypass As Boolean) As Boolean
End Function

And then:

BASS_FXSetBypass(hMixerMasterEQ, True) ' bypass

BASS_FXSetBypass(hMixerMasterEQ, False) ' resume

Phil75

@Ian Everything works, it's great, thank you very much  :)