Skip to content

Commit

Permalink
Release 1.0.13
Browse files Browse the repository at this point in the history
* Added insert() method to dspu::Sample class that allows to insert some zeroed
  chunks to the sample at the specified position.
* Improved sidechain algorithm related to RMS refresh.
* Implemented linear-phase FFT crossover.
* Updated build scripts.
* Updated module versions in dependencies.
  • Loading branch information
sadko4u committed Aug 20, 2023
2 parents fe90a19 + ae7c32a commit d4f0dd5
Show file tree
Hide file tree
Showing 28 changed files with 3,131 additions and 150 deletions.
28 changes: 27 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,33 @@ jobs:
echo "***** MEMCHECK $test *****"; \
valgrind ${{env.VALGRIND_ARGS}} .build/target/${{env.ARTIFACT}}/${{env.ARTIFACT}}-test utest --verbose --jobs 1 --nofork --debug $test; \
done
arch_linux_debug:
arch_linux_asan:
runs-on: ubuntu-latest
container:
image: archlinux:latest
steps:
- name: Add debug repositories
run: |
printf "[core-debug]\nInclude = /etc/pacman.d/mirrorlist\n[extra-debug]\nInclude = /etc/pacman.d/mirrorlist\n[multilib-debug]\nInclude = /etc/pacman.d/mirrorlist" >> /etc/pacman.conf
printf 'Server = https://geo.mirror.pkgbuild.com/$repo/os/$arch\n%s\n' "$(cat /etc/pacman.d/mirrorlist)" > /etc/pacman.d/mirrorlist
- name: Install dependencies
run: pacman --noconfirm -Syu base-devel glibc-debug git libsndfile
- uses: actions/checkout@v3
- name: Configure project
run: make config TEST=1 STRICT=1 DEBUG=1 ASAN=1
- name: Fetch project dependencies
run: make fetch
- name: Build project
run: make VERBOSE=1
- name: Run unit tests
run: .build/target/${{env.ARTIFACT}}/${{env.ARTIFACT}}-test utest --verbose --jobs 1
- name: Run unit tests with memcheck
run: |
for test in $(.build/target/${{env.ARTIFACT}}/${{env.ARTIFACT}}-test utest --list --suppress); do \
echo "***** MEMCHECK $test *****"; \
.build/target/${{env.ARTIFACT}}/${{env.ARTIFACT}}-test utest --verbose --jobs 1 --nofork --debug $test; \
done
arch_linux_valgrind:
runs-on: ubuntu-latest
container:
image: archlinux:latest
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
* RECENT CHANGES
*******************************************************************************

=== 1.0.13 ===
* Added insert() method to dspu::Sample class that allows to insert some zeroed
chunks to the sample at the specified position.
* Improved sidechain algorithm related to RMS refresh.
* Implemented linear-phase FFT crossover.
* Updated build scripts.
* Updated module versions in dependencies.

=== 1.0.12 ===
* Added support of high-precision oversampling routines to dspu::Oversampler module.
* Added functions for readinng current dspu::Oversampler setup.
Expand Down
2 changes: 1 addition & 1 deletion include/lsp-plug.in/dsp-units/dynamics/Gate.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ namespace lsp
/** Process sidechain signal
*
* @param out output signal gain to VCA
* @param env envelope signal of expander
* @param env envelope signal of gate
* @param in sidechain signal
* @param samples number of samples to process
*/
Expand Down
162 changes: 162 additions & 0 deletions include/lsp-plug.in/dsp-units/misc/fft_crossover.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
/*
* Copyright (C) 2023 Linux Studio Plugins Project <https://lsp-plug.in/>
* (C) 2023 Vladimir Sadovnikov <[email protected]>
*
* This file is part of lsp-dsp-units
* Created on: 8 авг. 2023 г.
*
* lsp-dsp-units is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* lsp-dsp-units is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with lsp-dsp-units. If not, see <https://www.gnu.org/licenses/>.
*/

#ifndef LSP_PLUG_IN_DSP_UNITS_MISC_FFT_CROSSOVER_H_
#define LSP_PLUG_IN_DSP_UNITS_MISC_FFT_CROSSOVER_H_

#include <lsp-plug.in/dsp-units/version.h>
#include <lsp-plug.in/common/types.h>

