/usr/lib/lv2/sc4-swh.lv2/plugin.ttl is in swh-lv2 1.0.16+git20160519~repack0-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 | @prefix : <http://lv2plug.in/ns/lv2core#> .
@prefix swh: <http://plugin.org.uk/swh-plugins/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix swhext: <http://plugin.org.uk/extensions#> .
@prefix pg: <http://lv2plug.in/ns/ext/port-groups#> .
@prefix pprops: <http://lv2plug.in/ns/ext/port-props#> .
swh:sc4-main_in a pg:Group ;
a pg:StereoGroup ;
:symbol "main_in" .
swh:sc4-main_out a pg:Group ;
a pg:StereoGroup ;
:symbol "main_out" .
swh:sc4 a :Plugin ;
a :CompressorPlugin ;
doap:name "SC4" ;
doap:maintainer [
foaf:name "Steve Harris";
foaf:homepage <http://plugin.org.uk/> ;
foaf:mbox <mailto:steve@plugin.org.uk> ;
] ;
doap:license <http://usefulinc.com/doap/licenses/gpl> ;
:documentation <http://plugin.org.uk/ladspa-swh/docs/ladspa-swh.html#sc4> ;
:pluginProperty :hardRtCapable ;
:port [
a :InputPort, :ControlPort ;
:name "RMS/peak" ;
:index 0 ;
:symbol "rms_peak" ;
:minimum 0 ;
:maximum 1 ;
:default 0 ;
] ;
:port [
a :InputPort, :ControlPort ;
:name "Attack time (ms)" ;
:index 1 ;
:symbol "attack" ;
:minimum 1.5 ;
:maximum 400 ;
:default 101.125 ;
] ;
:port [
a :InputPort, :ControlPort ;
:name "Release time (ms)" ;
:index 2 ;
:symbol "release" ;
:minimum 2 ;
:maximum 800 ;
:default 401 ;
] ;
:port [
a :InputPort, :ControlPort ;
:name "Threshold level (dB)" ;
:index 3 ;
:symbol "threshold" ;
:minimum -30 ;
:maximum 0 ;
:default 0 ;
] ;
:port [
a :InputPort, :ControlPort ;
:name "Ratio (1:n)" ;
:index 4 ;
:symbol "ratio" ;
:minimum 1 ;
:maximum 20 ;
:default 1.0 ;
] ;
:port [
a :InputPort, :ControlPort ;
:name "Knee radius (dB)" ;
:index 5 ;
:symbol "knee" ;
:minimum 1 ;
:maximum 10 ;
:default 3.25 ;
] ;
:port [
a :InputPort, :ControlPort ;
:name "Makeup gain (dB)" ;
:index 6 ;
:symbol "makeup_gain" ;
:minimum 0 ;
:maximum +24 ;
:default 0.0 ;
] ;
:port [
a :OutputPort, :ControlPort ;
:name "Amplitude (dB)" ;
:index 7 ;
:symbol "amplitude" ;
:minimum -40 ;
:maximum +12 ;
] ;
:port [
a :OutputPort, :ControlPort ;
:name "Gain reduction (dB)" ;
:index 8 ;
:symbol "gain_red" ;
:minimum -24 ;
:maximum 0 ;
] ;
:port [
a :InputPort, :AudioPort ;
:name "Left input" ;
:index 9 ;
:symbol "left_in" ;
pg:inGroup swh:sc4-main_in ;
pg:role pg:leftChannel ;
] ;
:port [
a :InputPort, :AudioPort ;
:name "Right input" ;
:index 10 ;
:symbol "right_in" ;
pg:inGroup swh:sc4-main_in ;
pg:role pg:rightChannel ;
] ;
:port [
a :OutputPort, :AudioPort ;
:name "Left output" ;
:index 11 ;
:symbol "left_out" ;
pg:inGroup swh:sc4-main_out ;
pg:role pg:leftChannel ;
] ;
:port [
a :OutputPort, :AudioPort ;
:name "Right output" ;
:index 12 ;
:symbol "right_out" ;
pg:inGroup swh:sc4-main_out ;
pg:role pg:rightChannel ;
] ;
swhext:code """
#include "util/db.h"
#include "util/rms.h"
#define A_TBL 256
""" ;
swhext:callback [
swhext:event "instantiate" ;
swhext:code """
unsigned int i;
float sample_rate = (float)s_rate;
rms = rms_env_new();
sum = 0.0f;
amp = 0.0f;
gain = 0.0f;
gain_t = 0.0f;
env = 0.0f;
env_rms = 0.0f;
env_peak = 0.0f;
count = 0;
as = malloc(A_TBL * sizeof(float));
as[0] = 1.0f;
for (i=1; i<A_TBL; i++) {
as[i] = expf(-1.0f / (sample_rate * (float)i / (float)A_TBL));
}
db_init();
""" ;
] ;
swhext:callback [
swhext:event "cleanup" ;
swhext:code """
rms_env_free(plugin_data->rms);
free(plugin_data->as);
""" ;
] ;
swhext:callback [
swhext:event "run" ;
swhext:code """
unsigned long pos;
const float ga = attack < 2.0f ? 0.0f : as[f_round(attack * 0.001f * (float)(A_TBL-1))];
const float gr = as[f_round(release * 0.001f * (float)(A_TBL-1))];
const float rs = (ratio - 1.0f) / ratio;
const float mug = db2lin(makeup_gain);
const float knee_min = db2lin(threshold - knee);
const float knee_max = db2lin(threshold + knee);
const float ef_a = ga * 0.25f;
const float ef_ai = 1.0f - ef_a;
for (pos = 0; pos < sample_count; pos++) {
const float la = fabs(left_in[pos]);
const float ra = fabs(right_in[pos]);
const float lev_in = f_max(la, ra);
sum += lev_in * lev_in;
if (amp > env_rms) {
env_rms = env_rms * ga + amp * (1.0f - ga);
} else {
env_rms = env_rms * gr + amp * (1.0f - gr);
}
round_to_zero(&env_rms);
if (lev_in > env_peak) {
env_peak = env_peak * ga + lev_in * (1.0f - ga);
} else {
env_peak = env_peak * gr + lev_in * (1.0f - gr);
}
round_to_zero(&env_peak);
if ((count++ & 3) == 3) {
amp = rms_env_process(rms, sum * 0.25f);
sum = 0.0f;
if (isnan(env_rms)) {
// This can happen sometimes, but I don't know why
env_rms = 0.0f;
}
env = LIN_INTERP(rms_peak, env_rms, env_peak);
if (env <= knee_min) {
gain_t = 1.0f;
} else if (env < knee_max) {
const float x = -(threshold - knee - lin2db(env)) / knee;
gain_t = db2lin(-knee * rs * x * x * 0.25f);
} else {
gain_t = db2lin((threshold - lin2db(env)) * rs);
}
}
gain = gain * ef_a + gain_t * ef_ai;
buffer_write(left_out[pos], left_in[pos] * gain * mug);
buffer_write(right_out[pos], right_in[pos] * gain * mug);
}
plugin_data->sum = sum;
plugin_data->amp = amp;
plugin_data->gain = gain;
plugin_data->gain_t = gain_t;
plugin_data->env = env;
plugin_data->env_rms = env_rms;
plugin_data->env_peak = env_peak;
plugin_data->count = count;
*(plugin_data->amplitude) = lin2db(env);
*(plugin_data->gain_red) = lin2db(gain);
""" ;
] ;
swhext:createdBy <http://plugin.org.uk/swh-plugins/toTurtle.xsl> .
|