Browse Source

Fix last commits, Zyn fx now properly sets 50% wet on init

tags/1.9.4
falkTX 11 years ago
parent
commit
e2ab7ede21
3 changed files with 13 additions and 21 deletions
  1. +12
    -16
      source/backend/native/zynaddsubfx.cpp
  2. +1
    -1
      source/backend/plugin/NativePlugin.cpp
  3. +0
    -4
      source/carla_shared.py

+ 12
- 16
source/backend/native/zynaddsubfx.cpp View File

@@ -582,11 +582,10 @@ protected:
fEffect(nullptr), fEffect(nullptr),
efxoutl(new float[synth->buffersize]), efxoutl(new float[synth->buffersize]),
efxoutr(new float[synth->buffersize]), efxoutr(new float[synth->buffersize]),
fWetOnly(false),
fFirstInit(true),
kParamCount(paramCount-2), // volume and pan handled by host kParamCount(paramCount-2), // volume and pan handled by host
kProgramCount(programCount) kProgramCount(programCount)
{ {
hostDispatcher(HOST_OPCODE_SET_DRYWET, 0, 0, nullptr, 0.5f);
} }


~FxAbstractPlugin() override ~FxAbstractPlugin() override
@@ -639,11 +638,13 @@ protected:
void setParameterValue(const uint32_t index, const float value) final void setParameterValue(const uint32_t index, const float value) final
{ {
fEffect->changepar(index+2, value); fEffect->changepar(index+2, value);
fFirstInit = false;
} }


void setMidiProgram(const uint8_t, const uint32_t, const uint32_t program) final void setMidiProgram(const uint8_t, const uint32_t, const uint32_t program) final
{ {
fEffect->setpreset(program); fEffect->setpreset(program);
fFirstInit = false;


const float volume(float(fEffect->getpar(0))/127.0f); const float volume(float(fEffect->getpar(0))/127.0f);
hostDispatcher(HOST_OPCODE_SET_VOLUME, 0, 0, nullptr, volume); hostDispatcher(HOST_OPCODE_SET_VOLUME, 0, 0, nullptr, volume);
@@ -659,6 +660,12 @@ protected:
void activate() final void activate() final
{ {
fEffect->cleanup(); fEffect->cleanup();

if (fFirstInit)
{
fFirstInit = false;
hostDispatcher(HOST_OPCODE_SET_DRYWET, 0, 0, nullptr, 0.5f);
}
} }


void process(float** const inBuffer, float** const outBuffer, const uint32_t frames, const uint32_t, const MidiEvent* const) final void process(float** const inBuffer, float** const outBuffer, const uint32_t frames, const uint32_t, const MidiEvent* const) final
@@ -667,19 +674,8 @@ protected:


fEffect->out(Stereo<float*>(inBuffer[0], inBuffer[1])); fEffect->out(Stereo<float*>(inBuffer[0], inBuffer[1]));


if (fWetOnly)
{
carla_copyFloat(outBuffer[0], efxoutl, frames);
carla_copyFloat(outBuffer[1], efxoutr, frames);
}
else
{
for (uint32_t i=0; i<frames; ++i)
{
outBuffer[0][i] = inBuffer[0][i]/2.0f + efxoutl[i]/2.0f;
outBuffer[1][i] = inBuffer[1][i]/2.0f + efxoutr[i]/2.0f;
}
}
carla_copyFloat(outBuffer[0], efxoutl, frames);
carla_copyFloat(outBuffer[1], efxoutr, frames);
} }


// ------------------------------------------------------------------- // -------------------------------------------------------------------
@@ -713,7 +709,7 @@ protected:
Effect* fEffect; Effect* fEffect;
float* efxoutl; float* efxoutl;
float* efxoutr; float* efxoutr;
bool fWetOnly;
bool fFirstInit;
const uint32_t kParamCount; const uint32_t kParamCount;
const uint32_t kProgramCount; const uint32_t kProgramCount;
}; };


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

@@ -2147,7 +2147,7 @@ protected:


intptr_t handleDispatcher(const HostDispatcherOpcode opcode, const int32_t index, const intptr_t value, void* const ptr, const float opt) intptr_t handleDispatcher(const HostDispatcherOpcode opcode, const int32_t index, const intptr_t value, void* const ptr, const float opt)
{ {
carla_stdout("NativePlugin::handleDispatcher(%i, %i, " P_INTPTR ", %p, %f", opcode, index, value, ptr, opt);
carla_debug("NativePlugin::handleDispatcher(%i, %i, " P_INTPTR ", %p, %f)", opcode, index, value, ptr, opt);


intptr_t ret = 0; intptr_t ret = 0;




+ 0
- 4
source/carla_shared.py View File

@@ -1108,22 +1108,18 @@ class PluginEdit(QDialog):
self.ui.dial_drywet.setCustomPaint(self.ui.dial_drywet.CUSTOM_PAINT_CARLA_WET) self.ui.dial_drywet.setCustomPaint(self.ui.dial_drywet.CUSTOM_PAINT_CARLA_WET)
self.ui.dial_drywet.setPixmap(3) self.ui.dial_drywet.setPixmap(3)
self.ui.dial_drywet.setLabel("Dry/Wet") self.ui.dial_drywet.setLabel("Dry/Wet")
self.ui.dial_drywet.setValue(Carla.host.get_current_parameter_value(self.fPluginId, PARAMETER_DRYWET))


self.ui.dial_vol.setCustomPaint(self.ui.dial_vol.CUSTOM_PAINT_CARLA_VOL) self.ui.dial_vol.setCustomPaint(self.ui.dial_vol.CUSTOM_PAINT_CARLA_VOL)
self.ui.dial_vol.setPixmap(3) self.ui.dial_vol.setPixmap(3)
self.ui.dial_vol.setLabel("Volume") self.ui.dial_vol.setLabel("Volume")
self.ui.dial_vol.setValue(Carla.host.get_current_parameter_value(self.fPluginId, PARAMETER_VOLUME))


self.ui.dial_b_left.setCustomPaint(self.ui.dial_b_left.CUSTOM_PAINT_CARLA_L) self.ui.dial_b_left.setCustomPaint(self.ui.dial_b_left.CUSTOM_PAINT_CARLA_L)
self.ui.dial_b_left.setPixmap(4) self.ui.dial_b_left.setPixmap(4)
self.ui.dial_b_left.setLabel("L") self.ui.dial_b_left.setLabel("L")
self.ui.dial_b_left.setValue(Carla.host.get_current_parameter_value(self.fPluginId, PARAMETER_BALANCE_LEFT))


self.ui.dial_b_right.setCustomPaint(self.ui.dial_b_right.CUSTOM_PAINT_CARLA_R) self.ui.dial_b_right.setCustomPaint(self.ui.dial_b_right.CUSTOM_PAINT_CARLA_R)
self.ui.dial_b_right.setPixmap(4) self.ui.dial_b_right.setPixmap(4)
self.ui.dial_b_right.setLabel("R") self.ui.dial_b_right.setLabel("R")
self.ui.dial_b_right.setValue(Carla.host.get_current_parameter_value(self.fPluginId, PARAMETER_BALANCE_RIGHT))


self.ui.keyboard.setMode(self.ui.keyboard.HORIZONTAL) self.ui.keyboard.setMode(self.ui.keyboard.HORIZONTAL)
self.ui.keyboard.setOctaves(10) self.ui.keyboard.setOctaves(10)


Loading…
Cancel
Save