/usr/lib/lv2/sc1-swh.lv2/plugin.ttl is in swh-lv2 1.0.15+git20151104~repack0-1.
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 | @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:sc1 a :Plugin ;
a :CompressorPlugin ;
doap:name "SC1" ;
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#sc1> ;
:pluginProperty :hardRtCapable ;
:port [
a :InputPort, :ControlPort ;
:name "Attack time (ms)" ;
:index 0 ;
:symbol "attack" ;
:minimum 2 ;
:maximum 400 ;
:default 101.5 ;
] ;
:port [
a :InputPort, :ControlPort ;
:name "Release time (ms)" ;
:index 1 ;
:symbol "release" ;
:minimum 2 ;
:maximum 800 ;
:default 401 ;
] ;
:port [
a :InputPort, :ControlPort ;
:name "Threshold level (dB)" ;
:index 2 ;
:symbol "threshold" ;
:minimum -30 ;
:maximum 0 ;
:default 0 ;
] ;
:port [
a :InputPort, :ControlPort ;
:name "Ratio (1:n)" ;
:index 3 ;
:symbol "ratio" ;
:minimum 1 ;
:maximum 10 ;
:default 1.0 ;
] ;
:port [
a :InputPort, :ControlPort ;
:name "Knee radius (dB)" ;
:index 4 ;
:symbol "knee" ;
:minimum 1 ;
:maximum 10 ;
:default 3.25 ;
] ;
:port [
a :InputPort, :ControlPort ;
:name "Makeup gain (dB)" ;
:index 5 ;
:symbol "makeup_gain" ;
:minimum 0 ;
:maximum +24 ;
:default 0.0 ;
] ;
:port [
a :InputPort, :AudioPort ;
:name "Input" ;
:index 6 ;
:symbol "input" ;
] ;
:port [
a :OutputPort, :AudioPort ;
:name "Output" ;
:index 7 ;
:symbol "output" ;
] ;
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;
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 = 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++) {
sum += input[pos] * input[pos];
if (amp > env) {
env = env * ga + amp * (1.0f - ga);
} else {
env = env * gr + amp * (1.0f - gr);
}
if (count++ % 4 == 3) {
amp = rms_env_process(rms, sum * 0.25f);
sum = 0.0f;
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(output[pos], input[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->count = count;
""" ;
] ;
swhext:createdBy <http://plugin.org.uk/swh-plugins/toTurtle.xsl> .
|