Skip to content

Commit 811d719

Browse files
committed
Release 1.0.10
* Added DC offset control at the clipping stage. * Updated build scripts and dependencies.
2 parents 8348a46 + 2e15c2d commit 811d719

17 files changed

Lines changed: 1639 additions & 543 deletions

File tree

.github/workflows/build.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,3 +221,17 @@ jobs:
221221
shell: msys2 {0}
222222
run: make VERBOSE=1
223223

224+
macos_stable:
225+
runs-on: macos-latest
226+
steps:
227+
- name: Update repositories
228+
run: brew update
229+
- name: Install dependencies
230+
run: brew install make pkgconf cairo freetype
231+
- uses: actions/checkout@v3
232+
- name: Configure project
233+
run: gmake config STRICT=1 VERBOSE=1 FEATURES='lv2 ui'
234+
- name: Fetch project dependencies
235+
run: gmake fetch
236+
- name: Build project
237+
run: gmake VERBOSE=1

CHANGELOG

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
* RECENT CHANGES
33
*******************************************************************************
44

5+
=== 1.0.10 ===
6+
* Added DC offset control at the clipping stage.
7+
* Updated build scripts and dependencies.
8+
59
=== 1.0.9 ===
610
* Updated build scripts and dependencies.
711

dependencies.mk

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,13 @@ endif
117117
# MacOS dependencies
118118
MACOS_DEPENDENCIES = \
119119
LIBAUDIOTOOLBOX \
120+
LIBCAIRO \
121+
LIBCOCOA \
120122
LIBCOREFOUNDATION \
123+
LIBFONTCONFIG \
124+
LIBFREETYPE \
121125
LIBICONV \
122-
LIBJACK
126+
LIBJACK
123127

124128
MACOS_TEST_DEPENDENCIES =
125129

include/private/meta/mb_clipper.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,10 @@ namespace lsp
5050
static constexpr float CLIP_CURVE_X_MAX = 2.25f;
5151
static constexpr size_t CURVE_MESH_POINTS = 256;
5252
static constexpr size_t REFRESH_RATE = 20;
53-
static constexpr size_t TIME_MESH_POINTS = 320;
53+
static constexpr size_t TIME_MESH_POINTS = 400;
5454
static constexpr float TIME_HISTORY_MAX = 5.0f;
5555
static constexpr float TIME_HISTORY_GAP = 0.5f;
56+
static constexpr float WAVEFORM_HISTORY_MAX = 1.0f;
5657
static constexpr float LUFS_MEASUREMENT_PERIOD = 400.0f;
5758
static constexpr float LUFS_LIMITER_REACT = 48.0f;
5859

@@ -61,6 +62,11 @@ namespace lsp
6162
static constexpr float THRESHOLD_DFL = 0.0f;
6263
static constexpr float THRESHOLD_STEP = 0.01f;
6364

65+
static constexpr float DCOFF_MIN = -100.0f;
66+
static constexpr float DCOFF_MAX = 100.0f;
67+
static constexpr float DCOFF_DFL = 0.0f;
68+
static constexpr float DCOFF_STEP = 0.05f;
69+
6470
static constexpr float REACT_TIME_MIN = 0.000f;
6571
static constexpr float REACT_TIME_MAX = 1.000f;
6672
static constexpr float REACT_TIME_DFL = 0.200f;

include/private/plugins/mb_clipper.h

Lines changed: 42 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* Copyright (C) 2023 Linux Studio Plugins Project <https://lsp-plug.in/>
3-
* (C) 2023 Vladimir Sadovnikov <sadko4u@gmail.com>
2+
* Copyright (C) 2025 Linux Studio Plugins Project <https://lsp-plug.in/>
3+
* (C) 2025 Vladimir Sadovnikov <sadko4u@gmail.com>
44
*
55
* This file is part of lsp-plugins-mb-clipper
66
* Created on: 11 ноя 2023 г.
@@ -62,10 +62,11 @@ namespace lsp
6262
PF_ODP_ENABLED = 1 << 1, // Overdrive protection enabled
6363
PF_LUFS_ENABLED = 1 << 2, // Enable input LUFS limiter
6464
PF_CLIP_ENABLED = 1 << 3, // Clipping enabled
65-
PF_DIRTY_BAND = 1 << 4, // Update band filter curve
66-
PF_SYNC_BAND = 1 << 5, // Sync band filter curve
67-
PF_SYNC_ODP = 1 << 6, // Sync overdrive protection curve
68-
PF_SYNC_CLIP = 1 << 7, // Sync sigmoid clipping curve
65+
PF_DC_COMPENSATE = 1 << 4, // DC compensate
66+
PF_DIRTY_BAND = 1 << 5, // Update band filter curve
67+
PF_SYNC_BAND = 1 << 6, // Sync band filter curve
68+
PF_SYNC_ODP = 1 << 7, // Sync overdrive protection curve
69+
PF_SYNC_CLIP = 1 << 8, // Sync sigmoid clipping curve
6970

