Author Topic: Floating point mixing with clipping but constant levels  (Read 3105 times)

mr.sam

  • Guest
I use floating point EQ. When I increase level of one band, levels of all other bands will decrease. As I understand, this happens to prevent clipping. But I don't need this feature.
Well, with EQ DSP I can do something like this (Delphi =):

CurrentSample := Min(1, CurrentSample);
CurrentSample := Max(-1, CurrentSample);

So, it'll always be -1 <= CurrentSample <= 1. (Clipping. No level changes.)

But, the same thing happens when I'm playing 2 or more channels on the same device. And I have no idea how to play channels with clipping but with constant levels. Could someone help me?

Thank you.

Ian @ un4seen

  • Administrator
  • Posts: 20427
What Windows version are you using? An EQ effect shouldn't automatically lower other frequencies, so what I suspect you're hearing is Vista/7's limiter/compressor kicking in, ie. the EQ adjustment is taking the level out of range, so the limiter lowers the level of it all, but since the EQ is boosting a particular band of frequencies, it sounds like only the other frequencies have been lowered.

To avoid the limiter, you could clip the sample data (limit to within +/-1) yourself in a DSP function at the end of the DSP chain, eg. via BASS_ChannelSetDSP with a low "priority". If you're using DX8 effects, make sure you don't use the BASS_SAMPLE_FX flag, so that the DX8 effects are part of the normal DSP chain.

mr.sam

  • Guest
Quote
I suspect you're hearing is Vista/7's limiter/compressor kicking in, ie. the EQ adjustment is taking the level out of range, so the limiter lowers the level of it all, but since the EQ is boosting a particular band of frequencies, it sounds like only the other frequencies have been lowered.

This is actually what I tried to explain.

Quote
To avoid the limiter, you could clip the sample data (limit to within +/-1) yourself in a DSP function at the end of the DSP chain, eg. via BASS_ChannelSetDSP with a low "priority". If you're using DX8 effects, make sure you don't use the BASS_SAMPLE_FX flag, so that the DX8 effects are part of the normal DSP chain.

I've already done this and it works.

Quote
CurrentSample := Min(1, CurrentSample);
CurrentSample := Max(-1, CurrentSample);

So, it'll always be -1 <= CurrentSample <= 1. (Clipping. No level changes.)

I wrote about EQ as an example. But I can't limit output by myself in a device mixer when playing 2 or more channels. Is there a way to disable OS's limiter?

Thank you.

mr.sam

  • Guest
Quote
Is there a way to disable OS's limiter?

OS's limiter/compressor I mean.

Ian @ un4seen

  • Administrator
  • Posts: 20427
I'm not aware of any way to disable Windows' limiter. I have seen mention of ticking the "Disable all enhancements" box in the Sound control panel, but that hasn't appeared to have any effect on the limiter when I've tried it. If you want to totally avoid it, it's looking like you may have to use ASIO or exclusive mode WASAPI output to do so (eg. using BASSASIO and/or BASSWASAPI).