IPlug2 controls not affecting Faust DSP params

I am now able to run my Faust instrument inside of an IPlug2 app, and I was able to get far enough to link IPlug params to Faust params and create controls that at least start out matching the DSP defaults. However, changing the controls in the UI does nothing:

Relevant code snippets:

// near the top of the constructor
  mFaustProcessor.CreateIPlugParameters(this, 0, mFaustProcessor.NParams());
  pushBandParams(0);
  pushBandParams(1);
  pushBandParams(2);
  pushBandParams(4);
  pushBandParams(6);
  pushBandParams(8);
  pushBandParams(10);
  pushBandParams(12);
  pushBandParams(14);
  pushBandParams(16);

// inside mLayoutFunc
    for (auto band = 0; band < mBandParams.size(); band++) {
        auto &bandParamIds = mBandParams.at(band);
        IRECT bandStrip = b.GetGridCell(0, band, 1, mBandParams.size());
        IRECT slider = bandStrip.ReduceFromTop(150);
        pGraphics->AttachControl(new IVSliderControl(slider, bandParamIds.gain, "Gain"));
        IRECT envKnobs = bandStrip.ReduceFromTop(250);
        pGraphics->AttachControl(new IVKnobControl(envKnobs.GetGridCell(0, 0, 4, 1), bandParamIds.attack, "Attack"));
        pGraphics->AttachControl(new IVKnobControl(envKnobs.GetGridCell(1, 0, 4, 1), bandParamIds.decay, "Decay"));
        pGraphics->AttachControl(new IVKnobControl(envKnobs.GetGridCell(2, 0, 4, 1), bandParamIds.sustain, "Sustain"));
        pGraphics->AttachControl(new IVKnobControl(envKnobs.GetGridCell(3, 0, 4, 1), bandParamIds.release, "Release"));
    }

// the helper pushBandParams function. this iterates over all plugin params - initialised by
// mFaustProcessor.CreateIPlugParameters - and builds a map of partial number to param ids
// based on what I called the parameters in the Faust code.
void WeirdOrgan::pushBandParams(int bandId)
{
    std::string gainName = "partial gain " + std::to_string(bandId);
    std::string attackName = "attack " + std::to_string(bandId);
    std::string decayName = "decay " + std::to_string(bandId);
    std::string sustainName = "sustain " + std::to_string(bandId);
    std::string releaseName = "release " + std::to_string(bandId);

    int gainId = -1;
    int attackId = -1;
    int decayId = -1;
    int sustainId = -1;
    int releaseId = -1;
    
    for (int i = 0; i < NParams(); i++) {
        auto name = GetParam(i)->GetName();
        if (gainName.compare(name) == 0) {
            gainId = i;
            continue;
        }
        if (attackName.compare(name) == 0) {
            attackId = i;
            continue;
        }
        if (decayName.compare(name) == 0) {
            decayId = i;
            continue;
        }
        if (sustainName.compare(name) == 0) {
            sustainId = i;
            continue;
        }
        if (releaseName.compare(name) == 0) {
            releaseId = i;
            continue;
        }
    }

    mBandParams.emplace_back(gainId, attackId, decayId, sustainId, releaseId);
}

bit hard to see whats wrong. is your source code online?

C++: FTWAudioPlugins/WeirdOrgan.cpp at main 路 FLamparski/FTWAudioPlugins 路 GitHub
Faust: FTWAudioPlugins/WeirdOrgan.dsp at main 路 FLamparski/FTWAudioPlugins 路 GitHub

Since I鈥檓 building on Windows I鈥檓 always using FAUST_COMPILED, otherwise the plugin always crashes.

I鈥檓 also not getting any output from it in a DAW (I鈥檓 using Ardour)

It seems your faust dsp has more parameters than the iPlug plug-in. If you comment this check, i think it might work

I think the zone/parameter confusion theory is right - I added an extra debug message and I鈥檓 seeing disagreement between the parameters that IPlug is picking up and the number of zones:

0 Panic
1 attack 0
2 decay 0
3 freq
4 gate
5 partial gain 0
6 q
7 release 0
8 sustain 0
9 attack 1
10 decay 1
11 partial gain 1
12 release 1
13 sustain 1
14 attack 2
15 decay 2
16 partial gain 2
17 release 2
18 sustain 2
19 attack 4
20 decay 4
21 partial gain 4
22 release 4
23 sustain 4
24 attack 6
25 decay 6
26 partial gain 6
27 release 6
28 sustain 6
29 attack 8
30 decay 8
31 partial gain 8
32 release 8
33 sustain 8
34 attack 10
35 decay 10
36 partial gain 10
37 release 10
38 sustain 10
39 attack 12
40 decay 12
41 partial gain 12
42 release 12
43 sustain 12
44 attack 14
45 decay 14
46 partial gain 14
47 release 14
48 sustain 14
49 attack 16
50 decay 16
51 partial gain 16
52 release 16
53 sustain 16
54 gain
55 volume
number of Faust zones = 83

Seems like a bug in Faust actually: Surprising effects of vgroup/hgroup on how controls and parameters work 路 Issue #725 路 grame-cncm/faust 路 GitHub