Skip to content

Commit

Permalink
Release 0.5.3
Browse files Browse the repository at this point in the history
* Added 'mastering' option to perform reverse-processing (applying frequency
  characteristics of master file to child files).
* Added 'normalize' and 'norm_gain' parameters for peak gain normalization.
  • Loading branch information
sadko4u committed Apr 22, 2021
2 parents b1240a3 + b178402 commit 5c31323
Show file tree
Hide file tree
Showing 20 changed files with 400 additions and 56 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
* RECENT CHANGES
*******************************************************************************

=== 0.5.3 ===
* Added 'mastering' option to perform reverse-processing (applying frequency
characteristics of master file to child files).
* Added 'normalize' and 'norm_gain' parameters for peak gain normalization.

=== 0.5.2 ===
* Added 'dry' and 'wet' parameters for setting up balance between processed
and unprocessed signal in output files.
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ clean:
fetch:
@$(CHK_CONFIG)
@echo "Fetching desired source code dependencies"
@$(MAKE) -s -f "$(BASEDIR)/make/modules.mk" $(@) BASEDIR="$(BASEDIR)" CONFIG="$(CONFIG)" MODULES="$(MODULES)"
@$(MAKE) -s -f "$(BASEDIR)/make/modules.mk" $(@) BASEDIR="$(BASEDIR)" CONFIG="$(CONFIG)"
@echo "Fetch OK"

tree:
Expand Down Expand Up @@ -89,7 +89,7 @@ config:
distsrc:
@echo "Building source code archive"
@mkdir -p "$(DISTSRC)/modules"
@$(MAKE) -s -f "$(BASEDIR)/make/modules.mk" tree BASEDIR="$(BASEDIR)" MODDIR="$(DISTSRC)/modules" TREE="1"
@$(MAKE) -s -f "$(BASEDIR)/make/modules.mk" tree BASEDIR="$(BASEDIR)" MODULES="$(DISTSRC)/modules" TREE="1"
@cp -R $(BASEDIR)/include $(BASEDIR)/make $(BASEDIR)/src "$(DISTSRC)/"
@cp $(BASEDIR)/CHANGELOG $(BASEDIR)/COPYING* $(BASEDIR)/Makefile $(BASEDIR)/*.mk "$(DISTSRC)/"
@find "$(DISTSRC)" -iname '.git' | xargs -exec rm -rf {}
Expand Down
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ which allow to tune tonal characteristics of the master file to match
the tonal characteristics of each corresponding child file. These raw IR files
allow to process audio data as linear-phase finite impulse response filters (FIRs).

There is additional 'mastering' mode provided that allows to swap roles between master and
child files so the timbral correction becomes applied to child files respective to the
computed spectral difference of master to the child.

Since linear-phased filters are symmetric across the center of the impulse response,
the processed audio data will introduce latency of the half of the impulse response duration.
To reduce the latency effect, additional option is available to cut (or strip) the raw
Expand All @@ -35,6 +39,9 @@ The example of batch file is the following:
"produce": [ "ir", "audio" ],
"dry" : -12,
"wet" : 0,
"mastering" : false,
"normalize": "above",
"norm_gain": -6,

"ir": {
"head_cut": 45,
Expand Down Expand Up @@ -83,6 +90,13 @@ Here's the full description of all possible parameters which can be omitted in t
* **fade_out** - the amount of linear fade-in (in percent) to add at the end of the IR file;
* **file** - the name of the stripped impulse response file, by default "${master_name}/${file_name} - IR.wav";
* **raw** - the name of the raw impulse response file, by default "${master_name}/${file_name} - Raw IR.wav";
* **masetering** - enables the tool working in reverse mode (applying timbral correction from master to child files);
* **norm_gain** - the peak normalization gain (in decibels) at output;
* **normalize** - the output file normaliztion:
* **none** - do not use normalization (default);
* **above** - normalize the file if the maximum signal peak is above the **norm_gain** level;
* **below** - normalize the file if the maximum signal peak is below the **norm_gain** level;
* **always** - always normalize output files to match the maximum signal peak to **norm_gain** level;
* **produce** - the array of strings that indicates the list of files to produce, ```[ "all" ]``` by default:
* **all** - produce all types of files: IR, raw IR, processed audio;
* **audio** - produce processed audio file;
Expand Down Expand Up @@ -113,17 +127,21 @@ The tool allows to override some batch parameters by specifying them as command-
-dg, --dry The amount (in dB) of unprocessed signal in output file
-f, --file Format of the output file name
-fr, --fft-rank The FFT rank (resolution) used for profiling
-h, --help Output help message
-h, --help Output this help message
-ir, --ir-file Format of the processed impulse response file name
-iw, --ir-raw Format of the raw impulse response file name
-ifi, --ir-fade-in The amount (in %) of fade-in for the IR file
-ifo, --ir-fade-out The amount (in %) of fade-out for the IR file
-ihc, --ir-head-cut The amount (in %) of head cut for the IR file
-itc, --ir-tail-cut The amount (in %) of tail cut for the IR file
-m, --mastering Work as auto-mastering tool instead of timbral correction
-n, --normalize Set normalization mode
-ng, --norm-gain Set normalization peak gain (in dB)
-p, --produce Comma-separated list of produced output files (ir,raw,audio,all)
-s, --src-path Source path to take files from
-sr, --srate Sample rate of output files
-wg, --wet The amount (in dB) of processed signal in output file
```

Requirements
Expand Down
8 changes: 4 additions & 4 deletions dependencies.mk
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,22 @@
#

# Variables that describe dependencies
LSP_COMMON_LIB_VERSION := 1.0.12
LSP_COMMON_LIB_VERSION := 1.0.13
LSP_COMMON_LIB_NAME := lsp-common-lib
LSP_COMMON_LIB_TYPE := src
LSP_COMMON_LIB_URL := https://github.com/sadko4u/$(LSP_COMMON_LIB_NAME).git

LSP_DSP_LIB_VERSION := 0.5.12
LSP_DSP_LIB_VERSION := 0.5.13
LSP_DSP_LIB_NAME := lsp-dsp-lib
LSP_DSP_LIB_TYPE := src
LSP_DSP_LIB_URL := https://github.com/sadko4u/$(LSP_DSP_LIB_NAME).git

LSP_DSP_UNITS_VERSION := 0.5.1
LSP_DSP_UNITS_VERSION := 0.5.2
LSP_DSP_UNITS_NAME := lsp-dsp-units
LSP_DSP_UNITS_TYPE := src
LSP_DSP_UNITS_URL := https://github.com/sadko4u/$(LSP_DSP_UNITS_NAME).git

LSP_RUNTIME_LIB_VERSION := 0.5.7
LSP_RUNTIME_LIB_VERSION := 0.5.9
LSP_RUNTIME_LIB_NAME := lsp-runtime-lib
LSP_RUNTIME_LIB_TYPE := src
LSP_RUNTIME_LIB_URL := https://github.com/sadko4u/$(LSP_RUNTIME_LIB_NAME).git
Expand Down
10 changes: 10 additions & 0 deletions include/private/audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <lsp-plug.in/dsp-units/sampling/Sample.h>
#include <lsp-plug.in/expr/Resolver.h>

#include <private/config/data.h>
#include <private/config/config.h>

namespace timbremill
Expand Down Expand Up @@ -109,6 +110,15 @@ namespace timbremill
* @return status of operation
*/
status_t convolve(dspu::Sample *dst, const dspu::Sample *src, const dspu::Sample *ir, ssize_t latency, float dry, float wet);

/**
* Normalize sample to the specified gain
* @param dst sample to normalize
* @param gain the maximum peak gain
* @param mode the normalization mode
* @return status of operation
*/
status_t normalize(dspu::Sample *dst, float gain, size_t mode);
}


Expand Down
13 changes: 13 additions & 0 deletions include/private/config/data.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ namespace timbremill
OUT_ALL = OUT_IR | OUT_RAW | OUT_AUDIO
};

