2 * Copyright (C) 2016 Damien Zammit <damien@zamaudio.com>
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
21 #include <cairo/cairo.h>
22 #include "ardour/lv2_extensions.h"
25 #include "lv2/lv2plug.in/ns/lv2core/lv2.h"
27 #define ACOMP_URI "urn:ardour:a-comp"
28 #define ACOMP_STEREO_URI "urn:ardour:a-comp#stereo"
31 # define M_PI 3.14159265358979323846
36 #define isfinite_local(val) (bool)_finite((double)val)
38 #define isfinite_local isfinite
88 LV2_Inline_Display_Image_Surface surf;
90 cairo_surface_t* display;
91 LV2_Inline_Display* queue_draw;
94 /* ports pointers are only valid during run so we'll
95 * have to cache them for the display, besides
96 * we do want to check for changes
111 instantiate(const LV2_Descriptor* descriptor,
113 const char* bundle_path,
114 const LV2_Feature* const* features)
116 AComp* acomp = (AComp*)calloc(1, sizeof(AComp));
118 for (int i=0; features[i]; ++i) {
120 if (!strcmp(features[i]->URI, LV2_INLINEDISPLAY__queue_draw)) {
121 acomp->queue_draw = (LV2_Inline_Display*) features[i]->data;
127 acomp->old_yl=acomp->old_y1=acomp->old_yg=0.f;
128 acomp->makeup_gain = 1.f;
130 acomp->need_expose = true;
131 acomp->v_lvl_out = -70.f;
134 return (LV2_Handle)acomp;
139 connect_port(LV2_Handle instance,
143 AComp* acomp = (AComp*)instance;
145 switch ((PortIndex)port) {
147 acomp->attack = (float*)data;
150 acomp->release = (float*)data;
153 acomp->knee = (float*)data;
156 acomp->ratio = (float*)data;
158 case ACOMP_THRESHOLD:
159 acomp->thresdb = (float*)data;
162 acomp->makeup = (float*)data;
165 acomp->gainr = (float*)data;
168 acomp->outlevel = (float*)data;
170 case ACOMP_SIDECHAIN:
171 acomp->sidechain = (float*)data;
174 acomp->enable = (float*)data;
182 connect_mono(LV2_Handle instance,
186 AComp* acomp = (AComp*)instance;
187 connect_port (instance, port, data);
189 switch ((PortIndex)port) {
191 acomp->input0 = (float*)data;
194 acomp->sc = (float*)data;
197 acomp->output0 = (float*)data;
205 connect_stereo(LV2_Handle instance,
209 AComp* acomp = (AComp*)instance;
210 connect_port (instance, port, data);
212 switch ((PortIndex)port) {
214 acomp->input0 = (float*)data;
217 acomp->input1 = (float*)data;
220 acomp->sc = (float*)data;
223 acomp->output0 = (float*)data;
226 acomp->output1 = (float*)data;
233 // Force already-denormal float value to zero
235 sanitize_denormal(float value) {
236 if (!isnormal(value)) {
244 return (exp(gdb/20.f*log(10.f)));
249 return (20.f*log10(g));
253 activate(LV2_Handle instance)
255 AComp* acomp = (AComp*)instance;
257 *(acomp->gainr) = 0.0f;
258 *(acomp->outlevel) = -45.0f;
259 acomp->old_yl=acomp->old_y1=acomp->old_yg=0.f;
263 run_mono(LV2_Handle instance, uint32_t n_samples)
265 AComp* acomp = (AComp*)instance;
267 const float* const input = acomp->input0;
268 const float* const sc = acomp->sc;
269 float* const output = acomp->output0;
271 float srate = acomp->srate;
272 float width = (6.f * *(acomp->knee)) + 0.01;
274 float attack_coeff = exp(-1000.f/(*(acomp->attack) * srate));
275 float release_coeff = exp(-1000.f/(*(acomp->release) * srate));
278 float lgaininp = 0.f;
280 float Lxg, Lxl, Lyg, Lyl, Ly1;
281 int usesidechain = (*(acomp->sidechain) <= 0.f) ? 0 : 1;
287 float ratio = *acomp->ratio;
288 float thresdb = *acomp->thresdb;
289 float makeup = *acomp->makeup;
290 float makeup_target = from_dB(makeup);
291 float makeup_gain = acomp->makeup_gain;
293 const float tau = (1.0 - exp (-2.f * M_PI * n_samples * 25.f / acomp->srate));
295 if (*acomp->enable <= 0) {
303 if (acomp->v_knee != *acomp->knee) {
304 acomp->v_knee = *acomp->knee;
305 acomp->need_expose = true;
308 if (acomp->v_ratio != ratio) {
309 acomp->v_ratio = ratio;
310 acomp->need_expose = true;
313 if (acomp->v_thresdb != thresdb) {
314 acomp->v_thresdb = thresdb;
315 acomp->need_expose = true;
318 if (acomp->v_makeup != makeup) {
319 acomp->v_makeup = makeup;
320 acomp->need_expose = true;
325 acomp->v_gainr = 0.0;
327 for (i = 0; i < n_samples; i++) {
330 ingain = usesidechain ? fabs(sc0) : fabs(in0);
331 in_peak = fmaxf (in_peak, ingain);
333 Lxg = (ingain==0.f) ? -160.f : to_dB(ingain);
334 Lxg = sanitize_denormal(Lxg);
337 if (2.f*(Lxg-thresdb) < -width) {
339 } else if (2.f*(Lxg-thresdb) > width) {
340 Lyg = thresdb + (Lxg-thresdb)/ratio;
341 Lyg = sanitize_denormal(Lyg);
343 Lyg = Lxg + (1.f/ratio-1.f)*(Lxg-thresdb+width/2.f)*(Lxg-thresdb+width/2.f)/(2.f*width);
348 acomp->old_y1 = sanitize_denormal(acomp->old_y1);
349 acomp->old_yl = sanitize_denormal(acomp->old_yl);
350 Ly1 = fmaxf(Lxl, release_coeff * acomp->old_y1+(1.f-release_coeff)*Lxl);
351 Lyl = attack_coeff * acomp->old_yl+(1.f-attack_coeff)*Ly1;
352 Ly1 = sanitize_denormal(Ly1);
353 Lyl = sanitize_denormal(Lyl);
356 Lgain = from_dB(cdb);
358 *(acomp->gainr) = Lyl;
359 if (Lyl > acomp->v_gainr) {
360 acomp->v_gainr = Lyl;
363 lgaininp = in0 * Lgain;
365 output[i] = lgaininp * makeup_gain;
367 max = (fabsf(output[i]) > max) ? fabsf(output[i]) : sanitize_denormal(max);
369 // TODO re-use local variables on stack
370 // store values back to acomp at the end of the inner-loop
376 if ( fabsf(makeup_target - makeup_gain) < 1e-6 ) {
379 makeup_gain += tau * (makeup_target - makeup_gain) + 1e-12;
382 *(acomp->outlevel) = (max < 0.0056f) ? -45.f : to_dB(max);
383 acomp->makeup_gain = makeup_gain;
386 const float old_v_lv1 = acomp->v_lv1;
387 const float old_v_lvl = acomp->v_lvl;
388 const float tot_rel_c = exp(-1000.f/(*(acomp->release) * srate) * n_samples);
389 const float tot_atk_c = exp(-1000.f/(*(acomp->attack) * srate) * n_samples);
390 acomp->v_lv1 = fmaxf (in_peak, tot_rel_c*old_v_lv1 + (1.f-tot_rel_c)*in_peak);
391 acomp->v_lvl = tot_atk_c*old_v_lvl + (1.f-tot_atk_c)*acomp->v_lv1;
393 if (!isfinite_local (acomp->v_lvl)) {
396 const float v_lvl_in = (acomp->v_lvl < 0.001f) ? -60.f : to_dB(acomp->v_lvl);
397 const float v_lvl_out = (max < 0.001f) ? -60.f : to_dB(max);
398 if (fabsf (acomp->v_lvl_out - v_lvl_out) >= 1 || fabsf (acomp->v_lvl_in - v_lvl_in) >= 1) {
400 acomp->need_expose = true;
401 acomp->v_lvl_in = v_lvl_in;
402 const float relax_coef = exp(-(float)n_samples/srate);
403 acomp->v_lvl_out = fmaxf (v_lvl_out, relax_coef*acomp->v_lvl_out + (1.f-relax_coef)*v_lvl_out);
405 if (acomp->need_expose && acomp->queue_draw) {
406 acomp->need_expose = false;
407 acomp->queue_draw->queue_draw (acomp->queue_draw->handle);
413 run_stereo(LV2_Handle instance, uint32_t n_samples)
415 AComp* acomp = (AComp*)instance;
417 const float* const input0 = acomp->input0;
418 const float* const input1 = acomp->input1;
419 const float* const sc = acomp->sc;
420 float* const output0 = acomp->output0;
421 float* const output1 = acomp->output1;
423 float srate = acomp->srate;
424 float width = (6.f * *(acomp->knee)) + 0.01;
426 float attack_coeff = exp(-1000.f/(*(acomp->attack) * srate));
427 float release_coeff = exp(-1000.f/(*(acomp->release) * srate));
430 float lgaininp = 0.f;
431 float rgaininp = 0.f;
433 float Lxg, Lxl, Lyg, Lyl, Ly1;
434 int usesidechain = (*(acomp->sidechain) <= 0.f) ? 0 : 1;
442 float ratio = *acomp->ratio;
443 float thresdb = *acomp->thresdb;
444 float makeup = *acomp->makeup;
445 float makeup_target = from_dB(makeup);
446 float makeup_gain = acomp->makeup_gain;
448 const float tau = (1.0 - exp (-2.f * M_PI * n_samples * 25.f / acomp->srate));
450 if (*acomp->enable <= 0) {
458 if (acomp->v_knee != *acomp->knee) {
459 acomp->v_knee = *acomp->knee;
460 acomp->need_expose = true;
463 if (acomp->v_ratio != ratio) {
464 acomp->v_ratio = ratio;
465 acomp->need_expose = true;
468 if (acomp->v_thresdb != thresdb) {
469 acomp->v_thresdb = thresdb;
470 acomp->need_expose = true;
473 if (acomp->v_makeup != makeup) {
474 acomp->v_makeup = makeup;
475 acomp->need_expose = true;
480 acomp->v_gainr = 0.0;
482 for (i = 0; i < n_samples; i++) {
486 maxabslr = fmaxf(fabs(in0), fabs(in1));
487 ingain = usesidechain ? fabs(sc0) : maxabslr;
488 in_peak = fmaxf (in_peak, ingain);
490 Lxg = (ingain==0.f) ? -160.f : to_dB(ingain);
491 Lxg = sanitize_denormal(Lxg);
494 if (2.f*(Lxg-thresdb) < -width) {
496 } else if (2.f*(Lxg-thresdb) > width) {
497 Lyg = thresdb + (Lxg-thresdb)/ratio;
498 Lyg = sanitize_denormal(Lyg);
500 Lyg = Lxg + (1.f/ratio-1.f)*(Lxg-thresdb+width/2.f)*(Lxg-thresdb+width/2.f)/(2.f*width);
505 acomp->old_y1 = sanitize_denormal(acomp->old_y1);
506 acomp->old_yl = sanitize_denormal(acomp->old_yl);
507 Ly1 = fmaxf(Lxl, release_coeff * acomp->old_y1+(1.f-release_coeff)*Lxl);
508 Lyl = attack_coeff * acomp->old_yl+(1.f-attack_coeff)*Ly1;
509 Ly1 = sanitize_denormal(Ly1);
510 Lyl = sanitize_denormal(Lyl);
513 Lgain = from_dB(cdb);
515 *(acomp->gainr) = Lyl;
516 if (Lyl > acomp->v_gainr) {
517 acomp->v_gainr = Lyl;
520 lgaininp = in0 * Lgain;
521 rgaininp = in1 * Lgain;
523 output0[i] = lgaininp * makeup_gain;
524 output1[i] = rgaininp * makeup_gain;
526 max = (fmaxf(fabs(output0[i]), fabs(output1[i])) > max) ? fmaxf(fabs(output0[i]), fabs(output1[i])) : sanitize_denormal(max);
528 // TODO re-use local variables on stack
529 // store values back to acomp at the end of the inner-loop
535 if ( fabsf(makeup_target - makeup_gain) < 1e-6 ) {
538 makeup_gain += tau * (makeup_target - makeup_gain) + 1e-12;
541 *(acomp->outlevel) = (max < 0.0056f) ? -45.f : to_dB(max);
542 acomp->makeup_gain = makeup_gain;
545 const float old_v_lv1 = acomp->v_lv1;
546 const float old_v_lvl = acomp->v_lvl;
547 const float tot_rel_c = exp(-1000.f/(*(acomp->release) * srate) * n_samples);
548 const float tot_atk_c = exp(-1000.f/(*(acomp->attack) * srate) * n_samples);
549 acomp->v_lv1 = fmaxf (in_peak, tot_rel_c*old_v_lv1 + (1.f-tot_rel_c)*in_peak);
550 acomp->v_lvl = tot_atk_c*old_v_lvl + (1.f-tot_atk_c)*acomp->v_lv1;
551 if (!isfinite_local (acomp->v_lvl)) {
554 const float v_lvl_in = (acomp->v_lvl < 0.001f) ? -60.f : to_dB(acomp->v_lvl);
555 const float v_lvl_out = (max < 0.001f) ? -60.f : to_dB(max);
556 if (fabsf (acomp->v_lvl_out - v_lvl_out) >= 1 || fabsf (acomp->v_lvl_in - v_lvl_in) >= 1) {
558 acomp->need_expose = true;
559 acomp->v_lvl_in = v_lvl_in;
560 const float relax_coef = exp(-2.0*n_samples/srate);
561 acomp->v_lvl_out = fmaxf (v_lvl_out, relax_coef*acomp->v_lvl_out + (1.f-relax_coef)*v_lvl_out);
563 if (acomp->need_expose && acomp->queue_draw) {
564 acomp->need_expose = false;
565 acomp->queue_draw->queue_draw (acomp->queue_draw->handle);
571 deactivate(LV2_Handle instance)
577 cleanup(LV2_Handle instance)
580 AComp* acomp = (AComp*)instance;
581 if (acomp->display) {
582 cairo_surface_destroy (acomp->display);
591 #define MIN(A,B) ((A) < (B)) ? (A) : (B)
596 comp_curve (const AComp* self, float xg) {
597 const float knee = self->v_knee;
598 const float ratio = self->v_ratio;
599 const float thresdb = self->v_thresdb;
600 const float makeup = self->v_makeup;
602 const float width = 6.f * knee + 0.01f;
605 if (2.f * (xg - thresdb) < -width) {
607 } else if (2.f * (xg - thresdb) > width) {
608 yg = thresdb + (xg - thresdb) / ratio;
610 yg = xg + (1.f / ratio - 1.f ) * (xg - thresdb + width / 2.f) * (xg - thresdb + width / 2.f) / (2.f * width);
619 render_inline_full (cairo_t* cr, const AComp* self)
621 const float w = self->w;
622 const float h = self->h;
624 const float makeup_thres = self->v_thresdb + self->v_makeup;
627 cairo_rectangle (cr, 0, 0, w, h);
628 cairo_set_source_rgba (cr, .2, .2, .2, 1.0);
631 cairo_set_line_width(cr, 1.0);
633 // draw grid 10dB steps
634 const double dash1[] = {1, 2};
635 const double dash2[] = {1, 3};
637 cairo_set_line_cap(cr, CAIRO_LINE_CAP_ROUND);
638 cairo_set_dash(cr, dash2, 2, 2);
639 cairo_set_source_rgba (cr, 0.5, 0.5, 0.5, 0.5);
641 for (uint32_t d = 1; d < 7; ++d) {
642 const float x = -.5 + floorf (w * (d * 10.f / 70.f));
643 const float y = -.5 + floorf (h * (d * 10.f / 70.f));
645 cairo_move_to (cr, x, 0);
646 cairo_line_to (cr, x, h);
649 cairo_move_to (cr, 0, y);
650 cairo_line_to (cr, w, y);
653 cairo_set_source_rgba (cr, 0.5, 0.5, 0.5, 1.0);
654 cairo_set_dash(cr, dash1, 2, 2);
655 if (self->v_thresdb < 0) {
656 const float y = -.5 + floorf (h * ((makeup_thres - 10.f) / -70.f));
657 cairo_move_to (cr, 0, y);
658 cairo_line_to (cr, w, y);
662 cairo_move_to (cr, 0, h);
663 cairo_line_to (cr, w, 0);
668 cairo_set_source_rgba (cr, 0.5, 0.5, 0.5, 0.5);
669 const float x = -.5 + floorf (w * (60.f / 70.f));
670 const float y = -.5 + floorf (h * (10.f / 70.f));
671 cairo_move_to (cr, x, 0);
672 cairo_line_to (cr, x, h);
674 cairo_move_to (cr, 0, y);
675 cairo_line_to (cr, w, y);
680 const float x = -.5 + floorf (w * (62.5f / 70.f));
681 const float y = -.5 + floorf (h * (10.0f / 70.f));
682 const float wd = floorf (w * (5.f / 70.f));
683 const float ht = floorf (h * (55.f / 70.f));
684 cairo_rectangle (cr, x, y, wd, ht);
687 const float h_gr = fminf (ht, floorf (h * self->v_gainr / 70.f));
688 cairo_set_source_rgba (cr, 0.95, 0.0, 0.0, 1.0);
689 cairo_rectangle (cr, x, y, wd, h_gr);
691 cairo_set_source_rgba (cr, 0.5, 0.5, 0.5, 0.5);
692 cairo_rectangle (cr, x, y, wd, ht);
693 cairo_set_source_rgba (cr, 0.75, 0.75, 0.75, 1.0);
698 cairo_set_source_rgba (cr, .8, .8, .8, 1.0);
699 cairo_move_to (cr, 0, h);
701 for (uint32_t x = 0; x < w; ++x) {
703 const float x_db = 70.f * (-1.f + x / (float)w) + 10.f;
704 const float y_db = comp_curve (self, x_db) - 10.f;
705 const float y = h * (y_db / -70.f);
706 cairo_line_to (cr, x, y);
708 cairo_stroke_preserve (cr);
710 cairo_line_to (cr, w, h);
711 cairo_close_path (cr);
714 // draw signal level & reduction/gradient
715 const float top = comp_curve (self, 0) - 10.f;
716 cairo_pattern_t* pat = cairo_pattern_create_linear (0.0, 0.0, 0.0, h);
717 if (top > makeup_thres - 10.f) {
718 cairo_pattern_add_color_stop_rgba (pat, 0.0, 0.8, 0.1, 0.1, 0.5);
719 cairo_pattern_add_color_stop_rgba (pat, top / -70.f, 0.8, 0.1, 0.1, 0.5);
721 if (self->v_knee > 0) {
722 cairo_pattern_add_color_stop_rgba (pat, ((makeup_thres -10.f) / -70.f), 0.7, 0.7, 0.2, 0.5);
723 cairo_pattern_add_color_stop_rgba (pat, ((makeup_thres - self->v_knee - 10.f) / -70.f), 0.5, 0.5, 0.5, 0.5);
725 cairo_pattern_add_color_stop_rgba (pat, ((makeup_thres - 10.f)/ -70.f), 0.7, 0.7, 0.2, 0.5);
726 cairo_pattern_add_color_stop_rgba (pat, ((makeup_thres - 10.01f) / -70.f), 0.5, 0.5, 0.5, 0.5);
728 cairo_pattern_add_color_stop_rgba (pat, 1.0, 0.5, 0.5, 0.5, 0.5);
730 // maybe cut off at x-position?
731 const float x = w * (self->v_lvl_in + 60) / 70.f;
732 const float y = x + h*self->v_makeup;
733 cairo_rectangle (cr, 0, h - y, x, y);
734 if (self->v_ratio > 1.0) {
735 cairo_set_source (cr, pat);
737 cairo_set_source_rgba (cr, 0.5, 0.5, 0.5, 0.5);
741 cairo_pattern_destroy (pat); // TODO cache pattern
745 render_inline_only_bars (cairo_t* cr, const AComp* self)
747 const float w = self->w;
748 const float h = self->h;
750 cairo_rectangle (cr, 0, 0, w, h);
751 cairo_set_source_rgba (cr, .2, .2, .2, 1.0);
757 const float ht = 0.25f * h;
759 const float x1 = w*0.05;
760 const float wd = w - 2.0f*x1;
762 const float y1 = 0.17*h;
763 const float y2 = h - y1 - ht;
765 cairo_set_source_rgba (cr, 0.5, 0.5, 0.5, 0.5);
767 cairo_rectangle (cr, x1, y1, wd, ht);
770 cairo_rectangle (cr, x1, y2, wd, ht);
773 cairo_set_source_rgba (cr, 0.75, 0.0, 0.0, 1.0);
774 const float w_gr = (self->v_gainr > 60.f) ? wd : wd * self->v_gainr * (1.f/60.f);
775 cairo_rectangle (cr, x1+wd-w_gr, y2, w_gr, ht);
778 if (self->v_lvl_out > -60.f) {
779 if (self->v_lvl_out > 10.f) {
780 cairo_set_source_rgba (cr, 0.75, 0.0, 0.0, 1.0);
781 } else if (self->v_lvl_out > 0.f) {
782 cairo_set_source_rgba (cr, 0.66, 0.66, 0.0, 1.0);
784 cairo_set_source_rgba (cr, 0.0, 0.66, 0.0, 1.0);
786 const float w_g = (self->v_lvl_out > 10.f) ? wd : wd * (60.f+self->v_lvl_out) / 70.f;
787 cairo_rectangle (cr, x1, y1, w_g, ht);
791 cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 1.0);
793 const float tck = 0.33*ht;
795 cairo_set_line_width (cr, .5);
797 for (uint32_t d = 1; d < 7; ++d) {
798 const float x = x1 + (d * wd * (10.f / 70.f));
800 cairo_move_to (cr, x, y1);
801 cairo_line_to (cr, x, y1+tck);
803 cairo_move_to (cr, x, y1+ht);
804 cairo_line_to (cr, x, y1+ht-tck);
806 cairo_move_to (cr, x, y2);
807 cairo_line_to (cr, x, y2+tck);
809 cairo_move_to (cr, x, y2+ht);
810 cairo_line_to (cr, x, y2+ht-tck);
815 const float x_0dB = x1 + wd*(60.f/70.f);
817 cairo_move_to (cr, x_0dB, y1);
818 cairo_line_to (cr, x_0dB, y1+ht);
820 cairo_rectangle (cr, x1, y1, wd, ht);
821 cairo_rectangle (cr, x1, y2, wd, ht);
824 cairo_set_line_width (cr, 2.0);
826 // visualize threshold
827 const float tr = x1 + wd * (60.f+self->v_thresdb) / 70.f;
828 cairo_set_source_rgba (cr, 0.95, 0.95, 0.0, 1.0);
829 cairo_move_to (cr, tr, y1);
830 cairo_line_to (cr, tr, y1+ht);
834 const float reduced_0dB = self->v_thresdb * (1.f - 1.f/self->v_ratio);
835 const float rt = x1 + wd * (60.f+reduced_0dB) / 70.f;
836 cairo_set_source_rgba (cr, 0.95, 0.0, 0.0, 1.0);
837 cairo_move_to (cr, rt, y1);
838 cairo_line_to (cr, rt, y1+ht);
842 static LV2_Inline_Display_Image_Surface *
843 render_inline (LV2_Handle instance, uint32_t w, uint32_t max_h)
845 AComp* self = (AComp*)instance;
847 uint32_t h = MIN (w, max_h);
852 if (!self->display || self->w != w || self->h != h) {
853 if (self->display) cairo_surface_destroy(self->display);
854 self->display = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, w, h);
859 cairo_t* cr = cairo_create (self->display);
862 render_inline_full (cr, self);
864 render_inline_only_bars (cr, self);
869 cairo_surface_flush (self->display);
870 self->surf.width = cairo_image_surface_get_width (self->display);
871 self->surf.height = cairo_image_surface_get_height (self->display);
872 self->surf.stride = cairo_image_surface_get_stride (self->display);
873 self->surf.data = cairo_image_surface_get_data (self->display);
880 extension_data(const char* uri)
883 static const LV2_Inline_Display_Interface display = { render_inline };
884 if (!strcmp(uri, LV2_INLINEDISPLAY__interface)) {
891 static const LV2_Descriptor descriptor_mono = {
902 static const LV2_Descriptor descriptor_stereo = {
914 const LV2_Descriptor*
915 lv2_descriptor(uint32_t index)
919 return &descriptor_mono;
921 return &descriptor_stereo;