Browse Source

More fixes for Vex and Zyn fx

tags/1.9.4
falkTX 11 years ago
parent
commit
5554b6e637
6 changed files with 22 additions and 24 deletions
  1. +12
    -12
      source/modules/carla_native/vex-fx.cpp
  2. +5
    -2
      source/modules/carla_native/vex-synth.cpp
  3. +1
    -2
      source/modules/carla_native/zynaddsubfx/DSP/AnalogFilter.cpp
  4. +2
    -4
      source/modules/carla_native/zynaddsubfx/DSP/FormantFilter.cpp
  5. +1
    -2
      source/modules/carla_native/zynaddsubfx/DSP/SVFilter.cpp
  6. +1
    -2
      source/modules/carla_native/zynaddsubfx/Effects/Reverb.cpp

+ 12
- 12
source/modules/carla_native/vex-fx.cpp View File

@@ -72,7 +72,7 @@ public:
clearContentComponent();
}

bool wasClosedByUser() const
bool wasClosedByUser() const noexcept
{
return fClosed;
}
@@ -577,9 +577,9 @@ protected:
void process(float** const inBuffer, float** const outBuffer, const uint32_t frames, const MidiEvent* const, const uint32_t) override
{
if (inBuffer[0] != outBuffer[0])
carla_copyFloat(outBuffer[0], inBuffer[0], frames);
FloatVectorOperations::copy(outBuffer[0], inBuffer[0], frames);
if (inBuffer[1] != outBuffer[1])
carla_copyFloat(outBuffer[1], inBuffer[1], frames);
FloatVectorOperations::copy(outBuffer[1], inBuffer[1], frames);

fChorus.processBlock(outBuffer[0], outBuffer[1], frames);
}
@@ -617,8 +617,8 @@ public:
{
std::memset(fParameters, 0, sizeof(float)*92);

fParameters[73] = 0.5f * 8.0f;
fParameters[74] = 0.4f * 100.0f;
fParameters[73] = 0.5f;
fParameters[74] = 0.4f;

fDelay.setSampleRate(getSampleRate());
}
@@ -654,6 +654,7 @@ protected:
case kParamTime:
hints |= PARAMETER_IS_INTEGER;
paramInfo.name = "Time";
paramInfo.unit = "steps";
paramInfo.ranges.def = 4.0f;
paramInfo.ranges.min = 0.0f;
paramInfo.ranges.max = 8.0f;
@@ -709,9 +710,9 @@ protected:
void process(float** const inBuffer, float** const outBuffer, const uint32_t frames, const MidiEvent* const, const uint32_t) override
{
if (inBuffer[0] != outBuffer[0])
carla_copyFloat(outBuffer[0], inBuffer[0], frames);
FloatVectorOperations::copy(outBuffer[0], inBuffer[0], frames);
if (inBuffer[1] != outBuffer[1])
carla_copyFloat(outBuffer[1], inBuffer[1], frames);
FloatVectorOperations::copy(outBuffer[1], inBuffer[1], frames);

const TimeInfo* const timeInfo(getTimeInfo());
const double bpm((timeInfo != nullptr && timeInfo->bbt.valid) ? timeInfo->bbt.beatsPerMinute : 120.0);
@@ -753,10 +754,9 @@ public:
{
std::memset(fParameters, 0, sizeof(float)*92);

// FIXME?
fParameters[79] = 0.6f;
fParameters[80] = 0.6f;
fParameters[81] = 0.7f;
fParameters[80] = 0.7f;
fParameters[81] = 0.6f;
}

protected:
@@ -854,9 +854,9 @@ protected:
void process(float** const inBuffer, float** const outBuffer, const uint32_t frames, const MidiEvent* const, const uint32_t) override
{
for (uint32_t i=0; i< frames; ++i)
outBuffer[0][i] = inBuffer[0][i]/2.0f;
FloatVectorOperations::copyWithMultiply(outBuffer[0], inBuffer[0], 0.5f, frames);
for (uint32_t i=0; i< frames; ++i)
outBuffer[1][i] = inBuffer[1][i]/2.0f;
FloatVectorOperations::copyWithMultiply(outBuffer[1], inBuffer[1], 0.5f, frames);

fReverb.processBlock(outBuffer[0], outBuffer[1], frames);
}


+ 5
- 2
source/modules/carla_native/vex-synth.cpp View File

@@ -246,7 +246,7 @@ public:
fReverb(fParameters),
fSynth(fParameters)
{
std::memset(fParameters, 0, sizeof(float)*92);
std::memset(fParameters, 0, sizeof(float)*kParamCount);

fParameters[0] = 1.0f; // main volume

@@ -309,6 +309,9 @@ public:

bufferSizeChanged(getBufferSize());
sampleRateChanged(getSampleRate());

for (int i = 0; i < kParamCount; ++i)
fSynth.update(i);
}

~VexSynthPlugin()
@@ -670,7 +673,7 @@ protected:
}

