This file is indexed.

/usr/lib/lv2/retro_flange-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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
@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:retroFlange a :Plugin ;
   a :FlangerPlugin ;

   doap:name "Retro Flanger" ;
   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#retroFlange> ;

   :pluginProperty :hardRtCapable ;
    
   :port [
     a :InputPort, :ControlPort ;
     :name "Average stall (ms)" ;
     :index 0 ;
     :symbol "delay_depth_avg" ;
     :minimum 0 ;
     :maximum 10 ;
     
     :default 2.5 ;
   ] ;
  
   :port [
     a :InputPort, :ControlPort ;
     :name "Flange frequency (Hz)" ;
     :index 1 ;
     :symbol "law_freq" ;
     :minimum 0.5 ;
     :maximum 8 ;
     
     :default 1.0 ;
   ] ;
  
   :port [
     a :InputPort, :AudioPort ;
     :name "Input" ;
     :index 2 ;
     :symbol "input" ;
   ] ;
  
   :port [
     a :OutputPort, :AudioPort ;
     :name "Output" ;
     :index 3 ;
     :symbol "output" ;
   ] ;
  
   swhext:code """
#include "ladspa-util.h"

#define BASE_BUFFER 0.001 // Base buffer length (s)

inline LADSPA_Data sat(LADSPA_Data x, float q,  float dist) {
	if (x == q) {
		return 1.0f / dist + q / (1.0f - f_exp(dist * q));
	}
	return ((x - q) / (1.0f - f_exp(-dist * (x - q))) + q /
	 (1.0f - f_exp(dist * q)));
}

		""" ;

   swhext:callback [
     swhext:event "instantiate" ;
     swhext:code """
sample_rate = s_rate;
buffer_size = BASE_BUFFER * s_rate;
buffer = calloc(buffer_size, sizeof(LADSPA_Data));
phase = 0;
last_phase = 0;
last_in = 0.0f;
max_law_p = s_rate*2;
last_law_p = -1;
delay_line_length = sample_rate * 0.01f;
delay_line = calloc(sizeof(float), delay_line_length);

delay_pos = 0;
count = 0;

prev_law_peak = 0.0f;
next_law_peak = 1.0f;
prev_law_pos = 0;
next_law_pos = 10;

z0 = 0.0f;
z1 = 0.0f;
z2 = 0.0f;
		""" ;
   ] ;
  
   swhext:callback [
     swhext:event "activate" ;
     swhext:code """
memset(delay_line, 0, sizeof(float) * delay_line_length);
memset(buffer, 0, sizeof(LADSPA_Data) * buffer_size);
z0 = 0.0f;
z1 = 0.0f;
z2 = 0.0f;

prev_law_peak = 0.0f;
next_law_peak = 1.0f;
prev_law_pos = 0;
next_law_pos = 10;
		""" ;
   ] ;
  
   swhext:callback [
     swhext:event "cleanup" ;
     swhext:code """
free(plugin_data->delay_line);
free(plugin_data->buffer);
		""" ;
   ] ;
  
   swhext:callback [
     swhext:event "run" ;
     swhext:code """
long int pos;
int law_p = f_trunc(LIMIT(sample_rate / f_clamp(law_freq, 0.0001f, 100.0f), 1, max_law_p));
float increment;
float lin_int, lin_inc;
int track;
int fph;
LADSPA_Data out = 0.0f;
const float dda_c = f_clamp(delay_depth_avg, 0.0f, 10.0f);
int dl_used = (dda_c * sample_rate) / 1000;
float inc_base = 1000.0f * (float)BASE_BUFFER;
const float delay_depth = 2.0f * dda_c;
float n_ph, p_ph, law;

for (pos = 0; pos < sample_count; pos++) {
	// Write into the delay line
	delay_line[delay_pos] = input[pos];
	z0 = delay_line[MOD(delay_pos - dl_used, delay_line_length)] + 0.12919609397f*z1 - 0.31050847f*z2;
	out = sat(z0*0.20466966f + z1*0.40933933f + z2*0.40933933f,
	                -0.23f, 3.3f);
	z2 = z1; z1 = z0;
	delay_pos = (delay_pos + 1) % delay_line_length;

        if ((count++ % law_p) == 0) {
		// Value for amplitude of law peak
		next_law_peak = (float)rand() / (float)RAND_MAX;
		next_law_pos = count + law_p;
	} else if (count % law_p == law_p / 2) {
		// Value for amplitude of law peak
		prev_law_peak = (float)rand() / (float)RAND_MAX;
		prev_law_pos = count + law_p;
        }

        n_ph = (float)(law_p - abs(next_law_pos - count))/(float)law_p;
        p_ph = n_ph + 0.5f;
        if (p_ph > 1.0f) {
                p_ph -= 1.0f;
        }
        law = f_sin_sq(3.1415926f*p_ph)*prev_law_peak +
                f_sin_sq(3.1415926f*n_ph)*next_law_peak;

	increment = inc_base / (delay_depth * law + 0.2);
	fph = f_trunc(phase);
	last_phase = fph;
	lin_int = phase - (float)fph;
	out += LIN_INTERP(lin_int, buffer[(fph+1) % buffer_size],
	 buffer[(fph+2) % buffer_size]);
	phase += increment;
	lin_inc = 1.0f / (floor(phase) - last_phase + 1);
	lin_inc = lin_inc > 1.0f ? 1.0f : lin_inc;
	lin_int = 0.0f;
	for (track = last_phase; track < phase; track++) {
		lin_int += lin_inc;
		buffer[track % buffer_size] =
		 LIN_INTERP(lin_int, last_in, input[pos]);
	}
	last_in = input[pos];
	buffer_write(output[pos], out * 0.707f);
	if (phase >= buffer_size) {
		phase -= buffer_size;
	}
}

// Store current phase in instance
plugin_data->phase = phase;
plugin_data->prev_law_peak = prev_law_peak;
plugin_data->next_law_peak = next_law_peak;
plugin_data->prev_law_pos = prev_law_pos;
plugin_data->next_law_pos = next_law_pos;
plugin_data->last_phase = last_phase;
plugin_data->last_in = last_in;
plugin_data->count = count;
plugin_data->last_law_p = last_law_p;
plugin_data->delay_pos = delay_pos;
plugin_data->z0 = z0;
plugin_data->z1 = z1;
plugin_data->z2 = z2;
		""" ;
   ] ;
  
   swhext:createdBy <http://plugin.org.uk/swh-plugins/toTurtle.xsl> .