Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: VCA #119

Open
Tracked by #69 ...
nathanjhood opened this issue Dec 6, 2024 · 4 comments · Fixed by #112
Open
Tracked by #69 ...

WIP: VCA #119

nathanjhood opened this issue Dec 6, 2024 · 4 comments · Fixed by #112
Assignees
Labels
enhancement New feature or request module Related to a new or existing VCV Rack 2 module

Comments

@nathanjhood
Copy link
Member

Chore

Describe the chore

Module: VCA

Voltage-controlled Amplifier.

@nathanjhood nathanjhood added enhancement New feature or request module Related to a new or existing VCV Rack 2 module labels Dec 6, 2024
@nathanjhood nathanjhood self-assigned this Dec 6, 2024
@nathanjhood nathanjhood moved this to Done in StoneyDSP Dec 6, 2024
@nathanjhood nathanjhood linked a pull request Dec 6, 2024 that will close this issue
@nathanjhood nathanjhood reopened this Dec 6, 2024
@nathanjhood
Copy link
Member Author

About this module.

The intention is to be a minimal, no-fuss no-mess VCA. Just multiply the CV input by the percentage (from 0% to 100%) of the Gain knob. Linear voltage gain multiplier; that's it.

I dislike so-called "exp" settings on VCA's as these create unclear patches, and don't say much about what the author's idea of "exp" actually is. I think Fundamental 2.0 did the correct thing in hiding this setting.

I have a nice, quite subtle Class-A - style harmonics generator which I may consider adding as an "analogue" option... it is an asymmerical clip, so that soon leads to the idea of some kind of polarity-flip control, or perhaps "attenuverter" mode... and already, the "no-fuss no-mess" approach quickly heads out the window... exponentially, with each new idea.

So, I just want to get a few simple 'n' sweet basic modules going first, before getting lost in such ideas.

I have not yet settled on any ideas for GUI, but I love the idea of making a fader design; the input port would be above the fader, and the output port below it; probably, 3HP wide, like Fundamental VCA.

Like a modular piece of a console; making a row of the fader-style VCA should look (and supposedly, feel) like a nicely-spaced fader bank of N channels, as if one module. I don't mind the outline separator between modules - this won't be expander modules or anything like that (cool idea for future modules, though...!), just a gain utility.

Come to think of it, if the design were a fader, then a percentage approach may not really make sense... and I'll need to make dBtoGain and GainToDb methods somewhere in the StoneyDSP library (a sure-fire requirement for that lib anyway).

Needless to say, the module will likely go through a few revisions before I land on the exact design to move forward with. This will all be tied in with a version number increment, nearer the time. For now, consider this module experimental.

@nathanjhood nathanjhood mentioned this issue Dec 13, 2024
9 tasks
@nathanjhood nathanjhood changed the title VCA WIP: VCA Dec 13, 2024
@nathanjhood
Copy link
Member Author

Added screws, lines, widgets and framebuffer stuff, deconstuctors...

Currently toying with either a knob with LED, or with a slider with embedded LED:

Screenshot from 2024-12-22 19-00-25
Screenshot from 2024-12-22 19-00-04
Screenshot from 2024-12-22 18-36-20
Screenshot from 2024-12-22 18-35-53

Also, moved VCA out of STONEYVCV_EXPERIMENTAL and into v2.0.2, without a tag as I still need to implement a proper baseline.

@nathanjhood
Copy link
Member Author

This module represents an excellent chance to finesse a bit more of the design system, since the blank panels do not use any ports, controls, lights, or labels.

It's a bit of sink-or-swim with learning how to extrapolate size and position information from other widgets in order to create an algorithmic spacing and placement of each widget, in relation to each other. Initialisation order of widgets will be a bug bear, probably, which perhaps might become easier to solve with the use of other child widgets (or not?)....

@nathanjhood
Copy link
Member Author

The code handling the light within the VCAModule::process() is not correct:

//...
{
    // Lights
    if (lightDivider.process()) {
        for (::StoneyDSP::size_t c = 0; c < numChannels; c++) {
            // Get output
            float out = outputs[::StoneyDSP::StoneyVCV::VCA::VCAModule::VCA_OUTPUT].getPolyVoltage(c);

            // Get gain
            auto gainApply = level;
            if (inputs[::StoneyDSP::StoneyVCV::VCA::VCAModule::CV_INPUT].isConnected()) {
                auto cv = ::rack::math::clamp(inputs[::StoneyDSP::StoneyVCV::VCA::VCAModule::CV_INPUT].getPolyVoltage(c) / 10.0F, 0.0F, 1.0F);
                gainApply *= cv;
            }

            // Apply gain
            auto lightsGain = out * gainApply;

            lights[::StoneyDSP::StoneyVCV::VCA::VCAModule::BLINK_LIGHT].setBrightnessSmooth(
                ::std::abs(lightsGain),
                args.sampleTime
            );
        }
    }
}

One big problem is the confusion going on about mono and poly; the light widget can only be monophonic, obviously. So, would be much more sensible to take outputs[VCA_OUTPUT].getPolyvoltages() and do a std::max on them all, so that the light is powered by the maximum of any/all polyvoltages on any given sample tick.

Will try this now...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request module Related to a new or existing VCV Rack 2 module
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant