From ef0bb4de9bbfdfdf90f401409f71cd42831f3004 Mon Sep 17 00:00:00 2001 From: Vladimir Sadovnikov Date: Tue, 5 Mar 2024 20:04:29 +0300 Subject: [PATCH 01/12] Version up --- CHANGELOG | 3 +++ project.mk | 2 +- src/main/meta/impulse_reverb.cpp | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 06d8b27..fe73520 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,9 @@ * RECENT CHANGES ******************************************************************************* +=== 1.0.19 === + + === 1.0.18 === * Updated build scripts and dependencies. diff --git a/project.mk b/project.mk index ed685d1..e81f756 100644 --- a/project.mk +++ b/project.mk @@ -25,7 +25,7 @@ ARTIFACT_TYPE = plug ARTIFACT_DESC = LSP Impulse Reverb Plugin Series ARTIFACT_HEADERS = lsp-plug.in ARTIFACT_EXPORT_HEADERS = 0 -ARTIFACT_VERSION = 1.0.18 +ARTIFACT_VERSION = 1.0.19-devel diff --git a/src/main/meta/impulse_reverb.cpp b/src/main/meta/impulse_reverb.cpp index 50e804a..92caf1f 100644 --- a/src/main/meta/impulse_reverb.cpp +++ b/src/main/meta/impulse_reverb.cpp @@ -27,7 +27,7 @@ #define LSP_PLUGINS_IMPULSE_REVERB_VERSION_MAJOR 1 #define LSP_PLUGINS_IMPULSE_REVERB_VERSION_MINOR 0 -#define LSP_PLUGINS_IMPULSE_REVERB_VERSION_MICRO 18 +#define LSP_PLUGINS_IMPULSE_REVERB_VERSION_MICRO 19 #define LSP_PLUGINS_IMPULSE_REVERB_VERSION \ LSP_MODULE_VERSION( \ From e01f469240823f43257113aa787196f5b1f12e40 Mon Sep 17 00:00:00 2001 From: Vladimir Sadovnikov Date: Sun, 17 Mar 2024 03:06:05 +0300 Subject: [PATCH 02/12] Updated build scripts and dependencies --- CHANGELOG | 2 +- make/tools.mk | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index fe73520..e3dfa36 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,7 +3,7 @@ ******************************************************************************* === 1.0.19 === - +* Updated build scripts and dependencies. === 1.0.18 === * Updated build scripts and dependencies. diff --git a/make/tools.mk b/make/tools.mk index b0486cf..a9f3375 100644 --- a/make/tools.mk +++ b/make/tools.mk @@ -76,6 +76,8 @@ ifeq ($(PLATFORM),Solaris) else ifeq ($(PLATFORM),Windows) FLAG_RELRO = FLAG_STDLIB = + CFLAGS_EXT += -DWINVER=0x600 -D_WIN32_WINNT=0x600 + CXXFLAGS_EXT += -DWINVER=0x600 -D_WIN32_WINNT=0x600 EXE_FLAGS_EXT += -static-libgcc -static-libstdc++ SO_FLAGS_EXT += -static-libgcc -static-libstdc++ LDFLAGS_EXT += -T $(CURDIR)/make/ld-windows.script From 26b53b423ff573465f30cf8ea20d90ad3802f1c1 Mon Sep 17 00:00:00 2001 From: Vladimir Sadovnikov Date: Tue, 9 Apr 2024 21:09:34 +0300 Subject: [PATCH 03/12] New code style --- include/private/plugins/impulse_reverb.h | 11 ++- src/main/plug/impulse_reverb.cpp | 98 +++++++++++------------- 2 files changed, 52 insertions(+), 57 deletions(-) diff --git a/include/private/plugins/impulse_reverb.h b/include/private/plugins/impulse_reverb.h index 67b6e4b..fdb611d 100644 --- a/include/private/plugins/impulse_reverb.h +++ b/include/private/plugins/impulse_reverb.h @@ -1,6 +1,6 @@ /* - * Copyright (C) 2023 Linux Studio Plugins Project - * (C) 2023 Vladimir Sadovnikov + * Copyright (C) 2024 Linux Studio Plugins Project + * (C) 2024 Vladimir Sadovnikov * * This file is part of lsp-plugins-impulse-reverb * Created on: 3 авг. 2021 г. @@ -228,12 +228,17 @@ namespace lsp public: explicit impulse_reverb(const meta::plugin_t *metadata); + impulse_reverb(const impulse_reverb &) = delete; + impulse_reverb(impulse_reverb &&) = delete; virtual ~impulse_reverb() override; - public: + impulse_reverb & operator = (const impulse_reverb &) = delete; + impulse_reverb & operator = (impulse_reverb &&) = delete; + virtual void init(plug::IWrapper *wrapper, plug::IPort **ports) override; virtual void destroy() override; + public: virtual void ui_activated() override; virtual void update_settings() override; virtual void update_sample_rate(long sr) override; diff --git a/src/main/plug/impulse_reverb.cpp b/src/main/plug/impulse_reverb.cpp index 52fbc6c..8cd247d 100644 --- a/src/main/plug/impulse_reverb.cpp +++ b/src/main/plug/impulse_reverb.cpp @@ -1,6 +1,6 @@ /* - * Copyright (C) 2023 Linux Studio Plugins Project - * (C) 2023 Vladimir Sadovnikov + * Copyright (C) 2024 Linux Studio Plugins Project + * (C) 2024 Vladimir Sadovnikov * * This file is part of lsp-plugins-impulse-reverb * Created on: 3 авг. 2021 г. @@ -27,19 +27,14 @@ #include #include #include - -#define TMP_BUF_SIZE 4096 -#define CONV_RANK 10 +#include namespace lsp { namespace plugins { - static plug::IPort *TRACE_PORT(plug::IPort *p) - { - lsp_trace(" port id=%s", (p)->metadata()->id); - return p; - } + static constexpr size_t TMP_BUF_SIZE = 0x1000; + static constexpr size_t CONV_RANK = 10; //--------------------------------------------------------------------- // Plugin factory @@ -355,10 +350,9 @@ namespace lsp size_t thumbs_size = meta::impulse_reverb_metadata::MESH_SIZE * sizeof(float); size_t alloc = tmp_buf_size * (meta::impulse_reverb_metadata::CONVOLVERS + 2) + thumbs_size * meta::impulse_reverb_metadata::TRACKS_MAX * meta::impulse_reverb_metadata::FILES; - pData = new uint8_t[alloc + DEFAULT_ALIGN]; - if (pData == NULL) + uint8_t *ptr = alloc_aligned(pData, alloc, DEFAULT_ALIGN); + if (ptr == NULL) return; - uint8_t *ptr = align_ptr(pData, DEFAULT_ALIGN); // Initialize inputs for (size_t i=0; i<2; ++i) @@ -473,23 +467,23 @@ namespace lsp lsp_trace("Binding audio ports"); for (size_t i=0; ipFile = TRACE_PORT(ports[port_id++]); - f->pHeadCut = TRACE_PORT(ports[port_id++]); - f->pTailCut = TRACE_PORT(ports[port_id++]); - f->pFadeIn = TRACE_PORT(ports[port_id++]); - f->pFadeOut = TRACE_PORT(ports[port_id++]); - f->pListen = TRACE_PORT(ports[port_id++]); - f->pReverse = TRACE_PORT(ports[port_id++]); - f->pStatus = TRACE_PORT(ports[port_id++]); - f->pLength = TRACE_PORT(ports[port_id++]); - f->pThumbs = TRACE_PORT(ports[port_id++]); + BIND_PORT(f->pFile); + BIND_PORT(f->pHeadCut); + BIND_PORT(f->pTailCut); + BIND_PORT(f->pFadeIn); + BIND_PORT(f->pFadeOut); + BIND_PORT(f->pListen); + BIND_PORT(f->pReverse); + BIND_PORT(f->pStatus); + BIND_PORT(f->pLength); + BIND_PORT(f->pThumbs); } // Bind convolver ports @@ -516,15 +510,15 @@ namespace lsp convolver_t *c = &vConvolvers[i]; if (nInputs > 1) // Input panning - c->pPanIn = TRACE_PORT(ports[port_id++]); - - c->pFile = TRACE_PORT(ports[port_id++]); - c->pTrack = TRACE_PORT(ports[port_id++]); - c->pMakeup = TRACE_PORT(ports[port_id++]); - c->pMute = TRACE_PORT(ports[port_id++]); - c->pActivity = TRACE_PORT(ports[port_id++]); - c->pPredelay = TRACE_PORT(ports[port_id++]); - c->pPanOut = TRACE_PORT(ports[port_id++]); + BIND_PORT(c->pPanIn); + + BIND_PORT(c->pFile); + BIND_PORT(c->pTrack); + BIND_PORT(c->pMakeup); + BIND_PORT(c->pMute); + BIND_PORT(c->pActivity); + BIND_PORT(c->pPredelay); + BIND_PORT(c->pPanOut); } // Bind wet processing ports @@ -534,16 +528,16 @@ namespace lsp { channel_t *c = &vChannels[i]; - c->pWetEq = TRACE_PORT(ports[port_id++]); - TRACE_PORT(ports[port_id++]); // Skip equalizer visibility port - c->pLowCut = TRACE_PORT(ports[port_id++]); - c->pLowFreq = TRACE_PORT(ports[port_id++]); + BIND_PORT(c->pWetEq); + SKIP_PORT("Equalizer visibility"); // Skip equalizer visibility port + BIND_PORT(c->pLowCut); + BIND_PORT(c->pLowFreq); for (size_t j=0; jpFreqGain[j] = TRACE_PORT(ports[port_id++]); + BIND_PORT(c->pFreqGain[j]); - c->pHighCut = TRACE_PORT(ports[port_id++]); - c->pHighFreq = TRACE_PORT(ports[port_id++]); + BIND_PORT(c->pHighCut); + BIND_PORT(c->pHighFreq); port_id = port; } @@ -570,11 +564,7 @@ namespace lsp destroy_channel(&vChannels[i]); // Delete all allocated data - if (pData != NULL) - { - delete [] pData; - pData = NULL; - } + free_aligned(pData); } void impulse_reverb::ui_activated() From d28f8ecf5c58e786948061d999b0b524ce903b48 Mon Sep 17 00:00:00 2001 From: Vladimir Sadovnikov Date: Tue, 9 Apr 2024 21:19:13 +0300 Subject: [PATCH 04/12] Added Dry/Wet balance knob --- include/private/plugins/impulse_reverb.h | 1 + .../ui/convolution/impulse_reverb/mono.xml | 27 ++++++++++--------- .../ui/convolution/impulse_reverb/stereo.xml | 26 +++++++++--------- src/doc/manuals/plugins/impulse_reverb.php | 1 + src/main/meta/impulse_reverb.cpp | 1 + src/main/plug/impulse_reverb.cpp | 16 +++++++---- 6 files changed, 42 insertions(+), 30 deletions(-) diff --git a/include/private/plugins/impulse_reverb.h b/include/private/plugins/impulse_reverb.h index fdb611d..bc895ea 100644 --- a/include/private/plugins/impulse_reverb.h +++ b/include/private/plugins/impulse_reverb.h @@ -217,6 +217,7 @@ namespace lsp plug::IPort *pRank; plug::IPort *pDry; plug::IPort *pWet; + plug::IPort *pDryWet; plug::IPort *pOutGain; plug::IPort *pPredelay; diff --git a/res/main/ui/convolution/impulse_reverb/mono.xml b/res/main/ui/convolution/impulse_reverb/mono.xml index eb84882..27d2128 100644 --- a/res/main/ui/convolution/impulse_reverb/mono.xml +++ b/res/main/ui/convolution/impulse_reverb/mono.xml @@ -18,7 +18,7 @@ - + @@ -41,21 +41,22 @@ - - - + + + + diff --git a/res/main/ui/convolution/impulse_reverb/stereo.xml b/res/main/ui/convolution/impulse_reverb/stereo.xml index 85b4b04..beda3b7 100644 --- a/res/main/ui/convolution/impulse_reverb/stereo.xml +++ b/res/main/ui/convolution/impulse_reverb/stereo.xml @@ -32,7 +32,7 @@ - + @@ -48,20 +48,22 @@ - - + + diff --git a/src/doc/manuals/plugins/impulse_reverb.php b/src/doc/manuals/plugins/impulse_reverb.php index c3ec6a2..cfbea18 100644 --- a/src/doc/manuals/plugins/impulse_reverb.php +++ b/src/doc/manuals/plugins/impulse_reverb.php @@ -82,6 +82,7 @@
  • Pre-delay - amount of pre-delay added to the wet (processed) signal.
  • Dry - amount of gain applied to the dry (unprocessed) signal.
  • Wet - amount of gain additionally applied to the wet (processed) signal.
  • +
  • Dry/Wet - the balance between the unprocessed (Dry) signal and mixed signal (see Dry and Wet controls).
  • Output - amount of gain additionally applied to the output signal.
  • diff --git a/src/main/meta/impulse_reverb.cpp b/src/main/meta/impulse_reverb.cpp index 92caf1f..65c13e5 100644 --- a/src/main/meta/impulse_reverb.cpp +++ b/src/main/meta/impulse_reverb.cpp @@ -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) \ diff --git a/src/main/plug/impulse_reverb.cpp b/src/main/plug/impulse_reverb.cpp index 8cd247d..8380953 100644 --- a/src/main/plug/impulse_reverb.cpp +++ b/src/main/plug/impulse_reverb.cpp @@ -237,6 +237,7 @@ namespace lsp pRank = NULL; pDry = NULL; pWet = NULL; + pDryWet = NULL; pOutGain = NULL; pPredelay = NULL; @@ -483,6 +484,7 @@ namespace lsp BIND_PORT(pDry); BIND_PORT(pWet); + BIND_PORT(pDryWet); BIND_PORT(pOutGain); // Bind impulse file ports @@ -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()); @@ -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); From bbeba081b5f9ab77025ea77e8a8b85476c480c1d Mon Sep 17 00:00:00 2001 From: Vladimir Sadovnikov Date: Tue, 9 Apr 2024 21:46:42 +0300 Subject: [PATCH 05/12] Fixed code --- src/main/plug/impulse_reverb.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/plug/impulse_reverb.cpp b/src/main/plug/impulse_reverb.cpp index 8380953..4ae2df3 100644 --- a/src/main/plug/impulse_reverb.cpp +++ b/src/main/plug/impulse_reverb.cpp @@ -582,7 +582,7 @@ namespace lsp 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 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(); From 9c087ba836cdb31373cf630e89ae787fa5fa31be Mon Sep 17 00:00:00 2001 From: Vladimir Sadovnikov Date: Tue, 9 Apr 2024 21:56:41 +0300 Subject: [PATCH 06/12] Updated CHANGELOG * Implemented Dry/Wet balance knob. --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index e3dfa36..684faf4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,6 +3,7 @@ ******************************************************************************* === 1.0.19 === +* Implemented Dry/Wet balance knob. * Updated build scripts and dependencies. === 1.0.18 === From 82773c7f961fed550ac47181b2d22df1817ddd6b Mon Sep 17 00:00:00 2001 From: Vladimir Sadovnikov Date: Wed, 10 Apr 2024 23:23:29 +0300 Subject: [PATCH 07/12] Fixed Dry/Wet --- src/main/plug/impulse_reverb.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/plug/impulse_reverb.cpp b/src/main/plug/impulse_reverb.cpp index 4ae2df3..d6c4fb4 100644 --- a/src/main/plug/impulse_reverb.cpp +++ b/src/main/plug/impulse_reverb.cpp @@ -579,11 +579,11 @@ namespace lsp void impulse_reverb::update_settings() { const float out_gain = pOutGain->value(); - const float dry = pDry->value() * out_gain; - const float wet = pWet->value() * out_gain; + const float dry = pDry->value(); + const float wet = pWet->value(); const float drywet = pDryWet->value() * 0.01f; - const float dry_gain = dry * drywet + 1.0f - drywet; - const float wet_gain = wet * drywet; + const float dry_gain = (dry * drywet + 1.0f - drywet) * out_gain; + const float wet_gain = wet * drywet * out_gain; const bool bypass = pBypass->value() >= 0.5f; const float predelay = pPredelay->value(); From cb7496482f2029730075141411ad39d014df1d59 Mon Sep 17 00:00:00 2001 From: bor-T Date: Mon, 15 Apr 2024 22:15:41 +0300 Subject: [PATCH 08/12] UI update. --- .../ui/convolution/impulse_reverb/mono.xml | 50 +++++++----- .../ui/convolution/impulse_reverb/stereo.xml | 81 ++++++++++--------- 2 files changed, 73 insertions(+), 58 deletions(-) diff --git a/res/main/ui/convolution/impulse_reverb/mono.xml b/res/main/ui/convolution/impulse_reverb/mono.xml index 27d2128..6d4a434 100644 --- a/res/main/ui/convolution/impulse_reverb/mono.xml +++ b/res/main/ui/convolution/impulse_reverb/mono.xml @@ -19,43 +19,51 @@ - - - + - @@ -78,7 +86,7 @@ length=":ifl${i}" status=":ifs${i}" width.min="600" - height.min="128" + height.min="245" load.preview="true" clipboard.head_cut="ihc${i}" clipboard.tail_cut="itc${i}" diff --git a/res/main/ui/convolution/impulse_reverb/stereo.xml b/res/main/ui/convolution/impulse_reverb/stereo.xml index beda3b7..c6d3e0b 100644 --- a/res/main/ui/convolution/impulse_reverb/stereo.xml +++ b/res/main/ui/convolution/impulse_reverb/stereo.xml @@ -18,51 +18,58 @@ - - - + + + - - - - - - + + - - - - - - + + + + + + - @@ -87,7 +94,7 @@ length=":ifl${i}" status=":ifs${i}" width.min="600" - height.min="128" + height.min="172" load.preview="true" clipboard.head_cut="ihc${i}" clipboard.tail_cut="itc${i}" @@ -218,7 +225,7 @@ - +