Skip to content

Commit

Permalink
Added Dry/Wet balance knob
Browse files Browse the repository at this point in the history
  • Loading branch information
sadko4u committed Apr 9, 2024
1 parent 26b53b4 commit d28f8ec
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 30 deletions.
1 change: 1 addition & 0 deletions include/private/plugins/impulse_reverb.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ namespace lsp
plug::IPort *pRank;
plug::IPort *pDry;
plug::IPort *pWet;
plug::IPort *pDryWet;
plug::IPort *pOutGain;
plug::IPort *pPredelay;

Expand Down
27 changes: 14 additions & 13 deletions res/main/ui/convolution/impulse_reverb/mono.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<cell rows="3">
<group text="groups.output" ipadding="0">
<grid rows="15" cols="1" expand="true" fill="true">
<vbox expand="true" fill="true">
<ui:with pad.h="6" pad.v="4" vreduce="true">
<label text="labels.signal.dry_pan"/>
</ui:with>
Expand All @@ -41,21 +41,22 @@

<hsep bg.color="bg" pad.v="2" vreduce="true"/>

<vbox height.min="105">
<label text="labels.signal.wet" pad.h="6" pad.v="4" vreduce="true"/>
<knob id="wet" scolor="wet"/>
<value id="wet" sline="true" pad.b="4"/>
</vbox>

<label text="labels.signal.wet" pad.h="6" pad.v="4" vreduce="true"/>
<knob id="wet" scolor="wet"/>
<value id="wet" sline="true" pad.b="4"/>

<hsep bg.color="bg" pad.v="2" vreduce="true"/>

<vbox height.min="105">
<label text="labels.output" pad.h="6" pad.v="4" vreduce="true"/>
<knob id="g_out"/>
<value id="g_out" sline="true"/>
</vbox>
<label text="labels.signal.drywet" pad.h="6" pad.v="4" vreduce="true"/>
<knob id="drywet" scolor="drywet"/>
<value id="drywet" sline="true" pad.b="4"/>

</grid>
<hsep bg.color="bg" pad.v="2" vreduce="true"/>

<label text="labels.output" pad.h="6" pad.v="4" vreduce="true"/>
<knob id="g_out"/>
<value id="g_out" sline="true"/>
</vbox>
</group>
</cell>

Expand Down
26 changes: 14 additions & 12 deletions res/main/ui/convolution/impulse_reverb/stereo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</ui:with>

<cell cols="2">
<grid rows="12" cols="1" expand="true" fill="true">
<vbox expand="true" fill="true">

<hsep bg.color="bg" pad.v="2" vreduce="true"/>

Expand All @@ -48,20 +48,22 @@

<hsep bg.color="bg" pad.v="2" vreduce="true"/>

<vbox height.min="105">
<label text="labels.signal.wet" pad.h="6" pad.v="4" vreduce="true"/>
<knob id="wet" scolor="wet"/>
<value id="wet" sline="true" pad.b="4"/>
</vbox>
<label text="labels.signal.wet" pad.h="6" pad.v="4" vreduce="true"/>
<knob id="wet" scolor="wet"/>
<value id="wet" sline="true" pad.b="4"/>

<hsep bg.color="bg" pad.v="2" vreduce="true"/>

<label text="labels.signal.drywet" pad.h="6" pad.v="4" vreduce="true"/>
<knob id="drywet" scolor="drywet"/>
<value id="drywet" sline="true" pad.b="4"/>

<hsep bg.color="bg" pad.v="2" vreduce="true"/>

<vbox height.min="105">
<label text="labels.output" pad.h="6" pad.v="4" vreduce="true"/>
<knob id="g_out"/>
<value id="g_out" sline="true"/>
</vbox>
</grid>
<label text="labels.output" pad.h="6" pad.v="4" vreduce="true"/>
<knob id="g_out"/>
<value id="g_out" sline="true"/>
</vbox>
</cell>
</grid>
</group>
Expand Down
1 change: 1 addition & 0 deletions src/doc/manuals/plugins/impulse_reverb.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
<li><b>Pre-delay</b> - amount of pre-delay added to the wet (processed) signal.</li>
<li><b>Dry</b> - amount of gain applied to the dry (unprocessed) signal.</li>
<li><b>Wet</b> - amount of gain additionally applied to the wet (processed) signal.</li>
<li><b>Dry/Wet</b> - the balance between the unprocessed (Dry) signal and mixed signal (see Dry and Wet controls).</li>
<li><b>Output</b> - amount of gain additionally applied to the output signal.</li>
</ul>

Expand Down
1 change: 1 addition & 0 deletions src/main/meta/impulse_reverb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ namespace lsp
pan, \
DRY_GAIN(1.0f), \
WET_GAIN(1.0f), \
DRYWET(100.0f), \
OUT_GAIN

#define IR_SAMPLE_FILE(id, label) \
Expand Down
16 changes: 11 additions & 5 deletions src/main/plug/impulse_reverb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ namespace lsp
pRank = NULL;
pDry = NULL;
pWet = NULL;
pDryWet = NULL;
pOutGain = NULL;
pPredelay = NULL;

Expand Down Expand Up @@ -483,6 +484,7 @@ namespace lsp

BIND_PORT(pDry);
BIND_PORT(pWet);
BIND_PORT(pDryWet);
BIND_PORT(pOutGain);

// Bind impulse file ports
Expand Down Expand Up @@ -576,11 +578,14 @@ namespace lsp

void impulse_reverb::update_settings()
{
float out_gain = pOutGain->value();
float dry_gain = pDry->value() * out_gain;
float wet_gain = pWet->value() * out_gain;
bool bypass = pBypass->value() >= 0.5f;
float predelay = pPredelay->value();
const float out_gain = pOutGain->value();
const float dry = pDry->value() * out_gain;
const float wet = pWet->value() * out_gain;
const float drywet = pDryWet->value() * 0.01f;
const float dry_gain = dry * drywet + 1.0f - drywet;;
const float wet_gain = wet * drywet;
const bool bypass = pBypass->value() >= 0.5f;
const float predelay = pPredelay->value();

// Check that FFT rank has changed
size_t rank = get_fft_rank(pRank->value());
Expand Down Expand Up @@ -1330,6 +1335,7 @@ namespace lsp
v->write("pRank", pRank);
v->write("pDry", pDry);
v->write("pWet", pWet);
v->write("pDryWet", pDryWet);
v->write("pOutGain", pOutGain);
v->write("pPredelay", pPredelay);

Expand Down

0 comments on commit d28f8ec

Please sign in to comment.