7071
PF_SYNC_ALL = PF_SYNC_BAND | PF_SYNC_ODP | PF_SYNC_CLIP
7172
};
@@ -84,8 +85,9 @@ namespace lsp
8485
GF_OUT_CLIP = 1 << 3, // Output clipper enabled
8586
GF_ODP_ENABLED = 1 << 4, // Overdrive protection enabled
8687
GF_CLIP_ENABLED = 1 << 5, // Clipping enabled
87-
GF_SYNC_ODP = 1 << 6, // Sync overdrive protection curve
88-
GF_SYNC_CLIP = 1 << 7, // Sync sigmoid clipping curve
88+
GF_DC_COMPENSATE = 1 << 6, // DC compensate
89+
GF_SYNC_ODP = 1 << 7, // Sync overdrive protection curve
90+
GF_SYNC_CLIP = 1 << 8, // Sync sigmoid clipping curve
8991

9092
GF_SYNC_ALL = GF_SYNC_ODP | GF_SYNC_CLIP
9193
};
@@ -114,13 +116,16 @@ namespace lsp
114116
{
115117
dspu::sigmoid::function_t pFunc; // Sigmoid function
116118
float fThreshold; // Threshold
119+
float fDCOffset; // DC offset
117120
float fPumping; // Pumping
118121
float fScaling; // Sigmoid scaling
119122
float fKnee; // Knee
120123

121124
plug::IPort *pOn; // Enable sigmoid function
122125
plug::IPort *pFunction; // Sigmoid function
123126
plug::IPort *pThreshold; // Sigmoid threshold
127+
plug::IPort *pDCOffset; // DC offset
128+
plug::IPort *pDCCompensate; // DC compensate
124129
plug::IPort *pPumping; // Sigmoid pumping
125130
plug::IPort *pCurveMesh; // Curve chart mesh
126131
} clip_params_t;
@@ -134,6 +139,8 @@ namespace lsp
134139
dspu::Delay sPostDelay; // Signal post-delay
135140
dspu::MeterGraph sInGraph; // Input meter graph
136141
dspu::MeterGraph sOutGraph; // Output meter graph
142+
dspu::MeterGraph sWaveformGraph; // Waveform graph
143+
dspu::MeterGraph sRedGraph; // Gain reduction graph
137144

138145
float *vInData; // Input data buffer
139146
float *vData; // Data buffer
@@ -146,8 +153,8 @@ namespace lsp
146153
float fOdpOut; // Overdrive protection out level
147154
float fOdpRed; // Overdrive protection reduction level
148155

149-
float fClipIn; // Clipping input level measured
150-
float fClipOut; // Clipping output level measured
156+
float fClipIn[2]; // Clipping input level measured
157+
float fClipOut[2]; // Clipping output level measured
151158
float fClipRed; // Clipping reduction level measured
152159

153160
plug::IPort *pIn; // Input level meter
@@ -158,11 +165,9 @@ namespace lsp
158165
plug::IPort *pOdpOut; // ODP output level meter
159166
plug::IPort *pOdpRed; // ODP reduction level meter
160167

161-
plug::IPort *pClipIn; // Clipping input level meter
162-
plug::IPort *pClipOut; // Clipping output level meter
168+
plug::IPort *pClipIn[2]; // Clipping input level meter
169+
plug::IPort *pClipOut[2]; // Clipping output level meter
163170
plug::IPort *pClipRed; // Clipping reduction level meter
164-
165-
plug::IPort *pTimeMesh; // Input, output and gain reduction graph mesh
166171
} band_t;
167172

168173
typedef struct lufs_limiter_t
@@ -221,6 +226,8 @@ namespace lsp
221226
dspu::Dither sDither; // Dither
222227
dspu::MeterGraph sInGraph; // Input meter graph
223228
dspu::MeterGraph sOutGraph; // Output meter graph
229+
dspu::MeterGraph sRedGraph; // Gain reduction graph
230+
dspu::MeterGraph sWaveformGraph; // Waveform graph
224231
band_t vBands[meta::mb_clipper::BANDS_MAX]; // Bands for processing
225232

226233
uint32_t nAnInChannel; // Analyzer input channel
@@ -239,13 +246,14 @@ namespace lsp
239246
float fOdpOut; // Overdrive protection out level
240247
float fOdpRed; // Overdrive protection reduction level
241248

