Page 1 of 1

Getting error with BASS_FXSetParameters

Posted: Fri May 18, 2018 12:39 pm
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

Re: Getting error with BASS_FXSetParameters

Posted: Sat May 19, 2018 3:51 am
by ozzie
I haven't used this function myself, but I think
BASS_FXSetParameters(fx, param(0))
should be
BASS_FXSetParameters(fx, @param(0))

Re: Getting error with BASS_FXSetParameters

Posted: Sat May 19, 2018 11:14 pm
by Martin Verlaan
Hi Mike, with @ i still get the same error

Re: Getting error with BASS_FXSetParameters

Posted: Mon May 21, 2018 9:35 pm
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)

Re: Getting error with BASS_FXSetParameters

Posted: Tue May 22, 2018 8:25 am
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.

Re: Getting error with BASS_FXSetParameters

Posted: Tue May 22, 2018 8:43 am
by Martin Verlaan
Both of you were right and I got it working now! Thanks for your help guys!