Browse Source

maxpat files added, some modified for min/max. exportcode doesn't always have min/max right, then change in cpp

pull/1/head
nino de wit 9 years ago
parent
commit
6eab61a6fb
28 changed files with 35504 additions and 243 deletions
  1. BIN
      plugins/.DS_Store
  2. +0
    -30
      plugins/Freeverb/DistrhoPluginInfo.h
  3. +0
    -1
      plugins/Freeverb/DistrhoPluginMaxGen.cpp
  4. +0
    -40
      plugins/Freeverb/Makefile
  5. +0
    -0
      plugins/bitcrush/DistrhoPluginInfo.h
  6. +0
    -0
      plugins/bitcrush/DistrhoPluginMaxGen.cpp
  7. +0
    -0
      plugins/bitcrush/Makefile
  8. +0
    -0
      plugins/bitcrush/gen_exported.cpp
  9. +0
    -0
      plugins/bitcrush/gen_exported.h
  10. +966
    -0
      plugins/bitcrush/gen~.bitcrush.maxpat
  11. BIN
      plugins/freeverb/.DS_Store
  12. +172
    -172
      plugins/freeverb/freeverb.cpp
  13. +37
    -0
      plugins/freeverb/freeverb.h
  14. +532
    -0
      plugins/freeverb/gen~.freeverb.maxpat
  15. BIN
      plugins/gigaverb/.DS_Store
  16. +537
    -0
      plugins/gigaverb/gen_exported.cpp
  17. +0
    -0
      plugins/gigaverb/gen_exported.h
  18. +5364
    -0
      plugins/gigaverb/gen~.gigaverb.maxpat
  19. +4567
    -0
      plugins/gigaverb/gigaverb.gendsp
  20. BIN
      plugins/pitchshift/.DS_Store
  21. +358
    -0
      plugins/pitchshift/gen_exported.cpp
  22. +37
    -0
      plugins/pitchshift/gen_exported.h
  23. +5091
    -0
      plugins/pitchshift/gen~.pitchshift.maxpat
  24. +2222
    -0
      plugins/pitchshift/pitchshift.gendsp
  25. +798
    -0
      plugins/shiroverb/gen_exported.cpp
  26. +37
    -0
      plugins/shiroverb/gen_exported.h
  27. +7858
    -0
      plugins/shiroverb/gen~.shiroverb.maxpat
  28. +6928
    -0
      plugins/shiroverb/shiroverb.gendsp

BIN
plugins/.DS_Store View File


+ 0
- 30
plugins/Freeverb/DistrhoPluginInfo.h View File

@@ -1,30 +0,0 @@
/*
* DPF Max Gen
* Copyright (C) 2015 Filipe Coelho <falktx@falktx.com>
*
* 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.
*/

#ifndef DISTRHO_PLUGIN_INFO_H_INCLUDED
#define DISTRHO_PLUGIN_INFO_H_INCLUDED

#define DISTRHO_PLUGIN_NAME "MaFreeverb"
#define DISTRHO_PLUGIN_URI "http://distrho.sf.net/plugins/MaFreeverb"

#define DISTRHO_PLUGIN_HAS_UI 0
#define DISTRHO_PLUGIN_IS_RT_SAFE 0
#define DISTRHO_PLUGIN_NUM_INPUTS 1
#define DISTRHO_PLUGIN_NUM_OUTPUTS 1

//#define DISTRHO_PLUGIN_LV2_CATEGORY "lv2:EQPlugin"

#endif // DISTRHO_PLUGIN_INFO_H_INCLUDED

+ 0
- 1
plugins/Freeverb/DistrhoPluginMaxGen.cpp View File

@@ -1 +0,0 @@
../common/DistrhoPluginMaxGen.cpp

+ 0
- 40
plugins/Freeverb/Makefile View File

@@ -1,40 +0,0 @@
#!/usr/bin/make -f
# Makefile for DISTRHO Plugins #
# ---------------------------- #
# Created by falkTX
#

# --------------------------------------------------------------
# Project name, used for binaries

NAME = MaFreeverb

# --------------------------------------------------------------
# Files to build

OBJS_DSP = \
DistrhoPluginMaxGen.cpp.o \
gen_exported.cpp.o

# --------------------------------------------------------------
# Do some magic

include ../Makefile.mk

# --------------------------------------------------------------
# Enable all possible plugin types

ifeq ($(HAVE_JACK),true)
TARGETS += jack
endif

ifeq ($(LINUX),true)
TARGETS += ladspa
endif

TARGETS += lv2_dsp
TARGETS += vst

all: $(TARGETS)

# --------------------------------------------------------------

plugins/BitCrusher/DistrhoPluginInfo.h → plugins/bitcrush/DistrhoPluginInfo.h View File


plugins/BitCrusher/DistrhoPluginMaxGen.cpp → plugins/bitcrush/DistrhoPluginMaxGen.cpp View File


plugins/BitCrusher/Makefile → plugins/bitcrush/Makefile View File


plugins/BitCrusher/gen_exported.cpp → plugins/bitcrush/gen_exported.cpp View File


plugins/BitCrusher/gen_exported.h → plugins/bitcrush/gen_exported.h View File


+ 966
- 0
plugins/bitcrush/gen~.bitcrush.maxpat View File

