bugfix: make soft clipping default because it's the first in the enum
This commit is contained in:
parent
e1274e7be7
commit
9acddeb29c
1 changed files with 1 additions and 1 deletions
|
|
@ -19,10 +19,10 @@ void Clipper::processStereo(const float *inLeft, const float *inRight,
|
||||||
|
|
||||||
float Clipper::clip(const float in) {
|
float Clipper::clip(const float in) {
|
||||||
switch (mode_) {
|
switch (mode_) {
|
||||||
default:
|
|
||||||
case kClipperModeHard: {
|
case kClipperModeHard: {
|
||||||
return std::fmin(std::fmax(in, -threshold_), threshold_);
|
return std::fmin(std::fmax(in, -threshold_), threshold_);
|
||||||
}
|
}
|
||||||
|
default:
|
||||||
case kClipperModeSoft: {
|
case kClipperModeSoft: {
|
||||||
float normalized = (in / threshold_) * 0.75f;
|
float normalized = (in / threshold_) * 0.75f;
|
||||||
return std::tanh(normalized) * threshold_;
|
return std::tanh(normalized) * threshold_;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue