Skip to content

VST3: two more loops assume isMidi is the only non-CLAP parameter #554

Description

@defiantnerd

Found while fixing VST3-2 in the 0.16 release review, which fixed the same assumption in the CLAP_PARAM_RESCAN_INFO loop.

The problem

The preset selector created by Vst3Parameter::createPresetSelector is not a CLAP parameter: it has an invented ParamID and leaves param_index_for_clap_get_info at 0. VST3-2 fixed one loop that skipped only p->isMidi and therefore fed the selector's id to CLAP. Two more do the same:

  • syncParameterValuesFromClap() (src/wrapasvst3.cpp ~:369) calls get_value with the selector's invented id.
  • getParamValueByString() (~:695) skips only isMidi, so text_to_value is called with it too.

Both are harmless today, but only because the plugin rejects an unknown id and the wrapper treats the failure as "no value" / kResultFalse. That is relying on every plugin implementing those calls defensively, which is not something the wrapper should depend on.

getParamStringByValue is already correct — it tests kIsProgramChange first.

Suggested fix

Skip p->isPreset alongside p->isMidi in both, matching the VST3-2 fix. Longer term, a single predicate (isWrapperOwned(), say) used by every loop that walks parameters would stop the next special-case parameter from re-introducing this.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions