CAPS: updated to version 0.4.3

Updated CAPS plugins to version 0.4.3 - changes:

  * basics.h cleanup / comments
  * minor Makefile cleanup
  * comment cosmetics
  * Eq and Eq2x2 per-band Q changed to 1.414 (= 1 octave)
  * Eq lowest band default value fixed to read 0
  * Niclas' fix for the bessel function implemented
  * uninitialised plugin states eliminated thanks to Damon
  * linker options for OSX added to the Makefile

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
(cherry picked from commit e0df82056c)
This commit is contained in:
Tobias Doerffel
2009-08-03 17:29:24 +02:00
parent 7bddad1895
commit 6d6bbe3b32
13 changed files with 87 additions and 46 deletions

View File

@@ -1,7 +1,7 @@
/*
Amp.h
Copyright 2002-7 Tim Goetze <tim@quitte.de>
Copyright 2002-9 Tim Goetze <tim@quitte.de>
http://quitte.de/dsp/
@@ -310,6 +310,8 @@ class AmpV
cut = 2;
supply = 0.;
tone = -1; /* causes initialisation of the filter at first cycle */
}
void run (int n)

View File

@@ -6,15 +6,7 @@ IF(LMMS_BUILD_WIN64)
ADD_DEFINITIONS(-DLMMS_BUILD_WIN64)
ENDIF(LMMS_BUILD_WIN64)
SET_TARGET_PROPERTIES(caps PROPERTIES PREFIX "")
EXEC_PROGRAM(${CMAKE_C_COMPILER} ARGS --version OUTPUT_VARIABLE _gcc_version_info)
STRING(REGEX MATCH "4\\.1\\.[0-9]" _gcc_is_4_1_x "${_gcc_version_info}")
STRING(LENGTH "${_gcc_is_4_1_x}" NO_O3)
IF(NO_O3)
MESSAGE("Found GCC 4.1.x - compiling CAPS-plugins with -O2 instead of -O3")
SET_TARGET_PROPERTIES(caps PROPERTIES COMPILE_FLAGS "-Wno-write-strings")
ELSE(NO_O3)
SET_TARGET_PROPERTIES(caps PROPERTIES COMPILE_FLAGS "-O3 -Wno-write-strings")
ENDIF(NO_O3)
SET_TARGET_PROPERTIES(caps PROPERTIES COMPILE_FLAGS "-O2 -funroll-loops -Wno-write-strings")
IF(LMMS_BUILD_WIN32)
ADD_CUSTOM_COMMAND(TARGET caps POST_BUILD COMMAND ${STRIP} ${CMAKE_CURRENT_BINARY_DIR}/caps.dll)

View File

@@ -63,6 +63,18 @@ CabinetII::models44100 [] = {
{0.0, 0.618938053184, 0.180052941443, -0.1028119852, -0.19233134457, -0.14303971742, -0.0450998045919, 0.0341843500162, 0.0465086637485, 0.0071435730282, -0.0461779135605, -0.059013077843, -0.0284397368519, 0.0187689538251, 0.0341298347311, 0.0244703904826, 0.00720524642447, 0.00991307420138, 0.018738094495, 0.0275442994126, 0.0299092523536, 0.0339721143791, 0.0270175082759, 0.0151058732685, -0.00751060215331, -0.0236467101096, -0.0272347092017, -0.00812409176413, 0.0141531255726, 0.0270163512016, 0.00208457244433, -0.0784208903527},
0.1132
},
{
32, /* mesa */
{0.462494284717, 0.393585742058, 0.303328992303, 0.181503108654, 0.0629173541037, -0.020681232006, -0.0571885284376, -0.0467796891544, -0.0276756897046, -0.00892844543715, 0.00204563746045, 0.0115134879366, 0.00106846505647, -0.0149439761237, -0.0330954690659, -0.0337794782369, -0.0276991983671, -0.0190072253549, -0.0324525139664, -0.0630355306227, -0.0999209480709, -0.111933999507, -0.110645947594, -0.092891889065, -0.0692697576821, -0.0450776510962, -0.0392851148349, -0.035324392499, -0.035403719608, -0.0376283525137, -0.0612971281858, -0.0900100571873},
{0.0, 0.56035020932, 0.29343466934, 0.0772363317707, -0.0530744622425, -0.0885361452358, -0.0589180077997, -0.00257855932105, 0.0334935643243, 0.0442328268628, 0.0294583386742, 0.00717959220156, -0.0175320543891, -0.0208128084726, -0.00373790944406, 0.0334761867029, 0.0627006023834, 0.0700861323961, 0.0416727224516, -0.000637024095321, -0.0357094622237, -0.0404012923223, -0.0285442599547, -0.00354190734239, 0.0184796761008, 0.0306524756002, 0.0181509660649, -0.00687913029057, -0.0393242377083, -0.0550286859069, -0.0375235630652, 0.0471541139774},
0.2500
},
{
32, /* pro_jr */
{0.734249445521, 0.491537503216, 0.337459965314, 0.176462147927, 0.0276390917692, -0.0644515999868, -0.0972401016684, -0.0803985996088, -0.0428685363211, -0.0140919517701, -0.0337409328059, -0.0478897322188, -0.0362288411405, -0.0130597902066, -0.00582049410513, 0.0022469159791, -0.00964075940401, -0.0380828738621, -0.0763568061844, -0.089961400489, -0.0952731732008, -0.0895604973654, -0.101346765163, -0.119569610891, -0.128233125318, -0.109253322153, -0.0821678710293, -0.041620049917, -0.0245690004857, -0.0219634796685, -0.0419014341928, -0.0651369005252},
{0.0, 0.663188793345, 0.270439727768, 0.0190336508265, -0.0946822703696, -0.0888520332756, -0.0267575060227, 0.03588910806, 0.0599594346375, 0.041850528867, -0.00632721029526, -0.0244115687714, -0.0103162286821, 0.0119858957112, 0.0197992179523, 0.0238625339809, 0.0142267453341, 0.00296440492823, -0.00543873217766, -0.00014858213959, -0.00196572770138, -0.00750279035903, -0.0243069229182, -0.0285801812939, -0.0100437887585, 0.0259127459737, 0.0475587872734, 0.0497287926166, 0.0189008750066, -0.0156259358581, -0.0395277285226, -0.0325403937133},
0.2500
},
};
Model32
@@ -103,6 +115,18 @@ CabinetII::models48000 [] = {
{0.0, 0.594136919296, 0.201493775156, -0.0716153113375, -0.180702317671, -0.160390621032, -0.0826806167453, 0.000697581661664, 0.0397029332137, 0.0299147550153, -0.0177304803895, -0.0570701545448, -0.0652412298089, -0.0298128518083, 0.0124560081161, 0.0355161884622, 0.0255626596849, 0.00762986123778, -0.00431800264305, 0.00420452150537, 0.0150803653129, 0.0291131391488, 0.0359312991789, 0.0364212054952, 0.0203516393338, 0.0022141464642, -0.0149317465975, -0.0121651677123, 0.00704936522966, 0.0353605810957, 0.0322793623201, -0.0307481566657},
0.0996
},
{
32, /* mesa */
{0.495930895017, 0.376476419856, 0.303586589503, 0.197845120631, 0.0899987258287, 0.00535662962566, -0.0475751298521, -0.0519576953746, -0.0376515865627, -0.0168652310379, -0.00508935920432, 0.00888673824726, 0.0109356809664, 0.00654236486877, -0.0122417367265, -0.0265484743045, -0.0339837870474, -0.0233241554396, -0.0127914848925, -0.00515836827508, -0.0209864779144, -0.0475368628257, -0.0782299905969, -0.0909360283527, -0.0983527406681, -0.0938199589393, -0.0898861541372, -0.0810532718198, -0.0815503996776, -0.0796236089322, -0.0749972587191, -0.0599151413182},
{0.0, 0.534078389658, 0.294930996327, 0.0991032789063, -0.0272295349878, -0.0770236019127, -0.0705005212384, -0.0257307535864, 0.0146092582685, 0.0379865150974, 0.0359872042115, 0.0230902724993, -0.000725294921074, -0.0174606095957, -0.0236682462783, -0.00669570447944, 0.021362472642, 0.0512331674592, 0.0584309807453, 0.044407663655, 0.00900197651083, -0.0217065441135, -0.037007819832, -0.0257650758221, -0.00590170187955, 0.0194528583388, 0.0320489572473, 0.030386820278, 0.00581345215134, -0.02347217653, -0.0472400829369, -0.0430772235107},
0.2500
},
{
32, /* pro_jr */
{0.767221028694, 0.44461349725, 0.324943328323, 0.187583401624, 0.0585707039826, -0.036895934974, -0.0893306767021, -0.0935390488322, -0.0758668196298, -0.0408583447944, -0.0309741335777, -0.0417509830741, -0.0550681782871, -0.0417048932451, -0.0295194484972, -0.0177059350466, -0.0189517349534, -0.0180093708399, -0.0336546809637, -0.0511188019942, -0.0648908298083, -0.0619349722444, -0.058573104994, -0.0470621645996, -0.0597723312001, -0.0855574645731, -0.109611426273, -0.113648127167, -0.112000636381, -0.0909222239483, -0.0727424833493, -0.0362189061166},
{0.0, 0.62970643913, 0.293410547935, 0.0578415012725, -0.0672697168081, -0.094466063484, -0.0596589574295, 0.000648321788151, 0.0432524054305, 0.0596811813862, 0.0366985835211, 0.0035102339371, -0.0156226319473, -0.00793362884142, 0.00010974226424, 0.00946937446156, 0.012432810986, 0.0166353982569, 0.00885441580212, 0.00176491241101, -0.00465797946213, -0.00706780418692, -0.0169292031721, -0.0217285491491, -0.0298358684941, -0.0214136482558, 0.00603804801211, 0.0432427970473, 0.0585065590431, 0.0472784452715, -0.00622503195681, -0.0778508047032},
0.2500
},
};
Model32
@@ -143,6 +167,18 @@ CabinetII::models88200 [] = {
{0.0, 0.51943795847, 0.326729354403, 0.149229797985, 0.0109767104297, -0.0732768493116, -0.111088974509, -0.110789539541, -0.0898934114003, -0.0564578047856, -0.0231004313356, 0.0069673688738, 0.0254240918116, 0.0337510299271, 0.0282514883492, 0.0147089116391, -0.00647743824673, -0.0269028751263, -0.0446349197143, -0.0510564142456, -0.0478791675617, -0.0324832722564, -0.0121393859238, 0.0104982033447, 0.0241412382054, 0.026038551433, 0.00994372364326, -0.0158545375622, -0.0436236854665, -0.0537883431888, -0.032574614307, 0.0387767610956},
0.0666
},
{
32, /* mesa */
{0.800744790951, 0.174351736281, 0.162047205857, 0.138794638546, 0.105850412073, 0.0723656260485, 0.0365740092219, 0.00431957094182, -0.0274260159266, -0.052813754463, -0.0747002681782, -0.0875980404567, -0.0959206315285, -0.0964326627017, -0.0951211930444, -0.0890916136798, -0.0839336477818, -0.0759587618493, -0.0699911420952, -0.0618103150195, -0.0562569921852, -0.0497246788081, -0.0474425366429, -0.045118852226, -0.0466084665482, -0.0466183009403, -0.048518031551, -0.0465434705359, -0.0436608634155, -0.0338725172886, -0.0202008830722, 0.0028064387038},
{0.0, 0.348283848037, 0.278266186344, 0.208315992656, 0.142238507639, 0.0877418515218, 0.0426721771028, 0.0101211230173, -0.0142620082039, -0.0279206093939, -0.0353541175487, -0.0344380562925, -0.030780249931, -0.0230674032021, -0.016830370528, -0.00961683532214, -0.00530786189015, -0.000225073976316, 0.00276994164541, 0.00775476255757, 0.0114020240885, 0.0168731013913, 0.0203623771917, 0.0249313385656, 0.0267810408235, 0.0287888955038, 0.026286558388, 0.0210452426156, 0.00782753651909, -0.0119982689793, -0.0444362907999, -0.0880582917654},
0.2500
},
{
32, /* pro_jr */
{0.909835294941, 0.237116967883, 0.220493213781, 0.188296175986, 0.145804855731, 0.1035213914, 0.0593519550104, 0.018535542445, -0.0211984146917, -0.0519769598497, -0.0754321013216, -0.0869433378891, -0.0920887014799, -0.087865027182, -0.0792907797887, -0.0637463287733, -0.0482713945314, -0.0325419993651, -0.0236382913314, -0.0187673840883, -0.0211003792763, -0.0242608362201, -0.0299312006336, -0.032972160693, -0.038384284548, -0.0433373155719, -0.0522438990617, -0.0598215574684, -0.0680342990137, -0.0706075753658, -0.0696540637908, -0.0592163425206},
{0.0, 0.437589362895, 0.316542061632, 0.204591087565, 0.109610647885, 0.0395709089276, -0.0101168883103, -0.0392507441308, -0.0536854447628, -0.0525994961208, -0.0429181531663, -0.0263178649123, -0.0108114446263, 0.00361113168474, 0.0124368978113, 0.0183164472387, 0.0173632458965, 0.0133080282174, 0.00451776800884, -0.0027292732446, -0.0084152300302, -0.00649797485834, 0.000343904158769, 0.0135853277076, 0.0260015642816, 0.0368350330248, 0.0397116093504, 0.035854103932, 0.0201173890247, -0.00598389310382, -0.0479894271495, -0.10412912505},
0.2500
},
};
Model32
@@ -183,5 +219,17 @@ CabinetII::models96000 [] = {
{0.0, 0.495552580909, 0.326384725738, 0.167649233033, 0.0373913746446, -0.049802990613, -0.0971841927371, -0.108389008817, -0.0971430950292, -0.0702481334571, -0.0402478232447, -0.00995144228925, 0.0120995492915, 0.0263638891687, 0.0284733804008, 0.0226883648689, 0.00733748451124, -0.0103570201666, -0.0304762029918, -0.0447374261541, -0.0534169560389, -0.0509721172171, -0.0411315716449, -0.0225994268992, -0.00306083571223, 0.0162408742504, 0.0258967736277, 0.0250750690024, 0.00862389563333, -0.0164131934788, -0.0455336929843, -0.0629205840552},
0.0663
},
{
32, /* mesa */
{0.816556812848, 0.150293117891, 0.141795487793, 0.124839522537, 0.099196755702, 0.0723627786971, 0.0428519140057, 0.0161310830227, -0.0110923701697, -0.034007587359, -0.0554568663798, -0.070468417213, -0.0823376819593, -0.0871844200317, -0.0898440433576, -0.0874713568897, -0.0851052646307, -0.0795934648554, -0.075427699709, -0.0687589148326, -0.0639930873009, -0.0572185996408, -0.0529180674694, -0.0475806410473, -0.0456514163291, -0.0429752541034, -0.0432519558816, -0.0416267292155, -0.0408422393067, -0.0352236824279, -0.0269876908459, -0.0103181623672},
{0.0, 0.324884890574, 0.268628249933, 0.210962607294, 0.15379956812, 0.104238396719, 0.0608732030517, 0.0272239220101, -0.000475953058616, -0.019347999351, -0.0332735025431, -0.039418716712, -0.0418327023679, -0.0385575041649, -0.0342524288567, -0.0267537524134, -0.0202714386094, -0.0115967221036, -0.00421419915726, 0.0052675530631, 0.0133773574491, 0.0230906449798, 0.0303465968119, 0.0374618799867, 0.0402738707573, 0.0409671902591, 0.0352080031286, 0.0253938319794, 0.0070273986645, -0.0175302180141, -0.0528396401673, -0.0967034944448},
0.2500
},
{
32, /* pro_jr */
{0.925365759135, 0.205121186223, 0.193282167511, 0.170964672217, 0.139026712618, 0.10615970874, 0.0712170483592, 0.0387785989803, 0.00565122246474, -0.022529589284, -0.0474765753603, -0.0638195347354, -0.0750789855745, -0.0781013105481, -0.0774023301337, -0.0698851353181, -0.0601759362765, -0.0460666153988, -0.033417255906, -0.0207620686126, -0.0136627961657, -0.008873845834, -0.00924040700271, -0.00959897299234, -0.0122760927684, -0.0134131792383, -0.0169861222268, -0.0197237904964, -0.0247929394164, -0.0274056341581, -0.0290372582108, -0.0230858292646},
{0.0, 0.384047660947, 0.296120799911, 0.212432468703, 0.136561707438, 0.0758675413252, 0.0277844248084, -0.00596868040294, -0.0302987351926, -0.0432929213814, -0.0490562834943, -0.0462652470517, -0.0403753213236, -0.030690892845, -0.022025662253, -0.0121577019191, -0.00457323646437, 0.00324370289428, 0.00777535572758, 0.0119010287281, 0.0130997070818, 0.0155933691883, 0.0177344547654, 0.023362610354, 0.028693981754, 0.0347549373256, 0.0352150834795, 0.0303066390313, 0.0145055938776, -0.0110543984149, -0.0508137742561, -0.102480420772},
0.2500
},
};

View File

@@ -205,9 +205,6 @@ CabinetII::init()
void
CabinetII::switch_model (int m)
{
if (m < 0) m = 0;
else if (m > 5) m = 5;
model = m;
n = models[m].n;
@@ -276,7 +273,7 @@ CabinetII::port_info [] =
}, {
"model",
INPUT | CONTROL,
{BOUNDED | INTEGER | DEFAULT_1, 0, 5}
{BOUNDED | INTEGER | DEFAULT_1, 0, 7}
}, {
"gain (dB)",
INPUT | CONTROL,

View File

@@ -1,7 +1,7 @@
/*
Descriptor.h
Copyright 2004-6 Tim Goetze <tim@quitte.de>
Copyright 2004-9 Tim Goetze <tim@quitte.de>
http://quitte.de/dsp/
@@ -11,7 +11,7 @@
Descriptor<P> expects P to declare some common methods, like init(),
activate() etc, plus a static port_info[] and LADSPA_Data * ports[]
and adding_gain.
and adding_gain. (P should derive from Plugin, too.)
*/
/*
@@ -48,8 +48,6 @@ class DescriptorStub
: public LADSPA_Descriptor
{
public:
static int thishostsucks;
DescriptorStub()
{
PortCount = 0;
@@ -85,10 +83,6 @@ class Descriptor
: public DescriptorStub
{
public:
/* Tom Szilyagi reports that hosts exist which call activate() before
* connect_port(). Since CAPS' plugins expect ports to be valid we
* need a safeguard: at instantiation, each port is connected to the
* lower bound. */
LADSPA_PortRangeHint * ranges;
public:
@@ -100,7 +94,7 @@ class Descriptor
PortCount = (sizeof (T::port_info) / sizeof (PortInfo));
/* unroll PortInfo members */
char ** names = new char * [PortCount];
const char ** names = new const char * [PortCount];
LADSPA_PortDescriptor * desc = new LADSPA_PortDescriptor [PortCount];
ranges = new LADSPA_PortRangeHint [PortCount];

View File

@@ -47,7 +47,7 @@ adjust_gain (int i, double g)
return g * adjust[i];
}
#define Q 1.2
#define Q 1.414
void
Eq::init()
@@ -116,7 +116,7 @@ Eq::port_info [] =
}, {
"31 Hz",
INPUT | CONTROL,
{BOUNDED | DEFAULT_LOW, -48, 24}
{BOUNDED | DEFAULT_0, -48, 24}
}, {
"63 Hz",
INPUT | CONTROL,
@@ -327,4 +327,9 @@ Descriptor<Eq2x2>::setup()
autogen();
}
/* //////////////////////////////////////////////////////////////////////// */
/*
todo: parametric -- 20-400, 60-1k, 150-2.5k, 500-8k, 1k-20k
bandwidth 0-2 octaves
*/

View File

@@ -1,7 +1,7 @@
/*
basics.h
Copyright 2004-5 Tim Goetze <tim@quitte.de>
Copyright 2004-9 Tim Goetze <tim@quitte.de>
http://quitte.de/dsp/
@@ -32,7 +32,7 @@
#define _GNU_SOURCE 1
#define _USE_GNU 1
/* gcc protects a lot of standard math calls. */
/* unlocking some standard math calls. */
#define __USE_ISOC99 1
#define __USE_ISOC9X 1
#define _ISOC99_SOURCE 1
@@ -49,9 +49,9 @@
#include <ladspa.h>
/* reducing LADSPA_DEFINES_WITH_LOTS_OF_CHARACTERS_REALLY verbosity */
#define BOUNDED (LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_BOUNDED_ABOVE)
#define INTEGER LADSPA_HINT_INTEGER
/* #define FS LADSPA_HINT_SAMPLE_RATE *//* deprecated */
#define LOG LADSPA_HINT_LOGARITHMIC
#define TOGGLE LADSPA_HINT_TOGGLED
@@ -75,6 +75,8 @@
#define TEN_TO_THE_SIXTH 1000000
#define MIN_GAIN .000001 /* -120 dB */
/* smallest non-denormal 32 bit IEEE float is 1.18<EFBFBD>10-38 */
#define NOISE_FLOOR .00000000000005 /* -266 dB */
typedef int8_t int8;
@@ -87,7 +89,7 @@ typedef int64_t int64;
typedef uint64_t uint64;
typedef struct {
char * name;
const char * name;
LADSPA_PortDescriptor descriptor;
LADSPA_PortRangeHint range;
} PortInfo;
@@ -141,7 +143,7 @@ frandom()
return (float) rand() / (float) RAND_MAX;
}
/* for testing only. */
/* NB: also true if 0 */
inline bool
is_denormal (float & f)
{
@@ -149,7 +151,7 @@ is_denormal (float & f)
return ((i & 0x7f800000) == 0);
}
/* not sure if this double version is correct, actually ... */
/* todo: not sure if this double version is correct, actually ... */
inline bool
is_denormal (double & f)
{

View File

@@ -1,11 +1,11 @@
/*
dsp/BiQuad.h
Copyright 2003-4 Tim Goetze <tim@quitte.de>
Copyright 2003-7 Tim Goetze <tim@quitte.de>
http://quitte.de/dsp/
bi-quad implementation.
Bi-quad IIR filter.
*/
/*
@@ -42,6 +42,7 @@ class BiQuad
BiQuad()
{
/* initialize to unity */
a[0] = 1;
a[1] = a[2] = b[0] = b[1] = b[2] = 0;
@@ -92,8 +93,9 @@ class BiQuad
return r;
}
/* additional methods for using the biquad to filter an
* upsampled signal with 0 padding */
/* Following are additional methods for using the biquad to filter an
* upsampled signal with 0 padding -- some terms reduce to 0 in this
* case */
inline d_sample process_0_1()
{
register int z = h;

View File

@@ -1,7 +1,7 @@
/*
dsp/OnePole.h
Copyright 2003-4 Tim Goetze <tim@quitte.de>
Copyright 2003-7 Tim Goetze <tim@quitte.de>
http://quitte.de/dsp/

View File

@@ -32,9 +32,11 @@ namespace DSP {
class RMS
{
public:
protected:
d_sample buffer[64];
int write;
public:
double sum;
RMS()

View File

@@ -1,7 +1,7 @@
/*
ToneStack.h
Copyright 2006-7
Copyright 2006-9
David Yeh <dtyeh@ccrma.stanford.edu> (implementation)
Tim Goetze <tim@quitte.de> (cosmetics)
@@ -83,6 +83,7 @@ class ToneStack
ToneStack()
{
model = -1;
setparams (presets[0]);
}

View File

@@ -1,7 +1,7 @@
/*
dsp/windows.h
Copyright 2004 Tim Goetze <tim@quitte.de>
Copyright 2004-9 Tim Goetze <tim@quitte.de>
http://quitte.de/dsp/
@@ -147,17 +147,13 @@ kaiser (d_sample * s, int n, double beta)
{
double k = besseli ((beta * sqrt (1 - pow ((2 * i / (n - 1)), 2)))) / bb;
#if LMMS_BUILD_WIN64
if (!isfinite (k))
#else
/* can you spell hack */
if (!finite (k))
#endif
if (!isfinite (k) || isnan(k))
k = 0;
F (s[si], k);
}
/* assymetrical hack: sort out first value!
/* asymmetrical hack: sort out first value!
win[0] = win[len-1];
*/
}

View File

@@ -1,7 +1,7 @@
/*
interface.cc
Copyright 2004-7 Tim Goetze <tim@quitte.de>
Copyright 2004-9 Tim Goetze <tim@quitte.de>
http://quitte.de/dsp/