@@ -28,8 +28,11 @@ Plateau2::Plateau2(const InstanceInfo& info)
2828 GetParam (kPreDelay1 )->InitSeconds (" Pre Delay 1" , 0 ., 0 ., 0.5 , 0.01 );
2929 GetParam (kNesting1 )->InitBool (" Nested Tank Diffusion 1" , false );
3030 GetParam (kInputNesting1 )->InitBool (" Nested Input Diffusion 1" , false );
31- // GetParam(kDiffusionDecay1)->InitPercentage("Tank Diffusion Decay 1", 75, 20, 130);
3231 GetParam (kDiffusionDecay1 )->InitPercentage (" Tank Diffusion Decay 1" , 100 );
32+ GetParam (kInput1 )->InitPercentage (" Input 1" , 100 );
33+ GetParam (kStereoSource1 )->InitPercentage (" Stereo Source 1" , 0 , -100 , 100 );
34+ GetParam (kWidth1 )->InitPercentage (" Stereo Width 1" , 100 , 0 , 200 );
35+ GetParam (kPan1 )->InitPercentage (" Pan 1" , 0 , -100 , 100 );
3336
3437
3538 GetParam (kEnable2 )->InitBool (" Tank 2 Enable" , false );
@@ -52,6 +55,10 @@ Plateau2::Plateau2(const InstanceInfo& info)
5255 GetParam (kNesting2 )->InitBool (" Nested Tank Diffusion 2" , false );
5356 GetParam (kInputNesting2 )->InitBool (" Nested Input Diffusion 2" , false );
5457 GetParam (kDiffusionDecay2 )->InitPercentage (" Tank Diffusion Decay 2" , 100 );
58+ GetParam (kInput2 )->InitPercentage (" Input 2" , 100 );
59+ GetParam (kStereoSource2 )->InitPercentage (" Stereo Source 2" , 0 , -100 , 100 );
60+ GetParam (kWidth2 )->InitPercentage (" Stereo Width 2" , 100 , 0 , 200 );
61+ GetParam (kPan2 )->InitPercentage (" Pan 2" , 0 , -100 , 100 );
5562
5663
5764 GetParam (kDanger )->InitBool (" DANGER! Allow Unsafe Feedback Settings" , false );
@@ -77,9 +84,9 @@ Plateau2::Plateau2(const InstanceInfo& info)
7784 pGraphics->AttachCornerResizer (EUIResizerMode::Scale, false );
7885 pGraphics->AttachSVGBackground (BACKGROUND_FN);
7986
80- ISVG PageBackgrounds[kNumPages ] = { pGraphics->LoadSVG (PAGEMAIN_FN), pGraphics->LoadSVG (PAGEEXTRAS_FN) };
81- ISVG NextButtons[kNumPages ] = { pGraphics->LoadSVG (NEXTEXTRAS_FN), pGraphics->LoadSVG (NEXTMAIN_FN) };
82- ISVG PrevButtons[kNumPages ] = { pGraphics->LoadSVG (PREVEXTRAS_FN ), pGraphics->LoadSVG (PREVMAIN_FN) };
87+ ISVG PageBackgrounds[kNumPages ] = { pGraphics->LoadSVG (PAGEMAIN_FN), pGraphics->LoadSVG (PAGEEXTRAS_FN), pGraphics-> LoadSVG (PAGEROUTING_FN) };
88+ ISVG NextButtons[kNumPages ] = { pGraphics->LoadSVG (NEXTEXTRAS_FN), pGraphics->LoadSVG (NEXTROUTING_FN), pGraphics-> LoadSVG ( NEXTMAIN_FN) };
89+ ISVG PrevButtons[kNumPages ] = { pGraphics->LoadSVG (PREVROUTING_FN ), pGraphics->LoadSVG (PREVMAIN_FN), pGraphics-> LoadSVG (PREVEXTRAS_FN ) };
8390
8491 PageBackgroundControl = new ISVGControl (pGraphics->GetBounds (), PageBackgrounds[0 ]);
8592 pGraphics->AttachControl (PageBackgroundControl);
@@ -108,20 +115,32 @@ Plateau2::Plateau2(const InstanceInfo& info)
108115 }
109116
110117 Knobs[12 ] = new NeedleKnob (IRECT::MakeXYWH (140 , 140 , 35 , 35 ), NeedleSVG, NeedleBGSVG, NeedleFG1PNG, NeedleFG2PNG, kPreDelay1 , kPreDelay2 );
111- Knobs[13 ] = new NeedleKnob (IRECT::MakeXYWH (203 , 310 , 56 , 56 ), NeedleSVG, NeedleBGSVG, NeedleFG1PNG, NeedleFG2PNG, kDiffusionDecay1 , kDiffusionDecay2 );
118+
119+ Knobs[13 ] = new NeedleKnob (IRECT::MakeXYWH (233 , 310 , 56 , 56 ), NeedleSVG, NeedleBGSVG, NeedleFG1PNG, NeedleFG2PNG, kDiffusionDecay1 , kDiffusionDecay2 );
112120 Knobs[13 ]->StartAngle = -72 .6923f ;
113121 Knobs[13 ]->EndAngle = 72 .6923f ;
122+
123+ Knobs[14 ] = new NeedleKnob (IRECT::MakeXYWH (93 , 160 , 56 , 56 ), NeedleSVG, NeedleBGSVG, NeedleFG1PNG, NeedleFG2PNG, kInput1 , kInput2 );
124+ Knobs[15 ] = new NeedleKnob (IRECT::MakeXYWH (166 , 160 , 56 , 56 ), NeedleSVG, NeedleBGSVG, NeedleFG1PNG, NeedleFG2PNG, kStereoSource1 , kStereoSource2 );
125+
126+ Knobs[16 ] = new NeedleKnob (IRECT::MakeXYWH (93 , 250 , 56 , 56 ), NeedleSVG, NeedleBGSVG, NeedleFG1PNG, NeedleFG2PNG, kWidth1 , kWidth2 );
127+ Knobs[17 ] = new NeedleKnob (IRECT::MakeXYWH (166 , 250 , 56 , 56 ), NeedleSVG, NeedleBGSVG, NeedleFG1PNG, NeedleFG2PNG, kPan1 , kPan2 );
114128
115- for (int i = 12 ; i <= 13 ; i++) {
129+ for (int i = 12 ; i <= 17 ; i++) {
116130 pGraphics->AttachControl (Knobs[i]);
117131 Knobs[i]->Hide (true );
118132 }
119133
120- NextButtonControl = new NavigatorButton (IRECT::MakeXYWH (220 . 572f , 125 .695f , 82 . 306f , 30 . f ), [this , PageBackgrounds, NextButtons, PrevButtons](IControl* pCaller) {
134+ NextButtonControl = new NavigatorButton (IRECT::MakeXYWH (213 , 125 .695f , 90 , 30 ), [this , PageBackgrounds, NextButtons, PrevButtons](IControl* pCaller) {
121135 ChangePage (1 , PageBackgrounds, NextButtons, PrevButtons);
122- }, pGraphics-> LoadSVG (NEXTEXTRAS_FN) );
136+ }, NextButtons[ 0 ] );
123137 pGraphics->AttachControl (NextButtonControl);
124138
139+ PrevButtonControl = new NavigatorButton (IRECT::MakeXYWH (12 , 125 .695f , 90 , 30 ), [this , PageBackgrounds, NextButtons, PrevButtons](IControl* pCaller) {
140+ ChangePage (-1 , PageBackgrounds, NextButtons, PrevButtons);
141+ }, PrevButtons[0 ]);
142+ pGraphics->AttachControl (PrevButtonControl);
143+
125144 double LEDScale = 0 .2453054f ;
126145
127146 const ISVG LedOffSVG = pGraphics->LoadSVG (LEDOFF_FN);
@@ -157,10 +176,10 @@ Plateau2::Plateau2(const InstanceInfo& info)
157176 pGraphics->AttachControl (Switches[i]);
158177 }
159178
160- Switches[5 ] = new LEDSwitch (IRECT::MakeXYWH (228 , 216 , 102 , 102 ), LEDScale, LedOffSVG, LedOn1SVG, LedOn2SVG, kNesting1 , kNesting2 );
179+ Switches[5 ] = new LEDSwitch (IRECT::MakeXYWH (210 , 170 , 102 , 102 ), LEDScale, LedOffSVG, LedOn1SVG, LedOn2SVG, kNesting1 , kNesting2 );
161180
162181 // DANGER switch
163- Switches[6 ] = new LEDSwitch (IRECT::MakeXYWH (130 , 329 , 56 , 56 ). GetScaledAboutCentre ( 2 ), 1 , DangerOffSVG, DangerOnSVG, DangerOnSVG, kDanger , kDanger );
182+ Switches[6 ] = new LEDSwitch (IRECT::MakeXYWH (102 , 301 , 112 , 112 ), 1 , DangerOffSVG, DangerOnSVG, DangerOnSVG, kDanger , kDanger );
164183
165184 for (int i = 5 ; i <= 6 ; i++) {
166185 pGraphics->AttachControl (Switches[i]);
@@ -189,7 +208,7 @@ void Plateau2::SelectTank(bool tank2) {
189208 for (int i = 0 ; i < kNumKnobs ; i++) {
190209 Knobs[i]->SelectTank (tank2);
191210 // Knobs[i]->SetValue(GetParam(Knobs[i]->GetParamIdx())->Value());
192- IEditorDelegate::SendParameterValueFromDelegate (Knobs[i]->GetParamIdx (), GetParam (Knobs[i]->GetParamIdx ())->GetNormalized (), true );
211+ // IEditorDelegate::SendParameterValueFromDelegate(Knobs[i]->GetParamIdx(), GetParam(Knobs[i]->GetParamIdx())->GetNormalized(), true);
193212 }
194213 for (int i = 0 ; i < kNumSwitches ; i++) {
195214 Switches[i]->SelectTank (tank2);
@@ -210,8 +229,7 @@ void Plateau2::ChangePage(int direction, const ISVG PageBackgrounds[kNumPages],
210229 PageBackgroundControl->SetDirty (false );
211230
212231 NextButtonControl->SetSVG (NextButtons[currentPage]);
213-
214- // PrevButtonControl->SetSVG(PreviousButtons[currentPage]);
232+ PrevButtonControl->SetSVG (PreviousButtons[currentPage]);
215233
216234 UpdatePageVisibility ();
217235}
@@ -236,6 +254,11 @@ void Plateau2::UpdatePageVisibility()
236254 for (int i = 5 ; i <= 6 ; i++) {
237255 Switches[i]->Hide (currentPage != 1 );
238256 }
257+
258+ // Routing page
259+ for (int i = 14 ; i <= 17 ; i++) {
260+ Knobs[i]->Hide (currentPage != 2 );
261+ }
239262}
240263
241264
@@ -244,16 +267,16 @@ void Plateau2::OnParamChange(int index)
244267 switch (index) {
245268 case kClear :
246269 if (initalizedInterface) {
247- if (GetParam (kClear )->Value () >= 1 ) {
248- SetParameterValue (kClear1 , GetParam (kClear )->Value ());
249- SetParameterValue (kClear2 , GetParam (kClear )->Value ());
270+ if (GetParam (kClear )->Value () >= 0.5 ) {
271+ SetParameterValue (kClear1 , GetParam (kClear )->Value ());
272+ SetParameterValue (kClear2 , GetParam (kClear )->Value ());
250273 }
251274 }
252275 break ;
253276 case kFreeze :
254277 if (initalizedInterface)
255278 {
256- if (GetParam (kFreeze )->Value () >= 1 ) {
279+ if (GetParam (kFreeze )->Value () >= 0.5 ) {
257280 SetParameterValue (tank2Selected ? kFreeze1 : kFreeze2 , 1 .);
258281 Switches[1 ]->SetValue (1 .);
259282 }
@@ -293,7 +316,7 @@ void Plateau2::OnParamChange(int index)
293316 case kDecay1 :
294317 {
295318 double decay = GetParam (index)->Value ();
296- reverb1.setDecay (2 . f * decay - decay * decay);
319+ reverb1.setDecay (2 * decay - decay * decay);
297320 break ;
298321 }
299322 case kReverbLowDamp1 :
@@ -442,6 +465,7 @@ void Plateau2::ProcessBlock(sample** inputs, sample** outputs, int nFrames)
442465
443466 const bool tank1Enabled = GetParam (kEnable1 )->Value ();
444467 const bool tank2Enabled = GetParam (kEnable2 )->Value ();
468+ const double input1 = GetParam (kInput1 )->Value () / 100 ;
445469
446470 outputs[0 ][s] = inputs[0 ][s] * dryParam;
447471 if (nChans > 1 )
@@ -494,13 +518,16 @@ void Plateau2::ProcessBlock(sample** inputs, sample** outputs, int nFrames)
494518 reverb1.freeze (frozen1);
495519 }
496520
497- reverb1.process (( double )(inputs[0 ][s] * envelope1._value ), (double )(inputs[nChans > 1 ? 1 : 0 ][s] * envelope1._value ));
521+ reverb1.process (balance (( double )(inputs[0 ][s] * envelope1._value * input1 ), (double )(inputs[nChans > 1 ? 1 : 0 ][s] * envelope1._value * input1), GetParam ( kStereoSource1 )-> Value ()/ 100 ));
498522
499- outputs[0 ][s] += reverb1.getLeftOutput () * wet1Param;
523+ std::tuple<double , double > output = seperation (reverb1.getLeftOutput () * wet1Param, reverb1.getRightOutput () * wet1Param, GetParam (kWidth1 )->Value ()/100 );
524+ output = balance (std::get<0 >(output), std::get<1 >(output), GetParam (kPan1 )->Value ()/100 );
525+
526+ outputs[0 ][s] += std::get<0 >(output);
500527
501528 if (nChans > 1 )
502529 {
503- outputs[1 ][s] += reverb1. getRightOutput () * wet1Param ;
530+ outputs[1 ][s] += std::get< 1 >(output) ;
504531 }
505532 }
506533
@@ -509,6 +536,7 @@ void Plateau2::ProcessBlock(sample** inputs, sample** outputs, int nFrames)
509536 const bool clear2Param = GetParam (kClear2 )->Value () || GetParam (kClear )->Value ();
510537 const bool freeze2Param = GetParam (kFreeze2 )->Value ();
511538 const double wet2Param = GetParam (kWet2 )->Value () / 100 ;
539+ const double input2 = GetParam (kInput2 )->Value () / 100 ;
512540
513541 if (clear2Param && !clear2 && cleared2) {
514542 cleared2 = false ;
@@ -550,13 +578,16 @@ void Plateau2::ProcessBlock(sample** inputs, sample** outputs, int nFrames)
550578 reverb2.freeze (frozen2);
551579 }
552580
553- reverb2.process ((double )(inputs[0 ][s] * envelope2._value ), (double )(inputs[nChans > 1 ? 1 : 0 ][s] * envelope2._value ));
581+ reverb2.process (balance ((double )(inputs[0 ][s] * envelope2._value * input2), (double )(inputs[nChans > 1 ? 1 : 0 ][s] * envelope2._value * input2), GetParam (kStereoSource2 )->Value () / 100 ));
582+
583+ std::tuple<double , double > output = seperation (reverb2.getLeftOutput () * wet2Param, reverb2.getRightOutput () * wet2Param, GetParam (kWidth2 )->Value ()/100 );
584+ output = balance (std::get<0 >(output), std::get<1 >(output), GetParam (kPan2 )->Value ()/100 );
554585
555- outputs[0 ][s] += reverb2. getLeftOutput () * wet2Param ;
586+ outputs[0 ][s] += std::get< 0 >(output) ;
556587
557588 if (nChans > 1 )
558589 {
559- outputs[1 ][s] += reverb2. getRightOutput () * wet2Param ;
590+ outputs[1 ][s] += std::get< 1 >(output) ;
560591 }
561592 }
562593 }
0 commit comments