/usr/lib/lv2/vynil-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 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 | @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:vynil a :Plugin ;
a :DistortionPlugin ;
doap:name "VyNil (Vinyl Effect)" ;
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#vynil> ;
:pluginProperty :hardRtCapable ;
:port [
a :InputPort, :ControlPort ;
:name "Year" ;
:index 0 ;
:symbol "year" ;
:minimum 1900 ;
:maximum 1990 ;
:default 1990 ;
] ;
:port [
a :InputPort, :ControlPort ;
:name "RPM" ;
:index 1 ;
:symbol "rpm" ;
:minimum 33 ;
:maximum 78 ;
:default 33 ;
] ;
:port [
a :InputPort, :ControlPort ;
:name "Surface warping" ;
:index 2 ;
:symbol "warp" ;
:minimum 0.0 ;
:maximum 1.0 ;
:default 0.0 ;
] ;
:port [
a :InputPort, :ControlPort ;
:name "Crackle" ;
:index 3 ;
:symbol "click" ;
:minimum 0.0 ;
:maximum 1.0 ;
:default 0.0 ;
] ;
:port [
a :InputPort, :ControlPort ;
:name "Wear" ;
:index 4 ;
:symbol "wear" ;
:minimum 0.0 ;
:maximum 1.0 ;
:default 0.0 ;
] ;
:port [
a :InputPort, :AudioPort ;
:name "Input L" ;
:index 5 ;
:symbol "in_l" ;
] ;
:port [
a :InputPort, :AudioPort ;
:name "Input R" ;
:index 6 ;
:symbol "in_r" ;
] ;
:port [
a :OutputPort, :AudioPort ;
:name "Output L" ;
:index 7 ;
:symbol "out_l" ;
] ;
:port [
a :OutputPort, :AudioPort ;
:name "Output R" ;
:index 8 ;
:symbol "out_r" ;
] ;
swhext:code """
#include <stdlib.h>
#include <limits.h>
#include "ladspa-util.h"
#include "util/biquad.h"
#define BUF_LEN 0.1
#define CLICK_BUF_SIZE 4096
#define df(x) ((sinf(x) + 1.0f) * 0.5f)
inline static float noise();
inline static float noise()
{
static unsigned int randSeed = 23;
randSeed = (randSeed * 196314165) + 907633515;
return randSeed / (float)INT_MAX - 1.0f;
}
""" ;
swhext:callback [
swhext:event "instantiate" ;
swhext:code """
unsigned int i;
unsigned int buffer_size;
fs = (float)s_rate;
buffer_size = 4096;
while (buffer_size < s_rate * BUF_LEN) {
buffer_size *= 2;
}
buffer_m = malloc(sizeof(LADSPA_Data) * buffer_size);
buffer_s = malloc(sizeof(LADSPA_Data) * buffer_size);
buffer_mask = buffer_size - 1;
buffer_pos = 0;
click_gain = 0;
phi = 0.0f; /* Angular phase */
click_buffer = malloc(sizeof(LADSPA_Data) * CLICK_BUF_SIZE);
for (i=0; i<CLICK_BUF_SIZE; i++) {
if (i<CLICK_BUF_SIZE / 2) {
click_buffer[i] = (double)i / (double)(CLICK_BUF_SIZE / 2);
click_buffer[i] *= click_buffer[i];
click_buffer[i] *= click_buffer[i];
click_buffer[i] *= click_buffer[i];
} else {
click_buffer[i] = click_buffer[CLICK_BUF_SIZE - i];
}
}
sample_cnt = 0;
def = 0.0f;
def_target = 0.0f;
lowp_m = calloc(sizeof(biquad), 1);
lowp_s = calloc(sizeof(biquad), 1);
highp = calloc(sizeof(biquad), 1);
noise_filt = calloc(sizeof(biquad), 1);
""" ;
] ;
swhext:callback [
swhext:event "activate" ;
swhext:code """
memset(buffer_m, 0, sizeof(LADSPA_Data) * (buffer_mask + 1));
memset(buffer_s, 0, sizeof(LADSPA_Data) * (buffer_mask + 1));
plugin_data->buffer_pos = 0;
plugin_data->click_buffer_pos.all = 0;
plugin_data->click_buffer_omega.all = 0;
plugin_data->click_gain = 0;
plugin_data->phi = 0.0f;
lp_set_params(lowp_m, 16000.0, 0.5, fs);
lp_set_params(lowp_s, 16000.0, 0.5, fs);
lp_set_params(highp, 10.0, 0.5, fs);
lp_set_params(noise_filt, 1000.0, 0.5, fs);
""" ;
] ;
swhext:callback [
swhext:event "run" ;
swhext:code """
unsigned long pos;
float deflec = def;
float deflec_target = def_target;
float src_m, src_s;
/* angular velocity of platter * 16 */
const float omega = 960.0f / (rpm * fs);
const float age = (2000 - year) * 0.01f;
const unsigned int click_prob = (age*age*(float)RAND_MAX)/10 + click * 0.02 * RAND_MAX;
const float noise_amp = (click + wear * 0.3f) * 0.12f + (1993.0f - year) * 0.0031f;
const float bandwidth = (year - 1880.0f) * (rpm * 1.9f);
const float noise_bandwidth = bandwidth * (0.25 - wear * 0.02) + click * 200.0 + 300.0;
const float stereo = f_clamp((year - 1940.0f) * 0.02f, 0.0f, 1.0f);
const float wrap_gain = age * 3.1f + 0.05f;
const float wrap_bias = age * 0.1f;
lp_set_params(lowp_m, bandwidth * (1.0 - wear * 0.86), 2.0, fs);
lp_set_params(lowp_s, bandwidth * (1.0 - wear * 0.89), 2.0, fs);
hp_set_params(highp, (2000-year) * 8.0, 1.5, fs);
lp_set_params(noise_filt, noise_bandwidth, 4.0 + wear * 2.0, fs);
for (pos = 0; pos < sample_count; pos++) {
unsigned int o1, o2;
float ofs;
if ((sample_cnt & 15) == 0) {
const float ang = phi * 2.0f * M_PI;
const float w = warp * (2000.0f - year) * 0.01f;
deflec_target = w*df(ang)*0.5f + w*w*df(2.0f*ang)*0.31f +
w*w*w*df(3.0f*ang)*0.129f;
phi += omega;
while (phi > 1.0f) {
phi -= 1.0f;
}
if ((unsigned int)rand() < click_prob) {
click_buffer_omega.all = ((rand() >> 6) + 1000) * rpm;
click_gain = noise_amp * 5.0f * noise();
}
}
deflec = deflec * 0.1f + deflec_target * 0.9f;
/* matrix into mid_side representation (this is roughly what stereo
* LPs do) */
buffer_m[buffer_pos] = in_l[pos] + in_r[pos];
buffer_s[buffer_pos] = in_l[pos] - in_r[pos];
/* cacluate the effects of the surface warping */
ofs = fs * 0.009f * deflec;
o1 = f_round(floorf(ofs));
o2 = f_round(ceilf(ofs));
ofs -= o1;
src_m = LIN_INTERP(ofs, buffer_m[(buffer_pos - o1 - 1) & buffer_mask], buffer_m[(buffer_pos - o2 - 1) & buffer_mask]);
src_s = LIN_INTERP(ofs, buffer_s[(buffer_pos - o1 - 1) & buffer_mask], buffer_s[(buffer_pos - o2 - 1) & buffer_mask]);
src_m = biquad_run(lowp_m, src_m + click_buffer[click_buffer_pos.part.in & (CLICK_BUF_SIZE - 1)] * click_gain);
/* waveshaper */
src_m = LIN_INTERP(age, src_m, sinf(src_m * wrap_gain + wrap_bias));
/* output highpass */
src_m = biquad_run(highp, src_m) + biquad_run(noise_filt, noise()) * noise_amp + click_buffer[click_buffer_pos.part.in & (CLICK_BUF_SIZE - 1)] * click_gain * 0.5f;
/* stereo seperation filter */
src_s = biquad_run(lowp_s, src_s) * stereo;
buffer_write(out_l[pos], (src_s + src_m) * 0.5f);
buffer_write(out_r[pos], (src_m - src_s) * 0.5f);
/* roll buffer indexes */
buffer_pos = (buffer_pos + 1) & buffer_mask;
click_buffer_pos.all += click_buffer_omega.all;
if (click_buffer_pos.part.in >= CLICK_BUF_SIZE) {
click_buffer_pos.all = 0;
click_buffer_omega.all = 0;
}
sample_cnt++;
}
plugin_data->buffer_pos = buffer_pos;
plugin_data->click_buffer_pos = click_buffer_pos;
plugin_data->click_buffer_omega = click_buffer_omega;
plugin_data->click_gain = click_gain;
plugin_data->sample_cnt = sample_cnt;
plugin_data->def_target = deflec_target;
plugin_data->def = deflec;
plugin_data->phi = phi;
""" ;
] ;
swhext:callback [
swhext:event "cleanup" ;
swhext:code """
free(plugin_data->buffer_m);
free(plugin_data->buffer_s);
free(plugin_data->click_buffer);
free(plugin_data->lowp_m);
free(plugin_data->lowp_s);
free(plugin_data->noise_filt);
""" ;
] ;
swhext:createdBy <http://plugin.org.uk/swh-plugins/toTurtle.xsl> .
|