242-
float fClipIn; // Clipping input level measured
243-
float fClipOut; // Clipping output level measured
249+
float fClipIn[2]; // Clipping input level measured
250+
float fClipOut[2]; // Clipping output level measured
244251
float fClipRed; // Clipping reduction level measured
245252

246253
// Buffers
247254
float *vIn; // Input buffer
248255
float *vOut; // Output buffer
256+
float *vInData; // Input data buffer for metering
249257
float *vData; // Data buffer
250258
float *vSc; // Sidechain buffer
251259
float *vTr; // Transfer function
@@ -272,24 +280,30 @@ namespace lsp
272280
plug::IPort *pOdpOut; // ODP output level meter
273281
plug::IPort *pOdpRed; // ODP reduction level meter
274282

275-
plug::IPort *pClipIn; // Clipping input level meter
276-
plug::IPort *pClipOut; // Clipping output level meter
283+
plug::IPort *pClipIn[2]; // Clipping input level meter
284+
plug::IPort *pClipOut[2]; // Clipping output level meter
277285
plug::IPort *pClipRed; // Clipping reduction level meter
286+
} channel_t;
278287

288+
typedef struct graph_t
289+
{
279290
plug::IPort *pTimeMesh; // Input, output and gain reduction graph mesh
280-
} channel_t;
291+
plug::IPort *pWaveformMesh; // Oscillogram mesh
292+
} graph_t;
281293

282294
static dspu::sigmoid::function_t vSigmoidFunctions[];
283295

284296
protected:
285297
size_t nChannels; // Number of channels
286-
channel_t *vChannels; // Delay channels
298+
channel_t *vChannels; // Processing channels
287299

288300
dspu::Analyzer sAnalyzer; // FFT analyzer
289301
dspu::Counter sCounter; // Counter
290302
dspu::LoudnessMeter sOutMeter; // Output LUFS meter
291303
split_t vSplits[meta::mb_clipper::BANDS_MAX-1];
292-
processor_t vProc[meta::mb_clipper::BANDS_MAX]; // Processor
304+
processor_t vProc[meta::mb_clipper::BANDS_MAX]; // Processor
305+
graph_t vBGraph[meta::mb_clipper::BANDS_MAX]; // Band Graphs
306+
graph_t sGraph; // Output graphs
293307
compressor_t sComp; // Simple compressor
294308
odp_params_t sOdp; // Overdrive protection params
295309
clip_params_t sClip; // Clipping parameters
@@ -313,6 +327,7 @@ namespace lsp
313327
float *vLinSigmoid; // Linear scale for sigmoid
314328
float *vLogSigmoid; // Logarithmic scale for sigmoid
315329
float *vTime; // Time graph
330+
float *vWaveformTime; // Waveform time graph
316331
core::IDBuffer *pIDisplay; // Inline display buffer
317332

318333
plug::IPort *pBypass; // Bypass
@@ -369,20 +384,26 @@ namespace lsp
369384
static void dump(dspu::IStateDumper *v, const char *name, const odp_params_t *p);
370385
static void dump(dspu::IStateDumper *v, const char *name, const clip_params_t *p);
371386
static void dump(dspu::IStateDumper *v, const char *name, const lufs_limiter_t *l);
387+
static void dump(dspu::IStateDumper *v, const char *name, const graph_t *g);
372388

373389
protected:
374390
void do_destroy();
375391
void bind_input_buffers();
376392
void limit_input_loudness(size_t samples);
377393
void split_bands(size_t samples);
394+
void process_clip_channel(channel_t *c, size_t samples);
395+
void process_clip_band(band_t *b, processor_t *p, size_t samples);
378396
void process_bands(size_t samples);
379397
void process_output_clipper(size_t samples);
398+
void meter_band(band_t *b, size_t samples);
399+
void meter_channel(channel_t *c, size_t samples);
380400
void perform_analysis(size_t samples);
381401
void output_signal(size_t samples);
382402
void advance_buffers(size_t samples);
383403
void merge_bands(size_t samples);
384404
void output_meters();
385405
void output_mesh_curves(size_t samples);
406+
void output_mesh_graphs(size_t samples);
386407

387408
public:
388409
explicit mb_clipper(const meta::plugin_t *meta);

modules.mk

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,93 +19,93 @@
1919
#
2020