@@ -0,0 +1,966 @@
{
"patcher" : {
"fileversion" : 1,
"appversion" : {
"major" : 6,
"minor" : 1,
"revision" : 0,
"architecture" : "x64"
}
,
"rect" : [ 227.0, 271.0, 872.0, 406.0 ],
"bglocked" : 0,
"openinpresentation" : 0,
"default_fontsize" : 12.0,
"default_fontface" : 0,
"default_fontname" : "Arial",
"gridonopen" : 0,
"gridsize" : [ 15.0, 15.0 ],
"gridsnaponopen" : 0,
"statusbarvisible" : 2,
"toolbarvisible" : 1,
"boxanimatetime" : 200,
"imprint" : 0,
"enablehscroll" : 1,
"enablevscroll" : 1,
"devicewidth" : 0.0,
"description" : "",
"digest" : "",
"tags" : "",
"boxes" : [ {
"box" : {
"channels" : 1,
"fontsize" : 13.0,
"id" : "obj-2",
"maxclass" : "live.gain~",
"numinlets" : 1,
"numoutlets" : 4,
"orientation" : 1,
"outlettype" : [ "signal", "", "float", "list" ],
"parameter_enable" : 1,
"patching_rect" : [ 533.0, 247.0, 136.0, 35.0 ],
"presentation_rect" : [ 105.0, 105.0, 50.0, 35.0 ],
"saved_attribute_attributes" : {
"valueof" : {
"parameter_longname" : "live.gain~[1]",
"parameter_unitstyle" : 4,
"parameter_mmax" : 6.0,
"parameter_mmin" : -70.0,
"parameter_initial" : [ -70 ],
"parameter_type" : 0,
"parameter_initial_enable" : 1,
"parameter_shortname" : "live.gain~"
}

}
,
"showname" : 0,
"varname" : "live.gain~[1]"
}

}
, {
"box" : {
"bgcolor" : [ 1.0, 1.0, 1.0, 1.0 ],
"border" : 1.75,
"bordercolor" : [ 0.501961, 0.501961, 0.501961, 1.0 ],
"id" : "obj-12",
"local" : 1,
"maxclass" : "ezdac~",
"numinlets" : 2,
"numoutlets" : 0,
"patching_rect" : [ 533.0, 318.5, 44.0, 44.0 ],
"prototypename" : "helpfile"
}

}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-13",
"maxclass" : "newobj",
"numinlets" : 2,
"numoutlets" : 1,
"outlettype" : [ "signal" ],
"patcher" : {
"fileversion" : 1,
"appversion" : {
"major" : 6,
"minor" : 1,
"revision" : 0,
"architecture" : "x64"
}
,
"rect" : [ 309.0, 189.0, 399.0, 327.0 ],
"bgcolor" : [ 0.9, 0.9, 0.9, 1.0 ],
"bglocked" : 0,
"openinpresentation" : 0,
"default_fontsize" : 12.0,
"default_fontface" : 0,
"default_fontname" : "Arial",
"gridonopen" : 0,
"gridsize" : [ 15.0, 15.0 ],
"gridsnaponopen" : 0,
"statusbarvisible" : 2,
"toolbarvisible" : 1,
"boxanimatetime" : 200,
"imprint" : 0,
"enablehscroll" : 1,
"enablevscroll" : 1,
"devicewidth" : 0.0,
"description" : "",
"digest" : "",
"tags" : "",
"boxes" : [ {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-5",
"maxclass" : "newobj",
"numinlets" : 0,
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 65.0, 94.0, 24.0, 20.0 ],
"text" : "f 1"
}

}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-3",
"maxclass" : "newobj",
"numinlets" : 3,
"numoutlets" : 3,
"outlettype" : [ "", "", "" ],
"patching_rect" : [ 65.0, 127.0, 51.0, 20.0 ],
"text" : "counter"
}

}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-2",
"maxclass" : "newobj",
"numinlets" : 2,
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 31.25, 196.0, 36.0, 20.0 ],
"text" : "latch"
}

}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-28",
"maxclass" : "newobj",
"numinlets" : 0,
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 97.0, 94.0, 213.0, 20.0 ],
"text" : "in 2 @comment \"downsample factor\""
}

}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"frgb" : 0.0,
"id" : "obj-20",
"maxclass" : "comment",
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 75.0, 196.0, 101.0, 20.0 ],
"text" : "sample & hold"
}

}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-1",
"maxclass" : "newobj",
"numinlets" : 0,
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 31.25, 12.0, 127.0, 20.0 ],
"text" : "in 1 @comment input"
}

}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-4",
"maxclass" : "newobj",
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 31.25, 234.0, 38.0, 20.0 ],
"text" : "out 1"
}

}
],
"lines" : [ {
"patchline" : {
"destination" : [ "obj-2", 0 ],
"disabled" : 0,
"hidden" : 0,
"source" : [ "obj-1", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-4", 0 ],
"disabled" : 0,
"hidden" : 0,
"source" : [ "obj-2", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-3", 2 ],
"disabled" : 0,
"hidden" : 0,
"source" : [ "obj-28", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-2", 1 ],
"disabled" : 0,
"hidden" : 0,
"source" : [ "obj-3", 1 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-3", 0 ],
"disabled" : 0,
"hidden" : 0,
"source" : [ "obj-5", 0 ]
}

}
]
}
,
"patching_rect" : [ 533.0, 201.0, 38.0, 20.0 ],
"text" : "gen~"
}

}
, {
"box" : {
"fontname" : "Arial Bold Italic",
"fontsize" : 18.0,
"frgb" : 0.0,
"id" : "obj-14",
"maxclass" : "comment",
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 533.0, 15.0, 226.0, 27.0 ],
"text" : "Like downsamp~"
}

}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"frgb" : 0.0,
"id" : "obj-15",
"maxclass" : "comment",
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 728.0, 120.0, 83.0, 20.0 ],
"text" : "n samples"
}

}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-17",
"maxclass" : "newobj",
"numinlets" : 2,
"numoutlets" : 1,
"outlettype" : [ "signal" ],
"patching_rect" : [ 533.0, 149.0, 70.0, 20.0 ],
"text" : "cycle~ 440"
}

}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-18",
"maxclass" : "flonum",
"numinlets" : 1,
"numoutlets" : 2,
"outlettype" : [ "float", "bang" ],
"parameter_enable" : 0,
"patching_rect" : [ 728.0, 150.0, 63.0, 20.0 ]
}

}
, {
"box" : {
"fontsize" : 13.0,
"id" : "obj-7",
"maxclass" : "live.gain~",
"numinlets" : 2,
"numoutlets" : 5,
"outlettype" : [ "signal", "signal", "", "float", "list" ],
"parameter_enable" : 1,
"patching_rect" : [ 31.0, 179.0, 42.0, 136.0 ],
"presentation_rect" : [ 15.0, 15.0, 35.0, 50.0 ],
"saved_attribute_attributes" : {
"valueof" : {
"parameter_longname" : "live.gain~",
"parameter_unitstyle" : 4,
"parameter_mmax" : 6.0,
"parameter_mmin" : -70.0,
"parameter_initial" : [ -70 ],
"parameter_type" : 0,
"parameter_initial_enable" : 1,
"parameter_shortname" : "live.gain~"
}

}
,
"showname" : 0,
"varname" : "live.gain~"
}

}
, {
"box" : {
"bgcolor" : [ 1.0, 1.0, 1.0, 1.0 ],
"border" : 1.75,
"bordercolor" : [ 0.501961, 0.501961, 0.501961, 1.0 ],
"id" : "obj-8",
"local" : 1,
"maxclass" : "ezdac~",
"numinlets" : 2,
"numoutlets" : 0,
"patching_rect" : [ 31.0, 325.0, 44.0, 44.0 ],
"prototypename" : "helpfile"
}

}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"frgb" : 0.0,
"id" : "obj-5",
"maxclass" : "comment",
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 211.0, 149.0, 150.0, 20.0 ],
"text" : "stereo crush!!"
}

}
, {
"box" : {
"fontname" : "Arial Bold Italic",
"fontsize" : 18.0,
"frgb" : 0.0,
"id" : "obj-9",
"maxclass" : "comment",
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 15.0, 15.0, 463.0, 27.0 ],
"text" : "Crushing by reducing sample resolution"
}

}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-11",
"maxclass" : "flonum",
"numinlets" : 1,
"numoutlets" : 2,
"outlettype" : [ "float", "bang" ],
"parameter_enable" : 0,
"patching_rect" : [ 31.0, 74.0, 50.0, 20.0 ]
}

}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-10",
"maxclass" : "newobj",
"numinlets" : 2,
"numoutlets" : 1,
"outlettype" : [ "signal" ],
"patching_rect" : [ 31.0, 104.0, 62.0, 20.0 ],
"text" : "cycle~ 40"
}

}
, {
"box" : {
"id" : "obj-3",
"maxclass" : "scope~",
"numinlets" : 2,
"numoutlets" : 0,
"patching_rect" : [ 86.0, 195.5, 321.0, 103.0 ]
}

}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-6",
"maxclass" : "flonum",
"numinlets" : 1,
"numoutlets" : 2,
"outlettype" : [ "float", "bang" ],
"parameter_enable" : 0,
"patching_rect" : [ 166.0, 74.0, 63.0, 20.0 ]
}

}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-4",
"maxclass" : "message",
"numinlets" : 2,
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 166.0, 104.0, 79.0, 18.0 ],
"text" : "resolution $1"
}

}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-1",
"maxclass" : "newobj",
"numinlets" : 1,
"numoutlets" : 2,
"outlettype" : [ "signal", "signal" ],
"patcher" : {
"fileversion" : 1,
"appversion" : {
"major" : 6,
"minor" : 1,
"revision" : 0,
"architecture" : "x64"
}
,
"rect" : [ 25.0, 69.0, 455.0, 400.0 ],
"bgcolor" : [ 0.9, 0.9, 0.9, 1.0 ],
"bglocked" : 0,
"openinpresentation" : 0,
"default_fontsize" : 12.0,
"default_fontface" : 0,
"default_fontname" : "Arial",
"gridonopen" : 0,
"gridsize" : [ 15.0, 15.0 ],
"gridsnaponopen" : 0,
"statusbarvisible" : 2,
"toolbarvisible" : 1,
"boxanimatetime" : 200,
"imprint" : 0,
"enablehscroll" : 1,
"enablevscroll" : 1,
"devicewidth" : 0.0,
"description" : "",
"digest" : "",
"tags" : "",
"boxes" : [ {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"frgb" : 0.0,
"id" : "obj-10",
"maxclass" : "comment",
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 16.0, 15.0, 325.0, 20.0 ],
"text" : "This isn't the only way to reduce sample resolution..."
}

}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"frgb" : 0.0,
"id" : "obj-9",
"maxclass" : "comment",
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 31.0, 285.0, 75.0, 20.0 ],
"text" : "scale down"
}

}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"frgb" : 0.0,
"id" : "obj-8",
"maxclass" : "comment",
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 31.0, 195.0, 75.0, 20.0 ],
"text" : "quantize"
}

}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"frgb" : 0.0,
"id" : "obj-7",
"maxclass" : "comment",
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 31.0, 105.0, 75.0, 20.0 ],
"text" : "scale up"
}

}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-5",
"maxclass" : "newobj",
"numinlets" : 1,
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 181.0, 225.0, 35.0, 20.0 ],
"text" : "- 0.5"
}

}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-4",
"maxclass" : "newobj",
"numinlets" : 1,
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 181.0, 165.0, 38.0, 20.0 ],
"text" : "+ 0.5"
}

}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-3",
"maxclass" : "newobj",
"numinlets" : 1,
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 181.0, 195.0, 34.0, 20.0 ],
"text" : "floor"
}

}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-1",
"maxclass" : "newobj",
"numinlets" : 2,
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 181.0, 285.0, 32.5, 20.0 ],
"text" : "/"
}

}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-2",
"maxclass" : "newobj",
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 181.0, 315.0, 37.0, 20.0 ],
"text" : "out 2"
}

}
, {
"box" : {
"color" : [ 0.839216, 0.709804, 0.709804, 1.0 ],
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-32",
"maxclass" : "newobj",
"numinlets" : 0,
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 286.0, 60.0, 111.0, 20.0 ],
"text" : "param resolution 6"
}

}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-31",
"maxclass" : "newobj",
"numinlets" : 2,
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 121.0, 285.0, 32.5, 20.0 ],
"text" : "/"
}

}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-30",
"maxclass" : "newobj",
"numinlets" : 1,
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 121.0, 195.0, 32.5, 20.0 ],
"text" : "ceil"
}

}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-29",
"maxclass" : "newobj",
"numinlets" : 2,
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 121.0, 105.0, 32.5, 20.0 ],
"text" : "*"
}

}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-28",
"maxclass" : "newobj",
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 121.0, 315.0, 37.0, 20.0 ],
"text" : "out 1"
}

}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-27",
"maxclass" : "newobj",
"numinlets" : 0,
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 121.0, 75.0, 32.5, 20.0 ],
"text" : "in 1"
}

}
],
"lines" : [ {
"patchline" : {
"destination" : [ "obj-2", 0 ],
"disabled" : 0,
"hidden" : 0,
"source" : [ "obj-1", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-29", 0 ],
"disabled" : 0,
"hidden" : 0,
"source" : [ "obj-27", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-30", 0 ],
"disabled" : 0,
"hidden" : 0,
"source" : [ "obj-29", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-4", 0 ],
"disabled" : 0,
"hidden" : 0,
"midpoints" : [ 130.5, 129.5, 190.5, 129.5 ],
"source" : [ "obj-29", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-5", 0 ],
"disabled" : 0,
"hidden" : 0,
"source" : [ "obj-3", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-31", 0 ],
"disabled" : 0,
"hidden" : 0,
"source" : [ "obj-30", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-28", 0 ],
"disabled" : 0,
"hidden" : 0,
"source" : [ "obj-31", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-1", 1 ],
"disabled" : 0,
"hidden" : 0,
"midpoints" : [ 295.5, 276.0, 204.0, 276.0 ],
"source" : [ "obj-32", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-29", 1 ],
"disabled" : 0,
"hidden" : 0,
"midpoints" : [ 295.5, 98.0, 144.0, 98.0 ],
"source" : [ "obj-32", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-31", 1 ],
"disabled" : 0,
"hidden" : 0,
"midpoints" : [ 295.5, 276.0, 144.0, 276.0 ],
"source" : [ "obj-32", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-3", 0 ],
"disabled" : 0,
"hidden" : 0,
"source" : [ "obj-4", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-1", 0 ],
"disabled" : 0,
"hidden" : 0,
"source" : [ "obj-5", 0 ]
}

}
]
}
,
"patching_rect" : [ 31.0, 149.0, 38.0, 20.0 ],
"text" : "gen~"
}

}
],
"lines" : [ {
"patchline" : {
"destination" : [ "obj-3", 0 ],
"disabled" : 0,
"hidden" : 0,
"source" : [ "obj-1", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-7", 1 ],
"disabled" : 0,
"hidden" : 0,
"source" : [ "obj-1", 1 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-7", 0 ],
"disabled" : 0,
"hidden" : 0,
"source" : [ "obj-1", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-1", 0 ],
"disabled" : 0,
"hidden" : 0,
"source" : [ "obj-10", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-10", 0 ],
"disabled" : 0,
"hidden" : 0,
"source" : [ "obj-11", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-2", 0 ],
"disabled" : 0,
"hidden" : 0,
"source" : [ "obj-13", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-13", 0 ],
"disabled" : 0,
"hidden" : 0,
"source" : [ "obj-17", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-13", 1 ],
"disabled" : 0,
"hidden" : 0,
"source" : [ "obj-18", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-12", 1 ],
"disabled" : 0,
"hidden" : 0,
"source" : [ "obj-2", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-12", 0 ],
"disabled" : 0,
"hidden" : 0,
"source" : [ "obj-2", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-1", 0 ],
"disabled" : 0,
"hidden" : 0,
"midpoints" : [ 175.5, 135.0, 40.5, 135.0 ],
"source" : [ "obj-4", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-4", 0 ],
"disabled" : 0,
"hidden" : 0,
"source" : [ "obj-6", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-8", 1 ],
"disabled" : 0,
"hidden" : 0,
"source" : [ "obj-7", 1 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-8", 0 ],
"disabled" : 0,
"hidden" : 0,
"source" : [ "obj-7", 0 ]
}

}
],
"parameters" : {
"obj-7" : [ "live.gain~", "live.gain~", 0 ],
"obj-2" : [ "live.gain~[1]", "live.gain~", 0 ]
}
,
"dependency_cache" : [ ]
}

}

BIN
plugins/freeverb/.DS_Store View File


plugins/Freeverb/gen_exported.cpp → plugins/freeverb/freeverb.cpp View File

@@ -1,6 +1,6 @@
#include "gen_exported.h"
#include "freeverb.h"

namespace gen_exported {
namespace freeverb {


/*******************************************************************************************************************
@@ -45,17 +45,17 @@ typedef struct State {
Delay m_delay_5;
double m_history_6;
double m_history_18;
double m_spread_1;
double m_fb_1;
double m_history_20;
double samplerate;
double m_fb_2;
double m_damp_2;
double m_history_8;
double m_history_16;
double m_history_14;
double m_damp_3;
double m_fb_3;
double m_history_12;
double m_history_10;
double m_fb_4;
double m_spread_4;
int vectorsize;
int __exception;
// re-initialize all member variables;
@@ -63,10 +63,10 @@ typedef struct State {
__exception = 0;
vectorsize = __vs;
samplerate = __sr;
m_spread_1 = 0;
m_fb_2 = 0.9;
m_damp_3 = 0.5;
m_fb_4 = 0.5;
m_fb_1 = 0.5;
m_damp_2 = 0.5;
m_fb_3 = 0.9;
m_spread_4 = 0;
m_delay_5.reset("m_delay_5", 2000);
m_history_6 = 0;
m_delay_7.reset("m_delay_7", 2000);
@@ -103,141 +103,141 @@ typedef struct State {
return __exception;
};
double mul_498 = (m_fb_4 * 0.5);
double add_474 = (225 + m_spread_1);
double add_481 = (341 + m_spread_1);
double add_496 = (441 + m_spread_1);
double add_467 = (556 + m_spread_1);
double damp_379 = m_damp_3;
double damp_377 = damp_379;
double damp_376 = damp_379;
double damp_378 = damp_379;
double damp_380 = damp_379;
double damp_381 = damp_379;
double damp_382 = damp_379;
double damp_383 = damp_379;
double add_489 = (1557 + m_spread_1);
double rsub_72 = (1 - damp_377);
double add_488 = (1617 + m_spread_1);
double rsub_510 = (1 - damp_376);
double add_490 = (1491 + m_spread_1);
double rsub_522 = (1 - damp_378);
double add_491 = (1422 + m_spread_1);
double rsub_537 = (1 - damp_379);
double add_492 = (1356 + m_spread_1);
double rsub_548 = (1 - damp_380);
double add_493 = (1277 + m_spread_1);
double rsub_561 = (1 - damp_381);
double add_494 = (1188 + m_spread_1);
double rsub_576 = (1 - damp_382);
double add_495 = (1116 + m_spread_1);
double rsub_585 = (1 - damp_383);
double mul_448 = (m_fb_1 * 0.5);
double add_424 = (225 + m_spread_4);
double add_431 = (341 + m_spread_4);
double add_446 = (441 + m_spread_4);
double add_417 = (556 + m_spread_4);
double damp_327 = m_damp_2;
double damp_326 = damp_327;
double damp_328 = damp_327;
double damp_329 = damp_327;
double damp_330 = damp_327;
double damp_331 = damp_327;
double damp_332 = damp_327;
double damp_333 = damp_327;
double add_439 = (1557 + m_spread_4);
double rsub_295 = (1 - damp_327);
double add_438 = (1617 + m_spread_4);
double rsub_466 = (1 - damp_326);
double add_440 = (1491 + m_spread_4);
double rsub_479 = (1 - damp_328);
double add_441 = (1422 + m_spread_4);
double rsub_484 = (1 - damp_329);
double add_442 = (1356 + m_spread_4);
double rsub_496 = (1 - damp_330);
double add_443 = (1277 + m_spread_4);
double rsub_508 = (1 - damp_331);
double add_444 = (1188 + m_spread_4);
double rsub_520 = (1 - damp_332);
double add_445 = (1116 + m_spread_4);
double rsub_532 = (1 - damp_333);
// the main sample loop;
while ((__n--)) {
const double in1 = (*(__in1++));
double mul_509 = (in1 * 0.015);
double tap_79 = m_delay_5.read_linear(add_489);
double gen_460 = tap_79;
double mul_77 = (tap_79 * damp_377);
double mul_75 = (m_history_6 * rsub_72);
double add_76 = (mul_77 + mul_75);
double mul_73 = (add_76 * m_fb_2);
double add_80 = (mul_509 + mul_73);
double history_74_next_81 = add_76;
double tap_514 = m_delay_7.read_linear(add_488);
double gen_508 = tap_514;
double mul_518 = (tap_514 * damp_376);
double mul_512 = (m_history_8 * rsub_510);
double add_513 = (mul_518 + mul_512);
double mul_515 = (add_513 * m_fb_2);
double add_517 = (mul_509 + mul_515);
double history_74_next_516 = add_513;
double tap_526 = m_delay_9.read_linear(add_490);
double gen_449 = tap_526;
double mul_530 = (tap_526 * damp_378);
double mul_524 = (m_history_10 * rsub_522);
double add_525 = (mul_530 + mul_524);
double mul_527 = (add_525 * m_fb_2);
double add_529 = (mul_509 + mul_527);
double history_74_next_528 = add_525;
double tap_539 = m_delay_11.read_linear(add_491);
double gen_438 = tap_539;
double mul_536 = (tap_539 * damp_379);
double mul_535 = (m_history_12 * rsub_537);
double add_538 = (mul_536 + mul_535);
double mul_540 = (add_538 * m_fb_2);
double add_541 = (mul_509 + mul_540);
double history_74_next_543 = add_538;
double tap_550 = m_delay_13.read_linear(add_492);
double gen_427 = tap_550;
double mul_547 = (tap_550 * damp_380);
double mul_546 = (m_history_14 * rsub_548);
double add_549 = (mul_547 + mul_546);
double mul_551 = (add_549 * m_fb_2);
double add_553 = (mul_509 + mul_551);
double history_74_next_555 = add_549;
double tap_563 = m_delay_15.read_linear(add_493);
double gen_416 = tap_563;
double mul_560 = (tap_563 * damp_381);
double mul_559 = (m_history_16 * rsub_561);
double add_562 = (mul_560 + mul_559);
double mul_564 = (add_562 * m_fb_2);
double add_565 = (mul_509 + mul_564);
double history_74_next_566 = add_562;
double tap_574 = m_delay_17.read_linear(add_494);
double gen_405 = tap_574;
double mul_572 = (tap_574 * damp_382);
double mul_571 = (m_history_18 * rsub_576);
double add_573 = (mul_572 + mul_571);
double mul_575 = (add_573 * m_fb_2);
double add_577 = (mul_509 + mul_575);
double history_74_next_579 = add_573;
double tap_587 = m_delay_19.read_linear(add_495);
double gen_394 = tap_587;
double mul_584 = (tap_587 * damp_383);
double mul_583 = (m_history_20 * rsub_585);
double add_586 = (mul_584 + mul_583);
double mul_588 = (add_586 * m_fb_2);
double add_589 = (mul_509 + mul_588);
double history_74_next_591 = add_586;
double add_497 = ((((((((gen_394 + gen_405) + gen_416) + gen_427) + gen_438) + gen_449) + gen_508) + gen_460) + 0);
double tap_60 = m_delay_21.read_linear(add_467);
double sub_56 = (add_497 - tap_60);
double mul_58 = (tap_60 * mul_498);
double add_57 = (add_497 + mul_58);
double tap_597 = m_delay_22.read_linear(add_496);
double sub_594 = (sub_56 - tap_597);
double mul_596 = (tap_597 * mul_498);
double add_598 = (sub_56 + mul_596);
double tap_603 = m_delay_23.read_linear(add_481);
double sub_600 = (sub_594 - tap_603);
double mul_602 = (tap_603 * mul_498);
double add_604 = (sub_594 + mul_602);
double tap_608 = m_delay_24.read_linear(add_474);
double sub_606 = (sub_600 - tap_608);
double mul_609 = (tap_608 * mul_498);
double add_610 = (sub_600 + mul_609);
double out1 = sub_606;
m_delay_5.write(add_80);
m_delay_24.write(add_610);
m_delay_23.write(add_604);
m_delay_22.write(add_598);
m_delay_21.write(add_57);
m_history_20 = history_74_next_591;
m_delay_19.write(add_589);
m_history_18 = history_74_next_579;
m_delay_17.write(add_577);
m_history_16 = history_74_next_566;
m_delay_15.write(add_565);
m_history_14 = history_74_next_555;
m_delay_13.write(add_553);
m_history_12 = history_74_next_543;
m_delay_11.write(add_541);
m_history_10 = history_74_next_528;
m_delay_9.write(add_529);
m_history_8 = history_74_next_516;
m_delay_7.write(add_517);
m_history_6 = history_74_next_81;
double mul_459 = (in1 * 0.015);
double tap_302 = m_delay_5.read_linear(add_439);
double gen_410 = tap_302;
double mul_300 = (tap_302 * damp_327);
double mul_298 = (m_history_6 * rsub_295);
double add_299 = (mul_300 + mul_298);
double mul_296 = (add_299 * m_fb_3);
double add_303 = (mul_459 + mul_296);
double history_297_next_304 = add_299;
double tap_469 = m_delay_7.read_linear(add_438);
double gen_458 = tap_469;
double mul_468 = (tap_469 * damp_326);
double mul_465 = (m_history_8 * rsub_466);
double add_464 = (mul_468 + mul_465);
double mul_462 = (add_464 * m_fb_3);
double add_463 = (mul_459 + mul_462);
double history_297_next_461 = add_464;
double tap_474 = m_delay_9.read_linear(add_440);
double gen_399 = tap_474;
double mul_480 = (tap_474 * damp_328);
double mul_478 = (m_history_10 * rsub_479);
double add_476 = (mul_480 + mul_478);
double mul_473 = (add_476 * m_fb_3);
double add_477 = (mul_459 + mul_473);
double history_297_next_475 = add_476;
double tap_489 = m_delay_11.read_linear(add_441);
double gen_388 = tap_489;
double mul_493 = (tap_489 * damp_329);
double mul_487 = (m_history_12 * rsub_484);
double add_492 = (mul_493 + mul_487);
double mul_491 = (add_492 * m_fb_3);
double add_490 = (mul_459 + mul_491);
double history_297_next_485 = add_492;
double tap_500 = m_delay_13.read_linear(add_442);
double gen_377 = tap_500;
double mul_501 = (tap_500 * damp_330);
double mul_499 = (m_history_14 * rsub_496);
double add_505 = (mul_501 + mul_499);
double mul_504 = (add_505 * m_fb_3);
double add_503 = (mul_459 + mul_504);
double history_297_next_497 = add_505;
double tap_512 = m_delay_15.read_linear(add_443);
double gen_366 = tap_512;
double mul_517 = (tap_512 * damp_331);
double mul_511 = (m_history_16 * rsub_508);
double add_516 = (mul_517 + mul_511);
double mul_513 = (add_516 * m_fb_3);
double add_514 = (mul_459 + mul_513);
double history_297_next_509 = add_516;
double tap_525 = m_delay_17.read_linear(add_444);
double gen_355 = tap_525;
double mul_521 = (tap_525 * damp_332);
double mul_524 = (m_history_18 * rsub_520);
double add_529 = (mul_521 + mul_524);
double mul_526 = (add_529 * m_fb_3);
double add_527 = (mul_459 + mul_526);
double history_297_next_522 = add_529;
double tap_537 = m_delay_19.read_linear(add_445);
double gen_344 = tap_537;
double mul_541 = (tap_537 * damp_333);
double mul_536 = (m_history_20 * rsub_532);
double add_538 = (mul_541 + mul_536);
double mul_540 = (add_538 * m_fb_3);
double add_534 = (mul_459 + mul_540);
double history_297_next_533 = add_538;
double add_447 = ((((((((gen_344 + gen_355) + gen_366) + gen_377) + gen_388) + gen_399) + gen_458) + gen_410) + 0);
double tap_283 = m_delay_21.read_linear(add_417);
double sub_279 = (add_447 - tap_283);
double mul_281 = (tap_283 * mul_448);
double add_280 = (add_447 + mul_281);
double tap_548 = m_delay_22.read_linear(add_446);
double sub_546 = (sub_279 - tap_548);
double mul_547 = (tap_548 * mul_448);
double add_544 = (sub_279 + mul_547);
double tap_554 = m_delay_23.read_linear(add_431);
double sub_552 = (sub_546 - tap_554);
double mul_553 = (tap_554 * mul_448);
double add_550 = (sub_546 + mul_553);
double tap_560 = m_delay_24.read_linear(add_424);
double sub_558 = (sub_552 - tap_560);
double mul_559 = (tap_560 * mul_448);
double add_556 = (sub_552 + mul_559);
double out1 = sub_558;
m_delay_5.write(add_303);
m_delay_24.write(add_556);
m_delay_23.write(add_550);
m_delay_22.write(add_544);
m_delay_21.write(add_280);
m_history_20 = history_297_next_533;
m_delay_19.write(add_534);
m_history_18 = history_297_next_522;
m_delay_17.write(add_527);
m_history_16 = history_297_next_509;
m_delay_15.write(add_514);
m_history_14 = history_297_next_497;
m_delay_13.write(add_503);
m_history_12 = history_297_next_485;
m_delay_11.write(add_490);
m_history_10 = history_297_next_475;
m_delay_9.write(add_477);
m_history_8 = history_297_next_461;
m_delay_7.write(add_463);
m_history_6 = history_297_next_304;
m_delay_5.step();
m_delay_7.step();
m_delay_9.step();
@@ -257,17 +257,17 @@ typedef struct State {
return __exception;
};
inline void set_spread(double _value) {
m_spread_1 = (_value < 0 ? 0 : (_value > 400 ? 400 : _value));
};
inline void set_fb1(double _value) {
m_fb_2 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value));
inline void set_fb2(double _value) {
m_fb_1 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value));
};
inline void set_damp(double _value) {
m_damp_3 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value));
m_damp_2 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value));
};
inline void set_fb2(double _value) {
m_fb_4 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value));
inline void set_fb1(double _value) {
m_fb_3 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value));
};
inline void set_spread(double _value) {
m_spread_4 = (_value < 0 ? 0 : (_value > 400 ? 400 : _value));
};
} State;
@@ -310,10 +310,10 @@ void reset(CommonState *cself) {
void setparameter(CommonState *cself, long index, double value, void *ref) {
State * self = (State *)cself;
switch (index) {
case 0: self->set_spread(value); break;
case 1: self->set_fb1(value); break;
case 2: self->set_damp(value); break;
case 3: self->set_fb2(value); break;
case 0: self->set_fb2(value); break;
case 1: self->set_damp(value); break;
case 2: self->set_fb1(value); break;
case 3: self->set_spread(value); break;
default: break;
}
@@ -324,10 +324,10 @@ void setparameter(CommonState *cself, long index, double value, void *ref) {
void getparameter(CommonState *cself, long index, double *value) {
State *self = (State *)cself;
switch (index) {
case 0: *value = self->m_spread_1; break;
case 1: *value = self->m_fb_2; break;
case 2: *value = self->m_damp_3; break;
case 3: *value = self->m_fb_4; break;
case 0: *value = self->m_fb_1; break;
case 1: *value = self->m_damp_2; break;
case 2: *value = self->m_fb_3; break;
case 3: *value = self->m_spread_4; break;
default: break;
}
@@ -347,25 +347,25 @@ void * create(double sr, long vs) {
self->__commonstate.vs = vs;
self->__commonstate.params = (ParamInfo *)genlib_sysmem_newptr(4 * sizeof(ParamInfo));
self->__commonstate.numparams = 4;
// initialize parameter 0 ("m_spread_1")
// initialize parameter 0 ("m_fb_1")
pi = self->__commonstate.params + 0;
pi->name = "spread";
pi->name = "fb2";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_spread_1;
pi->defaultvalue = self->m_fb_1;
pi->defaultref = 0;
pi->hasinputminmax = false;
pi->inputmin = 0;
pi->inputmax = 1;
pi->hasminmax = true;
pi->outputmin = 0;
pi->outputmax = 400;
pi->outputmax = 1;
pi->exp = 0;
pi->units = ""; // no units defined
// initialize parameter 1 ("m_fb_2")
// initialize parameter 1 ("m_damp_2")
pi = self->__commonstate.params + 1;
pi->name = "fb1";
pi->name = "damp";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_fb_2;
pi->defaultvalue = self->m_damp_2;
pi->defaultref = 0;
pi->hasinputminmax = false;
pi->inputmin = 0;
@@ -375,11 +375,11 @@ void * create(double sr, long vs) {
pi->outputmax = 1;
pi->exp = 0;
pi->units = ""; // no units defined
// initialize parameter 2 ("m_damp_3")
// initialize parameter 2 ("m_fb_3")
pi = self->__commonstate.params + 2;
pi->name = "damp";
pi->name = "fb1";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_damp_3;
pi->defaultvalue = self->m_fb_3;
pi->defaultref = 0;
pi->hasinputminmax = false;
pi->inputmin = 0;
@@ -389,18 +389,18 @@ void * create(double sr, long vs) {
pi->outputmax = 1;
pi->exp = 0;
pi->units = ""; // no units defined
// initialize parameter 3 ("m_fb_4")
// initialize parameter 3 ("m_spread_4")
pi = self->__commonstate.params + 3;
pi->name = "fb2";
pi->name = "spread";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_fb_4;
pi->defaultvalue = self->m_spread_4;
pi->defaultref = 0;
pi->hasinputminmax = false;
pi->inputmin = 0;
pi->inputmax = 1;
pi->hasminmax = true;
pi->outputmin = 0;
pi->outputmax = 1;
pi->outputmax = 400;
pi->exp = 0;
pi->units = ""; // no units defined

+ 37
- 0
plugins/freeverb/freeverb.h View File

@@ -0,0 +1,37 @@
/*******************************************************************************************************************
Copyright (c) 2012 Cycling '74

Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice 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 NONINFRINGEMENT.
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 freeverb {

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, double value, void *ref);
void getparameter(CommonState *cself, long index, double *value);
void * create(double sr, long vs);
void destroy(CommonState *cself);

} // freeverb::

+ 532
- 0
plugins/freeverb/gen~.freeverb.maxpat View File

@@ -0,0 +1,532 @@
{
"patcher" : {
"fileversion" : 1,
"appversion" : {
"major" : 6,
"minor" : 1,
"revision" : 9,
"architecture" : "x86"
}
,
"rect" : [ 100.0, 96.0, 681.0, 461.0 ],
"bglocked" : 0,
"openinpresentation" : 0,
"default_fontsize" : 12.0,
"default_fontface" : 0,
"default_fontname" : "Arial",
"gridonopen" : 0,
"gridsize" : [ 15.0, 15.0 ],
"gridsnaponopen" : 0,
"statusbarvisible" : 2,
"toolbarvisible" : 1,
"boxanimatetime" : 200,
"imprint" : 0,
"enablehscroll" : 1,
"enablevscroll" : 1,
"devicewidth" : 0.0,
"description" : "",
"digest" : "",
"tags" : "",
"boxes" : [ {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-17",
"maxclass" : "message",
"numinlets" : 2,
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 278.5, 251.0, 70.0, 18.0 ],
"text" : "exportcode"
}

}
, {
"box" : {
"id" : "obj-11",
"maxclass" : "live.gain~",
"numinlets" : 2,
"numoutlets" : 5,
"orientation" : 1,
"outlettype" : [ "signal", "signal", "", "float", "list" ],
"parameter_enable" : 1,
"patching_rect" : [ 85.0, 306.0, 136.0, 48.0 ],
"presentation_rect" : [ 0.0, 0.0, 50.0, 48.0 ],
"saved_attribute_attributes" : {
"valueof" : {
"parameter_longname" : "live.gain~",
"parameter_shortname" : "live.gain~",
"parameter_type" : 0,
"parameter_mmin" : -70.0,
"parameter_mmax" : 6.0,
"parameter_initial_enable" : 1,
"parameter_initial" : [ -70 ],
"parameter_unitstyle" : 4
}

}
,
"varname" : "live.gain~"
}

}
, {
"box" : {
"bgcolor" : [ 1.0, 1.0, 1.0, 1.0 ],
"border" : 1.75,
"bordercolor" : [ 0.501961, 0.501961, 0.501961, 1.0 ],
"id" : "obj-15",
"local" : 1,
"maxclass" : "ezdac~",
"numinlets" : 2,
"numoutlets" : 0,
"patching_rect" : [ 85.0, 363.0, 44.0, 44.0 ],
"prototypename" : "helpfile"
}

}
, {
"box" : {
"args" : [ "@loop", 1, "@file", 5 ],
"id" : "obj-4",
"maxclass" : "bpatcher",
"name" : "demosound.maxpat",
"numinlets" : 0,
"numoutlets" : 1,
"outlettype" : [ "signal" ],
"patching_rect" : [ 28.0, 75.0, 240.0, 105.0 ]
}

}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"hidden" : 1,
"id" : "obj-8",
"maxclass" : "newobj",
"numinlets" : 1,
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 360.0, 150.0, 81.0, 20.0 ],
"text" : "loadmess 74"
}

}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-6",
"maxclass" : "number",
"numinlets" : 1,
"numoutlets" : 2,
"outlettype" : [ "int", "bang" ],
"parameter_enable" : 0,
"patching_rect" : [ 359.0, 184.0, 50.0, 20.0 ]
}

}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"frgb" : 0.0,
"id" : "obj-7",
"maxclass" : "comment",
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 15.0, 45.0, 375.0, 20.0 ],
"text" : "An implementation of the well-known 'freeverb' algorithm."
}

}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-5",
"maxclass" : "message",
"numinlets" : 2,
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 359.0, 214.0, 65.0, 18.0 ],
"text" : "spread $1"
}

}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-2",
"maxclass" : "newobj",
"numinlets" : 1,
"numoutlets" : 1,
"outlettype" : [ "signal" ],
"patching_rect" : [ 224.0, 274.0, 124.0, 20.0 ],
"text" : "gen~ @gen freeverb"
}

}
, {
"box" : {
"fontname" : "Arial Bold Italic",
"fontsize" : 18.0,
"frgb" : 0.0,
"id" : "obj-19",
"maxclass" : "comment",
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 15.0, 15.0, 226.0, 27.0 ],
"text" : "Freeverb"
}

}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-14",
"maxclass" : "flonum",
"numinlets" : 1,
"numoutlets" : 2,
"outlettype" : [ "float", "bang" ],
"parameter_enable" : 0,
"patching_rect" : [ 284.0, 184.0, 50.0, 20.0 ]
}

}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-13",
"maxclass" : "flonum",
"numinlets" : 1,
"numoutlets" : 2,
"outlettype" : [ "float", "bang" ],
"parameter_enable" : 0,
"patching_rect" : [ 224.0, 184.0, 50.0, 20.0 ]
}

}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-12",
"maxclass" : "flonum",
"numinlets" : 1,
"numoutlets" : 2,
"outlettype" : [ "float", "bang" ],
"parameter_enable" : 0,
"patching_rect" : [ 164.0, 184.0, 50.0, 20.0 ]
}

}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-10",
"maxclass" : "message",
"numinlets" : 2,
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 284.0, 214.0, 59.0, 18.0 ],
"text" : "damp $1"
}

}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-9",
"maxclass" : "message",
"numinlets" : 2,
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 224.0, 214.0, 45.0, 18.0 ],
"text" : "fb2 $1"
}

}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-3",
"maxclass" : "message",
"numinlets" : 2,
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 164.0, 214.0, 45.0, 18.0 ],
"text" : "fb1 $1"
}

}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-1",
"maxclass" : "newobj",
"numinlets" : 1,
"numoutlets" : 1,
"outlettype" : [ "signal" ],
"patching_rect" : [ 85.0, 274.0, 124.0, 20.0 ],
"text" : "gen~ @gen freeverb"
}

}
],
"lines" : [ {
"patchline" : {
"destination" : [ "obj-11", 0 ],
"disabled" : 0,
"hidden" : 0,
"source" : [ "obj-1", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-1", 0 ],
"disabled" : 0,
"hidden" : 0,
"midpoints" : [ 293.5, 245.0, 94.5, 245.0 ],
"source" : [ "obj-10", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-2", 0 ],
"disabled" : 0,
"hidden" : 0,
"midpoints" : [ 293.5, 245.0, 233.5, 245.0 ],
"source" : [ "obj-10", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-15", 1 ],
"disabled" : 0,
"hidden" : 0,
"source" : [ "obj-11", 1 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-15", 0 ],
"disabled" : 0,
"hidden" : 0,
"source" : [ "obj-11", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-3", 0 ],
"disabled" : 0,
"hidden" : 0,
"source" : [ "obj-12", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-9", 0 ],
"disabled" : 0,
"hidden" : 0,
"source" : [ "obj-13", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-10", 0 ],
"disabled" : 0,
"hidden" : 0,
"source" : [ "obj-14", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-2", 0 ],
"disabled" : 0,
"hidden" : 0,
"source" : [ "obj-17", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-11", 1 ],
"disabled" : 0,
"hidden" : 0,
"source" : [ "obj-2", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-1", 0 ],
"disabled" : 0,
"hidden" : 0,
"midpoints" : [ 173.5, 245.0, 94.5, 245.0 ],
"source" : [ "obj-3", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-2", 0 ],
"disabled" : 0,
"hidden" : 0,
"midpoints" : [ 173.5, 245.0, 233.5, 245.0 ],
"source" : [ "obj-3", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-1", 0 ],
"disabled" : 0,
"hidden" : 0,
"midpoints" : [ 37.5, 267.5, 94.5, 267.5 ],
"source" : [ "obj-4", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-2", 0 ],
"disabled" : 0,
"hidden" : 0,
"midpoints" : [ 37.5, 262.0, 233.5, 262.0 ],
"source" : [ "obj-4", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-2", 0 ],
"disabled" : 0,
"hidden" : 0,
"midpoints" : [ 368.5, 259.0, 233.5, 259.0 ],
"source" : [ "obj-5", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-5", 0 ],
"disabled" : 0,
"hidden" : 0,
"source" : [ "obj-6", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-6", 0 ],
"disabled" : 0,
"hidden" : 1,
"source" : [ "obj-8", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-1", 0 ],
"disabled" : 0,
"hidden" : 0,
"midpoints" : [ 233.5, 245.0, 94.5, 245.0 ],
"source" : [ "obj-9", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-2", 0 ],
"disabled" : 0,
"hidden" : 0,
"midpoints" : [ 233.5, 245.0, 233.5, 245.0 ],
"source" : [ "obj-9", 0 ]
}

}
],
"parameters" : {
"obj-4::obj-35" : [ "[5]", "Level", 0 ],
"obj-4::obj-21::obj-6" : [ "live.tab[3]", "live.tab[1]", 0 ],
"obj-4::obj-32" : [ "[8]", "[2]", 0 ],
"obj-11" : [ "live.gain~", "live.gain~", 0 ]
}
,
"dependency_cache" : [ {
"name" : "freeverb.gendsp",
"bootpath" : "/Applications/Max 6.1/examples/gen",
"patcherrelativepath" : "../../../../../Applications/Max 6.1/examples/gen",
"type" : "gDSP",
"implicit" : 1
}
, {
"name" : "freeverb_allpass.gendsp",
"bootpath" : "/Applications/Max 6.1/examples/gen",
"patcherrelativepath" : "../../../../../Applications/Max 6.1/examples/gen",
"type" : "gDSP",
"implicit" : 1
}
, {
"name" : "freeverb_comb.gendsp",
"bootpath" : "/Applications/Max 6.1/examples/gen",
"patcherrelativepath" : "../../../../../Applications/Max 6.1/examples/gen",
"type" : "gDSP",
"implicit" : 1
}
, {
"name" : "demosound.maxpat",
"bootpath" : "/Applications/Max 6.1/Cycling '74/msp-help",
"patcherrelativepath" : "../../../../../Applications/Max 6.1/Cycling '74/msp-help",
"type" : "JSON",
"implicit" : 1
}
, {
"name" : "sine.svg",
"bootpath" : "/Applications/Max 6.1/patches/picts/m4l-picts",
"patcherrelativepath" : "../../../../../Applications/Max 6.1/patches/picts/m4l-picts",
"type" : "svg ",
"implicit" : 1
}
, {
"name" : "saw.svg",
"bootpath" : "/Applications/Max 6.1/patches/picts/m4l-picts",
"patcherrelativepath" : "../../../../../Applications/Max 6.1/patches/picts/m4l-picts",
"type" : "svg ",
"implicit" : 1
}
, {
"name" : "square.svg",
"bootpath" : "/Applications/Max 6.1/patches/picts/m4l-picts",
"patcherrelativepath" : "../../../../../Applications/Max 6.1/patches/picts/m4l-picts",
"type" : "svg ",
"implicit" : 1
}
, {
"name" : "random.svg",
"bootpath" : "/Applications/Max 6.1/patches/picts/m4l-picts",
"patcherrelativepath" : "../../../../../Applications/Max 6.1/patches/picts/m4l-picts",
"type" : "svg ",
"implicit" : 1
}
]
}

}

BIN
plugins/gigaverb/.DS_Store View File


+ 537
- 0
plugins/gigaverb/gen_exported.cpp View File

@@ -0,0 +1,537 @@
#include "gen_exported.h"

namespace gen_exported {


/*******************************************************************************************************************
Copyright (c) 2012 Cycling '74

Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice 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 NONINFRINGEMENT.
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;
Delay m_delay_11;
Delay m_delay_9;
Delay m_delay_8;
Delay m_delay_7;
Delay m_delay_10;
Delay m_delay_12;
Delay m_delay_16;
Delay m_delay_13;
Delay m_delay_14;
Delay m_delay_6;
Delay m_delay_15;
Delay m_delay_17;
double m_bandwidth_22;
double m_tail_23;
double m_spread_21;
double m_revtime_19;
double m_roomsize_20;
double m_damping_18;
double m_early_25;
double m_history_5;
double m_dry_24;
double samplerate;
double m_history_2;
double m_history_1;
double m_history_4;
double m_history_3;
int vectorsize;
int __exception;
// re-initialize all member variables;
inline void reset(double __sr, int __vs) {
__exception = 0;
vectorsize = __vs;
samplerate = __sr;
m_history_1 = 0;
m_history_2 = 0;
m_history_3 = 0;
m_history_4 = 0;
m_history_5 = 0;
m_delay_6.reset("m_delay_6", 5000);
m_delay_7.reset("m_delay_7", 7000);
m_delay_8.reset("m_delay_8", 15000);
m_delay_9.reset("m_delay_9", 6000);
m_delay_10.reset("m_delay_10", 16000);
m_delay_11.reset("m_delay_11", 48000);
m_delay_12.reset("m_delay_12", 10000);
m_delay_13.reset("m_delay_13", 12000);
m_delay_14.reset("m_delay_14", 48000);
m_delay_15.reset("m_delay_15", 48000);
m_delay_16.reset("m_delay_16", 48000);
m_delay_17.reset("m_delay_17", 48000);
m_damping_18 = 0.7;
m_revtime_19 = 11;
m_roomsize_20 = 75;
m_spread_21 = 23;
m_bandwidth_22 = 0.5;
m_tail_23 = 0.25;
m_dry_24 = 1;
m_early_25 = 0.25;
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;
};
double rsub_999 = (1 - m_bandwidth_22);
double expr_1051 = safepow(0.001, safediv(1, (m_revtime_19 * 44100)));
double expr_1052 = safediv((m_roomsize_20 * 44100), 340);
double mul_988 = (expr_1052 * 0.63245);
double expr_1043 = (-safepow(expr_1051, mul_988));
double mul_990 = (expr_1052 * 0.81649);
double expr_1045 = (-safepow(expr_1051, mul_990));
double mul_989 = (expr_1052 * 0.7071);
double expr_1044 = (-safepow(expr_1051, mul_989));
double mul_991 = (expr_1052 * 1);
double expr_1050 = (-safepow(expr_1051, mul_991));
double mul_985 = (expr_1052 * 0.000527);
int int_984 = int(mul_985);
double mul_925 = (m_spread_21 * -0.380445);
double add_924 = (mul_925 + 931);
double rsub_921 = (1341 - add_924);
double mul_934 = (int_984 * rsub_921);
double mul_953 = (m_spread_21 * 0.376623);
double add_952 = (mul_953 + 931);
double rsub_949 = (1341 - add_952);
double mul_960 = (int_984 * rsub_949);
double add_914 = (expr_1052 + 5);
double expr_1046 = safepow(expr_1051, add_914);
double mul_920 = (expr_1052 * 0.41);
double add_917 = (mul_920 + 5);
double expr_1049 = safepow(expr_1051, add_917);
double mul_919 = (expr_1052 * 0.3);
double add_916 = (mul_919 + 5);
double expr_1048 = safepow(expr_1051, add_916);
double mul_918 = (expr_1052 * 0.155);
double add_915 = (mul_918 + 5);
double expr_1047 = safepow(expr_1051, add_915);
double mul_927 = (m_spread_21 * -0.568366);
double add_923 = (mul_927 + 369);
double rsub_922 = (add_924 - add_923);
double mul_941 = (int_984 * rsub_922);
double mul_983 = (expr_1052 * 0.110732);
double mul_969 = (m_spread_21 * 0.125541);
double add_951 = (mul_969 + 369);
double rsub_950 = (add_952 - add_951);
double mul_967 = (int_984 * rsub_950);
double add_926 = (mul_927 + 159);
double mul_948 = (int_984 * add_926);
double add_968 = (mul_969 + 159);
double mul_976 = (int_984 * add_968);
// the main sample loop;
while ((__n--)) {
const double in1 = (*(__in1++));
const double in2 = (*(__in2++));
double mul_846 = (in2 * m_dry_24);
double mul_858 = (in1 * m_dry_24);
double mul_848 = ((in1 + in2) * 0.707);
double mix_1070 = (mul_848 + (rsub_999 * (m_history_5 - mul_848)));
double mix_998 = mix_1070;
double tap_888 = m_delay_17.read_linear(mul_988);
double mul_884 = (tap_888 * expr_1043);
double mix_1071 = (mul_884 + (m_damping_18 * (m_history_4 - mul_884)));
double mix_886 = mix_1071;
double tap_900 = m_delay_16.read_linear(mul_990);
double mul_896 = (tap_900 * expr_1045);
double mix_1072 = (mul_896 + (m_damping_18 * (m_history_3 - mul_896)));
double mix_898 = mix_1072;
double tap_894 = m_delay_15.read_linear(mul_989);
double mul_890 = (tap_894 * expr_1044);
double mix_1073 = (mul_890 + (m_damping_18 * (m_history_2 - mul_890)));
double mix_892 = mix_1073;
double tap_996 = m_delay_14.read_linear(mul_991);
double mul_987 = (tap_996 * expr_1050);
double mix_1074 = (mul_987 + (m_damping_18 * (m_history_1 - mul_987)));
double mix_994 = mix_1074;
double tap_933 = m_delay_13.read_linear(mul_934);
double mul_931 = (tap_933 * 0.625);
double tap_959 = m_delay_12.read_linear(mul_960);
double mul_957 = (tap_959 * 0.625);
double add_878 = (mix_994 + mix_898);
double add_876 = (mix_892 + mix_886);
double add_871 = (add_878 + add_876);
double mul_854 = (add_871 * 0.5);
double sub_875 = (add_878 - add_876);
double mul_857 = (sub_875 * 0.5);
double sub_877 = (mix_994 - mix_898);
double sub_874 = (mix_892 - mix_886);
double sub_873 = (sub_877 - sub_874);
double mul_856 = (sub_873 * 0.5);
double add_872 = (sub_877 + sub_874);
double rsub_870 = (0 - add_872);
double mul_855 = (rsub_870 * 0.5);
double tap_902 = m_delay_11.read_linear(add_917);
double tap_903 = m_delay_11.read_linear(add_916);
double tap_904 = m_delay_11.read_linear(add_915);
double tap_905 = m_delay_11.read_linear(add_914);
double mul_906 = (tap_905 * expr_1046);
double add_879 = (mul_854 + mul_906);
double mul_910 = (tap_903 * expr_1048);
double add_881 = (mul_856 + mul_910);
double mul_912 = (tap_902 * expr_1049);
double add_882 = (mul_857 + mul_912);
double mul_908 = (tap_904 * expr_1047);
double add_880 = (mul_855 + mul_908);
double tap_940 = m_delay_10.read_linear(mul_941);
double mul_938 = (tap_940 * 0.625);
double tap_982 = m_delay_9.read_linear(mul_983);
double tap_966 = m_delay_8.read_linear(mul_967);
double mul_964 = (tap_966 * 0.625);
double tap_947 = m_delay_7.read_linear(mul_948);
double mul_945 = (tap_947 * 0.75);
double mul_980 = (tap_982 * 0.75);
double sub_979 = (mix_998 - mul_980);
double mul_978 = (sub_979 * 0.75);
double add_977 = (mul_978 + tap_982);
double tap_975 = m_delay_6.read_linear(mul_976);
double mul_973 = (tap_975 * 0.75);
double mul_869 = (mul_857 * m_tail_23);
double mul_867 = (mul_855 * m_tail_23);
double add_853 = (mul_869 + mul_867);
double mul_868 = (mul_856 * m_tail_23);
double mul_866 = (mul_854 * m_tail_23);
double add_852 = (mul_868 + mul_866);
double sub_861 = (add_853 - add_852);
double mul_865 = (mul_912 * m_early_25);
double mul_863 = (mul_908 * m_early_25);
double add_851 = (mul_865 + mul_863);
double mul_864 = (mul_910 * m_early_25);
double mul_862 = (mul_906 * m_early_25);
double add_850 = (mul_864 + mul_862);
double sub_860 = (add_851 - add_850);
double add_847 = (sub_861 + sub_860);
double add_849 = (add_847 + in2);
double sub_944 = (add_849 - mul_945);
double mul_943 = (sub_944 * 0.75);
double add_942 = (mul_943 + tap_947);
double sub_937 = (add_942 - mul_938);
double mul_936 = (sub_937 * 0.625);
double add_935 = (mul_936 + tap_940);
double sub_930 = (add_935 - mul_931);
double mul_929 = (sub_930 * 0.625);
double add_928 = (mul_929 + tap_933);
double out2 = (mul_846 + add_928);
double add_859 = (add_847 + in1);
double sub_972 = (add_859 - mul_973);
double mul_971 = (sub_972 * 0.75);
double add_970 = (mul_971 + tap_975);
double sub_963 = (add_970 - mul_964);
double mul_962 = (sub_963 * 0.625);
double add_961 = (mul_962 + tap_966);
double sub_956 = (add_961 - mul_957);
double mul_955 = (sub_956 * 0.625);
double add_954 = (mul_955 + tap_959);
double out1 = (mul_858 + add_954);
double history_997_next_1065 = mix_998;
double history_885_next_1066 = mix_886;
double history_897_next_1067 = mix_898;
double history_891_next_1068 = mix_892;
double history_993_next_1069 = mix_994;
m_delay_17.write(add_879);
m_delay_16.write(add_881);
m_delay_15.write(add_880);
m_delay_14.write(add_882);
m_delay_13.write(sub_930);
m_delay_12.write(sub_956);
m_delay_11.write(add_977);
m_delay_10.write(sub_937);
m_delay_9.write(sub_979);
m_delay_8.write(sub_963);
m_delay_7.write(sub_944);
m_delay_6.write(sub_972);
m_history_5 = history_997_next_1065;
m_history_4 = history_885_next_1066;
m_history_3 = history_897_next_1067;
m_history_2 = history_891_next_1068;
m_history_1 = history_993_next_1069;
m_delay_6.step();
m_delay_7.step();
m_delay_8.step();
m_delay_9.step();
m_delay_10.step();
m_delay_11.step();
m_delay_12.step();
m_delay_13.step();
m_delay_14.step();
m_delay_15.step();
m_delay_16.step();
m_delay_17.step();
// assign results to output buffer;
(*(__out1++)) = out1;
(*(__out2++)) = out2;
};
return __exception;
};
inline void set_damping(double _value) {
m_damping_18 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value));
};
inline void set_revtime(double _value) {
m_revtime_19 = (_value < 0.1 ? 0.1 : (_value > 360 ? 360 : _value));
};
inline void set_roomsize(double _value) {
m_roomsize_20 = (_value < 0.1 ? 0.1 : (_value > 300 ? 300 : _value));
};
inline void set_spread(double _value) {
m_spread_21 = (_value < 0 ? 0 : (_value > 100 ? 100 : _value));
};
inline void set_bandwidth(double _value) {
m_bandwidth_22 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value));
};
inline void set_tail(double _value) {
m_tail_23 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value));
};
inline void set_dry(double _value) {
m_dry_24 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value));
};
inline void set_early(double _value) {
m_early_25 = (_value < 0 ? 0 : (_value > 1 ? 1 : _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 8; }

/// 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, double value, void *ref) {
State * self = (State *)cself;
switch (index) {
case 0: self->set_damping(value); break;
case 1: self->set_revtime(value); break;
case 2: self->set_roomsize(value); break;
case 3: self->set_spread(value); break;
case 4: self->set_bandwidth(value); break;
case 5: self->set_tail(value); break;
case 6: self->set_dry(value); break;
case 7: self->set_early(value); break;
default: break;
}
}

/// Get the value of a parameter of a State object

void getparameter(CommonState *cself, long index, double *value) {
State *self = (State *)cself;
switch (index) {
case 0: *value = self->m_damping_18; break;
case 1: *value = self->m_revtime_19; break;
case 2: *value = self->m_roomsize_20; break;
case 3: *value = self->m_spread_21; break;
case 4: *value = self->m_bandwidth_22; break;
case 5: *value = self->m_tail_23; break;
case 6: *value = self->m_dry_24; break;
case 7: *value = self->m_early_25; break;
default: break;
}
}

/// Allocate and configure a new State object and it's internal CommonState:

void * create(double 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(8 * sizeof(ParamInfo));
self->__commonstate.numparams = 8;
// initialize parameter 0 ("m_damping_18")
pi = self->__commonstate.params + 0;
pi->name = "damping";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_damping_18;
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_revtime_19")
pi = self->__commonstate.params + 1;
pi->name = "revtime";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_revtime_19;
pi->defaultref = 0;
pi->hasinputminmax = false;
pi->inputmin = 0;
pi->inputmax = 1;
pi->hasminmax = true;
pi->outputmin = 0.1;
pi->outputmax = 360;
pi->exp = 0;
pi->units = ""; // no units defined
// initialize parameter 2 ("m_roomsize_20")
pi = self->__commonstate.params + 2;
pi->name = "roomsize";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_roomsize_20;
pi->defaultref = 0;
pi->hasinputminmax = false;
pi->inputmin = 0;
pi->inputmax = 1;
pi->hasminmax = true;
pi->outputmin = 0.1;
pi->outputmax = 300;
pi->exp = 0;
pi->units = ""; // no units defined
// initialize parameter 3 ("m_spread_21")
pi = self->__commonstate.params + 3;
pi->name = "spread";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_spread_21;
pi->defaultref = 0;
pi->hasinputminmax = false;
pi->inputmin = 0;
pi->inputmax = 1;
pi->hasminmax = true;
pi->outputmin = 0;
pi->outputmax = 100;
pi->exp = 0;
pi->units = ""; // no units defined
// initialize parameter 4 ("m_bandwidth_22")
pi = self->__commonstate.params + 4;
pi->name = "bandwidth";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_bandwidth_22;
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_tail_23")
pi = self->__commonstate.params + 5;
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 6 ("m_dry_24")
pi = self->__commonstate.params + 6;
pi->name = "dry";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_dry_24;
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 7 ("m_early_25")
pi = self->__commonstate.params + 7;
pi->name = "early";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_early_25;
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::

plugins/Freeverb/gen_exported.h → plugins/gigaverb/gen_exported.h View File


+ 5364
- 0
plugins/gigaverb/gen~.gigaverb.maxpat
File diff suppressed because it is too large
View File


+ 4567
- 0
plugins/gigaverb/gigaverb.gendsp
File diff suppressed because it is too large
View File


BIN
plugins/pitchshift/.DS_Store View File


+ 358
- 0
plugins/pitchshift/gen_exported.cpp View File

@@ -0,0 +1,358 @@
#include "gen_exported.h"

namespace gen_exported {


/*******************************************************************************************************************
Copyright (c) 2012 Cycling '74

Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice 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 NONINFRINGEMENT.
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;
Delay m_delay_5;
Delta m_delta_14;
Delta m_delta_11;
Delta m_delta_20;
Delta m_delta_17;
Phasor m_phasor_10;
Sah m_sah_13;
Sah m_sah_12;
Sah m_sah_15;
Sah m_sah_16;
Sah m_sah_21;
Sah m_sah_19;
Sah m_sah_18;
Sah m_sah_22;
double samples_to_seconds;
double m_ratio_8;
double m_xfade_9;
double m_history_1;
double samplerate;
double m_history_3;
double m_history_2;
double m_blur_6;
double m_window_7;
double m_history_4;
int vectorsize;
int __exception;
// re-initialize all member variables;
inline void reset(double __sr, int __vs) {
__exception = 0;
vectorsize = __vs;
samplerate = __sr;
m_history_1 = 0;
m_history_2 = 0;
m_history_3 = 0;
m_history_4 = 0;
m_delay_5.reset("m_delay_5", 88200);
m_blur_6 = 0;
m_window_7 = 100;
m_ratio_8 = 0;
m_xfade_9 = 1;
samples_to_seconds = (1 / samplerate);
m_phasor_10.reset(0);
m_delta_11.reset(0);
m_sah_12.reset(0);
m_sah_13.reset(0);
m_delta_14.reset(0);
m_sah_15.reset(0);
m_sah_16.reset(0);
m_delta_17.reset(0);
m_sah_18.reset(0);
m_sah_19.reset(0);
m_delta_20.reset(0);
m_sah_21.reset(0);
m_sah_22.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];
if (__exception) {
return __exception;
} else if (( (__in1 == 0) || (__out1 == 0) || (__out2 == 0) )) {
__exception = GENLIB_ERR_NULL_BUFFER;
return __exception;
};
double mstosamps_1223 = (m_window_7 * (samplerate * 0.001));
double rsub_1209 = (1 - m_ratio_8);
double mul_1208 = (rsub_1209 * 1000);
double div_1207 = safediv(mul_1208, m_window_7);
samples_to_seconds = (1 / samplerate);
// the main sample loop;
while ((__n--)) {
const double in1 = (*(__in1++));
double noise_1159 = noise();
double abs_1177 = fabs(noise_1159);
double mul_1183 = (abs_1177 * m_blur_6);
double noise_1161 = noise();
double abs_1179 = fabs(noise_1161);
double mul_1189 = (abs_1179 * m_blur_6);
double noise_1160 = noise();
double abs_1178 = fabs(noise_1160);
double mul_1186 = (abs_1178 * m_blur_6);
double noise_1158 = noise();
double abs_1176 = fabs(noise_1158);
double mul_1180 = (abs_1176 * m_blur_6);
double phasor_1229 = m_phasor_10(div_1207, samples_to_seconds);
double add_1206 = ((m_history_4 + phasor_1229) + 0.5);
double mod_1205 = safemod(add_1206, 1);
double delta_1185 = m_delta_11(mod_1205);
double sah_1164 = m_sah_12(mul_1183, delta_1185, 0);
double sah_1184 = m_sah_13(mstosamps_1223, delta_1185, 0);
double mul_1173 = (sah_1184 * mod_1205);
double sub_1204 = (mod_1205 - 0.5);
double mul_1203 = (sub_1204 * 3.1415926535898);
double cos_1202 = cos(mul_1203);
double mul_1192 = (cos_1202 * cos_1202);
double add_1228 = ((m_history_3 + phasor_1229) + 0);
double mod_1227 = safemod(add_1228, 1);
double delta_1169 = m_delta_14(mod_1227);
double sah_1168 = m_sah_15(mul_1189, delta_1169, 0);
double sah_1190 = m_sah_16(mstosamps_1223, delta_1169, 0);
double mul_1175 = (sah_1190 * mod_1227);
double sub_1226 = (mod_1227 - 0.5);
double mul_1225 = (sub_1226 * 3.1415926535898);
double cos_1224 = cos(mul_1225);
double mul_1194 = (cos_1224 * cos_1224);
double add_1222 = ((m_history_2 + phasor_1229) + 0.25);
double mod_1221 = safemod(add_1222, 1);
double delta_1188 = m_delta_17(mod_1221);
double sah_1166 = m_sah_18(mul_1186, delta_1188, 0);
double sah_1187 = m_sah_19(mstosamps_1223, delta_1188, 0);
double mul_1174 = (sah_1187 * mod_1221);
double sub_1220 = (mod_1221 - 0.5);
double mul_1219 = (sub_1220 * 3.1415926535898);
double cos_1218 = cos(mul_1219);
double mul_1193 = (cos_1218 * cos_1218);
double add_1200 = ((m_history_1 + phasor_1229) + 0.75);
double mod_1199 = safemod(add_1200, 1);
double delta_1182 = m_delta_20(mod_1199);
double sah_1162 = m_sah_21(mul_1180, delta_1182, 0);
double sah_1181 = m_sah_22(mstosamps_1223, delta_1182, 0);
double mul_1172 = (sah_1181 * mod_1199);
double tap_1214 = m_delay_5.read_linear(mul_1175);
double tap_1215 = m_delay_5.read_linear(mul_1174);
double tap_1216 = m_delay_5.read_linear(mul_1173);
double tap_1217 = m_delay_5.read_linear(mul_1172);
double mul_1212 = (tap_1214 * mul_1194);
double mul_1201 = (tap_1216 * mul_1192);
double add_1245 = (mul_1201 + mul_1212);
double mix_1244 = (in1 + (m_xfade_9 * (add_1245 - in1)));
double out1 = mix_1244;
double mul_1211 = (tap_1215 * mul_1193);
double sub_1198 = (mod_1199 - 0.5);
double mul_1197 = (sub_1198 * 3.1415926535898);
double cos_1196 = cos(mul_1197);
double mul_1191 = (cos_1196 * cos_1196);
double mul_1195 = (tap_1217 * mul_1191);
double add_1247 = (mul_1195 + mul_1211);
double mix_1246 = (in1 + (m_xfade_9 * (add_1247 - in1)));
double out2 = mix_1246;
double history_1165_next_1240 = sah_1164;
double history_1170_next_1241 = sah_1168;
double history_1167_next_1242 = sah_1166;
double history_1163_next_1243 = sah_1162;
m_delay_5.write(in1);
m_history_4 = history_1165_next_1240;
m_history_3 = history_1170_next_1241;
m_history_2 = history_1167_next_1242;
m_history_1 = history_1163_next_1243;
m_delay_5.step();
// assign results to output buffer;
(*(__out1++)) = out1;
(*(__out2++)) = out2;
};
return __exception;
};
inline void set_blur(double _value) {
m_blur_6 = (_value < 0 ? 0 : (_value > 0.25 ? 0.25 : _value));
};
inline void set_window(double _value) {
m_window_7 = (_value < 0.1 ? 0.1 : (_value > 1000 ? 1000 : _value));
};
inline void set_ratio(double _value) {
m_ratio_8 = (_value < 0.25 ? 0.25 : (_value > 4 ? 4 : _value));
};
inline void set_xfade(double _value) {
m_xfade_9 = (_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 = 2;

int num_inputs() { return gen_kernel_numins; }
int num_outputs() { return gen_kernel_numouts; }
int num_params() { return 4; }

/// Assistive lables for the signal inputs and outputs

const char * gen_kernel_innames[] = { "in1" };
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, double value, void *ref) {
State * self = (State *)cself;
switch (index) {
case 0: self->set_blur(value); break;
case 1: self->set_window(value); break;
case 2: self->set_ratio(value); break;
case 3: self->set_xfade(value); break;
default: break;
}
}

/// Get the value of a parameter of a State object

void getparameter(CommonState *cself, long index, double *value) {
State *self = (State *)cself;
switch (index) {
case 0: *value = self->m_blur_6; break;
case 1: *value = self->m_window_7; break;
case 2: *value = self->m_ratio_8; break;
case 3: *value = self->m_xfade_9; break;
default: break;
}
}

/// Allocate and configure a new State object and it's internal CommonState:

void * create(double 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(4 * sizeof(ParamInfo));
self->__commonstate.numparams = 4;
// initialize parameter 0 ("m_blur_6")
pi = self->__commonstate.params + 0;
pi->name = "blur";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_blur_6;
pi->defaultref = 0;
pi->hasinputminmax = false;
pi->inputmin = 0;
pi->inputmax = 1;
pi->hasminmax = true;
pi->outputmin = 0;
pi->outputmax = 0.25;
pi->exp = 0;
pi->units = ""; // no units defined
// initialize parameter 1 ("m_window_7")
pi = self->__commonstate.params + 1;
pi->name = "window";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_window_7;
pi->defaultref = 0;
pi->hasinputminmax = false;
pi->inputmin = 0;
pi->inputmax = 1;
pi->hasminmax = true;
pi->outputmin = 0.1;
pi->outputmax = 1000;
pi->exp = 0;
pi->units = ""; // no units defined
// initialize parameter 2 ("m_ratio_8")
pi = self->__commonstate.params + 2;
pi->name = "ratio";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_ratio_8;
pi->defaultref = 0;
pi->hasinputminmax = false;
pi->inputmin = 0;
pi->inputmax = 1;
pi->hasminmax = true;
pi->outputmin = 0.25;
pi->outputmax = 4;
pi->exp = 0;
pi->units = ""; // no units defined
// initialize parameter 3 ("m_xfade_9")
pi = self->__commonstate.params + 3;
pi->name = "xfade";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_xfade_9;
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::

+ 37
- 0
plugins/pitchshift/gen_exported.h View File

@@ -0,0 +1,37 @@
/*******************************************************************************************************************
Copyright (c) 2012 Cycling '74

Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice 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 NONINFRINGEMENT.
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, double value, void *ref);
void getparameter(CommonState *cself, long index, double *value);
void * create(double sr, long vs);
void destroy(CommonState *cself);

} // gen_exported::

+ 5091
- 0
plugins/pitchshift/gen~.pitchshift.maxpat
File diff suppressed because it is too large
View File


+ 2222
- 0
plugins/pitchshift/pitchshift.gendsp
File diff suppressed because it is too large
View File


+ 798
- 0
plugins/shiroverb/gen_exported.cpp View File

@@ -0,0 +1,798 @@
#include "gen_exported.h"

namespace gen_exported {


/*******************************************************************************************************************
Copyright (c) 2012 Cycling '74

Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice 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 NONINFRINGEMENT.
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;
Delay m_delay_14;
Delay m_delay_18;
Delay m_delay_19;
Delay m_delay_15;
Delay m_delay_12;
Delay m_delay_17;
Delay m_delay_13;
Delay m_delay_21;
Delay m_delay_20;
Delay m_delay_22;
Delay m_delay_24;
Delay m_delay_23;
Delay m_delay_16;
Delta m_delta_43;
Delta m_delta_49;
Delta m_delta_46;
Delta m_delta_40;
Phasor m_phasor_39;
Sah m_sah_50;
Sah m_sah_51;
Sah m_sah_47;
Sah m_sah_48;
Sah m_sah_45;
Sah m_sah_42;
Sah m_sah_44;
Sah m_sah_41;
double m_mix_34;
double m_resonance_35;
double m_cutoff_36;
double m_window_38;
double m_blur_33;
double m_shift_37;
double samples_to_seconds;
double m_tail_32;
double m_ratio_25;
double m_damping_30;
double m_history_4;
double m_history_5;
double m_history_6;
double m_history_3;
double m_history_1;
double m_y_2;
double samplerate;
double m_spread_31;
double m_history_7;
double m_history_9;
double m_roomsize_28;
double m_decay_29;
double m_history_8;
double m_early_27;
double m_y_11;
double m_history_10;
double m_tone_26;
int vectorsize;
int __exception;
// re-initialize all member variables;
inline void reset(double __sr, int __vs) {
__exception = 0;
vectorsize = __vs;
samplerate = __sr;
m_history_1 = 0;
m_y_2 = 0;
m_history_3 = 0;
m_history_4 = 0;
m_history_5 = 0;
m_history_6 = 0;
m_history_7 = 0;
m_history_8 = 0;
m_history_9 = 0;
m_history_10 = 0;
m_y_11 = 0;
m_delay_12.reset("m_delay_12", 7000);
m_delay_13.reset("m_delay_13", 5000);
m_delay_14.reset("m_delay_14", 16000);
m_delay_15.reset("m_delay_15", 15000);
m_delay_16.reset("m_delay_16", 6000);
m_delay_17.reset("m_delay_17", 88200);
m_delay_18.reset("m_delay_18", 48000);
m_delay_19.reset("m_delay_19", 12000);
m_delay_20.reset("m_delay_20", 10000);
m_delay_21.reset("m_delay_21", 48000);
m_delay_22.reset("m_delay_22", 48000);
m_delay_23.reset("m_delay_23", 48000);
m_delay_24.reset("m_delay_24", 48000);
m_ratio_25 = 2;
m_tone_26 = 0.5;
m_early_27 = 0.25;
m_roomsize_28 = 75;
m_decay_29 = 11;
m_damping_30 = 0.7;
m_spread_31 = 23;
m_tail_32 = 0.25;
m_blur_33 = 0;
m_mix_34 = 1;
m_resonance_35 = 0;
m_cutoff_36 = 8000;
m_shift_37 = 1;
m_window_38 = 100;
samples_to_seconds = (1 / samplerate);
m_phasor_39.reset(0);
m_delta_40.reset(0);
m_sah_41.reset(0);
m_sah_42.reset(0);
m_delta_43.reset(0);
m_sah_44.reset(0);
m_sah_45.reset(0);
m_delta_46.reset(0);
m_sah_47.reset(0);
m_sah_48.reset(0);
m_delta_49.reset(0);
m_sah_50.reset(0);
m_sah_51.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];
if (__exception) {
return __exception;
} else if (( (__in1 == 0) || (__out1 == 0) || (__out2 == 0) )) {
__exception = GENLIB_ERR_NULL_BUFFER;
return __exception;
};
double rsub_11547 = (1 - m_tone_26);
double expr_11686 = safepow(0.001, safediv(1, (m_decay_29 * 44100)));
double expr_11687 = safediv((m_roomsize_28 * 44100), 340);
double mul_11539 = (expr_11687 * 1);
double expr_11685 = (-safepow(expr_11686, mul_11539));
double mul_11537 = (expr_11687 * 0.7071);
double expr_11679 = (-safepow(expr_11686, mul_11537));
double mul_11538 = (expr_11687 * 0.81649);
double expr_11680 = (-safepow(expr_11686, mul_11538));
double mul_11536 = (expr_11687 * 0.63245);
double expr_11678 = (-safepow(expr_11686, mul_11536));
double expr_11677 = safediv(((m_cutoff_36 * 2) * 3.1415926535898), 44100);
double cos_11390 = cos(expr_11677);
double mul_11392 = (m_resonance_35 * 0.125);
double exp_11393 = exp(mul_11392);
double mul_11391 = (exp_11393 * 0.882497);
double mul_11387 = (mul_11391 * mul_11391);
double mul_11389 = (cos_11390 * mul_11391);
double mul_11388 = (mul_11389 * -2);
double add_11386 = ((mul_11387 + mul_11388) + 1);
double mul_11533 = (expr_11687 * 0.000527);
int int_11532 = int(mul_11533);
double mstosamps_11374 = (m_window_38 * (samplerate * 0.001));
double add_11462 = (expr_11687 + 5);
double expr_11681 = safepow(expr_11686, add_11462);
double mul_11501 = (m_spread_31 * 0.376623);
double add_11500 = (mul_11501 + 931);
double rsub_11497 = (1341 - add_11500);
double mul_11508 = (int_11532 * rsub_11497);
double mul_11473 = (m_spread_31 * -0.380445);
double add_11472 = (mul_11473 + 931);
double rsub_11469 = (1341 - add_11472);
double mul_11482 = (int_11532 * rsub_11469);
double mul_11468 = (expr_11687 * 0.41);
double add_11465 = (mul_11468 + 5);
double expr_11684 = safepow(expr_11686, add_11465);
double mul_11467 = (expr_11687 * 0.3);
double add_11464 = (mul_11467 + 5);
double expr_11683 = safepow(expr_11686, add_11464);
double mul_11466 = (expr_11687 * 0.155);
double add_11463 = (mul_11466 + 5);
double expr_11682 = safepow(expr_11686, add_11463);
double rsub_11361 = (1 - m_ratio_25);
double mul_11360 = (rsub_11361 * 1000);
double div_11359 = safediv(mul_11360, m_window_38);
samples_to_seconds = (1 / samplerate);
double mul_11531 = (expr_11687 * 0.110732);
double mul_11517 = (m_spread_31 * 0.125541);
double add_11499 = (mul_11517 + 369);
double rsub_11498 = (add_11500 - add_11499);
double mul_11515 = (int_11532 * rsub_11498);
double mul_11475 = (m_spread_31 * -0.568366);
double add_11471 = (mul_11475 + 369);
double rsub_11470 = (add_11472 - add_11471);
double mul_11489 = (int_11532 * rsub_11470);
double add_11516 = (mul_11517 + 159);
double mul_11524 = (int_11532 * add_11516);
double add_11474 = (mul_11475 + 159);
double mul_11496 = (int_11532 * add_11474);
// the main sample loop;
while ((__n--)) {
const double in1 = (*(__in1++));
double noise_11310 = noise();
double abs_11328 = fabs(noise_11310);
double mul_11332 = (abs_11328 * m_blur_33);
double noise_11311 = noise();
double abs_11329 = fabs(noise_11311);
double mul_11335 = (abs_11329 * m_blur_33);
double noise_11313 = noise();
double abs_11331 = fabs(noise_11313);
double mul_11341 = (abs_11331 * m_blur_33);
double noise_11312 = noise();
double abs_11330 = fabs(noise_11312);
double mul_11338 = (abs_11330 * m_blur_33);
double tap_11544 = m_delay_24.read_linear(mul_11539);
double mul_11535 = (tap_11544 * expr_11685);
double mix_11730 = (mul_11535 + (m_damping_30 * (m_history_10 - mul_11535)));
double mix_11542 = mix_11730;
double tap_11442 = m_delay_23.read_linear(mul_11537);
double mul_11438 = (tap_11442 * expr_11679);
double mix_11731 = (mul_11438 + (m_damping_30 * (m_history_9 - mul_11438)));
double mix_11440 = mix_11731;
double tap_11448 = m_delay_22.read_linear(mul_11538);
double mul_11444 = (tap_11448 * expr_11680);
double mix_11732 = (mul_11444 + (m_damping_30 * (m_history_8 - mul_11444)));
double mix_11446 = mix_11732;
double tap_11436 = m_delay_21.read_linear(mul_11536);
double mul_11432 = (tap_11436 * expr_11678);
double mix_11733 = (mul_11432 + (m_damping_30 * (m_history_7 - mul_11432)));
double mix_11434 = mix_11733;
double mul_11383 = (mul_11387 * m_y_11);
double mul_11384 = (mul_11388 * m_y_2);
double add_11426 = (mix_11542 + mix_11446);
double add_11424 = (mix_11440 + mix_11434);
double sub_11423 = (add_11426 - add_11424);
double mul_11405 = (sub_11423 * 0.5);
double add_11419 = (add_11426 + add_11424);
double mul_11402 = (add_11419 * 0.5);
double tap_11507 = m_delay_20.read_linear(mul_11508);
double mul_11505 = (tap_11507 * 0.625);
double tap_11481 = m_delay_19.read_linear(mul_11482);
double mul_11479 = (tap_11481 * 0.625);
double sub_11425 = (mix_11542 - mix_11446);
double sub_11422 = (mix_11440 - mix_11434);
double sub_11421 = (sub_11425 - sub_11422);
double mul_11404 = (sub_11421 * 0.5);
double add_11420 = (sub_11425 + sub_11422);
double rsub_11418 = (0 - add_11420);
double mul_11403 = (rsub_11418 * 0.5);
double tap_11450 = m_delay_18.read_linear(add_11465);
double tap_11451 = m_delay_18.read_linear(add_11464);
double tap_11452 = m_delay_18.read_linear(add_11463);
double tap_11453 = m_delay_18.read_linear(add_11462);
double mul_11460 = (tap_11450 * expr_11684);
double add_11430 = (mul_11405 + mul_11460);
double mul_11458 = (tap_11451 * expr_11683);
double add_11429 = (mul_11404 + mul_11458);
double mul_11454 = (tap_11453 * expr_11681);
double add_11427 = (mul_11402 + mul_11454);
double mul_11456 = (tap_11452 * expr_11682);
double add_11428 = (mul_11403 + mul_11456);
double phasor_11380 = m_phasor_39(div_11359, samples_to_seconds);
double add_11352 = ((m_history_6 + phasor_11380) + 0.75);
double mod_11351 = safemod(add_11352, 1);
double delta_11334 = m_delta_40(mod_11351);
double sah_11314 = m_sah_41(mul_11332, delta_11334, 0);
double sah_11333 = m_sah_42(mstosamps_11374, delta_11334, 0);
double mul_11324 = (sah_11333 * mod_11351);
double sub_11350 = (mod_11351 - 0.5);
double mul_11349 = (sub_11350 * 3.1415926535898);
double cos_11348 = cos(mul_11349);
double mul_11343 = (cos_11348 * cos_11348);
double add_11358 = ((m_history_5 + phasor_11380) + 0.5);
double mod_11357 = safemod(add_11358, 1);
double delta_11337 = m_delta_43(mod_11357);
double sah_11316 = m_sah_44(mul_11335, delta_11337, 0);
double sah_11336 = m_sah_45(mstosamps_11374, delta_11337, 0);
double mul_11325 = (sah_11336 * mod_11357);
double sub_11356 = (mod_11357 - 0.5);
double mul_11355 = (sub_11356 * 3.1415926535898);
double cos_11354 = cos(mul_11355);
double mul_11344 = (cos_11354 * cos_11354);
double add_11379 = ((m_history_4 + phasor_11380) + 0);
double mod_11378 = safemod(add_11379, 1);
double delta_11321 = m_delta_46(mod_11378);
double sah_11320 = m_sah_47(mul_11341, delta_11321, 0);
double sah_11342 = m_sah_48(mstosamps_11374, delta_11321, 0);
double mul_11327 = (sah_11342 * mod_11378);
double sub_11377 = (mod_11378 - 0.5);
double mul_11376 = (sub_11377 * 3.1415926535898);
double cos_11375 = cos(mul_11376);
double mul_11346 = (cos_11375 * cos_11375);
double add_11373 = ((m_history_3 + phasor_11380) + 0.25);
double mod_11372 = safemod(add_11373, 1);
double delta_11340 = m_delta_49(mod_11372);
double sah_11318 = m_sah_50(mul_11338, delta_11340, 0);
double sah_11339 = m_sah_51(mstosamps_11374, delta_11340, 0);
double mul_11326 = (sah_11339 * mod_11372);
double tap_11365 = m_delay_17.read_linear(mul_11327);
double tap_11366 = m_delay_17.read_linear(mul_11326);
double tap_11367 = m_delay_17.read_linear(mul_11325);
double tap_11368 = m_delay_17.read_linear(mul_11324);
double mul_11347 = (tap_11368 * mul_11343);
double mul_11353 = (tap_11367 * mul_11344);
double mul_11363 = (tap_11365 * mul_11346);
double sub_11371 = (mod_11372 - 0.5);
double mul_11370 = (sub_11371 * 3.1415926535898);
double cos_11369 = cos(mul_11370);
double mul_11345 = (cos_11369 * cos_11369);
double mul_11362 = (tap_11366 * mul_11345);
double mul_11385 = ((((mul_11363 + mul_11362) + mul_11353) + mul_11347) * add_11386);
double sub_11382 = (mul_11385 - (mul_11383 + mul_11384));
double mix_11734 = (in1 + (m_shift_37 * (sub_11382 - in1)));
double mix_11323 = mix_11734;
double mul_11396 = (mix_11323 * 0.707);
double mix_11735 = (mul_11396 + (rsub_11547 * (m_history_1 - mul_11396)));
double mix_11546 = mix_11735;
double tap_11530 = m_delay_16.read_linear(mul_11531);
double mul_11528 = (tap_11530 * 0.75);
double sub_11527 = (mix_11546 - mul_11528);
double mul_11526 = (sub_11527 * 0.75);
double add_11525 = (mul_11526 + tap_11530);
double tap_11514 = m_delay_15.read_linear(mul_11515);
double mul_11512 = (tap_11514 * 0.625);
double tap_11488 = m_delay_14.read_linear(mul_11489);
double mul_11486 = (tap_11488 * 0.625);
double tap_11523 = m_delay_13.read_linear(mul_11524);
double mul_11521 = (tap_11523 * 0.75);
double tap_11495 = m_delay_12.read_linear(mul_11496);
double mul_11493 = (tap_11495 * 0.75);
double mul_11417 = (mul_11405 * m_tail_32);
double mul_11415 = (mul_11403 * m_tail_32);
double add_11401 = (mul_11417 + mul_11415);
double mul_11416 = (mul_11404 * m_tail_32);
double mul_11414 = (mul_11402 * m_tail_32);
double add_11400 = (mul_11416 + mul_11414);
double sub_11409 = (add_11401 - add_11400);
double mul_11413 = (mul_11460 * m_early_27);
double mul_11411 = (mul_11456 * m_early_27);
double add_11399 = (mul_11413 + mul_11411);
double mul_11412 = (mul_11458 * m_early_27);
double mul_11410 = (mul_11454 * m_early_27);
double add_11398 = (mul_11412 + mul_11410);
double sub_11408 = (add_11399 - add_11398);
double add_11395 = (sub_11409 + sub_11408);
double add_11407 = (add_11395 + mix_11323);
double sub_11520 = (add_11407 - mul_11521);
double mul_11519 = (sub_11520 * 0.75);
double add_11518 = (mul_11519 + tap_11523);
double sub_11511 = (add_11518 - mul_11512);
double mul_11510 = (sub_11511 * 0.625);
double add_11509 = (mul_11510 + tap_11514);
double sub_11504 = (add_11509 - mul_11505);
double mul_11503 = (sub_11504 * 0.625);
double add_11502 = (mul_11503 + tap_11507);
double mul_11406 = (add_11502 * m_mix_34);
double out1 = (mul_11406 + in1);
double add_11397 = (add_11395 + mix_11323);
double sub_11492 = (add_11397 - mul_11493);
double mul_11491 = (sub_11492 * 0.75);
double add_11490 = (mul_11491 + tap_11495);
double sub_11485 = (add_11490 - mul_11486);
double mul_11484 = (sub_11485 * 0.625);
double add_11483 = (mul_11484 + tap_11488);
double sub_11478 = (add_11483 - mul_11479);
double mul_11477 = (sub_11478 * 0.625);
double add_11476 = (mul_11477 + tap_11481);
double mul_11394 = (add_11476 * m_mix_34);
double out2 = (mul_11394 + in1);
double y2_next_11701 = m_y_2;
double history_11541_next_11702 = mix_11542;
double history_11439_next_11703 = mix_11440;
double history_11445_next_11704 = mix_11446;
double history_11433_next_11705 = mix_11434;
double history_11315_next_11706 = sah_11314;
double history_11317_next_11707 = sah_11316;
double history_11322_next_11708 = sah_11320;
double history_11319_next_11709 = sah_11318;
double y1_next_11710 = sub_11382;
double history_11545_next_11711 = mix_11546;
m_delay_24.write(add_11430);
m_delay_23.write(add_11428);
m_delay_22.write(add_11429);
m_delay_21.write(add_11427);
m_delay_20.write(sub_11504);
m_delay_19.write(sub_11478);
m_delay_18.write(add_11525);
m_delay_17.write(in1);
m_delay_16.write(sub_11527);
m_delay_15.write(sub_11511);
m_delay_14.write(sub_11485);
m_delay_13.write(sub_11520);
m_delay_12.write(sub_11492);
m_y_11 = y2_next_11701;
m_history_10 = history_11541_next_11702;
m_history_9 = history_11439_next_11703;
m_history_8 = history_11445_next_11704;
m_history_7 = history_11433_next_11705;
m_history_6 = history_11315_next_11706;
m_history_5 = history_11317_next_11707;
m_history_4 = history_11322_next_11708;
m_history_3 = history_11319_next_11709;
m_y_2 = y1_next_11710;
m_history_1 = history_11545_next_11711;
m_delay_12.step();
m_delay_13.step();
m_delay_14.step();
m_delay_15.step();
m_delay_16.step();
m_delay_17.step();
m_delay_18.step();
m_delay_19.step();
m_delay_20.step();
m_delay_21.step();
m_delay_22.step();
m_delay_23.step();
m_delay_24.step();
// assign results to output buffer;
(*(__out1++)) = out1;
(*(__out2++)) = out2;
};
return __exception;
};
inline void set_ratio(double _value) {
m_ratio_25 = (_value < 0.5 ? 0.5 : (_value > 2 ? 2 : _value));
};
inline void set_tone(double _value) {
m_tone_26 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value));
};
inline void set_early(double _value) {
m_early_27 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value));
};
inline void set_roomsize(double _value) {
m_roomsize_28 = (_value < 0.1 ? 0.1 : (_value > 300 ? 300 : _value));
};
inline void set_decay(double _value) {
m_decay_29 = (_value < 0.1 ? 0.1 : (_value > 360 ? 360 : _value));
};
inline void set_damping(double _value) {
m_damping_30 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value));
};
inline void set_spread(double _value) {
m_spread_31 = (_value < 0 ? 0 : (_value > 100 ? 100 : _value));
};
inline void set_tail(double _value) {
m_tail_32 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value));
};
inline void set_blur(double _value) {
m_blur_33 = (_value < 0 ? 0 : (_value > 0.25 ? 0.25 : _value));
};
inline void set_mix(double _value) {
m_mix_34 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value));
};
inline void set_resonance(double _value) {
m_resonance_35 = (_value < 0 ? 0 : (_value > 0.5 ? 0.5 : _value));
};
inline void set_cutoff(double _value) {
m_cutoff_36 = (_value < 0 ? 0 : (_value > 8000 ? 8000 : _value));
};
inline void set_shift(double _value) {
m_shift_37 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value));
};
inline void set_window(double _value) {
m_window_38 = (_value < 0.1 ? 0.1 : (_value > 1000 ? 1000 : _value));
};
} State;


///
/// Configuration for the genlib API
///

/// Number of signal inputs and outputs

int gen_kernel_numins = 1;
int gen_kernel_numouts = 2;

int num_inputs() { return gen_kernel_numins; }
int num_outputs() { return gen_kernel_numouts; }
int num_params() { return 14; }

/// Assistive lables for the signal inputs and outputs

const char * gen_kernel_innames[] = { "in1" };
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, double value, void *ref) {
State * self = (State *)cself;
switch (index) {
case 0: self->set_ratio(value); break;
case 1: self->set_tone(value); break;
case 2: self->set_early(value); break;
case 3: self->set_roomsize(value); break;
case 4: self->set_decay(value); break;
case 5: self->set_damping(value); break;
case 6: self->set_spread(value); break;
case 7: self->set_tail(value); break;
case 8: self->set_blur(value); break;
case 9: self->set_mix(value); break;
case 10: self->set_resonance(value); break;
case 11: self->set_cutoff(value); break;
case 12: self->set_shift(value); break;
case 13: self->set_window(value); break;
default: break;
}
}

/// Get the value of a parameter of a State object

void getparameter(CommonState *cself, long index, double *value) {
State *self = (State *)cself;
switch (index) {
case 0: *value = self->m_ratio_25; break;
case 1: *value = self->m_tone_26; break;
case 2: *value = self->m_early_27; break;
case 3: *value = self->m_roomsize_28; break;
case 4: *value = self->m_decay_29; break;
case 5: *value = self->m_damping_30; break;
case 6: *value = self->m_spread_31; break;
case 7: *value = self->m_tail_32; break;
case 8: *value = self->m_blur_33; break;
case 9: *value = self->m_mix_34; break;
case 10: *value = self->m_resonance_35; break;
case 11: *value = self->m_cutoff_36; break;
case 12: *value = self->m_shift_37; break;
case 13: *value = self->m_window_38; break;
default: break;
}
}

/// Allocate and configure a new State object and it's internal CommonState:

void * create(double 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(14 * sizeof(ParamInfo));
self->__commonstate.numparams = 14;
// initialize parameter 0 ("m_ratio_25")
pi = self->__commonstate.params + 0;
pi->name = "ratio";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_ratio_25;
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 1 ("m_tone_26")
pi = self->__commonstate.params + 1;
pi->name = "tone";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_tone_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_early_27")
pi = self->__commonstate.params + 2;
pi->name = "early";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_early_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 3 ("m_roomsize_28")
pi = self->__commonstate.params + 3;
pi->name = "roomsize";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_roomsize_28;
pi->defaultref = 0;
pi->hasinputminmax = false;
pi->inputmin = 0;
pi->inputmax = 1;
pi->hasminmax = true;
pi->outputmin = 0.1;
pi->outputmax = 300;
pi->exp = 0;
pi->units = ""; // no units defined
// initialize parameter 4 ("m_decay_29")
pi = self->__commonstate.params + 4;
pi->name = "decay";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_decay_29;
pi->defaultref = 0;
pi->hasinputminmax = false;
pi->inputmin = 0;
pi->inputmax = 1;
pi->hasminmax = true;
pi->outputmin = 0.1;
pi->outputmax = 360;
pi->exp = 0;
pi->units = ""; // no units defined
// initialize parameter 5 ("m_damping_30")
pi = self->__commonstate.params + 5;
pi->name = "damping";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_damping_30;
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_spread_31")
pi = self->__commonstate.params + 6;
pi->name = "spread";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_spread_31;
pi->defaultref = 0;
pi->hasinputminmax = false;
pi->inputmin = 0;
pi->inputmax = 1;
pi->hasminmax = true;
pi->outputmin = 0;
pi->outputmax = 100;
pi->exp = 0;
pi->units = ""; // no units defined
// initialize parameter 7 ("m_tail_32")
pi = self->__commonstate.params + 7;
pi->name = "tail";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_tail_32;
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_blur_33")
pi = self->__commonstate.params + 8;
pi->name = "blur";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_blur_33;
pi->defaultref = 0;
pi->hasinputminmax = false;
pi->inputmin = 0;
pi->inputmax = 1;
pi->hasminmax = true;
pi->outputmin = 0;
pi->outputmax = 0.25;
pi->exp = 0;
pi->units = ""; // no units defined
// initialize parameter 9 ("m_mix_34")
pi = self->__commonstate.params + 9;
pi->name = "mix";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_mix_34;
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 10 ("m_resonance_35")
pi = self->__commonstate.params + 10;
pi->name = "resonance";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_resonance_35;
pi->defaultref = 0;
pi->hasinputminmax = false;
pi->inputmin = 0;
pi->inputmax = 1;
pi->hasminmax = true;
pi->outputmin = 0;
pi->outputmax = 0.5;
pi->exp = 0;
pi->units = ""; // no units defined
// initialize parameter 11 ("m_cutoff_36")
pi = self->__commonstate.params + 11;
pi->name = "cutoff";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_cutoff_36;
pi->defaultref = 0;
pi->hasinputminmax = false;
pi->inputmin = 0;
pi->inputmax = 1;
pi->hasminmax = true;
pi->outputmin = 0;
pi->outputmax = 8000;
pi->exp = 0;
pi->units = ""; // no units defined
// initialize parameter 12 ("m_shift_37")
pi = self->__commonstate.params + 12;
pi->name = "shift";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_shift_37;
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_window_38")
pi = self->__commonstate.params + 13;
pi->name = "window";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_window_38;
pi->defaultref = 0;
pi->hasinputminmax = false;
pi->inputmin = 0;
pi->inputmax = 1;
pi->hasminmax = true;
pi->outputmin = 0.1;
pi->outputmax = 1000;
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::

+ 37
- 0
plugins/shiroverb/gen_exported.h View File

@@ -0,0 +1,37 @@
/*******************************************************************************************************************
Copyright (c) 2012 Cycling '74

Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice 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 NONINFRINGEMENT.
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, double value, void *ref);
void getparameter(CommonState *cself, long index, double *value);
void * create(double sr, long vs);
void destroy(CommonState *cself);

} // gen_exported::

+ 7858
- 0
plugins/shiroverb/gen~.shiroverb.maxpat
File diff suppressed because it is too large
View File


+ 6928
- 0
plugins/shiroverb/shiroverb.gendsp
File diff suppressed because it is too large
View File


Loading…
Cancel
Save