BASS_FX_PARAMEQ not working ?

Started by Fiens,

Fiens

Hello everybody.
I use bass, everything is perfect, i can play stream, cd, control level, fx (echo, flange, chorus) but i can not use
BASS_FX_PARAMEQ.
Is there anybody to explain me with a short sample how it works, 3 sliders (bass, medium, high) are enough.
I use function BASS_ChannelSetFX(), i have no error message,
(return > 0), but when i try to change slider, noting appear.

Fiens

Re-hello everybody.
I forgot to say in my early message that i work with Delphi.
Thanks.

Fiens

Your forum is perfect, i have find what i needed and it works fine.
here folow your forum-beautiful help.
Hope it can help somebody...

/////////////////////////////////////////////
Using direct 8 fx and delphi its quite easy:

You say an x band but you can modify the code below to an x number depending on cpu I think.
I'm not saying this is the perfect way to do it- but it works

First remember to add bass to the uses list at the top of the project

Place 3 trackbars on your form:
trackbar1
trackbar2
trackbar3
for each one
orientate them vertically
set min to -15 and max to 15

add to the var section at the top of the new project:


 
 low : BASS_FXparameq</b>; // 1st band of eq
 lhnd : HFX; // 1st band handle
 mid : BASS_FXparameq</b>; // 2nd band of eq
 mhnd : HFX; // 2nd band handle
 high : BASS_FXparameq</b>; // 3rd band of eq
 hhnd : HFX; // 3rd band handle
 streamh : DWORD; // Stream handle
 


Add this to the list of procedures


procedure upeq; // Update EQ
 


To form load or place on a button put:


Bass_Init(-1, 44100, 0, Form1.handle); //Init bass on default device
Bass_Start; // Start Bass
streamh := Bass_StreamCreateFile(FALSE, pChar('one.mp3'), 0, 0, 0); // Load a mp3
Bass_StreamPlay(streamh, FALSE, 0); // Play the mp3
//////////////////// Set the EQ objects to the stream
lhnd := BASS_ChannelSetFX(streamh, BASS_FX_parameq</b>);
mhnd := BASS_ChannelSetFX(streamh, BASS_FX_parameq</b>);
hhnd := BASS_ChannelSetFX(streamh, BASS_FX_parameq</b>);
//////////////////// Set 1st band settings
low.fCenter := 125;
low.fBandwidth := 5;
low.fGain := 0;
//////////////////// Set 2nd band settings
mid.fCenter := 1000;
mid.fBandwidth := 5;
mid.fGain := 0;
//////////////////// Set 3rd band settings
high.fCenter := 8000;
high.fBandwidth := 5;
high.fGain := 0;
//////////////////// // Apply Settings to song
BASS_FXSetParameters(lhnd, @low);
BASS_FXSetParameters(mhnd, @mid);
BASS_FXSetParameters(hhnd, @high);
 


On Form Destroy:


Bass_Free; // Free Bass
 


Under each of the trackbars OnChange event place:


upeq; // Update EQ
 


Finally make the new proc upeq:


procedure TForm1.upeq;
begin
////////// Set each eq instance to the correct gain
low.fGain := -trackbar1.Position;
mid.fGain := -trackbar2.Position;
high.fGain := -trackbar3.Position;
////////// Update Band Settings
BASS_FXSetParameters(lhnd, @low);
BASS_FXSetParameters(mhnd, @mid);
BASS_FXSetParameters(hhnd, @high);
//////////
end;
 


Right this works in delphi- but I'm sure theres a quicker or maybe easier way- or maybe not. I've just made up the band settings so it wont sound too spectacular. use your own or look at the thread off yesterday or the day before about band settings.

Hope this helps.

bigjim

I was just about to say I thought I posted a code snippet for this ;)