namespace lsp
{
namespace dspu
{
namespace crossover
{
/**
* This header allows to generate characteristics of linear-phase crossover filters.
*/

/**
* Compute the magintude of the hi-pass crossover filter
* @param f the array of frequencies
* @param f0 the cut-off frequency of the filter, at which it gives -6 dB attenuation
* @param slope the slope of the filter, attenuation in dB/octave. Negative value. If slope
* is greater than -3 dB, it is considered to be no attenuation after -6 dB fall-off
* @return the actual filter's magnitude at the specified frequency
*/
LSP_DSP_UNITS_PUBLIC
float hipass(float f, float f0, float slope);

/**
* Compute the magintude of the lo-pass crossover filter
* @param f the array of frequencies
* @param f0 the cut-off frequency of the filter, at which it gives -6 dB attenuation
* @param slope the slope of the filter, attenuation in dB/octave. Negative value. If slope
* is greater than -3 dB, it is considered to be no attenuation after -6 dB fall-off
* @return the actual filter's magnitude at the specified frequency
*/
LSP_DSP_UNITS_PUBLIC
float lopass(float f, float f0, float slope);

/**
* Generate characteristics of the hipass crossover filter
* @param gain the array to store output filter magintude for each frequency at the input
* @param f the array of frequencies
* @param f0 the cut-off frequency of the filter, at which it gives -6 dB attenuation
* @param slope the slope of the filter, attenuation in dB/octave. Negative value. If slope
* is greater than -3 dB, it is considered to be no attenuation after -6 dB fall-off
* @param count the overall number of frequencies in the input array of frequencies
*/
LSP_DSP_UNITS_PUBLIC
void hipass_set(float *gain, const float *f, float f0, float slope, size_t count);

/**
* Apply characteristics of the hipass crossover filter, usual when building bandpass filter
* from low-pass and high-pass filters.
* @param gain the array to store output filter magintude for each frequency at the input
* @param f the array of frequencies
* @param f0 the cut-off frequency of the filter, at which it gives -6 dB attenuation
* @param slope the slope of the filter, attenuation in dB/octave. Negative value. If slope
* is greater than -3 dB, it is considered to be no attenuation after -6 dB fall-off
* @param count the overall number of frequencies in the input array of frequencies
*/
LSP_DSP_UNITS_PUBLIC
void hipass_apply(float *gain, const float *f, float f0, float slope, size_t count);

/**
* Generate characteristics of the lowpass crossover filter
* @param gain the array to store output filter magintude for each frequency at the input
* @param f the array of frequencies
* @param f0 the cut-off frequency of the filter, at which it gives -6 dB attenuation
* @param slope the slope of the filter, attenuation in dB/octave. Negative value. If slope
* is greater than -3 dB, it is considered to be no attenuation after -6 dB fall-off
* @param count the overall number of frequencies in the input array of frequencies
*/
LSP_DSP_UNITS_PUBLIC
void lopass_set(float *gain, const float *f, float f0, float slope, size_t count);

/**
* Apply characteristics of the lowpass crossover filter, usual when building bandpass filter
* from low-pass and high-pass filters.
* @param gain the array to store output filter magintude for each frequency at the input
* @param f the array of frequencies
* @param f0 the cut-off frequency of the filter, at which it gives -6 dB attenuation
* @param slope the slope of the filter, attenuation in dB/octave. Negative value. If slope
* is greater than -3 dB, it is considered to be no attenuation after -6 dB fall-off
* @param count the overall number of frequencies in the input array of frequencies
*/
LSP_DSP_UNITS_PUBLIC
void lopass_apply(float *gain, const float *f, float f0, float slope, size_t count);

/**
* Generate magnitude characteristics of the hipass crossover filter for FFT processing.
* @param gain the array to store output filter magintude for each frequency at the input
* @param f0 the cut-off frequency of the filter, at which it gives -6 dB attenuation
* @param slope the slope of the filter, attenuation in dB/octave. Negative value. If slope
* is greater than -3 dB, it is considered to be no attenuation after -6 dB fall-off
* @param count the overall number of frequencies in the input array of frequencies
*/
LSP_DSP_UNITS_PUBLIC
void hipass_fft_set(float *mag, float f0, float slope, float sample_rate, size_t rank);

/**
* Apply magnitude characteristics of the hipass crossover filter for FFT processing, usual
* when building bandpass filter from low-pass and high-pass filters.
* @param gain the output filter gain for each frequency at the input, should be of 2^rank length.
* @param f0 the cut-off frequency of the filter, at which it gives -6 dB attenuation
* @param slope the slope of the filter, attenuation in dB/octave. Negative value. If slope
* is greater than -3 dB, it is considered to be no attenuation after -6 dB fall-off
* @param count the overall number of frequencies in the input array of frequencies
*/
LSP_DSP_UNITS_PUBLIC
void hipass_fft_apply(float *mag, float f0, float slope, float sample_rate, size_t rank);

/**
* Generate magnitude characteristics of the lowpass crossover filter for FFT processing.
* @param gain the output filter gain for each frequency at the input, should be of 2^rank length.
* @param f0 the cut-off frequency of the filter, at which it gives -6 dB attenuation
* @param slope the slope of the filter, attenuation in dB/octave. Negative value. If slope
* is greater than -3 dB, it is considered to be no attenuation after -6 dB fall-off
* @param count the overall number of frequencies in the input array of frequencies
*/
LSP_DSP_UNITS_PUBLIC
void lopass_fft_set(float *mag, float f0, float slope, float sample_rate, size_t rank);

/**
* Apply magnitude characteristics of the lowpass crossover filter for FFT processing, usual
* when building bandpass filter from low-pass and high-pass filters.
* @param gain the output filter gain for each frequency at the input, should be of 2^rank length.
* @param f0 the cut-off frequency of the filter, at which it gives -6 dB attenuation
* @param slope the slope of the filter, attenuation in dB/octave. Negative value. If slope
* is greater than -3 dB, it is considered to be no attenuation after -6 dB fall-off
* @param count the overall number of frequencies in the input array of frequencies
*/
LSP_DSP_UNITS_PUBLIC
void lopass_fft_apply(float *mag, float f0, float slope, float sample_rate, size_t rank);

} /* namespace crossover */
} /* namespace dspu */
} /* namespace lsp */



