Browse Source

Allow to run CV plugins in rack mode, CV connects to dummy port

tags/v2.3.0-RC1
falkTX 3 years ago
parent
commit
9210d031fb
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
2 changed files with 8 additions and 11 deletions
  1. +1
    -9
      source/backend/engine/CarlaEngine.cpp
  2. +7
    -2
      source/backend/engine/CarlaEngineGraph.cpp

+ 1
- 9
source/backend/engine/CarlaEngine.cpp View File

@@ -743,15 +743,7 @@ bool CarlaEngine::addPlugin(const BinaryType btype,

bool canRun = true;

/**/ if (pData->options.processMode == ENGINE_PROCESS_MODE_CONTINUOUS_RACK)
{
if (plugin->getCVInCount() > 0 || plugin->getCVInCount() > 0)
{
setLastError("Carla's rack mode cannot work with plugins that have CV ports, sorry!");
canRun = false;
}
}
else if (pData->options.processMode == ENGINE_PROCESS_MODE_PATCHBAY)
if (pData->options.processMode == ENGINE_PROCESS_MODE_PATCHBAY)
{
/**/ if (plugin->getMidiInCount() > 1 || plugin->getMidiOutCount() > 1)
{


+ 7
- 2
source/backend/engine/CarlaEngineGraph.cpp View File

@@ -1008,6 +1008,7 @@ void RackGraph::process(CarlaEngine::ProtectedData* const data, const float* inB

const uint32_t numInBufs = std::max(oldAudioInCount, 2U);
const uint32_t numOutBufs = std::max(oldAudioOutCount, 2U);
const uint32_t numCvBufs = std::max(plugin->getCVInCount(), plugin->getCVOutCount());

const float* inBuf[numInBufs];
inBuf[0] = inBuf0;
@@ -1017,7 +1018,11 @@ void RackGraph::process(CarlaEngine::ProtectedData* const data, const float* inB
outBuf[0] = outBufReal[0];
outBuf[1] = outBufReal[1];

if (numInBufs > 2 || numOutBufs > 2)
float* cvBuf[numCvBufs];
for (uint32_t j=0; j<numCvBufs; ++j)
cvBuf[j] = dummyBuf;

if (numInBufs > 2 || numOutBufs > 2 || numCvBufs != 0)
{
carla_zeroFloats(dummyBuf, frames);

@@ -1030,7 +1035,7 @@ void RackGraph::process(CarlaEngine::ProtectedData* const data, const float* inB

// process
plugin->initBuffers();
plugin->process(inBuf, outBuf, nullptr, nullptr, frames);
plugin->process(inBuf, outBuf, cvBuf, cvBuf, frames);
plugin->unlock();

// if plugin has no audio inputs, add input buffer


Loading…
Cancel
Save