|
|
@@ -29,6 +29,8 @@ |
|
|
|
#include "zynaddsubfx/Misc/Master.h" |
|
|
|
#include "zynaddsubfx/Misc/Part.h" |
|
|
|
#include "zynaddsubfx/Misc/Util.h" |
|
|
|
|
|
|
|
#include "zynaddsubfx/Effects/Alienwah.h" |
|
|
|
#include "zynaddsubfx/Effects/Reverb.h" |
|
|
|
|
|
|
|
#ifdef WANT_ZYNADDSUBFX_UI |
|
|
@@ -560,6 +562,215 @@ public: |
|
|
|
|
|
|
|
// ----------------------------------------------------------------------- |
|
|
|
|
|
|
|
class FxAlienWahPlugin : public PluginDescriptorClass |
|
|
|
{ |
|
|
|
public: |
|
|
|
static const uint32_t kParamCount = 11; |
|
|
|
static const uint32_t kProgramCount = 4; |
|
|
|
|
|
|
|
FxAlienWahPlugin(const HostDescriptor* const host) |
|
|
|
: PluginDescriptorClass(host), |
|
|
|
efxoutl(new float[getBufferSize()]), |
|
|
|
efxoutr(new float[getBufferSize()]), |
|
|
|
fEffect(false, efxoutl, efxoutr) |
|
|
|
{ |
|
|
|
} |
|
|
|
|
|
|
|
~FxAlienWahPlugin() |
|
|
|
{ |
|
|
|
if (efxoutl != nullptr) |
|
|
|
{ |
|
|
|
delete[] efxoutl; |
|
|
|
efxoutl = nullptr; |
|
|
|
} |
|
|
|
|
|
|
|
if (efxoutr != nullptr) |
|
|
|
{ |
|
|
|
delete[] efxoutr; |
|
|
|
efxoutr = nullptr; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
protected: |
|
|
|
// ------------------------------------------------------------------- |
|
|
|
// Plugin parameter calls |
|
|
|
|
|
|
|
uint32_t getParameterCount() override |
|
|
|
{ |
|
|
|
return kParamCount; |
|
|
|
} |
|
|
|
|
|
|
|
const Parameter* getParameterInfo(const uint32_t index) override |
|
|
|
{ |
|
|
|
if (index >= kParamCount) |
|
|
|
return nullptr; |
|
|
|
|
|
|
|
static Parameter param; |
|
|
|
|
|
|
|
int hints = PARAMETER_IS_ENABLED | PARAMETER_IS_INTEGER; |
|
|
|
|
|
|
|
param.name = nullptr; |
|
|
|
param.unit = nullptr; |
|
|
|
param.ranges.def = 1.0f; |
|
|
|
param.ranges.min = 0.0f; |
|
|
|
param.ranges.max = 127.0f; |
|
|
|
param.ranges.step = 1.0f; |
|
|
|
param.ranges.stepSmall = 1.0f; |
|
|
|
param.ranges.stepLarge = 20.0f; |
|
|
|
param.scalePointCount = 0; |
|
|
|
param.scalePoints = nullptr; |
|
|
|
|
|
|
|
switch (index) |
|
|
|
{ |
|
|
|
case 0: |
|
|
|
hints |= PARAMETER_IS_AUTOMABLE; |
|
|
|
param.name = "Volume"; |
|
|
|
param.ranges.def = 127.0f; |
|
|
|
break; |
|
|
|
case 1: |
|
|
|
hints |= PARAMETER_IS_AUTOMABLE; |
|
|
|
param.name = "Panning"; |
|
|
|
param.ranges.def = 64.0f; |
|
|
|
break; |
|
|
|
case 2: |
|
|
|
hints |= PARAMETER_IS_AUTOMABLE; |
|
|
|
param.name = "LFO Frequency"; |
|
|
|
param.ranges.def = 70.0f; |
|
|
|
break; |
|
|
|
case 3: |
|
|
|
hints |= PARAMETER_IS_AUTOMABLE; |
|
|
|
param.name = "LFO Randomness"; |
|
|
|
param.ranges.def = 0.0f; |
|
|
|
break; |
|
|
|
case 4: |
|
|
|
hints |= PARAMETER_IS_AUTOMABLE; |
|
|
|
param.name = "LFO Type"; |
|
|
|
param.ranges.def = 0.0f; |
|
|
|
break; |
|
|
|
case 5: |
|
|
|
hints |= PARAMETER_IS_AUTOMABLE; |
|
|
|
param.name = "LFO Stereo"; |
|
|
|
param.ranges.def = 62.0f; |
|
|
|
break; |
|
|
|
case 6: |
|
|
|
hints |= PARAMETER_IS_AUTOMABLE; |
|
|
|
param.name = "Depth"; |
|
|
|
param.ranges.def = 60.0f; |
|
|
|
break; |
|
|
|
case 7: |
|
|
|
hints |= PARAMETER_IS_AUTOMABLE; |
|
|
|
param.name = "Feedback"; |
|
|
|
param.ranges.def = 105.0f; |
|
|
|
break; |
|
|
|
case 8: |
|
|
|
param.name = "Delay"; |
|
|
|
param.ranges.def = 25.0f; |
|
|
|
break; |
|
|
|
case 9: |
|
|
|
hints |= PARAMETER_IS_AUTOMABLE; |
|
|
|
param.name = "Cross"; |
|
|
|
param.ranges.def = 0.0f; |
|
|
|
break; |
|
|
|
case 10: |
|
|
|
hints |= PARAMETER_IS_AUTOMABLE; |
|
|
|
param.name = "Phase"; |
|
|
|
param.ranges.def = 64.0f; |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|
param.hints = static_cast<ParameterHints>(hints); |
|
|
|
|
|
|
|
return ¶m; |
|
|
|
} |
|
|
|
|
|
|
|
float getParameterValue(const uint32_t index) override |
|
|
|
{ |
|
|
|
return fEffect.getpar(index); |
|
|
|
} |
|
|
|
|
|
|
|
// ------------------------------------------------------------------- |
|
|
|
// Plugin midi-program calls |
|
|
|
|
|
|
|
uint32_t getMidiProgramCount() override |
|
|
|
{ |
|
|
|
return kProgramCount; |
|
|
|
} |
|
|
|
|
|
|
|
const MidiProgram* getMidiProgramInfo(const uint32_t index) override |
|
|
|
{ |
|
|
|
if (index >= kProgramCount) |
|
|
|
return nullptr; |
|
|
|
|
|
|
|
static MidiProgram midiProg; |
|
|
|
|
|
|
|
midiProg.bank = 0; |
|
|
|
midiProg.program = index; |
|
|
|
midiProg.name = nullptr; |
|
|
|
|
|
|
|
switch (index) |
|
|
|
{ |
|
|
|
case 0: |
|
|
|
midiProg.name = "AlienWah1"; |
|
|
|
break; |
|
|
|
case 1: |
|
|
|
midiProg.name = "AlienWah2"; |
|
|
|
break; |
|
|
|
case 2: |
|
|
|
midiProg.name = "AlienWah3"; |
|
|
|
break; |
|
|
|
case 3: |
|
|
|
midiProg.name = "AlienWah4"; |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|
return &midiProg; |
|
|
|
} |
|
|
|
|
|
|
|
// ------------------------------------------------------------------- |
|
|
|
// Plugin state calls |
|
|
|
|
|
|
|
void setParameterValue(const uint32_t index, const float value) override |
|
|
|
{ |
|
|
|
fEffect.changepar(index, value); |
|
|
|
} |
|
|
|
|
|
|
|
void setMidiProgram(const uint8_t, const uint32_t, const uint32_t program) override |
|
|
|
{ |
|
|
|
fEffect.setpreset(program); |
|
|
|
} |
|
|
|
|
|
|
|
// ------------------------------------------------------------------- |
|
|
|
// Plugin process calls |
|
|
|
|
|
|
|
void activate() override |
|
|
|
{ |
|
|
|
fEffect.cleanup(); |
|
|
|
} |
|
|
|
|
|
|
|
void process(float** const inBuffer, float** const outBuffer, const uint32_t frames, const uint32_t, const MidiEvent* const) override |
|
|
|
{ |
|
|
|
CARLA_ASSERT(frames == synth->buffersize); |
|
|
|
|
|
|
|
fEffect.out(Stereo<float*>(inBuffer[0], inBuffer[1])); |
|
|
|
|
|
|
|
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; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private: |
|
|
|
float* efxoutl; |
|
|
|
float* efxoutr; |
|
|
|
Alienwah fEffect; |
|
|
|
|
|
|
|
ZynPluginDescriptorClassEND(FxAlienWahPlugin) |
|
|
|
CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(FxAlienWahPlugin) |
|
|
|
}; |
|
|
|
|
|
|
|
// ----------------------------------------------------------------------- |
|
|
|
|
|
|
|
class FxReverbPlugin : public PluginDescriptorClass |
|
|
|
{ |
|
|
|
public: |
|
|
@@ -568,10 +779,27 @@ public: |
|
|
|
|
|
|
|
FxReverbPlugin(const HostDescriptor* const host) |
|
|
|
: PluginDescriptorClass(host), |
|
|
|
fEffect(false, nullptr, nullptr) |
|
|
|
efxoutl(new float[getBufferSize()]), |
|
|
|
efxoutr(new float[getBufferSize()]), |
|
|
|
fEffect(false, efxoutl, efxoutr) |
|
|
|
{ |
|
|
|
} |
|
|
|
|
|
|
|
~FxReverbPlugin() |
|
|
|
{ |
|
|
|
if (efxoutl != nullptr) |
|
|
|
{ |
|
|
|
delete[] efxoutl; |
|
|
|
efxoutl = nullptr; |
|
|
|
} |
|
|
|
|
|
|
|
if (efxoutr != nullptr) |
|
|
|
{ |
|
|
|
delete[] efxoutr; |
|
|
|
efxoutr = nullptr; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
protected: |
|
|
|
// ------------------------------------------------------------------- |
|
|
|
// Plugin parameter calls |
|
|
@@ -761,14 +989,20 @@ protected: |
|
|
|
|
|
|
|
void process(float** const inBuffer, float** const outBuffer, const uint32_t frames, const uint32_t, const MidiEvent* const) override |
|
|
|
{ |
|
|
|
// beh, only testing for now anyway |
|
|
|
*((float**)&fEffect.efxoutl) = outBuffer[0]; |
|
|
|
*((float**)&fEffect.efxoutr) = outBuffer[1]; |
|
|
|
CARLA_ASSERT(frames == synth->buffersize); |
|
|
|
|
|
|
|
fEffect.out(Stereo<float*>(inBuffer[0], inBuffer[1])); |
|
|
|
|
|
|
|
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; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private: |
|
|
|
float* efxoutl; |
|
|
|
float* efxoutr; |
|
|
|
Reverb fEffect; |
|
|
|
|
|
|
|
ZynPluginDescriptorClassEND(FxReverbPlugin) |
|
|
@@ -1076,17 +1310,131 @@ private: |
|
|
|
|
|
|
|
// ----------------------------------------------------------------------- |
|
|
|
|
|
|
|
static const PluginDescriptor fxAlienWahDesc = { |
|
|
|
/* category */ PLUGIN_CATEGORY_MODULATOR, |
|
|
|
/* hints */ static_cast<PluginHints>(PLUGIN_USES_STATIC_BUFFERS), |
|
|
|
/* audioIns */ 2, |
|
|
|
/* audioOuts */ 2, |
|
|
|
/* midiIns */ 0, |
|
|
|
/* midiOuts */ 0, |
|
|
|
/* paramIns */ FxAlienWahPlugin::kParamCount, |
|
|
|
/* paramOuts */ 0, |
|
|
|
/* name */ "ZynAlienWah", |
|
|
|
/* label */ "zynAlienWah", |
|
|
|
/* maker */ "falkTX", |
|
|
|
/* copyright */ "GNU GPL v2+", |
|
|
|
PluginDescriptorFILL(FxAlienWahPlugin) |
|
|
|
}; |
|
|
|
|
|
|
|
#if 0 |
|
|
|
static const PluginDescriptor fxChorusDesc = { |
|
|
|
/* category */ PLUGIN_CATEGORY_MODULATOR, |
|
|
|
/* hints */ static_cast<PluginHints>(PLUGIN_USES_STATIC_BUFFERS), |
|
|
|
/* audioIns */ 2, |
|
|
|
/* audioOuts */ 2, |
|
|
|
/* midiIns */ 0, |
|
|
|
/* midiOuts */ 0, |
|
|
|
/* paramIns */ FxChorusPlugin::kParamCount, |
|
|
|
/* paramOuts */ 0, |
|
|
|
/* name */ "ZynChorus", |
|
|
|
/* label */ "zynChorus", |
|
|
|
/* maker */ "falkTX", |
|
|
|
/* copyright */ "GNU GPL v2+", |
|
|
|
PluginDescriptorFILL(FxChorusPlugin) |
|
|
|
}; |
|
|
|
|
|
|
|
static const PluginDescriptor fxDistortionDesc = { |
|
|
|
/* category */ PLUGIN_CATEGORY_MODULATOR, |
|
|
|
/* hints */ static_cast<PluginHints>(PLUGIN_USES_STATIC_BUFFERS), |
|
|
|
/* audioIns */ 2, |
|
|
|
/* audioOuts */ 2, |
|
|
|
/* midiIns */ 0, |
|
|
|
/* midiOuts */ 0, |
|
|
|
/* paramIns */ FxDistortionPlugin::kParamCount, |
|
|
|
/* paramOuts */ 0, |
|
|
|
/* name */ "ZynDistortion", |
|
|
|
/* label */ "zynDistortion", |
|
|
|
/* maker */ "falkTX", |
|
|
|
/* copyright */ "GNU GPL v2+", |
|
|
|
PluginDescriptorFILL(FxDistortionPlugin) |
|
|
|
}; |
|
|
|
|
|
|
|
static const PluginDescriptor fxDynamicFilterDesc = { |
|
|
|
/* category */ PLUGIN_CATEGORY_FILTER, |
|
|
|
/* hints */ static_cast<PluginHints>(PLUGIN_USES_STATIC_BUFFERS), |
|
|
|
/* audioIns */ 2, |
|
|
|
/* audioOuts */ 2, |
|
|
|
/* midiIns */ 0, |
|
|
|
/* midiOuts */ 0, |
|
|
|
/* paramIns */ FxDynamicFilterPlugin::kParamCount, |
|
|
|
/* paramOuts */ 0, |
|
|
|
/* name */ "ZynDynamicFilter", |
|
|
|
/* label */ "zynDynamicFilter", |
|
|
|
/* maker */ "falkTX", |
|
|
|
/* copyright */ "GNU GPL v2+", |
|
|
|
PluginDescriptorFILL(FxDynamicFilterPlugin) |
|
|
|
}; |
|
|
|
|
|
|
|
static const PluginDescriptor fxEchoDesc = { |
|
|
|
/* category */ PLUGIN_CATEGORY_DELAY, |
|
|
|
/* hints */ static_cast<PluginHints>(PLUGIN_USES_STATIC_BUFFERS), |
|
|
|
/* audioIns */ 2, |
|
|
|
/* audioOuts */ 2, |
|
|
|
/* midiIns */ 0, |
|
|
|
/* midiOuts */ 0, |
|
|
|
/* paramIns */ FxEchoPlugin::kParamCount, |
|
|
|
/* paramOuts */ 0, |
|
|
|
/* name */ "ZynEcho", |
|
|
|
/* label */ "zynEcho", |
|
|
|
/* maker */ "falkTX", |
|
|
|
/* copyright */ "GNU GPL v2+", |
|
|
|
PluginDescriptorFILL(FxEchoPlugin) |
|
|
|
}; |
|
|
|
|
|
|
|
static const PluginDescriptor fxEqDesc = { |
|
|
|
/* category */ PLUGIN_CATEGORY_EQ, |
|
|
|
/* hints */ static_cast<PluginHints>(PLUGIN_USES_STATIC_BUFFERS), |
|
|
|
/* audioIns */ 2, |
|
|
|
/* audioOuts */ 2, |
|
|
|
/* midiIns */ 0, |
|
|
|
/* midiOuts */ 0, |
|
|
|
/* paramIns */ FxEqPlugin::kParamCount, |
|
|
|
/* paramOuts */ 0, |
|
|
|
/* name */ "ZynEq", |
|
|
|
/* label */ "zynEq", |
|
|
|
/* maker */ "falkTX", |
|
|
|
/* copyright */ "GNU GPL v2+", |
|
|
|
PluginDescriptorFILL(FxEqPlugin) |
|
|
|
}; |
|
|
|
|
|
|
|
static const PluginDescriptor fxPhaserDesc = { |
|
|
|
/* category */ PLUGIN_CATEGORY_MODULATOR, |
|
|
|
/* hints */ static_cast<PluginHints>(PLUGIN_USES_STATIC_BUFFERS), |
|
|
|
/* audioIns */ 2, |
|
|
|
/* audioOuts */ 2, |
|
|
|
/* midiIns */ 0, |
|
|
|
/* midiOuts */ 0, |
|
|
|
/* paramIns */ FxPhaserPlugin::kParamCount, |
|
|
|
/* paramOuts */ 0, |
|
|
|
/* name */ "ZynPhaser", |
|
|
|
/* label */ "zynPhaser", |
|
|
|
/* maker */ "falkTX", |
|
|
|
/* copyright */ "GNU GPL v2+", |
|
|
|
PluginDescriptorFILL(FxPhaserPlugin) |
|
|
|
}; |
|
|
|
#endif |
|
|
|
|
|
|
|
static const PluginDescriptor fxReverbDesc = { |
|
|
|
/* category */ PLUGIN_CATEGORY_DELAY, |
|
|
|
/* hints */ static_cast<PluginHints>(/*PLUGIN_IS_RTSAFE*/ 0x0), |
|
|
|
/* hints */ static_cast<PluginHints>(PLUGIN_USES_STATIC_BUFFERS), |
|
|
|
/* audioIns */ 2, |
|
|
|
/* audioOuts */ 2, |
|
|
|
/* midiIns */ 0, |
|
|
|
/* midiOuts */ 0, |
|
|
|
/* paramIns */ 12-2, |
|
|
|
/* paramIns */ FxReverbPlugin::kParamCount, |
|
|
|
/* paramOuts */ 0, |
|
|
|
/* name */ "ZynReverb", |
|
|
|
/* label */ "zyn-reverb", |
|
|
|
/* label */ "zynReverb", |
|
|
|
/* maker */ "falkTX", |
|
|
|
/* copyright */ "GNU GPL v2+", |
|
|
|
PluginDescriptorFILL(FxReverbPlugin) |
|
|
@@ -1116,6 +1464,15 @@ static const PluginDescriptor zynaddsubfxDesc = { |
|
|
|
|
|
|
|
void carla_register_native_plugin_zynaddsubfx() |
|
|
|
{ |
|
|
|
carla_register_native_plugin(&fxAlienWahDesc); |
|
|
|
#if 0 |
|
|
|
carla_register_native_plugin(&fxChorusDesc); |
|
|
|
carla_register_native_plugin(&fxDistortionDesc); |
|
|
|
carla_register_native_plugin(&fxDynamicFilterDesc); |
|
|
|
carla_register_native_plugin(&fxEchoDesc); |
|
|
|
carla_register_native_plugin(&fxEqDesc); |
|
|
|
carla_register_native_plugin(&fxPhaserDesc); |
|
|
|
#endif |
|
|
|
carla_register_native_plugin(&fxReverbDesc); |
|
|
|
carla_register_native_plugin(&zynaddsubfxDesc); |
|
|
|
} |
|
|
|