-
Notifications
You must be signed in to change notification settings - Fork 12
/
VCF.cpp
754 lines (661 loc) · 22.8 KB
/
VCF.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
/*
* SurgeXT for VCV Rack - a Surge Synth Team product
*
* A set of modules expressing Surge XT into the VCV Rack Module Ecosystem
*
* Copyright 2019 - 2024, Various authors, as described in the github
* transaction log.
*
* Surge XT for VCV Rack is released under the GNU General Public License
* 3.0 or later (GPL-3.0-or-later). A copy of the license is in this
* repository in the file "LICENSE" or at:
*
* or at https://www.gnu.org/licenses/gpl-3.0.en.html
*
* All source for Surge XT for VCV Rack is available at
* https://github.com/surge-synthesizer/surge-rack/
*/
#include "VCF.h"
#include "SurgeXT.h"
#include "XTModuleWidget.h"
#include "XTWidgets.h"
#include "dsp/DSPExternalAdapterUtils.h"
#include "LayoutEngine.h"
#ifndef __EMSCRIPTEN__
#define SURGE_VCF_WITH_THREADED_ANALYSER 1
#endif
namespace sst::surgext_rack::vcf::ui
{
struct VCFWidget : widgets::XTModuleWidget
{
typedef vcf::VCF M;
VCFWidget(M *module);
void moduleBackground(NVGcontext *vg) {}
std::array<std::array<rack::Widget *, M::n_mod_inputs>, 5> overlays;
std::array<widgets::ModulatableKnob *, VCF::n_vcf_params> underKnobs;
std::array<widgets::ModToggleButton *, M::n_mod_inputs> toggles;
void selectModulator(int mod) override
{
if (toggles[mod])
toggles[mod]->onToggle(!toggles[mod]->pressedState);
}
void displayChannelMenu(rack::Menu *p, M *m)
{
if (!m)
return;
int cd = m->displayPolyChannel;
for (int i = 0; i < MAX_POLY; ++i)
{
auto name = std::string("Ch ") + std::to_string(i + 1);
p->addChild(rack::createMenuItem(name, CHECKMARK(i == cd),
[m, i] { m->displayPolyChannel = i; }));
}
}
void appendModuleSpecificMenu(rack::ui::Menu *menu) override
{
if (module)
{
menu->addChild(new rack::MenuSeparator);
menu->addChild(rack::createSubmenuItem(
"Curve Poly Channel", "",
[this, m = static_cast<VCF *>(module)](auto *x) { displayChannelMenu(x, m); }));
}
}
};
struct FilterChangeAction : rack::history::ModuleAction
{
int priorType{0}, priorSubType{0}, newType{0}, newSubType{0};
explicit FilterChangeAction(VCF *m)
{
moduleId = m->id;
priorType = (int)std::round(m->paramQuantities[VCF::VCF_TYPE]->getValue());
priorSubType = (int)std::round(m->paramQuantities[VCF::VCF_SUBTYPE]->getValue());
newType = priorType;
newSubType = priorSubType;
}
void undo() override
{
auto *module = APP->engine->getModule(moduleId);
if (!module)
return;
module->paramQuantities[VCF::VCF_TYPE]->setValue(priorType);
module->paramQuantities[VCF::VCF_SUBTYPE]->setValue(priorSubType);
}
void redo() override
{
auto *module = APP->engine->getModule(moduleId);
if (!module)
return;
module->paramQuantities[VCF::VCF_TYPE]->setValue(newType);
module->paramQuantities[VCF::VCF_SUBTYPE]->setValue(newSubType);
}
};
struct VCFSelector : widgets::ParamJogSelector
{
FilterSelectorMapper fsm;
std::vector<int> fsmOrdering;
VCFSelector() { fsmOrdering = fsm.totalIndexOrdering(); }
static VCFSelector *create(const rack::Vec &pos, const rack::Vec &size, VCF *module,
int paramId)
{
auto res = new VCFSelector();
res->box.pos = pos;
res->box.size = size;
res->module = module;
res->paramId = paramId;
res->initParamQuantity();
res->setup();
return res;
}
void onPresetJog(int dir) override
{
if (!getParamQuantity())
return;
int type = (int)std::round(getParamQuantity()->getValue());
auto di = fsm.remapStreamedIndexToDisplayIndex(type);
di += dir;
if (di >= (int)fsmOrdering.size())
di = 0;
if (di < 0)
di = fsmOrdering.size() - 1;
setType(fsmOrdering[di]);
}
int filterType()
{
if (!module)
return 0;
int type = (int)std::round(module->params[VCF::VCF_TYPE].getValue());
return type;
}
rack::ui::Menu *menuForGroup(rack::ui::Menu *menu, const std::string &group)
{
auto t = filterType();
for (const auto &[id, gn] : fsm.mapping)
{
if (gn == group)
{
menu->addChild(rack::createMenuItem(sst::filters::filter_type_names[id],
CHECKMARK(id == t),
[this, cid = id]() { setType(cid); }));
}
}
return menu;
}
void onShowMenu() override
{
if (!module)
return;
auto menu = rack::createMenu();
menu->addChild(rack::createMenuLabel("Filter Types"));
std::string currentGroup{"-not-a-filter-group-"};
auto t = filterType();
for (const auto &[id, gn] : fsm.mapping)
{
if (gn == "")
{
menu->addChild(rack::createMenuItem(sst::filters::filter_type_names[id],
CHECKMARK(id == t),
[this, cid = id]() { setType(cid); }));
}
else if (gn != currentGroup)
{
bool check{false};
// This is a little silly to iterate again to find this but this list is small and
// the group count is low and it's only at change so it's not problematically
// quadratic
for (const auto &[idr, gnr] : fsm.mapping)
{
if (gn == gnr && idr == t)
{
check = true;
}
}
menu->addChild(rack::createSubmenuItem(
gn, CHECKMARK(check), [this, cgn = gn](auto *x) { menuForGroup(x, cgn); }));
currentGroup = gn;
}
}
}
bool forceDirty{false};
void setType(int id)
{
forceDirty = true;
if (!module)
return;
if (!getParamQuantity())
return;
auto vcfm = static_cast<VCF *>(module);
auto h = new FilterChangeAction(vcfm);
h->newType = id;
h->newSubType = vcfm->defaultSubtype[id];
APP->history->push(h);
getParamQuantity()->setValue(id);
// FixMe: have a default type per type
module->params[VCF::VCF_SUBTYPE].setValue(vcfm->defaultSubtype[id]);
}
int lastType{-1};
bool isDirty() override
{
if (forceDirty)
{
forceDirty = false;
return true;
}
if (getParamQuantity())
{
int type = (int)std::round(getParamQuantity()->getValue());
if (type != lastType)
{
lastType = type;
return true;
}
}
return false;
}
std::string getPresetName() override
{
if (!getParamQuantity())
return "FILTER";
int type = (int)std::round(getParamQuantity()->getValue());
return sst::filters::filter_type_names[type];
}
};
struct VCFSubtypeSelector : widgets::ParamJogSelector
{
FilterSelectorMapper fsm;
static VCFSubtypeSelector *create(const rack::Vec &pos, const rack::Vec &size, VCF *module,
int paramId)
{
auto res = new VCFSubtypeSelector();
res->box.pos = pos;
res->box.size = size;
res->module = module;
res->paramId = paramId;
res->initParamQuantity();
res->setup();
return res;
}
int filterType()
{
if (!module)
return 0;
int type = (int)std::round(module->params[VCF::VCF_TYPE].getValue());
return type;
}
int filterSubType()
{
if (!module)
return 0;
int type = (int)std::round(module->params[VCF::VCF_SUBTYPE].getValue());
return type;
}
void onPresetJog(int dir) override
{
if (!module)
return;
auto type = filterType();
int i = std::clamp((int)std::round(getParamQuantity()->getValue()), 0,
sst::filters::fut_subcount[type]);
if (sst::filters::fut_subcount[type] == 0)
return;
i += dir;
if (i < 0)
i = sst::filters::fut_subcount[type] - 1;
if (i >= sst::filters::fut_subcount[type])
i = 0;
setSubType(i);
}
bool hasPresets() override
{
if (!module)
return true;
auto type = filterType();
return (sst::filters::fut_subcount[type] != 0);
}
void onShowMenu() override
{
if (!module)
return;
int type = filterType();
int subt = filterSubType();
int ct = sst::filters::fut_subcount[type];
if (ct == 0)
return;
auto menu = rack::createMenu();
menu->addChild(rack::createMenuLabel("Filter SubTypes"));
for (int i = 0; i < ct; ++i)
{
menu->addChild(
rack::createMenuItem(VCF::subtypeLabel(type, i), CHECKMARK(i == subt), [this, i]() {
setSubType(i);
forceDirty = true;
}));
}
}
bool forceDirty{false};
void setSubType(int id)
{
forceDirty = true;
if (!getParamQuantity())
return;
auto vcfm = static_cast<VCF *>(module);
auto h = new FilterChangeAction(vcfm);
h->newSubType = id;
APP->history->push(h);
getParamQuantity()->setValue(id);
}
int lastType{-1}, lastSubType{-1};
bool isDirty() override
{
if (forceDirty)
{
forceDirty = false;
return true;
}
if (!module)
return false;
int type = filterType();
if (type != lastType)
{
lastType = type;
return true;
}
auto st = (int)std::round(getParamQuantity()->getValue());
if (lastSubType != st)
{
lastSubType = st;
return true;
}
return false;
}
std::string getPresetName() override
{
if (!module)
return "None";
int type = filterType();
int i = std::clamp((int)std::round(getParamQuantity()->getValue()), 0,
sst::filters::fut_subcount[type]);
return VCF::subtypeLabel(type, i);
}
};
struct FilterPlotParameters
{
float sampleRate = 96000.0f;
float startFreqHz = 20.0f;
float endFreqHz = 20000.0f;
float inputAmplitude = 1.0f / 1.414213562373095; // root 2
float freqSmoothOctaves = 1.0f / 12.0f;
};
#if SURGE_VCF_WITH_THREADED_ANALYSER
struct FilterAnalzer
{
FilterAnalzer() { analysisThread = std::make_unique<std::thread>(callRunThread, this); }
~FilterAnalzer()
{
{
auto lock = std::unique_lock<std::mutex>(dataLock);
continueWaiting = false;
}
cv.notify_one();
analysisThread->join();
}
static void callRunThread(FilterAnalzer *that) { that->runThread(); }
void runThread()
{
uint64_t lastIB = 0;
while (continueWaiting)
{
if (lastIB == inboundUpdates)
{
auto lock = std::unique_lock<std::mutex>(dataLock);
cv.wait(lock);
}
if (lastIB != inboundUpdates)
{
int cty, csu;
float ccu, cre, cgn;
{
auto lock = std::unique_lock<std::mutex>(dataLock);
cty = type;
csu = subtype;
ccu = cutoff;
cre = resonance;
cgn = gain;
lastIB = inboundUpdates;
}
auto data = surge::calculateFilterResponseCurve(
(sst::filters::FilterType)cty, (sst::filters::FilterSubType)csu, ccu, cre, cgn);
{
auto lock = std::unique_lock<std::mutex>(dataLock);
outboundUpdates++;
dataCopy = data;
}
}
}
}
void request(int t, int s, float c, float r, float g)
{
{
auto lock = std::unique_lock<std::mutex>(dataLock);
type = t;
subtype = s;
cutoff = c;
resonance = r;
gain = powf(2.f, g / 18.f);
inboundUpdates++;
}
cv.notify_one();
}
std::pair<std::vector<float>, std::vector<float>> dataCopy;
std::atomic<uint64_t> inboundUpdates{1}, outboundUpdates{1};
int type{0}, subtype{0};
float cutoff{60}, resonance{0}, gain{1.f};
std::mutex dataLock;
std::condition_variable cv;
std::unique_ptr<std::thread> analysisThread;
bool hasWork{false}, continueWaiting{true};
};
#endif
struct FilterPlotWidget : rack::widget::TransparentWidget, style::StyleParticipant
{
#if SURGE_VCF_WITH_THREADED_ANALYSER
std::unique_ptr<FilterAnalzer> analyzer;
#endif
VCF *module{nullptr};
widgets::BufferedDrawFunctionWidget *bdw{nullptr};
widgets::BufferedDrawFunctionWidget *bdwPlot{nullptr};
FilterPlotWidget() {}
static FilterPlotWidget *create(const rack::Vec &pos, const rack::Vec &size, VCF *module)
{
auto res = new FilterPlotWidget();
res->box.pos = pos;
res->box.size = size;
res->module = module;
res->setup();
return res;
}
float fr, re;
void setup()
{
#if SURGE_VCF_WITH_THREADED_ANALYSER
if (module)
analyzer = std::make_unique<FilterAnalzer>();
#endif
bdw = new widgets::BufferedDrawFunctionWidget(rack::Vec(0, 0), box.size,
[this](auto vg) { this->drawUnder(vg); });
bdwPlot = new widgets::BufferedDrawFunctionWidgetOnLayer(
rack::Vec(0, 0), box.size, [this](auto vg) { this->drawPlot(vg); });
addChild(bdw);
addChild(bdwPlot);
}
uint64_t lastOutbound{1};
float lastFreq{-1}, lastReso{-1}, lastTy{-1}, lastSub{-1}, lastGn{-1}, lastDisplayPoly{-1};
std::pair<std::vector<float>, std::vector<float>> responseCurve;
#if SURGE_VCF_WITH_THREADED_ANALYSER
void step() override
{
if (!module)
return;
if (!analyzer)
return;
if (analyzer->outboundUpdates != lastOutbound)
{
{
std::lock_guard<std::mutex> g(analyzer->dataLock);
responseCurve = analyzer->dataCopy;
lastOutbound = analyzer->outboundUpdates;
}
bdwPlot->dirty = true;
}
// This is how we do the 'unanimated' version
// auto fr = module->params[VCF::FREQUENCY].getValue();
// auto re = module->params[VCF::RESONANCE].getValue();
float fr{0.f}, re{0.f}, gn{0.f};
if (style::XTStyle::getShowModulationAnimationOnDisplay())
{
auto ch = (int)module->displayPolyChannel;
if (ch >= module->polyChannelCount())
ch = 0;
fr = module->modulationAssistant.values[VCF::FREQUENCY][ch];
re = module->modulationAssistant.values[VCF::RESONANCE][ch];
gn = module->modulationAssistant.values[VCF::IN_GAIN][ch];
}
else
{
fr = module->modulationAssistant.basevalues[VCF::FREQUENCY];
re = module->modulationAssistant.basevalues[VCF::RESONANCE];
gn = module->modulationAssistant.basevalues[VCF::IN_GAIN];
}
auto ty = (int)std::round(module->params[VCF::VCF_TYPE].getValue());
auto sty = (int)std::round(module->params[VCF::VCF_SUBTYPE].getValue());
int lp = module->displayPolyChannel;
if (fr != lastFreq || re != lastReso || ty != lastTy || sty != lastSub || gn != lastGn ||
lp != lastDisplayPoly)
{
lastFreq = fr;
lastReso = re;
lastSub = sty;
lastTy = ty;
lastGn = gn;
lastDisplayPoly = lp;
// Remeber our filters all focus on midi note 69
analyzer->request(ty, sty, fr * 12 - 9, re, gn);
}
}
#endif
static constexpr float lowFreq = 10.f;
static constexpr float highFreq = 18000.f;
static constexpr float dbMin = -42.f;
static constexpr float dbMax = 12.f;
static constexpr float dbRange = dbMax - dbMin;
float freqToX(float freq, int width)
{
auto xNorm = std::log(freq / lowFreq) / std::log(highFreq / lowFreq);
return xNorm * (float)width;
};
float dbToY(float db, int height) { return (float)height * (dbMax - db) / dbRange; };
void drawUnder(NVGcontext *vg)
{
for (const auto freq : {100, 1000, 10000})
{
nvgBeginPath(vg);
nvgStrokeColor(vg, style()->getColor(style::XTStyle::PLOT_MARKS));
nvgMoveTo(vg, freqToX(freq, box.size.x), 0);
nvgLineTo(vg, freqToX(freq, box.size.x), box.size.y);
nvgStrokeWidth(vg, 0.75);
nvgStroke(vg);
}
for (const auto db : {-36, -24, -12, 0, 12})
{
nvgBeginPath(vg);
nvgStrokeColor(vg, style()->getColor(style::XTStyle::PLOT_MARKS));
nvgMoveTo(vg, 0, dbToY(db, box.size.y));
nvgLineTo(vg, box.size.x, dbToY(db, box.size.y));
nvgStrokeWidth(vg, 0.75);
nvgStroke(vg);
}
}
void drawPlot(NVGcontext *vg)
{
if (!module)
{
// Draw the module name here for preview goodness
nvgBeginPath(vg);
nvgTextAlign(vg, NVG_ALIGN_CENTER | NVG_ALIGN_MIDDLE);
nvgFontFaceId(vg, style()->fontIdBold(vg));
nvgFontSize(vg, 30);
nvgFillColor(vg, style()->getColor(style::XTStyle::PLOT_CURVE));
nvgText(vg, box.size.x * 0.5, box.size.y * 0.5, "Filter", nullptr);
return;
}
const auto &freq = responseCurve.first;
const auto &resp = responseCurve.second;
auto sz = std::min(freq.size(), resp.size());
nvgSave(vg);
nvgScissor(vg, 0, 0.5, box.size.x, box.size.y - 1);
auto makePath = [&]() -> std::pair<float, float> {
uint64_t curr = 0;
nvgBeginPath(vg);
bool first{true};
float firstf = 0, lastf = 0;
while (curr < sz)
{
auto f = freq[curr];
auto r = resp[curr];
if (f >= lowFreq && f <= highFreq)
{
float fscale = freqToX(f, box.size.x);
float yscale = dbToY(r, box.size.y);
if (first)
{
nvgMoveTo(vg, fscale, yscale);
firstf = fscale;
}
else
{
lastf = fscale;
nvgLineTo(vg, fscale, yscale);
}
first = false;
}
++curr;
}
return {firstf, lastf};
};
auto col = style()->getColor(style::XTStyle::PLOT_CURVE);
auto ff = makePath();
nvgLineTo(vg, ff.second, box.size.y);
nvgLineTo(vg, ff.first, box.size.y);
auto gsp = dbToY(6, box.size.y);
auto gsn = box.size.y;
auto gcp = col;
gcp.a = 0.5;
auto gcn = col;
gcn.a = 0.0;
auto gr = nvgLinearGradient(vg, 0, gsp, 0, gsn, gcp, gcn);
// nvgFillColor(vg, nvgRGBA(255, 0, 0, 80));
nvgFillPaint(vg, gr);
nvgFill(vg);
makePath();
nvgStrokeColor(vg, col);
nvgStrokeWidth(vg, 1.25);
nvgStroke(vg);
col.a = 0.1;
nvgStrokeColor(vg, col);
nvgStrokeWidth(vg, 3);
nvgStroke(vg);
nvgRestore(vg);
}
void onStyleChanged() override { bdw->dirty = true; }
};
VCFWidget::VCFWidget(VCFWidget::M *module) : XTModuleWidget()
{
setModule(module);
typedef layout::LayoutEngine<VCFWidget, M::FREQUENCY> engine_t;
engine_t::initializeModulationToBlank(this);
box.size = rack::Vec(rack::app::RACK_GRID_WIDTH * layout::LayoutConstants::numberOfScrews,
rack::app::RACK_GRID_HEIGHT);
auto bg = new widgets::Background(box.size, "FILTER", "vco", "BlankVCO");
addChild(bg);
int idx = 0;
float plotStartX = rack::mm2px(layout::LayoutConstants::VCOplotCX_MM -
layout::LayoutConstants::VCOplotW_MM * 0.5);
float plotStartY = rack::mm2px(layout::LayoutConstants::VCOplotCY_MM -
layout::LayoutConstants::VCOplotH_MM * 0.5);
float plotW = rack::mm2px(layout::LayoutConstants::VCOplotW_MM);
float plotH = rack::mm2px(layout::LayoutConstants::VCOplotH_MM -
layout::LayoutConstants::VCOplotControlsH_MM);
float underPlotStartY = plotStartY + plotH;
float underPlotH = rack::mm2px(layout::LayoutConstants::VCOplotControlsH_MM);
auto fivemm = rack::mm2px(5);
auto halfmm = rack::mm2px(0.5);
auto wts = VCFSelector::create(rack::Vec(plotStartX, plotStartY),
rack::Vec(plotW, fivemm - halfmm), module, VCF::VCF_TYPE);
addChild(wts);
plotStartY += fivemm;
plotH -= fivemm;
auto fpw = FilterPlotWidget::create(rack::Vec(plotStartX, plotStartY), rack::Vec(plotW, plotH),
module);
addChild(fpw);
auto subType =
VCFSubtypeSelector::create(rack::Vec(plotStartX, underPlotStartY),
rack::Vec(plotW, fivemm - halfmm), module, M::VCF_SUBTYPE);
addChild(subType);
typedef layout::LayoutItem lay_t;
for (const auto &lay : {lay_t::createVCFWSBigKnob(M::FREQUENCY, "FREQUENCY"),
lay_t::createVCOKnob(M::RESONANCE, "RES", 0, 2),
lay_t::createVCOKnob(M::MIX, "MIX", 0, 3),
lay_t::createVCOKnob(M::IN_GAIN, "DRIVE", 1, 2),
lay_t::createVCOKnob(M::OUT_GAIN, "GAIN", 1, 3)})
{
engine_t::layoutItem(this, lay, "VCF");
}
engine_t::addModulationSection(this, M::n_mod_inputs, M::VCF_MOD_INPUT);
engine_t::createLeftRightInputLabels(this);
engine_t::createInputOutputPorts(this, M::INPUT_L, M::INPUT_R, M::OUTPUT_L, M::OUTPUT_R);
resetStyleCouplingToModule();
}
} // namespace sst::surgext_rack::vcf::ui
// namespace sst::surgext_rack::vcf::ui
rack::Model *modelSurgeVCF = rack::createModel<sst::surgext_rack::vcf::ui::VCFWidget::M,
sst::surgext_rack::vcf::ui::VCFWidget>("SurgeXTVCF");