JackTrip
zitarevdsp.h
Go to the documentation of this file.
1 /* ------------------------------------------------------------
2 name: "zitarevdsp"
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 __zitarevdsp_H__
8 #define __zitarevdsp_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 static float zitarevdsp_faustpower2_f(float value) {
1563  return (value * value);
1564 }
1565 
1566 #ifndef FAUSTCLASS
1567 #define FAUSTCLASS zitarevdsp
1568 #endif
1569 
1570 #ifdef __APPLE__
1571 #define exp10f __exp10f
1572 #define exp10 __exp10
1573 #endif
1574 
1575 class zitarevdsp : public dsp {
1576 
1577  private:
1578 
1579  int IOTA;
1580  float fVec0[16384];
1581  float fVec1[16384];
1582  FAUSTFLOAT fVslider0;
1583  float fRec0[2];
1584  FAUSTFLOAT fVslider1;
1585  float fRec1[2];
1586  int fSampleRate;
1587  float fConst0;
1588  float fConst1;
1589  FAUSTFLOAT fVslider2;
1590  FAUSTFLOAT fVslider3;
1591  FAUSTFLOAT fVslider4;
1592  FAUSTFLOAT fVslider5;
1593  float fConst2;
1594  float fConst3;
1595  FAUSTFLOAT fVslider6;
1596  FAUSTFLOAT fVslider7;
1597  FAUSTFLOAT fVslider8;
1598  float fConst4;
1599  FAUSTFLOAT fVslider9;
1600  float fRec15[2];
1601  float fRec14[2];
1602  float fVec2[32768];
1603  float fConst5;
1604  int iConst6;
1605  float fConst7;
1606  FAUSTFLOAT fVslider10;
1607  float fVec3[2048];
1608  int iConst8;
1609  float fRec12[2];
1610  float fConst9;
1611  float fConst10;
1612  float fRec19[2];
1613  float fRec18[2];
1614  float fVec4[32768];
1615  float fConst11;
1616  int iConst12;
1617  float fVec5[4096];
1618  int iConst13;
1619  float fRec16[2];
1620  float fConst14;
1621  float fConst15;
1622  float fRec23[2];
1623  float fRec22[2];
1624  float fVec6[16384];
1625  float fConst16;
1626  int iConst17;
1627  float fVec7[4096];
1628  int iConst18;
1629  float fRec20[2];
1630  float fConst19;
1631  float fConst20;
1632  float fRec27[2];
1633  float fRec26[2];
1634  float fVec8[32768];
1635  float fConst21;
1636  int iConst22;
1637  float fVec9[4096];
1638  int iConst23;
1639  float fRec24[2];
1640  float fConst24;
1641  float fConst25;
1642  float fRec31[2];
1643  float fRec30[2];
1644  float fVec10[16384];
1645  float fConst26;
1646  int iConst27;
1647  float fVec11[2048];
1648  int iConst28;
1649  float fRec28[2];
1650  float fConst29;
1651  float fConst30;
1652  float fRec35[2];
1653  float fRec34[2];
1654  float fVec12[16384];
1655  float fConst31;
1656  int iConst32;
1657  float fVec13[4096];
1658  int iConst33;
1659  float fRec32[2];
1660  float fConst34;
1661  float fConst35;
1662  float fRec39[2];
1663  float fRec38[2];
1664  float fVec14[16384];
1665  float fConst36;
1666  int iConst37;
1667  float fVec15[4096];
1668  int iConst38;
1669  float fRec36[2];
1670  float fConst39;
1671  float fConst40;
1672  float fRec43[2];
1673  float fRec42[2];
1674  float fVec16[16384];
1675  float fConst41;
1676  int iConst42;
1677  float fVec17[2048];
1678  int iConst43;
1679  float fRec40[2];
1680  float fRec4[3];
1681  float fRec5[3];
1682  float fRec6[3];
1683  float fRec7[3];
1684  float fRec8[3];
1685  float fRec9[3];
1686  float fRec10[3];
1687  float fRec11[3];
1688  float fRec3[3];
1689  float fRec2[3];
1690  float fRec45[3];
1691  float fRec44[3];
1692 
1693  public:
1694 
1695  void metadata(Meta* m) {
1696  m->declare("basics.lib/name", "Faust Basic Element Library");
1697  m->declare("basics.lib/version", "0.1");
1698  m->declare("delays.lib/name", "Faust Delay Library");
1699  m->declare("delays.lib/version", "0.1");
1700  m->declare("filename", "zitarevdsp.dsp");
1701  m->declare("filters.lib/allpass_comb:author", "Julius O. Smith III");
1702  m->declare("filters.lib/allpass_comb:copyright", "Copyright (C) 2003-2019 by Julius O. Smith III <jos@ccrma.stanford.edu>");
1703  m->declare("filters.lib/allpass_comb:license", "MIT-style STK-4.3 license");
1704  m->declare("filters.lib/fir:author", "Julius O. Smith III");
1705  m->declare("filters.lib/fir:copyright", "Copyright (C) 2003-2019 by Julius O. Smith III <jos@ccrma.stanford.edu>");
1706  m->declare("filters.lib/fir:license", "MIT-style STK-4.3 license");
1707  m->declare("filters.lib/iir:author", "Julius O. Smith III");
1708  m->declare("filters.lib/iir:copyright", "Copyright (C) 2003-2019 by Julius O. Smith III <jos@ccrma.stanford.edu>");
1709  m->declare("filters.lib/iir:license", "MIT-style STK-4.3 license");
1710  m->declare("filters.lib/lowpass0_highpass1", "MIT-style STK-4.3 license");
1711  m->declare("filters.lib/lowpass0_highpass1:author", "Julius O. Smith III");
1712  m->declare("filters.lib/lowpass:author", "Julius O. Smith III");
1713  m->declare("filters.lib/lowpass:copyright", "Copyright (C) 2003-2019 by Julius O. Smith III <jos@ccrma.stanford.edu>");
1714  m->declare("filters.lib/lowpass:license", "MIT-style STK-4.3 license");
1715  m->declare("filters.lib/name", "Faust Filters Library");
1716  m->declare("filters.lib/peak_eq_rm:author", "Julius O. Smith III");
1717  m->declare("filters.lib/peak_eq_rm:copyright", "Copyright (C) 2003-2019 by Julius O. Smith III <jos@ccrma.stanford.edu>");
1718  m->declare("filters.lib/peak_eq_rm:license", "MIT-style STK-4.3 license");
1719  m->declare("filters.lib/tf1:author", "Julius O. Smith III");
1720  m->declare("filters.lib/tf1:copyright", "Copyright (C) 2003-2019 by Julius O. Smith III <jos@ccrma.stanford.edu>");
1721  m->declare("filters.lib/tf1:license", "MIT-style STK-4.3 license");
1722  m->declare("filters.lib/tf1s:author", "Julius O. Smith III");
1723  m->declare("filters.lib/tf1s:copyright", "Copyright (C) 2003-2019 by Julius O. Smith III <jos@ccrma.stanford.edu>");
1724  m->declare("filters.lib/tf1s:license", "MIT-style STK-4.3 license");
1725  m->declare("filters.lib/tf2:author", "Julius O. Smith III");
1726  m->declare("filters.lib/tf2:copyright", "Copyright (C) 2003-2019 by Julius O. Smith III <jos@ccrma.stanford.edu>");
1727  m->declare("filters.lib/tf2:license", "MIT-style STK-4.3 license");
1728  m->declare("maths.lib/author", "GRAME");
1729  m->declare("maths.lib/copyright", "GRAME");
1730  m->declare("maths.lib/license", "LGPL with exception");
1731  m->declare("maths.lib/name", "Faust Math Library");
1732  m->declare("maths.lib/version", "2.3");
1733  m->declare("name", "zitarevdsp");
1734  m->declare("platform.lib/name", "Generic Platform Library");
1735  m->declare("platform.lib/version", "0.1");
1736  m->declare("reverbs.lib/name", "Faust Reverb Library");
1737  m->declare("reverbs.lib/version", "0.0");
1738  m->declare("routes.lib/name", "Faust Signal Routing Library");
1739  m->declare("routes.lib/version", "0.2");
1740  m->declare("signals.lib/name", "Faust Signal Routing Library");
1741  m->declare("signals.lib/version", "0.0");
1742  }
1743 
1744  virtual int getNumInputs() {
1745  return 2;
1746  }
1747  virtual int getNumOutputs() {
1748  return 2;
1749  }
1750  virtual int getInputRate(int channel) {
1751  int rate;
1752  switch ((channel)) {
1753  case 0: {
1754  rate = 1;
1755  break;
1756  }
1757  case 1: {
1758  rate = 1;
1759  break;
1760  }
1761  default: {
1762  rate = -1;
1763  break;
1764  }
1765  }
1766  return rate;
1767  }
1768  virtual int getOutputRate(int channel) {
1769  int rate;
1770  switch ((channel)) {
1771  case 0: {
1772  rate = 1;
1773  break;
1774  }
1775  case 1: {
1776  rate = 1;
1777  break;
1778  }
1779  default: {
1780  rate = -1;
1781  break;
1782  }
1783  }
1784  return rate;
1785  }
1786 
1787  static void classInit(int sample_rate) {
1788  }
1789 
1790  virtual void instanceConstants(int sample_rate) {
1791  fSampleRate = sample_rate;
1792  fConst0 = std::min<float>(192000.0f, std::max<float>(1.0f, float(fSampleRate)));
1793  fConst1 = (6.28318548f / fConst0);
1794  fConst2 = std::floor(((0.219990999f * fConst0) + 0.5f));
1795  fConst3 = ((0.0f - (6.90775537f * fConst2)) / fConst0);
1796  fConst4 = (3.14159274f / fConst0);
1797  fConst5 = std::floor(((0.0191229992f * fConst0) + 0.5f));
1798  iConst6 = int(std::min<float>(16384.0f, std::max<float>(0.0f, (fConst2 - fConst5))));
1799  fConst7 = (0.00100000005f * fConst0);
1800  iConst8 = int(std::min<float>(1024.0f, std::max<float>(0.0f, (fConst5 + -1.0f))));
1801  fConst9 = std::floor(((0.256891012f * fConst0) + 0.5f));
1802  fConst10 = ((0.0f - (6.90775537f * fConst9)) / fConst0);
1803  fConst11 = std::floor(((0.0273330007f * fConst0) + 0.5f));
1804  iConst12 = int(std::min<float>(16384.0f, std::max<float>(0.0f, (fConst9 - fConst11))));
1805  iConst13 = int(std::min<float>(2048.0f, std::max<float>(0.0f, (fConst11 + -1.0f))));
1806  fConst14 = std::floor(((0.192303002f * fConst0) + 0.5f));
1807  fConst15 = ((0.0f - (6.90775537f * fConst14)) / fConst0);
1808  fConst16 = std::floor(((0.0292910002f * fConst0) + 0.5f));
1809  iConst17 = int(std::min<float>(8192.0f, std::max<float>(0.0f, (fConst14 - fConst16))));
1810  iConst18 = int(std::min<float>(2048.0f, std::max<float>(0.0f, (fConst16 + -1.0f))));
1811  fConst19 = std::floor(((0.210389003f * fConst0) + 0.5f));
1812  fConst20 = ((0.0f - (6.90775537f * fConst19)) / fConst0);
1813  fConst21 = std::floor(((0.0244210009f * fConst0) + 0.5f));
1814  iConst22 = int(std::min<float>(16384.0f, std::max<float>(0.0f, (fConst19 - fConst21))));
1815  iConst23 = int(std::min<float>(2048.0f, std::max<float>(0.0f, (fConst21 + -1.0f))));
1816  fConst24 = std::floor(((0.125f * fConst0) + 0.5f));
1817  fConst25 = ((0.0f - (6.90775537f * fConst24)) / fConst0);
1818  fConst26 = std::floor(((0.0134579996f * fConst0) + 0.5f));
1819  iConst27 = int(std::min<float>(8192.0f, std::max<float>(0.0f, (fConst24 - fConst26))));
1820  iConst28 = int(std::min<float>(1024.0f, std::max<float>(0.0f, (fConst26 + -1.0f))));
1821  fConst29 = std::floor(((0.127837002f * fConst0) + 0.5f));
1822  fConst30 = ((0.0f - (6.90775537f * fConst29)) / fConst0);
1823  fConst31 = std::floor(((0.0316039994f * fConst0) + 0.5f));
1824  iConst32 = int(std::min<float>(8192.0f, std::max<float>(0.0f, (fConst29 - fConst31))));
1825  iConst33 = int(std::min<float>(2048.0f, std::max<float>(0.0f, (fConst31 + -1.0f))));
1826  fConst34 = std::floor(((0.174713001f * fConst0) + 0.5f));
1827  fConst35 = ((0.0f - (6.90775537f * fConst34)) / fConst0);
1828  fConst36 = std::floor(((0.0229039993f * fConst0) + 0.5f));
1829  iConst37 = int(std::min<float>(8192.0f, std::max<float>(0.0f, (fConst34 - fConst36))));
1830  iConst38 = int(std::min<float>(2048.0f, std::max<float>(0.0f, (fConst36 + -1.0f))));
1831  fConst39 = std::floor(((0.153128996f * fConst0) + 0.5f));
1832  fConst40 = ((0.0f - (6.90775537f * fConst39)) / fConst0);
1833  fConst41 = std::floor(((0.0203460008f * fConst0) + 0.5f));
1834  iConst42 = int(std::min<float>(8192.0f, std::max<float>(0.0f, (fConst39 - fConst41))));
1835  iConst43 = int(std::min<float>(1024.0f, std::max<float>(0.0f, (fConst41 + -1.0f))));
1836  }
1837 
1839  fVslider0 = FAUSTFLOAT(-3.0f);
1840  fVslider1 = FAUSTFLOAT(0.0f);
1841  fVslider2 = FAUSTFLOAT(1500.0f);
1842  fVslider3 = FAUSTFLOAT(0.0f);
1843  fVslider4 = FAUSTFLOAT(315.0f);
1844  fVslider5 = FAUSTFLOAT(0.0f);
1845  fVslider6 = FAUSTFLOAT(2.0f);
1846  fVslider7 = FAUSTFLOAT(6000.0f);
1847  fVslider8 = FAUSTFLOAT(3.0f);
1848  fVslider9 = FAUSTFLOAT(200.0f);
1849  fVslider10 = FAUSTFLOAT(60.0f);
1850  }
1851 
1852  virtual void instanceClear() {
1853  IOTA = 0;
1854  for (int l0 = 0; (l0 < 16384); l0 = (l0 + 1)) {
1855  fVec0[l0] = 0.0f;
1856  }
1857  for (int l1 = 0; (l1 < 16384); l1 = (l1 + 1)) {
1858  fVec1[l1] = 0.0f;
1859  }
1860  for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
1861  fRec0[l2] = 0.0f;
1862  }
1863  for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
1864  fRec1[l3] = 0.0f;
1865  }
1866  for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
1867  fRec15[l4] = 0.0f;
1868  }
1869  for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
1870  fRec14[l5] = 0.0f;
1871  }
1872  for (int l6 = 0; (l6 < 32768); l6 = (l6 + 1)) {
1873  fVec2[l6] = 0.0f;
1874  }
1875  for (int l7 = 0; (l7 < 2048); l7 = (l7 + 1)) {
1876  fVec3[l7] = 0.0f;
1877  }
1878  for (int l8 = 0; (l8 < 2); l8 = (l8 + 1)) {
1879  fRec12[l8] = 0.0f;
1880  }
1881  for (int l9 = 0; (l9 < 2); l9 = (l9 + 1)) {
1882  fRec19[l9] = 0.0f;
1883  }
1884  for (int l10 = 0; (l10 < 2); l10 = (l10 + 1)) {
1885  fRec18[l10] = 0.0f;
1886  }
1887  for (int l11 = 0; (l11 < 32768); l11 = (l11 + 1)) {
1888  fVec4[l11] = 0.0f;
1889  }
1890  for (int l12 = 0; (l12 < 4096); l12 = (l12 + 1)) {
1891  fVec5[l12] = 0.0f;
1892  }
1893  for (int l13 = 0; (l13 < 2); l13 = (l13 + 1)) {
1894  fRec16[l13] = 0.0f;
1895  }
1896  for (int l14 = 0; (l14 < 2); l14 = (l14 + 1)) {
1897  fRec23[l14] = 0.0f;
1898  }
1899  for (int l15 = 0; (l15 < 2); l15 = (l15 + 1)) {
1900  fRec22[l15] = 0.0f;
1901  }
1902  for (int l16 = 0; (l16 < 16384); l16 = (l16 + 1)) {
1903  fVec6[l16] = 0.0f;
1904  }
1905  for (int l17 = 0; (l17 < 4096); l17 = (l17 + 1)) {
1906  fVec7[l17] = 0.0f;
1907  }
1908  for (int l18 = 0; (l18 < 2); l18 = (l18 + 1)) {
1909  fRec20[l18] = 0.0f;
1910  }
1911  for (int l19 = 0; (l19 < 2); l19 = (l19 + 1)) {
1912  fRec27[l19] = 0.0f;
1913  }
1914  for (int l20 = 0; (l20 < 2); l20 = (l20 + 1)) {
1915  fRec26[l20] = 0.0f;
1916  }
1917  for (int l21 = 0; (l21 < 32768); l21 = (l21 + 1)) {
1918  fVec8[l21] = 0.0f;
1919  }
1920  for (int l22 = 0; (l22 < 4096); l22 = (l22 + 1)) {
1921  fVec9[l22] = 0.0f;
1922  }
1923  for (int l23 = 0; (l23 < 2); l23 = (l23 + 1)) {
1924  fRec24[l23] = 0.0f;
1925  }
1926  for (int l24 = 0; (l24 < 2); l24 = (l24 + 1)) {
1927  fRec31[l24] = 0.0f;
1928  }
1929  for (int l25 = 0; (l25 < 2); l25 = (l25 + 1)) {
1930  fRec30[l25] = 0.0f;
1931  }
1932  for (int l26 = 0; (l26 < 16384); l26 = (l26 + 1)) {
1933  fVec10[l26] = 0.0f;
1934  }
1935  for (int l27 = 0; (l27 < 2048); l27 = (l27 + 1)) {
1936  fVec11[l27] = 0.0f;
1937  }
1938  for (int l28 = 0; (l28 < 2); l28 = (l28 + 1)) {
1939  fRec28[l28] = 0.0f;
1940  }
1941  for (int l29 = 0; (l29 < 2); l29 = (l29 + 1)) {
1942  fRec35[l29] = 0.0f;
1943  }
1944  for (int l30 = 0; (l30 < 2); l30 = (l30 + 1)) {
1945  fRec34[l30] = 0.0f;
1946  }
1947  for (int l31 = 0; (l31 < 16384); l31 = (l31 + 1)) {
1948  fVec12[l31] = 0.0f;
1949  }
1950  for (int l32 = 0; (l32 < 4096); l32 = (l32 + 1)) {
1951  fVec13[l32] = 0.0f;
1952  }
1953  for (int l33 = 0; (l33 < 2); l33 = (l33 + 1)) {
1954  fRec32[l33] = 0.0f;
1955  }
1956  for (int l34 = 0; (l34 < 2); l34 = (l34 + 1)) {
1957  fRec39[l34] = 0.0f;
1958  }
1959  for (int l35 = 0; (l35 < 2); l35 = (l35 + 1)) {
1960  fRec38[l35] = 0.0f;
1961  }
1962  for (int l36 = 0; (l36 < 16384); l36 = (l36 + 1)) {
1963  fVec14[l36] = 0.0f;
1964  }
1965  for (int l37 = 0; (l37 < 4096); l37 = (l37 + 1)) {
1966  fVec15[l37] = 0.0f;
1967  }
1968  for (int l38 = 0; (l38 < 2); l38 = (l38 + 1)) {
1969  fRec36[l38] = 0.0f;
1970  }
1971  for (int l39 = 0; (l39 < 2); l39 = (l39 + 1)) {
1972  fRec43[l39] = 0.0f;
1973  }
1974  for (int l40 = 0; (l40 < 2); l40 = (l40 + 1)) {
1975  fRec42[l40] = 0.0f;
1976  }
1977  for (int l41 = 0; (l41 < 16384); l41 = (l41 + 1)) {
1978  fVec16[l41] = 0.0f;
1979  }
1980  for (int l42 = 0; (l42 < 2048); l42 = (l42 + 1)) {
1981  fVec17[l42] = 0.0f;
1982  }
1983  for (int l43 = 0; (l43 < 2); l43 = (l43 + 1)) {
1984  fRec40[l43] = 0.0f;
1985  }
1986  for (int l44 = 0; (l44 < 3); l44 = (l44 + 1)) {
1987  fRec4[l44] = 0.0f;
1988  }
1989  for (int l45 = 0; (l45 < 3); l45 = (l45 + 1)) {
1990  fRec5[l45] = 0.0f;
1991  }
1992  for (int l46 = 0; (l46 < 3); l46 = (l46 + 1)) {
1993  fRec6[l46] = 0.0f;
1994  }
1995  for (int l47 = 0; (l47 < 3); l47 = (l47 + 1)) {
1996  fRec7[l47] = 0.0f;
1997  }
1998  for (int l48 = 0; (l48 < 3); l48 = (l48 + 1)) {
1999  fRec8[l48] = 0.0f;
2000  }
2001  for (int l49 = 0; (l49 < 3); l49 = (l49 + 1)) {
2002  fRec9[l49] = 0.0f;
2003  }
2004  for (int l50 = 0; (l50 < 3); l50 = (l50 + 1)) {
2005  fRec10[l50] = 0.0f;
2006  }
2007  for (int l51 = 0; (l51 < 3); l51 = (l51 + 1)) {
2008  fRec11[l51] = 0.0f;
2009  }
2010  for (int l52 = 0; (l52 < 3); l52 = (l52 + 1)) {
2011  fRec3[l52] = 0.0f;
2012  }
2013  for (int l53 = 0; (l53 < 3); l53 = (l53 + 1)) {
2014  fRec2[l53] = 0.0f;
2015  }
2016  for (int l54 = 0; (l54 < 3); l54 = (l54 + 1)) {
2017  fRec45[l54] = 0.0f;
2018  }
2019  for (int l55 = 0; (l55 < 3); l55 = (l55 + 1)) {
2020  fRec44[l55] = 0.0f;
2021  }
2022  }
2023 
2024  virtual void init(int sample_rate) {
2025  classInit(sample_rate);
2026  instanceInit(sample_rate);
2027  }
2028  virtual void instanceInit(int sample_rate) {
2029  instanceConstants(sample_rate);
2031  instanceClear();
2032  }
2033 
2034  virtual zitarevdsp* clone() {
2035  return new zitarevdsp();
2036  }
2037 
2038  virtual int getSampleRate() {
2039  return fSampleRate;
2040  }
2041 
2042  virtual void buildUserInterface(UI* ui_interface) {
2043  ui_interface->declare(0, "0", "");
2044  ui_interface->declare(0, "tooltip", "~ ZITA REV1 FEEDBACK DELAY NETWORK (FDN) & SCHROEDER ALLPASS-COMB REVERBERATOR (8x8). See Faust's reverbs.lib for documentation and references");
2045  ui_interface->openHorizontalBox("Zita_Rev1");
2046  ui_interface->declare(0, "1", "");
2047  ui_interface->openHorizontalBox("Input");
2048  ui_interface->declare(&fVslider10, "1", "");
2049  ui_interface->declare(&fVslider10, "style", "knob");
2050  ui_interface->declare(&fVslider10, "tooltip", "Delay in ms before reverberation begins");
2051  ui_interface->declare(&fVslider10, "unit", "ms");
2052  ui_interface->addVerticalSlider("In Delay", &fVslider10, 60.0f, 20.0f, 100.0f, 1.0f);
2053  ui_interface->closeBox();
2054  ui_interface->declare(0, "2", "");
2055  ui_interface->openHorizontalBox("Decay Times in Bands (see tooltips)");
2056  ui_interface->declare(&fVslider9, "1", "");
2057  ui_interface->declare(&fVslider9, "scale", "log");
2058  ui_interface->declare(&fVslider9, "style", "knob");
2059  ui_interface->declare(&fVslider9, "tooltip", "Crossover frequency (Hz) separating low and middle frequencies");
2060  ui_interface->declare(&fVslider9, "unit", "Hz");
2061  ui_interface->addVerticalSlider("LF X", &fVslider9, 200.0f, 50.0f, 1000.0f, 1.0f);
2062  ui_interface->declare(&fVslider8, "2", "");
2063  ui_interface->declare(&fVslider8, "scale", "log");
2064  ui_interface->declare(&fVslider8, "style", "knob");
2065  ui_interface->declare(&fVslider8, "tooltip", "T60 = time (in seconds) to decay 60dB in low-frequency band");
2066  ui_interface->declare(&fVslider8, "unit", "s");
2067  ui_interface->addVerticalSlider("Low RT60", &fVslider8, 3.0f, 1.0f, 8.0f, 0.100000001f);
2068  ui_interface->declare(&fVslider6, "3", "");
2069  ui_interface->declare(&fVslider6, "scale", "log");
2070  ui_interface->declare(&fVslider6, "style", "knob");
2071  ui_interface->declare(&fVslider6, "tooltip", "T60 = time (in seconds) to decay 60dB in middle band");
2072  ui_interface->declare(&fVslider6, "unit", "s");
2073  ui_interface->addVerticalSlider("Mid RT60", &fVslider6, 2.0f, 1.0f, 8.0f, 0.100000001f);
2074  ui_interface->declare(&fVslider7, "4", "");
2075  ui_interface->declare(&fVslider7, "scale", "log");
2076  ui_interface->declare(&fVslider7, "style", "knob");
2077  ui_interface->declare(&fVslider7, "tooltip", "Frequency (Hz) at which the high-frequency T60 is half the middle-band's T60");
2078  ui_interface->declare(&fVslider7, "unit", "Hz");
2079  ui_interface->addVerticalSlider("HF Damping", &fVslider7, 6000.0f, 1500.0f, 23520.0f, 1.0f);
2080  ui_interface->closeBox();
2081  ui_interface->declare(0, "3", "");
2082  ui_interface->openHorizontalBox("RM Peaking Equalizer 1");
2083  ui_interface->declare(&fVslider4, "1", "");
2084  ui_interface->declare(&fVslider4, "scale", "log");
2085  ui_interface->declare(&fVslider4, "style", "knob");
2086  ui_interface->declare(&fVslider4, "tooltip", "Center-frequency of second-order Regalia-Mitra peaking equalizer section 1");
2087  ui_interface->declare(&fVslider4, "unit", "Hz");
2088  ui_interface->addVerticalSlider("Eq1 Freq", &fVslider4, 315.0f, 40.0f, 2500.0f, 1.0f);
2089  ui_interface->declare(&fVslider5, "2", "");
2090  ui_interface->declare(&fVslider5, "style", "knob");
2091  ui_interface->declare(&fVslider5, "tooltip", "Peak level in dB of second-order Regalia-Mitra peaking equalizer section 1");
2092  ui_interface->declare(&fVslider5, "unit", "dB");
2093  ui_interface->addVerticalSlider("Eq1 Level", &fVslider5, 0.0f, -15.0f, 15.0f, 0.100000001f);
2094  ui_interface->closeBox();
2095  ui_interface->declare(0, "4", "");
2096  ui_interface->openHorizontalBox("RM Peaking Equalizer 2");
2097  ui_interface->declare(&fVslider2, "1", "");
2098  ui_interface->declare(&fVslider2, "scale", "log");
2099  ui_interface->declare(&fVslider2, "style", "knob");
2100  ui_interface->declare(&fVslider2, "tooltip", "Center-frequency of second-order Regalia-Mitra peaking equalizer section 2");
2101  ui_interface->declare(&fVslider2, "unit", "Hz");
2102  ui_interface->addVerticalSlider("Eq2 Freq", &fVslider2, 1500.0f, 160.0f, 10000.0f, 1.0f);
2103  ui_interface->declare(&fVslider3, "2", "");
2104  ui_interface->declare(&fVslider3, "style", "knob");
2105  ui_interface->declare(&fVslider3, "tooltip", "Peak level in dB of second-order Regalia-Mitra peaking equalizer section 2");
2106  ui_interface->declare(&fVslider3, "unit", "dB");
2107  ui_interface->addVerticalSlider("Eq2 Level", &fVslider3, 0.0f, -15.0f, 15.0f, 0.100000001f);
2108  ui_interface->closeBox();
2109  ui_interface->declare(0, "5", "");
2110  ui_interface->openHorizontalBox("Output");
2111  ui_interface->declare(&fVslider1, "1", "");
2112  ui_interface->declare(&fVslider1, "style", "knob");
2113  ui_interface->declare(&fVslider1, "tooltip", "Dry/Wet Mix: 0 = dry, 1 = wet");
2114  ui_interface->addVerticalSlider("Wet", &fVslider1, 0.0f, 0.0f, 1.0f, 0.00999999978f);
2115  ui_interface->declare(&fVslider0, "2", "");
2116  ui_interface->declare(&fVslider0, "style", "knob");
2117  ui_interface->declare(&fVslider0, "tooltip", "Output scale factor");
2118  ui_interface->declare(&fVslider0, "unit", "dB");
2119  ui_interface->addVerticalSlider("Level", &fVslider0, -3.0f, -70.0f, 20.0f, 0.100000001f);
2120  ui_interface->closeBox();
2121  ui_interface->closeBox();
2122  }
2123 
2124  virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
2125  FAUSTFLOAT* input0 = inputs[0];
2126  FAUSTFLOAT* input1 = inputs[1];
2127  FAUSTFLOAT* output0 = outputs[0];
2128  FAUSTFLOAT* output1 = outputs[1];
2129  float fSlow0 = (0.00100000005f * std::pow(10.0f, (0.0500000007f * float(fVslider0))));
2130  float fSlow1 = (0.00100000005f * float(fVslider1));
2131  float fSlow2 = float(fVslider2);
2132  float fSlow3 = std::pow(10.0f, (0.0500000007f * float(fVslider3)));
2133  float fSlow4 = (fConst1 * (fSlow2 / std::sqrt(std::max<float>(0.0f, fSlow3))));
2134  float fSlow5 = ((1.0f - fSlow4) / (fSlow4 + 1.0f));
2135  float fSlow6 = float(fVslider4);
2136  float fSlow7 = std::pow(10.0f, (0.0500000007f * float(fVslider5)));
2137  float fSlow8 = (fConst1 * (fSlow6 / std::sqrt(std::max<float>(0.0f, fSlow7))));
2138  float fSlow9 = ((1.0f - fSlow8) / (fSlow8 + 1.0f));
2139  float fSlow10 = float(fVslider6);
2140  float fSlow11 = std::exp((fConst3 / fSlow10));
2141  float fSlow12 = zitarevdsp_faustpower2_f(fSlow11);
2142  float fSlow13 = std::cos((fConst1 * float(fVslider7)));
2143  float fSlow14 = (1.0f - (fSlow12 * fSlow13));
2144  float fSlow15 = (1.0f - fSlow12);
2145  float fSlow16 = (fSlow14 / fSlow15);
2146  float fSlow17 = std::sqrt(std::max<float>(0.0f, ((zitarevdsp_faustpower2_f(fSlow14) / zitarevdsp_faustpower2_f(fSlow15)) + -1.0f)));
2147  float fSlow18 = (fSlow16 - fSlow17);
2148  float fSlow19 = (fSlow11 * (fSlow17 + (1.0f - fSlow16)));
2149  float fSlow20 = float(fVslider8);
2150  float fSlow21 = ((std::exp((fConst3 / fSlow20)) / fSlow11) + -1.0f);
2151  float fSlow22 = (1.0f / std::tan((fConst4 * float(fVslider9))));
2152  float fSlow23 = (1.0f / (fSlow22 + 1.0f));
2153  float fSlow24 = (1.0f - fSlow22);
2154  int iSlow25 = int(std::min<float>(8192.0f, std::max<float>(0.0f, (fConst7 * float(fVslider10)))));
2155  float fSlow26 = std::exp((fConst10 / fSlow10));
2156  float fSlow27 = zitarevdsp_faustpower2_f(fSlow26);
2157  float fSlow28 = (1.0f - (fSlow27 * fSlow13));
2158  float fSlow29 = (1.0f - fSlow27);
2159  float fSlow30 = (fSlow28 / fSlow29);
2160  float fSlow31 = std::sqrt(std::max<float>(0.0f, ((zitarevdsp_faustpower2_f(fSlow28) / zitarevdsp_faustpower2_f(fSlow29)) + -1.0f)));
2161  float fSlow32 = (fSlow30 - fSlow31);
2162  float fSlow33 = (fSlow26 * (fSlow31 + (1.0f - fSlow30)));
2163  float fSlow34 = ((std::exp((fConst10 / fSlow20)) / fSlow26) + -1.0f);
2164  float fSlow35 = std::exp((fConst15 / fSlow10));
2165  float fSlow36 = zitarevdsp_faustpower2_f(fSlow35);
2166  float fSlow37 = (1.0f - (fSlow36 * fSlow13));
2167  float fSlow38 = (1.0f - fSlow36);
2168  float fSlow39 = (fSlow37 / fSlow38);
2169  float fSlow40 = std::sqrt(std::max<float>(0.0f, ((zitarevdsp_faustpower2_f(fSlow37) / zitarevdsp_faustpower2_f(fSlow38)) + -1.0f)));
2170  float fSlow41 = (fSlow39 - fSlow40);
2171  float fSlow42 = (fSlow35 * (fSlow40 + (1.0f - fSlow39)));
2172  float fSlow43 = ((std::exp((fConst15 / fSlow20)) / fSlow35) + -1.0f);
2173  float fSlow44 = std::exp((fConst20 / fSlow10));
2174  float fSlow45 = zitarevdsp_faustpower2_f(fSlow44);
2175  float fSlow46 = (1.0f - (fSlow45 * fSlow13));
2176  float fSlow47 = (1.0f - fSlow45);
2177  float fSlow48 = (fSlow46 / fSlow47);
2178  float fSlow49 = std::sqrt(std::max<float>(0.0f, ((zitarevdsp_faustpower2_f(fSlow46) / zitarevdsp_faustpower2_f(fSlow47)) + -1.0f)));
2179  float fSlow50 = (fSlow48 - fSlow49);
2180  float fSlow51 = (fSlow44 * (fSlow49 + (1.0f - fSlow48)));
2181  float fSlow52 = ((std::exp((fConst20 / fSlow20)) / fSlow44) + -1.0f);
2182  float fSlow53 = std::exp((fConst25 / fSlow10));
2183  float fSlow54 = zitarevdsp_faustpower2_f(fSlow53);
2184  float fSlow55 = (1.0f - (fSlow54 * fSlow13));
2185  float fSlow56 = (1.0f - fSlow54);
2186  float fSlow57 = (fSlow55 / fSlow56);
2187  float fSlow58 = std::sqrt(std::max<float>(0.0f, ((zitarevdsp_faustpower2_f(fSlow55) / zitarevdsp_faustpower2_f(fSlow56)) + -1.0f)));
2188  float fSlow59 = (fSlow57 - fSlow58);
2189  float fSlow60 = (fSlow53 * (fSlow58 + (1.0f - fSlow57)));
2190  float fSlow61 = ((std::exp((fConst25 / fSlow20)) / fSlow53) + -1.0f);
2191  float fSlow62 = std::exp((fConst30 / fSlow10));
2192  float fSlow63 = zitarevdsp_faustpower2_f(fSlow62);
2193  float fSlow64 = (1.0f - (fSlow63 * fSlow13));
2194  float fSlow65 = (1.0f - fSlow63);
2195  float fSlow66 = (fSlow64 / fSlow65);
2196  float fSlow67 = std::sqrt(std::max<float>(0.0f, ((zitarevdsp_faustpower2_f(fSlow64) / zitarevdsp_faustpower2_f(fSlow65)) + -1.0f)));
2197  float fSlow68 = (fSlow66 - fSlow67);
2198  float fSlow69 = (fSlow62 * (fSlow67 + (1.0f - fSlow66)));
2199  float fSlow70 = ((std::exp((fConst30 / fSlow20)) / fSlow62) + -1.0f);
2200  float fSlow71 = std::exp((fConst35 / fSlow10));
2201  float fSlow72 = zitarevdsp_faustpower2_f(fSlow71);
2202  float fSlow73 = (1.0f - (fSlow72 * fSlow13));
2203  float fSlow74 = (1.0f - fSlow72);
2204  float fSlow75 = (fSlow73 / fSlow74);
2205  float fSlow76 = std::sqrt(std::max<float>(0.0f, ((zitarevdsp_faustpower2_f(fSlow73) / zitarevdsp_faustpower2_f(fSlow74)) + -1.0f)));
2206  float fSlow77 = (fSlow75 - fSlow76);
2207  float fSlow78 = (fSlow71 * (fSlow76 + (1.0f - fSlow75)));
2208  float fSlow79 = ((std::exp((fConst35 / fSlow20)) / fSlow71) + -1.0f);
2209  float fSlow80 = std::exp((fConst40 / fSlow10));
2210  float fSlow81 = zitarevdsp_faustpower2_f(fSlow80);
2211  float fSlow82 = (1.0f - (fSlow81 * fSlow13));
2212  float fSlow83 = (1.0f - fSlow81);
2213  float fSlow84 = (fSlow82 / fSlow83);
2214  float fSlow85 = std::sqrt(std::max<float>(0.0f, ((zitarevdsp_faustpower2_f(fSlow82) / zitarevdsp_faustpower2_f(fSlow83)) + -1.0f)));
2215  float fSlow86 = (fSlow84 - fSlow85);
2216  float fSlow87 = (fSlow80 * (fSlow85 + (1.0f - fSlow84)));
2217  float fSlow88 = ((std::exp((fConst40 / fSlow20)) / fSlow80) + -1.0f);
2218  float fSlow89 = (0.0f - (std::cos((fConst1 * fSlow6)) * (fSlow9 + 1.0f)));
2219  float fSlow90 = (0.0f - (std::cos((fConst1 * fSlow2)) * (fSlow5 + 1.0f)));
2220  for (int i = 0; (i < count); i = (i + 1)) {
2221  float fTemp0 = float(input0[i]);
2222  fVec0[(IOTA & 16383)] = fTemp0;
2223  float fTemp1 = float(input1[i]);
2224  fVec1[(IOTA & 16383)] = fTemp1;
2225  fRec0[0] = (fSlow0 + (0.999000013f * fRec0[1]));
2226  fRec1[0] = (fSlow1 + (0.999000013f * fRec1[1]));
2227  fRec15[0] = (0.0f - (fSlow23 * ((fSlow24 * fRec15[1]) - (fRec11[1] + fRec11[2]))));
2228  fRec14[0] = ((fSlow18 * fRec14[1]) + (fSlow19 * (fRec11[1] + (fSlow21 * fRec15[0]))));
2229  fVec2[(IOTA & 32767)] = ((0.353553385f * fRec14[0]) + 9.99999968e-21f);
2230  float fTemp2 = (0.300000012f * fVec1[((IOTA - iSlow25) & 16383)]);
2231  float fTemp3 = (((0.600000024f * fRec12[1]) + fVec2[((IOTA - iConst6) & 32767)]) - fTemp2);
2232  fVec3[(IOTA & 2047)] = fTemp3;
2233  fRec12[0] = fVec3[((IOTA - iConst8) & 2047)];
2234  float fRec13 = (0.0f - (0.600000024f * fTemp3));
2235  fRec19[0] = (0.0f - (fSlow23 * ((fSlow24 * fRec19[1]) - (fRec7[1] + fRec7[2]))));
2236  fRec18[0] = ((fSlow32 * fRec18[1]) + (fSlow33 * (fRec7[1] + (fSlow34 * fRec19[0]))));
2237  fVec4[(IOTA & 32767)] = ((0.353553385f * fRec18[0]) + 9.99999968e-21f);
2238  float fTemp4 = (((0.600000024f * fRec16[1]) + fVec4[((IOTA - iConst12) & 32767)]) - fTemp2);
2239  fVec5[(IOTA & 4095)] = fTemp4;
2240  fRec16[0] = fVec5[((IOTA - iConst13) & 4095)];
2241  float fRec17 = (0.0f - (0.600000024f * fTemp4));
2242  fRec23[0] = (0.0f - (fSlow23 * ((fSlow24 * fRec23[1]) - (fRec9[1] + fRec9[2]))));
2243  fRec22[0] = ((fSlow41 * fRec22[1]) + (fSlow42 * (fRec9[1] + (fSlow43 * fRec23[0]))));
2244  fVec6[(IOTA & 16383)] = ((0.353553385f * fRec22[0]) + 9.99999968e-21f);
2245  float fTemp5 = (fVec6[((IOTA - iConst17) & 16383)] + (fTemp2 + (0.600000024f * fRec20[1])));
2246  fVec7[(IOTA & 4095)] = fTemp5;
2247  fRec20[0] = fVec7[((IOTA - iConst18) & 4095)];
2248  float fRec21 = (0.0f - (0.600000024f * fTemp5));
2249  fRec27[0] = (0.0f - (fSlow23 * ((fSlow24 * fRec27[1]) - (fRec5[1] + fRec5[2]))));
2250  fRec26[0] = ((fSlow50 * fRec26[1]) + (fSlow51 * (fRec5[1] + (fSlow52 * fRec27[0]))));
2251  fVec8[(IOTA & 32767)] = ((0.353553385f * fRec26[0]) + 9.99999968e-21f);
2252  float fTemp6 = (fTemp2 + ((0.600000024f * fRec24[1]) + fVec8[((IOTA - iConst22) & 32767)]));
2253  fVec9[(IOTA & 4095)] = fTemp6;
2254  fRec24[0] = fVec9[((IOTA - iConst23) & 4095)];
2255  float fRec25 = (0.0f - (0.600000024f * fTemp6));
2256  fRec31[0] = (0.0f - (fSlow23 * ((fSlow24 * fRec31[1]) - (fRec10[1] + fRec10[2]))));
2257  fRec30[0] = ((fSlow59 * fRec30[1]) + (fSlow60 * (fRec10[1] + (fSlow61 * fRec31[0]))));
2258  fVec10[(IOTA & 16383)] = ((0.353553385f * fRec30[0]) + 9.99999968e-21f);
2259  float fTemp7 = (0.300000012f * fVec0[((IOTA - iSlow25) & 16383)]);
2260  float fTemp8 = (fVec10[((IOTA - iConst27) & 16383)] - (fTemp7 + (0.600000024f * fRec28[1])));
2261  fVec11[(IOTA & 2047)] = fTemp8;
2262  fRec28[0] = fVec11[((IOTA - iConst28) & 2047)];
2263  float fRec29 = (0.600000024f * fTemp8);
2264  fRec35[0] = (0.0f - (fSlow23 * ((fSlow24 * fRec35[1]) - (fRec6[1] + fRec6[2]))));
2265  fRec34[0] = ((fSlow68 * fRec34[1]) + (fSlow69 * (fRec6[1] + (fSlow70 * fRec35[0]))));
2266  fVec12[(IOTA & 16383)] = ((0.353553385f * fRec34[0]) + 9.99999968e-21f);
2267  float fTemp9 = (fVec12[((IOTA - iConst32) & 16383)] - (fTemp7 + (0.600000024f * fRec32[1])));
2268  fVec13[(IOTA & 4095)] = fTemp9;
2269  fRec32[0] = fVec13[((IOTA - iConst33) & 4095)];
2270  float fRec33 = (0.600000024f * fTemp9);
2271  fRec39[0] = (0.0f - (fSlow23 * ((fSlow24 * fRec39[1]) - (fRec8[1] + fRec8[2]))));
2272  fRec38[0] = ((fSlow77 * fRec38[1]) + (fSlow78 * (fRec8[1] + (fSlow79 * fRec39[0]))));
2273  fVec14[(IOTA & 16383)] = ((0.353553385f * fRec38[0]) + 9.99999968e-21f);
2274  float fTemp10 = ((fTemp7 + fVec14[((IOTA - iConst37) & 16383)]) - (0.600000024f * fRec36[1]));
2275  fVec15[(IOTA & 4095)] = fTemp10;
2276  fRec36[0] = fVec15[((IOTA - iConst38) & 4095)];
2277  float fRec37 = (0.600000024f * fTemp10);
2278  fRec43[0] = (0.0f - (fSlow23 * ((fSlow24 * fRec43[1]) - (fRec4[1] + fRec4[2]))));
2279  fRec42[0] = ((fSlow86 * fRec42[1]) + (fSlow87 * (fRec4[1] + (fSlow88 * fRec43[0]))));
2280  fVec16[(IOTA & 16383)] = ((0.353553385f * fRec42[0]) + 9.99999968e-21f);
2281  float fTemp11 = ((fVec16[((IOTA - iConst42) & 16383)] + fTemp7) - (0.600000024f * fRec40[1]));
2282  fVec17[(IOTA & 2047)] = fTemp11;
2283  fRec40[0] = fVec17[((IOTA - iConst43) & 2047)];
2284  float fRec41 = (0.600000024f * fTemp11);
2285  float fTemp12 = (fRec41 + fRec37);
2286  float fTemp13 = (fRec29 + (fRec33 + fTemp12));
2287  fRec4[0] = (fRec12[1] + (fRec16[1] + (fRec20[1] + (fRec24[1] + (fRec28[1] + (fRec32[1] + (fRec36[1] + (fRec40[1] + (fRec13 + (fRec17 + (fRec21 + (fRec25 + fTemp13))))))))))));
2288  fRec5[0] = ((fRec28[1] + (fRec32[1] + (fRec36[1] + (fRec40[1] + fTemp13)))) - (fRec12[1] + (fRec16[1] + (fRec20[1] + (fRec24[1] + (fRec13 + (fRec17 + (fRec25 + fRec21))))))));
2289  float fTemp14 = (fRec33 + fRec29);
2290  fRec6[0] = ((fRec20[1] + (fRec24[1] + (fRec36[1] + (fRec40[1] + (fRec21 + (fRec25 + fTemp12)))))) - (fRec12[1] + (fRec16[1] + (fRec28[1] + (fRec32[1] + (fRec13 + (fRec17 + fTemp14)))))));
2291  fRec7[0] = ((fRec12[1] + (fRec16[1] + (fRec36[1] + (fRec40[1] + (fRec13 + (fRec17 + fTemp12)))))) - (fRec20[1] + (fRec24[1] + (fRec28[1] + (fRec32[1] + (fRec21 + (fRec25 + fTemp14)))))));
2292  float fTemp15 = (fRec41 + fRec33);
2293  float fTemp16 = (fRec37 + fRec29);
2294  fRec8[0] = ((fRec16[1] + (fRec24[1] + (fRec32[1] + (fRec40[1] + (fRec17 + (fRec25 + fTemp15)))))) - (fRec12[1] + (fRec20[1] + (fRec28[1] + (fRec36[1] + (fRec13 + (fRec21 + fTemp16)))))));
2295  fRec9[0] = ((fRec12[1] + (fRec20[1] + (fRec32[1] + (fRec40[1] + (fRec13 + (fRec21 + fTemp15)))))) - (fRec16[1] + (fRec24[1] + (fRec28[1] + (fRec36[1] + (fRec17 + (fRec25 + fTemp16)))))));
2296  float fTemp17 = (fRec41 + fRec29);
2297  float fTemp18 = (fRec37 + fRec33);
2298  fRec10[0] = ((fRec12[1] + (fRec24[1] + (fRec28[1] + (fRec40[1] + (fRec13 + (fRec25 + fTemp17)))))) - (fRec16[1] + (fRec20[1] + (fRec32[1] + (fRec36[1] + (fRec17 + (fRec21 + fTemp18)))))));
2299  fRec11[0] = ((fRec16[1] + (fRec20[1] + (fRec28[1] + (fRec40[1] + (fRec17 + (fRec21 + fTemp17)))))) - (fRec12[1] + (fRec24[1] + (fRec32[1] + (fRec36[1] + (fRec13 + (fRec25 + fTemp18)))))));
2300  float fTemp19 = (0.370000005f * (fRec5[0] + fRec6[0]));
2301  float fTemp20 = (fSlow89 * fRec3[1]);
2302  fRec3[0] = (fTemp19 - (fTemp20 + (fSlow9 * fRec3[2])));
2303  float fTemp21 = (fSlow9 * fRec3[0]);
2304  float fTemp22 = (0.5f * ((fTemp21 + (fRec3[2] + (fTemp19 + fTemp20))) + (fSlow7 * ((fTemp21 + (fTemp20 + fRec3[2])) - fTemp19))));
2305  float fTemp23 = (fSlow90 * fRec2[1]);
2306  fRec2[0] = (fTemp22 - (fTemp23 + (fSlow5 * fRec2[2])));
2307  float fTemp24 = (fSlow5 * fRec2[0]);
2308  float fTemp25 = (1.0f - fRec1[0]);
2309  output0[i] = FAUSTFLOAT((fRec0[0] * ((0.5f * (fRec1[0] * ((fTemp24 + (fRec2[2] + (fTemp22 + fTemp23))) + (fSlow3 * ((fTemp24 + (fTemp23 + fRec2[2])) - fTemp22))))) + (fTemp0 * fTemp25))));
2310  float fTemp26 = (0.370000005f * (fRec5[0] - fRec6[0]));
2311  float fTemp27 = (fSlow89 * fRec45[1]);
2312  fRec45[0] = (fTemp26 - (fTemp27 + (fSlow9 * fRec45[2])));
2313  float fTemp28 = (fSlow9 * fRec45[0]);
2314  float fTemp29 = (0.5f * ((fTemp28 + (fRec45[2] + (fTemp26 + fTemp27))) + (fSlow7 * ((fTemp28 + (fTemp27 + fRec45[2])) - fTemp26))));
2315  float fTemp30 = (fSlow90 * fRec44[1]);
2316  fRec44[0] = (fTemp29 - (fTemp30 + (fSlow5 * fRec44[2])));
2317  float fTemp31 = (fSlow5 * fRec44[0]);
2318  output1[i] = FAUSTFLOAT((fRec0[0] * ((0.5f * (fRec1[0] * ((fTemp31 + (fRec44[2] + (fTemp29 + fTemp30))) + (fSlow3 * ((fTemp31 + (fTemp30 + fRec44[2])) - fTemp29))))) + (fTemp1 * fTemp25))));
2319  IOTA = (IOTA + 1);
2320  fRec0[1] = fRec0[0];
2321  fRec1[1] = fRec1[0];
2322  fRec15[1] = fRec15[0];
2323  fRec14[1] = fRec14[0];
2324  fRec12[1] = fRec12[0];
2325  fRec19[1] = fRec19[0];
2326  fRec18[1] = fRec18[0];
2327  fRec16[1] = fRec16[0];
2328  fRec23[1] = fRec23[0];
2329  fRec22[1] = fRec22[0];
2330  fRec20[1] = fRec20[0];
2331  fRec27[1] = fRec27[0];
2332  fRec26[1] = fRec26[0];
2333  fRec24[1] = fRec24[0];
2334  fRec31[1] = fRec31[0];
2335  fRec30[1] = fRec30[0];
2336  fRec28[1] = fRec28[0];
2337  fRec35[1] = fRec35[0];
2338  fRec34[1] = fRec34[0];
2339  fRec32[1] = fRec32[0];
2340  fRec39[1] = fRec39[0];
2341  fRec38[1] = fRec38[0];
2342  fRec36[1] = fRec36[0];
2343  fRec43[1] = fRec43[0];
2344  fRec42[1] = fRec42[0];
2345  fRec40[1] = fRec40[0];
2346  fRec4[2] = fRec4[1];
2347  fRec4[1] = fRec4[0];
2348  fRec5[2] = fRec5[1];
2349  fRec5[1] = fRec5[0];
2350  fRec6[2] = fRec6[1];
2351  fRec6[1] = fRec6[0];
2352  fRec7[2] = fRec7[1];
2353  fRec7[1] = fRec7[0];
2354  fRec8[2] = fRec8[1];
2355  fRec8[1] = fRec8[0];
2356  fRec9[2] = fRec9[1];
2357  fRec9[1] = fRec9[0];
2358  fRec10[2] = fRec10[1];
2359  fRec10[1] = fRec10[0];
2360  fRec11[2] = fRec11[1];
2361  fRec11[1] = fRec11[0];
2362  fRec3[2] = fRec3[1];
2363  fRec3[1] = fRec3[0];
2364  fRec2[2] = fRec2[1];
2365  fRec2[1] = fRec2[0];
2366  fRec45[2] = fRec45[1];
2367  fRec45[1] = fRec45[0];
2368  fRec44[2] = fRec44[1];
2369  fRec44[1] = fRec44[0];
2370  }
2371  }
2372 
2373 };
2374 
2375 #endif
ZoneReader::~ZoneReader
virtual ~ZoneReader()
Definition: zitarevdsp.h:1015
APIUI::fGyr
std::vector< ZoneControl * > fGyr[3]
Definition: compressordsp.h:1054
AccUpDownConverter::AccUpDownConverter
AccUpDownConverter(double amin, double amid, double amax, double fmin, double fmid, double fmax)
Definition: zitarevdsp.h:843
AccUpConverter
Definition: compressordsp.h:766
APIUI::getParamInit
FAUSTFLOAT getParamInit(int p)
Definition: zitarevdsp.h:1364
dsp_memory_manager::allocate
virtual void * allocate(size_t size)=0
ZoneControl::getActive
virtual bool getActive()
Definition: zitarevdsp.h:922
PathBuilder::pushLabel
void pushLabel(const std::string &label)
Definition: zitarevdsp.h:457
ValueConverter::~ValueConverter
virtual ~ValueConverter()
Definition: zitarevdsp.h:633
decorator_dsp::buildUserInterface
virtual void buildUserInterface(UI *ui_interface)
Definition: zitarevdsp.h:178
decorator_dsp::compute
virtual void compute(double date_usec, int count, FAUSTFLOAT **inputs, FAUSTFLOAT **outputs)
Definition: zitarevdsp.h:189
UIReal::addSoundfile
virtual void addSoundfile(const char *label, const char *filename, Soundfile **sf_zone)=0
Interpolator
Definition: compressordsp.h:553
APIUI::setAccConverter
void setAccConverter(int p, int acc, int curve, double amin, double amid, double amax)
Definition: zitarevdsp.h:1436
UIReal::~UIReal
virtual ~UIReal()
Definition: zitarevdsp.h:352
Interpolator::Interpolator
Interpolator(double lo, double hi, double v1, double v2)
Definition: zitarevdsp.h:572
APIUI::propagateGyr
void propagateGyr(int gyr, double value)
Definition: zitarevdsp.h:1496
APIUI::Type
Type
Definition: compressordsp.h:1236
Interpolator3pt
Definition: compressordsp.h:605
APIUI::kAcc
@ kAcc
Definition: compressordsp.h:1236
dsp_factory::getDSPCode
virtual std::string getDSPCode()=0
APIUI::kHBargraph
@ kHBargraph
Definition: compressordsp.h:1034
APIUI::fLabels
std::vector< std::string > fLabels
Definition: compressordsp.h:1042
LinearValueConverter::LinearValueConverter
LinearValueConverter(double umin, double umax, double fmin, double fmax)
Definition: zitarevdsp.h:677
APIUI::openHorizontalBox
virtual void openHorizontalBox(const char *label)
Definition: zitarevdsp.h:1253
APIUI::fCurrentColor
std::string fCurrentColor
Definition: compressordsp.h:1068
decorator_dsp::instanceClear
virtual void instanceClear()
Definition: zitarevdsp.h:184
APIUI::getParamIndex
int getParamIndex(const char *path)
Definition: zitarevdsp.h:1335
APIUI::fRedReader
ZoneReader * fRedReader
Definition: compressordsp.h:1059
UpdatableValueConverter
Definition: compressordsp.h:645
zitarevdsp::getSampleRate
virtual int getSampleRate()
Definition: zitarevdsp.h:2038
UI::~UI
virtual ~UI()
Definition: zitarevdsp.h:386
dsp::instanceResetUserInterface
virtual void instanceResetUserInterface()=0
decorator_dsp::decorator_dsp
decorator_dsp(dsp *dsp=nullptr)
Definition: zitarevdsp.h:173
LinearValueConverter2::setMappingValues
virtual void setMappingValues(double amin, double amid, double amax, double min, double init, double max)
Definition: zitarevdsp.h:711
decorator_dsp::instanceResetUserInterface
virtual void instanceResetUserInterface()
Definition: zitarevdsp.h:183
AccUpDownConverter::ui2faust
virtual double ui2faust(double x)
Definition: zitarevdsp.h:848
ZoneControl::ZoneControl
ZoneControl(FAUSTFLOAT *zone)
Definition: zitarevdsp.h:911
LinearValueConverter::LinearValueConverter
LinearValueConverter()
Definition: zitarevdsp.h:681
APIUI::getGyrConverter
void getGyrConverter(int p, int &gyr, int &curve, double &amin, double &amid, double &amax)
Definition: zitarevdsp.h:1484
dsp::compute
virtual void compute(double, int count, FAUSTFLOAT **inputs, FAUSTFLOAT **outputs)
Definition: zitarevdsp.h:157
decorator_dsp::init
virtual void init(int sample_rate)
Definition: zitarevdsp.h:180
APIUI::getZoneIndex
int getZoneIndex(std::vector< ZoneControl * > *table, int p, int val)
Definition: zitarevdsp.h:1168
APIUI::~APIUI
virtual ~APIUI()
Definition: zitarevdsp.h:1238
AccUpDownConverter
Definition: compressordsp.h:837
UI::UI
UI()
Definition: zitarevdsp.h:385
APIUI::getScreenColor
int getScreenColor()
Definition: zitarevdsp.h:1529
APIUI::addNumEntry
virtual void addNumEntry(const char *label, FAUSTFLOAT *zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT step)
Definition: zitarevdsp.h:1279
APIUI::addParameter
virtual void addParameter(const char *label, FAUSTFLOAT *zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT step, ItemType type)
Definition: zitarevdsp.h:1070
APIUI::fMetaData
std::vector< std::map< std::string, std::string > > fMetaData
Definition: compressordsp.h:1052
decorator_dsp::fDSP
dsp * fDSP
Definition: compressordsp.h:172
zitarevdsp::compute
virtual void compute(int count, FAUSTFLOAT **inputs, FAUSTFLOAT **outputs)
Definition: zitarevdsp.h:2124
LinearValueConverter2
Definition: compressordsp.h:695
LogValueConverter::ui2faust
virtual double ui2faust(double x)
Definition: zitarevdsp.h:736
APIUI::ItemType
ItemType
Definition: compressordsp.h:1034
ValueConverter::faust2ui
virtual double faust2ui(double x)=0
UIReal::addVerticalBargraph
virtual void addVerticalBargraph(const char *label, REAL *zone, REAL min, REAL max)=0
UIReal::openTabBox
virtual void openTabBox(const char *label)=0
APIUI::kExp
@ kExp
Definition: compressordsp.h:1038
ZoneReader::ZoneReader
ZoneReader(FAUSTFLOAT *zone, double lo, double hi)
Definition: zitarevdsp.h:1013
decorator_dsp::clone
virtual decorator_dsp * clone()
Definition: zitarevdsp.h:185
UIReal::declare
virtual void declare(REAL *zone, const char *key, const char *val)
Definition: zitarevdsp.h:380
AccDownConverter::AccDownConverter
AccDownConverter(double amin, double amid, double amax, double fmin, double fmid, double fmax)
Definition: zitarevdsp.h:808
APIUI::fConversion
std::vector< ValueConverter * > fConversion
Definition: compressordsp.h:1045
APIUI::fPaths
std::vector< std::string > fPaths
Definition: compressordsp.h:1041
AccDownUpConverter::faust2ui
virtual double faust2ui(double x)
Definition: zitarevdsp.h:884
UpdatableValueConverter::getMappingValues
virtual void getMappingValues(double &amin, double &amid, double &amax)=0
CurveZoneControl::~CurveZoneControl
virtual ~CurveZoneControl()
Definition: zitarevdsp.h:972
ZoneControl::getZone
FAUSTFLOAT * getZone()
Definition: zitarevdsp.h:919
UIReal::addHorizontalSlider
virtual void addHorizontalSlider(const char *label, REAL *zone, REAL init, REAL min, REAL max, REAL step)=0
Interpolator3pt::getMappingValues
void getMappingValues(double &amin, double &amid, double &amax)
Definition: zitarevdsp.h:618
zitarevdsp::buildUserInterface
virtual void buildUserInterface(UI *ui_interface)
Definition: zitarevdsp.h:2042
APIUI::fGreenReader
ZoneReader * fGreenReader
Definition: compressordsp.h:1060
dsp_factory::setMemoryManager
virtual void setMemoryManager(dsp_memory_manager *manager)=0
dsp::buildUserInterface
virtual void buildUserInterface(UI *ui_interface)=0
APIUI::addCheckButton
virtual void addCheckButton(const char *label, FAUSTFLOAT *zone)
Definition: zitarevdsp.h:1264
dsp_factory
Definition: compressordsp.h:200
dsp_factory::getCompileOptions
virtual std::string getCompileOptions()=0
LinearValueConverter::faust2ui
virtual double faust2ui(double x)
Definition: zitarevdsp.h:684
LogValueConverter::faust2ui
virtual double faust2ui(double x)
Definition: zitarevdsp.h:737
APIUI::fAcc
std::vector< ZoneControl * > fAcc[3]
Definition: compressordsp.h:1053
zitarevdsp::init
virtual void init(int sample_rate)
Definition: zitarevdsp.h:2024
UIReal::closeBox
virtual void closeBox()=0
zitarevdsp::metadata
void metadata(Meta *m)
Definition: zitarevdsp.h:1695
PathBuilder::fControlsLevel
std::vector< std::string > fControlsLevel
Definition: compressordsp.h:435
zitarevdsp::instanceResetUserInterface
virtual void instanceResetUserInterface()
Definition: zitarevdsp.h:1838
AccDownUpConverter::setMappingValues
virtual void setMappingValues(double amin, double amid, double amax, double fmin, double fmid, double fmax)
Definition: zitarevdsp.h:886
ExpValueConverter::ui2faust
virtual double ui2faust(double x)
Definition: zitarevdsp.h:753
dsp::instanceConstants
virtual void instanceConstants(int sample_rate)=0
APIUI::getGyrCount
int getGyrCount(int gyr)
Definition: zitarevdsp.h:1522
APIUI::setConverter
void setConverter(std::vector< ZoneControl * > *table, int p, int val, int curve, double amin, double amid, double amax)
Definition: zitarevdsp.h:1177
AccDownUpConverter::getMappingValues
virtual void getMappingValues(double &amin, double &amid, double &amax)
Definition: zitarevdsp.h:893
dsp::clone
virtual dsp * clone()=0
LinearValueConverter2::LinearValueConverter2
LinearValueConverter2()
Definition: zitarevdsp.h:705
dsp::getNumInputs
virtual int getNumInputs()=0
APIUI::fLabelMap
std::map< std::string, int > fLabelMap
Definition: compressordsp.h:1044
zitarevdsp::getInputRate
virtual int getInputRate(int channel)
Definition: zitarevdsp.h:1750
zitarevdsp::instanceInit
virtual void instanceInit(int sample_rate)
Definition: zitarevdsp.h:2028
LinearValueConverter2::ui2faust
virtual double ui2faust(double x)
Definition: zitarevdsp.h:708
AccUpConverter::faust2ui
virtual double faust2ui(double x)
Definition: zitarevdsp.h:778
APIUI::openVerticalBox
virtual void openVerticalBox(const char *label)
Definition: zitarevdsp.h:1254
CurveZoneControl::getMappingValues
void getMappingValues(double &amin, double &amid, double &amax)
Definition: zitarevdsp.h:987
AccDownConverter::getMappingValues
virtual void getMappingValues(double &amin, double &amid, double &amax)
Definition: zitarevdsp.h:823
APIUI::closeBox
virtual void closeBox()
Definition: zitarevdsp.h:1255
AccDownConverter::faust2ui
virtual double faust2ui(double x)
Definition: zitarevdsp.h:814
APIUI::fStep
std::vector< FAUSTFLOAT > fStep
Definition: compressordsp.h:1050
APIUI::kVSlider
@ kVSlider
Definition: compressordsp.h:1034
APIUI::kButton
@ kButton
Definition: compressordsp.h:1034
ConverterZoneControl::~ConverterZoneControl
virtual ~ConverterZoneControl()
Definition: zitarevdsp.h:941
APIUI::fBlueReader
ZoneReader * fBlueReader
Definition: compressordsp.h:1061
UIReal::addNumEntry
virtual void addNumEntry(const char *label, REAL *zone, REAL init, REAL min, REAL max, REAL step)=0
PathBuilder::popLabel
void popLabel()
Definition: zitarevdsp.h:458
UpdatableValueConverter::~UpdatableValueConverter
virtual ~UpdatableValueConverter()
Definition: zitarevdsp.h:652
dsp_factory::getSHAKey
virtual std::string getSHAKey()=0
decorator_dsp
Definition: compressordsp.h:168
CurveZoneControl::setActive
void setActive(bool on_off)
Definition: zitarevdsp.h:992
dsp_factory::getIncludePathnames
virtual std::vector< std::string > getIncludePathnames()=0
APIUI::getMetadata
std::map< const char *, const char * > getMetadata(int p)
Definition: zitarevdsp.h:1347
APIUI::getParamAddress
const char * getParamAddress(int p)
Definition: zitarevdsp.h:1345
ZoneControl::setActive
virtual void setActive(bool on_off)
Definition: zitarevdsp.h:921
ZoneReader
Definition: compressordsp.h:1007
ValueConverter::ui2faust
virtual double ui2faust(double x)=0
APIUI::fNumParameters
int fNumParameters
Definition: compressordsp.h:1040
APIUI::fCurrentTooltip
std::string fCurrentTooltip
Definition: compressordsp.h:1069
dsp_factory::getName
virtual std::string getName()=0
ZoneControl::getCurve
virtual int getCurve()
Definition: zitarevdsp.h:924
dsp_factory::getMemoryManager
virtual dsp_memory_manager * getMemoryManager()=0
Interpolator::getLowHigh
void getLowHigh(double &amin, double &amax)
Definition: zitarevdsp.h:590
zitarevdsp::classInit
static void classInit(int sample_rate)
Definition: zitarevdsp.h:1787
APIUI::kGyr
@ kGyr
Definition: compressordsp.h:1236
APIUI::getParamValue
FAUSTFLOAT getParamValue(int p)
Definition: zitarevdsp.h:1367
dsp_memory_manager::destroy
virtual void destroy(void *ptr)=0
APIUI::addSoundfile
virtual void addSoundfile(const char *label, const char *filename, Soundfile **sf_zone)
Definition: zitarevdsp.h:1298
Interpolator3pt::operator()
double operator()(double x)
Definition: zitarevdsp.h:616
ZoneControl::setMappingValues
virtual void setMappingValues(int curve, double amin, double amid, double amax, double min, double init, double max)
Definition: zitarevdsp.h:916
UIReal::addCheckButton
virtual void addCheckButton(const char *label, REAL *zone)=0
APIUI::setParamValue
void setParamValue(int p, FAUSTFLOAT v)
Definition: zitarevdsp.h:1368
APIUI::fZone
std::vector< FAUSTFLOAT * > fZone
Definition: compressordsp.h:1046
AccUpConverter::setMappingValues
virtual void setMappingValues(double amin, double amid, double amax, double fmin, double fmid, double fmax)
Definition: zitarevdsp.h:780
LogValueConverter::LogValueConverter
LogValueConverter(double umin, double umax, double fmin, double fmax)
Definition: zitarevdsp.h:732
LinearValueConverter2::faust2ui
virtual double faust2ui(double x)
Definition: zitarevdsp.h:709
dsp::instanceInit
virtual void instanceInit(int sample_rate)=0
APIUI::kLog
@ kLog
Definition: compressordsp.h:1038
ExpValueConverter::ExpValueConverter
ExpValueConverter(double umin, double umax, double fmin, double fmax)
Definition: zitarevdsp.h:749
zitarevdsp::getOutputRate
virtual int getOutputRate(int channel)
Definition: zitarevdsp.h:1768
APIUI::fCurrentScale
int fCurrentScale
Definition: compressordsp.h:1065
decorator_dsp::getNumInputs
virtual int getNumInputs()
Definition: zitarevdsp.h:176
APIUI
Definition: compressordsp.h:1031
UpdatableValueConverter::setMappingValues
virtual void setMappingValues(double amin, double amid, double amax, double min, double init, double max)=0
ExpValueConverter::faust2ui
virtual double faust2ui(double x)
Definition: zitarevdsp.h:754
APIUI::getParamZone
FAUSTFLOAT * getParamZone(int p)
Definition: zitarevdsp.h:1366
CurveZoneControl::update
void update(double v) const
Definition: zitarevdsp.h:979
AccDownConverter
Definition: compressordsp.h:802
decorator_dsp::getSampleRate
virtual int getSampleRate()
Definition: zitarevdsp.h:179
dsp_factory::~dsp_factory
virtual ~dsp_factory()
Definition: zitarevdsp.h:202
Meta::declare
virtual void declare(const char *key, const char *value)=0
ZoneControl::update
virtual void update(double v) const
Definition: zitarevdsp.h:914
AccUpDownConverter::faust2ui
virtual double faust2ui(double x)
Definition: zitarevdsp.h:849
CurveZoneControl
Definition: compressordsp.h:957
AccUpDownConverter::setMappingValues
virtual void setMappingValues(double amin, double amid, double amax, double fmin, double fmid, double fmax)
Definition: zitarevdsp.h:851
APIUI::getAccCount
int getAccCount(int acc)
Definition: zitarevdsp.h:1510
ExpValueConverter
Definition: compressordsp.h:748
APIUI::fPathMap
std::map< std::string, int > fPathMap
Definition: compressordsp.h:1043
PathBuilder::buildPath
std::string buildPath(const std::string &label)
Definition: zitarevdsp.h:439
dsp
Definition: compressordsp.h:74
ZoneControl::getMappingValues
virtual void getMappingValues(double &amin, double &amid, double &amax)
Definition: zitarevdsp.h:917
dsp_factory::createDSPInstance
virtual dsp * createDSPInstance()=0
dsp::dsp
dsp()
Definition: zitarevdsp.h:75
UIReal::openVerticalBox
virtual void openVerticalBox(const char *label)=0
APIUI::getParamMin
FAUSTFLOAT getParamMin(int p)
Definition: zitarevdsp.h:1361
FAUSTFLOAT
#define FAUSTFLOAT
Definition: zitarevdsp.h:48
ZoneControl
Definition: compressordsp.h:906
AccDownUpConverter::AccDownUpConverter
AccDownUpConverter(double amin, double amid, double amax, double fmin, double fmid, double fmax)
Definition: zitarevdsp.h:878
ConverterZoneControl::getConverter
ValueConverter * getConverter()
Definition: zitarevdsp.h:945
APIUI::getParamStep
FAUSTFLOAT getParamStep(int p)
Definition: zitarevdsp.h:1363
APIUI::getParamLabel
const char * getParamLabel(int p)
Definition: zitarevdsp.h:1346
APIUI::fItemType
std::vector< ItemType > fItemType
Definition: compressordsp.h:1051
UIReal::UIReal
UIReal()
Definition: zitarevdsp.h:351
APIUI::ratio2value
double ratio2value(int p, double r)
Definition: zitarevdsp.h:1374
AccDownUpConverter
Definition: compressordsp.h:872
APIUI::getConverter
void getConverter(std::vector< ZoneControl * > *table, int p, int &val, int &curve, double &amin, double &amid, double &amax)
Definition: zitarevdsp.h:1204
dsp::getNumOutputs
virtual int getNumOutputs()=0
Meta
Definition: compressordsp.h:303
dsp_memory_manager::~dsp_memory_manager
virtual ~dsp_memory_manager()
Definition: zitarevdsp.h:60
UpdatableValueConverter::fActive
bool fActive
Definition: compressordsp.h:649
ZoneControl::fZone
FAUSTFLOAT * fZone
Definition: compressordsp.h:910
ConverterZoneControl::fValueConverter
ValueConverter * fValueConverter
Definition: compressordsp.h:939
PathBuilder::PathBuilder
PathBuilder()
Definition: zitarevdsp.h:436
decorator_dsp::instanceConstants
virtual void instanceConstants(int sample_rate)
Definition: zitarevdsp.h:182
APIUI::setGyrConverter
void setGyrConverter(int p, int gyr, int curve, double amin, double amid, double amax)
Definition: zitarevdsp.h:1452
CurveZoneControl::setMappingValues
void setMappingValues(int curve, double amin, double amid, double amax, double min, double init, double max)
Definition: zitarevdsp.h:981
PathBuilder::~PathBuilder
virtual ~PathBuilder()
Definition: zitarevdsp.h:437
APIUI::getMetadata
const char * getMetadata(int p, const char *key)
Definition: zitarevdsp.h:1357
dsp_factory::getLibraryList
virtual std::vector< std::string > getLibraryList()=0
UI
Definition: compressordsp.h:387
LinearValueConverter
Definition: compressordsp.h:671
UIReal::addButton
virtual void addButton(const char *label, REAL *zone)=0
decorator_dsp::metadata
virtual void metadata(Meta *m)
Definition: zitarevdsp.h:186
APIUI::getParamMax
FAUSTFLOAT getParamMax(int p)
Definition: zitarevdsp.h:1362
UIReal::addVerticalSlider
virtual void addVerticalSlider(const char *label, REAL *zone, REAL init, REAL min, REAL max, REAL step)=0
AccUpConverter::ui2faust
virtual double ui2faust(double x)
Definition: zitarevdsp.h:777
ConverterZoneControl::ConverterZoneControl
ConverterZoneControl(FAUSTFLOAT *zone, ValueConverter *converter)
Definition: zitarevdsp.h:940
dsp::~dsp
virtual ~dsp()
Definition: zitarevdsp.h:76
APIUI::fMin
std::vector< FAUSTFLOAT > fMin
Definition: compressordsp.h:1048
zitarevdsp
Definition: zitarevdsp.h:1575
LinearValueConverter2::getMappingValues
virtual void getMappingValues(double &amin, double &amid, double &amax)
Definition: zitarevdsp.h:717
UpdatableValueConverter::UpdatableValueConverter
UpdatableValueConverter()
Definition: zitarevdsp.h:650
APIUI::getAccConverter
void getAccConverter(int p, int &acc, int &curve, double &amin, double &amid, double &amax)
Definition: zitarevdsp.h:1468
APIUI::addVerticalSlider
virtual void addVerticalSlider(const char *label, FAUSTFLOAT *zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT step)
Definition: zitarevdsp.h:1269
UIReal::addHorizontalBargraph
virtual void addHorizontalBargraph(const char *label, REAL *zone, REAL min, REAL max)=0
AccUpConverter::AccUpConverter
AccUpConverter(double amin, double amid, double amax, double fmin, double fmid, double fmax)
Definition: zitarevdsp.h:772
APIUI::value2ratio
double value2ratio(int p, double r)
Definition: zitarevdsp.h:1373
AccDownUpConverter::ui2faust
virtual double ui2faust(double x)
Definition: zitarevdsp.h:883
APIUI::fCurrentGyr
std::string fCurrentGyr
Definition: compressordsp.h:1067
dsp::instanceClear
virtual void instanceClear()=0
zitarevdsp::getNumOutputs
virtual int getNumOutputs()
Definition: zitarevdsp.h:1747
APIUI::fCurrentAcc
std::string fCurrentAcc
Definition: compressordsp.h:1066
APIUI::kNoType
@ kNoType
Definition: compressordsp.h:1236
UIReal::openHorizontalBox
virtual void openHorizontalBox(const char *label)=0
zitarevdsp::instanceConstants
virtual void instanceConstants(int sample_rate)
Definition: zitarevdsp.h:1790
APIUI::kCheckButton
@ kCheckButton
Definition: compressordsp.h:1034
Meta::~Meta
virtual ~Meta()
Definition: zitarevdsp.h:301
AccDownConverter::setMappingValues
virtual void setMappingValues(double amin, double amid, double amax, double fmin, double fmid, double fmax)
Definition: zitarevdsp.h:816
APIUI::addHorizontalSlider
virtual void addHorizontalSlider(const char *label, FAUSTFLOAT *zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT step)
Definition: zitarevdsp.h:1274
zitarevdsp::clone
virtual zitarevdsp * clone()
Definition: zitarevdsp.h:2034
AccDownConverter::ui2faust
virtual double ui2faust(double x)
Definition: zitarevdsp.h:813
LinearValueConverter::ui2faust
virtual double ui2faust(double x)
Definition: zitarevdsp.h:683
APIUI::setParamRatio
void setParamRatio(int p, double r)
Definition: zitarevdsp.h:1371
LinearValueConverter2::LinearValueConverter2
LinearValueConverter2(double amin, double amid, double amax, double min, double init, double max)
Definition: zitarevdsp.h:701
ZoneControl::~ZoneControl
virtual ~ZoneControl()
Definition: zitarevdsp.h:912
dsp::metadata
virtual void metadata(Meta *m)=0
APIUI::getParamRatio
double getParamRatio(int p)
Definition: zitarevdsp.h:1370
ConverterZoneControl
Definition: compressordsp.h:935
ValueConverter
Definition: compressordsp.h:632
decorator_dsp::getNumOutputs
virtual int getNumOutputs()
Definition: zitarevdsp.h:177
APIUI::fMax
std::vector< FAUSTFLOAT > fMax
Definition: compressordsp.h:1049
AccUpConverter::getMappingValues
virtual void getMappingValues(double &amin, double &amid, double &amax)
Definition: zitarevdsp.h:787
decorator_dsp::instanceInit
virtual void instanceInit(int sample_rate)
Definition: zitarevdsp.h:181
APIUI::declare
virtual void declare(FAUSTFLOAT *zone, const char *key, const char *val)
Definition: zitarevdsp.h:1302
ConverterZoneControl::update
virtual void update(double v) const
Definition: zitarevdsp.h:943
CurveZoneControl::getCurve
int getCurve()
Definition: zitarevdsp.h:1000
LogValueConverter
Definition: compressordsp.h:731
APIUI::openTabBox
virtual void openTabBox(const char *label)
Definition: zitarevdsp.h:1252
dsp::compute
virtual void compute(int count, FAUSTFLOAT **inputs, FAUSTFLOAT **outputs)=0
APIUI::addButton
virtual void addButton(const char *label, FAUSTFLOAT *zone)
Definition: zitarevdsp.h:1259
PathBuilder
Definition: compressordsp.h:431
PathBuilder::buildLabel
std::string buildLabel(std::string label)
Definition: zitarevdsp.h:451
zitarevdsp::getNumInputs
virtual int getNumInputs()
Definition: zitarevdsp.h:1744
APIUI::kVBargraph
@ kVBargraph
Definition: compressordsp.h:1034
dsp::init
virtual void init(int sample_rate)=0
APIUI::kLin
@ kLin
Definition: compressordsp.h:1038
APIUI::declare
virtual void declare(const char *key, const char *val)
Definition: zitarevdsp.h:1328
zitarevdsp::instanceClear
virtual void instanceClear()
Definition: zitarevdsp.h:1852
APIUI::kNumEntry
@ kNumEntry
Definition: compressordsp.h:1034
APIUI::fHasScreenControl
bool fHasScreenControl
Definition: compressordsp.h:1058
APIUI::fCurrentMetadata
std::map< std::string, std::string > fCurrentMetadata
Definition: compressordsp.h:1070
decorator_dsp::~decorator_dsp
virtual ~decorator_dsp()
Definition: zitarevdsp.h:174
ZoneReader::getValue
int getValue()
Definition: zitarevdsp.h:1017
UpdatableValueConverter::getActive
bool getActive()
Definition: zitarevdsp.h:659
dsp_memory_manager
Definition: compressordsp.h:61
Interpolator3pt::Interpolator3pt
Interpolator3pt(double lo, double mi, double hi, double v1, double vm, double v2)
Definition: zitarevdsp.h:612
UpdatableValueConverter::setActive
void setActive(bool on_off)
Definition: zitarevdsp.h:658
APIUI::APIUI
APIUI()
Definition: zitarevdsp.h:1235
dsp::getSampleRate
virtual int getSampleRate()=0
APIUI::getParamType
Type getParamType(int p)
Definition: zitarevdsp.h:1383
APIUI::addHorizontalBargraph
virtual void addHorizontalBargraph(const char *label, FAUSTFLOAT *zone, FAUSTFLOAT min, FAUSTFLOAT max)
Definition: zitarevdsp.h:1286
decorator_dsp::compute
virtual void compute(int count, FAUSTFLOAT **inputs, FAUSTFLOAT **outputs)
Definition: zitarevdsp.h:188
APIUI::fInit
std::vector< FAUSTFLOAT > fInit
Definition: compressordsp.h:1047
APIUI::getParamsCount
int getParamsCount()
Definition: zitarevdsp.h:1334
APIUI::getParamItemType
ItemType getParamItemType(int p)
Definition: zitarevdsp.h:1406
CurveZoneControl::CurveZoneControl
CurveZoneControl(FAUSTFLOAT *zone, int curve, double amin, double amid, double amax, double min, double init, double max)
Definition: zitarevdsp.h:963
APIUI::fCurrentUnit
std::string fCurrentUnit
Definition: compressordsp.h:1064
AccUpDownConverter::getMappingValues
virtual void getMappingValues(double &amin, double &amid, double &amax)
Definition: zitarevdsp.h:858
Interpolator::operator()
double operator()(double v)
Definition: compressordsp.h:587
UIReal
Definition: compressordsp.h:353
APIUI::propagateAcc
void propagateAcc(int acc, double value)
Definition: zitarevdsp.h:1418
APIUI::addVerticalBargraph
virtual void addVerticalBargraph(const char *label, FAUSTFLOAT *zone, FAUSTFLOAT min, FAUSTFLOAT max)
Definition: zitarevdsp.h:1291
APIUI::kHSlider
@ kHSlider
Definition: compressordsp.h:1034