enum normalize_t
{
NORM_NONE, // No normalization
NORM_ABOVE, // When the maximum peak is above the threshold
NORM_BELOW, // When the maximum peak is below the threshold
NORM_ALWAYS // Always normalize
};

typedef struct cfg_flag_t
{
const char *name;
Expand Down Expand Up @@ -105,6 +113,10 @@ namespace timbremill
float fGainRange; // Gain range (in decibels)
float fDry; // Amount of dry signal
float fWet; // Amount of wet signal
bool bMastering; // 'Mastering' feature
ssize_t nNormalize; // Normalization method
float fNormGain; // Normalization gain

irfile_t sIR; // IR file data
lltl::pphash<LSPString, fgroup_t> vGroups; // List of file groups

Expand All @@ -121,6 +133,7 @@ namespace timbremill
* Flags for 'produce' option of the configuration
*/
extern const cfg_flag_t produce_flags[];
extern const cfg_flag_t normalize_flags[];

/**
* Find flag by given name
Expand Down
29 changes: 0 additions & 29 deletions include/private/config/parse.h

This file was deleted.

2 changes: 1 addition & 1 deletion project.mk
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
ARTIFACT_ID = TIMBRE_MILL
ARTIFACT_NAME = timbre-mill
ARTIFACT_DESC = Timbre Mill - a tool for IR timbre correction
ARTIFACT_VERSION = 0.5.2
ARTIFACT_VERSION = 0.5.3

#------------------------------------------------------------------------------
# Plugin dependencies
Expand Down
3 changes: 3 additions & 0 deletions res/test/config/test.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"fft_rank": 16,
"dry": -18,
"wet": -6,
"mastering": true,
"normalize": "above",
"norm_gain": -10,

"produce": [ "raw", "audio" ],

Expand Down
2 changes: 2 additions & 0 deletions res/test/radio/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.wav

41 changes: 41 additions & 0 deletions res/test/radio/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"srate": 44100,
"dst_path": "tmp",
"src_path": "res/test/radio",
"file": "mastered/${file_name} - processed.wav",
"produce": [ "audio" ],
"fft_rank": 14,
"dry" : -1000,
"wet" : 0,
"mastering": true,
"normalize": "always",
"norm_gain": -6,

"ir": {
"head_cut": 45,
"tail_cut": 5,
"fade_in": 2,
"fade_out": 50,
"file": "ir/${file_name} - IR.wav",
"raw": "ir/${file_name} - Raw IR.wav"
},

"groups": {
"advertisement": {
"master": "Джуманджи.wav",
"files": [
"Aster1.wav",
"Aster2.wav",
"rio-1.wav",
"ДА_Дача_Бульмени Горячая Штучка_Чехов_аудио_mixdown.wav",
"ДА_Дача_Сосиски Папа Может_Чехов_аудио_mixdown.wav",
"ДА_Масло сливочное Аисфер_Чехов_аудио_mixdown.wav",
"ДА_Напиток ПЕПСИ_Чехов_аудио_mixdown.wav",
"ДА_Сок J7_Чехов_аудио_mixdown.wav",
"ДА_Сырок творожный Светлогорье_Чехов_аудио_mixdown.wav",
"ДоброценТобольск.wav",
"Джуманджи.wav"
]
}
}
}
2 changes: 1 addition & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ ifeq ($($(ARTIFACT_ID)_TESTING),1)
ARTIFACT_TARGETS += $(ARTIFACT_TEST_BIN)
endif

DEP_CXX = $(foreach src,$(CXX_SRC_MAIN) $(CXX_SRC_EXT) $(CXX_SRC_TEST),$(patsubst %.cpp,$(ARTIFACT_BIN)/%.d,$(src)))
DEP_CXX = $(foreach src,$(CXX_SRC_MAIN) $(CXX_SRC_EXT) $(CXX_SRC_TEST) $(CXX_SRC_NOTEST),$(patsubst %.cpp,$(ARTIFACT_BIN)/%.d,$(src)))
DEP_CXX_FILE = $(patsubst $(ARTIFACT_BIN)/%.d,%.cpp,$(@))
DEP_DEP_FILE = $(patsubst $(ARTIFACT_BIN)/%.d,%.o,$(@))

Expand Down
88 changes: 77 additions & 11 deletions src/Makefile.d
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,13 @@ $(TIMBRE_MILL_BIN)/main/audio.o: main/audio.cpp \
$(LSP_RUNTIME_LIB_INC)/lsp-plug.in/mm/IInAudioStream.h \
$(LSP_RUNTIME_LIB_INC)/lsp-plug.in/expr/Resolver.h \
$(LSP_RUNTIME_LIB_INC)/lsp-plug.in/expr/types.h \
$(TIMBRE_MILL_INC)/private/config/data.h \
$(LSP_LLTL_LIB_INC)/lsp-plug.in/lltl/parray.h \
$(LSP_LLTL_LIB_INC)/lsp-plug.in/lltl/pphash.h \
$(TIMBRE_MILL_INC)/private/config/config.h \
$(LSP_COMMON_LIB_INC)/lsp-plug.in/stdlib/stdio.h \
$(LSP_RUNTIME_LIB_INC)/lsp-plug.in/io/IInSequence.h \
$(LSP_RUNTIME_LIB_INC)/lsp-plug.in/io/IInStream.h \
$(TIMBRE_MILL_INC)/private/config/data.h \
$(LSP_LLTL_LIB_INC)/lsp-plug.in/lltl/parray.h \
$(LSP_LLTL_LIB_INC)/lsp-plug.in/lltl/pphash.h \
$(LSP_COMMON_LIB_INC)/lsp-plug.in/common/alloc.h \
$(LSP_DSP_LIB_INC)/lsp-plug.in/dsp/dsp.h \
$(LSP_DSP_LIB_INC)/lsp-plug.in/dsp/version.h \
Expand Down Expand Up @@ -335,12 +335,12 @@ $(TIMBRE_MILL_BIN)/test/mtest/profile.o: test/mtest/profile.cpp \
$(LSP_RUNTIME_LIB_INC)/lsp-plug.in/mm/IInAudioStream.h \
$(LSP_RUNTIME_LIB_INC)/lsp-plug.in/expr/Resolver.h \
$(LSP_RUNTIME_LIB_INC)/lsp-plug.in/expr/types.h \
$(TIMBRE_MILL_INC)/private/config/config.h \
$(LSP_RUNTIME_LIB_INC)/lsp-plug.in/io/IInSequence.h \
$(LSP_RUNTIME_LIB_INC)/lsp-plug.in/io/IInStream.h \
$(TIMBRE_MILL_INC)/private/config/data.h \
$(LSP_LLTL_LIB_INC)/lsp-plug.in/lltl/parray.h \
$(LSP_LLTL_LIB_INC)/lsp-plug.in/lltl/pphash.h
$(LSP_LLTL_LIB_INC)/lsp-plug.in/lltl/pphash.h \
$(TIMBRE_MILL_INC)/private/config/config.h \
$(LSP_RUNTIME_LIB_INC)/lsp-plug.in/io/IInSequence.h \
$(LSP_RUNTIME_LIB_INC)/lsp-plug.in/io/IInStream.h
$(TIMBRE_MILL_BIN)/test/mtest/main.o: test/mtest/main.cpp \
$(LSP_LLTL_LIB_INC)/lsp-plug.in/lltl/parray.h \
$(LSP_LLTL_LIB_INC)/lsp-plug.in/lltl/version.h \
Expand Down Expand Up @@ -414,12 +414,12 @@ $(TIMBRE_MILL_BIN)/test/mtest/ir.o: test/mtest/ir.cpp \
$(LSP_RUNTIME_LIB_INC)/lsp-plug.in/mm/IInAudioStream.h \
$(LSP_RUNTIME_LIB_INC)/lsp-plug.in/expr/Resolver.h \
$(LSP_RUNTIME_LIB_INC)/lsp-plug.in/expr/types.h \
$(TIMBRE_MILL_INC)/private/config/config.h \
$(LSP_RUNTIME_LIB_INC)/lsp-plug.in/io/IInSequence.h \
$(LSP_RUNTIME_LIB_INC)/lsp-plug.in/io/IInStream.h \
$(TIMBRE_MILL_INC)/private/config/data.h \
$(LSP_LLTL_LIB_INC)/lsp-plug.in/lltl/parray.h \
$(LSP_LLTL_LIB_INC)/lsp-plug.in/lltl/pphash.h
$(LSP_LLTL_LIB_INC)/lsp-plug.in/lltl/pphash.h \
$(TIMBRE_MILL_INC)/private/config/config.h \
$(LSP_RUNTIME_LIB_INC)/lsp-plug.in/io/IInSequence.h \
$(LSP_RUNTIME_LIB_INC)/lsp-plug.in/io/IInStream.h
$(TIMBRE_MILL_BIN)/test/main.o: test/main.cpp
$(TIMBRE_MILL_BIN)/test/init/dsp.o: test/init/dsp.cpp \
$(LSP_COMMON_LIB_INC)/lsp-plug.in/common/types.h \
Expand Down Expand Up @@ -468,3 +468,69 @@ $(TIMBRE_MILL_BIN)/test/init/dsp.o: test/init/dsp.cpp \
$(LSP_DSP_LIB_INC)/lsp-plug.in/dsp/common/smath.h \
$(LSP_DSP_LIB_INC)/lsp-plug.in/dsp/common/interpolation.h \
$(LSP_DSP_LIB_INC)/lsp-plug.in/dsp/common/interpolation/linear.h
$(TIMBRE_MILL_BIN)/main/main.o: main/main.cpp \
$(LSP_DSP_LIB_INC)/lsp-plug.in/dsp/dsp.h \
$(LSP_DSP_LIB_INC)/lsp-plug.in/dsp/version.h \
$(LSP_DSP_LIB_INC)/lsp-plug.in/dsp/common/types.h \
$(LSP_DSP_LIB_INC)/lsp-plug.in/dsp/common/3dmath.h \
$(LSP_DSP_LIB_INC)/lsp-plug.in/dsp/common/3dmath/types.h \
$(LSP_DSP_LIB_INC)/lsp-plug.in/dsp/common/coding.h \
$(LSP_DSP_LIB_INC)/lsp-plug.in/dsp/common/complex.h \
$(LSP_DSP_LIB_INC)/lsp-plug.in/dsp/common/context.h \
$(LSP_DSP_LIB_INC)/lsp-plug.in/dsp/common/convolution.h \
$(LSP_DSP_LIB_INC)/lsp-plug.in/dsp/common/copy.h \
$(LSP_DSP_LIB_INC)/lsp-plug.in/dsp/common/fastconv.h \
$(LSP_DSP_LIB_INC)/lsp-plug.in/dsp/common/fft.h \
$(LSP_DSP_LIB_INC)/lsp-plug.in/dsp/common/filters.h \
$(LSP_DSP_LIB_INC)/lsp-plug.in/dsp/common/filters/types.h \
$(LSP_DSP_LIB_INC)/lsp-plug.in/dsp/common/filters/dynamic.h \
$(LSP_DSP_LIB_INC)/lsp-plug.in/dsp/common/filters/static.h \
$(LSP_DSP_LIB_INC)/lsp-plug.in/dsp/common/filters/transfer.h \
$(LSP_DSP_LIB_INC)/lsp-plug.in/dsp/common/filters/transform.h \
$(LSP_DSP_LIB_INC)/lsp-plug.in/dsp/common/float.h \
$(LSP_DSP_LIB_INC)/lsp-plug.in/dsp/common/graphics.h \
$(LSP_DSP_LIB_INC)/lsp-plug.in/dsp/common/hmath.h \
$(LSP_DSP_LIB_INC)/lsp-plug.in/dsp/common/hmath/hdotp.h \
$(LSP_DSP_LIB_INC)/lsp-plug.in/dsp/common/hmath/hsum.h \
$(LSP_DSP_LIB_INC)/lsp-plug.in/dsp/common/misc.h \
$(LSP_DSP_LIB_INC)/lsp-plug.in/dsp/common/mix.h \
$(LSP_DSP_LIB_INC)/lsp-plug.in/dsp/common/msmatrix.h \
$(LSP_DSP_LIB_INC)/lsp-plug.in/dsp/common/pcomplex.h \
$(LSP_DSP_LIB_INC)/lsp-plug.in/dsp/common/pmath.h \
$(LSP_DSP_LIB_INC)/lsp-plug.in/dsp/common/pmath/abs_vv.h \
$(LSP_DSP_LIB_INC)/lsp-plug.in/dsp/common/pmath/exp.h \
$(LSP_DSP_LIB_INC)/lsp-plug.in/dsp/common/pmath/fmop_kx.h \
$(LSP_DSP_LIB_INC)/lsp-plug.in/dsp/common/pmath/fmop_vv.h \
$(LSP_DSP_LIB_INC)/lsp-plug.in/dsp/common/pmath/log.h \
$(LSP_DSP_LIB_INC)/lsp-plug.in/dsp/common/pmath/minmax.h \
$(LSP_DSP_LIB_INC)/lsp-plug.in/dsp/common/pmath/op_kx.h \
$(LSP_DSP_LIB_INC)/lsp-plug.in/dsp/common/pmath/op_vv.h \
$(LSP_DSP_LIB_INC)/lsp-plug.in/dsp/common/pmath/pow.h \
$(LSP_DSP_LIB_INC)/lsp-plug.in/dsp/common/resampling.h \
$(LSP_DSP_LIB_INC)/lsp-plug.in/dsp/common/search.h \
$(LSP_DSP_LIB_INC)/lsp-plug.in/dsp/common/search/iminmax.h \
$(LSP_DSP_LIB_INC)/lsp-plug.in/dsp/common/search/minmax.h \
$(LSP_DSP_LIB_INC)/lsp-plug.in/dsp/common/smath.h \
$(LSP_DSP_LIB_INC)/lsp-plug.in/dsp/common/interpolation.h \
$(LSP_DSP_LIB_INC)/lsp-plug.in/dsp/common/interpolation/linear.h \
$(TIMBRE_MILL_INC)/private/tool.h \
$(LSP_COMMON_LIB_INC)/lsp-plug.in/common/types.h \
$(LSP_COMMON_LIB_INC)/lsp-plug.in/common/version.h \
$(LSP_RUNTIME_LIB_INC)/lsp-plug.in/runtime/LSPString.h \
$(LSP_RUNTIME_LIB_INC)/lsp-plug.in/runtime/version.h \
$(LSP_COMMON_LIB_INC)/lsp-plug.in/stdlib/string.h \
$(LSP_LLTL_LIB_INC)/lsp-plug.in/lltl/types.h \
$(LSP_LLTL_LIB_INC)/lsp-plug.in/lltl/version.h \
$(LSP_LLTL_LIB_INC)/lsp-plug.in/lltl/spec.h \
$(LSP_RUNTIME_LIB_INC)/lsp-plug.in/expr/Variables.h \
$(LSP_RUNTIME_LIB_INC)/lsp-plug.in/expr/Resolver.h \
$(LSP_RUNTIME_LIB_INC)/lsp-plug.in/expr/types.h \
$(LSP_COMMON_LIB_INC)/lsp-plug.in/common/status.h \
$(LSP_LLTL_LIB_INC)/lsp-plug.in/lltl/parray.h \
$(TIMBRE_MILL_INC)/private/config/config.h \
$(LSP_COMMON_LIB_INC)/lsp-plug.in/stdlib/stdio.h \
$(LSP_RUNTIME_LIB_INC)/lsp-plug.in/io/Path.h \
$(LSP_RUNTIME_LIB_INC)/lsp-plug.in/io/IInSequence.h \
$(LSP_RUNTIME_LIB_INC)/lsp-plug.in/io/IInStream.h \
$(TIMBRE_MILL_INC)/private/config/data.h \
$(LSP_LLTL_LIB_INC)/lsp-plug.in/lltl/pphash.h
Loading

0 comments on commit 5c31323

Please sign in to comment.