Browse Source

Allow CV controls in a few more formats, plus in bridges as well

Signed-off-by: falkTX <falktx@falktx.com>
tags/v2.1-rc1
falkTX 4 years ago
parent
commit
8255f5a733
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
4 changed files with 45 additions and 10 deletions
  1. +10
    -1
      source/backend/plugin/CarlaPluginBridge.cpp
  2. +29
    -5
      source/backend/plugin/CarlaPluginJuce.cpp
  3. +1
    -1
      source/backend/plugin/CarlaPluginNative.cpp
  4. +5
    -3
      source/backend/plugin/CarlaPluginVST2.cpp

+ 10
- 1
source/backend/plugin/CarlaPluginBridge.cpp View File

@@ -1,6 +1,6 @@
/*
* Carla Plugin Bridge
* Copyright (C) 2011-2019 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2011-2020 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -1167,6 +1167,9 @@ public:
portName.truncate(portNameSize);

pData->event.portIn = (CarlaEngineEventPort*)pData->client->addPort(kEnginePortTypeEvent, portName, true, 0);
#ifndef BUILD_BRIDGE_ALTERNATIVE_ARCH
pData->event.cvSourcePorts = pData->client->createCVSourcePorts();
#endif
}

if (needsCtrlOut)
@@ -1311,6 +1314,12 @@ public:

#ifndef BUILD_BRIDGE_ALTERNATIVE_ARCH
bool allNotesOffSent = false;

if (cvIn != nullptr && pData->event.cvSourcePorts != nullptr)
{
const bool isSampleAccurate = (pData->options & PLUGIN_OPTION_FIXED_BUFFERS) == 0x0;
pData->event.cvSourcePorts->initPortBuffers(cvIn + pData->cvIn.count, frames, isSampleAccurate, pData->event.portIn);
}
#endif

for (uint32_t i=0, numEvents=pData->event.portIn->getEventCount(); i < numEvents; ++i)


+ 29
- 5
source/backend/plugin/CarlaPluginJuce.cpp View File

@@ -1,6 +1,6 @@
/*
* Carla Juce Plugin
* Copyright (C) 2013-2019 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2013-2020 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -305,7 +305,7 @@ public:

try {
fInstance->setParameter(static_cast<int>(parameterId), value);
} CARLA_SAFE_EXCEPTION("setParameter");
} CARLA_SAFE_EXCEPTION("setParameter(RT)");

CarlaPlugin::setParameterValueRT(parameterId, fixedValue, sendCallbackLater);
}
@@ -566,8 +566,13 @@ public:
#endif

if (fInstance->isParameterAutomatable(static_cast<int>(j)))
{
pData->param.data[j].hints |= PARAMETER_IS_AUTOMABLE;

if (fInstance->isMetaParameter(static_cast<int>(j)))
pData->param.data[j].hints |= PARAMETER_CAN_BE_CV_CONTROLLED;
}

// FIXME?
def = fInstance->getParameterDefaultValue(static_cast<int>(j));

@@ -598,6 +603,9 @@ public:
portName.truncate(portNameSize);

pData->event.portIn = (CarlaEngineEventPort*)pData->client->addPort(kEnginePortTypeEvent, portName, true, 0);
#ifndef BUILD_BRIDGE_ALTERNATIVE_ARCH
pData->event.cvSourcePorts = pData->client->createCVSourcePorts();
#endif
}

if (needsCtrlOut)
@@ -757,8 +765,11 @@ public:
} catch(...) {}
}

void process(const float* const* const audioIn, float** const audioOut,
const float* const*, float**, const uint32_t frames) override
void process(const float* const* const audioIn,
float** const audioOut,
const float* const* const cvIn,
float**,
const uint32_t frames) override
{
// --------------------------------------------------------------------------------------------------------
// Check if active
@@ -813,9 +824,13 @@ public:
// ----------------------------------------------------------------------------------------------------
// Event Input (System)

#ifndef BUILD_BRIDGE
#ifndef BUILD_BRIDGE_ALTERNATIVE_ARCH
bool allNotesOffSent = false;

if (cvIn != nullptr && pData->event.cvSourcePorts != nullptr)
pData->event.cvSourcePorts->initPortBuffers(cvIn, frames, false, pData->event.portIn);
#endif

for (uint32_t i=0, numEvents=pData->event.portIn->getEventCount(); i < numEvents; ++i)
{
const EngineEvent& event(pData->event.portIn->getEvent(i));
@@ -1073,6 +1088,15 @@ public:
// Process

processSingle(audioIn, audioOut, frames);

// --------------------------------------------------------------------------------------------------------

#ifdef BUILD_BRIDGE_ALTERNATIVE_ARCH
return;

// unused
(void)cvIn;
#endif
}

bool processSingle(const float* const* const inBuffer, float** const outBuffer, const uint32_t frames)


+ 1
- 1
source/backend/plugin/CarlaPluginNative.cpp View File

@@ -1855,7 +1855,7 @@ public:
#ifndef BUILD_BRIDGE
bool allNotesOffSent = false;
#endif
bool isSampleAccurate = (pData->options & PLUGIN_OPTION_FIXED_BUFFERS) == 0;
const bool isSampleAccurate = (pData->options & PLUGIN_OPTION_FIXED_BUFFERS) == 0;

uint32_t startTime = 0;
uint32_t timeOffset = 0;


+ 5
- 3
source/backend/plugin/CarlaPluginVST2.cpp View File

@@ -840,12 +840,14 @@ public:
pData->param.data[j].hints |= PARAMETER_IS_ENABLED;
pData->param.data[j].hints |= PARAMETER_USES_CUSTOM_TEXT;

if ((prop.flags & (kVstParameterIsSwitch|kVstParameterUsesIntStep)) == 0x0)
pData->param.data[j].hints |= PARAMETER_CAN_BE_CV_CONTROLLED;

if ((pData->hints & PLUGIN_USES_OLD_VSTSDK) != 0 || dispatcher(effCanBeAutomated, ij) == 1)
{
pData->param.data[j].hints |= PARAMETER_IS_AUTOMABLE;

if ((prop.flags & (kVstParameterIsSwitch|kVstParameterUsesIntStep)) == 0x0)
pData->param.data[j].hints |= PARAMETER_CAN_BE_CV_CONTROLLED;
}

// no such thing as VST default parameters
def = fEffect->getParameter(fEffect, ij);



Loading…
Cancel
Save