2121
# Variables that describe dependencies
22-
LSP_3RD_PARTY_VERSION := 1.0.22
22+
LSP_3RD_PARTY_VERSION := 1.0.23
2323
LSP_3RD_PARTY_NAME := lsp-3rd-party
2424
LSP_3RD_PARTY_TYPE := hdr
2525
LSP_3RD_PARTY_INC_OPT := -idirafter
2626
LSP_3RD_PARTY_URL_RO := https://github.com/lsp-plugins/$(LSP_3RD_PARTY_NAME).git
2727
LSP_3RD_PARTY_URL_RW := git@github.com:lsp-plugins/$(LSP_3RD_PARTY_NAME).git
2828

29-
LSP_COMMON_LIB_VERSION := 1.0.42
29+
LSP_COMMON_LIB_VERSION := 1.0.43
3030
LSP_COMMON_LIB_NAME := lsp-common-lib
3131
LSP_COMMON_LIB_TYPE := src
3232
LSP_COMMON_LIB_URL_RO := https://github.com/lsp-plugins/$(LSP_COMMON_LIB_NAME).git
3333
LSP_COMMON_LIB_URL_RW := git@github.com:lsp-plugins/$(LSP_COMMON_LIB_NAME).git
3434

35-
LSP_DSP_LIB_VERSION := 1.0.30
35+
LSP_DSP_LIB_VERSION := 1.0.31
3636
LSP_DSP_LIB_NAME := lsp-dsp-lib
3737
LSP_DSP_LIB_TYPE := src
3838
LSP_DSP_LIB_URL_RO := https://github.com/lsp-plugins/$(LSP_DSP_LIB_NAME).git
3939
LSP_DSP_LIB_URL_RW := git@github.com:lsp-plugins/$(LSP_DSP_LIB_NAME).git
4040

41-
LSP_DSP_UNITS_VERSION := 1.0.29
41+
LSP_DSP_UNITS_VERSION := 1.0.30
4242
LSP_DSP_UNITS_NAME := lsp-dsp-units
4343
LSP_DSP_UNITS_TYPE := src
4444
LSP_DSP_UNITS_URL_RO := https://github.com/lsp-plugins/$(LSP_DSP_UNITS_NAME).git
4545
LSP_DSP_UNITS_URL_RW := git@github.com:lsp-plugins/$(LSP_DSP_UNITS_NAME).git
4646

47-
LSP_LLTL_LIB_VERSION := 1.0.25
47+
LSP_LLTL_LIB_VERSION := 1.0.26
4848
LSP_LLTL_LIB_NAME := lsp-lltl-lib
4949
LSP_LLTL_LIB_TYPE := src
5050
LSP_LLTL_LIB_URL_RO := https://github.com/lsp-plugins/$(LSP_LLTL_LIB_NAME).git
5151
LSP_LLTL_LIB_URL_RW := git@github.com:lsp-plugins/$(LSP_LLTL_LIB_NAME).git
5252

53-
LSP_R3D_BASE_LIB_VERSION := 1.0.24
53+
LSP_R3D_BASE_LIB_VERSION := 1.0.25
5454
LSP_R3D_BASE_LIB_NAME := lsp-r3d-base-lib
5555
LSP_R3D_BASE_LIB_TYPE := src
5656
LSP_R3D_BASE_LIB_URL_RO := https://github.com/lsp-plugins/$(LSP_R3D_BASE_LIB_NAME).git
5757
LSP_R3D_BASE_LIB_URL_RW := git@github.com:lsp-plugins/$(LSP_R3D_BASE_LIB_NAME).git
5858

59-
LSP_R3D_IFACE_VERSION := 1.0.24
59+
LSP_R3D_IFACE_VERSION := 1.0.25
6060
LSP_R3D_IFACE_NAME := lsp-r3d-iface
6161
LSP_R3D_IFACE_TYPE := src
6262
LSP_R3D_IFACE_URL_RO := https://github.com/lsp-plugins/$(LSP_R3D_IFACE_NAME).git
6363
LSP_R3D_IFACE_URL_RW := git@github.com:lsp-plugins/$(LSP_R3D_IFACE_NAME).git
6464

65-
LSP_R3D_GLX_LIB_VERSION := 1.0.24
65+
LSP_R3D_GLX_LIB_VERSION := 1.0.25
6666
LSP_R3D_GLX_LIB_NAME := lsp-r3d-glx-lib
6767
LSP_R3D_GLX_LIB_TYPE := bin
6868
LSP_R3D_GLX_LIB_URL_RO := https://github.com/lsp-plugins/$(LSP_R3D_GLX_LIB_NAME).git
6969
LSP_R3D_GLX_LIB_URL_RW := git@github.com:lsp-plugins/$(LSP_R3D_GLX_LIB_NAME).git
7070