private:
float fParameters[92];
float fParameters[kParamCount];

AudioSampleBuffer* obf;
AudioSampleBuffer* abf;


+ 1
- 2
source/modules/carla_native/zynaddsubfx/DSP/AnalogFilter.cpp View File

@@ -360,7 +360,7 @@ void AnalogFilter::filterout(float *smp)

if(needsinterpolation) {
//Merge Filter at old coeff with new coeff
float *ismp = getTmpBuffer();
float ismp[buffersize];
memcpy(ismp, smp, bufferbytes);

for(int i = 0; i < stages + 1; ++i)
@@ -370,7 +370,6 @@ void AnalogFilter::filterout(float *smp)
float x = (float)i / buffersize_f;
smp[i] = ismp[i] * (1.0f - x) + smp[i] * x;
}
returnTmpBuffer(ismp);
needsinterpolation = false;
}



+ 2
- 4
source/modules/carla_native/zynaddsubfx/DSP/FormantFilter.cpp View File

@@ -204,13 +204,13 @@ void FormantFilter::setfreq_and_q(float frequency, float q_)

void FormantFilter::filterout(float *smp)
{
float *inbuffer = getTmpBuffer();
float inbuffer[buffersize];

memcpy(inbuffer, smp, bufferbytes);
memset(smp, 0, bufferbytes);

for(int j = 0; j < numformants; ++j) {
float *tmpbuf = getTmpBuffer();
float tmpbuf[buffersize];
for(int i = 0; i < buffersize; ++i)
tmpbuf[i] = inbuffer[i] * outgain;
formant[j]->filterout(tmpbuf);
@@ -225,8 +225,6 @@ void FormantFilter::filterout(float *smp)
else
for(int i = 0; i < buffersize; ++i)
smp[i] += tmpbuf[i] * currentformants[j].amp;
returnTmpBuffer(tmpbuf);
oldformantamp[j] = currentformants[j].amp;
}
returnTmpBuffer(inbuffer);
}

+ 1
- 2
source/modules/carla_native/zynaddsubfx/DSP/SVFilter.cpp View File

@@ -160,7 +160,7 @@ void SVFilter::filterout(float *smp)
singlefilterout(smp, st[i], par);

if(needsinterpolation) {
float *ismp = getTmpBuffer();
float ismp[buffersize];
memcpy(ismp, smp, bufferbytes);

for(int i = 0; i < stages + 1; ++i)
@@ -170,7 +170,6 @@ void SVFilter::filterout(float *smp)
float x = (float)i / buffersize_f;
smp[i] = ismp[i] * (1.0f - x) + smp[i] * x;
}
returnTmpBuffer(ismp);
needsinterpolation = false;
}



+ 1
- 2
source/modules/carla_native/zynaddsubfx/Effects/Reverb.cpp View File

@@ -148,7 +148,7 @@ void Reverb::out(const Stereo<float *> &smp)
if(!Pvolume && insertion)
return;

float *inputbuf = getTmpBuffer();
float inputbuf[buffersize];
for(int i = 0; i < buffersize; ++i)
inputbuf[i] = (smp.l[i] + smp.r[i]) / 2.0f;

@@ -173,7 +173,6 @@ void Reverb::out(const Stereo<float *> &smp)

processmono(0, efxoutl, inputbuf); //left
processmono(1, efxoutr, inputbuf); //right
returnTmpBuffer(inputbuf);

float lvol = rs / REV_COMBS * pangainL;
float rvol = rs / REV_COMBS * pangainR;


Loading…
Cancel
Save