This file is indexed.

/usr/lib/lv2/sifter-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
@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:sifter a :Plugin ;
   a :TimePlugin ;
   a :DistortionPlugin ;

   doap:name "Signal sifter" ;
   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#sifter> ;

   :port [
     a :InputPort, :ControlPort ;
     :name "Sift size" ;
     :index 0 ;
     :symbol "size" ;
     :minimum 1 ;
     :maximum 1000 ;
     
     :default 1.0 ;
   ] ;
  
   :port [
     a :InputPort, :AudioPort ;
     :name "Input" ;
     :index 1 ;
     :symbol "input" ;
   ] ;
  
   :port [
     a :OutputPort, :AudioPort ;
     :name "Output" ;
     :index 2 ;
     :symbol "output" ;
   ] ;
  
   swhext:code """
#include "ladspa-util.h"

#define MAX_BSIZE 1000

inline int partition(LADSPA_Data array[], int left, int right);

/* required for clang compilation */
void q_sort(LADSPA_Data array[], int left, int right);

inline void q_sort(LADSPA_Data array[], int left, int right) {
	float pivot = partition(array, left, right);

	if (left < pivot) {
		q_sort(array, left, pivot-1);
	}
	if (right > pivot) {
		q_sort(array, pivot+1, right);
	}
}

inline int partition(LADSPA_Data array[], int left, int right) {
	float pivot = array[left];

	while (left < right) {
		while (array[right] >= pivot && left < right) {
			right--;
		}
		if (left != right) {
			array[left] = array[right];
			left++;
		}
		while (array[left] <= pivot && left < right) {
			left++;
		}
		if (left != right) {
			array[right] = array[left];
			right--;
		}
	}
	array[left] = pivot;

	return left;
}
    """ ;

   swhext:callback [
     swhext:event "instantiate" ;
     swhext:code """
      long i;
      float scla = (float)MAX_BSIZE * 0.5f;
      float sclb = (float)MAX_BSIZE;

      b1 = (LADSPA_Data *)calloc(MAX_BSIZE, sizeof(LADSPA_Data));
      b2 = (LADSPA_Data *)calloc(MAX_BSIZE, sizeof(LADSPA_Data));
      ob = (LADSPA_Data *)calloc(MAX_BSIZE, sizeof(LADSPA_Data));
      rc = (LADSPA_Data *)calloc(MAX_BSIZE, sizeof(LADSPA_Data));

      // Calculate raised cosine table, to build windowing function from
      rc[0] = cos(((0.0f - scla) / sclb) * M_PI);
      rc[0] *= rc[0];
      for (i=1; i<MAX_BSIZE / 2; i++) {
        rc[i] = cos((((float)i - scla) / sclb) * M_PI);
        rc[i] *= rc[i];
        rc[MAX_BSIZE - i] = rc[i];
      }
      rc[MAX_BSIZE / 2] = 1.0f;

      b1ptr = 0;
      b2ptr = 0;
    """ ;
   ] ;
  
   swhext:callback [
     swhext:event "activate" ;
     swhext:code """
      b1ptr = 0;
      b2ptr = 0;
      memset(b1, 0, MAX_BSIZE * sizeof(LADSPA_Data));
      memset(b2, 0, MAX_BSIZE * sizeof(LADSPA_Data));
      memset(ob, 0, MAX_BSIZE * sizeof(LADSPA_Data));
    """ ;
   ] ;
  
   swhext:callback [
     swhext:event "cleanup" ;
     swhext:code """
      free(plugin_data->b1);
      free(plugin_data->b2);
      free(plugin_data->ob);
      free(plugin_data->rc);
    """ ;
   ] ;
  
   swhext:callback [
     swhext:event "run" ;
     swhext:code """
unsigned long pos, i;
long bsize = f_round(LIMIT(size, 1, MAX_BSIZE));

for (pos = 0; pos < sample_count; pos++) {
	if (b1ptr >= bsize) {
		float wstep = (float)MAX_BSIZE / (float)b1ptr, wpos = 0.0f;

		q_sort(b1, 0, b1ptr);
		for (i=0; i<b1ptr; i++) {
			ob[i] += b1[i] * rc[f_round(wpos)];
			wpos += wstep;
		}
		b1ptr = 0;
		b2ptr = (bsize+1) / 2;
	}

	if (b2ptr >= bsize) {
		float wstep = (float)MAX_BSIZE / (float)b2ptr, wpos = 0.0f;
		int offset = (b2ptr+1)/2;

		q_sort(b2, 0, b2ptr);
		for (i=0; i<offset; i++) {
			ob[i + offset] += b2[i] * rc[f_round(wpos)];
			wpos += wstep;
		}
		for (; i<b2ptr; i++) {
			ob[i - offset] += b2[i] * rc[f_round(wpos)];
			wpos += wstep;
		}
		b2ptr = 0;
	}

	if (bsize < 2) {
		ob[b1ptr] = input[pos];
	}

	b1[b1ptr] = input[pos];
	b2[b2ptr] = input[pos];
	buffer_write(output[pos], ob[b1ptr]);
	ob[b1ptr] = 0.0f;
	b1ptr++;
	b2ptr++;
}

plugin_data->b1ptr = b1ptr;
plugin_data->b2ptr = b2ptr;
    """ ;
   ] ;
  
   swhext:createdBy <http://plugin.org.uk/swh-plugins/toTurtle.xsl> .