#endif /* LSP_PLUG_IN_DSP_UNITS_MISC_FFT_CROSSOVER_H_ */
15 changes: 11 additions & 4 deletions include/lsp-plug.in/dsp-units/misc/interpolation.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ namespace lsp
namespace interpolation
{
/** Perform quadratic Hermite interpolation
*
* The resulting polynom equation is the following:
* y(x) = p[0]*x^2 + p[1]*x^ + p[2]
*
* @param p destination (3 floats) to store the final hermite polynom
* @param x0 x-coordinate of first point used for interpolation
Expand All @@ -43,7 +46,10 @@ namespace lsp
LSP_DSP_UNITS_PUBLIC
void hermite_quadratic(float *p, float x0, float y0, float k0, float x1, float k1);

/** Perform cubic Hermite interpolation
/** Perform cubic Hermite interpolation.
*
* The resulting polynom equation is the following:
* y(x) = p[0]*x^3 + p[1]*x^2 + p[2]*x + p[3]
*
* @param p destination (4 floats) to store the final hermite polynom
* @param x0 x-coordinate of first point used for interpolation
Expand Down Expand Up @@ -78,8 +84,9 @@ namespace lsp
*/
LSP_DSP_UNITS_PUBLIC
void linear(float *p, float x0, float y0, float x1, float y1);
}
}
}

} /* namespace interpolation */
} /* namespace dspu */
} /* namespace lsp */

#endif /* LSP_PLUG_IN_DSP_UNITS_MISC_INTERPOLATION_H_ */
24 changes: 23 additions & 1 deletion include/lsp-plug.in/dsp-units/sampling/Sample.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,28 @@ namespace lsp
*/
status_t resample(size_t new_sample_rate);

/**
* Insert some empty samples at specified position
* @param pos position to insert data
* @param samples number of samples to insert
* @return status of operation
*/
status_t insert(size_t pos, size_t samples);

/**
* Append the specified number of samples at the end of the sample
* @param samples number of samples to append
* @return status of operation
*/
status_t append(size_t samples);

/**
* Prepend the specified number of samples at the beginning of the sample
* @param samples number of samples to append
* @return status of operation
*/
status_t prepend(size_t samples);

/** Reverse track
*
* @param channel channel to reverse
Expand Down Expand Up @@ -388,7 +410,7 @@ namespace lsp
*/
void dump(IStateDumper *v) const;
};
}
} /* namespace dspu */
} /* namespace lsp */

#endif /* LSP_PLUG_IN_DSP_UNITS_SAMPLING_SAMPLE_H_ */
12 changes: 7 additions & 5 deletions include/lsp-plug.in/dsp-units/util/Crossover.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2020 Linux Studio Plugins Project <https://lsp-plug.in/>
* (C) 2020 Vladimir Sadovnikov <[email protected]>
* Copyright (C) 2023 Linux Studio Plugins Project <https://lsp-plug.in/>
* (C) 2023 Vladimir Sadovnikov <[email protected]>
*
* This file is part of lsp-dsp-units
* Created on: 03 авг. 2016 г.
Expand Down Expand Up @@ -62,14 +62,16 @@ namespace lsp
namespace dspu
{
/**
* Crossover callback function for processing band signal
* Crossover callback function for processing band signal. Because the internal processing buffer
* of crossover is limited, the function can be called multiple times. To understand the right offset
* relatively to the original buffer, the 'first' parameter can be used.
*
* @param object the object that handles callback
* @param subject the subject that is used to handle callback
* @param band number of the band
* @param data the output band signal produced by crossover,
* is valid only until the function returns
* @param first index of the first sample in input buffer
* @param first index of the first sample in the data buffer relatively to the original input buffer
* @param count number of processed samples in the data buffer
*/
typedef void (* crossover_func_t)(void *object, void *subject, size_t band, const float *data, size_t first, size_t count);
Expand Down Expand Up @@ -353,7 +355,7 @@ namespace lsp
*/
void dump(IStateDumper *v) const;
};
}
} /* namespace dspu */
} /* namespace lsp */

#endif /* LSP_PLUG_IN_DSP_UNITS_UTIL_CROSSOVER_H_ */
Loading

0 comments on commit d4f0dd5

Please sign in to comment.