Some EQ questions (may seem stupid)

Started by Atilla,

Atilla

Now i really checked the forums for what i'm asking here, but with no luck ...

If i want to buld a 10-band prametric equalizer using the BASS_Parameq, what are the values i need, so everything sounds nice. I got that a range of 12 is an full octave. I got that the max center frequency has to be 1/3 of the channel output frequency. (If i have 44 100, the max would be around 14 700). Is that all correct? Also - if I use a range of 2, for example, i change a fery small spectrum, so the EQ wouldn't be very effective.

Also if i set the smalles center FQ to 80, which is the minumum, and set the range to 12, i'm actually losing half of the range, because 80 is the minimum value thet can be changed right? (Yes I know that human is able to hear sounds above 50hz, but there are really very few speaker systems able to produce thet low Frequencies).


The last thing. When i free the stream, the EQ settings are lost for the next song. How do i tell bass, that i want to start a new song with the same EQ setings, without restarting the equalizer. I saw something about BASS_CahnnelSlide, but couldn't get it...

Ian @ un4seen

The standard 10 bands would be 31.25, 62.5, 125, 250, 500, 1000, 2000, 4000, 8000, 16000 - all an octave apart. But, as you say, the DX EQ doesn't allow center freqs lower than 80hz.

If you want 10 bands evenly spread across the whole allowable frequency range, regardless of the channel's sample rate, then you could do something like this...
HSTREAM chan;
HFX eq[10]; // EQ band handles
float gain[10]={0}; // EQ band gains

void InitEQ()
{
      int a;
      BASS_FXPARAMEQ p;
      DWORD freq;
      BASS_ChannelGetAttributes(chan,&freq,NULL,NULL);
      freq=min(freq/3,16000); // max center freq DX will allow
      p.fBandwidth=12*log(freq/80.0)/log(2)/9;
      for (a=0;a<10;a++) {
            eq[a]=BASS_ChannelSetFX(chan,BASS_FX_PARAMEQ);
            p.fCenter=80*pow(freq/80.0,a/9.0);
            p.fGain=gain[a];
            BASS_FXSetParameters(eq[a],&p);
      }
}

...

BASS_StreamFree(chan); // free old channel
chan=BASS_StreamCreateFile(...); // create new one
InitEQ(); // setup eq on it

Regarding retaining EQ settings... you can simply store the gains in an array, and reuse them when initializing the eq on a channel - as in the example above :)

Atilla

Basicly this is almost what i'm doing - reapplying the array for the new stream. Only that mine is dynamic array. I was just wondering if there is a better way of doing it. 10x for the freq. tip.