From aff3bcc04ea72e5a91628e5123119df094df5da8 Mon Sep 17 00:00:00 2001 From: Carlo Capocasa Date: Thu, 20 Jul 2017 10:45:14 +0200 Subject: [PATCH 1/2] fix compile flags for JPverb_supernova and Greyhole_supernova --- source/CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index cd90ecb145..7c3b150d9d 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -222,12 +222,22 @@ BUILD_PLUGIN(JPverb set_property(TARGET JPverb APPEND PROPERTY COMPILE_DEFINITIONS SC_FAUST_PREFIX="\"\"") set_property(TARGET JPverb APPEND PROPERTY COMPILE_DEFINITIONS mydsp=JPVERB) set_property(TARGET JPverb APPEND PROPERTY COMPILE_DEFINITIONS NDEBUG) +if (SUPERNOVA) + set_property(TARGET JPverb_supernova APPEND PROPERTY COMPILE_DEFINITIONS SC_FAUST_PREFIX="\"\"") + set_property(TARGET JPverb_supernova APPEND PROPERTY COMPILE_DEFINITIONS mydsp=JPVERB) + set_property(TARGET JPverb_supernova APPEND PROPERTY COMPILE_DEFINITIONS NDEBUG) +endif() BUILD_PLUGIN(Greyhole "DEINDUGens/GreyholeRaw.cpp" "" "DEINDUGens") set_property(TARGET Greyhole APPEND PROPERTY COMPILE_DEFINITIONS SC_FAUST_PREFIX="\"\"") set_property(TARGET Greyhole APPEND PROPERTY COMPILE_DEFINITIONS mydsp=GREYHOLE) set_property(TARGET Greyhole APPEND PROPERTY COMPILE_DEFINITIONS NDEBUG) +if (SUPERNOVA) + set_property(TARGET Greyhole_supernova APPEND PROPERTY COMPILE_DEFINITIONS SC_FAUST_PREFIX="\"\"") + set_property(TARGET Greyhole_supernova APPEND PROPERTY COMPILE_DEFINITIONS mydsp=GREYHOLE) + set_property(TARGET Greyhole_supernova APPEND PROPERTY COMPILE_DEFINITIONS NDEBUG) +endif() # MembraneUGens BUILD_PLUGIN(MembraneUGens "MembraneUGens/Membrane_shape.c;MembraneUGens/Membrane.cpp" From 5393b40295e45856e35bc1d4ca5634f5064a68e8 Mon Sep 17 00:00:00 2001 From: LFSaw Date: Thu, 16 Nov 2017 12:29:03 +0100 Subject: [PATCH 2/2] bump faust version to 0.12.0, includes fixes made by @carlocapocasa in #149 --- source/DEINDUGens/GreyholeRaw.cpp | 1474 +++++++----- source/DEINDUGens/JPverbRaw.cpp | 1968 +++++++++++------ source/DEINDUGens/faust_src/GreyholeRaw.cpp | 1474 +++++++----- source/DEINDUGens/faust_src/JPverbRaw.cpp | 1968 +++++++++++------ source/DEINDUGens/faust_src/README.md | 7 +- source/DEINDUGens/include/faust/au/AUUI.h | 415 ++-- .../DEINDUGens/include/faust/audio/alsa-dsp.h | 106 +- .../include/faust/audio/android-dsp.h | 15 +- source/DEINDUGens/include/faust/audio/audio.h | 72 +- .../DEINDUGens/include/faust/audio/channels.h | 72 +- .../include/faust/audio/coreaudio-dsp.h | 64 +- .../include/faust/audio/coreaudio-ios-dsp.h | 260 +-- .../include/faust/audio/dummy-audio.h | 114 +- .../DEINDUGens/include/faust/audio/jack-dsp.h | 123 +- .../DEINDUGens/include/faust/audio/juce-dsp.h | 14 +- .../include/faust/audio/netjack-dsp.h | 143 +- .../include/faust/audio/ofaudio-dsp.h | 56 +- .../faust/audio/opensles-android-dsp.h | 52 +- .../DEINDUGens/include/faust/audio/osc-dsp.h | 172 +- .../include/faust/audio/portaudio-dsp.h | 27 +- .../include/faust/audio/rtaudio-dsp.h | 27 +- .../include/faust/audio/soundfile.h | 129 ++ .../include/faust/dsp/dsp-adapter.h | 61 +- .../DEINDUGens/include/faust/dsp/dsp-bench.h | 206 +- .../include/faust/dsp/dsp-combiner.h | 54 +- .../DEINDUGens/include/faust/dsp/dsp-tools.h | 42 +- source/DEINDUGens/include/faust/dsp/dsp.h | 99 +- .../include/faust/dsp/faust-engine.h | 38 +- .../include/faust/dsp/faust-poly-engine.h | 73 +- .../DEINDUGens/include/faust/dsp/poly-dsp.h | 118 +- .../DEINDUGens/include/faust/dsp/proxy-dsp.h | 244 +- .../include/faust/dsp/sound-player.h | 42 +- .../DEINDUGens/include/faust/dsp/timed-dsp.h | 73 +- source/DEINDUGens/include/faust/gui/APIUI.h | 188 +- .../DEINDUGens/include/faust/gui/ControlUI.h | 58 +- .../include/faust/gui/DecoratorUI.h | 110 + source/DEINDUGens/include/faust/gui/FUI.h | 161 +- source/DEINDUGens/include/faust/gui/GUI.h | 157 +- source/DEINDUGens/include/faust/gui/JSONUI.h | 275 ++- .../include/faust/gui/JSONUIDecoder.h | 281 +++ source/DEINDUGens/include/faust/gui/JuceGUI.h | 40 +- .../DEINDUGens/include/faust/gui/JuceOSCUI.h | 42 +- .../include/faust/gui/JuceParameterUI.h | 88 +- .../include/faust/gui/JuceStateUI.h | 79 +- source/DEINDUGens/include/faust/gui/MapUI.h | 47 +- .../DEINDUGens/include/faust/gui/MetaDataUI.h | 539 ++--- source/DEINDUGens/include/faust/gui/MidiUI.h | 154 +- source/DEINDUGens/include/faust/gui/OCVUI.h | 28 +- source/DEINDUGens/include/faust/gui/OSCUI.h | 46 +- .../include/faust/gui/PathBuilder.h | 43 +- source/DEINDUGens/include/faust/gui/PrintUI.h | 51 +- source/DEINDUGens/include/faust/gui/RosCI.h | 37 +- source/DEINDUGens/include/faust/gui/RosUI.h | 40 +- .../include/faust/gui/SimpleParser.h | 30 +- source/DEINDUGens/include/faust/gui/SoundUI.h | 68 + source/DEINDUGens/include/faust/gui/UI.h | 53 +- .../include/faust/gui/ValueConverter.h | 46 +- source/DEINDUGens/include/faust/gui/console.h | 62 +- .../DEINDUGens/include/faust/gui/faustgtk.h | 61 +- source/DEINDUGens/include/faust/gui/faustqt.h | 13 +- source/DEINDUGens/include/faust/gui/httpdUI.h | 88 +- source/DEINDUGens/include/faust/gui/meta.h | 40 +- source/DEINDUGens/include/faust/midi/RtMidi.h | 2 +- .../DEINDUGens/include/faust/midi/bela-midi.h | 42 +- .../DEINDUGens/include/faust/midi/jack-midi.h | 43 +- .../DEINDUGens/include/faust/midi/juce-midi.h | 44 +- source/DEINDUGens/include/faust/midi/midi.h | 42 +- .../DEINDUGens/include/faust/midi/rt-midi.h | 42 +- source/DEINDUGens/include/faust/misc.h | 38 +- .../DEINDUGens/include/faust/osc/RootNode.h | 20 +- source/DEINDUGens/include/faust/sound-file.h | 43 +- .../faust/unity/AudioPluginInterface.h | 23 + 72 files changed, 7843 insertions(+), 5223 deletions(-) create mode 100644 source/DEINDUGens/include/faust/audio/soundfile.h create mode 100644 source/DEINDUGens/include/faust/gui/DecoratorUI.h create mode 100644 source/DEINDUGens/include/faust/gui/JSONUIDecoder.h create mode 100644 source/DEINDUGens/include/faust/gui/SoundUI.h diff --git a/source/DEINDUGens/GreyholeRaw.cpp b/source/DEINDUGens/GreyholeRaw.cpp index aacd64ef89..9c5a956e53 100644 --- a/source/DEINDUGens/GreyholeRaw.cpp +++ b/source/DEINDUGens/GreyholeRaw.cpp @@ -1,21 +1,16 @@ //---------------------------------------------------------- +// name: "GreyholeRaw" // version: "1.0" // author: "Julian Parker, bug fixes by Till Bovermann" // license: "GPL2+" -// name: "GreyholeRaw" // copyright: "(c) Julian Parker 2013" // -// Code generated with Faust 0.9.98 (http://faust.grame.fr) +// Code generated with Faust 0.12.0 (http://faust.grame.fr) //---------------------------------------------------------- /* link with : "primes" */ #include #include -// If other than 'faust2sc --prefix Faust' is used, sed this as well: -#if !defined(SC_FAUST_PREFIX) -# define SC_FAUST_PREFIX "Faust" -#endif - //------------------------------------------------------------------- // FAUST architecture file for SuperCollider. // Copyright (C) 2005-2012 Stefan Kersten. @@ -36,6 +31,11 @@ // 02111-1307 USA //------------------------------------------------------------------- +// If other than 'faust2sc --prefix Faust' is used, sed this as well: +#if !defined(SC_FAUST_PREFIX) +#define SC_FAUST_PREFIX "Faust" +#endif + #include #include #include @@ -48,9 +48,15 @@ using namespace std; #if defined(__GNUC__) && __GNUC__ >= 4 -# define FAUST_EXPORT __attribute__((visibility("default"))) + #define FAUST_EXPORT __attribute__((visibility("default"))) #else -# define FAUST_EXPORT SC_API_EXPORT + #define FAUST_EXPORT SC_API_EXPORT +#endif + +#ifdef WIN32 + #define STRDUP _strdup +#else + #define STRDUP strdup #endif //---------------------------------------------------------------------------- @@ -221,124 +227,332 @@ class mydsp : public dsp { FAUSTFLOAT fslider0; float fVec0[2]; int iVec1[2]; - float fConst0; - float fConst1; + float fTempPerm0; FAUSTFLOAT fslider1; float fVec2[2]; - float fConst2; + float fTempPerm1; + float fTempPerm2; + float fTempPerm3; + float fTempPerm4; + float fTempPerm5; + float fTempPerm6; + float fTempPerm7; + float fTempPerm8; FAUSTFLOAT fslider2; float fVec3[2]; - float fRec39[2]; - float fRec40[2]; - int IOTA; - float fVec4[131072]; + float fTempPerm9; + float fConst0; + float fConst1; FAUSTFLOAT fslider3; - float fRec41[2]; - float fRec42[2]; - float fRec43[2]; - float fRec44[2]; + float fVec4[2]; + float fTempPerm10; + float fConst2; FAUSTFLOAT fslider4; float fVec5[2]; + float fTempPerm11; + float fTempPerm12; + float fTempPerm13; + float fRec27[2]; + int iTempPerm14; + float fRec28[2]; + float fTempPerm15; + float fTempPerm16; + int iTempPerm17; + float fTempPerm18; + float fTempPerm19; + float fTempPerm20; + float fTempPerm21; + float fTempPerm22; + float fTempPerm23; + float fTempPerm24; + int IOTA; float fVec6[131072]; - float fVec7[16384]; FAUSTFLOAT fslider5; + float fTempPerm25; + float fRec29[2]; + float fRec30[2]; + float fRec31[2]; + float fRec32[2]; + int iTempPerm26; + int iTempPerm27; + float fTempPerm28; + float fTempPerm29; + float fTempPerm30; + float fTempPerm31; + float fTempPerm32; + float fTempPerm33; + float fVec7[16384]; + FAUSTFLOAT fslider6; float fRec45[2]; - float fRec38[2]; - float fRec36[2]; - float fVec8[16384]; + float fTempPerm34; + int iTempPerm35; + float fTempPerm36; + float fTempPerm37; + float fTempPerm38; + float fRec44[2]; + float fRec42[2]; + float fTempPerm39; + float fTempPerm40; + float fTempPerm41; + float fTempPerm42; + float fTempPerm43; + float fTempPerm44; + float fTempPerm45; + int iTempPerm46; + float fTempPerm47; + float fTempPerm48; + float fVec8[131072]; + float fTempPerm49; + float fTempPerm50; + float fTempPerm51; + float fTempPerm52; + float fTempPerm53; + float fVec9[16384]; float fRec47[2]; + float fTempPerm54; + int iTempPerm55; + float fTempPerm56; + float fTempPerm57; + float fTempPerm58; float fRec46[2]; - float fRec37[2]; - float fVec9[16384]; - float fRec48[2]; - float fRec35[2]; - float fRec33[2]; + float fRec43[2]; + float fTempPerm59; float fVec10[16384]; + float fRec48[2]; + float fTempPerm60; + int iTempPerm61; + float fTempPerm62; + float fTempPerm63; + float fTempPerm64; + float fRec41[2]; + float fRec39[2]; + float fTempPerm65; + float fVec11[16384]; float fRec50[2]; + float fTempPerm66; + int iTempPerm67; + float fTempPerm68; + float fTempPerm69; + float fTempPerm70; float fRec49[2]; - float fRec34[2]; - float fVec11[16384]; - float fRec51[2]; - float fRec32[2]; - float fRec30[2]; + float fRec40[2]; + float fTempPerm71; float fVec12[16384]; + float fRec51[2]; + float fTempPerm72; + int iTempPerm73; + float fTempPerm74; + float fTempPerm75; + float fTempPerm76; + float fRec38[2]; + float fRec36[2]; + float fTempPerm77; + float fVec13[16384]; float fRec53[2]; + float fTempPerm78; + int iTempPerm79; + float fTempPerm80; + float fTempPerm81; + float fTempPerm82; float fRec52[2]; - float fRec31[2]; - float fVec13[16384]; - float fRec54[2]; - float fRec29[2]; - float fRec27[2]; + float fRec37[2]; + float fTempPerm83; float fVec14[16384]; + float fRec54[2]; + float fTempPerm84; + int iTempPerm85; + float fTempPerm86; + float fTempPerm87; + float fTempPerm88; + float fRec35[2]; + float fRec33[2]; + float fTempPerm89; + float fVec15[16384]; float fRec56[2]; + float fTempPerm90; + int iTempPerm91; + float fTempPerm92; + float fTempPerm93; + float fTempPerm94; float fRec55[2]; - float fRec28[2]; - float fVec15[16384]; + float fRec34[2]; + float fTempPerm95; + float fTempPerm96; + float fTempPerm97; + float fTempPerm98; + float fTempPerm99; + float fVec16[16384]; float fRec57[2]; + float fTempPerm100; + int iTempPerm101; + float fTempPerm102; + float fTempPerm103; + float fTempPerm104; float fRec26[2]; float fRec24[2]; - float fVec16[16384]; + float fTempPerm105; + float fTempPerm106; + float fTempPerm107; + float fTempPerm108; + float fTempPerm109; + float fVec17[16384]; float fRec59[2]; + float fTempPerm110; + int iTempPerm111; + float fTempPerm112; + float fTempPerm113; + float fTempPerm114; float fRec58[2]; float fRec25[2]; - float fVec17[16384]; + float fTempPerm115; + float fVec18[16384]; float fRec60[2]; + float fTempPerm116; + int iTempPerm117; + float fTempPerm118; + float fTempPerm119; + float fTempPerm120; float fRec23[2]; float fRec21[2]; - float fVec18[16384]; + float fTempPerm121; + float fVec19[16384]; float fRec62[2]; + float fTempPerm122; + int iTempPerm123; + float fTempPerm124; + float fTempPerm125; + float fTempPerm126; float fRec61[2]; float fRec22[2]; - float fVec19[16384]; + float fTempPerm127; + float fVec20[16384]; float fRec63[2]; + float fTempPerm128; + int iTempPerm129; + float fTempPerm130; + float fTempPerm131; + float fTempPerm132; float fRec20[2]; float fRec18[2]; - float fVec20[16384]; + float fTempPerm133; + float fVec21[16384]; float fRec65[2]; + float fTempPerm134; + int iTempPerm135; + float fTempPerm136; + float fTempPerm137; + float fTempPerm138; float fRec64[2]; float fRec19[2]; - float fVec21[16384]; + float fTempPerm139; + float fVec22[16384]; float fRec66[2]; + float fTempPerm140; + int iTempPerm141; + float fTempPerm142; + float fTempPerm143; + float fTempPerm144; float fRec17[2]; float fRec15[2]; - float fVec22[16384]; + float fTempPerm145; + float fVec23[16384]; float fRec68[2]; + float fTempPerm146; + int iTempPerm147; + float fTempPerm148; + float fTempPerm149; + float fTempPerm150; float fRec67[2]; float fRec16[2]; - float fVec23[16384]; + float fTempPerm151; + float fTempPerm152; + float fTempPerm153; + float fTempPerm154; + float fTempPerm155; + float fVec24[16384]; float fRec69[2]; + float fTempPerm156; + int iTempPerm157; + float fTempPerm158; + float fTempPerm159; + float fTempPerm160; float fRec14[2]; float fRec12[2]; - float fVec24[16384]; + float fTempPerm161; + float fTempPerm162; + float fTempPerm163; + float fTempPerm164; + float fTempPerm165; + float fVec25[16384]; float fRec71[2]; + float fTempPerm166; + int iTempPerm167; + float fTempPerm168; + float fTempPerm169; + float fTempPerm170; float fRec70[2]; float fRec13[2]; - float fVec25[16384]; + float fTempPerm171; + float fVec26[16384]; float fRec72[2]; + float fTempPerm172; + int iTempPerm173; + float fTempPerm174; + float fTempPerm175; + float fTempPerm176; float fRec11[2]; float fRec9[2]; - float fVec26[16384]; + float fTempPerm177; + float fVec27[16384]; float fRec74[2]; + float fTempPerm178; + int iTempPerm179; + float fTempPerm180; + float fTempPerm181; + float fTempPerm182; float fRec73[2]; float fRec10[2]; - float fVec27[16384]; + float fTempPerm183; + float fVec28[16384]; float fRec75[2]; + float fTempPerm184; + int iTempPerm185; + float fTempPerm186; + float fTempPerm187; + float fTempPerm188; float fRec8[2]; float fRec6[2]; - float fVec28[16384]; + float fTempPerm189; + float fVec29[16384]; float fRec77[2]; + float fTempPerm190; + int iTempPerm191; + float fTempPerm192; + float fTempPerm193; + float fTempPerm194; float fRec76[2]; float fRec7[2]; - float fVec29[16384]; + float fTempPerm195; + float fVec30[16384]; float fRec78[2]; + float fTempPerm196; + int iTempPerm197; + float fTempPerm198; + float fTempPerm199; + float fTempPerm200; float fRec5[2]; float fRec3[2]; - float fVec30[16384]; + float fTempPerm201; + float fVec31[16384]; float fRec80[2]; + float fTempPerm202; + int iTempPerm203; + float fTempPerm204; + float fTempPerm205; + float fTempPerm206; float fRec79[2]; float fRec4[2]; - FAUSTFLOAT fslider6; - float fVec31[2]; + float fTempPerm207; float fRec2[2]; float fRec0[1024]; float fRec81[2]; @@ -347,24 +561,24 @@ class mydsp : public dsp { public: virtual void metadata(Meta* m) { + m->declare("name", "GreyholeRaw"); m->declare("version", "1.0"); m->declare("author", "Julian Parker, bug fixes by Till Bovermann"); m->declare("license", "GPL2+"); - m->declare("name", "GreyholeRaw"); + m->declare("copyright", "(c) Julian Parker 2013"); + m->declare("signals.lib/name", "Faust Signal Routing Library"); + m->declare("signals.lib/version", "0.0"); m->declare("maths.lib/name", "Faust Math Library"); - m->declare("maths.lib/version", "2.0"); + m->declare("maths.lib/version", "2.1"); m->declare("maths.lib/author", "GRAME"); m->declare("maths.lib/copyright", "GRAME"); m->declare("maths.lib/license", "LGPL with exception"); m->declare("delays.lib/name", "Faust Delay Library"); m->declare("delays.lib/version", "0.0"); - m->declare("filters.lib/name", "Faust Filters Library"); - m->declare("filters.lib/version", "0.0"); - m->declare("copyright", "(c) Julian Parker 2013"); - m->declare("signals.lib/name", "Faust Signal Routing Library"); - m->declare("signals.lib/version", "0.0"); m->declare("oscillators.lib/name", "Faust Oscillator Library"); m->declare("oscillators.lib/version", "0.0"); + m->declare("filters.lib/name", "Faust Filters Library"); + m->declare("filters.lib/version", "0.0"); m->declare("basics.lib/name", "Faust Basic Element Library"); m->declare("basics.lib/version", "0.0"); } @@ -375,131 +589,339 @@ class mydsp : public dsp { } virtual void instanceConstants(int samplingFreq) { fSamplingFreq = samplingFreq; - fConst0 = min(1.92e+05f, max(1e+03f, (float)fSamplingFreq)); + fTempPerm0 = 0; + fTempPerm1 = 0; + fTempPerm2 = 0; + fTempPerm3 = 0; + fTempPerm4 = 0; + fTempPerm5 = 0; + fTempPerm6 = 0; + fTempPerm7 = 0; + fTempPerm8 = 0; + fTempPerm9 = 0; + fConst0 = min(1.92e+05f, max(1.0f, (float)fSamplingFreq)); fConst1 = (0.00056689343f * fConst0); + fTempPerm10 = 0; fConst2 = (3.1415927f / fConst0); + fTempPerm11 = 0; + fTempPerm12 = 0; + fTempPerm13 = 0; + iTempPerm14 = 0; + fTempPerm15 = 0; + fTempPerm16 = 0; + iTempPerm17 = 0; + fTempPerm18 = 0; + fTempPerm19 = 0; + fTempPerm20 = 0; + fTempPerm21 = 0; + fTempPerm22 = 0; + fTempPerm23 = 0; + fTempPerm24 = 0; + fTempPerm25 = 0; + iTempPerm26 = 0; + iTempPerm27 = 0; + fTempPerm28 = 0; + fTempPerm29 = 0; + fTempPerm30 = 0; + fTempPerm31 = 0; + fTempPerm32 = 0; + fTempPerm33 = 0; + fTempPerm34 = 0; + iTempPerm35 = 0; + fTempPerm36 = 0; + fTempPerm37 = 0; + fTempPerm38 = 0; + fTempPerm39 = 0; + fTempPerm40 = 0; + fTempPerm41 = 0; + fTempPerm42 = 0; + fTempPerm43 = 0; + fTempPerm44 = 0; + fTempPerm45 = 0; + iTempPerm46 = 0; + fTempPerm47 = 0; + fTempPerm48 = 0; + fTempPerm49 = 0; + fTempPerm50 = 0; + fTempPerm51 = 0; + fTempPerm52 = 0; + fTempPerm53 = 0; + fTempPerm54 = 0; + iTempPerm55 = 0; + fTempPerm56 = 0; + fTempPerm57 = 0; + fTempPerm58 = 0; + fTempPerm59 = 0; + fTempPerm60 = 0; + iTempPerm61 = 0; + fTempPerm62 = 0; + fTempPerm63 = 0; + fTempPerm64 = 0; + fTempPerm65 = 0; + fTempPerm66 = 0; + iTempPerm67 = 0; + fTempPerm68 = 0; + fTempPerm69 = 0; + fTempPerm70 = 0; + fTempPerm71 = 0; + fTempPerm72 = 0; + iTempPerm73 = 0; + fTempPerm74 = 0; + fTempPerm75 = 0; + fTempPerm76 = 0; + fTempPerm77 = 0; + fTempPerm78 = 0; + iTempPerm79 = 0; + fTempPerm80 = 0; + fTempPerm81 = 0; + fTempPerm82 = 0; + fTempPerm83 = 0; + fTempPerm84 = 0; + iTempPerm85 = 0; + fTempPerm86 = 0; + fTempPerm87 = 0; + fTempPerm88 = 0; + fTempPerm89 = 0; + fTempPerm90 = 0; + iTempPerm91 = 0; + fTempPerm92 = 0; + fTempPerm93 = 0; + fTempPerm94 = 0; + fTempPerm95 = 0; + fTempPerm96 = 0; + fTempPerm97 = 0; + fTempPerm98 = 0; + fTempPerm99 = 0; + fTempPerm100 = 0; + iTempPerm101 = 0; + fTempPerm102 = 0; + fTempPerm103 = 0; + fTempPerm104 = 0; + fTempPerm105 = 0; + fTempPerm106 = 0; + fTempPerm107 = 0; + fTempPerm108 = 0; + fTempPerm109 = 0; + fTempPerm110 = 0; + iTempPerm111 = 0; + fTempPerm112 = 0; + fTempPerm113 = 0; + fTempPerm114 = 0; + fTempPerm115 = 0; + fTempPerm116 = 0; + iTempPerm117 = 0; + fTempPerm118 = 0; + fTempPerm119 = 0; + fTempPerm120 = 0; + fTempPerm121 = 0; + fTempPerm122 = 0; + iTempPerm123 = 0; + fTempPerm124 = 0; + fTempPerm125 = 0; + fTempPerm126 = 0; + fTempPerm127 = 0; + fTempPerm128 = 0; + iTempPerm129 = 0; + fTempPerm130 = 0; + fTempPerm131 = 0; + fTempPerm132 = 0; + fTempPerm133 = 0; + fTempPerm134 = 0; + iTempPerm135 = 0; + fTempPerm136 = 0; + fTempPerm137 = 0; + fTempPerm138 = 0; + fTempPerm139 = 0; + fTempPerm140 = 0; + iTempPerm141 = 0; + fTempPerm142 = 0; + fTempPerm143 = 0; + fTempPerm144 = 0; + fTempPerm145 = 0; + fTempPerm146 = 0; + iTempPerm147 = 0; + fTempPerm148 = 0; + fTempPerm149 = 0; + fTempPerm150 = 0; + fTempPerm151 = 0; + fTempPerm152 = 0; + fTempPerm153 = 0; + fTempPerm154 = 0; + fTempPerm155 = 0; + fTempPerm156 = 0; + iTempPerm157 = 0; + fTempPerm158 = 0; + fTempPerm159 = 0; + fTempPerm160 = 0; + fTempPerm161 = 0; + fTempPerm162 = 0; + fTempPerm163 = 0; + fTempPerm164 = 0; + fTempPerm165 = 0; + fTempPerm166 = 0; + iTempPerm167 = 0; + fTempPerm168 = 0; + fTempPerm169 = 0; + fTempPerm170 = 0; + fTempPerm171 = 0; + fTempPerm172 = 0; + iTempPerm173 = 0; + fTempPerm174 = 0; + fTempPerm175 = 0; + fTempPerm176 = 0; + fTempPerm177 = 0; + fTempPerm178 = 0; + iTempPerm179 = 0; + fTempPerm180 = 0; + fTempPerm181 = 0; + fTempPerm182 = 0; + fTempPerm183 = 0; + fTempPerm184 = 0; + iTempPerm185 = 0; + fTempPerm186 = 0; + fTempPerm187 = 0; + fTempPerm188 = 0; + fTempPerm189 = 0; + fTempPerm190 = 0; + iTempPerm191 = 0; + fTempPerm192 = 0; + fTempPerm193 = 0; + fTempPerm194 = 0; + fTempPerm195 = 0; + fTempPerm196 = 0; + iTempPerm197 = 0; + fTempPerm198 = 0; + fTempPerm199 = 0; + fTempPerm200 = 0; + fTempPerm201 = 0; + fTempPerm202 = 0; + iTempPerm203 = 0; + fTempPerm204 = 0; + fTempPerm205 = 0; + fTempPerm206 = 0; + fTempPerm207 = 0; } virtual void instanceResetUserInterface() { - fslider0 = 0.5f; - fslider1 = 0.1f; - fslider2 = 2.0f; - fslider3 = 0.2f; - fslider4 = 0.9f; - fslider5 = 1.0f; - fslider6 = 0.0f; + fslider0 = 0.0f; + fslider1 = 0.5f; + fslider2 = 0.9f; + fslider3 = 0.1f; + fslider4 = 2.0f; + fslider5 = 0.2f; + fslider6 = 1.0f; } virtual void instanceClear() { for (int i=0; i<2; i++) fVec0[i] = 0; for (int i=0; i<2; i++) iVec1[i] = 0; for (int i=0; i<2; i++) fVec2[i] = 0; for (int i=0; i<2; i++) fVec3[i] = 0; - for (int i=0; i<2; i++) fRec39[i] = 0; - for (int i=0; i<2; i++) fRec40[i] = 0; - IOTA = 0; - for (int i=0; i<131072; i++) fVec4[i] = 0; - for (int i=0; i<2; i++) fRec41[i] = 0; - for (int i=0; i<2; i++) fRec42[i] = 0; - for (int i=0; i<2; i++) fRec43[i] = 0; - for (int i=0; i<2; i++) fRec44[i] = 0; + for (int i=0; i<2; i++) fVec4[i] = 0; for (int i=0; i<2; i++) fVec5[i] = 0; + for (int i=0; i<2; i++) fRec27[i] = 0; + for (int i=0; i<2; i++) fRec28[i] = 0; + IOTA = 0; for (int i=0; i<131072; i++) fVec6[i] = 0; + for (int i=0; i<2; i++) fRec29[i] = 0; + for (int i=0; i<2; i++) fRec30[i] = 0; + for (int i=0; i<2; i++) fRec31[i] = 0; + for (int i=0; i<2; i++) fRec32[i] = 0; for (int i=0; i<16384; i++) fVec7[i] = 0; for (int i=0; i<2; i++) fRec45[i] = 0; - for (int i=0; i<2; i++) fRec38[i] = 0; - for (int i=0; i<2; i++) fRec36[i] = 0; - for (int i=0; i<16384; i++) fVec8[i] = 0; + for (int i=0; i<2; i++) fRec44[i] = 0; + for (int i=0; i<2; i++) fRec42[i] = 0; + for (int i=0; i<131072; i++) fVec8[i] = 0; + for (int i=0; i<16384; i++) fVec9[i] = 0; for (int i=0; i<2; i++) fRec47[i] = 0; for (int i=0; i<2; i++) fRec46[i] = 0; - for (int i=0; i<2; i++) fRec37[i] = 0; - for (int i=0; i<16384; i++) fVec9[i] = 0; - for (int i=0; i<2; i++) fRec48[i] = 0; - for (int i=0; i<2; i++) fRec35[i] = 0; - for (int i=0; i<2; i++) fRec33[i] = 0; + for (int i=0; i<2; i++) fRec43[i] = 0; for (int i=0; i<16384; i++) fVec10[i] = 0; + for (int i=0; i<2; i++) fRec48[i] = 0; + for (int i=0; i<2; i++) fRec41[i] = 0; + for (int i=0; i<2; i++) fRec39[i] = 0; + for (int i=0; i<16384; i++) fVec11[i] = 0; for (int i=0; i<2; i++) fRec50[i] = 0; for (int i=0; i<2; i++) fRec49[i] = 0; - for (int i=0; i<2; i++) fRec34[i] = 0; - for (int i=0; i<16384; i++) fVec11[i] = 0; - for (int i=0; i<2; i++) fRec51[i] = 0; - for (int i=0; i<2; i++) fRec32[i] = 0; - for (int i=0; i<2; i++) fRec30[i] = 0; + for (int i=0; i<2; i++) fRec40[i] = 0; for (int i=0; i<16384; i++) fVec12[i] = 0; + for (int i=0; i<2; i++) fRec51[i] = 0; + for (int i=0; i<2; i++) fRec38[i] = 0; + for (int i=0; i<2; i++) fRec36[i] = 0; + for (int i=0; i<16384; i++) fVec13[i] = 0; for (int i=0; i<2; i++) fRec53[i] = 0; for (int i=0; i<2; i++) fRec52[i] = 0; - for (int i=0; i<2; i++) fRec31[i] = 0; - for (int i=0; i<16384; i++) fVec13[i] = 0; - for (int i=0; i<2; i++) fRec54[i] = 0; - for (int i=0; i<2; i++) fRec29[i] = 0; - for (int i=0; i<2; i++) fRec27[i] = 0; + for (int i=0; i<2; i++) fRec37[i] = 0; for (int i=0; i<16384; i++) fVec14[i] = 0; + for (int i=0; i<2; i++) fRec54[i] = 0; + for (int i=0; i<2; i++) fRec35[i] = 0; + for (int i=0; i<2; i++) fRec33[i] = 0; + for (int i=0; i<16384; i++) fVec15[i] = 0; for (int i=0; i<2; i++) fRec56[i] = 0; for (int i=0; i<2; i++) fRec55[i] = 0; - for (int i=0; i<2; i++) fRec28[i] = 0; - for (int i=0; i<16384; i++) fVec15[i] = 0; + for (int i=0; i<2; i++) fRec34[i] = 0; + for (int i=0; i<16384; i++) fVec16[i] = 0; for (int i=0; i<2; i++) fRec57[i] = 0; for (int i=0; i<2; i++) fRec26[i] = 0; for (int i=0; i<2; i++) fRec24[i] = 0; - for (int i=0; i<16384; i++) fVec16[i] = 0; + for (int i=0; i<16384; i++) fVec17[i] = 0; for (int i=0; i<2; i++) fRec59[i] = 0; for (int i=0; i<2; i++) fRec58[i] = 0; for (int i=0; i<2; i++) fRec25[i] = 0; - for (int i=0; i<16384; i++) fVec17[i] = 0; + for (int i=0; i<16384; i++) fVec18[i] = 0; for (int i=0; i<2; i++) fRec60[i] = 0; for (int i=0; i<2; i++) fRec23[i] = 0; for (int i=0; i<2; i++) fRec21[i] = 0; - for (int i=0; i<16384; i++) fVec18[i] = 0; + for (int i=0; i<16384; i++) fVec19[i] = 0; for (int i=0; i<2; i++) fRec62[i] = 0; for (int i=0; i<2; i++) fRec61[i] = 0; for (int i=0; i<2; i++) fRec22[i] = 0; - for (int i=0; i<16384; i++) fVec19[i] = 0; + for (int i=0; i<16384; i++) fVec20[i] = 0; for (int i=0; i<2; i++) fRec63[i] = 0; for (int i=0; i<2; i++) fRec20[i] = 0; for (int i=0; i<2; i++) fRec18[i] = 0; - for (int i=0; i<16384; i++) fVec20[i] = 0; + for (int i=0; i<16384; i++) fVec21[i] = 0; for (int i=0; i<2; i++) fRec65[i] = 0; for (int i=0; i<2; i++) fRec64[i] = 0; for (int i=0; i<2; i++) fRec19[i] = 0; - for (int i=0; i<16384; i++) fVec21[i] = 0; + for (int i=0; i<16384; i++) fVec22[i] = 0; for (int i=0; i<2; i++) fRec66[i] = 0; for (int i=0; i<2; i++) fRec17[i] = 0; for (int i=0; i<2; i++) fRec15[i] = 0; - for (int i=0; i<16384; i++) fVec22[i] = 0; + for (int i=0; i<16384; i++) fVec23[i] = 0; for (int i=0; i<2; i++) fRec68[i] = 0; for (int i=0; i<2; i++) fRec67[i] = 0; for (int i=0; i<2; i++) fRec16[i] = 0; - for (int i=0; i<16384; i++) fVec23[i] = 0; + for (int i=0; i<16384; i++) fVec24[i] = 0; for (int i=0; i<2; i++) fRec69[i] = 0; for (int i=0; i<2; i++) fRec14[i] = 0; for (int i=0; i<2; i++) fRec12[i] = 0; - for (int i=0; i<16384; i++) fVec24[i] = 0; + for (int i=0; i<16384; i++) fVec25[i] = 0; for (int i=0; i<2; i++) fRec71[i] = 0; for (int i=0; i<2; i++) fRec70[i] = 0; for (int i=0; i<2; i++) fRec13[i] = 0; - for (int i=0; i<16384; i++) fVec25[i] = 0; + for (int i=0; i<16384; i++) fVec26[i] = 0; for (int i=0; i<2; i++) fRec72[i] = 0; for (int i=0; i<2; i++) fRec11[i] = 0; for (int i=0; i<2; i++) fRec9[i] = 0; - for (int i=0; i<16384; i++) fVec26[i] = 0; + for (int i=0; i<16384; i++) fVec27[i] = 0; for (int i=0; i<2; i++) fRec74[i] = 0; for (int i=0; i<2; i++) fRec73[i] = 0; for (int i=0; i<2; i++) fRec10[i] = 0; - for (int i=0; i<16384; i++) fVec27[i] = 0; + for (int i=0; i<16384; i++) fVec28[i] = 0; for (int i=0; i<2; i++) fRec75[i] = 0; for (int i=0; i<2; i++) fRec8[i] = 0; for (int i=0; i<2; i++) fRec6[i] = 0; - for (int i=0; i<16384; i++) fVec28[i] = 0; + for (int i=0; i<16384; i++) fVec29[i] = 0; for (int i=0; i<2; i++) fRec77[i] = 0; for (int i=0; i<2; i++) fRec76[i] = 0; for (int i=0; i<2; i++) fRec7[i] = 0; - for (int i=0; i<16384; i++) fVec29[i] = 0; + for (int i=0; i<16384; i++) fVec30[i] = 0; for (int i=0; i<2; i++) fRec78[i] = 0; for (int i=0; i<2; i++) fRec5[i] = 0; for (int i=0; i<2; i++) fRec3[i] = 0; - for (int i=0; i<16384; i++) fVec30[i] = 0; + for (int i=0; i<16384; i++) fVec31[i] = 0; for (int i=0; i<2; i++) fRec80[i] = 0; for (int i=0; i<2; i++) fRec79[i] = 0; for (int i=0; i<2; i++) fRec4[i] = 0; - for (int i=0; i<2; i++) fVec31[i] = 0; for (int i=0; i<2; i++) fRec2[i] = 0; for (int i=0; i<1024; i++) fRec0[i] = 0; for (int i=0; i<2; i++) fRec81[i] = 0; @@ -521,441 +943,420 @@ class mydsp : public dsp { return fSamplingFreq; } virtual void buildUserInterface(UI* ui_interface) { - ui_interface->openVerticalBox("0x00"); - ui_interface->addHorizontalSlider("damping", &fslider6, 0.0f, 0.0f, 0.99f, 0.001f); - ui_interface->addHorizontalSlider("delayTime", &fslider3, 0.2f, 0.001f, 1.45f, 0.0001f); - ui_interface->addHorizontalSlider("diffusion", &fslider0, 0.5f, 0.0f, 0.99f, 0.0001f); - ui_interface->addHorizontalSlider("feedback", &fslider4, 0.9f, 0.0f, 1.0f, 0.01f); - ui_interface->addHorizontalSlider("modDepth", &fslider1, 0.1f, 0.0f, 1.0f, 0.001f); - ui_interface->addHorizontalSlider("modFreq", &fslider2, 2.0f, 0.0f, 1e+01f, 0.01f); - ui_interface->addHorizontalSlider("size", &fslider5, 1.0f, 0.5f, 3.0f, 0.0001f); + ui_interface->openVerticalBox("GreyholeRaw"); + ui_interface->addHorizontalSlider("damping", &fslider0, 0.0f, 0.0f, 0.99f, 0.001f); + ui_interface->addHorizontalSlider("delayTime", &fslider5, 0.2f, 0.001f, 1.45f, 0.0001f); + ui_interface->addHorizontalSlider("diffusion", &fslider1, 0.5f, 0.0f, 0.99f, 0.0001f); + ui_interface->addHorizontalSlider("feedback", &fslider2, 0.9f, 0.0f, 1.0f, 0.01f); + ui_interface->addHorizontalSlider("modDepth", &fslider3, 0.1f, 0.0f, 1.0f, 0.001f); + ui_interface->addHorizontalSlider("modFreq", &fslider4, 2.0f, 0.0f, 1e+01f, 0.01f); + ui_interface->addHorizontalSlider("size", &fslider6, 1.0f, 0.5f, 3.0f, 0.0001f); ui_interface->closeBox(); } virtual void compute (int count, FAUSTFLOAT** input, FAUSTFLOAT** output) { + //zone1 + //zone2 float fSlow0 = float(fslider0); float fSlow1 = float(fslider1); float fSlow2 = float(fslider2); - float fSlow3 = floorf(min((float)65533, (fConst0 * float(fslider3)))); + float fSlow3 = float(fslider3); float fSlow4 = float(fslider4); - float fSlow5 = float(fslider5); - float fSlow6 = (49 * fSlow5); - int iSlow7 = primes(fSlow6); - float fSlow8 = (0.0001f * iSlow7); - int iSlow9 = primes((fSlow6 + 10)); - float fSlow10 = (0.0001f * iSlow9); - float fSlow11 = (36 * fSlow5); - int iSlow12 = primes(fSlow11); - float fSlow13 = (0.001f * iSlow12); - int iSlow14 = primes((fSlow11 + 10)); - float fSlow15 = (0.001f * iSlow14); - float fSlow16 = (23 * fSlow5); - int iSlow17 = primes(fSlow16); - float fSlow18 = (0.001f * iSlow17); - int iSlow19 = primes((fSlow16 + 10)); - float fSlow20 = (0.001f * iSlow19); - int iSlow21 = primes((10 * fSlow5)); - float fSlow22 = (0.001f * iSlow21); - int iSlow23 = primes((10 * (fSlow5 + 1))); - float fSlow24 = (0.001f * iSlow23); - float fSlow25 = (68 * fSlow5); - int iSlow26 = primes(fSlow25); - float fSlow27 = (0.0001f * iSlow26); - int iSlow28 = primes((fSlow25 + 10)); - float fSlow29 = (0.0001f * iSlow28); - float fSlow30 = (55 * fSlow5); - int iSlow31 = primes(fSlow30); - float fSlow32 = (0.001f * iSlow31); - int iSlow33 = primes((fSlow30 + 10)); - float fSlow34 = (0.001f * iSlow33); - float fSlow35 = (42 * fSlow5); - int iSlow36 = primes(fSlow35); - float fSlow37 = (0.001f * iSlow36); - int iSlow38 = primes((fSlow35 + 10)); - float fSlow39 = (0.001f * iSlow38); - float fSlow40 = (29 * fSlow5); - int iSlow41 = primes(fSlow40); - float fSlow42 = (0.001f * iSlow41); - int iSlow43 = primes((fSlow40 + 10)); - float fSlow44 = (0.001f * iSlow43); - float fSlow45 = (87 * fSlow5); - int iSlow46 = primes(fSlow45); - float fSlow47 = (0.0001f * iSlow46); - int iSlow48 = primes((fSlow45 + 10)); - float fSlow49 = (0.0001f * iSlow48); - float fSlow50 = (74 * fSlow5); - int iSlow51 = primes(fSlow50); - float fSlow52 = (0.001f * iSlow51); - int iSlow53 = primes((fSlow50 + 10)); - float fSlow54 = (0.001f * iSlow53); - float fSlow55 = (61 * fSlow5); - int iSlow56 = primes(fSlow55); - float fSlow57 = (0.001f * iSlow56); - int iSlow58 = primes((fSlow55 + 10)); - float fSlow59 = (0.001f * iSlow58); - float fSlow60 = (48 * fSlow5); - int iSlow61 = primes(fSlow60); - float fSlow62 = (0.001f * iSlow61); - int iSlow63 = primes((fSlow60 + 10)); - float fSlow64 = (0.001f * iSlow63); - float fSlow65 = float(fslider6); + float fSlow5 = floorf(min((float)65533, (fConst0 * float(fslider5)))); + float fSlow6 = float(fslider6); + float fSlow7 = (49 * fSlow6); + int iSlow8 = primes(fSlow7); + float fSlow9 = (0.0001f * iSlow8); + int iSlow10 = primes((fSlow7 + 10)); + float fSlow11 = (0.0001f * iSlow10); + float fSlow12 = (36 * fSlow6); + int iSlow13 = primes(fSlow12); + float fSlow14 = (0.001f * iSlow13); + int iSlow15 = primes((fSlow12 + 10)); + float fSlow16 = (0.001f * iSlow15); + float fSlow17 = (23 * fSlow6); + int iSlow18 = primes(fSlow17); + float fSlow19 = (0.001f * iSlow18); + int iSlow20 = primes((fSlow17 + 10)); + float fSlow21 = (0.001f * iSlow20); + int iSlow22 = primes((10 * fSlow6)); + float fSlow23 = (0.001f * iSlow22); + int iSlow24 = primes((10 * (fSlow6 + 1))); + float fSlow25 = (0.001f * iSlow24); + float fSlow26 = (68 * fSlow6); + int iSlow27 = primes(fSlow26); + float fSlow28 = (0.0001f * iSlow27); + int iSlow29 = primes((fSlow26 + 10)); + float fSlow30 = (0.0001f * iSlow29); + float fSlow31 = (55 * fSlow6); + int iSlow32 = primes(fSlow31); + float fSlow33 = (0.001f * iSlow32); + int iSlow34 = primes((fSlow31 + 10)); + float fSlow35 = (0.001f * iSlow34); + float fSlow36 = (42 * fSlow6); + int iSlow37 = primes(fSlow36); + float fSlow38 = (0.001f * iSlow37); + int iSlow39 = primes((fSlow36 + 10)); + float fSlow40 = (0.001f * iSlow39); + float fSlow41 = (29 * fSlow6); + int iSlow42 = primes(fSlow41); + float fSlow43 = (0.001f * iSlow42); + int iSlow44 = primes((fSlow41 + 10)); + float fSlow45 = (0.001f * iSlow44); + float fSlow46 = (87 * fSlow6); + int iSlow47 = primes(fSlow46); + float fSlow48 = (0.0001f * iSlow47); + int iSlow49 = primes((fSlow46 + 10)); + float fSlow50 = (0.0001f * iSlow49); + float fSlow51 = (74 * fSlow6); + int iSlow52 = primes(fSlow51); + float fSlow53 = (0.001f * iSlow52); + int iSlow54 = primes((fSlow51 + 10)); + float fSlow55 = (0.001f * iSlow54); + float fSlow56 = (61 * fSlow6); + int iSlow57 = primes(fSlow56); + float fSlow58 = (0.001f * iSlow57); + int iSlow59 = primes((fSlow56 + 10)); + float fSlow60 = (0.001f * iSlow59); + float fSlow61 = (48 * fSlow6); + int iSlow62 = primes(fSlow61); + float fSlow63 = (0.001f * iSlow62); + int iSlow64 = primes((fSlow61 + 10)); + float fSlow65 = (0.001f * iSlow64); + //zone2b + //zone3 FAUSTFLOAT* input0 = input[0]; FAUSTFLOAT* input1 = input[1]; FAUSTFLOAT* output0 = output[0]; FAUSTFLOAT* output1 = output[1]; + //LoopGraphScalar for (int i=0; i 0.0f) & (fRec42[1] < 1.0f))))?fRec41[1]:0):((int(((fRec42[1] == 0.0f) & (fSlow3 != fRec43[1]))))?4.5351473e-05f:((int(((fRec42[1] == 1.0f) & (fSlow3 != fRec44[1]))))?-4.5351473e-05f:0))); - fRec41[0] = fTemp23; - fRec42[0] = max(0.0f, min(1.0f, (fRec42[1] + fTemp23))); - fRec43[0] = ((int(((fRec42[1] >= 1.0f) & (fRec44[1] != fSlow3))))?fSlow3:fRec43[1]); - fRec44[0] = ((int(((fRec42[1] <= 0.0f) & (fRec43[1] != fSlow3))))?fSlow3:fRec44[1]); - int iTemp24 = int(min((float)65536, max((float)0, fRec43[0]))); - float fTemp25 = (1.0f - fRec42[0]); - int iTemp26 = int(min((float)65536, max((float)0, fRec44[0]))); + fTempPerm9 = (fSlow2 + fVec3[1]); + fVec4[0] = fSlow3; + fTempPerm10 = (fSlow3 + fVec4[1]); fVec5[0] = fSlow4; - float fTemp27 = (fSlow4 + fVec5[1]); - float fTemp28 = ((float)input0[i] + (0.5f * (((fVec4[(IOTA-iTemp24)&131071] * fTemp25) + (fVec4[(IOTA-iTemp26)&131071] * fRec42[0])) * fTemp27))); - float fTemp29 = ((fRec27[1] * fTemp7) + (fTemp1 * fTemp28)); - float fTemp30 = ((fRec30[1] * fTemp7) + (fTemp1 * fTemp29)); - float fTemp31 = ((fRec33[1] * fTemp7) + (fTemp1 * fTemp30)); - float fTemp32 = ((fRec36[1] * fTemp7) + (fTemp1 * fTemp31)); - float fTemp33 = (fConst1 * (fTemp8 * (fRec39[0] + 1.0f))); - float fTemp34 = (fTemp33 + 8.500005f); - int iTemp35 = int(fTemp34); - float fTemp36 = floorf(fTemp34); - float fTemp37 = (fTemp33 + (9.0f - fTemp36)); - float fTemp38 = (fTemp33 + (8.0f - fTemp36)); - float fTemp39 = (fTemp33 + (7.0f - fTemp36)); - float fTemp40 = (fTemp33 + (6.0f - fTemp36)); - float fTemp41 = (fTemp37 * fTemp38); - float fTemp42 = (((((fRec1[(IOTA-int((int(min(512, max(0, iTemp35))) + 1)))&1023] * (0 - fTemp37)) * (0 - (0.5f * fTemp38))) * (0 - (0.33333334f * fTemp39))) * (0 - (0.25f * fTemp40))) + ((fTemp33 + (1e+01f - fTemp36)) * ((((((fRec1[(IOTA-int((int(min(512, max(0, (iTemp35 + 1)))) + 1)))&1023] * (0 - fTemp38)) * (0 - (0.5f * fTemp39))) * (0 - (0.33333334f * fTemp40))) + (0.5f * (((fTemp37 * fRec1[(IOTA-int((int(min(512, max(0, (iTemp35 + 2)))) + 1)))&1023]) * (0 - fTemp39)) * (0 - (0.5f * fTemp40))))) + (0.16666667f * ((fTemp41 * fRec1[(IOTA-int((int(min(512, max(0, (iTemp35 + 3)))) + 1)))&1023]) * (0 - fTemp40)))) + (0.041666668f * ((fTemp41 * fTemp39) * fRec1[(IOTA-int((int(min(512, max(0, (iTemp35 + 4)))) + 1)))&1023]))))); - fVec6[IOTA&131071] = fTemp42; - float fTemp43 = ((float)input1[i] + (0.5f * (fTemp27 * ((fVec6[(IOTA-iTemp26)&131071] * fRec42[0]) + (fVec6[(IOTA-iTemp24)&131071] * fTemp25))))); - float fTemp44 = ((fRec28[1] * fTemp7) + (fTemp1 * fTemp43)); - float fTemp45 = ((fRec31[1] * fTemp7) + (fTemp1 * fTemp44)); - float fTemp46 = ((fRec34[1] * fTemp7) + (fTemp1 * fTemp45)); - float fTemp47 = ((fRec37[1] * fTemp7) + (fTemp1 * fTemp46)); - float fTemp48 = ((6.123234e-17f * fTemp32) - fTemp47); - fVec7[IOTA&16383] = fTemp48; - fRec45[0] = (fSlow8 + (0.9999f * ((iSlow7 * iTemp12) + fRec45[1]))); - float fTemp49 = (fRec45[0] + -1.49999f); - int iTemp50 = int(min(8192, max(0, int(fTemp49)))); - float fTemp51 = floorf(fTemp49); - float fTemp52 = (fTemp51 + (2.0f - fRec45[0])); - float fTemp53 = (fRec45[0] - fTemp51); - fRec38[0] = (fVec7[(IOTA-int((iTemp50 + 1)))&16383] + ((fRec38[1] * (0 - (fTemp52 / fTemp53))) + ((fTemp52 * fVec7[(IOTA-iTemp50)&16383]) / fTemp53))); + fTempPerm11 = (fConst2 * (fSlow4 + fVec5[1])); + fTempPerm12 = sinf(fTempPerm11); + fTempPerm13 = cosf(fTempPerm11); + fRec27[0] = ((fTempPerm12 * fRec28[1]) + (fTempPerm13 * fRec27[1])); + iTempPerm14 = (1 - iVec1[1]); + fRec28[0] = (((fTempPerm13 * fRec28[1]) + ((0 - fTempPerm12) * fRec27[1])) + iTempPerm14); + fTempPerm15 = (fConst1 * (fTempPerm10 * (fRec27[0] + 1.0f))); + fTempPerm16 = (fTempPerm15 + 8.500005f); + iTempPerm17 = int(fTempPerm16); + fTempPerm18 = floorf(fTempPerm16); + fTempPerm19 = (fTempPerm15 + (9.0f - fTempPerm18)); + fTempPerm20 = (fTempPerm15 + (8.0f - fTempPerm18)); + fTempPerm21 = (fTempPerm15 + (7.0f - fTempPerm18)); + fTempPerm22 = (fTempPerm15 + (6.0f - fTempPerm18)); + fTempPerm23 = (fTempPerm19 * fTempPerm20); + fTempPerm24 = (((((fRec1[(IOTA-int((int(min(512, max(0, iTempPerm17))) + 1)))&1023] * (0 - fTempPerm19)) * (0 - (0.5f * fTempPerm20))) * (0 - (0.33333334f * fTempPerm21))) * (0 - (0.25f * fTempPerm22))) + ((fTempPerm15 + (1e+01f - fTempPerm18)) * ((((((fRec1[(IOTA-int((int(min(512, max(0, (iTempPerm17 + 1)))) + 1)))&1023] * (0 - fTempPerm20)) * (0 - (0.5f * fTempPerm21))) * (0 - (0.33333334f * fTempPerm22))) + (0.5f * (((fTempPerm19 * fRec1[(IOTA-int((int(min(512, max(0, (iTempPerm17 + 2)))) + 1)))&1023]) * (0 - fTempPerm21)) * (0 - (0.5f * fTempPerm22))))) + (0.16666667f * ((fTempPerm23 * fRec1[(IOTA-int((int(min(512, max(0, (iTempPerm17 + 3)))) + 1)))&1023]) * (0 - fTempPerm22)))) + (0.041666668f * ((fTempPerm23 * fTempPerm21) * fRec1[(IOTA-int((int(min(512, max(0, (iTempPerm17 + 4)))) + 1)))&1023]))))); + fVec6[IOTA&131071] = fTempPerm24; + fTempPerm25 = ((int((fRec29[1] != 0.0f)))?((int(((fRec30[1] > 0.0f) & (fRec30[1] < 1.0f))))?fRec29[1]:0):((int(((fRec30[1] == 0.0f) & (fSlow5 != fRec31[1]))))?4.5351473e-05f:((int(((fRec30[1] == 1.0f) & (fSlow5 != fRec32[1]))))?-4.5351473e-05f:0))); + fRec29[0] = fTempPerm25; + fRec30[0] = max(0.0f, min(1.0f, (fRec30[1] + fTempPerm25))); + fRec31[0] = ((int(((fRec30[1] >= 1.0f) & (fRec32[1] != fSlow5))))?fSlow5:fRec31[1]); + fRec32[0] = ((int(((fRec30[1] <= 0.0f) & (fRec31[1] != fSlow5))))?fSlow5:fRec32[1]); + iTempPerm26 = int(min((float)65536, max((float)0, fRec32[0]))); + iTempPerm27 = int(min((float)65536, max((float)0, fRec31[0]))); + fTempPerm28 = (1.0f - fRec30[0]); + fTempPerm29 = ((float)input1[i] + (0.5f * (fTempPerm9 * ((fVec6[(IOTA-iTempPerm26)&131071] * fRec30[0]) + (fVec6[(IOTA-iTempPerm27)&131071] * fTempPerm28))))); + fTempPerm30 = ((fRec34[1] * fTempPerm4) + (fTempPerm2 * fTempPerm29)); + fTempPerm31 = ((fRec37[1] * fTempPerm4) + (fTempPerm2 * fTempPerm30)); + fTempPerm32 = ((fRec40[1] * fTempPerm4) + (fTempPerm2 * fTempPerm31)); + fTempPerm33 = (0 - ((fRec43[1] * fTempPerm4) + (fTempPerm2 * fTempPerm32))); + fVec7[IOTA&16383] = fTempPerm33; + fRec45[0] = (fSlow9 + (0.9999f * ((iSlow8 * iTempPerm14) + fRec45[1]))); + fTempPerm34 = (fRec45[0] + -1.49999f); + iTempPerm35 = int(min(8192, max(0, int(fTempPerm34)))); + fTempPerm36 = floorf(fTempPerm34); + fTempPerm37 = (fTempPerm36 + (2.0f - fRec45[0])); + fTempPerm38 = (fRec45[0] - fTempPerm36); + fRec44[0] = ((((fVec7[(IOTA-iTempPerm35)&16383] * fTempPerm37) / fTempPerm38) + fVec7[(IOTA-int((iTempPerm35 + 1)))&16383]) + (fRec44[1] * (0 - (fTempPerm37 / fTempPerm38)))); + fRec42[0] = fRec44[0]; + fTempPerm39 = (fConst1 * (fTempPerm10 * (fRec28[0] + 1.0f))); + fTempPerm40 = (fTempPerm39 + 8.500005f); + fTempPerm41 = floorf(fTempPerm40); + fTempPerm42 = (fTempPerm39 + (9.0f - fTempPerm41)); + fTempPerm43 = (fTempPerm39 + (8.0f - fTempPerm41)); + fTempPerm44 = (fTempPerm39 + (7.0f - fTempPerm41)); + fTempPerm45 = (fTempPerm39 + (6.0f - fTempPerm41)); + iTempPerm46 = int(fTempPerm40); + fTempPerm47 = (fTempPerm42 * fTempPerm43); + fTempPerm48 = ((((((0 - fTempPerm42) * (0 - (0.5f * fTempPerm43))) * (0 - (0.33333334f * fTempPerm44))) * (0 - (0.25f * fTempPerm45))) * fRec0[(IOTA-int((int(min(512, max(0, iTempPerm46))) + 1)))&1023]) + ((fTempPerm39 + (1e+01f - fTempPerm41)) * ((((((fRec0[(IOTA-int((int(min(512, max(0, (iTempPerm46 + 1)))) + 1)))&1023] * (0 - fTempPerm43)) * (0 - (0.5f * fTempPerm44))) * (0 - (0.33333334f * fTempPerm45))) + (0.5f * (((fTempPerm42 * fRec0[(IOTA-int((int(min(512, max(0, (iTempPerm46 + 2)))) + 1)))&1023]) * (0 - fTempPerm44)) * (0 - (0.5f * fTempPerm45))))) + (0.16666667f * ((fTempPerm47 * fRec0[(IOTA-int((int(min(512, max(0, (iTempPerm46 + 3)))) + 1)))&1023]) * (0 - fTempPerm45)))) + (0.041666668f * ((fTempPerm47 * fTempPerm44) * fRec0[(IOTA-int((int(min(512, max(0, (iTempPerm46 + 4)))) + 1)))&1023]))))); + fVec8[IOTA&131071] = fTempPerm48; + fTempPerm49 = ((float)input0[i] + (0.5f * (((fVec8[(IOTA-iTempPerm27)&131071] * fTempPerm28) + (fVec8[(IOTA-iTempPerm26)&131071] * fRec30[0])) * fTempPerm9))); + fTempPerm50 = ((fTempPerm2 * fTempPerm49) + (fTempPerm4 * fRec33[1])); + fTempPerm51 = ((fTempPerm2 * fTempPerm50) + (fTempPerm4 * fRec36[1])); + fTempPerm52 = ((fTempPerm2 * fTempPerm51) + (fTempPerm4 * fRec39[1])); + fTempPerm53 = ((fTempPerm2 * fTempPerm52) + (fTempPerm4 * fRec42[1])); + fVec9[IOTA&16383] = fTempPerm53; + fRec47[0] = (fSlow11 + (0.9999f * ((iSlow10 * iTempPerm14) + fRec47[1]))); + fTempPerm54 = (fRec47[0] + -1.49999f); + iTempPerm55 = int(min(8192, max(0, int(fTempPerm54)))); + fTempPerm56 = floorf(fTempPerm54); + fTempPerm57 = (fTempPerm56 + (2.0f - fRec47[0])); + fTempPerm58 = (fRec47[0] - fTempPerm56); + fRec46[0] = (fVec9[(IOTA-int((iTempPerm55 + 1)))&16383] + ((fRec46[1] * (0 - (fTempPerm57 / fTempPerm58))) + ((fTempPerm57 * fVec9[(IOTA-iTempPerm55)&16383]) / fTempPerm58))); + fRec43[0] = fRec46[0]; + fTempPerm59 = (0 - ((fTempPerm2 * fRec43[1]) + (fTempPerm32 * fTempPerm3))); + fVec10[IOTA&16383] = fTempPerm59; + fRec48[0] = (fSlow14 + (0.999f * ((iSlow13 * iTempPerm14) + fRec48[1]))); + fTempPerm60 = (fRec48[0] + -1.49999f); + iTempPerm61 = int(min(8192, max(0, int(fTempPerm60)))); + fTempPerm62 = floorf(fTempPerm60); + fTempPerm63 = (fTempPerm62 + (2.0f - fRec48[0])); + fTempPerm64 = (fRec48[0] - fTempPerm62); + fRec41[0] = ((((fVec10[(IOTA-iTempPerm61)&16383] * fTempPerm63) / fTempPerm64) + fVec10[(IOTA-int((iTempPerm61 + 1)))&16383]) + (fRec41[1] * (0 - (fTempPerm63 / fTempPerm64)))); + fRec39[0] = fRec41[0]; + fTempPerm65 = ((fTempPerm2 * fRec42[1]) + (fTempPerm52 * fTempPerm3)); + fVec11[IOTA&16383] = fTempPerm65; + fRec50[0] = (fSlow16 + (0.999f * ((iSlow15 * iTempPerm14) + fRec50[1]))); + fTempPerm66 = (fRec50[0] + -1.49999f); + iTempPerm67 = int(min(8192, max(0, int(fTempPerm66)))); + fTempPerm68 = floorf(fTempPerm66); + fTempPerm69 = (fTempPerm68 + (2.0f - fRec50[0])); + fTempPerm70 = (fRec50[0] - fTempPerm68); + fRec49[0] = (fVec11[(IOTA-int((iTempPerm67 + 1)))&16383] + ((fRec49[1] * (0 - (fTempPerm69 / fTempPerm70))) + ((fTempPerm69 * fVec11[(IOTA-iTempPerm67)&16383]) / fTempPerm70))); + fRec40[0] = fRec49[0]; + fTempPerm71 = (0 - ((fTempPerm2 * fRec40[1]) + (fTempPerm31 * fTempPerm3))); + fVec12[IOTA&16383] = fTempPerm71; + fRec51[0] = (fSlow19 + (0.999f * ((iSlow18 * iTempPerm14) + fRec51[1]))); + fTempPerm72 = (fRec51[0] + -1.49999f); + iTempPerm73 = int(min(8192, max(0, int(fTempPerm72)))); + fTempPerm74 = floorf(fTempPerm72); + fTempPerm75 = (fTempPerm74 + (2.0f - fRec51[0])); + fTempPerm76 = (fRec51[0] - fTempPerm74); + fRec38[0] = ((((fVec12[(IOTA-iTempPerm73)&16383] * fTempPerm75) / fTempPerm76) + fVec12[(IOTA-int((iTempPerm73 + 1)))&16383]) + (fRec38[1] * (0 - (fTempPerm75 / fTempPerm76)))); fRec36[0] = fRec38[0]; - float fTemp54 = (fTemp32 + (6.123234e-17f * fTemp47)); - fVec8[IOTA&16383] = fTemp54; - fRec47[0] = (fSlow10 + (0.9999f * ((iSlow9 * iTemp12) + fRec47[1]))); - float fTemp55 = (fRec47[0] + -1.49999f); - int iTemp56 = int(min(8192, max(0, int(fTemp55)))); - float fTemp57 = floorf(fTemp55); - float fTemp58 = (fTemp57 + (2.0f - fRec47[0])); - float fTemp59 = (fRec47[0] - fTemp57); - fRec46[0] = (fVec8[(IOTA-int((iTemp56 + 1)))&16383] + ((fRec46[1] * (0 - (fTemp58 / fTemp59))) + ((fTemp58 * fVec8[(IOTA-iTemp56)&16383]) / fTemp59))); - fRec37[0] = fRec46[0]; - float fTemp60 = ((fRec36[1] * fTemp1) + (fTemp31 * fTemp6)); - float fTemp61 = ((fTemp1 * fRec37[1]) + (fTemp46 * fTemp6)); - float fTemp62 = ((6.123234e-17f * fTemp60) - fTemp61); - fVec9[IOTA&16383] = fTemp62; - fRec48[0] = (fSlow13 + (0.999f * ((iSlow12 * iTemp12) + fRec48[1]))); - float fTemp63 = (fRec48[0] + -1.49999f); - int iTemp64 = int(min(8192, max(0, int(fTemp63)))); - float fTemp65 = floorf(fTemp63); - float fTemp66 = (fTemp65 + (2.0f - fRec48[0])); - float fTemp67 = (fRec48[0] - fTemp65); - fRec35[0] = (fVec9[(IOTA-int((iTemp64 + 1)))&16383] + ((fRec35[1] * (0 - (fTemp66 / fTemp67))) + ((fTemp66 * fVec9[(IOTA-iTemp64)&16383]) / fTemp67))); + fTempPerm77 = ((fTempPerm2 * fRec39[1]) + (fTempPerm51 * fTempPerm3)); + fVec13[IOTA&16383] = fTempPerm77; + fRec53[0] = (fSlow21 + (0.999f * ((iSlow20 * iTempPerm14) + fRec53[1]))); + fTempPerm78 = (fRec53[0] + -1.49999f); + iTempPerm79 = int(min(8192, max(0, int(fTempPerm78)))); + fTempPerm80 = floorf(fTempPerm78); + fTempPerm81 = (fTempPerm80 + (2.0f - fRec53[0])); + fTempPerm82 = (fRec53[0] - fTempPerm80); + fRec52[0] = (fVec13[(IOTA-int((iTempPerm79 + 1)))&16383] + ((fRec52[1] * (0 - (fTempPerm81 / fTempPerm82))) + ((fTempPerm81 * fVec13[(IOTA-iTempPerm79)&16383]) / fTempPerm82))); + fRec37[0] = fRec52[0]; + fTempPerm83 = (0 - ((fTempPerm2 * fRec37[1]) + (fTempPerm30 * fTempPerm3))); + fVec14[IOTA&16383] = fTempPerm83; + fRec54[0] = (fSlow23 + (0.999f * ((iSlow22 * iTempPerm14) + fRec54[1]))); + fTempPerm84 = (fRec54[0] + -1.49999f); + iTempPerm85 = int(min(8192, max(0, int(fTempPerm84)))); + fTempPerm86 = floorf(fTempPerm84); + fTempPerm87 = (fTempPerm86 + (2.0f - fRec54[0])); + fTempPerm88 = (fRec54[0] - fTempPerm86); + fRec35[0] = ((((fVec14[(IOTA-iTempPerm85)&16383] * fTempPerm87) / fTempPerm88) + fVec14[(IOTA-int((iTempPerm85 + 1)))&16383]) + ((0 - (fTempPerm87 / fTempPerm88)) * fRec35[1])); fRec33[0] = fRec35[0]; - float fTemp68 = ((6.123234e-17f * fTemp61) + fTemp60); - fVec10[IOTA&16383] = fTemp68; - fRec50[0] = (fSlow15 + (0.999f * ((iSlow14 * iTemp12) + fRec50[1]))); - float fTemp69 = (fRec50[0] + -1.49999f); - int iTemp70 = int(min(8192, max(0, int(fTemp69)))); - float fTemp71 = floorf(fTemp69); - float fTemp72 = (fTemp71 + (2.0f - fRec50[0])); - float fTemp73 = (fRec50[0] - fTemp71); - fRec49[0] = ((((fVec10[(IOTA-iTemp70)&16383] * fTemp72) / fTemp73) + fVec10[(IOTA-int((iTemp70 + 1)))&16383]) + (fRec49[1] * (0 - (fTemp72 / fTemp73)))); - fRec34[0] = fRec49[0]; - float fTemp74 = ((fRec33[1] * fTemp1) + (fTemp30 * fTemp6)); - float fTemp75 = ((fTemp1 * fRec34[1]) + (fTemp45 * fTemp6)); - float fTemp76 = ((6.123234e-17f * fTemp74) - fTemp75); - fVec11[IOTA&16383] = fTemp76; - fRec51[0] = (fSlow18 + (0.999f * ((iSlow17 * iTemp12) + fRec51[1]))); - float fTemp77 = (fRec51[0] + -1.49999f); - int iTemp78 = int(min(8192, max(0, int(fTemp77)))); - float fTemp79 = floorf(fTemp77); - float fTemp80 = (fTemp79 + (2.0f - fRec51[0])); - float fTemp81 = (fRec51[0] - fTemp79); - fRec32[0] = (fVec11[(IOTA-int((iTemp78 + 1)))&16383] + ((fRec32[1] * (0 - (fTemp80 / fTemp81))) + ((fTemp80 * fVec11[(IOTA-iTemp78)&16383]) / fTemp81))); - fRec30[0] = fRec32[0]; - float fTemp82 = (fTemp74 + (6.123234e-17f * fTemp75)); - fVec12[IOTA&16383] = fTemp82; - fRec53[0] = (fSlow20 + (0.999f * ((iSlow19 * iTemp12) + fRec53[1]))); - float fTemp83 = (fRec53[0] + -1.49999f); - int iTemp84 = int(min(8192, max(0, int(fTemp83)))); - float fTemp85 = floorf(fTemp83); - float fTemp86 = (fTemp85 + (2.0f - fRec53[0])); - float fTemp87 = (fRec53[0] - fTemp85); - fRec52[0] = (fVec12[(IOTA-int((iTemp84 + 1)))&16383] + ((fRec52[1] * (0 - (fTemp86 / fTemp87))) + ((fTemp86 * fVec12[(IOTA-iTemp84)&16383]) / fTemp87))); - fRec31[0] = fRec52[0]; - float fTemp88 = ((fRec30[1] * fTemp1) + (fTemp29 * fTemp6)); - float fTemp89 = ((fTemp1 * fRec31[1]) + (fTemp44 * fTemp6)); - float fTemp90 = ((6.123234e-17f * fTemp88) - fTemp89); - fVec13[IOTA&16383] = fTemp90; - fRec54[0] = (fSlow22 + (0.999f * ((iSlow21 * iTemp12) + fRec54[1]))); - float fTemp91 = (fRec54[0] + -1.49999f); - int iTemp92 = int(min(8192, max(0, int(fTemp91)))); - float fTemp93 = floorf(fTemp91); - float fTemp94 = (fTemp93 + (2.0f - fRec54[0])); - float fTemp95 = (fRec54[0] - fTemp93); - fRec29[0] = (fVec13[(IOTA-int((iTemp92 + 1)))&16383] + ((fRec29[1] * (0 - (fTemp94 / fTemp95))) + ((fTemp94 * fVec13[(IOTA-iTemp92)&16383]) / fTemp95))); - fRec27[0] = fRec29[0]; - float fTemp96 = (fTemp88 + (6.123234e-17f * fTemp89)); - fVec14[IOTA&16383] = fTemp96; - fRec56[0] = (fSlow24 + (0.999f * ((iSlow23 * iTemp12) + fRec56[1]))); - float fTemp97 = (fRec56[0] + -1.49999f); - int iTemp98 = int(min(8192, max(0, int(fTemp97)))); - float fTemp99 = floorf(fTemp97); - float fTemp100 = (fTemp99 + (2.0f - fRec56[0])); - float fTemp101 = (fRec56[0] - fTemp99); - fRec55[0] = (fVec14[(IOTA-int((iTemp98 + 1)))&16383] + ((fRec55[1] * (0 - (fTemp100 / fTemp101))) + ((fTemp100 * fVec14[(IOTA-iTemp98)&16383]) / fTemp101))); - fRec28[0] = fRec55[0]; - float fTemp102 = ((fRec27[1] * fTemp1) + (fTemp28 * fTemp6)); - float fTemp103 = ((fTemp4 * fRec15[1]) + (fTemp102 * fTemp5)); - float fTemp104 = ((fTemp4 * fRec18[1]) + (fTemp5 * fTemp103)); - float fTemp105 = ((fTemp4 * fRec21[1]) + (fTemp5 * fTemp104)); - float fTemp106 = ((fRec24[1] * fTemp4) + (fTemp5 * fTemp105)); - float fTemp107 = ((fTemp1 * fRec28[1]) + (fTemp43 * fTemp6)); - float fTemp108 = ((fTemp4 * fRec16[1]) + (fTemp5 * fTemp107)); - float fTemp109 = ((fTemp4 * fRec19[1]) + (fTemp5 * fTemp108)); - float fTemp110 = ((fTemp4 * fRec22[1]) + (fTemp5 * fTemp109)); - float fTemp111 = ((fTemp4 * fRec25[1]) + (fTemp5 * fTemp110)); - float fTemp112 = ((6.123234e-17f * fTemp106) - fTemp111); - fVec15[IOTA&16383] = fTemp112; - fRec57[0] = (fSlow27 + (0.9999f * ((iSlow26 * iTemp12) + fRec57[1]))); - float fTemp113 = (fRec57[0] + -1.49999f); - int iTemp114 = int(min(8192, max(0, int(fTemp113)))); - float fTemp115 = floorf(fTemp113); - float fTemp116 = (fTemp115 + (2.0f - fRec57[0])); - float fTemp117 = (fRec57[0] - fTemp115); - fRec26[0] = (fVec15[(IOTA-int((iTemp114 + 1)))&16383] + ((fRec26[1] * (0 - (fTemp116 / fTemp117))) + ((fTemp116 * fVec15[(IOTA-iTemp114)&16383]) / fTemp117))); + fTempPerm89 = ((fTempPerm2 * fRec36[1]) + (fTempPerm50 * fTempPerm3)); + fVec15[IOTA&16383] = fTempPerm89; + fRec56[0] = (fSlow25 + (0.999f * ((iSlow24 * iTempPerm14) + fRec56[1]))); + fTempPerm90 = (fRec56[0] + -1.49999f); + iTempPerm91 = int(min(8192, max(0, int(fTempPerm90)))); + fTempPerm92 = floorf(fTempPerm90); + fTempPerm93 = (fTempPerm92 + (2.0f - fRec56[0])); + fTempPerm94 = (fRec56[0] - fTempPerm92); + fRec55[0] = (fVec15[(IOTA-int((iTempPerm91 + 1)))&16383] + ((fRec55[1] * (0 - (fTempPerm93 / fTempPerm94))) + ((fTempPerm93 * fVec15[(IOTA-iTempPerm91)&16383]) / fTempPerm94))); + fRec34[0] = fRec55[0]; + fTempPerm95 = ((fTempPerm29 * fTempPerm3) + (fTempPerm2 * fRec34[1])); + fTempPerm96 = ((fRec16[1] * fTempPerm8) + (fTempPerm6 * fTempPerm95)); + fTempPerm97 = ((fRec19[1] * fTempPerm8) + (fTempPerm6 * fTempPerm96)); + fTempPerm98 = ((fRec22[1] * fTempPerm8) + (fTempPerm6 * fTempPerm97)); + fTempPerm99 = (0 - ((fRec25[1] * fTempPerm8) + (fTempPerm6 * fTempPerm98))); + fVec16[IOTA&16383] = fTempPerm99; + fRec57[0] = (fSlow28 + (0.9999f * ((iSlow27 * iTempPerm14) + fRec57[1]))); + fTempPerm100 = (fRec57[0] + -1.49999f); + iTempPerm101 = int(min(8192, max(0, int(fTempPerm100)))); + fTempPerm102 = floorf(fTempPerm100); + fTempPerm103 = (fTempPerm102 + (2.0f - fRec57[0])); + fTempPerm104 = (fRec57[0] - fTempPerm102); + fRec26[0] = ((((fVec16[(IOTA-iTempPerm101)&16383] * fTempPerm103) / fTempPerm104) + fVec16[(IOTA-int((iTempPerm101 + 1)))&16383]) + (fRec26[1] * (0 - (fTempPerm103 / fTempPerm104)))); fRec24[0] = fRec26[0]; - float fTemp118 = (fTemp106 + (6.123234e-17f * fTemp111)); - fVec16[IOTA&16383] = fTemp118; - fRec59[0] = (fSlow29 + (0.9999f * ((iSlow28 * iTemp12) + fRec59[1]))); - float fTemp119 = (fRec59[0] + -1.49999f); - int iTemp120 = int(min(8192, max(0, int(fTemp119)))); - float fTemp121 = floorf(fTemp119); - float fTemp122 = (fTemp121 + (2.0f - fRec59[0])); - float fTemp123 = (fRec59[0] - fTemp121); - fRec58[0] = (fVec16[(IOTA-int((iTemp120 + 1)))&16383] + ((fRec58[1] * (0 - (fTemp122 / fTemp123))) + ((fTemp122 * fVec16[(IOTA-iTemp120)&16383]) / fTemp123))); + fTempPerm105 = ((fTempPerm2 * fRec33[1]) + (fTempPerm49 * fTempPerm3)); + fTempPerm106 = ((fTempPerm105 * fTempPerm6) + (fTempPerm8 * fRec15[1])); + fTempPerm107 = ((fTempPerm6 * fTempPerm106) + (fTempPerm8 * fRec18[1])); + fTempPerm108 = ((fTempPerm6 * fTempPerm107) + (fTempPerm8 * fRec21[1])); + fTempPerm109 = ((fTempPerm6 * fTempPerm108) + (fRec24[1] * fTempPerm8)); + fVec17[IOTA&16383] = fTempPerm109; + fRec59[0] = (fSlow30 + (0.9999f * ((iSlow29 * iTempPerm14) + fRec59[1]))); + fTempPerm110 = (fRec59[0] + -1.49999f); + iTempPerm111 = int(min(8192, max(0, int(fTempPerm110)))); + fTempPerm112 = floorf(fTempPerm110); + fTempPerm113 = (fTempPerm112 + (2.0f - fRec59[0])); + fTempPerm114 = (fRec59[0] - fTempPerm112); + fRec58[0] = (fVec17[(IOTA-int((iTempPerm111 + 1)))&16383] + ((fRec58[1] * (0 - (fTempPerm113 / fTempPerm114))) + ((fTempPerm113 * fVec17[(IOTA-iTempPerm111)&16383]) / fTempPerm114))); fRec25[0] = fRec58[0]; - float fTemp124 = ((fRec24[1] * fTemp5) + (fTemp3 * fTemp105)); - float fTemp125 = ((fTemp5 * fRec25[1]) + (fTemp3 * fTemp110)); - float fTemp126 = ((6.123234e-17f * fTemp124) - fTemp125); - fVec17[IOTA&16383] = fTemp126; - fRec60[0] = (fSlow32 + (0.999f * ((iSlow31 * iTemp12) + fRec60[1]))); - float fTemp127 = (fRec60[0] + -1.49999f); - int iTemp128 = int(min(8192, max(0, int(fTemp127)))); - float fTemp129 = floorf(fTemp127); - float fTemp130 = (fTemp129 + (2.0f - fRec60[0])); - float fTemp131 = (fRec60[0] - fTemp129); - fRec23[0] = (fVec17[(IOTA-int((iTemp128 + 1)))&16383] + (((0 - (fTemp130 / fTemp131)) * fRec23[1]) + ((fVec17[(IOTA-iTemp128)&16383] * fTemp130) / fTemp131))); + fTempPerm115 = (0 - ((fTempPerm6 * fRec25[1]) + (fTempPerm98 * fTempPerm7))); + fVec18[IOTA&16383] = fTempPerm115; + fRec60[0] = (fSlow33 + (0.999f * ((iSlow32 * iTempPerm14) + fRec60[1]))); + fTempPerm116 = (fRec60[0] + -1.49999f); + iTempPerm117 = int(min(8192, max(0, int(fTempPerm116)))); + fTempPerm118 = floorf(fTempPerm116); + fTempPerm119 = (fTempPerm118 + (2.0f - fRec60[0])); + fTempPerm120 = (fRec60[0] - fTempPerm118); + fRec23[0] = ((((fVec18[(IOTA-iTempPerm117)&16383] * fTempPerm119) / fTempPerm120) + fVec18[(IOTA-int((iTempPerm117 + 1)))&16383]) + (fRec23[1] * (0 - (fTempPerm119 / fTempPerm120)))); fRec21[0] = fRec23[0]; - float fTemp132 = (fTemp124 + (6.123234e-17f * fTemp125)); - fVec18[IOTA&16383] = fTemp132; - fRec62[0] = (fSlow34 + (0.999f * ((iSlow33 * iTemp12) + fRec62[1]))); - float fTemp133 = (fRec62[0] + -1.49999f); - int iTemp134 = int(min(8192, max(0, int(fTemp133)))); - float fTemp135 = floorf(fTemp133); - float fTemp136 = (fTemp135 + (2.0f - fRec62[0])); - float fTemp137 = (fRec62[0] - fTemp135); - fRec61[0] = (fVec18[(IOTA-int((iTemp134 + 1)))&16383] + ((fRec61[1] * (0 - (fTemp136 / fTemp137))) + ((fTemp136 * fVec18[(IOTA-iTemp134)&16383]) / fTemp137))); + fTempPerm121 = ((fTempPerm6 * fRec24[1]) + (fTempPerm108 * fTempPerm7)); + fVec19[IOTA&16383] = fTempPerm121; + fRec62[0] = (fSlow35 + (0.999f * ((iSlow34 * iTempPerm14) + fRec62[1]))); + fTempPerm122 = (fRec62[0] + -1.49999f); + iTempPerm123 = int(min(8192, max(0, int(fTempPerm122)))); + fTempPerm124 = floorf(fTempPerm122); + fTempPerm125 = (fTempPerm124 + (2.0f - fRec62[0])); + fTempPerm126 = (fRec62[0] - fTempPerm124); + fRec61[0] = (fVec19[(IOTA-int((iTempPerm123 + 1)))&16383] + ((fRec61[1] * (0 - (fTempPerm125 / fTempPerm126))) + ((fTempPerm125 * fVec19[(IOTA-iTempPerm123)&16383]) / fTempPerm126))); fRec22[0] = fRec61[0]; - float fTemp138 = ((fRec21[1] * fTemp5) + (fTemp3 * fTemp104)); - float fTemp139 = ((fTemp5 * fRec22[1]) + (fTemp3 * fTemp109)); - float fTemp140 = ((6.123234e-17f * fTemp138) - fTemp139); - fVec19[IOTA&16383] = fTemp140; - fRec63[0] = (fSlow37 + (0.999f * ((iSlow36 * iTemp12) + fRec63[1]))); - float fTemp141 = (fRec63[0] + -1.49999f); - int iTemp142 = int(min(8192, max(0, int(fTemp141)))); - float fTemp143 = floorf(fTemp141); - float fTemp144 = (fTemp143 + (2.0f - fRec63[0])); - float fTemp145 = (fRec63[0] - fTemp143); - fRec20[0] = ((((fVec19[(IOTA-iTemp142)&16383] * fTemp144) / fTemp145) + fVec19[(IOTA-int((iTemp142 + 1)))&16383]) + (fRec20[1] * (0 - (fTemp144 / fTemp145)))); + fTempPerm127 = (0 - ((fTempPerm6 * fRec22[1]) + (fTempPerm97 * fTempPerm7))); + fVec20[IOTA&16383] = fTempPerm127; + fRec63[0] = (fSlow38 + (0.999f * ((iSlow37 * iTempPerm14) + fRec63[1]))); + fTempPerm128 = (fRec63[0] + -1.49999f); + iTempPerm129 = int(min(8192, max(0, int(fTempPerm128)))); + fTempPerm130 = floorf(fTempPerm128); + fTempPerm131 = (fTempPerm130 + (2.0f - fRec63[0])); + fTempPerm132 = (fRec63[0] - fTempPerm130); + fRec20[0] = ((((fVec20[(IOTA-iTempPerm129)&16383] * fTempPerm131) / fTempPerm132) + fVec20[(IOTA-int((iTempPerm129 + 1)))&16383]) + (fRec20[1] * (0 - (fTempPerm131 / fTempPerm132)))); fRec18[0] = fRec20[0]; - float fTemp146 = (fTemp138 + (6.123234e-17f * fTemp139)); - fVec20[IOTA&16383] = fTemp146; - fRec65[0] = (fSlow39 + (0.999f * ((iSlow38 * iTemp12) + fRec65[1]))); - float fTemp147 = (fRec65[0] + -1.49999f); - int iTemp148 = int(min(8192, max(0, int(fTemp147)))); - float fTemp149 = floorf(fTemp147); - float fTemp150 = (fTemp149 + (2.0f - fRec65[0])); - float fTemp151 = (fRec65[0] - fTemp149); - fRec64[0] = (fVec20[(IOTA-int((iTemp148 + 1)))&16383] + ((fRec64[1] * (0 - (fTemp150 / fTemp151))) + ((fTemp150 * fVec20[(IOTA-iTemp148)&16383]) / fTemp151))); + fTempPerm133 = ((fTempPerm6 * fRec21[1]) + (fTempPerm107 * fTempPerm7)); + fVec21[IOTA&16383] = fTempPerm133; + fRec65[0] = (fSlow40 + (0.999f * ((iSlow39 * iTempPerm14) + fRec65[1]))); + fTempPerm134 = (fRec65[0] + -1.49999f); + iTempPerm135 = int(min(8192, max(0, int(fTempPerm134)))); + fTempPerm136 = floorf(fTempPerm134); + fTempPerm137 = (fTempPerm136 + (2.0f - fRec65[0])); + fTempPerm138 = (fRec65[0] - fTempPerm136); + fRec64[0] = (fVec21[(IOTA-int((iTempPerm135 + 1)))&16383] + ((fRec64[1] * (0 - (fTempPerm137 / fTempPerm138))) + ((fTempPerm137 * fVec21[(IOTA-iTempPerm135)&16383]) / fTempPerm138))); fRec19[0] = fRec64[0]; - float fTemp152 = ((fRec18[1] * fTemp5) + (fTemp3 * fTemp103)); - float fTemp153 = ((fTemp5 * fRec19[1]) + (fTemp3 * fTemp108)); - float fTemp154 = ((6.123234e-17f * fTemp152) - fTemp153); - fVec21[IOTA&16383] = fTemp154; - fRec66[0] = (fSlow42 + (0.999f * ((iSlow41 * iTemp12) + fRec66[1]))); - float fTemp155 = (fRec66[0] + -1.49999f); - int iTemp156 = int(min(8192, max(0, int(fTemp155)))); - float fTemp157 = floorf(fTemp155); - float fTemp158 = (fTemp157 + (2.0f - fRec66[0])); - float fTemp159 = (fRec66[0] - fTemp157); - fRec17[0] = ((((fVec21[(IOTA-iTemp156)&16383] * fTemp158) / fTemp159) + fVec21[(IOTA-int((iTemp156 + 1)))&16383]) + (fRec17[1] * (0 - (fTemp158 / fTemp159)))); + fTempPerm139 = (0 - ((fTempPerm6 * fRec19[1]) + (fTempPerm96 * fTempPerm7))); + fVec22[IOTA&16383] = fTempPerm139; + fRec66[0] = (fSlow43 + (0.999f * ((iSlow42 * iTempPerm14) + fRec66[1]))); + fTempPerm140 = (fRec66[0] + -1.49999f); + iTempPerm141 = int(min(8192, max(0, int(fTempPerm140)))); + fTempPerm142 = floorf(fTempPerm140); + fTempPerm143 = (fTempPerm142 + (2.0f - fRec66[0])); + fTempPerm144 = (fRec66[0] - fTempPerm142); + fRec17[0] = ((((fVec22[(IOTA-iTempPerm141)&16383] * fTempPerm143) / fTempPerm144) + fVec22[(IOTA-int((iTempPerm141 + 1)))&16383]) + (fRec17[1] * (0 - (fTempPerm143 / fTempPerm144)))); fRec15[0] = fRec17[0]; - float fTemp160 = (fTemp152 + (6.123234e-17f * fTemp153)); - fVec22[IOTA&16383] = fTemp160; - fRec68[0] = (fSlow44 + (0.999f * ((iSlow43 * iTemp12) + fRec68[1]))); - float fTemp161 = (fRec68[0] + -1.49999f); - int iTemp162 = int(min(8192, max(0, int(fTemp161)))); - float fTemp163 = floorf(fTemp161); - float fTemp164 = (fTemp163 + (2.0f - fRec68[0])); - float fTemp165 = (fRec68[0] - fTemp163); - fRec67[0] = (fVec22[(IOTA-int((iTemp162 + 1)))&16383] + ((fRec67[1] * (0 - (fTemp164 / fTemp165))) + ((fTemp164 * fVec22[(IOTA-iTemp162)&16383]) / fTemp165))); + fTempPerm145 = ((fTempPerm6 * fRec18[1]) + (fTempPerm106 * fTempPerm7)); + fVec23[IOTA&16383] = fTempPerm145; + fRec68[0] = (fSlow45 + (0.999f * ((iSlow44 * iTempPerm14) + fRec68[1]))); + fTempPerm146 = (fRec68[0] + -1.49999f); + iTempPerm147 = int(min(8192, max(0, int(fTempPerm146)))); + fTempPerm148 = floorf(fTempPerm146); + fTempPerm149 = (fTempPerm148 + (2.0f - fRec68[0])); + fTempPerm150 = (fRec68[0] - fTempPerm148); + fRec67[0] = (fVec23[(IOTA-int((iTempPerm147 + 1)))&16383] + ((fRec67[1] * (0 - (fTempPerm149 / fTempPerm150))) + ((fTempPerm149 * fVec23[(IOTA-iTempPerm147)&16383]) / fTempPerm150))); fRec16[0] = fRec67[0]; - float fTemp166 = ((fRec15[1] * fTemp5) + (fTemp3 * fTemp102)); - float fTemp167 = ((fTemp1 * fTemp166) + (fTemp7 * fRec3[1])); - float fTemp168 = ((fTemp1 * fTemp167) + (fTemp7 * fRec6[1])); - float fTemp169 = ((fTemp1 * fTemp168) + (fTemp7 * fRec9[1])); - float fTemp170 = (fTemp1 * fTemp169); - float fTemp171 = (fRec12[1] * fTemp7); - float fTemp172 = ((fTemp5 * fRec16[1]) + (fTemp3 * fTemp107)); - float fTemp173 = ((fRec4[1] * fTemp7) + (fTemp1 * fTemp172)); - float fTemp174 = ((fRec7[1] * fTemp7) + (fTemp1 * fTemp173)); - float fTemp175 = ((fRec10[1] * fTemp7) + (fTemp1 * fTemp174)); - float fTemp176 = ((fRec13[1] * fTemp7) + (fTemp1 * fTemp175)); - float fTemp177 = ((6.123234e-17f * (fTemp170 + fTemp171)) - fTemp176); - fVec23[IOTA&16383] = fTemp177; - fRec69[0] = (fSlow47 + (0.9999f * ((iSlow46 * iTemp12) + fRec69[1]))); - float fTemp178 = (fRec69[0] + -1.49999f); - int iTemp179 = int(min(8192, max(0, int(fTemp178)))); - float fTemp180 = floorf(fTemp178); - float fTemp181 = (fTemp180 + (2.0f - fRec69[0])); - float fTemp182 = (fRec69[0] - fTemp180); - fRec14[0] = ((((fVec23[(IOTA-iTemp179)&16383] * fTemp181) / fTemp182) + fVec23[(IOTA-int((iTemp179 + 1)))&16383]) + (fRec14[1] * (0 - (fTemp181 / fTemp182)))); + fTempPerm151 = ((fTempPerm6 * fRec16[1]) + (fTempPerm95 * fTempPerm7)); + fTempPerm152 = ((fTempPerm4 * fRec4[1]) + (fTempPerm2 * fTempPerm151)); + fTempPerm153 = ((fTempPerm4 * fRec7[1]) + (fTempPerm2 * fTempPerm152)); + fTempPerm154 = ((fTempPerm4 * fRec10[1]) + (fTempPerm2 * fTempPerm153)); + fTempPerm155 = (0 - ((fTempPerm4 * fRec13[1]) + (fTempPerm2 * fTempPerm154))); + fVec24[IOTA&16383] = fTempPerm155; + fRec69[0] = (fSlow48 + (0.9999f * ((iSlow47 * iTempPerm14) + fRec69[1]))); + fTempPerm156 = (fRec69[0] + -1.49999f); + iTempPerm157 = int(min(8192, max(0, int(fTempPerm156)))); + fTempPerm158 = floorf(fTempPerm156); + fTempPerm159 = (fTempPerm158 + (2.0f - fRec69[0])); + fTempPerm160 = (fRec69[0] - fTempPerm158); + fRec14[0] = (fVec24[(IOTA-int((iTempPerm157 + 1)))&16383] + ((fRec14[1] * (0 - (fTempPerm159 / fTempPerm160))) + ((fTempPerm159 * fVec24[(IOTA-iTempPerm157)&16383]) / fTempPerm160))); fRec12[0] = fRec14[0]; - float fTemp183 = ((fTemp170 + (6.123234e-17f * fTemp176)) + fTemp171); - fVec24[IOTA&16383] = fTemp183; - fRec71[0] = (fSlow49 + (0.9999f * ((iSlow48 * iTemp12) + fRec71[1]))); - float fTemp184 = (fRec71[0] + -1.49999f); - int iTemp185 = int(min(8192, max(0, int(fTemp184)))); - float fTemp186 = floorf(fTemp184); - float fTemp187 = (fTemp186 + (2.0f - fRec71[0])); - float fTemp188 = (fRec71[0] - fTemp186); - fRec70[0] = (fVec24[(IOTA-int((iTemp185 + 1)))&16383] + ((fRec70[1] * (0 - (fTemp187 / fTemp188))) + ((fTemp187 * fVec24[(IOTA-iTemp185)&16383]) / fTemp188))); + fTempPerm161 = ((fTempPerm6 * fRec15[1]) + (fTempPerm105 * fTempPerm7)); + fTempPerm162 = ((fTempPerm4 * fRec3[1]) + (fTempPerm2 * fTempPerm161)); + fTempPerm163 = ((fTempPerm4 * fRec6[1]) + (fTempPerm2 * fTempPerm162)); + fTempPerm164 = ((fTempPerm4 * fRec9[1]) + (fTempPerm2 * fTempPerm163)); + fTempPerm165 = ((fRec12[1] * fTempPerm4) + (fTempPerm2 * fTempPerm164)); + fVec25[IOTA&16383] = fTempPerm165; + fRec71[0] = (fSlow50 + (0.9999f * ((iSlow49 * iTempPerm14) + fRec71[1]))); + fTempPerm166 = (fRec71[0] + -1.49999f); + iTempPerm167 = int(min(8192, max(0, int(fTempPerm166)))); + fTempPerm168 = floorf(fTempPerm166); + fTempPerm169 = (fTempPerm168 + (2.0f - fRec71[0])); + fTempPerm170 = (fRec71[0] - fTempPerm168); + fRec70[0] = (fVec25[(IOTA-int((iTempPerm167 + 1)))&16383] + ((fRec70[1] * (0 - (fTempPerm169 / fTempPerm170))) + ((fTempPerm169 * fVec25[(IOTA-iTempPerm167)&16383]) / fTempPerm170))); fRec13[0] = fRec70[0]; - float fTemp189 = ((fTemp1 * fRec12[1]) + (fTemp169 * fTemp6)); - float fTemp190 = ((fTemp1 * fRec13[1]) + (fTemp175 * fTemp6)); - float fTemp191 = ((6.123234e-17f * fTemp189) - fTemp190); - fVec25[IOTA&16383] = fTemp191; - fRec72[0] = (fSlow52 + (0.999f * ((iSlow51 * iTemp12) + fRec72[1]))); - float fTemp192 = (fRec72[0] + -1.49999f); - int iTemp193 = int(min(8192, max(0, int(fTemp192)))); - float fTemp194 = floorf(fTemp192); - float fTemp195 = (fTemp194 + (2.0f - fRec72[0])); - float fTemp196 = (fRec72[0] - fTemp194); - fRec11[0] = ((((fVec25[(IOTA-iTemp193)&16383] * fTemp195) / fTemp196) + fVec25[(IOTA-int((iTemp193 + 1)))&16383]) + (fRec11[1] * (0 - (fTemp195 / fTemp196)))); + fTempPerm171 = (0 - ((fTempPerm2 * fRec13[1]) + (fTempPerm3 * fTempPerm154))); + fVec26[IOTA&16383] = fTempPerm171; + fRec72[0] = (fSlow53 + (0.999f * ((iSlow52 * iTempPerm14) + fRec72[1]))); + fTempPerm172 = (fRec72[0] + -1.49999f); + iTempPerm173 = int(min(8192, max(0, int(fTempPerm172)))); + fTempPerm174 = floorf(fTempPerm172); + fTempPerm175 = (fTempPerm174 + (2.0f - fRec72[0])); + fTempPerm176 = (fRec72[0] - fTempPerm174); + fRec11[0] = (fVec26[(IOTA-int((iTempPerm173 + 1)))&16383] + ((fRec11[1] * (0 - (fTempPerm175 / fTempPerm176))) + ((fTempPerm175 * fVec26[(IOTA-iTempPerm173)&16383]) / fTempPerm176))); fRec9[0] = fRec11[0]; - float fTemp197 = (fTemp189 + (6.123234e-17f * fTemp190)); - fVec26[IOTA&16383] = fTemp197; - fRec74[0] = (fSlow54 + (0.999f * ((iSlow53 * iTemp12) + fRec74[1]))); - float fTemp198 = (fRec74[0] + -1.49999f); - int iTemp199 = int(min(8192, max(0, int(fTemp198)))); - float fTemp200 = floorf(fTemp198); - float fTemp201 = (fTemp200 + (2.0f - fRec74[0])); - float fTemp202 = (fRec74[0] - fTemp200); - fRec73[0] = (fVec26[(IOTA-int((iTemp199 + 1)))&16383] + ((fRec73[1] * (0 - (fTemp201 / fTemp202))) + ((fTemp201 * fVec26[(IOTA-iTemp199)&16383]) / fTemp202))); + fTempPerm177 = ((fTempPerm2 * fRec12[1]) + (fTempPerm3 * fTempPerm164)); + fVec27[IOTA&16383] = fTempPerm177; + fRec74[0] = (fSlow55 + (0.999f * ((iSlow54 * iTempPerm14) + fRec74[1]))); + fTempPerm178 = (fRec74[0] + -1.49999f); + iTempPerm179 = int(min(8192, max(0, int(fTempPerm178)))); + fTempPerm180 = floorf(fTempPerm178); + fTempPerm181 = (fTempPerm180 + (2.0f - fRec74[0])); + fTempPerm182 = (fRec74[0] - fTempPerm180); + fRec73[0] = (fVec27[(IOTA-int((iTempPerm179 + 1)))&16383] + ((fRec73[1] * (0 - (fTempPerm181 / fTempPerm182))) + ((fTempPerm181 * fVec27[(IOTA-iTempPerm179)&16383]) / fTempPerm182))); fRec10[0] = fRec73[0]; - float fTemp203 = ((fTemp1 * fRec9[1]) + (fTemp168 * fTemp6)); - float fTemp204 = ((fTemp1 * fRec10[1]) + (fTemp174 * fTemp6)); - float fTemp205 = ((6.123234e-17f * fTemp203) - fTemp204); - fVec27[IOTA&16383] = fTemp205; - fRec75[0] = (fSlow57 + (0.999f * ((iSlow56 * iTemp12) + fRec75[1]))); - float fTemp206 = (fRec75[0] + -1.49999f); - int iTemp207 = int(min(8192, max(0, int(fTemp206)))); - float fTemp208 = floorf(fTemp206); - float fTemp209 = (fTemp208 + (2.0f - fRec75[0])); - float fTemp210 = (fRec75[0] - fTemp208); - fRec8[0] = ((((fVec27[(IOTA-iTemp207)&16383] * fTemp209) / fTemp210) + fVec27[(IOTA-int((iTemp207 + 1)))&16383]) + (fRec8[1] * (0 - (fTemp209 / fTemp210)))); + fTempPerm183 = (0 - ((fTempPerm2 * fRec10[1]) + (fTempPerm3 * fTempPerm153))); + fVec28[IOTA&16383] = fTempPerm183; + fRec75[0] = (fSlow58 + (0.999f * ((iSlow57 * iTempPerm14) + fRec75[1]))); + fTempPerm184 = (fRec75[0] + -1.49999f); + iTempPerm185 = int(min(8192, max(0, int(fTempPerm184)))); + fTempPerm186 = floorf(fTempPerm184); + fTempPerm187 = (fTempPerm186 + (2.0f - fRec75[0])); + fTempPerm188 = (fRec75[0] - fTempPerm186); + fRec8[0] = (fVec28[(IOTA-int((iTempPerm185 + 1)))&16383] + ((fRec8[1] * (0 - (fTempPerm187 / fTempPerm188))) + ((fTempPerm187 * fVec28[(IOTA-iTempPerm185)&16383]) / fTempPerm188))); fRec6[0] = fRec8[0]; - float fTemp211 = (fTemp203 + (6.123234e-17f * fTemp204)); - fVec28[IOTA&16383] = fTemp211; - fRec77[0] = (fSlow59 + (0.999f * ((iSlow58 * iTemp12) + fRec77[1]))); - float fTemp212 = (fRec77[0] + -1.49999f); - int iTemp213 = int(min(8192, max(0, int(fTemp212)))); - float fTemp214 = floorf(fTemp212); - float fTemp215 = (fTemp214 + (2.0f - fRec77[0])); - float fTemp216 = (fRec77[0] - fTemp214); - fRec76[0] = (fVec28[(IOTA-int((iTemp213 + 1)))&16383] + ((fRec76[1] * (0 - (fTemp215 / fTemp216))) + ((fTemp215 * fVec28[(IOTA-iTemp213)&16383]) / fTemp216))); + fTempPerm189 = ((fTempPerm2 * fRec9[1]) + (fTempPerm3 * fTempPerm163)); + fVec29[IOTA&16383] = fTempPerm189; + fRec77[0] = (fSlow60 + (0.999f * ((iSlow59 * iTempPerm14) + fRec77[1]))); + fTempPerm190 = (fRec77[0] + -1.49999f); + iTempPerm191 = int(min(8192, max(0, int(fTempPerm190)))); + fTempPerm192 = floorf(fTempPerm190); + fTempPerm193 = (fTempPerm192 + (2.0f - fRec77[0])); + fTempPerm194 = (fRec77[0] - fTempPerm192); + fRec76[0] = (fVec29[(IOTA-int((iTempPerm191 + 1)))&16383] + ((fRec76[1] * (0 - (fTempPerm193 / fTempPerm194))) + ((fTempPerm193 * fVec29[(IOTA-iTempPerm191)&16383]) / fTempPerm194))); fRec7[0] = fRec76[0]; - float fTemp217 = ((fTemp1 * fRec6[1]) + (fTemp167 * fTemp6)); - float fTemp218 = ((fTemp1 * fRec7[1]) + (fTemp173 * fTemp6)); - float fTemp219 = ((6.123234e-17f * fTemp217) - fTemp218); - fVec29[IOTA&16383] = fTemp219; - fRec78[0] = (fSlow62 + (0.999f * ((iSlow61 * iTemp12) + fRec78[1]))); - float fTemp220 = (fRec78[0] + -1.49999f); - int iTemp221 = int(min(8192, max(0, int(fTemp220)))); - float fTemp222 = floorf(fTemp220); - float fTemp223 = (fTemp222 + (2.0f - fRec78[0])); - float fTemp224 = (fRec78[0] - fTemp222); - fRec5[0] = ((((fVec29[(IOTA-iTemp221)&16383] * fTemp223) / fTemp224) + fVec29[(IOTA-int((iTemp221 + 1)))&16383]) + (fRec5[1] * (0 - (fTemp223 / fTemp224)))); + fTempPerm195 = (0 - ((fTempPerm2 * fRec7[1]) + (fTempPerm3 * fTempPerm152))); + fVec30[IOTA&16383] = fTempPerm195; + fRec78[0] = (fSlow63 + (0.999f * ((iSlow62 * iTempPerm14) + fRec78[1]))); + fTempPerm196 = (fRec78[0] + -1.49999f); + iTempPerm197 = int(min(8192, max(0, int(fTempPerm196)))); + fTempPerm198 = floorf(fTempPerm196); + fTempPerm199 = (fTempPerm198 + (2.0f - fRec78[0])); + fTempPerm200 = (fRec78[0] - fTempPerm198); + fRec5[0] = (fVec30[(IOTA-int((iTempPerm197 + 1)))&16383] + ((fRec5[1] * (0 - (fTempPerm199 / fTempPerm200))) + ((fTempPerm199 * fVec30[(IOTA-iTempPerm197)&16383]) / fTempPerm200))); fRec3[0] = fRec5[0]; - float fTemp225 = (fTemp217 + (6.123234e-17f * fTemp218)); - fVec30[IOTA&16383] = fTemp225; - fRec80[0] = (fSlow64 + (0.999f * ((iSlow63 * iTemp12) + fRec80[1]))); - float fTemp226 = (fRec80[0] + -1.49999f); - int iTemp227 = int(min(8192, max(0, int(fTemp226)))); - float fTemp228 = floorf(fTemp226); - float fTemp229 = (fTemp228 + (2.0f - fRec80[0])); - float fTemp230 = (fRec80[0] - fTemp228); - fRec79[0] = (fVec30[(IOTA-int((iTemp227 + 1)))&16383] + ((fRec79[1] * (0 - (fTemp229 / fTemp230))) + ((fTemp229 * fVec30[(IOTA-iTemp227)&16383]) / fTemp230))); + fTempPerm201 = ((fTempPerm2 * fRec6[1]) + (fTempPerm3 * fTempPerm162)); + fVec31[IOTA&16383] = fTempPerm201; + fRec80[0] = (fSlow65 + (0.999f * ((iSlow64 * iTempPerm14) + fRec80[1]))); + fTempPerm202 = (fRec80[0] + -1.49999f); + iTempPerm203 = int(min(8192, max(0, int(fTempPerm202)))); + fTempPerm204 = floorf(fTempPerm202); + fTempPerm205 = (fTempPerm204 + (2.0f - fRec80[0])); + fTempPerm206 = (fRec80[0] - fTempPerm204); + fRec79[0] = (fVec31[(IOTA-int((iTempPerm203 + 1)))&16383] + ((fRec79[1] * (0 - (fTempPerm205 / fTempPerm206))) + ((fTempPerm205 * fVec31[(IOTA-iTempPerm203)&16383]) / fTempPerm206))); fRec4[0] = fRec79[0]; - fVec31[0] = fSlow65; - float fTemp231 = (fSlow65 + fVec31[1]); - float fTemp232 = (1.0f - (0.5f * fTemp231)); - fRec2[0] = ((((fTemp1 * fRec3[1]) + (fTemp166 * fTemp6)) * fTemp232) + (0.5f * (fTemp231 * fRec2[1]))); + fTempPerm207 = (1.0f - (0.5f * fTempPerm0)); + fRec2[0] = ((0.5f * (fTempPerm0 * fRec2[1])) + (((fTempPerm2 * fRec3[1]) + (fTempPerm3 * fTempPerm161)) * fTempPerm207)); fRec0[IOTA&1023] = fRec2[0]; - fRec81[0] = ((0.5f * (fTemp231 * fRec81[1])) + (fTemp232 * ((fTemp172 * fTemp6) + (fTemp1 * fRec4[1])))); + fRec81[0] = ((0.5f * (fTempPerm0 * fRec81[1])) + (fTempPerm207 * ((fTempPerm2 * fRec4[1]) + (fTempPerm3 * fTempPerm151)))); fRec1[IOTA&1023] = fRec81[0]; output0[i] = (FAUSTFLOAT)fRec0[(IOTA-0)&1023]; output1[i] = (FAUSTFLOAT)fRec1[(IOTA-0)&1023]; // post processing fRec81[1] = fRec81[0]; fRec2[1] = fRec2[0]; - fVec31[1] = fVec31[0]; fRec4[1] = fRec4[0]; fRec79[1] = fRec79[0]; fRec80[1] = fRec80[0]; @@ -1004,38 +1405,39 @@ class mydsp : public dsp { fRec24[1] = fRec24[0]; fRec26[1] = fRec26[0]; fRec57[1] = fRec57[0]; - fRec28[1] = fRec28[0]; + fRec34[1] = fRec34[0]; fRec55[1] = fRec55[0]; fRec56[1] = fRec56[0]; - fRec27[1] = fRec27[0]; - fRec29[1] = fRec29[0]; + fRec33[1] = fRec33[0]; + fRec35[1] = fRec35[0]; fRec54[1] = fRec54[0]; - fRec31[1] = fRec31[0]; + fRec37[1] = fRec37[0]; fRec52[1] = fRec52[0]; fRec53[1] = fRec53[0]; - fRec30[1] = fRec30[0]; - fRec32[1] = fRec32[0]; + fRec36[1] = fRec36[0]; + fRec38[1] = fRec38[0]; fRec51[1] = fRec51[0]; - fRec34[1] = fRec34[0]; + fRec40[1] = fRec40[0]; fRec49[1] = fRec49[0]; fRec50[1] = fRec50[0]; - fRec33[1] = fRec33[0]; - fRec35[1] = fRec35[0]; + fRec39[1] = fRec39[0]; + fRec41[1] = fRec41[0]; fRec48[1] = fRec48[0]; - fRec37[1] = fRec37[0]; + fRec43[1] = fRec43[0]; fRec46[1] = fRec46[0]; fRec47[1] = fRec47[0]; - fRec36[1] = fRec36[0]; - fRec38[1] = fRec38[0]; - fRec45[1] = fRec45[0]; - fVec5[1] = fVec5[0]; - fRec44[1] = fRec44[0]; - fRec43[1] = fRec43[0]; fRec42[1] = fRec42[0]; - fRec41[1] = fRec41[0]; + fRec44[1] = fRec44[0]; + fRec45[1] = fRec45[0]; + fRec32[1] = fRec32[0]; + fRec31[1] = fRec31[0]; + fRec30[1] = fRec30[0]; + fRec29[1] = fRec29[0]; IOTA = IOTA+1; - fRec40[1] = fRec40[0]; - fRec39[1] = fRec39[0]; + fRec28[1] = fRec28[0]; + fRec27[1] = fRec27[0]; + fVec5[1] = fVec5[0]; + fVec4[1] = fVec4[0]; fVec3[1] = fVec3[0]; fVec2[1] = fVec2[0]; iVec1[1] = iVec1[0]; @@ -1087,7 +1489,7 @@ static std::string normalizeClassName(const std::string& name); void initState(const std::string& name, int sampleRate) { - g_unitName = strdup(name.c_str()); + g_unitName = STRDUP(name.c_str()); mydsp* dsp = new FAUSTCLASS; ControlCounter* cc = new ControlCounter; @@ -1170,9 +1572,9 @@ inline static void copyBuffer(float* dst, int n, float* src) inline static void Faust_updateControls(Faust* unit) { Control* controls = unit->mControls; - int numControls = unit->mNumControls; - int curControl = unit->mDSP->getNumInputs(); - for (int i=0; i < numControls; ++i) { + size_t numControls = unit->mNumControls; + int curControl = unit->mDSP->getNumInputs(); + for (int i = 0; i < numControls; ++i) { float value = IN0(curControl); (controls++)->update(value); curControl++; @@ -1374,4 +1776,10 @@ FAUST_EXPORT void load(InterfaceTable* inTable) #endif // NDEBUG } +#ifdef SUPERNOVA +extern "C" FAUST_EXPORT int server_type(void) { return sc_server_supernova; } +#else +extern "C" FAUST_EXPORT int server_type(void) { return sc_server_scsynth; } +#endif + // EOF diff --git a/source/DEINDUGens/JPverbRaw.cpp b/source/DEINDUGens/JPverbRaw.cpp index 013752dc7f..a3fd04b5fd 100644 --- a/source/DEINDUGens/JPverbRaw.cpp +++ b/source/DEINDUGens/JPverbRaw.cpp @@ -1,11 +1,11 @@ //---------------------------------------------------------- -// copyright: "(c) Julian Parker 2013" // name: "JPverbRaw" // version: "1.1" // author: "Julian Parker, bug fixes by Till Bovermann" // license: "GPL2+" +// copyright: "(c) Julian Parker 2013" // -// Code generated with Faust 0.9.98 (http://faust.grame.fr) +// Code generated with Faust 0.12.0 (http://faust.grame.fr) //---------------------------------------------------------- /* link with : "primes" */ @@ -23,11 +23,6 @@ template <> inline float faustpower<0>(float x) { return 1; } template <> inline float faustpower<1>(float x) { return x; } template <> inline float faustpower<2>(float x) { return x*x; } #endif -// If other than 'faust2sc --prefix Faust' is used, sed this as well: -#if !defined(SC_FAUST_PREFIX) -# define SC_FAUST_PREFIX "Faust" -#endif - //------------------------------------------------------------------- // FAUST architecture file for SuperCollider. // Copyright (C) 2005-2012 Stefan Kersten. @@ -48,6 +43,11 @@ template <> inline float faustpower<2>(float x) { return x*x; } // 02111-1307 USA //------------------------------------------------------------------- +// If other than 'faust2sc --prefix Faust' is used, sed this as well: +#if !defined(SC_FAUST_PREFIX) +#define SC_FAUST_PREFIX "Faust" +#endif + #include #include #include @@ -60,9 +60,15 @@ template <> inline float faustpower<2>(float x) { return x*x; } using namespace std; #if defined(__GNUC__) && __GNUC__ >= 4 -# define FAUST_EXPORT __attribute__((visibility("default"))) + #define FAUST_EXPORT __attribute__((visibility("default"))) +#else + #define FAUST_EXPORT SC_API_EXPORT +#endif + +#ifdef WIN32 + #define STRDUP _strdup #else -# define FAUST_EXPORT SC_API_EXPORT + #define STRDUP strdup #endif //---------------------------------------------------------------------------- @@ -234,118 +240,367 @@ class mydsp : public dsp { int iVec0[2]; FAUSTFLOAT fslider1; FAUSTFLOAT fslider2; - FAUSTFLOAT fslider3; - FAUSTFLOAT fslider4; float fConst0; float fConst1; + FAUSTFLOAT fslider3; + float fRec15[2]; + int iTempPerm0; + float fRec16[2]; + float fTempPerm1; + float fTempPerm2; + float fTempPerm3; + float fTempPerm4; + float fTempPerm5; + FAUSTFLOAT fslider4; FAUSTFLOAT fslider5; - float fRec45[2]; + FAUSTFLOAT fslider6; + float fConst2; + FAUSTFLOAT fslider7; + float fTempPerm6; + float fTempPerm7; + float fTempPerm8; int IOTA; float fVec1[16384]; + float fRec53[2]; + float fTempPerm9; + int iTempPerm10; + float fTempPerm11; + float fTempPerm12; + float fTempPerm13; float fRec52[2]; - float fRec51[2]; - float fRec49[2]; + float fRec50[2]; + float fTempPerm14; float fVec2[16384]; + float fRec55[2]; + float fTempPerm15; + int iTempPerm16; + float fTempPerm17; + float fTempPerm18; + float fTempPerm19; float fRec54[2]; - float fRec53[2]; - float fRec50[2]; + float fRec51[2]; + float fTempPerm20; + float fTempPerm21; + float fTempPerm22; + float fTempPerm23; + float fTempPerm24; float fVec3[16384]; - float fRec55[2]; - float fRec48[2]; - float fRec46[2]; - float fVec4[16384]; - float fRec57[2]; float fRec56[2]; + float fTempPerm25; + int iTempPerm26; + float fTempPerm27; + float fTempPerm28; + float fTempPerm29; + float fRec49[2]; float fRec47[2]; + float fTempPerm30; + float fVec4[16384]; + float fRec58[2]; + float fTempPerm31; + int iTempPerm32; + float fTempPerm33; + float fTempPerm34; + float fTempPerm35; + float fRec57[2]; + float fRec48[2]; + float fTempPerm36; + float fTempPerm37; + float fTempPerm38; + float fTempPerm39; + float fTempPerm40; float fVec5[16384]; + float fRec59[2]; + float fTempPerm41; + int iTempPerm42; + float fTempPerm43; + float fTempPerm44; + float fTempPerm45; + float fRec46[2]; float fRec44[2]; - float fRec42[2]; + float fTempPerm46; float fVec6[16384]; - float fRec59[2]; - float fRec58[2]; - float fRec43[2]; - float fVec7[16384]; + float fRec61[2]; + float fTempPerm47; + int iTempPerm48; + float fTempPerm49; + float fTempPerm50; + float fTempPerm51; float fRec60[2]; + float fRec45[2]; + float fTempPerm52; + float fTempPerm53; + float fTempPerm54; + float fTempPerm55; + float fTempPerm56; + float fVec7[16384]; + float fRec62[2]; + float fTempPerm57; + int iTempPerm58; + float fTempPerm59; + float fTempPerm60; + float fTempPerm61; + float fRec43[2]; float fRec41[2]; - float fRec39[2]; + float fTempPerm62; float fVec8[16384]; - float fRec62[2]; - float fRec61[2]; - float fRec40[2]; - float fVec9[16384]; + float fRec64[2]; + float fTempPerm63; + int iTempPerm64; + float fTempPerm65; + float fTempPerm66; + float fTempPerm67; float fRec63[2]; - float fRec38[2]; - float fRec36[2]; + float fRec42[2]; + float fTempPerm68; + float fTempPerm69; + float fTempPerm70; + float fTempPerm71; + float fTempPerm72; + float fVec9[16384]; float fRec65[2]; + float fTempPerm73; + int iTempPerm74; + float fTempPerm75; + float fTempPerm76; + float fTempPerm77; + float fRec40[2]; + float fRec38[2]; + float fTempPerm78; float fVec10[16384]; - float fRec64[2]; - float fRec37[2]; - float fVec11[1024]; - FAUSTFLOAT fslider6; - float fConst2; - FAUSTFLOAT fslider7; - float fRec66[2]; float fRec67[2]; + float fTempPerm79; + int iTempPerm80; + float fTempPerm81; + float fTempPerm82; + float fTempPerm83; + float fRec66[2]; + float fRec39[2]; + float fTempPerm84; + float fVec11[1024]; + float fTempPerm85; + float fTempPerm86; + int iTempPerm87; + int iTempPerm88; + float fTempPerm89; + float fTempPerm90; + float fTempPerm91; + float fTempPerm92; + float fTempPerm93; + float fTempPerm94; + float fTempPerm95; + float fTempPerm96; + float fTempPerm97; + float fTempPerm98; + int iTempPerm99; + float fTempPerm100; + float fTempPerm101; + float fTempPerm102; + int iTempPerm103; + float fTempPerm104; + float fTempPerm105; + float fTempPerm106; + int iTempPerm107; + float fTempPerm108; + int iTempPerm109; + float fTempPerm110; float fVec12[16384]; float fRec68[2]; - float fRec35[2]; + float fTempPerm111; + int iTempPerm112; + float fTempPerm113; + float fTempPerm114; + float fTempPerm115; + float fRec37[2]; + float fTempPerm116; + float fTempPerm117; float fVec13[1024]; + float fTempPerm118; + float fTempPerm119; + int iTempPerm120; + float fTempPerm121; + float fTempPerm122; + float fTempPerm123; + float fTempPerm124; + float fTempPerm125; + float fTempPerm126; + float fTempPerm127; float fVec14[16384]; float fRec70[2]; + float fTempPerm128; + int iTempPerm129; + float fTempPerm130; + float fTempPerm131; + float fTempPerm132; float fRec69[2]; + float fTempPerm133; + float fTempPerm134; float fVec15[16384]; float fRec71[2]; + float fTempPerm135; + int iTempPerm136; + float fTempPerm137; + float fTempPerm138; + float fTempPerm139; + float fRec36[2]; float fRec34[2]; - float fRec32[2]; + float fTempPerm140; float fVec16[16384]; float fRec73[2]; + float fTempPerm141; + int iTempPerm142; + float fTempPerm143; + float fTempPerm144; + float fTempPerm145; float fRec72[2]; - float fRec33[2]; + float fRec35[2]; + float fTempPerm146; + float fTempPerm147; + float fTempPerm148; + float fTempPerm149; + float fTempPerm150; float fVec17[16384]; float fRec74[2]; + float fTempPerm151; + int iTempPerm152; + float fTempPerm153; + float fTempPerm154; + float fTempPerm155; + float fRec33[2]; float fRec31[2]; - float fRec29[2]; + float fTempPerm156; float fVec18[16384]; float fRec76[2]; + float fTempPerm157; + int iTempPerm158; + int iTempPerm159; + float fTempPerm160; + float fTempPerm161; + float fTempPerm162; + float fTempPerm163; float fRec75[2]; - float fRec30[2]; + float fRec32[2]; + float fTempPerm164; + float fTempPerm165; + float fTempPerm166; + float fTempPerm167; + float fTempPerm168; float fVec19[16384]; float fRec77[2]; + float fTempPerm169; + int iTempPerm170; + float fTempPerm171; + float fTempPerm172; + float fTempPerm173; + float fRec30[2]; float fRec28[2]; - float fRec26[2]; + float fTempPerm174; float fVec20[16384]; float fRec79[2]; + float fTempPerm175; + int iTempPerm176; + int iTempPerm177; + float fTempPerm178; + float fTempPerm179; + float fTempPerm180; + float fTempPerm181; float fRec78[2]; - float fRec27[2]; + float fRec29[2]; + float fTempPerm182; + float fTempPerm183; + float fTempPerm184; + float fTempPerm185; + float fTempPerm186; float fVec21[16384]; float fRec80[2]; + float fTempPerm187; + int iTempPerm188; + int iTempPerm189; + float fTempPerm190; + float fTempPerm191; + float fTempPerm192; + float fTempPerm193; + float fRec27[2]; float fRec25[2]; - float fRec23[2]; + float fTempPerm194; float fVec22[16384]; float fRec82[2]; + float fTempPerm195; + int iTempPerm196; + int iTempPerm197; + float fTempPerm198; + float fTempPerm199; + float fTempPerm200; + float fTempPerm201; float fRec81[2]; - float fRec24[2]; + float fRec26[2]; + float fTempPerm202; + float fTempPerm203; + float fTempPerm204; + float fTempPerm205; + float fTempPerm206; float fVec23[16384]; float fRec83[2]; + float fTempPerm207; + int iTempPerm208; + float fTempPerm209; + float fTempPerm210; + float fTempPerm211; + float fRec24[2]; float fRec22[2]; - float fRec20[2]; + float fTempPerm212; float fVec24[16384]; float fRec85[2]; + float fTempPerm213; + int iTempPerm214; + int iTempPerm215; + float fTempPerm216; + float fTempPerm217; + float fTempPerm218; + float fTempPerm219; float fRec84[2]; - float fRec21[2]; + float fRec23[2]; + float fTempPerm220; float fVec25[16384]; + int iTempPerm221; + int iTempPerm222; + float fTempPerm223; + float fTempPerm224; + float fTempPerm225; + float fTempPerm226; + float fTempPerm227; + float fTempPerm228; + int iTempPerm229; + float fTempPerm230; + float fTempPerm231; + float fTempPerm232; + int iTempPerm233; + float fTempPerm234; + float fTempPerm235; + int iTempPerm236; + float fTempPerm237; + int iTempPerm238; + float fTempPerm239; + float fTempPerm240; float fVec26[16384]; float fRec86[2]; - float fRec19[2]; - float fRec18[2]; - float fRec17[3]; - float fRec16[3]; + float fTempPerm241; + int iTempPerm242; + float fTempPerm243; + float fTempPerm244; + float fTempPerm245; + float fRec21[2]; + float fRec20[2]; + float fRec19[3]; + float fRec18[3]; FAUSTFLOAT fslider8; - float fRec15[3]; + float fTempPerm246; + float fRec17[3]; FAUSTFLOAT fslider9; float fRec92[2]; float fRec91[3]; float fRec90[3]; + float fTempPerm247; + float fTempPerm248; float fVec27[2]; float fRec89[2]; float fRec88[3]; @@ -354,19 +609,40 @@ class mydsp : public dsp { float fRec95[2]; float fRec94[3]; float fRec93[3]; + float fTempPerm249; float fVec28[1024]; float fRec14[2]; + float fTempPerm250; + float fTempPerm251; float fVec29[16384]; + float fTempPerm252; + float fTempPerm253; + int iTempPerm254; + float fTempPerm255; + float fTempPerm256; + float fTempPerm257; + float fTempPerm258; + float fTempPerm259; + float fTempPerm260; + float fTempPerm261; float fVec30[16384]; float fRec102[2]; + float fTempPerm262; + int iTempPerm263; + float fTempPerm264; + float fTempPerm265; + float fTempPerm266; float fRec101[2]; float fRec100[2]; float fRec99[3]; float fRec98[3]; + float fTempPerm267; float fRec97[3]; float fRec108[2]; float fRec107[3]; float fRec106[3]; + float fTempPerm268; + float fTempPerm269; float fVec31[2]; float fRec105[2]; float fRec104[3]; @@ -374,32 +650,69 @@ class mydsp : public dsp { float fRec111[2]; float fRec110[3]; float fRec109[3]; + float fTempPerm270; float fVec32[1024]; float fRec96[2]; + float fTempPerm271; + float fTempPerm272; float fVec33[16384]; float fRec13[2]; float fRec11[2]; + float fTempPerm273; float fVec34[16384]; float fRec113[2]; + float fTempPerm274; + int iTempPerm275; + float fTempPerm276; + float fTempPerm277; + float fTempPerm278; float fRec112[2]; float fRec12[2]; + float fTempPerm279; + float fTempPerm280; + float fTempPerm281; + float fTempPerm282; + float fTempPerm283; float fVec35[16384]; float fRec10[2]; float fRec8[2]; + float fTempPerm284; float fVec36[16384]; float fRec114[2]; float fRec9[2]; + float fTempPerm285; + float fTempPerm286; + float fTempPerm287; + float fTempPerm288; + float fTempPerm289; float fVec37[16384]; float fRec7[2]; float fRec5[2]; + float fTempPerm290; float fVec38[16384]; float fRec116[2]; + float fTempPerm291; + int iTempPerm292; + float fTempPerm293; + float fTempPerm294; + float fTempPerm295; float fRec115[2]; float fRec6[2]; + float fTempPerm296; + float fTempPerm297; + float fTempPerm298; + float fTempPerm299; + float fTempPerm300; float fVec39[16384]; float fRec117[2]; + float fTempPerm301; + int iTempPerm302; + float fTempPerm303; + float fTempPerm304; + float fTempPerm305; float fRec4[2]; float fRec2[2]; + float fTempPerm306; float fVec40[16384]; float fRec118[2]; float fRec3[2]; @@ -409,26 +722,26 @@ class mydsp : public dsp { public: virtual void metadata(Meta* m) { - m->declare("copyright", "(c) Julian Parker 2013"); - m->declare("signals.lib/name", "Faust Signal Routing Library"); - m->declare("signals.lib/version", "0.0"); m->declare("name", "JPverbRaw"); m->declare("version", "1.1"); m->declare("author", "Julian Parker, bug fixes by Till Bovermann"); m->declare("license", "GPL2+"); - m->declare("filters.lib/name", "Faust Filters Library"); - m->declare("filters.lib/version", "0.0"); - m->declare("delays.lib/name", "Faust Delay Library"); - m->declare("delays.lib/version", "0.0"); + m->declare("copyright", "(c) Julian Parker 2013"); m->declare("oscillators.lib/name", "Faust Oscillator Library"); m->declare("oscillators.lib/version", "0.0"); + m->declare("signals.lib/name", "Faust Signal Routing Library"); + m->declare("signals.lib/version", "0.0"); + m->declare("delays.lib/name", "Faust Delay Library"); + m->declare("delays.lib/version", "0.0"); + m->declare("filters.lib/name", "Faust Filters Library"); + m->declare("filters.lib/version", "0.0"); + m->declare("analyzers.lib/name", "Faust Analyzer Library"); + m->declare("analyzers.lib/version", "0.0"); m->declare("maths.lib/name", "Faust Math Library"); - m->declare("maths.lib/version", "2.0"); + m->declare("maths.lib/version", "2.1"); m->declare("maths.lib/author", "GRAME"); m->declare("maths.lib/copyright", "GRAME"); m->declare("maths.lib/license", "LGPL with exception"); - m->declare("analyzers.lib/name", "Faust Analyzer Library"); - m->declare("analyzers.lib/version", "0.0"); m->declare("basics.lib/name", "Faust Basic Element Library"); m->declare("basics.lib/version", "0.0"); } @@ -439,124 +752,431 @@ class mydsp : public dsp { } virtual void instanceConstants(int samplingFreq) { fSamplingFreq = samplingFreq; - fConst0 = min(1.92e+05f, max(1e+03f, (float)fSamplingFreq)); - fConst1 = (3.1415927f / fConst0); - fConst2 = (6.2831855f / fConst0); + fConst0 = min(1.92e+05f, max(1.0f, (float)fSamplingFreq)); + fConst1 = (6.2831855f / fConst0); + iTempPerm0 = 0; + fTempPerm1 = 0; + fTempPerm2 = 0; + fTempPerm3 = 0; + fTempPerm4 = 0; + fTempPerm5 = 0; + fConst2 = (3.1415927f / fConst0); + fTempPerm6 = 0; + fTempPerm7 = 0; + fTempPerm8 = 0; + fTempPerm9 = 0; + iTempPerm10 = 0; + fTempPerm11 = 0; + fTempPerm12 = 0; + fTempPerm13 = 0; + fTempPerm14 = 0; + fTempPerm15 = 0; + iTempPerm16 = 0; + fTempPerm17 = 0; + fTempPerm18 = 0; + fTempPerm19 = 0; + fTempPerm20 = 0; + fTempPerm21 = 0; + fTempPerm22 = 0; + fTempPerm23 = 0; + fTempPerm24 = 0; + fTempPerm25 = 0; + iTempPerm26 = 0; + fTempPerm27 = 0; + fTempPerm28 = 0; + fTempPerm29 = 0; + fTempPerm30 = 0; + fTempPerm31 = 0; + iTempPerm32 = 0; + fTempPerm33 = 0; + fTempPerm34 = 0; + fTempPerm35 = 0; + fTempPerm36 = 0; + fTempPerm37 = 0; + fTempPerm38 = 0; + fTempPerm39 = 0; + fTempPerm40 = 0; + fTempPerm41 = 0; + iTempPerm42 = 0; + fTempPerm43 = 0; + fTempPerm44 = 0; + fTempPerm45 = 0; + fTempPerm46 = 0; + fTempPerm47 = 0; + iTempPerm48 = 0; + fTempPerm49 = 0; + fTempPerm50 = 0; + fTempPerm51 = 0; + fTempPerm52 = 0; + fTempPerm53 = 0; + fTempPerm54 = 0; + fTempPerm55 = 0; + fTempPerm56 = 0; + fTempPerm57 = 0; + iTempPerm58 = 0; + fTempPerm59 = 0; + fTempPerm60 = 0; + fTempPerm61 = 0; + fTempPerm62 = 0; + fTempPerm63 = 0; + iTempPerm64 = 0; + fTempPerm65 = 0; + fTempPerm66 = 0; + fTempPerm67 = 0; + fTempPerm68 = 0; + fTempPerm69 = 0; + fTempPerm70 = 0; + fTempPerm71 = 0; + fTempPerm72 = 0; + fTempPerm73 = 0; + iTempPerm74 = 0; + fTempPerm75 = 0; + fTempPerm76 = 0; + fTempPerm77 = 0; + fTempPerm78 = 0; + fTempPerm79 = 0; + iTempPerm80 = 0; + fTempPerm81 = 0; + fTempPerm82 = 0; + fTempPerm83 = 0; + fTempPerm84 = 0; + fTempPerm85 = 0; + fTempPerm86 = 0; + iTempPerm87 = 0; + iTempPerm88 = 0; + fTempPerm89 = 0; + fTempPerm90 = 0; + fTempPerm91 = 0; + fTempPerm92 = 0; + fTempPerm93 = 0; + fTempPerm94 = 0; + fTempPerm95 = 0; + fTempPerm96 = 0; + fTempPerm97 = 0; + fTempPerm98 = 0; + iTempPerm99 = 0; + fTempPerm100 = 0; + fTempPerm101 = 0; + fTempPerm102 = 0; + iTempPerm103 = 0; + fTempPerm104 = 0; + fTempPerm105 = 0; + fTempPerm106 = 0; + iTempPerm107 = 0; + fTempPerm108 = 0; + iTempPerm109 = 0; + fTempPerm110 = 0; + fTempPerm111 = 0; + iTempPerm112 = 0; + fTempPerm113 = 0; + fTempPerm114 = 0; + fTempPerm115 = 0; + fTempPerm116 = 0; + fTempPerm117 = 0; + fTempPerm118 = 0; + fTempPerm119 = 0; + iTempPerm120 = 0; + fTempPerm121 = 0; + fTempPerm122 = 0; + fTempPerm123 = 0; + fTempPerm124 = 0; + fTempPerm125 = 0; + fTempPerm126 = 0; + fTempPerm127 = 0; + fTempPerm128 = 0; + iTempPerm129 = 0; + fTempPerm130 = 0; + fTempPerm131 = 0; + fTempPerm132 = 0; + fTempPerm133 = 0; + fTempPerm134 = 0; + fTempPerm135 = 0; + iTempPerm136 = 0; + fTempPerm137 = 0; + fTempPerm138 = 0; + fTempPerm139 = 0; + fTempPerm140 = 0; + fTempPerm141 = 0; + iTempPerm142 = 0; + fTempPerm143 = 0; + fTempPerm144 = 0; + fTempPerm145 = 0; + fTempPerm146 = 0; + fTempPerm147 = 0; + fTempPerm148 = 0; + fTempPerm149 = 0; + fTempPerm150 = 0; + fTempPerm151 = 0; + iTempPerm152 = 0; + fTempPerm153 = 0; + fTempPerm154 = 0; + fTempPerm155 = 0; + fTempPerm156 = 0; + fTempPerm157 = 0; + iTempPerm158 = 0; + iTempPerm159 = 0; + fTempPerm160 = 0; + fTempPerm161 = 0; + fTempPerm162 = 0; + fTempPerm163 = 0; + fTempPerm164 = 0; + fTempPerm165 = 0; + fTempPerm166 = 0; + fTempPerm167 = 0; + fTempPerm168 = 0; + fTempPerm169 = 0; + iTempPerm170 = 0; + fTempPerm171 = 0; + fTempPerm172 = 0; + fTempPerm173 = 0; + fTempPerm174 = 0; + fTempPerm175 = 0; + iTempPerm176 = 0; + iTempPerm177 = 0; + fTempPerm178 = 0; + fTempPerm179 = 0; + fTempPerm180 = 0; + fTempPerm181 = 0; + fTempPerm182 = 0; + fTempPerm183 = 0; + fTempPerm184 = 0; + fTempPerm185 = 0; + fTempPerm186 = 0; + fTempPerm187 = 0; + iTempPerm188 = 0; + iTempPerm189 = 0; + fTempPerm190 = 0; + fTempPerm191 = 0; + fTempPerm192 = 0; + fTempPerm193 = 0; + fTempPerm194 = 0; + fTempPerm195 = 0; + iTempPerm196 = 0; + iTempPerm197 = 0; + fTempPerm198 = 0; + fTempPerm199 = 0; + fTempPerm200 = 0; + fTempPerm201 = 0; + fTempPerm202 = 0; + fTempPerm203 = 0; + fTempPerm204 = 0; + fTempPerm205 = 0; + fTempPerm206 = 0; + fTempPerm207 = 0; + iTempPerm208 = 0; + fTempPerm209 = 0; + fTempPerm210 = 0; + fTempPerm211 = 0; + fTempPerm212 = 0; + fTempPerm213 = 0; + iTempPerm214 = 0; + iTempPerm215 = 0; + fTempPerm216 = 0; + fTempPerm217 = 0; + fTempPerm218 = 0; + fTempPerm219 = 0; + fTempPerm220 = 0; + iTempPerm221 = 0; + iTempPerm222 = 0; + fTempPerm223 = 0; + fTempPerm224 = 0; + fTempPerm225 = 0; + fTempPerm226 = 0; + fTempPerm227 = 0; + fTempPerm228 = 0; + iTempPerm229 = 0; + fTempPerm230 = 0; + fTempPerm231 = 0; + fTempPerm232 = 0; + iTempPerm233 = 0; + fTempPerm234 = 0; + fTempPerm235 = 0; + iTempPerm236 = 0; + fTempPerm237 = 0; + iTempPerm238 = 0; + fTempPerm239 = 0; + fTempPerm240 = 0; + fTempPerm241 = 0; + iTempPerm242 = 0; + fTempPerm243 = 0; + fTempPerm244 = 0; + fTempPerm245 = 0; + fTempPerm246 = 0; + fTempPerm247 = 0; + fTempPerm248 = 0; + fTempPerm249 = 0; + fTempPerm250 = 0; + fTempPerm251 = 0; + fTempPerm252 = 0; + fTempPerm253 = 0; + iTempPerm254 = 0; + fTempPerm255 = 0; + fTempPerm256 = 0; + fTempPerm257 = 0; + fTempPerm258 = 0; + fTempPerm259 = 0; + fTempPerm260 = 0; + fTempPerm261 = 0; + fTempPerm262 = 0; + iTempPerm263 = 0; + fTempPerm264 = 0; + fTempPerm265 = 0; + fTempPerm266 = 0; + fTempPerm267 = 0; + fTempPerm268 = 0; + fTempPerm269 = 0; + fTempPerm270 = 0; + fTempPerm271 = 0; + fTempPerm272 = 0; + fTempPerm273 = 0; + fTempPerm274 = 0; + iTempPerm275 = 0; + fTempPerm276 = 0; + fTempPerm277 = 0; + fTempPerm278 = 0; + fTempPerm279 = 0; + fTempPerm280 = 0; + fTempPerm281 = 0; + fTempPerm282 = 0; + fTempPerm283 = 0; + fTempPerm284 = 0; + fTempPerm285 = 0; + fTempPerm286 = 0; + fTempPerm287 = 0; + fTempPerm288 = 0; + fTempPerm289 = 0; + fTempPerm290 = 0; + fTempPerm291 = 0; + iTempPerm292 = 0; + fTempPerm293 = 0; + fTempPerm294 = 0; + fTempPerm295 = 0; + fTempPerm296 = 0; + fTempPerm297 = 0; + fTempPerm298 = 0; + fTempPerm299 = 0; + fTempPerm300 = 0; + fTempPerm301 = 0; + iTempPerm302 = 0; + fTempPerm303 = 0; + fTempPerm304 = 0; + fTempPerm305 = 0; + fTempPerm306 = 0; } virtual void instanceResetUserInterface() { fslider0 = 0.707f; fslider1 = 0.0f; - fslider2 = 1.0f; - fslider3 = 1.0f; + fslider2 = 0.1f; + fslider3 = 2.0f; fslider4 = 1.0f; - fslider5 = 2e+03f; - fslider6 = 0.1f; - fslider7 = 2.0f; + fslider5 = 1.0f; + fslider6 = 1.0f; + fslider7 = 2e+03f; fslider8 = 5e+02f; fslider9 = 1.0f; fslider10 = 1.0f; } virtual void instanceClear() { for (int i=0; i<2; i++) iVec0[i] = 0; - for (int i=0; i<2; i++) fRec45[i] = 0; + for (int i=0; i<2; i++) fRec15[i] = 0; + for (int i=0; i<2; i++) fRec16[i] = 0; IOTA = 0; for (int i=0; i<16384; i++) fVec1[i] = 0; + for (int i=0; i<2; i++) fRec53[i] = 0; for (int i=0; i<2; i++) fRec52[i] = 0; - for (int i=0; i<2; i++) fRec51[i] = 0; - for (int i=0; i<2; i++) fRec49[i] = 0; + for (int i=0; i<2; i++) fRec50[i] = 0; for (int i=0; i<16384; i++) fVec2[i] = 0; + for (int i=0; i<2; i++) fRec55[i] = 0; for (int i=0; i<2; i++) fRec54[i] = 0; - for (int i=0; i<2; i++) fRec53[i] = 0; - for (int i=0; i<2; i++) fRec50[i] = 0; + for (int i=0; i<2; i++) fRec51[i] = 0; for (int i=0; i<16384; i++) fVec3[i] = 0; - for (int i=0; i<2; i++) fRec55[i] = 0; - for (int i=0; i<2; i++) fRec48[i] = 0; - for (int i=0; i<2; i++) fRec46[i] = 0; - for (int i=0; i<16384; i++) fVec4[i] = 0; - for (int i=0; i<2; i++) fRec57[i] = 0; for (int i=0; i<2; i++) fRec56[i] = 0; + for (int i=0; i<2; i++) fRec49[i] = 0; for (int i=0; i<2; i++) fRec47[i] = 0; + for (int i=0; i<16384; i++) fVec4[i] = 0; + for (int i=0; i<2; i++) fRec58[i] = 0; + for (int i=0; i<2; i++) fRec57[i] = 0; + for (int i=0; i<2; i++) fRec48[i] = 0; for (int i=0; i<16384; i++) fVec5[i] = 0; + for (int i=0; i<2; i++) fRec59[i] = 0; + for (int i=0; i<2; i++) fRec46[i] = 0; for (int i=0; i<2; i++) fRec44[i] = 0; - for (int i=0; i<2; i++) fRec42[i] = 0; for (int i=0; i<16384; i++) fVec6[i] = 0; - for (int i=0; i<2; i++) fRec59[i] = 0; - for (int i=0; i<2; i++) fRec58[i] = 0; - for (int i=0; i<2; i++) fRec43[i] = 0; - for (int i=0; i<16384; i++) fVec7[i] = 0; + for (int i=0; i<2; i++) fRec61[i] = 0; for (int i=0; i<2; i++) fRec60[i] = 0; + for (int i=0; i<2; i++) fRec45[i] = 0; + for (int i=0; i<16384; i++) fVec7[i] = 0; + for (int i=0; i<2; i++) fRec62[i] = 0; + for (int i=0; i<2; i++) fRec43[i] = 0; for (int i=0; i<2; i++) fRec41[i] = 0; - for (int i=0; i<2; i++) fRec39[i] = 0; for (int i=0; i<16384; i++) fVec8[i] = 0; - for (int i=0; i<2; i++) fRec62[i] = 0; - for (int i=0; i<2; i++) fRec61[i] = 0; - for (int i=0; i<2; i++) fRec40[i] = 0; - for (int i=0; i<16384; i++) fVec9[i] = 0; + for (int i=0; i<2; i++) fRec64[i] = 0; for (int i=0; i<2; i++) fRec63[i] = 0; - for (int i=0; i<2; i++) fRec38[i] = 0; - for (int i=0; i<2; i++) fRec36[i] = 0; + for (int i=0; i<2; i++) fRec42[i] = 0; + for (int i=0; i<16384; i++) fVec9[i] = 0; for (int i=0; i<2; i++) fRec65[i] = 0; + for (int i=0; i<2; i++) fRec40[i] = 0; + for (int i=0; i<2; i++) fRec38[i] = 0; for (int i=0; i<16384; i++) fVec10[i] = 0; - for (int i=0; i<2; i++) fRec64[i] = 0; - for (int i=0; i<2; i++) fRec37[i] = 0; - for (int i=0; i<1024; i++) fVec11[i] = 0; - for (int i=0; i<2; i++) fRec66[i] = 0; for (int i=0; i<2; i++) fRec67[i] = 0; + for (int i=0; i<2; i++) fRec66[i] = 0; + for (int i=0; i<2; i++) fRec39[i] = 0; + for (int i=0; i<1024; i++) fVec11[i] = 0; for (int i=0; i<16384; i++) fVec12[i] = 0; for (int i=0; i<2; i++) fRec68[i] = 0; - for (int i=0; i<2; i++) fRec35[i] = 0; + for (int i=0; i<2; i++) fRec37[i] = 0; for (int i=0; i<1024; i++) fVec13[i] = 0; for (int i=0; i<16384; i++) fVec14[i] = 0; for (int i=0; i<2; i++) fRec70[i] = 0; for (int i=0; i<2; i++) fRec69[i] = 0; for (int i=0; i<16384; i++) fVec15[i] = 0; for (int i=0; i<2; i++) fRec71[i] = 0; + for (int i=0; i<2; i++) fRec36[i] = 0; for (int i=0; i<2; i++) fRec34[i] = 0; - for (int i=0; i<2; i++) fRec32[i] = 0; for (int i=0; i<16384; i++) fVec16[i] = 0; for (int i=0; i<2; i++) fRec73[i] = 0; for (int i=0; i<2; i++) fRec72[i] = 0; - for (int i=0; i<2; i++) fRec33[i] = 0; + for (int i=0; i<2; i++) fRec35[i] = 0; for (int i=0; i<16384; i++) fVec17[i] = 0; for (int i=0; i<2; i++) fRec74[i] = 0; + for (int i=0; i<2; i++) fRec33[i] = 0; for (int i=0; i<2; i++) fRec31[i] = 0; - for (int i=0; i<2; i++) fRec29[i] = 0; for (int i=0; i<16384; i++) fVec18[i] = 0; for (int i=0; i<2; i++) fRec76[i] = 0; for (int i=0; i<2; i++) fRec75[i] = 0; - for (int i=0; i<2; i++) fRec30[i] = 0; + for (int i=0; i<2; i++) fRec32[i] = 0; for (int i=0; i<16384; i++) fVec19[i] = 0; for (int i=0; i<2; i++) fRec77[i] = 0; + for (int i=0; i<2; i++) fRec30[i] = 0; for (int i=0; i<2; i++) fRec28[i] = 0; - for (int i=0; i<2; i++) fRec26[i] = 0; for (int i=0; i<16384; i++) fVec20[i] = 0; for (int i=0; i<2; i++) fRec79[i] = 0; for (int i=0; i<2; i++) fRec78[i] = 0; - for (int i=0; i<2; i++) fRec27[i] = 0; + for (int i=0; i<2; i++) fRec29[i] = 0; for (int i=0; i<16384; i++) fVec21[i] = 0; for (int i=0; i<2; i++) fRec80[i] = 0; + for (int i=0; i<2; i++) fRec27[i] = 0; for (int i=0; i<2; i++) fRec25[i] = 0; - for (int i=0; i<2; i++) fRec23[i] = 0; for (int i=0; i<16384; i++) fVec22[i] = 0; for (int i=0; i<2; i++) fRec82[i] = 0; for (int i=0; i<2; i++) fRec81[i] = 0; - for (int i=0; i<2; i++) fRec24[i] = 0; + for (int i=0; i<2; i++) fRec26[i] = 0; for (int i=0; i<16384; i++) fVec23[i] = 0; for (int i=0; i<2; i++) fRec83[i] = 0; + for (int i=0; i<2; i++) fRec24[i] = 0; for (int i=0; i<2; i++) fRec22[i] = 0; - for (int i=0; i<2; i++) fRec20[i] = 0; for (int i=0; i<16384; i++) fVec24[i] = 0; for (int i=0; i<2; i++) fRec85[i] = 0; for (int i=0; i<2; i++) fRec84[i] = 0; - for (int i=0; i<2; i++) fRec21[i] = 0; + for (int i=0; i<2; i++) fRec23[i] = 0; for (int i=0; i<16384; i++) fVec25[i] = 0; for (int i=0; i<16384; i++) fVec26[i] = 0; for (int i=0; i<2; i++) fRec86[i] = 0; - for (int i=0; i<2; i++) fRec19[i] = 0; - for (int i=0; i<2; i++) fRec18[i] = 0; + for (int i=0; i<2; i++) fRec21[i] = 0; + for (int i=0; i<2; i++) fRec20[i] = 0; + for (int i=0; i<3; i++) fRec19[i] = 0; + for (int i=0; i<3; i++) fRec18[i] = 0; for (int i=0; i<3; i++) fRec17[i] = 0; - for (int i=0; i<3; i++) fRec16[i] = 0; - for (int i=0; i<3; i++) fRec15[i] = 0; for (int i=0; i<2; i++) fRec92[i] = 0; for (int i=0; i<3; i++) fRec91[i] = 0; for (int i=0; i<3; i++) fRec90[i] = 0; @@ -635,21 +1255,23 @@ class mydsp : public dsp { return fSamplingFreq; } virtual void buildUserInterface(UI* ui_interface) { - ui_interface->openVerticalBox("0x00"); + ui_interface->openVerticalBox("JPverbRaw"); ui_interface->addHorizontalSlider("damp", &fslider1, 0.0f, 0.0f, 0.999f, 0.0001f); ui_interface->addHorizontalSlider("earlyDiff", &fslider0, 0.707f, 0.0f, 0.99f, 0.001f); - ui_interface->addHorizontalSlider("highBand", &fslider5, 2e+03f, 1e+03f, 1e+04f, 0.1f); - ui_interface->addHorizontalSlider("highX", &fslider4, 1.0f, 0.0f, 1.0f, 0.01f); + ui_interface->addHorizontalSlider("highBand", &fslider7, 2e+03f, 1e+03f, 1e+04f, 0.1f); + ui_interface->addHorizontalSlider("highX", &fslider6, 1.0f, 0.0f, 1.0f, 0.01f); ui_interface->addHorizontalSlider("lowBand", &fslider8, 5e+02f, 1e+02f, 6e+03f, 0.1f); ui_interface->addHorizontalSlider("lowX", &fslider10, 1.0f, 0.0f, 1.0f, 0.01f); - ui_interface->addHorizontalSlider("mDepth", &fslider6, 0.1f, 0.0f, 1.0f, 0.001f); - ui_interface->addHorizontalSlider("mFreq", &fslider7, 2.0f, 0.0f, 1e+01f, 0.01f); + ui_interface->addHorizontalSlider("mDepth", &fslider2, 0.1f, 0.0f, 1.0f, 0.001f); + ui_interface->addHorizontalSlider("mFreq", &fslider3, 2.0f, 0.0f, 1e+01f, 0.01f); ui_interface->addHorizontalSlider("midX", &fslider9, 1.0f, 0.0f, 1.0f, 0.01f); - ui_interface->addHorizontalSlider("size", &fslider2, 1.0f, 0.5f, 3.0f, 0.01f); - ui_interface->addHorizontalSlider("t60", &fslider3, 1.0f, 0.1f, 6e+01f, 0.1f); + ui_interface->addHorizontalSlider("size", &fslider4, 1.0f, 0.5f, 3.0f, 0.01f); + ui_interface->addHorizontalSlider("t60", &fslider5, 1.0f, 0.1f, 6e+01f, 0.1f); ui_interface->closeBox(); } virtual void compute (int count, FAUSTFLOAT** input, FAUSTFLOAT** output) { + //zone1 + //zone2 float fSlow0 = float(fslider0); float fSlow1 = cosf(fSlow0); float fSlow2 = sinf(fSlow0); @@ -657,76 +1279,76 @@ class mydsp : public dsp { float fSlow4 = float(fslider1); float fSlow5 = (1.0f - fSlow4); float fSlow6 = float(fslider2); - float fSlow7 = powf(10,(0 - (0.51f * (((1.25f * fSlow6) + -0.25f) / float(fslider3))))); - float fSlow8 = float(fslider4); - float fSlow9 = tanf((fConst1 * float(fslider5))); - float fSlow10 = (1.0f / fSlow9); - float fSlow11 = (((fSlow10 + 0.618034f) / fSlow9) + 1); - float fSlow12 = (1.0f / fSlow11); - float fSlow13 = (1.0f / faustpower<2>(fSlow9)); - float fSlow14 = (2 * (0 - fSlow13)); - float fSlow15 = (1.0f / (((fSlow10 + 1.618034f) / fSlow9) + 1)); - float fSlow16 = (fSlow10 + 1); - float fSlow17 = (1.0f / fSlow16); - int iSlow18 = primes((70 * fSlow6)); - float fSlow19 = (0.0001f * iSlow18); - int iSlow20 = primes((10 * fSlow6)); - float fSlow21 = (0.0001f * iSlow20); - int iSlow22 = primes((110 * fSlow6)); - float fSlow23 = (0.0001f * iSlow22); - int iSlow24 = primes((40 * fSlow6)); + float fSlow7 = (50 * fSlow6); + float fSlow8 = (fConst1 * float(fslider3)); + float fSlow9 = sinf(fSlow8); + float fSlow10 = cosf(fSlow8); + float fSlow11 = (0 - fSlow9); + float fSlow12 = float(fslider4); + float fSlow13 = powf(10,(0 - (0.51f * (((1.25f * fSlow12) + -0.25f) / float(fslider5))))); + float fSlow14 = float(fslider6); + float fSlow15 = tanf((fConst2 * float(fslider7))); + float fSlow16 = (1.0f / fSlow15); + float fSlow17 = (((fSlow16 + 0.618034f) / fSlow15) + 1); + float fSlow18 = (1.0f / fSlow17); + float fSlow19 = (1.0f / faustpower<2>(fSlow15)); + float fSlow20 = (1.0f / (((fSlow16 + 1.618034f) / fSlow15) + 1)); + float fSlow21 = (fSlow16 + 1); + float fSlow22 = (0 - ((1 - fSlow16) / fSlow21)); + float fSlow23 = (1.0f / fSlow21); + int iSlow24 = primes((10 * fSlow12)); float fSlow25 = (0.0001f * iSlow24); - int iSlow26 = primes((140 * fSlow6)); + int iSlow26 = primes((110 * fSlow12)); float fSlow27 = (0.0001f * iSlow26); - int iSlow28 = primes((170 * fSlow6)); + int iSlow28 = primes((40 * fSlow12)); float fSlow29 = (0.0001f * iSlow28); - int iSlow30 = primes((100 * fSlow6)); + int iSlow30 = primes((140 * fSlow12)); float fSlow31 = (0.0001f * iSlow30); - int iSlow32 = primes((200 * fSlow6)); + int iSlow32 = primes((70 * fSlow12)); float fSlow33 = (0.0001f * iSlow32); - int iSlow34 = primes((130 * fSlow6)); + int iSlow34 = primes((170 * fSlow12)); float fSlow35 = (0.0001f * iSlow34); - int iSlow36 = primes((230 * fSlow6)); + int iSlow36 = primes((100 * fSlow12)); float fSlow37 = (0.0001f * iSlow36); - float fSlow38 = float(fslider6); - float fSlow39 = (50 * fSlow38); - float fSlow40 = (fConst2 * float(fslider7)); - float fSlow41 = sinf(fSlow40); - float fSlow42 = cosf(fSlow40); - float fSlow43 = (0 - fSlow41); - int iSlow44 = primes((54 * fSlow6)); + int iSlow38 = primes((200 * fSlow12)); + float fSlow39 = (0.0001f * iSlow38); + int iSlow40 = primes((130 * fSlow12)); + float fSlow41 = (0.0001f * iSlow40); + int iSlow42 = primes((230 * fSlow12)); + float fSlow43 = (0.0001f * iSlow42); + int iSlow44 = primes((54 * fSlow12)); float fSlow45 = (0.005f * iSlow44); - float fSlow46 = (0 - (5e+01f * fSlow38)); - int iSlow47 = primes((204 * fSlow6)); + float fSlow46 = (0 - (5e+01f * fSlow6)); + int iSlow47 = primes((204 * fSlow12)); float fSlow48 = (0.005f * iSlow47); - int iSlow49 = primes((125 * fSlow6)); + int iSlow49 = primes((125 * fSlow12)); float fSlow50 = (0.0001f * iSlow49); - int iSlow51 = primes((25 * fSlow6)); + int iSlow51 = primes((25 * fSlow12)); float fSlow52 = (0.0001f * iSlow51); - int iSlow53 = primes((155 * fSlow6)); + int iSlow53 = primes((155 * fSlow12)); float fSlow54 = (0.0001f * iSlow53); - int iSlow55 = primes((55 * fSlow6)); + int iSlow55 = primes((55 * fSlow12)); float fSlow56 = (0.0001f * iSlow55); - int iSlow57 = primes((185 * fSlow6)); + int iSlow57 = primes((185 * fSlow12)); float fSlow58 = (0.0001f * iSlow57); - int iSlow59 = primes((85 * fSlow6)); + int iSlow59 = primes((85 * fSlow12)); float fSlow60 = (0.0001f * iSlow59); - int iSlow61 = primes((215 * fSlow6)); + int iSlow61 = primes((215 * fSlow12)); float fSlow62 = (0.0001f * iSlow61); - int iSlow63 = primes((115 * fSlow6)); + int iSlow63 = primes((115 * fSlow12)); float fSlow64 = (0.0001f * iSlow63); - int iSlow65 = primes((245 * fSlow6)); + int iSlow65 = primes((245 * fSlow12)); float fSlow66 = (0.0001f * iSlow65); - int iSlow67 = primes((145 * fSlow6)); + int iSlow67 = primes((145 * fSlow12)); float fSlow68 = (0.0001f * iSlow67); - int iSlow69 = primes((134 * fSlow6)); + int iSlow69 = primes((134 * fSlow12)); float fSlow70 = (0.005f * iSlow69); - float fSlow71 = (0 - fSlow10); - float fSlow72 = (0 - ((1 - fSlow10) / fSlow16)); - float fSlow73 = (2 * (1 - fSlow13)); - float fSlow74 = (((fSlow10 + -1.618034f) / fSlow9) + 1); - float fSlow75 = (((fSlow10 + -0.618034f) / fSlow9) + 1); - float fSlow76 = tanf((fConst1 * float(fslider8))); + float fSlow71 = (0 - fSlow16); + float fSlow72 = (2 * (1 - fSlow19)); + float fSlow73 = (((fSlow16 + -1.618034f) / fSlow15) + 1); + float fSlow74 = (2 * (0 - fSlow19)); + float fSlow75 = (((fSlow16 + -0.618034f) / fSlow15) + 1); + float fSlow76 = tanf((fConst2 * float(fslider8))); float fSlow77 = (1.0f / fSlow76); float fSlow78 = (1.0f / (((fSlow77 + 1.618034f) / fSlow76) + 1)); float fSlow79 = (((fSlow77 + -1.618034f) / fSlow76) + 1); @@ -740,491 +1362,493 @@ class mydsp : public dsp { float fSlow87 = (0 - ((1 - fSlow77) / fSlow86)); float fSlow88 = (1.0f / fSlow86); float fSlow89 = (0 - fSlow77); - float fSlow90 = (1.0f / (fSlow11 * fSlow76)); + float fSlow90 = (1.0f / (fSlow76 * fSlow17)); float fSlow91 = (((fSlow77 + -1.618034f) / fSlow76) + 1); float fSlow92 = (((fSlow77 + -0.618034f) / fSlow76) + 1); float fSlow93 = float(fslider10); - int iSlow94 = primes((34 * fSlow6)); + int iSlow94 = primes((34 * fSlow12)); float fSlow95 = (0.005f * iSlow94); - int iSlow96 = primes((240 * fSlow6)); + int iSlow96 = primes((240 * fSlow12)); float fSlow97 = (0.0001f * iSlow96); - int iSlow98 = primes((190 * fSlow6)); + int iSlow98 = primes((190 * fSlow12)); float fSlow99 = (0.0001f * iSlow98); - int iSlow100 = primes((175 * fSlow6)); + int iSlow100 = primes((175 * fSlow12)); float fSlow101 = (0.0001f * iSlow100); + //zone2b + //zone3 FAUSTFLOAT* input0 = input[0]; FAUSTFLOAT* input1 = input[1]; FAUSTFLOAT* output0 = output[0]; FAUSTFLOAT* output1 = output[1]; + //LoopGraphScalar for (int i=0; imControls; - int numControls = unit->mNumControls; - int curControl = unit->mDSP->getNumInputs(); - for (int i=0; i < numControls; ++i) { + size_t numControls = unit->mNumControls; + int curControl = unit->mDSP->getNumInputs(); + for (int i = 0; i < numControls; ++i) { float value = IN0(curControl); (controls++)->update(value); curControl++; @@ -1685,4 +2309,10 @@ FAUST_EXPORT void load(InterfaceTable* inTable) #endif // NDEBUG } +#ifdef SUPERNOVA +extern "C" FAUST_EXPORT int server_type(void) { return sc_server_supernova; } +#else +extern "C" FAUST_EXPORT int server_type(void) { return sc_server_scsynth; } +#endif + // EOF diff --git a/source/DEINDUGens/faust_src/GreyholeRaw.cpp b/source/DEINDUGens/faust_src/GreyholeRaw.cpp index aacd64ef89..9c5a956e53 100644 --- a/source/DEINDUGens/faust_src/GreyholeRaw.cpp +++ b/source/DEINDUGens/faust_src/GreyholeRaw.cpp @@ -1,21 +1,16 @@ //---------------------------------------------------------- +// name: "GreyholeRaw" // version: "1.0" // author: "Julian Parker, bug fixes by Till Bovermann" // license: "GPL2+" -// name: "GreyholeRaw" // copyright: "(c) Julian Parker 2013" // -// Code generated with Faust 0.9.98 (http://faust.grame.fr) +// Code generated with Faust 0.12.0 (http://faust.grame.fr) //---------------------------------------------------------- /* link with : "primes" */ #include #include -// If other than 'faust2sc --prefix Faust' is used, sed this as well: -#if !defined(SC_FAUST_PREFIX) -# define SC_FAUST_PREFIX "Faust" -#endif - //------------------------------------------------------------------- // FAUST architecture file for SuperCollider. // Copyright (C) 2005-2012 Stefan Kersten. @@ -36,6 +31,11 @@ // 02111-1307 USA //------------------------------------------------------------------- +// If other than 'faust2sc --prefix Faust' is used, sed this as well: +#if !defined(SC_FAUST_PREFIX) +#define SC_FAUST_PREFIX "Faust" +#endif + #include #include #include @@ -48,9 +48,15 @@ using namespace std; #if defined(__GNUC__) && __GNUC__ >= 4 -# define FAUST_EXPORT __attribute__((visibility("default"))) + #define FAUST_EXPORT __attribute__((visibility("default"))) #else -# define FAUST_EXPORT SC_API_EXPORT + #define FAUST_EXPORT SC_API_EXPORT +#endif + +#ifdef WIN32 + #define STRDUP _strdup +#else + #define STRDUP strdup #endif //---------------------------------------------------------------------------- @@ -221,124 +227,332 @@ class mydsp : public dsp { FAUSTFLOAT fslider0; float fVec0[2]; int iVec1[2]; - float fConst0; - float fConst1; + float fTempPerm0; FAUSTFLOAT fslider1; float fVec2[2]; - float fConst2; + float fTempPerm1; + float fTempPerm2; + float fTempPerm3; + float fTempPerm4; + float fTempPerm5; + float fTempPerm6; + float fTempPerm7; + float fTempPerm8; FAUSTFLOAT fslider2; float fVec3[2]; - float fRec39[2]; - float fRec40[2]; - int IOTA; - float fVec4[131072]; + float fTempPerm9; + float fConst0; + float fConst1; FAUSTFLOAT fslider3; - float fRec41[2]; - float fRec42[2]; - float fRec43[2]; - float fRec44[2]; + float fVec4[2]; + float fTempPerm10; + float fConst2; FAUSTFLOAT fslider4; float fVec5[2]; + float fTempPerm11; + float fTempPerm12; + float fTempPerm13; + float fRec27[2]; + int iTempPerm14; + float fRec28[2]; + float fTempPerm15; + float fTempPerm16; + int iTempPerm17; + float fTempPerm18; + float fTempPerm19; + float fTempPerm20; + float fTempPerm21; + float fTempPerm22; + float fTempPerm23; + float fTempPerm24; + int IOTA; float fVec6[131072]; - float fVec7[16384]; FAUSTFLOAT fslider5; + float fTempPerm25; + float fRec29[2]; + float fRec30[2]; + float fRec31[2]; + float fRec32[2]; + int iTempPerm26; + int iTempPerm27; + float fTempPerm28; + float fTempPerm29; + float fTempPerm30; + float fTempPerm31; + float fTempPerm32; + float fTempPerm33; + float fVec7[16384]; + FAUSTFLOAT fslider6; float fRec45[2]; - float fRec38[2]; - float fRec36[2]; - float fVec8[16384]; + float fTempPerm34; + int iTempPerm35; + float fTempPerm36; + float fTempPerm37; + float fTempPerm38; + float fRec44[2]; + float fRec42[2]; + float fTempPerm39; + float fTempPerm40; + float fTempPerm41; + float fTempPerm42; + float fTempPerm43; + float fTempPerm44; + float fTempPerm45; + int iTempPerm46; + float fTempPerm47; + float fTempPerm48; + float fVec8[131072]; + float fTempPerm49; + float fTempPerm50; + float fTempPerm51; + float fTempPerm52; + float fTempPerm53; + float fVec9[16384]; float fRec47[2]; + float fTempPerm54; + int iTempPerm55; + float fTempPerm56; + float fTempPerm57; + float fTempPerm58; float fRec46[2]; - float fRec37[2]; - float fVec9[16384]; - float fRec48[2]; - float fRec35[2]; - float fRec33[2]; + float fRec43[2]; + float fTempPerm59; float fVec10[16384]; + float fRec48[2]; + float fTempPerm60; + int iTempPerm61; + float fTempPerm62; + float fTempPerm63; + float fTempPerm64; + float fRec41[2]; + float fRec39[2]; + float fTempPerm65; + float fVec11[16384]; float fRec50[2]; + float fTempPerm66; + int iTempPerm67; + float fTempPerm68; + float fTempPerm69; + float fTempPerm70; float fRec49[2]; - float fRec34[2]; - float fVec11[16384]; - float fRec51[2]; - float fRec32[2]; - float fRec30[2]; + float fRec40[2]; + float fTempPerm71; float fVec12[16384]; + float fRec51[2]; + float fTempPerm72; + int iTempPerm73; + float fTempPerm74; + float fTempPerm75; + float fTempPerm76; + float fRec38[2]; + float fRec36[2]; + float fTempPerm77; + float fVec13[16384]; float fRec53[2]; + float fTempPerm78; + int iTempPerm79; + float fTempPerm80; + float fTempPerm81; + float fTempPerm82; float fRec52[2]; - float fRec31[2]; - float fVec13[16384]; - float fRec54[2]; - float fRec29[2]; - float fRec27[2]; + float fRec37[2]; + float fTempPerm83; float fVec14[16384]; + float fRec54[2]; + float fTempPerm84; + int iTempPerm85; + float fTempPerm86; + float fTempPerm87; + float fTempPerm88; + float fRec35[2]; + float fRec33[2]; + float fTempPerm89; + float fVec15[16384]; float fRec56[2]; + float fTempPerm90; + int iTempPerm91; + float fTempPerm92; + float fTempPerm93; + float fTempPerm94; float fRec55[2]; - float fRec28[2]; - float fVec15[16384]; + float fRec34[2]; + float fTempPerm95; + float fTempPerm96; + float fTempPerm97; + float fTempPerm98; + float fTempPerm99; + float fVec16[16384]; float fRec57[2]; + float fTempPerm100; + int iTempPerm101; + float fTempPerm102; + float fTempPerm103; + float fTempPerm104; float fRec26[2]; float fRec24[2]; - float fVec16[16384]; + float fTempPerm105; + float fTempPerm106; + float fTempPerm107; + float fTempPerm108; + float fTempPerm109; + float fVec17[16384]; float fRec59[2]; + float fTempPerm110; + int iTempPerm111; + float fTempPerm112; + float fTempPerm113; + float fTempPerm114; float fRec58[2]; float fRec25[2]; - float fVec17[16384]; + float fTempPerm115; + float fVec18[16384]; float fRec60[2]; + float fTempPerm116; + int iTempPerm117; + float fTempPerm118; + float fTempPerm119; + float fTempPerm120; float fRec23[2]; float fRec21[2]; - float fVec18[16384]; + float fTempPerm121; + float fVec19[16384]; float fRec62[2]; + float fTempPerm122; + int iTempPerm123; + float fTempPerm124; + float fTempPerm125; + float fTempPerm126; float fRec61[2]; float fRec22[2]; - float fVec19[16384]; + float fTempPerm127; + float fVec20[16384]; float fRec63[2]; + float fTempPerm128; + int iTempPerm129; + float fTempPerm130; + float fTempPerm131; + float fTempPerm132; float fRec20[2]; float fRec18[2]; - float fVec20[16384]; + float fTempPerm133; + float fVec21[16384]; float fRec65[2]; + float fTempPerm134; + int iTempPerm135; + float fTempPerm136; + float fTempPerm137; + float fTempPerm138; float fRec64[2]; float fRec19[2]; - float fVec21[16384]; + float fTempPerm139; + float fVec22[16384]; float fRec66[2]; + float fTempPerm140; + int iTempPerm141; + float fTempPerm142; + float fTempPerm143; + float fTempPerm144; float fRec17[2]; float fRec15[2]; - float fVec22[16384]; + float fTempPerm145; + float fVec23[16384]; float fRec68[2]; + float fTempPerm146; + int iTempPerm147; + float fTempPerm148; + float fTempPerm149; + float fTempPerm150; float fRec67[2]; float fRec16[2]; - float fVec23[16384]; + float fTempPerm151; + float fTempPerm152; + float fTempPerm153; + float fTempPerm154; + float fTempPerm155; + float fVec24[16384]; float fRec69[2]; + float fTempPerm156; + int iTempPerm157; + float fTempPerm158; + float fTempPerm159; + float fTempPerm160; float fRec14[2]; float fRec12[2]; - float fVec24[16384]; + float fTempPerm161; + float fTempPerm162; + float fTempPerm163; + float fTempPerm164; + float fTempPerm165; + float fVec25[16384]; float fRec71[2]; + float fTempPerm166; + int iTempPerm167; + float fTempPerm168; + float fTempPerm169; + float fTempPerm170; float fRec70[2]; float fRec13[2]; - float fVec25[16384]; + float fTempPerm171; + float fVec26[16384]; float fRec72[2]; + float fTempPerm172; + int iTempPerm173; + float fTempPerm174; + float fTempPerm175; + float fTempPerm176; float fRec11[2]; float fRec9[2]; - float fVec26[16384]; + float fTempPerm177; + float fVec27[16384]; float fRec74[2]; + float fTempPerm178; + int iTempPerm179; + float fTempPerm180; + float fTempPerm181; + float fTempPerm182; float fRec73[2]; float fRec10[2]; - float fVec27[16384]; + float fTempPerm183; + float fVec28[16384]; float fRec75[2]; + float fTempPerm184; + int iTempPerm185; + float fTempPerm186; + float fTempPerm187; + float fTempPerm188; float fRec8[2]; float fRec6[2]; - float fVec28[16384]; + float fTempPerm189; + float fVec29[16384]; float fRec77[2]; + float fTempPerm190; + int iTempPerm191; + float fTempPerm192; + float fTempPerm193; + float fTempPerm194; float fRec76[2]; float fRec7[2]; - float fVec29[16384]; + float fTempPerm195; + float fVec30[16384]; float fRec78[2]; + float fTempPerm196; + int iTempPerm197; + float fTempPerm198; + float fTempPerm199; + float fTempPerm200; float fRec5[2]; float fRec3[2]; - float fVec30[16384]; + float fTempPerm201; + float fVec31[16384]; float fRec80[2]; + float fTempPerm202; + int iTempPerm203; + float fTempPerm204; + float fTempPerm205; + float fTempPerm206; float fRec79[2]; float fRec4[2]; - FAUSTFLOAT fslider6; - float fVec31[2]; + float fTempPerm207; float fRec2[2]; float fRec0[1024]; float fRec81[2]; @@ -347,24 +561,24 @@ class mydsp : public dsp { public: virtual void metadata(Meta* m) { + m->declare("name", "GreyholeRaw"); m->declare("version", "1.0"); m->declare("author", "Julian Parker, bug fixes by Till Bovermann"); m->declare("license", "GPL2+"); - m->declare("name", "GreyholeRaw"); + m->declare("copyright", "(c) Julian Parker 2013"); + m->declare("signals.lib/name", "Faust Signal Routing Library"); + m->declare("signals.lib/version", "0.0"); m->declare("maths.lib/name", "Faust Math Library"); - m->declare("maths.lib/version", "2.0"); + m->declare("maths.lib/version", "2.1"); m->declare("maths.lib/author", "GRAME"); m->declare("maths.lib/copyright", "GRAME"); m->declare("maths.lib/license", "LGPL with exception"); m->declare("delays.lib/name", "Faust Delay Library"); m->declare("delays.lib/version", "0.0"); - m->declare("filters.lib/name", "Faust Filters Library"); - m->declare("filters.lib/version", "0.0"); - m->declare("copyright", "(c) Julian Parker 2013"); - m->declare("signals.lib/name", "Faust Signal Routing Library"); - m->declare("signals.lib/version", "0.0"); m->declare("oscillators.lib/name", "Faust Oscillator Library"); m->declare("oscillators.lib/version", "0.0"); + m->declare("filters.lib/name", "Faust Filters Library"); + m->declare("filters.lib/version", "0.0"); m->declare("basics.lib/name", "Faust Basic Element Library"); m->declare("basics.lib/version", "0.0"); } @@ -375,131 +589,339 @@ class mydsp : public dsp { } virtual void instanceConstants(int samplingFreq) { fSamplingFreq = samplingFreq; - fConst0 = min(1.92e+05f, max(1e+03f, (float)fSamplingFreq)); + fTempPerm0 = 0; + fTempPerm1 = 0; + fTempPerm2 = 0; + fTempPerm3 = 0; + fTempPerm4 = 0; + fTempPerm5 = 0; + fTempPerm6 = 0; + fTempPerm7 = 0; + fTempPerm8 = 0; + fTempPerm9 = 0; + fConst0 = min(1.92e+05f, max(1.0f, (float)fSamplingFreq)); fConst1 = (0.00056689343f * fConst0); + fTempPerm10 = 0; fConst2 = (3.1415927f / fConst0); + fTempPerm11 = 0; + fTempPerm12 = 0; + fTempPerm13 = 0; + iTempPerm14 = 0; + fTempPerm15 = 0; + fTempPerm16 = 0; + iTempPerm17 = 0; + fTempPerm18 = 0; + fTempPerm19 = 0; + fTempPerm20 = 0; + fTempPerm21 = 0; + fTempPerm22 = 0; + fTempPerm23 = 0; + fTempPerm24 = 0; + fTempPerm25 = 0; + iTempPerm26 = 0; + iTempPerm27 = 0; + fTempPerm28 = 0; + fTempPerm29 = 0; + fTempPerm30 = 0; + fTempPerm31 = 0; + fTempPerm32 = 0; + fTempPerm33 = 0; + fTempPerm34 = 0; + iTempPerm35 = 0; + fTempPerm36 = 0; + fTempPerm37 = 0; + fTempPerm38 = 0; + fTempPerm39 = 0; + fTempPerm40 = 0; + fTempPerm41 = 0; + fTempPerm42 = 0; + fTempPerm43 = 0; + fTempPerm44 = 0; + fTempPerm45 = 0; + iTempPerm46 = 0; + fTempPerm47 = 0; + fTempPerm48 = 0; + fTempPerm49 = 0; + fTempPerm50 = 0; + fTempPerm51 = 0; + fTempPerm52 = 0; + fTempPerm53 = 0; + fTempPerm54 = 0; + iTempPerm55 = 0; + fTempPerm56 = 0; + fTempPerm57 = 0; + fTempPerm58 = 0; + fTempPerm59 = 0; + fTempPerm60 = 0; + iTempPerm61 = 0; + fTempPerm62 = 0; + fTempPerm63 = 0; + fTempPerm64 = 0; + fTempPerm65 = 0; + fTempPerm66 = 0; + iTempPerm67 = 0; + fTempPerm68 = 0; + fTempPerm69 = 0; + fTempPerm70 = 0; + fTempPerm71 = 0; + fTempPerm72 = 0; + iTempPerm73 = 0; + fTempPerm74 = 0; + fTempPerm75 = 0; + fTempPerm76 = 0; + fTempPerm77 = 0; + fTempPerm78 = 0; + iTempPerm79 = 0; + fTempPerm80 = 0; + fTempPerm81 = 0; + fTempPerm82 = 0; + fTempPerm83 = 0; + fTempPerm84 = 0; + iTempPerm85 = 0; + fTempPerm86 = 0; + fTempPerm87 = 0; + fTempPerm88 = 0; + fTempPerm89 = 0; + fTempPerm90 = 0; + iTempPerm91 = 0; + fTempPerm92 = 0; + fTempPerm93 = 0; + fTempPerm94 = 0; + fTempPerm95 = 0; + fTempPerm96 = 0; + fTempPerm97 = 0; + fTempPerm98 = 0; + fTempPerm99 = 0; + fTempPerm100 = 0; + iTempPerm101 = 0; + fTempPerm102 = 0; + fTempPerm103 = 0; + fTempPerm104 = 0; + fTempPerm105 = 0; + fTempPerm106 = 0; + fTempPerm107 = 0; + fTempPerm108 = 0; + fTempPerm109 = 0; + fTempPerm110 = 0; + iTempPerm111 = 0; + fTempPerm112 = 0; + fTempPerm113 = 0; + fTempPerm114 = 0; + fTempPerm115 = 0; + fTempPerm116 = 0; + iTempPerm117 = 0; + fTempPerm118 = 0; + fTempPerm119 = 0; + fTempPerm120 = 0; + fTempPerm121 = 0; + fTempPerm122 = 0; + iTempPerm123 = 0; + fTempPerm124 = 0; + fTempPerm125 = 0; + fTempPerm126 = 0; + fTempPerm127 = 0; + fTempPerm128 = 0; + iTempPerm129 = 0; + fTempPerm130 = 0; + fTempPerm131 = 0; + fTempPerm132 = 0; + fTempPerm133 = 0; + fTempPerm134 = 0; + iTempPerm135 = 0; + fTempPerm136 = 0; + fTempPerm137 = 0; + fTempPerm138 = 0; + fTempPerm139 = 0; + fTempPerm140 = 0; + iTempPerm141 = 0; + fTempPerm142 = 0; + fTempPerm143 = 0; + fTempPerm144 = 0; + fTempPerm145 = 0; + fTempPerm146 = 0; + iTempPerm147 = 0; + fTempPerm148 = 0; + fTempPerm149 = 0; + fTempPerm150 = 0; + fTempPerm151 = 0; + fTempPerm152 = 0; + fTempPerm153 = 0; + fTempPerm154 = 0; + fTempPerm155 = 0; + fTempPerm156 = 0; + iTempPerm157 = 0; + fTempPerm158 = 0; + fTempPerm159 = 0; + fTempPerm160 = 0; + fTempPerm161 = 0; + fTempPerm162 = 0; + fTempPerm163 = 0; + fTempPerm164 = 0; + fTempPerm165 = 0; + fTempPerm166 = 0; + iTempPerm167 = 0; + fTempPerm168 = 0; + fTempPerm169 = 0; + fTempPerm170 = 0; + fTempPerm171 = 0; + fTempPerm172 = 0; + iTempPerm173 = 0; + fTempPerm174 = 0; + fTempPerm175 = 0; + fTempPerm176 = 0; + fTempPerm177 = 0; + fTempPerm178 = 0; + iTempPerm179 = 0; + fTempPerm180 = 0; + fTempPerm181 = 0; + fTempPerm182 = 0; + fTempPerm183 = 0; + fTempPerm184 = 0; + iTempPerm185 = 0; + fTempPerm186 = 0; + fTempPerm187 = 0; + fTempPerm188 = 0; + fTempPerm189 = 0; + fTempPerm190 = 0; + iTempPerm191 = 0; + fTempPerm192 = 0; + fTempPerm193 = 0; + fTempPerm194 = 0; + fTempPerm195 = 0; + fTempPerm196 = 0; + iTempPerm197 = 0; + fTempPerm198 = 0; + fTempPerm199 = 0; + fTempPerm200 = 0; + fTempPerm201 = 0; + fTempPerm202 = 0; + iTempPerm203 = 0; + fTempPerm204 = 0; + fTempPerm205 = 0; + fTempPerm206 = 0; + fTempPerm207 = 0; } virtual void instanceResetUserInterface() { - fslider0 = 0.5f; - fslider1 = 0.1f; - fslider2 = 2.0f; - fslider3 = 0.2f; - fslider4 = 0.9f; - fslider5 = 1.0f; - fslider6 = 0.0f; + fslider0 = 0.0f; + fslider1 = 0.5f; + fslider2 = 0.9f; + fslider3 = 0.1f; + fslider4 = 2.0f; + fslider5 = 0.2f; + fslider6 = 1.0f; } virtual void instanceClear() { for (int i=0; i<2; i++) fVec0[i] = 0; for (int i=0; i<2; i++) iVec1[i] = 0; for (int i=0; i<2; i++) fVec2[i] = 0; for (int i=0; i<2; i++) fVec3[i] = 0; - for (int i=0; i<2; i++) fRec39[i] = 0; - for (int i=0; i<2; i++) fRec40[i] = 0; - IOTA = 0; - for (int i=0; i<131072; i++) fVec4[i] = 0; - for (int i=0; i<2; i++) fRec41[i] = 0; - for (int i=0; i<2; i++) fRec42[i] = 0; - for (int i=0; i<2; i++) fRec43[i] = 0; - for (int i=0; i<2; i++) fRec44[i] = 0; + for (int i=0; i<2; i++) fVec4[i] = 0; for (int i=0; i<2; i++) fVec5[i] = 0; + for (int i=0; i<2; i++) fRec27[i] = 0; + for (int i=0; i<2; i++) fRec28[i] = 0; + IOTA = 0; for (int i=0; i<131072; i++) fVec6[i] = 0; + for (int i=0; i<2; i++) fRec29[i] = 0; + for (int i=0; i<2; i++) fRec30[i] = 0; + for (int i=0; i<2; i++) fRec31[i] = 0; + for (int i=0; i<2; i++) fRec32[i] = 0; for (int i=0; i<16384; i++) fVec7[i] = 0; for (int i=0; i<2; i++) fRec45[i] = 0; - for (int i=0; i<2; i++) fRec38[i] = 0; - for (int i=0; i<2; i++) fRec36[i] = 0; - for (int i=0; i<16384; i++) fVec8[i] = 0; + for (int i=0; i<2; i++) fRec44[i] = 0; + for (int i=0; i<2; i++) fRec42[i] = 0; + for (int i=0; i<131072; i++) fVec8[i] = 0; + for (int i=0; i<16384; i++) fVec9[i] = 0; for (int i=0; i<2; i++) fRec47[i] = 0; for (int i=0; i<2; i++) fRec46[i] = 0; - for (int i=0; i<2; i++) fRec37[i] = 0; - for (int i=0; i<16384; i++) fVec9[i] = 0; - for (int i=0; i<2; i++) fRec48[i] = 0; - for (int i=0; i<2; i++) fRec35[i] = 0; - for (int i=0; i<2; i++) fRec33[i] = 0; + for (int i=0; i<2; i++) fRec43[i] = 0; for (int i=0; i<16384; i++) fVec10[i] = 0; + for (int i=0; i<2; i++) fRec48[i] = 0; + for (int i=0; i<2; i++) fRec41[i] = 0; + for (int i=0; i<2; i++) fRec39[i] = 0; + for (int i=0; i<16384; i++) fVec11[i] = 0; for (int i=0; i<2; i++) fRec50[i] = 0; for (int i=0; i<2; i++) fRec49[i] = 0; - for (int i=0; i<2; i++) fRec34[i] = 0; - for (int i=0; i<16384; i++) fVec11[i] = 0; - for (int i=0; i<2; i++) fRec51[i] = 0; - for (int i=0; i<2; i++) fRec32[i] = 0; - for (int i=0; i<2; i++) fRec30[i] = 0; + for (int i=0; i<2; i++) fRec40[i] = 0; for (int i=0; i<16384; i++) fVec12[i] = 0; + for (int i=0; i<2; i++) fRec51[i] = 0; + for (int i=0; i<2; i++) fRec38[i] = 0; + for (int i=0; i<2; i++) fRec36[i] = 0; + for (int i=0; i<16384; i++) fVec13[i] = 0; for (int i=0; i<2; i++) fRec53[i] = 0; for (int i=0; i<2; i++) fRec52[i] = 0; - for (int i=0; i<2; i++) fRec31[i] = 0; - for (int i=0; i<16384; i++) fVec13[i] = 0; - for (int i=0; i<2; i++) fRec54[i] = 0; - for (int i=0; i<2; i++) fRec29[i] = 0; - for (int i=0; i<2; i++) fRec27[i] = 0; + for (int i=0; i<2; i++) fRec37[i] = 0; for (int i=0; i<16384; i++) fVec14[i] = 0; + for (int i=0; i<2; i++) fRec54[i] = 0; + for (int i=0; i<2; i++) fRec35[i] = 0; + for (int i=0; i<2; i++) fRec33[i] = 0; + for (int i=0; i<16384; i++) fVec15[i] = 0; for (int i=0; i<2; i++) fRec56[i] = 0; for (int i=0; i<2; i++) fRec55[i] = 0; - for (int i=0; i<2; i++) fRec28[i] = 0; - for (int i=0; i<16384; i++) fVec15[i] = 0; + for (int i=0; i<2; i++) fRec34[i] = 0; + for (int i=0; i<16384; i++) fVec16[i] = 0; for (int i=0; i<2; i++) fRec57[i] = 0; for (int i=0; i<2; i++) fRec26[i] = 0; for (int i=0; i<2; i++) fRec24[i] = 0; - for (int i=0; i<16384; i++) fVec16[i] = 0; + for (int i=0; i<16384; i++) fVec17[i] = 0; for (int i=0; i<2; i++) fRec59[i] = 0; for (int i=0; i<2; i++) fRec58[i] = 0; for (int i=0; i<2; i++) fRec25[i] = 0; - for (int i=0; i<16384; i++) fVec17[i] = 0; + for (int i=0; i<16384; i++) fVec18[i] = 0; for (int i=0; i<2; i++) fRec60[i] = 0; for (int i=0; i<2; i++) fRec23[i] = 0; for (int i=0; i<2; i++) fRec21[i] = 0; - for (int i=0; i<16384; i++) fVec18[i] = 0; + for (int i=0; i<16384; i++) fVec19[i] = 0; for (int i=0; i<2; i++) fRec62[i] = 0; for (int i=0; i<2; i++) fRec61[i] = 0; for (int i=0; i<2; i++) fRec22[i] = 0; - for (int i=0; i<16384; i++) fVec19[i] = 0; + for (int i=0; i<16384; i++) fVec20[i] = 0; for (int i=0; i<2; i++) fRec63[i] = 0; for (int i=0; i<2; i++) fRec20[i] = 0; for (int i=0; i<2; i++) fRec18[i] = 0; - for (int i=0; i<16384; i++) fVec20[i] = 0; + for (int i=0; i<16384; i++) fVec21[i] = 0; for (int i=0; i<2; i++) fRec65[i] = 0; for (int i=0; i<2; i++) fRec64[i] = 0; for (int i=0; i<2; i++) fRec19[i] = 0; - for (int i=0; i<16384; i++) fVec21[i] = 0; + for (int i=0; i<16384; i++) fVec22[i] = 0; for (int i=0; i<2; i++) fRec66[i] = 0; for (int i=0; i<2; i++) fRec17[i] = 0; for (int i=0; i<2; i++) fRec15[i] = 0; - for (int i=0; i<16384; i++) fVec22[i] = 0; + for (int i=0; i<16384; i++) fVec23[i] = 0; for (int i=0; i<2; i++) fRec68[i] = 0; for (int i=0; i<2; i++) fRec67[i] = 0; for (int i=0; i<2; i++) fRec16[i] = 0; - for (int i=0; i<16384; i++) fVec23[i] = 0; + for (int i=0; i<16384; i++) fVec24[i] = 0; for (int i=0; i<2; i++) fRec69[i] = 0; for (int i=0; i<2; i++) fRec14[i] = 0; for (int i=0; i<2; i++) fRec12[i] = 0; - for (int i=0; i<16384; i++) fVec24[i] = 0; + for (int i=0; i<16384; i++) fVec25[i] = 0; for (int i=0; i<2; i++) fRec71[i] = 0; for (int i=0; i<2; i++) fRec70[i] = 0; for (int i=0; i<2; i++) fRec13[i] = 0; - for (int i=0; i<16384; i++) fVec25[i] = 0; + for (int i=0; i<16384; i++) fVec26[i] = 0; for (int i=0; i<2; i++) fRec72[i] = 0; for (int i=0; i<2; i++) fRec11[i] = 0; for (int i=0; i<2; i++) fRec9[i] = 0; - for (int i=0; i<16384; i++) fVec26[i] = 0; + for (int i=0; i<16384; i++) fVec27[i] = 0; for (int i=0; i<2; i++) fRec74[i] = 0; for (int i=0; i<2; i++) fRec73[i] = 0; for (int i=0; i<2; i++) fRec10[i] = 0; - for (int i=0; i<16384; i++) fVec27[i] = 0; + for (int i=0; i<16384; i++) fVec28[i] = 0; for (int i=0; i<2; i++) fRec75[i] = 0; for (int i=0; i<2; i++) fRec8[i] = 0; for (int i=0; i<2; i++) fRec6[i] = 0; - for (int i=0; i<16384; i++) fVec28[i] = 0; + for (int i=0; i<16384; i++) fVec29[i] = 0; for (int i=0; i<2; i++) fRec77[i] = 0; for (int i=0; i<2; i++) fRec76[i] = 0; for (int i=0; i<2; i++) fRec7[i] = 0; - for (int i=0; i<16384; i++) fVec29[i] = 0; + for (int i=0; i<16384; i++) fVec30[i] = 0; for (int i=0; i<2; i++) fRec78[i] = 0; for (int i=0; i<2; i++) fRec5[i] = 0; for (int i=0; i<2; i++) fRec3[i] = 0; - for (int i=0; i<16384; i++) fVec30[i] = 0; + for (int i=0; i<16384; i++) fVec31[i] = 0; for (int i=0; i<2; i++) fRec80[i] = 0; for (int i=0; i<2; i++) fRec79[i] = 0; for (int i=0; i<2; i++) fRec4[i] = 0; - for (int i=0; i<2; i++) fVec31[i] = 0; for (int i=0; i<2; i++) fRec2[i] = 0; for (int i=0; i<1024; i++) fRec0[i] = 0; for (int i=0; i<2; i++) fRec81[i] = 0; @@ -521,441 +943,420 @@ class mydsp : public dsp { return fSamplingFreq; } virtual void buildUserInterface(UI* ui_interface) { - ui_interface->openVerticalBox("0x00"); - ui_interface->addHorizontalSlider("damping", &fslider6, 0.0f, 0.0f, 0.99f, 0.001f); - ui_interface->addHorizontalSlider("delayTime", &fslider3, 0.2f, 0.001f, 1.45f, 0.0001f); - ui_interface->addHorizontalSlider("diffusion", &fslider0, 0.5f, 0.0f, 0.99f, 0.0001f); - ui_interface->addHorizontalSlider("feedback", &fslider4, 0.9f, 0.0f, 1.0f, 0.01f); - ui_interface->addHorizontalSlider("modDepth", &fslider1, 0.1f, 0.0f, 1.0f, 0.001f); - ui_interface->addHorizontalSlider("modFreq", &fslider2, 2.0f, 0.0f, 1e+01f, 0.01f); - ui_interface->addHorizontalSlider("size", &fslider5, 1.0f, 0.5f, 3.0f, 0.0001f); + ui_interface->openVerticalBox("GreyholeRaw"); + ui_interface->addHorizontalSlider("damping", &fslider0, 0.0f, 0.0f, 0.99f, 0.001f); + ui_interface->addHorizontalSlider("delayTime", &fslider5, 0.2f, 0.001f, 1.45f, 0.0001f); + ui_interface->addHorizontalSlider("diffusion", &fslider1, 0.5f, 0.0f, 0.99f, 0.0001f); + ui_interface->addHorizontalSlider("feedback", &fslider2, 0.9f, 0.0f, 1.0f, 0.01f); + ui_interface->addHorizontalSlider("modDepth", &fslider3, 0.1f, 0.0f, 1.0f, 0.001f); + ui_interface->addHorizontalSlider("modFreq", &fslider4, 2.0f, 0.0f, 1e+01f, 0.01f); + ui_interface->addHorizontalSlider("size", &fslider6, 1.0f, 0.5f, 3.0f, 0.0001f); ui_interface->closeBox(); } virtual void compute (int count, FAUSTFLOAT** input, FAUSTFLOAT** output) { + //zone1 + //zone2 float fSlow0 = float(fslider0); float fSlow1 = float(fslider1); float fSlow2 = float(fslider2); - float fSlow3 = floorf(min((float)65533, (fConst0 * float(fslider3)))); + float fSlow3 = float(fslider3); float fSlow4 = float(fslider4); - float fSlow5 = float(fslider5); - float fSlow6 = (49 * fSlow5); - int iSlow7 = primes(fSlow6); - float fSlow8 = (0.0001f * iSlow7); - int iSlow9 = primes((fSlow6 + 10)); - float fSlow10 = (0.0001f * iSlow9); - float fSlow11 = (36 * fSlow5); - int iSlow12 = primes(fSlow11); - float fSlow13 = (0.001f * iSlow12); - int iSlow14 = primes((fSlow11 + 10)); - float fSlow15 = (0.001f * iSlow14); - float fSlow16 = (23 * fSlow5); - int iSlow17 = primes(fSlow16); - float fSlow18 = (0.001f * iSlow17); - int iSlow19 = primes((fSlow16 + 10)); - float fSlow20 = (0.001f * iSlow19); - int iSlow21 = primes((10 * fSlow5)); - float fSlow22 = (0.001f * iSlow21); - int iSlow23 = primes((10 * (fSlow5 + 1))); - float fSlow24 = (0.001f * iSlow23); - float fSlow25 = (68 * fSlow5); - int iSlow26 = primes(fSlow25); - float fSlow27 = (0.0001f * iSlow26); - int iSlow28 = primes((fSlow25 + 10)); - float fSlow29 = (0.0001f * iSlow28); - float fSlow30 = (55 * fSlow5); - int iSlow31 = primes(fSlow30); - float fSlow32 = (0.001f * iSlow31); - int iSlow33 = primes((fSlow30 + 10)); - float fSlow34 = (0.001f * iSlow33); - float fSlow35 = (42 * fSlow5); - int iSlow36 = primes(fSlow35); - float fSlow37 = (0.001f * iSlow36); - int iSlow38 = primes((fSlow35 + 10)); - float fSlow39 = (0.001f * iSlow38); - float fSlow40 = (29 * fSlow5); - int iSlow41 = primes(fSlow40); - float fSlow42 = (0.001f * iSlow41); - int iSlow43 = primes((fSlow40 + 10)); - float fSlow44 = (0.001f * iSlow43); - float fSlow45 = (87 * fSlow5); - int iSlow46 = primes(fSlow45); - float fSlow47 = (0.0001f * iSlow46); - int iSlow48 = primes((fSlow45 + 10)); - float fSlow49 = (0.0001f * iSlow48); - float fSlow50 = (74 * fSlow5); - int iSlow51 = primes(fSlow50); - float fSlow52 = (0.001f * iSlow51); - int iSlow53 = primes((fSlow50 + 10)); - float fSlow54 = (0.001f * iSlow53); - float fSlow55 = (61 * fSlow5); - int iSlow56 = primes(fSlow55); - float fSlow57 = (0.001f * iSlow56); - int iSlow58 = primes((fSlow55 + 10)); - float fSlow59 = (0.001f * iSlow58); - float fSlow60 = (48 * fSlow5); - int iSlow61 = primes(fSlow60); - float fSlow62 = (0.001f * iSlow61); - int iSlow63 = primes((fSlow60 + 10)); - float fSlow64 = (0.001f * iSlow63); - float fSlow65 = float(fslider6); + float fSlow5 = floorf(min((float)65533, (fConst0 * float(fslider5)))); + float fSlow6 = float(fslider6); + float fSlow7 = (49 * fSlow6); + int iSlow8 = primes(fSlow7); + float fSlow9 = (0.0001f * iSlow8); + int iSlow10 = primes((fSlow7 + 10)); + float fSlow11 = (0.0001f * iSlow10); + float fSlow12 = (36 * fSlow6); + int iSlow13 = primes(fSlow12); + float fSlow14 = (0.001f * iSlow13); + int iSlow15 = primes((fSlow12 + 10)); + float fSlow16 = (0.001f * iSlow15); + float fSlow17 = (23 * fSlow6); + int iSlow18 = primes(fSlow17); + float fSlow19 = (0.001f * iSlow18); + int iSlow20 = primes((fSlow17 + 10)); + float fSlow21 = (0.001f * iSlow20); + int iSlow22 = primes((10 * fSlow6)); + float fSlow23 = (0.001f * iSlow22); + int iSlow24 = primes((10 * (fSlow6 + 1))); + float fSlow25 = (0.001f * iSlow24); + float fSlow26 = (68 * fSlow6); + int iSlow27 = primes(fSlow26); + float fSlow28 = (0.0001f * iSlow27); + int iSlow29 = primes((fSlow26 + 10)); + float fSlow30 = (0.0001f * iSlow29); + float fSlow31 = (55 * fSlow6); + int iSlow32 = primes(fSlow31); + float fSlow33 = (0.001f * iSlow32); + int iSlow34 = primes((fSlow31 + 10)); + float fSlow35 = (0.001f * iSlow34); + float fSlow36 = (42 * fSlow6); + int iSlow37 = primes(fSlow36); + float fSlow38 = (0.001f * iSlow37); + int iSlow39 = primes((fSlow36 + 10)); + float fSlow40 = (0.001f * iSlow39); + float fSlow41 = (29 * fSlow6); + int iSlow42 = primes(fSlow41); + float fSlow43 = (0.001f * iSlow42); + int iSlow44 = primes((fSlow41 + 10)); + float fSlow45 = (0.001f * iSlow44); + float fSlow46 = (87 * fSlow6); + int iSlow47 = primes(fSlow46); + float fSlow48 = (0.0001f * iSlow47); + int iSlow49 = primes((fSlow46 + 10)); + float fSlow50 = (0.0001f * iSlow49); + float fSlow51 = (74 * fSlow6); + int iSlow52 = primes(fSlow51); + float fSlow53 = (0.001f * iSlow52); + int iSlow54 = primes((fSlow51 + 10)); + float fSlow55 = (0.001f * iSlow54); + float fSlow56 = (61 * fSlow6); + int iSlow57 = primes(fSlow56); + float fSlow58 = (0.001f * iSlow57); + int iSlow59 = primes((fSlow56 + 10)); + float fSlow60 = (0.001f * iSlow59); + float fSlow61 = (48 * fSlow6); + int iSlow62 = primes(fSlow61); + float fSlow63 = (0.001f * iSlow62); + int iSlow64 = primes((fSlow61 + 10)); + float fSlow65 = (0.001f * iSlow64); + //zone2b + //zone3 FAUSTFLOAT* input0 = input[0]; FAUSTFLOAT* input1 = input[1]; FAUSTFLOAT* output0 = output[0]; FAUSTFLOAT* output1 = output[1]; + //LoopGraphScalar for (int i=0; i 0.0f) & (fRec42[1] < 1.0f))))?fRec41[1]:0):((int(((fRec42[1] == 0.0f) & (fSlow3 != fRec43[1]))))?4.5351473e-05f:((int(((fRec42[1] == 1.0f) & (fSlow3 != fRec44[1]))))?-4.5351473e-05f:0))); - fRec41[0] = fTemp23; - fRec42[0] = max(0.0f, min(1.0f, (fRec42[1] + fTemp23))); - fRec43[0] = ((int(((fRec42[1] >= 1.0f) & (fRec44[1] != fSlow3))))?fSlow3:fRec43[1]); - fRec44[0] = ((int(((fRec42[1] <= 0.0f) & (fRec43[1] != fSlow3))))?fSlow3:fRec44[1]); - int iTemp24 = int(min((float)65536, max((float)0, fRec43[0]))); - float fTemp25 = (1.0f - fRec42[0]); - int iTemp26 = int(min((float)65536, max((float)0, fRec44[0]))); + fTempPerm9 = (fSlow2 + fVec3[1]); + fVec4[0] = fSlow3; + fTempPerm10 = (fSlow3 + fVec4[1]); fVec5[0] = fSlow4; - float fTemp27 = (fSlow4 + fVec5[1]); - float fTemp28 = ((float)input0[i] + (0.5f * (((fVec4[(IOTA-iTemp24)&131071] * fTemp25) + (fVec4[(IOTA-iTemp26)&131071] * fRec42[0])) * fTemp27))); - float fTemp29 = ((fRec27[1] * fTemp7) + (fTemp1 * fTemp28)); - float fTemp30 = ((fRec30[1] * fTemp7) + (fTemp1 * fTemp29)); - float fTemp31 = ((fRec33[1] * fTemp7) + (fTemp1 * fTemp30)); - float fTemp32 = ((fRec36[1] * fTemp7) + (fTemp1 * fTemp31)); - float fTemp33 = (fConst1 * (fTemp8 * (fRec39[0] + 1.0f))); - float fTemp34 = (fTemp33 + 8.500005f); - int iTemp35 = int(fTemp34); - float fTemp36 = floorf(fTemp34); - float fTemp37 = (fTemp33 + (9.0f - fTemp36)); - float fTemp38 = (fTemp33 + (8.0f - fTemp36)); - float fTemp39 = (fTemp33 + (7.0f - fTemp36)); - float fTemp40 = (fTemp33 + (6.0f - fTemp36)); - float fTemp41 = (fTemp37 * fTemp38); - float fTemp42 = (((((fRec1[(IOTA-int((int(min(512, max(0, iTemp35))) + 1)))&1023] * (0 - fTemp37)) * (0 - (0.5f * fTemp38))) * (0 - (0.33333334f * fTemp39))) * (0 - (0.25f * fTemp40))) + ((fTemp33 + (1e+01f - fTemp36)) * ((((((fRec1[(IOTA-int((int(min(512, max(0, (iTemp35 + 1)))) + 1)))&1023] * (0 - fTemp38)) * (0 - (0.5f * fTemp39))) * (0 - (0.33333334f * fTemp40))) + (0.5f * (((fTemp37 * fRec1[(IOTA-int((int(min(512, max(0, (iTemp35 + 2)))) + 1)))&1023]) * (0 - fTemp39)) * (0 - (0.5f * fTemp40))))) + (0.16666667f * ((fTemp41 * fRec1[(IOTA-int((int(min(512, max(0, (iTemp35 + 3)))) + 1)))&1023]) * (0 - fTemp40)))) + (0.041666668f * ((fTemp41 * fTemp39) * fRec1[(IOTA-int((int(min(512, max(0, (iTemp35 + 4)))) + 1)))&1023]))))); - fVec6[IOTA&131071] = fTemp42; - float fTemp43 = ((float)input1[i] + (0.5f * (fTemp27 * ((fVec6[(IOTA-iTemp26)&131071] * fRec42[0]) + (fVec6[(IOTA-iTemp24)&131071] * fTemp25))))); - float fTemp44 = ((fRec28[1] * fTemp7) + (fTemp1 * fTemp43)); - float fTemp45 = ((fRec31[1] * fTemp7) + (fTemp1 * fTemp44)); - float fTemp46 = ((fRec34[1] * fTemp7) + (fTemp1 * fTemp45)); - float fTemp47 = ((fRec37[1] * fTemp7) + (fTemp1 * fTemp46)); - float fTemp48 = ((6.123234e-17f * fTemp32) - fTemp47); - fVec7[IOTA&16383] = fTemp48; - fRec45[0] = (fSlow8 + (0.9999f * ((iSlow7 * iTemp12) + fRec45[1]))); - float fTemp49 = (fRec45[0] + -1.49999f); - int iTemp50 = int(min(8192, max(0, int(fTemp49)))); - float fTemp51 = floorf(fTemp49); - float fTemp52 = (fTemp51 + (2.0f - fRec45[0])); - float fTemp53 = (fRec45[0] - fTemp51); - fRec38[0] = (fVec7[(IOTA-int((iTemp50 + 1)))&16383] + ((fRec38[1] * (0 - (fTemp52 / fTemp53))) + ((fTemp52 * fVec7[(IOTA-iTemp50)&16383]) / fTemp53))); + fTempPerm11 = (fConst2 * (fSlow4 + fVec5[1])); + fTempPerm12 = sinf(fTempPerm11); + fTempPerm13 = cosf(fTempPerm11); + fRec27[0] = ((fTempPerm12 * fRec28[1]) + (fTempPerm13 * fRec27[1])); + iTempPerm14 = (1 - iVec1[1]); + fRec28[0] = (((fTempPerm13 * fRec28[1]) + ((0 - fTempPerm12) * fRec27[1])) + iTempPerm14); + fTempPerm15 = (fConst1 * (fTempPerm10 * (fRec27[0] + 1.0f))); + fTempPerm16 = (fTempPerm15 + 8.500005f); + iTempPerm17 = int(fTempPerm16); + fTempPerm18 = floorf(fTempPerm16); + fTempPerm19 = (fTempPerm15 + (9.0f - fTempPerm18)); + fTempPerm20 = (fTempPerm15 + (8.0f - fTempPerm18)); + fTempPerm21 = (fTempPerm15 + (7.0f - fTempPerm18)); + fTempPerm22 = (fTempPerm15 + (6.0f - fTempPerm18)); + fTempPerm23 = (fTempPerm19 * fTempPerm20); + fTempPerm24 = (((((fRec1[(IOTA-int((int(min(512, max(0, iTempPerm17))) + 1)))&1023] * (0 - fTempPerm19)) * (0 - (0.5f * fTempPerm20))) * (0 - (0.33333334f * fTempPerm21))) * (0 - (0.25f * fTempPerm22))) + ((fTempPerm15 + (1e+01f - fTempPerm18)) * ((((((fRec1[(IOTA-int((int(min(512, max(0, (iTempPerm17 + 1)))) + 1)))&1023] * (0 - fTempPerm20)) * (0 - (0.5f * fTempPerm21))) * (0 - (0.33333334f * fTempPerm22))) + (0.5f * (((fTempPerm19 * fRec1[(IOTA-int((int(min(512, max(0, (iTempPerm17 + 2)))) + 1)))&1023]) * (0 - fTempPerm21)) * (0 - (0.5f * fTempPerm22))))) + (0.16666667f * ((fTempPerm23 * fRec1[(IOTA-int((int(min(512, max(0, (iTempPerm17 + 3)))) + 1)))&1023]) * (0 - fTempPerm22)))) + (0.041666668f * ((fTempPerm23 * fTempPerm21) * fRec1[(IOTA-int((int(min(512, max(0, (iTempPerm17 + 4)))) + 1)))&1023]))))); + fVec6[IOTA&131071] = fTempPerm24; + fTempPerm25 = ((int((fRec29[1] != 0.0f)))?((int(((fRec30[1] > 0.0f) & (fRec30[1] < 1.0f))))?fRec29[1]:0):((int(((fRec30[1] == 0.0f) & (fSlow5 != fRec31[1]))))?4.5351473e-05f:((int(((fRec30[1] == 1.0f) & (fSlow5 != fRec32[1]))))?-4.5351473e-05f:0))); + fRec29[0] = fTempPerm25; + fRec30[0] = max(0.0f, min(1.0f, (fRec30[1] + fTempPerm25))); + fRec31[0] = ((int(((fRec30[1] >= 1.0f) & (fRec32[1] != fSlow5))))?fSlow5:fRec31[1]); + fRec32[0] = ((int(((fRec30[1] <= 0.0f) & (fRec31[1] != fSlow5))))?fSlow5:fRec32[1]); + iTempPerm26 = int(min((float)65536, max((float)0, fRec32[0]))); + iTempPerm27 = int(min((float)65536, max((float)0, fRec31[0]))); + fTempPerm28 = (1.0f - fRec30[0]); + fTempPerm29 = ((float)input1[i] + (0.5f * (fTempPerm9 * ((fVec6[(IOTA-iTempPerm26)&131071] * fRec30[0]) + (fVec6[(IOTA-iTempPerm27)&131071] * fTempPerm28))))); + fTempPerm30 = ((fRec34[1] * fTempPerm4) + (fTempPerm2 * fTempPerm29)); + fTempPerm31 = ((fRec37[1] * fTempPerm4) + (fTempPerm2 * fTempPerm30)); + fTempPerm32 = ((fRec40[1] * fTempPerm4) + (fTempPerm2 * fTempPerm31)); + fTempPerm33 = (0 - ((fRec43[1] * fTempPerm4) + (fTempPerm2 * fTempPerm32))); + fVec7[IOTA&16383] = fTempPerm33; + fRec45[0] = (fSlow9 + (0.9999f * ((iSlow8 * iTempPerm14) + fRec45[1]))); + fTempPerm34 = (fRec45[0] + -1.49999f); + iTempPerm35 = int(min(8192, max(0, int(fTempPerm34)))); + fTempPerm36 = floorf(fTempPerm34); + fTempPerm37 = (fTempPerm36 + (2.0f - fRec45[0])); + fTempPerm38 = (fRec45[0] - fTempPerm36); + fRec44[0] = ((((fVec7[(IOTA-iTempPerm35)&16383] * fTempPerm37) / fTempPerm38) + fVec7[(IOTA-int((iTempPerm35 + 1)))&16383]) + (fRec44[1] * (0 - (fTempPerm37 / fTempPerm38)))); + fRec42[0] = fRec44[0]; + fTempPerm39 = (fConst1 * (fTempPerm10 * (fRec28[0] + 1.0f))); + fTempPerm40 = (fTempPerm39 + 8.500005f); + fTempPerm41 = floorf(fTempPerm40); + fTempPerm42 = (fTempPerm39 + (9.0f - fTempPerm41)); + fTempPerm43 = (fTempPerm39 + (8.0f - fTempPerm41)); + fTempPerm44 = (fTempPerm39 + (7.0f - fTempPerm41)); + fTempPerm45 = (fTempPerm39 + (6.0f - fTempPerm41)); + iTempPerm46 = int(fTempPerm40); + fTempPerm47 = (fTempPerm42 * fTempPerm43); + fTempPerm48 = ((((((0 - fTempPerm42) * (0 - (0.5f * fTempPerm43))) * (0 - (0.33333334f * fTempPerm44))) * (0 - (0.25f * fTempPerm45))) * fRec0[(IOTA-int((int(min(512, max(0, iTempPerm46))) + 1)))&1023]) + ((fTempPerm39 + (1e+01f - fTempPerm41)) * ((((((fRec0[(IOTA-int((int(min(512, max(0, (iTempPerm46 + 1)))) + 1)))&1023] * (0 - fTempPerm43)) * (0 - (0.5f * fTempPerm44))) * (0 - (0.33333334f * fTempPerm45))) + (0.5f * (((fTempPerm42 * fRec0[(IOTA-int((int(min(512, max(0, (iTempPerm46 + 2)))) + 1)))&1023]) * (0 - fTempPerm44)) * (0 - (0.5f * fTempPerm45))))) + (0.16666667f * ((fTempPerm47 * fRec0[(IOTA-int((int(min(512, max(0, (iTempPerm46 + 3)))) + 1)))&1023]) * (0 - fTempPerm45)))) + (0.041666668f * ((fTempPerm47 * fTempPerm44) * fRec0[(IOTA-int((int(min(512, max(0, (iTempPerm46 + 4)))) + 1)))&1023]))))); + fVec8[IOTA&131071] = fTempPerm48; + fTempPerm49 = ((float)input0[i] + (0.5f * (((fVec8[(IOTA-iTempPerm27)&131071] * fTempPerm28) + (fVec8[(IOTA-iTempPerm26)&131071] * fRec30[0])) * fTempPerm9))); + fTempPerm50 = ((fTempPerm2 * fTempPerm49) + (fTempPerm4 * fRec33[1])); + fTempPerm51 = ((fTempPerm2 * fTempPerm50) + (fTempPerm4 * fRec36[1])); + fTempPerm52 = ((fTempPerm2 * fTempPerm51) + (fTempPerm4 * fRec39[1])); + fTempPerm53 = ((fTempPerm2 * fTempPerm52) + (fTempPerm4 * fRec42[1])); + fVec9[IOTA&16383] = fTempPerm53; + fRec47[0] = (fSlow11 + (0.9999f * ((iSlow10 * iTempPerm14) + fRec47[1]))); + fTempPerm54 = (fRec47[0] + -1.49999f); + iTempPerm55 = int(min(8192, max(0, int(fTempPerm54)))); + fTempPerm56 = floorf(fTempPerm54); + fTempPerm57 = (fTempPerm56 + (2.0f - fRec47[0])); + fTempPerm58 = (fRec47[0] - fTempPerm56); + fRec46[0] = (fVec9[(IOTA-int((iTempPerm55 + 1)))&16383] + ((fRec46[1] * (0 - (fTempPerm57 / fTempPerm58))) + ((fTempPerm57 * fVec9[(IOTA-iTempPerm55)&16383]) / fTempPerm58))); + fRec43[0] = fRec46[0]; + fTempPerm59 = (0 - ((fTempPerm2 * fRec43[1]) + (fTempPerm32 * fTempPerm3))); + fVec10[IOTA&16383] = fTempPerm59; + fRec48[0] = (fSlow14 + (0.999f * ((iSlow13 * iTempPerm14) + fRec48[1]))); + fTempPerm60 = (fRec48[0] + -1.49999f); + iTempPerm61 = int(min(8192, max(0, int(fTempPerm60)))); + fTempPerm62 = floorf(fTempPerm60); + fTempPerm63 = (fTempPerm62 + (2.0f - fRec48[0])); + fTempPerm64 = (fRec48[0] - fTempPerm62); + fRec41[0] = ((((fVec10[(IOTA-iTempPerm61)&16383] * fTempPerm63) / fTempPerm64) + fVec10[(IOTA-int((iTempPerm61 + 1)))&16383]) + (fRec41[1] * (0 - (fTempPerm63 / fTempPerm64)))); + fRec39[0] = fRec41[0]; + fTempPerm65 = ((fTempPerm2 * fRec42[1]) + (fTempPerm52 * fTempPerm3)); + fVec11[IOTA&16383] = fTempPerm65; + fRec50[0] = (fSlow16 + (0.999f * ((iSlow15 * iTempPerm14) + fRec50[1]))); + fTempPerm66 = (fRec50[0] + -1.49999f); + iTempPerm67 = int(min(8192, max(0, int(fTempPerm66)))); + fTempPerm68 = floorf(fTempPerm66); + fTempPerm69 = (fTempPerm68 + (2.0f - fRec50[0])); + fTempPerm70 = (fRec50[0] - fTempPerm68); + fRec49[0] = (fVec11[(IOTA-int((iTempPerm67 + 1)))&16383] + ((fRec49[1] * (0 - (fTempPerm69 / fTempPerm70))) + ((fTempPerm69 * fVec11[(IOTA-iTempPerm67)&16383]) / fTempPerm70))); + fRec40[0] = fRec49[0]; + fTempPerm71 = (0 - ((fTempPerm2 * fRec40[1]) + (fTempPerm31 * fTempPerm3))); + fVec12[IOTA&16383] = fTempPerm71; + fRec51[0] = (fSlow19 + (0.999f * ((iSlow18 * iTempPerm14) + fRec51[1]))); + fTempPerm72 = (fRec51[0] + -1.49999f); + iTempPerm73 = int(min(8192, max(0, int(fTempPerm72)))); + fTempPerm74 = floorf(fTempPerm72); + fTempPerm75 = (fTempPerm74 + (2.0f - fRec51[0])); + fTempPerm76 = (fRec51[0] - fTempPerm74); + fRec38[0] = ((((fVec12[(IOTA-iTempPerm73)&16383] * fTempPerm75) / fTempPerm76) + fVec12[(IOTA-int((iTempPerm73 + 1)))&16383]) + (fRec38[1] * (0 - (fTempPerm75 / fTempPerm76)))); fRec36[0] = fRec38[0]; - float fTemp54 = (fTemp32 + (6.123234e-17f * fTemp47)); - fVec8[IOTA&16383] = fTemp54; - fRec47[0] = (fSlow10 + (0.9999f * ((iSlow9 * iTemp12) + fRec47[1]))); - float fTemp55 = (fRec47[0] + -1.49999f); - int iTemp56 = int(min(8192, max(0, int(fTemp55)))); - float fTemp57 = floorf(fTemp55); - float fTemp58 = (fTemp57 + (2.0f - fRec47[0])); - float fTemp59 = (fRec47[0] - fTemp57); - fRec46[0] = (fVec8[(IOTA-int((iTemp56 + 1)))&16383] + ((fRec46[1] * (0 - (fTemp58 / fTemp59))) + ((fTemp58 * fVec8[(IOTA-iTemp56)&16383]) / fTemp59))); - fRec37[0] = fRec46[0]; - float fTemp60 = ((fRec36[1] * fTemp1) + (fTemp31 * fTemp6)); - float fTemp61 = ((fTemp1 * fRec37[1]) + (fTemp46 * fTemp6)); - float fTemp62 = ((6.123234e-17f * fTemp60) - fTemp61); - fVec9[IOTA&16383] = fTemp62; - fRec48[0] = (fSlow13 + (0.999f * ((iSlow12 * iTemp12) + fRec48[1]))); - float fTemp63 = (fRec48[0] + -1.49999f); - int iTemp64 = int(min(8192, max(0, int(fTemp63)))); - float fTemp65 = floorf(fTemp63); - float fTemp66 = (fTemp65 + (2.0f - fRec48[0])); - float fTemp67 = (fRec48[0] - fTemp65); - fRec35[0] = (fVec9[(IOTA-int((iTemp64 + 1)))&16383] + ((fRec35[1] * (0 - (fTemp66 / fTemp67))) + ((fTemp66 * fVec9[(IOTA-iTemp64)&16383]) / fTemp67))); + fTempPerm77 = ((fTempPerm2 * fRec39[1]) + (fTempPerm51 * fTempPerm3)); + fVec13[IOTA&16383] = fTempPerm77; + fRec53[0] = (fSlow21 + (0.999f * ((iSlow20 * iTempPerm14) + fRec53[1]))); + fTempPerm78 = (fRec53[0] + -1.49999f); + iTempPerm79 = int(min(8192, max(0, int(fTempPerm78)))); + fTempPerm80 = floorf(fTempPerm78); + fTempPerm81 = (fTempPerm80 + (2.0f - fRec53[0])); + fTempPerm82 = (fRec53[0] - fTempPerm80); + fRec52[0] = (fVec13[(IOTA-int((iTempPerm79 + 1)))&16383] + ((fRec52[1] * (0 - (fTempPerm81 / fTempPerm82))) + ((fTempPerm81 * fVec13[(IOTA-iTempPerm79)&16383]) / fTempPerm82))); + fRec37[0] = fRec52[0]; + fTempPerm83 = (0 - ((fTempPerm2 * fRec37[1]) + (fTempPerm30 * fTempPerm3))); + fVec14[IOTA&16383] = fTempPerm83; + fRec54[0] = (fSlow23 + (0.999f * ((iSlow22 * iTempPerm14) + fRec54[1]))); + fTempPerm84 = (fRec54[0] + -1.49999f); + iTempPerm85 = int(min(8192, max(0, int(fTempPerm84)))); + fTempPerm86 = floorf(fTempPerm84); + fTempPerm87 = (fTempPerm86 + (2.0f - fRec54[0])); + fTempPerm88 = (fRec54[0] - fTempPerm86); + fRec35[0] = ((((fVec14[(IOTA-iTempPerm85)&16383] * fTempPerm87) / fTempPerm88) + fVec14[(IOTA-int((iTempPerm85 + 1)))&16383]) + ((0 - (fTempPerm87 / fTempPerm88)) * fRec35[1])); fRec33[0] = fRec35[0]; - float fTemp68 = ((6.123234e-17f * fTemp61) + fTemp60); - fVec10[IOTA&16383] = fTemp68; - fRec50[0] = (fSlow15 + (0.999f * ((iSlow14 * iTemp12) + fRec50[1]))); - float fTemp69 = (fRec50[0] + -1.49999f); - int iTemp70 = int(min(8192, max(0, int(fTemp69)))); - float fTemp71 = floorf(fTemp69); - float fTemp72 = (fTemp71 + (2.0f - fRec50[0])); - float fTemp73 = (fRec50[0] - fTemp71); - fRec49[0] = ((((fVec10[(IOTA-iTemp70)&16383] * fTemp72) / fTemp73) + fVec10[(IOTA-int((iTemp70 + 1)))&16383]) + (fRec49[1] * (0 - (fTemp72 / fTemp73)))); - fRec34[0] = fRec49[0]; - float fTemp74 = ((fRec33[1] * fTemp1) + (fTemp30 * fTemp6)); - float fTemp75 = ((fTemp1 * fRec34[1]) + (fTemp45 * fTemp6)); - float fTemp76 = ((6.123234e-17f * fTemp74) - fTemp75); - fVec11[IOTA&16383] = fTemp76; - fRec51[0] = (fSlow18 + (0.999f * ((iSlow17 * iTemp12) + fRec51[1]))); - float fTemp77 = (fRec51[0] + -1.49999f); - int iTemp78 = int(min(8192, max(0, int(fTemp77)))); - float fTemp79 = floorf(fTemp77); - float fTemp80 = (fTemp79 + (2.0f - fRec51[0])); - float fTemp81 = (fRec51[0] - fTemp79); - fRec32[0] = (fVec11[(IOTA-int((iTemp78 + 1)))&16383] + ((fRec32[1] * (0 - (fTemp80 / fTemp81))) + ((fTemp80 * fVec11[(IOTA-iTemp78)&16383]) / fTemp81))); - fRec30[0] = fRec32[0]; - float fTemp82 = (fTemp74 + (6.123234e-17f * fTemp75)); - fVec12[IOTA&16383] = fTemp82; - fRec53[0] = (fSlow20 + (0.999f * ((iSlow19 * iTemp12) + fRec53[1]))); - float fTemp83 = (fRec53[0] + -1.49999f); - int iTemp84 = int(min(8192, max(0, int(fTemp83)))); - float fTemp85 = floorf(fTemp83); - float fTemp86 = (fTemp85 + (2.0f - fRec53[0])); - float fTemp87 = (fRec53[0] - fTemp85); - fRec52[0] = (fVec12[(IOTA-int((iTemp84 + 1)))&16383] + ((fRec52[1] * (0 - (fTemp86 / fTemp87))) + ((fTemp86 * fVec12[(IOTA-iTemp84)&16383]) / fTemp87))); - fRec31[0] = fRec52[0]; - float fTemp88 = ((fRec30[1] * fTemp1) + (fTemp29 * fTemp6)); - float fTemp89 = ((fTemp1 * fRec31[1]) + (fTemp44 * fTemp6)); - float fTemp90 = ((6.123234e-17f * fTemp88) - fTemp89); - fVec13[IOTA&16383] = fTemp90; - fRec54[0] = (fSlow22 + (0.999f * ((iSlow21 * iTemp12) + fRec54[1]))); - float fTemp91 = (fRec54[0] + -1.49999f); - int iTemp92 = int(min(8192, max(0, int(fTemp91)))); - float fTemp93 = floorf(fTemp91); - float fTemp94 = (fTemp93 + (2.0f - fRec54[0])); - float fTemp95 = (fRec54[0] - fTemp93); - fRec29[0] = (fVec13[(IOTA-int((iTemp92 + 1)))&16383] + ((fRec29[1] * (0 - (fTemp94 / fTemp95))) + ((fTemp94 * fVec13[(IOTA-iTemp92)&16383]) / fTemp95))); - fRec27[0] = fRec29[0]; - float fTemp96 = (fTemp88 + (6.123234e-17f * fTemp89)); - fVec14[IOTA&16383] = fTemp96; - fRec56[0] = (fSlow24 + (0.999f * ((iSlow23 * iTemp12) + fRec56[1]))); - float fTemp97 = (fRec56[0] + -1.49999f); - int iTemp98 = int(min(8192, max(0, int(fTemp97)))); - float fTemp99 = floorf(fTemp97); - float fTemp100 = (fTemp99 + (2.0f - fRec56[0])); - float fTemp101 = (fRec56[0] - fTemp99); - fRec55[0] = (fVec14[(IOTA-int((iTemp98 + 1)))&16383] + ((fRec55[1] * (0 - (fTemp100 / fTemp101))) + ((fTemp100 * fVec14[(IOTA-iTemp98)&16383]) / fTemp101))); - fRec28[0] = fRec55[0]; - float fTemp102 = ((fRec27[1] * fTemp1) + (fTemp28 * fTemp6)); - float fTemp103 = ((fTemp4 * fRec15[1]) + (fTemp102 * fTemp5)); - float fTemp104 = ((fTemp4 * fRec18[1]) + (fTemp5 * fTemp103)); - float fTemp105 = ((fTemp4 * fRec21[1]) + (fTemp5 * fTemp104)); - float fTemp106 = ((fRec24[1] * fTemp4) + (fTemp5 * fTemp105)); - float fTemp107 = ((fTemp1 * fRec28[1]) + (fTemp43 * fTemp6)); - float fTemp108 = ((fTemp4 * fRec16[1]) + (fTemp5 * fTemp107)); - float fTemp109 = ((fTemp4 * fRec19[1]) + (fTemp5 * fTemp108)); - float fTemp110 = ((fTemp4 * fRec22[1]) + (fTemp5 * fTemp109)); - float fTemp111 = ((fTemp4 * fRec25[1]) + (fTemp5 * fTemp110)); - float fTemp112 = ((6.123234e-17f * fTemp106) - fTemp111); - fVec15[IOTA&16383] = fTemp112; - fRec57[0] = (fSlow27 + (0.9999f * ((iSlow26 * iTemp12) + fRec57[1]))); - float fTemp113 = (fRec57[0] + -1.49999f); - int iTemp114 = int(min(8192, max(0, int(fTemp113)))); - float fTemp115 = floorf(fTemp113); - float fTemp116 = (fTemp115 + (2.0f - fRec57[0])); - float fTemp117 = (fRec57[0] - fTemp115); - fRec26[0] = (fVec15[(IOTA-int((iTemp114 + 1)))&16383] + ((fRec26[1] * (0 - (fTemp116 / fTemp117))) + ((fTemp116 * fVec15[(IOTA-iTemp114)&16383]) / fTemp117))); + fTempPerm89 = ((fTempPerm2 * fRec36[1]) + (fTempPerm50 * fTempPerm3)); + fVec15[IOTA&16383] = fTempPerm89; + fRec56[0] = (fSlow25 + (0.999f * ((iSlow24 * iTempPerm14) + fRec56[1]))); + fTempPerm90 = (fRec56[0] + -1.49999f); + iTempPerm91 = int(min(8192, max(0, int(fTempPerm90)))); + fTempPerm92 = floorf(fTempPerm90); + fTempPerm93 = (fTempPerm92 + (2.0f - fRec56[0])); + fTempPerm94 = (fRec56[0] - fTempPerm92); + fRec55[0] = (fVec15[(IOTA-int((iTempPerm91 + 1)))&16383] + ((fRec55[1] * (0 - (fTempPerm93 / fTempPerm94))) + ((fTempPerm93 * fVec15[(IOTA-iTempPerm91)&16383]) / fTempPerm94))); + fRec34[0] = fRec55[0]; + fTempPerm95 = ((fTempPerm29 * fTempPerm3) + (fTempPerm2 * fRec34[1])); + fTempPerm96 = ((fRec16[1] * fTempPerm8) + (fTempPerm6 * fTempPerm95)); + fTempPerm97 = ((fRec19[1] * fTempPerm8) + (fTempPerm6 * fTempPerm96)); + fTempPerm98 = ((fRec22[1] * fTempPerm8) + (fTempPerm6 * fTempPerm97)); + fTempPerm99 = (0 - ((fRec25[1] * fTempPerm8) + (fTempPerm6 * fTempPerm98))); + fVec16[IOTA&16383] = fTempPerm99; + fRec57[0] = (fSlow28 + (0.9999f * ((iSlow27 * iTempPerm14) + fRec57[1]))); + fTempPerm100 = (fRec57[0] + -1.49999f); + iTempPerm101 = int(min(8192, max(0, int(fTempPerm100)))); + fTempPerm102 = floorf(fTempPerm100); + fTempPerm103 = (fTempPerm102 + (2.0f - fRec57[0])); + fTempPerm104 = (fRec57[0] - fTempPerm102); + fRec26[0] = ((((fVec16[(IOTA-iTempPerm101)&16383] * fTempPerm103) / fTempPerm104) + fVec16[(IOTA-int((iTempPerm101 + 1)))&16383]) + (fRec26[1] * (0 - (fTempPerm103 / fTempPerm104)))); fRec24[0] = fRec26[0]; - float fTemp118 = (fTemp106 + (6.123234e-17f * fTemp111)); - fVec16[IOTA&16383] = fTemp118; - fRec59[0] = (fSlow29 + (0.9999f * ((iSlow28 * iTemp12) + fRec59[1]))); - float fTemp119 = (fRec59[0] + -1.49999f); - int iTemp120 = int(min(8192, max(0, int(fTemp119)))); - float fTemp121 = floorf(fTemp119); - float fTemp122 = (fTemp121 + (2.0f - fRec59[0])); - float fTemp123 = (fRec59[0] - fTemp121); - fRec58[0] = (fVec16[(IOTA-int((iTemp120 + 1)))&16383] + ((fRec58[1] * (0 - (fTemp122 / fTemp123))) + ((fTemp122 * fVec16[(IOTA-iTemp120)&16383]) / fTemp123))); + fTempPerm105 = ((fTempPerm2 * fRec33[1]) + (fTempPerm49 * fTempPerm3)); + fTempPerm106 = ((fTempPerm105 * fTempPerm6) + (fTempPerm8 * fRec15[1])); + fTempPerm107 = ((fTempPerm6 * fTempPerm106) + (fTempPerm8 * fRec18[1])); + fTempPerm108 = ((fTempPerm6 * fTempPerm107) + (fTempPerm8 * fRec21[1])); + fTempPerm109 = ((fTempPerm6 * fTempPerm108) + (fRec24[1] * fTempPerm8)); + fVec17[IOTA&16383] = fTempPerm109; + fRec59[0] = (fSlow30 + (0.9999f * ((iSlow29 * iTempPerm14) + fRec59[1]))); + fTempPerm110 = (fRec59[0] + -1.49999f); + iTempPerm111 = int(min(8192, max(0, int(fTempPerm110)))); + fTempPerm112 = floorf(fTempPerm110); + fTempPerm113 = (fTempPerm112 + (2.0f - fRec59[0])); + fTempPerm114 = (fRec59[0] - fTempPerm112); + fRec58[0] = (fVec17[(IOTA-int((iTempPerm111 + 1)))&16383] + ((fRec58[1] * (0 - (fTempPerm113 / fTempPerm114))) + ((fTempPerm113 * fVec17[(IOTA-iTempPerm111)&16383]) / fTempPerm114))); fRec25[0] = fRec58[0]; - float fTemp124 = ((fRec24[1] * fTemp5) + (fTemp3 * fTemp105)); - float fTemp125 = ((fTemp5 * fRec25[1]) + (fTemp3 * fTemp110)); - float fTemp126 = ((6.123234e-17f * fTemp124) - fTemp125); - fVec17[IOTA&16383] = fTemp126; - fRec60[0] = (fSlow32 + (0.999f * ((iSlow31 * iTemp12) + fRec60[1]))); - float fTemp127 = (fRec60[0] + -1.49999f); - int iTemp128 = int(min(8192, max(0, int(fTemp127)))); - float fTemp129 = floorf(fTemp127); - float fTemp130 = (fTemp129 + (2.0f - fRec60[0])); - float fTemp131 = (fRec60[0] - fTemp129); - fRec23[0] = (fVec17[(IOTA-int((iTemp128 + 1)))&16383] + (((0 - (fTemp130 / fTemp131)) * fRec23[1]) + ((fVec17[(IOTA-iTemp128)&16383] * fTemp130) / fTemp131))); + fTempPerm115 = (0 - ((fTempPerm6 * fRec25[1]) + (fTempPerm98 * fTempPerm7))); + fVec18[IOTA&16383] = fTempPerm115; + fRec60[0] = (fSlow33 + (0.999f * ((iSlow32 * iTempPerm14) + fRec60[1]))); + fTempPerm116 = (fRec60[0] + -1.49999f); + iTempPerm117 = int(min(8192, max(0, int(fTempPerm116)))); + fTempPerm118 = floorf(fTempPerm116); + fTempPerm119 = (fTempPerm118 + (2.0f - fRec60[0])); + fTempPerm120 = (fRec60[0] - fTempPerm118); + fRec23[0] = ((((fVec18[(IOTA-iTempPerm117)&16383] * fTempPerm119) / fTempPerm120) + fVec18[(IOTA-int((iTempPerm117 + 1)))&16383]) + (fRec23[1] * (0 - (fTempPerm119 / fTempPerm120)))); fRec21[0] = fRec23[0]; - float fTemp132 = (fTemp124 + (6.123234e-17f * fTemp125)); - fVec18[IOTA&16383] = fTemp132; - fRec62[0] = (fSlow34 + (0.999f * ((iSlow33 * iTemp12) + fRec62[1]))); - float fTemp133 = (fRec62[0] + -1.49999f); - int iTemp134 = int(min(8192, max(0, int(fTemp133)))); - float fTemp135 = floorf(fTemp133); - float fTemp136 = (fTemp135 + (2.0f - fRec62[0])); - float fTemp137 = (fRec62[0] - fTemp135); - fRec61[0] = (fVec18[(IOTA-int((iTemp134 + 1)))&16383] + ((fRec61[1] * (0 - (fTemp136 / fTemp137))) + ((fTemp136 * fVec18[(IOTA-iTemp134)&16383]) / fTemp137))); + fTempPerm121 = ((fTempPerm6 * fRec24[1]) + (fTempPerm108 * fTempPerm7)); + fVec19[IOTA&16383] = fTempPerm121; + fRec62[0] = (fSlow35 + (0.999f * ((iSlow34 * iTempPerm14) + fRec62[1]))); + fTempPerm122 = (fRec62[0] + -1.49999f); + iTempPerm123 = int(min(8192, max(0, int(fTempPerm122)))); + fTempPerm124 = floorf(fTempPerm122); + fTempPerm125 = (fTempPerm124 + (2.0f - fRec62[0])); + fTempPerm126 = (fRec62[0] - fTempPerm124); + fRec61[0] = (fVec19[(IOTA-int((iTempPerm123 + 1)))&16383] + ((fRec61[1] * (0 - (fTempPerm125 / fTempPerm126))) + ((fTempPerm125 * fVec19[(IOTA-iTempPerm123)&16383]) / fTempPerm126))); fRec22[0] = fRec61[0]; - float fTemp138 = ((fRec21[1] * fTemp5) + (fTemp3 * fTemp104)); - float fTemp139 = ((fTemp5 * fRec22[1]) + (fTemp3 * fTemp109)); - float fTemp140 = ((6.123234e-17f * fTemp138) - fTemp139); - fVec19[IOTA&16383] = fTemp140; - fRec63[0] = (fSlow37 + (0.999f * ((iSlow36 * iTemp12) + fRec63[1]))); - float fTemp141 = (fRec63[0] + -1.49999f); - int iTemp142 = int(min(8192, max(0, int(fTemp141)))); - float fTemp143 = floorf(fTemp141); - float fTemp144 = (fTemp143 + (2.0f - fRec63[0])); - float fTemp145 = (fRec63[0] - fTemp143); - fRec20[0] = ((((fVec19[(IOTA-iTemp142)&16383] * fTemp144) / fTemp145) + fVec19[(IOTA-int((iTemp142 + 1)))&16383]) + (fRec20[1] * (0 - (fTemp144 / fTemp145)))); + fTempPerm127 = (0 - ((fTempPerm6 * fRec22[1]) + (fTempPerm97 * fTempPerm7))); + fVec20[IOTA&16383] = fTempPerm127; + fRec63[0] = (fSlow38 + (0.999f * ((iSlow37 * iTempPerm14) + fRec63[1]))); + fTempPerm128 = (fRec63[0] + -1.49999f); + iTempPerm129 = int(min(8192, max(0, int(fTempPerm128)))); + fTempPerm130 = floorf(fTempPerm128); + fTempPerm131 = (fTempPerm130 + (2.0f - fRec63[0])); + fTempPerm132 = (fRec63[0] - fTempPerm130); + fRec20[0] = ((((fVec20[(IOTA-iTempPerm129)&16383] * fTempPerm131) / fTempPerm132) + fVec20[(IOTA-int((iTempPerm129 + 1)))&16383]) + (fRec20[1] * (0 - (fTempPerm131 / fTempPerm132)))); fRec18[0] = fRec20[0]; - float fTemp146 = (fTemp138 + (6.123234e-17f * fTemp139)); - fVec20[IOTA&16383] = fTemp146; - fRec65[0] = (fSlow39 + (0.999f * ((iSlow38 * iTemp12) + fRec65[1]))); - float fTemp147 = (fRec65[0] + -1.49999f); - int iTemp148 = int(min(8192, max(0, int(fTemp147)))); - float fTemp149 = floorf(fTemp147); - float fTemp150 = (fTemp149 + (2.0f - fRec65[0])); - float fTemp151 = (fRec65[0] - fTemp149); - fRec64[0] = (fVec20[(IOTA-int((iTemp148 + 1)))&16383] + ((fRec64[1] * (0 - (fTemp150 / fTemp151))) + ((fTemp150 * fVec20[(IOTA-iTemp148)&16383]) / fTemp151))); + fTempPerm133 = ((fTempPerm6 * fRec21[1]) + (fTempPerm107 * fTempPerm7)); + fVec21[IOTA&16383] = fTempPerm133; + fRec65[0] = (fSlow40 + (0.999f * ((iSlow39 * iTempPerm14) + fRec65[1]))); + fTempPerm134 = (fRec65[0] + -1.49999f); + iTempPerm135 = int(min(8192, max(0, int(fTempPerm134)))); + fTempPerm136 = floorf(fTempPerm134); + fTempPerm137 = (fTempPerm136 + (2.0f - fRec65[0])); + fTempPerm138 = (fRec65[0] - fTempPerm136); + fRec64[0] = (fVec21[(IOTA-int((iTempPerm135 + 1)))&16383] + ((fRec64[1] * (0 - (fTempPerm137 / fTempPerm138))) + ((fTempPerm137 * fVec21[(IOTA-iTempPerm135)&16383]) / fTempPerm138))); fRec19[0] = fRec64[0]; - float fTemp152 = ((fRec18[1] * fTemp5) + (fTemp3 * fTemp103)); - float fTemp153 = ((fTemp5 * fRec19[1]) + (fTemp3 * fTemp108)); - float fTemp154 = ((6.123234e-17f * fTemp152) - fTemp153); - fVec21[IOTA&16383] = fTemp154; - fRec66[0] = (fSlow42 + (0.999f * ((iSlow41 * iTemp12) + fRec66[1]))); - float fTemp155 = (fRec66[0] + -1.49999f); - int iTemp156 = int(min(8192, max(0, int(fTemp155)))); - float fTemp157 = floorf(fTemp155); - float fTemp158 = (fTemp157 + (2.0f - fRec66[0])); - float fTemp159 = (fRec66[0] - fTemp157); - fRec17[0] = ((((fVec21[(IOTA-iTemp156)&16383] * fTemp158) / fTemp159) + fVec21[(IOTA-int((iTemp156 + 1)))&16383]) + (fRec17[1] * (0 - (fTemp158 / fTemp159)))); + fTempPerm139 = (0 - ((fTempPerm6 * fRec19[1]) + (fTempPerm96 * fTempPerm7))); + fVec22[IOTA&16383] = fTempPerm139; + fRec66[0] = (fSlow43 + (0.999f * ((iSlow42 * iTempPerm14) + fRec66[1]))); + fTempPerm140 = (fRec66[0] + -1.49999f); + iTempPerm141 = int(min(8192, max(0, int(fTempPerm140)))); + fTempPerm142 = floorf(fTempPerm140); + fTempPerm143 = (fTempPerm142 + (2.0f - fRec66[0])); + fTempPerm144 = (fRec66[0] - fTempPerm142); + fRec17[0] = ((((fVec22[(IOTA-iTempPerm141)&16383] * fTempPerm143) / fTempPerm144) + fVec22[(IOTA-int((iTempPerm141 + 1)))&16383]) + (fRec17[1] * (0 - (fTempPerm143 / fTempPerm144)))); fRec15[0] = fRec17[0]; - float fTemp160 = (fTemp152 + (6.123234e-17f * fTemp153)); - fVec22[IOTA&16383] = fTemp160; - fRec68[0] = (fSlow44 + (0.999f * ((iSlow43 * iTemp12) + fRec68[1]))); - float fTemp161 = (fRec68[0] + -1.49999f); - int iTemp162 = int(min(8192, max(0, int(fTemp161)))); - float fTemp163 = floorf(fTemp161); - float fTemp164 = (fTemp163 + (2.0f - fRec68[0])); - float fTemp165 = (fRec68[0] - fTemp163); - fRec67[0] = (fVec22[(IOTA-int((iTemp162 + 1)))&16383] + ((fRec67[1] * (0 - (fTemp164 / fTemp165))) + ((fTemp164 * fVec22[(IOTA-iTemp162)&16383]) / fTemp165))); + fTempPerm145 = ((fTempPerm6 * fRec18[1]) + (fTempPerm106 * fTempPerm7)); + fVec23[IOTA&16383] = fTempPerm145; + fRec68[0] = (fSlow45 + (0.999f * ((iSlow44 * iTempPerm14) + fRec68[1]))); + fTempPerm146 = (fRec68[0] + -1.49999f); + iTempPerm147 = int(min(8192, max(0, int(fTempPerm146)))); + fTempPerm148 = floorf(fTempPerm146); + fTempPerm149 = (fTempPerm148 + (2.0f - fRec68[0])); + fTempPerm150 = (fRec68[0] - fTempPerm148); + fRec67[0] = (fVec23[(IOTA-int((iTempPerm147 + 1)))&16383] + ((fRec67[1] * (0 - (fTempPerm149 / fTempPerm150))) + ((fTempPerm149 * fVec23[(IOTA-iTempPerm147)&16383]) / fTempPerm150))); fRec16[0] = fRec67[0]; - float fTemp166 = ((fRec15[1] * fTemp5) + (fTemp3 * fTemp102)); - float fTemp167 = ((fTemp1 * fTemp166) + (fTemp7 * fRec3[1])); - float fTemp168 = ((fTemp1 * fTemp167) + (fTemp7 * fRec6[1])); - float fTemp169 = ((fTemp1 * fTemp168) + (fTemp7 * fRec9[1])); - float fTemp170 = (fTemp1 * fTemp169); - float fTemp171 = (fRec12[1] * fTemp7); - float fTemp172 = ((fTemp5 * fRec16[1]) + (fTemp3 * fTemp107)); - float fTemp173 = ((fRec4[1] * fTemp7) + (fTemp1 * fTemp172)); - float fTemp174 = ((fRec7[1] * fTemp7) + (fTemp1 * fTemp173)); - float fTemp175 = ((fRec10[1] * fTemp7) + (fTemp1 * fTemp174)); - float fTemp176 = ((fRec13[1] * fTemp7) + (fTemp1 * fTemp175)); - float fTemp177 = ((6.123234e-17f * (fTemp170 + fTemp171)) - fTemp176); - fVec23[IOTA&16383] = fTemp177; - fRec69[0] = (fSlow47 + (0.9999f * ((iSlow46 * iTemp12) + fRec69[1]))); - float fTemp178 = (fRec69[0] + -1.49999f); - int iTemp179 = int(min(8192, max(0, int(fTemp178)))); - float fTemp180 = floorf(fTemp178); - float fTemp181 = (fTemp180 + (2.0f - fRec69[0])); - float fTemp182 = (fRec69[0] - fTemp180); - fRec14[0] = ((((fVec23[(IOTA-iTemp179)&16383] * fTemp181) / fTemp182) + fVec23[(IOTA-int((iTemp179 + 1)))&16383]) + (fRec14[1] * (0 - (fTemp181 / fTemp182)))); + fTempPerm151 = ((fTempPerm6 * fRec16[1]) + (fTempPerm95 * fTempPerm7)); + fTempPerm152 = ((fTempPerm4 * fRec4[1]) + (fTempPerm2 * fTempPerm151)); + fTempPerm153 = ((fTempPerm4 * fRec7[1]) + (fTempPerm2 * fTempPerm152)); + fTempPerm154 = ((fTempPerm4 * fRec10[1]) + (fTempPerm2 * fTempPerm153)); + fTempPerm155 = (0 - ((fTempPerm4 * fRec13[1]) + (fTempPerm2 * fTempPerm154))); + fVec24[IOTA&16383] = fTempPerm155; + fRec69[0] = (fSlow48 + (0.9999f * ((iSlow47 * iTempPerm14) + fRec69[1]))); + fTempPerm156 = (fRec69[0] + -1.49999f); + iTempPerm157 = int(min(8192, max(0, int(fTempPerm156)))); + fTempPerm158 = floorf(fTempPerm156); + fTempPerm159 = (fTempPerm158 + (2.0f - fRec69[0])); + fTempPerm160 = (fRec69[0] - fTempPerm158); + fRec14[0] = (fVec24[(IOTA-int((iTempPerm157 + 1)))&16383] + ((fRec14[1] * (0 - (fTempPerm159 / fTempPerm160))) + ((fTempPerm159 * fVec24[(IOTA-iTempPerm157)&16383]) / fTempPerm160))); fRec12[0] = fRec14[0]; - float fTemp183 = ((fTemp170 + (6.123234e-17f * fTemp176)) + fTemp171); - fVec24[IOTA&16383] = fTemp183; - fRec71[0] = (fSlow49 + (0.9999f * ((iSlow48 * iTemp12) + fRec71[1]))); - float fTemp184 = (fRec71[0] + -1.49999f); - int iTemp185 = int(min(8192, max(0, int(fTemp184)))); - float fTemp186 = floorf(fTemp184); - float fTemp187 = (fTemp186 + (2.0f - fRec71[0])); - float fTemp188 = (fRec71[0] - fTemp186); - fRec70[0] = (fVec24[(IOTA-int((iTemp185 + 1)))&16383] + ((fRec70[1] * (0 - (fTemp187 / fTemp188))) + ((fTemp187 * fVec24[(IOTA-iTemp185)&16383]) / fTemp188))); + fTempPerm161 = ((fTempPerm6 * fRec15[1]) + (fTempPerm105 * fTempPerm7)); + fTempPerm162 = ((fTempPerm4 * fRec3[1]) + (fTempPerm2 * fTempPerm161)); + fTempPerm163 = ((fTempPerm4 * fRec6[1]) + (fTempPerm2 * fTempPerm162)); + fTempPerm164 = ((fTempPerm4 * fRec9[1]) + (fTempPerm2 * fTempPerm163)); + fTempPerm165 = ((fRec12[1] * fTempPerm4) + (fTempPerm2 * fTempPerm164)); + fVec25[IOTA&16383] = fTempPerm165; + fRec71[0] = (fSlow50 + (0.9999f * ((iSlow49 * iTempPerm14) + fRec71[1]))); + fTempPerm166 = (fRec71[0] + -1.49999f); + iTempPerm167 = int(min(8192, max(0, int(fTempPerm166)))); + fTempPerm168 = floorf(fTempPerm166); + fTempPerm169 = (fTempPerm168 + (2.0f - fRec71[0])); + fTempPerm170 = (fRec71[0] - fTempPerm168); + fRec70[0] = (fVec25[(IOTA-int((iTempPerm167 + 1)))&16383] + ((fRec70[1] * (0 - (fTempPerm169 / fTempPerm170))) + ((fTempPerm169 * fVec25[(IOTA-iTempPerm167)&16383]) / fTempPerm170))); fRec13[0] = fRec70[0]; - float fTemp189 = ((fTemp1 * fRec12[1]) + (fTemp169 * fTemp6)); - float fTemp190 = ((fTemp1 * fRec13[1]) + (fTemp175 * fTemp6)); - float fTemp191 = ((6.123234e-17f * fTemp189) - fTemp190); - fVec25[IOTA&16383] = fTemp191; - fRec72[0] = (fSlow52 + (0.999f * ((iSlow51 * iTemp12) + fRec72[1]))); - float fTemp192 = (fRec72[0] + -1.49999f); - int iTemp193 = int(min(8192, max(0, int(fTemp192)))); - float fTemp194 = floorf(fTemp192); - float fTemp195 = (fTemp194 + (2.0f - fRec72[0])); - float fTemp196 = (fRec72[0] - fTemp194); - fRec11[0] = ((((fVec25[(IOTA-iTemp193)&16383] * fTemp195) / fTemp196) + fVec25[(IOTA-int((iTemp193 + 1)))&16383]) + (fRec11[1] * (0 - (fTemp195 / fTemp196)))); + fTempPerm171 = (0 - ((fTempPerm2 * fRec13[1]) + (fTempPerm3 * fTempPerm154))); + fVec26[IOTA&16383] = fTempPerm171; + fRec72[0] = (fSlow53 + (0.999f * ((iSlow52 * iTempPerm14) + fRec72[1]))); + fTempPerm172 = (fRec72[0] + -1.49999f); + iTempPerm173 = int(min(8192, max(0, int(fTempPerm172)))); + fTempPerm174 = floorf(fTempPerm172); + fTempPerm175 = (fTempPerm174 + (2.0f - fRec72[0])); + fTempPerm176 = (fRec72[0] - fTempPerm174); + fRec11[0] = (fVec26[(IOTA-int((iTempPerm173 + 1)))&16383] + ((fRec11[1] * (0 - (fTempPerm175 / fTempPerm176))) + ((fTempPerm175 * fVec26[(IOTA-iTempPerm173)&16383]) / fTempPerm176))); fRec9[0] = fRec11[0]; - float fTemp197 = (fTemp189 + (6.123234e-17f * fTemp190)); - fVec26[IOTA&16383] = fTemp197; - fRec74[0] = (fSlow54 + (0.999f * ((iSlow53 * iTemp12) + fRec74[1]))); - float fTemp198 = (fRec74[0] + -1.49999f); - int iTemp199 = int(min(8192, max(0, int(fTemp198)))); - float fTemp200 = floorf(fTemp198); - float fTemp201 = (fTemp200 + (2.0f - fRec74[0])); - float fTemp202 = (fRec74[0] - fTemp200); - fRec73[0] = (fVec26[(IOTA-int((iTemp199 + 1)))&16383] + ((fRec73[1] * (0 - (fTemp201 / fTemp202))) + ((fTemp201 * fVec26[(IOTA-iTemp199)&16383]) / fTemp202))); + fTempPerm177 = ((fTempPerm2 * fRec12[1]) + (fTempPerm3 * fTempPerm164)); + fVec27[IOTA&16383] = fTempPerm177; + fRec74[0] = (fSlow55 + (0.999f * ((iSlow54 * iTempPerm14) + fRec74[1]))); + fTempPerm178 = (fRec74[0] + -1.49999f); + iTempPerm179 = int(min(8192, max(0, int(fTempPerm178)))); + fTempPerm180 = floorf(fTempPerm178); + fTempPerm181 = (fTempPerm180 + (2.0f - fRec74[0])); + fTempPerm182 = (fRec74[0] - fTempPerm180); + fRec73[0] = (fVec27[(IOTA-int((iTempPerm179 + 1)))&16383] + ((fRec73[1] * (0 - (fTempPerm181 / fTempPerm182))) + ((fTempPerm181 * fVec27[(IOTA-iTempPerm179)&16383]) / fTempPerm182))); fRec10[0] = fRec73[0]; - float fTemp203 = ((fTemp1 * fRec9[1]) + (fTemp168 * fTemp6)); - float fTemp204 = ((fTemp1 * fRec10[1]) + (fTemp174 * fTemp6)); - float fTemp205 = ((6.123234e-17f * fTemp203) - fTemp204); - fVec27[IOTA&16383] = fTemp205; - fRec75[0] = (fSlow57 + (0.999f * ((iSlow56 * iTemp12) + fRec75[1]))); - float fTemp206 = (fRec75[0] + -1.49999f); - int iTemp207 = int(min(8192, max(0, int(fTemp206)))); - float fTemp208 = floorf(fTemp206); - float fTemp209 = (fTemp208 + (2.0f - fRec75[0])); - float fTemp210 = (fRec75[0] - fTemp208); - fRec8[0] = ((((fVec27[(IOTA-iTemp207)&16383] * fTemp209) / fTemp210) + fVec27[(IOTA-int((iTemp207 + 1)))&16383]) + (fRec8[1] * (0 - (fTemp209 / fTemp210)))); + fTempPerm183 = (0 - ((fTempPerm2 * fRec10[1]) + (fTempPerm3 * fTempPerm153))); + fVec28[IOTA&16383] = fTempPerm183; + fRec75[0] = (fSlow58 + (0.999f * ((iSlow57 * iTempPerm14) + fRec75[1]))); + fTempPerm184 = (fRec75[0] + -1.49999f); + iTempPerm185 = int(min(8192, max(0, int(fTempPerm184)))); + fTempPerm186 = floorf(fTempPerm184); + fTempPerm187 = (fTempPerm186 + (2.0f - fRec75[0])); + fTempPerm188 = (fRec75[0] - fTempPerm186); + fRec8[0] = (fVec28[(IOTA-int((iTempPerm185 + 1)))&16383] + ((fRec8[1] * (0 - (fTempPerm187 / fTempPerm188))) + ((fTempPerm187 * fVec28[(IOTA-iTempPerm185)&16383]) / fTempPerm188))); fRec6[0] = fRec8[0]; - float fTemp211 = (fTemp203 + (6.123234e-17f * fTemp204)); - fVec28[IOTA&16383] = fTemp211; - fRec77[0] = (fSlow59 + (0.999f * ((iSlow58 * iTemp12) + fRec77[1]))); - float fTemp212 = (fRec77[0] + -1.49999f); - int iTemp213 = int(min(8192, max(0, int(fTemp212)))); - float fTemp214 = floorf(fTemp212); - float fTemp215 = (fTemp214 + (2.0f - fRec77[0])); - float fTemp216 = (fRec77[0] - fTemp214); - fRec76[0] = (fVec28[(IOTA-int((iTemp213 + 1)))&16383] + ((fRec76[1] * (0 - (fTemp215 / fTemp216))) + ((fTemp215 * fVec28[(IOTA-iTemp213)&16383]) / fTemp216))); + fTempPerm189 = ((fTempPerm2 * fRec9[1]) + (fTempPerm3 * fTempPerm163)); + fVec29[IOTA&16383] = fTempPerm189; + fRec77[0] = (fSlow60 + (0.999f * ((iSlow59 * iTempPerm14) + fRec77[1]))); + fTempPerm190 = (fRec77[0] + -1.49999f); + iTempPerm191 = int(min(8192, max(0, int(fTempPerm190)))); + fTempPerm192 = floorf(fTempPerm190); + fTempPerm193 = (fTempPerm192 + (2.0f - fRec77[0])); + fTempPerm194 = (fRec77[0] - fTempPerm192); + fRec76[0] = (fVec29[(IOTA-int((iTempPerm191 + 1)))&16383] + ((fRec76[1] * (0 - (fTempPerm193 / fTempPerm194))) + ((fTempPerm193 * fVec29[(IOTA-iTempPerm191)&16383]) / fTempPerm194))); fRec7[0] = fRec76[0]; - float fTemp217 = ((fTemp1 * fRec6[1]) + (fTemp167 * fTemp6)); - float fTemp218 = ((fTemp1 * fRec7[1]) + (fTemp173 * fTemp6)); - float fTemp219 = ((6.123234e-17f * fTemp217) - fTemp218); - fVec29[IOTA&16383] = fTemp219; - fRec78[0] = (fSlow62 + (0.999f * ((iSlow61 * iTemp12) + fRec78[1]))); - float fTemp220 = (fRec78[0] + -1.49999f); - int iTemp221 = int(min(8192, max(0, int(fTemp220)))); - float fTemp222 = floorf(fTemp220); - float fTemp223 = (fTemp222 + (2.0f - fRec78[0])); - float fTemp224 = (fRec78[0] - fTemp222); - fRec5[0] = ((((fVec29[(IOTA-iTemp221)&16383] * fTemp223) / fTemp224) + fVec29[(IOTA-int((iTemp221 + 1)))&16383]) + (fRec5[1] * (0 - (fTemp223 / fTemp224)))); + fTempPerm195 = (0 - ((fTempPerm2 * fRec7[1]) + (fTempPerm3 * fTempPerm152))); + fVec30[IOTA&16383] = fTempPerm195; + fRec78[0] = (fSlow63 + (0.999f * ((iSlow62 * iTempPerm14) + fRec78[1]))); + fTempPerm196 = (fRec78[0] + -1.49999f); + iTempPerm197 = int(min(8192, max(0, int(fTempPerm196)))); + fTempPerm198 = floorf(fTempPerm196); + fTempPerm199 = (fTempPerm198 + (2.0f - fRec78[0])); + fTempPerm200 = (fRec78[0] - fTempPerm198); + fRec5[0] = (fVec30[(IOTA-int((iTempPerm197 + 1)))&16383] + ((fRec5[1] * (0 - (fTempPerm199 / fTempPerm200))) + ((fTempPerm199 * fVec30[(IOTA-iTempPerm197)&16383]) / fTempPerm200))); fRec3[0] = fRec5[0]; - float fTemp225 = (fTemp217 + (6.123234e-17f * fTemp218)); - fVec30[IOTA&16383] = fTemp225; - fRec80[0] = (fSlow64 + (0.999f * ((iSlow63 * iTemp12) + fRec80[1]))); - float fTemp226 = (fRec80[0] + -1.49999f); - int iTemp227 = int(min(8192, max(0, int(fTemp226)))); - float fTemp228 = floorf(fTemp226); - float fTemp229 = (fTemp228 + (2.0f - fRec80[0])); - float fTemp230 = (fRec80[0] - fTemp228); - fRec79[0] = (fVec30[(IOTA-int((iTemp227 + 1)))&16383] + ((fRec79[1] * (0 - (fTemp229 / fTemp230))) + ((fTemp229 * fVec30[(IOTA-iTemp227)&16383]) / fTemp230))); + fTempPerm201 = ((fTempPerm2 * fRec6[1]) + (fTempPerm3 * fTempPerm162)); + fVec31[IOTA&16383] = fTempPerm201; + fRec80[0] = (fSlow65 + (0.999f * ((iSlow64 * iTempPerm14) + fRec80[1]))); + fTempPerm202 = (fRec80[0] + -1.49999f); + iTempPerm203 = int(min(8192, max(0, int(fTempPerm202)))); + fTempPerm204 = floorf(fTempPerm202); + fTempPerm205 = (fTempPerm204 + (2.0f - fRec80[0])); + fTempPerm206 = (fRec80[0] - fTempPerm204); + fRec79[0] = (fVec31[(IOTA-int((iTempPerm203 + 1)))&16383] + ((fRec79[1] * (0 - (fTempPerm205 / fTempPerm206))) + ((fTempPerm205 * fVec31[(IOTA-iTempPerm203)&16383]) / fTempPerm206))); fRec4[0] = fRec79[0]; - fVec31[0] = fSlow65; - float fTemp231 = (fSlow65 + fVec31[1]); - float fTemp232 = (1.0f - (0.5f * fTemp231)); - fRec2[0] = ((((fTemp1 * fRec3[1]) + (fTemp166 * fTemp6)) * fTemp232) + (0.5f * (fTemp231 * fRec2[1]))); + fTempPerm207 = (1.0f - (0.5f * fTempPerm0)); + fRec2[0] = ((0.5f * (fTempPerm0 * fRec2[1])) + (((fTempPerm2 * fRec3[1]) + (fTempPerm3 * fTempPerm161)) * fTempPerm207)); fRec0[IOTA&1023] = fRec2[0]; - fRec81[0] = ((0.5f * (fTemp231 * fRec81[1])) + (fTemp232 * ((fTemp172 * fTemp6) + (fTemp1 * fRec4[1])))); + fRec81[0] = ((0.5f * (fTempPerm0 * fRec81[1])) + (fTempPerm207 * ((fTempPerm2 * fRec4[1]) + (fTempPerm3 * fTempPerm151)))); fRec1[IOTA&1023] = fRec81[0]; output0[i] = (FAUSTFLOAT)fRec0[(IOTA-0)&1023]; output1[i] = (FAUSTFLOAT)fRec1[(IOTA-0)&1023]; // post processing fRec81[1] = fRec81[0]; fRec2[1] = fRec2[0]; - fVec31[1] = fVec31[0]; fRec4[1] = fRec4[0]; fRec79[1] = fRec79[0]; fRec80[1] = fRec80[0]; @@ -1004,38 +1405,39 @@ class mydsp : public dsp { fRec24[1] = fRec24[0]; fRec26[1] = fRec26[0]; fRec57[1] = fRec57[0]; - fRec28[1] = fRec28[0]; + fRec34[1] = fRec34[0]; fRec55[1] = fRec55[0]; fRec56[1] = fRec56[0]; - fRec27[1] = fRec27[0]; - fRec29[1] = fRec29[0]; + fRec33[1] = fRec33[0]; + fRec35[1] = fRec35[0]; fRec54[1] = fRec54[0]; - fRec31[1] = fRec31[0]; + fRec37[1] = fRec37[0]; fRec52[1] = fRec52[0]; fRec53[1] = fRec53[0]; - fRec30[1] = fRec30[0]; - fRec32[1] = fRec32[0]; + fRec36[1] = fRec36[0]; + fRec38[1] = fRec38[0]; fRec51[1] = fRec51[0]; - fRec34[1] = fRec34[0]; + fRec40[1] = fRec40[0]; fRec49[1] = fRec49[0]; fRec50[1] = fRec50[0]; - fRec33[1] = fRec33[0]; - fRec35[1] = fRec35[0]; + fRec39[1] = fRec39[0]; + fRec41[1] = fRec41[0]; fRec48[1] = fRec48[0]; - fRec37[1] = fRec37[0]; + fRec43[1] = fRec43[0]; fRec46[1] = fRec46[0]; fRec47[1] = fRec47[0]; - fRec36[1] = fRec36[0]; - fRec38[1] = fRec38[0]; - fRec45[1] = fRec45[0]; - fVec5[1] = fVec5[0]; - fRec44[1] = fRec44[0]; - fRec43[1] = fRec43[0]; fRec42[1] = fRec42[0]; - fRec41[1] = fRec41[0]; + fRec44[1] = fRec44[0]; + fRec45[1] = fRec45[0]; + fRec32[1] = fRec32[0]; + fRec31[1] = fRec31[0]; + fRec30[1] = fRec30[0]; + fRec29[1] = fRec29[0]; IOTA = IOTA+1; - fRec40[1] = fRec40[0]; - fRec39[1] = fRec39[0]; + fRec28[1] = fRec28[0]; + fRec27[1] = fRec27[0]; + fVec5[1] = fVec5[0]; + fVec4[1] = fVec4[0]; fVec3[1] = fVec3[0]; fVec2[1] = fVec2[0]; iVec1[1] = iVec1[0]; @@ -1087,7 +1489,7 @@ static std::string normalizeClassName(const std::string& name); void initState(const std::string& name, int sampleRate) { - g_unitName = strdup(name.c_str()); + g_unitName = STRDUP(name.c_str()); mydsp* dsp = new FAUSTCLASS; ControlCounter* cc = new ControlCounter; @@ -1170,9 +1572,9 @@ inline static void copyBuffer(float* dst, int n, float* src) inline static void Faust_updateControls(Faust* unit) { Control* controls = unit->mControls; - int numControls = unit->mNumControls; - int curControl = unit->mDSP->getNumInputs(); - for (int i=0; i < numControls; ++i) { + size_t numControls = unit->mNumControls; + int curControl = unit->mDSP->getNumInputs(); + for (int i = 0; i < numControls; ++i) { float value = IN0(curControl); (controls++)->update(value); curControl++; @@ -1374,4 +1776,10 @@ FAUST_EXPORT void load(InterfaceTable* inTable) #endif // NDEBUG } +#ifdef SUPERNOVA +extern "C" FAUST_EXPORT int server_type(void) { return sc_server_supernova; } +#else +extern "C" FAUST_EXPORT int server_type(void) { return sc_server_scsynth; } +#endif + // EOF diff --git a/source/DEINDUGens/faust_src/JPverbRaw.cpp b/source/DEINDUGens/faust_src/JPverbRaw.cpp index 013752dc7f..a3fd04b5fd 100644 --- a/source/DEINDUGens/faust_src/JPverbRaw.cpp +++ b/source/DEINDUGens/faust_src/JPverbRaw.cpp @@ -1,11 +1,11 @@ //---------------------------------------------------------- -// copyright: "(c) Julian Parker 2013" // name: "JPverbRaw" // version: "1.1" // author: "Julian Parker, bug fixes by Till Bovermann" // license: "GPL2+" +// copyright: "(c) Julian Parker 2013" // -// Code generated with Faust 0.9.98 (http://faust.grame.fr) +// Code generated with Faust 0.12.0 (http://faust.grame.fr) //---------------------------------------------------------- /* link with : "primes" */ @@ -23,11 +23,6 @@ template <> inline float faustpower<0>(float x) { return 1; } template <> inline float faustpower<1>(float x) { return x; } template <> inline float faustpower<2>(float x) { return x*x; } #endif -// If other than 'faust2sc --prefix Faust' is used, sed this as well: -#if !defined(SC_FAUST_PREFIX) -# define SC_FAUST_PREFIX "Faust" -#endif - //------------------------------------------------------------------- // FAUST architecture file for SuperCollider. // Copyright (C) 2005-2012 Stefan Kersten. @@ -48,6 +43,11 @@ template <> inline float faustpower<2>(float x) { return x*x; } // 02111-1307 USA //------------------------------------------------------------------- +// If other than 'faust2sc --prefix Faust' is used, sed this as well: +#if !defined(SC_FAUST_PREFIX) +#define SC_FAUST_PREFIX "Faust" +#endif + #include #include #include @@ -60,9 +60,15 @@ template <> inline float faustpower<2>(float x) { return x*x; } using namespace std; #if defined(__GNUC__) && __GNUC__ >= 4 -# define FAUST_EXPORT __attribute__((visibility("default"))) + #define FAUST_EXPORT __attribute__((visibility("default"))) +#else + #define FAUST_EXPORT SC_API_EXPORT +#endif + +#ifdef WIN32 + #define STRDUP _strdup #else -# define FAUST_EXPORT SC_API_EXPORT + #define STRDUP strdup #endif //---------------------------------------------------------------------------- @@ -234,118 +240,367 @@ class mydsp : public dsp { int iVec0[2]; FAUSTFLOAT fslider1; FAUSTFLOAT fslider2; - FAUSTFLOAT fslider3; - FAUSTFLOAT fslider4; float fConst0; float fConst1; + FAUSTFLOAT fslider3; + float fRec15[2]; + int iTempPerm0; + float fRec16[2]; + float fTempPerm1; + float fTempPerm2; + float fTempPerm3; + float fTempPerm4; + float fTempPerm5; + FAUSTFLOAT fslider4; FAUSTFLOAT fslider5; - float fRec45[2]; + FAUSTFLOAT fslider6; + float fConst2; + FAUSTFLOAT fslider7; + float fTempPerm6; + float fTempPerm7; + float fTempPerm8; int IOTA; float fVec1[16384]; + float fRec53[2]; + float fTempPerm9; + int iTempPerm10; + float fTempPerm11; + float fTempPerm12; + float fTempPerm13; float fRec52[2]; - float fRec51[2]; - float fRec49[2]; + float fRec50[2]; + float fTempPerm14; float fVec2[16384]; + float fRec55[2]; + float fTempPerm15; + int iTempPerm16; + float fTempPerm17; + float fTempPerm18; + float fTempPerm19; float fRec54[2]; - float fRec53[2]; - float fRec50[2]; + float fRec51[2]; + float fTempPerm20; + float fTempPerm21; + float fTempPerm22; + float fTempPerm23; + float fTempPerm24; float fVec3[16384]; - float fRec55[2]; - float fRec48[2]; - float fRec46[2]; - float fVec4[16384]; - float fRec57[2]; float fRec56[2]; + float fTempPerm25; + int iTempPerm26; + float fTempPerm27; + float fTempPerm28; + float fTempPerm29; + float fRec49[2]; float fRec47[2]; + float fTempPerm30; + float fVec4[16384]; + float fRec58[2]; + float fTempPerm31; + int iTempPerm32; + float fTempPerm33; + float fTempPerm34; + float fTempPerm35; + float fRec57[2]; + float fRec48[2]; + float fTempPerm36; + float fTempPerm37; + float fTempPerm38; + float fTempPerm39; + float fTempPerm40; float fVec5[16384]; + float fRec59[2]; + float fTempPerm41; + int iTempPerm42; + float fTempPerm43; + float fTempPerm44; + float fTempPerm45; + float fRec46[2]; float fRec44[2]; - float fRec42[2]; + float fTempPerm46; float fVec6[16384]; - float fRec59[2]; - float fRec58[2]; - float fRec43[2]; - float fVec7[16384]; + float fRec61[2]; + float fTempPerm47; + int iTempPerm48; + float fTempPerm49; + float fTempPerm50; + float fTempPerm51; float fRec60[2]; + float fRec45[2]; + float fTempPerm52; + float fTempPerm53; + float fTempPerm54; + float fTempPerm55; + float fTempPerm56; + float fVec7[16384]; + float fRec62[2]; + float fTempPerm57; + int iTempPerm58; + float fTempPerm59; + float fTempPerm60; + float fTempPerm61; + float fRec43[2]; float fRec41[2]; - float fRec39[2]; + float fTempPerm62; float fVec8[16384]; - float fRec62[2]; - float fRec61[2]; - float fRec40[2]; - float fVec9[16384]; + float fRec64[2]; + float fTempPerm63; + int iTempPerm64; + float fTempPerm65; + float fTempPerm66; + float fTempPerm67; float fRec63[2]; - float fRec38[2]; - float fRec36[2]; + float fRec42[2]; + float fTempPerm68; + float fTempPerm69; + float fTempPerm70; + float fTempPerm71; + float fTempPerm72; + float fVec9[16384]; float fRec65[2]; + float fTempPerm73; + int iTempPerm74; + float fTempPerm75; + float fTempPerm76; + float fTempPerm77; + float fRec40[2]; + float fRec38[2]; + float fTempPerm78; float fVec10[16384]; - float fRec64[2]; - float fRec37[2]; - float fVec11[1024]; - FAUSTFLOAT fslider6; - float fConst2; - FAUSTFLOAT fslider7; - float fRec66[2]; float fRec67[2]; + float fTempPerm79; + int iTempPerm80; + float fTempPerm81; + float fTempPerm82; + float fTempPerm83; + float fRec66[2]; + float fRec39[2]; + float fTempPerm84; + float fVec11[1024]; + float fTempPerm85; + float fTempPerm86; + int iTempPerm87; + int iTempPerm88; + float fTempPerm89; + float fTempPerm90; + float fTempPerm91; + float fTempPerm92; + float fTempPerm93; + float fTempPerm94; + float fTempPerm95; + float fTempPerm96; + float fTempPerm97; + float fTempPerm98; + int iTempPerm99; + float fTempPerm100; + float fTempPerm101; + float fTempPerm102; + int iTempPerm103; + float fTempPerm104; + float fTempPerm105; + float fTempPerm106; + int iTempPerm107; + float fTempPerm108; + int iTempPerm109; + float fTempPerm110; float fVec12[16384]; float fRec68[2]; - float fRec35[2]; + float fTempPerm111; + int iTempPerm112; + float fTempPerm113; + float fTempPerm114; + float fTempPerm115; + float fRec37[2]; + float fTempPerm116; + float fTempPerm117; float fVec13[1024]; + float fTempPerm118; + float fTempPerm119; + int iTempPerm120; + float fTempPerm121; + float fTempPerm122; + float fTempPerm123; + float fTempPerm124; + float fTempPerm125; + float fTempPerm126; + float fTempPerm127; float fVec14[16384]; float fRec70[2]; + float fTempPerm128; + int iTempPerm129; + float fTempPerm130; + float fTempPerm131; + float fTempPerm132; float fRec69[2]; + float fTempPerm133; + float fTempPerm134; float fVec15[16384]; float fRec71[2]; + float fTempPerm135; + int iTempPerm136; + float fTempPerm137; + float fTempPerm138; + float fTempPerm139; + float fRec36[2]; float fRec34[2]; - float fRec32[2]; + float fTempPerm140; float fVec16[16384]; float fRec73[2]; + float fTempPerm141; + int iTempPerm142; + float fTempPerm143; + float fTempPerm144; + float fTempPerm145; float fRec72[2]; - float fRec33[2]; + float fRec35[2]; + float fTempPerm146; + float fTempPerm147; + float fTempPerm148; + float fTempPerm149; + float fTempPerm150; float fVec17[16384]; float fRec74[2]; + float fTempPerm151; + int iTempPerm152; + float fTempPerm153; + float fTempPerm154; + float fTempPerm155; + float fRec33[2]; float fRec31[2]; - float fRec29[2]; + float fTempPerm156; float fVec18[16384]; float fRec76[2]; + float fTempPerm157; + int iTempPerm158; + int iTempPerm159; + float fTempPerm160; + float fTempPerm161; + float fTempPerm162; + float fTempPerm163; float fRec75[2]; - float fRec30[2]; + float fRec32[2]; + float fTempPerm164; + float fTempPerm165; + float fTempPerm166; + float fTempPerm167; + float fTempPerm168; float fVec19[16384]; float fRec77[2]; + float fTempPerm169; + int iTempPerm170; + float fTempPerm171; + float fTempPerm172; + float fTempPerm173; + float fRec30[2]; float fRec28[2]; - float fRec26[2]; + float fTempPerm174; float fVec20[16384]; float fRec79[2]; + float fTempPerm175; + int iTempPerm176; + int iTempPerm177; + float fTempPerm178; + float fTempPerm179; + float fTempPerm180; + float fTempPerm181; float fRec78[2]; - float fRec27[2]; + float fRec29[2]; + float fTempPerm182; + float fTempPerm183; + float fTempPerm184; + float fTempPerm185; + float fTempPerm186; float fVec21[16384]; float fRec80[2]; + float fTempPerm187; + int iTempPerm188; + int iTempPerm189; + float fTempPerm190; + float fTempPerm191; + float fTempPerm192; + float fTempPerm193; + float fRec27[2]; float fRec25[2]; - float fRec23[2]; + float fTempPerm194; float fVec22[16384]; float fRec82[2]; + float fTempPerm195; + int iTempPerm196; + int iTempPerm197; + float fTempPerm198; + float fTempPerm199; + float fTempPerm200; + float fTempPerm201; float fRec81[2]; - float fRec24[2]; + float fRec26[2]; + float fTempPerm202; + float fTempPerm203; + float fTempPerm204; + float fTempPerm205; + float fTempPerm206; float fVec23[16384]; float fRec83[2]; + float fTempPerm207; + int iTempPerm208; + float fTempPerm209; + float fTempPerm210; + float fTempPerm211; + float fRec24[2]; float fRec22[2]; - float fRec20[2]; + float fTempPerm212; float fVec24[16384]; float fRec85[2]; + float fTempPerm213; + int iTempPerm214; + int iTempPerm215; + float fTempPerm216; + float fTempPerm217; + float fTempPerm218; + float fTempPerm219; float fRec84[2]; - float fRec21[2]; + float fRec23[2]; + float fTempPerm220; float fVec25[16384]; + int iTempPerm221; + int iTempPerm222; + float fTempPerm223; + float fTempPerm224; + float fTempPerm225; + float fTempPerm226; + float fTempPerm227; + float fTempPerm228; + int iTempPerm229; + float fTempPerm230; + float fTempPerm231; + float fTempPerm232; + int iTempPerm233; + float fTempPerm234; + float fTempPerm235; + int iTempPerm236; + float fTempPerm237; + int iTempPerm238; + float fTempPerm239; + float fTempPerm240; float fVec26[16384]; float fRec86[2]; - float fRec19[2]; - float fRec18[2]; - float fRec17[3]; - float fRec16[3]; + float fTempPerm241; + int iTempPerm242; + float fTempPerm243; + float fTempPerm244; + float fTempPerm245; + float fRec21[2]; + float fRec20[2]; + float fRec19[3]; + float fRec18[3]; FAUSTFLOAT fslider8; - float fRec15[3]; + float fTempPerm246; + float fRec17[3]; FAUSTFLOAT fslider9; float fRec92[2]; float fRec91[3]; float fRec90[3]; + float fTempPerm247; + float fTempPerm248; float fVec27[2]; float fRec89[2]; float fRec88[3]; @@ -354,19 +609,40 @@ class mydsp : public dsp { float fRec95[2]; float fRec94[3]; float fRec93[3]; + float fTempPerm249; float fVec28[1024]; float fRec14[2]; + float fTempPerm250; + float fTempPerm251; float fVec29[16384]; + float fTempPerm252; + float fTempPerm253; + int iTempPerm254; + float fTempPerm255; + float fTempPerm256; + float fTempPerm257; + float fTempPerm258; + float fTempPerm259; + float fTempPerm260; + float fTempPerm261; float fVec30[16384]; float fRec102[2]; + float fTempPerm262; + int iTempPerm263; + float fTempPerm264; + float fTempPerm265; + float fTempPerm266; float fRec101[2]; float fRec100[2]; float fRec99[3]; float fRec98[3]; + float fTempPerm267; float fRec97[3]; float fRec108[2]; float fRec107[3]; float fRec106[3]; + float fTempPerm268; + float fTempPerm269; float fVec31[2]; float fRec105[2]; float fRec104[3]; @@ -374,32 +650,69 @@ class mydsp : public dsp { float fRec111[2]; float fRec110[3]; float fRec109[3]; + float fTempPerm270; float fVec32[1024]; float fRec96[2]; + float fTempPerm271; + float fTempPerm272; float fVec33[16384]; float fRec13[2]; float fRec11[2]; + float fTempPerm273; float fVec34[16384]; float fRec113[2]; + float fTempPerm274; + int iTempPerm275; + float fTempPerm276; + float fTempPerm277; + float fTempPerm278; float fRec112[2]; float fRec12[2]; + float fTempPerm279; + float fTempPerm280; + float fTempPerm281; + float fTempPerm282; + float fTempPerm283; float fVec35[16384]; float fRec10[2]; float fRec8[2]; + float fTempPerm284; float fVec36[16384]; float fRec114[2]; float fRec9[2]; + float fTempPerm285; + float fTempPerm286; + float fTempPerm287; + float fTempPerm288; + float fTempPerm289; float fVec37[16384]; float fRec7[2]; float fRec5[2]; + float fTempPerm290; float fVec38[16384]; float fRec116[2]; + float fTempPerm291; + int iTempPerm292; + float fTempPerm293; + float fTempPerm294; + float fTempPerm295; float fRec115[2]; float fRec6[2]; + float fTempPerm296; + float fTempPerm297; + float fTempPerm298; + float fTempPerm299; + float fTempPerm300; float fVec39[16384]; float fRec117[2]; + float fTempPerm301; + int iTempPerm302; + float fTempPerm303; + float fTempPerm304; + float fTempPerm305; float fRec4[2]; float fRec2[2]; + float fTempPerm306; float fVec40[16384]; float fRec118[2]; float fRec3[2]; @@ -409,26 +722,26 @@ class mydsp : public dsp { public: virtual void metadata(Meta* m) { - m->declare("copyright", "(c) Julian Parker 2013"); - m->declare("signals.lib/name", "Faust Signal Routing Library"); - m->declare("signals.lib/version", "0.0"); m->declare("name", "JPverbRaw"); m->declare("version", "1.1"); m->declare("author", "Julian Parker, bug fixes by Till Bovermann"); m->declare("license", "GPL2+"); - m->declare("filters.lib/name", "Faust Filters Library"); - m->declare("filters.lib/version", "0.0"); - m->declare("delays.lib/name", "Faust Delay Library"); - m->declare("delays.lib/version", "0.0"); + m->declare("copyright", "(c) Julian Parker 2013"); m->declare("oscillators.lib/name", "Faust Oscillator Library"); m->declare("oscillators.lib/version", "0.0"); + m->declare("signals.lib/name", "Faust Signal Routing Library"); + m->declare("signals.lib/version", "0.0"); + m->declare("delays.lib/name", "Faust Delay Library"); + m->declare("delays.lib/version", "0.0"); + m->declare("filters.lib/name", "Faust Filters Library"); + m->declare("filters.lib/version", "0.0"); + m->declare("analyzers.lib/name", "Faust Analyzer Library"); + m->declare("analyzers.lib/version", "0.0"); m->declare("maths.lib/name", "Faust Math Library"); - m->declare("maths.lib/version", "2.0"); + m->declare("maths.lib/version", "2.1"); m->declare("maths.lib/author", "GRAME"); m->declare("maths.lib/copyright", "GRAME"); m->declare("maths.lib/license", "LGPL with exception"); - m->declare("analyzers.lib/name", "Faust Analyzer Library"); - m->declare("analyzers.lib/version", "0.0"); m->declare("basics.lib/name", "Faust Basic Element Library"); m->declare("basics.lib/version", "0.0"); } @@ -439,124 +752,431 @@ class mydsp : public dsp { } virtual void instanceConstants(int samplingFreq) { fSamplingFreq = samplingFreq; - fConst0 = min(1.92e+05f, max(1e+03f, (float)fSamplingFreq)); - fConst1 = (3.1415927f / fConst0); - fConst2 = (6.2831855f / fConst0); + fConst0 = min(1.92e+05f, max(1.0f, (float)fSamplingFreq)); + fConst1 = (6.2831855f / fConst0); + iTempPerm0 = 0; + fTempPerm1 = 0; + fTempPerm2 = 0; + fTempPerm3 = 0; + fTempPerm4 = 0; + fTempPerm5 = 0; + fConst2 = (3.1415927f / fConst0); + fTempPerm6 = 0; + fTempPerm7 = 0; + fTempPerm8 = 0; + fTempPerm9 = 0; + iTempPerm10 = 0; + fTempPerm11 = 0; + fTempPerm12 = 0; + fTempPerm13 = 0; + fTempPerm14 = 0; + fTempPerm15 = 0; + iTempPerm16 = 0; + fTempPerm17 = 0; + fTempPerm18 = 0; + fTempPerm19 = 0; + fTempPerm20 = 0; + fTempPerm21 = 0; + fTempPerm22 = 0; + fTempPerm23 = 0; + fTempPerm24 = 0; + fTempPerm25 = 0; + iTempPerm26 = 0; + fTempPerm27 = 0; + fTempPerm28 = 0; + fTempPerm29 = 0; + fTempPerm30 = 0; + fTempPerm31 = 0; + iTempPerm32 = 0; + fTempPerm33 = 0; + fTempPerm34 = 0; + fTempPerm35 = 0; + fTempPerm36 = 0; + fTempPerm37 = 0; + fTempPerm38 = 0; + fTempPerm39 = 0; + fTempPerm40 = 0; + fTempPerm41 = 0; + iTempPerm42 = 0; + fTempPerm43 = 0; + fTempPerm44 = 0; + fTempPerm45 = 0; + fTempPerm46 = 0; + fTempPerm47 = 0; + iTempPerm48 = 0; + fTempPerm49 = 0; + fTempPerm50 = 0; + fTempPerm51 = 0; + fTempPerm52 = 0; + fTempPerm53 = 0; + fTempPerm54 = 0; + fTempPerm55 = 0; + fTempPerm56 = 0; + fTempPerm57 = 0; + iTempPerm58 = 0; + fTempPerm59 = 0; + fTempPerm60 = 0; + fTempPerm61 = 0; + fTempPerm62 = 0; + fTempPerm63 = 0; + iTempPerm64 = 0; + fTempPerm65 = 0; + fTempPerm66 = 0; + fTempPerm67 = 0; + fTempPerm68 = 0; + fTempPerm69 = 0; + fTempPerm70 = 0; + fTempPerm71 = 0; + fTempPerm72 = 0; + fTempPerm73 = 0; + iTempPerm74 = 0; + fTempPerm75 = 0; + fTempPerm76 = 0; + fTempPerm77 = 0; + fTempPerm78 = 0; + fTempPerm79 = 0; + iTempPerm80 = 0; + fTempPerm81 = 0; + fTempPerm82 = 0; + fTempPerm83 = 0; + fTempPerm84 = 0; + fTempPerm85 = 0; + fTempPerm86 = 0; + iTempPerm87 = 0; + iTempPerm88 = 0; + fTempPerm89 = 0; + fTempPerm90 = 0; + fTempPerm91 = 0; + fTempPerm92 = 0; + fTempPerm93 = 0; + fTempPerm94 = 0; + fTempPerm95 = 0; + fTempPerm96 = 0; + fTempPerm97 = 0; + fTempPerm98 = 0; + iTempPerm99 = 0; + fTempPerm100 = 0; + fTempPerm101 = 0; + fTempPerm102 = 0; + iTempPerm103 = 0; + fTempPerm104 = 0; + fTempPerm105 = 0; + fTempPerm106 = 0; + iTempPerm107 = 0; + fTempPerm108 = 0; + iTempPerm109 = 0; + fTempPerm110 = 0; + fTempPerm111 = 0; + iTempPerm112 = 0; + fTempPerm113 = 0; + fTempPerm114 = 0; + fTempPerm115 = 0; + fTempPerm116 = 0; + fTempPerm117 = 0; + fTempPerm118 = 0; + fTempPerm119 = 0; + iTempPerm120 = 0; + fTempPerm121 = 0; + fTempPerm122 = 0; + fTempPerm123 = 0; + fTempPerm124 = 0; + fTempPerm125 = 0; + fTempPerm126 = 0; + fTempPerm127 = 0; + fTempPerm128 = 0; + iTempPerm129 = 0; + fTempPerm130 = 0; + fTempPerm131 = 0; + fTempPerm132 = 0; + fTempPerm133 = 0; + fTempPerm134 = 0; + fTempPerm135 = 0; + iTempPerm136 = 0; + fTempPerm137 = 0; + fTempPerm138 = 0; + fTempPerm139 = 0; + fTempPerm140 = 0; + fTempPerm141 = 0; + iTempPerm142 = 0; + fTempPerm143 = 0; + fTempPerm144 = 0; + fTempPerm145 = 0; + fTempPerm146 = 0; + fTempPerm147 = 0; + fTempPerm148 = 0; + fTempPerm149 = 0; + fTempPerm150 = 0; + fTempPerm151 = 0; + iTempPerm152 = 0; + fTempPerm153 = 0; + fTempPerm154 = 0; + fTempPerm155 = 0; + fTempPerm156 = 0; + fTempPerm157 = 0; + iTempPerm158 = 0; + iTempPerm159 = 0; + fTempPerm160 = 0; + fTempPerm161 = 0; + fTempPerm162 = 0; + fTempPerm163 = 0; + fTempPerm164 = 0; + fTempPerm165 = 0; + fTempPerm166 = 0; + fTempPerm167 = 0; + fTempPerm168 = 0; + fTempPerm169 = 0; + iTempPerm170 = 0; + fTempPerm171 = 0; + fTempPerm172 = 0; + fTempPerm173 = 0; + fTempPerm174 = 0; + fTempPerm175 = 0; + iTempPerm176 = 0; + iTempPerm177 = 0; + fTempPerm178 = 0; + fTempPerm179 = 0; + fTempPerm180 = 0; + fTempPerm181 = 0; + fTempPerm182 = 0; + fTempPerm183 = 0; + fTempPerm184 = 0; + fTempPerm185 = 0; + fTempPerm186 = 0; + fTempPerm187 = 0; + iTempPerm188 = 0; + iTempPerm189 = 0; + fTempPerm190 = 0; + fTempPerm191 = 0; + fTempPerm192 = 0; + fTempPerm193 = 0; + fTempPerm194 = 0; + fTempPerm195 = 0; + iTempPerm196 = 0; + iTempPerm197 = 0; + fTempPerm198 = 0; + fTempPerm199 = 0; + fTempPerm200 = 0; + fTempPerm201 = 0; + fTempPerm202 = 0; + fTempPerm203 = 0; + fTempPerm204 = 0; + fTempPerm205 = 0; + fTempPerm206 = 0; + fTempPerm207 = 0; + iTempPerm208 = 0; + fTempPerm209 = 0; + fTempPerm210 = 0; + fTempPerm211 = 0; + fTempPerm212 = 0; + fTempPerm213 = 0; + iTempPerm214 = 0; + iTempPerm215 = 0; + fTempPerm216 = 0; + fTempPerm217 = 0; + fTempPerm218 = 0; + fTempPerm219 = 0; + fTempPerm220 = 0; + iTempPerm221 = 0; + iTempPerm222 = 0; + fTempPerm223 = 0; + fTempPerm224 = 0; + fTempPerm225 = 0; + fTempPerm226 = 0; + fTempPerm227 = 0; + fTempPerm228 = 0; + iTempPerm229 = 0; + fTempPerm230 = 0; + fTempPerm231 = 0; + fTempPerm232 = 0; + iTempPerm233 = 0; + fTempPerm234 = 0; + fTempPerm235 = 0; + iTempPerm236 = 0; + fTempPerm237 = 0; + iTempPerm238 = 0; + fTempPerm239 = 0; + fTempPerm240 = 0; + fTempPerm241 = 0; + iTempPerm242 = 0; + fTempPerm243 = 0; + fTempPerm244 = 0; + fTempPerm245 = 0; + fTempPerm246 = 0; + fTempPerm247 = 0; + fTempPerm248 = 0; + fTempPerm249 = 0; + fTempPerm250 = 0; + fTempPerm251 = 0; + fTempPerm252 = 0; + fTempPerm253 = 0; + iTempPerm254 = 0; + fTempPerm255 = 0; + fTempPerm256 = 0; + fTempPerm257 = 0; + fTempPerm258 = 0; + fTempPerm259 = 0; + fTempPerm260 = 0; + fTempPerm261 = 0; + fTempPerm262 = 0; + iTempPerm263 = 0; + fTempPerm264 = 0; + fTempPerm265 = 0; + fTempPerm266 = 0; + fTempPerm267 = 0; + fTempPerm268 = 0; + fTempPerm269 = 0; + fTempPerm270 = 0; + fTempPerm271 = 0; + fTempPerm272 = 0; + fTempPerm273 = 0; + fTempPerm274 = 0; + iTempPerm275 = 0; + fTempPerm276 = 0; + fTempPerm277 = 0; + fTempPerm278 = 0; + fTempPerm279 = 0; + fTempPerm280 = 0; + fTempPerm281 = 0; + fTempPerm282 = 0; + fTempPerm283 = 0; + fTempPerm284 = 0; + fTempPerm285 = 0; + fTempPerm286 = 0; + fTempPerm287 = 0; + fTempPerm288 = 0; + fTempPerm289 = 0; + fTempPerm290 = 0; + fTempPerm291 = 0; + iTempPerm292 = 0; + fTempPerm293 = 0; + fTempPerm294 = 0; + fTempPerm295 = 0; + fTempPerm296 = 0; + fTempPerm297 = 0; + fTempPerm298 = 0; + fTempPerm299 = 0; + fTempPerm300 = 0; + fTempPerm301 = 0; + iTempPerm302 = 0; + fTempPerm303 = 0; + fTempPerm304 = 0; + fTempPerm305 = 0; + fTempPerm306 = 0; } virtual void instanceResetUserInterface() { fslider0 = 0.707f; fslider1 = 0.0f; - fslider2 = 1.0f; - fslider3 = 1.0f; + fslider2 = 0.1f; + fslider3 = 2.0f; fslider4 = 1.0f; - fslider5 = 2e+03f; - fslider6 = 0.1f; - fslider7 = 2.0f; + fslider5 = 1.0f; + fslider6 = 1.0f; + fslider7 = 2e+03f; fslider8 = 5e+02f; fslider9 = 1.0f; fslider10 = 1.0f; } virtual void instanceClear() { for (int i=0; i<2; i++) iVec0[i] = 0; - for (int i=0; i<2; i++) fRec45[i] = 0; + for (int i=0; i<2; i++) fRec15[i] = 0; + for (int i=0; i<2; i++) fRec16[i] = 0; IOTA = 0; for (int i=0; i<16384; i++) fVec1[i] = 0; + for (int i=0; i<2; i++) fRec53[i] = 0; for (int i=0; i<2; i++) fRec52[i] = 0; - for (int i=0; i<2; i++) fRec51[i] = 0; - for (int i=0; i<2; i++) fRec49[i] = 0; + for (int i=0; i<2; i++) fRec50[i] = 0; for (int i=0; i<16384; i++) fVec2[i] = 0; + for (int i=0; i<2; i++) fRec55[i] = 0; for (int i=0; i<2; i++) fRec54[i] = 0; - for (int i=0; i<2; i++) fRec53[i] = 0; - for (int i=0; i<2; i++) fRec50[i] = 0; + for (int i=0; i<2; i++) fRec51[i] = 0; for (int i=0; i<16384; i++) fVec3[i] = 0; - for (int i=0; i<2; i++) fRec55[i] = 0; - for (int i=0; i<2; i++) fRec48[i] = 0; - for (int i=0; i<2; i++) fRec46[i] = 0; - for (int i=0; i<16384; i++) fVec4[i] = 0; - for (int i=0; i<2; i++) fRec57[i] = 0; for (int i=0; i<2; i++) fRec56[i] = 0; + for (int i=0; i<2; i++) fRec49[i] = 0; for (int i=0; i<2; i++) fRec47[i] = 0; + for (int i=0; i<16384; i++) fVec4[i] = 0; + for (int i=0; i<2; i++) fRec58[i] = 0; + for (int i=0; i<2; i++) fRec57[i] = 0; + for (int i=0; i<2; i++) fRec48[i] = 0; for (int i=0; i<16384; i++) fVec5[i] = 0; + for (int i=0; i<2; i++) fRec59[i] = 0; + for (int i=0; i<2; i++) fRec46[i] = 0; for (int i=0; i<2; i++) fRec44[i] = 0; - for (int i=0; i<2; i++) fRec42[i] = 0; for (int i=0; i<16384; i++) fVec6[i] = 0; - for (int i=0; i<2; i++) fRec59[i] = 0; - for (int i=0; i<2; i++) fRec58[i] = 0; - for (int i=0; i<2; i++) fRec43[i] = 0; - for (int i=0; i<16384; i++) fVec7[i] = 0; + for (int i=0; i<2; i++) fRec61[i] = 0; for (int i=0; i<2; i++) fRec60[i] = 0; + for (int i=0; i<2; i++) fRec45[i] = 0; + for (int i=0; i<16384; i++) fVec7[i] = 0; + for (int i=0; i<2; i++) fRec62[i] = 0; + for (int i=0; i<2; i++) fRec43[i] = 0; for (int i=0; i<2; i++) fRec41[i] = 0; - for (int i=0; i<2; i++) fRec39[i] = 0; for (int i=0; i<16384; i++) fVec8[i] = 0; - for (int i=0; i<2; i++) fRec62[i] = 0; - for (int i=0; i<2; i++) fRec61[i] = 0; - for (int i=0; i<2; i++) fRec40[i] = 0; - for (int i=0; i<16384; i++) fVec9[i] = 0; + for (int i=0; i<2; i++) fRec64[i] = 0; for (int i=0; i<2; i++) fRec63[i] = 0; - for (int i=0; i<2; i++) fRec38[i] = 0; - for (int i=0; i<2; i++) fRec36[i] = 0; + for (int i=0; i<2; i++) fRec42[i] = 0; + for (int i=0; i<16384; i++) fVec9[i] = 0; for (int i=0; i<2; i++) fRec65[i] = 0; + for (int i=0; i<2; i++) fRec40[i] = 0; + for (int i=0; i<2; i++) fRec38[i] = 0; for (int i=0; i<16384; i++) fVec10[i] = 0; - for (int i=0; i<2; i++) fRec64[i] = 0; - for (int i=0; i<2; i++) fRec37[i] = 0; - for (int i=0; i<1024; i++) fVec11[i] = 0; - for (int i=0; i<2; i++) fRec66[i] = 0; for (int i=0; i<2; i++) fRec67[i] = 0; + for (int i=0; i<2; i++) fRec66[i] = 0; + for (int i=0; i<2; i++) fRec39[i] = 0; + for (int i=0; i<1024; i++) fVec11[i] = 0; for (int i=0; i<16384; i++) fVec12[i] = 0; for (int i=0; i<2; i++) fRec68[i] = 0; - for (int i=0; i<2; i++) fRec35[i] = 0; + for (int i=0; i<2; i++) fRec37[i] = 0; for (int i=0; i<1024; i++) fVec13[i] = 0; for (int i=0; i<16384; i++) fVec14[i] = 0; for (int i=0; i<2; i++) fRec70[i] = 0; for (int i=0; i<2; i++) fRec69[i] = 0; for (int i=0; i<16384; i++) fVec15[i] = 0; for (int i=0; i<2; i++) fRec71[i] = 0; + for (int i=0; i<2; i++) fRec36[i] = 0; for (int i=0; i<2; i++) fRec34[i] = 0; - for (int i=0; i<2; i++) fRec32[i] = 0; for (int i=0; i<16384; i++) fVec16[i] = 0; for (int i=0; i<2; i++) fRec73[i] = 0; for (int i=0; i<2; i++) fRec72[i] = 0; - for (int i=0; i<2; i++) fRec33[i] = 0; + for (int i=0; i<2; i++) fRec35[i] = 0; for (int i=0; i<16384; i++) fVec17[i] = 0; for (int i=0; i<2; i++) fRec74[i] = 0; + for (int i=0; i<2; i++) fRec33[i] = 0; for (int i=0; i<2; i++) fRec31[i] = 0; - for (int i=0; i<2; i++) fRec29[i] = 0; for (int i=0; i<16384; i++) fVec18[i] = 0; for (int i=0; i<2; i++) fRec76[i] = 0; for (int i=0; i<2; i++) fRec75[i] = 0; - for (int i=0; i<2; i++) fRec30[i] = 0; + for (int i=0; i<2; i++) fRec32[i] = 0; for (int i=0; i<16384; i++) fVec19[i] = 0; for (int i=0; i<2; i++) fRec77[i] = 0; + for (int i=0; i<2; i++) fRec30[i] = 0; for (int i=0; i<2; i++) fRec28[i] = 0; - for (int i=0; i<2; i++) fRec26[i] = 0; for (int i=0; i<16384; i++) fVec20[i] = 0; for (int i=0; i<2; i++) fRec79[i] = 0; for (int i=0; i<2; i++) fRec78[i] = 0; - for (int i=0; i<2; i++) fRec27[i] = 0; + for (int i=0; i<2; i++) fRec29[i] = 0; for (int i=0; i<16384; i++) fVec21[i] = 0; for (int i=0; i<2; i++) fRec80[i] = 0; + for (int i=0; i<2; i++) fRec27[i] = 0; for (int i=0; i<2; i++) fRec25[i] = 0; - for (int i=0; i<2; i++) fRec23[i] = 0; for (int i=0; i<16384; i++) fVec22[i] = 0; for (int i=0; i<2; i++) fRec82[i] = 0; for (int i=0; i<2; i++) fRec81[i] = 0; - for (int i=0; i<2; i++) fRec24[i] = 0; + for (int i=0; i<2; i++) fRec26[i] = 0; for (int i=0; i<16384; i++) fVec23[i] = 0; for (int i=0; i<2; i++) fRec83[i] = 0; + for (int i=0; i<2; i++) fRec24[i] = 0; for (int i=0; i<2; i++) fRec22[i] = 0; - for (int i=0; i<2; i++) fRec20[i] = 0; for (int i=0; i<16384; i++) fVec24[i] = 0; for (int i=0; i<2; i++) fRec85[i] = 0; for (int i=0; i<2; i++) fRec84[i] = 0; - for (int i=0; i<2; i++) fRec21[i] = 0; + for (int i=0; i<2; i++) fRec23[i] = 0; for (int i=0; i<16384; i++) fVec25[i] = 0; for (int i=0; i<16384; i++) fVec26[i] = 0; for (int i=0; i<2; i++) fRec86[i] = 0; - for (int i=0; i<2; i++) fRec19[i] = 0; - for (int i=0; i<2; i++) fRec18[i] = 0; + for (int i=0; i<2; i++) fRec21[i] = 0; + for (int i=0; i<2; i++) fRec20[i] = 0; + for (int i=0; i<3; i++) fRec19[i] = 0; + for (int i=0; i<3; i++) fRec18[i] = 0; for (int i=0; i<3; i++) fRec17[i] = 0; - for (int i=0; i<3; i++) fRec16[i] = 0; - for (int i=0; i<3; i++) fRec15[i] = 0; for (int i=0; i<2; i++) fRec92[i] = 0; for (int i=0; i<3; i++) fRec91[i] = 0; for (int i=0; i<3; i++) fRec90[i] = 0; @@ -635,21 +1255,23 @@ class mydsp : public dsp { return fSamplingFreq; } virtual void buildUserInterface(UI* ui_interface) { - ui_interface->openVerticalBox("0x00"); + ui_interface->openVerticalBox("JPverbRaw"); ui_interface->addHorizontalSlider("damp", &fslider1, 0.0f, 0.0f, 0.999f, 0.0001f); ui_interface->addHorizontalSlider("earlyDiff", &fslider0, 0.707f, 0.0f, 0.99f, 0.001f); - ui_interface->addHorizontalSlider("highBand", &fslider5, 2e+03f, 1e+03f, 1e+04f, 0.1f); - ui_interface->addHorizontalSlider("highX", &fslider4, 1.0f, 0.0f, 1.0f, 0.01f); + ui_interface->addHorizontalSlider("highBand", &fslider7, 2e+03f, 1e+03f, 1e+04f, 0.1f); + ui_interface->addHorizontalSlider("highX", &fslider6, 1.0f, 0.0f, 1.0f, 0.01f); ui_interface->addHorizontalSlider("lowBand", &fslider8, 5e+02f, 1e+02f, 6e+03f, 0.1f); ui_interface->addHorizontalSlider("lowX", &fslider10, 1.0f, 0.0f, 1.0f, 0.01f); - ui_interface->addHorizontalSlider("mDepth", &fslider6, 0.1f, 0.0f, 1.0f, 0.001f); - ui_interface->addHorizontalSlider("mFreq", &fslider7, 2.0f, 0.0f, 1e+01f, 0.01f); + ui_interface->addHorizontalSlider("mDepth", &fslider2, 0.1f, 0.0f, 1.0f, 0.001f); + ui_interface->addHorizontalSlider("mFreq", &fslider3, 2.0f, 0.0f, 1e+01f, 0.01f); ui_interface->addHorizontalSlider("midX", &fslider9, 1.0f, 0.0f, 1.0f, 0.01f); - ui_interface->addHorizontalSlider("size", &fslider2, 1.0f, 0.5f, 3.0f, 0.01f); - ui_interface->addHorizontalSlider("t60", &fslider3, 1.0f, 0.1f, 6e+01f, 0.1f); + ui_interface->addHorizontalSlider("size", &fslider4, 1.0f, 0.5f, 3.0f, 0.01f); + ui_interface->addHorizontalSlider("t60", &fslider5, 1.0f, 0.1f, 6e+01f, 0.1f); ui_interface->closeBox(); } virtual void compute (int count, FAUSTFLOAT** input, FAUSTFLOAT** output) { + //zone1 + //zone2 float fSlow0 = float(fslider0); float fSlow1 = cosf(fSlow0); float fSlow2 = sinf(fSlow0); @@ -657,76 +1279,76 @@ class mydsp : public dsp { float fSlow4 = float(fslider1); float fSlow5 = (1.0f - fSlow4); float fSlow6 = float(fslider2); - float fSlow7 = powf(10,(0 - (0.51f * (((1.25f * fSlow6) + -0.25f) / float(fslider3))))); - float fSlow8 = float(fslider4); - float fSlow9 = tanf((fConst1 * float(fslider5))); - float fSlow10 = (1.0f / fSlow9); - float fSlow11 = (((fSlow10 + 0.618034f) / fSlow9) + 1); - float fSlow12 = (1.0f / fSlow11); - float fSlow13 = (1.0f / faustpower<2>(fSlow9)); - float fSlow14 = (2 * (0 - fSlow13)); - float fSlow15 = (1.0f / (((fSlow10 + 1.618034f) / fSlow9) + 1)); - float fSlow16 = (fSlow10 + 1); - float fSlow17 = (1.0f / fSlow16); - int iSlow18 = primes((70 * fSlow6)); - float fSlow19 = (0.0001f * iSlow18); - int iSlow20 = primes((10 * fSlow6)); - float fSlow21 = (0.0001f * iSlow20); - int iSlow22 = primes((110 * fSlow6)); - float fSlow23 = (0.0001f * iSlow22); - int iSlow24 = primes((40 * fSlow6)); + float fSlow7 = (50 * fSlow6); + float fSlow8 = (fConst1 * float(fslider3)); + float fSlow9 = sinf(fSlow8); + float fSlow10 = cosf(fSlow8); + float fSlow11 = (0 - fSlow9); + float fSlow12 = float(fslider4); + float fSlow13 = powf(10,(0 - (0.51f * (((1.25f * fSlow12) + -0.25f) / float(fslider5))))); + float fSlow14 = float(fslider6); + float fSlow15 = tanf((fConst2 * float(fslider7))); + float fSlow16 = (1.0f / fSlow15); + float fSlow17 = (((fSlow16 + 0.618034f) / fSlow15) + 1); + float fSlow18 = (1.0f / fSlow17); + float fSlow19 = (1.0f / faustpower<2>(fSlow15)); + float fSlow20 = (1.0f / (((fSlow16 + 1.618034f) / fSlow15) + 1)); + float fSlow21 = (fSlow16 + 1); + float fSlow22 = (0 - ((1 - fSlow16) / fSlow21)); + float fSlow23 = (1.0f / fSlow21); + int iSlow24 = primes((10 * fSlow12)); float fSlow25 = (0.0001f * iSlow24); - int iSlow26 = primes((140 * fSlow6)); + int iSlow26 = primes((110 * fSlow12)); float fSlow27 = (0.0001f * iSlow26); - int iSlow28 = primes((170 * fSlow6)); + int iSlow28 = primes((40 * fSlow12)); float fSlow29 = (0.0001f * iSlow28); - int iSlow30 = primes((100 * fSlow6)); + int iSlow30 = primes((140 * fSlow12)); float fSlow31 = (0.0001f * iSlow30); - int iSlow32 = primes((200 * fSlow6)); + int iSlow32 = primes((70 * fSlow12)); float fSlow33 = (0.0001f * iSlow32); - int iSlow34 = primes((130 * fSlow6)); + int iSlow34 = primes((170 * fSlow12)); float fSlow35 = (0.0001f * iSlow34); - int iSlow36 = primes((230 * fSlow6)); + int iSlow36 = primes((100 * fSlow12)); float fSlow37 = (0.0001f * iSlow36); - float fSlow38 = float(fslider6); - float fSlow39 = (50 * fSlow38); - float fSlow40 = (fConst2 * float(fslider7)); - float fSlow41 = sinf(fSlow40); - float fSlow42 = cosf(fSlow40); - float fSlow43 = (0 - fSlow41); - int iSlow44 = primes((54 * fSlow6)); + int iSlow38 = primes((200 * fSlow12)); + float fSlow39 = (0.0001f * iSlow38); + int iSlow40 = primes((130 * fSlow12)); + float fSlow41 = (0.0001f * iSlow40); + int iSlow42 = primes((230 * fSlow12)); + float fSlow43 = (0.0001f * iSlow42); + int iSlow44 = primes((54 * fSlow12)); float fSlow45 = (0.005f * iSlow44); - float fSlow46 = (0 - (5e+01f * fSlow38)); - int iSlow47 = primes((204 * fSlow6)); + float fSlow46 = (0 - (5e+01f * fSlow6)); + int iSlow47 = primes((204 * fSlow12)); float fSlow48 = (0.005f * iSlow47); - int iSlow49 = primes((125 * fSlow6)); + int iSlow49 = primes((125 * fSlow12)); float fSlow50 = (0.0001f * iSlow49); - int iSlow51 = primes((25 * fSlow6)); + int iSlow51 = primes((25 * fSlow12)); float fSlow52 = (0.0001f * iSlow51); - int iSlow53 = primes((155 * fSlow6)); + int iSlow53 = primes((155 * fSlow12)); float fSlow54 = (0.0001f * iSlow53); - int iSlow55 = primes((55 * fSlow6)); + int iSlow55 = primes((55 * fSlow12)); float fSlow56 = (0.0001f * iSlow55); - int iSlow57 = primes((185 * fSlow6)); + int iSlow57 = primes((185 * fSlow12)); float fSlow58 = (0.0001f * iSlow57); - int iSlow59 = primes((85 * fSlow6)); + int iSlow59 = primes((85 * fSlow12)); float fSlow60 = (0.0001f * iSlow59); - int iSlow61 = primes((215 * fSlow6)); + int iSlow61 = primes((215 * fSlow12)); float fSlow62 = (0.0001f * iSlow61); - int iSlow63 = primes((115 * fSlow6)); + int iSlow63 = primes((115 * fSlow12)); float fSlow64 = (0.0001f * iSlow63); - int iSlow65 = primes((245 * fSlow6)); + int iSlow65 = primes((245 * fSlow12)); float fSlow66 = (0.0001f * iSlow65); - int iSlow67 = primes((145 * fSlow6)); + int iSlow67 = primes((145 * fSlow12)); float fSlow68 = (0.0001f * iSlow67); - int iSlow69 = primes((134 * fSlow6)); + int iSlow69 = primes((134 * fSlow12)); float fSlow70 = (0.005f * iSlow69); - float fSlow71 = (0 - fSlow10); - float fSlow72 = (0 - ((1 - fSlow10) / fSlow16)); - float fSlow73 = (2 * (1 - fSlow13)); - float fSlow74 = (((fSlow10 + -1.618034f) / fSlow9) + 1); - float fSlow75 = (((fSlow10 + -0.618034f) / fSlow9) + 1); - float fSlow76 = tanf((fConst1 * float(fslider8))); + float fSlow71 = (0 - fSlow16); + float fSlow72 = (2 * (1 - fSlow19)); + float fSlow73 = (((fSlow16 + -1.618034f) / fSlow15) + 1); + float fSlow74 = (2 * (0 - fSlow19)); + float fSlow75 = (((fSlow16 + -0.618034f) / fSlow15) + 1); + float fSlow76 = tanf((fConst2 * float(fslider8))); float fSlow77 = (1.0f / fSlow76); float fSlow78 = (1.0f / (((fSlow77 + 1.618034f) / fSlow76) + 1)); float fSlow79 = (((fSlow77 + -1.618034f) / fSlow76) + 1); @@ -740,491 +1362,493 @@ class mydsp : public dsp { float fSlow87 = (0 - ((1 - fSlow77) / fSlow86)); float fSlow88 = (1.0f / fSlow86); float fSlow89 = (0 - fSlow77); - float fSlow90 = (1.0f / (fSlow11 * fSlow76)); + float fSlow90 = (1.0f / (fSlow76 * fSlow17)); float fSlow91 = (((fSlow77 + -1.618034f) / fSlow76) + 1); float fSlow92 = (((fSlow77 + -0.618034f) / fSlow76) + 1); float fSlow93 = float(fslider10); - int iSlow94 = primes((34 * fSlow6)); + int iSlow94 = primes((34 * fSlow12)); float fSlow95 = (0.005f * iSlow94); - int iSlow96 = primes((240 * fSlow6)); + int iSlow96 = primes((240 * fSlow12)); float fSlow97 = (0.0001f * iSlow96); - int iSlow98 = primes((190 * fSlow6)); + int iSlow98 = primes((190 * fSlow12)); float fSlow99 = (0.0001f * iSlow98); - int iSlow100 = primes((175 * fSlow6)); + int iSlow100 = primes((175 * fSlow12)); float fSlow101 = (0.0001f * iSlow100); + //zone2b + //zone3 FAUSTFLOAT* input0 = input[0]; FAUSTFLOAT* input1 = input[1]; FAUSTFLOAT* output0 = output[0]; FAUSTFLOAT* output1 = output[1]; + //LoopGraphScalar for (int i=0; imControls; - int numControls = unit->mNumControls; - int curControl = unit->mDSP->getNumInputs(); - for (int i=0; i < numControls; ++i) { + size_t numControls = unit->mNumControls; + int curControl = unit->mDSP->getNumInputs(); + for (int i = 0; i < numControls; ++i) { float value = IN0(curControl); (controls++)->update(value); curControl++; @@ -1685,4 +2309,10 @@ FAUST_EXPORT void load(InterfaceTable* inTable) #endif // NDEBUG } +#ifdef SUPERNOVA +extern "C" FAUST_EXPORT int server_type(void) { return sc_server_supernova; } +#else +extern "C" FAUST_EXPORT int server_type(void) { return sc_server_scsynth; } +#endif + // EOF diff --git a/source/DEINDUGens/faust_src/README.md b/source/DEINDUGens/faust_src/README.md index ee8567ef6e..8ee0a0bf72 100644 --- a/source/DEINDUGens/faust_src/README.md +++ b/source/DEINDUGens/faust_src/README.md @@ -1,9 +1,14 @@ ## How to update the faust-generated cpp files *for GreyHole and JPverb* +### Changelog ++ Thu Nov 16 2017: based on faust commit 4d20e3acb7c96d7bd229652fb7290430814375da. + +### Generate and compile *official* sc3-plugins sources + Install a recent version of [faust](https://github.com/grame-cncm/faust). -`cd` to the `faust_src` directory and create `cpp` files for the from the `dsp`-files +`cd` to the `faust_src` directory and create `cpp` files from the `dsp`-files Generate the code by diff --git a/source/DEINDUGens/include/faust/au/AUUI.h b/source/DEINDUGens/include/faust/au/AUUI.h index 17f1e758e7..eeeb4d5cf9 100644 --- a/source/DEINDUGens/include/faust/au/AUUI.h +++ b/source/DEINDUGens/include/faust/au/AUUI.h @@ -1,13 +1,3 @@ -/************************************************************************ - - IMPORTANT NOTE : this file contains two clearly delimited sections : - the ARCHITECTURE section (in two parts) and the USER section. Each section - is governed by its own copyright and license. Please check individually - each section for license and copyright information. - *************************************************************************/ - -/*******************BEGIN ARCHITECTURE SECTION (part 1/2)****************/ - /************************************************************************ FAUST Audio Unit UI Copyright (C) 2013 Reza Payami @@ -44,381 +34,346 @@ In order to compile a AU (TM) Synth plugin with this architecture file you will need the proprietary AU SDK from Apple. Please check the corresponding license. - ************************************************************************/ + #include #include "faust/gui/UI.h" +#include "faust/gui/MetaDataUI.h" using namespace std; class auUI; -class auUIObject { -public: - string fLabel; - float* fZone; - - float range(float min, float max, float val) { // AU parameters are normalized in the range [0;1] - val = min + val * (max - min); - return (val < min) ? min : (val > max) ? max : val; - } +struct auUIObject { -public: - auUIObject(const char* label, FAUSTFLOAT* zone) : - fLabel(label), fZone(zone) { - } + string fLabel; + FAUSTFLOAT* fZone; - virtual ~auUIObject() { - } + FAUSTFLOAT range(FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT val) + { // AU parameters are normalized in the range [0;1] + val = min + val * (max - min); + return (val < min) ? min : (val > max) ? max : val; + } - virtual void GetName(char *text) { - std::strcpy(text, fLabel.c_str()); - } + auUIObject(const char* label, FAUSTFLOAT* zone): fLabel(label), fZone(zone) + {} - virtual void SetValue(double f) { - *fZone = range(0.0f, 1.0f, (float) f); - } + virtual ~auUIObject() + {} - virtual float GetValue() { - return *fZone; - } + virtual void GetName(char *text) { + std::strcpy(text, fLabel.c_str()); + } - virtual void GetDisplay(char *text) { - std::sprintf(text, "%f", *fZone); - } + virtual void SetValue(double f) + { + *fZone = range(0.0f, 1.0f, FAUSTFLOAT(f)); + } - virtual long GetID() { /* returns the sum of all the ASCII characters contained in the parameter's label */ - int i; - long acc; - for (i = 0, acc = 0; i < fLabel.length(); i++) - acc += (fLabel.c_str())[i]; - return acc; - } + virtual FAUSTFLOAT GetValue() + { + return *fZone; + } + + virtual void GetDisplay(char *text) + { + std::sprintf(text, "%f", *fZone); + } + + virtual long GetID() + { /* returns the sum of all the ASCII characters contained in the parameter's label */ + int i; + long acc; + for (i = 0, acc = 0; i < fLabel.length(); i++) + acc += (fLabel.c_str())[i]; + return acc; + } }; /**********************************************************************************/ -class auToggleButton: public auUIObject { +struct auToggleButton: public auUIObject { -public: + auToggleButton(const char* label, FAUSTFLOAT* zone) : + auUIObject(label, zone) + {} - auToggleButton(const char* label, FAUSTFLOAT* zone) : - auUIObject(label, zone) { - } + virtual ~auToggleButton() + {} - virtual ~auToggleButton() { - } + virtual FAUSTFLOAT GetValue() + { + return *fZone; + } - virtual float GetValue() { - return *fZone; - } + virtual void SetValue(double f) + { + *fZone = (f > 0.5f) ? 1.0f : 0.0f; + } - virtual void SetValue(double f) { - *fZone = (f > 0.5f) ? 1.0f : 0.0f; - } + virtual void GetDisplay(char *text) + { + (*fZone > 0.5f) ? std::strcpy(text, "ON") : std::strcpy(text, "OFF"); + } - virtual void GetDisplay(char *text) { - (*fZone > 0.5f) ? std::strcpy(text, "ON") : std::strcpy(text, "OFF"); - } }; /**********************************************************************************/ -class auCheckButton: public auUIObject { +struct auCheckButton: public auUIObject { -public: + auCheckButton(const char* label, FAUSTFLOAT* zone) : + auUIObject(label, zone) + {} - auCheckButton(const char* label, FAUSTFLOAT* zone) : - auUIObject(label, zone) { - } + virtual ~auCheckButton() + {} - virtual ~auCheckButton() { - } + virtual FAUSTFLOAT GetValue() + { + return *fZone; + } - virtual float GetValue() { - return *fZone; - } + virtual void SetValue(double f) + { + *fZone = (f > 0.5f) ? 1.0f : 0.0f; + } - virtual void SetValue(double f) { - *fZone = (f > 0.5f) ? 1.0f : 0.0f; - } + virtual void GetDisplay(char *text) + { + (*fZone > 0.5f) ? std::strcpy(text, "ON") : std::strcpy(text, "OFF"); + } - virtual void GetDisplay(char *text) { - (*fZone > 0.5f) ? std::strcpy(text, "ON") : std::strcpy(text, "OFF"); - } }; /**********************************************************************************/ -class auButton: public auUIObject { +struct auButton: public auUIObject { -public: + auButton(const char* label, FAUSTFLOAT* zone) : + auUIObject(label, zone) + {} - auButton(const char* label, FAUSTFLOAT* zone) : - auUIObject(label, zone) { - } + virtual ~auButton() + {} - virtual ~auButton() { - } + virtual FAUSTFLOAT GetValue() + { + return *fZone; + } - virtual float GetValue() { - return *fZone; - } + virtual void SetValue(double f) + { + *fZone = (f > 0.5f) ? 1.0f : 0.0f; + } - virtual void SetValue(double f) { - *fZone = (f > 0.5f) ? 1.0f : 0.0f; - } + virtual void GetDisplay(char *text) + { + (*fZone > 0.5f) ? std::strcpy(text, "ON") : std::strcpy(text, "OFF"); + } - virtual void GetDisplay(char *text) { - (*fZone > 0.5f) ? std::strcpy(text, "ON") : std::strcpy(text, "OFF"); - } }; /**********************************************************************************/ -class auSlider: public auUIObject { +struct auSlider: public auUIObject { -public: - float fInit; - float fMin; - float fMax; - float fStep; + FAUSTFLOAT fInit; + FAUSTFLOAT fMin; + FAUSTFLOAT fMax; + FAUSTFLOAT fStep; bool fIsVertical; -public: + auSlider(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, + FAUSTFLOAT step, bool isVertical) : + auUIObject(label, zone), fInit(init), fMin(min), fMax(max), fStep(step), fIsVertical(isVertical) + {} - auSlider(const char* label, FAUSTFLOAT* zone, float init, float min, float max, - float step, bool isVertical) : - auUIObject(label, zone), fInit(init), fMin(min), fMax(max), fStep(step), fIsVertical(isVertical) { - } + virtual ~auSlider() + {} - virtual ~auSlider() { - } + virtual FAUSTFLOAT GetValue() + { + return (*fZone - fMin) / (fMax - fMin); + } // normalize - virtual float GetValue() { - return (*fZone - fMin) / (fMax - fMin); - } // normalize + virtual void SetValue(double f) + { + *fZone = range(fMin, fMax, FAUSTFLOAT(f)); + } // expand - virtual void SetValue(double f) { - *fZone = range(fMin, fMax, (float) f); - } // expand }; - /**********************************************************************************/ - -class auBargraph: public auUIObject { +struct auBargraph: public auUIObject { -public: - float fInit; - float fMin; - float fMax; - float fStep; + FAUSTFLOAT fInit; + FAUSTFLOAT fMin; + FAUSTFLOAT fMax; + FAUSTFLOAT fStep; bool fIsVertical; -public: + auBargraph(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT min, FAUSTFLOAT max, bool isVertical) : + auUIObject(label, zone), fMin(min), fMax(max), fIsVertical(isVertical) + {} - auBargraph(const char* label, FAUSTFLOAT* zone, float min, float max, bool isVertical) : - auUIObject(label, zone), fMin(min), fMax(max), fIsVertical(isVertical){ - } + virtual ~auBargraph() + {} - virtual ~auBargraph() { - } - - virtual float GetValue() { + virtual FAUSTFLOAT GetValue() + { return (*fZone - fMin) / (fMax - fMin); } // normalize - virtual void SetValue(double f) { - *fZone = range(fMin, fMax, (float) f); + virtual void SetValue(double f) + { + *fZone = range(fMin, fMax, FAUSTFLOAT(f)); } // expand + }; /**********************************************************************************/ -class auBox: public auUIObject { +struct auBox: public auUIObject { -public: - vector children; - bool isVertical; + vector fChildren; + bool fIsVertical; auBox* parent; -public: - auBox(const char* label, auBox* inParent, bool inIsVertical) : - auUIObject(label, NULL), parent(inParent), isVertical(inIsVertical) { - } + auUIObject(label, NULL), parent(inParent), fIsVertical(inIsVertical) + {} - void add(auUIObject* child) { - children.push_back(child); + virtual ~auBox() + {} + + void add(auUIObject* child) + { + fChildren.push_back(child); } - - virtual ~auBox() { - } - + }; - /**********************************************************************************/ //eunum Direction {HORIZONTAL, VERTICAL}; //TODO -class auUI: public UI { -public: +struct auUI: public UI, public MetaDataUI { vector fUITable; - std::set knobSet; auBox* currentBox = NULL; auBox* boundingBox = NULL; -public: - - auUI() { + auUI() + { currentBox = boundingBox = new auBox("", NULL, true); } - virtual ~auUI() { + virtual ~auUI() + { for (vector::iterator iter = fUITable.begin(); - iter != fUITable.end(); iter++) + iter != fUITable.end(); iter++) delete *iter; - //TODO delete boxes + // TODO delete boxes } - - virtual void declare(float* zone, const char* key, const char* value) + void addButton(const char* label, FAUSTFLOAT* zone) { - if (zone == 0) - { - if (strcmp(key, "hidden") == 0) - { - - } - } - else - { - if (strcmp(key,"size") == 0) - { - } - else if (strcmp(key,"tooltip") == 0) - { - } - else if (strcmp(key,"unit") == 0) - { - } - if (strcmp(key,"hidden") == 0) - { - - } - else if (strcmp(key,"style") == 0) - { - if (strstr(value, "knob")) //TODO - { - - knobSet.insert(zone); - } - } - else if (strcmp(key,"color") == 0) - { - } - else if (strcmp(key,"accx") == 0 - || strcmp(key,"accy") == 0 - || strcmp(key,"accz") == 0 - || strcmp(key,"gyrox") == 0 - || strcmp(key,"gyroy") == 0 - || strcmp(key,"gyroz") == 0 - || strcmp(key,"compass") == 0) - { - } - - } - } - - - void addButton(const char* label, FAUSTFLOAT* zone) { auButton* button = new auButton(label, zone); fUITable.push_back(button); currentBox->add(button); } - void openTabBox(const char* label) { - - } + void openTabBox(const char* label) + {} - void addCheckButton(const char* label, FAUSTFLOAT* zone) { + void addCheckButton(const char* label, FAUSTFLOAT* zone) + { auCheckButton* checkButton= new auCheckButton(label, zone); fUITable.push_back(checkButton); currentBox->add(checkButton); } - void addVerticalSlider(const char* label, FAUSTFLOAT* zone, float init, float min, - float max, float step) { + void addVerticalSlider(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT step) + { auSlider* slider = new auSlider(label, zone, init, min, max, step, true); fUITable.push_back(slider); currentBox->add(slider); } - void addHorizontalSlider(const char* label, FAUSTFLOAT* zone, float init, float min, - float max, float step) { + void addHorizontalSlider(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT step) + { auSlider* slider = new auSlider(label, zone, init, min, max, step, false); fUITable.push_back(slider); currentBox->add(slider); } - void addNumEntry(const char* label, FAUSTFLOAT* zone, float init, float min, float max, - float step) { + void addNumEntry(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT step) + { auSlider* slider = new auSlider(label, zone, init, min, max, step, false); fUITable.push_back(slider); currentBox->add(slider); } - void addHorizontalBargraph(const char* label, FAUSTFLOAT* zone, float min, float max) { + void addHorizontalBargraph(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT min, FAUSTFLOAT max) + { auBargraph* bargraph = new auBargraph(label, zone, min, max, false); fUITable.push_back(bargraph); currentBox->add(bargraph); } - void addVerticalBargraph(const char* label, FAUSTFLOAT* zone, float min, float max) { + void addVerticalBargraph(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT min, FAUSTFLOAT max) + { auBargraph* bargraph = new auBargraph(label, zone, min, max, true); fUITable.push_back(bargraph); currentBox->add(bargraph); } - void openHorizontalBox(const char* label) { + void openHorizontalBox(const char* label) + { auBox* box = new auBox(label, currentBox, false); currentBox->add(box); currentBox = box; } - void openVerticalBox(const char* label) { + void openVerticalBox(const char* label) + { auBox* box = new auBox(label, currentBox, true); currentBox->add(box); currentBox = box; } - void closeBox() { - if (currentBox) //TODO else? + void closeBox() + { + if (currentBox) { //TODO else? currentBox = currentBox->parent; + } } - void SetValue(int index, double f) { + void SetValue(int index, double f) + { assert(index < fUITable.size()); fUITable[index]->SetValue(f); } - float GetValue(long index) { + FAUSTFLOAT GetValue(long index) + { assert(index < fUITable.size()); return fUITable[index]->GetValue(); } - void GetDisplay(long index, char *text) { + void GetDisplay(long index, char *text) + { assert(index < fUITable.size()); fUITable[index]->GetDisplay(text); } - void GetName(long index, char *text) { + void GetName(long index, char *text) + { assert(index < fUITable.size()); fUITable[index]->GetName(text); } - long GetNumParams() { + long GetNumParams() + { return fUITable.size(); } @@ -436,13 +391,11 @@ class auUI: public UI { return baseid + id % maxNumberOfId; } - void addNumDisplay(char* label, float* zone, int precision) { - } - - void addTextDisplay(char* label, float* zone, char* names[], float min, - float max) { - } + void addNumDisplay(char* label, FAUSTFLOAT* zone, int precision) + {} + void addTextDisplay(char* label, FAUSTFLOAT* zone, char* names[], FAUSTFLOAT min, FAUSTFLOAT max) + {} }; diff --git a/source/DEINDUGens/include/faust/audio/alsa-dsp.h b/source/DEINDUGens/include/faust/audio/alsa-dsp.h index fec04bcd02..f1fbb7f774 100644 --- a/source/DEINDUGens/include/faust/audio/alsa-dsp.h +++ b/source/DEINDUGens/include/faust/audio/alsa-dsp.h @@ -1,37 +1,24 @@ /************************************************************************ - - IMPORTANT NOTE : this file contains two clearly delimited sections : - the ARCHITECTURE section (in two parts) and the USER section. Each section - is governed by its own copyright and license. Please check individually - each section for license and copyright information. -*************************************************************************/ - -/*******************BEGIN ARCHITECTURE SECTION (part 1/2)****************/ - -/************************************************************************ - FAUST Architecture File - Copyright (C) 2003-2016 GRAME, Centre National de Creation Musicale - --------------------------------------------------------------------- - This Architecture section is free software; you can redistribute it - and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; If not, see . - - EXCEPTION : As a special exception, you may create a larger work - that contains this FAUST architecture section and distribute - that work under terms of your choice, so long as this FAUST - architecture section is not modified. - - - ************************************************************************ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. ************************************************************************/ #ifndef __alsa_dsp__ @@ -210,12 +197,12 @@ struct AudioInterface : public AudioParam err = snd_pcm_open( &fOutputDevice, fCardName, SND_PCM_STREAM_PLAYBACK, 0 ); check_error(err) // setup output device parameters - err = snd_pcm_hw_params_malloc ( &fOutputParams ); check_error(err) + err = snd_pcm_hw_params_malloc(&fOutputParams); check_error(err) setAudioParams(fOutputDevice, fOutputParams); fCardOutputs = fSoftOutputs; snd_pcm_hw_params_set_channels_near(fOutputDevice, fOutputParams, &fCardOutputs); - err = snd_pcm_hw_params (fOutputDevice, fOutputParams ); check_error(err); + err = snd_pcm_hw_params(fOutputDevice, fOutputParams ); check_error(err); // allocate alsa output buffers if (fSampleAccess == SND_PCM_ACCESS_RW_INTERLEAVED) { @@ -248,7 +235,7 @@ struct AudioInterface : public AudioParam // set the number of physical inputs close to what we need err = snd_pcm_hw_params_malloc ( &fInputParams ); check_error(err); setAudioParams(fInputDevice, fInputParams); - fCardInputs = fSoftInputs; + fCardInputs = fSoftInputs; snd_pcm_hw_params_set_channels_near(fInputDevice, fInputParams, &fCardInputs); err = snd_pcm_hw_params (fInputDevice, fInputParams ); check_error(err); @@ -289,12 +276,12 @@ struct AudioInterface : public AudioParam int err; // set params record with initial values - err = snd_pcm_hw_params_any ( stream, params ); + err = snd_pcm_hw_params_any(stream, params); check_error_msg(err, "unable to init parameters") // set alsa access mode (and fSampleAccess field) either to non interleaved or interleaved - err = snd_pcm_hw_params_set_access (stream, params, SND_PCM_ACCESS_RW_NONINTERLEAVED ); + err = snd_pcm_hw_params_set_access(stream, params, SND_PCM_ACCESS_RW_NONINTERLEAVED ); if (err) { err = snd_pcm_hw_params_set_access (stream, params, SND_PCM_ACCESS_RW_INTERLEAVED ); check_error_msg(err, "unable to set access mode neither to non-interleaved or to interleaved"); @@ -312,10 +299,10 @@ struct AudioInterface : public AudioParam snd_pcm_hw_params_set_rate_near (stream, params, &fFrequency, 0); // set period and period size (buffering) - err = snd_pcm_hw_params_set_period_size (stream, params, fBuffering, 0); + err = snd_pcm_hw_params_set_period_size(stream, params, fBuffering, 0); check_error_msg(err, "period size not available"); - err = snd_pcm_hw_params_set_periods (stream, params, fPeriods, 0); + err = snd_pcm_hw_params_set_periods(stream, params, fPeriods, 0); check_error_msg(err, "number of periods not available"); } @@ -571,6 +558,9 @@ struct AudioInterface : public AudioParam #endif printf("--------------\n"); } + + int getNumInputs() { return fCardInputs; } + int getNumOutputs() { return fCardOutputs; } }; @@ -674,26 +664,28 @@ class alsaaudio : public audio return true; } - virtual bool start() + virtual bool start() { - fRunning = true; - if (pthread_create(&fAudioThread, 0, __run, this)) { - fRunning = false; + fRunning = true; + if (pthread_create(&fAudioThread, 0, __run, this)) { + fRunning = false; } - return fRunning; - } + return fRunning; + } - virtual void stop() { - if (fRunning) { - fRunning = false; - pthread_join(fAudioThread, 0); - } - } + virtual void stop() + { + if (fRunning) { + fRunning = false; + pthread_join(fAudioThread, 0); + } + } - virtual int get_buffer_size() { return fAudio->buffering(); } - virtual int get_sample_rate() { return fAudio->frequency(); } + virtual int getBufferSize() { return fAudio->buffering(); } + virtual int getSampleRate() { return fAudio->frequency(); } - virtual void run() { + virtual void run() + { bool rt = setRealtimePriority(); printf(rt ? "RT : ":"NRT: "); fAudio->shortinfo(); AVOIDDENORMALS; @@ -713,6 +705,10 @@ class alsaaudio : public audio } } } + + virtual int getNumInputs() { return fAudio->getNumInputs(); } + virtual int getNumOutputs() { return fAudio->getNumOutputs(); } + }; void* __run (void* ptr) diff --git a/source/DEINDUGens/include/faust/audio/android-dsp.h b/source/DEINDUGens/include/faust/audio/android-dsp.h index 24633cf7e2..5b3e0725a5 100644 --- a/source/DEINDUGens/include/faust/audio/android-dsp.h +++ b/source/DEINDUGens/include/faust/audio/android-dsp.h @@ -1,6 +1,6 @@ /************************************************************************ FAUST Architecture File - Copyright (C) 2015-2015 GRAME, Centre National de Creation Musicale + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale --------------------------------------------------------------------- This Architecture section is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -19,10 +19,7 @@ that contains this FAUST architecture section and distribute that work under terms of your choice, so long as this FAUST architecture section is not modified. - - - ************************************************************************ - *************************************************************************/ + ************************************************************************/ #ifndef __android_dsp__ #define __android_dsp__ @@ -454,22 +451,22 @@ class androidaudio : public audio { } } - virtual int get_buffer_size() + virtual int getBufferSize() { return fBufferSize; } - virtual int get_sample_rate() + virtual int getSampleRate() { return fSampleRate; } - virtual int get_num_inputs() + virtual int getNumInputs() { return fNumInChans; } - virtual int get_num_outputs() + virtual int getNumOutputs() { return fNumOutChans; } diff --git a/source/DEINDUGens/include/faust/audio/audio.h b/source/DEINDUGens/include/faust/audio/audio.h index ced70b713c..360bbcb2ed 100644 --- a/source/DEINDUGens/include/faust/audio/audio.h +++ b/source/DEINDUGens/include/faust/audio/audio.h @@ -1,49 +1,29 @@ /************************************************************************ - IMPORTANT NOTE : this file contains two clearly delimited sections : - the ARCHITECTURE section (in two parts) and the USER section. Each section - is governed by its own copyright and license. Please check individually - each section for license and copyright information. -*************************************************************************/ - -/*******************BEGIN ARCHITECTURE SECTION (part 1/2)****************/ - -/************************************************************************ - FAUST Architecture File - Copyright (C) 2003-2011 GRAME, Centre National de Creation Musicale - --------------------------------------------------------------------- - This Architecture section is free software; you can redistribute it - and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; If not, see . - - EXCEPTION : As a special exception, you may create a larger work - that contains this FAUST architecture section and distribute - that work under terms of your choice, so long as this FAUST - architecture section is not modified. - - - ************************************************************************ - ************************************************************************/ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. -/****************************************************************************** -******************************************************************************* - - An abstraction layer over audio layer - -******************************************************************************* -*******************************************************************************/ + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. + ************************************************************************/ #ifndef __audio__ #define __audio__ - + class dsp; typedef void (* shutdown_callback)(const char* message, void* arg); @@ -59,13 +39,13 @@ class audio { virtual void stop() = 0; virtual void shutdown(shutdown_callback cb, void* arg) {} - virtual int get_buffer_size() = 0; - virtual int get_sample_rate() = 0; + virtual int getBufferSize() = 0; + virtual int getSampleRate() = 0; - virtual int get_num_inputs() { return -1; } - virtual int get_num_outputs() { return -1; } + virtual int getNumInputs() = 0; + virtual int getNumOutputs() = 0; - virtual float get_cpu_load() { return 0.f; } + virtual float getCPULoad() { return 0.f; } }; #endif diff --git a/source/DEINDUGens/include/faust/audio/channels.h b/source/DEINDUGens/include/faust/audio/channels.h index 1e775b3a23..8639729286 100644 --- a/source/DEINDUGens/include/faust/audio/channels.h +++ b/source/DEINDUGens/include/faust/audio/channels.h @@ -1,27 +1,31 @@ /************************************************************************ - ************************************************************************ - FAUST Architecture File - Copyright (C) 2003-2011 GRAME, Centre National de Creation Musicale - --------------------------------------------------------------------- - This Architecture section is free software; you can redistribute it - and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; If not, see . - - ************************************************************************ - ************************************************************************/ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. + ************************************************************************/ #ifndef __audio_channels__ #define __audio_channels__ +#include + #ifndef FAUSTFLOAT #define FAUSTFLOAT float #endif @@ -43,37 +47,37 @@ class channels fNumChannels = nchannels; // allocate audio channels - for (int i = 0; i < fNumChannels; i++) { - fBuffers[i] = new FAUSTFLOAT[fNumFrames]; + for (int chan = 0; chan < fNumChannels; chan++) { + fBuffers[chan] = new FAUSTFLOAT[fNumFrames]; } + + zero(); } void zero() { // allocate audio channels - for (int i = 0; i < fNumChannels; i++) { - for (int f = 0; f < fNumFrames; f++) { - fBuffers[i][f] = FAUSTFLOAT(0.0); - } + for (int chan = 0; chan < fNumChannels; chan++) { + memset(fBuffers[chan], 0, sizeof(FAUSTFLOAT) * fNumFrames); } } void impulse() { // allocate audio channels - for (int i = 0; i < fNumChannels; i++) { - fBuffers[i][0] = FAUSTFLOAT(1.0); - for (int f = 1; f < fNumFrames; f++) { - fBuffers[i][f] = FAUSTFLOAT(0.0); + for (int chan = 0; chan < fNumChannels; chan++) { + fBuffers[chan][0] = FAUSTFLOAT(1.0); + for (int frame = 1; frame < fNumFrames; frame++) { + fBuffers[chan][frame] = FAUSTFLOAT(0.0); } } } void display() { - for (int i = 0; i < fNumChannels; i++) { - for (int f = 0; f < fNumFrames; f++) { - std::cout << "chan = " << i << " frame = " << f << " value = " << fBuffers[i][f] << std::endl; + for (int chan = 0; chan < fNumChannels; chan++) { + for (int frame = 0; frame < fNumFrames; frame++) { + std::cout << "chan = " << chan << " frame = " << frame << " value = " << fBuffers[chan][frame] << std::endl; } } } @@ -81,8 +85,8 @@ class channels virtual ~channels() { // free separate input channels - for (int i = 0; i < fNumChannels; i++) { - delete [] fBuffers[i]; + for (int chan = 0; chan < fNumChannels; chan++) { + delete [] fBuffers[chan]; } delete [] fBuffers; } diff --git a/source/DEINDUGens/include/faust/audio/coreaudio-dsp.h b/source/DEINDUGens/include/faust/audio/coreaudio-dsp.h index ceb2da29a3..f5d05407fa 100644 --- a/source/DEINDUGens/include/faust/audio/coreaudio-dsp.h +++ b/source/DEINDUGens/include/faust/audio/coreaudio-dsp.h @@ -1,36 +1,24 @@ /************************************************************************ - IMPORTANT NOTE : this file contains two clearly delimited sections : - the ARCHITECTURE section (in two parts) and the USER section. Each section - is governed by its own copyright and license. Please check individually - each section for license and copyright information. -*************************************************************************/ - -/*******************BEGIN ARCHITECTURE SECTION (part 1/2)****************/ - -/************************************************************************ - FAUST Architecture File - Copyright (C) 2003-2011 GRAME, Centre National de Creation Musicale - --------------------------------------------------------------------- - This Architecture section is free software; you can redistribute it - and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; If not, see . - - EXCEPTION : As a special exception, you may create a larger work - that contains this FAUST architecture section and distribute - that work under terms of your choice, so long as this FAUST - architecture section is not modified. - - - ************************************************************************ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. ************************************************************************/ #ifndef __coreaudio_dsp__ @@ -1447,7 +1435,7 @@ class TCoreAudioRenderer } } - void set_dsp(dsp* DSP) + void setDsp(dsp* DSP) { fDSP = DSP; } @@ -1483,7 +1471,7 @@ class coreaudio : public audio { printf("Cannot open CoreAudio device\n"); return false; } - fAudioDevice.set_dsp(DSP); + fAudioDevice.setDsp(DSP); // If -1 was given, fSampleRate will be changed by OpenDefault DSP->init(fSampleRate); return true; @@ -1503,11 +1491,11 @@ class coreaudio : public audio { fAudioDevice.Stop(); } - virtual int get_buffer_size() { return fAudioDevice.GetBufferSize(); } - virtual int get_sample_rate() { return fAudioDevice.GetSampleRate(); } + virtual int getBufferSize() { return fAudioDevice.GetBufferSize(); } + virtual int getSampleRate() { return fAudioDevice.GetSampleRate(); } - virtual int get_num_inputs() { return fAudioDevice.GetNumInputs(); } - virtual int get_num_outputs() { return fAudioDevice.GetNumOutputs(); } + virtual int getNumInputs() { return fAudioDevice.GetNumInputs(); } + virtual int getNumOutputs() { return fAudioDevice.GetNumOutputs(); } }; diff --git a/source/DEINDUGens/include/faust/audio/coreaudio-ios-dsp.h b/source/DEINDUGens/include/faust/audio/coreaudio-ios-dsp.h index a835b29a4f..71a10bc9c9 100644 --- a/source/DEINDUGens/include/faust/audio/coreaudio-ios-dsp.h +++ b/source/DEINDUGens/include/faust/audio/coreaudio-ios-dsp.h @@ -1,39 +1,27 @@ /************************************************************************ - - IMPORTANT NOTE : this file contains two clearly delimited sections : - the ARCHITECTURE section (in two parts) and the USER section. Each section - is governed by its own copyright and license. Please check individually - each section for license and copyright information. -*************************************************************************/ - -/*******************BEGIN ARCHITECTURE SECTION (part 1/2)****************/ - -/************************************************************************ - FAUST Architecture File - Copyright (C) 2003-2011 GRAME, Centre National de Creation Musicale - --------------------------------------------------------------------- - This Architecture section is free software; you can redistribute it - and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; If not, see . - - EXCEPTION : As a special exception, you may create a larger work - that contains this FAUST architecture section and distribute - that work under terms of your choice, so long as this FAUST - architecture section is not modified. + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. + ************************************************************************/ - ************************************************************************ - ************************************************************************/ - #ifndef __coreaudio_ios_dsp__ #define __coreaudio_ios_dsp__ @@ -69,7 +57,7 @@ typedef void (* ControlCallback) (void* data); class TiPhoneCoreAudioRenderer { - + protected: AudioUnit fAUHAL; @@ -79,10 +67,10 @@ class TiPhoneCoreAudioRenderer int fHWNumInChans; int fHWNumOutChans; - + ControlCallback fControlCb; void* fControlCbArg; - + dsp* fDSP; AudioBufferList* fCAInputData; @@ -100,7 +88,7 @@ class TiPhoneCoreAudioRenderer printf(" Bits per Channel:%ld\n", inDesc->mBitsPerChannel); printf("- - - - - - - - - - - - - - - - - - - -\n"); } - + static void printError(OSStatus err) { switch (err) { @@ -139,7 +127,7 @@ class TiPhoneCoreAudioRenderer break; } } - + static OSStatus Render(void *inRefCon,AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, UInt32, @@ -148,30 +136,30 @@ class TiPhoneCoreAudioRenderer { return static_cast(inRefCon)->Render(ioActionFlags, inTimeStamp, inNumberFrames, ioData); } - + OSStatus Render(AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, UInt32 inNumberFrames, AudioBufferList *ioData) { OSStatus err = noErr; - + if (fDevNumInChans > 0) { err = AudioUnitRender(fAUHAL, ioActionFlags, inTimeStamp, 1, inNumberFrames, fCAInputData); } - + if (err == noErr) { float* fInChannel[fDevNumInChans]; float* fOutChannel[fDevNumOutChans]; - + for (int chan = 0; chan < fDevNumInChans; chan++) { fInChannel[chan] = (float*)fCAInputData->mBuffers[chan].mData; } - + for (int chan = 0; chan < fDevNumOutChans; chan++) { fOutChannel[chan] = (float*)ioData->mBuffers[chan].mData; } - + if (fControlCb) { fControlCb(fControlCbArg); } @@ -179,28 +167,28 @@ class TiPhoneCoreAudioRenderer } return err; } - + static void InterruptionListener(void *inClientData, UInt32 inInterruption) { TiPhoneCoreAudioRenderer *obj = (TiPhoneCoreAudioRenderer*)inClientData; printf("Session interrupted! --- %s ---", (inInterruption == kAudioSessionBeginInterruption) ? "Begin Interruption" : "End Interruption"); - + if (inInterruption == kAudioSessionEndInterruption) { // Make sure we are again the active session AudioSessionSetActive(true); obj->SetupMixing(); AudioOutputUnitStart(obj->fAUHAL); } - + if (inInterruption == kAudioSessionBeginInterruption) { AudioOutputUnitStop(obj->fAUHAL); } } - + int SetupMixing() { OSStatus err; - + /* 01/07/2014 : cause iRig to fail, so deactivated for now... CFStringRef route; @@ -214,8 +202,8 @@ class TiPhoneCoreAudioRenderer AudioSessionSetProperty(kAudioSessionProperty_OverrideAudioRoute, sizeof(newRoute), &newRoute); } } - */ - + */ + UInt32 allowMixing = true; err = AudioSessionSetProperty(kAudioSessionProperty_OverrideCategoryMixWithOthers, sizeof(allowMixing), &allowMixing); if (err != noErr) { @@ -226,7 +214,7 @@ class TiPhoneCoreAudioRenderer return 0; } } - + static void AudioSessionPropertyListener(void* inClientData, AudioSessionPropertyID inID, UInt32 inDataSize, const void* inData) { TiPhoneCoreAudioRenderer *obj = (TiPhoneCoreAudioRenderer*)inData; @@ -247,7 +235,7 @@ class TiPhoneCoreAudioRenderer } } } - + static int SetAudioCategory(int input, int output) { // Set the audioCategory the way Faust DSP wants @@ -262,42 +250,55 @@ class TiPhoneCoreAudioRenderer audioCategory = kAudioSessionCategory_MediaPlayback; printf("AudioCategory kAudioSessionCategory_MediaPlayback\n"); } - + OSStatus err = AudioSessionSetProperty(kAudioSessionProperty_AudioCategory, sizeof(audioCategory), &audioCategory); if (err != noErr) { printf("Couldn't set audio category\n"); printError(err); return OPEN_ERR; } - + // 09/07/2015 : https://developer.apple.com/library/ios/qa/qa1754/_index.html if (audioCategory == kAudioSessionCategory_PlayAndRecord) { + + // 21/09/2017 Compatible with bluetooth devices. Deactivate bluetooth micro which run at 16khz, use internal micro instead. + /* UInt32 overrideAudioRoute = 1; err = AudioSessionSetProperty(kAudioSessionProperty_OverrideCategoryDefaultToSpeaker, sizeof(UInt32), &overrideAudioRoute); if (err != noErr) { printf("Error setting kAudioSessionProperty_OverrideCategoryDefaultToSpeaker\n"); printError(err); } - + UInt32 allowBluetoothInput = 1; err = AudioSessionSetProperty(kAudioSessionProperty_OverrideCategoryEnableBluetoothInput, sizeof(UInt32), &allowBluetoothInput); if (err != noErr) { printf("Error setting kAudioSessionProperty_OverrideCategoryEnableBluetoothInput\n"); printError(err); } + */ + + // On devices with more than one built-in microphone, the microphone closest to the video camera is used. + UInt32 allowInternalInput = kAudioSessionMode_VideoRecording; + err = AudioSessionSetProperty(kAudioSessionProperty_Mode, sizeof(UInt32), &allowInternalInput); + if (err != noErr) { + printf("Error setting kAudioSessionMode_VideoRecording\n"); + printError(err); + } + } - - #if NOAGC + + #if NOAGC // If input is used, disable AGC if (audioCategory == kAudioSessionCategory_RecordAudio || audioCategory == kAudioSessionCategory_PlayAndRecord) { - + UInt32 sessionMode = kAudioSessionMode_Measurement; err = AudioSessionSetProperty(kAudioSessionProperty_Mode, sizeof(sessionMode), &sessionMode); if (err != noErr) { printf("Error setting kAudioSessionMode_Measurement\n"); printError(err); } - + UInt32 availableGain; UInt32 outSize = sizeof(availableGain); err = AudioSessionGetProperty(kAudioSessionProperty_InputGainAvailable, &outSize, &availableGain); @@ -320,35 +321,35 @@ class TiPhoneCoreAudioRenderer } } } - #endif - + #endif + return NO_ERR; } - + int SetParameters(int bufferSize, int samplerate) { OSStatus err; UInt32 outSize; UInt32 enableIO; AudioStreamBasicDescription srcFormat, dstFormat; - + printf("SetParameters fDevNumInChans = %d fDevNumOutChans = %d bufferSize = %d samplerate = %d\n", fDevNumInChans, fDevNumOutChans, bufferSize, samplerate); - + err = AudioSessionSetActive(true); if (err != noErr) { printf("Couldn't set audio session active\n"); printError(err); return OPEN_ERR; } - + AudioSessionAddPropertyListener(kAudioSessionProperty_AudioRouteChange, AudioSessionPropertyListener, this); AudioSessionAddPropertyListener(kAudioSessionProperty_AudioInputAvailable, AudioSessionPropertyListener, this); AudioSessionAddPropertyListener(kAudioSessionProperty_ServerDied, AudioSessionPropertyListener, this); - + if (SetAudioCategory(fDevNumInChans, fDevNumOutChans) != NO_ERR) { return OPEN_ERR; } - + // Scan Hardware outSize = sizeof(fHWNumInChans); err = AudioSessionGetProperty(kAudioSessionProperty_CurrentHardwareInputNumberChannels, &outSize, &fHWNumInChans); @@ -359,7 +360,7 @@ class TiPhoneCoreAudioRenderer } else { printf("Get hw input channels %d\n", fHWNumInChans); } - + outSize = sizeof(fHWNumOutChans); err = AudioSessionGetProperty(kAudioSessionProperty_CurrentHardwareOutputNumberChannels, &outSize, &fHWNumOutChans); if (err != noErr) { @@ -369,16 +370,17 @@ class TiPhoneCoreAudioRenderer } else { printf("Get hw output channels %d\n", fHWNumOutChans); } - + /* // Possibly reset the audioCategory the way hardware allows + // 21/09/2017 cause problem when use bluetooth, deactive for now if (SetAudioCategory(fHWNumInChans, fHWNumOutChans) != NO_ERR) { return OPEN_ERR; } - + */ if (SetupMixing() < 0) { return OPEN_ERR; } - + Float64 hwSampleRate; outSize = sizeof(hwSampleRate); err = AudioSessionGetProperty(kAudioSessionProperty_CurrentHardwareSampleRate, &outSize, &hwSampleRate); @@ -389,7 +391,7 @@ class TiPhoneCoreAudioRenderer } else { printf("Get hw sample rate %f\n", hwSampleRate); } - + Float32 hwBufferSize; outSize = sizeof(hwBufferSize); err = AudioSessionGetProperty(kAudioSessionProperty_CurrentHardwareIOBufferDuration, &outSize, &hwBufferSize); @@ -400,17 +402,17 @@ class TiPhoneCoreAudioRenderer } else { printf("Get hw buffer duration %f\n", hwBufferSize); } - + Float32 preferredPeriodDuration = float(bufferSize) / float(samplerate); printf("preferredPeriodDuration %f \n", preferredPeriodDuration); - + err = AudioSessionSetProperty(kAudioSessionProperty_PreferredHardwareIOBufferDuration, sizeof(preferredPeriodDuration), &preferredPeriodDuration); if (err != noErr) { printf("Couldn't set i/o buffer duration\n"); printError(err); return OPEN_ERR; } - + Float32 actualPeriodDuration; outSize = sizeof(actualPeriodDuration); err = AudioSessionGetProperty(kAudioSessionProperty_PreferredHardwareIOBufferDuration, &outSize, &actualPeriodDuration); @@ -419,13 +421,13 @@ class TiPhoneCoreAudioRenderer printError(err); return OPEN_ERR; } - + printf("preferredPeriodDuration %f actualPeriodDuration %f\n", preferredPeriodDuration, actualPeriodDuration); if (preferredPeriodDuration != actualPeriodDuration) { printf("Couldn't set hw buffer duration\n"); return OPEN_ERR; } - + Float64 preferredSamplerate = float(samplerate); err = AudioSessionSetProperty(kAudioSessionProperty_PreferredHardwareSampleRate, sizeof(preferredSamplerate), &preferredSamplerate); if (err != noErr) { @@ -433,7 +435,7 @@ class TiPhoneCoreAudioRenderer printError(err); return OPEN_ERR; } - + Float32 inputLatency; outSize = sizeof(inputLatency); err = AudioSessionGetProperty(kAudioSessionProperty_CurrentHardwareInputLatency, &outSize, &inputLatency); @@ -443,7 +445,7 @@ class TiPhoneCoreAudioRenderer } else { printf("inputLatency in sec : %f\n", inputLatency); } - + Float32 outputLatency; outSize = sizeof(outputLatency); err = AudioSessionGetProperty(kAudioSessionProperty_CurrentHardwareOutputLatency, &outSize, &outputLatency); @@ -453,18 +455,18 @@ class TiPhoneCoreAudioRenderer } else { printf("outputLatency in sec : %f\n", outputLatency); } - + // AUHAL AudioComponentDescription cd = {kAudioUnitType_Output, kAudioUnitSubType_RemoteIO, kAudioUnitManufacturer_Apple, 0, 0}; AudioComponent HALOutput = AudioComponentFindNext(NULL, &cd); - + err = AudioComponentInstanceNew(HALOutput, &fAUHAL); if (err != noErr) { printf("Error calling OpenAComponent\n"); printError(err); goto error; } - + enableIO = 1; err = AudioUnitSetProperty(fAUHAL, kAudioOutputUnitProperty_EnableIO, kAudioUnitScope_Output, 0, &enableIO, sizeof(enableIO)); if (err != noErr) { @@ -472,7 +474,7 @@ class TiPhoneCoreAudioRenderer printError(err); goto error; } - + enableIO = 1; err = AudioUnitSetProperty(fAUHAL, kAudioOutputUnitProperty_EnableIO, kAudioUnitScope_Input, 1, &enableIO, sizeof(enableIO)); if (err != noErr) { @@ -480,7 +482,7 @@ class TiPhoneCoreAudioRenderer printError(err); goto error; } - + UInt32 maxFPS; outSize = sizeof(maxFPS); err = AudioUnitGetProperty(fAUHAL, kAudioUnitProperty_MaximumFramesPerSlice, kAudioUnitScope_Global, 0, &maxFPS, &outSize); @@ -491,28 +493,28 @@ class TiPhoneCoreAudioRenderer } else { printf("Get kAudioUnitProperty_MaximumFramesPerSlice %d\n", (unsigned int)maxFPS); } - + err = AudioUnitSetProperty(fAUHAL, kAudioUnitProperty_MaximumFramesPerSlice, kAudioUnitScope_Global, 1, (UInt32*)&bufferSize, sizeof(UInt32)); if (err != noErr) { printf("Error calling AudioUnitSetProperty - kAudioUnitProperty_MaximumFramesPerSlice\n"); printError(err); goto error; } - + err = AudioUnitSetProperty(fAUHAL, kAudioUnitProperty_MaximumFramesPerSlice, kAudioUnitScope_Global, 0, (UInt32*)&bufferSize, sizeof(UInt32)); if (err != noErr) { printf("Error calling AudioUnitSetProperty - kAudioUnitProperty_MaximumFramesPerSlice\n"); printError(err); goto error; } - + err = AudioUnitInitialize(fAUHAL); if (err != noErr) { printf("Cannot initialize AUHAL unit\n"); printError(err); goto error; } - + // Setting format if (fDevNumInChans > 0) { outSize = sizeof(AudioStreamBasicDescription); @@ -522,7 +524,7 @@ class TiPhoneCoreAudioRenderer printError(err); } PrintStreamDesc(&srcFormat); - + srcFormat.mFormatID = kAudioFormatLinearPCM; srcFormat.mFormatFlags = kAudioFormatFlagsNativeFloatPacked | kLinearPCMFormatFlagIsNonInterleaved; srcFormat.mBytesPerPacket = sizeof(AudioUnitSampleType); @@ -530,16 +532,16 @@ class TiPhoneCoreAudioRenderer srcFormat.mBytesPerFrame = sizeof(AudioUnitSampleType); srcFormat.mChannelsPerFrame = fDevNumInChans; srcFormat.mBitsPerChannel = 32; - + PrintStreamDesc(&srcFormat); - + err = AudioUnitSetProperty(fAUHAL, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Output, 1, &srcFormat, sizeof(AudioStreamBasicDescription)); if (err != noErr) { printf("Error calling AudioUnitSetProperty - kAudioUnitProperty_StreamFormat kAudioUnitScope_Output\n"); printError(err); } } - + if (fDevNumOutChans > 0) { outSize = sizeof(AudioStreamBasicDescription); err = AudioUnitGetProperty(fAUHAL, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, 0, &dstFormat, &outSize); @@ -548,7 +550,7 @@ class TiPhoneCoreAudioRenderer printError(err); } PrintStreamDesc(&dstFormat); - + dstFormat.mFormatID = kAudioFormatLinearPCM; dstFormat.mFormatFlags = kAudioFormatFlagsNativeFloatPacked | kLinearPCMFormatFlagIsNonInterleaved; dstFormat.mBytesPerPacket = sizeof(AudioUnitSampleType); @@ -556,16 +558,16 @@ class TiPhoneCoreAudioRenderer dstFormat.mBytesPerFrame = sizeof(AudioUnitSampleType); dstFormat.mChannelsPerFrame = fDevNumOutChans; dstFormat.mBitsPerChannel = 32; - + PrintStreamDesc(&dstFormat); - + err = AudioUnitSetProperty(fAUHAL, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, 0, &dstFormat, sizeof(AudioStreamBasicDescription)); if (err != noErr) { printf("Error calling AudioUnitSetProperty - kAudioUnitProperty_StreamFormat kAudioUnitScope_Input\n"); printError(err); } } - + if (fDevNumInChans > 0 && fDevNumOutChans == 0) { AURenderCallbackStruct output; output.inputProc = Render; @@ -587,7 +589,7 @@ class TiPhoneCoreAudioRenderer goto error; } } - + // Possibly prepare input buffers if (fDevNumInChans > 0) { fCAInputData = (AudioBufferList*)malloc(sizeof(float) + fDevNumInChans * sizeof(AudioBuffer)); @@ -598,9 +600,9 @@ class TiPhoneCoreAudioRenderer fCAInputData->mBuffers[i].mData = malloc(bufferSize * sizeof(float)); } } - + return NO_ERR; - + error: AudioUnitUninitialize(fAUHAL); AudioComponentInstanceDispose(fAUHAL); @@ -624,7 +626,7 @@ class TiPhoneCoreAudioRenderer free(fCAInputData); } } - + int Open(dsp* dsp, int inChan, int outChan, int buffersize, int samplerate, ControlCallback cb, void* arg) { fDSP = dsp; @@ -632,7 +634,7 @@ class TiPhoneCoreAudioRenderer fDevNumOutChans = outChan; fControlCb = cb; fControlCbArg = arg; - + // Initialize and configure the audio session OSStatus err = AudioSessionInitialize(NULL, NULL, InterruptionListener, this); if (err != noErr && err != kAudioSessionAlreadyInitialized) { @@ -640,26 +642,26 @@ class TiPhoneCoreAudioRenderer printError(err); return OPEN_ERR; } - + if (SetParameters(buffersize, samplerate) < 0) { printf("Cannot set parameters to CoreAudio device\n"); return OPEN_ERR; } - + return NO_ERR; } - + int Close() { AudioUnitUninitialize(fAUHAL); AudioComponentInstanceDispose(fAUHAL); return NO_ERR; } - + int Start() { AudioSessionSetActive(true); - + if (AudioOutputUnitStart(fAUHAL) != noErr) { printf("Error while opening device : device open error\n"); return OPEN_ERR; @@ -667,11 +669,11 @@ class TiPhoneCoreAudioRenderer return NO_ERR; } } - + int Stop() { AudioSessionSetActive(false); - + if (AudioOutputUnitStop(fAUHAL) != noErr) { printf("Error while closing device : device close error\n"); return OPEN_ERR; @@ -680,34 +682,37 @@ class TiPhoneCoreAudioRenderer } } + int GetNumInputs() { return fHWNumInChans; } + int GetNumOutputs() { return fHWNumOutChans; } + }; /****************************************************************************** ******************************************************************************* - + CORE AUDIO INTERFACE - + ******************************************************************************* *******************************************************************************/ class iosaudio : public audio { protected: - + TiPhoneCoreAudioRenderer fAudioDevice; int fSampleRate, fBufferSize; ControlCallback fControlCb; void* fControlCbArg; - + public: - + iosaudio(int srate, int bsize, ControlCallback cb = NULL, void* arg = NULL) :fSampleRate(srate), fBufferSize(bsize), fControlCb(cb), fControlCbArg(arg) {} - + virtual ~iosaudio() { fAudioDevice.Close(); } - - virtual bool init(const char* /*name*/, dsp* DSP) + + virtual bool init(const char* /*name*/, dsp* DSP) { DSP->init(fSampleRate); if (fAudioDevice.Open(DSP, DSP->getNumInputs(), DSP->getNumOutputs(), fBufferSize, fSampleRate, fControlCb, fControlCbArg) < 0) { @@ -716,8 +721,8 @@ class iosaudio : public audio { } return true; } - - virtual bool start() + + virtual bool start() { if (fAudioDevice.Start() < 0) { printf("Cannot start iOS audio device\n"); @@ -725,19 +730,20 @@ class iosaudio : public audio { } return true; } - - virtual void stop() + + virtual void stop() { fAudioDevice.Stop(); } - - virtual int get_buffer_size() { return fBufferSize; } - virtual int get_sample_rate() { return fSampleRate; } - + + virtual int getBufferSize() { return fBufferSize; } + virtual int getSampleRate() { return fSampleRate; } + + virtual int getNumInputs() { return fAudioDevice.GetNumInputs(); } + virtual int getNumOutputs() { return fAudioDevice.GetNumOutputs(); } + }; #endif /********************END ARCHITECTURE SECTION (part 2/2)****************/ - - diff --git a/source/DEINDUGens/include/faust/audio/dummy-audio.h b/source/DEINDUGens/include/faust/audio/dummy-audio.h index 67b4df8d6b..d653223232 100644 --- a/source/DEINDUGens/include/faust/audio/dummy-audio.h +++ b/source/DEINDUGens/include/faust/audio/dummy-audio.h @@ -1,45 +1,25 @@ /************************************************************************ - IMPORTANT NOTE : this file contains two clearly delimited sections : - the ARCHITECTURE section (in two parts) and the USER section. Each section - is governed by its own copyright and license. Please check individually - each section for license and copyright information. -*************************************************************************/ - -/*******************BEGIN ARCHITECTURE SECTION (part 1/2)****************/ - -/************************************************************************ - FAUST Architecture File - Copyright (C) 2003-2011 GRAME, Centre National de Creation Musicale - --------------------------------------------------------------------- - This Architecture section is free software; you can redistribute it - and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; If not, see . - - EXCEPTION : As a special exception, you may create a larger work - that contains this FAUST architecture section and distribute - that work under terms of your choice, so long as this FAUST - architecture section is not modified. - - - ************************************************************************ - ************************************************************************/ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. -/****************************************************************************** -******************************************************************************* - - A dummy audio driver - -******************************************************************************* -*******************************************************************************/ + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. + ************************************************************************/ #ifndef __dummy_audio__ #define __dummy_audio__ @@ -62,27 +42,33 @@ class dummyaudio : public audio { dsp* fDSP; long fSampleRate; - long fBufferSize; + long fBufferSize; + + int fNumInputs; + int fNumOutputs; FAUSTFLOAT** fInChannel; FAUSTFLOAT** fOutChannel; + int fRender; int fCount; bool fIsSample; + bool fManager; public: - dummyaudio(int sr, int bs, int count = 10, bool sample = false) - :fSampleRate(sr), fBufferSize(bs), fCount(count), fIsSample(sample) {} + dummyaudio(int sr, int bs, int count = 10, bool sample = false, bool manager = false) + :fSampleRate(sr), fBufferSize(bs), fRender(0), fCount(count), fIsSample(sample), fManager(manager) {} + dummyaudio(int count = 10) - :fSampleRate(48000), fBufferSize(512), fCount(count) {} + :fSampleRate(48000), fBufferSize(512), fRender(0), fCount(count), fIsSample(false), fManager(false) {} - virtual ~dummyaudio() + virtual ~dummyaudio() { - for (int i = 0; i < fDSP->getNumInputs(); i++) { + for (int i = 0; i < fNumInputs; i++) { delete[] fInChannel[i]; } - for (int i = 0; i < fDSP->getNumOutputs(); i++) { + for (int i = 0; i < fNumOutputs; i++) { delete[] fOutChannel[i]; } @@ -93,16 +79,24 @@ class dummyaudio : public audio { virtual bool init(const char* name, dsp* dsp) { fDSP = dsp; - fDSP->init(fSampleRate); + fNumInputs = fDSP->getNumInputs(); + fNumOutputs = fDSP->getNumOutputs(); - fInChannel = new FAUSTFLOAT*[fDSP->getNumInputs()]; - fOutChannel = new FAUSTFLOAT*[fDSP->getNumOutputs()]; + if (fManager) { + // classInit is called elsewhere with a custom memory manager + fDSP->instanceInit(fSampleRate); + } else { + fDSP->init(fSampleRate); + } + + fInChannel = new FAUSTFLOAT*[fNumInputs]; + fOutChannel = new FAUSTFLOAT*[fNumOutputs]; - for (int i = 0; i < fDSP->getNumInputs(); i++) { + for (int i = 0; i < fNumInputs; i++) { fInChannel[i] = new FAUSTFLOAT[fBufferSize]; memset(fInChannel[i], 0, sizeof(FAUSTFLOAT) * fBufferSize); } - for (int i = 0; i < fDSP->getNumOutputs(); i++) { + for (int i = 0; i < fNumOutputs; i++) { fOutChannel[i] = new FAUSTFLOAT[fBufferSize]; memset(fOutChannel[i], 0, sizeof(FAUSTFLOAT) * fBufferSize); } @@ -110,7 +104,8 @@ class dummyaudio : public audio { } virtual bool start() { - while (--fCount > 0) { + fRender = fCount; + while (--fRender > 0) { printf("Render one buffer\n"); render(); } @@ -122,7 +117,7 @@ class dummyaudio : public audio { void render() { fDSP->compute(fBufferSize, fInChannel, fOutChannel); - if (fDSP->getNumInputs() > 0) { + if (fNumInputs > 0) { if (fIsSample) { for (int frame = 0; frame < fBufferSize; frame++) { std::cout << std::setprecision(6) << "sample in " << fInChannel[0][frame] << std::endl; @@ -131,7 +126,7 @@ class dummyaudio : public audio { std::cout << std::setprecision(6) << "sample in " << fInChannel[0][0] << std::endl; } } - if (fDSP->getNumOutputs() > 0) { + if (fNumOutputs > 0) { if (fIsSample) { for (int frame = 0; frame < fBufferSize; frame++) { std::cout << std::fixed << std::setprecision(6) << "sample out " << fOutChannel[0][frame] << std::endl; @@ -141,9 +136,12 @@ class dummyaudio : public audio { } } } - - virtual int get_buffer_size() { return fBufferSize; } - virtual int get_sample_rate() { return fSampleRate; } + + virtual int getBufferSize() { return fBufferSize; } + virtual int getSampleRate() { return fSampleRate; } + + virtual int getNumInputs() { return fNumInputs; } + virtual int getNumOutputs() { return fNumOutputs; } }; diff --git a/source/DEINDUGens/include/faust/audio/jack-dsp.h b/source/DEINDUGens/include/faust/audio/jack-dsp.h index 121cb2107e..7a08468198 100644 --- a/source/DEINDUGens/include/faust/audio/jack-dsp.h +++ b/source/DEINDUGens/include/faust/audio/jack-dsp.h @@ -1,35 +1,24 @@ /************************************************************************ - IMPORTANT NOTE : this file contains two clearly delimited sections : - the ARCHITECTURE section (in two parts) and the USER section. Each section - is governed by its own copyright and license. Please check individually - each section for license and copyright information. -*************************************************************************/ -/*******************BEGIN ARCHITECTURE SECTION (part 1/2)****************/ - -/************************************************************************ - FAUST Architecture File - Copyright (C) 2003-2011 GRAME, Centre National de Creation Musicale - --------------------------------------------------------------------- - This Architecture section is free software; you can redistribute it - and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; If not, see . - - EXCEPTION : As a special exception, you may create a larger work - that contains this FAUST architecture section and distribute - that work under terms of your choice, so long as this FAUST - architecture section is not modified. - - - ************************************************************************ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. ************************************************************************/ #ifndef __jack_dsp__ @@ -47,6 +36,7 @@ #endif #include "faust/audio/audio.h" #include "faust/dsp/dsp.h" +#include "faust/dsp/dsp-adapter.h" #include "faust/midi/jack-midi.h" #if defined(_WIN32) && !defined(__MINGW32__) @@ -129,7 +119,7 @@ class jackaudio : public audio { } // Save client connections - virtual bool save_connections() + virtual bool saveConnections() { if (fClient) { fConnections.clear(); @@ -163,7 +153,7 @@ class jackaudio : public audio { } // Load client connections - void load_connections() + void loadConnections() { std::list >::const_iterator it; for (it = fConnections.begin(); it != fConnections.end(); it++) { @@ -200,10 +190,10 @@ class jackaudio : public audio { fOutChannel[i] = (float*)jack_port_get_buffer(fOutputPorts[i], nframes); } - fDSP->compute(nframes, fInChannel, fOutChannel); + fDSP->compute(nframes, reinterpret_cast(fInChannel), reinterpret_cast(fOutChannel)); return 0; } - + public: jackaudio(const void* icon_data = 0, size_t icon_size = 0, bool auto_connect = true) @@ -241,7 +231,7 @@ class jackaudio : public audio { virtual bool init(const char* name, dsp* dsp) { if (init(name)) { - if (dsp) { set_dsp(dsp); } + if (dsp) { setDsp(dsp); } return true; } else { return false; @@ -303,9 +293,9 @@ class jackaudio : public audio { } if (fConnections.size() > 0) { - load_connections(); + loadConnections(); } else if (fAutoConnect) { - default_connections(); + defaultConnections(); } return true; @@ -314,7 +304,7 @@ class jackaudio : public audio { virtual void stop() { if (fClient) { - save_connections(); + saveConnections(); jack_deactivate(fClient); } } @@ -325,25 +315,25 @@ class jackaudio : public audio { fShutdownArg = arg; } - virtual int get_buffer_size() { return jack_get_buffer_size(fClient); } - virtual int get_sample_rate() { return jack_get_sample_rate(fClient); } + virtual int getBufferSize() { return jack_get_buffer_size(fClient); } + virtual int getSampleRate() { return jack_get_sample_rate(fClient); } - virtual int get_num_inputs() + virtual int getNumInputs() { return fPhysicalInputs.size(); } - virtual int get_num_outputs() + virtual int getNumOutputs() { return fPhysicalOutputs.size(); } // Additional public API - jack_client_t* get_client() { return fClient; } + jack_client_t* getClient() { return fClient; } // Connect to physical inputs/outputs - void default_connections() + void defaultConnections() { // To avoid feedback at launch time, don't connect hardware inputs /* @@ -356,9 +346,10 @@ class jackaudio : public audio { } } - virtual void set_dsp(dsp* dsp) + virtual void setDsp(dsp* dsp) { - fDSP = dsp; + // Warning: possible memory leak here... + fDSP = (sizeof(FAUSTFLOAT) == 8) ? (new dsp_sample_adapter(dsp)) : dsp; for (int i = 0; i < fDSP->getNumInputs(); i++) { char buf[256]; @@ -378,22 +369,22 @@ class jackaudio : public audio { { if (driver) { // Connection between drivers - jack_port_t* src_port = get_output_port(src); - jack_port_t* dst_port = driver->get_input_port(src); + jack_port_t* src_port = getOutputPort(src); + jack_port_t* dst_port = driver->getInputPort(src); if (src_port && dst_port) { jack_connect(fClient, jack_port_name(src_port), jack_port_name(dst_port)); } } else if (reverse) { // Connection to physical input if (src > fPhysicalInputs.size()) return; - jack_port_t* dst_port = get_input_port(dst); + jack_port_t* dst_port = getInputPort(dst); if (dst_port) { jack_connect(fClient, fPhysicalInputs[src], jack_port_name(dst_port)); } } else { // Connection to physical output if (dst > fPhysicalOutputs.size()) return; - jack_port_t* src_port = get_output_port(src); + jack_port_t* src_port = getOutputPort(src); if (src_port) { jack_connect(fClient, jack_port_name(src_port), fPhysicalOutputs[dst]); } @@ -404,34 +395,34 @@ class jackaudio : public audio { { if (driver) { // Connection between drivers - jack_port_t* src_port = get_output_port(src); - jack_port_t* dst_port = driver->get_input_port(src); + jack_port_t* src_port = getOutputPort(src); + jack_port_t* dst_port = driver->getInputPort(src); if (src_port && dst_port) { jack_disconnect(fClient, jack_port_name(src_port), jack_port_name(dst_port)); } } else if (reverse) { // Connection to physical input if (src > fPhysicalInputs.size()) return; - jack_port_t* dst_port = get_input_port(dst); + jack_port_t* dst_port = getInputPort(dst); if (dst_port) { jack_disconnect(fClient, fPhysicalInputs[src], jack_port_name(dst_port)); } } else { // Connection to physical output if (dst > fPhysicalOutputs.size()) return; - jack_port_t* src_port = get_output_port(src); + jack_port_t* src_port = getOutputPort(src); if (src_port) { jack_disconnect(fClient, jack_port_name(src_port), fPhysicalOutputs[dst]); } } } - bool is_connected(jackaudio* driver, int src, int dst, bool reverse) + bool isConnected(jackaudio* driver, int src, int dst, bool reverse) { if (driver) { // Connection between drivers - jack_port_t* src_port = get_output_port(src); - jack_port_t* dst_port = driver->get_input_port(src); + jack_port_t* src_port = getOutputPort(src); + jack_port_t* dst_port = driver->getInputPort(src); if (src_port && dst_port) { return jack_port_connected_to(src_port, jack_port_name(dst_port)); } else { @@ -440,7 +431,7 @@ class jackaudio : public audio { } else if (reverse) { // Connection to physical input if (src > fPhysicalInputs.size()) return false; - jack_port_t* dst_port = get_input_port(dst); + jack_port_t* dst_port = getInputPort(dst); if (dst_port) { return jack_port_connected_to(dst_port, fPhysicalInputs[src]); } else { @@ -449,7 +440,7 @@ class jackaudio : public audio { } else { // Connection to physical output if (dst > fPhysicalOutputs.size()) return false; - jack_port_t* src_port = get_output_port(src); + jack_port_t* src_port = getOutputPort(src); if (src_port) { return jack_port_connected_to(src_port, fPhysicalOutputs[dst]); } else { @@ -458,8 +449,8 @@ class jackaudio : public audio { } } - jack_port_t* get_input_port(int port) { return (port >= 0 && port < fInputPorts.size()) ? fInputPorts[port] : 0; } - jack_port_t* get_output_port(int port) { return (port >= 0 && port < fOutputPorts.size()) ? fOutputPorts[port] : 0; } + jack_port_t* getInputPort(int port) { return (port >= 0 && port < fInputPorts.size()) ? fInputPorts[port] : 0; } + jack_port_t* getOutputPort(int port) { return (port >= 0 && port < fOutputPorts.size()) ? fOutputPorts[port] : 0; } }; @@ -472,9 +463,9 @@ class jackaudio_midi : public jackaudio, public jack_midi_handler { jack_port_t* fInputMidiPort; // JACK input MIDI port jack_port_t* fOutputMidiPort; // JACK output MIDI port - virtual bool save_connections() + virtual bool saveConnections() { - if (jackaudio::save_connections()) { // Audio connections can be saved, so try MIDI + if (jackaudio::saveConnections()) { // Audio connections can be saved, so try MIDI if (fInputMidiPort) { const char** connected_port = jack_port_get_all_connections(fClient, fInputMidiPort); @@ -529,7 +520,7 @@ class jackaudio_midi : public jackaudio, public jack_midi_handler { } // By convention timestamp of -1 means 'no timestamp conversion' : events already have a timestamp espressed in frames - fDSP->compute(-1, nframes, fInChannel, fOutChannel); + fDSP->compute(-1, nframes, reinterpret_cast(fInChannel), reinterpret_cast(fOutChannel)); } virtual void processMidiOut(jack_nframes_t nframes) @@ -571,7 +562,7 @@ class jackaudio_midi : public jackaudio, public jack_midi_handler { virtual bool init(const char* name, dsp* dsp, bool midi = false) { if (jackaudio::init(name)) { - if (dsp) { set_dsp(dsp); } + if (dsp) { setDsp(dsp); } if (midi) { fInputMidiPort = jack_port_register(fClient, "midi_in_1", JACK_DEFAULT_MIDI_TYPE, JackPortIsInput, 0); fOutputMidiPort = jack_port_register(fClient, "midi_out_1", JACK_DEFAULT_MIDI_TYPE, JackPortIsOutput, 0); diff --git a/source/DEINDUGens/include/faust/audio/juce-dsp.h b/source/DEINDUGens/include/faust/audio/juce-dsp.h index 604d53cb61..dcfcf74a44 100644 --- a/source/DEINDUGens/include/faust/audio/juce-dsp.h +++ b/source/DEINDUGens/include/faust/audio/juce-dsp.h @@ -1,7 +1,6 @@ /************************************************************************ FAUST Architecture File - Copyright (C) 2017 Allen Weng - Copyright (C) 2017 GRAME, Centre National de Creation Musicale + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale --------------------------------------------------------------------- This Architecture section is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -20,7 +19,6 @@ that contains this FAUST architecture section and distribute that work under terms of your choice, so long as this FAUST architecture section is not modified. - ************************************************************************/ #ifndef __juce_dsp__ @@ -100,20 +98,20 @@ class juceaudio : public audio, private AudioAppComponent { shutdownAudio(); } - int get_buffer_size() override + int getBufferSize() override { return int(deviceManager.getCurrentAudioDevice()->getCurrentBufferSizeSamples()); } - int get_sample_rate() override + int getSampleRate() override { return int(deviceManager.getCurrentAudioDevice()->getCurrentSampleRate()); } - int get_num_inputs() override { return deviceManager.getCurrentAudioDevice()->getActiveInputChannels().toInteger(); } - int get_num_outputs() override { return deviceManager.getCurrentAudioDevice()->getActiveOutputChannels().toInteger(); } + int getNumInputs() override { return deviceManager.getCurrentAudioDevice()->getActiveInputChannels().toInteger(); } + int getNumOutputs() override { return deviceManager.getCurrentAudioDevice()->getActiveOutputChannels().toInteger(); } - float get_cpu_load() override { return float(deviceManager.getCpuUsage()); } + float getCPULoad() override { return float(deviceManager.getCpuUsage()); } }; #endif diff --git a/source/DEINDUGens/include/faust/audio/netjack-dsp.h b/source/DEINDUGens/include/faust/audio/netjack-dsp.h index 78287903f4..c0f2e0fadb 100644 --- a/source/DEINDUGens/include/faust/audio/netjack-dsp.h +++ b/source/DEINDUGens/include/faust/audio/netjack-dsp.h @@ -1,37 +1,24 @@ /************************************************************************ - - IMPORTANT NOTE : this file contains two clearly delimited sections : - the ARCHITECTURE section (in two parts) and the USER section. Each section - is governed by its own copyright and license. Please check individually - each section for license and copyright information. -*************************************************************************/ - -/*******************BEGIN ARCHITECTURE SECTION (part 1/2)****************/ - -/************************************************************************ - FAUST Architecture File - Copyright (C) 2003-2011 GRAME, Centre National de Creation Musicale - --------------------------------------------------------------------- - This Architecture section is free software; you can redistribute it - and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; If not, see . - - EXCEPTION : As a special exception, you may create a larger work - that contains this FAUST architecture section and distribute - that work under terms of your choice, so long as this FAUST - architecture section is not modified. - - - ************************************************************************ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. ************************************************************************/ #ifndef __netjack_dsp__ @@ -62,35 +49,35 @@ class netjackaudio : public audio jack_master_t fResult; #ifdef RESTART_CB_API - static int net_restart(void* arg) + static int netRestart(void* arg) { printf("Network failure, restart...\n"); - return static_cast(arg)->restart_cb(); + return static_cast(arg)->restartCb(); } #else - static void net_shutdown(void* arg) + static void netShutdown(void* arg) { printf("Network failure, shutdown...\n"); static_cast(arg)->shutdown_cb(); } #endif - static int net_sample_rate(jack_nframes_t nframes, void* arg) + static int netSampleRate(jack_nframes_t nframes, void* arg) { - return static_cast(arg)->set_sample_rate(nframes); + return static_cast(arg)->setSampleRate(nframes); } - static int net_buffer_size(jack_nframes_t nframes, void* arg) + static int netBufferSize(jack_nframes_t nframes, void* arg) { - return static_cast(arg)->set_buffer_size(nframes); + return static_cast(arg)->setBufferSize(nframes); } - static void net_error(int error_code, void* arg) + static void netError(int error_code, void* arg) { - return static_cast(arg)->error_cb(error_code); + return static_cast(arg)->errorCb(error_code); } - static int net_process(jack_nframes_t buffer_size, + static int netProcess(jack_nframes_t buffer_size, int, float** audio_inputs, int, @@ -105,17 +92,17 @@ class netjackaudio : public audio return 0; } - bool init_aux(const char* name, dsp* DSP, int audio_inputs, int audio_outputs, int midi_inputs, int midi_outputs) + bool initAux(const char* name, dsp* DSP, int audio_inputs, int audio_outputs, int midi_inputs, int midi_outputs) { - if (init_aux(name, audio_inputs, audio_outputs, midi_inputs, midi_outputs)) { - set_dsp(DSP); + if (initAux(name, audio_inputs, audio_outputs, midi_inputs, midi_outputs)) { + setDsp(DSP); return true; } else { return false; } } - bool init_aux(const char* name, int audio_inputs, int audio_outputs, int midi_inputs, int midi_outputs) + bool initAux(const char* name, int audio_inputs, int audio_outputs, int midi_inputs, int midi_outputs) { jack_slave_t request = { audio_inputs, @@ -134,40 +121,40 @@ class netjackaudio : public audio return false; } - jack_set_net_slave_process_callback(fNet, net_process, this); + jack_set_net_slave_process_callback(fNet, netProcess, this); #ifdef RESTART_CB_API - jack_set_net_slave_restart_callback(fNet, net_restart, this); + jack_set_net_slave_restart_callback(fNet, netRestart, this); #else - jack_set_net_slave_shutdown_callback(fNet, net_shutdown, this); + jack_set_net_slave_shutdown_callback(fNet, netShutdown, this); #endif - jack_set_net_slave_sample_rate_callback(fNet, net_sample_rate, this); + jack_set_net_slave_sample_rate_callback(fNet, netSampleRate, this); - jack_set_net_slave_buffer_size_callback(fNet, net_buffer_size, this); + jack_set_net_slave_buffer_size_callback(fNet, netBufferSize, this); - jack_set_net_slave_error_callback(fNet, net_error, this); + jack_set_net_slave_error_callback(fNet, netError, this); return true; } // Possibly to be redefined by subclasses - virtual int restart_cb() + virtual int restartCb() { return 0; } - virtual void shutdown_cb() + virtual void shutdownCb() {} - virtual void error_cb(int error_code) + virtual void errorCb(int error_code) {} - virtual int set_sample_rate(jack_nframes_t nframes) + virtual int setSampleRate(jack_nframes_t nframes) { return 0; } - virtual int set_buffer_size(jack_nframes_t nframes) + virtual int setBufferSize(jack_nframes_t nframes) { return 0; } @@ -194,7 +181,7 @@ class netjackaudio : public audio virtual bool init(const char* name, dsp* DSP) { - return init_aux(name, DSP, DSP->getNumInputs(), DSP->getNumOutputs(), 0, 0); + return initAux(name, DSP, DSP->getNumInputs(), DSP->getNumOutputs(), 0, 0); } virtual bool start() @@ -213,14 +200,22 @@ class netjackaudio : public audio } } - void set_dsp(dsp* DSP) + virtual bool isConnexionActive() + { + return jack_net_slave_is_active(fNet); + } + + void setDsp(dsp* DSP) { fDSP = DSP; fDSP->init(fResult.sample_rate); } - virtual int get_buffer_size() { return fResult.buffer_size; } - virtual int get_sample_rate() { return fResult.sample_rate; } + virtual int getBufferSize() { return fResult.buffer_size; } + virtual int getSampleRate() { return fResult.sample_rate; } + + virtual int getNumInputs() { return fDSP->getNumInputs(); } + virtual int getNumOutputs() { return fDSP->getNumOutputs(); } }; @@ -248,13 +243,13 @@ class netjackaudio_control : public netjackaudio, public ControlUI { } // Control buffer always use buffer_size, even if uncomplete data buffer (count < buffer_size) is received - decode_control(audio_inputs[0], fResult.buffer_size); + decodeControl(audio_inputs[0], fResult.buffer_size); // "count" may be less than buffer_size fDSP->compute(count, inputs_tmp, outputs_tmp); // Control buffer always use buffer_size, even if uncomplete data buffer (count < buffer_size) is received - encode_control(audio_outputs[0], fResult.buffer_size); + encodeControl(audio_outputs[0], fResult.buffer_size); } public: @@ -265,8 +260,8 @@ class netjackaudio_control : public netjackaudio, public ControlUI { virtual ~netjackaudio_control() {} - - bool is_connexion_active() + + bool isConnexionActive() { return jack_net_slave_is_active(fNet); } @@ -274,10 +269,10 @@ class netjackaudio_control : public netjackaudio, public ControlUI { virtual bool init(const char* name, dsp* dsp) { dsp->buildUserInterface(this); - return init_aux(name, dsp, dsp->getNumInputs() + 1, dsp->getNumOutputs() + 1, 0, 0); // One more audio port for control + return initAux(name, dsp, dsp->getNumInputs() + 1, dsp->getNumOutputs() + 1, 0, 0); // One more audio port for control } - virtual int restart_cb() + virtual int restartCb() { return -1; } @@ -308,7 +303,7 @@ class netjackaudio_midicontrol : public netjackaudio, public ControlUI, public j } // Control buffer always use buffer_size, even if uncomplete data buffer (count < buffer_size) is received - decode_midi_control(midi_inputs[0], fResult.buffer_size); + decodeMidiControl(midi_inputs[0], fResult.buffer_size); // Decode MIDI messages processMidiInBuffer(midi_inputs[1]); @@ -317,7 +312,7 @@ class netjackaudio_midicontrol : public netjackaudio, public ControlUI, public j fDSP->compute(count, inputs_tmp, outputs_tmp); // Control buffer always use buffer_size, even if uncomplete data buffer (count < buffer_size) is received - encode_midi_control(midi_outputs[0], fResult.buffer_size); + encodeMidiControl(midi_outputs[0], fResult.buffer_size); // Encode MIDI messages processMidiOutBuffer(midi_outputs[1], true); @@ -331,8 +326,8 @@ class netjackaudio_midicontrol : public netjackaudio, public ControlUI, public j virtual ~netjackaudio_midicontrol() {} - - bool is_connexion_active() + + bool isConnexionActive() { return jack_net_slave_is_active(fNet); } @@ -341,10 +336,10 @@ class netjackaudio_midicontrol : public netjackaudio, public ControlUI, public j { dsp->buildUserInterface(this); // One MIDI channel for control, and one MIDI channel for messages in both direction - return init_aux(name, dsp, dsp->getNumInputs(), dsp->getNumOutputs(), 2, 2); + return initAux(name, dsp, dsp->getNumInputs(), dsp->getNumOutputs(), 2, 2); } - virtual int restart_cb() + virtual int restartCb() { return -1; } diff --git a/source/DEINDUGens/include/faust/audio/ofaudio-dsp.h b/source/DEINDUGens/include/faust/audio/ofaudio-dsp.h index 31bf60b4af..e1d033c020 100644 --- a/source/DEINDUGens/include/faust/audio/ofaudio-dsp.h +++ b/source/DEINDUGens/include/faust/audio/ofaudio-dsp.h @@ -1,31 +1,25 @@ - /************************************************************************ - FAUST Architecture File - Copyright (C) 2017 GRAME, Centre National de Creation Musicale - --------------------------------------------------------------------- - This Architecture section is free software; you can redistribute it - and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; If not, see . - - EXCEPTION : As a special exception, you may create a larger work - that contains this FAUST architecture section and distribute - that work under terms of your choice, so long as this FAUST - architecture section is not modified. - - ************************************************************************/ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. -/****************************************************************************** - Using OpenFramework -*******************************************************************************/ + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. + ************************************************************************/ #ifndef __openframework__ #define __openframework__ @@ -131,20 +125,20 @@ class ofaudio : public audio, public ofBaseSoundInput, public ofBaseSoundOutput void shutdown(shutdown_callback cb, void* arg) {} - int get_buffer_size() + int getBufferSize() { return fStream.getBufferSize(); } - int get_sample_rate() + int getSampleRate() { return fStream.getSampleRate(); } - int get_num_inputs() { return fStream.getNumInputChannels(); } - int get_num_outputs() { return fStream.getNumOutputChannels(); } + int getNumInputs() { return fStream.getNumInputChannels(); } + int getNumOutputs() { return fStream.getNumOutputChannels(); } - float get_cpu_load() { return 0.f; } + float getCPULoad() { return 0.f; } }; #endif diff --git a/source/DEINDUGens/include/faust/audio/opensles-android-dsp.h b/source/DEINDUGens/include/faust/audio/opensles-android-dsp.h index fce52d0374..90d89a16ce 100644 --- a/source/DEINDUGens/include/faust/audio/opensles-android-dsp.h +++ b/source/DEINDUGens/include/faust/audio/opensles-android-dsp.h @@ -1,36 +1,24 @@ /************************************************************************ - IMPORTANT NOTE : this file contains two clearly delimited sections : - the ARCHITECTURE section (in two parts) and the USER section. Each section - is governed by its own copyright and license. Please check individually - each section for license and copyright information. -*************************************************************************/ - -/*******************BEGIN ARCHITECTURE SECTION (part 1/2)****************/ - -/************************************************************************ - FAUST Architecture File - Copyright (C) 2003-2014 GRAME, Centre National de Creation Musicale - --------------------------------------------------------------------- - This Architecture section is free software; you can redistribute it - and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; If not, see . - - EXCEPTION : As a special exception, you may create a larger work - that contains this FAUST architecture section and distribute - that work under terms of your choice, so long as this FAUST - architecture section is not modified. - - - ************************************************************************ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. ************************************************************************/ /* diff --git a/source/DEINDUGens/include/faust/audio/osc-dsp.h b/source/DEINDUGens/include/faust/audio/osc-dsp.h index 75d155e890..eeb7ac8128 100644 --- a/source/DEINDUGens/include/faust/audio/osc-dsp.h +++ b/source/DEINDUGens/include/faust/audio/osc-dsp.h @@ -1,29 +1,26 @@ /************************************************************************ - FAUST Architecture File - Copyright (C) 2003-2016 GRAME, Centre National de Creation Musicale - --------------------------------------------------------------------- - This Architecture section is free software; you can redistribute it - and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; If not, see . - - EXCEPTION : As a special exception, you may create a larger work - that contains this FAUST architecture section and distribute - that work under terms of your choice, so long as this FAUST - architecture section is not modified. - - - ************************************************************************ - ************************************************************************/ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. + ************************************************************************/ + #ifndef __osc_dsp__ #define __osc_dsp__ @@ -44,72 +41,79 @@ #define kMaxBuffer 4096 class oscdsp : public audio, public oscfaust::OSCIO { - dsp* fDsp; - float ** fInBuffers, **fOutBuffers; - - public: - oscdsp(const char * dst, int argc, char *argv[]) : OSCIO(dst), fDsp(0), fInBuffers(0), fOutBuffers(0) - { - for (int i = 1; i < argc-1; i++) { - if (!strcmp(argv[i], "-iodst")) setDest (argv[i+1]); - } - } - virtual ~oscdsp() - { - stop(); - for (int i = 0; i < numInputs(); i++) { - delete [] fInBuffers[i]; - } - for (int i = 0; i < numOutputs(); i++) { - delete [] fOutBuffers[i]; + + private: + + dsp* fDsp; + float ** fInBuffers, **fOutBuffers; + + public: + + oscdsp(const char * dst, int argc, char *argv[]) : OSCIO(dst), fDsp(0), fInBuffers(0), fOutBuffers(0) + { + for (int i = 1; i < argc-1; i++) { + if (!strcmp(argv[i], "-iodst")) setDest (argv[i+1]); + } } - delete [] fInBuffers; - delete [] fOutBuffers; - } - - virtual bool init(const char*name, dsp* DSP) - { - fDsp = DSP; - fDsp->init(44100); - fInBuffers = new float*[numInputs()]; - fOutBuffers = new float*[numOutputs()]; - for (int i = 0; i < numInputs(); i++) { - fInBuffers[i] = new float[kMaxBuffer]; + + virtual ~oscdsp() + { + stop(); + for (int i = 0; i < numInputs(); i++) { + delete [] fInBuffers[i]; + } + for (int i = 0; i < numOutputs(); i++) { + delete [] fOutBuffers[i]; + } + delete [] fInBuffers; + delete [] fOutBuffers; } - for (int i = 0; i < numOutputs(); i++) { - fOutBuffers [i] = new float[kMaxBuffer]; + + virtual bool init(const char*name, dsp* DSP) + { + fDsp = DSP; + fDsp->init(44100); + fInBuffers = new float*[numInputs()]; + fOutBuffers = new float*[numOutputs()]; + for (int i = 0; i < numInputs(); i++) { + fInBuffers[i] = new float[kMaxBuffer]; + } + for (int i = 0; i < numOutputs(); i++) { + fOutBuffers [i] = new float[kMaxBuffer]; + } + return true; } - return true; - } - virtual bool start() { return true; } - virtual void stop() {} + virtual bool start() { return true; } + virtual void stop() {} + + void compute(int nframes) + { + fDsp->compute(nframes, fInBuffers, fOutBuffers); + for (int i= 0; i < numOutputs(); i++) { + send(nframes, fOutBuffers [i], i); + } + } - void compute(int nframes) - { - fDsp->compute(nframes, fInBuffers, fOutBuffers); - for (int i= 0; i < numOutputs(); i++) { - send(nframes, fOutBuffers [i], i); + void receive(int nvalues, float* val) + { + int inChans = numInputs(); + if (!inChans) { + compute(nvalues); + return; + } + + for (int i=0; i < nvalues; i++) { + int c = i % inChans; + int frame = i / inChans; + fInBuffers[c][frame] = val[i]; + } + compute (nvalues / inChans); } - } - - void receive(int nvalues, float* val) - { - int inChans = numInputs(); - if (!inChans) { - compute(nvalues); - return; - } - - for (int i=0; i < nvalues; i++) { - int c = i % inChans; - int frame = i / inChans; - fInBuffers[c][frame] = val[i]; - } - compute (nvalues / inChans); - } - int numOutputs() const { return fDsp ? fDsp->getNumOutputs() : 0; } - int numInputs() const { return fDsp ? fDsp->getNumInputs() : 0; } + + int getNumInputs() const { return fDsp ? fDsp->getNumInputs() : 0; } + int getNumOutputs() const { return fDsp ? fDsp->getNumOutputs() : 0; } + }; #endif diff --git a/source/DEINDUGens/include/faust/audio/portaudio-dsp.h b/source/DEINDUGens/include/faust/audio/portaudio-dsp.h index 5b0a60ba35..da502e2322 100644 --- a/source/DEINDUGens/include/faust/audio/portaudio-dsp.h +++ b/source/DEINDUGens/include/faust/audio/portaudio-dsp.h @@ -1,16 +1,6 @@ -/************************************************************************ - - IMPORTANT NOTE : this file contains two clearly delimited sections : - the ARCHITECTURE section (in two parts) and the USER section. Each section - is governed by its own copyright and license. Please check individually - each section for license and copyright information. - *************************************************************************/ - -/*******************BEGIN ARCHITECTURE SECTION (part 1/2)****************/ - /************************************************************************ FAUST Architecture File - Copyright (C) 2003-2011 GRAME, Centre National de Creation Musicale + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale --------------------------------------------------------------------- This Architecture section is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -29,9 +19,6 @@ that contains this FAUST architecture section and distribute that work under terms of your choice, so long as this FAUST architecture section is not modified. - - - ************************************************************************ ************************************************************************/ #ifndef __portaudio_dsp__ @@ -122,7 +109,7 @@ class portaudio : public audio { virtual bool init(const char* name, dsp* DSP) { if (init(name, DSP->getNumInputs(), DSP->getNumOutputs())) { - set_dsp(DSP); + setDsp(DSP); return true; } else { return false; @@ -192,7 +179,7 @@ class portaudio : public audio { return true; } - void set_dsp(dsp* DSP) + void setDsp(dsp* DSP) { fDsp = DSP; if (fDsp->getNumInputs() > fDevNumInChans || fDsp->getNumOutputs() > fDevNumOutChans) { @@ -221,22 +208,22 @@ class portaudio : public audio { } } - virtual int get_buffer_size() + virtual int getBufferSize() { return fBufferSize; } - virtual int get_sample_rate() + virtual int getSampleRate() { return fSampleRate; } - virtual int get_num_inputs() + virtual int getNumInputs() { return fDevNumInChans; } - virtual int get_num_outputs() + virtual int getNumOutputs() { return fDevNumOutChans; } diff --git a/source/DEINDUGens/include/faust/audio/rtaudio-dsp.h b/source/DEINDUGens/include/faust/audio/rtaudio-dsp.h index 3d4e846537..738b962545 100644 --- a/source/DEINDUGens/include/faust/audio/rtaudio-dsp.h +++ b/source/DEINDUGens/include/faust/audio/rtaudio-dsp.h @@ -1,16 +1,6 @@ -/************************************************************************ - - IMPORTANT NOTE : this file contains two clearly delimited sections : - the ARCHITECTURE section (in two parts) and the USER section. Each section - is governed by its own copyright and license. Please check individually - each section for license and copyright information. - *************************************************************************/ - -/*******************BEGIN ARCHITECTURE SECTION (part 1/2)****************/ - /************************************************************************ FAUST Architecture File - Copyright (C) 2003-2011 GRAME, Centre National de Creation Musicale + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale --------------------------------------------------------------------- This Architecture section is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -29,9 +19,6 @@ that contains this FAUST architecture section and distribute that work under terms of your choice, so long as this FAUST architecture section is not modified. - - - ************************************************************************ ************************************************************************/ #ifndef __rtaudio_dsp__ @@ -114,7 +101,7 @@ class rtaudio : public audio { virtual bool init(const char* name, dsp* DSP) { if (init(name, DSP->getNumInputs(), DSP->getNumOutputs())) { - set_dsp(DSP); + setDsp(DSP); return true; } else { return false; @@ -157,7 +144,7 @@ class rtaudio : public audio { return true; } - void set_dsp(dsp* DSP) + void setDsp(dsp* DSP) { fDsp = DSP; @@ -191,22 +178,22 @@ class rtaudio : public audio { } } - virtual int get_buffer_size() + virtual int getBufferSize() { return fBufferSize; } - virtual int get_sample_rate() + virtual int getSampleRate() { return fSampleRate; } - virtual int get_num_inputs() + virtual int getNumInputs() { return fDevNumInChans; } - virtual int get_num_outputs() + virtual int getNumOutputs() { return fDevNumOutChans; } diff --git a/source/DEINDUGens/include/faust/audio/soundfile.h b/source/DEINDUGens/include/faust/audio/soundfile.h new file mode 100644 index 0000000000..16822d6d1c --- /dev/null +++ b/source/DEINDUGens/include/faust/audio/soundfile.h @@ -0,0 +1,129 @@ +/************************************************************************ + FAUST Architecture File + Copyright (C) 2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. + ************************************************************************/ + +#ifndef __soundfile__ +#define __soundfile__ + +#include +#include +#include +#include +#include + +#ifndef FAUSTFLOAT +#define FAUSTFLOAT float +#endif + +#define BUFFER_SIZE 1024 +#define SAMPLE_RATE 44100 +#define MAX_CHAN 64 + +#define MIN_CHAN(a,b) ((a) < (b) ? (a) : (b)) + +struct Soundfile { + + int length; + int rate; + int chans; + FAUSTFLOAT** channels; + + Soundfile(const std::string& name, int max_chan) + { + channels = new FAUSTFLOAT*[max_chan]; + assert(channels); + + // Open sndfile + SF_INFO snd_info; + snd_info.format = 0; + SNDFILE* snd_file = sf_open(name.c_str(), SFM_READ, &snd_info); + + if (snd_file) { + + chans = MIN_CHAN(max_chan, snd_info.channels); + length = snd_info.frames; + rate = snd_info.samplerate; + + for (int chan = 0; chan < chans; chan++) { + channels[chan] = new FAUSTFLOAT[snd_info.frames]; + assert(channels[chan]); + } + + // Read and fill snd_info.channels number of channels + int nbf, index = 0; + double buffer[BUFFER_SIZE * snd_info.channels]; + do { + nbf = sf_readf_double(snd_file, buffer, BUFFER_SIZE); + for (int sample = 0; sample < nbf; sample++) { + for (int chan = 0; chan < chans; chan++) { + channels[chan][index + sample] = (FAUSTFLOAT)buffer[sample * snd_info.channels + chan]; + } + } + index += nbf; + } while (nbf == BUFFER_SIZE); + + // Share the same buffers for all other channels so that we have max_chan channels available + for (int chan = chans; chan < max_chan; chan++) { + channels[chan] = channels[chan % snd_info.channels]; + } + + sf_close(snd_file); + + } else { + + if (name != "") { + std::cerr << "Error opening the file : " << name << std::endl; + } + + chans = 1; + length = BUFFER_SIZE; + rate = SAMPLE_RATE; + + // Allocate 1 channel + channels[0] = new FAUSTFLOAT[BUFFER_SIZE]; + assert(channels[0]); + memset(channels[0], 0, BUFFER_SIZE * sizeof(FAUSTFLOAT)); + + // Share the same buffer for all other channels so that we have max_chan channels available + for (int chan = chans; chan < max_chan; chan++) { + channels[chan] = channels[0]; + } + } + } + + ~Soundfile() + { + for (int chan = 0; chan < chans; chan++) { + delete channels[chan]; + } + delete [] channels; + } + +}; + +#ifdef TARGET_OS_IPHONE + SNDFILE* sf_open(const char* path, int mode, SF_INFO* sfinfo) { return 0; } + sf_count_t sf_readf_double(SNDFILE* sndfile, double* ptr, sf_count_t frames) { return 0; } + int sf_close(SNDFILE* sndfile) { return 0; } +#endif + +#endif diff --git a/source/DEINDUGens/include/faust/dsp/dsp-adapter.h b/source/DEINDUGens/include/faust/dsp/dsp-adapter.h index 1e25b37dd7..79305b01bc 100644 --- a/source/DEINDUGens/include/faust/dsp/dsp-adapter.h +++ b/source/DEINDUGens/include/faust/dsp/dsp-adapter.h @@ -1,32 +1,31 @@ /************************************************************************ - FAUST Architecture File - Copyright (C) 2003-2011 GRAME, Centre National de Creation Musicale - --------------------------------------------------------------------- - This Architecture section is free software; you can redistribute it - and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; If not, see . - - EXCEPTION : As a special exception, you may create a larger work - that contains this FAUST architecture section and distribute - that work under terms of your choice, so long as this FAUST - architecture section is not modified. - - ************************************************************************ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. ************************************************************************/ #ifndef __dsp_adapter__ #define __dsp_adapter__ #include +#include #include "faust/dsp/dsp.h" // Adapts a DSP for a different number of inputs/outputs @@ -101,19 +100,19 @@ class dsp_adapter : public decorator_dsp { // Adapts a DSP for a different sample size -template +template class dsp_sample_adapter : public decorator_dsp { protected: - SAMPLE_TYPE** fAdaptedInputs; - SAMPLE_TYPE** fAdaptedOutputs; + TYPE_INT** fAdaptedInputs; + TYPE_INT** fAdaptedOutputs; void adaptInputBuffers(int count, FAUSTFLOAT** inputs) { for (int chan = 0; chan < fDSP->getNumInputs(); chan++) { for (int frame = 0; frame < count; frame++) { - fAdaptedInputs[chan][frame] = SAMPLE_TYPE(inputs[chan][frame]); + fAdaptedInputs[chan][frame] = TYPE_INT(reinterpret_cast(inputs)[chan][frame]); } } } @@ -122,7 +121,7 @@ class dsp_sample_adapter : public decorator_dsp { { for (int chan = 0; chan < fDSP->getNumOutputs(); chan++) { for (int frame = 0; frame < count; frame++) { - outputs[chan][frame] = SAMPLE_TYPE(fAdaptedOutputs[chan][frame]); + reinterpret_cast(outputs)[chan][frame] = TYPE_EXT(fAdaptedOutputs[chan][frame]); } } } @@ -131,14 +130,14 @@ class dsp_sample_adapter : public decorator_dsp { dsp_sample_adapter(dsp* dsp):decorator_dsp(dsp) { - fAdaptedInputs = new SAMPLE_TYPE*[dsp->getNumInputs()]; + fAdaptedInputs = new TYPE_INT*[dsp->getNumInputs()]; for (int i = 0; i < dsp->getNumInputs(); i++) { - fAdaptedInputs[i] = new SAMPLE_TYPE[4096]; + fAdaptedInputs[i] = new TYPE_INT[4096]; } - fAdaptedOutputs = new SAMPLE_TYPE*[dsp->getNumOutputs()]; + fAdaptedOutputs = new TYPE_INT*[dsp->getNumOutputs()]; for (int i = 0; i < dsp->getNumOutputs(); i++) { - fAdaptedOutputs[i] = new SAMPLE_TYPE[4096]; + fAdaptedOutputs[i] = new TYPE_INT[4096]; } } diff --git a/source/DEINDUGens/include/faust/dsp/dsp-bench.h b/source/DEINDUGens/include/faust/dsp/dsp-bench.h index d2bb28bc72..098d43e6d4 100644 --- a/source/DEINDUGens/include/faust/dsp/dsp-bench.h +++ b/source/DEINDUGens/include/faust/dsp/dsp-bench.h @@ -1,26 +1,25 @@ /************************************************************************ - FAUST Architecture File - Copyright (C) 2016 GRAME, Centre National de Creation Musicale - --------------------------------------------------------------------- - This Architecture section is free software; you can redistribute it - and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; If not, see . - - EXCEPTION : As a special exception, you may create a larger work - that contains this FAUST architecture section and distribute - that work under terms of your choice, so long as this FAUST - architecture section is not modified. + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . -************************************************************************/ + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. + ************************************************************************/ #ifndef __dsp_bench__ #define __dsp_bench__ @@ -33,6 +32,8 @@ #include #include #include +#include +#include #include "faust/dsp/dsp.h" @@ -53,6 +54,20 @@ #include #endif +#define SAMPLE_RATE 44100.0 +#define NV 4096 // number of vectors in BIG buffer (should exceed cache) + +template +inline void FAUSTBENCH_LOG(VAL_TYPE val) +{ + const char* log = getenv("FAUSTBENCH_LOG"); + if (log && (strcasecmp(log, "on") == 0)) { + std::ofstream gFaustbenchLog; + gFaustbenchLog.open("Faustbench.csv", std::ofstream::app); + gFaustbenchLog << val << std::endl; + } +} + /* A class to do do timing measurements */ @@ -66,14 +81,14 @@ class time_bench { #endif int fMeasure; - int fMeasureCount; + int fCount; int fSkip; // These values are used to determine the number of clocks in a second uint64 fFirstRDTSC; uint64 fLastRDTSC; - // These tables contains the last fMeasureCount in clocks + // These tables contains the last fCount in clocks uint64* fStarts; uint64* fStops; @@ -157,12 +172,12 @@ class time_bench { time_bench(int count, int skip) { fSkip = skip; - fMeasureCount = count; + fCount = count; fMeasure = 0; fFirstRDTSC = 0; fLastRDTSC = 0; - fStarts = new uint64[fMeasureCount]; - fStops = new uint64[fMeasureCount]; + fStarts = new uint64[fCount]; + fStops = new uint64[fCount]; #ifdef TARGET_OS_IPHONE mach_timebase_info(&fTimeInfo); #endif @@ -174,9 +189,9 @@ class time_bench { delete [] fStops; } - void startMeasure() { fStarts[fMeasure % fMeasureCount] = rdtsc(); } + void startMeasure() { fStarts[fMeasure % fCount] = rdtsc(); } - void stopMeasure() { fStops[fMeasure % fMeasureCount] = rdtsc(); fMeasure++; } + void stopMeasure() { fStops[fMeasure % fCount] = rdtsc(); fMeasure++; } void openMeasure() { @@ -203,12 +218,10 @@ class time_bench { */ double getStats(int bsize, int ichans, int ochans) { - //std::cout << "getStats fMeasure = " << fMeasure << " fMeasureCount = " << fMeasureCount << std::endl; - - assert(fMeasure > fMeasureCount); - std::vector V(fMeasureCount); + assert(fMeasure > fCount); + std::vector V(fCount); - for (int i = 0; i < fMeasureCount; i++) { + for (int i = 0; i < fCount; i++) { V[i] = fStops[i] - fStarts[i]; } @@ -220,14 +233,14 @@ class time_bench { } /** - * Print the median value (in Megabytes/second) of fMeasureCount throughputs measurements. + * Print the median value (in Megabytes/second) of fCount throughputs measurements. */ void printStats(const char* applname, int bsize, int ichans, int ochans) { - assert(fMeasure > fMeasureCount); - std::vector V(fMeasureCount); + assert(fMeasure > fCount); + std::vector V(fCount); - for (int i = 0; i < fMeasureCount; i++) { + for (int i = 0; i < fCount; i++) { V[i] = fStops[i] - fStarts[i]; } @@ -235,9 +248,9 @@ class time_bench { // Mean of 10 best values (gives relatively stable results) uint64 meaval00 = meanValue(V.begin(), V.begin()+ 5); - uint64 meaval25 = meanValue(V.begin() + fMeasureCount / 4 - 2, V.begin()+fMeasureCount / 4 + 3); - uint64 meaval50 = meanValue(V.begin() + fMeasureCount / 2 - 2, V.begin()+fMeasureCount / 2 + 3); - uint64 meaval75 = meanValue(V.begin() + 3 * fMeasureCount / 4 - 2, V.begin() + 3 * fMeasureCount / 4 + 3); + uint64 meaval25 = meanValue(V.begin() + fCount / 4 - 2, V.begin()+fCount / 4 + 3); + uint64 meaval50 = meanValue(V.begin() + fCount / 2 - 2, V.begin()+fCount / 2 + 3); + uint64 meaval75 = meanValue(V.begin() + 3 * fCount / 4 - 2, V.begin() + 3 * fCount / 4 + 3); uint64 meaval100 = meanValue(V.end() - 5, V.end()); // Printing @@ -250,7 +263,12 @@ class time_bench { << std::endl; } - bool isRunning() { return (fMeasure <= (fMeasureCount + fSkip)); } + bool isRunning() { return (fMeasure <= (fCount + fSkip)); } + + int getCount() + { + return fMeasure; + } }; @@ -263,24 +281,67 @@ class measure_dsp : public decorator_dsp { protected: FAUSTFLOAT** fInputs; + FAUSTFLOAT** fAllInputs; FAUSTFLOAT** fOutputs; + FAUSTFLOAT** fAllOutputs; time_bench* fBench; int fBufferSize; + int fInputIndex; + int fOutputIndex; + int fCount; void init() { + fDSP->init(SAMPLE_RATE); + + fInputIndex = 0; + fOutputIndex = 0; + fInputs = new FAUSTFLOAT*[fDSP->getNumInputs()]; + fAllInputs = new FAUSTFLOAT*[fDSP->getNumInputs()]; for (int i = 0; i < fDSP->getNumInputs(); i++) { - fInputs[i] = new FAUSTFLOAT[fBufferSize]; - memset(fInputs[i], 0, sizeof(FAUSTFLOAT) * fBufferSize); + fAllInputs[i] = new FAUSTFLOAT[fBufferSize * NV]; + fInputs[i] = fAllInputs[i]; + // Write noise in inputs (to avoid 'speedup' effect due to null values) + int R0_0 = 0; + for (int j = 0; j < fBufferSize * NV; j++) { + int R0temp0 = (12345 + (1103515245 * R0_0)); + fAllInputs[i][j] = FAUSTFLOAT(4.656613e-10f * R0temp0); + R0_0 = R0temp0; + } } + fOutputs = new FAUSTFLOAT*[fDSP->getNumOutputs()]; + fAllOutputs = new FAUSTFLOAT*[fDSP->getNumOutputs()]; for (int i = 0; i < fDSP->getNumOutputs(); i++) { - fOutputs[i] = new FAUSTFLOAT[fBufferSize]; - memset(fOutputs[i], 0, sizeof(FAUSTFLOAT) * fBufferSize); + fAllOutputs[i] = new FAUSTFLOAT[fBufferSize * NV]; + fOutputs[i] = fAllOutputs[i]; + // Write zero in outputs + memset(fAllOutputs[i], 0, sizeof(FAUSTFLOAT) * fBufferSize * NV); } } + bool setRealtimePriority() + { + struct passwd* pw; + int err; + uid_t uid; + int policy; + struct sched_param param; + + uid = getuid(); + pw = getpwnam("root"); + setuid(pw->pw_uid); + + pthread_getschedparam(pthread_self(), &policy, ¶m); + policy = SCHED_RR; + param.sched_priority = 80; + err = pthread_setschedparam(pthread_self(), policy, ¶m); + + setuid(uid); + return (err != -1); + } + public: /** @@ -289,43 +350,56 @@ class measure_dsp : public decorator_dsp { * @param dsp - the dsp to be measured. * @param buffer_size - the buffer size used when calling 'computeAll' * @param count - the number of cycles using in 'computeAll' - * @param skip - ?? * */ - measure_dsp(dsp* dsp, int buffer_size, int count, int skip) - :decorator_dsp(dsp), fBufferSize(buffer_size) + measure_dsp(dsp* dsp, int buffer_size, int count) + :decorator_dsp(dsp), fBufferSize(buffer_size), fCount(count) { init(); - fBench = new time_bench(count, 10); + fBench = new time_bench(fCount, 10); } + /** + * Constructor. + * + * @param dsp - the dsp to be measured. + * @param buffer_size - the buffer size used when calling 'computeAll' + * @param duration_in_sec - the wanted durection used in 'computeAll' + * + */ measure_dsp(dsp* dsp, int buffer_size, double duration_in_sec) :decorator_dsp(dsp), fBufferSize(buffer_size) { init(); // Creates a first time_bench object to estimate the proper 'count' number of measure to do later - fBench = new time_bench(500, 10); + fBench = new time_bench(1000, 10); measure(); double duration = fBench->measureDurationUsec(); - int cout = int (500 * (duration_in_sec * 1e6 / duration)); + std::cout << "duration " << (duration / 1e6) << std::endl; + fCount = int(1000 * (duration_in_sec * 1e6 / duration)); delete fBench; // Then allocate final time_bench object with proper 'count' parameter - fBench = new time_bench(cout, 10); + fBench = new time_bench(fCount, 10); } virtual ~measure_dsp() { for (int i = 0; i < fDSP->getNumInputs(); i++) { - delete [] fInputs[i]; + delete [] fAllInputs[i]; } delete [] fInputs; + delete [] fAllInputs; + for (int i = 0; i < fDSP->getNumOutputs(); i++) { - delete [] fOutputs[i]; + delete [] fAllOutputs[i]; } - delete[] fOutputs; + delete [] fOutputs; + delete [] fAllOutputs; + delete fBench; + // DSP is deallocated by the decorator_dsp class. } /** @@ -333,6 +407,7 @@ class measure_dsp : public decorator_dsp { */ virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { + AVOIDDENORMALS; fBench->startMeasure(); fDSP->compute(count, inputs, outputs); fBench->stopMeasure(); @@ -349,6 +424,16 @@ class measure_dsp : public decorator_dsp { void computeAll() { do { + for (int i = 0; i < fDSP->getNumInputs(); i++) { + FAUSTFLOAT* allinputs = fAllInputs[i]; + fInputs[i] = &allinputs[fInputIndex * fBufferSize]; + fInputIndex = (1 + fInputIndex) % NV; + } + for (int i = 0; i < fDSP->getNumOutputs(); i++) { + FAUSTFLOAT* alloutputs = fAllOutputs[i]; + fOutputs[i] = &alloutputs[fOutputIndex * fBufferSize]; + fOutputIndex = (1 + fOutputIndex) % NV; + } compute(0, fBufferSize, fInputs, fOutputs); } while (fBench->isRunning()); } @@ -371,6 +456,8 @@ class measure_dsp : public decorator_dsp { void measure() { + setRealtimePriority(); + openMeasure(); computeAll(); closeMeasure(); @@ -385,7 +472,7 @@ class measure_dsp : public decorator_dsp { } /** - * Print the median value (in Megabytes/second) of fMeasureCount throughputs measurements + * Print the median value (in Megabytes/second) of fCount throughputs measurements */ void printStats(const char* applname) { @@ -394,6 +481,13 @@ class measure_dsp : public decorator_dsp { bool isRunning() { return fBench->isRunning(); } + float getCPULoad() + { + return (fBench->measureDurationUsec() / 1000.0 * SAMPLE_RATE) / (fBench->getCount() * fBufferSize * 1000.0); + } + + int getCount() { return fCount; } + }; #endif diff --git a/source/DEINDUGens/include/faust/dsp/dsp-combiner.h b/source/DEINDUGens/include/faust/dsp/dsp-combiner.h index 15d1dee7cb..f855c6e266 100644 --- a/source/DEINDUGens/include/faust/dsp/dsp-combiner.h +++ b/source/DEINDUGens/include/faust/dsp/dsp-combiner.h @@ -1,35 +1,24 @@ /************************************************************************ - IMPORTANT NOTE : this file contains two clearly delimited sections : - the ARCHITECTURE section (in two parts) and the USER section. Each section - is governed by its own copyright and license. Please check individually - each section for license and copyright information. -*************************************************************************/ - -/*******************BEGIN ARCHITECTURE SECTION (part 1/2)****************/ - -/************************************************************************ - FAUST Architecture File - Copyright (C) 2003-2011 GRAME, Centre National de Creation Musicale - --------------------------------------------------------------------- - This Architecture section is free software; you can redistribute it - and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; If not, see . - - EXCEPTION : As a special exception, you may create a larger work - that contains this FAUST architecture section and distribute - that work under terms of your choice, so long as this FAUST - architecture section is not modified. - - ************************************************************************ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. ************************************************************************/ #ifndef __dsp_combiner__ @@ -37,6 +26,7 @@ #include #include + #include "faust/dsp/dsp.h" // Combine two DSP in sequence @@ -235,7 +225,7 @@ class dsp_parallelizer : public dsp { FAUSTFLOAT** outputs_dsp2 = (FAUSTFLOAT**)alloca(fDSP2->getNumOutputs() * sizeof(FAUSTFLOAT*)); for (int chan = 0; chan < fDSP2->getNumOutputs(); chan++) { - outputs_dsp2[chan] = inputs[fDSP1->getNumOutputs() + chan]; + outputs_dsp2[chan] = outputs[fDSP1->getNumOutputs() + chan]; } fDSP2->compute(count, inputs_dsp2, outputs_dsp2); diff --git a/source/DEINDUGens/include/faust/dsp/dsp-tools.h b/source/DEINDUGens/include/faust/dsp/dsp-tools.h index f3a1da9f1b..50b0d41200 100644 --- a/source/DEINDUGens/include/faust/dsp/dsp-tools.h +++ b/source/DEINDUGens/include/faust/dsp/dsp-tools.h @@ -1,26 +1,24 @@ /************************************************************************ - FAUST Architecture File - Copyright (C) 2017 GRAME, Centre National de Creation Musicale - --------------------------------------------------------------------- - This Architecture section is free software; you can redistribute it - and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; If not, see . - - EXCEPTION : As a special exception, you may create a larger work - that contains this FAUST architecture section and distribute - that work under terms of your choice, so long as this FAUST - architecture section is not modified. - - ************************************************************************ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. ************************************************************************/ #ifndef __dsp_tools__ diff --git a/source/DEINDUGens/include/faust/dsp/dsp.h b/source/DEINDUGens/include/faust/dsp/dsp.h index f1e9ab04d5..e19b4a2b06 100644 --- a/source/DEINDUGens/include/faust/dsp/dsp.h +++ b/source/DEINDUGens/include/faust/dsp/dsp.h @@ -1,44 +1,25 @@ /************************************************************************ - IMPORTANT NOTE : this file contains two clearly delimited sections : - the ARCHITECTURE section (in two parts) and the USER section. Each section - is governed by its own copyright and license. Please check individually - each section for license and copyright information. -*************************************************************************/ - -/*******************BEGIN ARCHITECTURE SECTION (part 1/2)****************/ - -/************************************************************************ - FAUST Architecture File - Copyright (C) 2003-2011 GRAME, Centre National de Creation Musicale - --------------------------------------------------------------------- - This Architecture section is free software; you can redistribute it - and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; If not, see . - - EXCEPTION : As a special exception, you may create a larger work - that contains this FAUST architecture section and distribute - that work under terms of your choice, so long as this FAUST - architecture section is not modified. - - ************************************************************************ - ************************************************************************/ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. -/****************************************************************************** -******************************************************************************* - - FAUST DSP - -******************************************************************************* -*******************************************************************************/ + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. + ************************************************************************/ #ifndef __dsp__ #define __dsp__ @@ -50,6 +31,19 @@ class UI; struct Meta; +/** + * DSP memory manager. + */ + +struct dsp_memory_manager { + + virtual ~dsp_memory_manager() {} + + virtual void* allocate(size_t size) = 0; + virtual void destroy(void* ptr) = 0; + +}; + /** * Signal processor definition. */ @@ -68,31 +62,34 @@ class dsp { virtual int getNumOutputs() = 0; /** - * Trigger the UI* parameter with instance specific calls + * Trigger the ui_interface parameter with instance specific calls * to 'addBtton', 'addVerticalSlider'... in order to build the UI. * - * @param ui_interface - the UI* user interface builder + * @param ui_interface - the user interface builder */ virtual void buildUserInterface(UI* ui_interface) = 0; /* Returns the sample rate currently used by the instance */ virtual int getSampleRate() = 0; - /** Global init, calls the following methods: - * - static class 'classInit': static table initialisation - * - 'instanceInit': constants and instance table initialisation + /** + * Global init, calls the following methods: + * - static class 'classInit': static tables initialization + * - 'instanceInit': constants and instance state initialization * * @param samplingRate - the sampling rate in Herz */ virtual void init(int samplingRate) = 0; - /** Init instance state + /** + * Init instance state * * @param samplingRate - the sampling rate in Hertz */ virtual void instanceInit(int samplingRate) = 0; - /** Init instance constant state + /** + * Init instance constant state * * @param samplingRate - the sampling rate in Hertz */ @@ -112,16 +109,16 @@ class dsp { virtual dsp* clone() = 0; /** - * Trigger the Meta* parameter with instance specific calls to 'declare' (key, value metadata). + * Trigger the Meta* parameter with instance specific calls to 'declare' (key, value) metadata. * * @param m - the Meta* meta user */ virtual void metadata(Meta* m) = 0; /** - * DSP instance computation, to be called with sucessive in/out audio buffers. + * DSP instance computation, to be called with successive in/out audio buffers. * - * @param count - the nomber of frames to compute + * @param count - the number of frames to compute * @param inputs - the input audio buffers as an array of non-interleaved FAUSTFLOAT samples (eiher float, double or quad) * @param outputs - the output audio buffers as an array of non-interleaved FAUSTFLOAT samples (eiher float, double or quad) * @@ -132,7 +129,7 @@ class dsp { * DSP instance computation: alternative method to be used by subclasses. * * @param date_usec - the timestamp in microsec given by audio driver. - * @param count - the nomber of frames to compute + * @param count - the number of frames to compute * @param inputs - the input audio buffers as an array of non-interleaved FAUSTFLOAT samples (eiher float, double or quad) * @param outputs - the output audio buffers as an array of non-interleaved FAUSTFLOAT samples (eiher float, double or quad) * @@ -166,7 +163,7 @@ class decorator_dsp : public dsp { virtual void instanceResetUserInterface() { fDSP->instanceResetUserInterface(); } virtual void instanceClear() { fDSP->instanceClear(); } virtual decorator_dsp* clone() { return new decorator_dsp(fDSP->clone()); } - virtual void metadata(Meta* m) { return fDSP->metadata(m); } + virtual void metadata(Meta* m) { fDSP->metadata(m); } // Beware: subclasses usually have to overload the two 'compute' methods virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { fDSP->compute(count, inputs, outputs); } virtual void compute(double date_usec, int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { fDSP->compute(date_usec, count, inputs, outputs); } diff --git a/source/DEINDUGens/include/faust/dsp/faust-engine.h b/source/DEINDUGens/include/faust/dsp/faust-engine.h index a3be33b3d9..9814fb74f8 100644 --- a/source/DEINDUGens/include/faust/dsp/faust-engine.h +++ b/source/DEINDUGens/include/faust/dsp/faust-engine.h @@ -1,19 +1,25 @@ /************************************************************************ - ************************************************************************ - FAUST Polyphonic Architecture File - Copyright (C) 2016 GRAME, Centre National de Creation Musicale + FAUST Architecture File + Copyright (C) 2013 GRAME, Romain Michon, CCRMA - Stanford University + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale --------------------------------------------------------------------- - - This is sample code. This file is provided as an example of minimal - FAUST architecture file. Redistribution and use in source and binary - forms, with or without modification, in part or in full are permitted. - In particular you can create a derived work of this FAUST architecture - and distribute that work under terms of your choice. - - This sample code is distributed in the hope that it will be useful, + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - ************************************************************************ + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. ************************************************************************/ #ifndef __faust_engine__ @@ -31,7 +37,7 @@ extern "C" { bool isRunning(void*); - long keyOn(void*, int, int); + unsigned long keyOn(void*, int, int); int keyOff(void*, int); void propagateMidi(void*, int, double, int, int, int, int); @@ -47,8 +53,8 @@ extern "C" { void setParamIdValue(void*, int, float); float getParamIdValue(void*, int); - void setVoiceParamValue(void*, const char*, long, float); - float getVoiceParamValue(void*, const char*, long); + void setVoiceParamValue(void*, const char*, unsigned long, float); + float getVoiceParamValue(void*, const char*, unsigned long); const char* getParamAddress(void*, int); diff --git a/source/DEINDUGens/include/faust/dsp/faust-poly-engine.h b/source/DEINDUGens/include/faust/dsp/faust-poly-engine.h index ff4091b858..3f1f675205 100644 --- a/source/DEINDUGens/include/faust/dsp/faust-poly-engine.h +++ b/source/DEINDUGens/include/faust/dsp/faust-poly-engine.h @@ -1,20 +1,25 @@ /************************************************************************ - ************************************************************************ - FAUST Polyphonic Architecture File + FAUST Architecture File Copyright (C) 2013 GRAME, Romain Michon, CCRMA - Stanford University - Copyright (C) 2003-2015 GRAME, Centre National de Creation Musicale + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale --------------------------------------------------------------------- - - This is sample code. This file is provided as an example of minimal - FAUST architecture file. Redistribution and use in source and binary - forms, with or without modification, in part or in full are permitted. - In particular you can create a derived work of this FAUST architecture - and distribute that work under terms of your choice. - - This sample code is distributed in the hope that it will be useful, + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - ************************************************************************ + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. ************************************************************************/ #ifndef __faust_poly_engine__ @@ -226,10 +231,10 @@ class FaustPolyEngine { } /* - * deleteVoice(long voice) - * Delete a voice based on its MapUI* casted as a long. + * deleteVoice(unsigned long voice) + * Delete a voice based on its MapUI* casted as a unsigned long. */ - int deleteVoice(long voice) + int deleteVoice(unsigned long voice) { return deleteVoice(reinterpret_cast(voice)); } @@ -278,7 +283,7 @@ class FaustPolyEngine { /* * buildUserInterface(ui) - * Calls the polyphonic of monophonic buildUserInterface with the ui parameter. + * Calls the polyphonic or monophonic buildUserInterface with the ui parameter. */ void buildUserInterface(UI* ui_interface) { @@ -346,7 +351,7 @@ class FaustPolyEngine { * the voice. setVoiceParamValue can only be * used if the [style:poly] metadata is used in the Faust code. */ - void setVoiceParamValue(const char* address, long voice, float value) + void setVoiceParamValue(const char* address, unsigned long voice, float value) { reinterpret_cast(voice)->setParamValue(address, value); } @@ -357,7 +362,7 @@ class FaustPolyEngine { * the voice. setVoiceParamValue can only be * used if the [style:poly] metadata is used in the Faust code. */ - void setVoiceParamValue(int id, long voice, float value) + void setVoiceParamValue(int id, unsigned long voice, float value) { reinterpret_cast(voice)->setParamValue(reinterpret_cast(voice)->getParamAddress(id), value); } @@ -368,7 +373,7 @@ class FaustPolyEngine { * getVoiceParamValue can only be used if the [style:poly] metadata * is used in the Faust code. */ - float getVoiceParamValue(const char* address, long voice) + float getVoiceParamValue(const char* address, unsigned long voice) { return reinterpret_cast(voice)->getParamValue(address); } @@ -379,7 +384,7 @@ class FaustPolyEngine { * getVoiceParamValue can only be used if the [style:poly] metadata * is used in the Faust code. */ - float getVoiceParamValue(int id, long voice) + float getVoiceParamValue(int id, unsigned long voice) { return reinterpret_cast(voice)->getParamValue(reinterpret_cast(voice)->getParamAddress(id)); } @@ -398,7 +403,7 @@ class FaustPolyEngine { * Returns the address of a parameter for a specific voice * in function of its "id". */ - const char* getVoiceParamAddress(int id, long voice) + const char* getVoiceParamAddress(int id, unsigned long voice) { return reinterpret_cast(voice)->getParamAddress(id).c_str(); } @@ -461,22 +466,22 @@ class FaustPolyEngine { } /* - * getParamTooltip(address) - * Returns the tooltip of a parameter. + * getMetadata(address, key) + * Returns the metadata of a parameter. */ - const char* getParamTooltip(const char* address) + const char* getMetadata(const char* address, const char* key) { int id = fAPIUI.getParamIndex(address); - return (id >= 0) ? fAPIUI.getParamTooltip(id) : ""; + return (id >= 0) ? fAPIUI.getMetadata(id, key) : ""; } /* - * getParamTooltip(id) - * Returns the tooltip of a parameter. + * getMetadata(id, key) + * Returns the metadata of a parameter. */ - const char* getParamTooltip(int id) + const char* getMetadata(int id, const char* key) { - return fAPIUI.getParamTooltip(id); + return fAPIUI.getMetadata(id, key); } /* @@ -521,7 +526,7 @@ class FaustPolyEngine { * getCPULoad() * Return DSP CPU load. */ - float getCPULoad() { return fDriver->get_cpu_load(); } + float getCPULoad() { return fDriver->getCPULoad(); } /* * getScreenColor() -> c:int @@ -549,7 +554,7 @@ extern "C" { bool isRunning(void* dsp) { return reinterpret_cast(dsp)->isRunning(); } - long keyOn(void* dsp, int pitch, int velocity) { return (long)reinterpret_cast(dsp)->keyOn(pitch, velocity); } + unsigned long keyOn(void* dsp, int pitch, int velocity) { return (unsigned long)reinterpret_cast(dsp)->keyOn(pitch, velocity); } int keyOff(void* dsp, int pitch) { return reinterpret_cast(dsp)->keyOff(pitch); } void propagateMidi(void* dsp, int count, double time, int type, int channel, int data1, int data2) @@ -568,11 +573,11 @@ extern "C" { void setParamIdValue(void* dsp, int id, float value) { reinterpret_cast(dsp)->setParamValue(id, value); } float getParamIdValue(void* dsp, int id) { return reinterpret_cast(dsp)->getParamValue(id); } - void setVoiceParamValue(void* dsp, const char* address, long voice, float value) + void setVoiceParamValue(void* dsp, const char* address, unsigned long voice, float value) { reinterpret_cast(dsp)->setVoiceParamValue(address, voice, value); } - float getVoiceParamValue(void* dsp, const char* address, long voice) { return reinterpret_cast(dsp)->getVoiceParamValue(address, voice); } + float getVoiceParamValue(void* dsp, const char* address, unsigned long voice) { return reinterpret_cast(dsp)->getVoiceParamValue(address, voice); } const char* getParamAddress(void* dsp, int id) { return reinterpret_cast(dsp)->getParamAddress(id); } diff --git a/source/DEINDUGens/include/faust/dsp/poly-dsp.h b/source/DEINDUGens/include/faust/dsp/poly-dsp.h index a18f291859..11ae5709dd 100644 --- a/source/DEINDUGens/include/faust/dsp/poly-dsp.h +++ b/source/DEINDUGens/include/faust/dsp/poly-dsp.h @@ -6,21 +6,19 @@ and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; If not, see . - + EXCEPTION : As a special exception, you may create a larger work that contains this FAUST architecture section and distribute that work under terms of your choice, so long as this FAUST architecture section is not modified. - - ************************************************************************ ************************************************************************/ #ifndef __poly_dsp__ @@ -37,7 +35,6 @@ #include #include "faust/gui/MidiUI.h" -#include "faust/gui/JSONUI.h" #include "faust/gui/MapUI.h" #include "faust/dsp/proxy-dsp.h" @@ -103,11 +100,12 @@ class GroupUI : public GUI, public PathBuilder GroupUI(FAUSTFLOAT* zone, uiCallback cb, void* arg) { fPanic = new uiCallbackItem(this, zone, cb, arg); - }; + } + virtual ~GroupUI() { // 'fPanic' is kept and deleted in GUI, so do not delete here - }; + } // -- widget's layouts void openTabBox(const char* label) @@ -207,7 +205,6 @@ struct dsp_voice : public MapUI, public decorator_dsp { setParamValue(fFreqPath, midiToFreq(pitch)); setParamValue(fGainPath, float(velocity)/127.f); fNote = pitch; - fTrigger = true; // so that envelop is always re-initialized } // Normalized MIDI velocity [0..1] @@ -216,13 +213,13 @@ struct dsp_voice : public MapUI, public decorator_dsp { setParamValue(fFreqPath, midiToFreq(pitch)); setParamValue(fGainPath, velocity); fNote = pitch; - fTrigger = true; // so that envelop is always re-initialized } void keyOff(bool hard = false) { // No use of velocity for now... setParamValue(fGatePath, FAUSTFLOAT(0)); + if (hard) { // Stop immediately fNote = kFreeVoice; @@ -333,7 +330,7 @@ struct dsp_voice_group { fVoiceGroup->buildUserInterface(ui_interface); ui_interface->closeBox(); - // In not group, also add individual voices UI + // If not grouped, also add individual voices UI if (!fGroupControl) { for (int i = 0; i < fVoiceTable.size(); i++) { char buffer[32]; @@ -383,21 +380,43 @@ class mydsp_poly : public decorator_dsp, public dsp_voice_group, public midi { memset(mixBuffer[i], 0, count * sizeof(FAUSTFLOAT)); } } - - inline int getVoice(int note, bool steal = false) + + inline int getPlayingVoice(int pitch) { + int voice_playing = kNoVoice; + int oldest_date_playing = INT_MAX; + for (int i = 0; i < fVoiceTable.size(); i++) { - if (fVoiceTable[i]->fNote == note) { - if (steal) { - fVoiceTable[i]->fDate = fDate++; + if (fVoiceTable[i]->fNote == pitch) { + // Keeps oldest playing voice + if (fVoiceTable[i]->fDate < oldest_date_playing) { + oldest_date_playing = fVoiceTable[i]->fDate; + voice_playing = i; } - return i; + } + } + + return voice_playing; + } + + // Always returns a voice + inline int getFreeVoice() + { + int voice = kNoVoice; + + // Looks for the first available voice + for (int i = 0; i < fVoiceTable.size(); i++) { + if (fVoiceTable[i]->fNote == kFreeVoice) { + voice = i; + goto result; } } - if (steal) { + { + // Otherwise steal one int voice_release = kNoVoice; int voice_playing = kNoVoice; + int oldest_date_release = INT_MAX; int oldest_date_playing = INT_MAX; @@ -417,26 +436,27 @@ class mydsp_poly : public decorator_dsp, public dsp_voice_group, public midi { } } } - + // Then decide which one to steal if (oldest_date_release != INT_MAX) { std::cout << "Steal release voice : voice_date " << fVoiceTable[voice_release]->fDate << " cur_date = " << fDate << " voice = " << voice_release << std::endl; - fVoiceTable[voice_release]->fDate = fDate++; - fVoiceTable[voice_release]->fTrigger = true; - return voice_release; + voice = voice_release; + goto result; } else if (oldest_date_playing != INT_MAX) { std::cout << "Steal playing voice : voice_date " << fVoiceTable[voice_playing]->fDate << " cur_date = " << fDate << " voice = " << voice_playing << std::endl; - fVoiceTable[voice_playing]->fDate = fDate++; - fVoiceTable[voice_playing]->fTrigger = true; - return voice_playing; + voice = voice_playing; + goto result; } else { assert(false); return kNoVoice; } - - } else { - return kNoVoice; } + + result: + fVoiceTable[voice]->fDate = fDate++; + fVoiceTable[voice]->fTrigger = true; // so that envelop is always re-initialized + fVoiceTable[voice]->fNote = kActiveVoice; + return voice; } static void panic(FAUSTFLOAT val, void* arg) @@ -456,17 +476,8 @@ class mydsp_poly : public decorator_dsp, public dsp_voice_group, public midi { } } - // Always returns a voice - int newVoiceAux() - { - int voice = getVoice(kFreeVoice, true); - assert(voice != kNoVoice); - fVoiceTable[voice]->fNote = kActiveVoice; - return voice; - } - public: - + /** * Constructor. * @@ -517,22 +528,28 @@ class mydsp_poly : public decorator_dsp, public dsp_voice_group, public midi { void init(int samplingRate) { + decorator_dsp::init(samplingRate); + fVoiceGroup->init(samplingRate); + fPanic = FAUSTFLOAT(0); + // Init voices for (int i = 0; i < fVoiceTable.size(); i++) { fVoiceTable[i]->init(samplingRate); } } - - void instanceInit(int samplingRate) + + void instanceInit(int samplingFreq) { - // Init voices - for (int i = 0; i < fVoiceTable.size(); i++) { - fVoiceTable[i]->instanceInit(samplingRate); - } + instanceConstants(samplingFreq); + instanceResetUserInterface(); + instanceClear(); } void instanceConstants(int samplingRate) { + decorator_dsp::instanceConstants(samplingRate); + fVoiceGroup->instanceConstants(samplingRate); + // Init voices for (int i = 0; i < fVoiceTable.size(); i++) { fVoiceTable[i]->instanceConstants(samplingRate); @@ -541,6 +558,10 @@ class mydsp_poly : public decorator_dsp, public dsp_voice_group, public midi { void instanceResetUserInterface() { + decorator_dsp::instanceResetUserInterface(); + fVoiceGroup->instanceResetUserInterface(); + fPanic = FAUSTFLOAT(0); + for (int i = 0; i < fVoiceTable.size(); i++) { fVoiceTable[i]->instanceResetUserInterface(); } @@ -548,6 +569,9 @@ class mydsp_poly : public decorator_dsp, public dsp_voice_group, public midi { void instanceClear() { + decorator_dsp::instanceClear(); + fVoiceGroup->instanceClear(); + for (int i = 0; i < fVoiceTable.size(); i++) { fVoiceTable[i]->instanceClear(); } @@ -596,7 +620,7 @@ class mydsp_poly : public decorator_dsp, public dsp_voice_group, public midi { // Additional polyphonic API MapUI* newVoice() { - return fVoiceTable[newVoiceAux()]; + return fVoiceTable[getFreeVoice()]; } void deleteVoice(MapUI* voice) @@ -613,7 +637,7 @@ class mydsp_poly : public decorator_dsp, public dsp_voice_group, public midi { MapUI* keyOn(int channel, int pitch, int velocity) { if (checkPolyphony()) { - int voice = newVoiceAux(); + int voice = getFreeVoice(); fVoiceTable[voice]->keyOn(pitch, velocity); return fVoiceTable[voice]; } else { @@ -624,7 +648,7 @@ class mydsp_poly : public decorator_dsp, public dsp_voice_group, public midi { void keyOff(int channel, int pitch, int velocity = 127) { if (checkPolyphony()) { - int voice = getVoice(pitch); + int voice = getPlayingVoice(pitch); if (voice != kNoVoice) { fVoiceTable[voice]->keyOff(); } else { diff --git a/source/DEINDUGens/include/faust/dsp/proxy-dsp.h b/source/DEINDUGens/include/faust/dsp/proxy-dsp.h index aacecfc6a3..410e87d2e4 100644 --- a/source/DEINDUGens/include/faust/dsp/proxy-dsp.h +++ b/source/DEINDUGens/include/faust/dsp/proxy-dsp.h @@ -1,35 +1,24 @@ /************************************************************************ - IMPORTANT NOTE : this file contains two clearly delimited sections : - the ARCHITECTURE section (in two parts) and the USER section. Each section - is governed by its own copyright and license. Please check individually - each section for license and copyright information. -*************************************************************************/ - -/*******************BEGIN ARCHITECTURE SECTION (part 1/2)****************/ - -/************************************************************************ - FAUST Architecture File - Copyright (C) 2003-2011 GRAME, Centre National de Creation Musicale - --------------------------------------------------------------------- - This Architecture section is free software; you can redistribute it - and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; If not, see . - - EXCEPTION : As a special exception, you may create a larger work - that contains this FAUST architecture section and distribute - that work under terms of your choice, so long as this FAUST - architecture section is not modified. - - ************************************************************************ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. ************************************************************************/ #ifndef __proxy_dsp__ @@ -39,184 +28,9 @@ #include #include "faust/dsp/dsp.h" -#include "faust/gui/SimpleParser.h" +#include "faust/gui/JSONUIDecoder.h" #include "faust/gui/JSONUI.h" -#ifdef _WIN32 -#include -#define snprintf _snprintf -#endif - -inline FAUSTFLOAT STR2REAL(const std::string& s) { return (strtod(s.c_str(), NULL)); } - -//------------------------------------------------------------------- -// Decode a dsp JSON description and implement 'buildUserInterface' -//------------------------------------------------------------------- - -struct JSONUIDecoder { - - std::string fName; - - std::map fMetadatas; - std::vector fUiItems; - - FAUSTFLOAT* fInControl; - FAUSTFLOAT* fOutControl; - - std::string fJSON; - - int fNumInputs, fNumOutputs; - int fInputItems, fOutputItems; - - JSONUIDecoder(const std::string& json) - { - fJSON = json; - const char* p = fJSON.c_str(); - parseJson(p, fMetadatas, fUiItems); - - // fMetadatas will contain the "meta" section as well as , , pairs - if (fMetadatas.find("name") != fMetadatas.end()) { - fName = fMetadatas["name"]; - fMetadatas.erase("name"); - } else { - fName = ""; - } - - if (fMetadatas.find("inputs") != fMetadatas.end()) { - fNumInputs = atoi(fMetadatas["inputs"].c_str()); - fMetadatas.erase("inputs"); - } else { - fNumInputs = -1; - } - - if (fMetadatas.find("outputs") != fMetadatas.end()) { - fNumOutputs = atoi(fMetadatas["outputs"].c_str()); - fMetadatas.erase("outputs"); - } else { - fNumOutputs = -1; - } - - vector::iterator it; - fInputItems = 0; - fOutputItems = 0; - - for (it = fUiItems.begin(); it != fUiItems.end(); it++) { - string type = (*it)->type; - if (type == "vslider" || type == "hslider" || type == "nentry" || type == "button") { - fInputItems++; - } else if (type == "hbargraph" || type == "vbargraph") { - fOutputItems++; - } - } - - fInControl = new FAUSTFLOAT[fInputItems]; - fOutControl = new FAUSTFLOAT[fOutputItems]; - } - - virtual ~JSONUIDecoder() - { - vector::iterator it; - for (it = fUiItems.begin(); it != fUiItems.end(); it++) { - delete(*it); - } - delete [] fInControl; - delete [] fOutControl; - } - - void metadata(Meta* m) - { - std::map::iterator it; - for (it = fMetadatas.begin(); it != fMetadatas.end(); it++) { - m->declare((*it).first.c_str(), (*it).second.c_str()); - } - } - - void buildUserInterface(UI* ui) - { - // To be sure the floats are correctly encoded - char* tmp_local = setlocale(LC_ALL, NULL); - setlocale(LC_ALL, "C"); - - int counterIn = 0; - int counterOut = 0; - vector::iterator it; - - for (it = fUiItems.begin(); it != fUiItems.end(); it++) { - - bool isInItem = false; - bool isOutItem = false; - string type = (*it)->type; - - FAUSTFLOAT init = STR2REAL((*it)->init); - FAUSTFLOAT min = STR2REAL((*it)->min); - FAUSTFLOAT max = STR2REAL((*it)->max); - FAUSTFLOAT step = STR2REAL((*it)->step); - - if (type == "vslider" || type == "hslider" || type == "nentry" || type == "button") { - isInItem = true; - } else if (type == "hbargraph" || type == "vbargraph") { - isOutItem = true; - } - - // Meta data declaration for input items - if ((*it)->type.find("group") == string::npos && (*it)->type.find("bargraph") == string::npos && (*it)->type != "close") { - fInControl[counterIn] = init; - for (int i = 0; i < (*it)->meta.size(); i++) { - ui->declare(&fInControl[counterIn], (*it)->meta[i].first.c_str(), (*it)->meta[i].second.c_str()); - } - } - // Meta data declaration for output items - else if ((*it)->type.find("bargraph") != string::npos) { - fOutControl[counterOut] = init; - for (int i = 0; i < (*it)->meta.size(); i++) { - ui->declare(&fOutControl[counterOut], (*it)->meta[i].first.c_str(), (*it)->meta[i].second.c_str()); - } - } - // Meta data declaration for group opening or closing - else { - for (int i = 0; i < (*it)->meta.size(); i++) { - ui->declare(0, (*it)->meta[i].first.c_str(), (*it)->meta[i].second.c_str()); - } - } - - if (type == "hgroup") { - ui->openHorizontalBox((*it)->label.c_str()); - } else if (type == "vgroup") { - ui->openVerticalBox((*it)->label.c_str()); - } else if (type == "tgroup") { - ui->openTabBox((*it)->label.c_str()); - } else if (type == "vslider") { - ui->addVerticalSlider((*it)->label.c_str(), &fInControl[counterIn], init, min, max, step); - } else if (type == "hslider") { - ui->addHorizontalSlider((*it)->label.c_str(), &fInControl[counterIn], init, min, max, step); - } else if (type == "checkbox") { - ui->addCheckButton((*it)->label.c_str(), &fInControl[counterIn]); - } else if (type == "hbargraph") { - ui->addHorizontalBargraph((*it)->label.c_str(), &fOutControl[counterOut], min, max); - } else if (type == "vbargraph") { - ui->addVerticalBargraph((*it)->label.c_str(), &fOutControl[counterOut], min, max); - } else if (type == "nentry") { - ui->addNumEntry((*it)->label.c_str(), &fInControl[counterIn], init, min, max, step); - } else if (type == "button") { - ui->addButton((*it)->label.c_str(), &fInControl[counterIn]); - } else if (type == "close") { - ui->closeBox(); - } - - if (isInItem) { - counterIn++; - } - - if (isOutItem) { - counterOut++; - } - } - - setlocale(LC_ALL, tmp_local); - } - -}; - //---------------------------------------------------------------- // Proxy dsp definition created from the DSP JSON description // This class allows a 'proxy' dsp to control a real dsp @@ -258,10 +72,18 @@ class proxy_dsp : public dsp { virtual void buildUserInterface(UI* ui) { fDecoder->buildUserInterface(ui); } // To possibly implement in a concrete proxy dsp - virtual void init(int samplingRate) { fSamplingFreq = samplingRate; } - virtual void instanceInit(int samplingRate) {} - virtual void instanceConstants(int samplingRate) {} - virtual void instanceResetUserInterface() {} + virtual void init(int samplingFreq) + { + instanceInit(samplingFreq); + } + virtual void instanceInit(int samplingFreq) + { + instanceConstants(samplingFreq); + instanceResetUserInterface(); + instanceClear(); + } + virtual void instanceConstants(int samplingRate) { fSamplingFreq = samplingRate; } + virtual void instanceResetUserInterface() { fDecoder->resetUserInterface(); } virtual void instanceClear() {} virtual int getSampleRate() { return fSamplingFreq; } diff --git a/source/DEINDUGens/include/faust/dsp/sound-player.h b/source/DEINDUGens/include/faust/dsp/sound-player.h index 6b2889b01f..40c13560db 100644 --- a/source/DEINDUGens/include/faust/dsp/sound-player.h +++ b/source/DEINDUGens/include/faust/dsp/sound-player.h @@ -1,26 +1,24 @@ /************************************************************************ - FAUST Architecture File - Copyright (C) 2017 GRAME, Centre National de Creation Musicale - --------------------------------------------------------------------- - This Architecture section is free software; you can redistribute it - and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; If not, see . - - EXCEPTION : As a special exception, you may create a larger work - that contains this FAUST architecture section and distribute - that work under terms of your choice, so long as this FAUST - architecture section is not modified. - - ************************************************************************ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. ************************************************************************/ #ifndef __sound_player__ diff --git a/source/DEINDUGens/include/faust/dsp/timed-dsp.h b/source/DEINDUGens/include/faust/dsp/timed-dsp.h index 8924be16f6..452412efc7 100644 --- a/source/DEINDUGens/include/faust/dsp/timed-dsp.h +++ b/source/DEINDUGens/include/faust/dsp/timed-dsp.h @@ -1,39 +1,38 @@ /************************************************************************ - FAUST Architecture File - Copyright (C) 2003-2016 GRAME, Centre National de Creation Musicale - --------------------------------------------------------------------- - This Architecture section is free software; you can redistribute it - and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; If not, see . - - EXCEPTION : As a special exception, you may create a larger work - that contains this FAUST architecture section and distribute - that work under terms of your choice, so long as this FAUST - architecture section is not modified. - - ************************************************************************ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. ************************************************************************/ #ifndef __timed_dsp__ #define __timed_dsp__ -#include "faust/dsp/dsp.h" -#include "faust/gui/GUI.h" -#include "faust/gui/ring-buffer.h" - #include #include #include +#include "faust/dsp/dsp.h" +#include "faust/gui/GUI.h" +#include "faust/gui/DecoratorUI.h" +#include "faust/gui/ring-buffer.h" + namespace { #if __APPLE__ @@ -75,13 +74,13 @@ inline double GetCurrentTimeInUsec(void) * ZoneUI : this class collect zones in a set. */ -struct ZoneUI : public UI +struct ZoneUI : public GenericUI { std::set fZoneSet; - ZoneUI() {}; - virtual ~ZoneUI() {}; + ZoneUI():GenericUI() {} + virtual ~ZoneUI() {} void insertZone(FAUSTFLOAT* zone) { @@ -90,16 +89,6 @@ struct ZoneUI : public UI } } - // -- widget's layouts - void openTabBox(const char* label) - {} - void openHorizontalBox(const char* label) - {} - void openVerticalBox(const char* label) - {} - void closeBox() - {} - // -- active widgets void addButton(const char* label, FAUSTFLOAT* zone) { @@ -131,11 +120,7 @@ struct ZoneUI : public UI { insertZone(zone); } - - // -- metadata declarations - void declare(FAUSTFLOAT* zone, const char* key, const char* val) - {} - + }; /** diff --git a/source/DEINDUGens/include/faust/gui/APIUI.h b/source/DEINDUGens/include/faust/gui/APIUI.h index 8670f9940a..af4f9261ea 100644 --- a/source/DEINDUGens/include/faust/gui/APIUI.h +++ b/source/DEINDUGens/include/faust/gui/APIUI.h @@ -1,50 +1,53 @@ /************************************************************************ - FAUST Architecture File - Copyright (C) 2003-2016 GRAME, Centre National de Creation Musicale - --------------------------------------------------------------------- - This Architecture section is free software; you can redistribute it - and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; If not, see . - - EXCEPTION : As a special exception, you may create a larger work - that contains this FAUST architecture section and distribute - that work under terms of your choice, so long as this FAUST - architecture section is not modified. - - - ************************************************************************ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. ************************************************************************/ #ifndef API_UI_H #define API_UI_H -#include "faust/gui/meta.h" -#include "faust/gui/UI.h" -#include "faust/gui/PathBuilder.h" -#include "faust/gui/ValueConverter.h" #include #include #include #include #include +#include "faust/gui/meta.h" +#include "faust/gui/UI.h" +#include "faust/gui/PathBuilder.h" +#include "faust/gui/ValueConverter.h" + class APIUI : public PathBuilder, public Meta, public UI { + public: + + enum ItemType { kButton = 0, kCheckButton, kVSlider, kHSlider, kNumEntry, kHBargraph, kVBargraph }; + protected: enum { kLin = 0, kLog = 1, kExp = 2 }; int fNumParameters; - std::vector fName; + std::vector fPaths; + std::vector fLabels; std::map fPathMap; std::map fLabelMap; std::vector fConversion; @@ -53,8 +56,8 @@ class APIUI : public PathBuilder, public Meta, public UI std::vector fMin; std::vector fMax; std::vector fStep; - std::vector fUnit; - std::vector fTooltip; + std::vector fItemType; + std::vector > fMetaData; std::vector fAcc[3]; std::vector fGyr[3]; @@ -72,37 +75,38 @@ class APIUI : public PathBuilder, public Meta, public UI std::string fCurrentGyr; std::string fCurrentColor; std::string fCurrentTooltip; - + std::map fCurrentMetadata; + // Add a generic parameter virtual void addParameter(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, - FAUSTFLOAT step) + FAUSTFLOAT step, + ItemType type) { std::string path = buildPath(label); fPathMap[path] = fLabelMap[label] = fNumParameters++; - fName.push_back(path); + fPaths.push_back(path); + fLabels.push_back(label); fZone.push_back(zone); fInit.push_back(init); fMin.push_back(min); fMax.push_back(max); fStep.push_back(step); - - //handle unit metadata - fUnit.push_back(fCurrentUnit); - fCurrentUnit = ""; + fItemType.push_back(type); - //handle tooltip metadata - fTooltip.push_back(fCurrentTooltip); - fCurrentTooltip = ""; - //handle scale metadata switch (fCurrentScale) { - case kLin : fConversion.push_back(new LinearValueConverter(0, 1, min, max)); break; - case kLog : fConversion.push_back(new LogValueConverter(0, 1, min, max)); break; - case kExp : fConversion.push_back(new ExpValueConverter(0, 1, min, max)); break; + case kLin: + fConversion.push_back(new LinearValueConverter(0, 1, min, max)); + break; + case kLog: + fConversion.push_back(new LogValueConverter(0, 1, min, max)); + break; + case kExp: fConversion.push_back(new ExpValueConverter(0, 1, min, max)); + break; } fCurrentScale = kLin; @@ -146,7 +150,7 @@ class APIUI : public PathBuilder, public Meta, public UI fCurrentGyr = ""; } - // handle screencolor metadata "...[screencolor:red|green|blue]..." + // handle screencolor metadata "...[screencolor:red|green|blue|white]..." if (fCurrentColor.size() > 0) { if ((fCurrentColor == "red") && (fRedReader == 0)) { fRedReader = new ZoneReader(zone, min, max); @@ -167,6 +171,9 @@ class APIUI : public PathBuilder, public Meta, public UI } } fCurrentColor = ""; + + fMetaData.push_back(fCurrentMetadata); + fCurrentMetadata.clear(); } int getZoneIndex(std::vector* table, int p, int val) @@ -235,7 +242,7 @@ class APIUI : public PathBuilder, public Meta, public UI public: enum Type { kAcc = 0, kGyr = 1, kNoType }; - + APIUI() : fNumParameters(0), fHasScreenControl(false), fRedReader(0), fGreenReader(0), fBlueReader(0) {} @@ -272,46 +279,49 @@ class APIUI : public PathBuilder, public Meta, public UI virtual void addButton(const char* label, FAUSTFLOAT* zone) { - addParameter(label, zone, 0, 0, 1, 1); + addParameter(label, zone, 0, 0, 1, 1, kButton); } virtual void addCheckButton(const char* label, FAUSTFLOAT* zone) { - addParameter(label, zone, 0, 0, 1, 1); + addParameter(label, zone, 0, 0, 1, 1, kCheckButton); } virtual void addVerticalSlider(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT step) { - addParameter(label, zone, init, min, max, step); + addParameter(label, zone, init, min, max, step, kVSlider); } virtual void addHorizontalSlider(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT step) { - addParameter(label, zone, init, min, max, step); + addParameter(label, zone, init, min, max, step, kHSlider); } virtual void addNumEntry(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT step) { - addParameter(label, zone, init, min, max, step); + addParameter(label, zone, init, min, max, step, kNumEntry); } // -- passive widgets virtual void addHorizontalBargraph(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT min, FAUSTFLOAT max) { - addParameter(label, zone, min, min, max, (max-min)/1000.0); + addParameter(label, zone, min, min, max, (max-min)/1000.0, kHBargraph); } virtual void addVerticalBargraph(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT min, FAUSTFLOAT max) { - addParameter(label, zone, min, min, max, (max-min)/1000.0); + addParameter(label, zone, min, min, max, (max-min)/1000.0, kVBargraph); } // -- metadata declarations virtual void declare(FAUSTFLOAT* zone, const char* key, const char* val) { - if (strcmp(key, "scale") == 0) { + // Keep matadata + fCurrentMetadata[key] = val; + + if (strcmp(key, "scale") == 0) { if (strcmp(val, "log") == 0) { fCurrentScale = kLog; } else if (strcmp(val, "exp") == 0) { @@ -319,14 +329,14 @@ class APIUI : public PathBuilder, public Meta, public UI } else { fCurrentScale = kLin; } - } else if (strcmp(key, "unit") == 0) { - fCurrentUnit = val; - } else if (strcmp(key, "acc") == 0) { - fCurrentAcc = val; - } else if (strcmp(key, "gyr") == 0) { - fCurrentGyr = val; - } else if (strcmp(key, "screencolor") == 0) { - fCurrentColor = val; // val = "red", "green" or "blue" + } else if (strcmp(key, "unit") == 0) { + fCurrentUnit = val; + } else if (strcmp(key, "acc") == 0) { + fCurrentAcc = val; + } else if (strcmp(key, "gyr") == 0) { + fCurrentGyr = val; + } else if (strcmp(key, "screencolor") == 0) { + fCurrentColor = val; // val = "red", "green", "blue" or "white" } else if (strcmp(key, "tooltip") == 0) { fCurrentTooltip = val; } @@ -349,26 +359,40 @@ class APIUI : public PathBuilder, public Meta, public UI return -1; } } - const char* getParamAddress(int p) { return fName[p].c_str(); } - const char* getParamUnit(int p) { return fUnit[p].c_str(); } - const char* getParamTooltip(int p) { return fTooltip[p].c_str(); } - FAUSTFLOAT getParamMin(int p) { return fMin[p]; } - FAUSTFLOAT getParamMax(int p) { return fMax[p]; } - FAUSTFLOAT getParamStep(int p) { return fStep[p]; } - FAUSTFLOAT getParamInit(int p) { return fInit[p]; } + const char* getParamAddress(int p) { return fPaths[p].c_str(); } + const char* getParamLabel(int p) { return fLabels[p].c_str(); } + std::map getMetadata(int p) + { + std::map res; + std::map metadata = fMetaData[p]; + std::map::iterator it; + for (it = metadata.begin(); it != metadata.end(); ++it) { + res[(*it).first.c_str()] = (*it).second.c_str(); + } + return res; + } + + const char* getMetadata(int p, const char* key) + { + return (fMetaData[p].find(key) != fMetaData[p].end()) ? fMetaData[p][key].c_str() : ""; + } + FAUSTFLOAT getParamMin(int p) { return fMin[p]; } + FAUSTFLOAT getParamMax(int p) { return fMax[p]; } + FAUSTFLOAT getParamStep(int p) { return fStep[p]; } + FAUSTFLOAT getParamInit(int p) { return fInit[p]; } FAUSTFLOAT* getParamZone(int p) { return fZone[p]; } - FAUSTFLOAT getParamValue(int p) { return *fZone[p]; } - void setParamValue(int p, FAUSTFLOAT v) { *fZone[p] = v; } + FAUSTFLOAT getParamValue(int p) { return *fZone[p]; } + void setParamValue(int p, FAUSTFLOAT v) { *fZone[p] = v; } - double getParamRatio(int p) { return fConversion[p]->faust2ui(*fZone[p]); } - void setParamRatio(int p, double r) { *fZone[p] = fConversion[p]->ui2faust(r); } + double getParamRatio(int p) { return fConversion[p]->faust2ui(*fZone[p]); } + void setParamRatio(int p, double r) { *fZone[p] = fConversion[p]->ui2faust(r); } - double value2ratio(int p, double r) { return fConversion[p]->faust2ui(r); } - double ratio2value(int p, double r) { return fConversion[p]->ui2faust(r); } + double value2ratio(int p, double r) { return fConversion[p]->faust2ui(r); } + double ratio2value(int p, double r) { return fConversion[p]->ui2faust(r); } /** - * Return the control type (kAcc, kGyr, or -1) for a given paramater + * Return the control type (kAcc, kGyr, or -1) for a given parameter * * @param p - the UI parameter index * @@ -389,6 +413,18 @@ class APIUI : public PathBuilder, public Meta, public UI } return kNoType; } + + /** + * Return the Item type (kButton = 0, kCheckButton, kVSlider, kHSlider, kNumEntry, kHBargraph, kVBargraph) for a given parameter + * + * @param p - the UI parameter index + * + * @return the Item type + */ + ItemType getParamItemType(int p) + { + return fItemType[p]; + } /** * Set a new value coming from an accelerometer, propagate it to all relevant float* zones. diff --git a/source/DEINDUGens/include/faust/gui/ControlUI.h b/source/DEINDUGens/include/faust/gui/ControlUI.h index e84f814cbf..fb53be9834 100644 --- a/source/DEINDUGens/include/faust/gui/ControlUI.h +++ b/source/DEINDUGens/include/faust/gui/ControlUI.h @@ -1,37 +1,35 @@ /************************************************************************ - FAUST Architecture File - Copyright (C) 2003-2016 GRAME, Centre National de Creation Musicale - --------------------------------------------------------------------- - This Architecture section is free software; you can redistribute it - and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; If not, see . - - EXCEPTION : As a special exception, you may create a larger work - that contains this FAUST architecture section and distribute - that work under terms of your choice, so long as this FAUST - architecture section is not modified. - - - ************************************************************************ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. ************************************************************************/ #ifndef CONTROL_UI_H #define CONTROL_UI_H -#include "faust/gui/UI.h" #include #include #include +#include "faust/gui/UI.h" + class ControlUI : public UI { protected: @@ -62,7 +60,7 @@ class ControlUI : public UI { public: - void encode_control(float* control_buffer, unsigned int frames) + void encodeControl(float* control_buffer, unsigned int frames) { assert(fControlOut.size() <= frames); @@ -71,7 +69,7 @@ class ControlUI : public UI { } } - void decode_control(float* control_buffer, unsigned int frames) + void decodeControl(float* control_buffer, unsigned int frames) { assert(fControlIn.size() <= frames); @@ -80,7 +78,7 @@ class ControlUI : public UI { } } - void encode_midi_control(void* midi_control_buffer, unsigned int frames) + void encodeMidiControl(void* midi_control_buffer, unsigned int frames) { assert(fControlOut.size() <= frames); jack_midi_reset_buffer(midi_control_buffer); @@ -92,7 +90,7 @@ class ControlUI : public UI { } } - static void encode_midi_control(void* midi_control_buffer, float* control_buffer, int count) + static void encodeMidiControl(void* midi_control_buffer, float* control_buffer, int count) { jack_midi_reset_buffer(midi_control_buffer); @@ -103,7 +101,7 @@ class ControlUI : public UI { } } - void decode_midi_control(void* midi_control_buffer, unsigned int frames) + void decodeMidiControl(void* midi_control_buffer, unsigned int frames) { assert(jack_midi_get_event_count(midi_control_buffer) <= frames); @@ -114,7 +112,7 @@ class ControlUI : public UI { } } - static void decode_midi_control(void* midi_control_buffer, float* control_buffer, int count) + static void decodeMidiControl(void* midi_control_buffer, float* control_buffer, int count) { assert(jack_midi_get_event_count(midi_control_buffer) <= count); diff --git a/source/DEINDUGens/include/faust/gui/DecoratorUI.h b/source/DEINDUGens/include/faust/gui/DecoratorUI.h new file mode 100644 index 0000000000..d571c4c01a --- /dev/null +++ b/source/DEINDUGens/include/faust/gui/DecoratorUI.h @@ -0,0 +1,110 @@ +/************************************************************************ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. + ************************************************************************/ + +#ifndef Decorator_UI_H +#define Decorator_UI_H + +#include "faust/gui/UI.h" + +//---------------------------------------------------------------- +// Generic UI empty implementation +//---------------------------------------------------------------- + +class GenericUI : public UI +{ + + public: + + GenericUI(){} + virtual ~GenericUI() {} + + // -- widget's layouts + virtual void openTabBox(const char* label) {} + virtual void openHorizontalBox(const char* label) {} + virtual void openVerticalBox(const char* label) {} + virtual void closeBox() {} + + // -- active widgets + virtual void addButton(const char* label, FAUSTFLOAT* zone) {} + virtual void addCheckButton(const char* label, FAUSTFLOAT* zone) {} + virtual void addVerticalSlider(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT step) {} + virtual void addHorizontalSlider(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT step) {} + virtual void addNumEntry(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT step) {} + + // -- passive widgets + virtual void addHorizontalBargraph(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT min, FAUSTFLOAT max) {} + virtual void addVerticalBargraph(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT min, FAUSTFLOAT max) {} + + // -- soundfiles + virtual void addSoundfile(const char* label, Soundfile** sf_zone) {} + + virtual void declare(FAUSTFLOAT* zone, const char* key, const char* val) {} + +}; + +//---------------------------------------------------------------- +// Generic UI decorator +//---------------------------------------------------------------- + +class DecoratorUI : public UI +{ + + protected: + + UI* fUI; + + public: + + DecoratorUI(UI* ui = 0):fUI(ui) {} + virtual ~DecoratorUI() { delete fUI; } + + // -- widget's layouts + virtual void openTabBox(const char* label) { fUI->openTabBox(label); } + virtual void openHorizontalBox(const char* label) { fUI->openHorizontalBox(label); } + virtual void openVerticalBox(const char* label) { fUI->openVerticalBox(label); } + virtual void closeBox() { fUI->closeBox(); } + + // -- active widgets + virtual void addButton(const char* label, FAUSTFLOAT* zone) { fUI->addButton(label, zone); } + virtual void addCheckButton(const char* label, FAUSTFLOAT* zone) { fUI->addCheckButton(label, zone); } + virtual void addVerticalSlider(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT step) + { fUI->addVerticalSlider(label, zone, init, min, max, step); } + virtual void addHorizontalSlider(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT step) + { fUI->addHorizontalSlider(label, zone, init, min, max, step); } + virtual void addNumEntry(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT step) + { fUI->addNumEntry(label, zone, init, min, max, step); } + + // -- passive widgets + virtual void addHorizontalBargraph(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT min, FAUSTFLOAT max) + { fUI->addHorizontalBargraph(label, zone, min, max); } + virtual void addVerticalBargraph(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT min, FAUSTFLOAT max) + { fUI->addVerticalBargraph(label, zone, min, max); } + + // -- soundfiles + virtual void addSoundfile(const char* label, Soundfile** sf_zone) { fUI->addSoundfile(label, sf_zone); } + + virtual void declare(FAUSTFLOAT* zone, const char* key, const char* val) { fUI->declare(zone, key, val); } + +}; + +#endif diff --git a/source/DEINDUGens/include/faust/gui/FUI.h b/source/DEINDUGens/include/faust/gui/FUI.h index 0c3e52e7db..eeb4cb4992 100644 --- a/source/DEINDUGens/include/faust/gui/FUI.h +++ b/source/DEINDUGens/include/faust/gui/FUI.h @@ -1,34 +1,29 @@ /************************************************************************ - FAUST Architecture File - Copyright (C) 2003-2016 GRAME, Centre National de Creation Musicale - --------------------------------------------------------------------- - This Architecture section is free software; you can redistribute it - and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; If not, see . - - EXCEPTION : As a special exception, you may create a larger work - that contains this FAUST architecture section and distribute - that work under terms of your choice, so long as this FAUST - architecture section is not modified. - - - ************************************************************************ - ************************************************************************/ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. + ************************************************************************/ + #ifndef FAUST_FUI_H #define FAUST_FUI_H -#include "faust/gui/UI.h" - #include #include #include @@ -37,7 +32,8 @@ #include #include -#if 1 +#include "faust/gui/UI.h" +#include "faust/gui/PathBuilder.h" /******************************************************************************* * FUI : used to save and recall the state of the user interface @@ -46,122 +42,89 @@ * The file is human readable and editable ******************************************************************************/ -class FUI : public UI +class FUI : public UI, public PathBuilder { protected: - std::stack fGroupStack; - std::vector fNameList; std::map fName2Zone; - std::map fButtons; - - // labels are normalized by replacing white spaces by underscores and by removing parenthesis - std::string normalizeLabel(const char* label) - { - std::string s; - char c; - - while ((c = *label++)) { - if (isspace(c)) { s += '_'; } - //else if ((c == '(') | (c == ')') ) { } - else { s += c; } - } - return s; - } + std::vector fButtons; // add an element by relating its full name and memory zone virtual void addElement(const char* label, FAUSTFLOAT* zone, bool button = false) { - std::string fullname (fGroupStack.top() + '/' + normalizeLabel(label)); - fNameList.push_back(fullname); - fName2Zone[fullname] = zone; - fButtons[zone] = button; - } - - // keep track of full group names in a stack - virtual void pushGroupLabel(const char* label) - { - if (fGroupStack.empty()) { - fGroupStack.push(normalizeLabel(label)); - } else { - fGroupStack.push(fGroupStack.top() + '/' + normalizeLabel(label)); + std::string path = buildPath(label); + fName2Zone[path] = zone; + if (button) { + fButtons.push_back(zone); } } - virtual void popGroupLabel() - { - fGroupStack.pop(); - } - - + public: - FUI() {} - virtual ~FUI() {} + FUI() {} + virtual ~FUI() {} // -- Save and recall methods // save the zones values and full names virtual void saveState(const char* filename) { - std::ofstream f(filename); - - for (unsigned int i = 0; i < fNameList.size(); i++) { - std::string n = fNameList[i]; - FAUSTFLOAT* z = fName2Zone[n]; - f << *z << ' ' << n.c_str() << std::endl; + std::ofstream file(filename); + std::map::iterator it; + + for (it = fName2Zone.begin(); it != fName2Zone.end(); ++it) { + file << *(*it).second << ' ' << (*it).first << std::endl; } - f << std::endl; - f.close(); + file << std::endl; + file.close(); } // recall the zones values and full names virtual void recallState(const char* filename) { - std::ifstream f(filename); - FAUSTFLOAT v; - std::string n; - - while (f.good()) { - f >> v >> n; - if (fName2Zone.count(n) > 0) { - *(fName2Zone[n]) = v; - } else if (n.size() > 0) { - std::cerr << "recallState : parameter not found : " << n << " with value : " << v << std::endl; + std::ifstream file(filename); + FAUSTFLOAT value; + std::string path1, path2; + while (file.good()) { + file >> value >> path1; + path2 = "/" + path1; + if (fName2Zone.count(path1) > 0) { // Old path system + *(fName2Zone[path1]) = value; + } else if (fName2Zone.count(path2) > 0) { // New path system with the starting '/' + *(fName2Zone[path2]) = value; + } else if (path1.size() > 0) { + std::cerr << "recallState : parameter not found : " << path1 << " with value : " << value << std::endl; } } - f.close(); + file.close(); } void setButtons(bool state) { - std::map::iterator it; - for (it = fButtons.begin(); it != fButtons.end(); it++) { - FAUSTFLOAT* zone = (*it).first; - if ((*it).second) { - *zone = state; - } + for (int i = 0; i < fButtons.size(); i++) { + *fButtons[i] = state; } } // -- widget's layouts (just keep track of group labels) - virtual void openTabBox(const char* label) { pushGroupLabel(label); } - virtual void openHorizontalBox(const char* label) { pushGroupLabel(label); } - virtual void openVerticalBox(const char* label) { pushGroupLabel(label); } - virtual void closeBox() { popGroupLabel(); }; + virtual void openTabBox(const char* label) { fControlsLevel.push_back(label); } + virtual void openHorizontalBox(const char* label) { fControlsLevel.push_back(label); } + virtual void openVerticalBox(const char* label) { fControlsLevel.push_back(label); } + virtual void closeBox() { fControlsLevel.pop_back(); }; // -- active widgets (just add an element) virtual void addButton(const char* label, FAUSTFLOAT* zone) { addElement(label, zone, true); } virtual void addCheckButton(const char* label, FAUSTFLOAT* zone) { addElement(label, zone); } - virtual void addVerticalSlider(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT , FAUSTFLOAT , FAUSTFLOAT , FAUSTFLOAT) + virtual void addVerticalSlider(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT, FAUSTFLOAT, FAUSTFLOAT, FAUSTFLOAT) { addElement(label, zone); } - virtual void addHorizontalSlider(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT , FAUSTFLOAT , FAUSTFLOAT , FAUSTFLOAT) + virtual void addHorizontalSlider(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT, FAUSTFLOAT, FAUSTFLOAT, FAUSTFLOAT) { addElement(label, zone); } - virtual void addNumEntry(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT , FAUSTFLOAT , FAUSTFLOAT , FAUSTFLOAT) + virtual void addNumEntry(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT, FAUSTFLOAT, FAUSTFLOAT, FAUSTFLOAT) { addElement(label, zone); } // -- passive widgets (are ignored) @@ -177,5 +140,3 @@ class FUI : public UI #endif -#endif - diff --git a/source/DEINDUGens/include/faust/gui/GUI.h b/source/DEINDUGens/include/faust/gui/GUI.h index f50a151866..a8cf57e450 100644 --- a/source/DEINDUGens/include/faust/gui/GUI.h +++ b/source/DEINDUGens/include/faust/gui/GUI.h @@ -1,37 +1,36 @@ /************************************************************************ - FAUST Architecture File - Copyright (C) 2003-2016 GRAME, Centre National de Creation Musicale - --------------------------------------------------------------------- - This Architecture section is free software; you can redistribute it - and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; If not, see . - - EXCEPTION : As a special exception, you may create a larger work - that contains this FAUST architecture section and distribute - that work under terms of your choice, so long as this FAUST - architecture section is not modified. - - ************************************************************************ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. ************************************************************************/ -#ifndef FAUST_GUI_H -#define FAUST_GUI_H - -#include "faust/gui/UI.h" -#include "faust/gui/ring-buffer.h" +#ifndef __GUI_H__ +#define __GUI_H__ #include #include #include +#include + +#include "faust/gui/UI.h" +#include "faust/gui/ring-buffer.h" /******************************************************************************* * GUI : Abstract Graphic User Interface @@ -44,6 +43,7 @@ typedef void (*uiCallback)(FAUSTFLOAT val, void* data); class clist : public std::list { + public: virtual ~clist(); @@ -59,23 +59,23 @@ class GUI : public UI private: - static std::list fGuiList; - zmap fZoneMap; - bool fStopped; + static std::list fGuiList; + zmap fZoneMap; + bool fStopped; public: - GUI() : fStopped(false) + GUI():fStopped(false) { fGuiList.push_back(this); } virtual ~GUI() { - // delete all - zmap::iterator g; - for (g = fZoneMap.begin(); g != fZoneMap.end(); g++) { - delete (*g).second; + // delete all items + zmap::iterator it; + for (it = fZoneMap.begin(); it != fZoneMap.end(); it++) { + delete (*it).second; } // suppress 'this' in static fGuiList fGuiList.remove(this); @@ -144,9 +144,9 @@ class uiItem { protected: - GUI* fGUI; - FAUSTFLOAT* fZone; - FAUSTFLOAT fCache; + GUI* fGUI; + FAUSTFLOAT* fZone; + FAUSTFLOAT fCache; uiItem(GUI* ui, FAUSTFLOAT* zone):fGUI(ui), fZone(zone), fCache(FAUSTFLOAT(-123456.654321)) { @@ -167,8 +167,8 @@ class uiItem } } - FAUSTFLOAT cache() { return fCache; } - virtual void reflectZone() = 0; + FAUSTFLOAT cache() { return fCache; } + virtual void reflectZone() = 0; }; /** @@ -194,10 +194,10 @@ class uiOwnedItem : public uiItem { * Callback Item */ -struct uiCallbackItem : public uiItem -{ - uiCallback fCallback; - void* fData; +struct uiCallbackItem : public uiItem { + + uiCallback fCallback; + void* fData; uiCallbackItem(GUI* ui, FAUSTFLOAT* zone, uiCallback foo, void* data) : uiItem(ui, zone), fCallback(foo), fData(data) {} @@ -211,10 +211,63 @@ struct uiCallbackItem : public uiItem }; /** - * Allows to group a set of zones. + * Base class for timed items */ - -class uiGroupItem : public uiItem + +// For precise timestamped control +struct DatedControl { + + double fDate; + FAUSTFLOAT fValue; + + DatedControl(double d = 0., FAUSTFLOAT v = FAUSTFLOAT(0)):fDate(d), fValue(v) {} + +}; + +class uiTimedItem : public uiItem +{ + + protected: + + bool fDelete; + + public: + + uiTimedItem(GUI* ui, FAUSTFLOAT* zone):uiItem(ui, zone) + { + if (GUI::gTimedZoneMap.find(fZone) == GUI::gTimedZoneMap.end()) { + GUI::gTimedZoneMap[fZone] = ringbuffer_create(8192); + fDelete = true; + } else { + fDelete = false; + } + } + + virtual ~uiTimedItem() + { + ztimedmap::iterator it; + if (fDelete && ((it = GUI::gTimedZoneMap.find(fZone)) != GUI::gTimedZoneMap.end())) { + ringbuffer_free((*it).second); + GUI::gTimedZoneMap.erase(it); + } + } + + virtual void modifyZone(double date, FAUSTFLOAT v) + { + size_t res; + DatedControl dated_val(date, v); + if ((res = ringbuffer_write(GUI::gTimedZoneMap[fZone], (const char*)&dated_val, sizeof(DatedControl))) != sizeof(DatedControl)) { + std::cerr << "ringbuffer_write error DatedControl" << std::endl; + } + } + +}; + +/** + * Allows to group a set of zones + */ + +class uiGroupItem : public uiItem { protected: @@ -291,14 +344,4 @@ inline clist::~clist() } } -// For precise timestamped control -struct DatedControl { - - double fDate; - FAUSTFLOAT fValue; - - DatedControl(double d = 0., FAUSTFLOAT v = FAUSTFLOAT(0)):fDate(d), fValue(v) {} - -}; - #endif diff --git a/source/DEINDUGens/include/faust/gui/JSONUI.h b/source/DEINDUGens/include/faust/gui/JSONUI.h index 54f3d2f07d..fe56637296 100644 --- a/source/DEINDUGens/include/faust/gui/JSONUI.h +++ b/source/DEINDUGens/include/faust/gui/JSONUI.h @@ -1,40 +1,29 @@ /************************************************************************ - FAUST Architecture File - Copyright (C) 2003-2011 GRAME, Centre National de Creation Musicale - --------------------------------------------------------------------- - This Architecture section is free software; you can redistribute it - and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; If not, see . - - EXCEPTION : As a special exception, you may create a larger work - that contains this FAUST architecture section and distribute - that work under terms of your choice, so long as this FAUST - architecture section is not modified. - - - ************************************************************************ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. ************************************************************************/ #ifndef FAUST_JSONUI_H #define FAUST_JSONUI_H -#ifndef FAUSTFLOAT -#define FAUSTFLOAT float -#endif - -#include "faust/gui/UI.h" -#include "faust/gui/PathBuilder.h" -#include "faust/gui/meta.h" - #include #include #include @@ -42,12 +31,19 @@ #include #include +#include "faust/gui/UI.h" +#include "faust/gui/PathBuilder.h" +#include "faust/gui/meta.h" + /******************************************************************************* * JSONUI : Faust User Interface * This class produce a complete JSON decription of the DSP instance. ******************************************************************************/ -class JSONUI : public PathBuilder, public Meta, public UI +struct Soundfile; + +template +class JSONUIAux : public PathBuilder, public Meta, public UI { protected: @@ -56,9 +52,13 @@ class JSONUI : public PathBuilder, public Meta, public UI std::stringstream fUI; std::stringstream fMeta; std::vector > fMetaAux; + std::string fVersion; + std::string fOptions; std::string fName; std::string fExpandedCode; std::string fSHAKey; + std::string fDSPSize; + std::map fPathTable; char fCloseUIPar; char fCloseMetaPar; @@ -88,38 +88,26 @@ class JSONUI : public PathBuilder, public Meta, public UI fMetaAux.clear(); } } - - void init(const std::string& name, int inputs, int outputs, const std::string& sha_key, const std::string& dsp_code) - { - fTab = 1; - - // Start Meta generation - tab(fTab, fMeta); fMeta << "\"meta\": ["; - fCloseMetaPar = ' '; - - // Start UI generation - tab(fTab, fUI); fUI << "\"ui\": ["; - fCloseUIPar = ' '; - fTab += 1; - - fName = name; - fInputs = inputs; - fOutputs = outputs; - fExpandedCode = dsp_code; - fSHAKey = sha_key; - } - + + // Add escape (that is '\') for internal strings inline std::string flatten(const std::string& src) { + bool in_string = false; std::stringstream dst; for (size_t i = 0; i < src.size(); i++) { switch (src[i]) { case '\n': case '\t': - dst << ' '; + break; + case ' ': + if (in_string) dst << src[i]; break; case '"': dst << "\\" << '"'; + in_string = !in_string; + break; + case '\\': + dst << '\\' << '\\'; break; default: dst << src[i]; @@ -128,31 +116,87 @@ class JSONUI : public PathBuilder, public Meta, public UI } return dst.str(); } + + inline std::string getAddressIndex(const std::string& path) + { + if (fPathTable.find(path) != fPathTable.end()) { + std::stringstream num; num << fPathTable[path]; + return num.str(); + } else { + return "-1"; + } + } public: - JSONUI(const std::string& name, int inputs, int outputs, const std::string& sha_key, const std::string& dsp_code) + JSONUIAux(const std::string& name, + int inputs, + int outputs, + const std::string& sha_key, + const std::string& dsp_code, + const std::string& version, + const std::string& options, + const std::string& size, + const std::map& path_table) { - init(name, inputs, outputs, sha_key, dsp_code); + init(name, inputs, outputs, sha_key, dsp_code, version, options, size, path_table); } - JSONUI(const std::string& name, int inputs, int outputs) + JSONUIAux(const std::string& name, int inputs, int outputs) { - init(name, inputs, outputs, "", ""); + init(name, inputs, outputs, "", "", "", "", "", std::map()); } - JSONUI(int inputs, int outputs) + JSONUIAux(int inputs, int outputs) { - init("", inputs, outputs, "", ""); + init("", inputs, outputs, "", "","", "", "", std::map()); } - JSONUI() + JSONUIAux() { - init("", -1, -1, "", ""); + init("", -1, -1, "", "", "", "", "", std::map()); } - virtual ~JSONUI() {} - + virtual ~JSONUIAux() {} + + void setInputs(int inputs) { fInputs = inputs; } + void setOutputs(int outputs) { fOutputs = outputs; } + + // Init may be called multiple times so fMeta and fUI are reinitialized + void init(const std::string& name, + int inputs, + int outputs, + const std::string& sha_key, + const std::string& dsp_code, + const std::string& version, + const std::string& options, + const std::string& size, + const std::map& path_table) + { + fTab = 1; + + // Start Meta generation + fMeta.str(""); + tab(fTab, fMeta); fMeta << "\"meta\": ["; + fCloseMetaPar = ' '; + + // Start UI generation + fUI.str(""); + tab(fTab, fUI); fUI << "\"ui\": ["; + fCloseUIPar = ' '; + fTab += 1; + + fName = name; + fInputs = inputs; + fOutputs = outputs; + fExpandedCode = dsp_code; + fSHAKey = sha_key; + fDSPSize = size; + fPathTable = path_table; + fVersion = version; + fOptions = options; + } + // -- widget's layouts virtual void openGenericGroup(const char* label, const char* name) @@ -195,36 +239,50 @@ class JSONUI : public PathBuilder, public Meta, public UI } // -- active widgets - + virtual void addGenericButton(const char* label, const char* name) { + std::string path = buildPath(label); + std::string index = getAddressIndex(path); + fUI << fCloseUIPar; tab(fTab, fUI); fUI << "{"; tab(fTab + 1, fUI); fUI << "\"type\": \"" << name << "\","; - tab(fTab + 1, fUI); fUI << "\"label\": \"" << label << "\"" << ","; - tab(fTab + 1, fUI); fUI << "\"address\": \"" << buildPath(label) << "\"" << ((fMetaAux.size() > 0) ? "," : ""); + tab(fTab + 1, fUI); fUI << "\"label\": \"" << label << "\","; + if (fPathTable.size() > 0) { + tab(fTab + 1, fUI); fUI << "\"address\": \"" << path << "\","; + tab(fTab + 1, fUI); fUI << "\"index\": \"" << index << "\"" << ((fMetaAux.size() > 0) ? "," : ""); + } else { + tab(fTab + 1, fUI); fUI << "\"address\": \"" << path << "\"" << ((fMetaAux.size() > 0) ? "," : ""); + } addMeta(fTab + 1, false); tab(fTab, fUI); fUI << "}"; fCloseUIPar = ','; } - virtual void addButton(const char* label, FAUSTFLOAT* zone) + virtual void addButton(const char* label, REAL* zone) { addGenericButton(label, "button"); } - virtual void addCheckButton(const char* label, FAUSTFLOAT* zone) + virtual void addCheckButton(const char* label, REAL* zone) { addGenericButton(label, "checkbox"); } - virtual void addGenericEntry(const char* label, const char* name, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT step) + virtual void addGenericEntry(const char* label, const char* name, REAL init, REAL min, REAL max, REAL step) { + std::string path = buildPath(label); + std::string index = getAddressIndex(path); + fUI << fCloseUIPar; tab(fTab, fUI); fUI << "{"; tab(fTab + 1, fUI); fUI << "\"type\": \"" << name << "\","; - tab(fTab + 1, fUI); fUI << "\"label\": \"" << label << "\"" << ","; - tab(fTab + 1, fUI); fUI << "\"address\": \"" << buildPath(label) << "\"" << ","; + tab(fTab + 1, fUI); fUI << "\"label\": \"" << label << "\","; + tab(fTab + 1, fUI); fUI << "\"address\": \"" << path << "\","; + if (fPathTable.size() > 0) { + tab(fTab + 1, fUI); fUI << "\"index\": \"" << index << "\","; + } addMeta(fTab + 1); tab(fTab + 1, fUI); fUI << "\"init\": \"" << init << "\","; tab(fTab + 1, fUI); fUI << "\"min\": \"" << min << "\","; @@ -234,30 +292,36 @@ class JSONUI : public PathBuilder, public Meta, public UI fCloseUIPar = ','; } - virtual void addVerticalSlider(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT step) + virtual void addVerticalSlider(const char* label, REAL* zone, REAL init, REAL min, REAL max, REAL step) { addGenericEntry(label, "vslider", init, min, max, step); } - virtual void addHorizontalSlider(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT step) + virtual void addHorizontalSlider(const char* label, REAL* zone, REAL init, REAL min, REAL max, REAL step) { addGenericEntry(label, "hslider", init, min, max, step); } - virtual void addNumEntry(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT step) + virtual void addNumEntry(const char* label, REAL* zone, REAL init, REAL min, REAL max, REAL step) { addGenericEntry(label, "nentry", init, min, max, step); } // -- passive widgets - virtual void addGenericBargraph(const char* label, const char* name, FAUSTFLOAT min, FAUSTFLOAT max) + virtual void addGenericBargraph(const char* label, const char* name, REAL min, REAL max) { + std::string path = buildPath(label); + std::string index = getAddressIndex(path); + fUI << fCloseUIPar; tab(fTab, fUI); fUI << "{"; tab(fTab + 1, fUI); fUI << "\"type\": \"" << name << "\","; - tab(fTab + 1, fUI); fUI << "\"label\": \"" << label << "\"" << ","; - tab(fTab + 1, fUI); fUI << "\"address\": \"" << buildPath(label) << "\"" << ","; + tab(fTab + 1, fUI); fUI << "\"label\": \"" << label << "\","; + tab(fTab + 1, fUI); fUI << "\"address\": \"" << path << "\","; + if (fPathTable.size() > 0) { + tab(fTab + 1, fUI); fUI << "\"index\": \"" << index << "\","; + } addMeta(fTab + 1); tab(fTab + 1, fUI); fUI << "\"min\": \"" << min << "\","; tab(fTab + 1, fUI); fUI << "\"max\": \"" << max << "\""; @@ -265,19 +329,31 @@ class JSONUI : public PathBuilder, public Meta, public UI fCloseUIPar = ','; } - virtual void addHorizontalBargraph(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT min, FAUSTFLOAT max) + virtual void addHorizontalBargraph(const char* label, REAL* zone, REAL min, REAL max) { addGenericBargraph(label, "hbargraph", min, max); } - virtual void addVerticalBargraph(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT min, FAUSTFLOAT max) + virtual void addVerticalBargraph(const char* label, REAL* zone, REAL min, REAL max) { addGenericBargraph(label, "vbargraph", min, max); } + + virtual void addSoundfile(const char* label, Soundfile** zone) + { + fUI << fCloseUIPar; + tab(fTab, fUI); fUI << "{"; + tab(fTab + 1, fUI); fUI << "\"type\": \"" << "soundfile" << "\","; + tab(fTab + 1, fUI); fUI << "\"label\": \"" << label << "\"" << ","; + tab(fTab + 1, fUI); fUI << "\"address\": \"" << buildPath(label) << "\"" << ((fMetaAux.size() > 0) ? "," : ""); + addMeta(fTab + 1, false); + tab(fTab, fUI); fUI << "}"; + fCloseUIPar = ','; + } // -- metadata declarations - virtual void declare(FAUSTFLOAT* zone, const char* key, const char* val) + virtual void declare(REAL* zone, const char* key, const char* val) { fMetaAux.push_back(std::make_pair(key, val)); } @@ -297,6 +373,9 @@ class JSONUI : public PathBuilder, public Meta, public UI fJSON << "{"; fTab += 1; tab(fTab, fJSON); fJSON << "\"name\": \"" << fName << "\","; + if (fVersion != "") { tab(fTab, fJSON); fJSON << "\"version\": \"" << fVersion << "\","; } + if (fOptions != "") { tab(fTab, fJSON); fJSON << "\"options\": \"" << fOptions << "\","; } + if (fDSPSize != "") { tab(fTab, fJSON); fJSON << "\"size\": \"" << fDSPSize << "\","; } if (fSHAKey != "") { tab(fTab, fJSON); fJSON << "\"sha_key\": \"" << fSHAKey << "\","; } if (fExpandedCode != "") { tab(fTab, fJSON); fJSON << "\"code\": \"" << fExpandedCode << "\","; } tab(fTab, fJSON); fJSON << "\"inputs\": \"" << fInputs << "\","; @@ -309,10 +388,42 @@ class JSONUI : public PathBuilder, public Meta, public UI } else { fJSON << fUI.str(); } - tab(fTab, fJSON); fJSON << "}" << std::endl; + tab(fTab, fJSON); fJSON << "}"; return (flat) ? flatten(fJSON.str()) : fJSON.str(); } }; +// Externally available class using FAUSTFLOAT + +class JSONUI : public JSONUIAux +{ + public : + + JSONUI(const std::string& name, + int inputs, + int outputs, + const std::string& sha_key, + const std::string& dsp_code, + const std::string& version, + const std::string& options, + const std::string& size, + const std::map& path_table): + JSONUIAux(name, inputs, outputs, sha_key, dsp_code, version, options, size, path_table) + {} + + JSONUI(const std::string& name, int inputs, int outputs): + JSONUIAux(name, inputs, outputs) + {} + + JSONUI(int inputs, int outputs): + JSONUIAux(inputs, outputs) + {} + + JSONUI(): + JSONUIAux() + {} + +}; + #endif // FAUST_JSONUI_H diff --git a/source/DEINDUGens/include/faust/gui/JSONUIDecoder.h b/source/DEINDUGens/include/faust/gui/JSONUIDecoder.h new file mode 100644 index 0000000000..39a1c460ec --- /dev/null +++ b/source/DEINDUGens/include/faust/gui/JSONUIDecoder.h @@ -0,0 +1,281 @@ +/************************************************************************ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. + ************************************************************************/ + +#ifndef __JSONUIDecoder__ +#define __JSONUIDecoder__ + +#include +#include +#include +#include + +#include "faust/gui/UI.h" +#include "faust/gui/meta.h" +#include "faust/gui/SimpleParser.h" + +#ifdef _WIN32 +#include +#define snprintf _snprintf +#endif + +inline FAUSTFLOAT STR2REAL(const std::string& s) { return (strtod(s.c_str(), NULL)); } + +//------------------------------------------------------------------- +// Decode a dsp JSON description and implement 'buildUserInterface' +//------------------------------------------------------------------- + +typedef std::map > controlMap; + +struct JSONUIDecoder { + + std::string fName; + + std::map fMetadatas; + std::vector fUiItems; + + FAUSTFLOAT* fInControl; + FAUSTFLOAT* fOutControl; + + std::string fJSON; + + int fNumInputs, fNumOutputs; + int fInputItems, fOutputItems; + + std::string fVersion; + std::string fOptions; + + int fDSPSize; + + controlMap fPathInputTable; // [path, ] + controlMap fPathOutputTable; // [path, ] + + bool isInput(const string& type) { return (type == "vslider" || type == "hslider" || type == "nentry" || type == "button" || type == "checkbox"); } + bool isOutput(const string& type) { return (type == "hbargraph" || type == "vbargraph"); } + + JSONUIDecoder(const std::string& json) + { + fJSON = json; + const char* p = fJSON.c_str(); + parseJson(p, fMetadatas, fUiItems); + + // fMetadatas will contain the "meta" section as well as , , pairs + if (fMetadatas.find("name") != fMetadatas.end()) { + fName = fMetadatas["name"]; + fMetadatas.erase("name"); + } else { + fName = ""; + } + + if (fMetadatas.find("version") != fMetadatas.end()) { + fVersion = fMetadatas["version"]; + fMetadatas.erase("version"); + } else { + fVersion = ""; + } + + if (fMetadatas.find("options") != fMetadatas.end()) { + fOptions = fMetadatas["options"]; + fMetadatas.erase("options"); + } else { + fOptions = ""; + } + + if (fMetadatas.find("size") != fMetadatas.end()) { + fDSPSize = atoi(fMetadatas["size"].c_str()); + fMetadatas.erase("size"); + } else { + fDSPSize = -1; + } + + if (fMetadatas.find("inputs") != fMetadatas.end()) { + fNumInputs = atoi(fMetadatas["inputs"].c_str()); + fMetadatas.erase("inputs"); + } else { + fNumInputs = -1; + } + + if (fMetadatas.find("outputs") != fMetadatas.end()) { + fNumOutputs = atoi(fMetadatas["outputs"].c_str()); + fMetadatas.erase("outputs"); + } else { + fNumOutputs = -1; + } + + fInputItems = 0; + fOutputItems = 0; + + vector::iterator it; + for (it = fUiItems.begin(); it != fUiItems.end(); it++) { + string type = (*it)->type; + if (isInput(type)) { + fInputItems++; + } else if (isOutput(type)) { + fOutputItems++; + } + } + + fInControl = new FAUSTFLOAT[fInputItems]; + fOutControl = new FAUSTFLOAT[fOutputItems]; + + int counterIn = 0; + int counterOut = 0; + + // Prepare the fPathTable and init zone + for (it = fUiItems.begin(); it != fUiItems.end(); it++) { + string type = (*it)->type; + // Meta data declaration for input items + if (isInput(type)) { + if ((*it)->address != "") { + fPathInputTable[(*it)->address] = make_pair(atoi((*it)->index.c_str()), &fInControl[counterIn]); + } + fInControl[counterIn] = STR2REAL((*it)->init); + counterIn++; + } + // Meta data declaration for output items + else if (isOutput(type)) { + if ((*it)->address != "") { + fPathOutputTable[(*it)->address] = make_pair(atoi((*it)->index.c_str()), &fOutControl[counterOut]); + } + fOutControl[counterOut] = FAUSTFLOAT(0); + counterOut++; + } + } + } + + virtual ~JSONUIDecoder() + { + vector::iterator it; + for (it = fUiItems.begin(); it != fUiItems.end(); it++) { + delete(*it); + } + delete [] fInControl; + delete [] fOutControl; + } + + void metadata(Meta* m) + { + std::map::iterator it; + for (it = fMetadatas.begin(); it != fMetadatas.end(); it++) { + m->declare((*it).first.c_str(), (*it).second.c_str()); + } + } + + void resetUserInterface() + { + vector::iterator it; + int item = 0; + for (it = fUiItems.begin(); it != fUiItems.end(); it++) { + if (isInput((*it)->type)) { + fInControl[item++] = STR2REAL((*it)->init); + } + } + } + + void buildUserInterface(UI* ui) + { + // To be sure the floats are correctly encoded + char* tmp_local = setlocale(LC_ALL, NULL); + setlocale(LC_ALL, "C"); + + int counterIn = 0; + int counterOut = 0; + vector::iterator it; + + for (it = fUiItems.begin(); it != fUiItems.end(); it++) { + + bool isInItem = false; + bool isOutItem = false; + string type = (*it)->type; + + FAUSTFLOAT init = STR2REAL((*it)->init); + FAUSTFLOAT min = STR2REAL((*it)->min); + FAUSTFLOAT max = STR2REAL((*it)->max); + FAUSTFLOAT step = STR2REAL((*it)->step); + + if (isInput(type)) { + isInItem = true; + } else if (isOutput(type)) { + isOutItem = true; + } + + // Meta data declaration for input items + if (isInput(type)) { + fInControl[counterIn] = init; + for (int i = 0; i < (*it)->meta.size(); i++) { + ui->declare(&fInControl[counterIn], (*it)->meta[i].first.c_str(), (*it)->meta[i].second.c_str()); + } + } + // Meta data declaration for output items + else if (isOutput(type)) { + fOutControl[counterOut] = init; + for (int i = 0; i < (*it)->meta.size(); i++) { + ui->declare(&fOutControl[counterOut], (*it)->meta[i].first.c_str(), (*it)->meta[i].second.c_str()); + } + } + // Meta data declaration for group opening or closing + else { + for (int i = 0; i < (*it)->meta.size(); i++) { + ui->declare(0, (*it)->meta[i].first.c_str(), (*it)->meta[i].second.c_str()); + } + } + + if (type == "hgroup") { + ui->openHorizontalBox((*it)->label.c_str()); + } else if (type == "vgroup") { + ui->openVerticalBox((*it)->label.c_str()); + } else if (type == "tgroup") { + ui->openTabBox((*it)->label.c_str()); + } else if (type == "vslider") { + ui->addVerticalSlider((*it)->label.c_str(), &fInControl[counterIn], init, min, max, step); + } else if (type == "hslider") { + ui->addHorizontalSlider((*it)->label.c_str(), &fInControl[counterIn], init, min, max, step); + } else if (type == "checkbox") { + ui->addCheckButton((*it)->label.c_str(), &fInControl[counterIn]); + } else if (type == "hbargraph") { + ui->addHorizontalBargraph((*it)->label.c_str(), &fOutControl[counterOut], min, max); + } else if (type == "vbargraph") { + ui->addVerticalBargraph((*it)->label.c_str(), &fOutControl[counterOut], min, max); + } else if (type == "nentry") { + ui->addNumEntry((*it)->label.c_str(), &fInControl[counterIn], init, min, max, step); + } else if (type == "button") { + ui->addButton((*it)->label.c_str(), &fInControl[counterIn]); + } else if (type == "close") { + ui->closeBox(); + } + + if (isInItem) { + counterIn++; + } + + if (isOutItem) { + counterOut++; + } + } + + setlocale(LC_ALL, tmp_local); + } + +}; + + +#endif diff --git a/source/DEINDUGens/include/faust/gui/JuceGUI.h b/source/DEINDUGens/include/faust/gui/JuceGUI.h index 4a7dc89a1e..f9db5d93a5 100755 --- a/source/DEINDUGens/include/faust/gui/JuceGUI.h +++ b/source/DEINDUGens/include/faust/gui/JuceGUI.h @@ -1,26 +1,24 @@ /************************************************************************ FAUST Architecture File - Copyright (C) 2016 GRAME, Centre National de Creation Musicale + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale --------------------------------------------------------------------- This Architecture section is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; If not, see . - + EXCEPTION : As a special exception, you may create a larger work that contains this FAUST architecture section and distribute that work under terms of your choice, so long as this FAUST architecture section is not modified. - - ************************************************************************ ************************************************************************/ #ifndef FAUSTFLOAT @@ -881,7 +879,7 @@ class uiRadioButton : public uiComponent, private juce::Button::Listener * \param vert True if vertical, false if horizontal. * \param names Contain the names of the different items. * \param values Contain the "values" of the different items. - * \param fRadioGroupID RadioButton being multiple CheckButton in JUCE, + * \param fRadioGroupID RadioButton being multiple CheckButton in JUCE, * we need an ID to know which are linked together. */ uiRadioButton(GUI* gui, FAUSTFLOAT* zone, String label, FAUSTFLOAT w, FAUSTFLOAT h, FAUSTFLOAT cur, FAUSTFLOAT lo, FAUSTFLOAT hi, bool vert, vector& names, vector& values, String tooltip, int radioGroupID) : uiComponent(gui, zone, w, h, label), fIsVertical(vert) @@ -1824,14 +1822,20 @@ class JuceGUI : public GUI, public MetaDataUI, public Component { private: - + + bool fDefault = true; std::stack fBoxStack; uiBase* fCurrentBox = nullptr; // Current box used in buildUserInterface logic. int fRadioGroupID; // In case of radio buttons. //ScopedPointer fLaf = new CustomLookAndFeel(); ScopedPointer fLaf = new LookAndFeel_V3(); - + + FAUSTFLOAT defaultVal(FAUSTFLOAT* zone, FAUSTFLOAT def) + { + return (fDefault) ? def : *zone; + } + /** Add generic box to the user interface. */ void openBox(uiBase* box) { @@ -1846,13 +1850,13 @@ class JuceGUI : public GUI, public MetaDataUI, public Component void addSlider(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT step, int kWidth, int kHeight, SliderType type) { if (isKnob(zone)) { - addKnob(label, zone, init, min, max, step); + addKnob(label, zone, defaultVal(zone, init), min, max, step); } else if (isRadio(zone)) { - addRadioButtons(label, zone, init, min, max, step, fRadioDescription[zone].c_str(), false); + addRadioButtons(label, zone, defaultVal(zone, init), min, max, step, fRadioDescription[zone].c_str(), false); } else if (isMenu(zone)) { - addMenu(label, zone, init, min, max, step, fMenuDescription[zone].c_str()); + addMenu(label, zone, defaultVal(zone, init), min, max, step, fMenuDescription[zone].c_str()); } else { - fCurrentBox->add(new uiSlider(this, zone, kWidth, kHeight, min, max, init, step, String(label), String(fUnit[zone]), String(fTooltip[zone]), getScale(zone), type)); + fCurrentBox->add(new uiSlider(this, zone, kWidth, kHeight, min, max, defaultVal(zone, init), step, String(label), String(fUnit[zone]), String(fTooltip[zone]), getScale(zone), type)); } } @@ -1872,21 +1876,21 @@ class JuceGUI : public GUI, public MetaDataUI, public Component } if (vert) { - fCurrentBox->add(new uiRadioButton(this, zone, String(label), kCheckButtonWidth, names.size() * (kRadioButtonHeight - 25) + 25, init, min, max, true, names, values, String(fTooltip[zone]), fRadioGroupID++)); + fCurrentBox->add(new uiRadioButton(this, zone, String(label), kCheckButtonWidth, names.size() * (kRadioButtonHeight - 25) + 25, defaultVal(zone, init), min, max, true, names, values, String(fTooltip[zone]), fRadioGroupID++)); } else { - fCurrentBox->add(new uiRadioButton(this, zone, String(label), kCheckButtonWidth, kRadioButtonHeight, init, min, max, false, names, values, String(fTooltip[zone]), fRadioGroupID++)); + fCurrentBox->add(new uiRadioButton(this, zone, String(label), kCheckButtonWidth, kRadioButtonHeight, defaultVal(zone, init), min, max, false, names, values, String(fTooltip[zone]), fRadioGroupID++)); } } /** Add a menu to the user interface. */ void addMenu(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT step, const char* mdescr) { - fCurrentBox->add(new uiMenu(this, zone, String(label), kMenuWidth, kMenuHeight, init, min, max, String(fTooltip[zone]), mdescr)); + fCurrentBox->add(new uiMenu(this, zone, String(label), kMenuWidth, kMenuHeight, defaultVal(zone, init), min, max, String(fTooltip[zone]), mdescr)); } /** Add a ciruclar slider to the user interface. */ void addKnob(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT step) { - fCurrentBox->add(new uiSlider(this, zone, kKnobWidth, kKnobHeight, min, max, init, step, String(label), String(fUnit[zone]), String(fTooltip[zone]), getScale(zone), Knob)); + fCurrentBox->add(new uiSlider(this, zone, kKnobWidth, kKnobHeight, min, max, defaultVal(zone, init), step, String(label), String(fUnit[zone]), String(fTooltip[zone]), getScale(zone), Knob)); } /** Add a bargraph to the user interface. */ @@ -1906,7 +1910,7 @@ class JuceGUI : public GUI, public MetaDataUI, public Component * \brief Constructor. * \details Initialize the JuceGUI specific variables. */ - JuceGUI():fRadioGroupID(0) + JuceGUI(bool def = true):fDefault(def), fRadioGroupID(1) // fRadioGroupID must start at 1 {} /** diff --git a/source/DEINDUGens/include/faust/gui/JuceOSCUI.h b/source/DEINDUGens/include/faust/gui/JuceOSCUI.h index 3cebdd6529..33dda90210 100755 --- a/source/DEINDUGens/include/faust/gui/JuceOSCUI.h +++ b/source/DEINDUGens/include/faust/gui/JuceOSCUI.h @@ -1,26 +1,24 @@ /************************************************************************ - FAUST Architecture File - Copyright (C) 2016 GRAME, Centre National de Creation Musicale - --------------------------------------------------------------------- - This Architecture section is free software; you can redistribute it - and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; If not, see . - - EXCEPTION : As a special exception, you may create a larger work - that contains this FAUST architecture section and distribute - that work under terms of your choice, so long as this FAUST - architecture section is not modified. - - ************************************************************************ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. ************************************************************************/ #ifndef __juce_osc__ diff --git a/source/DEINDUGens/include/faust/gui/JuceParameterUI.h b/source/DEINDUGens/include/faust/gui/JuceParameterUI.h index c3cc508f78..66b0bca223 100644 --- a/source/DEINDUGens/include/faust/gui/JuceParameterUI.h +++ b/source/DEINDUGens/include/faust/gui/JuceParameterUI.h @@ -1,41 +1,40 @@ /************************************************************************ - FAUST Architecture File - Copyright (C) 2017 GRAME, Centre National de Creation Musicale - --------------------------------------------------------------------- - This Architecture section is free software; you can redistribute it - and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; If not, see . - - EXCEPTION : As a special exception, you may create a larger work - that contains this FAUST architecture section and distribute - that work under terms of your choice, so long as this FAUST - architecture section is not modified. - - ************************************************************************ - ************************************************************************/ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. + ************************************************************************/ + #ifndef JuceParameterUI_H #define JuceParameterUI_H #include "../JuceLibraryCode/JuceHeader.h" #include "faust/gui/GUI.h" +#include "faust/gui/PathBuilder.h" // Link AudioParameterBool with on/off parameter struct FaustPlugInAudioParameterBool : public AudioParameterBool, public uiOwnedItem { - FaustPlugInAudioParameterBool(GUI* gui, FAUSTFLOAT* zone, const char* label) - :AudioParameterBool(label, label, false), uiOwnedItem(gui, zone) + FaustPlugInAudioParameterBool(GUI* gui, FAUSTFLOAT* zone, const std::string& path, const std::string& label) + :AudioParameterBool(path, label, false), uiOwnedItem(gui, zone) {} void reflectZone() override @@ -56,8 +55,8 @@ struct FaustPlugInAudioParameterBool : public AudioParameterBool, public uiOwned struct FaustPlugInAudioParameterFloat : public AudioParameterFloat, public uiOwnedItem { - FaustPlugInAudioParameterFloat(GUI* gui, FAUSTFLOAT* zone, const char* label, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT step) - :AudioParameterFloat(label, label, float(min), float(max), float(init)), uiOwnedItem(gui, zone) + FaustPlugInAudioParameterFloat(GUI* gui, FAUSTFLOAT* zone, const std::string& path, const std::string& label, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT step) + :AudioParameterFloat(path, label, float(min), float(max), float(init)), uiOwnedItem(gui, zone) {} void reflectZone() override @@ -76,7 +75,7 @@ struct FaustPlugInAudioParameterFloat : public AudioParameterFloat, public uiOwn // A class to create AudioProcessorParameter objects for each zone -class JuceParameterUI : public GUI { +class JuceParameterUI : public GUI, public PathBuilder { private: @@ -87,42 +86,61 @@ class JuceParameterUI : public GUI { JuceParameterUI(AudioProcessor* processor):fProcessor(processor) {} + // -- widget's layouts + + virtual void openTabBox(const char* label) + { + fControlsLevel.push_back(label); + } + virtual void openHorizontalBox(const char* label) + { + fControlsLevel.push_back(label); + } + virtual void openVerticalBox(const char* label) + { + fControlsLevel.push_back(label); + } + virtual void closeBox() + { + fControlsLevel.pop_back(); + } + // -- active widgets virtual void addButton(const char* label, FAUSTFLOAT* zone) { - fProcessor->addParameter(new FaustPlugInAudioParameterBool(this, zone, label)); + fProcessor->addParameter(new FaustPlugInAudioParameterBool(this, zone, buildPath(label), label)); } virtual void addCheckButton(const char* label, FAUSTFLOAT* zone) { - fProcessor->addParameter(new FaustPlugInAudioParameterBool(this, zone, label)); + fProcessor->addParameter(new FaustPlugInAudioParameterBool(this, zone, buildPath(label), label)); } virtual void addVerticalSlider(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT step) { - fProcessor->addParameter(new FaustPlugInAudioParameterFloat(this, zone, label, init, min, max, step)); + fProcessor->addParameter(new FaustPlugInAudioParameterFloat(this, zone, buildPath(label), label, init, min, max, step)); } virtual void addHorizontalSlider(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT step) { - fProcessor->addParameter(new FaustPlugInAudioParameterFloat(this, zone, label, init, min, max, step)); + fProcessor->addParameter(new FaustPlugInAudioParameterFloat(this, zone, buildPath(label), label, init, min, max, step)); } virtual void addNumEntry(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT step) { - fProcessor->addParameter(new FaustPlugInAudioParameterFloat(this, zone, label, init, min, max, step)); + fProcessor->addParameter(new FaustPlugInAudioParameterFloat(this, zone, buildPath(label), label, init, min, max, step)); } // -- passive widgets virtual void addHorizontalBargraph(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT min, FAUSTFLOAT max) { - fProcessor->addParameter(new FaustPlugInAudioParameterFloat(this, zone, label, 0, min, max, 0)); + fProcessor->addParameter(new FaustPlugInAudioParameterFloat(this, zone, buildPath(label), label, 0, min, max, 0)); } virtual void addVerticalBargraph(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT min, FAUSTFLOAT max) { - fProcessor->addParameter(new FaustPlugInAudioParameterFloat(this, zone, label, 0, min, max, 0)); + fProcessor->addParameter(new FaustPlugInAudioParameterFloat(this, zone, buildPath(label), label, 0, min, max, 0)); } }; diff --git a/source/DEINDUGens/include/faust/gui/JuceStateUI.h b/source/DEINDUGens/include/faust/gui/JuceStateUI.h index 0e81d84c0b..31d620d16c 100644 --- a/source/DEINDUGens/include/faust/gui/JuceStateUI.h +++ b/source/DEINDUGens/include/faust/gui/JuceStateUI.h @@ -1,26 +1,24 @@ /************************************************************************ - FAUST Architecture File - Copyright (C) 2017 GRAME, Centre National de Creation Musicale - --------------------------------------------------------------------- - This Architecture section is free software; you can redistribute it - and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; If not, see . - - EXCEPTION : As a special exception, you may create a larger work - that contains this FAUST architecture section and distribute - that work under terms of your choice, so long as this FAUST - architecture section is not modified. - - ************************************************************************ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. ************************************************************************/ #ifndef JuceStateUI_H @@ -30,18 +28,18 @@ #include "../JuceLibraryCode/JuceHeader.h" -#include "faust/gui/UI.h" +#include "faust/gui/DecoratorUI.h" -// A class to save/restore DSP state using JUCE +// A class to save/restore DSP state using JUCE, which also set default values at construction time. -class JuceStateUI : public UI { +class JuceStateUI : public GenericUI { private: std::vector fZones; - + public: - + void getStateInformation (MemoryBlock& destData) { MemoryOutputStream stream (destData, true); @@ -60,7 +58,7 @@ class JuceStateUI : public UI { void setStateInformation (const void* data, int sizeInBytes) { MemoryInputStream stream (data, static_cast (sizeInBytes), false); - + if (sizeof(FAUSTFLOAT) == sizeof(float)) { for (int i = 0; i < sizeInBytes / sizeof(float); i++) { *fZones[i] = stream.readFloat(); @@ -72,31 +70,14 @@ class JuceStateUI : public UI { } } - // -- widget's layouts - - virtual void openTabBox(const char* label) {}; - virtual void openHorizontalBox(const char* label) {} - virtual void openVerticalBox(const char* label) {} - virtual void closeBox() {} - // -- active widgets virtual void addButton(const char* label, FAUSTFLOAT* zone) { fZones.push_back(zone); } virtual void addCheckButton(const char* label, FAUSTFLOAT* zone) { fZones.push_back(zone); } - virtual void addVerticalSlider(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT step) { fZones.push_back(zone); } - virtual void addHorizontalSlider(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT step) { fZones.push_back(zone); } - virtual void addNumEntry(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT step) { fZones.push_back(zone); }; - - // -- passive widgets - - virtual void addHorizontalBargraph(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT min, FAUSTFLOAT max) {} - virtual void addVerticalBargraph(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT min, FAUSTFLOAT max) {} - - // -- metadata declarations - - virtual void declare(FAUSTFLOAT*, const char*, const char*) {} - - + virtual void addVerticalSlider(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT step) { fZones.push_back(zone); *zone = init; } + virtual void addHorizontalSlider(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT step) { fZones.push_back(zone); *zone = init; } + virtual void addNumEntry(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT step) { fZones.push_back(zone); *zone = init;}; + }; #endif diff --git a/source/DEINDUGens/include/faust/gui/MapUI.h b/source/DEINDUGens/include/faust/gui/MapUI.h index a9cd2fa3d1..9038db446d 100644 --- a/source/DEINDUGens/include/faust/gui/MapUI.h +++ b/source/DEINDUGens/include/faust/gui/MapUI.h @@ -1,36 +1,29 @@ /************************************************************************ - FAUST Architecture File - Copyright (C) 2003-2011 GRAME, Centre National de Creation Musicale - --------------------------------------------------------------------- - This Architecture section is free software; you can redistribute it - and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; If not, see . - - EXCEPTION : As a special exception, you may create a larger work - that contains this FAUST architecture section and distribute - that work under terms of your choice, so long as this FAUST - architecture section is not modified. - - - ************************************************************************ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. ************************************************************************/ #ifndef FAUST_MAPUI_H #define FAUST_MAPUI_H -#ifndef FAUSTFLOAT -#define FAUSTFLOAT float -#endif - #include #include #include diff --git a/source/DEINDUGens/include/faust/gui/MetaDataUI.h b/source/DEINDUGens/include/faust/gui/MetaDataUI.h index bce9beff5b..43c040f204 100644 --- a/source/DEINDUGens/include/faust/gui/MetaDataUI.h +++ b/source/DEINDUGens/include/faust/gui/MetaDataUI.h @@ -1,32 +1,33 @@ /************************************************************************ - FAUST Architecture File - Copyright (C) 2003-2016 GRAME, Centre National de Creation Musicale - --------------------------------------------------------------------- - This Architecture section is free software; you can redistribute it - and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; If not, see . - - EXCEPTION : As a special exception, you may create a larger work - that contains this FAUST architecture section and distribute - that work under terms of your choice, so long as this FAUST - architecture section is not modified. - - - ************************************************************************ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. ************************************************************************/ #ifndef MetaData_UI_H #define MetaData_UI_H +#ifndef FAUSTFLOAT +#define FAUSTFLOAT float +#endif + #include #include #include @@ -34,10 +35,6 @@ #include "faust/gui/SimpleParser.h" -#ifndef FAUSTFLOAT -#define FAUSTFLOAT float -#endif - static inline bool startWith(const std::string& str, const std::string& prefix) { return (str.substr(0, prefix.size()) == prefix); @@ -80,263 +77,275 @@ static inline FAUSTFLOAT dB2Scale(FAUSTFLOAT dB) class MetaDataUI { -protected: - - std::string fGroupTooltip; - std::map fGuiSize; // map widget zone with widget size coef - std::map fTooltip; // map widget zone with tooltip strings - std::map fUnit; // map widget zone to unit string (i.e. "dB") - std::map fRadioDescription; // map zone to {'low':440; ...; 'hi':1000.0} - std::map fMenuDescription; // map zone to {'low':440; ...; 'hi':1000.0} - std::set fKnobSet; // set of widget zone to be knobs - std::set fLedSet; // set of widget zone to be LEDs - std::set fNumSet; // set of widget zone to be numerical bargraphs - std::set fLogSet; // set of widget zone having a log UI scale - std::set fExpSet; // set of widget zone having an exp UI scale - - void clearMetadata() - { - fGuiSize.clear(); - fTooltip.clear(); - fUnit.clear(); - fRadioDescription.clear(); - fMenuDescription.clear(); - fKnobSet.clear(); - fLedSet.clear(); - fNumSet.clear(); - fLogSet.clear(); - fExpSet.clear(); - } - - bool isKnob(FAUSTFLOAT* zone) - { - return fKnobSet.count(zone) > 0; - } - - bool isRadio(FAUSTFLOAT* zone) - { - return fRadioDescription.count(zone) > 0; - } - - bool isMenu(FAUSTFLOAT* zone) - { - return fMenuDescription.count(zone) > 0; - } - - bool isLed(FAUSTFLOAT* zone) - { - return fLedSet.count(zone) > 0; - } - - bool isNumerical(FAUSTFLOAT* zone) - { - return fNumSet.count(zone) > 0; - } - - /** - * rmWhiteSpaces(): Remove the leading and trailing white spaces of a string - * (but not those in the middle of the string) - */ - std::string rmWhiteSpaces(const std::string& s) - { - size_t i = s.find_first_not_of(" \t"); - size_t j = s.find_last_not_of(" \t"); - if ((i != std::string::npos) && (j != std::string::npos)) { - return s.substr(i, 1+j-i); - } else { - return ""; + protected: + + std::string fGroupTooltip; + std::map fGuiSize; // map widget zone with widget size coef + std::map fTooltip; // map widget zone with tooltip strings + std::map fUnit; // map widget zone to unit string (i.e. "dB") + std::map fRadioDescription; // map zone to {'low':440; ...; 'hi':1000.0} + std::map fMenuDescription; // map zone to {'low':440; ...; 'hi':1000.0} + std::set fKnobSet; // set of widget zone to be knobs + std::set fLedSet; // set of widget zone to be LEDs + std::set fNumSet; // set of widget zone to be numerical bargraphs + std::set fLogSet; // set of widget zone having a log UI scale + std::set fExpSet; // set of widget zone having an exp UI scale + std::set fHiddenSet; // set of hidden widget zone + + void clearMetadata() + { + fGuiSize.clear(); + fTooltip.clear(); + fUnit.clear(); + fRadioDescription.clear(); + fMenuDescription.clear(); + fKnobSet.clear(); + fLedSet.clear(); + fNumSet.clear(); + fLogSet.clear(); + fExpSet.clear(); + fHiddenSet.clear(); } - } - - /** - * Extracts metdata from a label : 'vol [unit: dB]' -> 'vol' + metadata(unit=dB) - */ - void extractMetadata(const std::string& fulllabel, std::string& label, std::map& metadata) - { - enum {kLabel, kEscape1, kEscape2, kEscape3, kKey, kValue}; - int state = kLabel; int deep = 0; - std::string key, value; - for (unsigned int i = 0; i < fulllabel.size(); i++) { - char c = fulllabel[i]; - switch (state) { - case kLabel : - assert(deep == 0); - switch (c) { - case '\\' : state = kEscape1; break; - case '[' : state = kKey; deep++; break; - default : label += c; - } - break; - - case kEscape1: - label += c; - state = kLabel; - break; - - case kEscape2: - key += c; - state = kKey; - break; - - case kEscape3: - value += c; - state = kValue; - break; - - case kKey: - assert(deep > 0); - switch (c) { - case '\\': - state = kEscape2; - break; - - case '[': - deep++; - key += c; - break; - - case ':': - if (deep == 1) { - state = kValue; - } else { - key += c; + /** + * rmWhiteSpaces(): Remove the leading and trailing white spaces of a string + * (but not those in the middle of the string) + */ + std::string rmWhiteSpaces(const std::string& s) + { + size_t i = s.find_first_not_of(" \t"); + size_t j = s.find_last_not_of(" \t"); + if ((i != std::string::npos) && (j != std::string::npos)) { + return s.substr(i, 1+j-i); + } else { + return ""; + } + } + + /** + * Extracts metdata from a label : 'vol [unit: dB]' -> 'vol' + metadata(unit=dB) + */ + void extractMetadata(const std::string& fulllabel, std::string& label, std::map& metadata) + { + enum {kLabel, kEscape1, kEscape2, kEscape3, kKey, kValue}; + int state = kLabel; int deep = 0; + std::string key, value; + + for (unsigned int i = 0; i < fulllabel.size(); i++) { + char c = fulllabel[i]; + switch (state) { + case kLabel : + assert(deep == 0); + switch (c) { + case '\\' : state = kEscape1; break; + case '[' : state = kKey; deep++; break; + default : label += c; } - break; - case ']': - deep--; - if (deep < 1) { - metadata[rmWhiteSpaces(key)] = ""; - state = kLabel; - key=""; - value=""; + break; + + case kEscape1: + label += c; + state = kLabel; + break; + + case kEscape2: + key += c; + state = kKey; + break; + + case kEscape3: + value += c; + state = kValue; + break; + + case kKey: + assert(deep > 0); + switch (c) { + case '\\': + state = kEscape2; + break; + + case '[': + deep++; + key += c; + break; + + case ':': + if (deep == 1) { + state = kValue; } else { key += c; } - break; - default : key += c; - } - break; - - case kValue: - assert(deep > 0); - switch (c) { - case '\\': - state = kEscape3; - break; - - case '[': - deep++; - value += c; - break; - - case ']': - deep--; - if (deep < 1) { - metadata[rmWhiteSpaces(key)] = rmWhiteSpaces(value); - state = kLabel; - key = ""; - value = ""; - } else { + break; + case ']': + deep--; + if (deep < 1) { + metadata[rmWhiteSpaces(key)] = ""; + state = kLabel; + key=""; + value=""; + } else { + key += c; + } + break; + default : key += c; + } + break; + + case kValue: + assert(deep > 0); + switch (c) { + case '\\': + state = kEscape3; + break; + + case '[': + deep++; value += c; - } - break; - default : value += c; - } - break; - - default: - std::cerr << "ERROR unrecognized state " << state << std::endl; + break; + + case ']': + deep--; + if (deep < 1) { + metadata[rmWhiteSpaces(key)] = rmWhiteSpaces(value); + state = kLabel; + key = ""; + value = ""; + } else { + value += c; + } + break; + default : value += c; + } + break; + + default: + std::cerr << "ERROR unrecognized state " << state << std::endl; + } } + label = rmWhiteSpaces(label); } - label = rmWhiteSpaces(label); - } - - /** - * Format tooltip string by replacing some white spaces by - * return characters so that line width doesn't exceed n. - * Limitation : long words exceeding n are not cut - */ - std::string formatTooltip(int n, const std::string& tt) - { - std::string ss = tt; // ss string we are going to format - int lws = 0; // last white space encountered - int lri = 0; // last return inserted - for (int i = 0; i < (int)tt.size(); i++) { - if (tt[i] == ' ') lws = i; - if (((i-lri) >= n) && (lws > lri)) { - // insert return here - ss[lws] = '\n'; - lri = lws; + + /** + * Format tooltip string by replacing some white spaces by + * return characters so that line width doesn't exceed n. + * Limitation : long words exceeding n are not cut + */ + std::string formatTooltip(int n, const std::string& tt) + { + std::string ss = tt; // ss string we are going to format + int lws = 0; // last white space encountered + int lri = 0; // last return inserted + for (int i = 0; i < (int)tt.size(); i++) { + if (tt[i] == ' ') lws = i; + if (((i-lri) >= n) && (lws > lri)) { + // insert return here + ss[lws] = '\n'; + lri = lws; + } } + return ss; + } + + public: + + virtual ~MetaDataUI() + {} + + enum Scale { + kLin, + kLog, + kExp + }; + + Scale getScale(FAUSTFLOAT* zone) + { + if (fLogSet.count(zone) > 0) return kLog; + if (fExpSet.count(zone) > 0) return kExp; + return kLin; } - return ss; - } - -public: - - virtual ~MetaDataUI() - {} - enum Scale { - kLin, - kLog, - kExp - }; + bool isKnob(FAUSTFLOAT* zone) + { + return fKnobSet.count(zone) > 0; + } + + bool isRadio(FAUSTFLOAT* zone) + { + return fRadioDescription.count(zone) > 0; + } + + bool isMenu(FAUSTFLOAT* zone) + { + return fMenuDescription.count(zone) > 0; + } + + bool isLed(FAUSTFLOAT* zone) + { + return fLedSet.count(zone) > 0; + } + + bool isNumerical(FAUSTFLOAT* zone) + { + return fNumSet.count(zone) > 0; + } - Scale getScale(FAUSTFLOAT* zone) - { - if (fLogSet.count(zone) > 0) return kLog; - if (fExpSet.count(zone) > 0) return kExp; - return kLin; - } + bool isHidden(FAUSTFLOAT* zone) + { + return fHiddenSet.count(zone) > 0; + } - /** - * Analyses the widget zone metadata declarations and takes appropriate actions - */ - void declare(FAUSTFLOAT* zone, const char* key, const char* value) - { - if (zone == 0) { - // special zone 0 means group metadata - if (strcmp(key,"tooltip") == 0) { - // only group tooltip are currently implemented - fGroupTooltip = formatTooltip(30, value); - } - } else { - if (strcmp(key,"size") == 0) { - fGuiSize[zone] = atof(value); - } - else if (strcmp(key,"tooltip") == 0) { - fTooltip[zone] = formatTooltip(30, value); - } - else if (strcmp(key,"unit") == 0) { - fUnit[zone] = value ; - } - else if (strcmp(key,"scale") == 0) { - if (strcmp(value,"log") == 0) { - fLogSet.insert(zone); - } else if (strcmp(value,"exp") == 0) { - fExpSet.insert(zone); + /** + * Analyses the widget zone metadata declarations and takes appropriate actions + */ + void declare(FAUSTFLOAT* zone, const char* key, const char* value) + { + if (zone == 0) { + // special zone 0 means group metadata + if (strcmp(key, "tooltip") == 0) { + // only group tooltip are currently implemented + fGroupTooltip = formatTooltip(30, value); + } else if (strcmp(key, "hidden") == 0) { + fHiddenSet.insert(zone); } - } - else if (strcmp(key,"style") == 0) { - if (strcmp(value,"knob") == 0) { - fKnobSet.insert(zone); - } else if (strcmp(value,"led") == 0) { - fLedSet.insert(zone); - } else if (strcmp(value,"numerical") == 0) { - fNumSet.insert(zone); - } else { - const char* p = value; - if (parseWord(p, "radio")) { - fRadioDescription[zone] = std::string(p); - } else if (parseWord(p, "menu")) { - fMenuDescription[zone] = std::string(p); + } else { + if (strcmp(key, "size") == 0) { + fGuiSize[zone] = atof(value); + } + else if (strcmp(key, "tooltip") == 0) { + fTooltip[zone] = formatTooltip(30, value); + } + else if (strcmp(key, "unit") == 0) { + fUnit[zone] = value; + } + else if (strcmp(key, "hidden") == 0) { + fHiddenSet.insert(zone); + } + else if (strcmp(key, "scale") == 0) { + if (strcmp(value, "log") == 0) { + fLogSet.insert(zone); + } else if (strcmp(value, "exp") == 0) { + fExpSet.insert(zone); + } + } + else if (strcmp(key, "style") == 0) { + if (strcmp(value, "knob") == 0) { + fKnobSet.insert(zone); + } else if (strcmp(value, "led") == 0) { + fLedSet.insert(zone); + } else if (strcmp(value, "numerical") == 0) { + fNumSet.insert(zone); + } else { + const char* p = value; + if (parseWord(p, "radio")) { + fRadioDescription[zone] = std::string(p); + } else if (parseWord(p, "menu")) { + fMenuDescription[zone] = std::string(p); + } } } } } - } }; diff --git a/source/DEINDUGens/include/faust/gui/MidiUI.h b/source/DEINDUGens/include/faust/gui/MidiUI.h index c3baba0044..9bf44f0324 100644 --- a/source/DEINDUGens/include/faust/gui/MidiUI.h +++ b/source/DEINDUGens/include/faust/gui/MidiUI.h @@ -1,35 +1,29 @@ /************************************************************************ - FAUST Architecture File - Copyright (C) 2003-2016 GRAME, Centre National de Creation Musicale - --------------------------------------------------------------------- - This Architecture section is free software; you can redistribute it - and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; If not, see . - - EXCEPTION : As a special exception, you may create a larger work - that contains this FAUST architecture section and distribute - that work under terms of your choice, so long as this FAUST - architecture section is not modified. - - ************************************************************************ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. ************************************************************************/ #ifndef FAUST_MIDIUI_H #define FAUST_MIDIUI_H -#ifndef FAUSTFLOAT -#define FAUSTFLOAT float -#endif - #include #include #include @@ -93,65 +87,55 @@ struct MidiMeta : public Meta, public std::map /******************************************************************************* * MidiUI : Faust User Interface * This class decodes MIDI meta data and maps incoming MIDI messages to them. - * Currently ctrl, keyon/keyoff, keypress, pgm, chanpress, pitchwheel/pitchbend + * Currently ctrl, keyon/keyoff, keypress, pgm, chanpress, pitchwheel/pitchbend * start/stop/clock meta data is handled. ******************************************************************************/ - -class uiMidiItem : public uiItem { - + +class uiMidi { + protected: + + midi* fMidiOut; + bool fInputCtrl; + + public: + + uiMidi(midi* midi_out, bool input):fMidiOut(midi_out), fInputCtrl(input) + {} + + virtual ~uiMidi() + {} - midi* fMidiOut; - bool fInputCtrl; +}; +class uiMidiItem : public uiMidi, public uiItem { + public: + + uiMidiItem(midi* midi_out, GUI* ui, FAUSTFLOAT* zone, bool input = true) + :uiMidi(midi_out, input), uiItem(ui, zone) + {} + + virtual ~uiMidiItem() + {} + + virtual void reflectZone() {} - uiMidiItem(midi* midi_out, GUI* ui, FAUSTFLOAT* zone, bool input) - :uiItem(ui, zone), fMidiOut(midi_out), fInputCtrl(input) {} - virtual ~uiMidiItem() {} - }; - -class uiMidiTimedItem : public uiMidiItem -{ - protected: + +class uiMidiTimedItem : public uiMidi, public uiTimedItem { - bool fDelete; - public: - - uiMidiTimedItem(midi* midi_out, GUI* ui, FAUSTFLOAT* zone, bool input = true) - :uiMidiItem(midi_out, ui, zone, input) - { - if (GUI::gTimedZoneMap.find(fZone) == GUI::gTimedZoneMap.end()) { - GUI::gTimedZoneMap[fZone] = ringbuffer_create(8192); - fDelete = true; - } else { - fDelete = false; - } - } - virtual ~uiMidiTimedItem() - { - ztimedmap::iterator it; - if (fDelete && ((it = GUI::gTimedZoneMap.find(fZone)) != GUI::gTimedZoneMap.end())) { - ringbuffer_free((*it).second); - GUI::gTimedZoneMap.erase(it); - } - } - - void modifyZone(double date, FAUSTFLOAT v) - { - size_t res; - DatedControl dated_val(date, v); - if ((res = ringbuffer_write(GUI::gTimedZoneMap[fZone], (const char*)&dated_val, sizeof(DatedControl))) != sizeof(DatedControl)) { - std::cerr << "ringbuffer_write error DatedControl" << std::endl; - } - } + uiMidiTimedItem(midi* midi_out, GUI* ui, FAUSTFLOAT* zone, bool input = true) + :uiMidi(midi_out, input), uiTimedItem(ui, zone) + {} - // TODO + virtual ~uiMidiTimedItem() + {} + virtual void reflectZone() {} - + }; // MIDI sync @@ -213,21 +197,22 @@ class uiMidiClock : public uiMidiTimedItem {} virtual ~uiMidiClock() {} - - void modifyZone(double date, FAUSTFLOAT v) - { - if (fInputCtrl) { - fState = !fState; - uiMidiTimedItem::modifyZone(date, FAUSTFLOAT(fState)); - } - } - + virtual void reflectZone() { FAUSTFLOAT v = *fZone; fCache = v; fMidiOut->clock(0); } + + void modifyZone(double date, FAUSTFLOAT v) + { + if (fInputCtrl) { + fState = !fState; + uiMidiTimedItem::modifyZone(date, FAUSTFLOAT(fState)); + } + } + }; class uiMidiProgChange : public uiMidiItem @@ -469,7 +454,8 @@ class MidiUI : public GUI, public midi std::vector > fMetaAux; midi_handler* fMidiHandler; - + bool fDelete; + void addGenericZone(FAUSTFLOAT* zone, FAUSTFLOAT min, FAUSTFLOAT max, bool input = true) { if (fMetaAux.size() > 0) { @@ -507,15 +493,17 @@ class MidiUI : public GUI, public midi public: - MidiUI(midi_handler* midi_handler) + MidiUI(midi_handler* midi_handler, bool delete_handler = false) { fMidiHandler = midi_handler; fMidiHandler->addMidiIn(this); + fDelete = delete_handler; } virtual ~MidiUI() { fMidiHandler->removeMidiIn(this); + if (fDelete) delete fMidiHandler; } bool run() { return fMidiHandler->start_midi(); } diff --git a/source/DEINDUGens/include/faust/gui/OCVUI.h b/source/DEINDUGens/include/faust/gui/OCVUI.h index 1f90261fa6..bb8e315c27 100644 --- a/source/DEINDUGens/include/faust/gui/OCVUI.h +++ b/source/DEINDUGens/include/faust/gui/OCVUI.h @@ -1,10 +1,26 @@ -/****************************************************************************** -******************************************************************************* +/************************************************************************ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. + ************************************************************************/ - OPENCV USER INTERFACE - -******************************************************************************* -*******************************************************************************/ #ifndef _OCVUI_H #define _OCVUI_H diff --git a/source/DEINDUGens/include/faust/gui/OSCUI.h b/source/DEINDUGens/include/faust/gui/OSCUI.h index 532f42d8e9..d53b1ce6b2 100644 --- a/source/DEINDUGens/include/faust/gui/OSCUI.h +++ b/source/DEINDUGens/include/faust/gui/OSCUI.h @@ -1,27 +1,24 @@ /************************************************************************ - FAUST Architecture File - Copyright (C) 2003-2016 GRAME, Centre National de Creation Musicale - --------------------------------------------------------------------- - This Architecture section is free software; you can redistribute it - and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; If not, see . - - EXCEPTION : As a special exception, you may create a larger work - that contains this FAUST architecture section and distribute - that work under terms of your choice, so long as this FAUST - architecture section is not modified. - - - ************************************************************************ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. ************************************************************************/ /* @@ -34,9 +31,10 @@ #ifndef __OSCUI__ #define __OSCUI__ +#include + #include "faust/gui/OSCControler.h" #include "faust/gui/GUI.h" -#include #ifdef _WIN32 #define strcasecmp _stricmp diff --git a/source/DEINDUGens/include/faust/gui/PathBuilder.h b/source/DEINDUGens/include/faust/gui/PathBuilder.h index 1ddd5c5d77..efda9a72a7 100644 --- a/source/DEINDUGens/include/faust/gui/PathBuilder.h +++ b/source/DEINDUGens/include/faust/gui/PathBuilder.h @@ -1,27 +1,24 @@ /************************************************************************ - FAUST Architecture File - Copyright (C) 2003-2011 GRAME, Centre National de Creation Musicale - --------------------------------------------------------------------- - This Architecture section is free software; you can redistribute it - and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; If not, see . - - EXCEPTION : As a special exception, you may create a larger work - that contains this FAUST architecture section and distribute - that work under terms of your choice, so long as this FAUST - architecture section is not modified. - - - ************************************************************************ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. ************************************************************************/ #ifndef FAUST_PATHBUILDER_H diff --git a/source/DEINDUGens/include/faust/gui/PrintUI.h b/source/DEINDUGens/include/faust/gui/PrintUI.h index d8a4be30aa..39b543d0ec 100644 --- a/source/DEINDUGens/include/faust/gui/PrintUI.h +++ b/source/DEINDUGens/include/faust/gui/PrintUI.h @@ -1,40 +1,35 @@ /************************************************************************ - FAUST Architecture File - Copyright (C) 2003-2011 GRAME, Centre National de Creation Musicale - --------------------------------------------------------------------- - This Architecture section is free software; you can redistribute it - and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; If not, see . - - EXCEPTION : As a special exception, you may create a larger work - that contains this FAUST architecture section and distribute - that work under terms of your choice, so long as this FAUST - architecture section is not modified. - - - ************************************************************************ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. ************************************************************************/ #ifndef FAUST_PRINTUI_H #define FAUST_PRINTUI_H -#ifndef FAUSTFLOAT -#define FAUSTFLOAT float -#endif +#include +#include +#include #include "faust/gui/UI.h" #include "faust/gui/PathBuilder.h" -#include -#include /******************************************************************************* * PrintUI : Faust User Interface diff --git a/source/DEINDUGens/include/faust/gui/RosCI.h b/source/DEINDUGens/include/faust/gui/RosCI.h index 3ace08cd4f..381c29e8b1 100644 --- a/source/DEINDUGens/include/faust/gui/RosCI.h +++ b/source/DEINDUGens/include/faust/gui/RosCI.h @@ -1,22 +1,37 @@ +/************************************************************************ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. + ************************************************************************/ + /********************************************** * ROS Callbacks Interface * -* This interface allows the user to use ROS -* metadata -* It handles ROS metadata, and writes the -* callbacks directly in the .cpp file. +* This interface allows the user to use ROS metadata +* It handles ROS metadata, and writes the callbacks directly in the .cpp file. * **********************************************/ #ifndef FAUST_RosCI_H #define FAUST_RosCI_H -#ifndef FAUSTFLOAT -#define FAUSTFLOAT float -#endif - -#include "faust/gui/UI.h" - #include #include #include @@ -24,6 +39,8 @@ #include #include +#include "faust/gui/UI.h" + class RosCI : public UI { diff --git a/source/DEINDUGens/include/faust/gui/RosUI.h b/source/DEINDUGens/include/faust/gui/RosUI.h index 6f9335271c..d23750e16f 100644 --- a/source/DEINDUGens/include/faust/gui/RosUI.h +++ b/source/DEINDUGens/include/faust/gui/RosUI.h @@ -1,28 +1,48 @@ +/************************************************************************ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. + ************************************************************************/ + /********************************************** * ROS User Interface * * This interface creates default callbacks -* with default messages types +* with default messages types * It also returns parameters for specific ROS -* callbacks, defined in the RosCallbacks class -* thanks to the RosCI.h and ros-callbacks.cpp -* architecture files +* callbacks, defined in the RosCallbacks class +* thanks to the RosCI.h and ros-callbacks.cpp +* architecture files **********************************************/ + #ifndef FAUST_RosUI_H #define FAUST_RosUI_H -#ifndef FAUSTFLOAT -#define FAUSTFLOAT float -#endif +#include +#include #include "faust/gui/UI.h" #include "ros/ros.h" #include "std_msgs/Bool.h" #include "std_msgs/Float32.h" -#include -#include - class RosUI : public UI { diff --git a/source/DEINDUGens/include/faust/gui/SimpleParser.h b/source/DEINDUGens/include/faust/gui/SimpleParser.h index 14128ffc4a..cc6498a8bd 100644 --- a/source/DEINDUGens/include/faust/gui/SimpleParser.h +++ b/source/DEINDUGens/include/faust/gui/SimpleParser.h @@ -1,12 +1,11 @@ /************************************************************************ - ************************************************************************ - FAUST compiler - Copyright (C) 2003-2015 GRAME, Centre National de Creation Musicale + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale --------------------------------------------------------------------- - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,9 +13,12 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ************************************************************************ + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. ************************************************************************/ #ifndef SIMPLEPARSER_H @@ -42,6 +44,7 @@ struct itemInfo { std::string type; std::string label; std::string address; + std::string index; std::string init; std::string min; std::string max; @@ -367,6 +370,13 @@ static bool parseUI(const char*& p, std::vector& uiItems, int& numIte } } + else if (label == "index") { + if (parseChar(p, ':') && parseDQString(p, value)) { + itemInfo* item = uiItems[numItems]; + item->index = value; + } + } + else if (label == "meta") { itemInfo* item = uiItems[numItems]; if (!parseItemMetaData(p, item->meta)) { diff --git a/source/DEINDUGens/include/faust/gui/SoundUI.h b/source/DEINDUGens/include/faust/gui/SoundUI.h new file mode 100644 index 0000000000..c15b86b889 --- /dev/null +++ b/source/DEINDUGens/include/faust/gui/SoundUI.h @@ -0,0 +1,68 @@ +/************************************************************************ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. + ************************************************************************/ + +#ifndef __SoundUI_H__ +#define __SoundUI_H__ + +#include +#include + +#include "faust/gui/DecoratorUI.h" +#include "faust/audio/soundfile.h" + +class SoundUI : public GenericUI +{ + + private: + + std::map fSFMap; + + public: + + SoundUI(){} + + virtual ~SoundUI() + { + // delete all soundfiles + std::map::iterator it; + for (it = fSFMap.begin(); it != fSFMap.end(); it++) { + delete (*it).second; + } + } + + // -- soundfiles + virtual void addSoundfile(const char* label, Soundfile** sf_zone) + { + // check if 'label' is already loaded + if (fSFMap.find(label) == fSFMap.end()) { + fSFMap[label] = new Soundfile(label, 64); + } + *sf_zone = fSFMap[label]; + } + +}; + +// To be used in no SoundUI is used +static Soundfile* defaultsound = new Soundfile("", MAX_CHAN); + +#endif diff --git a/source/DEINDUGens/include/faust/gui/UI.h b/source/DEINDUGens/include/faust/gui/UI.h index 2b78e11ff5..af511f4757 100644 --- a/source/DEINDUGens/include/faust/gui/UI.h +++ b/source/DEINDUGens/include/faust/gui/UI.h @@ -1,31 +1,28 @@ /************************************************************************ - FAUST Architecture File - Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale - --------------------------------------------------------------------- - This Architecture section is free software; you can redistribute it - and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; If not, see . - - EXCEPTION : As a special exception, you may create a larger work - that contains this FAUST architecture section and distribute - that work under terms of your choice, so long as this FAUST - architecture section is not modified. - - - ************************************************************************ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. ************************************************************************/ -#ifndef FAUST_UI_H -#define FAUST_UI_H +#ifndef __UI_H__ +#define __UI_H__ #ifndef FAUSTFLOAT #define FAUSTFLOAT float @@ -38,6 +35,8 @@ * generate to describe a DSP user interface. ******************************************************************************/ +struct Soundfile; + class UI { @@ -66,6 +65,10 @@ class UI virtual void addHorizontalBargraph(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT min, FAUSTFLOAT max) = 0; virtual void addVerticalBargraph(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT min, FAUSTFLOAT max) = 0; + + // -- soundfiles + + virtual void addSoundfile(const char* label, Soundfile** sf_zone) {} // -- metadata declarations diff --git a/source/DEINDUGens/include/faust/gui/ValueConverter.h b/source/DEINDUGens/include/faust/gui/ValueConverter.h index 40cc13453c..04a71d29b6 100644 --- a/source/DEINDUGens/include/faust/gui/ValueConverter.h +++ b/source/DEINDUGens/include/faust/gui/ValueConverter.h @@ -1,27 +1,24 @@ /************************************************************************ - FAUST Architecture File - Copyright (C) 2003-2016 GRAME, Centre National de Creation Musicale - --------------------------------------------------------------------- - This Architecture section is free software; you can redistribute it - and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; If not, see . - - EXCEPTION : As a special exception, you may create a larger work - that contains this FAUST architecture section and distribute - that work under terms of your choice, so long as this FAUST - architecture section is not modified. - - - ************************************************************************ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. ************************************************************************/ #ifndef __ValueConverter__ @@ -516,7 +513,8 @@ class ZoneReader virtual ~ZoneReader() {} - int getValue() { + int getValue() + { if (fZone != 0) { return (int)fInterpolator(*fZone); } else { diff --git a/source/DEINDUGens/include/faust/gui/console.h b/source/DEINDUGens/include/faust/gui/console.h index a88cd14442..2768ac615c 100644 --- a/source/DEINDUGens/include/faust/gui/console.h +++ b/source/DEINDUGens/include/faust/gui/console.h @@ -1,38 +1,26 @@ /************************************************************************ - - IMPORTANT NOTE : this file contains two clearly delimited sections : - the ARCHITECTURE section (in two parts) and the USER section. Each section - is governed by its own copyright and license. Please check individually - each section for license and copyright information. -*************************************************************************/ - -/*******************BEGIN ARCHITECTURE SECTION (part 1/2)****************/ - -/************************************************************************ - FAUST Architecture File - Copyright (C) 2003-2011 GRAME, Centre National de Creation Musicale - --------------------------------------------------------------------- - This Architecture section is free software; you can redistribute it - and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; If not, see . - - EXCEPTION : As a special exception, you may create a larger work - that contains this FAUST architecture section and distribute - that work under terms of your choice, so long as this FAUST - architecture section is not modified. - - - ************************************************************************ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. ************************************************************************/ + #ifndef __faustconsole__ #define __faustconsole__ @@ -87,7 +75,7 @@ class CMDUI : public UI int level = 0; std::string dst; - while (src[i] ) { + while (src[i]) { switch (level) { @@ -251,10 +239,10 @@ class CMDUI : public UI } } - unsigned long files() { return fFiles.size(); } - char* file (int n) { return fFiles[n]; } + unsigned long files() { return fFiles.size(); } + char* file(int n) { return fFiles[n]; } - char* input_file () { std::cout << "input file " << fFiles[0] << "\n"; return fFiles[0]; } + char* input_file() { std::cout << "input file " << fFiles[0] << "\n"; return fFiles[0]; } char* output_file() { std::cout << "output file " << fFiles[1] << "\n"; return fFiles[1]; } void process_init() diff --git a/source/DEINDUGens/include/faust/gui/faustgtk.h b/source/DEINDUGens/include/faust/gui/faustgtk.h index e4b137eaa6..c34395b9a4 100644 --- a/source/DEINDUGens/include/faust/gui/faustgtk.h +++ b/source/DEINDUGens/include/faust/gui/faustgtk.h @@ -1,35 +1,29 @@ /************************************************************************ - FAUST Architecture File - Copyright (C) 2003-2016 GRAME, Centre National de Creation Musicale - --------------------------------------------------------------------- - This Architecture section is free software; you can redistribute it - and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; If not, see . - - EXCEPTION : As a special exception, you may create a larger work - that contains this FAUST architecture section and distribute - that work under terms of your choice, so long as this FAUST - architecture section is not modified. - - - ************************************************************************ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. ************************************************************************/ #ifndef FAUST_GTKUI_H #define FAUST_GTKUI_H -#include "faust/gui/GUI.h" -#include "faust/gui/MetaDataUI.h" - /****************************************************************************** ******************************************************************************* @@ -49,7 +43,10 @@ #include #include -#define stackSize 256 +#include "faust/gui/GUI.h" +#include "faust/gui/MetaDataUI.h" + +#define kStackSize 256 // Insertion modes @@ -72,7 +69,7 @@ namespace gtk_knob class GtkKnob { private: - double start_x, start_y, max_value; + public: GtkRange parent; int last_quadrant; @@ -518,8 +515,8 @@ class GTKUI : public GUI, public MetaDataUI GtkWidget* fWindow; int fTop; - GtkWidget* fBox[stackSize]; - int fMode[stackSize]; + GtkWidget* fBox[kStackSize]; + int fMode[kStackSize]; bool fStopped; GtkWidget* addWidget(const char* label, GtkWidget* w); @@ -531,7 +528,7 @@ class GTKUI : public GUI, public MetaDataUI static const gboolean fill = true; static const gboolean homogene = false; - GTKUI(char * name, int* pargc, char*** pargv); + GTKUI(char* name, int* pargc, char*** pargv); // -- Labels and metadata @@ -633,7 +630,7 @@ GTKUI::GTKUI(char * name, int* pargc, char*** pargv) void GTKUI::pushBox(int mode, GtkWidget* w) { ++fTop; - assert(fTop < stackSize); + assert(fTop < kStackSize); fMode[fTop] = mode; fBox[fTop] = w; } diff --git a/source/DEINDUGens/include/faust/gui/faustqt.h b/source/DEINDUGens/include/faust/gui/faustqt.h index fb39e84887..3657ac7840 100644 --- a/source/DEINDUGens/include/faust/gui/faustqt.h +++ b/source/DEINDUGens/include/faust/gui/faustqt.h @@ -1,7 +1,6 @@ /************************************************************************ - ************************************************************************ FAUST Architecture File - Copyright (C) 2003-2011 GRAME, Centre National de Creation Musicale + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale --------------------------------------------------------------------- This Architecture section is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -16,7 +15,10 @@ You should have received a copy of the GNU General Public License along with this program; If not, see . - ************************************************************************ + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. ************************************************************************/ #ifndef __faustqt__ @@ -59,13 +61,12 @@ #include #include #include +#include #include "faust/gui/GUI.h" #include "faust/gui/ValueConverter.h" #include "faust/gui/MetaDataUI.h" -#include - // for compatibility #define minValue minimum #define maxValue maximum @@ -1624,7 +1625,7 @@ class QTGUI : public QWidget, public GUI, public MetaDataUI QObject::connect(w, SIGNAL(valueChanged(double)), c, SLOT(setValue(double))); if (label && label[0]) closeBox(); checkForTooltip(zone, w); - clearMetadata(); + // Metadata is not cleared here, since it will be by the enclosing element calling addNumDisplay } ////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/DEINDUGens/include/faust/gui/httpdUI.h b/source/DEINDUGens/include/faust/gui/httpdUI.h index c1c71ca740..ca79d04e0f 100644 --- a/source/DEINDUGens/include/faust/gui/httpdUI.h +++ b/source/DEINDUGens/include/faust/gui/httpdUI.h @@ -1,27 +1,24 @@ /************************************************************************ - FAUST Architecture File - Copyright (C) 2003-2016 GRAME, Centre National de Creation Musicale - --------------------------------------------------------------------- - This Architecture section is free software; you can redistribute it - and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; If not, see . - - EXCEPTION : As a special exception, you may create a larger work - that contains this FAUST architecture section and distribute - that work under terms of your choice, so long as this FAUST - architecture section is not modified. - - - ************************************************************************ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. ************************************************************************/ #ifndef __httpdUI__ @@ -31,7 +28,7 @@ #include #include "faust/gui/HTTPDControler.h" -#include "faust/gui/UI.h" +#include "faust/gui/DecoratorUI.h" #include "faust/gui/PathBuilder.h" #include "faust/misc.h" @@ -339,49 +336,6 @@ class httpdClientUI : public GUI, public PathBuilder, public httpdUIAux Creates a httpdServerUI or httpdClientUI depending of the presence of '-server URL' parameter. */ -//---------------------------------------------------------------- -// Generic decorator -//---------------------------------------------------------------- - -class DecoratorUI : public UI -{ - protected: - - UI* fUI; - - public: - - DecoratorUI(UI* ui = 0):fUI(ui) - {} - - virtual ~DecoratorUI() { delete fUI; } - - // -- widget's layouts - virtual void openTabBox(const char* label) { fUI->openTabBox(label); } - virtual void openHorizontalBox(const char* label) { fUI->openHorizontalBox(label); } - virtual void openVerticalBox(const char* label) { fUI->openVerticalBox(label); } - virtual void closeBox() { fUI->closeBox(); } - - // -- active widgets - virtual void addButton(const char* label, FAUSTFLOAT* zone) { fUI->addButton(label, zone); } - virtual void addCheckButton(const char* label, FAUSTFLOAT* zone) { fUI->addCheckButton(label, zone); } - virtual void addVerticalSlider(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT step) - { fUI->addVerticalSlider(label, zone, init, min, max, step); } - virtual void addHorizontalSlider(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT step) - { fUI->addHorizontalSlider(label, zone, init, min, max, step); } - virtual void addNumEntry(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT step) - { fUI->addNumEntry(label, zone, init, min, max, step); } - - // -- passive widgets - virtual void addHorizontalBargraph(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT min, FAUSTFLOAT max) - { fUI->addHorizontalBargraph(label, zone, min, max); } - virtual void addVerticalBargraph(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT min, FAUSTFLOAT max) - { fUI->addVerticalBargraph(label, zone, min, max); } - - virtual void declare(FAUSTFLOAT* zone, const char* key, const char* val) { fUI->declare(zone, key, val); } - -}; - class httpdUI : public DecoratorUI { diff --git a/source/DEINDUGens/include/faust/gui/meta.h b/source/DEINDUGens/include/faust/gui/meta.h index 410c8c6103..858f1ba9f1 100644 --- a/source/DEINDUGens/include/faust/gui/meta.h +++ b/source/DEINDUGens/include/faust/gui/meta.h @@ -1,24 +1,26 @@ /************************************************************************ - ************************************************************************ - FAUST Architecture File - Copyright (C) 2003-2011 GRAME, Centre National de Creation Musicale - --------------------------------------------------------------------- - This Architecture section is free software; you can redistribute it - and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; If not, see . - - ************************************************************************ - ************************************************************************/ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. + ************************************************************************/ + #ifndef __meta__ #define __meta__ diff --git a/source/DEINDUGens/include/faust/midi/RtMidi.h b/source/DEINDUGens/include/faust/midi/RtMidi.h index 73dedeb2d0..5fb647aaf3 100644 --- a/source/DEINDUGens/include/faust/midi/RtMidi.h +++ b/source/DEINDUGens/include/faust/midi/RtMidi.h @@ -42,8 +42,8 @@ POSSIBILITY OF SUCH DAMAGE. Copyright (C) 2013 Apple Inc. All Rights Reserved. - */ + #if !defined(__CAHostTimeBase_h__) #define __CAHostTimeBase_h__ diff --git a/source/DEINDUGens/include/faust/midi/bela-midi.h b/source/DEINDUGens/include/faust/midi/bela-midi.h index 48683a4846..3b442e1eb0 100644 --- a/source/DEINDUGens/include/faust/midi/bela-midi.h +++ b/source/DEINDUGens/include/faust/midi/bela-midi.h @@ -1,26 +1,24 @@ /************************************************************************ - FAUST Architecture File - Copyright (C) 2016 GRAME, Centre National de Creation Musicale - --------------------------------------------------------------------- - This Architecture section is free software; you can redistribute it - and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; If not, see . - - EXCEPTION : As a special exception, you may create a larger work - that contains this FAUST architecture section and distribute - that work under terms of your choice, so long as this FAUST - architecture section is not modified. - - ************************************************************************ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. ************************************************************************/ #ifndef __bela_midi__ diff --git a/source/DEINDUGens/include/faust/midi/jack-midi.h b/source/DEINDUGens/include/faust/midi/jack-midi.h index c014790816..f3a10a6d31 100644 --- a/source/DEINDUGens/include/faust/midi/jack-midi.h +++ b/source/DEINDUGens/include/faust/midi/jack-midi.h @@ -1,26 +1,24 @@ /************************************************************************ - FAUST Architecture File - Copyright (C) 2016 GRAME, Centre National de Creation Musicale - --------------------------------------------------------------------- - This Architecture section is free software; you can redistribute it - and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; If not, see . - - EXCEPTION : As a special exception, you may create a larger work - that contains this FAUST architecture section and distribute - that work under terms of your choice, so long as this FAUST - architecture section is not modified. - - ************************************************************************ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. ************************************************************************/ #ifndef __jack_midi__ @@ -28,6 +26,7 @@ #include #include + #include #include "faust/midi/midi.h" #include "faust/gui/ring-buffer.h" diff --git a/source/DEINDUGens/include/faust/midi/juce-midi.h b/source/DEINDUGens/include/faust/midi/juce-midi.h index ab9c456107..be80eb07df 100755 --- a/source/DEINDUGens/include/faust/midi/juce-midi.h +++ b/source/DEINDUGens/include/faust/midi/juce-midi.h @@ -1,28 +1,26 @@ /************************************************************************ - FAUST Architecture File - Copyright (C) 2016 GRAME, Centre National de Creation Musicale - --------------------------------------------------------------------- - This Architecture section is free software; you can redistribute it - and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; If not, see . - - EXCEPTION : As a special exception, you may create a larger work - that contains this FAUST architecture section and distribute - that work under terms of your choice, so long as this FAUST - architecture section is not modified. - - ************************************************************************ - ************************************************************************/ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. + ************************************************************************/ + #ifndef __juce_midi__ #define __juce_midi__ diff --git a/source/DEINDUGens/include/faust/midi/midi.h b/source/DEINDUGens/include/faust/midi/midi.h index 3aff4ff13f..c11ed19c33 100644 --- a/source/DEINDUGens/include/faust/midi/midi.h +++ b/source/DEINDUGens/include/faust/midi/midi.h @@ -1,26 +1,24 @@ /************************************************************************ - FAUST Architecture File - Copyright (C) 2003-2011 GRAME, Centre National de Creation Musicale - --------------------------------------------------------------------- - This Architecture section is free software; you can redistribute it - and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; If not, see . - - EXCEPTION : As a special exception, you may create a larger work - that contains this FAUST architecture section and distribute - that work under terms of your choice, so long as this FAUST - architecture section is not modified. - - ************************************************************************ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. ************************************************************************/ #ifndef __midi__ diff --git a/source/DEINDUGens/include/faust/midi/rt-midi.h b/source/DEINDUGens/include/faust/midi/rt-midi.h index 35b1c1895e..cfbec0fc6e 100644 --- a/source/DEINDUGens/include/faust/midi/rt-midi.h +++ b/source/DEINDUGens/include/faust/midi/rt-midi.h @@ -1,26 +1,24 @@ /************************************************************************ - FAUST Architecture File - Copyright (C) 2003-2011 GRAME, Centre National de Creation Musicale - --------------------------------------------------------------------- - This Architecture section is free software; you can redistribute it - and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; If not, see . - - EXCEPTION : As a special exception, you may create a larger work - that contains this FAUST architecture section and distribute - that work under terms of your choice, so long as this FAUST - architecture section is not modified. - - ************************************************************************ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. ************************************************************************/ #ifndef __rt_midi__ diff --git a/source/DEINDUGens/include/faust/misc.h b/source/DEINDUGens/include/faust/misc.h index ff22a38a93..923b0ddd82 100644 --- a/source/DEINDUGens/include/faust/misc.h +++ b/source/DEINDUGens/include/faust/misc.h @@ -1,22 +1,24 @@ /************************************************************************ - ************************************************************************ - FAUST Architecture File - Copyright (C) 2003-2011 GRAME, Centre National de Creation Musicale - --------------------------------------------------------------------- - This Architecture section is free software; you can redistribute it - and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; If not, see . - - ************************************************************************ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. ************************************************************************/ #ifndef __misc__ diff --git a/source/DEINDUGens/include/faust/osc/RootNode.h b/source/DEINDUGens/include/faust/osc/RootNode.h index 770a473f32..e7a1483eb3 100644 --- a/source/DEINDUGens/include/faust/osc/RootNode.h +++ b/source/DEINDUGens/include/faust/osc/RootNode.h @@ -73,6 +73,24 @@ struct aliastarget return (fMinOut+fMaxOut)/2.0; } } + + float invscale(float x) const + { + if (fMinOut < fMaxOut) { + // increasing control + float z = (x < fMinOut) ? fMinOut : (x > fMaxOut) ? fMaxOut : x; + return fMinIn + (z-fMinOut)*(fMaxIn-fMinIn)/(fMaxOut-fMinOut); + + } else if (fMinOut > fMaxOut) { + // reversed control + float z = (x < fMaxOut) ? fMaxOut : (x > fMinOut) ? fMinOut : x; + return fMinIn + (fMinOut-z)*(fMaxIn-fMinIn)/(fMinOut-fMaxOut); + + } else { + // no control ! + return (fMinIn+fMaxIn)/2.0; + } + } }; //-------------------------------------------------------------------------- @@ -107,7 +125,7 @@ class RootNode : public MessageDriven void hello(unsigned long ipdest) const; ///< handler for the 'hello' message void setPorts(int* in, int* out, int* err); - std::vector getAliases(const std::string& address); + std::vector > getAliases(const std::string& address, double value); }; } // end namespoace diff --git a/source/DEINDUGens/include/faust/sound-file.h b/source/DEINDUGens/include/faust/sound-file.h index 9ad28f4449..6aedb72bca 100644 --- a/source/DEINDUGens/include/faust/sound-file.h +++ b/source/DEINDUGens/include/faust/sound-file.h @@ -1,27 +1,24 @@ /************************************************************************ - FAUST Architecture File - Copyright (C) 2003-2016 GRAME, Centre National de Creation Musicale - --------------------------------------------------------------------- - This Architecture section is free software; you can redistribute it - and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; If not, see . - - EXCEPTION : As a special exception, you may create a larger work - that contains this FAUST architecture section and distribute - that work under terms of your choice, so long as this FAUST - architecture section is not modified. - - - ************************************************************************ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. ************************************************************************/ #ifndef __SoundFileReader__ diff --git a/source/DEINDUGens/include/faust/unity/AudioPluginInterface.h b/source/DEINDUGens/include/faust/unity/AudioPluginInterface.h index e887869df4..8dc4f34f00 100644 --- a/source/DEINDUGens/include/faust/unity/AudioPluginInterface.h +++ b/source/DEINDUGens/include/faust/unity/AudioPluginInterface.h @@ -1,3 +1,26 @@ +/************************************************************************ + FAUST Architecture File + Copyright (C) 2003-2017 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This Architecture section is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; If not, see . + + EXCEPTION : As a special exception, you may create a larger work + that contains this FAUST architecture section and distribute + that work under terms of your choice, so long as this FAUST + architecture section is not modified. + ************************************************************************/ + #ifndef __UNITYAUDIOPLUGININTERFACE__ #define __UNITYAUDIOPLUGININTERFACE__