Skip to content

Commit

Permalink
VST3 CC controls still subtle; fix for Live (surge-synthesizer#1536)
Browse files Browse the repository at this point in the history
the VST3 CC controls send a specious first beginEdit which maps
to a negative ID which Reaper is immune to but which confuses Live
and which we should supress anyway, so here we do.

Addresses surge-synthesizer#1531
  • Loading branch information
baconpaul authored Jan 30, 2020
1 parent 4c5be03 commit 721f4ea
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/vst3/SurgeVst3Processor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ using namespace Steinberg::Vst;
}

SurgeVst3Processor::SurgeVst3Processor() : blockpos(0), surgeInstance()
{}
{
}

SurgeVst3Processor::~SurgeVst3Processor()
{
Expand Down Expand Up @@ -531,7 +532,7 @@ tresult SurgeVst3Processor::beginEdit(ParamID id)
{
mappedId = id;
}
else if (id >= getParameterCount())
else if (id >= getParameterCount() || mappedId < 0 )
{
return kInvalidArgument;
}
Expand All @@ -543,6 +544,7 @@ tresult SurgeVst3Processor::beginEdit(ParamID id)

if( beginEditGuard[id] == 1 )
{
// std::cout << "BeginEdit " << mappedId << std::endl;
return Steinberg::Vst::SingleComponentEffect::beginEdit(mappedId);
}
else
Expand All @@ -560,7 +562,7 @@ tresult SurgeVst3Processor::performEdit(ParamID id, Steinberg::Vst::ParamValue v
{
mappedId = id;
}
else if (id >= getParameterCount())
else if (id >= getParameterCount() || mappedId < 0 )
{
return kInvalidArgument;
}
Expand All @@ -569,6 +571,8 @@ tresult SurgeVst3Processor::performEdit(ParamID id, Steinberg::Vst::ParamValue v
return kResultOk;
}

// std::cout << "PerformEdit " << mappedId << std::endl;

return Steinberg::Vst::SingleComponentEffect::performEdit(mappedId, valueNormalized);
}

Expand All @@ -581,7 +585,7 @@ tresult SurgeVst3Processor::endEdit(ParamID id)
{
mappedId = id;
}
else if (id >= getParameterCount())
else if (id >= getParameterCount() && mappedId < 0 )
{
return kInvalidArgument;
}
Expand All @@ -605,6 +609,7 @@ tresult SurgeVst3Processor::endEdit(ParamID id)

if( endcount == 0 )
{
// std::cout << "EndEdit " << mappedId << std::endl;
return Steinberg::Vst::SingleComponentEffect::endEdit(mappedId);
}
else
Expand Down

0 comments on commit 721f4ea

Please sign in to comment.