damiensellier / CtrlrX

CtlrX is an alternative fork of Roman Kubiak's Ctrlr. This project is ONLY aimed at delivering updates, a wiki, documentations, tutorials or anything that the community cannot share on the original Ctrlr github due to credential restrictions.
BSD 3-Clause "New" or "Revised" License
18 stars 3 forks source link

"Max exported VST params" ctrlrMaxExportedVstParameters not working as intended #31

Closed damiensellier closed 2 months ago

damiensellier commented 2 months ago

SEE : https://github.com/RomanKubiak/ctrlr/issues/654

The parameter "Max exported VST params" ctrlrMaxExportedVstParameters is often useless. If you export a panel as vst restricted instance, from the function getNumModulators() only the highest vstindex should set the limit. But it's not if the vstindex highest number is above 64. From what I can see, it falls back to the default settings from global Ctrlr preferences (64) because of JMAX comparator.

"Max exported VST params" ctrlrMaxExportedVstParameters should be removed/commented.

and CtrlrProcessor::getNumParameters() needs to be updated :

int CtrlrProcessor::getNumParameters()
{
    if (ctrlrManager)
        // return (jmax(ctrlrManager->getNumModulators(true), (int)overridesTree.getProperty (Ids::ctrlrMaxExportedVstParameters))); // Removed 5.6.31 because VST Host was returning 64 params most of the time since panels hardly have more than 64 parameters passed as vst controls
        return (ctrlrManager->getNumModulators(true)); // Updated v5.6.31.
    else
        return (CTRLR_DEFAULT_PARAMETER_COUNT);
}
dobo365 commented 2 months ago

The question is: why is this needed? I mean, we have the Export property to decide what to export and we have the VSTindex to sort them according to what we want to see in the DAW (Oscillators together then Filters then... for example). If a limit would work, it would prevent exporting parameters marked as "Export" and this would be confusing. Never experienced the limit of 64 but watched it as it was needed to have some .overrides file at a certain moment (tried that but never saw a diff). I have many panels with 100-200 exported parameters

damiensellier commented 2 months ago

I tried and it's not working anyway because if you load a panel from the stock vst, the parameters won't pass to the host so you'll get 0 control from the host. I'll probably leave it as is or add statement if panel is single use max vstindex else use the current formula. Ca permet surtout de pas avoir une liste de 64 parametres affichés pour les automations dans cubase. si j'en ai que deux utiles, il me map quand même les 62 autres sur mon controlleur ou clavier ce qui est pas pratique.

Panel as exported instance (ok with return (ctrlrManager->getNumModulators(true));): Capture d’écran, le 2024-07-03 à 15 38 00

BUT as panel imported in Ctrlr.vst, the modulators won't be passed to host : Capture d’écran, le 2024-07-03 à 15 44 31

damiensellier commented 2 months ago

FIXED I got it working with the following statement :

int CtrlrProcessor::getNumParameters() // Updated 5.6.31. VST Host was assigned (64) params most of the time since panels hardly have more than 64 params passed as VST controls
{
    if (ctrlrManager)
        if (ctrlrManager->isSingleInstance()) // Added v5.6.31
        {
            return (ctrlrManager->getNumModulators(true)); // Added v5.6.31. Will pass the highest vstIndex value as the total number of VST params to the host.
        }
        else
        {
            return (jmax(ctrlrManager->getNumModulators(true), (int)overridesTree.getProperty (Ids::ctrlrMaxExportedVstParameters))); // Pass jmax ctrlrMaxExportedVstParameters value or default (64) params to the host when designing or loading a panel in ctrlr.vst or ctrlr.vst3
        }
    else
        return (CTRLR_DEFAULT_PARAMETER_COUNT);
}

When opening a panel in ctrlrx.vst we have 64 parameters ready to go as default :

Capture d’écran, le 2024-07-03 à 16 16 15

When using a panel as vst instance we only have the max vstindex number of parameters passed to the host (here 4): Capture d’écran, le 2024-07-03 à 16 18 52

damiensellier commented 2 months ago

I don't have the 8 pages of useless parameters anymore on my MIDI MCU controller now, that's cool.

Exported instance with updated code : Capture d’écran, le 2024-07-03 à 16 31 01

Exported Instance with old code (10 pages of parameters) : Capture d’écran, le 2024-07-03 à 16 32 14