void EffectDistortion::HardLimiter() { // The LADSPA "hardLimiter 1413" is basically hard clipping, // but with a 'kind of' wet/dry mix: // out = ((wet-residual)*clipped) + (residual*in) HardClip(); }
void EffectNode::Process(unsigned int bufsize) { if (bufsize>(unsigned int)m_Output.GetLength()) { m_Output.Allocate(bufsize); } ProcessChildren(bufsize); if (ChildExists(0) && !GetChild(0)->IsTerminal() && ChildExists(1)) { if (m_Type==CLIP) { m_Output=GetInput(0); if (GetChild(1)->IsTerminal()) { HardClip(m_Output, GetChild(1)->GetCVValue()); } else { MovingHardClip(m_Output, GetInput(1)); } } else if (m_Type==DISTORT) { m_Output=GetInput(0); if (GetChild(1)->IsTerminal()) { Distort(m_Output, GetChild(1)->GetCVValue()); } else { MovingDistort(m_Output, GetInput(1)); } } else if (ChildExists(2)) { switch (m_Type) { case CRUSH : m_Output=GetInput(0); Crush(m_Output, GetChild(1)->GetCVValue(), GetChild(2)->GetCVValue()); break; case DELAY : { m_Delay.SetDelay(GetChild(1)->GetCVValue()); m_Delay.SetFeedback(GetChild(2)->GetCVValue()); m_Delay.Process(bufsize, GetInput(0), m_Output); break; } default : assert(0); break; } } } }
void EffectDistortion::MakeTable() { switch (mParams.mTableChoiceIndx) { case kHardClip: HardClip(); break; case kSoftClip: SoftClip(); break; case kHalfSinCurve: HalfSinTable(); break; case kExpCurve: ExponentialTable(); break; case kLogCurve: LogarithmicTable(); break; case kCubic: CubicTable(); break; case kEvenHarmonics: EvenHarmonicTable(); break; case kSinCurve: SineTable(); break; case kLeveller: Leveller(); break; case kRectifier: Rectifier(); break; case kHardLimiter: HardLimiter(); break; } }