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