71-
LSP_R3D_WGL_LIB_VERSION := 1.0.19
71+
LSP_R3D_WGL_LIB_VERSION := 1.0.20
7272
LSP_R3D_WGL_LIB_NAME := lsp-r3d-wgl-lib
7373
LSP_R3D_WGL_LIB_TYPE := bin
7474
LSP_R3D_WGL_LIB_URL_RO := https://github.com/lsp-plugins/$(LSP_R3D_WGL_LIB_NAME).git
7575
LSP_R3D_WGL_LIB_URL_RW := git@github.com:lsp-plugins/$(LSP_R3D_WGL_LIB_NAME).git
7676

77-
LSP_RUNTIME_LIB_VERSION := 1.0.28
77+
LSP_RUNTIME_LIB_VERSION := 1.0.29
7878
LSP_RUNTIME_LIB_NAME := lsp-runtime-lib
7979
LSP_RUNTIME_LIB_TYPE := src
8080
LSP_RUNTIME_LIB_URL_RO := https://github.com/lsp-plugins/$(LSP_RUNTIME_LIB_NAME).git
8181
LSP_RUNTIME_LIB_URL_RW := git@github.com:lsp-plugins/$(LSP_RUNTIME_LIB_NAME).git
8282

83-
LSP_TEST_FW_VERSION := 1.0.31
83+
LSP_TEST_FW_VERSION := 1.0.32
8484
LSP_TEST_FW_NAME := lsp-test-fw
8585
LSP_TEST_FW_TYPE := src
8686
LSP_TEST_FW_URL_RO := https://github.com/lsp-plugins/$(LSP_TEST_FW_NAME).git
8787
LSP_TEST_FW_URL_RW := git@github.com:lsp-plugins/$(LSP_TEST_FW_NAME).git
8888

89-
LSP_TK_LIB_VERSION := 1.0.28
89+
LSP_TK_LIB_VERSION := 1.0.29
9090
LSP_TK_LIB_NAME := lsp-tk-lib
9191
LSP_TK_LIB_TYPE := src
9292
LSP_TK_LIB_URL_RO := https://github.com/lsp-plugins/$(LSP_TK_LIB_NAME).git
9393
LSP_TK_LIB_URL_RW := git@github.com:lsp-plugins/$(LSP_TK_LIB_NAME).git
9494

95-
LSP_WS_LIB_VERSION := 1.0.28
95+
LSP_WS_LIB_VERSION := 1.0.29
9696
LSP_WS_LIB_NAME := lsp-ws-lib
9797
LSP_WS_LIB_TYPE := src
9898
LSP_WS_LIB_URL_RO := https://github.com/lsp-plugins/$(LSP_WS_LIB_NAME).git
9999
LSP_WS_LIB_URL_RW := git@github.com:lsp-plugins/$(LSP_WS_LIB_NAME).git
100100

101101
# Plugin-related module dependencies
102-
LSP_PLUGIN_FW_VERSION := 1.0.30
102+
LSP_PLUGIN_FW_VERSION := 1.0.31
103103
LSP_PLUGIN_FW_NAME := lsp-plugin-fw
104104
LSP_PLUGIN_FW_TYPE := src
105105
LSP_PLUGIN_FW_URL_RO := https://github.com/lsp-plugins/$(LSP_PLUGIN_FW_NAME).git
106106
LSP_PLUGIN_FW_URL_RW := git@github.com:lsp-plugins/$(LSP_PLUGIN_FW_NAME).git
107107

108-
LSP_PLUGINS_SHARED_VERSION := 1.0.29
108+
LSP_PLUGINS_SHARED_VERSION := 1.0.30
109109
LSP_PLUGINS_SHARED_NAME := lsp-plugins-shared
110110
LSP_PLUGINS_SHARED_TYPE := src
111111
LSP_PLUGINS_SHARED_URL_RO := https://github.com/lsp-plugins/$(LSP_PLUGINS_SHARED_NAME).git
@@ -117,6 +117,11 @@ LIBAUDIOTOOLBOX_NAME := libaudiotoolbox
117117
LIBAUDIOTOOLBOX_TYPE := opt
118118
LIBAUDIOTOOLBOX_LDFLAGS := -framework AudioToolbox
119119

120+
LIBCOCOA_VERSION := system
121+
LIBCOCOA_NAME := libcocoa
122+
LIBCOCOA_TYPE := opt
123+
LIBCOCOA_LDFLAGS := -framework Cocoa
124+
120125
LIBCOREFOUNDATION_VERSION := system
121126
LIBCOREFOUNDATION_NAME := libcorefoundation
122127
LIBCOREFOUNDATION_TYPE := opt

0 commit comments

Comments
 (0)