Browse Source

Carla: Continue last commit, now for LADSPA, DSSI and LV2

tags/v0.9.0
falkTX 13 years ago
parent
commit
ff9fe01a45
4 changed files with 43 additions and 17 deletions
  1. +4
    -5
      c++/carla-backend/carla_native.cpp
  2. +13
    -4
      c++/carla-backend/dssi.cpp
  3. +13
    -4
      c++/carla-backend/ladspa.cpp
  4. +13
    -4
      c++/carla-backend/lv2.cpp

+ 4
- 5
c++/carla-backend/carla_native.cpp View File

@@ -1285,7 +1285,7 @@ public:
bool do_balance = (m_hints & PLUGIN_CAN_BALANCE) > 0 && (x_balanceLeft != -1.0 || x_balanceRight != 1.0);

double bal_rangeL, bal_rangeR;
float oldBufLeft[do_balance ? frames : 0];
float bufValue, oldBufLeft[do_balance ? frames : 0];

for (i=0; i < aOut.count; i++)
{
@@ -1294,10 +1294,9 @@ public:
{
for (k=0; k < frames; k++)
{
if (aIn.count == 1)
outBuffer[i][k] = (outBuffer[i][k]*x_dryWet)+(inBuffer[0][k]*(1.0-x_dryWet));
else
outBuffer[i][k] = (outBuffer[i][k]*x_dryWet)+(inBuffer[i][k]*(1.0-x_dryWet));
bufValue = (aIn.count == 1) ? inBuffer[0][k] : inBuffer[i][k];

outBuffer[i][k] = (outBuffer[i][k]*x_dryWet)+(bufValue*(1.0-x_dryWet));
}
}



+ 13
- 4
c++/carla-backend/dssi.cpp View File

@@ -1295,7 +1295,7 @@ public:
bool do_balance = (m_hints & PLUGIN_CAN_BALANCE) > 0 && (x_balanceLeft != -1.0 || x_balanceRight != 1.0);

double bal_rangeL, bal_rangeR;
float oldBufLeft[do_balance ? frames : 0];
float bufValue, oldBufLeft[do_balance ? frames : 0];

for (i=0; i < aOut.count; i++)
{
@@ -1304,10 +1304,12 @@ public:
{
for (k=0; k < frames; k++)
{
if (aIn.count == 1)
outBuffer[i][k] = (outBuffer[i][k]*x_dryWet)+(inBuffer[0][k]*(1.0-x_dryWet));
if (k < m_latency && m_latency < frames)
bufValue = (aIn.count == 1) ? m_tempBufferIn[0][k] : m_tempBufferIn[i][k];
else
outBuffer[i][k] = (outBuffer[i][k]*x_dryWet)+(inBuffer[i][k]*(1.0-x_dryWet));
bufValue = (aIn.count == 1) ? inBuffer[0][k-m_latency] : inBuffer[i][k-m_latency];

outBuffer[i][k] = (outBuffer[i][k]*x_dryWet)+(bufValue*(1.0-x_dryWet));
}
}

@@ -1351,6 +1353,13 @@ public:
aOutsPeak[i] = abs(outBuffer[i][k]);
}
}

// Latency, save values for next callback
if (m_latency > 0 && m_latency < frames)
{
for (i=0; i < aIn.count; i++)
memcpy(m_tempBufferIn[i], inBuffer[i] + (frames - m_latency), sizeof(float)*m_latency);
}
}
else
{


+ 13
- 4
c++/carla-backend/ladspa.cpp View File

@@ -971,7 +971,7 @@ public:
bool do_balance = (m_hints & PLUGIN_CAN_BALANCE) > 0 && (x_balanceLeft != -1.0 || x_balanceRight != 1.0);

double bal_rangeL, bal_rangeR;
float oldBufLeft[do_balance ? frames : 0];
float bufValue, oldBufLeft[do_balance ? frames : 0];

for (i=0; i < aOut.count; i++)
{
@@ -980,10 +980,12 @@ public:
{
for (k=0; k < frames; k++)
{
if (aIn.count == 1)
outBuffer[i][k] = (outBuffer[i][k]*x_dryWet)+(inBuffer[0][k]*(1.0-x_dryWet));
if (k < m_latency && m_latency < frames)
bufValue = (aIn.count == 1) ? m_tempBufferIn[0][k] : m_tempBufferIn[i][k];
else
outBuffer[i][k] = (outBuffer[i][k]*x_dryWet)+(inBuffer[i][k]*(1.0-x_dryWet));
bufValue = (aIn.count == 1) ? inBuffer[0][k-m_latency] : inBuffer[i][k-m_latency];

outBuffer[i][k] = (outBuffer[i][k]*x_dryWet)+(bufValue*(1.0-x_dryWet));
}
}

@@ -1027,6 +1029,13 @@ public:
aOutsPeak[i] = abs(outBuffer[i][k]);
}
}

// Latency, save values for next callback
if (m_latency > 0 && m_latency < frames)
{
for (i=0; i < aIn.count; i++)
memcpy(m_tempBufferIn[i], inBuffer[i] + (frames - m_latency), sizeof(float)*m_latency);
}
}
else
{


+ 13
- 4
c++/carla-backend/lv2.cpp View File

@@ -2572,7 +2572,7 @@ public:
bool do_balance = (m_hints & PLUGIN_CAN_BALANCE) > 0 && (x_balanceLeft != -1.0 || x_balanceRight != 1.0);

double bal_rangeL, bal_rangeR;
float oldBufLeft[do_balance ? frames : 0];
float bufValue, oldBufLeft[do_balance ? frames : 0];

for (i=0; i < aOut.count; i++)
{
@@ -2581,10 +2581,12 @@ public:
{
for (k=0; k < frames; k++)
{
if (aIn.count == 1)
outBuffer[i][k] = (outBuffer[i][k]*x_dryWet)+(inBuffer[0][k]*(1.0-x_dryWet));
if (k < m_latency && m_latency < frames)
bufValue = (aIn.count == 1) ? m_tempBufferIn[0][k] : m_tempBufferIn[i][k];
else
outBuffer[i][k] = (outBuffer[i][k]*x_dryWet)+(inBuffer[i][k]*(1.0-x_dryWet));
bufValue = (aIn.count == 1) ? inBuffer[0][k-m_latency] : inBuffer[i][k-m_latency];

outBuffer[i][k] = (outBuffer[i][k]*x_dryWet)+(bufValue*(1.0-x_dryWet));
}
}

@@ -2628,6 +2630,13 @@ public:
aOutsPeak[i] = abs(outBuffer[i][k]);
}
}

// Latency, save values for next callback
if (m_latency > 0 && m_latency < frames)
{
for (i=0; i < aIn.count; i++)
memcpy(m_tempBufferIn[i], inBuffer[i] + (frames - m_latency), sizeof(float)*m_latency);
}
}
else
{


Loading…
Cancel
Save