ENUM: Addressing single Parameters

Its a simple problem - and I had it once before but forgot the solution. I am currently porting the Towers module by Unless into a 2HP version (no C++ skills though)

#define ROWS 2
#define FADERS 16
    enum ParamIds
    {
        ENUMS(FADER_PARAMS, FADERS *ROWS),
        ENUMS(POLARITY_PARAM, ROWS),
        ENUMS(TRIM_PARAMS, ROWS),
        ENUMS(SAMPLE_PARAMS, ROWS),
        ENUMS(CHANNEL_PARAMS, ROWS),
        NUM_PARAMS
    };

etc. and while its fairly easy to adress the whole group of parameters using a for loop I need to address the single parameters in the final bit:

addParam(createParamCentered(Vec(spl, spo * 2), module, VoltageBank2::SAMPLE_PARAMS)); addParam(createParamCentered(Vec(spl, spo * 3), module, VoltageBank2::POLARITY_PARAM)); addOutput(createOutputCentered(Vec(spl, spo * 4), module, VoltageBank2::FADER_OUTPUTS));

  • I just need to know how ID1 and ID2 of the parameters are called. Any of the usual variations give me compiler errors or crash Rack after unpacking.

edit: I highlighted the part. what goes there?

addOutput(createOutputCentered(Vec(spl, spo * 4), module, VoltageBank2::FADER_OUTPUTS));

and here?

addInput(createInputCentered(Vec(spl, sp2), module, VoltageBank2::FADER_INPUTS2));

Thanks!

unlessgames has been active in the VCV Rack discord

I think the errors you are getting is because you need to give it a type:

For example, here I have specified the RoundKnob from the SDK component library:

addParam(createParamCentered<RoundKnob>(Vec(spl, spo * 2), module, VoltageBank2::SAMPLE_PARAMS));

Oh… I solved it. Copying VCVs VIZ

A:

ENUMS(FADER_PARAMS, FADERS *ROWS),
ENUMS(POLARITY_PARAM, 2 * 2),
ENUMS(TRIM_PARAMS, 2 * 2),
ENUMS(SAMPLE_PARAMS, 2 * 2),

B:

addOutput(createOutputCentered<SmallPortO>(Vec(spl, spo * 4), module, VoltageBank2::FADER_OUTPUTS + 0 * 2))
addInput(createInputCentered<SmallPortC>(Vec(spl, spo * 6), module, VoltageBank2::FADER_INPUTS + 1));

Strangely enough the +0 and +1 didn’t work before. Maybe some very particular issue with the code. Thanks guys!

Finally a tiny format Sample&Hold that can be saved to patch and stays intact after closing VCV. Except for its size “Towers” is the best Polyphonic Voltage Storage in Rack. Its even compatible with 8Face and Transit.