Getting error with BASS_FXSetParameters

Just starting out? Need help? Post your questions and find answers here.
Martin Verlaan
Enthusiast
Enthusiast
Posts: 135
Joined: Sun Apr 01, 2018 11:26 am
Location: Netherlands
Contact:

Getting error with BASS_FXSetParameters

Post by Martin Verlaan »

I am trying to apply a high pass filter with the Bass/BassFX libraries from Un4seen. But BASS_FXSetParameters returns errorcode 20 (BASS_ERROR_ILLPARAM). Does anybody have an idea what i am doing wrong?

Code: Select all

XIncludeFile "bass.pbi"
XIncludeFile "bassfx.pbi"

OpenWindow(0, #PB_Ignore, #PB_Ignore, 610, 220, "Test") 
BASS_Init(-1, 44100, 0, 0, #Null)

Filename.s = "test.mp3"
chan = BASS_StreamCreateFile(0, @Filename, 0, 0, #BASS_UNICODE) 

Dim param.BASS_BFX_BQF(0)
param(0)\lFilter = 1
param(0)\fCenter = 100 
param(0)\fBandwidth = 0 
param(0)\fQ = 0.7 
param(0)\lChannel = -1

fx = BASS_ChannelSetFX(chan, #BASS_FX_DX8_PARAMEQ, 0) ; add a filter to a stream
BASS_FXSetParameters(fx, param(0)) ; apply the filter parameters
ozzie
Enthusiast
Enthusiast
Posts: 443
Joined: Sun Apr 06, 2008 12:54 pm
Location: Brisbane, Qld, Australia
Contact:

Re: Getting error with BASS_FXSetParameters

Post by ozzie »

I haven't used this function myself, but I think
BASS_FXSetParameters(fx, param(0))
should be
BASS_FXSetParameters(fx, @param(0))
Martin Verlaan
Enthusiast
Enthusiast
Posts: 135
Joined: Sun Apr 01, 2018 11:26 am
Location: Netherlands
Contact:

Re: Getting error with BASS_FXSetParameters

Post by Martin Verlaan »

Hi Mike, with @ i still get the same error
chris_b
Enthusiast
Enthusiast
Posts: 103
Joined: Sun Apr 27, 2003 1:54 am

Re: Getting error with BASS_FXSetParameters

Post by chris_b »

Those parameters don't match #BASS_FX_DX8_PARAMEQ that you ask for in your call to BASS_ChannelSetFX()

Presumably it should be: fx = BASS_ChannelSetFX(chan, #BASS_FX_BFX_BQF, 0)
ozzie
Enthusiast
Enthusiast
Posts: 443
Joined: Sun Apr 06, 2008 12:54 pm
Location: Brisbane, Qld, Australia
Contact:

Re: Getting error with BASS_FXSetParameters

Post by ozzie »

Yes, chris_b, you're right. I hadn't noticed that! I've run some tests here using the (correct) EQ settings, and also tried some echo effects, and it's all working OK.
Martin Verlaan
Enthusiast
Enthusiast
Posts: 135
Joined: Sun Apr 01, 2018 11:26 am
Location: Netherlands
Contact:

Re: Getting error with BASS_FXSetParameters

Post by Martin Verlaan »

Both of you were right and I got it working now! Thanks for your help guys!
Post Reply