Commit c556354d authored by Ross Gammon's avatar Ross Gammon

New upstream version 20190714

parent 911c2930
......@@ -9,11 +9,14 @@ VERSION ?=$(shell date +%Y%m%d)
SUBDIRS = \
balance.lv2 \
controlfilter.lv2 \
darc.lv2 \
dpl.lv2 \
convoLV2 \
fat1.lv2 \
fil4.lv2 \
matrixmixer.lv2 \
meters.lv2 \
mididebug.lv2 \
midifilter.lv2 \
midigen.lv2 \
midimap.lv2 \
......@@ -21,6 +24,7 @@ SUBDIRS = \
nodelay.lv2 \
onsettrigger.lv2 \
sisco.lv2 \
spectra.lv2 \
stepseq.lv2 \
stereoroute.lv2 \
testsignal.lv2 \
......
......@@ -4,11 +4,11 @@
# make CXXFLAGS=-O2
# make install DESTDIR=$(CURDIR)/debian/balance_lv2 PREFIX=/usr
#
OPTIMIZATIONS ?= -msse -msse2 -mfpmath=sse -ffast-math -fomit-frame-pointer -O3 -fno-finite-math-only
OPTIMIZATIONS ?= -msse -msse2 -mfpmath=sse -ffast-math -fomit-frame-pointer -O3 -fno-finite-math-only -DNDEBUG
PREFIX ?= /usr/local
CXXFLAGS ?= $(OPTIMIZATIONS) -Wall
LIBDIR ?= lib
PKG_CONFIG?=pkg-config
STRIP?=strip
STRIPFLAGS=-s
UISTRIPFLAGS=-s
......@@ -16,7 +16,7 @@ UISTRIPFLAGS=-s
balance_VERSION?=$(shell git describe --tags HEAD 2>/dev/null | sed 's/-g.*$$//;s/^v//' || echo "LV2")
###############################################################################
LV2DIR ?= $(PREFIX)/$(LIBDIR)/lv2
LV2DIR ?= $(PREFIX)/lib/lv2
LOADLIBES=-lm
LV2NAME=balance
LV2GUI=balanceUI
......@@ -24,9 +24,12 @@ BUNDLE=balance.lv2
BUILDDIR=build/
targets=
override CXXFLAGS+=-fPIC
TX=textures/
ifeq ($(XWIN),)
override CXXFLAGS += -fPIC -fvisibility=hidden
endif
IS_OSX=
PKG_GL_LIBS=
UNAME=$(shell uname)
......@@ -62,10 +65,10 @@ LV2VERSION=$(balance_VERSION)
include git2lv2.mk
# check for build-dependencies
ifeq ($(shell pkg-config --exists lv2 || echo no), no)
ifeq ($(shell $(PKG_CONFIG) --exists lv2 || echo no), no)
$(error "LV2 SDK was not found")
else
override CXXFLAGS+=`pkg-config --cflags lv2`
override CXXFLAGS+=`$(PKG_CONFIG) --cflags lv2`
endif
# optional UI
......@@ -95,18 +98,18 @@ else
endif
endif
HAVE_UI=$(shell pkg-config --exists $(PKG_GL_LIBS) ftgl && echo $(FONT_FOUND))
HAVE_UI=$(shell $(PKG_CONFIG) --exists $(PKG_GL_LIBS) ftgl && echo $(FONT_FOUND))
LV2UIREQ=
# check for LV2 idle thread -- requires 'lv2', atleast_version='1.4.6
ifeq ($(shell pkg-config --atleast-version=1.4.6 lv2 || echo no), no)
ifeq ($(shell $(PKG_CONFIG) --atleast-version=1.4.6 lv2 || echo no), no)
UICFLAGS+=-DOLD_SUIL
else
LV2UIREQ=lv2:requiredFeature ui:idleInterface; lv2:extensionData ui:idleInterface;
endif
# check for lv2_atom_forge_object new in 1.8.1 deprecates lv2_atom_forge_blank
ifeq ($(shell pkg-config --atleast-version=1.8.1 lv2 && echo yes), yes)
ifeq ($(shell $(PKG_CONFIG) --atleast-version=1.8.1 lv2 && echo yes), yes)
override CXXFLAGS += -DHAVE_LV2_1_8
endif
......@@ -120,34 +123,34 @@ ifeq ($(HAVE_UI), yes)
UIDEPS+=pugl/pugl_osx.m
UILIBS=pugl/pugl_osx.m -framework Cocoa -framework OpenGL
UI_TYPE=CocoaUI
UILIBS+=`pkg-config --variable=libdir ftgl`/libftgl.a `pkg-config --variable=libdir ftgl`/libfreetype.a -lm -mmacosx-version-min=10.5
UILIBS+=`pkg-config --libs zlib`
UILIBS+=`$(PKG_CONFIG) --variable=libdir ftgl`/libftgl.a `$(PKG_CONFIG) --variable=libdir ftgl`/libfreetype.a -lm -mmacosx-version-min=10.5
UILIBS+=`$(PKG_CONFIG) --libs zlib`
else
ifneq ($(XWIN),)
UIDEPS+=pugl/pugl_win.cpp
UICFLAGS+=-DPTW32_STATIC_LIB
UILIBS=pugl/pugl_win.cpp
UILIBS+=`pkg-config --variable=libdir ftgl`/libftgl.a `pkg-config --variable=libdir ftgl`/libfreetype.a
UILIBS+=`pkg-config --libs zlib`
UILIBS+=`$(PKG_CONFIG) --variable=libdir ftgl`/libftgl.a `$(PKG_CONFIG) --variable=libdir ftgl`/libfreetype.a
UILIBS+=`$(PKG_CONFIG) --libs zlib`
UILIBS+=-lws2_32 -lwinmm -lopengl32 -lglu32 -lgdi32 -lcomdlg32 -lpthread
UI_TYPE=WindowsUI
else
UIDEPS+=pugl/pugl_x11.c
UICFLAGS+=`pkg-config --cflags glu gl`
UICFLAGS+=`$(PKG_CONFIG) --cflags glu gl`
UILIBS=pugl/pugl_x11.c -lX11
UI_TYPE=X11UI
ifeq ($(STATICBUILD), yes)
UILIBS+=`pkg-config --libs glu`
UILIBS+=`pkg-config --variable=libdir ftgl`/libftgl.a `pkg-config --variable=libdir ftgl`/libfreetype.a
UILIBS+=`pkg-config --libs zlib`
UILIBS+=`$(PKG_CONFIG) --libs glu`
UILIBS+=`$(PKG_CONFIG) --variable=libdir ftgl`/libftgl.a `$(PKG_CONFIG) --variable=libdir ftgl`/libfreetype.a
UILIBS+=`$(PKG_CONFIG) --libs zlib`
else
UILIBS+=`pkg-config --libs glu ftgl`
UILIBS+=`$(PKG_CONFIG) --libs glu ftgl`
endif
UICFLAGS+=-DFONTFILE=\"$(FONTFILE)\"
endif
endif
UILIBS+=`pkg-config --libs ftgl`
UICFLAGS+=`pkg-config --cflags freetype2` `pkg-config --cflags ftgl` -DHAVE_FTGL -DUINQHACK=Blc
UILIBS+=`$(PKG_CONFIG) --libs ftgl`
UICFLAGS+=`$(PKG_CONFIG) --cflags freetype2` `$(PKG_CONFIG) --cflags ftgl` -DHAVE_FTGL -DUINQHACK=Blc
UICFLAGS+=-DFONTSIZE=$(FONTSIZE)
targets+=$(BUILDDIR)$(LV2GUI)$(LIB_EXT)
......
......@@ -4,6 +4,7 @@ OPTIMIZATIONS ?= -msse -msse2 -mfpmath=sse -ffast-math -fomit-frame-pointer -O3
PREFIX ?= /usr/local
CFLAGS ?= $(OPTIMIZATIONS) -Wall
PKG_CONFIG?=pkg-config
STRIP?=strip
STRIPFLAGS?=-s
......@@ -47,12 +48,14 @@ include git2lv2.mk
###############################################################################
# check for build-dependencies
ifeq ($(shell pkg-config --exists lv2 || echo no), no)
ifeq ($(shell $(PKG_CONFIG) --exists lv2 || echo no), no)
$(error "LV2 SDK was not found")
endif
override CFLAGS += -fPIC -std=c99
override CFLAGS += `pkg-config --cflags lv2`
ifeq ($(XWIN),)
override CFLAGS += -fPIC -fvisibility=hidden
endif
override CFLAGS += -std=c99 `$(PKG_CONFIG) --cflags lv2` -DVERSION="\"$(controlfilter_VERSION)\""
###############################################################################
# build target definitions
......
......@@ -135,7 +135,7 @@ cleanup(LV2_Handle instance)
free(instance);
}
const void*
static const void*
extension_data(const char* uri)
{
return NULL;
......
......@@ -4,20 +4,24 @@
# make CXXFLAGS=-O2
# make install DESTDIR=$(CURDIR)/debian/convoLV2 PREFIX=/usr
#
OPTIMIZATIONS ?= -msse -msse2 -mfpmath=sse -ffast-math -fomit-frame-pointer -O3 -fno-finite-math-only
PREFIX ?= /usr/local
LV2DIR ?= $(PREFIX)/lib/lv2
OPTIMIZATIONS ?= -msse -msse2 -mfpmath=sse -ffast-math -fomit-frame-pointer -O3 -fno-finite-math-only -DNDEBUG
CXXFLAGS ?= $(OPTIMIZATIONS) -Wall
LIBDIR ?= lib
STRIP ?= strip
PKG_CONFIG?=pkg-config
STRIP ?= strip
BUILDGTK ?= no
###############################################################################
BUILDDIR=build/
LV2DIR ?= $(PREFIX)/$(LIBDIR)/lv2
LV2NAME=convoLV2
LV2GUI=convoLV2UI
BUNDLE=convo.lv2
targets=
UNAME=$(shell uname)
......@@ -37,30 +41,33 @@ endif
ifneq ($(XWIN),)
CC=$(XWIN)-gcc
CXX=$(XWIN)-g++
STRIP=$(XWIN)-strip
LV2LDFLAGS=-Wl,-Bstatic -Wl,-Bdynamic -Wl,--as-needed -lpthread
LIB_EXT=.dll
BUILDGTK=no
override LDFLAGS += -static-libgcc -static-libstdc++
else
override CXXFLAGS += -fPIC -fvisibility=hidden
endif
# check for build-dependencies
ifeq ($(shell pkg-config --exists lv2 || echo no), no)
ifeq ($(shell $(PKG_CONFIG) --exists lv2 || echo no), no)
$(error "LV2 SDK was not found")
endif
ifeq ($(shell pkg-config --atleast-version=1.4 lv2 || echo no), no)
ifeq ($(shell $(PKG_CONFIG) --atleast-version=1.4 lv2 || echo no), no)
$(error "LV2 SDK needs to be version 1.4 or later")
endif
ifneq ($(shell pkg-config --exists sndfile samplerate\
ifneq ($(shell $(PKG_CONFIG) --exists sndfile samplerate\
&& echo yes), yes)
$(error "libsndfile and libsamplerate are required")
endif
CLV2UI=
ifneq ($(BUILDGTK), no)
ifeq ($(shell pkg-config --exists glib-2.0 gtk+-2.0 || echo no), no)
ifeq ($(shell $(PKG_CONFIG) --exists glib-2.0 gtk+-2.0 || echo no), no)
$(warning "The optional plugin GUI requires glib-2.0 and gtk+-2.0")
$(warning "call make BUILDGTK=no to disable the GUI.")
$(error "Aborting build.")
......@@ -77,17 +84,16 @@ endif
# add library dependent flags and libs
override CXXFLAGS +=-fPIC
override CXXFLAGS +=`pkg-config --cflags glib-2.0 lv2 sndfile samplerate`
override LOADLIBES +=`pkg-config --libs sndfile samplerate` -lm
override CXXFLAGS +=`$(PKG_CONFIG) --cflags glib-2.0 lv2 sndfile samplerate`
override LOADLIBES +=`$(PKG_CONFIG) --libs sndfile samplerate` -lm
ifeq ($(shell pkg-config --atleast-version=1.8.1 lv2 && echo yes), yes)
ifeq ($(shell $(PKG_CONFIG) --atleast-version=1.8.1 lv2 && echo yes), yes)
override CXXFLAGS += -DHAVE_LV2_1_8
endif
GTKCFLAGS = `pkg-config --cflags gtk+-2.0`
GTKLIBS = `pkg-config --libs gtk+-2.0`
GTKCFLAGS = `$(PKG_CONFIG) --cflags gtk+-2.0`
GTKLIBS = `$(PKG_CONFIG) --libs gtk+-2.0`
targets+= $(BUILDDIR)$(LV2NAME)$(LIB_EXT)
......@@ -125,6 +131,7 @@ ifneq ($(BUILDGTK), no)
endif
$(BUILDDIR)$(LV2NAME)$(LIB_EXT): lv2.c convolution.cc uris.h
@mkdir -p $(BUILDDIR)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) \
-o $(BUILDDIR)$(LV2NAME)$(LIB_EXT) lv2.c convolution.cc \
$(LIBZITACONVOLVER) \
......
......@@ -320,11 +320,6 @@ int clv_initialize (
clv->fragment_size = buffersize;
if (zita_convolver_major_version () != ZITA_CONVOLVER_MAJOR_VERSION) {
fprintf (stderr, "convoLV2: Zita-convolver version does not match.\n");
return -1;
}
if (clv->convproc) {
fprintf (stderr, "convoLV2: already initialized.\n");
return (-1);
......
......@@ -460,7 +460,9 @@ save(LV2_Handle instance,
}
}
if (map_path) {
if (!map_path) {
return LV2_STATE_ERR_NO_FEATURE;
} else {
char fn[1024]; // PATH_MAX
if (clv_query_setting(self->clv_online, "convolution.ir.file", fn, 1024) > 0 ) {
char* apath = map_path->abstract_path(map_path->handle, fn);
......@@ -468,7 +470,9 @@ save(LV2_Handle instance,
apath, strlen(apath) + 1,
self->uris.atom_Path,
LV2_STATE_IS_POD | LV2_STATE_IS_PORTABLE);
#ifndef _WIN32 // https://github.com/drobilla/lilv/issues/14
free(apath);
#endif
}
}
return LV2_STATE_SUCCESS;
......@@ -490,11 +494,18 @@ restore(LV2_Handle instance,
support), but fall back to instantiate() schedules (spec-violating
workaround for broken hosts). */
LV2_Worker_Schedule* schedule = self->schedule;
LV2_State_Map_Path* map_path = NULL;
for (int i = 0; features[i]; ++i) {
if (!strcmp(features[i]->URI, LV2_WORKER__schedule)) {
DEBUG_printf("State: using thread-safe restore scheduler\n");
schedule = (LV2_Worker_Schedule*)features[i]->data;
}
if (!strcmp(features[i]->URI, LV2_STATE__mapPath)) {
map_path = (LV2_State_Map_Path*)features[i]->data;
}
}
if (!map_path) {
return LV2_STATE_ERR_NO_FEATURE;
}
if (schedule == self->schedule) {
DEBUG_printf("State: warning: using run() scheduler to restore\n");
......@@ -545,10 +556,14 @@ restore(LV2_Handle instance,
value = retrieve(handle, self->uris.clv2_impulse, &size, &type, &valflags);
if (value) {
const char* path = (const char*)value;
char* path = map_path->absolute_path (map_path->handle, (const char*) value);
DEBUG_printf("PTH: convolution.ir.file=%s\n", path);
clv_configure(self->clv_offline, "convolution.ir.file", path);
#ifndef _WIN32 // https://github.com/drobilla/lilv/issues/14
free (path);
#endif
} else {
ok = false;
}
......
......@@ -4,6 +4,7 @@
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix opts: <http://lv2plug.in/ns/ext/options#> .
@prefix patch: <http://lv2plug.in/ns/ext/patch#> .
@prefix pg: <http://lv2plug.in/ns/ext/port-groups#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
......@@ -36,8 +37,7 @@ clv2:Mono
lv2:microVersion 0 ;
lv2:minorVersion 4 ;
lv2:project <http://gareus.org/oss/lv2/convoLV2> ;
lv2:requiredFeature urid:map ,
work:schedule ;
lv2:requiredFeature bufsz:boundedBlockLength, urid:map, opts:options, work:schedule;
bufsz:minBlockLength 64 ;
bufsz:maxBlockLength 8192 ;
lv2:extensionData work:interface ,
......@@ -96,11 +96,12 @@ clv2:Stereo
lv2:microVersion 0 ;
lv2:minorVersion 4 ;
lv2:project <http://gareus.org/oss/lv2/convoLV2> ;
lv2:requiredFeature urid:map ,
work:schedule ;
lv2:requiredFeature bufsz:boundedBlockLength, urid:map, opts:options, work:schedule;
bufsz:minBlockLength 64 ;
bufsz:maxBlockLength 8192 ;
lv2:extensionData work:interface ,
state:interface ;
lv2:optionalFeature lv2:hardRTCapable ;
lv2:optionalFeature lv2:hardRTCapable, state:threadSafeRestore, bufsz:coarseBlockLength;
@CLV2UI@
patch:writable clv2:impulse ;
lv2:port [
......@@ -170,11 +171,12 @@ clv2:MonoToStereo
lv2:microVersion 0 ;
lv2:minorVersion 4 ;
lv2:project <http://gareus.org/oss/lv2/convoLV2> ;
lv2:requiredFeature urid:map ,
work:schedule ;
lv2:requiredFeature bufsz:boundedBlockLength, urid:map, opts:options, work:schedule;
bufsz:minBlockLength 64 ;
bufsz:maxBlockLength 8192 ;
lv2:extensionData work:interface ,
state:interface ;
lv2:optionalFeature lv2:hardRTCapable ;
lv2:optionalFeature lv2:hardRTCapable, state:threadSafeRestore, bufsz:coarseBlockLength;
@CLV2UI@
patch:writable clv2:impulse ;
lv2:port [
......
This diff is collapsed.
This diff is collapsed.
darc.lv2 - Dynamic Audio Range Compressor
=========================================
darc.lv2 is a general purpose audio signal compressor.
The compression gain is controlled by threshold and ratio only:
Makeup gain is automatically set to retain equal loudness at -10 dBFS/RMS with a soft knee.
This maintains perceived loudness over a wide range of thresholds and ratio settings.
It is available as [LV2 plugin](http://lv2plug.in/) and standalone [JACK](http://jackaudio.org/)-application.
Usage
-----
The Plugin has five 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.
For an elaborate descripton and manual, please see https://x42-plugins.com/x42/x42-compressor
Install
-------
Compiling darc.lv2 requires the LV2 SDK, jack-headers, gnu-make, a c++-compiler,
liblo, libpango, libcairo and openGL (sometimes called: glu, glx, mesa).
```bash
git clone git://github.com/x42/darc.lv2.git
cd darc.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/darc.lv2/master/img/darc.png "DARC LV2 GUI")
Credits
-------
darc.lv2 was inspired by Fons Adriaensen's zita-dc1-0.3.3.
###############################################################################
# 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@ ;
opts:supportedOption <http://lv2plug.in/ns/extensions/ui#scaleFactor> ;
lv2:optionalFeature opts:options ;
@UI_REQ@
lv2:requiredFeature urid:map ;
.
a lv2:AudioPort ,
lv2:InputPort ;
lv2:index 10 ;
lv2:symbol "in" ;
lv2:name "In"
] , [
a lv2:AudioPort ,
lv2:OutputPort ;
lv2:index 11 ;
lv2:symbol "out" ;
lv2:name "Out"
]
.
@LV2NAME@:@URISUFFIX@
a lv2:Plugin, doap:Project, lv2:CompressorPlugin;
doap:license <http://usefulinc.com/doap/licenses/gpl> ;
doap:maintainer <http://gareus.org/rgareus#me> ;
@VERSION@
doap:name "x42-comp - Dynamic Compressor@NAMESUFFIX@";
lv2:extensionData idpy:interface @SIGNATURE@;
lv2:optionalFeature lv2:hardRTCapable, idpy:queue_draw;
@UITTL@
lv2:port [
a lv2:InputPort ,
lv2:ControlPort ;
lv2:index 0 ;
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 1 ;
lv2:symbol "hold" ;
lv2:name "Hold";
lv2:default 0 ;
lv2:minimum 0 ;
lv2:maximum 1 ;
lv2:portProperty lv2:integer, lv2:toggled;
lv2:designation lv2:enabled;
] , [
a lv2:InputPort ,
lv2:ControlPort ;
lv2:index 2 ;
lv2:symbol "inputgain" ;
lv2:name "Input Gain" ;
lv2:default 0.0 ;
lv2:minimum -10.0 ;
lv2:maximum 30.0;
pprop:rangeSteps 81;
units:unit units:db ;
] , [
a lv2:InputPort ,
lv2:ControlPort ;
lv2:index 3 ;
lv2:symbol "threshold" ;
lv2:name "Threshold" ;
lv2:default -30.0 ;
lv2:minimum -50.0 ;
lv2:maximum -10.0;
pprop:rangeSteps 81;