JackTrip
freeverbmonodsp.h
Go to the documentation of this file.
1 /* ------------------------------------------------------------
2 name: "freeverbmonodsp"
3 Code generated with Faust 2.28.6 (https://faust.grame.fr)
4 Compilation options: -lang cpp -inpl -scal -ftz 0
5 ------------------------------------------------------------ */
6 
7 #ifndef __freeverbmonodsp_H__
8 #define __freeverbmonodsp_H__
9 
10 // NOTE: ANY INCLUDE-GUARD HERE MUST BE DERIVED FROM THE CLASS NAME
11 //
12 // faust2header.cpp - FAUST Architecture File
13 // This is a simple variation of matlabplot.cpp in the Faust distribution
14 // aimed at creating a simple C++ header file (.h) containing a Faust DSP.
15 // See the Makefile for how to use it.
16 
17 /************************** BEGIN dsp.h **************************/
18 /************************************************************************
19  FAUST Architecture File
20  Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale
21  ---------------------------------------------------------------------
22  This Architecture section is free software; you can redistribute it
23  and/or modify it under the terms of the GNU General Public License
24  as published by the Free Software Foundation; either version 3 of
25  the License, or (at your option) any later version.
26 
27  This program is distributed in the hope that it will be useful,
28  but WITHOUT ANY WARRANTY; without even the implied warranty of
29  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30  GNU General Public License for more details.
31 
32  You should have received a copy of the GNU General Public License
33  along with this program; If not, see <http://www.gnu.org/licenses/>.
34 
35  EXCEPTION : As a special exception, you may create a larger work
36  that contains this FAUST architecture section and distribute
37  that work under terms of your choice, so long as this FAUST
38  architecture section is not modified.
39  ************************************************************************/
40 
41 #ifndef __dsp__
42 #define __dsp__
43 
44 #include <string>
45 #include <vector>
46 
47 #ifndef FAUSTFLOAT
48 #define FAUSTFLOAT float
49 #endif
50 
51 struct UI;
52 struct Meta;
53 
58 struct dsp_memory_manager {
59 
60  virtual ~dsp_memory_manager() {}
61 
62  virtual void* allocate(size_t size) = 0;
63  virtual void destroy(void* ptr) = 0;
64 
65 };
66 
71 class dsp {
72 
73  public:
74 
75  dsp() {}
76  virtual ~dsp() {}
77 
78  /* Return instance number of audio inputs */
79  virtual int getNumInputs() = 0;
80 
81  /* Return instance number of audio outputs */
82  virtual int getNumOutputs() = 0;
83 
90  virtual void buildUserInterface(UI* ui_interface) = 0;
91 
92  /* Returns the sample rate currently used by the instance */
93  virtual int getSampleRate() = 0;
94 
102  virtual void init(int sample_rate) = 0;
103 
109  virtual void instanceInit(int sample_rate) = 0;
110 
116  virtual void instanceConstants(int sample_rate) = 0;
117 
118  /* Init default control parameters values */
119  virtual void instanceResetUserInterface() = 0;
120 
121  /* Init instance state (delay lines...) */
122  virtual void instanceClear() = 0;
123 
129  virtual dsp* clone() = 0;
130 
136  virtual void metadata(Meta* m) = 0;
137 
146  virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) = 0;
147 
157  virtual void compute(double /*date_usec*/, int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { compute(count, inputs, outputs); }
158 
159 };
160 
165 class decorator_dsp : public dsp {
166 
167  protected:
168 
169  dsp* fDSP;
170 
171  public:
172 
173  decorator_dsp(dsp* dsp = nullptr):fDSP(dsp) {}
174  virtual ~decorator_dsp() { delete fDSP; }
175 
176  virtual int getNumInputs() { return fDSP->getNumInputs(); }
177  virtual int getNumOutputs() { return fDSP->getNumOutputs(); }
178  virtual void buildUserInterface(UI* ui_interface) { fDSP->buildUserInterface(ui_interface); }
179  virtual int getSampleRate() { return fDSP->getSampleRate(); }
180  virtual void init(int sample_rate) { fDSP->init(sample_rate); }
181  virtual void instanceInit(int sample_rate) { fDSP->instanceInit(sample_rate); }
182  virtual void instanceConstants(int sample_rate) { fDSP->instanceConstants(sample_rate); }
184  virtual void instanceClear() { fDSP->instanceClear(); }
185  virtual decorator_dsp* clone() { return new decorator_dsp(fDSP->clone()); }
186  virtual void metadata(Meta* m) { fDSP->metadata(m); }
187  // Beware: subclasses usually have to overload the two 'compute' methods
188  virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { fDSP->compute(count, inputs, outputs); }
189  virtual void compute(double date_usec, int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { fDSP->compute(date_usec, count, inputs, outputs); }
190 
191 };
192 
197 class dsp_factory {
198 
199  protected:
200 
201  // So that to force sub-classes to use deleteDSPFactory(dsp_factory* factory);
202  virtual ~dsp_factory() {}
203 
204  public:
205 
206  virtual std::string getName() = 0;
207  virtual std::string getSHAKey() = 0;
208  virtual std::string getDSPCode() = 0;
209  virtual std::string getCompileOptions() = 0;
210  virtual std::vector<std::string> getLibraryList() = 0;
211  virtual std::vector<std::string> getIncludePathnames() = 0;
212 
213  virtual dsp* createDSPInstance() = 0;
214 
215  virtual void setMemoryManager(dsp_memory_manager* manager) = 0;
217 
218 };
219 
225 #ifdef __SSE__
226  #include <xmmintrin.h>
227  #ifdef __SSE2__
228  #define AVOIDDENORMALS _mm_setcsr(_mm_getcsr() | 0x8040)
229  #else
230  #define AVOIDDENORMALS _mm_setcsr(_mm_getcsr() | 0x8000)
231  #endif
232 #else
233  #define AVOIDDENORMALS
234 #endif
235 
236 #endif
237 /************************** END dsp.h **************************/
238 
239 /************************** BEGIN APIUI.h **************************/
240 /************************************************************************
241  FAUST Architecture File
242  Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale
243  ---------------------------------------------------------------------
244  This Architecture section is free software; you can redistribute it
245  and/or modify it under the terms of the GNU General Public License
246  as published by the Free Software Foundation; either version 3 of
247  the License, or (at your option) any later version.
248 
249  This program is distributed in the hope that it will be useful,
250  but WITHOUT ANY WARRANTY; without even the implied warranty of
251  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
252  GNU General Public License for more details.
253 
254  You should have received a copy of the GNU General Public License
255  along with this program; If not, see <http://www.gnu.org/licenses/>.
256 
257  EXCEPTION : As a special exception, you may create a larger work
258  that contains this FAUST architecture section and distribute
259  that work under terms of your choice, so long as this FAUST
260  architecture section is not modified.
261  ************************************************************************/
262 
263 #ifndef API_UI_H
264 #define API_UI_H
265 
266 #include <sstream>
267 #include <string>
268 #include <vector>
269 #include <iostream>
270 #include <map>
271 
272 /************************** BEGIN meta.h **************************/
273 /************************************************************************
274  FAUST Architecture File
275  Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale
276  ---------------------------------------------------------------------
277  This Architecture section is free software; you can redistribute it
278  and/or modify it under the terms of the GNU General Public License
279  as published by the Free Software Foundation; either version 3 of
280  the License, or (at your option) any later version.
281 
282  This program is distributed in the hope that it will be useful,
283  but WITHOUT ANY WARRANTY; without even the implied warranty of
284  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
285  GNU General Public License for more details.
286 
287  You should have received a copy of the GNU General Public License
288  along with this program; If not, see <http://www.gnu.org/licenses/>.
289 
290  EXCEPTION : As a special exception, you may create a larger work
291  that contains this FAUST architecture section and distribute
292  that work under terms of your choice, so long as this FAUST
293  architecture section is not modified.
294  ************************************************************************/
295 
296 #ifndef __meta__
297 #define __meta__
298 
299 struct Meta
300 {
301  virtual ~Meta() {};
302  virtual void declare(const char* key, const char* value) = 0;
303 
304 };
305 
306 #endif
307 /************************** END meta.h **************************/
308 /************************** BEGIN UI.h **************************/
309 /************************************************************************
310  FAUST Architecture File
311  Copyright (C) 2003-2020 GRAME, Centre National de Creation Musicale
312  ---------------------------------------------------------------------
313  This Architecture section is free software; you can redistribute it
314  and/or modify it under the terms of the GNU General Public License
315  as published by the Free Software Foundation; either version 3 of
316  the License, or (at your option) any later version.
317 
318  This program is distributed in the hope that it will be useful,
319  but WITHOUT ANY WARRANTY; without even the implied warranty of
320  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
321  GNU General Public License for more details.
322 
323  You should have received a copy of the GNU General Public License
324  along with this program; If not, see <http://www.gnu.org/licenses/>.
325 
326  EXCEPTION : As a special exception, you may create a larger work
327  that contains this FAUST architecture section and distribute
328  that work under terms of your choice, so long as this FAUST
329  architecture section is not modified.
330  ************************************************************************/
331 
332 #ifndef __UI_H__
333 #define __UI_H__
334 
335 #ifndef FAUSTFLOAT
336 #define FAUSTFLOAT float
337 #endif
338 
339 /*******************************************************************************
340  * UI : Faust DSP User Interface
341  * User Interface as expected by the buildUserInterface() method of a DSP.
342  * This abstract class contains only the method that the Faust compiler can
343  * generate to describe a DSP user interface.
344  ******************************************************************************/
345 
346 struct Soundfile;
347 
348 template <typename REAL>
349 struct UIReal
350 {
351  UIReal() {}
352  virtual ~UIReal() {}
353 
354  // -- widget's layouts
355 
356  virtual void openTabBox(const char* label) = 0;
357  virtual void openHorizontalBox(const char* label) = 0;
358  virtual void openVerticalBox(const char* label) = 0;
359  virtual void closeBox() = 0;
360 
361  // -- active widgets
362 
363  virtual void addButton(const char* label, REAL* zone) = 0;
364  virtual void addCheckButton(const char* label, REAL* zone) = 0;
365  virtual void addVerticalSlider(const char* label, REAL* zone, REAL init, REAL min, REAL max, REAL step) = 0;
366  virtual void addHorizontalSlider(const char* label, REAL* zone, REAL init, REAL min, REAL max, REAL step) = 0;
367  virtual void addNumEntry(const char* label, REAL* zone, REAL init, REAL min, REAL max, REAL step) = 0;
368 
369  // -- passive widgets
370 
371  virtual void addHorizontalBargraph(const char* label, REAL* zone, REAL min, REAL max) = 0;
372  virtual void addVerticalBargraph(const char* label, REAL* zone, REAL min, REAL max) = 0;
373 
374  // -- soundfiles
375 
376  virtual void addSoundfile(const char* label, const char* filename, Soundfile** sf_zone) = 0;
377 
378  // -- metadata declarations
379 
380  virtual void declare(REAL* zone, const char* key, const char* val) {}
381 };
382 
383 struct UI : public UIReal<FAUSTFLOAT>
384 {
385  UI() {}
386  virtual ~UI() {}
387 };
388 
389 #endif
390 /************************** END UI.h **************************/
391 /************************** BEGIN PathBuilder.h **************************/
392 /************************************************************************
393  FAUST Architecture File
394  Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale
395  ---------------------------------------------------------------------
396  This Architecture section is free software; you can redistribute it
397  and/or modify it under the terms of the GNU General Public License
398  as published by the Free Software Foundation; either version 3 of
399  the License, or (at your option) any later version.
400 
401  This program is distributed in the hope that it will be useful,
402  but WITHOUT ANY WARRANTY; without even the implied warranty of
403  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
404  GNU General Public License for more details.
405 
406  You should have received a copy of the GNU General Public License
407  along with this program; If not, see <http://www.gnu.org/licenses/>.
408 
409  EXCEPTION : As a special exception, you may create a larger work
410  that contains this FAUST architecture section and distribute
411  that work under terms of your choice, so long as this FAUST
412  architecture section is not modified.
413  ************************************************************************/
414 
415 #ifndef FAUST_PATHBUILDER_H
416 #define FAUST_PATHBUILDER_H
417 
418 #include <vector>
419 #include <string>
420 #include <algorithm>
421 
422 /*******************************************************************************
423  * PathBuilder : Faust User Interface
424  * Helper class to build complete hierarchical path for UI items.
425  ******************************************************************************/
426 
427 class PathBuilder
428 {
429 
430  protected:
431 
432  std::vector<std::string> fControlsLevel;
433 
434  public:
435 
437  virtual ~PathBuilder() {}
438 
439  std::string buildPath(const std::string& label)
440  {
441  std::string res = "/";
442  for (size_t i = 0; i < fControlsLevel.size(); i++) {
443  res += fControlsLevel[i];
444  res += "/";
445  }
446  res += label;
447  std::replace(res.begin(), res.end(), ' ', '_');
448  return res;
449  }
450 
451  std::string buildLabel(std::string label)
452  {
453  std::replace(label.begin(), label.end(), ' ', '_');
454  return label;
455  }
456 
457  void pushLabel(const std::string& label) { fControlsLevel.push_back(label); }
458  void popLabel() { fControlsLevel.pop_back(); }
459 
460 };
461 
462 #endif // FAUST_PATHBUILDER_H
463 /************************** END PathBuilder.h **************************/
464 /************************** BEGIN ValueConverter.h **************************/
465 /************************************************************************
466  FAUST Architecture File
467  Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale
468  ---------------------------------------------------------------------
469  This Architecture section is free software; you can redistribute it
470  and/or modify it under the terms of the GNU General Public License
471  as published by the Free Software Foundation; either version 3 of
472  the License, or (at your option) any later version.
473 
474  This program is distributed in the hope that it will be useful,
475  but WITHOUT ANY WARRANTY; without even the implied warranty of
476  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
477  GNU General Public License for more details.
478 
479  You should have received a copy of the GNU General Public License
480  along with this program; If not, see <http://www.gnu.org/licenses/>.
481 
482  EXCEPTION : As a special exception, you may create a larger work
483  that contains this FAUST architecture section and distribute
484  that work under terms of your choice, so long as this FAUST
485  architecture section is not modified.
486  ************************************************************************/
487 
488 #ifndef __ValueConverter__
489 #define __ValueConverter__
490 
491 /***************************************************************************************
492  ValueConverter.h
493  (GRAME, Copyright 2015-2019)
494 
495 Set of conversion objects used to map user interface values (for example a gui slider
496 delivering values between 0 and 1) to faust values (for example a vslider between
497 20 and 20000) using a log scale.
498 
499 -- Utilities
500 
501 Range(lo,hi) : clip a value x between lo and hi
502 Interpolator(lo,hi,v1,v2) : Maps a value x between lo and hi to a value y between v1 and v2
503 Interpolator3pt(lo,mi,hi,v1,vm,v2) : Map values between lo mid hi to values between v1 vm v2
504 
505 -- Value Converters
506 
507 ValueConverter::ui2faust(x)
508 ValueConverter::faust2ui(x)
509 
510 -- ValueConverters used for sliders depending of the scale
511 
512 LinearValueConverter(umin, umax, fmin, fmax)
513 LinearValueConverter2(lo, mi, hi, v1, vm, v2) using 2 segments
514 LogValueConverter(umin, umax, fmin, fmax)
515 ExpValueConverter(umin, umax, fmin, fmax)
516 
517 -- ValueConverters used for accelerometers based on 3 points
518 
519 AccUpConverter(amin, amid, amax, fmin, fmid, fmax) -- curve 0
520 AccDownConverter(amin, amid, amax, fmin, fmid, fmax) -- curve 1
521 AccUpDownConverter(amin, amid, amax, fmin, fmid, fmax) -- curve 2
522 AccDownUpConverter(amin, amid, amax, fmin, fmid, fmax) -- curve 3
523 
524 -- lists of ZoneControl are used to implement accelerometers metadata for each axes
525 
526 ZoneControl(zone, valueConverter) : a zone with an accelerometer data converter
527 
528 -- ZoneReader are used to implement screencolor metadata
529 
530 ZoneReader(zone, valueConverter) : a zone with a data converter
531 
532 ****************************************************************************************/
533 
534 #include <float.h>
535 #include <algorithm> // std::max
536 #include <cmath>
537 #include <vector>
538 #include <assert.h>
539 
540 //--------------------------------------------------------------------------------------
541 // Interpolator(lo,hi,v1,v2)
542 // Maps a value x between lo and hi to a value y between v1 and v2
543 // y = v1 + (x-lo)/(hi-lo)*(v2-v1)
544 // y = v1 + (x-lo) * coef with coef = (v2-v1)/(hi-lo)
545 // y = v1 + x*coef - lo*coef
546 // y = v1 - lo*coef + x*coef
547 // y = offset + x*coef with offset = v1 - lo*coef
548 //--------------------------------------------------------------------------------------
549 class Interpolator
550 {
551  private:
552 
553  //--------------------------------------------------------------------------------------
554  // Range(lo,hi) clip a value between lo and hi
555  //--------------------------------------------------------------------------------------
556  struct Range
557  {
558  double fLo;
559  double fHi;
560 
561  Range(double x, double y) : fLo(std::min<double>(x,y)), fHi(std::max<double>(x,y)) {}
562  double operator()(double x) { return (x<fLo) ? fLo : (x>fHi) ? fHi : x; }
563  };
564 
565 
566  Range fRange;
567  double fCoef;
568  double fOffset;
569 
570  public:
571 
572  Interpolator(double lo, double hi, double v1, double v2) : fRange(lo,hi)
573  {
574  if (hi != lo) {
575  // regular case
576  fCoef = (v2-v1)/(hi-lo);
577  fOffset = v1 - lo*fCoef;
578  } else {
579  // degenerate case, avoids division by zero
580  fCoef = 0;
581  fOffset = (v1+v2)/2;
582  }
583  }
584  double operator()(double v)
585  {
586  double x = fRange(v);
587  return fOffset + x*fCoef;
588  }
589 
590  void getLowHigh(double& amin, double& amax)
591  {
592  amin = fRange.fLo;
593  amax = fRange.fHi;
594  }
595 };
596 
597 //--------------------------------------------------------------------------------------
598 // Interpolator3pt(lo,mi,hi,v1,vm,v2)
599 // Map values between lo mid hi to values between v1 vm v2
600 //--------------------------------------------------------------------------------------
601 class Interpolator3pt
602 {
603 
604  private:
605 
606  Interpolator fSegment1;
607  Interpolator fSegment2;
608  double fMid;
609 
610  public:
611 
612  Interpolator3pt(double lo, double mi, double hi, double v1, double vm, double v2) :
613  fSegment1(lo, mi, v1, vm),
614  fSegment2(mi, hi, vm, v2),
615  fMid(mi) {}
616  double operator()(double x) { return (x < fMid) ? fSegment1(x) : fSegment2(x); }
617 
618  void getMappingValues(double& amin, double& amid, double& amax)
619  {
620  fSegment1.getLowHigh(amin, amid);
621  fSegment2.getLowHigh(amid, amax);
622  }
623 };
624 
625 //--------------------------------------------------------------------------------------
626 // Abstract ValueConverter class. Converts values between UI and Faust representations
627 //--------------------------------------------------------------------------------------
628 class ValueConverter
629 {
630 
631  public:
632 
633  virtual ~ValueConverter() {}
634  virtual double ui2faust(double x) = 0;
635  virtual double faust2ui(double x) = 0;
636 };
637 
638 //--------------------------------------------------------------------------------------
639 // A converter than can be updated
640 //--------------------------------------------------------------------------------------
641 
643 
644  protected:
645 
646  bool fActive;
647 
648  public:
649 
651  {}
653  {}
654 
655  virtual void setMappingValues(double amin, double amid, double amax, double min, double init, double max) = 0;
656  virtual void getMappingValues(double& amin, double& amid, double& amax) = 0;
657 
658  void setActive(bool on_off) { fActive = on_off; }
659  bool getActive() { return fActive; }
660 
661 };
662 
663 
664 //--------------------------------------------------------------------------------------
665 // Linear conversion between ui and Faust values
666 //--------------------------------------------------------------------------------------
668 {
669 
670  private:
671 
672  Interpolator fUI2F;
673  Interpolator fF2UI;
674 
675  public:
676 
677  LinearValueConverter(double umin, double umax, double fmin, double fmax) :
678  fUI2F(umin,umax,fmin,fmax), fF2UI(fmin,fmax,umin,umax)
679  {}
680 
681  LinearValueConverter() : fUI2F(0.,0.,0.,0.), fF2UI(0.,0.,0.,0.)
682  {}
683  virtual double ui2faust(double x) { return fUI2F(x); }
684  virtual double faust2ui(double x) { return fF2UI(x); }
685 
686 };
687 
688 //--------------------------------------------------------------------------------------
689 // Two segments linear conversion between ui and Faust values
690 //--------------------------------------------------------------------------------------
692 {
693 
694  private:
695 
696  Interpolator3pt fUI2F;
697  Interpolator3pt fF2UI;
698 
699  public:
700 
701  LinearValueConverter2(double amin, double amid, double amax, double min, double init, double max) :
702  fUI2F(amin, amid, amax, min, init, max), fF2UI(min, init, max, amin, amid, amax)
703  {}
704 
705  LinearValueConverter2() : fUI2F(0.,0.,0.,0.,0.,0.), fF2UI(0.,0.,0.,0.,0.,0.)
706  {}
707 
708  virtual double ui2faust(double x) { return fUI2F(x); }
709  virtual double faust2ui(double x) { return fF2UI(x); }
710 
711  virtual void setMappingValues(double amin, double amid, double amax, double min, double init, double max)
712  {
713  fUI2F = Interpolator3pt(amin, amid, amax, min, init, max);
714  fF2UI = Interpolator3pt(min, init, max, amin, amid, amax);
715  }
716 
717  virtual void getMappingValues(double& amin, double& amid, double& amax)
718  {
719  fUI2F.getMappingValues(amin, amid, amax);
720  }
721 
722 };
723 
724 //--------------------------------------------------------------------------------------
725 // Logarithmic conversion between ui and Faust values
726 //--------------------------------------------------------------------------------------
728 {
729 
730  public:
731 
732  LogValueConverter(double umin, double umax, double fmin, double fmax) :
733  LinearValueConverter(umin, umax, std::log(std::max<double>(DBL_MIN, fmin)), std::log(std::max<double>(DBL_MIN, fmax)))
734  {}
735 
736  virtual double ui2faust(double x) { return std::exp(LinearValueConverter::ui2faust(x)); }
737  virtual double faust2ui(double x) { return LinearValueConverter::faust2ui(std::log(std::max<double>(x, DBL_MIN))); }
738 
739 };
740 
741 //--------------------------------------------------------------------------------------
742 // Exponential conversion between ui and Faust values
743 //--------------------------------------------------------------------------------------
745 {
746 
747  public:
748 
749  ExpValueConverter(double umin, double umax, double fmin, double fmax) :
750  LinearValueConverter(umin, umax, std::min<double>(DBL_MAX, std::exp(fmin)), std::min<double>(DBL_MAX, std::exp(fmax)))
751  {}
752 
753  virtual double ui2faust(double x) { return std::log(LinearValueConverter::ui2faust(x)); }
754  virtual double faust2ui(double x) { return LinearValueConverter::faust2ui(std::min<double>(DBL_MAX, std::exp(x))); }
755 
756 };
757 
758 //--------------------------------------------------------------------------------------
759 // Convert accelerometer or gyroscope values to Faust values
760 // Using an Up curve (curve 0)
761 //--------------------------------------------------------------------------------------
763 {
764 
765  private:
766 
767  Interpolator3pt fA2F;
768  Interpolator3pt fF2A;
769 
770  public:
771 
772  AccUpConverter(double amin, double amid, double amax, double fmin, double fmid, double fmax) :
773  fA2F(amin,amid,amax,fmin,fmid,fmax),
774  fF2A(fmin,fmid,fmax,amin,amid,amax)
775  {}
776 
777  virtual double ui2faust(double x) { return fA2F(x); }
778  virtual double faust2ui(double x) { return fF2A(x); }
779 
780  virtual void setMappingValues(double amin, double amid, double amax, double fmin, double fmid, double fmax)
781  {
782  //__android_log_print(ANDROID_LOG_ERROR, "Faust", "AccUpConverter update %f %f %f %f %f %f", amin,amid,amax,fmin,fmid,fmax);
783  fA2F = Interpolator3pt(amin, amid, amax, fmin, fmid, fmax);
784  fF2A = Interpolator3pt(fmin, fmid, fmax, amin, amid, amax);
785  }
786 
787  virtual void getMappingValues(double& amin, double& amid, double& amax)
788  {
789  fA2F.getMappingValues(amin, amid, amax);
790  }
791 
792 };
793 
794 //--------------------------------------------------------------------------------------
795 // Convert accelerometer or gyroscope values to Faust values
796 // Using a Down curve (curve 1)
797 //--------------------------------------------------------------------------------------
799 {
800 
801  private:
802 
803  Interpolator3pt fA2F;
804  Interpolator3pt fF2A;
805 
806  public:
807 
808  AccDownConverter(double amin, double amid, double amax, double fmin, double fmid, double fmax) :
809  fA2F(amin,amid,amax,fmax,fmid,fmin),
810  fF2A(fmin,fmid,fmax,amax,amid,amin)
811  {}
812 
813  virtual double ui2faust(double x) { return fA2F(x); }
814  virtual double faust2ui(double x) { return fF2A(x); }
815 
816  virtual void setMappingValues(double amin, double amid, double amax, double fmin, double fmid, double fmax)
817  {
818  //__android_log_print(ANDROID_LOG_ERROR, "Faust", "AccDownConverter update %f %f %f %f %f %f", amin,amid,amax,fmin,fmid,fmax);
819  fA2F = Interpolator3pt(amin, amid, amax, fmax, fmid, fmin);
820  fF2A = Interpolator3pt(fmin, fmid, fmax, amax, amid, amin);
821  }
822 
823  virtual void getMappingValues(double& amin, double& amid, double& amax)
824  {
825  fA2F.getMappingValues(amin, amid, amax);
826  }
827 };
828 
829 //--------------------------------------------------------------------------------------
830 // Convert accelerometer or gyroscope values to Faust values
831 // Using an Up-Down curve (curve 2)
832 //--------------------------------------------------------------------------------------
834 {
835 
836  private:
837 
838  Interpolator3pt fA2F;
839  Interpolator fF2A;
840 
841  public:
842 
843  AccUpDownConverter(double amin, double amid, double amax, double fmin, double fmid, double fmax) :
844  fA2F(amin,amid,amax,fmin,fmax,fmin),
845  fF2A(fmin,fmax,amin,amax) // Special, pseudo inverse of a non monotonic function
846  {}
847 
848  virtual double ui2faust(double x) { return fA2F(x); }
849  virtual double faust2ui(double x) { return fF2A(x); }
850 
851  virtual void setMappingValues(double amin, double amid, double amax, double fmin, double fmid, double fmax)
852  {
853  //__android_log_print(ANDROID_LOG_ERROR, "Faust", "AccUpDownConverter update %f %f %f %f %f %f", amin,amid,amax,fmin,fmid,fmax);
854  fA2F = Interpolator3pt(amin, amid, amax, fmin, fmax, fmin);
855  fF2A = Interpolator(fmin, fmax, amin, amax);
856  }
857 
858  virtual void getMappingValues(double& amin, double& amid, double& amax)
859  {
860  fA2F.getMappingValues(amin, amid, amax);
861  }
862 };
863 
864 //--------------------------------------------------------------------------------------
865 // Convert accelerometer or gyroscope values to Faust values
866 // Using a Down-Up curve (curve 3)
867 //--------------------------------------------------------------------------------------
869 {
870 
871  private:
872 
873  Interpolator3pt fA2F;
874  Interpolator fF2A;
875 
876  public:
877 
878  AccDownUpConverter(double amin, double amid, double amax, double fmin, double fmid, double fmax) :
879  fA2F(amin,amid,amax,fmax,fmin,fmax),
880  fF2A(fmin,fmax,amin,amax) // Special, pseudo inverse of a non monotonic function
881  {}
882 
883  virtual double ui2faust(double x) { return fA2F(x); }
884  virtual double faust2ui(double x) { return fF2A(x); }
885 
886  virtual void setMappingValues(double amin, double amid, double amax, double fmin, double fmid, double fmax)
887  {
888  //__android_log_print(ANDROID_LOG_ERROR, "Faust", "AccDownUpConverter update %f %f %f %f %f %f", amin,amid,amax,fmin,fmid,fmax);
889  fA2F = Interpolator3pt(amin, amid, amax, fmax, fmin, fmax);
890  fF2A = Interpolator(fmin, fmax, amin, amax);
891  }
892 
893  virtual void getMappingValues(double& amin, double& amid, double& amax)
894  {
895  fA2F.getMappingValues(amin, amid, amax);
896  }
897 };
898 
899 //--------------------------------------------------------------------------------------
900 // Base class for ZoneControl
901 //--------------------------------------------------------------------------------------
902 class ZoneControl
903 {
904 
905  protected:
906 
907  FAUSTFLOAT* fZone;
908 
909  public:
910 
911  ZoneControl(FAUSTFLOAT* zone) : fZone(zone) {}
912  virtual ~ZoneControl() {}
913 
914  virtual void update(double v) const {}
915 
916  virtual void setMappingValues(int curve, double amin, double amid, double amax, double min, double init, double max) {}
917  virtual void getMappingValues(double& amin, double& amid, double& amax) {}
918 
919  FAUSTFLOAT* getZone() { return fZone; }
920 
921  virtual void setActive(bool on_off) {}
922  virtual bool getActive() { return false; }
923 
924  virtual int getCurve() { return -1; }
925 
926 };
927 
928 //--------------------------------------------------------------------------------------
929 // Useful to implement accelerometers metadata as a list of ZoneControl for each axes
930 //--------------------------------------------------------------------------------------
931 class ConverterZoneControl : public ZoneControl
932 {
933 
934  protected:
935 
937 
938  public:
939 
941  virtual ~ConverterZoneControl() { delete fValueConverter; } // Assuming fValueConverter is not kept elsewhere...
942 
943  virtual void update(double v) const { *fZone = fValueConverter->ui2faust(v); }
944 
946 
947 };
948 
949 //--------------------------------------------------------------------------------------
950 // Association of a zone and a four value converter, each one for each possible curve.
951 // Useful to implement accelerometers metadata as a list of ZoneControl for each axes
952 //--------------------------------------------------------------------------------------
953 class CurveZoneControl : public ZoneControl
954 {
955 
956  private:
957 
958  std::vector<UpdatableValueConverter*> fValueConverters;
959  int fCurve;
960 
961  public:
962 
963  CurveZoneControl(FAUSTFLOAT* zone, int curve, double amin, double amid, double amax, double min, double init, double max) : ZoneControl(zone), fCurve(0)
964  {
965  assert(curve >= 0 && curve <= 3);
966  fValueConverters.push_back(new AccUpConverter(amin, amid, amax, min, init, max));
967  fValueConverters.push_back(new AccDownConverter(amin, amid, amax, min, init, max));
968  fValueConverters.push_back(new AccUpDownConverter(amin, amid, amax, min, init, max));
969  fValueConverters.push_back(new AccDownUpConverter(amin, amid, amax, min, init, max));
970  fCurve = curve;
971  }
973  {
974  std::vector<UpdatableValueConverter*>::iterator it;
975  for (it = fValueConverters.begin(); it != fValueConverters.end(); it++) {
976  delete(*it);
977  }
978  }
979  void update(double v) const { if (fValueConverters[fCurve]->getActive()) *fZone = fValueConverters[fCurve]->ui2faust(v); }
980 
981  void setMappingValues(int curve, double amin, double amid, double amax, double min, double init, double max)
982  {
983  fValueConverters[curve]->setMappingValues(amin, amid, amax, min, init, max);
984  fCurve = curve;
985  }
986 
987  void getMappingValues(double& amin, double& amid, double& amax)
988  {
989  fValueConverters[fCurve]->getMappingValues(amin, amid, amax);
990  }
991 
992  void setActive(bool on_off)
993  {
994  std::vector<UpdatableValueConverter*>::iterator it;
995  for (it = fValueConverters.begin(); it != fValueConverters.end(); it++) {
996  (*it)->setActive(on_off);
997  }
998  }
999 
1000  int getCurve() { return fCurve; }
1001 };
1002 
1003 class ZoneReader
1004 {
1005 
1006  private:
1007 
1008  FAUSTFLOAT* fZone;
1009  Interpolator fInterpolator;
1010 
1011  public:
1012 
1013  ZoneReader(FAUSTFLOAT* zone, double lo, double hi) : fZone(zone), fInterpolator(lo, hi, 0, 255) {}
1014 
1015  virtual ~ZoneReader() {}
1016 
1017  int getValue()
1018  {
1019  return (fZone != nullptr) ? int(fInterpolator(*fZone)) : 127;
1020  }
1021 
1022 };
1023 
1024 #endif
1025 /************************** END ValueConverter.h **************************/
1026 
1027 class APIUI : public PathBuilder, public Meta, public UI
1028 {
1029  public:
1030 
1032 
1033  protected:
1034 
1035  enum { kLin = 0, kLog = 1, kExp = 2 };
1036 
1037  int fNumParameters;
1038  std::vector<std::string> fPaths;
1039  std::vector<std::string> fLabels;
1040  std::map<std::string, int> fPathMap;
1041  std::map<std::string, int> fLabelMap;
1042  std::vector<ValueConverter*> fConversion;
1043  std::vector<FAUSTFLOAT*> fZone;
1044  std::vector<FAUSTFLOAT> fInit;
1045  std::vector<FAUSTFLOAT> fMin;
1046  std::vector<FAUSTFLOAT> fMax;
1047  std::vector<FAUSTFLOAT> fStep;
1048  std::vector<ItemType> fItemType;
1049  std::vector<std::map<std::string, std::string> > fMetaData;
1050  std::vector<ZoneControl*> fAcc[3];
1051  std::vector<ZoneControl*> fGyr[3];
1052 
1053  // Screen color control
1054  // "...[screencolor:red]..." etc.
1055  bool fHasScreenControl; // true if control screen color metadata
1059 
1060  // Current values controlled by metadata
1061  std::string fCurrentUnit;
1062  int fCurrentScale;
1063  std::string fCurrentAcc;
1064  std::string fCurrentGyr;
1065  std::string fCurrentColor;
1066  std::string fCurrentTooltip;
1067  std::map<std::string, std::string> fCurrentMetadata;
1068 
1069  // Add a generic parameter
1070  virtual void addParameter(const char* label,
1071  FAUSTFLOAT* zone,
1072  FAUSTFLOAT init,
1073  FAUSTFLOAT min,
1074  FAUSTFLOAT max,
1075  FAUSTFLOAT step,
1076  ItemType type)
1077  {
1078  std::string path = buildPath(label);
1079  fPathMap[path] = fLabelMap[label] = fNumParameters++;
1080  fPaths.push_back(path);
1081  fLabels.push_back(label);
1082  fZone.push_back(zone);
1083  fInit.push_back(init);
1084  fMin.push_back(min);
1085  fMax.push_back(max);
1086  fStep.push_back(step);
1087  fItemType.push_back(type);
1088 
1089  // handle scale metadata
1090  switch (fCurrentScale) {
1091  case kLin:
1092  fConversion.push_back(new LinearValueConverter(0, 1, min, max));
1093  break;
1094  case kLog:
1095  fConversion.push_back(new LogValueConverter(0, 1, min, max));
1096  break;
1097  case kExp: fConversion.push_back(new ExpValueConverter(0, 1, min, max));
1098  break;
1099  }
1100  fCurrentScale = kLin;
1101 
1102  if (fCurrentAcc.size() > 0 && fCurrentGyr.size() > 0) {
1103  std::cerr << "warning : 'acc' and 'gyr' metadata used for the same " << label << " parameter !!\n";
1104  }
1105 
1106  // handle acc metadata "...[acc : <axe> <curve> <amin> <amid> <amax>]..."
1107  if (fCurrentAcc.size() > 0) {
1108  std::istringstream iss(fCurrentAcc);
1109  int axe, curve;
1110  double amin, amid, amax;
1111  iss >> axe >> curve >> amin >> amid >> amax;
1112 
1113  if ((0 <= axe) && (axe < 3) &&
1114  (0 <= curve) && (curve < 4) &&
1115  (amin < amax) && (amin <= amid) && (amid <= amax))
1116  {
1117  fAcc[axe].push_back(new CurveZoneControl(zone, curve, amin, amid, amax, min, init, max));
1118  } else {
1119  std::cerr << "incorrect acc metadata : " << fCurrentAcc << std::endl;
1120  }
1121  fCurrentAcc = "";
1122  }
1123 
1124  // handle gyr metadata "...[gyr : <axe> <curve> <amin> <amid> <amax>]..."
1125  if (fCurrentGyr.size() > 0) {
1126  std::istringstream iss(fCurrentGyr);
1127  int axe, curve;
1128  double amin, amid, amax;
1129  iss >> axe >> curve >> amin >> amid >> amax;
1130 
1131  if ((0 <= axe) && (axe < 3) &&
1132  (0 <= curve) && (curve < 4) &&
1133  (amin < amax) && (amin <= amid) && (amid <= amax))
1134  {
1135  fGyr[axe].push_back(new CurveZoneControl(zone, curve, amin, amid, amax, min, init, max));
1136  } else {
1137  std::cerr << "incorrect gyr metadata : " << fCurrentGyr << std::endl;
1138  }
1139  fCurrentGyr = "";
1140  }
1141 
1142  // handle screencolor metadata "...[screencolor:red|green|blue|white]..."
1143  if (fCurrentColor.size() > 0) {
1144  if ((fCurrentColor == "red") && (fRedReader == 0)) {
1145  fRedReader = new ZoneReader(zone, min, max);
1146  fHasScreenControl = true;
1147  } else if ((fCurrentColor == "green") && (fGreenReader == 0)) {
1148  fGreenReader = new ZoneReader(zone, min, max);
1149  fHasScreenControl = true;
1150  } else if ((fCurrentColor == "blue") && (fBlueReader == 0)) {
1151  fBlueReader = new ZoneReader(zone, min, max);
1152  fHasScreenControl = true;
1153  } else if ((fCurrentColor == "white") && (fRedReader == 0) && (fGreenReader == 0) && (fBlueReader == 0)) {
1154  fRedReader = new ZoneReader(zone, min, max);
1155  fGreenReader = new ZoneReader(zone, min, max);
1156  fBlueReader = new ZoneReader(zone, min, max);
1157  fHasScreenControl = true;
1158  } else {
1159  std::cerr << "incorrect screencolor metadata : " << fCurrentColor << std::endl;
1160  }
1161  }
1162  fCurrentColor = "";
1163 
1164  fMetaData.push_back(fCurrentMetadata);
1165  fCurrentMetadata.clear();
1166  }
1167 
1168  int getZoneIndex(std::vector<ZoneControl*>* table, int p, int val)
1169  {
1170  FAUSTFLOAT* zone = fZone[p];
1171  for (size_t i = 0; i < table[val].size(); i++) {
1172  if (zone == table[val][i]->getZone()) return int(i);
1173  }
1174  return -1;
1175  }
1176 
1177  void setConverter(std::vector<ZoneControl*>* table, int p, int val, int curve, double amin, double amid, double amax)
1178  {
1179  int id1 = getZoneIndex(table, p, 0);
1180  int id2 = getZoneIndex(table, p, 1);
1181  int id3 = getZoneIndex(table, p, 2);
1182 
1183  // Deactivates everywhere..
1184  if (id1 != -1) table[0][id1]->setActive(false);
1185  if (id2 != -1) table[1][id2]->setActive(false);
1186  if (id3 != -1) table[2][id3]->setActive(false);
1187 
1188  if (val == -1) { // Means: no more mapping...
1189  // So stay all deactivated...
1190  } else {
1191  int id4 = getZoneIndex(table, p, val);
1192  if (id4 != -1) {
1193  // Reactivate the one we edit...
1194  table[val][id4]->setMappingValues(curve, amin, amid, amax, fMin[p], fInit[p], fMax[p]);
1195  table[val][id4]->setActive(true);
1196  } else {
1197  // Allocate a new CurveZoneControl which is 'active' by default
1198  FAUSTFLOAT* zone = fZone[p];
1199  table[val].push_back(new CurveZoneControl(zone, curve, amin, amid, amax, fMin[p], fInit[p], fMax[p]));
1200  }
1201  }
1202  }
1203 
1204  void getConverter(std::vector<ZoneControl*>* table, int p, int& val, int& curve, double& amin, double& amid, double& amax)
1205  {
1206  int id1 = getZoneIndex(table, p, 0);
1207  int id2 = getZoneIndex(table, p, 1);
1208  int id3 = getZoneIndex(table, p, 2);
1209 
1210  if (id1 != -1) {
1211  val = 0;
1212  curve = table[val][id1]->getCurve();
1213  table[val][id1]->getMappingValues(amin, amid, amax);
1214  } else if (id2 != -1) {
1215  val = 1;
1216  curve = table[val][id2]->getCurve();
1217  table[val][id2]->getMappingValues(amin, amid, amax);
1218  } else if (id3 != -1) {
1219  val = 2;
1220  curve = table[val][id3]->getCurve();
1221  table[val][id3]->getMappingValues(amin, amid, amax);
1222  } else {
1223  val = -1; // No mapping
1224  curve = 0;
1225  amin = -100.;
1226  amid = 0.;
1227  amax = 100.;
1228  }
1229  }
1230 
1231  public:
1232 
1233  enum Type { kAcc = 0, kGyr = 1, kNoType };
1234 
1236  {}
1237 
1238  virtual ~APIUI()
1239  {
1240  for (auto& it : fConversion) delete it;
1241  for (int i = 0; i < 3; i++) {
1242  for (auto& it : fAcc[i]) delete it;
1243  for (auto& it : fGyr[i]) delete it;
1244  }
1245  delete fRedReader;
1246  delete fGreenReader;
1247  delete fBlueReader;
1248  }
1249 
1250  // -- widget's layouts
1251 
1252  virtual void openTabBox(const char* label) { pushLabel(label); }
1253  virtual void openHorizontalBox(const char* label) { pushLabel(label); }
1254  virtual void openVerticalBox(const char* label) { pushLabel(label); }
1255  virtual void closeBox() { popLabel(); }
1256 
1257  // -- active widgets
1258 
1259  virtual void addButton(const char* label, FAUSTFLOAT* zone)
1260  {
1261  addParameter(label, zone, 0, 0, 1, 1, kButton);
1262  }
1263 
1264  virtual void addCheckButton(const char* label, FAUSTFLOAT* zone)
1265  {
1266  addParameter(label, zone, 0, 0, 1, 1, kCheckButton);
1267  }
1268 
1269  virtual void addVerticalSlider(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT step)
1270  {
1271  addParameter(label, zone, init, min, max, step, kVSlider);
1272  }
1273 
1274  virtual void addHorizontalSlider(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT step)
1275  {
1276  addParameter(label, zone, init, min, max, step, kHSlider);
1277  }
1278 
1279  virtual void addNumEntry(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT step)
1280  {
1281  addParameter(label, zone, init, min, max, step, kNumEntry);
1282  }
1283 
1284  // -- passive widgets
1285 
1286  virtual void addHorizontalBargraph(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT min, FAUSTFLOAT max)
1287  {
1288  addParameter(label, zone, min, min, max, (max-min)/1000.0, kHBargraph);
1289  }
1290 
1291  virtual void addVerticalBargraph(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT min, FAUSTFLOAT max)
1292  {
1293  addParameter(label, zone, min, min, max, (max-min)/1000.0, kVBargraph);
1294  }
1295 
1296  // -- soundfiles
1297 
1298  virtual void addSoundfile(const char* label, const char* filename, Soundfile** sf_zone) {}
1299 
1300  // -- metadata declarations
1301 
1302  virtual void declare(FAUSTFLOAT* zone, const char* key, const char* val)
1303  {
1304  // Keep metadata
1305  fCurrentMetadata[key] = val;
1306 
1307  if (strcmp(key, "scale") == 0) {
1308  if (strcmp(val, "log") == 0) {
1309  fCurrentScale = kLog;
1310  } else if (strcmp(val, "exp") == 0) {
1311  fCurrentScale = kExp;
1312  } else {
1313  fCurrentScale = kLin;
1314  }
1315  } else if (strcmp(key, "unit") == 0) {
1316  fCurrentUnit = val;
1317  } else if (strcmp(key, "acc") == 0) {
1318  fCurrentAcc = val;
1319  } else if (strcmp(key, "gyr") == 0) {
1320  fCurrentGyr = val;
1321  } else if (strcmp(key, "screencolor") == 0) {
1322  fCurrentColor = val; // val = "red", "green", "blue" or "white"
1323  } else if (strcmp(key, "tooltip") == 0) {
1324  fCurrentTooltip = val;
1325  }
1326  }
1327 
1328  virtual void declare(const char* key, const char* val)
1329  {}
1330 
1331  //-------------------------------------------------------------------------------
1332  // Simple API part
1333  //-------------------------------------------------------------------------------
1334  int getParamsCount() { return fNumParameters; }
1335  int getParamIndex(const char* path)
1336  {
1337  if (fPathMap.find(path) != fPathMap.end()) {
1338  return fPathMap[path];
1339  } else if (fLabelMap.find(path) != fLabelMap.end()) {
1340  return fLabelMap[path];
1341  } else {
1342  return -1;
1343  }
1344  }
1345  const char* getParamAddress(int p) { return fPaths[p].c_str(); }
1346  const char* getParamLabel(int p) { return fLabels[p].c_str(); }
1347  std::map<const char*, const char*> getMetadata(int p)
1348  {
1349  std::map<const char*, const char*> res;
1350  std::map<std::string, std::string> metadata = fMetaData[p];
1351  for (auto it : metadata) {
1352  res[it.first.c_str()] = it.second.c_str();
1353  }
1354  return res;
1355  }
1356 
1357  const char* getMetadata(int p, const char* key)
1358  {
1359  return (fMetaData[p].find(key) != fMetaData[p].end()) ? fMetaData[p][key].c_str() : "";
1360  }
1361  FAUSTFLOAT getParamMin(int p) { return fMin[p]; }
1362  FAUSTFLOAT getParamMax(int p) { return fMax[p]; }
1363  FAUSTFLOAT getParamStep(int p) { return fStep[p]; }
1364  FAUSTFLOAT getParamInit(int p) { return fInit[p]; }
1365 
1366  FAUSTFLOAT* getParamZone(int p) { return fZone[p]; }
1367  FAUSTFLOAT getParamValue(int p) { return *fZone[p]; }
1368  void setParamValue(int p, FAUSTFLOAT v) { *fZone[p] = v; }
1369 
1370  double getParamRatio(int p) { return fConversion[p]->faust2ui(*fZone[p]); }
1371  void setParamRatio(int p, double r) { *fZone[p] = fConversion[p]->ui2faust(r); }
1372 
1373  double value2ratio(int p, double r) { return fConversion[p]->faust2ui(r); }
1374  double ratio2value(int p, double r) { return fConversion[p]->ui2faust(r); }
1375 
1384  {
1385  if (p >= 0) {
1386  if (getZoneIndex(fAcc, p, 0) != -1
1387  || getZoneIndex(fAcc, p, 1) != -1
1388  || getZoneIndex(fAcc, p, 2) != -1) {
1389  return kAcc;
1390  } else if (getZoneIndex(fGyr, p, 0) != -1
1391  || getZoneIndex(fGyr, p, 1) != -1
1392  || getZoneIndex(fGyr, p, 2) != -1) {
1393  return kGyr;
1394  }
1395  }
1396  return kNoType;
1397  }
1398 
1407  {
1408  return fItemType[p];
1409  }
1410 
1418  void propagateAcc(int acc, double value)
1419  {
1420  for (size_t i = 0; i < fAcc[acc].size(); i++) {
1421  fAcc[acc][i]->update(value);
1422  }
1423  }
1424 
1436  void setAccConverter(int p, int acc, int curve, double amin, double amid, double amax)
1437  {
1438  setConverter(fAcc, p, acc, curve, amin, amid, amax);
1439  }
1440 
1452  void setGyrConverter(int p, int gyr, int curve, double amin, double amid, double amax)
1453  {
1454  setConverter(fGyr, p, gyr, curve, amin, amid, amax);
1455  }
1456 
1468  void getAccConverter(int p, int& acc, int& curve, double& amin, double& amid, double& amax)
1469  {
1470  getConverter(fAcc, p, acc, curve, amin, amid, amax);
1471  }
1472 
1484  void getGyrConverter(int p, int& gyr, int& curve, double& amin, double& amid, double& amax)
1485  {
1486  getConverter(fGyr, p, gyr, curve, amin, amid, amax);
1487  }
1488 
1496  void propagateGyr(int gyr, double value)
1497  {
1498  for (size_t i = 0; i < fGyr[gyr].size(); i++) {
1499  fGyr[gyr][i]->update(value);
1500  }
1501  }
1502 
1510  int getAccCount(int acc)
1511  {
1512  return (acc >= 0 && acc < 3) ? int(fAcc[acc].size()) : 0;
1513  }
1514 
1522  int getGyrCount(int gyr)
1523  {
1524  return (gyr >= 0 && gyr < 3) ? int(fGyr[gyr].size()) : 0;
1525  }
1526 
1527  // getScreenColor() : -1 means no screen color control (no screencolor metadata found)
1528  // otherwise return 0x00RRGGBB a ready to use color
1530  {
1531  if (fHasScreenControl) {
1532  int r = (fRedReader) ? fRedReader->getValue() : 0;
1533  int g = (fGreenReader) ? fGreenReader->getValue() : 0;
1534  int b = (fBlueReader) ? fBlueReader->getValue() : 0;
1535  return (r<<16) | (g<<8) | b;
1536  } else {
1537  return -1;
1538  }
1539  }
1540 
1541 };
1542 
1543 #endif
1544 /************************** END APIUI.h **************************/
1545 
1546 // NOTE: "faust -scn name" changes the last line above to
1547 // #include <faust/name/name.h>
1548 
1549 //----------------------------------------------------------------------------
1550 // FAUST Generated Code
1551 //----------------------------------------------------------------------------
1552 
1553 
1554 #ifndef FAUSTFLOAT
1555 #define FAUSTFLOAT float
1556 #endif
1557 
1558 #include <algorithm>
1559 #include <cmath>
1560 #include <math.h>
1561 
1562 
1563 #ifndef FAUSTCLASS
1564 #define FAUSTCLASS freeverbmonodsp
1565 #endif
1566 
1567 #ifdef __APPLE__
1568 #define exp10f __exp10f
1569 #define exp10 __exp10
1570 #endif
1571 
1572 class freeverbmonodsp : public dsp {
1573 
1574  private:
1575 
1576  FAUSTFLOAT fVslider0;
1577  int fSampleRate;
1578  float fConst0;
1579  float fConst1;
1580  FAUSTFLOAT fVslider1;
1581  float fConst2;
1582  FAUSTFLOAT fVslider2;
1583  float fRec9[2];
1584  int IOTA;
1585  float fVec0[8192];
1586  int iConst3;
1587  float fConst4;
1588  FAUSTFLOAT fVslider3;
1589  float fRec8[2];
1590  float fRec11[2];
1591  float fVec1[8192];
1592  int iConst5;
1593  float fRec10[2];
1594  float fRec13[2];
1595  float fVec2[8192];
1596  int iConst6;
1597  float fRec12[2];
1598  float fRec15[2];
1599  float fVec3[8192];
1600  int iConst7;
1601  float fRec14[2];
1602  float fRec17[2];
1603  float fVec4[8192];
1604  int iConst8;
1605  float fRec16[2];
1606  float fRec19[2];
1607  float fVec5[8192];
1608  int iConst9;
1609  float fRec18[2];
1610  float fRec21[2];
1611  float fVec6[8192];
1612  int iConst10;
1613  float fRec20[2];
1614  float fRec23[2];
1615  float fVec7[8192];
1616  int iConst11;
1617  float fRec22[2];
1618  float fVec8[2048];
1619  int iConst12;
1620  float fRec6[2];
1621  float fVec9[2048];
1622  int iConst13;
1623  float fRec4[2];
1624  float fVec10[2048];
1625  int iConst14;
1626  float fRec2[2];
1627  float fVec11[2048];
1628  int iConst15;
1629  float fRec0[2];
1630  float fRec33[2];
1631  float fVec12[8192];
1632  float fRec32[2];
1633  float fRec35[2];
1634  float fVec13[8192];
1635  float fRec34[2];
1636  float fRec37[2];
1637  float fVec14[8192];
1638  float fRec36[2];
1639  float fRec39[2];
1640  float fVec15[8192];
1641  float fRec38[2];
1642  float fRec41[2];
1643  float fVec16[8192];
1644  float fRec40[2];
1645  float fRec43[2];
1646  float fVec17[8192];
1647  float fRec42[2];
1648  float fRec45[2];
1649  float fVec18[8192];
1650  float fRec44[2];
1651  float fRec47[2];
1652  float fVec19[8192];
1653  float fRec46[2];
1654  float fVec20[2048];
1655  int iConst16;
1656  float fRec30[2];
1657  float fVec21[2048];
1658  int iConst17;
1659  float fRec28[2];
1660  float fVec22[2048];
1661  int iConst18;
1662  float fRec26[2];
1663  float fVec23[1024];
1664  int iConst19;
1665  float fRec24[2];
1666 
1667  public:
1668 
1669  void metadata(Meta* m) {
1670  m->declare("delays.lib/name", "Faust Delay Library");
1671  m->declare("delays.lib/version", "0.1");
1672  m->declare("filename", "freeverbmonodsp.dsp");
1673  m->declare("filters.lib/allpass_comb:author", "Julius O. Smith III");
1674  m->declare("filters.lib/allpass_comb:copyright", "Copyright (C) 2003-2019 by Julius O. Smith III <jos@ccrma.stanford.edu>");
1675  m->declare("filters.lib/allpass_comb:license", "MIT-style STK-4.3 license");
1676  m->declare("filters.lib/lowpass0_highpass1", "MIT-style STK-4.3 license");
1677  m->declare("filters.lib/name", "Faust Filters Library");
1678  m->declare("freeverbdsp.dsp/author", "Romain Michon");
1679  m->declare("freeverbdsp.dsp/description", "Freeverb implementation in Faust, from the Faust Library's dm.freeverb_demo in demos.lib");
1680  m->declare("freeverbdsp.dsp/license", "LGPL");
1681  m->declare("freeverbdsp.dsp/name", "freeverb");
1682  m->declare("freeverbdsp.dsp/version", "0.0");
1683  m->declare("maths.lib/author", "GRAME");
1684  m->declare("maths.lib/copyright", "GRAME");
1685  m->declare("maths.lib/license", "LGPL with exception");
1686  m->declare("maths.lib/name", "Faust Math Library");
1687  m->declare("maths.lib/version", "2.3");
1688  m->declare("name", "freeverbmonodsp");
1689  m->declare("platform.lib/name", "Generic Platform Library");
1690  m->declare("platform.lib/version", "0.1");
1691  m->declare("reverbs.lib/name", "Faust Reverb Library");
1692  m->declare("reverbs.lib/version", "0.0");
1693  }
1694 
1695  virtual int getNumInputs() {
1696  return 1;
1697  }
1698  virtual int getNumOutputs() {
1699  return 1;
1700  }
1701  virtual int getInputRate(int channel) {
1702  int rate;
1703  switch ((channel)) {
1704  case 0: {
1705  rate = 1;
1706  break;
1707  }
1708  default: {
1709  rate = -1;
1710  break;
1711  }
1712  }
1713  return rate;
1714  }
1715  virtual int getOutputRate(int channel) {
1716  int rate;
1717  switch ((channel)) {
1718  case 0: {
1719  rate = 1;
1720  break;
1721  }
1722  default: {
1723  rate = -1;
1724  break;
1725  }
1726  }
1727  return rate;
1728  }
1729 
1730  static void classInit(int sample_rate) {
1731  }
1732 
1733  virtual void instanceConstants(int sample_rate) {
1734  fSampleRate = sample_rate;
1735  fConst0 = std::min<float>(192000.0f, std::max<float>(1.0f, float(fSampleRate)));
1736  fConst1 = (12348.0f / fConst0);
1737  fConst2 = (17640.0f / fConst0);
1738  iConst3 = int((0.0253061224f * fConst0));
1739  fConst4 = (0.00104308384f * fConst0);
1740  iConst5 = int((0.0269387756f * fConst0));
1741  iConst6 = int((0.0289569162f * fConst0));
1742  iConst7 = int((0.0307482984f * fConst0));
1743  iConst8 = int((0.0322448984f * fConst0));
1744  iConst9 = int((0.033809524f * fConst0));
1745  iConst10 = int((0.0353061222f * fConst0));
1746  iConst11 = int((0.0366666652f * fConst0));
1747  iConst12 = int((0.0126077095f * fConst0));
1748  iConst13 = int((0.00999999978f * fConst0));
1749  iConst14 = int((0.00773242628f * fConst0));
1750  iConst15 = int((0.00510204071f * fConst0));
1751  iConst16 = std::min<int>(1024, std::max<int>(0, (iConst12 + -1)));
1752  iConst17 = std::min<int>(1024, std::max<int>(0, (iConst13 + -1)));
1753  iConst18 = std::min<int>(1024, std::max<int>(0, (iConst14 + -1)));
1754  iConst19 = std::min<int>(1024, std::max<int>(0, (iConst15 + -1)));
1755  }
1756 
1758  fVslider0 = FAUSTFLOAT(0.10000000000000001f);
1759  fVslider1 = FAUSTFLOAT(0.10000000000000001f);
1760  fVslider2 = FAUSTFLOAT(0.5f);
1761  fVslider3 = FAUSTFLOAT(0.5f);
1762  }
1763 
1764  virtual void instanceClear() {
1765  for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
1766  fRec9[l0] = 0.0f;
1767  }
1768  IOTA = 0;
1769  for (int l1 = 0; (l1 < 8192); l1 = (l1 + 1)) {
1770  fVec0[l1] = 0.0f;
1771  }
1772  for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
1773  fRec8[l2] = 0.0f;
1774  }
1775  for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
1776  fRec11[l3] = 0.0f;
1777  }
1778  for (int l4 = 0; (l4 < 8192); l4 = (l4 + 1)) {
1779  fVec1[l4] = 0.0f;
1780  }
1781  for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
1782  fRec10[l5] = 0.0f;
1783  }
1784  for (int l6 = 0; (l6 < 2); l6 = (l6 + 1)) {
1785  fRec13[l6] = 0.0f;
1786  }
1787  for (int l7 = 0; (l7 < 8192); l7 = (l7 + 1)) {
1788  fVec2[l7] = 0.0f;
1789  }
1790  for (int l8 = 0; (l8 < 2); l8 = (l8 + 1)) {
1791  fRec12[l8] = 0.0f;
1792  }
1793  for (int l9 = 0; (l9 < 2); l9 = (l9 + 1)) {
1794  fRec15[l9] = 0.0f;
1795  }
1796  for (int l10 = 0; (l10 < 8192); l10 = (l10 + 1)) {
1797  fVec3[l10] = 0.0f;
1798  }
1799  for (int l11 = 0; (l11 < 2); l11 = (l11 + 1)) {
1800  fRec14[l11] = 0.0f;
1801  }
1802  for (int l12 = 0; (l12 < 2); l12 = (l12 + 1)) {
1803  fRec17[l12] = 0.0f;
1804  }
1805  for (int l13 = 0; (l13 < 8192); l13 = (l13 + 1)) {
1806  fVec4[l13] = 0.0f;
1807  }
1808  for (int l14 = 0; (l14 < 2); l14 = (l14 + 1)) {
1809  fRec16[l14] = 0.0f;
1810  }
1811  for (int l15 = 0; (l15 < 2); l15 = (l15 + 1)) {
1812  fRec19[l15] = 0.0f;
1813  }
1814  for (int l16 = 0; (l16 < 8192); l16 = (l16 + 1)) {
1815  fVec5[l16] = 0.0f;
1816  }
1817  for (int l17 = 0; (l17 < 2); l17 = (l17 + 1)) {
1818  fRec18[l17] = 0.0f;
1819  }
1820  for (int l18 = 0; (l18 < 2); l18 = (l18 + 1)) {
1821  fRec21[l18] = 0.0f;
1822  }
1823  for (int l19 = 0; (l19 < 8192); l19 = (l19 + 1)) {
1824  fVec6[l19] = 0.0f;
1825  }
1826  for (int l20 = 0; (l20 < 2); l20 = (l20 + 1)) {
1827  fRec20[l20] = 0.0f;
1828  }
1829  for (int l21 = 0; (l21 < 2); l21 = (l21 + 1)) {
1830  fRec23[l21] = 0.0f;
1831  }
1832  for (int l22 = 0; (l22 < 8192); l22 = (l22 + 1)) {
1833  fVec7[l22] = 0.0f;
1834  }
1835  for (int l23 = 0; (l23 < 2); l23 = (l23 + 1)) {
1836  fRec22[l23] = 0.0f;
1837  }
1838  for (int l24 = 0; (l24 < 2048); l24 = (l24 + 1)) {
1839  fVec8[l24] = 0.0f;
1840  }
1841  for (int l25 = 0; (l25 < 2); l25 = (l25 + 1)) {
1842  fRec6[l25] = 0.0f;
1843  }
1844  for (int l26 = 0; (l26 < 2048); l26 = (l26 + 1)) {
1845  fVec9[l26] = 0.0f;
1846  }
1847  for (int l27 = 0; (l27 < 2); l27 = (l27 + 1)) {
1848  fRec4[l27] = 0.0f;
1849  }
1850  for (int l28 = 0; (l28 < 2048); l28 = (l28 + 1)) {
1851  fVec10[l28] = 0.0f;
1852  }
1853  for (int l29 = 0; (l29 < 2); l29 = (l29 + 1)) {
1854  fRec2[l29] = 0.0f;
1855  }
1856  for (int l30 = 0; (l30 < 2048); l30 = (l30 + 1)) {
1857  fVec11[l30] = 0.0f;
1858  }
1859  for (int l31 = 0; (l31 < 2); l31 = (l31 + 1)) {
1860  fRec0[l31] = 0.0f;
1861  }
1862  for (int l32 = 0; (l32 < 2); l32 = (l32 + 1)) {
1863  fRec33[l32] = 0.0f;
1864  }
1865  for (int l33 = 0; (l33 < 8192); l33 = (l33 + 1)) {
1866  fVec12[l33] = 0.0f;
1867  }
1868  for (int l34 = 0; (l34 < 2); l34 = (l34 + 1)) {
1869  fRec32[l34] = 0.0f;
1870  }
1871  for (int l35 = 0; (l35 < 2); l35 = (l35 + 1)) {
1872  fRec35[l35] = 0.0f;
1873  }
1874  for (int l36 = 0; (l36 < 8192); l36 = (l36 + 1)) {
1875  fVec13[l36] = 0.0f;
1876  }
1877  for (int l37 = 0; (l37 < 2); l37 = (l37 + 1)) {
1878  fRec34[l37] = 0.0f;
1879  }
1880  for (int l38 = 0; (l38 < 2); l38 = (l38 + 1)) {
1881  fRec37[l38] = 0.0f;
1882  }
1883  for (int l39 = 0; (l39 < 8192); l39 = (l39 + 1)) {
1884  fVec14[l39] = 0.0f;
1885  }
1886  for (int l40 = 0; (l40 < 2); l40 = (l40 + 1)) {
1887  fRec36[l40] = 0.0f;
1888  }
1889  for (int l41 = 0; (l41 < 2); l41 = (l41 + 1)) {
1890  fRec39[l41] = 0.0f;
1891  }
1892  for (int l42 = 0; (l42 < 8192); l42 = (l42 + 1)) {
1893  fVec15[l42] = 0.0f;
1894  }
1895  for (int l43 = 0; (l43 < 2); l43 = (l43 + 1)) {
1896  fRec38[l43] = 0.0f;
1897  }
1898  for (int l44 = 0; (l44 < 2); l44 = (l44 + 1)) {
1899  fRec41[l44] = 0.0f;
1900  }
1901  for (int l45 = 0; (l45 < 8192); l45 = (l45 + 1)) {
1902  fVec16[l45] = 0.0f;
1903  }
1904  for (int l46 = 0; (l46 < 2); l46 = (l46 + 1)) {
1905  fRec40[l46] = 0.0f;
1906  }
1907  for (int l47 = 0; (l47 < 2); l47 = (l47 + 1)) {
1908  fRec43[l47] = 0.0f;
1909  }
1910  for (int l48 = 0; (l48 < 8192); l48 = (l48 + 1)) {
1911  fVec17[l48] = 0.0f;
1912  }
1913  for (int l49 = 0; (l49 < 2); l49 = (l49 + 1)) {
1914  fRec42[l49] = 0.0f;
1915  }
1916  for (int l50 = 0; (l50 < 2); l50 = (l50 + 1)) {
1917  fRec45[l50] = 0.0f;
1918  }
1919  for (int l51 = 0; (l51 < 8192); l51 = (l51 + 1)) {
1920  fVec18[l51] = 0.0f;
1921  }
1922  for (int l52 = 0; (l52 < 2); l52 = (l52 + 1)) {
1923  fRec44[l52] = 0.0f;
1924  }
1925  for (int l53 = 0; (l53 < 2); l53 = (l53 + 1)) {
1926  fRec47[l53] = 0.0f;
1927  }
1928  for (int l54 = 0; (l54 < 8192); l54 = (l54 + 1)) {
1929  fVec19[l54] = 0.0f;
1930  }
1931  for (int l55 = 0; (l55 < 2); l55 = (l55 + 1)) {
1932  fRec46[l55] = 0.0f;
1933  }
1934  for (int l56 = 0; (l56 < 2048); l56 = (l56 + 1)) {
1935  fVec20[l56] = 0.0f;
1936  }
1937  for (int l57 = 0; (l57 < 2); l57 = (l57 + 1)) {
1938  fRec30[l57] = 0.0f;
1939  }
1940  for (int l58 = 0; (l58 < 2048); l58 = (l58 + 1)) {
1941  fVec21[l58] = 0.0f;
1942  }
1943  for (int l59 = 0; (l59 < 2); l59 = (l59 + 1)) {
1944  fRec28[l59] = 0.0f;
1945  }
1946  for (int l60 = 0; (l60 < 2048); l60 = (l60 + 1)) {
1947  fVec22[l60] = 0.0f;
1948  }
1949  for (int l61 = 0; (l61 < 2); l61 = (l61 + 1)) {
1950  fRec26[l61] = 0.0f;
1951  }
1952  for (int l62 = 0; (l62 < 1024); l62 = (l62 + 1)) {
1953  fVec23[l62] = 0.0f;
1954  }
1955  for (int l63 = 0; (l63 < 2); l63 = (l63 + 1)) {
1956  fRec24[l63] = 0.0f;
1957  }
1958  }
1959 
1960  virtual void init(int sample_rate) {
1961  classInit(sample_rate);
1962  instanceInit(sample_rate);
1963  }
1964  virtual void instanceInit(int sample_rate) {
1965  instanceConstants(sample_rate);
1967  instanceClear();
1968  }
1969 
1970  virtual freeverbmonodsp* clone() {
1971  return new freeverbmonodsp();
1972  }
1973 
1974  virtual int getSampleRate() {
1975  return fSampleRate;
1976  }
1977 
1978  virtual void buildUserInterface(UI* ui_interface) {
1979  ui_interface->openHorizontalBox("Freeverb");
1980  ui_interface->declare(0, "0", "");
1981  ui_interface->openVerticalBox("0x00");
1982  ui_interface->declare(&fVslider2, "0", "");
1983  ui_interface->declare(&fVslider2, "style", "knob");
1984  ui_interface->declare(&fVslider2, "tooltip", "Somehow control the density of the reverb.");
1985  ui_interface->addVerticalSlider("Damp", &fVslider2, 0.5f, 0.0f, 1.0f, 0.0250000004f);
1986  ui_interface->declare(&fVslider1, "1", "");
1987  ui_interface->declare(&fVslider1, "style", "knob");
1988  ui_interface->declare(&fVslider1, "tooltip", "The room size between 0 and 1 with 1 for the largest room.");
1989  ui_interface->addVerticalSlider("RoomSize", &fVslider1, 0.100000001f, 0.0f, 1.0f, 0.0250000004f);
1990  ui_interface->declare(&fVslider3, "2", "");
1991  ui_interface->declare(&fVslider3, "style", "knob");
1992  ui_interface->declare(&fVslider3, "tooltip", "Spatial spread between 0 and 1 with 1 for maximum spread.");
1993  ui_interface->addVerticalSlider("Stereo Spread", &fVslider3, 0.5f, 0.0f, 1.0f, 0.00999999978f);
1994  ui_interface->closeBox();
1995  ui_interface->declare(&fVslider0, "1", "");
1996  ui_interface->declare(&fVslider0, "tooltip", "The amount of reverb applied to the signal between 0 and 1 with 1 for the maximum amount of reverb.");
1997  ui_interface->addVerticalSlider("Wet", &fVslider0, 0.100000001f, 0.0f, 1.0f, 0.0250000004f);
1998  ui_interface->closeBox();
1999  }
2000 
2001  virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
2002  FAUSTFLOAT* input0 = inputs[0];
2003  FAUSTFLOAT* output0 = outputs[0];
2004  float fSlow0 = float(fVslider0);
2005  float fSlow1 = (0.200000003f * fSlow0);
2006  float fSlow2 = ((fConst1 * float(fVslider1)) + 0.699999988f);
2007  float fSlow3 = (fConst2 * float(fVslider2));
2008  float fSlow4 = (1.0f - fSlow3);
2009  int iSlow5 = int((fConst4 * float(fVslider3)));
2010  int iSlow6 = (iConst3 + iSlow5);
2011  int iSlow7 = (iConst5 + iSlow5);
2012  int iSlow8 = (iConst6 + iSlow5);
2013  int iSlow9 = (iConst7 + iSlow5);
2014  int iSlow10 = (iConst8 + iSlow5);
2015  int iSlow11 = (iConst9 + iSlow5);
2016  int iSlow12 = (iConst10 + iSlow5);
2017  int iSlow13 = (iConst11 + iSlow5);
2018  int iSlow14 = (iSlow5 + -1);
2019  int iSlow15 = std::min<int>(1024, std::max<int>(0, (iConst12 + iSlow14)));
2020  int iSlow16 = std::min<int>(1024, std::max<int>(0, (iConst13 + iSlow14)));
2021  int iSlow17 = std::min<int>(1024, std::max<int>(0, (iConst14 + iSlow14)));
2022  int iSlow18 = std::min<int>(1024, std::max<int>(0, (iConst15 + iSlow14)));
2023  float fSlow19 = (2.0f * (1.0f - fSlow0));
2024  for (int i = 0; (i < count); i = (i + 1)) {
2025  float fTemp0 = float(input0[i]);
2026  float fTemp1 = (fSlow1 * fTemp0);
2027  fRec9[0] = ((fSlow3 * fRec9[1]) + (fSlow4 * fRec8[1]));
2028  fVec0[(IOTA & 8191)] = (fTemp1 + (fSlow2 * fRec9[0]));
2029  fRec8[0] = fVec0[((IOTA - iSlow6) & 8191)];
2030  fRec11[0] = ((fSlow3 * fRec11[1]) + (fSlow4 * fRec10[1]));
2031  fVec1[(IOTA & 8191)] = (fTemp1 + (fSlow2 * fRec11[0]));
2032  fRec10[0] = fVec1[((IOTA - iSlow7) & 8191)];
2033  fRec13[0] = ((fSlow3 * fRec13[1]) + (fSlow4 * fRec12[1]));
2034  fVec2[(IOTA & 8191)] = (fTemp1 + (fSlow2 * fRec13[0]));
2035  fRec12[0] = fVec2[((IOTA - iSlow8) & 8191)];
2036  fRec15[0] = ((fSlow3 * fRec15[1]) + (fSlow4 * fRec14[1]));
2037  fVec3[(IOTA & 8191)] = (fTemp1 + (fSlow2 * fRec15[0]));
2038  fRec14[0] = fVec3[((IOTA - iSlow9) & 8191)];
2039  fRec17[0] = ((fSlow3 * fRec17[1]) + (fSlow4 * fRec16[1]));
2040  fVec4[(IOTA & 8191)] = (fTemp1 + (fSlow2 * fRec17[0]));
2041  fRec16[0] = fVec4[((IOTA - iSlow10) & 8191)];
2042  fRec19[0] = ((fSlow3 * fRec19[1]) + (fSlow4 * fRec18[1]));
2043  fVec5[(IOTA & 8191)] = (fTemp1 + (fSlow2 * fRec19[0]));
2044  fRec18[0] = fVec5[((IOTA - iSlow11) & 8191)];
2045  fRec21[0] = ((fSlow3 * fRec21[1]) + (fSlow4 * fRec20[1]));
2046  fVec6[(IOTA & 8191)] = (fTemp1 + (fSlow2 * fRec21[0]));
2047  fRec20[0] = fVec6[((IOTA - iSlow12) & 8191)];
2048  fRec23[0] = ((fSlow3 * fRec23[1]) + (fSlow4 * fRec22[1]));
2049  fVec7[(IOTA & 8191)] = (fTemp1 + (fSlow2 * fRec23[0]));
2050  fRec22[0] = fVec7[((IOTA - iSlow13) & 8191)];
2051  float fTemp2 = ((((((((fRec8[0] + fRec10[0]) + fRec12[0]) + fRec14[0]) + fRec16[0]) + fRec18[0]) + fRec20[0]) + fRec22[0]) + (0.5f * fRec6[1]));
2052  fVec8[(IOTA & 2047)] = fTemp2;
2053  fRec6[0] = fVec8[((IOTA - iSlow15) & 2047)];
2054  float fRec7 = (0.0f - (0.5f * fTemp2));
2055  float fTemp3 = (fRec6[1] + (fRec7 + (0.5f * fRec4[1])));
2056  fVec9[(IOTA & 2047)] = fTemp3;
2057  fRec4[0] = fVec9[((IOTA - iSlow16) & 2047)];
2058  float fRec5 = (0.0f - (0.5f * fTemp3));
2059  float fTemp4 = (fRec4[1] + (fRec5 + (0.5f * fRec2[1])));
2060  fVec10[(IOTA & 2047)] = fTemp4;
2061  fRec2[0] = fVec10[((IOTA - iSlow17) & 2047)];
2062  float fRec3 = (0.0f - (0.5f * fTemp4));
2063  float fTemp5 = (fRec2[1] + (fRec3 + (0.5f * fRec0[1])));
2064  fVec11[(IOTA & 2047)] = fTemp5;
2065  fRec0[0] = fVec11[((IOTA - iSlow18) & 2047)];
2066  float fRec1 = (0.0f - (0.5f * fTemp5));
2067  fRec33[0] = ((fSlow3 * fRec33[1]) + (fSlow4 * fRec32[1]));
2068  fVec12[(IOTA & 8191)] = ((fSlow2 * fRec33[0]) + fTemp1);
2069  fRec32[0] = fVec12[((IOTA - iConst3) & 8191)];
2070  fRec35[0] = ((fSlow3 * fRec35[1]) + (fSlow4 * fRec34[1]));
2071  fVec13[(IOTA & 8191)] = (fTemp1 + (fSlow2 * fRec35[0]));
2072  fRec34[0] = fVec13[((IOTA - iConst5) & 8191)];
2073  fRec37[0] = ((fSlow3 * fRec37[1]) + (fSlow4 * fRec36[1]));
2074  fVec14[(IOTA & 8191)] = (fTemp1 + (fSlow2 * fRec37[0]));
2075  fRec36[0] = fVec14[((IOTA - iConst6) & 8191)];
2076  fRec39[0] = ((fSlow3 * fRec39[1]) + (fSlow4 * fRec38[1]));
2077  fVec15[(IOTA & 8191)] = (fTemp1 + (fSlow2 * fRec39[0]));
2078  fRec38[0] = fVec15[((IOTA - iConst7) & 8191)];
2079  fRec41[0] = ((fSlow3 * fRec41[1]) + (fSlow4 * fRec40[1]));
2080  fVec16[(IOTA & 8191)] = (fTemp1 + (fSlow2 * fRec41[0]));
2081  fRec40[0] = fVec16[((IOTA - iConst8) & 8191)];
2082  fRec43[0] = ((fSlow3 * fRec43[1]) + (fSlow4 * fRec42[1]));
2083  fVec17[(IOTA & 8191)] = (fTemp1 + (fSlow2 * fRec43[0]));
2084  fRec42[0] = fVec17[((IOTA - iConst9) & 8191)];
2085  fRec45[0] = ((fSlow3 * fRec45[1]) + (fSlow4 * fRec44[1]));
2086  fVec18[(IOTA & 8191)] = (fTemp1 + (fSlow2 * fRec45[0]));
2087  fRec44[0] = fVec18[((IOTA - iConst10) & 8191)];
2088  fRec47[0] = ((fSlow3 * fRec47[1]) + (fSlow4 * fRec46[1]));
2089  fVec19[(IOTA & 8191)] = (fTemp1 + (fSlow2 * fRec47[0]));
2090  fRec46[0] = fVec19[((IOTA - iConst11) & 8191)];
2091  float fTemp6 = ((((((((fRec32[0] + fRec34[0]) + fRec36[0]) + fRec38[0]) + fRec40[0]) + fRec42[0]) + fRec44[0]) + fRec46[0]) + (0.5f * fRec30[1]));
2092  fVec20[(IOTA & 2047)] = fTemp6;
2093  fRec30[0] = fVec20[((IOTA - iConst16) & 2047)];
2094  float fRec31 = (0.0f - (0.5f * fTemp6));
2095  float fTemp7 = (fRec30[1] + (fRec31 + (0.5f * fRec28[1])));
2096  fVec21[(IOTA & 2047)] = fTemp7;
2097  fRec28[0] = fVec21[((IOTA - iConst17) & 2047)];
2098  float fRec29 = (0.0f - (0.5f * fTemp7));
2099  float fTemp8 = (fRec28[1] + (fRec29 + (0.5f * fRec26[1])));
2100  fVec22[(IOTA & 2047)] = fTemp8;
2101  fRec26[0] = fVec22[((IOTA - iConst18) & 2047)];
2102  float fRec27 = (0.0f - (0.5f * fTemp8));
2103  float fTemp9 = (fRec26[1] + (fRec27 + (0.5f * fRec24[1])));
2104  fVec23[(IOTA & 1023)] = fTemp9;
2105  fRec24[0] = fVec23[((IOTA - iConst19) & 1023)];
2106  float fRec25 = (0.0f - (0.5f * fTemp9));
2107  output0[i] = FAUSTFLOAT((fRec0[1] + ((fRec24[1] + (fRec25 + fRec1)) + (fSlow19 * fTemp0))));
2108  fRec9[1] = fRec9[0];
2109  IOTA = (IOTA + 1);
2110  fRec8[1] = fRec8[0];
2111  fRec11[1] = fRec11[0];
2112  fRec10[1] = fRec10[0];
2113  fRec13[1] = fRec13[0];
2114  fRec12[1] = fRec12[0];
2115  fRec15[1] = fRec15[0];
2116  fRec14[1] = fRec14[0];
2117  fRec17[1] = fRec17[0];
2118  fRec16[1] = fRec16[0];
2119  fRec19[1] = fRec19[0];
2120  fRec18[1] = fRec18[0];
2121  fRec21[1] = fRec21[0];
2122  fRec20[1] = fRec20[0];
2123  fRec23[1] = fRec23[0];
2124  fRec22[1] = fRec22[0];
2125  fRec6[1] = fRec6[0];
2126  fRec4[1] = fRec4[0];
2127  fRec2[1] = fRec2[0];
2128  fRec0[1] = fRec0[0];
2129  fRec33[1] = fRec33[0];
2130  fRec32[1] = fRec32[0];
2131  fRec35[1] = fRec35[0];
2132  fRec34[1] = fRec34[0];
2133  fRec37[1] = fRec37[0];
2134  fRec36[1] = fRec36[0];
2135  fRec39[1] = fRec39[0];
2136  fRec38[1] = fRec38[0];
2137  fRec41[1] = fRec41[0];
2138  fRec40[1] = fRec40[0];
2139  fRec43[1] = fRec43[0];
2140  fRec42[1] = fRec42[0];
2141  fRec45[1] = fRec45[0];
2142  fRec44[1] = fRec44[0];
2143  fRec47[1] = fRec47[0];
2144  fRec46[1] = fRec46[0];
2145  fRec30[1] = fRec30[0];
2146  fRec28[1] = fRec28[0];
2147  fRec26[1] = fRec26[0];
2148  fRec24[1] = fRec24[0];
2149  }
2150  }
2151 
2152 };
2153 
2154 #endif
Definition: compressordsp.h:1031
std::string fCurrentAcc
Definition: compressordsp.h:1066
std::vector< FAUSTFLOAT > fMax
Definition: compressordsp.h:1049
void getGyrConverter(int p, int &gyr, int &curve, double &amin, double &amid, double &amax)
Definition: freeverbmonodsp.h:1484
@ kExp
Definition: compressordsp.h:1038
@ kLin
Definition: compressordsp.h:1038
@ kLog
Definition: compressordsp.h:1038
const char * getMetadata(int p, const char *key)
Definition: freeverbmonodsp.h:1357
void propagateAcc(int acc, double value)
Definition: freeverbmonodsp.h:1418
int getGyrCount(int gyr)
Definition: freeverbmonodsp.h:1522
int getParamsCount()
Definition: freeverbmonodsp.h:1334
virtual void addButton(const char *label, FAUSTFLOAT *zone)
Definition: freeverbmonodsp.h:1259
const char * getParamLabel(int p)
Definition: freeverbmonodsp.h:1346
virtual void closeBox()
Definition: freeverbmonodsp.h:1255
void setParamRatio(int p, double r)
Definition: freeverbmonodsp.h:1371
FAUSTFLOAT getParamInit(int p)
Definition: freeverbmonodsp.h:1364
std::map< std::string, int > fPathMap
Definition: compressordsp.h:1043
int getZoneIndex(std::vector< ZoneControl * > *table, int p, int val)
Definition: freeverbmonodsp.h:1168
double getParamRatio(int p)
Definition: freeverbmonodsp.h:1370
ItemType getParamItemType(int p)
Definition: freeverbmonodsp.h:1406
void getAccConverter(int p, int &acc, int &curve, double &amin, double &amid, double &amax)
Definition: freeverbmonodsp.h:1468
int getParamIndex(const char *path)
Definition: freeverbmonodsp.h:1335
const char * getParamAddress(int p)
Definition: freeverbmonodsp.h:1345
std::vector< FAUSTFLOAT > fMin
Definition: compressordsp.h:1048
double value2ratio(int p, double r)
Definition: freeverbmonodsp.h:1373
virtual void declare(const char *key, const char *val)
Definition: freeverbmonodsp.h:1328
virtual void addParameter(const char *label, FAUSTFLOAT *zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT step, ItemType type)
Definition: freeverbmonodsp.h:1070
virtual void addHorizontalSlider(const char *label, FAUSTFLOAT *zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT step)
Definition: freeverbmonodsp.h:1274
ItemType
Definition: compressordsp.h:1034
@ kHBargraph
Definition: compressordsp.h:1034
@ kButton
Definition: compressordsp.h:1034
@ kVBargraph
Definition: compressordsp.h:1034
@ kCheckButton
Definition: compressordsp.h:1034
@ kHSlider
Definition: compressordsp.h:1034
@ kNumEntry
Definition: compressordsp.h:1034
@ kVSlider
Definition: compressordsp.h:1034
std::vector< ZoneControl * > fGyr[3]
Definition: compressordsp.h:1054
virtual void declare(FAUSTFLOAT *zone, const char *key, const char *val)
Definition: freeverbmonodsp.h:1302
virtual void addCheckButton(const char *label, FAUSTFLOAT *zone)
Definition: freeverbmonodsp.h:1264
std::vector< std::string > fPaths
Definition: compressordsp.h:1041
std::vector< FAUSTFLOAT > fInit
Definition: compressordsp.h:1047
virtual void addVerticalSlider(const char *label, FAUSTFLOAT *zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT step)
Definition: freeverbmonodsp.h:1269
void getConverter(std::vector< ZoneControl * > *table, int p, int &val, int &curve, double &amin, double &amid, double &amax)
Definition: freeverbmonodsp.h:1204
virtual void addHorizontalBargraph(const char *label, FAUSTFLOAT *zone, FAUSTFLOAT min, FAUSTFLOAT max)
Definition: freeverbmonodsp.h:1286
virtual void addNumEntry(const char *label, FAUSTFLOAT *zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT step)
Definition: freeverbmonodsp.h:1279
std::vector< std::map< std::string, std::string > > fMetaData
Definition: compressordsp.h:1052
std::map< const char *, const char * > getMetadata(int p)
Definition: freeverbmonodsp.h:1347
int fCurrentScale
Definition: compressordsp.h:1065
virtual ~APIUI()
Definition: freeverbmonodsp.h:1238
std::vector< std::string > fLabels
Definition: compressordsp.h:1042
int fNumParameters
Definition: compressordsp.h:1040
std::vector< ItemType > fItemType
Definition: compressordsp.h:1051
Type
Definition: compressordsp.h:1236
@ kAcc
Definition: compressordsp.h:1236
@ kNoType
Definition: compressordsp.h:1236
@ kGyr
Definition: compressordsp.h:1236
std::string fCurrentColor
Definition: compressordsp.h:1068
ZoneReader * fGreenReader
Definition: compressordsp.h:1060
std::string fCurrentTooltip
Definition: compressordsp.h:1069
ZoneReader * fRedReader
Definition: compressordsp.h:1059
void setConverter(std::vector< ZoneControl * > *table, int p, int val, int curve, double amin, double amid, double amax)
Definition: freeverbmonodsp.h:1177
int getAccCount(int acc)
Definition: freeverbmonodsp.h:1510
void propagateGyr(int gyr, double value)
Definition: freeverbmonodsp.h:1496
virtual void openVerticalBox(const char *label)
Definition: freeverbmonodsp.h:1254
std::string fCurrentGyr
Definition: compressordsp.h:1067
void setParamValue(int p, FAUSTFLOAT v)
Definition: freeverbmonodsp.h:1368
ZoneReader * fBlueReader
Definition: compressordsp.h:1061
FAUSTFLOAT getParamValue(int p)
Definition: freeverbmonodsp.h:1367
virtual void openHorizontalBox(const char *label)
Definition: freeverbmonodsp.h:1253
std::map< std::string, std::string > fCurrentMetadata
Definition: compressordsp.h:1070
void setGyrConverter(int p, int gyr, int curve, double amin, double amid, double amax)
Definition: freeverbmonodsp.h:1452
std::string fCurrentUnit
Definition: compressordsp.h:1064
std::vector< ValueConverter * > fConversion
Definition: compressordsp.h:1045
APIUI()
Definition: freeverbmonodsp.h:1235
std::vector< ZoneControl * > fAcc[3]
Definition: compressordsp.h:1053
FAUSTFLOAT getParamStep(int p)
Definition: freeverbmonodsp.h:1363
virtual void addVerticalBargraph(const char *label, FAUSTFLOAT *zone, FAUSTFLOAT min, FAUSTFLOAT max)
Definition: freeverbmonodsp.h:1291
std::map< std::string, int > fLabelMap
Definition: compressordsp.h:1044
virtual void openTabBox(const char *label)
Definition: freeverbmonodsp.h:1252
double ratio2value(int p, double r)
Definition: freeverbmonodsp.h:1374
FAUSTFLOAT getParamMin(int p)
Definition: freeverbmonodsp.h:1361
std::vector< FAUSTFLOAT > fStep
Definition: compressordsp.h:1050
bool fHasScreenControl
Definition: compressordsp.h:1058
std::vector< FAUSTFLOAT * > fZone
Definition: compressordsp.h:1046
FAUSTFLOAT * getParamZone(int p)
Definition: freeverbmonodsp.h:1366
int getScreenColor()
Definition: freeverbmonodsp.h:1529
FAUSTFLOAT getParamMax(int p)
Definition: freeverbmonodsp.h:1362
Type getParamType(int p)
Definition: freeverbmonodsp.h:1383
virtual void addSoundfile(const char *label, const char *filename, Soundfile **sf_zone)
Definition: freeverbmonodsp.h:1298
void setAccConverter(int p, int acc, int curve, double amin, double amid, double amax)
Definition: freeverbmonodsp.h:1436
Definition: compressordsp.h:802
AccDownConverter(double amin, double amid, double amax, double fmin, double fmid, double fmax)
Definition: freeverbmonodsp.h:808
virtual double faust2ui(double x)
Definition: freeverbmonodsp.h:814
virtual void getMappingValues(double &amin, double &amid, double &amax)
Definition: freeverbmonodsp.h:823
virtual double ui2faust(double x)
Definition: freeverbmonodsp.h:813
virtual void setMappingValues(double amin, double amid, double amax, double fmin, double fmid, double fmax)
Definition: freeverbmonodsp.h:816
Definition: compressordsp.h:872
virtual void getMappingValues(double &amin, double &amid, double &amax)
Definition: freeverbmonodsp.h:893
virtual double faust2ui(double x)
Definition: freeverbmonodsp.h:884
virtual void setMappingValues(double amin, double amid, double amax, double fmin, double fmid, double fmax)
Definition: freeverbmonodsp.h:886
virtual double ui2faust(double x)
Definition: freeverbmonodsp.h:883
AccDownUpConverter(double amin, double amid, double amax, double fmin, double fmid, double fmax)
Definition: freeverbmonodsp.h:878
Definition: compressordsp.h:766
virtual void setMappingValues(double amin, double amid, double amax, double fmin, double fmid, double fmax)
Definition: freeverbmonodsp.h:780
virtual void getMappingValues(double &amin, double &amid, double &amax)
Definition: freeverbmonodsp.h:787
virtual double faust2ui(double x)
Definition: freeverbmonodsp.h:778
AccUpConverter(double amin, double amid, double amax, double fmin, double fmid, double fmax)
Definition: freeverbmonodsp.h:772
virtual double ui2faust(double x)
Definition: freeverbmonodsp.h:777
Definition: compressordsp.h:837
virtual void getMappingValues(double &amin, double &amid, double &amax)
Definition: freeverbmonodsp.h:858
AccUpDownConverter(double amin, double amid, double amax, double fmin, double fmid, double fmax)
Definition: freeverbmonodsp.h:843
virtual void setMappingValues(double amin, double amid, double amax, double fmin, double fmid, double fmax)
Definition: freeverbmonodsp.h:851
virtual double faust2ui(double x)
Definition: freeverbmonodsp.h:849
virtual double ui2faust(double x)
Definition: freeverbmonodsp.h:848
Definition: compressordsp.h:935
ConverterZoneControl(FAUSTFLOAT *zone, ValueConverter *converter)
Definition: freeverbmonodsp.h:940
ValueConverter * fValueConverter
Definition: compressordsp.h:939
virtual void update(double v) const
Definition: freeverbmonodsp.h:943
ValueConverter * getConverter()
Definition: freeverbmonodsp.h:945
virtual ~ConverterZoneControl()
Definition: freeverbmonodsp.h:941
Definition: compressordsp.h:957
void setActive(bool on_off)
Definition: freeverbmonodsp.h:992
void update(double v) const
Definition: freeverbmonodsp.h:979
void setMappingValues(int curve, double amin, double amid, double amax, double min, double init, double max)
Definition: freeverbmonodsp.h:981
void getMappingValues(double &amin, double &amid, double &amax)
Definition: freeverbmonodsp.h:987
virtual ~CurveZoneControl()
Definition: freeverbmonodsp.h:972
CurveZoneControl(FAUSTFLOAT *zone, int curve, double amin, double amid, double amax, double min, double init, double max)
Definition: freeverbmonodsp.h:963
int getCurve()
Definition: freeverbmonodsp.h:1000
Definition: compressordsp.h:748
ExpValueConverter(double umin, double umax, double fmin, double fmax)
Definition: freeverbmonodsp.h:749
virtual double ui2faust(double x)
Definition: freeverbmonodsp.h:753
virtual double faust2ui(double x)
Definition: freeverbmonodsp.h:754
Definition: compressordsp.h:605
double operator()(double x)
Definition: freeverbmonodsp.h:616
Interpolator3pt(double lo, double mi, double hi, double v1, double vm, double v2)
Definition: freeverbmonodsp.h:612
void getMappingValues(double &amin, double &amid, double &amax)
Definition: freeverbmonodsp.h:618
Definition: compressordsp.h:553
void getLowHigh(double &amin, double &amax)
Definition: freeverbmonodsp.h:590
Interpolator(double lo, double hi, double v1, double v2)
Definition: freeverbmonodsp.h:572
double operator()(double v)
Definition: compressordsp.h:587
Definition: compressordsp.h:695
virtual void getMappingValues(double &amin, double &amid, double &amax)
Definition: freeverbmonodsp.h:717
LinearValueConverter2(double amin, double amid, double amax, double min, double init, double max)
Definition: freeverbmonodsp.h:701
virtual void setMappingValues(double amin, double amid, double amax, double min, double init, double max)
Definition: freeverbmonodsp.h:711
virtual double faust2ui(double x)
Definition: freeverbmonodsp.h:709
LinearValueConverter2()
Definition: freeverbmonodsp.h:705
virtual double ui2faust(double x)
Definition: freeverbmonodsp.h:708
Definition: compressordsp.h:671
virtual double faust2ui(double x)
Definition: freeverbmonodsp.h:684
LinearValueConverter()
Definition: freeverbmonodsp.h:681
virtual double ui2faust(double x)
Definition: freeverbmonodsp.h:683
LinearValueConverter(double umin, double umax, double fmin, double fmax)
Definition: freeverbmonodsp.h:677
Definition: compressordsp.h:731
virtual double ui2faust(double x)
Definition: freeverbmonodsp.h:736
LogValueConverter(double umin, double umax, double fmin, double fmax)
Definition: freeverbmonodsp.h:732
virtual double faust2ui(double x)
Definition: freeverbmonodsp.h:737
Definition: compressordsp.h:431
PathBuilder()
Definition: freeverbmonodsp.h:436
std::vector< std::string > fControlsLevel
Definition: compressordsp.h:435
void pushLabel(const std::string &label)
Definition: freeverbmonodsp.h:457
std::string buildLabel(std::string label)
Definition: freeverbmonodsp.h:451
void popLabel()
Definition: freeverbmonodsp.h:458
virtual ~PathBuilder()
Definition: freeverbmonodsp.h:437
std::string buildPath(const std::string &label)
Definition: freeverbmonodsp.h:439
Definition: compressordsp.h:645
bool getActive()
Definition: freeverbmonodsp.h:659
virtual void setMappingValues(double amin, double amid, double amax, double min, double init, double max)=0
virtual ~UpdatableValueConverter()
Definition: freeverbmonodsp.h:652
UpdatableValueConverter()
Definition: freeverbmonodsp.h:650
virtual void getMappingValues(double &amin, double &amid, double &amax)=0
void setActive(bool on_off)
Definition: freeverbmonodsp.h:658
bool fActive
Definition: compressordsp.h:649
Definition: compressordsp.h:632
virtual ~ValueConverter()
Definition: freeverbmonodsp.h:633
virtual double ui2faust(double x)=0
virtual double faust2ui(double x)=0
Definition: compressordsp.h:906
virtual int getCurve()
Definition: freeverbmonodsp.h:924
ZoneControl(FAUSTFLOAT *zone)
Definition: freeverbmonodsp.h:911
virtual void setMappingValues(int curve, double amin, double amid, double amax, double min, double init, double max)
Definition: freeverbmonodsp.h:916
virtual bool getActive()
Definition: freeverbmonodsp.h:922
FAUSTFLOAT * fZone
Definition: compressordsp.h:910
virtual void getMappingValues(double &amin, double &amid, double &amax)
Definition: freeverbmonodsp.h:917
virtual ~ZoneControl()
Definition: freeverbmonodsp.h:912
virtual void update(double v) const
Definition: freeverbmonodsp.h:914
virtual void setActive(bool on_off)
Definition: freeverbmonodsp.h:921
FAUSTFLOAT * getZone()
Definition: freeverbmonodsp.h:919
Definition: compressordsp.h:1007
int getValue()
Definition: freeverbmonodsp.h:1017
ZoneReader(FAUSTFLOAT *zone, double lo, double hi)
Definition: freeverbmonodsp.h:1013
virtual ~ZoneReader()
Definition: freeverbmonodsp.h:1015
Definition: compressordsp.h:168
virtual void init(int sample_rate)
Definition: freeverbmonodsp.h:180
virtual void buildUserInterface(UI *ui_interface)
Definition: freeverbmonodsp.h:178
virtual void instanceConstants(int sample_rate)
Definition: freeverbmonodsp.h:182
virtual void compute(int count, FAUSTFLOAT **inputs, FAUSTFLOAT **outputs)
Definition: freeverbmonodsp.h:188
decorator_dsp(dsp *dsp=nullptr)
Definition: freeverbmonodsp.h:173
virtual void instanceResetUserInterface()
Definition: freeverbmonodsp.h:183
virtual int getNumOutputs()
Definition: freeverbmonodsp.h:177
virtual void compute(double date_usec, int count, FAUSTFLOAT **inputs, FAUSTFLOAT **outputs)
Definition: freeverbmonodsp.h:189
virtual void instanceInit(int sample_rate)
Definition: freeverbmonodsp.h:181
virtual decorator_dsp * clone()
Definition: freeverbmonodsp.h:185
virtual int getSampleRate()
Definition: freeverbmonodsp.h:179
dsp * fDSP
Definition: compressordsp.h:172
virtual void instanceClear()
Definition: freeverbmonodsp.h:184
virtual ~decorator_dsp()
Definition: freeverbmonodsp.h:174
virtual int getNumInputs()
Definition: freeverbmonodsp.h:176
virtual void metadata(Meta *m)
Definition: freeverbmonodsp.h:186
Definition: compressordsp.h:200
virtual std::vector< std::string > getLibraryList()=0
virtual dsp_memory_manager * getMemoryManager()=0
virtual dsp * createDSPInstance()=0
virtual std::vector< std::string > getIncludePathnames()=0
virtual ~dsp_factory()
Definition: freeverbmonodsp.h:202
virtual std::string getName()=0
virtual std::string getSHAKey()=0
virtual void setMemoryManager(dsp_memory_manager *manager)=0
virtual std::string getCompileOptions()=0
virtual std::string getDSPCode()=0
Definition: compressordsp.h:74
virtual int getNumOutputs()=0
virtual void init(int sample_rate)=0
virtual int getNumInputs()=0
virtual void instanceClear()=0
virtual void instanceConstants(int sample_rate)=0
virtual void instanceResetUserInterface()=0
virtual void compute(int count, FAUSTFLOAT **inputs, FAUSTFLOAT **outputs)=0
virtual dsp * clone()=0
virtual void compute(double, int count, FAUSTFLOAT **inputs, FAUSTFLOAT **outputs)
Definition: freeverbmonodsp.h:157
virtual void instanceInit(int sample_rate)=0
virtual ~dsp()
Definition: freeverbmonodsp.h:76
dsp()
Definition: freeverbmonodsp.h:75
virtual void buildUserInterface(UI *ui_interface)=0
virtual int getSampleRate()=0
virtual void metadata(Meta *m)=0
Definition: freeverbmonodsp.h:1572
virtual freeverbmonodsp * clone()
Definition: freeverbmonodsp.h:1970
virtual int getSampleRate()
Definition: freeverbmonodsp.h:1974
static void classInit(int sample_rate)
Definition: freeverbmonodsp.h:1730
virtual int getInputRate(int channel)
Definition: freeverbmonodsp.h:1701
virtual int getNumInputs()
Definition: freeverbmonodsp.h:1695
virtual int getOutputRate(int channel)
Definition: freeverbmonodsp.h:1715
virtual void instanceClear()
Definition: freeverbmonodsp.h:1764
virtual void instanceInit(int sample_rate)
Definition: freeverbmonodsp.h:1964
virtual void buildUserInterface(UI *ui_interface)
Definition: freeverbmonodsp.h:1978
virtual int getNumOutputs()
Definition: freeverbmonodsp.h:1698
virtual void init(int sample_rate)
Definition: freeverbmonodsp.h:1960
void metadata(Meta *m)
Definition: freeverbmonodsp.h:1669
virtual void compute(int count, FAUSTFLOAT **inputs, FAUSTFLOAT **outputs)
Definition: freeverbmonodsp.h:2001
virtual void instanceResetUserInterface()
Definition: freeverbmonodsp.h:1757
virtual void instanceConstants(int sample_rate)
Definition: freeverbmonodsp.h:1733
#define FAUSTFLOAT
Definition: freeverbmonodsp.h:48
Definition: compressordsp.h:303
virtual void declare(const char *key, const char *value)=0
virtual ~Meta()
Definition: freeverbmonodsp.h:301
Definition: compressordsp.h:387
virtual ~UI()
Definition: freeverbmonodsp.h:386
UI()
Definition: freeverbmonodsp.h:385
Definition: compressordsp.h:353
virtual void openVerticalBox(const char *label)=0
virtual void addNumEntry(const char *label, REAL *zone, REAL init, REAL min, REAL max, REAL step)=0
virtual void addSoundfile(const char *label, const char *filename, Soundfile **sf_zone)=0
virtual void addHorizontalBargraph(const char *label, REAL *zone, REAL min, REAL max)=0
virtual void addHorizontalSlider(const char *label, REAL *zone, REAL init, REAL min, REAL max, REAL step)=0
virtual void addCheckButton(const char *label, REAL *zone)=0
virtual void addVerticalBargraph(const char *label, REAL *zone, REAL min, REAL max)=0
UIReal()
Definition: freeverbmonodsp.h:351
virtual void declare(REAL *zone, const char *key, const char *val)
Definition: freeverbmonodsp.h:380
virtual void addButton(const char *label, REAL *zone)=0
virtual void openTabBox(const char *label)=0
virtual void closeBox()=0
virtual ~UIReal()
Definition: freeverbmonodsp.h:352
virtual void openHorizontalBox(const char *label)=0
virtual void addVerticalSlider(const char *label, REAL *zone, REAL init, REAL min, REAL max, REAL step)=0
Definition: compressordsp.h:61
virtual ~dsp_memory_manager()
Definition: freeverbmonodsp.h:60
virtual void * allocate(size_t size)=0
virtual void destroy(void *ptr)=0