diff -Nru abgate-1.1.6/abgate.patch abgate-1.1.7/abgate.patch --- abgate-1.1.6/abgate.patch 1970-01-01 00:00:00.000000000 +0000 +++ abgate-1.1.7/abgate.patch 2014-01-13 08:39:57.000000000 +0000 @@ -0,0 +1,150 @@ +--- abgate-1.1.6/gate.cpp.orig 2011-02-15 12:16:02.000000000 +0100 ++++ abgate-1.1.6/gate.cpp 2014-01-01 14:46:16.000000000 +0100 +@@ -35,18 +35,16 @@ + state = CLOSED; + gate = 0; + holding = 0; +- input_db = 0; + } +- virtual ~Gate(); ++ ~Gate() {} + +- bool bypass; +- float *switch_button, *threshold, *attack, *hold, *decay, *range, input_db, sample_rate, gate, range_coef, attack_coef, decay_coef, *output; ++ float *switch_button, *threshold, *attack, *hold, *decay, *range, sample_rate, gate, *output; + const float *input; + int state, holding; + }; + + static LV2_Handle instantiateGate(const _LV2_Descriptor *descriptor, double s_rate, const char *path, const LV2_Feature * const* features) { +- Gate *plugin_data = (Gate *)malloc(sizeof(Gate)); ++ Gate *plugin_data = new Gate; + plugin_data->sample_rate = s_rate; + return (LV2_Handle)plugin_data; + } +@@ -94,8 +92,8 @@ + switch_button = switch_button < 0 ? 0 : switch_button; + switch_button = switch_button > 1 ? 1 : switch_button; + +- bool bypass = switch_button > 0 ? true : false; +- if (bypass != false) { ++ bool active = switch_button > 0; ++ if (active) { + + // Getting port values + const float threshold = *(plugin_data->threshold); +@@ -104,65 +102,84 @@ + const float decay = *(plugin_data->decay); + const float range = *(plugin_data->range); + +- float sample_rate = plugin_data->sample_rate; ++ const float sample_rate = plugin_data->sample_rate; ++ ++ const float threshold_value = pow(10, threshold * 0.05); ++ const float attack_coef = 1000 / (attack * sample_rate); ++ const int hold_samples = round(hold * sample_rate * 0.001); ++ const float decay_coef = 1000 / (decay * sample_rate); ++ const float range_coef = range > -90 ? pow(10, range * 0.05) : 0; ++ + int state = plugin_data->state; + float gate = plugin_data->gate; + int holding = plugin_data->holding; +- float input_db = plugin_data->input_db; + +- float range_coef = range > -90 ? pow(10, range * 0.05) : 0; +- float attack_coef = 1000 / (attack * sample_rate); +- float decay_coef = 1000 / (decay * sample_rate); +- + for (uint32_t i = 0; i < sample_count; ++i) { + + // Counting input dB +- input_db = 20 * log10(fabs(input[i])); ++ float sample = input[i]; ++ float abs_sample = fabs(sample); ++ + switch (state){ + case CLOSED: +- if (input_db >= threshold) { state = ATTACK; } ++ case DECAY: ++ if (abs_sample >= threshold_value) { state = ATTACK; } + break; + case ATTACK: +- // attacking :) ++ break; ++ case OPENED: ++ if (abs_sample >= threshold_value) { holding = hold_samples; } ++ else if (holding <= 0) { state = DECAY; } ++ else { holding--; } ++ break; ++ default: ++ // shouldn't happen ++ state = CLOSED; ++ } ++ ++ // handle attack/decay in a second pass to avoid unnecessary one-sample delay ++ switch (state){ ++ case CLOSED: ++ output[i] = sample * range_coef; ++ break; ++ case DECAY: ++ gate -= decay_coef; ++ if (gate <= 0) { ++ gate = 0; ++ state = CLOSED; ++ } ++ output[i] = sample * (range_coef * (1 - gate) + gate); ++ break; ++ case ATTACK: + gate += attack_coef; + if (gate >= 1) { + gate = 1; + state = OPENED; +- holding = round(hold * sample_rate * 0.001); ++ holding = hold_samples; + } ++ output[i] = sample * (range_coef * (1 - gate) + gate); + break; +- case OPENED: +- if (holding <= 0) { +- if (input_db < threshold) { state = DECAY; } +- } +- else { holding--; } +- break; +- case DECAY: +- gate -= decay_coef; +- if (input_db >= threshold) { state = ATTACK; } +- else if (gate <= 0) { +- gate = 0; +- state = CLOSED; +- } ++ case OPENED: ++ output[i] = sample; + break; +- default: +- state = CLOSED; + } +- output[i] = input[i] * (range_coef * (1 - gate) + gate); +- } +- plugin_data->input_db = input_db; ++ } ++ + plugin_data->gate = gate; + plugin_data->state = state; + plugin_data->holding = holding; + } + else { + // Bypassing +- for (uint32_t i = 0; i < sample_count; ++i) { output[i] = input[i]; } ++ if (output != input) { ++ for (uint32_t i = 0; i < sample_count; ++i) { output[i] = input[i]; } ++ } + } + } + + static void cleanupGate(LV2_Handle instance) { +- free(instance); ++ Gate *plugin_data = (Gate *)instance; ++ delete plugin_data; + } + + static void init() { diff -Nru abgate-1.1.6/ChangeLog abgate-1.1.7/ChangeLog --- abgate-1.1.6/ChangeLog 2012-04-21 05:34:35.000000000 +0000 +++ abgate-1.1.7/ChangeLog 2014-01-13 08:49:14.000000000 +0000 @@ -1,5 +1,8 @@ abGate +Version 1.1.7 - 2014-01-13 11:00 UTC+02 + * Bugfixes and performance improvement by Sebastian Reichelt + Version 1.1.6 - 2012-04-21 09:00 UTC+02 * updated Makefile and ttl files @@ -30,4 +33,4 @@ * added plugin_configuration.h file for easier png files management when changing the default directory Version 1.0 - 2011-01-26 - initial public release + * initial public release diff -Nru abgate-1.1.6/debian/changelog abgate-1.1.7/debian/changelog --- abgate-1.1.6/debian/changelog 2012-05-14 16:19:54.000000000 +0000 +++ abgate-1.1.7/debian/changelog 2014-02-14 09:16:48.000000000 +0000 @@ -1,3 +1,13 @@ +abgate (1.1.7-1) unstable; urgency=low + + * New upstream release. + * Bump Standards. + * Set dh/compat 9. + * Patch refreshed. + * Update VCS urls. + + -- Jaromír Mikeš Sat, 01 Feb 2014 21:44:38 +0100 + abgate (1.1.6-1) unstable; urgency=low * New upstream release. diff -Nru abgate-1.1.6/debian/compat abgate-1.1.7/debian/compat --- abgate-1.1.6/debian/compat 2012-05-14 15:52:14.000000000 +0000 +++ abgate-1.1.7/debian/compat 2014-02-14 09:13:07.000000000 +0000 @@ -1 +1 @@ -7 +9 diff -Nru abgate-1.1.6/debian/control abgate-1.1.7/debian/control --- abgate-1.1.6/debian/control 2012-05-14 16:18:05.000000000 +0000 +++ abgate-1.1.7/debian/control 2014-02-14 09:13:07.000000000 +0000 @@ -3,17 +3,18 @@ Section: sound Maintainer: Debian Multimedia Maintainers Uploaders: - Alessio Treglia + Alessio Treglia , + Jaromír Mikeš Build-Depends: - debhelper (>= 7), + debhelper (>= 9), libgtkmm-2.4-dev, libqt4-dev, lv2-dev, pkg-config, qt4-dev-tools -Standards-Version: 3.9.3 -Vcs-Git: git://git.debian.org/pkg-multimedia/abgate.git -Vcs-Browser: http://git.debian.org/?p=pkg-multimedia/abgate.git +Standards-Version: 3.9.5 +Vcs-Git: git://anonscm.debian.org/pkg-multimedia/abgate.git +Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-multimedia/abgate.git Homepage: http://abgate.sourceforge.net Package: abgate diff -Nru abgate-1.1.6/debian/patches/0001-lv2core_to_lv2.patch abgate-1.1.7/debian/patches/0001-lv2core_to_lv2.patch --- abgate-1.1.6/debian/patches/0001-lv2core_to_lv2.patch 2012-05-14 15:54:19.000000000 +0000 +++ abgate-1.1.7/debian/patches/0001-lv2core_to_lv2.patch 2014-02-14 09:13:07.000000000 +0000 @@ -1,14 +1,16 @@ Description: Port to LV2's new release. Author: Alessio Treglia -Forwarded: no +Forwarded: Antanas Bružas --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---- abgate.orig/Makefile -+++ abgate/Makefile -@@ -13,10 +13,10 @@ abGateQt/libabGateQt.so: - cd abGateQt; qmake; make +Index: abgate/Makefile +=================================================================== +--- abgate.orig/Makefile 2014-02-01 21:48:06.998316241 +0100 ++++ abgate/Makefile 2014-02-01 21:48:06.994316226 +0100 +@@ -13,10 +13,10 @@ + cd abGateQt; qmake-qt4; make gate.so: gate.cpp - g++ $(LDFLAGS) -O3 -shared -fPIC -DPIC gate.cpp `pkg-config --cflags --libs lv2core` -o gate.so diff -Nru abgate-1.1.6/gate.cpp abgate-1.1.7/gate.cpp --- abgate-1.1.6/gate.cpp 2011-02-15 11:16:02.000000000 +0000 +++ abgate-1.1.7/gate.cpp 2014-01-13 09:30:53.000000000 +0000 @@ -35,18 +35,16 @@ state = CLOSED; gate = 0; holding = 0; - input_db = 0; } - virtual ~Gate(); + ~Gate() {} - bool bypass; - float *switch_button, *threshold, *attack, *hold, *decay, *range, input_db, sample_rate, gate, range_coef, attack_coef, decay_coef, *output; + float *switch_button, *threshold, *attack, *hold, *decay, *range, sample_rate, gate, *output; const float *input; int state, holding; }; static LV2_Handle instantiateGate(const _LV2_Descriptor *descriptor, double s_rate, const char *path, const LV2_Feature * const* features) { - Gate *plugin_data = (Gate *)malloc(sizeof(Gate)); + Gate *plugin_data = new Gate; plugin_data->sample_rate = s_rate; return (LV2_Handle)plugin_data; } @@ -94,8 +92,8 @@ switch_button = switch_button < 0 ? 0 : switch_button; switch_button = switch_button > 1 ? 1 : switch_button; - bool bypass = switch_button > 0 ? true : false; - if (bypass != false) { + bool active = switch_button > 0; + if (active) { // Getting port values const float threshold = *(plugin_data->threshold); @@ -104,65 +102,84 @@ const float decay = *(plugin_data->decay); const float range = *(plugin_data->range); - float sample_rate = plugin_data->sample_rate; + const float sample_rate = plugin_data->sample_rate; + + const float threshold_value = pow(10, threshold * 0.05); + const float attack_coef = 1000 / (attack * sample_rate); + const int hold_samples = round(hold * sample_rate * 0.001); + const float decay_coef = 1000 / (decay * sample_rate); + const float range_coef = range > -90 ? pow(10, range * 0.05) : 0; + int state = plugin_data->state; float gate = plugin_data->gate; int holding = plugin_data->holding; - float input_db = plugin_data->input_db; - float range_coef = range > -90 ? pow(10, range * 0.05) : 0; - float attack_coef = 1000 / (attack * sample_rate); - float decay_coef = 1000 / (decay * sample_rate); - for (uint32_t i = 0; i < sample_count; ++i) { // Counting input dB - input_db = 20 * log10(fabs(input[i])); + float sample = input[i]; + float abs_sample = fabs(sample); + switch (state){ case CLOSED: - if (input_db >= threshold) { state = ATTACK; } + case DECAY: + if (abs_sample >= threshold_value) { state = ATTACK; } break; case ATTACK: - // attacking :) + break; + case OPENED: + if (abs_sample >= threshold_value) { holding = hold_samples; } + else if (holding <= 0) { state = DECAY; } + else { holding--; } + break; + default: + // shouldn't happen + state = CLOSED; + } + + // handle attack/decay in a second pass to avoid unnecessary one-sample delay + switch (state){ + case CLOSED: + output[i] = sample * range_coef; + break; + case DECAY: + gate -= decay_coef; + if (gate <= 0) { + gate = 0; + state = CLOSED; + } + output[i] = sample * (range_coef * (1 - gate) + gate); + break; + case ATTACK: gate += attack_coef; if (gate >= 1) { gate = 1; state = OPENED; - holding = round(hold * sample_rate * 0.001); + holding = hold_samples; } + output[i] = sample * (range_coef * (1 - gate) + gate); break; - case OPENED: - if (holding <= 0) { - if (input_db < threshold) { state = DECAY; } - } - else { holding--; } - break; - case DECAY: - gate -= decay_coef; - if (input_db >= threshold) { state = ATTACK; } - else if (gate <= 0) { - gate = 0; - state = CLOSED; - } + case OPENED: + output[i] = sample; break; - default: - state = CLOSED; } - output[i] = input[i] * (range_coef * (1 - gate) + gate); - } - plugin_data->input_db = input_db; + } + plugin_data->gate = gate; plugin_data->state = state; plugin_data->holding = holding; } else { // Bypassing - for (uint32_t i = 0; i < sample_count; ++i) { output[i] = input[i]; } + if (output != input) { + for (uint32_t i = 0; i < sample_count; ++i) { output[i] = input[i]; } + } } } static void cleanupGate(LV2_Handle instance) { - free(instance); + Gate *plugin_data = (Gate *)instance; + delete plugin_data; } static void init() { diff -Nru abgate-1.1.6/main_window.h abgate-1.1.7/main_window.h --- abgate-1.1.6/main_window.h 2011-02-15 11:57:58.000000000 +0000 +++ abgate-1.1.7/main_window.h 2014-01-13 10:31:59.000000000 +0000 @@ -108,6 +108,4 @@ //----------------------- preset_widget *m_presets; //----------------------- - - // Pažiūrėti ką galima įdėti į protected vėliau }; diff -Nru abgate-1.1.6/Makefile abgate-1.1.7/Makefile --- abgate-1.1.6/Makefile 2012-04-21 05:04:43.000000000 +0000 +++ abgate-1.1.7/Makefile 2014-01-13 09:17:05.000000000 +0000 @@ -10,7 +10,7 @@ cp $^ $(BUNDLE) abGateQt/libabGateQt.so: - cd abGateQt; qmake; make + cd abGateQt; qmake-qt4; make gate.so: gate.cpp g++ $(LDFLAGS) -O3 -shared -fPIC -DPIC gate.cpp `pkg-config --cflags --libs lv2core` -o gate.so diff -Nru abgate-1.1.6/README abgate-1.1.7/README --- abgate-1.1.6/README 2012-04-21 05:35:01.000000000 +0000 +++ abgate-1.1.7/README 2014-01-13 11:11:15.000000000 +0000 @@ -1,17 +1,10 @@ ======================== - abGate LV2 Plugin v1.1.6 + abGate LV2 Plugin v1.1.7 ======================== abGate is LV2 noise gate plugin for Linux. -Features: - - * Qt4 GUI - * Presets - * Automation works with all controls - * User interface works with Gtk+ Hosts (tested with Ardour 2.8.11) - Newest version of the plugin can be downloaded from http://abgate.sf.net @@ -20,14 +13,13 @@ abGate plugin will be installed into /usr/lib/lv2 by default If you want to change the installation path, edit Makefile and plugin_configuration.h files -You can install abGate from AutoStatic's PPA if you are using Ubuntu: https://launchpad.net/~autostatic/+archive/ppa/ - Before installing the plugin from source check if you have all of the required libraries: - gcc compiler - pkg-config - gtkmm >= 2.4 - lv2core + - qmake To install the plugin, go to abGate folder in the terminal and type: