From 75f9ecc1afb7c2f81628d4355b5ac411cb21f560 Mon Sep 17 00:00:00 2001 From: falkTX Date: Fri, 15 Dec 2023 15:35:11 +0100 Subject: [PATCH] Add new zwabo plugins Signed-off-by: falkTX --- custom-ttl/zwabo-cozmic/zwabo-cozmic_dsp.ttl | 256 ++++ .../zwabo-stuttter/zwabo-cozmic_dsp.ttl | 242 +++ .../zwabo-toggle_2in/zwabo-toggle_2in_dsp.ttl | 74 + .../zwabo-toggle_2in_dsp.ttl | 112 ++ .../zwabo-zinvert_phase_dsp.ttl | 79 + .../zwabo-ztoggle4/zwabo-ztoggle4_dsp.ttl | 123 ++ plugins/zwabo-cozmic/DistrhoPluginInfo.h | 34 + plugins/zwabo-cozmic/README.md | 42 + plugins/zwabo-cozmic/gen_exported.cpp | 1328 +++++++++++++++++ plugins/zwabo-cozmic/gen_exported.h | 49 + plugins/zwabo-stuttter/DistrhoPluginInfo.h | 34 + plugins/zwabo-stuttter/README.md | 28 + plugins/zwabo-stuttter/gen_exported.cpp | 1037 +++++++++++++ plugins/zwabo-stuttter/gen_exported.h | 49 + plugins/zwabo-toggle_2in/DistrhoPluginInfo.h | 34 + plugins/zwabo-toggle_2in/README.md | 20 + plugins/zwabo-toggle_2in/gen_exported.cpp | 269 ++++ plugins/zwabo-toggle_2in/gen_exported.h | 49 + plugins/zwabo-xfade1to2st/DistrhoPluginInfo.h | 34 + plugins/zwabo-xfade1to2st/README.md | 25 + plugins/zwabo-xfade1to2st/gen_exported.cpp | 296 ++++ plugins/zwabo-xfade1to2st/gen_exported.h | 49 + .../zwabo-zinvert_phase/DistrhoPluginInfo.h | 34 + plugins/zwabo-zinvert_phase/README.md | 16 + plugins/zwabo-zinvert_phase/gen_exported.cpp | 266 ++++ plugins/zwabo-zinvert_phase/gen_exported.h | 49 + plugins/zwabo-ztoggle4/DistrhoPluginInfo.h | 34 + plugins/zwabo-ztoggle4/README.md | 23 + plugins/zwabo-ztoggle4/gen_exported.cpp | 353 +++++ plugins/zwabo-ztoggle4/gen_exported.h | 49 + .../DOUBLE_4000_ms.ttl | 53 + .../COZMIC-DOUBLE_4000_ms.lv2/manifest.ttl | 13 + .../SIMPLE_2500_ms.ttl | 53 + .../COZMIC-SIMPLE_2500_ms.lv2/manifest.ttl | 13 + .../RANDOM_DOUBLE.ttl | 53 + .../STUTTTER-RANDOM_DOUBLE.lv2/manifest.ttl | 13 + .../_4_3_120_bpm.ttl | 53 + .../STUTTTER-_4_3_120_bpm.lv2/manifest.ttl | 13 + .../_7_11_20_bpm.ttl | 53 + .../STUTTTER-_7_11_20_bpm.lv2/manifest.ttl | 13 + .../STUTTTER-random.lv2/RANDOM.ttl | 53 + .../STUTTTER-random.lv2/manifest.ttl | 13 + 42 files changed, 5483 insertions(+) create mode 100755 custom-ttl/zwabo-cozmic/zwabo-cozmic_dsp.ttl create mode 100644 custom-ttl/zwabo-stuttter/zwabo-cozmic_dsp.ttl create mode 100755 custom-ttl/zwabo-toggle_2in/zwabo-toggle_2in_dsp.ttl create mode 100755 custom-ttl/zwabo-xfade1to2st/zwabo-toggle_2in_dsp.ttl create mode 100755 custom-ttl/zwabo-zinvert_phase/zwabo-zinvert_phase_dsp.ttl create mode 100755 custom-ttl/zwabo-ztoggle4/zwabo-ztoggle4_dsp.ttl create mode 100644 plugins/zwabo-cozmic/DistrhoPluginInfo.h create mode 100644 plugins/zwabo-cozmic/README.md create mode 100644 plugins/zwabo-cozmic/gen_exported.cpp create mode 100644 plugins/zwabo-cozmic/gen_exported.h create mode 100644 plugins/zwabo-stuttter/DistrhoPluginInfo.h create mode 100644 plugins/zwabo-stuttter/README.md create mode 100644 plugins/zwabo-stuttter/gen_exported.cpp create mode 100644 plugins/zwabo-stuttter/gen_exported.h create mode 100644 plugins/zwabo-toggle_2in/DistrhoPluginInfo.h create mode 100644 plugins/zwabo-toggle_2in/README.md create mode 100644 plugins/zwabo-toggle_2in/gen_exported.cpp create mode 100644 plugins/zwabo-toggle_2in/gen_exported.h create mode 100644 plugins/zwabo-xfade1to2st/DistrhoPluginInfo.h create mode 100644 plugins/zwabo-xfade1to2st/README.md create mode 100644 plugins/zwabo-xfade1to2st/gen_exported.cpp create mode 100644 plugins/zwabo-xfade1to2st/gen_exported.h create mode 100644 plugins/zwabo-zinvert_phase/DistrhoPluginInfo.h create mode 100644 plugins/zwabo-zinvert_phase/README.md create mode 100644 plugins/zwabo-zinvert_phase/gen_exported.cpp create mode 100644 plugins/zwabo-zinvert_phase/gen_exported.h create mode 100644 plugins/zwabo-ztoggle4/DistrhoPluginInfo.h create mode 100644 plugins/zwabo-ztoggle4/README.md create mode 100644 plugins/zwabo-ztoggle4/gen_exported.cpp create mode 100644 plugins/zwabo-ztoggle4/gen_exported.h create mode 100644 presets/zwabo-cozmic/COZMIC-DOUBLE_4000_ms.lv2/DOUBLE_4000_ms.ttl create mode 100644 presets/zwabo-cozmic/COZMIC-DOUBLE_4000_ms.lv2/manifest.ttl create mode 100644 presets/zwabo-cozmic/COZMIC-SIMPLE_2500_ms.lv2/SIMPLE_2500_ms.ttl create mode 100644 presets/zwabo-cozmic/COZMIC-SIMPLE_2500_ms.lv2/manifest.ttl create mode 100644 presets/zwabo-stuttter/STUTTTER-RANDOM_DOUBLE.lv2/RANDOM_DOUBLE.ttl create mode 100644 presets/zwabo-stuttter/STUTTTER-RANDOM_DOUBLE.lv2/manifest.ttl create mode 100644 presets/zwabo-stuttter/STUTTTER-_4_3_120_bpm.lv2/_4_3_120_bpm.ttl create mode 100644 presets/zwabo-stuttter/STUTTTER-_4_3_120_bpm.lv2/manifest.ttl create mode 100644 presets/zwabo-stuttter/STUTTTER-_7_11_20_bpm.lv2/_7_11_20_bpm.ttl create mode 100644 presets/zwabo-stuttter/STUTTTER-_7_11_20_bpm.lv2/manifest.ttl create mode 100644 presets/zwabo-stuttter/STUTTTER-random.lv2/RANDOM.ttl create mode 100644 presets/zwabo-stuttter/STUTTTER-random.lv2/manifest.ttl diff --git a/custom-ttl/zwabo-cozmic/zwabo-cozmic_dsp.ttl b/custom-ttl/zwabo-cozmic/zwabo-cozmic_dsp.ttl new file mode 100755 index 0000000..7bbccc0 --- /dev/null +++ b/custom-ttl/zwabo-cozmic/zwabo-cozmic_dsp.ttl @@ -0,0 +1,256 @@ +@prefix doap: . +@prefix foaf: . +@prefix lv2: . +@prefix midi: . +@prefix mod: . +@prefix opts: . +@prefix pg: . +@prefix patch: . +@prefix rdf: . +@prefix rdfs: . +@prefix spdx: . +@prefix unit: . +@prefix time: . + + + a lv2:DelayPlugin, lv2:Plugin, doap:Project ; + + lv2:extensionData opts:interface ; + + lv2:optionalFeature , + ; + + lv2:requiredFeature opts:options , + ; + + opts:supportedOption , + , + ; + + lv2:port [ + a lv2:InputPort, lv2:AudioPort ; + lv2:index 0 ; + lv2:symbol "lv2_audio_in_1" ; + lv2:name "Audio Input 1" ; + pg:group ; + lv2:designation pg:left ; + ] , + [ + a lv2:InputPort, lv2:AudioPort ; + lv2:index 1 ; + lv2:symbol "lv2_audio_in_2" ; + lv2:name "Audio Input 2" ; + pg:group ; + lv2:designation pg:right ; + ] ; + + lv2:port [ + a lv2:OutputPort, lv2:AudioPort ; + lv2:index 2 ; + lv2:symbol "lv2_audio_out_1" ; + lv2:name "Audio Output 1" ; + pg:group ; + lv2:designation pg:left ; + ] , + [ + a lv2:OutputPort, lv2:AudioPort ; + lv2:index 3 ; + lv2:symbol "lv2_audio_out_2" ; + lv2:name "Audio Output 2" ; + pg:group ; + lv2:designation pg:right ; + ] ; + + lv2:port [ + a lv2:InputPort, lv2:ControlPort ; + lv2:index 4 ; + lv2:name "Disto" ; + lv2:symbol "Disto" ; + lv2:default 0 ; + lv2:minimum 0 ; + lv2:maximum 2 ; + ] , + [ + a lv2:InputPort, lv2:ControlPort ; + lv2:index 5 ; + lv2:name "FadeOut" ; + lv2:symbol "FadeOut" ; + lv2:default 1000 ; + lv2:minimum 0 ; + lv2:maximum 10000 ; + ] , + [ + a lv2:InputPort, lv2:ControlPort ; + lv2:index 6 ; + lv2:name "Filter" ; + lv2:symbol "Filter" ; + lv2:default 0 ; + lv2:minimum -100 ; + lv2:maximum 100 ; + ] , + [ + a lv2:InputPort, lv2:ControlPort ; + lv2:index 7 ; + lv2:name "Filter_On" ; + lv2:symbol "Filter_On" ; + lv2:default 0 ; + lv2:minimum 0 ; + lv2:maximum 1 ; + lv2:portProperty lv2:toggled; + ] , + [ + a lv2:InputPort, lv2:ControlPort ; + lv2:index 8 ; + lv2:name "REC" ; + lv2:symbol "REC" ; + lv2:default 0 ; + lv2:minimum 0 ; + lv2:maximum 1 ; + lv2:portProperty lv2:toggled; + ] , + [ + a lv2:InputPort, lv2:ControlPort ; + lv2:index 9 ; + lv2:name "crossfeed" ; + lv2:symbol "crossfeed" ; + lv2:default 0 ; + lv2:minimum 0 ; + lv2:maximum 1 ; + ] , + [ + a lv2:OutputPort, lv2:ControlPort ; + lv2:index 10 ; + lv2:name "delay1" ; + lv2:symbol "delay1" ; + lv2:default 0 ; + lv2:minimum 0 ; + lv2:maximum 1 ; + ] , + [ + a lv2:OutputPort, lv2:ControlPort ; + lv2:index 11 ; + lv2:name "delay2" ; + lv2:symbol "delay2" ; + lv2:default 0 ; + lv2:minimum 0 ; + lv2:maximum 1 ; + ] , + [ + a lv2:OutputPort, lv2:ControlPort ; + lv2:index 12 ; + lv2:name "delay3" ; + lv2:symbol "delay3" ; + lv2:default 0 ; + lv2:minimum 0 ; + lv2:maximum 1 ; + ] , + [ + a lv2:OutputPort, lv2:ControlPort ; + lv2:index 13 ; + lv2:name "delay4" ; + lv2:symbol "delay4" ; + lv2:default 0 ; + lv2:minimum 0 ; + lv2:maximum 1 ; + ] , + [ + a lv2:InputPort, lv2:ControlPort ; + lv2:index 14 ; + lv2:name "double" ; + lv2:symbol "double" ; + lv2:default 0 ; + lv2:minimum 0 ; + lv2:maximum 1 ; + ] , + [ + a lv2:InputPort, lv2:ControlPort ; + lv2:index 15 ; + lv2:name "feedback" ; + lv2:symbol "feedback" ; + lv2:default 1 ; + lv2:minimum 0 ; + lv2:maximum 1 ; + ] , + [ + a lv2:InputPort, lv2:ControlPort ; + lv2:index 16 ; + lv2:name "mix" ; + lv2:symbol "mix" ; + lv2:default 0.5 ; + lv2:minimum 0 ; + lv2:maximum 1 ; + ] , + [ + a lv2:InputPort, lv2:ControlPort ; + lv2:index 17 ; + lv2:name "reset" ; + lv2:symbol "reset" ; + lv2:default 0 ; + lv2:minimum 0 ; + lv2:maximum 1 ; + lv2:portProperty lv2:integer, lv2:toggled, mod:preferMomentaryOnByDefault ; + ] , + [ + a lv2:InputPort, lv2:ControlPort ; + lv2:index 18 ; + lv2:name "reverse" ; + lv2:symbol "reverse" ; + lv2:default 0 ; + lv2:minimum 0 ; + lv2:maximum 1 ; + lv2:portProperty lv2:toggled ; + ] , + [ + a lv2:InputPort, lv2:ControlPort ; + lv2:index 19 ; + lv2:name "speed" ; + lv2:symbol "speed" ; + lv2:default 1 ; + lv2:minimum 0.5 ; + lv2:maximum 2 ; + lv2:portProperty lv2:integer, lv2:enumeration ; + lv2:scalePoint [ + rdfs:label "HALF SPEED" ; + rdf:value 0.5 + ], + [ + rdfs:label "NORMAL" ; + rdf:value 1.0 + ], + [ + rdfs:label "DOUBLE SPEED"; + rdf:value 2.0 + ] ; + ] , + [ + a lv2:InputPort, lv2:ControlPort ; + lv2:index 20 ; + lv2:name "time" ; + lv2:symbol "time" ; + lv2:default 2500 ; + lv2:minimum 100 ; + lv2:maximum 10000 ; + ] ; + + rdfs:comment """ +Ambiant tool with 4 asynchronous delay lines , a crossfeed between the lines and more features +""" ; + + mod:brand "zwabo" ; + mod:label "COZMIC" ; + + doap:name "COZMIC" ; + doap:license ; + + doap:maintainer [ + foaf:name "zwabo" ; + foaf:homepage ; + ] ; + + lv2:microVersion 0 ; + lv2:minorVersion 0 . + + + a pg:Group , pg:StereoGroup ; + lv2:name "Stereo" ; + lv2:symbol "dpf_stereo" . diff --git a/custom-ttl/zwabo-stuttter/zwabo-cozmic_dsp.ttl b/custom-ttl/zwabo-stuttter/zwabo-cozmic_dsp.ttl new file mode 100644 index 0000000..15ab140 --- /dev/null +++ b/custom-ttl/zwabo-stuttter/zwabo-cozmic_dsp.ttl @@ -0,0 +1,242 @@ +@prefix doap: . +@prefix foaf: . +@prefix lv2: . +@prefix midi: . +@prefix mod: . +@prefix opts: . +@prefix pg: . +@prefix patch: . +@prefix rdf: . +@prefix rdfs: . +@prefix rsz: . +@prefix spdx: . +@prefix units: . +@prefix time: . + + + a lv2:DelayPlugin, lv2:Plugin, doap:Project ; + + lv2:extensionData opts:interface ; + + lv2:optionalFeature , + ; + + lv2:requiredFeature opts:options , + ; + + opts:supportedOption , + , + ; + + lv2:port [ + a lv2:InputPort, lv2:AudioPort ; + lv2:index 0 ; + lv2:symbol "lv2_audio_in_1" ; + lv2:name "Audio Input 1" ; + ] , + [ + a lv2:InputPort, lv2:AudioPort ; + lv2:index 1 ; + lv2:symbol "lv2_audio_in_2" ; + lv2:name "Audio Input 2" ; + ] ; + + lv2:port [ + a lv2:OutputPort, lv2:AudioPort ; + lv2:index 2 ; + lv2:symbol "lv2_audio_out_1" ; + lv2:name "Audio Output 1" ; + ] , + [ + a lv2:OutputPort, lv2:AudioPort ; + lv2:index 3 ; + lv2:symbol "lv2_audio_out_2" ; + lv2:name "Audio Output 2" ; + ] ; + + lv2:port [ + a lv2:InputPort, lv2:ControlPort ; + lv2:index 4 ; + lv2:name "BPM" ; + lv2:symbol "BPM" ; + lv2:default 120 ; + lv2:minimum 20 ; + lv2:maximum 280 ; + lv2:portProperty mod:tempoRelatedDynamicScalePoints ; + ] , + [ + a lv2:InputPort, lv2:ControlPort ; + lv2:index 5 ; + lv2:name "DOUBLE" ; + lv2:symbol "DOUBLE" ; + lv2:default 0 ; + lv2:minimum 0 ; + lv2:maximum 1 ; + lv2:portProperty lv2:toggled ; + ] , + [ + a lv2:InputPort, lv2:ControlPort ; + lv2:index 6 ; + lv2:name "Div_L" ; + lv2:symbol "Div_L" ; + lv2:default 1 ; + lv2:minimum 1 ; + lv2:maximum 10 ; + lv2:portProperty lv2:integer, lv2:enumeration ; + lv2:scalePoint [rdfs:label "1/4note"; rdf:value 1]; + lv2:scalePoint [rdfs:label "Dotted1/8note"; rdf:value 2]; + lv2:scalePoint [rdfs:label "1/4notetriplets"; rdf:value 3]; + lv2:scalePoint [rdfs:label "1/8note"; rdf:value 4]; + lv2:scalePoint [rdfs:label "1/8notetriplets"; rdf:value 5]; + lv2:scalePoint [rdfs:label "Dotted1/16note"; rdf:value 6]; + lv2:scalePoint [rdfs:label "5tuplet"; rdf:value 7]; + lv2:scalePoint [rdfs:label "7tuplet"; rdf:value 8]; + lv2:scalePoint [rdfs:label "9tuplet"; rdf:value 9]; + lv2:scalePoint [rdfs:label "11tuplet"; rdf:value 10]; + + ] , + [ + a lv2:InputPort, lv2:ControlPort ; + lv2:index 7 ; + lv2:name "Div_R" ; + lv2:symbol "Div_R" ; + lv2:default 3 ; + lv2:minimum 1 ; + lv2:maximum 10 ; + lv2:portProperty lv2:integer, lv2:enumeration ; + lv2:scalePoint [rdfs:label "1/4note"; rdf:value 1]; + lv2:scalePoint [rdfs:label "Dotted1/8note"; rdf:value 2]; + lv2:scalePoint [rdfs:label "1/4notetriplets"; rdf:value 3]; + lv2:scalePoint [rdfs:label "1/8note"; rdf:value 4]; + lv2:scalePoint [rdfs:label "1/8notetriplets"; rdf:value 5]; + lv2:scalePoint [rdfs:label "Dotted1/16note"; rdf:value 6]; + lv2:scalePoint [rdfs:label "5tuplet"; rdf:value 7]; + lv2:scalePoint [rdfs:label "7tuplet"; rdf:value 8]; + lv2:scalePoint [rdfs:label "9tuplet"; rdf:value 9]; + lv2:scalePoint [rdfs:label "11tuplet"; rdf:value 10]; + + ] , + [ + a lv2:InputPort, lv2:ControlPort ; + lv2:index 8 ; + lv2:name "ENV_ms" ; + lv2:symbol "ENV_ms" ; + lv2:default 1 ; + lv2:minimum 0 ; + lv2:maximum 500 ; + ] , + [ + a lv2:InputPort, lv2:ControlPort ; + lv2:index 9 ; + lv2:name "Filter_R" ; + lv2:symbol "Filter_R" ; + lv2:default 0 ; + lv2:minimum -100 ; + lv2:maximum 100 ; + ] , + [ + a lv2:OutputPort, lv2:ControlPort ; + lv2:index 10 ; + lv2:name "LEFT" ; + lv2:symbol "LEFT" ; + lv2:default 0 ; + lv2:minimum 0 ; + lv2:maximum 1 ; + ] , + [ + a lv2:InputPort, lv2:ControlPort ; + lv2:index 11 ; + lv2:name "RANDOM" ; + lv2:symbol "RANDOM" ; + lv2:default 0 ; + lv2:minimum 0 ; + lv2:maximum 1 ; + lv2:portProperty lv2:toggled; + ] , + [ + a lv2:InputPort, lv2:ControlPort ; + lv2:index 12 ; + lv2:name "RANGE" ; + lv2:symbol "RANGE" ; + lv2:default 5 ; + lv2:minimum 1 ; + lv2:maximum 10 ; + ] , + [ + a lv2:OutputPort, lv2:ControlPort ; + lv2:index 13 ; + lv2:name "RIGHT" ; + lv2:symbol "RIGHT" ; + lv2:default 0 ; + lv2:minimum 0 ; + lv2:maximum 1 ; + ] , + [ + a lv2:InputPort, lv2:ControlPort ; + lv2:index 14 ; + lv2:name "Tail" ; + lv2:symbol "Tail" ; + lv2:default 0 ; + lv2:minimum 0 ; + lv2:maximum 1 ; + ] , + [ + a lv2:InputPort, lv2:ControlPort ; + lv2:index 15 ; + lv2:name "dry_wet" ; + lv2:symbol "dry_wet" ; + lv2:default 0.5 ; + lv2:minimum 0 ; + lv2:maximum 1 ; + ] , + [ + a lv2:InputPort, lv2:ControlPort ; + lv2:index 16 ; + lv2:name "reverse" ; + lv2:symbol "reverse" ; + lv2:default 0 ; + lv2:minimum 0 ; + lv2:maximum 1 ; + lv2:portProperty lv2:toggled; + ] , + [ + a lv2:InputPort, lv2:ControlPort ; + lv2:index 17 ; + lv2:name "speed" ; + lv2:symbol "speed" ; + lv2:default 1 ; + lv2:minimum 0.009 ; + lv2:maximum 2 ; + ] , + [ + a lv2:InputPort, lv2:ControlPort ; + lv2:index 18 ; + lv2:name "ztutter" ; + lv2:symbol "ztutter" ; + lv2:default 0 ; + lv2:minimum 0 ; + lv2:maximum 1 ; + lv2:portProperty lv2:integer, lv2:toggled, mod:preferMomentaryOnByDefault ; + ] ; + +rdfs:comment """ +Double Stutter effect (L/R) with time division 1/4 note, 1/8 note , etc... +but also odd division 5tuplet, 7tuplet, 9tuplet, 11tuplet +which could give interesting polyrythmic effects at slow tempo. +An ambiant/harsh tool in one plugin. + +""" ; + + mod:brand "zwabo" ; + mod:label "STUTTTER" ; + + doap:name "STUTTTER" ; + doap:license ; + + doap:maintainer [ + foaf:name "zwabo" ; + foaf:homepage ; + ] ; + + lv2:microVersion 0 ; + lv2:minorVersion 0 . diff --git a/custom-ttl/zwabo-toggle_2in/zwabo-toggle_2in_dsp.ttl b/custom-ttl/zwabo-toggle_2in/zwabo-toggle_2in_dsp.ttl new file mode 100755 index 0000000..04663ad --- /dev/null +++ b/custom-ttl/zwabo-toggle_2in/zwabo-toggle_2in_dsp.ttl @@ -0,0 +1,74 @@ +@prefix doap: . +@prefix foaf: . +@prefix lv2: . +@prefix midi: . +@prefix mod: . +@prefix opts: . +@prefix pg: . +@prefix patch: . +@prefix rdf: . +@prefix rdfs: . +@prefix spdx: . +@prefix unit: . + + + a lv2:UtilityPlugin, lv2:Plugin, doap:Project ; + + lv2:extensionData opts:interface ; + + lv2:optionalFeature , + ; + + lv2:requiredFeature opts:options , + ; + + opts:supportedOption , + , + ; + + lv2:port [ + a lv2:InputPort, lv2:AudioPort ; + lv2:index 0 ; + lv2:symbol "lv2_audio_in_1" ; + lv2:name "Audio Input 1" ; + ] , + [ + a lv2:InputPort, lv2:AudioPort ; + lv2:index 1 ; + lv2:symbol "lv2_audio_in_2" ; + lv2:name "Audio Input 2" ; + ] ; + + lv2:port [ + a lv2:OutputPort, lv2:AudioPort ; + lv2:index 2 ; + lv2:symbol "lv2_audio_out_1" ; + lv2:name "Audio Output 1" ; + ] ; + + lv2:port [ + a lv2:InputPort, lv2:ControlPort ; + lv2:index 3 ; + lv2:name "Toggle" ; + lv2:symbol "Toggle" ; + lv2:default 0 ; + lv2:minimum 0 ; + lv2:maximum 1 ; + lv2:portProperty lv2:toggled ; + ] ; + + rdfs:comment "Generated from Max gen~ and github.com/moddevices/max-gen-plugins" ; + + mod:brand "zwabo" ; + mod:label "Toggle_2IN" ; + + doap:name "Toggle_2IN" ; + doap:license ; + + doap:maintainer [ + foaf:name "zwabo" ; + foaf:homepage ; + ] ; + + lv2:microVersion 0 ; + lv2:minorVersion 0 . diff --git a/custom-ttl/zwabo-xfade1to2st/zwabo-toggle_2in_dsp.ttl b/custom-ttl/zwabo-xfade1to2st/zwabo-toggle_2in_dsp.ttl new file mode 100755 index 0000000..1492e18 --- /dev/null +++ b/custom-ttl/zwabo-xfade1to2st/zwabo-toggle_2in_dsp.ttl @@ -0,0 +1,112 @@ +@prefix doap: . +@prefix foaf: . +@prefix lv2: . +@prefix midi: . +@prefix mod: . +@prefix opts: . +@prefix pg: . +@prefix patch: . +@prefix rdf: . +@prefix rdfs: . +@prefix spdx: . +@prefix unit: . + + + a lv2:UtilityPlugin, lv2:Plugin, doap:Project ; + + lv2:extensionData opts:interface ; + + lv2:optionalFeature , + ; + + lv2:requiredFeature opts:options , + ; + + opts:supportedOption , + , + ; + + lv2:port [ + a lv2:InputPort, lv2:AudioPort ; + lv2:index 0 ; + lv2:symbol "lv2_audio_in_1" ; + lv2:name "Audio Input 1" ; + ] , + [ + a lv2:InputPort, lv2:AudioPort ; + lv2:index 1 ; + lv2:symbol "lv2_audio_in_2" ; + lv2:name "Audio Input 2" ; + ] ; + + lv2:port [ + a lv2:OutputPort, lv2:AudioPort ; + lv2:index 2 ; + lv2:symbol "lv2_audio_out_1" ; + lv2:name "Audio Output 1" ; + ] , + [ + a lv2:OutputPort, lv2:AudioPort ; + lv2:index 3 ; + lv2:symbol "lv2_audio_out_2" ; + lv2:name "Audio Output 2" ; + ] , + [ + a lv2:OutputPort, lv2:AudioPort ; + lv2:index 4 ; + lv2:symbol "lv2_audio_out_3" ; + lv2:name "Audio Output 3" ; + ] , + [ + a lv2:OutputPort, lv2:AudioPort ; + lv2:index 5 ; + lv2:symbol "lv2_audio_out_4" ; + lv2:name "Audio Output 4" ; + ] ; + + lv2:port [ + a lv2:InputPort, lv2:ControlPort ; + lv2:index 6 ; + lv2:name "MIX" ; + lv2:symbol "MIX" ; + lv2:default 0 ; + lv2:minimum 0 ; + lv2:maximum 1 ; + ] , + [ + a lv2:InputPort, lv2:ControlPort ; + lv2:index 7 ; + lv2:name "RANGE" ; + lv2:symbol "RANGE" ; + lv2:default 0.5 ; + lv2:minimum 0.5 ; + lv2:maximum 1 ; + ] ; + + rdfs:comment """ +lv2 plugin utility , crossfade L R input to 2 L R outputs +Two parameters. + +MIX: + +mix the input to the two outputs +RANGE : + +at 0 , when mix is in the middle position, the output gain is 0.5 x the input gain for each output. +at 1, when mix is in the middle position, the output gain is 1x the input gain for each output. You can choose in between according to your needs. +A slight smoothing is implemented in order to avoid scale effects +""" ; + + mod:brand "zwabo" ; + mod:label "Xfade1to2st" ; + + doap:name "Xfade1to2st" ; + doap:license ; + + doap:maintainer [ + foaf:name "zwabo" ; + foaf:homepage ; + ] ; + + lv2:microVersion 0 ; + lv2:minorVersion 0 . diff --git a/custom-ttl/zwabo-zinvert_phase/zwabo-zinvert_phase_dsp.ttl b/custom-ttl/zwabo-zinvert_phase/zwabo-zinvert_phase_dsp.ttl new file mode 100755 index 0000000..13dbb4f --- /dev/null +++ b/custom-ttl/zwabo-zinvert_phase/zwabo-zinvert_phase_dsp.ttl @@ -0,0 +1,79 @@ +@prefix doap: . +@prefix foaf: . +@prefix lv2: . +@prefix midi: . +@prefix mod: . +@prefix opts: . +@prefix pg: . +@prefix patch: . +@prefix rdf: . +@prefix rdfs: . +@prefix spdx: . +@prefix unit: . + + + a lv2:UtilityPlugin, lv2:Plugin, doap:Project ; + + lv2:extensionData opts:interface ; + + lv2:optionalFeature , + ; + + lv2:requiredFeature opts:options , + ; + + opts:supportedOption , + , + ; + + lv2:port [ + a lv2:InputPort, lv2:AudioPort ; + lv2:index 0 ; + lv2:symbol "lv2_audio_in_1" ; + lv2:name "Audio Input 1" ; + pg:group ; + lv2:designation pg:center ; + ] ; + + lv2:port [ + a lv2:OutputPort, lv2:AudioPort ; + lv2:index 1 ; + lv2:symbol "lv2_audio_out_1" ; + lv2:name "Audio Output 1" ; + pg:group ; + lv2:designation pg:center ; + ] ; + + lv2:port [ + a lv2:InputPort, lv2:ControlPort ; + lv2:index 2 ; + lv2:name "INVERT" ; + lv2:symbol "INVERT" ; + lv2:default 0 ; + lv2:minimum 0 ; + lv2:maximum 1 ; + lv2:portProperty lv2:toggled ; + ] ; + + rdfs:comment """ +Simple phase inverter. i.e. useful on stage for acoustic instrument amplification +""" ; + + mod:brand "zwabo" ; + mod:label "Zinvert_phase" ; + + doap:name "Zinvert_phase" ; + doap:license ; + + doap:maintainer [ + foaf:name "zwabo" ; + foaf:homepage ; + ] ; + + lv2:microVersion 0 ; + lv2:minorVersion 0 . + + + a pg:Group , pg:MonoGroup ; + lv2:name "Mono" ; + lv2:symbol "dpf_mono" . diff --git a/custom-ttl/zwabo-ztoggle4/zwabo-ztoggle4_dsp.ttl b/custom-ttl/zwabo-ztoggle4/zwabo-ztoggle4_dsp.ttl new file mode 100755 index 0000000..28b16f2 --- /dev/null +++ b/custom-ttl/zwabo-ztoggle4/zwabo-ztoggle4_dsp.ttl @@ -0,0 +1,123 @@ +@prefix doap: . +@prefix foaf: . +@prefix lv2: . +@prefix midi: . +@prefix mod: . +@prefix opts: . +@prefix pg: . +@prefix patch: . +@prefix rdf: . +@prefix rdfs: . +@prefix spdx: . +@prefix unit: . +@prefix time: . + + + a lv2:UtilityPlugin, lv2:Plugin, doap:Project ; + + lv2:extensionData opts:interface ; + + lv2:optionalFeature , + ; + + lv2:requiredFeature opts:options , + ; + + opts:supportedOption , + , + ; + + lv2:port [ + a lv2:InputPort, lv2:AudioPort ; + lv2:index 0 ; + lv2:symbol "lv2_audio_in_1" ; + lv2:name "Audio Input 1" ; + ] ; + + lv2:port [ + a lv2:OutputPort, lv2:AudioPort ; + lv2:index 1 ; + lv2:symbol "lv2_audio_out_1" ; + lv2:name "Audio Output 1" ; + ] , + [ + a lv2:OutputPort, lv2:AudioPort ; + lv2:index 2 ; + lv2:symbol "lv2_audio_out_2" ; + lv2:name "Audio Output 2" ; + ] , + [ + a lv2:OutputPort, lv2:AudioPort ; + lv2:index 3 ; + lv2:symbol "lv2_audio_out_3" ; + lv2:name "Audio Output 3" ; + ] , + [ + a lv2:OutputPort, lv2:AudioPort ; + lv2:index 4 ; + lv2:symbol "lv2_audio_out_4" ; + lv2:name "Audio Output 4" ; + ] ; + + lv2:port [ + a lv2:InputPort, lv2:ControlPort ; + lv2:index 5 ; + lv2:name "Cycle" ; + lv2:symbol "Cycle" ; + lv2:default 2 ; + lv2:minimum 0 ; + lv2:maximum 3 ; + lv2:portProperty lv2:integer, lv2:enumeration ; + lv2:scalePoint [ + rdfs:label "1" ; + rdf:value 0 + ] , + [ + rdfs:label "1/2" ; + rdf:value 1 + ] , + [ + rdfs:label "1/2/3" ; + rdf:value 2 + ] , + [ + rdfs:label "1/2/3/4" ; + rdf:value 3 + ] ; + ] , + [ + a lv2:InputPort, lv2:ControlPort ; + lv2:index 6 ; + lv2:name "Killswitch" ; + lv2:symbol "Killswitch" ; + lv2:default 0 ; + lv2:minimum 0 ; + lv2:maximum 1 ; + lv2:portProperty lv2:toggled ; + ] , + [ + a lv2:InputPort, lv2:ControlPort ; + lv2:index 7 ; + lv2:name "Select" ; + lv2:symbol "Select" ; + lv2:default 0 ; + lv2:minimum 0 ; + lv2:maximum 1 ; + lv2:portProperty lv2:integer, lv2:toggled, mod:preferMomentaryOnByDefault ; + ] ; + + rdfs:comment "Ztoggle4 gets one audio stream as input and chooses one of four outputs to route the audio. When the SELECT switch is activated (MIDI and CV assignable) the audio stream pass to the next output " ; + + mod:brand "zwabo" ; + mod:label "Ztoggle4" ; + + doap:name "Ztoggle4" ; + doap:license ; + + doap:maintainer [ + foaf:name "zwabo" ; + foaf:homepage ; + ] ; + + lv2:microVersion 0 ; + lv2:minorVersion 0 . diff --git a/plugins/zwabo-cozmic/DistrhoPluginInfo.h b/plugins/zwabo-cozmic/DistrhoPluginInfo.h new file mode 100644 index 0000000..d178aa2 --- /dev/null +++ b/plugins/zwabo-cozmic/DistrhoPluginInfo.h @@ -0,0 +1,34 @@ +/* + * DPF Max Gen + * Copyright (C) 2015-2023 Filipe Coelho + * + * Permission to use, copy, modify, and/or distribute this software for any purpose with + * or without fee is hereby granted, provided that the above copyright notice and this + * permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD + * TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER + * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#pragma once + +#define DISTRHO_PLUGIN_BRAND "zwabo" +#define DISTRHO_PLUGIN_NAME "COZMIC" +#define DISTRHO_PLUGIN_URI "urn:maxgen:zwabo:cozmic" +#define DISTRHO_PLUGIN_CLAP_ID "maxgen.zwabo.cozmic" + +#define DISTRHO_PLUGIN_HAS_UI 0 +#define DISTRHO_PLUGIN_IS_RT_SAFE 1 +#define DISTRHO_PLUGIN_NUM_INPUTS 2 +#define DISTRHO_PLUGIN_NUM_OUTPUTS 2 + +#define DISTRHO_PLUGIN_CLAP_FEATURES "audio-effect", "delay", "stereo" +#define DISTRHO_PLUGIN_LV2_CATEGORY "lv2:DelayPlugin" +#define DISTRHO_PLUGIN_VST3_CATEGORIES "Fx|Delay" + +#define DISTRHO_PLUGIN_UNIQUE_ID d_cconst('z', 'w', 'c', 'z') +#define DISTRHO_PLUGIN_VERSION d_version(0, 0, 0) diff --git a/plugins/zwabo-cozmic/README.md b/plugins/zwabo-cozmic/README.md new file mode 100644 index 0000000..04bec4c --- /dev/null +++ b/plugins/zwabo-cozmic/README.md @@ -0,0 +1,42 @@ +# COZMIC +4 asynchronous delay lines / Plugin lv2 build with Max Gen~ for the Mod Dwarf + +Parameters: + +REC / activate inputs record + +Mix / wet-dry mix + +Time / select time between 100 and 10000 ms + +Double / delay 3 and 4 volume + +Reverse / reverse delay 1 and 2 + +Feedback / 1 = infinite loop + +Crossfeed / delay 1 and delay 2 feed eachother / and delay 3 and delay 4 feed eachother + +Speed / select speed ( 1/2x , 1x , 2x ) for delay 1 and 2 + +Disto / add slight distortion in the feedback loop + +Filter / -100 -> 0 LP , 0 -> 100 HP + +Filter_On / filter on/off + +Reset / reset the audio buffers + +FadeOut / fade out time on reset between 0 and 1000 ms + + +Mod devices installation: + +• Copy the zwabo-cozmic.lv2 folder to your Mod: +``` + scp -rp root@192.168.51.1:/root/.lv2 + ``` + + +• Enter password "mod" +• Reboot Mod diff --git a/plugins/zwabo-cozmic/gen_exported.cpp b/plugins/zwabo-cozmic/gen_exported.cpp new file mode 100644 index 0000000..5f64143 --- /dev/null +++ b/plugins/zwabo-cozmic/gen_exported.cpp @@ -0,0 +1,1328 @@ +#include "gen_exported.h" + +namespace gen_exported { + +/******************************************************************************************************************* +Cycling '74 License for Max-Generated Code for Export +Copyright (c) 2016 Cycling '74 +The code that Max generates automatically and that end users are capable of exporting and using, and any + associated documentation files (the “Software”) is a work of authorship for which Cycling '74 is the author + and owner for copyright purposes. A license is hereby granted, free of charge, to any person obtaining a + copy of the Software (“Licensee”) to use, copy, modify, merge, publish, and distribute copies of the Software, + and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +The Software is licensed to Licensee only for non-commercial use. Users who wish to make commercial use of the + Software must contact the copyright owner to determine if a license for commercial use is available, and the + terms and conditions for same, which may include fees or royalties. For commercial use, please send inquiries + to licensing (at) cycling74.com. The determination of whether a use is commercial use or non-commercial use is based + upon the use, not the user. The Software may be used by individuals, institutions, governments, corporations, or + other business whether for-profit or non-profit so long as the use itself is not a commercialization of the + materials or a use that generates or is intended to generate income, revenue, sales or profit. +The above copyright notice and this license shall be included in all copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO + THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*******************************************************************************************************************/ + +// global noise generator +Noise noise; +static const int GENLIB_LOOPCOUNT_BAIL = 100000; + + +// The State struct contains all the state and procedures for the gendsp kernel +typedef struct State { + CommonState __commonstate; + Data m_delay_46; + Data m_delay_50; + Data m_delay_62; + Data m_delay_47; + Delay m_delay_13; + int __exception; + int vectorsize; + t_sample m_Disto_54; + t_sample m_time_56; + t_sample m_double_58; + t_sample m_Filter_57; + t_sample m_reset_55; + t_sample m_REC_53; + t_sample m_mix_51; + t_sample m_speed_59; + t_sample m_history_43; + t_sample m_history_42; + t_sample m_feedback_52; + t_sample m_history_44; + t_sample m_Filter_On_48; + t_sample m_history_45; + t_sample m_reverse_49; + t_sample m_crossfeed_60; + t_sample m_FadeOut_61; + t_sample __m_count_63; + t_sample __m_latch_93; + t_sample __m_latch_92; + t_sample __m_latch_90; + t_sample __m_latch_96; + t_sample __m_slide_99; + t_sample __m_latch_97; + t_sample __m_latch_102; + t_sample m_history_41; + t_sample __m_latch_89; + t_sample __m_count_83; + t_sample __m_count_67; + t_sample __m_carry_65; + t_sample __m_carry_85; + t_sample __m_carry_69; + t_sample __m_count_77; + t_sample __m_latch_75; + t_sample __m_carry_79; + t_sample m_history_40; + t_sample m_history_39; + t_sample m_history_38; + t_sample m_history_12; + t_sample m_history_11; + t_sample m_history_10; + t_sample m_history_9; + t_sample m_history_14; + t_sample m_history_16; + t_sample m_history_15; + t_sample m_history_17; + t_sample m_history_18; + t_sample m_history_8; + t_sample m_history_6; + t_sample m_history_1; + t_sample samplerate; + t_sample m_history_7; + t_sample m_history_2; + t_sample m_history_4; + t_sample m_history_3; + t_sample m_history_5; + t_sample __m_latch_103; + t_sample m_history_19; + t_sample m_history_21; + t_sample m_history_33; + t_sample m_history_32; + t_sample m_history_31; + t_sample m_history_34; + t_sample m_history_36; + t_sample m_history_35; + t_sample m_history_37; + t_sample m_history_20; + t_sample m_history_30; + t_sample m_history_28; + t_sample m_history_23; + t_sample m_history_22; + t_sample m_history_29; + t_sample m_history_24; + t_sample m_history_26; + t_sample m_history_25; + t_sample m_history_27; + t_sample __m_latch_105; + // re-initialize all member variables; + inline void reset(t_param __sr, int __vs) { + __exception = 0; + vectorsize = __vs; + samplerate = __sr; + m_history_1 = ((int)0); + m_history_2 = ((int)0); + m_history_3 = ((int)0); + m_history_4 = ((int)0); + m_history_5 = ((int)0); + m_history_6 = ((int)0); + m_history_7 = ((int)0); + m_history_8 = ((int)0); + m_history_9 = ((int)0); + m_history_10 = ((int)0); + m_history_11 = ((int)0); + m_history_12 = ((int)0); + m_delay_13.reset("m_delay_13", ((int)24000)); + m_history_14 = ((int)0); + m_history_15 = ((int)0); + m_history_16 = ((int)0); + m_history_17 = ((int)0); + m_history_18 = ((int)0); + m_history_19 = ((int)0); + m_history_20 = ((int)0); + m_history_21 = ((int)0); + m_history_22 = ((int)0); + m_history_23 = ((int)0); + m_history_24 = ((int)0); + m_history_25 = ((int)0); + m_history_26 = ((int)0); + m_history_27 = ((int)0); + m_history_28 = ((int)0); + m_history_29 = ((int)0); + m_history_30 = ((int)0); + m_history_31 = ((int)0); + m_history_32 = ((int)0); + m_history_33 = ((int)0); + m_history_34 = ((int)0); + m_history_35 = ((int)0); + m_history_36 = ((int)0); + m_history_37 = ((int)0); + m_history_38 = ((int)0); + m_history_39 = ((int)0); + m_history_40 = ((int)0); + m_history_41 = ((int)0); + m_history_42 = ((int)0); + m_history_43 = ((int)0); + m_history_44 = ((int)0); + m_history_45 = ((int)0); + m_delay_46.reset("delay3", ((int)480010), ((int)1)); + m_delay_47.reset("delay4", ((int)480010), ((int)1)); + m_Filter_On_48 = 0; + m_reverse_49 = 0; + m_delay_50.reset("delay1", ((int)480010), ((int)1)); + m_mix_51 = 1; + m_feedback_52 = 1; + m_REC_53 = 0; + m_Disto_54 = 0; + m_reset_55 = 0; + m_time_56 = 2500; + m_Filter_57 = 0; + m_double_58 = 0; + m_speed_59 = 1; + m_crossfeed_60 = 0; + m_FadeOut_61 = 1000; + m_delay_62.reset("delay2", ((int)480010), ((int)1)); + __m_count_63 = 0; + __m_carry_65 = 0; + __m_count_67 = 0; + __m_carry_69 = 0; + __m_latch_75 = 0; + __m_count_77 = 0; + __m_carry_79 = 0; + __m_count_83 = 0; + __m_carry_85 = 0; + __m_latch_89 = 0; + __m_latch_90 = 0; + __m_latch_92 = 0; + __m_latch_93 = 0; + __m_latch_96 = 0; + __m_latch_97 = 0; + __m_slide_99 = 0; + __m_latch_102 = 0; + __m_latch_103 = 0; + __m_latch_105 = 0; + genlib_reset_complete(this); + + }; + // the signal processing routine; + inline int perform(t_sample ** __ins, t_sample ** __outs, int __n) { + vectorsize = __n; + const t_sample * __in1 = __ins[0]; + const t_sample * __in2 = __ins[1]; + t_sample * __out1 = __outs[0]; + t_sample * __out2 = __outs[1]; + if (__exception) { + return __exception; + + } else if (( (__in1 == 0) || (__in2 == 0) || (__out1 == 0) || (__out2 == 0) )) { + __exception = GENLIB_ERR_NULL_BUFFER; + return __exception; + + }; + int delay4_dim = m_delay_47.dim; + int delay4_channels = m_delay_47.channels; + int dim_507 = delay4_dim; + int delay3_dim = m_delay_46.dim; + int delay3_channels = m_delay_46.channels; + int dim_605 = delay3_dim; + t_sample choice_71 = int(m_REC_53); + t_sample choice_73 = int(m_REC_53); + int delay1_dim = m_delay_50.dim; + int delay1_channels = m_delay_50.channels; + int dim_812 = delay1_dim; + int delay2_dim = m_delay_62.dim; + int delay2_channels = m_delay_62.channels; + int dim_708 = delay2_dim; + int gte_835 = (m_speed_59 >= ((t_sample)1.9)); + int mul_834 = (gte_835 * ((int)3)); + int lt_833 = (m_speed_59 < ((t_sample)1.9)); + int mul_836 = (lt_833 * ((int)2)); + int lte_832 = (m_speed_59 <= ((t_sample)0.6)); + int mul_831 = (lte_832 * ((int)1)); + int gt_830 = (m_speed_59 > ((t_sample)0.6)); + int mul_829 = (gt_830 * ((int)2)); + __m_latch_75 = (((((gt_830 + lte_832) + lt_833) + gte_835) != 0) ? (((mul_836 + mul_829) + mul_831) + mul_834) : __m_latch_75); + int latch_841 = __m_latch_75; + int sub_828 = (latch_841 - ((int)2)); + int choice_76 = sub_828; + t_sample selector_840 = ((choice_76 >= 3) ? ((int)2) : ((choice_76 >= 2) ? ((int)1) : ((choice_76 >= 1) ? ((t_sample)0.5) : 0))); + t_sample gen_842 = selector_840; + t_sample speed_827 = gen_842; + t_sample speed_721 = speed_827; + t_sample crossfeed_482 = m_crossfeed_60; + t_sample crossfeed_495 = crossfeed_482; + t_sample crossfeed_485 = crossfeed_482; + t_sample mul_466 = (crossfeed_482 * ((t_sample)0.6)); + t_sample crossfeed_479 = crossfeed_482; + t_sample mul_467 = (crossfeed_479 * ((t_sample)0.6)); + t_sample add_826 = (m_Filter_On_48 + ((int)1)); + t_sample filterOn_802 = add_826; + t_sample filterOn_596 = filterOn_802; + t_sample filterOn_498 = filterOn_802; + t_sample filter_700 = m_Filter_57; + t_sample filter_597 = filter_700; + int lte_616 = (filter_597 <= ((int)0)); + int not_615 = (!lte_616); + __m_latch_89 = ((not_615 != 0) ? filter_597 : __m_latch_89); + t_sample latch_617 = __m_latch_89; + t_sample sub_8293 = (latch_617 - ((int)0)); + t_sample scale_8290 = ((safepow((sub_8293 * ((t_sample)0.01)), ((int)1)) * ((int)995)) + ((int)5)); + t_sample scale_621 = scale_8290; + int gte_619 = (filter_597 >= ((int)0)); + int not_618 = (!gte_619); + __m_latch_90 = ((not_618 != 0) ? filter_597 : __m_latch_90); + t_sample latch_620 = __m_latch_90; + t_sample sub_8297 = (latch_620 - (-100)); + t_sample scale_8294 = ((safepow((sub_8297 * ((t_sample)0.01)), ((int)1)) * ((int)22500)) + ((int)500)); + t_sample scale_622 = scale_8294; + t_sample min_659 = ((scale_622 < ((int)0)) ? ((int)0) : scale_622); + t_sample omega = safediv((min_659 * ((t_sample)6.2831853071796)), samplerate); + t_sample sn = sin(omega); + t_sample cs = cos(omega); + t_sample alpha = ((sn * ((t_sample)0.5)) * ((int)2)); + t_sample b0 = safediv(((int)1), (((int)1) + alpha)); + t_sample a2 = (((((int)1) - cs) * ((t_sample)0.5)) * b0); + t_sample a1 = ((((int)1) - cs) * b0); + t_sample b1 = ((((int)-2) * cs) * b0); + t_sample b2 = ((((int)1) - alpha) * b0); + t_sample expr_675 = a2; + t_sample expr_676 = a1; + t_sample expr_677 = a2; + t_sample expr_678 = b1; + t_sample expr_679 = b2; + t_sample min_631 = ((scale_621 < ((int)0)) ? ((int)0) : scale_621); + t_sample omega_685 = safediv((min_631 * ((t_sample)6.2831853071796)), samplerate); + t_sample sn_688 = sin(omega_685); + t_sample cs_684 = cos(omega_685); + t_sample alpha_689 = ((sn_688 * ((t_sample)0.5)) * ((t_sample)2)); + t_sample b_681 = safediv(((int)1), (((int)1) + alpha_689)); + t_sample a_682 = (((((int)1) + cs_684) * ((t_sample)0.5)) * b_681); + t_sample a_687 = ((-(((int)1) + cs_684)) * b_681); + t_sample b_686 = ((((int)-2) * cs_684) * b_681); + t_sample b_683 = ((((int)1) - alpha_689) * b_681); + t_sample expr_647 = a_682; + t_sample expr_648 = a_687; + t_sample expr_649 = a_682; + t_sample expr_650 = b_686; + t_sample expr_651 = b_683; + t_sample choice_91 = int(filterOn_596); + t_sample filter_499 = filter_700; + int lte_518 = (filter_499 <= ((int)0)); + int not_517 = (!lte_518); + __m_latch_92 = ((not_517 != 0) ? filter_499 : __m_latch_92); + t_sample latch_519 = __m_latch_92; + t_sample sub_8301 = (latch_519 - ((int)0)); + t_sample scale_8298 = ((safepow((sub_8301 * ((t_sample)0.01)), ((int)1)) * ((int)995)) + ((int)5)); + t_sample scale_523 = scale_8298; + int gte_521 = (filter_499 >= ((int)0)); + int not_520 = (!gte_521); + __m_latch_93 = ((not_520 != 0) ? filter_499 : __m_latch_93); + t_sample latch_522 = __m_latch_93; + t_sample sub_8305 = (latch_522 - (-100)); + t_sample scale_8302 = ((safepow((sub_8305 * ((t_sample)0.01)), ((int)1)) * ((int)22500)) + ((int)500)); + t_sample scale_524 = scale_8302; + t_sample min_561 = ((scale_524 < ((int)0)) ? ((int)0) : scale_524); + t_sample omega_8203 = safediv((min_561 * ((t_sample)6.2831853071796)), samplerate); + t_sample sn_8206 = sin(omega_8203); + t_sample cs_8201 = cos(omega_8203); + t_sample alpha_8202 = ((sn_8206 * ((t_sample)0.5)) * ((int)2)); + t_sample b_8208 = safediv(((int)1), (((int)1) + alpha_8202)); + t_sample a_8199 = (((((int)1) - cs_8201) * ((t_sample)0.5)) * b_8208); + t_sample a_8205 = ((((int)1) - cs_8201) * b_8208); + t_sample b_8204 = ((((int)-2) * cs_8201) * b_8208); + t_sample b_8200 = ((((int)1) - alpha_8202) * b_8208); + t_sample expr_577 = a_8199; + t_sample expr_578 = a_8205; + t_sample expr_579 = a_8199; + t_sample expr_580 = b_8204; + t_sample expr_581 = b_8200; + t_sample min_533 = ((scale_523 < ((int)0)) ? ((int)0) : scale_523); + t_sample omega_587 = safediv((min_533 * ((t_sample)6.2831853071796)), samplerate); + t_sample sn_589 = sin(omega_587); + t_sample cs_586 = cos(omega_587); + t_sample alpha_590 = ((sn_589 * ((t_sample)0.5)) * ((t_sample)2)); + t_sample b_583 = safediv(((int)1), (((int)1) + alpha_590)); + t_sample a_584 = (((((int)1) + cs_586) * ((t_sample)0.5)) * b_583); + t_sample a_591 = ((-(((int)1) + cs_586)) * b_583); + t_sample b_588 = ((((int)-2) * cs_586) * b_583); + t_sample b_585 = ((((int)1) - alpha_590) * b_583); + t_sample expr_549 = a_584; + t_sample expr_550 = a_591; + t_sample expr_551 = a_584; + t_sample expr_552 = b_588; + t_sample expr_553 = b_585; + t_sample choice_94 = int(filterOn_498); + t_sample add_822 = (m_Disto_54 + ((int)1)); + t_sample disto_801 = add_822; + t_sample sub_8309 = (disto_801 - ((int)1)); + t_sample scale_8306 = ((safepow((sub_8309 * ((t_sample)1)), ((int)1)) * ((t_sample)-0.32)) + ((int)1)); + t_sample scale_821 = scale_8306; + t_sample disto_698 = disto_801; + t_sample sub_8313 = (disto_698 - ((int)1)); + t_sample scale_8310 = ((safepow((sub_8313 * ((t_sample)1)), ((int)1)) * ((t_sample)-0.32)) + ((int)1)); + t_sample scale_717 = scale_8310; + t_sample pass_7925 = m_reset_55; + t_sample add_462 = (pass_7925 + ((int)1)); + t_sample choice_95 = int(add_462); + t_sample selector_465 = ((choice_95 >= 2) ? ((int)0) : ((choice_95 >= 1) ? m_feedback_52 : 0)); + t_sample fdback_463 = selector_465; + t_sample fdback_464 = fdback_463; + t_sample fdback_461 = fdback_463; + t_sample fdback_460 = fdback_463; + t_sample filterOn_699 = filterOn_802; + int lte_723 = (filter_700 <= ((int)0)); + int not_722 = (!lte_723); + __m_latch_96 = ((not_722 != 0) ? filter_700 : __m_latch_96); + t_sample latch_724 = __m_latch_96; + t_sample sub_8317 = (latch_724 - ((int)0)); + t_sample scale_8314 = ((safepow((sub_8317 * ((t_sample)0.01)), ((int)1)) * ((int)995)) + ((int)5)); + t_sample scale_728 = scale_8314; + int gte_726 = (filter_700 >= ((int)0)); + int not_725 = (!gte_726); + __m_latch_97 = ((not_725 != 0) ? filter_700 : __m_latch_97); + t_sample latch_727 = __m_latch_97; + t_sample sub_8321 = (latch_727 - (-100)); + t_sample scale_8318 = ((safepow((sub_8321 * ((t_sample)0.01)), ((int)1)) * ((int)22500)) + ((int)500)); + t_sample scale_729 = scale_8318; + t_sample min_766 = ((scale_729 < ((int)0)) ? ((int)0) : scale_729); + t_sample omega_8213 = safediv((min_766 * ((t_sample)6.2831853071796)), samplerate); + t_sample sn_8216 = sin(omega_8213); + t_sample cs_8211 = cos(omega_8213); + t_sample alpha_8212 = ((sn_8216 * ((t_sample)0.5)) * ((int)2)); + t_sample b_8218 = safediv(((int)1), (((int)1) + alpha_8212)); + t_sample a_8209 = (((((int)1) - cs_8211) * ((t_sample)0.5)) * b_8218); + t_sample a_8215 = ((((int)1) - cs_8211) * b_8218); + t_sample b_8214 = ((((int)-2) * cs_8211) * b_8218); + t_sample b_8210 = ((((int)1) - alpha_8212) * b_8218); + t_sample expr_782 = a_8209; + t_sample expr_783 = a_8215; + t_sample expr_784 = a_8209; + t_sample expr_785 = b_8214; + t_sample expr_786 = b_8210; + t_sample min_738 = ((scale_728 < ((int)0)) ? ((int)0) : scale_728); + t_sample omega_792 = safediv((min_738 * ((t_sample)6.2831853071796)), samplerate); + t_sample sn_795 = sin(omega_792); + t_sample cs_791 = cos(omega_792); + t_sample alpha_796 = ((sn_795 * ((t_sample)0.5)) * ((t_sample)2)); + t_sample b_788 = safediv(((int)1), (((int)1) + alpha_796)); + t_sample a_789 = (((((int)1) + cs_791) * ((t_sample)0.5)) * b_788); + t_sample a_794 = ((-(((int)1) + cs_791)) * b_788); + t_sample b_793 = ((((int)-2) * cs_791) * b_788); + t_sample b_790 = ((((int)1) - alpha_796) * b_788); + t_sample expr_754 = a_789; + t_sample expr_755 = a_794; + t_sample expr_756 = a_789; + t_sample expr_757 = b_793; + t_sample expr_758 = b_790; + t_sample choice_98 = int(filterOn_699); + t_sample mstosamps_4919 = (m_FadeOut_61 * (samplerate * 0.001)); + t_sample add_806 = (m_reverse_49 + ((int)1)); + t_sample reverse_805 = add_806; + t_sample reverse_702 = reverse_805; + t_sample reverse_599 = reverse_805; + t_sample reverse_501 = reverse_805; + int not_444 = (!pass_7925); + t_sample iup_100 = (1 / maximum(1, abs(((int)100)))); + t_sample idown_101 = (1 / maximum(1, abs(mstosamps_4919))); + t_sample filter_803 = filter_700; + int lte_844 = (filter_803 <= ((int)0)); + int not_843 = (!lte_844); + __m_latch_102 = ((not_843 != 0) ? filter_803 : __m_latch_102); + t_sample latch_845 = __m_latch_102; + t_sample sub_8325 = (latch_845 - ((int)0)); + t_sample scale_8322 = ((safepow((sub_8325 * ((t_sample)0.01)), ((int)1)) * ((int)995)) + ((int)5)); + t_sample scale_849 = scale_8322; + int gte_847 = (filter_803 >= ((int)0)); + int not_846 = (!gte_847); + __m_latch_103 = ((not_846 != 0) ? filter_803 : __m_latch_103); + t_sample latch_848 = __m_latch_103; + t_sample sub_8329 = (latch_848 - (-100)); + t_sample scale_8326 = ((safepow((sub_8329 * ((t_sample)0.01)), ((int)1)) * ((int)22500)) + ((int)500)); + t_sample scale_850 = scale_8326; + t_sample min_887 = ((scale_850 < ((int)0)) ? ((int)0) : scale_850); + t_sample omega_8222 = safediv((min_887 * ((t_sample)6.2831853071796)), samplerate); + t_sample sn_8228 = sin(omega_8222); + t_sample cs_8220 = cos(omega_8222); + t_sample alpha_8221 = ((sn_8228 * ((t_sample)0.5)) * ((int)2)); + t_sample b_8226 = safediv(((int)1), (((int)1) + alpha_8221)); + t_sample a_8219 = (((((int)1) - cs_8220) * ((t_sample)0.5)) * b_8226); + t_sample a_8224 = ((((int)1) - cs_8220) * b_8226); + t_sample b_8223 = ((((int)-2) * cs_8220) * b_8226); + t_sample b_8227 = ((((int)1) - alpha_8221) * b_8226); + t_sample expr_903 = a_8219; + t_sample expr_904 = a_8224; + t_sample expr_905 = a_8219; + t_sample expr_906 = b_8223; + t_sample expr_907 = b_8227; + t_sample min_859 = ((scale_849 < ((int)0)) ? ((int)0) : scale_849); + t_sample omega_912 = safediv((min_859 * ((t_sample)6.2831853071796)), samplerate); + t_sample sn_915 = sin(omega_912); + t_sample cs_917 = cos(omega_912); + t_sample alpha_916 = ((sn_915 * ((t_sample)0.5)) * ((t_sample)2)); + t_sample b_909 = safediv(((int)1), (((int)1) + alpha_916)); + t_sample a_910 = (((((int)1) + cs_917) * ((t_sample)0.5)) * b_909); + t_sample a_914 = ((-(((int)1) + cs_917)) * b_909); + t_sample b_913 = ((((int)-2) * cs_917) * b_909); + t_sample b_911 = ((((int)1) - alpha_916) * b_909); + t_sample expr_875 = a_910; + t_sample expr_876 = a_914; + t_sample expr_877 = a_910; + t_sample expr_878 = b_913; + t_sample expr_879 = b_911; + t_sample choice_104 = int(filterOn_802); + t_sample choice_106 = int(reverse_805); + int min_115 = (-1); + t_sample choice_116 = int(reverse_599); + int min_125 = (-1); + int min_126 = (-1); + t_sample choice_127 = int(reverse_702); + int min_136 = (-1); + t_sample choice_137 = int(reverse_501); + int min_146 = (-1); + int min_147 = (-1); + // the main sample loop; + while ((__n--)) { + const t_sample in1 = (*(__in1++)); + const t_sample in2 = (*(__in2++)); + t_sample add_491 = (m_history_11 + m_history_6); + __m_count_63 = (((int)0) ? 0 : (fixdenorm(__m_count_63 + ((int)1)))); + int carry_64 = 0; + if ((((int)0) != 0)) { + __m_count_63 = 0; + __m_carry_65 = 0; + + } else if (((dim_507 > 0) && (__m_count_63 >= dim_507))) { + int wraps_66 = (__m_count_63 / dim_507); + __m_carry_65 = (__m_carry_65 + wraps_66); + __m_count_63 = (__m_count_63 - (wraps_66 * dim_507)); + carry_64 = 1; + + }; + int counter_508 = __m_count_63; + int counter_509 = carry_64; + int counter_510 = __m_carry_65; + t_sample add_492 = (m_history_12 + m_history_2); + __m_count_67 = (((int)0) ? 0 : (fixdenorm(__m_count_67 + ((int)1)))); + int carry_68 = 0; + if ((((int)0) != 0)) { + __m_count_67 = 0; + __m_carry_69 = 0; + + } else if (((dim_605 > 0) && (__m_count_67 >= dim_605))) { + int wraps_70 = (__m_count_67 / dim_605); + __m_carry_69 = (__m_carry_69 + wraps_70); + __m_count_67 = (__m_count_67 - (wraps_70 * dim_605)); + carry_68 = 1; + + }; + int counter_606 = __m_count_67; + int counter_607 = carry_68; + int counter_608 = __m_carry_69; + t_sample selector_925 = ((choice_71 >= 1) ? in2 : 0); + t_sample add_514 = (selector_925 + add_491); + bool index_ignore_72 = ((counter_508 >= delay4_dim) || (counter_508 < 0)); + if ((!index_ignore_72)) { + m_delay_47.write(add_514, counter_508, 0); + + }; + t_sample selector_924 = ((choice_73 >= 1) ? in1 : 0); + t_sample add_612 = (selector_924 + add_492); + bool index_ignore_74 = ((counter_606 >= delay3_dim) || (counter_606 < 0)); + if ((!index_ignore_74)) { + m_delay_46.write(add_612, counter_606, 0); + + }; + t_sample add_494 = (m_history_9 + m_history_3); + t_sample add_819 = (selector_924 + add_494); + t_sample add_493 = (m_history_10 + m_history_7); + t_sample add_715 = (selector_925 + add_493); + __m_count_77 = (((int)0) ? 0 : (fixdenorm(__m_count_77 + speed_827))); + int carry_78 = 0; + if ((((int)0) != 0)) { + __m_count_77 = 0; + __m_carry_79 = 0; + + } else if (((dim_812 > 0) && (__m_count_77 >= dim_812))) { + int wraps_80 = (__m_count_77 / dim_812); + __m_carry_79 = (__m_carry_79 + wraps_80); + __m_count_77 = (__m_count_77 - (wraps_80 * dim_812)); + carry_78 = 1; + + }; + t_sample counter_813 = __m_count_77; + int counter_814 = carry_78; + int counter_815 = __m_carry_79; + int index_trunc_81 = fixnan(floor(counter_813)); + bool index_ignore_82 = ((index_trunc_81 >= delay1_dim) || (index_trunc_81 < 0)); + if ((!index_ignore_82)) { + m_delay_50.write(add_819, index_trunc_81, 0); + + }; + __m_count_83 = (((int)0) ? 0 : (fixdenorm(__m_count_83 + speed_721))); + int carry_84 = 0; + if ((((int)0) != 0)) { + __m_count_83 = 0; + __m_carry_85 = 0; + + } else if (((dim_708 > 0) && (__m_count_83 >= dim_708))) { + int wraps_86 = (__m_count_83 / dim_708); + __m_carry_85 = (__m_carry_85 + wraps_86); + __m_count_83 = (__m_count_83 - (wraps_86 * dim_708)); + carry_84 = 1; + + }; + t_sample counter_709 = __m_count_83; + int counter_710 = carry_84; + int counter_711 = __m_carry_85; + int index_trunc_87 = fixnan(floor(counter_709)); + bool index_ignore_88 = ((index_trunc_87 >= delay2_dim) || (index_trunc_87 < 0)); + if ((!index_ignore_88)) { + m_delay_62.write(add_715, index_trunc_87, 0); + + }; + t_sample mul_669 = (m_history_5 * expr_675); + t_sample mul_666 = (m_history_43 * expr_676); + t_sample mul_664 = (m_history_45 * expr_677); + t_sample mul_660 = (m_history_44 * expr_679); + t_sample mul_662 = (m_history_42 * expr_678); + t_sample sub_668 = (((mul_664 + mul_666) + mul_669) - (mul_662 + mul_660)); + t_sample gen_674 = sub_668; + t_sample history_665_next_670 = fixdenorm(m_history_43); + t_sample history_661_next_671 = fixdenorm(m_history_42); + t_sample history_667_next_672 = fixdenorm(m_history_5); + t_sample history_663_next_673 = fixdenorm(sub_668); + t_sample gen_680 = gen_674; + t_sample mul_641 = (gen_680 * expr_647); + t_sample mul_638 = (m_history_39 * expr_648); + t_sample mul_636 = (m_history_41 * expr_649); + t_sample mul_632 = (m_history_40 * expr_651); + t_sample mul_634 = (m_history_38 * expr_650); + t_sample sub_640 = (((mul_636 + mul_638) + mul_641) - (mul_634 + mul_632)); + t_sample gen_646 = sub_640; + t_sample history_637_next_642 = fixdenorm(m_history_39); + t_sample history_633_next_643 = fixdenorm(m_history_38); + t_sample history_639_next_644 = fixdenorm(gen_680); + t_sample history_635_next_645 = fixdenorm(sub_640); + t_sample gen_652 = gen_646; + t_sample gen_690 = gen_652; + t_sample selector_613 = ((choice_91 >= 2) ? gen_690 : ((choice_91 >= 1) ? m_history_5 : 0)); + t_sample mul_571 = (m_history_1 * expr_577); + t_sample mul_568 = (m_history_35 * expr_578); + t_sample mul_566 = (m_history_36 * expr_579); + t_sample mul_562 = (m_history_37 * expr_581); + t_sample mul_564 = (m_history_34 * expr_580); + t_sample sub_570 = (((mul_566 + mul_568) + mul_571) - (mul_564 + mul_562)); + t_sample gen_576 = sub_570; + t_sample history_563_next_572 = fixdenorm(m_history_34); + t_sample history_567_next_573 = fixdenorm(m_history_35); + t_sample history_569_next_574 = fixdenorm(m_history_1); + t_sample history_565_next_575 = fixdenorm(sub_570); + t_sample gen_582 = gen_576; + t_sample mul_543 = (gen_582 * expr_549); + t_sample mul_540 = (m_history_31 * expr_550); + t_sample mul_538 = (m_history_32 * expr_551); + t_sample mul_534 = (m_history_33 * expr_553); + t_sample mul_536 = (m_history_30 * expr_552); + t_sample sub_542 = (((mul_538 + mul_540) + mul_543) - (mul_536 + mul_534)); + t_sample gen_548 = sub_542; + t_sample history_535_next_544 = fixdenorm(m_history_30); + t_sample history_539_next_545 = fixdenorm(m_history_31); + t_sample history_541_next_546 = fixdenorm(gen_582); + t_sample history_537_next_547 = fixdenorm(sub_542); + t_sample gen_554 = gen_548; + t_sample gen_592 = gen_554; + t_sample selector_515 = ((choice_94 >= 2) ? gen_592 : ((choice_94 >= 1) ? m_history_1 : 0)); + t_sample mul_776 = (m_history_4 * expr_782); + t_sample mul_773 = (m_history_27 * expr_783); + t_sample mul_771 = (m_history_28 * expr_784); + t_sample mul_767 = (m_history_29 * expr_786); + t_sample mul_769 = (m_history_26 * expr_785); + t_sample sub_775 = (((mul_771 + mul_773) + mul_776) - (mul_769 + mul_767)); + t_sample gen_781 = sub_775; + t_sample history_768_next_777 = fixdenorm(m_history_26); + t_sample history_772_next_778 = fixdenorm(m_history_27); + t_sample history_774_next_779 = fixdenorm(m_history_4); + t_sample history_770_next_780 = fixdenorm(sub_775); + t_sample gen_787 = gen_781; + t_sample mul_748 = (gen_787 * expr_754); + t_sample mul_745 = (m_history_23 * expr_755); + t_sample mul_743 = (m_history_25 * expr_756); + t_sample mul_739 = (m_history_24 * expr_758); + t_sample mul_741 = (m_history_22 * expr_757); + t_sample sub_747 = (((mul_743 + mul_745) + mul_748) - (mul_741 + mul_739)); + t_sample gen_753 = sub_747; + t_sample history_744_next_749 = fixdenorm(m_history_23); + t_sample history_740_next_750 = fixdenorm(m_history_22); + t_sample history_746_next_751 = fixdenorm(gen_787); + t_sample history_742_next_752 = fixdenorm(sub_747); + t_sample gen_759 = gen_753; + t_sample gen_797 = gen_759; + t_sample selector_720 = ((choice_98 >= 2) ? gen_797 : ((choice_98 >= 1) ? m_history_4 : 0)); + t_sample mul_718 = (selector_720 * disto_698); + t_sample tanh_719 = tanh(mul_718); + t_sample mul_716 = (tanh_719 * scale_717); + __m_slide_99 = fixdenorm((__m_slide_99 + (((not_444 > __m_slide_99) ? iup_100 : idown_101) * (not_444 - __m_slide_99)))); + t_sample slide_6058 = __m_slide_99; + t_sample pass_6711 = slide_6058; + t_sample mul_897 = (m_history_8 * expr_903); + t_sample mul_894 = (m_history_19 * expr_904); + t_sample mul_892 = (m_history_21 * expr_905); + t_sample mul_888 = (m_history_20 * expr_907); + t_sample mul_890 = (m_history_18 * expr_906); + t_sample sub_896 = (((mul_892 + mul_894) + mul_897) - (mul_890 + mul_888)); + t_sample gen_902 = sub_896; + t_sample history_893_next_898 = fixdenorm(m_history_19); + t_sample history_889_next_899 = fixdenorm(m_history_18); + t_sample history_895_next_900 = fixdenorm(m_history_8); + t_sample history_891_next_901 = fixdenorm(sub_896); + t_sample gen_908 = gen_902; + t_sample mul_869 = (gen_908 * expr_875); + t_sample mul_866 = (m_history_15 * expr_876); + t_sample mul_864 = (m_history_16 * expr_877); + t_sample mul_860 = (m_history_17 * expr_879); + t_sample mul_862 = (m_history_14 * expr_878); + t_sample sub_868 = (((mul_864 + mul_866) + mul_869) - (mul_862 + mul_860)); + t_sample gen_874 = sub_868; + t_sample history_861_next_870 = fixdenorm(m_history_14); + t_sample history_865_next_871 = fixdenorm(m_history_15); + t_sample history_867_next_872 = fixdenorm(gen_908); + t_sample history_863_next_873 = fixdenorm(sub_868); + t_sample gen_880 = gen_874; + t_sample gen_918 = gen_880; + t_sample selector_825 = ((choice_104 >= 2) ? gen_918 : ((choice_104 >= 1) ? m_history_8 : 0)); + t_sample mul_823 = (selector_825 * disto_801); + t_sample tanh_824 = tanh(mul_823); + t_sample mul_820 = (tanh_824 * scale_821); + t_sample tap_470 = m_delay_13.read_step(((int)24000)); + int eq_471 = (m_time_56 == tap_470); + __m_latch_105 = ((eq_471 != 0) ? m_time_56 : __m_latch_105); + t_sample latch_468 = __m_latch_105; + t_sample mstosamps_472 = (latch_468 * (samplerate * 0.001)); + t_sample time_489 = mstosamps_472; + t_sample time_804 = time_489; + t_sample sub_810 = (counter_813 - time_804); + t_sample sub_811 = (time_804 - counter_813); + t_sample selector_809 = ((choice_106 >= 2) ? sub_811 : ((choice_106 >= 1) ? sub_810 : 0)); + int index_trunc_107 = fixnan(floor(selector_809)); + double index_fract_108 = (selector_809 - index_trunc_107); + int index_trunc_109 = (index_trunc_107 + 1); + int index_wrap_110 = ((index_trunc_107 < 0) ? ((delay1_dim - 1) + ((index_trunc_107 + 1) % delay1_dim)) : (index_trunc_107 % delay1_dim)); + int index_wrap_111 = ((index_trunc_109 < 0) ? ((delay1_dim - 1) + ((index_trunc_109 + 1) % delay1_dim)) : (index_trunc_109 % delay1_dim)); + // samples delay1 channel 1; + double read_delay_112 = m_delay_50.read(index_wrap_110, 0); + double read_delay_113 = m_delay_50.read(index_wrap_111, 0); + double readinterp_114 = linear_interp(index_fract_108, read_delay_112, read_delay_113); + t_sample sample_delay_816 = readinterp_114; + t_sample index_delay_817 = selector_809; + t_sample clamp_921 = ((sample_delay_816 <= min_115) ? min_115 : ((sample_delay_816 >= ((int)1)) ? ((int)1) : sample_delay_816)); + t_sample mul_920 = (clamp_921 * fdback_464); + t_sample mul_497 = (clamp_921 * crossfeed_495); + t_sample mul_598 = (time_489 * ((t_sample)0.419)); + t_sample sub_603 = (counter_606 - mul_598); + t_sample sub_604 = (mul_598 - counter_606); + t_sample selector_602 = ((choice_116 >= 2) ? sub_604 : ((choice_116 >= 1) ? sub_603 : 0)); + int index_trunc_117 = fixnan(floor(selector_602)); + double index_fract_118 = (selector_602 - index_trunc_117); + int index_trunc_119 = (index_trunc_117 + 1); + int index_wrap_120 = ((index_trunc_117 < 0) ? ((delay3_dim - 1) + ((index_trunc_117 + 1) % delay3_dim)) : (index_trunc_117 % delay3_dim)); + int index_wrap_121 = ((index_trunc_119 < 0) ? ((delay3_dim - 1) + ((index_trunc_119 + 1) % delay3_dim)) : (index_trunc_119 % delay3_dim)); + // samples delay3 channel 1; + double read_delay_122 = m_delay_46.read(index_wrap_120, 0); + double read_delay_123 = m_delay_46.read(index_wrap_121, 0); + double readinterp_124 = linear_interp(index_fract_118, read_delay_122, read_delay_123); + t_sample sample_delay_609 = readinterp_124; + t_sample index_delay_610 = selector_602; + t_sample clamp_693 = ((sample_delay_609 <= min_125) ? min_125 : ((sample_delay_609 >= ((int)1)) ? ((int)1) : sample_delay_609)); + t_sample mul_481 = (clamp_693 * mul_467); + t_sample mul_692 = (clamp_693 * fdback_461); + t_sample mul_477 = (clamp_693 * ((t_sample)0.45)); + t_sample mul_478 = (m_double_58 * mul_477); + t_sample mix_8330 = (clamp_921 + (((t_sample)0.5) * (mul_478 - clamp_921))); + t_sample clamp_696 = ((mix_8330 <= min_126) ? min_126 : ((mix_8330 >= ((int)1)) ? ((int)1) : mix_8330)); + t_sample mul_447 = (clamp_696 * pass_6711); + t_sample mix_8331 = (in1 + (m_mix_51 * (mul_447 - in1))); + t_sample out1 = mix_8331; + t_sample time_490 = time_489; + t_sample mul_701 = (time_490 * ((t_sample)0.881)); + t_sample sub_706 = (counter_709 - mul_701); + t_sample sub_707 = (mul_701 - counter_709); + t_sample selector_705 = ((choice_127 >= 2) ? sub_707 : ((choice_127 >= 1) ? sub_706 : 0)); + int index_trunc_128 = fixnan(floor(selector_705)); + double index_fract_129 = (selector_705 - index_trunc_128); + int index_trunc_130 = (index_trunc_128 + 1); + int index_wrap_131 = ((index_trunc_128 < 0) ? ((delay2_dim - 1) + ((index_trunc_128 + 1) % delay2_dim)) : (index_trunc_128 % delay2_dim)); + int index_wrap_132 = ((index_trunc_130 < 0) ? ((delay2_dim - 1) + ((index_trunc_130 + 1) % delay2_dim)) : (index_trunc_130 % delay2_dim)); + // samples delay2 channel 1; + double read_delay_133 = m_delay_62.read(index_wrap_131, 0); + double read_delay_134 = m_delay_62.read(index_wrap_132, 0); + double readinterp_135 = linear_interp(index_fract_129, read_delay_133, read_delay_134); + t_sample sample_delay_712 = readinterp_135; + t_sample index_delay_713 = selector_705; + t_sample clamp_800 = ((sample_delay_712 <= min_136) ? min_136 : ((sample_delay_712 >= ((int)1)) ? ((int)1) : sample_delay_712)); + t_sample mul_799 = (clamp_800 * fdback_463); + t_sample mul_487 = (clamp_800 * crossfeed_485); + t_sample time_488 = time_489; + t_sample mul_500 = (time_488 * ((t_sample)0.179)); + t_sample sub_505 = (counter_508 - mul_500); + t_sample sub_506 = (mul_500 - counter_508); + t_sample selector_504 = ((choice_137 >= 2) ? sub_506 : ((choice_137 >= 1) ? sub_505 : 0)); + int index_trunc_138 = fixnan(floor(selector_504)); + double index_fract_139 = (selector_504 - index_trunc_138); + int index_trunc_140 = (index_trunc_138 + 1); + int index_wrap_141 = ((index_trunc_138 < 0) ? ((delay4_dim - 1) + ((index_trunc_138 + 1) % delay4_dim)) : (index_trunc_138 % delay4_dim)); + int index_wrap_142 = ((index_trunc_140 < 0) ? ((delay4_dim - 1) + ((index_trunc_140 + 1) % delay4_dim)) : (index_trunc_140 % delay4_dim)); + // samples delay4 channel 1; + double read_delay_143 = m_delay_47.read(index_wrap_141, 0); + double read_delay_144 = m_delay_47.read(index_wrap_142, 0); + double readinterp_145 = linear_interp(index_fract_139, read_delay_143, read_delay_144); + t_sample sample_delay_511 = readinterp_145; + t_sample index_delay_512 = selector_504; + t_sample clamp_595 = ((sample_delay_511 <= min_146) ? min_146 : ((sample_delay_511 >= ((int)1)) ? ((int)1) : sample_delay_511)); + t_sample mul_484 = (clamp_595 * mul_466); + t_sample mul_594 = (clamp_595 * fdback_460); + t_sample mul_474 = (clamp_595 * ((t_sample)0.45)); + t_sample mul_475 = (m_double_58 * mul_474); + t_sample mix_8332 = (clamp_800 + (((t_sample)0.5) * (mul_475 - clamp_800))); + t_sample clamp_697 = ((mix_8332 <= min_147) ? min_147 : ((mix_8332 >= ((int)1)) ? ((int)1) : mix_8332)); + t_sample mul_446 = (clamp_697 * pass_6711); + t_sample mix_8333 = (in2 + (m_mix_51 * (mul_446 - in2))); + t_sample out2 = mix_8333; + t_sample history_611_next_8230 = fixdenorm(selector_613); + t_sample history_513_next_8231 = fixdenorm(selector_515); + t_sample history_714_next_8232 = fixdenorm(mul_716); + t_sample history_818_next_8233 = fixdenorm(mul_820); + t_sample history_919_next_8234 = fixdenorm(mul_920); + t_sample history_496_next_8235 = fixdenorm(mul_497); + t_sample history_480_next_8236 = fixdenorm(mul_481); + t_sample history_691_next_8237 = fixdenorm(mul_692); + t_sample history_798_next_8238 = fixdenorm(mul_799); + t_sample history_486_next_8239 = fixdenorm(mul_487); + t_sample history_483_next_8240 = fixdenorm(mul_484); + t_sample history_593_next_8241 = fixdenorm(mul_594); + m_history_45 = history_665_next_670; + m_history_38 = history_635_next_645; + m_history_39 = history_639_next_644; + m_history_40 = history_633_next_643; + m_history_41 = history_637_next_642; + m_history_42 = history_663_next_673; + m_history_43 = history_667_next_672; + m_history_44 = history_661_next_671; + m_history_37 = history_563_next_572; + m_history_30 = history_537_next_547; + m_history_31 = history_541_next_546; + m_history_32 = history_539_next_545; + m_history_33 = history_535_next_544; + m_history_34 = history_565_next_575; + m_history_35 = history_569_next_574; + m_history_36 = history_567_next_573; + m_history_29 = history_768_next_777; + m_history_22 = history_742_next_752; + m_history_23 = history_746_next_751; + m_history_24 = history_740_next_750; + m_history_25 = history_744_next_749; + m_history_26 = history_770_next_780; + m_history_27 = history_774_next_779; + m_history_28 = history_772_next_778; + m_history_21 = history_893_next_898; + m_history_14 = history_863_next_873; + m_history_15 = history_867_next_872; + m_history_16 = history_865_next_871; + m_history_17 = history_861_next_870; + m_history_18 = history_891_next_901; + m_history_19 = history_895_next_900; + m_history_20 = history_889_next_899; + m_delay_13.write(m_time_56); + m_history_12 = history_611_next_8230; + m_history_11 = history_513_next_8231; + m_history_10 = history_714_next_8232; + m_history_9 = history_818_next_8233; + m_history_8 = history_919_next_8234; + m_history_7 = history_496_next_8235; + m_history_6 = history_480_next_8236; + m_history_5 = history_691_next_8237; + m_history_4 = history_798_next_8238; + m_history_3 = history_486_next_8239; + m_history_2 = history_483_next_8240; + m_history_1 = history_593_next_8241; + m_delay_13.step(); + // assign results to output buffer; + (*(__out1++)) = out1; + (*(__out2++)) = out2; + + }; + return __exception; + + }; + inline void set_delay3(void * _value) { + m_delay_46.setbuffer(_value); + }; + inline void set_delay4(void * _value) { + m_delay_47.setbuffer(_value); + }; + inline void set_Filter_On(t_param _value) { + m_Filter_On_48 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value)); + }; + inline void set_reverse(t_param _value) { + m_reverse_49 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value)); + }; + inline void set_delay1(void * _value) { + m_delay_50.setbuffer(_value); + }; + inline void set_mix(t_param _value) { + m_mix_51 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value)); + }; + inline void set_feedback(t_param _value) { + m_feedback_52 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value)); + }; + inline void set_REC(t_param _value) { + m_REC_53 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value)); + }; + inline void set_Disto(t_param _value) { + m_Disto_54 = (_value < 0 ? 0 : (_value > 2 ? 2 : _value)); + }; + inline void set_reset(t_param _value) { + m_reset_55 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value)); + }; + inline void set_time(t_param _value) { + m_time_56 = (_value < 100 ? 100 : (_value > 10000 ? 10000 : _value)); + }; + inline void set_Filter(t_param _value) { + m_Filter_57 = (_value < -100 ? -100 : (_value > 100 ? 100 : _value)); + }; + inline void set_double(t_param _value) { + m_double_58 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value)); + }; + inline void set_speed(t_param _value) { + m_speed_59 = (_value < 0.5 ? 0.5 : (_value > 2 ? 2 : _value)); + }; + inline void set_crossfeed(t_param _value) { + m_crossfeed_60 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value)); + }; + inline void set_FadeOut(t_param _value) { + m_FadeOut_61 = (_value < 0 ? 0 : (_value > 10000 ? 10000 : _value)); + }; + inline void set_delay2(void * _value) { + m_delay_62.setbuffer(_value); + }; + +} State; + + +/// +/// Configuration for the genlib API +/// + +/// Number of signal inputs and outputs + +int gen_kernel_numins = 2; +int gen_kernel_numouts = 2; + +int num_inputs() { return gen_kernel_numins; } +int num_outputs() { return gen_kernel_numouts; } +int num_params() { return 17; } + +/// Assistive lables for the signal inputs and outputs + +const char *gen_kernel_innames[] = { "in1", "in2" }; +const char *gen_kernel_outnames[] = { "out1", "out2" }; + +/// Invoke the signal process of a State object + +int perform(CommonState *cself, t_sample **ins, long numins, t_sample **outs, long numouts, long n) { + State* self = (State *)cself; + return self->perform(ins, outs, n); +} + +/// Reset all parameters and stateful operators of a State object + +void reset(CommonState *cself) { + State* self = (State *)cself; + self->reset(cself->sr, cself->vs); +} + +/// Set a parameter of a State object + +void setparameter(CommonState *cself, long index, t_param value, void *ref) { + State *self = (State *)cself; + switch (index) { + case 0: self->set_Disto(value); break; + case 1: self->set_FadeOut(value); break; + case 2: self->set_Filter(value); break; + case 3: self->set_Filter_On(value); break; + case 4: self->set_REC(value); break; + case 5: self->set_crossfeed(value); break; + case 6: self->set_delay1(ref); break; + case 7: self->set_delay2(ref); break; + case 8: self->set_delay3(ref); break; + case 9: self->set_delay4(ref); break; + case 10: self->set_double(value); break; + case 11: self->set_feedback(value); break; + case 12: self->set_mix(value); break; + case 13: self->set_reset(value); break; + case 14: self->set_reverse(value); break; + case 15: self->set_speed(value); break; + case 16: self->set_time(value); break; + + default: break; + } +} + +/// Get the value of a parameter of a State object + +void getparameter(CommonState *cself, long index, t_param *value) { + State *self = (State *)cself; + switch (index) { + case 0: *value = self->m_Disto_54; break; + case 1: *value = self->m_FadeOut_61; break; + case 2: *value = self->m_Filter_57; break; + case 3: *value = self->m_Filter_On_48; break; + case 4: *value = self->m_REC_53; break; + case 5: *value = self->m_crossfeed_60; break; + + + + + case 10: *value = self->m_double_58; break; + case 11: *value = self->m_feedback_52; break; + case 12: *value = self->m_mix_51; break; + case 13: *value = self->m_reset_55; break; + case 14: *value = self->m_reverse_49; break; + case 15: *value = self->m_speed_59; break; + case 16: *value = self->m_time_56; break; + + default: break; + } +} + +/// Get the name of a parameter of a State object + +const char *getparametername(CommonState *cself, long index) { + if (index >= 0 && index < cself->numparams) { + return cself->params[index].name; + } + return 0; +} + +/// Get the minimum value of a parameter of a State object + +t_param getparametermin(CommonState *cself, long index) { + if (index >= 0 && index < cself->numparams) { + return cself->params[index].outputmin; + } + return 0; +} + +/// Get the maximum value of a parameter of a State object + +t_param getparametermax(CommonState *cself, long index) { + if (index >= 0 && index < cself->numparams) { + return cself->params[index].outputmax; + } + return 0; +} + +/// Get parameter of a State object has a minimum and maximum value + +char getparameterhasminmax(CommonState *cself, long index) { + if (index >= 0 && index < cself->numparams) { + return cself->params[index].hasminmax; + } + return 0; +} + +/// Get the units of a parameter of a State object + +const char *getparameterunits(CommonState *cself, long index) { + if (index >= 0 && index < cself->numparams) { + return cself->params[index].units; + } + return 0; +} + +/// Get the size of the state of all parameters of a State object + +size_t getstatesize(CommonState *cself) { + return genlib_getstatesize(cself, &getparameter); +} + +/// Get the state of all parameters of a State object + +short getstate(CommonState *cself, char *state) { + return genlib_getstate(cself, state, &getparameter); +} + +/// set the state of all parameters of a State object + +short setstate(CommonState *cself, const char *state) { + return genlib_setstate(cself, state, &setparameter); +} + +/// Allocate and configure a new State object and it's internal CommonState: + +void *create(t_param sr, long vs) { + State *self = new State; + self->reset(sr, vs); + ParamInfo *pi; + self->__commonstate.inputnames = gen_kernel_innames; + self->__commonstate.outputnames = gen_kernel_outnames; + self->__commonstate.numins = gen_kernel_numins; + self->__commonstate.numouts = gen_kernel_numouts; + self->__commonstate.sr = sr; + self->__commonstate.vs = vs; + self->__commonstate.params = (ParamInfo *)genlib_sysmem_newptr(17 * sizeof(ParamInfo)); + self->__commonstate.numparams = 17; + // initialize parameter 0 ("m_Disto_54") + pi = self->__commonstate.params + 0; + pi->name = "Disto"; + pi->paramtype = GENLIB_PARAMTYPE_FLOAT; + pi->defaultvalue = self->m_Disto_54; + pi->defaultref = 0; + pi->hasinputminmax = false; + pi->inputmin = 0; + pi->inputmax = 1; + pi->hasminmax = true; + pi->outputmin = 0; + pi->outputmax = 2; + pi->exp = 0; + pi->units = ""; // no units defined + // initialize parameter 1 ("m_FadeOut_61") + pi = self->__commonstate.params + 1; + pi->name = "FadeOut"; + pi->paramtype = GENLIB_PARAMTYPE_FLOAT; + pi->defaultvalue = self->m_FadeOut_61; + pi->defaultref = 0; + pi->hasinputminmax = false; + pi->inputmin = 0; + pi->inputmax = 1; + pi->hasminmax = true; + pi->outputmin = 0; + pi->outputmax = 10000; + pi->exp = 0; + pi->units = ""; // no units defined + // initialize parameter 2 ("m_Filter_57") + pi = self->__commonstate.params + 2; + pi->name = "Filter"; + pi->paramtype = GENLIB_PARAMTYPE_FLOAT; + pi->defaultvalue = self->m_Filter_57; + pi->defaultref = 0; + pi->hasinputminmax = false; + pi->inputmin = 0; + pi->inputmax = 1; + pi->hasminmax = true; + pi->outputmin = -100; + pi->outputmax = 100; + pi->exp = 0; + pi->units = ""; // no units defined + // initialize parameter 3 ("m_Filter_On_48") + pi = self->__commonstate.params + 3; + pi->name = "Filter_On"; + pi->paramtype = GENLIB_PARAMTYPE_FLOAT; + pi->defaultvalue = self->m_Filter_On_48; + pi->defaultref = 0; + pi->hasinputminmax = false; + pi->inputmin = 0; + pi->inputmax = 1; + pi->hasminmax = true; + pi->outputmin = 0; + pi->outputmax = 1; + pi->exp = 0; + pi->units = ""; // no units defined + // initialize parameter 4 ("m_REC_53") + pi = self->__commonstate.params + 4; + pi->name = "REC"; + pi->paramtype = GENLIB_PARAMTYPE_FLOAT; + pi->defaultvalue = self->m_REC_53; + pi->defaultref = 0; + pi->hasinputminmax = false; + pi->inputmin = 0; + pi->inputmax = 1; + pi->hasminmax = true; + pi->outputmin = 0; + pi->outputmax = 1; + pi->exp = 0; + pi->units = ""; // no units defined + // initialize parameter 5 ("m_crossfeed_60") + pi = self->__commonstate.params + 5; + pi->name = "crossfeed"; + pi->paramtype = GENLIB_PARAMTYPE_FLOAT; + pi->defaultvalue = self->m_crossfeed_60; + pi->defaultref = 0; + pi->hasinputminmax = false; + pi->inputmin = 0; + pi->inputmax = 1; + pi->hasminmax = true; + pi->outputmin = 0; + pi->outputmax = 1; + pi->exp = 0; + pi->units = ""; // no units defined + // initialize parameter 6 ("m_delay_50") + pi = self->__commonstate.params + 6; + pi->name = "delay1"; + pi->paramtype = GENLIB_PARAMTYPE_SYM; + pi->defaultvalue = 0.; + pi->defaultref = 0; + pi->hasinputminmax = false; + pi->inputmin = 0; + pi->inputmax = 1; + pi->hasminmax = false; + pi->outputmin = 0; + pi->outputmax = 1; + pi->exp = 0; + pi->units = ""; // no units defined + // initialize parameter 7 ("m_delay_62") + pi = self->__commonstate.params + 7; + pi->name = "delay2"; + pi->paramtype = GENLIB_PARAMTYPE_SYM; + pi->defaultvalue = 0.; + pi->defaultref = 0; + pi->hasinputminmax = false; + pi->inputmin = 0; + pi->inputmax = 1; + pi->hasminmax = false; + pi->outputmin = 0; + pi->outputmax = 1; + pi->exp = 0; + pi->units = ""; // no units defined + // initialize parameter 8 ("m_delay_46") + pi = self->__commonstate.params + 8; + pi->name = "delay3"; + pi->paramtype = GENLIB_PARAMTYPE_SYM; + pi->defaultvalue = 0.; + pi->defaultref = 0; + pi->hasinputminmax = false; + pi->inputmin = 0; + pi->inputmax = 1; + pi->hasminmax = false; + pi->outputmin = 0; + pi->outputmax = 1; + pi->exp = 0; + pi->units = ""; // no units defined + // initialize parameter 9 ("m_delay_47") + pi = self->__commonstate.params + 9; + pi->name = "delay4"; + pi->paramtype = GENLIB_PARAMTYPE_SYM; + pi->defaultvalue = 0.; + pi->defaultref = 0; + pi->hasinputminmax = false; + pi->inputmin = 0; + pi->inputmax = 1; + pi->hasminmax = false; + pi->outputmin = 0; + pi->outputmax = 1; + pi->exp = 0; + pi->units = ""; // no units defined + // initialize parameter 10 ("m_double_58") + pi = self->__commonstate.params + 10; + pi->name = "double"; + pi->paramtype = GENLIB_PARAMTYPE_FLOAT; + pi->defaultvalue = self->m_double_58; + pi->defaultref = 0; + pi->hasinputminmax = false; + pi->inputmin = 0; + pi->inputmax = 1; + pi->hasminmax = true; + pi->outputmin = 0; + pi->outputmax = 1; + pi->exp = 0; + pi->units = ""; // no units defined + // initialize parameter 11 ("m_feedback_52") + pi = self->__commonstate.params + 11; + pi->name = "feedback"; + pi->paramtype = GENLIB_PARAMTYPE_FLOAT; + pi->defaultvalue = self->m_feedback_52; + pi->defaultref = 0; + pi->hasinputminmax = false; + pi->inputmin = 0; + pi->inputmax = 1; + pi->hasminmax = true; + pi->outputmin = 0; + pi->outputmax = 1; + pi->exp = 0; + pi->units = ""; // no units defined + // initialize parameter 12 ("m_mix_51") + pi = self->__commonstate.params + 12; + pi->name = "mix"; + pi->paramtype = GENLIB_PARAMTYPE_FLOAT; + pi->defaultvalue = self->m_mix_51; + pi->defaultref = 0; + pi->hasinputminmax = false; + pi->inputmin = 0; + pi->inputmax = 1; + pi->hasminmax = true; + pi->outputmin = 0; + pi->outputmax = 1; + pi->exp = 0; + pi->units = ""; // no units defined + // initialize parameter 13 ("m_reset_55") + pi = self->__commonstate.params + 13; + pi->name = "reset"; + pi->paramtype = GENLIB_PARAMTYPE_FLOAT; + pi->defaultvalue = self->m_reset_55; + pi->defaultref = 0; + pi->hasinputminmax = false; + pi->inputmin = 0; + pi->inputmax = 1; + pi->hasminmax = true; + pi->outputmin = 0; + pi->outputmax = 1; + pi->exp = 0; + pi->units = ""; // no units defined + // initialize parameter 14 ("m_reverse_49") + pi = self->__commonstate.params + 14; + pi->name = "reverse"; + pi->paramtype = GENLIB_PARAMTYPE_FLOAT; + pi->defaultvalue = self->m_reverse_49; + pi->defaultref = 0; + pi->hasinputminmax = false; + pi->inputmin = 0; + pi->inputmax = 1; + pi->hasminmax = true; + pi->outputmin = 0; + pi->outputmax = 1; + pi->exp = 0; + pi->units = ""; // no units defined + // initialize parameter 15 ("m_speed_59") + pi = self->__commonstate.params + 15; + pi->name = "speed"; + pi->paramtype = GENLIB_PARAMTYPE_FLOAT; + pi->defaultvalue = self->m_speed_59; + pi->defaultref = 0; + pi->hasinputminmax = false; + pi->inputmin = 0; + pi->inputmax = 1; + pi->hasminmax = true; + pi->outputmin = 0.5; + pi->outputmax = 2; + pi->exp = 0; + pi->units = ""; // no units defined + // initialize parameter 16 ("m_time_56") + pi = self->__commonstate.params + 16; + pi->name = "time"; + pi->paramtype = GENLIB_PARAMTYPE_FLOAT; + pi->defaultvalue = self->m_time_56; + pi->defaultref = 0; + pi->hasinputminmax = false; + pi->inputmin = 0; + pi->inputmax = 1; + pi->hasminmax = true; + pi->outputmin = 100; + pi->outputmax = 10000; + pi->exp = 0; + pi->units = ""; // no units defined + + return self; +} + +/// Release all resources and memory used by a State object: + +void destroy(CommonState *cself) { + State *self = (State *)cself; + genlib_sysmem_freeptr(cself->params); + + delete self; +} + + +} // gen_exported:: diff --git a/plugins/zwabo-cozmic/gen_exported.h b/plugins/zwabo-cozmic/gen_exported.h new file mode 100644 index 0000000..231d733 --- /dev/null +++ b/plugins/zwabo-cozmic/gen_exported.h @@ -0,0 +1,49 @@ +/******************************************************************************************************************* +Cycling '74 License for Max-Generated Code for Export +Copyright (c) 2016 Cycling '74 +The code that Max generates automatically and that end users are capable of exporting and using, and any + associated documentation files (the “Software”) is a work of authorship for which Cycling '74 is the author + and owner for copyright purposes. A license is hereby granted, free of charge, to any person obtaining a + copy of the Software (“Licensee”) to use, copy, modify, merge, publish, and distribute copies of the Software, + and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +The Software is licensed to Licensee only for non-commercial use. Users who wish to make commercial use of the + Software must contact the copyright owner to determine if a license for commercial use is available, and the + terms and conditions for same, which may include fees or royalties. For commercial use, please send inquiries + to licensing (at) cycling74.com. The determination of whether a use is commercial use or non-commercial use is based + upon the use, not the user. The Software may be used by individuals, institutions, governments, corporations, or + other business whether for-profit or non-profit so long as the use itself is not a commercialization of the + materials or a use that generates or is intended to generate income, revenue, sales or profit. +The above copyright notice and this license shall be included in all copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO + THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*******************************************************************************************************************/ + + +#include "genlib.h" +#include "genlib_exportfunctions.h" +#include "genlib_ops.h" + +namespace gen_exported { + +int num_inputs(); +int num_outputs(); +int num_params(); +int perform(CommonState *cself, t_sample **ins, long numins, t_sample **outs, long numouts, long n); +void reset(CommonState *cself); +void setparameter(CommonState *cself, long index, t_param value, void *ref); +void getparameter(CommonState *cself, long index, t_param *value); +const char *getparametername(CommonState *cself, long index); +t_param getparametermin(CommonState *cself, long index); +t_param getparametermax(CommonState *cself, long index); +char getparameterhasminmax(CommonState *cself, long index); +const char *getparameterunits(CommonState *cself, long index); +size_t getstatesize(CommonState *cself); +short getstate(CommonState *cself, char *state); +short setstate(CommonState *cself, const char *state); +void *create(t_param sr, long vs); +void destroy(CommonState *cself); + +} // gen_exported:: diff --git a/plugins/zwabo-stuttter/DistrhoPluginInfo.h b/plugins/zwabo-stuttter/DistrhoPluginInfo.h new file mode 100644 index 0000000..063f0a0 --- /dev/null +++ b/plugins/zwabo-stuttter/DistrhoPluginInfo.h @@ -0,0 +1,34 @@ +/* + * DPF Max Gen + * Copyright (C) 2015-2023 Filipe Coelho + * + * Permission to use, copy, modify, and/or distribute this software for any purpose with + * or without fee is hereby granted, provided that the above copyright notice and this + * permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD + * TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER + * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#pragma once + +#define DISTRHO_PLUGIN_BRAND "zwabo" +#define DISTRHO_PLUGIN_NAME "STUTTER" +#define DISTRHO_PLUGIN_URI "urn:maxgen:zwabo:stutter" +#define DISTRHO_PLUGIN_CLAP_ID "maxgen.zwabo.stutter" + +#define DISTRHO_PLUGIN_HAS_UI 0 +#define DISTRHO_PLUGIN_IS_RT_SAFE 1 +#define DISTRHO_PLUGIN_NUM_INPUTS 2 +#define DISTRHO_PLUGIN_NUM_OUTPUTS 2 + +#define DISTRHO_PLUGIN_CLAP_FEATURES "audio-effect", "delay", "stereo" +#define DISTRHO_PLUGIN_LV2_CATEGORY "lv2:DelayPlugin" +#define DISTRHO_PLUGIN_VST3_CATEGORIES "Fx|Delay" + +#define DISTRHO_PLUGIN_UNIQUE_ID d_cconst('z', 'w', 's', 't') +#define DISTRHO_PLUGIN_VERSION d_version(0, 0, 0) diff --git a/plugins/zwabo-stuttter/README.md b/plugins/zwabo-stuttter/README.md new file mode 100644 index 0000000..9356044 --- /dev/null +++ b/plugins/zwabo-stuttter/README.md @@ -0,0 +1,28 @@ +# Stuttter +Double Stutter effect (L/R) with time division 1/4 note, 1/8 note , etc... +but also odd division 5tuplet, 7tuplet, 9tuplet, 11tuplet which could give interesting polyrythmic effects at slow tempo. An ambiant soft and harsh tool in one plugin.. + + +Max gen~ plugin compiled with Christosku docker container + +BPM : time between 20 and 240 bpm + +DIV_L and DIV_R : Independant time division for channel left and right 1/4 note, dotted1/8 note , 1/4 note triplets, 1/8 note, etc ….and also odd division 5tuplet, 7tuplet, 9tuplet, 11tuplet which could give interesting polyrythmic effects at slow tempo + +DOUBLE: when engaged, left and right are active, disengaged only DIV_L is active in mono. + +FILTER_R : when Double is engaged, allow filtering for channel right (interesting when playing on a mono source) + +ZTUTTER : record and trig the stutter effect + +Dry/Wet: mix dry/wet + +RANDOM: when engaged, random tempo/division on each ZTUTTER trig + +RANGE : random range 1 (random time longer) to 10 (random time shorter) + +TAIL : add a tail when stopping stutter (artifacts with random…) + +ENV : add an envelop to avoid clicks and/or tweak the loop + + diff --git a/plugins/zwabo-stuttter/gen_exported.cpp b/plugins/zwabo-stuttter/gen_exported.cpp new file mode 100644 index 0000000..8cb23f1 --- /dev/null +++ b/plugins/zwabo-stuttter/gen_exported.cpp @@ -0,0 +1,1037 @@ +#include "gen_exported.h" + +namespace gen_exported { + +/******************************************************************************************************************* +Cycling '74 License for Max-Generated Code for Export +Copyright (c) 2016 Cycling '74 +The code that Max generates automatically and that end users are capable of exporting and using, and any + associated documentation files (the “Software”) is a work of authorship for which Cycling '74 is the author + and owner for copyright purposes. A license is hereby granted, free of charge, to any person obtaining a + copy of the Software (“Licensee”) to use, copy, modify, merge, publish, and distribute copies of the Software, + and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +The Software is licensed to Licensee only for non-commercial use. Users who wish to make commercial use of the + Software must contact the copyright owner to determine if a license for commercial use is available, and the + terms and conditions for same, which may include fees or royalties. For commercial use, please send inquiries + to licensing (at) cycling74.com. The determination of whether a use is commercial use or non-commercial use is based + upon the use, not the user. The Software may be used by individuals, institutions, governments, corporations, or + other business whether for-profit or non-profit so long as the use itself is not a commercialization of the + materials or a use that generates or is intended to generate income, revenue, sales or profit. +The above copyright notice and this license shall be included in all copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO + THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*******************************************************************************************************************/ + +// global noise generator +Noise noise; +static const int GENLIB_LOOPCOUNT_BAIL = 100000; + + +// The State struct contains all the state and procedures for the gendsp kernel +typedef struct State { + CommonState __commonstate; + Data m_RIGHT_11; + Data m_LEFT_17; + Delay m_delay_19; + Delay m_delay_10; + Delay m_delay_20; + Delay m_delay_13; + Delay m_delay_16; + Delay m_delay_14; + Delta __m_delta_78; + Delta __m_delta_52; + PlusEquals __m_pluseq_55; + PlusEquals __m_pluseq_81; + Sah __m_sah_36; + Sah __m_sah_34; + Sah __m_sah_35; + int vectorsize; + int __exception; + t_sample __m_latch_54; + t_sample __m_carry_47; + t_sample __m_latch_53; + t_sample __m_count_43; + t_sample __m_count_45; + t_sample __m_count_57; + t_sample m_BPM_33; + t_sample __m_latch_82; + t_sample __m_latch_80; + t_sample __m_count_83; + t_sample __m_carry_85; + t_sample __m_latch_56; + t_sample __m_latch_79; + t_sample __m_count_71; + t_sample __m_carry_73; + t_sample __m_carry_59; + t_sample __m_count_69; + t_sample m_Filter_R_32; + t_sample m_Div_R_28; + t_sample m_RANGE_30; + t_sample m_history_6; + t_sample m_history_5; + t_sample m_history_7; + t_sample m_history_8; + t_sample m_history_9; + t_sample m_history_4; + t_sample m_history_2; + t_sample m_history_3; + t_sample samplerate; + t_sample m_history_1; + t_sample m_reverse_31; + t_sample m_history_12; + t_sample m_history_18; + t_sample m_dry_wet_27; + t_sample m_DOUBLE_26; + t_sample __m_latch_89; + t_sample m_ztutter_29; + t_sample m_history_15; + t_sample m_speed_25; + t_sample m_Tail_23; + t_sample m_Div_L_24; + t_sample m_RANDOM_21; + t_sample m_ENV_ms_22; + t_sample __m_latch_90; + // re-initialize all member variables; + inline void reset(t_param __sr, int __vs) { + __exception = 0; + vectorsize = __vs; + samplerate = __sr; + m_history_1 = ((int)0); + m_history_2 = ((int)0); + m_history_3 = ((int)0); + m_history_4 = ((int)0); + m_history_5 = ((int)0); + m_history_6 = ((int)0); + m_history_7 = ((int)0); + m_history_8 = ((int)0); + m_history_9 = ((int)0); + m_delay_10.reset("m_delay_10", samplerate); + m_RIGHT_11.reset("RIGHT", ((int)192000), ((int)1)); + m_history_12 = ((int)0); + m_delay_13.reset("m_delay_13", ((int)48000)); + m_delay_14.reset("m_delay_14", samplerate); + m_history_15 = ((int)0); + m_delay_16.reset("m_delay_16", samplerate); + m_LEFT_17.reset("LEFT", ((int)192000), ((int)1)); + m_history_18 = ((int)0); + m_delay_19.reset("m_delay_19", ((int)48000)); + m_delay_20.reset("m_delay_20", samplerate); + m_RANDOM_21 = 0; + m_ENV_ms_22 = 20; + m_Tail_23 = 0; + m_Div_L_24 = 1; + m_speed_25 = 1; + m_DOUBLE_26 = 0; + m_dry_wet_27 = 0.5; + m_Div_R_28 = 3; + m_ztutter_29 = 0; + m_RANGE_30 = 5; + m_reverse_31 = 0; + m_Filter_R_32 = 0; + m_BPM_33 = 120; + __m_sah_34.reset(0); + __m_sah_35.reset(0); + __m_sah_36.reset(0); + __m_count_43 = 0; + __m_count_45 = 0; + __m_carry_47 = 0; + __m_delta_52.reset(0); + __m_latch_53 = 0; + __m_latch_54 = 0; + __m_pluseq_55.reset(0); + __m_latch_56 = 0; + __m_count_57 = 0; + __m_carry_59 = 0; + __m_count_69 = 0; + __m_count_71 = 0; + __m_carry_73 = 0; + __m_delta_78.reset(0); + __m_latch_79 = 0; + __m_latch_80 = 0; + __m_pluseq_81.reset(0); + __m_latch_82 = 0; + __m_count_83 = 0; + __m_carry_85 = 0; + __m_latch_89 = 0; + __m_latch_90 = 0; + genlib_reset_complete(this); + + }; + // the signal processing routine; + inline int perform(t_sample ** __ins, t_sample ** __outs, int __n) { + vectorsize = __n; + const t_sample * __in1 = __ins[0]; + const t_sample * __in2 = __ins[1]; + t_sample * __out1 = __outs[0]; + t_sample * __out2 = __outs[1]; + if (__exception) { + return __exception; + + } else if (( (__in1 == 0) || (__in2 == 0) || (__out1 == 0) || (__out2 == 0) )) { + __exception = GENLIB_ERR_NULL_BUFFER; + return __exception; + + }; + t_sample sub_389 = (m_dry_wet_27 - ((t_sample)0.5)); + t_sample scale_386 = ((safepow((sub_389 * ((t_sample)2)), ((int)1)) * ((int)-1)) + ((int)1)); + t_sample scale_378 = scale_386; + t_sample min_377 = ((((int)1) < scale_378) ? ((int)1) : scale_378); + t_sample sub_393 = (m_dry_wet_27 - ((int)0)); + t_sample scale_390 = ((safepow((sub_393 * ((t_sample)2)), ((int)1)) * ((int)1)) + ((int)0)); + t_sample scale_277 = scale_390; + t_sample min_380 = ((((int)1) < scale_277) ? ((int)1) : scale_277); + t_sample tail_256 = m_Tail_23; + t_sample tail_255 = tail_256; + t_sample stutt_46 = m_ztutter_29; + t_sample stutt_384 = stutt_46; + t_sample add_383 = (stutt_384 + ((int)1)); + t_sample stutt_365 = stutt_46; + t_sample add_364 = (stutt_365 + ((int)1)); + t_sample stutt_257 = stutt_46; + t_sample speed_68 = m_speed_25; + t_sample speed_3 = speed_68; + t_sample stutt_280 = stutt_46; + t_sample add_66 = (m_reverse_31 + ((int)1)); + t_sample reverse_2 = add_66; + t_sample reverse_67 = reverse_2; + t_sample stutt_278 = stutt_46; + t_sample add_283 = (m_DOUBLE_26 + ((int)1)); + t_sample add_187 = (m_RANDOM_21 + ((int)1)); + t_sample randomsel_242 = add_187; + t_sample randomsel_247 = randomsel_242; + t_sample randomsel_244 = randomsel_242; + t_sample stutt_188 = stutt_46; + int not_186 = (!stutt_188); + t_sample add_208 = (((int)0) + m_RANGE_30); + t_sample orange_400 = (add_208 - ((int)0)); + t_sample mul_192 = (((t_sample)0.5) * m_RANGE_30); + t_sample orange_408 = (mul_192 - ((t_sample)0.5)); + t_sample add_224 = (((int)0) + m_RANGE_30); + t_sample orange_416 = (add_224 - ((int)0)); + t_sample choice_37 = int(randomsel_247); + t_sample choice_39 = int(randomsel_242); + t_sample add_266 = (stutt_257 + ((int)1)); + t_sample choice_40 = int(add_266); + t_sample add_259 = (stutt_257 + ((int)1)); + t_sample choice_41 = int(add_259); + t_sample selector_260 = ((choice_41 >= 2) ? ((int)1) : ((choice_41 >= 1) ? ((t_sample)0.45) : 0)); + int not_69 = (!stutt_257); + int LEFT_dim = m_LEFT_17.dim; + int LEFT_channels = m_LEFT_17.channels; + t_sample choice_49 = int(reverse_67); + t_sample sub_425 = (m_ENV_ms_22 - ((int)0)); + t_sample scale_422 = ((safepow((sub_425 * ((t_sample)0.00033333333333333)), ((int)1)) * ((t_sample)-0.0099)) + ((t_sample)0.01)); + t_sample scale_348 = scale_422; + t_sample mul_325 = (m_ENV_ms_22 * ((int)2)); + int eq_344 = (stutt_280 == ((int)0)); + t_sample choice_61 = int(add_383); + int min_62 = (-1); + t_sample choice_63 = int(randomsel_244); + t_sample choice_65 = int(add_283); + t_sample add_55 = (stutt_46 + ((int)1)); + t_sample choice_66 = int(add_55); + t_sample add_48 = (stutt_46 + ((int)1)); + t_sample choice_67 = int(add_48); + t_sample selector_49 = ((choice_67 >= 2) ? ((int)1) : ((choice_67 >= 1) ? ((t_sample)0.45) : 0)); + int not_4 = (!stutt_46); + int RIGHT_dim = m_RIGHT_11.dim; + int RIGHT_channels = m_RIGHT_11.channels; + t_sample choice_75 = int(reverse_2); + t_sample sub_433 = (m_ENV_ms_22 - ((int)0)); + t_sample scale_430 = ((safepow((sub_433 * ((t_sample)0.00033333333333333)), ((int)1)) * ((t_sample)-0.0099)) + ((t_sample)0.01)); + t_sample scale_323 = scale_430; + t_sample mul_300 = (m_ENV_ms_22 * ((int)2)); + int eq_319 = (stutt_278 == ((int)0)); + t_sample choice_87 = int(add_364); + int min_88 = (-1); + int lte_111 = (m_Filter_R_32 <= ((int)0)); + int not_110 = (!lte_111); + __m_latch_89 = ((not_110 != 0) ? m_Filter_R_32 : __m_latch_89); + t_sample latch_112 = __m_latch_89; + t_sample sub_437 = (latch_112 - ((int)0)); + t_sample scale_434 = ((safepow((sub_437 * ((t_sample)0.01)), ((int)1)) * ((int)995)) + ((int)5)); + t_sample scale_116 = scale_434; + int gte_114 = (m_Filter_R_32 >= ((int)0)); + int not_113 = (!gte_114); + __m_latch_90 = ((not_113 != 0) ? m_Filter_R_32 : __m_latch_90); + t_sample latch_115 = __m_latch_90; + t_sample sub_441 = (latch_115 - (-100)); + t_sample scale_438 = ((safepow((sub_441 * ((t_sample)0.01)), ((int)1)) * ((int)22500)) + ((int)500)); + t_sample scale_117 = scale_438; + t_sample min_154 = ((scale_117 < ((int)0)) ? ((int)0) : scale_117); + t_sample omega = safediv((min_154 * ((t_sample)6.2831853071796)), samplerate); + t_sample sn = sin(omega); + t_sample cs = cos(omega); + t_sample alpha = ((sn * ((t_sample)0.5)) * ((int)2)); + t_sample b0 = safediv(((int)1), (((int)1) + alpha)); + t_sample a2 = (((((int)1) - cs) * ((t_sample)0.5)) * b0); + t_sample a1 = ((((int)1) - cs) * b0); + t_sample b1 = ((((int)-2) * cs) * b0); + t_sample b2 = ((((int)1) - alpha) * b0); + t_sample expr_170 = a2; + t_sample expr_171 = a1; + t_sample expr_172 = a2; + t_sample expr_173 = b1; + t_sample expr_174 = b2; + t_sample min_126 = ((scale_116 < ((int)0)) ? ((int)0) : scale_116); + t_sample omega_178 = safediv((min_126 * ((t_sample)6.2831853071796)), samplerate); + t_sample sn_182 = sin(omega_178); + t_sample cs_181 = cos(omega_178); + t_sample alpha_183 = ((sn_182 * ((t_sample)0.5)) * ((t_sample)2)); + t_sample b_176 = safediv(((int)1), (((int)1) + alpha_183)); + t_sample a_184 = (((((int)1) + cs_181) * ((t_sample)0.5)) * b_176); + t_sample a_180 = ((-(((int)1) + cs_181)) * b_176); + t_sample b_179 = ((((int)-2) * cs_181) * b_176); + t_sample b_177 = ((((int)1) - alpha_183) * b_176); + t_sample expr_142 = a_184; + t_sample expr_143 = a_180; + t_sample expr_144 = a_184; + t_sample expr_145 = b_179; + t_sample expr_146 = b_177; + // the main sample loop; + while ((__n--)) { + const t_sample in1 = (*(__in1++)); + const t_sample in2 = (*(__in2++)); + t_sample mul_382 = (in1 * min_377); + t_sample mul_363 = (in2 * min_377); + t_sample noise_216 = noise(); + t_sample noise_218 = noise(); + t_sample noise_219 = noise(); + t_sample wrap_217 = wrap(noise_219, noise_216, noise_218); + t_sample irange_395 = (noise_218 - noise_216); + t_sample sub_397 = (wrap_217 - noise_216); + t_sample scale_394 = ((safepow(safediv(sub_397, irange_395), ((int)1)) * ((int)1)) + ((int)0)); + t_sample scale_215 = scale_394; + t_sample sub_401 = (scale_215 - ((int)0)); + t_sample scale_398 = ((safepow((sub_401 * ((t_sample)1)), ((int)1)) * orange_400) + ((int)0)); + t_sample scale_211 = scale_398; + t_sample ceil_206 = ceil(scale_211); + t_sample sah_205 = __m_sah_34(ceil_206, not_186, ((int)0)); + t_sample gen_220 = sah_205; + t_sample gen_238 = gen_220; + t_sample noise_200 = noise(); + t_sample noise_202 = noise(); + t_sample noise_203 = noise(); + t_sample wrap_201 = wrap(noise_203, noise_200, noise_202); + t_sample irange_403 = (noise_202 - noise_200); + t_sample sub_405 = (wrap_201 - noise_200); + t_sample scale_402 = ((safepow(safediv(sub_405, irange_403), ((int)1)) * ((int)1)) + ((int)0)); + t_sample scale_199 = scale_402; + t_sample sub_409 = (scale_199 - ((int)0)); + t_sample scale_406 = ((safepow((sub_409 * ((t_sample)1)), ((int)1)) * orange_408) + ((t_sample)0.5)); + t_sample scale_195 = scale_406; + t_sample ceil_190 = ceil(scale_195); + t_sample sah_189 = __m_sah_35(ceil_190, not_186, ((int)0)); + t_sample gen_204 = sah_189; + t_sample gen_239 = gen_204; + t_sample noise_232 = noise(); + t_sample noise_234 = noise(); + t_sample noise_235 = noise(); + t_sample wrap_233 = wrap(noise_235, noise_232, noise_234); + t_sample irange_411 = (noise_234 - noise_232); + t_sample sub_413 = (wrap_233 - noise_232); + t_sample scale_410 = ((safepow(safediv(sub_413, irange_411), ((int)1)) * ((int)1)) + ((int)0)); + t_sample scale_231 = scale_410; + t_sample sub_417 = (scale_231 - ((int)0)); + t_sample scale_414 = ((safepow((sub_417 * ((t_sample)1)), ((int)1)) * orange_416) + ((int)0)); + t_sample scale_227 = scale_414; + t_sample ceil_222 = ceil(scale_227); + t_sample sah_221 = __m_sah_36(ceil_222, not_186, ((int)0)); + t_sample gen_236 = sah_221; + t_sample gen_237 = gen_236; + t_sample Div_248 = gen_237; + t_sample selector_249 = ((choice_37 >= 2) ? Div_248 : ((choice_37 >= 1) ? m_Div_L_24 : 0)); + t_sample choice_38 = int(selector_249); + t_sample selector_375 = ((choice_38 >= 10) ? ((t_sample)0.090909) : ((choice_38 >= 9) ? ((t_sample)0.111111) : ((choice_38 >= 8) ? ((t_sample)0.142857) : ((choice_38 >= 7) ? ((t_sample)0.2) : ((choice_38 >= 6) ? ((t_sample)0.25) : ((choice_38 >= 5) ? ((t_sample)0.3335) : ((choice_38 >= 4) ? ((t_sample)0.5) : ((choice_38 >= 3) ? ((t_sample)0.667) : ((choice_38 >= 2) ? ((t_sample)0.75) : ((choice_38 >= 1) ? ((int)1) : 0)))))))))); + t_sample MultBPM_241 = gen_239; + t_sample mul_240 = (m_BPM_33 * MultBPM_241); + t_sample selector_243 = ((choice_39 >= 2) ? mul_240 : ((choice_39 >= 1) ? m_BPM_33 : 0)); + t_sample rdiv_356 = safediv(((int)60), selector_243); + t_sample mul_370 = (rdiv_356 * selector_375); + t_sample mul_355 = (mul_370 * ((int)1000)); + t_sample mstosamps_376 = (mul_355 * (samplerate * 0.001)); + t_sample pass_251 = mstosamps_376; + t_sample timesamples_L_281 = pass_251; + t_sample timesamples_L_252 = timesamples_L_281; + t_sample tap_274 = m_delay_20.read_linear(timesamples_L_252); + t_sample fold_271 = fold(tap_274, (-1), ((int)1)); + t_sample mul_262 = (fold_271 * ((int)1)); + t_sample tap_264 = m_delay_19.read_step(((int)48000)); + t_sample selector_267 = ((choice_40 >= 2) ? tap_264 : ((choice_40 >= 1) ? ((int)1) : 0)); + t_sample add_265 = (selector_267 + ((int)1)); + t_sample mul_272 = (m_history_18 * selector_260); + t_sample choice_42 = int(add_265); + t_sample selector_269 = ((choice_42 >= 2) ? mul_272 : ((choice_42 >= 1) ? in1 : 0)); + t_sample history_270_next_275 = fixdenorm(fold_271); + t_sample mul_254 = (mul_262 * tail_256); + __m_count_43 = (not_69 ? 0 : (fixdenorm(__m_count_43 + ((int)1)))); + int counter_104 = __m_count_43; + int counter_105 = ((int)0); + int counter_106 = ((int)0); + int clamp_102 = ((counter_104 <= ((int)0)) ? ((int)0) : ((counter_104 >= ((int)191999)) ? ((int)191999) : counter_104)); + bool index_ignore_44 = ((clamp_102 >= LEFT_dim) || (clamp_102 < 0)); + if ((!index_ignore_44)) { + m_LEFT_17.write(in1, clamp_102, 0); + + }; + __m_count_45 = (not_69 ? 0 : (fixdenorm(__m_count_45 + speed_68))); + int carry_46 = 0; + if ((not_69 != 0)) { + __m_count_45 = 0; + __m_carry_47 = 0; + + } else if (((timesamples_L_252 > 0) && (__m_count_45 >= timesamples_L_252))) { + int wraps_48 = (__m_count_45 / timesamples_L_252); + __m_carry_47 = (__m_carry_47 + wraps_48); + __m_count_45 = (__m_count_45 - (wraps_48 * timesamples_L_252)); + carry_46 = 1; + + }; + t_sample counter_97 = __m_count_45; + int counter_98 = carry_46; + int counter_99 = __m_carry_47; + t_sample clamp_96 = ((counter_97 <= ((int)0)) ? ((int)0) : ((counter_97 >= ((int)191999)) ? ((int)191999) : counter_97)); + t_sample irange_419 = (timesamples_L_252 - ((int)0)); + t_sample orange_420 = (((int)0) - timesamples_L_252); + t_sample sub_421 = (clamp_96 - ((int)0)); + t_sample scale_418 = ((safepow(safediv(sub_421, irange_419), ((int)1)) * orange_420) + timesamples_L_252); + t_sample selector_92 = ((choice_49 >= 2) ? scale_418 : ((choice_49 >= 1) ? clamp_96 : 0)); + int index_trunc_50 = fixnan(floor(selector_92)); + bool index_ignore_51 = ((index_trunc_50 >= LEFT_dim) || (index_trunc_50 < 0)); + // samples LEFT channel 1; + t_sample sample_LEFT_100 = (index_ignore_51 ? 0 : m_LEFT_17.read(index_trunc_50, 0)); + t_sample index_LEFT_101 = selector_92; + t_sample tap_327 = m_delay_16.read_linear(m_ENV_ms_22); + t_sample delta_337 = __m_delta_52(tap_327); + __m_latch_53 = ((delta_337 != 0) ? m_history_15 : __m_latch_53); + t_sample latch_332 = __m_latch_53; + __m_latch_54 = ((delta_337 != 0) ? tap_327 : __m_latch_54); + t_sample latch_334 = __m_latch_54; + t_sample plusequals_336 = __m_pluseq_55.post(((int)1), delta_337, 0); + __m_latch_56 = ((delta_337 != 0) ? scale_348 : __m_latch_56); + t_sample latch_331 = __m_latch_56; + t_sample mul_335 = (plusequals_336 * latch_331); + t_sample clamp_333 = ((mul_335 <= ((int)0)) ? ((int)0) : ((mul_335 >= ((int)1)) ? ((int)1) : mul_335)); + t_sample anon_338 = linear_interp(clamp_333, latch_332, latch_334); + t_sample gen_340 = anon_338; + t_sample history_329_next_339 = fixdenorm(anon_338); + t_sample sub_342 = (timesamples_L_281 - mul_325); + __m_count_57 = (eq_344 ? 0 : (fixdenorm(__m_count_57 + ((int)1)))); + int carry_58 = 0; + if ((eq_344 != 0)) { + __m_count_57 = 0; + __m_carry_59 = 0; + + } else if (((timesamples_L_281 > 0) && (__m_count_57 >= timesamples_L_281))) { + int wraps_60 = (__m_count_57 / timesamples_L_281); + __m_carry_59 = (__m_carry_59 + wraps_60); + __m_count_57 = (__m_count_57 - (wraps_60 * timesamples_L_281)); + carry_58 = 1; + + }; + int counter_345 = __m_count_57; + int counter_346 = carry_58; + int counter_347 = __m_carry_59; + int gte_341 = (counter_345 >= sub_342); + int not_328 = (!gte_341); + t_sample mul_368 = (sample_LEFT_100 * gen_340); + t_sample selector_385 = ((choice_61 >= 2) ? mul_368 : ((choice_61 >= 1) ? mul_254 : 0)); + t_sample mul_379 = (selector_385 * min_380); + t_sample add_381 = (mul_382 + mul_379); + t_sample clamp_358 = ((add_381 <= min_62) ? min_62 : ((add_381 >= ((int)1)) ? ((int)1) : add_381)); + t_sample out1 = clamp_358; + t_sample rdiv_291 = safediv(((int)60), selector_243); + t_sample Div_245 = gen_238; + t_sample selector_246 = ((choice_63 >= 2) ? Div_245 : ((choice_63 >= 1) ? m_Div_R_28 : 0)); + t_sample choice_64 = int(selector_246); + t_sample selector_298 = ((choice_64 >= 10) ? ((t_sample)0.090909) : ((choice_64 >= 9) ? ((t_sample)0.111111) : ((choice_64 >= 8) ? ((t_sample)0.142857) : ((choice_64 >= 7) ? ((t_sample)0.2) : ((choice_64 >= 6) ? ((t_sample)0.25) : ((choice_64 >= 5) ? ((t_sample)0.3335) : ((choice_64 >= 4) ? ((t_sample)0.5) : ((choice_64 >= 3) ? ((t_sample)0.667) : ((choice_64 >= 2) ? ((t_sample)0.75) : ((choice_64 >= 1) ? ((int)1) : 0)))))))))); + t_sample mul_293 = (rdiv_291 * selector_298); + t_sample mul_290 = (mul_293 * ((int)1000)); + t_sample mstosamps_299 = (mul_290 * (samplerate * 0.001)); + t_sample pass_250 = mstosamps_299; + t_sample selector_284 = ((choice_65 >= 2) ? pass_250 : ((choice_65 >= 1) ? pass_251 : 0)); + t_sample timesamples_selected_279 = selector_284; + t_sample timesamples_selected_45 = timesamples_selected_279; + t_sample tap_63 = m_delay_14.read_linear(timesamples_selected_45); + t_sample fold_60 = fold(tap_63, (-1), ((int)1)); + t_sample mul_51 = (fold_60 * ((int)1)); + t_sample gen_65 = mul_51; + t_sample tap_53 = m_delay_13.read_step(((int)48000)); + t_sample selector_56 = ((choice_66 >= 2) ? tap_53 : ((choice_66 >= 1) ? ((int)1) : 0)); + t_sample add_54 = (selector_56 + ((int)1)); + t_sample mul_61 = (m_history_12 * selector_49); + t_sample choice_68 = int(add_54); + t_sample selector_58 = ((choice_68 >= 2) ? mul_61 : ((choice_68 >= 1) ? in2 : 0)); + t_sample history_59_next_64 = fixdenorm(fold_60); + t_sample mul_253 = (gen_65 * tail_255); + __m_count_69 = (not_4 ? 0 : (fixdenorm(__m_count_69 + ((int)1)))); + int counter_39 = __m_count_69; + int counter_40 = ((int)0); + int counter_41 = ((int)0); + int clamp_37 = ((counter_39 <= ((int)0)) ? ((int)0) : ((counter_39 >= ((int)191999)) ? ((int)191999) : counter_39)); + bool index_ignore_70 = ((clamp_37 >= RIGHT_dim) || (clamp_37 < 0)); + if ((!index_ignore_70)) { + m_RIGHT_11.write(in2, clamp_37, 0); + + }; + __m_count_71 = (not_4 ? 0 : (fixdenorm(__m_count_71 + speed_3))); + int carry_72 = 0; + if ((not_4 != 0)) { + __m_count_71 = 0; + __m_carry_73 = 0; + + } else if (((timesamples_selected_45 > 0) && (__m_count_71 >= timesamples_selected_45))) { + int wraps_74 = (__m_count_71 / timesamples_selected_45); + __m_carry_73 = (__m_carry_73 + wraps_74); + __m_count_71 = (__m_count_71 - (wraps_74 * timesamples_selected_45)); + carry_72 = 1; + + }; + t_sample counter_32 = __m_count_71; + int counter_33 = carry_72; + int counter_34 = __m_carry_73; + t_sample clamp_31 = ((counter_32 <= ((int)0)) ? ((int)0) : ((counter_32 >= ((int)191999)) ? ((int)191999) : counter_32)); + t_sample irange_427 = (timesamples_selected_45 - ((int)0)); + t_sample orange_428 = (((int)0) - timesamples_selected_45); + t_sample sub_429 = (clamp_31 - ((int)0)); + t_sample scale_426 = ((safepow(safediv(sub_429, irange_427), ((int)1)) * orange_428) + timesamples_selected_45); + t_sample scale_30 = scale_426; + t_sample selector_27 = ((choice_75 >= 2) ? scale_30 : ((choice_75 >= 1) ? clamp_31 : 0)); + int index_trunc_76 = fixnan(floor(selector_27)); + bool index_ignore_77 = ((index_trunc_76 >= RIGHT_dim) || (index_trunc_76 < 0)); + // samples RIGHT channel 1; + t_sample sample_RIGHT_35 = (index_ignore_77 ? 0 : m_RIGHT_11.read(index_trunc_76, 0)); + t_sample index_RIGHT_36 = selector_27; + t_sample gen_44 = sample_RIGHT_35; + t_sample tap_302 = m_delay_10.read_linear(m_ENV_ms_22); + t_sample delta_312 = __m_delta_78(tap_302); + __m_latch_79 = ((delta_312 != 0) ? m_history_9 : __m_latch_79); + t_sample latch_307 = __m_latch_79; + __m_latch_80 = ((delta_312 != 0) ? tap_302 : __m_latch_80); + t_sample latch_309 = __m_latch_80; + t_sample plusequals_311 = __m_pluseq_81.post(((int)1), delta_312, 0); + __m_latch_82 = ((delta_312 != 0) ? scale_323 : __m_latch_82); + t_sample latch_306 = __m_latch_82; + t_sample mul_310 = (plusequals_311 * latch_306); + t_sample clamp_308 = ((mul_310 <= ((int)0)) ? ((int)0) : ((mul_310 >= ((int)1)) ? ((int)1) : mul_310)); + t_sample anon_313 = linear_interp(clamp_308, latch_307, latch_309); + t_sample gen_315 = anon_313; + t_sample history_304_next_314 = fixdenorm(anon_313); + t_sample gen_324 = gen_315; + t_sample sub_317 = (timesamples_selected_279 - mul_300); + __m_count_83 = (eq_319 ? 0 : (fixdenorm(__m_count_83 + ((int)1)))); + int carry_84 = 0; + if ((eq_319 != 0)) { + __m_count_83 = 0; + __m_carry_85 = 0; + + } else if (((timesamples_selected_279 > 0) && (__m_count_83 >= timesamples_selected_279))) { + int wraps_86 = (__m_count_83 / timesamples_selected_279); + __m_carry_85 = (__m_carry_85 + wraps_86); + __m_count_83 = (__m_count_83 - (wraps_86 * timesamples_selected_279)); + carry_84 = 1; + + }; + int counter_320 = __m_count_83; + int counter_321 = carry_84; + int counter_322 = __m_carry_85; + int gte_316 = (counter_320 >= sub_317); + int not_303 = (!gte_316); + t_sample envelop_R_359 = gen_324; + t_sample mul_360 = (gen_44 * envelop_R_359); + t_sample selector_366 = ((choice_87 >= 2) ? mul_360 : ((choice_87 >= 1) ? mul_253 : 0)); + t_sample mul_361 = (selector_366 * min_380); + t_sample add_362 = (mul_363 + mul_361); + t_sample clamp_357 = ((add_362 <= min_88) ? min_88 : ((add_362 >= ((int)1)) ? ((int)1) : add_362)); + t_sample mul_164 = (clamp_357 * expr_170); + t_sample mul_161 = (m_history_6 * expr_171); + t_sample mul_159 = (m_history_7 * expr_172); + t_sample mul_155 = (m_history_8 * expr_174); + t_sample mul_157 = (m_history_5 * expr_173); + t_sample sub_163 = (((mul_159 + mul_161) + mul_164) - (mul_157 + mul_155)); + t_sample gen_169 = sub_163; + t_sample history_156_next_165 = fixdenorm(m_history_5); + t_sample history_160_next_166 = fixdenorm(m_history_6); + t_sample history_162_next_167 = fixdenorm(clamp_357); + t_sample history_158_next_168 = fixdenorm(sub_163); + t_sample gen_175 = gen_169; + t_sample mul_136 = (gen_175 * expr_142); + t_sample mul_133 = (m_history_2 * expr_143); + t_sample mul_131 = (m_history_4 * expr_144); + t_sample mul_127 = (m_history_3 * expr_146); + t_sample mul_129 = (m_history_1 * expr_145); + t_sample sub_135 = (((mul_131 + mul_133) + mul_136) - (mul_129 + mul_127)); + t_sample gen_141 = sub_135; + t_sample history_132_next_137 = fixdenorm(m_history_2); + t_sample history_128_next_138 = fixdenorm(m_history_1); + t_sample history_134_next_139 = fixdenorm(gen_175); + t_sample history_130_next_140 = fixdenorm(sub_135); + t_sample out2 = gen_141; + m_delay_20.write(selector_269); + m_history_18 = history_270_next_275; + m_delay_19.write(stutt_257); + m_delay_16.write(not_328); + m_history_15 = history_329_next_339; + m_delay_14.write(selector_58); + m_history_12 = history_59_next_64; + m_delay_13.write(stutt_46); + m_delay_10.write(not_303); + m_history_9 = history_304_next_314; + m_history_8 = history_156_next_165; + m_history_1 = history_130_next_140; + m_history_2 = history_134_next_139; + m_history_3 = history_128_next_138; + m_history_4 = history_132_next_137; + m_history_5 = history_158_next_168; + m_history_6 = history_162_next_167; + m_history_7 = history_160_next_166; + m_delay_10.step(); + m_delay_13.step(); + m_delay_14.step(); + m_delay_16.step(); + m_delay_19.step(); + m_delay_20.step(); + // assign results to output buffer; + (*(__out1++)) = out1; + (*(__out2++)) = out2; + + }; + return __exception; + + }; + inline void set_RIGHT(void * _value) { + m_RIGHT_11.setbuffer(_value); + }; + inline void set_LEFT(void * _value) { + m_LEFT_17.setbuffer(_value); + }; + inline void set_RANDOM(t_param _value) { + m_RANDOM_21 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value)); + }; + inline void set_ENV_ms(t_param _value) { + m_ENV_ms_22 = (_value < 0 ? 0 : (_value > 3000 ? 3000 : _value)); + }; + inline void set_Tail(t_param _value) { + m_Tail_23 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value)); + }; + inline void set_Div_L(t_param _value) { + m_Div_L_24 = (_value < 1 ? 1 : (_value > 10 ? 10 : _value)); + }; + inline void set_speed(t_param _value) { + m_speed_25 = (_value < 0.01 ? 0.01 : (_value > 23 ? 23 : _value)); + }; + inline void set_DOUBLE(t_param _value) { + m_DOUBLE_26 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value)); + }; + inline void set_dry_wet(t_param _value) { + m_dry_wet_27 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value)); + }; + inline void set_Div_R(t_param _value) { + m_Div_R_28 = (_value < 1 ? 1 : (_value > 10 ? 10 : _value)); + }; + inline void set_ztutter(t_param _value) { + m_ztutter_29 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value)); + }; + inline void set_RANGE(t_param _value) { + m_RANGE_30 = (_value < 1 ? 1 : (_value > 10 ? 10 : _value)); + }; + inline void set_reverse(t_param _value) { + m_reverse_31 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value)); + }; + inline void set_Filter_R(t_param _value) { + m_Filter_R_32 = (_value < -100 ? -100 : (_value > 100 ? 100 : _value)); + }; + inline void set_BPM(t_param _value) { + m_BPM_33 = (_value < 20 ? 20 : (_value > 240 ? 240 : _value)); + }; + +} State; + + +/// +/// Configuration for the genlib API +/// + +/// Number of signal inputs and outputs + +int gen_kernel_numins = 2; +int gen_kernel_numouts = 2; + +int num_inputs() { return gen_kernel_numins; } +int num_outputs() { return gen_kernel_numouts; } +int num_params() { return 15; } + +/// Assistive lables for the signal inputs and outputs + +const char *gen_kernel_innames[] = { "in1", "in2" }; +const char *gen_kernel_outnames[] = { "out1", "out2" }; + +/// Invoke the signal process of a State object + +int perform(CommonState *cself, t_sample **ins, long numins, t_sample **outs, long numouts, long n) { + State* self = (State *)cself; + return self->perform(ins, outs, n); +} + +/// Reset all parameters and stateful operators of a State object + +void reset(CommonState *cself) { + State* self = (State *)cself; + self->reset(cself->sr, cself->vs); +} + +/// Set a parameter of a State object + +void setparameter(CommonState *cself, long index, t_param value, void *ref) { + State *self = (State *)cself; + switch (index) { + case 0: self->set_BPM(value); break; + case 1: self->set_DOUBLE(value); break; + case 2: self->set_Div_L(value); break; + case 3: self->set_Div_R(value); break; + case 4: self->set_ENV_ms(value); break; + case 5: self->set_Filter_R(value); break; + case 6: self->set_LEFT(ref); break; + case 7: self->set_RANDOM(value); break; + case 8: self->set_RANGE(value); break; + case 9: self->set_RIGHT(ref); break; + case 10: self->set_Tail(value); break; + case 11: self->set_dry_wet(value); break; + case 12: self->set_reverse(value); break; + case 13: self->set_speed(value); break; + case 14: self->set_ztutter(value); break; + + default: break; + } +} + +/// Get the value of a parameter of a State object + +void getparameter(CommonState *cself, long index, t_param *value) { + State *self = (State *)cself; + switch (index) { + case 0: *value = self->m_BPM_33; break; + case 1: *value = self->m_DOUBLE_26; break; + case 2: *value = self->m_Div_L_24; break; + case 3: *value = self->m_Div_R_28; break; + case 4: *value = self->m_ENV_ms_22; break; + case 5: *value = self->m_Filter_R_32; break; + + case 7: *value = self->m_RANDOM_21; break; + case 8: *value = self->m_RANGE_30; break; + + case 10: *value = self->m_Tail_23; break; + case 11: *value = self->m_dry_wet_27; break; + case 12: *value = self->m_reverse_31; break; + case 13: *value = self->m_speed_25; break; + case 14: *value = self->m_ztutter_29; break; + + default: break; + } +} + +/// Get the name of a parameter of a State object + +const char *getparametername(CommonState *cself, long index) { + if (index >= 0 && index < cself->numparams) { + return cself->params[index].name; + } + return 0; +} + +/// Get the minimum value of a parameter of a State object + +t_param getparametermin(CommonState *cself, long index) { + if (index >= 0 && index < cself->numparams) { + return cself->params[index].outputmin; + } + return 0; +} + +/// Get the maximum value of a parameter of a State object + +t_param getparametermax(CommonState *cself, long index) { + if (index >= 0 && index < cself->numparams) { + return cself->params[index].outputmax; + } + return 0; +} + +/// Get parameter of a State object has a minimum and maximum value + +char getparameterhasminmax(CommonState *cself, long index) { + if (index >= 0 && index < cself->numparams) { + return cself->params[index].hasminmax; + } + return 0; +} + +/// Get the units of a parameter of a State object + +const char *getparameterunits(CommonState *cself, long index) { + if (index >= 0 && index < cself->numparams) { + return cself->params[index].units; + } + return 0; +} + +/// Get the size of the state of all parameters of a State object + +size_t getstatesize(CommonState *cself) { + return genlib_getstatesize(cself, &getparameter); +} + +/// Get the state of all parameters of a State object + +short getstate(CommonState *cself, char *state) { + return genlib_getstate(cself, state, &getparameter); +} + +/// set the state of all parameters of a State object + +short setstate(CommonState *cself, const char *state) { + return genlib_setstate(cself, state, &setparameter); +} + +/// Allocate and configure a new State object and it's internal CommonState: + +void *create(t_param sr, long vs) { + State *self = new State; + self->reset(sr, vs); + ParamInfo *pi; + self->__commonstate.inputnames = gen_kernel_innames; + self->__commonstate.outputnames = gen_kernel_outnames; + self->__commonstate.numins = gen_kernel_numins; + self->__commonstate.numouts = gen_kernel_numouts; + self->__commonstate.sr = sr; + self->__commonstate.vs = vs; + self->__commonstate.params = (ParamInfo *)genlib_sysmem_newptr(15 * sizeof(ParamInfo)); + self->__commonstate.numparams = 15; + // initialize parameter 0 ("m_BPM_33") + pi = self->__commonstate.params + 0; + pi->name = "BPM"; + pi->paramtype = GENLIB_PARAMTYPE_FLOAT; + pi->defaultvalue = self->m_BPM_33; + pi->defaultref = 0; + pi->hasinputminmax = false; + pi->inputmin = 0; + pi->inputmax = 1; + pi->hasminmax = true; + pi->outputmin = 20; + pi->outputmax = 240; + pi->exp = 0; + pi->units = ""; // no units defined + // initialize parameter 1 ("m_DOUBLE_26") + pi = self->__commonstate.params + 1; + pi->name = "DOUBLE"; + pi->paramtype = GENLIB_PARAMTYPE_FLOAT; + pi->defaultvalue = self->m_DOUBLE_26; + pi->defaultref = 0; + pi->hasinputminmax = false; + pi->inputmin = 0; + pi->inputmax = 1; + pi->hasminmax = true; + pi->outputmin = 0; + pi->outputmax = 1; + pi->exp = 0; + pi->units = ""; // no units defined + // initialize parameter 2 ("m_Div_L_24") + pi = self->__commonstate.params + 2; + pi->name = "Div_L"; + pi->paramtype = GENLIB_PARAMTYPE_FLOAT; + pi->defaultvalue = self->m_Div_L_24; + pi->defaultref = 0; + pi->hasinputminmax = false; + pi->inputmin = 0; + pi->inputmax = 1; + pi->hasminmax = true; + pi->outputmin = 1; + pi->outputmax = 10; + pi->exp = 0; + pi->units = ""; // no units defined + // initialize parameter 3 ("m_Div_R_28") + pi = self->__commonstate.params + 3; + pi->name = "Div_R"; + pi->paramtype = GENLIB_PARAMTYPE_FLOAT; + pi->defaultvalue = self->m_Div_R_28; + pi->defaultref = 0; + pi->hasinputminmax = false; + pi->inputmin = 0; + pi->inputmax = 1; + pi->hasminmax = true; + pi->outputmin = 1; + pi->outputmax = 10; + pi->exp = 0; + pi->units = ""; // no units defined + // initialize parameter 4 ("m_ENV_ms_22") + pi = self->__commonstate.params + 4; + pi->name = "ENV_ms"; + pi->paramtype = GENLIB_PARAMTYPE_FLOAT; + pi->defaultvalue = self->m_ENV_ms_22; + pi->defaultref = 0; + pi->hasinputminmax = false; + pi->inputmin = 0; + pi->inputmax = 1; + pi->hasminmax = true; + pi->outputmin = 0; + pi->outputmax = 3000; + pi->exp = 0; + pi->units = ""; // no units defined + // initialize parameter 5 ("m_Filter_R_32") + pi = self->__commonstate.params + 5; + pi->name = "Filter_R"; + pi->paramtype = GENLIB_PARAMTYPE_FLOAT; + pi->defaultvalue = self->m_Filter_R_32; + pi->defaultref = 0; + pi->hasinputminmax = false; + pi->inputmin = 0; + pi->inputmax = 1; + pi->hasminmax = true; + pi->outputmin = -100; + pi->outputmax = 100; + pi->exp = 0; + pi->units = ""; // no units defined + // initialize parameter 6 ("m_LEFT_17") + pi = self->__commonstate.params + 6; + pi->name = "LEFT"; + pi->paramtype = GENLIB_PARAMTYPE_SYM; + pi->defaultvalue = 0.; + pi->defaultref = 0; + pi->hasinputminmax = false; + pi->inputmin = 0; + pi->inputmax = 1; + pi->hasminmax = false; + pi->outputmin = 0; + pi->outputmax = 1; + pi->exp = 0; + pi->units = ""; // no units defined + // initialize parameter 7 ("m_RANDOM_21") + pi = self->__commonstate.params + 7; + pi->name = "RANDOM"; + pi->paramtype = GENLIB_PARAMTYPE_FLOAT; + pi->defaultvalue = self->m_RANDOM_21; + pi->defaultref = 0; + pi->hasinputminmax = false; + pi->inputmin = 0; + pi->inputmax = 1; + pi->hasminmax = true; + pi->outputmin = 0; + pi->outputmax = 1; + pi->exp = 0; + pi->units = ""; // no units defined + // initialize parameter 8 ("m_RANGE_30") + pi = self->__commonstate.params + 8; + pi->name = "RANGE"; + pi->paramtype = GENLIB_PARAMTYPE_FLOAT; + pi->defaultvalue = self->m_RANGE_30; + pi->defaultref = 0; + pi->hasinputminmax = false; + pi->inputmin = 0; + pi->inputmax = 1; + pi->hasminmax = true; + pi->outputmin = 1; + pi->outputmax = 10; + pi->exp = 0; + pi->units = ""; // no units defined + // initialize parameter 9 ("m_RIGHT_11") + pi = self->__commonstate.params + 9; + pi->name = "RIGHT"; + pi->paramtype = GENLIB_PARAMTYPE_SYM; + pi->defaultvalue = 0.; + pi->defaultref = 0; + pi->hasinputminmax = false; + pi->inputmin = 0; + pi->inputmax = 1; + pi->hasminmax = false; + pi->outputmin = 0; + pi->outputmax = 1; + pi->exp = 0; + pi->units = ""; // no units defined + // initialize parameter 10 ("m_Tail_23") + pi = self->__commonstate.params + 10; + pi->name = "Tail"; + pi->paramtype = GENLIB_PARAMTYPE_FLOAT; + pi->defaultvalue = self->m_Tail_23; + pi->defaultref = 0; + pi->hasinputminmax = false; + pi->inputmin = 0; + pi->inputmax = 1; + pi->hasminmax = true; + pi->outputmin = 0; + pi->outputmax = 1; + pi->exp = 0; + pi->units = ""; // no units defined + // initialize parameter 11 ("m_dry_wet_27") + pi = self->__commonstate.params + 11; + pi->name = "dry_wet"; + pi->paramtype = GENLIB_PARAMTYPE_FLOAT; + pi->defaultvalue = self->m_dry_wet_27; + pi->defaultref = 0; + pi->hasinputminmax = false; + pi->inputmin = 0; + pi->inputmax = 1; + pi->hasminmax = true; + pi->outputmin = 0; + pi->outputmax = 1; + pi->exp = 0; + pi->units = ""; // no units defined + // initialize parameter 12 ("m_reverse_31") + pi = self->__commonstate.params + 12; + pi->name = "reverse"; + pi->paramtype = GENLIB_PARAMTYPE_FLOAT; + pi->defaultvalue = self->m_reverse_31; + pi->defaultref = 0; + pi->hasinputminmax = false; + pi->inputmin = 0; + pi->inputmax = 1; + pi->hasminmax = true; + pi->outputmin = 0; + pi->outputmax = 1; + pi->exp = 0; + pi->units = ""; // no units defined + // initialize parameter 13 ("m_speed_25") + pi = self->__commonstate.params + 13; + pi->name = "speed"; + pi->paramtype = GENLIB_PARAMTYPE_FLOAT; + pi->defaultvalue = self->m_speed_25; + pi->defaultref = 0; + pi->hasinputminmax = false; + pi->inputmin = 0; + pi->inputmax = 1; + pi->hasminmax = true; + pi->outputmin = 0.01; + pi->outputmax = 23; + pi->exp = 0; + pi->units = ""; // no units defined + // initialize parameter 14 ("m_ztutter_29") + pi = self->__commonstate.params + 14; + pi->name = "ztutter"; + pi->paramtype = GENLIB_PARAMTYPE_FLOAT; + pi->defaultvalue = self->m_ztutter_29; + pi->defaultref = 0; + pi->hasinputminmax = false; + pi->inputmin = 0; + pi->inputmax = 1; + pi->hasminmax = true; + pi->outputmin = 0; + pi->outputmax = 1; + pi->exp = 0; + pi->units = ""; // no units defined + + return self; +} + +/// Release all resources and memory used by a State object: + +void destroy(CommonState *cself) { + State *self = (State *)cself; + genlib_sysmem_freeptr(cself->params); + + delete self; +} + + +} // gen_exported:: diff --git a/plugins/zwabo-stuttter/gen_exported.h b/plugins/zwabo-stuttter/gen_exported.h new file mode 100644 index 0000000..231d733 --- /dev/null +++ b/plugins/zwabo-stuttter/gen_exported.h @@ -0,0 +1,49 @@ +/******************************************************************************************************************* +Cycling '74 License for Max-Generated Code for Export +Copyright (c) 2016 Cycling '74 +The code that Max generates automatically and that end users are capable of exporting and using, and any + associated documentation files (the “Software”) is a work of authorship for which Cycling '74 is the author + and owner for copyright purposes. A license is hereby granted, free of charge, to any person obtaining a + copy of the Software (“Licensee”) to use, copy, modify, merge, publish, and distribute copies of the Software, + and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +The Software is licensed to Licensee only for non-commercial use. Users who wish to make commercial use of the + Software must contact the copyright owner to determine if a license for commercial use is available, and the + terms and conditions for same, which may include fees or royalties. For commercial use, please send inquiries + to licensing (at) cycling74.com. The determination of whether a use is commercial use or non-commercial use is based + upon the use, not the user. The Software may be used by individuals, institutions, governments, corporations, or + other business whether for-profit or non-profit so long as the use itself is not a commercialization of the + materials or a use that generates or is intended to generate income, revenue, sales or profit. +The above copyright notice and this license shall be included in all copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO + THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*******************************************************************************************************************/ + + +#include "genlib.h" +#include "genlib_exportfunctions.h" +#include "genlib_ops.h" + +namespace gen_exported { + +int num_inputs(); +int num_outputs(); +int num_params(); +int perform(CommonState *cself, t_sample **ins, long numins, t_sample **outs, long numouts, long n); +void reset(CommonState *cself); +void setparameter(CommonState *cself, long index, t_param value, void *ref); +void getparameter(CommonState *cself, long index, t_param *value); +const char *getparametername(CommonState *cself, long index); +t_param getparametermin(CommonState *cself, long index); +t_param getparametermax(CommonState *cself, long index); +char getparameterhasminmax(CommonState *cself, long index); +const char *getparameterunits(CommonState *cself, long index); +size_t getstatesize(CommonState *cself); +short getstate(CommonState *cself, char *state); +short setstate(CommonState *cself, const char *state); +void *create(t_param sr, long vs); +void destroy(CommonState *cself); + +} // gen_exported:: diff --git a/plugins/zwabo-toggle_2in/DistrhoPluginInfo.h b/plugins/zwabo-toggle_2in/DistrhoPluginInfo.h new file mode 100644 index 0000000..c4a2b74 --- /dev/null +++ b/plugins/zwabo-toggle_2in/DistrhoPluginInfo.h @@ -0,0 +1,34 @@ +/* + * DPF Max Gen + * Copyright (C) 2015-2023 Filipe Coelho + * + * Permission to use, copy, modify, and/or distribute this software for any purpose with + * or without fee is hereby granted, provided that the above copyright notice and this + * permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD + * TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER + * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#pragma once + +#define DISTRHO_PLUGIN_BRAND "zwabo" +#define DISTRHO_PLUGIN_NAME "Toggle_2IN" +#define DISTRHO_PLUGIN_URI "urn:maxgen:zwabo:toggle_2in" +#define DISTRHO_PLUGIN_CLAP_ID "maxgen.zwabo.toggle_2in" + +#define DISTRHO_PLUGIN_HAS_UI 0 +#define DISTRHO_PLUGIN_IS_RT_SAFE 1 +#define DISTRHO_PLUGIN_NUM_INPUTS 2 +#define DISTRHO_PLUGIN_NUM_OUTPUTS 1 + +#define DISTRHO_PLUGIN_CLAP_FEATURES "audio-effect", "routing", "mono" +#define DISTRHO_PLUGIN_LV2_CATEGORY "lv2:UtilityPlugin" +#define DISTRHO_PLUGIN_VST3_CATEGORIES "Fx|Utility" + +#define DISTRHO_PLUGIN_UNIQUE_ID d_cconst('z', 'w', 't', '2') +#define DISTRHO_PLUGIN_VERSION d_version(0, 0, 0) diff --git a/plugins/zwabo-toggle_2in/README.md b/plugins/zwabo-toggle_2in/README.md new file mode 100644 index 0000000..38ee61c --- /dev/null +++ b/plugins/zwabo-toggle_2in/README.md @@ -0,0 +1,20 @@ +# Toggle_2IN +.lv2 plugin utility for Mod / Toggle switch + +Same as the MOD switchbox plugin but switch possible with CV + +A slight smoothing is implemented in order to avoid scale effects. + +---- + +Mod devices installation + +- Copy the zwabo-toggle_2in.lv2 folder to your Mod: + +``` +scp -rp root@192.168.51.1:/root/.lv2 +``` + +- Enter password "mod" + +- Reboot Mod diff --git a/plugins/zwabo-toggle_2in/gen_exported.cpp b/plugins/zwabo-toggle_2in/gen_exported.cpp new file mode 100644 index 0000000..54ae4e4 --- /dev/null +++ b/plugins/zwabo-toggle_2in/gen_exported.cpp @@ -0,0 +1,269 @@ +#include "gen_exported.h" + +namespace gen_exported { + +/******************************************************************************************************************* +Cycling '74 License for Max-Generated Code for Export +Copyright (c) 2016 Cycling '74 +The code that Max generates automatically and that end users are capable of exporting and using, and any + associated documentation files (the “Software”) is a work of authorship for which Cycling '74 is the author + and owner for copyright purposes. A license is hereby granted, free of charge, to any person obtaining a + copy of the Software (“Licensee”) to use, copy, modify, merge, publish, and distribute copies of the Software, + and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +The Software is licensed to Licensee only for non-commercial use. Users who wish to make commercial use of the + Software must contact the copyright owner to determine if a license for commercial use is available, and the + terms and conditions for same, which may include fees or royalties. For commercial use, please send inquiries + to licensing (at) cycling74.com. The determination of whether a use is commercial use or non-commercial use is based + upon the use, not the user. The Software may be used by individuals, institutions, governments, corporations, or + other business whether for-profit or non-profit so long as the use itself is not a commercialization of the + materials or a use that generates or is intended to generate income, revenue, sales or profit. +The above copyright notice and this license shall be included in all copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO + THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*******************************************************************************************************************/ + +// global noise generator +Noise noise; +static const int GENLIB_LOOPCOUNT_BAIL = 100000; + + +// The State struct contains all the state and procedures for the gendsp kernel +typedef struct State { + CommonState __commonstate; + Change __m_change_5; + int vectorsize; + int __exception; + t_sample m_prev_4; + t_sample samplerate; + t_sample m_diff_3; + t_sample m_val_2; + t_sample m_Toggle_1; + // re-initialize all member variables; + inline void reset(t_param __sr, int __vs) { + __exception = 0; + vectorsize = __vs; + samplerate = __sr; + m_Toggle_1 = 0; + m_val_2 = ((int)0); + m_diff_3 = ((int)0); + m_prev_4 = ((int)0); + __m_change_5.reset(0); + genlib_reset_complete(this); + + }; + // the signal processing routine; + inline int perform(t_sample ** __ins, t_sample ** __outs, int __n) { + vectorsize = __n; + const t_sample * __in1 = __ins[0]; + const t_sample * __in2 = __ins[1]; + t_sample * __out1 = __outs[0]; + if (__exception) { + return __exception; + + } else if (( (__in1 == 0) || (__in2 == 0) || (__out1 == 0) )) { + __exception = GENLIB_ERR_NULL_BUFFER; + return __exception; + + }; + t_sample rsr = safediv(((int)50), (((int)1000) * (samplerate * 0.001))); + // the main sample loop; + while ((__n--)) { + const t_sample in1 = (*(__in1++)); + const t_sample in2 = (*(__in2++)); + t_sample expr_58 = ramp0_d_d(m_Toggle_1, rsr); + t_sample mix_64 = (in1 + (expr_58 * (in2 - in1))); + t_sample out1 = mix_64; + // assign results to output buffer; + (*(__out1++)) = out1; + + }; + return __exception; + + }; + inline void set_Toggle(t_param _value) { + m_Toggle_1 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value)); + }; + inline t_sample ramp0_d_d(t_sample in1, t_sample rsr) { + if ((__m_change_5(in1) != ((int)0))) { + m_diff_3 = ((in1 - m_prev_4) * rsr); + m_prev_4 = in1; + + }; + if ((((m_diff_3 > ((int)0)) && (m_val_2 > m_prev_4)) || ((m_diff_3 < ((int)0)) && (m_val_2 < m_prev_4)))) { + m_val_2 = in1; + m_diff_3 = ((int)0); + + } else { + m_val_2 = (m_val_2 + m_diff_3); + + }; + return m_val_2; + + }; + +} State; + + +/// +/// Configuration for the genlib API +/// + +/// Number of signal inputs and outputs + +int gen_kernel_numins = 2; +int gen_kernel_numouts = 1; + +int num_inputs() { return gen_kernel_numins; } +int num_outputs() { return gen_kernel_numouts; } +int num_params() { return 1; } + +/// Assistive lables for the signal inputs and outputs + +const char *gen_kernel_innames[] = { "in1", "in2" }; +const char *gen_kernel_outnames[] = { "out1" }; + +/// Invoke the signal process of a State object + +int perform(CommonState *cself, t_sample **ins, long numins, t_sample **outs, long numouts, long n) { + State* self = (State *)cself; + return self->perform(ins, outs, n); +} + +/// Reset all parameters and stateful operators of a State object + +void reset(CommonState *cself) { + State* self = (State *)cself; + self->reset(cself->sr, cself->vs); +} + +/// Set a parameter of a State object + +void setparameter(CommonState *cself, long index, t_param value, void *ref) { + State *self = (State *)cself; + switch (index) { + case 0: self->set_Toggle(value); break; + + default: break; + } +} + +/// Get the value of a parameter of a State object + +void getparameter(CommonState *cself, long index, t_param *value) { + State *self = (State *)cself; + switch (index) { + case 0: *value = self->m_Toggle_1; break; + + default: break; + } +} + +/// Get the name of a parameter of a State object + +const char *getparametername(CommonState *cself, long index) { + if (index >= 0 && index < cself->numparams) { + return cself->params[index].name; + } + return 0; +} + +/// Get the minimum value of a parameter of a State object + +t_param getparametermin(CommonState *cself, long index) { + if (index >= 0 && index < cself->numparams) { + return cself->params[index].outputmin; + } + return 0; +} + +/// Get the maximum value of a parameter of a State object + +t_param getparametermax(CommonState *cself, long index) { + if (index >= 0 && index < cself->numparams) { + return cself->params[index].outputmax; + } + return 0; +} + +/// Get parameter of a State object has a minimum and maximum value + +char getparameterhasminmax(CommonState *cself, long index) { + if (index >= 0 && index < cself->numparams) { + return cself->params[index].hasminmax; + } + return 0; +} + +/// Get the units of a parameter of a State object + +const char *getparameterunits(CommonState *cself, long index) { + if (index >= 0 && index < cself->numparams) { + return cself->params[index].units; + } + return 0; +} + +/// Get the size of the state of all parameters of a State object + +size_t getstatesize(CommonState *cself) { + return genlib_getstatesize(cself, &getparameter); +} + +/// Get the state of all parameters of a State object + +short getstate(CommonState *cself, char *state) { + return genlib_getstate(cself, state, &getparameter); +} + +/// set the state of all parameters of a State object + +short setstate(CommonState *cself, const char *state) { + return genlib_setstate(cself, state, &setparameter); +} + +/// Allocate and configure a new State object and it's internal CommonState: + +void *create(t_param sr, long vs) { + State *self = new State; + self->reset(sr, vs); + ParamInfo *pi; + self->__commonstate.inputnames = gen_kernel_innames; + self->__commonstate.outputnames = gen_kernel_outnames; + self->__commonstate.numins = gen_kernel_numins; + self->__commonstate.numouts = gen_kernel_numouts; + self->__commonstate.sr = sr; + self->__commonstate.vs = vs; + self->__commonstate.params = (ParamInfo *)genlib_sysmem_newptr(1 * sizeof(ParamInfo)); + self->__commonstate.numparams = 1; + // initialize parameter 0 ("m_Toggle_1") + pi = self->__commonstate.params + 0; + pi->name = "Toggle"; + pi->paramtype = GENLIB_PARAMTYPE_FLOAT; + pi->defaultvalue = self->m_Toggle_1; + pi->defaultref = 0; + pi->hasinputminmax = false; + pi->inputmin = 0; + pi->inputmax = 1; + pi->hasminmax = true; + pi->outputmin = 0; + pi->outputmax = 1; + pi->exp = 0; + pi->units = ""; // no units defined + + return self; +} + +/// Release all resources and memory used by a State object: + +void destroy(CommonState *cself) { + State *self = (State *)cself; + genlib_sysmem_freeptr(cself->params); + + delete self; +} + + +} // gen_exported:: diff --git a/plugins/zwabo-toggle_2in/gen_exported.h b/plugins/zwabo-toggle_2in/gen_exported.h new file mode 100644 index 0000000..231d733 --- /dev/null +++ b/plugins/zwabo-toggle_2in/gen_exported.h @@ -0,0 +1,49 @@ +/******************************************************************************************************************* +Cycling '74 License for Max-Generated Code for Export +Copyright (c) 2016 Cycling '74 +The code that Max generates automatically and that end users are capable of exporting and using, and any + associated documentation files (the “Software”) is a work of authorship for which Cycling '74 is the author + and owner for copyright purposes. A license is hereby granted, free of charge, to any person obtaining a + copy of the Software (“Licensee”) to use, copy, modify, merge, publish, and distribute copies of the Software, + and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +The Software is licensed to Licensee only for non-commercial use. Users who wish to make commercial use of the + Software must contact the copyright owner to determine if a license for commercial use is available, and the + terms and conditions for same, which may include fees or royalties. For commercial use, please send inquiries + to licensing (at) cycling74.com. The determination of whether a use is commercial use or non-commercial use is based + upon the use, not the user. The Software may be used by individuals, institutions, governments, corporations, or + other business whether for-profit or non-profit so long as the use itself is not a commercialization of the + materials or a use that generates or is intended to generate income, revenue, sales or profit. +The above copyright notice and this license shall be included in all copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO + THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*******************************************************************************************************************/ + + +#include "genlib.h" +#include "genlib_exportfunctions.h" +#include "genlib_ops.h" + +namespace gen_exported { + +int num_inputs(); +int num_outputs(); +int num_params(); +int perform(CommonState *cself, t_sample **ins, long numins, t_sample **outs, long numouts, long n); +void reset(CommonState *cself); +void setparameter(CommonState *cself, long index, t_param value, void *ref); +void getparameter(CommonState *cself, long index, t_param *value); +const char *getparametername(CommonState *cself, long index); +t_param getparametermin(CommonState *cself, long index); +t_param getparametermax(CommonState *cself, long index); +char getparameterhasminmax(CommonState *cself, long index); +const char *getparameterunits(CommonState *cself, long index); +size_t getstatesize(CommonState *cself); +short getstate(CommonState *cself, char *state); +short setstate(CommonState *cself, const char *state); +void *create(t_param sr, long vs); +void destroy(CommonState *cself); + +} // gen_exported:: diff --git a/plugins/zwabo-xfade1to2st/DistrhoPluginInfo.h b/plugins/zwabo-xfade1to2st/DistrhoPluginInfo.h new file mode 100644 index 0000000..63184fc --- /dev/null +++ b/plugins/zwabo-xfade1to2st/DistrhoPluginInfo.h @@ -0,0 +1,34 @@ +/* + * DPF Max Gen + * Copyright (C) 2015-2023 Filipe Coelho + * + * Permission to use, copy, modify, and/or distribute this software for any purpose with + * or without fee is hereby granted, provided that the above copyright notice and this + * permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD + * TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER + * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#pragma once + +#define DISTRHO_PLUGIN_BRAND "zwabo" +#define DISTRHO_PLUGIN_NAME "Xfade1to2st" +#define DISTRHO_PLUGIN_URI "urn:maxgen:zwabo:xfade1to2st" +#define DISTRHO_PLUGIN_CLAP_ID "maxgen.zwabo.xfade1to2st" + +#define DISTRHO_PLUGIN_HAS_UI 0 +#define DISTRHO_PLUGIN_IS_RT_SAFE 1 +#define DISTRHO_PLUGIN_NUM_INPUTS 2 +#define DISTRHO_PLUGIN_NUM_OUTPUTS 4 + +#define DISTRHO_PLUGIN_CLAP_FEATURES "audio-effect", "routing", "stereo" +#define DISTRHO_PLUGIN_LV2_CATEGORY "lv2:UtilityPlugin" +#define DISTRHO_PLUGIN_VST3_CATEGORIES "Fx|Utility" + +#define DISTRHO_PLUGIN_UNIQUE_ID d_cconst('z', 'w', 'x', 'f') +#define DISTRHO_PLUGIN_VERSION d_version(0, 0, 0) diff --git a/plugins/zwabo-xfade1to2st/README.md b/plugins/zwabo-xfade1to2st/README.md new file mode 100644 index 0000000..e4c9ccd --- /dev/null +++ b/plugins/zwabo-xfade1to2st/README.md @@ -0,0 +1,25 @@ +# Xfade1to2st +## lv2 plugin utility , crossfade L R input to 2 L R outputs + +Two parameters. + +MIX: +- mix the input to the two outputs + +RANGE : +- at 0 , when mix is in the middle position, the output gain is 0.5 x the input gain for each output. +- at 1, when mix is in the middle position, the output gain is 1x the input gain for each output. You can choose in between according to your needs. + +A slight smoothing is implemented in order to avoid scale effects. + +-------------------------- + +Mod devices installation + +• Copy the zwabo-xfade1to2st.lv2 folder to your Mod: +``` +scp -rp root@192.168.51.1:/root/.lv2 +``` +• Enter password "mod" + +• Reboot Mod diff --git a/plugins/zwabo-xfade1to2st/gen_exported.cpp b/plugins/zwabo-xfade1to2st/gen_exported.cpp new file mode 100644 index 0000000..68a731d --- /dev/null +++ b/plugins/zwabo-xfade1to2st/gen_exported.cpp @@ -0,0 +1,296 @@ +#include "gen_exported.h" + +namespace gen_exported { + +/******************************************************************************************************************* +Cycling '74 License for Max-Generated Code for Export +Copyright (c) 2016 Cycling '74 +The code that Max generates automatically and that end users are capable of exporting and using, and any + associated documentation files (the “Software”) is a work of authorship for which Cycling '74 is the author + and owner for copyright purposes. A license is hereby granted, free of charge, to any person obtaining a + copy of the Software (“Licensee”) to use, copy, modify, merge, publish, and distribute copies of the Software, + and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +The Software is licensed to Licensee only for non-commercial use. Users who wish to make commercial use of the + Software must contact the copyright owner to determine if a license for commercial use is available, and the + terms and conditions for same, which may include fees or royalties. For commercial use, please send inquiries + to licensing (at) cycling74.com. The determination of whether a use is commercial use or non-commercial use is based + upon the use, not the user. The Software may be used by individuals, institutions, governments, corporations, or + other business whether for-profit or non-profit so long as the use itself is not a commercialization of the + materials or a use that generates or is intended to generate income, revenue, sales or profit. +The above copyright notice and this license shall be included in all copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO + THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*******************************************************************************************************************/ + +// global noise generator +Noise noise; +static const int GENLIB_LOOPCOUNT_BAIL = 100000; + + +// The State struct contains all the state and procedures for the gendsp kernel +typedef struct State { + CommonState __commonstate; + int __exception; + int vectorsize; + t_sample m_RANGE_1; + t_sample samplerate; + t_sample m_MIX_2; + t_sample m_prev_3; + // re-initialize all member variables; + inline void reset(t_param __sr, int __vs) { + __exception = 0; + vectorsize = __vs; + samplerate = __sr; + m_RANGE_1 = 0.5; + m_MIX_2 = 0; + m_prev_3 = ((int)0); + genlib_reset_complete(this); + + }; + // the signal processing routine; + inline int perform(t_sample ** __ins, t_sample ** __outs, int __n) { + vectorsize = __n; + const t_sample * __in1 = __ins[0]; + const t_sample * __in2 = __ins[1]; + t_sample * __out1 = __outs[0]; + t_sample * __out2 = __outs[1]; + t_sample * __out3 = __outs[2]; + t_sample * __out4 = __outs[3]; + if (__exception) { + return __exception; + + } else if (( (__in1 == 0) || (__in2 == 0) || (__out1 == 0) || (__out2 == 0) || (__out3 == 0) || (__out4 == 0) )) { + __exception = GENLIB_ERR_NULL_BUFFER; + return __exception; + + }; + t_sample sub_100 = (m_RANGE_1 - ((t_sample)0.5)); + t_sample scale_97 = ((safepow((sub_100 * ((t_sample)2)), ((int)1)) * ((t_sample)0.5)) + ((int)0)); + t_sample sub_104 = (m_RANGE_1 - ((t_sample)0.5)); + t_sample scale_101 = ((safepow((sub_104 * ((t_sample)2)), ((int)1)) * ((t_sample)-0.5)) + ((int)1)); + t_sample rsr = safediv(((int)50), (((int)1000) * (samplerate * 0.001))); + t_sample irange_106 = (((int)1) - scale_97); + t_sample irange_110 = (scale_101 - ((int)0)); + // the main sample loop; + while ((__n--)) { + const t_sample in1 = (*(__in1++)); + const t_sample in2 = (*(__in2++)); + t_sample expr_31 = smooth0_d_d(m_MIX_2, rsr); + t_sample sub_108 = (expr_31 - scale_97); + t_sample scale_105 = ((safepow(safediv(sub_108, irange_106), ((int)1)) * ((int)-1)) + ((int)1)); + t_sample min_42 = ((((int)1) < scale_105) ? ((int)1) : scale_105); + t_sample mul_46 = (in1 * min_42); + t_sample out1 = mul_46; + t_sample mul_44 = (in2 * min_42); + t_sample out2 = mul_44; + t_sample sub_112 = (expr_31 - ((int)0)); + t_sample scale_109 = ((safepow(safediv(sub_112, irange_110), ((int)1)) * ((int)1)) + ((int)0)); + t_sample min_45 = ((((int)1) < scale_109) ? ((int)1) : scale_109); + t_sample mul_25 = (in1 * min_45); + t_sample out3 = mul_25; + t_sample mul_24 = (in2 * min_45); + t_sample out4 = mul_24; + // assign results to output buffer; + (*(__out1++)) = out1; + (*(__out2++)) = out2; + (*(__out3++)) = out3; + (*(__out4++)) = out4; + + }; + return __exception; + + }; + inline void set_RANGE(t_param _value) { + m_RANGE_1 = (_value < 0.5 ? 0.5 : (_value > 1 ? 1 : _value)); + }; + inline void set_MIX(t_param _value) { + m_MIX_2 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value)); + }; + inline t_sample smooth0_d_d(t_sample in1, t_sample incr) { + m_prev_3 = (m_prev_3 + (incr * (in1 - m_prev_3))); + return m_prev_3; + + }; + +} State; + + +/// +/// Configuration for the genlib API +/// + +/// Number of signal inputs and outputs + +int gen_kernel_numins = 2; +int gen_kernel_numouts = 4; + +int num_inputs() { return gen_kernel_numins; } +int num_outputs() { return gen_kernel_numouts; } +int num_params() { return 2; } + +/// Assistive lables for the signal inputs and outputs + +const char *gen_kernel_innames[] = { "in1", "in2" }; +const char *gen_kernel_outnames[] = { "out1", "out2", "out3", "out4" }; + +/// Invoke the signal process of a State object + +int perform(CommonState *cself, t_sample **ins, long numins, t_sample **outs, long numouts, long n) { + State* self = (State *)cself; + return self->perform(ins, outs, n); +} + +/// Reset all parameters and stateful operators of a State object + +void reset(CommonState *cself) { + State* self = (State *)cself; + self->reset(cself->sr, cself->vs); +} + +/// Set a parameter of a State object + +void setparameter(CommonState *cself, long index, t_param value, void *ref) { + State *self = (State *)cself; + switch (index) { + case 0: self->set_MIX(value); break; + case 1: self->set_RANGE(value); break; + + default: break; + } +} + +/// Get the value of a parameter of a State object + +void getparameter(CommonState *cself, long index, t_param *value) { + State *self = (State *)cself; + switch (index) { + case 0: *value = self->m_MIX_2; break; + case 1: *value = self->m_RANGE_1; break; + + default: break; + } +} + +/// Get the name of a parameter of a State object + +const char *getparametername(CommonState *cself, long index) { + if (index >= 0 && index < cself->numparams) { + return cself->params[index].name; + } + return 0; +} + +/// Get the minimum value of a parameter of a State object + +t_param getparametermin(CommonState *cself, long index) { + if (index >= 0 && index < cself->numparams) { + return cself->params[index].outputmin; + } + return 0; +} + +/// Get the maximum value of a parameter of a State object + +t_param getparametermax(CommonState *cself, long index) { + if (index >= 0 && index < cself->numparams) { + return cself->params[index].outputmax; + } + return 0; +} + +/// Get parameter of a State object has a minimum and maximum value + +char getparameterhasminmax(CommonState *cself, long index) { + if (index >= 0 && index < cself->numparams) { + return cself->params[index].hasminmax; + } + return 0; +} + +/// Get the units of a parameter of a State object + +const char *getparameterunits(CommonState *cself, long index) { + if (index >= 0 && index < cself->numparams) { + return cself->params[index].units; + } + return 0; +} + +/// Get the size of the state of all parameters of a State object + +size_t getstatesize(CommonState *cself) { + return genlib_getstatesize(cself, &getparameter); +} + +/// Get the state of all parameters of a State object + +short getstate(CommonState *cself, char *state) { + return genlib_getstate(cself, state, &getparameter); +} + +/// set the state of all parameters of a State object + +short setstate(CommonState *cself, const char *state) { + return genlib_setstate(cself, state, &setparameter); +} + +/// Allocate and configure a new State object and it's internal CommonState: + +void *create(t_param sr, long vs) { + State *self = new State; + self->reset(sr, vs); + ParamInfo *pi; + self->__commonstate.inputnames = gen_kernel_innames; + self->__commonstate.outputnames = gen_kernel_outnames; + self->__commonstate.numins = gen_kernel_numins; + self->__commonstate.numouts = gen_kernel_numouts; + self->__commonstate.sr = sr; + self->__commonstate.vs = vs; + self->__commonstate.params = (ParamInfo *)genlib_sysmem_newptr(2 * sizeof(ParamInfo)); + self->__commonstate.numparams = 2; + // initialize parameter 0 ("m_MIX_2") + pi = self->__commonstate.params + 0; + pi->name = "MIX"; + pi->paramtype = GENLIB_PARAMTYPE_FLOAT; + pi->defaultvalue = self->m_MIX_2; + pi->defaultref = 0; + pi->hasinputminmax = false; + pi->inputmin = 0; + pi->inputmax = 1; + pi->hasminmax = true; + pi->outputmin = 0; + pi->outputmax = 1; + pi->exp = 0; + pi->units = ""; // no units defined + // initialize parameter 1 ("m_RANGE_1") + pi = self->__commonstate.params + 1; + pi->name = "RANGE"; + pi->paramtype = GENLIB_PARAMTYPE_FLOAT; + pi->defaultvalue = self->m_RANGE_1; + pi->defaultref = 0; + pi->hasinputminmax = false; + pi->inputmin = 0; + pi->inputmax = 1; + pi->hasminmax = true; + pi->outputmin = 0.5; + pi->outputmax = 1; + pi->exp = 0; + pi->units = ""; // no units defined + + return self; +} + +/// Release all resources and memory used by a State object: + +void destroy(CommonState *cself) { + State *self = (State *)cself; + genlib_sysmem_freeptr(cself->params); + + delete self; +} + + +} // gen_exported:: diff --git a/plugins/zwabo-xfade1to2st/gen_exported.h b/plugins/zwabo-xfade1to2st/gen_exported.h new file mode 100644 index 0000000..231d733 --- /dev/null +++ b/plugins/zwabo-xfade1to2st/gen_exported.h @@ -0,0 +1,49 @@ +/******************************************************************************************************************* +Cycling '74 License for Max-Generated Code for Export +Copyright (c) 2016 Cycling '74 +The code that Max generates automatically and that end users are capable of exporting and using, and any + associated documentation files (the “Software”) is a work of authorship for which Cycling '74 is the author + and owner for copyright purposes. A license is hereby granted, free of charge, to any person obtaining a + copy of the Software (“Licensee”) to use, copy, modify, merge, publish, and distribute copies of the Software, + and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +The Software is licensed to Licensee only for non-commercial use. Users who wish to make commercial use of the + Software must contact the copyright owner to determine if a license for commercial use is available, and the + terms and conditions for same, which may include fees or royalties. For commercial use, please send inquiries + to licensing (at) cycling74.com. The determination of whether a use is commercial use or non-commercial use is based + upon the use, not the user. The Software may be used by individuals, institutions, governments, corporations, or + other business whether for-profit or non-profit so long as the use itself is not a commercialization of the + materials or a use that generates or is intended to generate income, revenue, sales or profit. +The above copyright notice and this license shall be included in all copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO + THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*******************************************************************************************************************/ + + +#include "genlib.h" +#include "genlib_exportfunctions.h" +#include "genlib_ops.h" + +namespace gen_exported { + +int num_inputs(); +int num_outputs(); +int num_params(); +int perform(CommonState *cself, t_sample **ins, long numins, t_sample **outs, long numouts, long n); +void reset(CommonState *cself); +void setparameter(CommonState *cself, long index, t_param value, void *ref); +void getparameter(CommonState *cself, long index, t_param *value); +const char *getparametername(CommonState *cself, long index); +t_param getparametermin(CommonState *cself, long index); +t_param getparametermax(CommonState *cself, long index); +char getparameterhasminmax(CommonState *cself, long index); +const char *getparameterunits(CommonState *cself, long index); +size_t getstatesize(CommonState *cself); +short getstate(CommonState *cself, char *state); +short setstate(CommonState *cself, const char *state); +void *create(t_param sr, long vs); +void destroy(CommonState *cself); + +} // gen_exported:: diff --git a/plugins/zwabo-zinvert_phase/DistrhoPluginInfo.h b/plugins/zwabo-zinvert_phase/DistrhoPluginInfo.h new file mode 100644 index 0000000..b394e11 --- /dev/null +++ b/plugins/zwabo-zinvert_phase/DistrhoPluginInfo.h @@ -0,0 +1,34 @@ +/* + * DPF Max Gen + * Copyright (C) 2015-2023 Filipe Coelho + * + * Permission to use, copy, modify, and/or distribute this software for any purpose with + * or without fee is hereby granted, provided that the above copyright notice and this + * permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD + * TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER + * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#pragma once + +#define DISTRHO_PLUGIN_BRAND "zwabo" +#define DISTRHO_PLUGIN_NAME "Zinvert_phase" +#define DISTRHO_PLUGIN_URI "urn:maxgen:zwabo:zinvert_phase" +#define DISTRHO_PLUGIN_CLAP_ID "maxgen.zwabo.zinvert_phase" + +#define DISTRHO_PLUGIN_HAS_UI 0 +#define DISTRHO_PLUGIN_IS_RT_SAFE 1 +#define DISTRHO_PLUGIN_NUM_INPUTS 1 +#define DISTRHO_PLUGIN_NUM_OUTPUTS 1 + +#define DISTRHO_PLUGIN_CLAP_FEATURES "audio-effect", "mono" +#define DISTRHO_PLUGIN_LV2_CATEGORY "lv2:UtilityPlugin" +#define DISTRHO_PLUGIN_VST3_CATEGORIES "Fx|Utility" + +#define DISTRHO_PLUGIN_UNIQUE_ID d_cconst('z', 'w', 'i', 'p') +#define DISTRHO_PLUGIN_VERSION d_version(0, 0, 0) diff --git a/plugins/zwabo-zinvert_phase/README.md b/plugins/zwabo-zinvert_phase/README.md new file mode 100644 index 0000000..5d164b9 --- /dev/null +++ b/plugins/zwabo-zinvert_phase/README.md @@ -0,0 +1,16 @@ +# Zinvert_phase + +Simple phase inverter. +i.e. useful on stage to avoid feedback with acoustic instrument amplification + +Mod devices installation + +- Copy the zwabo-zinvert_phase.lv2 folder to your Mod: + + ``` + scp -rp root@192.168.51.1:/root/.lv2 + ``` + +- Enter password "mod" + +- Reboot Mod diff --git a/plugins/zwabo-zinvert_phase/gen_exported.cpp b/plugins/zwabo-zinvert_phase/gen_exported.cpp new file mode 100644 index 0000000..492df7b --- /dev/null +++ b/plugins/zwabo-zinvert_phase/gen_exported.cpp @@ -0,0 +1,266 @@ +#include "gen_exported.h" + +namespace gen_exported { + +/******************************************************************************************************************* +Cycling '74 License for Max-Generated Code for Export +Copyright (c) 2016 Cycling '74 +The code that Max generates automatically and that end users are capable of exporting and using, and any + associated documentation files (the “Software”) is a work of authorship for which Cycling '74 is the author + and owner for copyright purposes. A license is hereby granted, free of charge, to any person obtaining a + copy of the Software (“Licensee”) to use, copy, modify, merge, publish, and distribute copies of the Software, + and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +The Software is licensed to Licensee only for non-commercial use. Users who wish to make commercial use of the + Software must contact the copyright owner to determine if a license for commercial use is available, and the + terms and conditions for same, which may include fees or royalties. For commercial use, please send inquiries + to licensing (at) cycling74.com. The determination of whether a use is commercial use or non-commercial use is based + upon the use, not the user. The Software may be used by individuals, institutions, governments, corporations, or + other business whether for-profit or non-profit so long as the use itself is not a commercialization of the + materials or a use that generates or is intended to generate income, revenue, sales or profit. +The above copyright notice and this license shall be included in all copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO + THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*******************************************************************************************************************/ + +// global noise generator +Noise noise; +static const int GENLIB_LOOPCOUNT_BAIL = 100000; + + +// The State struct contains all the state and procedures for the gendsp kernel +typedef struct State { + CommonState __commonstate; + Delta __m_delta_6; + int vectorsize; + int __exception; + t_sample m_increment_1; + t_sample m_target_4; + t_sample samplerate; + t_sample m_current_3; + t_sample m_INVERT_5; + t_sample m_remain_2; + // re-initialize all member variables; + inline void reset(t_param __sr, int __vs) { + __exception = 0; + vectorsize = __vs; + samplerate = __sr; + m_increment_1 = ((int)0); + m_remain_2 = ((int)0); + m_current_3 = ((int)0); + m_target_4 = ((int)0); + m_INVERT_5 = 0; + __m_delta_6.reset(0); + genlib_reset_complete(this); + + }; + // the signal processing routine; + inline int perform(t_sample ** __ins, t_sample ** __outs, int __n) { + vectorsize = __n; + const t_sample * __in1 = __ins[0]; + t_sample * __out1 = __outs[0]; + if (__exception) { + return __exception; + + } else if (( (__in1 == 0) || (__out1 == 0) )) { + __exception = GENLIB_ERR_NULL_BUFFER; + return __exception; + + }; + // the main sample loop; + while ((__n--)) { + const t_sample in1 = (*(__in1++)); + if ((__m_delta_6(m_INVERT_5) != ((int)0))) { + m_target_4 = m_INVERT_5; + m_remain_2 = (((int)100) * (samplerate * 0.001)); + m_increment_1 = safediv((m_target_4 - m_current_3), m_remain_2); + + }; + if ((m_remain_2 > ((int)0))) { + m_current_3 = (m_target_4 - (m_increment_1 * m_remain_2)); + m_remain_2 = (m_remain_2 - ((int)1)); + + } else { + m_current_3 = m_target_4; + + }; + t_sample expr_287 = m_current_3; + t_sample mul_176 = (in1 * (-1)); + t_sample mix_289 = (in1 + (expr_287 * (mul_176 - in1))); + t_sample out1 = mix_289; + // assign results to output buffer; + (*(__out1++)) = out1; + + }; + return __exception; + + }; + inline void set_INVERT(t_param _value) { + m_INVERT_5 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value)); + }; + +} State; + + +/// +/// Configuration for the genlib API +/// + +/// Number of signal inputs and outputs + +int gen_kernel_numins = 1; +int gen_kernel_numouts = 1; + +int num_inputs() { return gen_kernel_numins; } +int num_outputs() { return gen_kernel_numouts; } +int num_params() { return 1; } + +/// Assistive lables for the signal inputs and outputs + +const char *gen_kernel_innames[] = { "in1" }; +const char *gen_kernel_outnames[] = { "out1" }; + +/// Invoke the signal process of a State object + +int perform(CommonState *cself, t_sample **ins, long numins, t_sample **outs, long numouts, long n) { + State* self = (State *)cself; + return self->perform(ins, outs, n); +} + +/// Reset all parameters and stateful operators of a State object + +void reset(CommonState *cself) { + State* self = (State *)cself; + self->reset(cself->sr, cself->vs); +} + +/// Set a parameter of a State object + +void setparameter(CommonState *cself, long index, t_param value, void *ref) { + State *self = (State *)cself; + switch (index) { + case 0: self->set_INVERT(value); break; + + default: break; + } +} + +/// Get the value of a parameter of a State object + +void getparameter(CommonState *cself, long index, t_param *value) { + State *self = (State *)cself; + switch (index) { + case 0: *value = self->m_INVERT_5; break; + + default: break; + } +} + +/// Get the name of a parameter of a State object + +const char *getparametername(CommonState *cself, long index) { + if (index >= 0 && index < cself->numparams) { + return cself->params[index].name; + } + return 0; +} + +/// Get the minimum value of a parameter of a State object + +t_param getparametermin(CommonState *cself, long index) { + if (index >= 0 && index < cself->numparams) { + return cself->params[index].outputmin; + } + return 0; +} + +/// Get the maximum value of a parameter of a State object + +t_param getparametermax(CommonState *cself, long index) { + if (index >= 0 && index < cself->numparams) { + return cself->params[index].outputmax; + } + return 0; +} + +/// Get parameter of a State object has a minimum and maximum value + +char getparameterhasminmax(CommonState *cself, long index) { + if (index >= 0 && index < cself->numparams) { + return cself->params[index].hasminmax; + } + return 0; +} + +/// Get the units of a parameter of a State object + +const char *getparameterunits(CommonState *cself, long index) { + if (index >= 0 && index < cself->numparams) { + return cself->params[index].units; + } + return 0; +} + +/// Get the size of the state of all parameters of a State object + +size_t getstatesize(CommonState *cself) { + return genlib_getstatesize(cself, &getparameter); +} + +/// Get the state of all parameters of a State object + +short getstate(CommonState *cself, char *state) { + return genlib_getstate(cself, state, &getparameter); +} + +/// set the state of all parameters of a State object + +short setstate(CommonState *cself, const char *state) { + return genlib_setstate(cself, state, &setparameter); +} + +/// Allocate and configure a new State object and it's internal CommonState: + +void *create(t_param sr, long vs) { + State *self = new State; + self->reset(sr, vs); + ParamInfo *pi; + self->__commonstate.inputnames = gen_kernel_innames; + self->__commonstate.outputnames = gen_kernel_outnames; + self->__commonstate.numins = gen_kernel_numins; + self->__commonstate.numouts = gen_kernel_numouts; + self->__commonstate.sr = sr; + self->__commonstate.vs = vs; + self->__commonstate.params = (ParamInfo *)genlib_sysmem_newptr(1 * sizeof(ParamInfo)); + self->__commonstate.numparams = 1; + // initialize parameter 0 ("m_INVERT_5") + pi = self->__commonstate.params + 0; + pi->name = "INVERT"; + pi->paramtype = GENLIB_PARAMTYPE_FLOAT; + pi->defaultvalue = self->m_INVERT_5; + pi->defaultref = 0; + pi->hasinputminmax = false; + pi->inputmin = 0; + pi->inputmax = 1; + pi->hasminmax = true; + pi->outputmin = 0; + pi->outputmax = 1; + pi->exp = 0; + pi->units = ""; // no units defined + + return self; +} + +/// Release all resources and memory used by a State object: + +void destroy(CommonState *cself) { + State *self = (State *)cself; + genlib_sysmem_freeptr(cself->params); + + delete self; +} + + +} // gen_exported:: diff --git a/plugins/zwabo-zinvert_phase/gen_exported.h b/plugins/zwabo-zinvert_phase/gen_exported.h new file mode 100644 index 0000000..231d733 --- /dev/null +++ b/plugins/zwabo-zinvert_phase/gen_exported.h @@ -0,0 +1,49 @@ +/******************************************************************************************************************* +Cycling '74 License for Max-Generated Code for Export +Copyright (c) 2016 Cycling '74 +The code that Max generates automatically and that end users are capable of exporting and using, and any + associated documentation files (the “Software”) is a work of authorship for which Cycling '74 is the author + and owner for copyright purposes. A license is hereby granted, free of charge, to any person obtaining a + copy of the Software (“Licensee”) to use, copy, modify, merge, publish, and distribute copies of the Software, + and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +The Software is licensed to Licensee only for non-commercial use. Users who wish to make commercial use of the + Software must contact the copyright owner to determine if a license for commercial use is available, and the + terms and conditions for same, which may include fees or royalties. For commercial use, please send inquiries + to licensing (at) cycling74.com. The determination of whether a use is commercial use or non-commercial use is based + upon the use, not the user. The Software may be used by individuals, institutions, governments, corporations, or + other business whether for-profit or non-profit so long as the use itself is not a commercialization of the + materials or a use that generates or is intended to generate income, revenue, sales or profit. +The above copyright notice and this license shall be included in all copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO + THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*******************************************************************************************************************/ + + +#include "genlib.h" +#include "genlib_exportfunctions.h" +#include "genlib_ops.h" + +namespace gen_exported { + +int num_inputs(); +int num_outputs(); +int num_params(); +int perform(CommonState *cself, t_sample **ins, long numins, t_sample **outs, long numouts, long n); +void reset(CommonState *cself); +void setparameter(CommonState *cself, long index, t_param value, void *ref); +void getparameter(CommonState *cself, long index, t_param *value); +const char *getparametername(CommonState *cself, long index); +t_param getparametermin(CommonState *cself, long index); +t_param getparametermax(CommonState *cself, long index); +char getparameterhasminmax(CommonState *cself, long index); +const char *getparameterunits(CommonState *cself, long index); +size_t getstatesize(CommonState *cself); +short getstate(CommonState *cself, char *state); +short setstate(CommonState *cself, const char *state); +void *create(t_param sr, long vs); +void destroy(CommonState *cself); + +} // gen_exported:: diff --git a/plugins/zwabo-ztoggle4/DistrhoPluginInfo.h b/plugins/zwabo-ztoggle4/DistrhoPluginInfo.h new file mode 100644 index 0000000..8c4949a --- /dev/null +++ b/plugins/zwabo-ztoggle4/DistrhoPluginInfo.h @@ -0,0 +1,34 @@ +/* + * DPF Max Gen + * Copyright (C) 2015-2023 Filipe Coelho + * + * Permission to use, copy, modify, and/or distribute this software for any purpose with + * or without fee is hereby granted, provided that the above copyright notice and this + * permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD + * TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER + * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#pragma once + +#define DISTRHO_PLUGIN_BRAND "zwabo" +#define DISTRHO_PLUGIN_NAME "Ztoggle4" +#define DISTRHO_PLUGIN_URI "urn:maxgen:zwabo:ztoggle4" +#define DISTRHO_PLUGIN_CLAP_ID "maxgen.zwabo.ztoggle4" + +#define DISTRHO_PLUGIN_HAS_UI 0 +#define DISTRHO_PLUGIN_IS_RT_SAFE 1 +#define DISTRHO_PLUGIN_NUM_INPUTS 1 +#define DISTRHO_PLUGIN_NUM_OUTPUTS 4 + +#define DISTRHO_PLUGIN_CLAP_FEATURES "audio-effect", "routing", "mono" +#define DISTRHO_PLUGIN_LV2_CATEGORY "lv2:UtilityPlugin" +#define DISTRHO_PLUGIN_VST3_CATEGORIES "Fx|Utility" + +#define DISTRHO_PLUGIN_UNIQUE_ID d_cconst('z', 'w', 't', '4') +#define DISTRHO_PLUGIN_VERSION d_version(0, 0, 0) diff --git a/plugins/zwabo-ztoggle4/README.md b/plugins/zwabo-ztoggle4/README.md new file mode 100644 index 0000000..4d72f55 --- /dev/null +++ b/plugins/zwabo-ztoggle4/README.md @@ -0,0 +1,23 @@ +# Ztoggle4 +Lv2 plugin created for the Mod Dwarf + +Ztoggle4 gets one audio stream as input and chooses one of four outputs to route the audio. When the SELECT switch is activated (MIDI and CV assignable) the audio stream pass to the next output . + +The CYCLE selector has four modes : +1) 1 (only usefull if KILLSWITCH is engaged) +2) 1-2 +3) 1-2-3 +4) 1-2-3-4 + +When the KILLSWITCH is engaged , the SELECT switch cuts audio when it’s on. + +Dwarf installation on a Mac: +- Open Terminal + + ``` + scp -rp root@192.168.51.1:/root/.lv2 + ``` + +- Enter password "mod" + +- Reboot Mod diff --git a/plugins/zwabo-ztoggle4/gen_exported.cpp b/plugins/zwabo-ztoggle4/gen_exported.cpp new file mode 100644 index 0000000..8053d21 --- /dev/null +++ b/plugins/zwabo-ztoggle4/gen_exported.cpp @@ -0,0 +1,353 @@ +#include "gen_exported.h" + +namespace gen_exported { + +/******************************************************************************************************************* +Cycling '74 License for Max-Generated Code for Export +Copyright (c) 2016 Cycling '74 +The code that Max generates automatically and that end users are capable of exporting and using, and any + associated documentation files (the “Software”) is a work of authorship for which Cycling '74 is the author + and owner for copyright purposes. A license is hereby granted, free of charge, to any person obtaining a + copy of the Software (“Licensee”) to use, copy, modify, merge, publish, and distribute copies of the Software, + and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +The Software is licensed to Licensee only for non-commercial use. Users who wish to make commercial use of the + Software must contact the copyright owner to determine if a license for commercial use is available, and the + terms and conditions for same, which may include fees or royalties. For commercial use, please send inquiries + to licensing (at) cycling74.com. The determination of whether a use is commercial use or non-commercial use is based + upon the use, not the user. The Software may be used by individuals, institutions, governments, corporations, or + other business whether for-profit or non-profit so long as the use itself is not a commercialization of the + materials or a use that generates or is intended to generate income, revenue, sales or profit. +The above copyright notice and this license shall be included in all copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO + THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*******************************************************************************************************************/ + +// global noise generator +Noise noise; +static const int GENLIB_LOOPCOUNT_BAIL = 100000; + + +// The State struct contains all the state and procedures for the gendsp kernel +typedef struct State { + CommonState __commonstate; + Change __m_change_12; + Delta __m_delta_4; + int __exception; + int vectorsize; + t_sample __m_carry_7; + t_sample m_diff_10; + t_sample m_prev_9; + t_sample __m_count_5; + t_sample m_Cycle_3; + t_sample m_val_11; + t_sample m_Select_1; + t_sample m_Killswitch_2; + t_sample samplerate; + // re-initialize all member variables; + inline void reset(t_param __sr, int __vs) { + __exception = 0; + vectorsize = __vs; + samplerate = __sr; + m_Select_1 = 0; + m_Killswitch_2 = 0; + m_Cycle_3 = 2; + __m_delta_4.reset(0); + __m_count_5 = 0; + __m_carry_7 = 0; + m_prev_9 = ((int)0); + m_diff_10 = ((int)0); + m_val_11 = ((int)0); + __m_change_12.reset(0); + genlib_reset_complete(this); + + }; + // the signal processing routine; + inline int perform(t_sample ** __ins, t_sample ** __outs, int __n) { + vectorsize = __n; + const t_sample * __in1 = __ins[0]; + t_sample * __out1 = __outs[0]; + t_sample * __out2 = __outs[1]; + t_sample * __out3 = __outs[2]; + t_sample * __out4 = __outs[3]; + if (__exception) { + return __exception; + + } else if (( (__in1 == 0) || (__out1 == 0) || (__out2 == 0) || (__out3 == 0) || (__out4 == 0) )) { + __exception = GENLIB_ERR_NULL_BUFFER; + return __exception; + + }; + t_sample add_1961 = (m_Cycle_3 + ((int)1)); + t_sample add_1949 = (m_Killswitch_2 + ((int)1)); + int neq_2398 = (m_Select_1 != ((int)1)); + t_sample rsr = safediv(((int)1), (((int)50) * (samplerate * 0.001))); + t_sample choice_13 = int(add_1949); + // the main sample loop; + while ((__n--)) { + const t_sample in1 = (*(__in1++)); + int delta_1964 = __m_delta_4(neq_2398); + int lt_1963 = (delta_1964 < ((int)0)); + __m_count_5 = (((int)0) ? 0 : (fixdenorm(__m_count_5 + lt_1963))); + int carry_6 = 0; + if ((((int)0) != 0)) { + __m_count_5 = 0; + __m_carry_7 = 0; + + } else if (((add_1961 > 0) && (__m_count_5 >= add_1961))) { + int wraps_8 = (__m_count_5 / add_1961); + __m_carry_7 = (__m_carry_7 + wraps_8); + __m_count_5 = (__m_count_5 - (wraps_8 * add_1961)); + carry_6 = 1; + + }; + int counter_1965 = __m_count_5; + int counter_1966 = carry_6; + int counter_1967 = __m_carry_7; + int add_1962 = (counter_1965 + ((int)1)); + t_sample expr_2392 = ramp0_i_d(neq_2398, rsr); + t_sample selector_1951 = ((choice_13 >= 2) ? expr_2392 : ((choice_13 >= 1) ? ((int)1) : 0)); + t_sample mul_1972 = (in1 * selector_1951); + int choice_14 = add_1962; + t_sample gate_1968 = (((choice_14 >= 1) && (choice_14 < 2)) ? mul_1972 : 0); + t_sample gate_1969 = (((choice_14 >= 2) && (choice_14 < 3)) ? mul_1972 : 0); + t_sample gate_1970 = (((choice_14 >= 3) && (choice_14 < 4)) ? mul_1972 : 0); + t_sample gate_1971 = ((choice_14 >= 4) ? mul_1972 : 0); + t_sample out3 = gate_1970; + t_sample out4 = gate_1971; + t_sample out2 = gate_1969; + t_sample out1 = gate_1968; + // assign results to output buffer; + (*(__out1++)) = out1; + (*(__out2++)) = out2; + (*(__out3++)) = out3; + (*(__out4++)) = out4; + + }; + return __exception; + + }; + inline void set_Select(t_param _value) { + m_Select_1 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value)); + }; + inline void set_Killswitch(t_param _value) { + m_Killswitch_2 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value)); + }; + inline void set_Cycle(t_param _value) { + m_Cycle_3 = (_value < 0 ? 0 : (_value > 3 ? 3 : _value)); + }; + inline t_sample ramp0_i_d(int in1, t_sample rsr) { + if ((__m_change_12(in1) != ((int)0))) { + m_diff_10 = ((in1 - m_prev_9) * rsr); + m_prev_9 = in1; + + }; + if ((((m_diff_10 > ((int)0)) && (m_val_11 > m_prev_9)) || ((m_diff_10 < ((int)0)) && (m_val_11 < m_prev_9)))) { + m_val_11 = in1; + m_diff_10 = ((int)0); + + } else { + m_val_11 = (m_val_11 + m_diff_10); + + }; + return m_val_11; + + }; + +} State; + + +/// +/// Configuration for the genlib API +/// + +/// Number of signal inputs and outputs + +int gen_kernel_numins = 1; +int gen_kernel_numouts = 4; + +int num_inputs() { return gen_kernel_numins; } +int num_outputs() { return gen_kernel_numouts; } +int num_params() { return 3; } + +/// Assistive lables for the signal inputs and outputs + +const char *gen_kernel_innames[] = { "in1" }; +const char *gen_kernel_outnames[] = { "out1", "out2", "out3", "out4" }; + +/// Invoke the signal process of a State object + +int perform(CommonState *cself, t_sample **ins, long numins, t_sample **outs, long numouts, long n) { + State* self = (State *)cself; + return self->perform(ins, outs, n); +} + +/// Reset all parameters and stateful operators of a State object + +void reset(CommonState *cself) { + State* self = (State *)cself; + self->reset(cself->sr, cself->vs); +} + +/// Set a parameter of a State object + +void setparameter(CommonState *cself, long index, t_param value, void *ref) { + State *self = (State *)cself; + switch (index) { + case 0: self->set_Cycle(value); break; + case 1: self->set_Killswitch(value); break; + case 2: self->set_Select(value); break; + + default: break; + } +} + +/// Get the value of a parameter of a State object + +void getparameter(CommonState *cself, long index, t_param *value) { + State *self = (State *)cself; + switch (index) { + case 0: *value = self->m_Cycle_3; break; + case 1: *value = self->m_Killswitch_2; break; + case 2: *value = self->m_Select_1; break; + + default: break; + } +} + +/// Get the name of a parameter of a State object + +const char *getparametername(CommonState *cself, long index) { + if (index >= 0 && index < cself->numparams) { + return cself->params[index].name; + } + return 0; +} + +/// Get the minimum value of a parameter of a State object + +t_param getparametermin(CommonState *cself, long index) { + if (index >= 0 && index < cself->numparams) { + return cself->params[index].outputmin; + } + return 0; +} + +/// Get the maximum value of a parameter of a State object + +t_param getparametermax(CommonState *cself, long index) { + if (index >= 0 && index < cself->numparams) { + return cself->params[index].outputmax; + } + return 0; +} + +/// Get parameter of a State object has a minimum and maximum value + +char getparameterhasminmax(CommonState *cself, long index) { + if (index >= 0 && index < cself->numparams) { + return cself->params[index].hasminmax; + } + return 0; +} + +/// Get the units of a parameter of a State object + +const char *getparameterunits(CommonState *cself, long index) { + if (index >= 0 && index < cself->numparams) { + return cself->params[index].units; + } + return 0; +} + +/// Get the size of the state of all parameters of a State object + +size_t getstatesize(CommonState *cself) { + return genlib_getstatesize(cself, &getparameter); +} + +/// Get the state of all parameters of a State object + +short getstate(CommonState *cself, char *state) { + return genlib_getstate(cself, state, &getparameter); +} + +/// set the state of all parameters of a State object + +short setstate(CommonState *cself, const char *state) { + return genlib_setstate(cself, state, &setparameter); +} + +/// Allocate and configure a new State object and it's internal CommonState: + +void *create(t_param sr, long vs) { + State *self = new State; + self->reset(sr, vs); + ParamInfo *pi; + self->__commonstate.inputnames = gen_kernel_innames; + self->__commonstate.outputnames = gen_kernel_outnames; + self->__commonstate.numins = gen_kernel_numins; + self->__commonstate.numouts = gen_kernel_numouts; + self->__commonstate.sr = sr; + self->__commonstate.vs = vs; + self->__commonstate.params = (ParamInfo *)genlib_sysmem_newptr(3 * sizeof(ParamInfo)); + self->__commonstate.numparams = 3; + // initialize parameter 0 ("m_Cycle_3") + pi = self->__commonstate.params + 0; + pi->name = "Cycle"; + pi->paramtype = GENLIB_PARAMTYPE_FLOAT; + pi->defaultvalue = self->m_Cycle_3; + pi->defaultref = 0; + pi->hasinputminmax = false; + pi->inputmin = 0; + pi->inputmax = 1; + pi->hasminmax = true; + pi->outputmin = 0; + pi->outputmax = 3; + pi->exp = 0; + pi->units = ""; // no units defined + // initialize parameter 1 ("m_Killswitch_2") + pi = self->__commonstate.params + 1; + pi->name = "Killswitch"; + pi->paramtype = GENLIB_PARAMTYPE_FLOAT; + pi->defaultvalue = self->m_Killswitch_2; + pi->defaultref = 0; + pi->hasinputminmax = false; + pi->inputmin = 0; + pi->inputmax = 1; + pi->hasminmax = true; + pi->outputmin = 0; + pi->outputmax = 1; + pi->exp = 0; + pi->units = ""; // no units defined + // initialize parameter 2 ("m_Select_1") + pi = self->__commonstate.params + 2; + pi->name = "Select"; + pi->paramtype = GENLIB_PARAMTYPE_FLOAT; + pi->defaultvalue = self->m_Select_1; + pi->defaultref = 0; + pi->hasinputminmax = false; + pi->inputmin = 0; + pi->inputmax = 1; + pi->hasminmax = true; + pi->outputmin = 0; + pi->outputmax = 1; + pi->exp = 0; + pi->units = ""; // no units defined + + return self; +} + +/// Release all resources and memory used by a State object: + +void destroy(CommonState *cself) { + State *self = (State *)cself; + genlib_sysmem_freeptr(cself->params); + + delete self; +} + + +} // gen_exported:: diff --git a/plugins/zwabo-ztoggle4/gen_exported.h b/plugins/zwabo-ztoggle4/gen_exported.h new file mode 100644 index 0000000..231d733 --- /dev/null +++ b/plugins/zwabo-ztoggle4/gen_exported.h @@ -0,0 +1,49 @@ +/******************************************************************************************************************* +Cycling '74 License for Max-Generated Code for Export +Copyright (c) 2016 Cycling '74 +The code that Max generates automatically and that end users are capable of exporting and using, and any + associated documentation files (the “Software”) is a work of authorship for which Cycling '74 is the author + and owner for copyright purposes. A license is hereby granted, free of charge, to any person obtaining a + copy of the Software (“Licensee”) to use, copy, modify, merge, publish, and distribute copies of the Software, + and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +The Software is licensed to Licensee only for non-commercial use. Users who wish to make commercial use of the + Software must contact the copyright owner to determine if a license for commercial use is available, and the + terms and conditions for same, which may include fees or royalties. For commercial use, please send inquiries + to licensing (at) cycling74.com. The determination of whether a use is commercial use or non-commercial use is based + upon the use, not the user. The Software may be used by individuals, institutions, governments, corporations, or + other business whether for-profit or non-profit so long as the use itself is not a commercialization of the + materials or a use that generates or is intended to generate income, revenue, sales or profit. +The above copyright notice and this license shall be included in all copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO + THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*******************************************************************************************************************/ + + +#include "genlib.h" +#include "genlib_exportfunctions.h" +#include "genlib_ops.h" + +namespace gen_exported { + +int num_inputs(); +int num_outputs(); +int num_params(); +int perform(CommonState *cself, t_sample **ins, long numins, t_sample **outs, long numouts, long n); +void reset(CommonState *cself); +void setparameter(CommonState *cself, long index, t_param value, void *ref); +void getparameter(CommonState *cself, long index, t_param *value); +const char *getparametername(CommonState *cself, long index); +t_param getparametermin(CommonState *cself, long index); +t_param getparametermax(CommonState *cself, long index); +char getparameterhasminmax(CommonState *cself, long index); +const char *getparameterunits(CommonState *cself, long index); +size_t getstatesize(CommonState *cself); +short getstate(CommonState *cself, char *state); +short setstate(CommonState *cself, const char *state); +void *create(t_param sr, long vs); +void destroy(CommonState *cself); + +} // gen_exported:: diff --git a/presets/zwabo-cozmic/COZMIC-DOUBLE_4000_ms.lv2/DOUBLE_4000_ms.ttl b/presets/zwabo-cozmic/COZMIC-DOUBLE_4000_ms.lv2/DOUBLE_4000_ms.ttl new file mode 100644 index 0000000..f1dd643 --- /dev/null +++ b/presets/zwabo-cozmic/COZMIC-DOUBLE_4000_ms.lv2/DOUBLE_4000_ms.ttl @@ -0,0 +1,53 @@ +@prefix atom: . +@prefix lv2: . +@prefix pset: . +@prefix rdf: . +@prefix rdfs: . +@prefix state: . +@prefix xsd: . + +<> + a pset:Preset ; + lv2:appliesTo ; + rdfs:label "DOUBLE 4000 ms" ; + lv2:port [ + lv2:symbol "Disto" ; + pset:value 0.0 + ] , [ + lv2:symbol "FadeOut" ; + pset:value 4000.0 + ] , [ + lv2:symbol "Filter" ; + pset:value 0.0 + ] , [ + lv2:symbol "Filter_On" ; + pset:value 0.0 + ] , [ + lv2:symbol "REC" ; + pset:value 0.0 + ] , [ + lv2:symbol "crossfeed" ; + pset:value 0.0 + ] , [ + lv2:symbol "double" ; + pset:value 1.0 + ] , [ + lv2:symbol "feedback" ; + pset:value 1.0 + ] , [ + lv2:symbol "mix" ; + pset:value 0.5 + ] , [ + lv2:symbol "reset" ; + pset:value 0.0 + ] , [ + lv2:symbol "reverse" ; + pset:value 0.0 + ] , [ + lv2:symbol "speed" ; + pset:value 1.0 + ] , [ + lv2:symbol "time" ; + pset:value 4000.0 + ] . + diff --git a/presets/zwabo-cozmic/COZMIC-DOUBLE_4000_ms.lv2/manifest.ttl b/presets/zwabo-cozmic/COZMIC-DOUBLE_4000_ms.lv2/manifest.ttl new file mode 100644 index 0000000..c8a8c40 --- /dev/null +++ b/presets/zwabo-cozmic/COZMIC-DOUBLE_4000_ms.lv2/manifest.ttl @@ -0,0 +1,13 @@ +@prefix atom: . +@prefix lv2: . +@prefix pset: . +@prefix rdf: . +@prefix rdfs: . +@prefix state: . +@prefix xsd: . + + + lv2:appliesTo ; + a pset:Preset ; + rdfs:seeAlso . + diff --git a/presets/zwabo-cozmic/COZMIC-SIMPLE_2500_ms.lv2/SIMPLE_2500_ms.ttl b/presets/zwabo-cozmic/COZMIC-SIMPLE_2500_ms.lv2/SIMPLE_2500_ms.ttl new file mode 100644 index 0000000..77691f9 --- /dev/null +++ b/presets/zwabo-cozmic/COZMIC-SIMPLE_2500_ms.lv2/SIMPLE_2500_ms.ttl @@ -0,0 +1,53 @@ +@prefix atom: . +@prefix lv2: . +@prefix pset: . +@prefix rdf: . +@prefix rdfs: . +@prefix state: . +@prefix xsd: . + +<> + a pset:Preset ; + lv2:appliesTo ; + rdfs:label "SIMPLE 2500 ms" ; + lv2:port [ + lv2:symbol "Disto" ; + pset:value 0.0 + ] , [ + lv2:symbol "FadeOut" ; + pset:value 4000.0 + ] , [ + lv2:symbol "Filter" ; + pset:value 0.0 + ] , [ + lv2:symbol "Filter_On" ; + pset:value 0.0 + ] , [ + lv2:symbol "REC" ; + pset:value 0.0 + ] , [ + lv2:symbol "crossfeed" ; + pset:value 0.0 + ] , [ + lv2:symbol "double" ; + pset:value 0.0 + ] , [ + lv2:symbol "feedback" ; + pset:value 1.0 + ] , [ + lv2:symbol "mix" ; + pset:value 0.5 + ] , [ + lv2:symbol "reset" ; + pset:value 0.0 + ] , [ + lv2:symbol "reverse" ; + pset:value 0.0 + ] , [ + lv2:symbol "speed" ; + pset:value 1.0 + ] , [ + lv2:symbol "time" ; + pset:value 2500.0 + ] . + diff --git a/presets/zwabo-cozmic/COZMIC-SIMPLE_2500_ms.lv2/manifest.ttl b/presets/zwabo-cozmic/COZMIC-SIMPLE_2500_ms.lv2/manifest.ttl new file mode 100644 index 0000000..ac37252 --- /dev/null +++ b/presets/zwabo-cozmic/COZMIC-SIMPLE_2500_ms.lv2/manifest.ttl @@ -0,0 +1,13 @@ +@prefix atom: . +@prefix lv2: . +@prefix pset: . +@prefix rdf: . +@prefix rdfs: . +@prefix state: . +@prefix xsd: . + + + lv2:appliesTo ; + a pset:Preset ; + rdfs:seeAlso . + diff --git a/presets/zwabo-stuttter/STUTTTER-RANDOM_DOUBLE.lv2/RANDOM_DOUBLE.ttl b/presets/zwabo-stuttter/STUTTTER-RANDOM_DOUBLE.lv2/RANDOM_DOUBLE.ttl new file mode 100644 index 0000000..a71d784 --- /dev/null +++ b/presets/zwabo-stuttter/STUTTTER-RANDOM_DOUBLE.lv2/RANDOM_DOUBLE.ttl @@ -0,0 +1,53 @@ +@prefix atom: . +@prefix lv2: . +@prefix pset: . +@prefix rdf: . +@prefix rdfs: . +@prefix state: . +@prefix xsd: . + +<> + a pset:Preset ; + lv2:appliesTo ; + rdfs:label "RANDOM DOUBLE" ; + lv2:port [ + lv2:symbol "BPM" ; + pset:value 210.64732361 + ] , [ + lv2:symbol "DOUBLE" ; + pset:value 1.0 + ] , [ + lv2:symbol "Div_L" ; + pset:value 1.0 + ] , [ + lv2:symbol "Div_R" ; + pset:value 3.0 + ] , [ + lv2:symbol "ENV_ms" ; + pset:value 1.0 + ] , [ + lv2:symbol "Filter_R" ; + pset:value 0.0 + ] , [ + lv2:symbol "RANDOM" ; + pset:value 1.0 + ] , [ + lv2:symbol "RANGE" ; + pset:value 6.61495495 + ] , [ + lv2:symbol "Tail" ; + pset:value 0.0 + ] , [ + lv2:symbol "dry_wet" ; + pset:value 0.5 + ] , [ + lv2:symbol "reverse" ; + pset:value 0.0 + ] , [ + lv2:symbol "speed" ; + pset:value 1.0 + ] , [ + lv2:symbol "ztutter" ; + pset:value 0.0 + ] . + diff --git a/presets/zwabo-stuttter/STUTTTER-RANDOM_DOUBLE.lv2/manifest.ttl b/presets/zwabo-stuttter/STUTTTER-RANDOM_DOUBLE.lv2/manifest.ttl new file mode 100644 index 0000000..3bb9db0 --- /dev/null +++ b/presets/zwabo-stuttter/STUTTTER-RANDOM_DOUBLE.lv2/manifest.ttl @@ -0,0 +1,13 @@ +@prefix atom: . +@prefix lv2: . +@prefix pset: . +@prefix rdf: . +@prefix rdfs: . +@prefix state: . +@prefix xsd: . + + + lv2:appliesTo ; + a pset:Preset ; + rdfs:seeAlso . + diff --git a/presets/zwabo-stuttter/STUTTTER-_4_3_120_bpm.lv2/_4_3_120_bpm.ttl b/presets/zwabo-stuttter/STUTTTER-_4_3_120_bpm.lv2/_4_3_120_bpm.ttl new file mode 100644 index 0000000..a37253c --- /dev/null +++ b/presets/zwabo-stuttter/STUTTTER-_4_3_120_bpm.lv2/_4_3_120_bpm.ttl @@ -0,0 +1,53 @@ +@prefix atom: . +@prefix lv2: . +@prefix pset: . +@prefix rdf: . +@prefix rdfs: . +@prefix state: . +@prefix xsd: . + +<> + a pset:Preset ; + lv2:appliesTo ; + rdfs:label "4/3 120 bpm" ; + lv2:port [ + lv2:symbol "BPM" ; + pset:value 120.0 + ] , [ + lv2:symbol "DOUBLE" ; + pset:value 1.0 + ] , [ + lv2:symbol "Div_L" ; + pset:value 1.0 + ] , [ + lv2:symbol "Div_R" ; + pset:value 2.0 + ] , [ + lv2:symbol "ENV_ms" ; + pset:value 1.0 + ] , [ + lv2:symbol "Filter_R" ; + pset:value 0.0 + ] , [ + lv2:symbol "RANDOM" ; + pset:value 0.0 + ] , [ + lv2:symbol "RANGE" ; + pset:value 5.0 + ] , [ + lv2:symbol "Tail" ; + pset:value 0.0 + ] , [ + lv2:symbol "dry_wet" ; + pset:value 0.5 + ] , [ + lv2:symbol "reverse" ; + pset:value 0.0 + ] , [ + lv2:symbol "speed" ; + pset:value 1.0 + ] , [ + lv2:symbol "ztutter" ; + pset:value 0.0 + ] . + diff --git a/presets/zwabo-stuttter/STUTTTER-_4_3_120_bpm.lv2/manifest.ttl b/presets/zwabo-stuttter/STUTTTER-_4_3_120_bpm.lv2/manifest.ttl new file mode 100644 index 0000000..14db45b --- /dev/null +++ b/presets/zwabo-stuttter/STUTTTER-_4_3_120_bpm.lv2/manifest.ttl @@ -0,0 +1,13 @@ +@prefix atom: . +@prefix lv2: . +@prefix pset: . +@prefix rdf: . +@prefix rdfs: . +@prefix state: . +@prefix xsd: . + +<_4_3_120_bpm.ttl> + lv2:appliesTo ; + a pset:Preset ; + rdfs:seeAlso <_4_3_120_bpm.ttl> . + diff --git a/presets/zwabo-stuttter/STUTTTER-_7_11_20_bpm.lv2/_7_11_20_bpm.ttl b/presets/zwabo-stuttter/STUTTTER-_7_11_20_bpm.lv2/_7_11_20_bpm.ttl new file mode 100644 index 0000000..7abd33b --- /dev/null +++ b/presets/zwabo-stuttter/STUTTTER-_7_11_20_bpm.lv2/_7_11_20_bpm.ttl @@ -0,0 +1,53 @@ +@prefix atom: . +@prefix lv2: . +@prefix pset: . +@prefix rdf: . +@prefix rdfs: . +@prefix state: . +@prefix xsd: . + +<> + a pset:Preset ; + lv2:appliesTo ; + rdfs:label "7/11 20 bpm" ; + lv2:port [ + lv2:symbol "BPM" ; + pset:value 20.0 + ] , [ + lv2:symbol "DOUBLE" ; + pset:value 1.0 + ] , [ + lv2:symbol "Div_L" ; + pset:value 8.0 + ] , [ + lv2:symbol "Div_R" ; + pset:value 10.0 + ] , [ + lv2:symbol "ENV_ms" ; + pset:value 1.0 + ] , [ + lv2:symbol "Filter_R" ; + pset:value 0.0 + ] , [ + lv2:symbol "RANDOM" ; + pset:value 0.0 + ] , [ + lv2:symbol "RANGE" ; + pset:value 5.0 + ] , [ + lv2:symbol "Tail" ; + pset:value 0.0 + ] , [ + lv2:symbol "dry_wet" ; + pset:value 0.5 + ] , [ + lv2:symbol "reverse" ; + pset:value 0.0 + ] , [ + lv2:symbol "speed" ; + pset:value 1.0 + ] , [ + lv2:symbol "ztutter" ; + pset:value 0.0 + ] . + diff --git a/presets/zwabo-stuttter/STUTTTER-_7_11_20_bpm.lv2/manifest.ttl b/presets/zwabo-stuttter/STUTTTER-_7_11_20_bpm.lv2/manifest.ttl new file mode 100644 index 0000000..43d2dbc --- /dev/null +++ b/presets/zwabo-stuttter/STUTTTER-_7_11_20_bpm.lv2/manifest.ttl @@ -0,0 +1,13 @@ +@prefix atom: . +@prefix lv2: . +@prefix pset: . +@prefix rdf: . +@prefix rdfs: . +@prefix state: . +@prefix xsd: . + +<_7_11_20_bpm.ttl> + lv2:appliesTo ; + a pset:Preset ; + rdfs:seeAlso <_7_11_20_bpm.ttl> . + diff --git a/presets/zwabo-stuttter/STUTTTER-random.lv2/RANDOM.ttl b/presets/zwabo-stuttter/STUTTTER-random.lv2/RANDOM.ttl new file mode 100644 index 0000000..6006b18 --- /dev/null +++ b/presets/zwabo-stuttter/STUTTTER-random.lv2/RANDOM.ttl @@ -0,0 +1,53 @@ +@prefix atom: . +@prefix lv2: . +@prefix pset: . +@prefix rdf: . +@prefix rdfs: . +@prefix state: . +@prefix xsd: . + +<> + a pset:Preset ; + lv2:appliesTo ; + rdfs:label "RANDOM" ; + lv2:port [ + lv2:symbol "BPM" ; + pset:value 210.64732361 + ] , [ + lv2:symbol "DOUBLE" ; + pset:value 0.0 + ] , [ + lv2:symbol "Div_L" ; + pset:value 5.0 + ] , [ + lv2:symbol "Div_R" ; + pset:value 7.0 + ] , [ + lv2:symbol "ENV_ms" ; + pset:value 1.0 + ] , [ + lv2:symbol "Filter_R" ; + pset:value 0.0 + ] , [ + lv2:symbol "RANDOM" ; + pset:value 1.0 + ] , [ + lv2:symbol "RANGE" ; + pset:value 5.0 + ] , [ + lv2:symbol "Tail" ; + pset:value 0.0 + ] , [ + lv2:symbol "dry_wet" ; + pset:value 0.5 + ] , [ + lv2:symbol "reverse" ; + pset:value 0.0 + ] , [ + lv2:symbol "speed" ; + pset:value 1.0 + ] , [ + lv2:symbol "ztutter" ; + pset:value 0.0 + ] . + diff --git a/presets/zwabo-stuttter/STUTTTER-random.lv2/manifest.ttl b/presets/zwabo-stuttter/STUTTTER-random.lv2/manifest.ttl new file mode 100644 index 0000000..505fdc2 --- /dev/null +++ b/presets/zwabo-stuttter/STUTTTER-random.lv2/manifest.ttl @@ -0,0 +1,13 @@ +@prefix atom: . +@prefix lv2: . +@prefix pset: . +@prefix rdf: . +@prefix rdfs: . +@prefix state: . +@prefix xsd: . + + + lv2:appliesTo ; + a pset:Preset ; + rdfs:seeAlso . +