Author Topic: Replacement for BASS_FXCOMPRESSOR()  (Read 578 times)

decouxb

  • Posts: 6
Replacement for BASS_FXCOMPRESSOR()
« on: 16 Jun '15 - 16:42 »
Hi all,

I've taken over a project using an older version of BASS.NET and I need to find the equivalent of the following section of code:

private static BASS_FXCOMPRESSOR bassCompressor;

public static BASS_FXCOMPRESSOR BassCompressor
{
     get
    {
          if (bassCompressor == null)
          {
               bassCompressor = new BASS_FXCOMPRESSOR();
               bassCompressor.fAttack = .01f;
               bassCompressor.fGain = 5.0f;
               bassCompressor.fPredelay = 0f;
               bassCompressor.fRatio = 10f;
               bassCompressor.fRelease = 50f;
               bassCompressor.fThreshold = -24f;
          }
          return bassCompressor;
    }
}

I looked at BASS_BFX_COMPRESSOR, but it only has the fThreshold property.

Also looked at BASS_DX8_COMPRESSOR, but this is not supported by the BASS_FXSetParameters method, which I would assume is because it's DX8 not FX.

Any help would be greatly appreciated.  I've resolved all of the other upgrade related issues, this is the last one.

Thanks,

Bill

Ian @ un4seen

  • Administrator
  • Posts: 20427
Re: Replacement for BASS_FXCOMPRESSOR()
« Reply #1 on: 16 Jun '15 - 17:48 »
From those parameter names, it looks like it is the DX8 compressor effect (BASS_FX_DX8_COMPRESSOR) that's being used. BASS_DX8_COMPRESSOR (rather than BASS_FXCOMPRESSOR) is the name of the effect's parameter structure, which you can use in BASS_FXSetParameters calls.

decouxb

  • Posts: 6
Re: Replacement for BASS_FXCOMPRESSOR()
« Reply #2 on: 16 Jun '15 - 22:43 »
I was using the BASS_DX8_COMPRESSOR object with BASS_FXSetParameters, but kept getting this feature not support by the language type error.

The property is defined in a static HELPERS class as a static object.  If I create the BASS_DX8_COMPRESSOR locally and use the object in the BASS_FXSetParameters it works fine.  Not sure why this would be a problem, though. 

Any ideas why I can't define the BassCompressor property as static BASS_DX8_COMPRESSOR in a static class and use that in the BASS_FXSetParameters method?


Ian @ un4seen

  • Administrator
  • Posts: 20427
Re: Replacement for BASS_FXCOMPRESSOR()
« Reply #3 on: 17 Jun '15 - 16:03 »
Are you using the latest BASS.Net version now or are you still using an older version?

decouxb

  • Posts: 6
Re: Replacement for BASS_FXCOMPRESSOR()
« Reply #4 on: 17 Jun '15 - 17:03 »
Version 2.4.11

I moved the declaration of the object from the static class and don't get the error now.  Just curious why the static class would affect this.