Forgot some tweaks on host cv module, now latency tested too
Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
parent
deeecfd3ab
commit
5e2473b6e9
2 changed files with 37 additions and 20 deletions
|
|
@ -76,8 +76,6 @@ struct HostAudio : TerminalModule {
|
||||||
|
|
||||||
void processTerminalInput(const ProcessArgs&) override
|
void processTerminalInput(const ProcessArgs&) override
|
||||||
{
|
{
|
||||||
const float* const* const dataIns = pcontext->dataIns;
|
|
||||||
|
|
||||||
const int blockFrames = pcontext->engine->getBlockFrames();
|
const int blockFrames = pcontext->engine->getBlockFrames();
|
||||||
const int64_t blockFrame = pcontext->engine->getBlockFrame();
|
const int64_t blockFrame = pcontext->engine->getBlockFrame();
|
||||||
|
|
||||||
|
|
@ -98,7 +96,7 @@ struct HostAudio : TerminalModule {
|
||||||
for (int i=0; i<numOutputs; ++i)
|
for (int i=0; i<numOutputs; ++i)
|
||||||
outputs[i].setVoltage(0.0f);
|
outputs[i].setVoltage(0.0f);
|
||||||
}
|
}
|
||||||
else if (dataIns != nullptr)
|
else if (const float* const* const dataIns = pcontext->dataIns)
|
||||||
{
|
{
|
||||||
for (int i=0; i<numOutputs; ++i)
|
for (int i=0; i<numOutputs; ++i)
|
||||||
outputs[i].setVoltage(dataIns[i][k] * 10.0f);
|
outputs[i].setVoltage(dataIns[i][k] * 10.0f);
|
||||||
|
|
|
||||||
|
|
@ -64,45 +64,64 @@ struct HostCV : TerminalModule {
|
||||||
if (pcontext->variant != kCardinalVariantMain)
|
if (pcontext->variant != kCardinalVariantMain)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const float* const* const dataIns = pcontext->dataIns;
|
|
||||||
float** const dataOuts = pcontext->dataOuts;
|
|
||||||
|
|
||||||
const int64_t blockFrame = pcontext->engine->getBlockFrame();
|
const int64_t blockFrame = pcontext->engine->getBlockFrame();
|
||||||
|
|
||||||
|
// only checked on input
|
||||||
if (lastBlockFrame != blockFrame)
|
if (lastBlockFrame != blockFrame)
|
||||||
{
|
{
|
||||||
dataFrame = 0;
|
dataFrame = 0;
|
||||||
lastBlockFrame = blockFrame;
|
lastBlockFrame = blockFrame;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// only incremented on output
|
||||||
|
const int k = dataFrame;
|
||||||
|
DISTRHO_SAFE_ASSERT_RETURN(k < pcontext->engine->getBlockFrames(),);
|
||||||
|
|
||||||
|
if (isBypassed())
|
||||||
|
{
|
||||||
|
for (int i=0; i<10; ++i)
|
||||||
|
outputs[i].setVoltage(0.0f);
|
||||||
|
}
|
||||||
|
else if (const float* const* const dataIns = pcontext->dataIns)
|
||||||
|
{
|
||||||
|
float outputOffset;
|
||||||
|
outputOffset = params[BIPOLAR_OUTPUTS_1_5].getValue() > 0.1f ? 5.0f : 0.0f;
|
||||||
|
|
||||||
|
for (int i=0; i<5; ++i)
|
||||||
|
outputs[i].setVoltage(dataIns[i+CARDINAL_AUDIO_IO_OFFSET][k] - outputOffset);
|
||||||
|
|
||||||
|
outputOffset = params[BIPOLAR_OUTPUTS_6_10].getValue() > 0.1f ? 5.0f : 0.0f;
|
||||||
|
|
||||||
|
for (int i=5; i<10; ++i)
|
||||||
|
outputs[i].setVoltage(dataIns[i+CARDINAL_AUDIO_IO_OFFSET][k] - outputOffset);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void processTerminalOutput(const ProcessArgs&) override
|
||||||
|
{
|
||||||
|
if (pcontext->variant != kCardinalVariantMain)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// only incremented on output
|
||||||
const int k = dataFrame++;
|
const int k = dataFrame++;
|
||||||
DISTRHO_SAFE_ASSERT_RETURN(k < pcontext->engine->getBlockFrames(),);
|
DISTRHO_SAFE_ASSERT_RETURN(k < pcontext->engine->getBlockFrames(),);
|
||||||
|
|
||||||
if (isBypassed())
|
if (isBypassed())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
float inputOffset, outputOffset;
|
float** const dataOuts = pcontext->dataOuts;
|
||||||
|
|
||||||
|
float inputOffset;
|
||||||
inputOffset = params[BIPOLAR_INPUTS_1_5].getValue() > 0.1f ? 5.0f : 0.0f;
|
inputOffset = params[BIPOLAR_INPUTS_1_5].getValue() > 0.1f ? 5.0f : 0.0f;
|
||||||
outputOffset = params[BIPOLAR_OUTPUTS_1_5].getValue() > 0.1f ? 5.0f : 0.0f;
|
|
||||||
|
|
||||||
for (int i=0; i<5; ++i)
|
for (int i=0; i<5; ++i)
|
||||||
{
|
dataOuts[i+CARDINAL_AUDIO_IO_OFFSET][k] += inputs[i].getVoltage() + inputOffset;
|
||||||
outputs[i].setVoltage(dataIns[i+CARDINAL_AUDIO_IO_OFFSET][k] - outputOffset);
|
|
||||||
dataOuts[i+CARDINAL_AUDIO_IO_OFFSET][k] = inputs[i].getVoltage() + inputOffset;
|
|
||||||
}
|
|
||||||
|
|
||||||
inputOffset = params[BIPOLAR_INPUTS_6_10].getValue() > 0.1f ? 5.0f : 0.0f;
|
inputOffset = params[BIPOLAR_INPUTS_6_10].getValue() > 0.1f ? 5.0f : 0.0f;
|
||||||
outputOffset = params[BIPOLAR_OUTPUTS_6_10].getValue() > 0.1f ? 5.0f : 0.0f;
|
|
||||||
|
|
||||||
for (int i=5; i<10; ++i)
|
for (int i=5; i<10; ++i)
|
||||||
{
|
dataOuts[i+CARDINAL_AUDIO_IO_OFFSET][k] += inputs[i].getVoltage() + inputOffset;
|
||||||
outputs[i].setVoltage(dataIns[i+CARDINAL_AUDIO_IO_OFFSET][k] - outputOffset);
|
|
||||||
dataOuts[i+CARDINAL_AUDIO_IO_OFFSET][k] = inputs[i].getVoltage() + inputOffset;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void processTerminalOutput(const ProcessArgs&) override
|
|
||||||
{}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct HostCVWidget : ModuleWidgetWith8HP {
|
struct HostCVWidget : ModuleWidgetWith8HP {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue