@@ -30,6 +30,8 @@ Plateau2::Plateau2(const InstanceInfo& info)
3030 GetParam (kNesting1 )->InitBool (" Nested Tank Diffusion 1" , false );
3131 GetParam (kInputNesting1 )->InitBool (" Nested Input Diffusion 1" , false );
3232 GetParam (kDiffusionDecay1 )->InitPercentage (" Tank Diffusion Decay 1" , 76.9230 );
33+ GetParam (kVariance1 )->InitDouble (" Tank Variance 1" , 1 ., 0 ., 1 ., 0.01 );
34+ GetParam (kSoftClip1 )->InitBool (" Soft Clip 1" , false );
3335 GetParam (kInput1 )->InitPercentage (" Input 1" , 100 );
3436 GetParam (kStereoSource1 )->InitPercentage (" Stereo Source 1" , 0 , -100 , 100 );
3537 GetParam (kWidth1 )->InitPercentage (" Stereo Width 1" , 100 , 0 , 200 );
@@ -62,6 +64,8 @@ Plateau2::Plateau2(const InstanceInfo& info)
6264 GetParam (kNesting2 )->InitBool (" Nested Tank Diffusion 2" , false );
6365 GetParam (kInputNesting2 )->InitBool (" Nested Input Diffusion 2" , false );
6466 GetParam (kDiffusionDecay2 )->InitPercentage (" Tank Diffusion Decay 2" , 76.9230 );
67+ GetParam (kVariance2 )->InitDouble (" Tank Variance 2" , 1 ., 0 ., 1 ., 0.01 );
68+ GetParam (kSoftClip2 )->InitBool (" Soft Clip 2" , false );
6569 GetParam (kInput2 )->InitPercentage (" Input 2" , 100 );
6670 GetParam (kStereoSource2 )->InitPercentage (" Stereo Source 2" , 0 , -100 , 100 );
6771 GetParam (kWidth2 )->InitPercentage (" Stereo Width 2" , 100 , 0 , 200 );
@@ -146,7 +150,9 @@ Plateau2::Plateau2(const InstanceInfo& info)
146150 Knobs[kDiffusionDecayKnob ] = new NeedleKnob (IRECT::MakeXYWH (233 , 310 , 56 , 56 ), NeedleSVG, NeedleBGSVG, NeedleFG1PNG, NeedleFG2PNG, kDiffusionDecay1 , kDiffusionDecay2 );
147151 Knobs[kDiffusionDecayKnob ]->Bound = 72 .6923f ;
148152
149- Knobs[kModVarianceKnob ] = new NeedleKnob (IRECT::MakeXYWH (233 , 518 , 56 , 56 ), NeedleSVG, NeedleBGSVG, NeedleFG1PNG, NeedleFG2PNG, kModVariance1 , kModVariance2 );
153+ Knobs[kModVarianceKnob ] = new NeedleKnob (IRECT::MakeXYWH (130 , 220 , 56 , 56 ), NeedleSVG, NeedleBGSVG, NeedleFG1PNG, NeedleFG2PNG, kModVariance1 , kModVariance2 );
154+
155+ Knobs[kVarianceKnob ] = new NeedleKnob (IRECT::MakeXYWH (26 , 310 , 56 , 56 ), NeedleSVG, NeedleBGSVG, NeedleFG1PNG, NeedleFG2PNG, kVariance1 , kVariance2 );
150156
151157 // Routing Page Knobs
152158 Knobs[kInputKnob ] = new NeedleKnob (IRECT::MakeXYWH (93 , 170 , 56 , 56 ), NeedleSVG, NeedleBGSVG, NeedleFG1PNG, NeedleFG2PNG, kInput1 , kInput2 );
@@ -214,12 +220,14 @@ Plateau2::Plateau2(const InstanceInfo& info)
214220 Switches[5 ] = new LEDSwitch (IRECT::MakeXYWH (210 , 170 , 102 , 102 ), LEDScale, LedOffSVG, LedOn1SVG, LedOn2SVG, kNesting1 , kNesting2 );
215221
216222 // DANGER switch
217- Switches[6 ] = new LEDSwitch (IRECT::MakeXYWH (102 , 301 , 112 , 112 ), 1 , DangerOffSVG, DangerOnSVG, DangerOnSVG, kDanger , kDanger );
223+ Switches[6 ] = new LEDSwitch (IRECT::MakeXYWH (102 , 321 , 112 , 112 ), 1 , DangerOffSVG, DangerOnSVG, DangerOnSVG, kDanger , kDanger );
224+
225+ Switches[7 ] = new LEDSwitch (IRECT::MakeXYWH (3 , 170 , 102 , 102 ), LEDScale, LedOffSVG, LedOn1SVG, LedOn2SVG, kSoftClip1 , kSoftClip2 );
218226
219227 // Routing page Switches
220- Switches[7 ] = new LEDSwitch (IRECT::MakeXYWH (106.5 , 374 , 102 , 102 ), LEDScale, LedOffSVG, LedOn1SVG, LedOn2SVG, k1to2, k2to1);
228+ Switches[8 ] = new LEDSwitch (IRECT::MakeXYWH (106.5 , 374 , 102 , 102 ), LEDScale, LedOffSVG, LedOn1SVG, LedOn2SVG, k1to2, k2to1);
221229
222- for (int i = 5 ; i <= 7 ; i++) {
230+ for (int i = 5 ; i <= 8 ; i++) {
223231 pGraphics->AttachControl (Switches[i]);
224232 Switches[i]->Hide (true );
225233 }
@@ -296,24 +304,24 @@ void Plateau2::UpdatePageVisibility()
296304 }
297305
298306 // Extras page
299- for (int i = kPreDelayKnob ; i <= kModVarianceKnob ; i++) {
307+ for (int i = kPreDelayKnob ; i <= kVarianceKnob ; i++) {
300308 Knobs[i]->Hide (currentPage != 1 );
301309 }
302- for (int i = 5 ; i <= 6 ; i++) {
310+ for (int i = 5 ; i <= 7 ; i++) {
303311 Switches[i]->Hide (currentPage != 1 );
304312 }
305313
306314 // Routing page
315+ Switches[8 ]->Hide (currentPage != 2 );
316+
307317 for (int i = kInputKnob ; i <= kPanKnob ; i++) {
308318 Knobs[i]->Hide (currentPage != 2 );
309319 }
320+
310321 UpdateSendVisibility ();
311322}
312323
313324void Plateau2::UpdateSendVisibility () {
314- for (int i = 7 ; i <= 7 ; i++) {
315- Switches[i]->Hide (currentPage != 2 );
316- }
317325 bool dangerous = GetParam (kDanger )->Value ();
318326 for (int i = kSendLevel ; i <= kSendHighDamp ; i++) {
319327 Knobs[i]->Hide (currentPage != 2 || (!dangerous && tank2Selected));
@@ -420,6 +428,9 @@ void Plateau2::OnParamChange(int index)
420428 reverb1.setTankDiffusionDecay (scaled);
421429 break ;
422430 }
431+ case kVariance1 :
432+ reverb1.setTankVariance (GetParam (index)->Value ());
433+ break ;
423434 case kStereoSource1 :
424435 sourceBalance1 = balanceFactors (GetParam (kStereoSource1 )->Value ()/100 );
425436 break ;
@@ -503,6 +514,9 @@ void Plateau2::OnParamChange(int index)
503514 reverb2.setTankDiffusionDecay (scaled);
504515 break ;
505516 }
517+ case kVariance2 :
518+ reverb2.setTankVariance (GetParam (index)->Value ());
519+ break ;
506520 case kStereoSource2 :
507521 sourceBalance2 = balanceFactors (GetParam (kStereoSource2 )->Value ()/100 );
508522 break ;
@@ -568,6 +582,7 @@ void Plateau2::ProcessBlock(sample** inputs, sample** outputs, int nFrames)
568582 const double wet1Param = GetParam (kWet1 )->Value () / 100 ;
569583 const double input1 = GetParam (kInput1 )->Value () / 100 ;
570584 const double level2to1 = GetParam (k2to1Level)->Value () / 100 ;
585+ const double softClip1 = GetParam (kSoftClip1 )->Value () >= 0.5 ;
571586
572587 if (clear1Param && !clear1 && cleared1) {
573588 cleared1 = false ;
@@ -616,9 +631,16 @@ void Plateau2::ProcessBlock(sample** inputs, sample** outputs, int nFrames)
616631
617632 outputs[0 ][s] += std::get<0 >(out) * wet1Param;
618633
634+ if (softClip1) {
635+ outputs[0 ][s] = std::tanh (outputs[0 ][s]);
636+ }
637+
619638 if (nChans > 1 )
620639 {
621640 outputs[1 ][s] += std::get<1 >(out) * wet1Param;
641+ if (softClip1) {
642+ outputs[1 ][s] = std::tanh (outputs[1 ][s]);
643+ }
622644 }
623645
624646 if (send1to2) {
@@ -639,6 +661,7 @@ void Plateau2::ProcessBlock(sample** inputs, sample** outputs, int nFrames)
639661 const double wet2Param = GetParam (kWet2 )->Value () / 100 ;
640662 const double input2 = GetParam (kInput2 )->Value () / 100 ;
641663 const double level1to2 = GetParam (k1to2Level)->Value () / 100 ;
664+ const double softClip2 = GetParam (kSoftClip2 )->Value () >= 0.5 ;
642665
643666 if (clear2Param && !clear2 && cleared2) {
644667 cleared2 = false ;
@@ -688,9 +711,16 @@ void Plateau2::ProcessBlock(sample** inputs, sample** outputs, int nFrames)
688711
689712 outputs[0 ][s] += std::get<0 >(out) * wet2Param;
690713
714+ if (softClip2) {
715+ outputs[0 ][s] = std::tanh (outputs[0 ][s]);
716+ }
717+
691718 if (nChans > 1 )
692719 {
693720 outputs[1 ][s] += std::get<1 >(out) * wet2Param;
721+ if (softClip2) {
722+ outputs[1 ][s] = std::tanh (outputs[1 ][s]);
723+ }
694724 }
695725
696726 if (send2to1) {
0 commit comments