@@ -222,10 +222,11 @@ template <> void VCOConfig<ot_twist>::oscillatorSpecificSetup(VCO<ot_twist> *m)
222
222
template <> inline void VCOConfig<ot_twist>::configureVCOSpecificParameters(VCO<ot_twist> *m)
223
223
{
224
224
m->configOnOff (VCO<ot_twist>::ARBITRARY_SWITCH_0 + 0 , 0 , " Enable LPG on Trigger" );
225
+ m->configOnOffNoRand (VCO<ot_twist>::ARBITRARY_SWITCH_0 + 1 , 0 , " Randomize Includes Engine" );
225
226
226
227
m->intStateForConfig [0 ] = m->inputs [VCO<ot_twist>::RETRIGGER].isConnected ();
227
228
m->intStateForConfig [1 ] = m->oscstorage ->p [TwistOscillator::twist_lpg_response].deactivated ;
228
- for (int i = 1 ; i < VCO<ot_twist>::n_arbitrary_switches; ++i)
229
+ for (int i = 2 ; i < VCO<ot_twist>::n_arbitrary_switches; ++i)
229
230
{
230
231
m->configParam (VCO<ot_twist>::ARBITRARY_SWITCH_0 + i, 0 , 1 , 0 , " Unused" );
231
232
}
@@ -260,6 +261,13 @@ template <> void VCOConfig<ot_twist>::processVCOSpecificParameters(VCO<ot_twist>
260
261
deact = true ;
261
262
s->p [TwistOscillator::twist_lpg_response].deactivated = deact;
262
263
}
264
+
265
+ auto l1 = (bool )(m->params [VCO<ot_twist>::ARBITRARY_SWITCH_0 + 1 ].getValue () > 0.5 );
266
+ auto epq = m->paramQuantities [VCO<ot_twist>::OSC_CTRL_PARAM_0 + TwistOscillator::twist_engine];
267
+ if (epq->randomizeEnabled != l1)
268
+ {
269
+ epq->randomizeEnabled = l1;
270
+ }
263
271
}
264
272
265
273
template <> bool VCOConfig<ot_twist>::getVCOSpecificReInit(VCO<ot_twist> *m)
@@ -293,6 +301,18 @@ void VCOConfig<ot_twist>::oscillatorReInit(VCO<ot_twist> *m, Oscillator *o, floa
293
301
o->init (pitch0);
294
302
}
295
303
}
304
+
305
+ template <> void VCOConfig<ot_twist>::addMenuItems(VCO<ot_twist> *m, rack::ui::Menu *toThis)
306
+ {
307
+ auto l1 = (int )std::round (m->params [VCO<ot_twist>::ARBITRARY_SWITCH_0 + 1 ].getValue ());
308
+
309
+ toThis->addChild (rack::createMenuItem (" Randomize Twist Engine" , CHECKMARK (l1), [m, l1]() {
310
+ m->params [VCO<ot_twist>::ARBITRARY_SWITCH_0 + 1 ].setValue (l1 ? 0 : 1 );
311
+ m->paramQuantities [VCO<ot_twist>::OSC_CTRL_PARAM_0 + TwistOscillator::twist_engine]
312
+ ->randomizeEnabled = !l1;
313
+ }));
314
+ }
315
+
296
316
} // namespace sst::surgext_rack::vco
297
317
298
318
#endif
0 commit comments