Commit 911c2930 authored by Sebastian Ramacher's avatar Sebastian Ramacher

New upstream version 20180803

parent 47edef2d
......@@ -6,10 +6,27 @@ export RW=../robtk/
###############################################################################
VERSION ?=$(shell date +%Y%m%d)
SUBDIRS = balance.lv2 convoLV2 fat1.lv2 fil4.lv2 meters.lv2 \
midifilter.lv2 midigen.lv2 midimap.lv2 mixtri.lv2 \
nodelay.lv2 onsettrigger.lv2 sisco.lv2 stepseq.lv2 \
stereoroute.lv2 testsignal.lv2 tuna.lv2 xfade.lv2
SUBDIRS = \
balance.lv2 \
controlfilter.lv2 \
dpl.lv2 \
convoLV2 \
fat1.lv2 \
fil4.lv2 \
meters.lv2 \
midifilter.lv2 \
midigen.lv2 \
midimap.lv2 \
mixtri.lv2 \
nodelay.lv2 \
onsettrigger.lv2 \
sisco.lv2 \
stepseq.lv2 \
stereoroute.lv2 \
testsignal.lv2 \
tuna.lv2 \
xfade.lv2
all clean install uninstall: submodule_check $(SUBDIRS)
......
......@@ -48,7 +48,7 @@
lv2:default 0 ;
lv2:minimum 0 ;
lv2:maximum 1 ;
lv2:portProperty lv2:integer, lv2:toggled;
lv2:portProperty lv2:toggled;
] , [
a lv2:InputPort ,
lv2:ControlPort ;
......@@ -58,7 +58,7 @@
lv2:default 0 ;
lv2:minimum 0 ;
lv2:maximum 1 ;
lv2:portProperty lv2:integer, lv2:toggled;
lv2:portProperty lv2:toggled;
] , [
a lv2:InputPort ,
lv2:ControlPort ;
......
......@@ -3,7 +3,7 @@
#ifdef CSC_TTF
controlfilter:CSC_NAME
TTL_DEFAULTDEF("Control Port Exponental")
TTL_DEFAULTDEF("Control Port Exponential")
, TTL_IPORTFLOAT(0, "base", "base", -10, 10, 2.718281828)
; rdfs:comment "Control Parameter Exponential out = base ^ in"
.
......
......@@ -3,7 +3,7 @@
#ifdef CSC_TTF
controlfilter:CSC_NAME
TTL_DEFAULTDEF("Control Linear Scale")
TTL_DEFAULTDEF("Control Invert")
; rdfs:comment "Control Parameter Inverter out = 1 / in"
.
......
......@@ -28,7 +28,7 @@
lv2:ControlPort ; \
lv2:index 0 ; \
lv2:symbol "in" ; \
lv2:name "Control Input" \
lv2:name "Control Input"; \
lv2:default 0.0 ; \
lv2:minimum -1.0 ; \
lv2:maximum 1.0 ; \
......
......@@ -8,6 +8,7 @@ OPTIMIZATIONS ?= -msse -msse2 -mfpmath=sse -ffast-math -fomit-frame-pointer -O3
PREFIX ?= /usr/local
CXXFLAGS ?= $(OPTIMIZATIONS) -Wall
LIBDIR ?= lib
STRIP ?= strip
BUILDGTK ?= no
###############################################################################
......@@ -17,14 +18,20 @@ LV2DIR ?= $(PREFIX)/$(LIBDIR)/lv2
LV2NAME=convoLV2
LV2GUI=convoLV2UI
BUNDLE=convo.lv2
targets=
UNAME=$(shell uname)
ifeq ($(UNAME),Darwin)
LV2LDFLAGS=-dynamiclib
LIB_EXT=.dylib
STRIPFLAGS=-u -r -arch all -s lv2syms
UISTRIPFLAGS=-u -r -arch all -s lv2uisyms
targets+=lv2syms lv2uisyms
else
LV2LDFLAGS=-Wl,-Bstatic -Wl,-Bdynamic
LIB_EXT=.so
STRIPFLAGS=-s
UISTRIPFLAGS=-s
endif
ifneq ($(XWIN),)
......@@ -63,7 +70,7 @@ endif
ifeq ($(LIBZITACONVOLVER),)
ifeq ($(shell test -f /usr/include/zita-convolver.h -o -f /usr/local/include/zita-convolver.h || echo no ), no)
$(error "libzita-convolver3, is required")
$(error "libzita-convolver3 or 4, is required")
endif
LOADLIBES += -lzita-convolver
endif
......@@ -82,7 +89,7 @@ endif
GTKCFLAGS = `pkg-config --cflags gtk+-2.0`
GTKLIBS = `pkg-config --libs gtk+-2.0`
targets= $(BUILDDIR)$(LV2NAME)$(LIB_EXT)
targets+= $(BUILDDIR)$(LV2NAME)$(LIB_EXT)
ifneq ($(BUILDGTK), no)
targets+=$(BUILDDIR)$(LV2GUI)$(LIB_EXT)
......@@ -94,6 +101,12 @@ default: all
all: $(BUILDDIR)manifest.ttl $(BUILDDIR)$(LV2NAME).ttl $(targets)
lv2syms:
echo "_lv2_descriptor" > lv2syms
lv2uisyms:
echo "_lv2ui_descriptor" > lv2uisyms
$(BUILDDIR)manifest.ttl: lv2ttl/manifest.ttl.in lv2ttl/manifest.gui.ttl.in
@mkdir -p $(BUILDDIR)
sed "s/@LV2NAME@/$(LV2NAME)/;s/@LV2GUI@/$(LV2GUI)/;s/@LIB_EXT@/$(LIB_EXT)/" \
......@@ -116,11 +129,13 @@ $(BUILDDIR)$(LV2NAME)$(LIB_EXT): lv2.c convolution.cc uris.h
-o $(BUILDDIR)$(LV2NAME)$(LIB_EXT) lv2.c convolution.cc \
$(LIBZITACONVOLVER) \
-shared $(LV2LDFLAGS) $(LDFLAGS) $(LOADLIBES)
$(STRIP) $(STRIPFLAGS) $(BUILDDIR)$(LV2NAME)$(LIB_EXT)
$(BUILDDIR)$(LV2GUI)$(LIB_EXT): ui.c uris.h
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(GTKCFLAGS) \
-o $(BUILDDIR)$(LV2GUI)$(LIB_EXT) ui.c \
-shared $(LV2LDFLAGS) $(LDFLAGS) $(GTKLIBS)
$(STRIP) $(UISTRIPFLAGS) $(BUILDDIR)$(LV2GUI)$(LIB_EXT)
# install/uninstall/clean target definitions
......@@ -139,7 +154,8 @@ uninstall:
clean:
rm -f $(BUILDDIR)manifest.ttl $(BUILDDIR)$(LV2NAME).ttl \
$(BUILDDIR)$(LV2NAME)$(LIB_EXT) $(BUILDDIR)$(LV2GUI)$(LIB_EXT)
$(BUILDDIR)$(LV2NAME)$(LIB_EXT) $(BUILDDIR)$(LV2GUI)$(LIB_EXT) \
lv2syms lv2uisyms
rm -rf $(BUILDDIR)*.dSYM
-test -d $(BUILDDIR) && rmdir $(BUILDDIR) || true
......
......@@ -18,7 +18,7 @@ for the required configuration, channel-assignment wraps around (modulo file cha
convoLV2's main use-case is cabinet-emulation and generic signal processing where latency matters.
For fancy reverb applications, see also [IR.lv2](http://factorial.hu/plugins/lv2/ir).
For fancy reverb applications, see also [IR.lv2](https://tomszilagyi.github.io/plugins/ir.lv2/)
Install
-------
......
......@@ -47,8 +47,8 @@
#include <samplerate.h>
#include "convolution.h"
#if ZITA_CONVOLVER_MAJOR_VERSION != 3
# error "This programs requires zita-convolver 3.x.x"
#if ZITA_CONVOLVER_MAJOR_VERSION != 3 && ZITA_CONVOLVER_MAJOR_VERSION != 4
# error "This programs requires zita-convolver 3 or 4"
#endif
#ifndef SRC_QUALITY // alternatives: SRC_SINC_FASTEST, SRC_SINC_MEDIUM_QUALITY, (SRC_ZERO_ORDER_HOLD, SRC_LINEAR)
......@@ -156,6 +156,7 @@ static int audiofile_read (const char *fn, const int sample_rate, float **buf, u
if (n_sp) *n_sp = (unsigned int) src_data.output_frames_gen;
free(rdb);
src_delete (src_state);
}
}
......@@ -343,7 +344,9 @@ int clv_initialize (
clv->convproc = new Convproc;
clv->convproc->set_options (options);
#if ZITA_CONVOLVER_MAJOR_VERSION == 3
clv->convproc->set_density (clv->density);
#endif
if (audiofile_read (clv->ir_fn, sample_rate, &p, &n_chan, &n_frames)) {
fprintf(stderr, "convoLV2: failed to read IR.\n");
......@@ -378,6 +381,9 @@ int clv_initialize (
/*quantum*/ buffersize,
/*min-part*/ buffersize /* must be >= fragm */,
/*max-part*/ buffersize /* Convproc::MAXPART -> stich output every period */
#if ZITA_CONVOLVER_MAJOR_VERSION == 4
, clv->density
#endif
)) {
fprintf (stderr, "convoLV2: Cannot initialize convolution engine.\n");
goto errout;
......
---
Language: Cpp
BasedOnStyle: LLVM
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
AlignEscapedNewlinesLeft: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine : false
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: AllDefinitions
BreakBeforeBraces: Linux
ColumnLimit: 0
IndentCaseLabels: true
KeepEmptyLinesAtTheStartOfBlocks: false
MaxEmptyLinesToKeep: 1
ReflowComments: true
PointerAlignment: Left
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: Always
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Cpp11BracedListStyle: false
AccessModifierOffset: -8
IndentWidth: 8
TabWidth: 8
UseTab: ForIndentation
This diff is collapsed.
This diff is collapsed.
dpl.lv2 - Digital Peak Limiter
==============================
dpl.lv2 is a look-ahead digital peak limiter intended but not limited to the final step of mastering or mixing.
It is available as [LV2 plugin](http://lv2plug.in/) and standalone [JACK](http://jackaudio.org/)-application.
Usage
-----
The Plugin has three controls which can be operated by mouse-drag and the scroll-wheel.
Holding the _Ctrl_ key allows for fine-grained control when dragging or using the mouse-wheel on a knob.
Furthermore the UI offers
* Shift + click: reset to default
* Right-click on knob: toggle current value with default, 2nd click restore.
The rotary knobs from left to right allow to set
* Input gain. This sets the gain applied before peak detection or any other processing. Range is -10 to +30 dB in steps of 0.2 dB.
* Threshold. The maximum sample value at the output. -10 to 0 dB in steps of 0.1 dB. dpl.lv2 will not allow a single sample above this level.
* Release time. This can be set from 1 ms to 1 second. Note that dpl.lv2 allows short release times even on signals that contain high level low frequency signals. Any gain reduction caused by those will have an automatically extended hold time in order to avoid the limiter following the shape of the waveform and create excessive distortion. Short superimposed peaks will still have the release time as set by this control.
Install
-------
Compiling dpl.lv2 requires the LV2 SDK, jack-headers, gnu-make, a c++-compiler,
libpango, libcairo and openGL (sometimes called: glu, glx, mesa).
```bash
git clone git://github.com/x42/dpl.lv2.git
cd dpl.lv2
make submodules
make
sudo make install PREFIX=/usr
```
Note to packagers: the Makefile honors `PREFIX` and `DESTDIR` variables as well
as `CXXLAGS`, `LDFLAGS` and `OPTIMIZATIONS` (additions to `CXXFLAGS`), also
see the first 10 lines of the Makefile.
You really want to package the superset of [x42-plugins](https://github.com/x42/x42-plugins).
Screenshots
-----------
![screenshot](https://raw.github.com/x42/dpl.lv2/master/img/dpl1.png "DPL LV2 GUI")
Credits
-------
dpl.lv2 is based on zita-jacktools-1.0.0 by Fons Adriaensen.
###############################################################################
# extract versions
GIT_REV_REGEXP="([0-9][0-9]*)\.([0-9][0-9]*)(\.([0-9][0-9]*))?(-([0-9][0-9]*))?(-g([a-f0-9]+))?"
override MAJOR=$(shell echo $(LV2VERSION) | sed $(EXTENDED_RE) -e s/$(GIT_REV_REGEXP)/\\1/)
override MINOR=$(shell echo $(LV2VERSION) | sed $(EXTENDED_RE) -e s/$(GIT_REV_REGEXP)/\\2/)
override MICRO=$(shell echo $(LV2VERSION) | sed $(EXTENDED_RE) -e s/$(GIT_REV_REGEXP)/\\4/)
override GITREV=$(shell echo $(LV2VERSION) | sed $(EXTENDED_RE) -e s/$(GIT_REV_REGEXP)/\\6/)
ifeq ($(MAJOR),)
override MAJOR=0
endif
ifeq ($(MINOR),)
override MINOR=0
endif
ifeq ($(MICRO),)
override MICRO=0
endif
$(info Version: $(LV2VERSION) -> $(MAJOR) $(MINOR) $(MICRO) $(GITREV))
# version requirements, see
# http://lv2plug.in/ns/lv2core/#minorVersion
# http://lv2plug.in/ns/lv2core/#microVersion
ifeq ($(GITREV),)
# even numbers for tagged releases
override LV2MIN = $(shell expr $(MAJOR) \* 65536 + $(MINOR) \* 256 + $(MICRO) \* 2 )
override LV2MIC = 0
else
# odd-numbers for all non tagged git versions
override LV2MIN = $(shell expr $(MAJOR) \* 65536 + $(MINOR) \* 256 + $(MICRO) \* 2 + 1 )
override LV2MIC = $(shell expr $(GITREV) \* 2 + 1)
endif
ifeq ($(LV2MIN),)
$(error "Cannot extract required LV2 minor-version parameter")
endif
ifeq ($(LV2MIC),)
$(error "Cannot extract required LV2 micro-version parameter")
endif
$(info LV2 Version: $(LV2MIN) $(LV2MIC))
This diff is collapsed.
@LV2NAME@:ui_gl
a @UI_TYPE@ ;
@UI_REQ@
lv2:requiredFeature urid:map ;
.
a lv2:AudioPort ,
lv2:InputPort ;
lv2:index 8 ;
lv2:symbol "in" ;
lv2:name "In"
] , [
a lv2:AudioPort ,
lv2:OutputPort ;
lv2:index 9 ;
lv2:symbol "out" ;
lv2:name "Out"
] ;
rdfs:comment "Mono look-ahead digital peak limiter"
.
@LV2NAME@:@URISUFFIX@
a lv2:Plugin, doap:Project, lv2:ParaEQPlugin;
doap:license <http://usefulinc.com/doap/licenses/gpl> ;
doap:maintainer <http://gareus.org/rgareus#me> ;
@VERSION@
doap:name "x42-dpl - Digital Peak Limiter@NAMESUFFIX@";
lv2:requiredFeature urid:map ;
lv2:extensionData state:interface @SIGNATURE@;
lv2:optionalFeature lv2:hardRTCapable ;
@UITTL@
lv2:port [
a atom:AtomPort ,
lv2:InputPort ;
atom:bufferType atom:Sequence ;
lv2:designation lv2:control ;
lv2:index 0 ;
lv2:symbol "control" ;
lv2:name "control" ;
rdfs:comment "UI to plugin communication"
] , [
a atom:AtomPort ,
lv2:OutputPort ;
atom:bufferType atom:Sequence ;
lv2:designation lv2:control ;
lv2:index 1 ;
lv2:symbol "notify" ;
lv2:name "Notify" ;
rsz:minimumSize @CTLSIZE@;
rdfs:comment "Plugin to GUI communication"
] , [
a lv2:InputPort ,
lv2:ControlPort ;
lv2:index 2 ;
lv2:symbol "enable" ;
lv2:name "Enable";
lv2:default 1 ;
lv2:minimum 0 ;
lv2:maximum 1 ;
lv2:portProperty lv2:integer, lv2:toggled;
lv2:designation lv2:enabled;
] , [
a lv2:InputPort ,
lv2:ControlPort ;
lv2:index 3 ;
lv2:symbol "gain" ;
lv2:name "Input Gain" ;
lv2:default 0.0 ;
lv2:minimum -10.0 ;
lv2:maximum 30.0;
pprop:rangeSteps 201;
units:unit units:db ;
] , [
a lv2:InputPort ,
lv2:ControlPort ;
lv2:index 4 ;
lv2:symbol "threshold" ;
lv2:name "Threshold" ;
lv2:default 0.0 ;
lv2:minimum -10.0 ;
lv2:maximum 0.0;
pprop:rangeSteps 101;
units:unit units:db ;
] , [
a lv2:InputPort ,
lv2:ControlPort ;
lv2:index 5 ;
lv2:symbol "release" ;
lv2:name "Release Time";
lv2:default 0.01 ;
lv2:minimum 0.001 ;
lv2:maximum 1.0 ;
lv2:portProperty pprop:logarithmic;
pprop:rangeSteps 151;
] , [
a lv2:OutputPort ,
lv2:ControlPort ;
lv2:index 6 ;
lv2:symbol "level" ;
lv2:name "Signal Level" ;
lv2:minimum -10.0 ;
lv2:maximum 20.0;
units:unit units:db ;
] , [
a lv2:OutputPort ,
lv2:ControlPort ;
lv2:index 7 ;
lv2:symbol "latency" ;
lv2:name "Signal Latency" ;
lv2:minimum 0 ;
lv2:maximum 1024;
lv2:portProperty lv2:reportsLatency, lv2:integer;
units:unit units:frame;
] , [
a lv2:AudioPort ,
lv2:InputPort ;
lv2:index 8 ;
lv2:symbol "inL" ;
lv2:name "In Left"
] , [
a lv2:AudioPort ,
lv2:OutputPort ;
lv2:index 9 ;
lv2:symbol "outL" ;
lv2:name "Out Left"
] , [
a lv2:AudioPort ,
lv2:InputPort ;
lv2:index 10 ;
lv2:symbol "inR" ;
lv2:name "In Right"
] , [
a lv2:AudioPort ,
lv2:OutputPort ;
lv2:index 11 ;
lv2:symbol "outR" ;
lv2:name "Out Right"
] ;
rdfs:comment "Stereo look-ahead digital peak limiter"
.
@prefix atom: <http://lv2plug.in/ns/ext/atom#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix kx: <http://kxstudio.sf.net/ns/lv2ext/external-ui#> .
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix mod: <http://moddevices.com/ns/mod#> .
@prefix pprop: <http://lv2plug.in/ns/ext/port-props#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix rsz: <http://lv2plug.in/ns/ext/resize-port#> .
@prefix state: <http://lv2plug.in/ns/ext/state#> .
@prefix ui: <http://lv2plug.in/ns/extensions/ui#> .
@prefix units: <http://lv2plug.in/ns/extensions/units#> .
@prefix urid: <http://lv2plug.in/ns/ext/urid#> .
@prefix @LV2NAME@: <http://gareus.org/oss/lv2/@LV2NAME@#> .
<http://gareus.org/rgareus#me>
a foaf:Person ;
foaf:name "Robin Gareus" ;
foaf:mbox <mailto:robin@gareus.org> ;
foaf:homepage <http://gareus.org/> .
// generated by lv2ttl2c from
// http://gareus.org/oss/lv2/dpl#mono
extern const LV2_Descriptor* lv2_descriptor(uint32_t index);
extern const LV2UI_Descriptor* lv2ui_descriptor(uint32_t index);
static const RtkLv2Description _plugin_mono = {
&lv2_descriptor,
&lv2ui_descriptor
, 0 // uint32_t dsp_descriptor_id
, 0 // uint32_t gui_descriptor_id
, "x42-dpl - Digital Peak Limiter Mono" // const char *plugin_human_id
, (const struct LV2Port[10])
{
{ "control", ATOM_IN, nan, nan, nan, "UI to plugin communication"},
{ "notify", ATOM_OUT, nan, nan, nan, "Plugin to GUI communication"},
{ "enable", CONTROL_IN, 1.000000, 0.000000, 1.000000, "Enable"},
{ "gain", CONTROL_IN, 0.000000, -10.000000, 30.000000, "Input Gain"},
{ "threshold", CONTROL_IN, 0.000000, -10.000000, 0.000000, "Threshold"},
{ "release", CONTROL_IN, 0.010000, 0.001000, 1.000000, "Release Time"},
{ "level", CONTROL_OUT, nan, -10.000000, 20.000000, "Signal Level"},
{ "latency", CONTROL_OUT, nan, 0.000000, 1024.000000, "Signal Latency"},
{ "in", AUDIO_IN, nan, nan, nan, "In"},
{ "out", AUDIO_OUT, nan, nan, nan, "Out"},
}
, 10 // uint32_t nports_total
, 1 // uint32_t nports_audio_in
, 1 // uint32_t nports_audio_out
, 0 // uint32_t nports_midi_in
, 0 // uint32_t nports_midi_out
, 1 // uint32_t nports_atom_in
, 1 // uint32_t nports_atom_out
, 6 // uint32_t nports_ctrl
, 4 // uint32_t nports_ctrl_in
, 2 // uint32_t nports_ctrl_out
, 65888 // uint32_t min_atom_bufsiz
, false // bool send_time_info
, 7 // uint32_t latency_ctrl_port
};
// generated by lv2ttl2c from
// http://gareus.org/oss/lv2/dpl#stereo
extern const LV2_Descriptor* lv2_descriptor(uint32_t index);
extern const LV2UI_Descriptor* lv2ui_descriptor(uint32_t index);
static const RtkLv2Description _plugin_stereo = {
&lv2_descriptor,
&lv2ui_descriptor
, 1 // uint32_t dsp_descriptor_id
, 0 // uint32_t gui_descriptor_id
, "x42-dpl - Digital Peak Limiter Stereo" // const char *plugin_human_id
, (const struct LV2Port[12])
{
{ "control", ATOM_IN, nan, nan, nan, "UI to plugin communication"},
{ "notify", ATOM_OUT, nan, nan, nan, "Plugin to GUI communication"},
{ "enable", CONTROL_IN, 1.000000, 0.000000, 1.000000, "Enable"},
{ "gain", CONTROL_IN, 0.000000, -10.000000, 30.000000, "Input Gain"},
{ "threshold", CONTROL_IN, 0.000000, -10.000000, 0.000000, "Threshold"},
{ "release", CONTROL_IN, 0.010000, 0.001000, 1.000000, "Release Time"},
{ "level", CONTROL_OUT, nan, -10.000000, 20.000000, "Signal Level"},
{ "latency", CONTROL_OUT, nan, 0.000000, 1024.000000, "Signal Latency"},
{ "inL", AUDIO_IN, nan, nan, nan, "In Left"},
{ "outL", AUDIO_OUT, nan, nan, nan, "Out Left"},
{ "inR", AUDIO_IN, nan, nan, nan, "In Right"},
{ "outR", AUDIO_OUT, nan, nan, nan, "Out Right"},
}
, 12 // uint32_t nports_total
, 2 // uint32_t nports_audio_in
, 2 // uint32_t nports_audio_out
, 0 // uint32_t nports_midi_in
, 0 // uint32_t nports_midi_out
, 1 // uint32_t nports_atom_in
, 1 // uint32_t nports_atom_out
, 6 // uint32_t nports_ctrl
, 4 // uint32_t nports_ctrl_in
, 2 // uint32_t nports_ctrl_out
, 131424 // uint32_t min_atom_bufsiz
, false // bool send_time_info
, 7 // uint32_t latency_ctrl_port
};
@LV2NAME@:ui_gl
a @UI_TYPE@ ;
ui:binary <@LV2GUI@@LIB_EXT@> ;
rdfs:seeAlso <@LV2NAME@.ttl> .
@prefix kx: <http://kxstudio.sf.net/ns/lv2ext/external-ui#> .
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix modgui: <http://moddevices.com/ns/modgui#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix ui: <http://lv2plug.in/ns/extensions/ui#> .
@prefix @LV2NAME@: <http://gareus.org/oss/lv2/@LV2NAME@#> .
@LV2NAME@:mono
a lv2:Plugin ;
lv2:binary <@LV2NAME@@LIB_EXT@> ;
rdfs:seeAlso <@LV2NAME@.ttl> .
@LV2NAME@:stereo
a lv2:Plugin ;
lv2:binary <@LV2NAME@@LIB_EXT@> ;
rdfs:seeAlso <@LV2NAME@.ttl> .
#define MULTIPLUGIN 1
#define X42_MULTIPLUGIN_NAME "Peak Limiter"
#define X42_MULTIPLUGIN_URI "http://gareus.org/oss/lv2/dpl"
#include "lv2ttl/dpl_mono.h"
#include "lv2ttl/dpl_stereo.h"
static const RtkLv2Description _plugins[] = {
_plugin_stereo,
_plugin_mono,
};
This diff is collapsed.
/*
* Copyright (C) 2010-2018 Fons Adriaensen <fons@linuxaudio.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <assert.h>
#include <math.h>
#include <string.h>
#include "peaklim.h"
using namespace DPLLV2;
void
Histmin::init (int hlen)
{
int i;
assert (hlen <= SIZE);
_hlen = hlen;
_hold = hlen;
_wind = 0;
_vmin = 1;
for (i = 0; i < SIZE; i++)
_hist[i] = _vmin;
}
float
Histmin::write (float v)
{
int i, j;
i = _wind;
_hist[i] = v;
if (v <= _vmin) {
_vmin = v;
_hold = _hlen;
} else if (--_hold == 0) {
_vmin = v;
_hold = _hlen;
for (j = 1 - _hlen; j < 0; j++) {
v = _hist[(i + j) & MASK];
if (v < _vmin) {
_vmin = v;
_hold = _hlen + j;
}
}
}
_wind = ++i & MASK;
return _vmin;
}
Peaklim::Peaklim (void)
: _fsamp (0),
_nchan (0),
_rstat (false),
_peak (0),
_gmax (1),
_gmin (1)
{
for (int i = 0; i < MAXCHAN; i++)
_dbuff[i] = 0;
}
Peaklim::~Peaklim (void)
{
fini ();
}
void
Peaklim::set_inpgain (float v)
{
_g1 = powf (10.0f, 0.05f * v);
}
void