Browse Source

Add Max-Gen plugins

tags/v1.0
falkTX 9 years ago
parent
commit
b91b3dc60f
72 changed files with 53433 additions and 12 deletions
  1. +28
    -2
      Makefile
  2. +12
    -9
      README.md
  3. +1
    -1
      get-plugins.sh
  4. +46
    -0
      modguis/Pitchotto.modgui/manifest.ttl
  5. +49
    -0
      modguis/Pitchotto.modgui/modgui/icon-pitchotto.html
  6. BIN
      modguis/Pitchotto.modgui/modgui/knobs/boxy/black.png
  7. BIN
      modguis/Pitchotto.modgui/modgui/pedals/boxy75/red.png
  8. BIN
      modguis/Pitchotto.modgui/modgui/pedals/footswitch.png
  9. BIN
      modguis/Pitchotto.modgui/modgui/screenshot-pitchotto.png
  10. +1093
    -0
      modguis/Pitchotto.modgui/modgui/stylesheet-pitchotto.css
  11. BIN
      modguis/Pitchotto.modgui/modgui/thumbnail-pitchotto.png
  12. BIN
      modguis/Pitchotto.modgui/modgui/utils/dropdown-arrow-black.png
  13. BIN
      modguis/Pitchotto.modgui/modgui/utils/dropdown-arrow-white.png
  14. +50
    -0
      modguis/Shiroverb.modgui/manifest.ttl
  15. +49
    -0
      modguis/Shiroverb.modgui/modgui/icon-shiroverb.html
  16. BIN
      modguis/Shiroverb.modgui/modgui/knobs/boxy/black.png
  17. BIN
      modguis/Shiroverb.modgui/modgui/pedals/boxy75/petrol.png
  18. BIN
      modguis/Shiroverb.modgui/modgui/pedals/footswitch.png
  19. BIN
      modguis/Shiroverb.modgui/modgui/screenshot-shiroverb.png
  20. +1093
    -0
      modguis/Shiroverb.modgui/modgui/stylesheet-shiroverb.css
  21. BIN
      modguis/Shiroverb.modgui/modgui/thumbnail-shiroverb.png
  22. BIN
      modguis/Shiroverb.modgui/modgui/utils/dropdown-arrow-black.png
  23. BIN
      modguis/Shiroverb.modgui/modgui/utils/dropdown-arrow-white.png
  24. +153
    -0
      plugins/Makefile.DPF-Max-Gen.mk
  25. +32
    -0
      plugins/bitcrush/DistrhoPluginInfo.h
  26. +1
    -0
      plugins/bitcrush/DistrhoPluginMaxGen.cpp
  27. +40
    -0
      plugins/bitcrush/Makefile
  28. +184
    -0
      plugins/bitcrush/gen_exported.cpp
  29. +37
    -0
      plugins/bitcrush/gen_exported.h
  30. +966
    -0
      plugins/bitcrush/gen~.bitcrush.maxpat
  31. +89
    -0
      plugins/common/DistrhoPluginMaxGen.cpp
  32. +101
    -0
      plugins/common/DistrhoPluginMaxGen.hpp
  33. +354
    -0
      plugins/common/gen_dsp/genlib.cpp
  34. +120
    -0
      plugins/common/gen_dsp/genlib.h
  35. +108
    -0
      plugins/common/gen_dsp/genlib_common.h
  36. +43
    -0
      plugins/common/gen_dsp/genlib_common_win.h
  37. +38
    -0
      plugins/common/gen_dsp/genlib_exportfunctions.h
  38. +1374
    -0
      plugins/common/gen_dsp/genlib_ops.h
  39. +34
    -0
      plugins/freeverb/DistrhoPluginInfo.h
  40. +1
    -0
      plugins/freeverb/DistrhoPluginMaxGen.cpp
  41. +40
    -0
      plugins/freeverb/Makefile
  42. +420
    -0
      plugins/freeverb/gen_exported.cpp
  43. +37
    -0
      plugins/freeverb/gen_exported.h
  44. +532
    -0
      plugins/freeverb/gen~.freeverb.maxpat
  45. +34
    -0
      plugins/gigaverb/DistrhoPluginInfo.h
  46. +1
    -0
      plugins/gigaverb/DistrhoPluginMaxGen.cpp
  47. +40
    -0
      plugins/gigaverb/Makefile
  48. +537
    -0
      plugins/gigaverb/gen_exported.cpp
  49. +37
    -0
      plugins/gigaverb/gen_exported.h
  50. +5364
    -0
      plugins/gigaverb/gen~.gigaverb.maxpat
  51. +4567
    -0
      plugins/gigaverb/gigaverb.gendsp
  52. +35
    -0
      plugins/pitchotto/DistrhoPluginInfo.h
  53. +1
    -0
      plugins/pitchotto/DistrhoPluginMaxGen.cpp
  54. +40
    -0
      plugins/pitchotto/Makefile
  55. +568
    -0
      plugins/pitchotto/gen_exported.cpp
  56. +37
    -0
      plugins/pitchotto/gen_exported.h
  57. +4428
    -0
      plugins/pitchotto/pitchotto.gendsp
  58. +7288
    -0
      plugins/pitchotto/pitchotto.maxpat
  59. +34
    -0
      plugins/pitchshift/DistrhoPluginInfo.h
  60. +1
    -0
      plugins/pitchshift/DistrhoPluginMaxGen.cpp
  61. +40
    -0
      plugins/pitchshift/Makefile
  62. +358
    -0
      plugins/pitchshift/gen_exported.cpp
  63. +37
    -0
      plugins/pitchshift/gen_exported.h
  64. +5091
    -0
      plugins/pitchshift/gen~.pitchshift.maxpat
  65. +2222
    -0
      plugins/pitchshift/pitchshift.gendsp
  66. +34
    -0
      plugins/shiroverb/DistrhoPluginInfo.h
  67. +1
    -0
      plugins/shiroverb/DistrhoPluginMaxGen.cpp
  68. +40
    -0
      plugins/shiroverb/Makefile
  69. +798
    -0
      plugins/shiroverb/gen_exported.cpp
  70. +37
    -0
      plugins/shiroverb/gen_exported.h
  71. +6854
    -0
      plugins/shiroverb/shiroverb.gendsp
  72. +7784
    -0
      plugins/shiroverb/shiroverb.maxpat

+ 28
- 2
Makefile View File

@@ -47,6 +47,14 @@ ifeq ($(HAVE_PROJM),true)
endif
endif

# Max-Gen stuff
$(MAKE) all -C plugins/bitcrush
$(MAKE) all -C plugins/freeverb
$(MAKE) all -C plugins/gigaverb
$(MAKE) all -C plugins/pitchotto
$(MAKE) all -C plugins/pitchshift
$(MAKE) all -C plugins/shiroverb

gen: plugins dpf/utils/lv2_ttl_generator
@$(CURDIR)/dpf/utils/generate-ttl.sh
ifeq ($(MACOS),true)
@@ -86,6 +94,14 @@ endif
# ProM
$(MAKE) clean -C plugins/ProM

# Max-Gen stuff
$(MAKE) clean -C plugins/bitcrush
$(MAKE) clean -C plugins/freeverb
$(MAKE) clean -C plugins/gigaverb
$(MAKE) clean -C plugins/pitchotto
$(MAKE) clean -C plugins/pitchshift
$(MAKE) clean -C plugins/shiroverb

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

install:
@@ -103,14 +119,24 @@ ifeq ($(HAVE_DGL),true)
endif
cp -r bin/*.lv2 $(DESTDIR)$(PREFIX)/lib/lv2/

# Kars
cp -r modguis/Kars.modgui/modgui $(DESTDIR)$(PREFIX)/lib/lv2/Kars.lv2/
cp modguis/Kars.modgui/manifest.ttl $(DESTDIR)$(PREFIX)/lib/lv2/Kars.lv2/modgui.ttl

# Mini-Series
cp -r modguis/PingPongPan.modgui/modgui $(DESTDIR)$(PREFIX)/lib/lv2/PingPongPan.lv2/
cp modguis/PingPongPan.modgui/manifest.ttl $(DESTDIR)$(PREFIX)/lib/lv2/PingPongPan.lv2/modgui.ttl

# MVerb
cp -r modguis/MVerb.modgui/modgui $(DESTDIR)$(PREFIX)/lib/lv2/MVerb.lv2/
cp modguis/MVerb.modgui/manifest.ttl $(DESTDIR)$(PREFIX)/lib/lv2/MVerb.lv2/modgui.ttl

cp -r modguis/PingPongPan.modgui/modgui $(DESTDIR)$(PREFIX)/lib/lv2/PingPongPan.lv2/
cp modguis/PingPongPan.modgui/manifest.ttl $(DESTDIR)$(PREFIX)/lib/lv2/PingPongPan.lv2/modgui.ttl
# Max-Gen stuff
cp -r modguis/Pitchotto.modgui/modgui $(DESTDIR)$(PREFIX)/lib/lv2/Pitchotto.lv2/
cp modguis/Pitchotto.modgui/manifest.ttl $(DESTDIR)$(PREFIX)/lib/lv2/Pitchotto.lv2/modgui.ttl

cp -r modguis/Shiroverb.modgui/modgui $(DESTDIR)$(PREFIX)/lib/lv2/Shiroverb.lv2/
cp modguis/Shiroverb.modgui/manifest.ttl $(DESTDIR)$(PREFIX)/lib/lv2/Shiroverb.lv2/modgui.ttl

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



+ 12
- 9
README.md View File

@@ -24,31 +24,34 @@ Screenshots

<b>

Kars<br/>
![screenshot](https://raw.githubusercontent.com/DISTRHO/DPF-Plugins/master/plugins/Kars/Screenshot.png "Kars")

3 Band EQ<br/>
![screenshot](https://raw.githubusercontent.com/falkTX/DPF-Plugins/master/plugins/3BandEQ/Screenshot.png "3 Band EQ")
![screenshot](https://raw.githubusercontent.com/DISTRHO/DPF-Plugins/master/plugins/3BandEQ/Screenshot.png "3 Band EQ")

3 Band Splitter<br/>
![screenshot](https://raw.githubusercontent.com/falkTX/DPF-Plugins/master/plugins/3BandSplitter/Screenshot.png "3 Band Splitter")
![screenshot](https://raw.githubusercontent.com/DISTRHO/DPF-Plugins/master/plugins/3BandSplitter/Screenshot.png "3 Band Splitter")

Ping Pong Pan<br/>
![screenshot](https://raw.githubusercontent.com/falkTX/DPF-Plugins/master/plugins/PingPongPan/Screenshot.png "Ping Pong Pan")
![screenshot](https://raw.githubusercontent.com/DISTRHO/DPF-Plugins/master/plugins/PingPongPan/Screenshot.png "Ping Pong Pan")

Amplitude Imposer<br/>
![screenshot](https://raw.githubusercontent.com/falkTX/DPF-Plugins/master/plugins/AmplitudeImposer/Screenshot.png "Amplitude Imposer")
![screenshot](https://raw.githubusercontent.com/DISTRHO/DPF-Plugins/master/plugins/AmplitudeImposer/Screenshot.png "Amplitude Imposer")

Cycle Shifter<br/>
![screenshot](https://raw.githubusercontent.com/falkTX/DPF-Plugins/master/plugins/CycleShifter/Screenshot.png "Cycle Shifter")
![screenshot](https://raw.githubusercontent.com/DISTRHO/DPF-Plugins/master/plugins/CycleShifter/Screenshot.png "Cycle Shifter")

Soul Force<br/>
![screenshot](https://raw.githubusercontent.com/falkTX/DPF-Plugins/master/plugins/SoulForce/Screenshot.png "Soul Force")
![screenshot](https://raw.githubusercontent.com/DISTRHO/DPF-Plugins/master/plugins/SoulForce/Screenshot.png "Soul Force")

MVerb<br/>
![screenshot](https://raw.githubusercontent.com/falkTX/DPF-Plugins/master/plugins/MVerb/Screenshot.png "MVerb")
![screenshot](https://raw.githubusercontent.com/DISTRHO/DPF-Plugins/master/plugins/MVerb/Screenshot.png "MVerb")

Nekobi<br/>
![screenshot](https://raw.githubusercontent.com/falkTX/DPF-Plugins/master/plugins/Nekobi/Screenshot.png "Nekobi")
![screenshot](https://raw.githubusercontent.com/DISTRHO/DPF-Plugins/master/plugins/Nekobi/Screenshot.png "Nekobi")

ProM<br/>
![screenshot](https://raw.githubusercontent.com/falkTX/DPF-Plugins/master/plugins/ProM/Screenshot.png "ProM")
![screenshot](https://raw.githubusercontent.com/DISTRHO/DPF-Plugins/master/plugins/ProM/Screenshot.png "ProM")

</b>

+ 1
- 1
get-plugins.sh View File

@@ -2,7 +2,7 @@

set -e

PLUGINS=("Kars" "Mini-Series" "MVerb" "Nekobi" "ProM" "ndc-Plugs")
PLUGINS=("Kars" "Mini-Series" "MVerb" "Nekobi" "ProM" "ndc-Plugs" "DPF-Max-Gen")

if [ ! -f Makefile ]; then
echo "Makefile not found, please run this script from DPF-Plugins root source dir"


+ 46
- 0
modguis/Pitchotto.modgui/manifest.ttl View File

@@ -0,0 +1,46 @@
@prefix modgui: <http://moddevices.com/ns/modgui#> .
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .

<http://distrho.sf.net/plugins/Pitchotto>
modgui:gui [
modgui:resourcesDirectory <modgui> ;
modgui:iconTemplate <modgui/icon-pitchotto.html> ;
modgui:stylesheet <modgui/stylesheet-pitchotto.css> ;
modgui:screenshot <modgui/screenshot-pitchotto.png> ;
modgui:thumbnail <modgui/thumbnail-pitchotto.png> ;
modgui:brand "SHIRO" ;
modgui:label "Pitchotto" ;
modgui:model "boxy" ;
modgui:panel "7-knobs" ;
modgui:color "red" ;
modgui:knob "black" ;
modgui:port [
lv2:index 0 ;
lv2:symbol "ratio1" ;
lv2:name "ratio1" ;
] , [
lv2:index 1 ;
lv2:symbol "ratio2" ;
lv2:name "ratio2" ;
] , [
lv2:index 2 ;
lv2:symbol "cutoff" ;
lv2:name "cutoff" ;
] , [
lv2:index 3 ;
lv2:symbol "mix" ;
lv2:name "mix" ;
] , [
lv2:index 4 ;
lv2:symbol "window1" ;
lv2:name "window1" ;
] , [
lv2:index 5 ;
lv2:symbol "window2" ;
lv2:name "window2" ;
] , [
lv2:index 6 ;
lv2:symbol "blur" ;
lv2:name "blur" ;
] ;
] .

+ 49
- 0
modguis/Pitchotto.modgui/modgui/icon-pitchotto.html View File

@@ -0,0 +1,49 @@
<div class="mod-pedal mod-pedal-boxy{{{cns}}} mod-seven-knobs mod-boxy75 mod-{{color}} {{color}}">
<div mod-role="drag-handle" class="mod-drag-handle"></div>
<div class="mod-plugin-brand"><h1>{{brand}}</h1></div>
<div class="mod-plugin-name"><h1>{{label}}</h1></div>
<div class="mod-light on" mod-role="bypass-light"></div>
<div class="mod-control-group mod-{{knob}} clearfix">
{{#controls}}
<div class="mod-knob">
<div class="mod-knob-image" mod-role="input-control-port" mod-port-symbol="{{symbol}}"></div>
<span class="mod-knob-title">{{name}}</span>
</div>
{{/controls}}
</div>
<div class="mod-footswitch" mod-role="bypass"></div>
<div class="mod-pedal-input">
{{#effect.ports.audio.input}}
<div class="mod-input mod-input-disconnected" title="{{name}}" mod-role="input-audio-port" mod-port-symbol="{{symbol}}">
<div class="mod-pedal-input-image"></div>
</div>
{{/effect.ports.audio.input}}
{{#effect.ports.midi.input}}
<div class="mod-input mod-input-disconnected" title="{{name}}" mod-role="input-midi-port" mod-port-symbol="{{symbol}}">
<div class="mod-pedal-input-image"></div>
</div>
{{/effect.ports.midi.input}}
{{#effect.ports.cv.input}}
<div class="mod-input mod-input-disconnected" title="{{name}}" mod-role="input-cv-port" mod-port-symbol="{{symbol}}">
<div class="mod-pedal-input-image"></div>
</div>
{{/effect.ports.cv.input}}
</div>
<div class="mod-pedal-output">
{{#effect.ports.audio.output}}
<div class="mod-output mod-output-disconnected" title="{{name}}" mod-role="output-audio-port" mod-port-symbol="{{symbol}}">
<div class="mod-pedal-output-image"></div>
</div>
{{/effect.ports.audio.output}}
{{#effect.ports.midi.output}}
<div class="mod-output mod-output-disconnected" title="{{name}}" mod-role="output-midi-port" mod-port-symbol="{{symbol}}">
<div class="mod-pedal-output-image"></div>
</div>
{{/effect.ports.midi.output}}
{{#effect.ports.cv.output}}
<div class="mod-output mod-output-disconnected" title="{{name}}" mod-role="output-cv-port" mod-port-symbol="{{symbol}}">
<div class="mod-pedal-output-image"></div>
</div>
{{/effect.ports.cv.output}}
</div>
</div>

BIN
modguis/Pitchotto.modgui/modgui/knobs/boxy/black.png View File

Before After
Width: 8320  |  Height: 128  |  Size: 382KB

BIN
modguis/Pitchotto.modgui/modgui/pedals/boxy75/red.png View File

Before After
Width: 326  |  Height: 431  |  Size: 247KB

BIN
modguis/Pitchotto.modgui/modgui/pedals/footswitch.png View File

Before After
Width: 88  |  Height: 176  |  Size: 13KB

BIN
modguis/Pitchotto.modgui/modgui/screenshot-pitchotto.png View File

Before After
Width: 357  |  Height: 430  |  Size: 239KB

+ 1093
- 0
modguis/Pitchotto.modgui/modgui/stylesheet-pitchotto.css
File diff suppressed because it is too large
View File


BIN
modguis/Pitchotto.modgui/modgui/thumbnail-pitchotto.png View File

Before After
Width: 53  |  Height: 64  |  Size: 6.7KB

BIN
modguis/Pitchotto.modgui/modgui/utils/dropdown-arrow-black.png View File

Before After
Width: 13  |  Height: 6  |  Size: 982B

BIN
modguis/Pitchotto.modgui/modgui/utils/dropdown-arrow-white.png View File

Before After
Width: 13  |  Height: 6  |  Size: 977B

+ 50
- 0
modguis/Shiroverb.modgui/manifest.ttl View File

@@ -0,0 +1,50 @@
@prefix modgui: <http://moddevices.com/ns/modgui#> .
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .

<http://distrho.sf.net/plugins/Shiroverb>
modgui:gui [
modgui:resourcesDirectory <modgui> ;
modgui:iconTemplate <modgui/icon-shiroverb.html> ;
modgui:stylesheet <modgui/stylesheet-shiroverb.css> ;
modgui:screenshot <modgui/screenshot-shiroverb.png> ;
modgui:thumbnail <modgui/thumbnail-shiroverb.png> ;
modgui:brand "SHIRO" ;
modgui:label "Shiroverb" ;
modgui:model "boxy" ;
modgui:panel "8-knobs" ;
modgui:color "petrol" ;
modgui:knob "black" ;
modgui:port [
lv2:index 0 ;
lv2:symbol "decay" ;
lv2:name "decay" ;
] , [
lv2:index 1 ;
lv2:symbol "roomsize" ;
lv2:name "roomsize" ;
] , [
lv2:index 2 ;
lv2:symbol "damping" ;
lv2:name "damping" ;
] , [
lv2:index 3 ;
lv2:symbol "mix" ;
lv2:name "mix" ;
] , [
lv2:index 4 ;
lv2:symbol "ratio" ;
lv2:name "ratio" ;
] , [
lv2:index 5 ;
lv2:symbol "cutoff" ;
lv2:name "cutoff" ;
] , [
lv2:index 6 ;
lv2:symbol "blur" ;
lv2:name "blur" ;
] , [
lv2:index 7 ;
lv2:symbol "shimmer" ;
lv2:name "shimmer" ;
] ;
] .

+ 49
- 0
modguis/Shiroverb.modgui/modgui/icon-shiroverb.html View File

@@ -0,0 +1,49 @@
<div class="mod-pedal mod-pedal-boxy{{{cns}}} mod-eight-knobs mod-boxy75 mod-{{color}} {{color}}">
<div mod-role="drag-handle" class="mod-drag-handle"></div>
<div class="mod-plugin-brand"><h1>{{brand}}</h1></div>
<div class="mod-plugin-name"><h1>{{label}}</h1></div>
<div class="mod-light on" mod-role="bypass-light"></div>
<div class="mod-control-group mod-{{knob}} clearfix">
{{#controls}}
<div class="mod-knob">
<div class="mod-knob-image" mod-role="input-control-port" mod-port-symbol="{{symbol}}"></div>
<span class="mod-knob-title">{{name}}</span>
</div>
{{/controls}}
</div>
<div class="mod-footswitch" mod-role="bypass"></div>
<div class="mod-pedal-input">
{{#effect.ports.audio.input}}
<div class="mod-input mod-input-disconnected" title="{{name}}" mod-role="input-audio-port" mod-port-symbol="{{symbol}}">
<div class="mod-pedal-input-image"></div>
</div>
{{/effect.ports.audio.input}}
{{#effect.ports.midi.input}}
<div class="mod-input mod-input-disconnected" title="{{name}}" mod-role="input-midi-port" mod-port-symbol="{{symbol}}">
<div class="mod-pedal-input-image"></div>
</div>
{{/effect.ports.midi.input}}
{{#effect.ports.cv.input}}
<div class="mod-input mod-input-disconnected" title="{{name}}" mod-role="input-cv-port" mod-port-symbol="{{symbol}}">
<div class="mod-pedal-input-image"></div>
</div>
{{/effect.ports.cv.input}}
</div>
<div class="mod-pedal-output">
{{#effect.ports.audio.output}}
<div class="mod-output mod-output-disconnected" title="{{name}}" mod-role="output-audio-port" mod-port-symbol="{{symbol}}">
<div class="mod-pedal-output-image"></div>
</div>
{{/effect.ports.audio.output}}
{{#effect.ports.midi.output}}
<div class="mod-output mod-output-disconnected" title="{{name}}" mod-role="output-midi-port" mod-port-symbol="{{symbol}}">
<div class="mod-pedal-output-image"></div>
</div>
{{/effect.ports.midi.output}}
{{#effect.ports.cv.output}}
<div class="mod-output mod-output-disconnected" title="{{name}}" mod-role="output-cv-port" mod-port-symbol="{{symbol}}">
<div class="mod-pedal-output-image"></div>
</div>
{{/effect.ports.cv.output}}
</div>
</div>

BIN
modguis/Shiroverb.modgui/modgui/knobs/boxy/black.png View File

Before After
Width: 8320  |  Height: 128  |  Size: 382KB

BIN
modguis/Shiroverb.modgui/modgui/pedals/boxy75/petrol.png View File

Before After
Width: 326  |  Height: 431  |  Size: 245KB

BIN
modguis/Shiroverb.modgui/modgui/pedals/footswitch.png View File

Before After
Width: 88  |  Height: 176  |  Size: 13KB

BIN
modguis/Shiroverb.modgui/modgui/screenshot-shiroverb.png View File

Before After
Width: 357  |  Height: 430  |  Size: 239KB

+ 1093
- 0
modguis/Shiroverb.modgui/modgui/stylesheet-shiroverb.css
File diff suppressed because it is too large
View File


BIN
modguis/Shiroverb.modgui/modgui/thumbnail-shiroverb.png View File

Before After
Width: 53  |  Height: 64  |  Size: 6.9KB

BIN
modguis/Shiroverb.modgui/modgui/utils/dropdown-arrow-black.png View File

Before After
Width: 13  |  Height: 6  |  Size: 982B

BIN
modguis/Shiroverb.modgui/modgui/utils/dropdown-arrow-white.png View File

Before After
Width: 13  |  Height: 6  |  Size: 977B

+ 153
- 0
plugins/Makefile.DPF-Max-Gen.mk View File

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

# NAME, OBJS_DSP and OBJS_UI have been defined before

include ../../Makefile.mk

ifeq ($(OBJS_UI),)
HAVE_DGL = false
endif

# --------------------------------------------------------------
# Basic setup

TARGET_DIR = ../../bin

BUILD_C_FLAGS += -I.
BUILD_CXX_FLAGS += -I. -I../common -I../common/gen_dsp -I../../dpf/distrho -I../../dpf/dgl

ifeq ($(HAVE_DGL),true)
BASE_FLAGS += -DHAVE_DGL
endif

ifeq ($(HAVE_JACK),true)
BASE_FLAGS += -DHAVE_JACK
endif

ifeq ($(HAVE_LIBLO),true)
BASE_FLAGS += -DHAVE_LIBLO
endif

# --------------------------------------------------------------
# Set plugin binary file targets

jack = $(TARGET_DIR)/$(NAME)$(APP_EXT)
ladspa_dsp = $(TARGET_DIR)/$(NAME)-ladspa$(LIB_EXT)
dssi_dsp = $(TARGET_DIR)/$(NAME)-dssi$(LIB_EXT)
dssi_ui = $(TARGET_DIR)/$(NAME)-dssi/$(NAME)_ui$(APP_EXT)
lv2 = $(TARGET_DIR)/$(NAME).lv2/$(NAME)$(LIB_EXT)
lv2_dsp = $(TARGET_DIR)/$(NAME).lv2/$(NAME)_dsp$(LIB_EXT)
lv2_ui = $(TARGET_DIR)/$(NAME).lv2/$(NAME)_ui$(LIB_EXT)
vst = $(TARGET_DIR)/$(NAME)-vst$(LIB_EXT)

# --------------------------------------------------------------
# Set distrho code files

DISTRHO_PLUGIN_FILES = ../../dpf/distrho/DistrhoPluginMain.cpp

ifeq ($(HAVE_DGL),true)
DISTRHO_UI_FILES = ../../dpf/distrho/DistrhoUIMain.cpp ../../dpf/libdgl.a
endif

# --------------------------------------------------------------
# Handle plugins without UI

ifneq ($(HAVE_DGL),true)
dssi_ui =
lv2_ui =
DISTRHO_UI_FILES =
DGL_LIBS =
OBJS_UI =
endif

# --------------------------------------------------------------
# all needs to be first

all:

# --------------------------------------------------------------
# Common

%.c.o: %.c
$(CC) $< $(BUILD_C_FLAGS) -MD -MP -c -o $@

%.cpp.o: %.cpp
$(CXX) $< $(BUILD_CXX_FLAGS) -MD -MP -c -o $@

clean:
rm -f *.d *.o
rm -rf $(TARGET_DIR)/$(NAME) $(TARGET_DIR)/$(NAME)-* $(TARGET_DIR)/$(NAME).lv2/

# --------------------------------------------------------------
# JACK

jack: $(jack)

$(jack): $(OBJS_DSP) $(OBJS_UI) $(DISTRHO_PLUGIN_FILES) $(DISTRHO_UI_FILES)
mkdir -p $(shell dirname $@)
$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(DGL_LIBS) $(shell pkg-config --cflags --libs jack) -DDISTRHO_PLUGIN_TARGET_JACK -o $@

# --------------------------------------------------------------
# LADSPA

ladspa: $(ladspa_dsp)

$(ladspa_dsp): $(OBJS_DSP) $(DISTRHO_PLUGIN_FILES)
mkdir -p $(shell dirname $@)
$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(SHARED) -DDISTRHO_PLUGIN_TARGET_LADSPA -o $@

# --------------------------------------------------------------
# DSSI

dssi: $(dssi_dsp) $(dssi_ui)
dssi_dsp: $(dssi_dsp)
dssi_ui: $(dssi_ui)

$(dssi_dsp): $(OBJS_DSP) $(DISTRHO_PLUGIN_FILES)
mkdir -p $(shell dirname $@)
$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(SHARED) -DDISTRHO_PLUGIN_TARGET_DSSI -o $@

$(dssi_ui): $(OBJS_UI) $(DISTRHO_UI_FILES)
mkdir -p $(shell dirname $@)
$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(DGL_LIBS) $(shell pkg-config --cflags --libs liblo) -DDISTRHO_PLUGIN_TARGET_DSSI -o $@

# --------------------------------------------------------------
# LV2

lv2_one: $(lv2)
lv2_dsp: $(lv2_dsp)
lv2_sep: $(lv2_dsp) $(lv2_ui)

$(lv2): $(OBJS_DSP) $(OBJS_UI) $(DISTRHO_PLUGIN_FILES) $(DISTRHO_UI_FILES)
mkdir -p $(shell dirname $@)
$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(DGL_LIBS) $(SHARED) -DDISTRHO_PLUGIN_TARGET_LV2 -o $@

$(lv2_dsp): $(OBJS_DSP) $(DISTRHO_PLUGIN_FILES)
mkdir -p $(shell dirname $@)
$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(SHARED) -DDISTRHO_PLUGIN_TARGET_LV2 -o $@

$(lv2_ui): $(OBJS_UI) $(DISTRHO_UI_FILES)
mkdir -p $(shell dirname $@)
$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(DGL_LIBS) $(SHARED) -DDISTRHO_PLUGIN_TARGET_LV2 -o $@

# --------------------------------------------------------------
# VST

vst: $(vst)

$(vst): $(OBJS_DSP) $(OBJS_UI) $(DISTRHO_PLUGIN_FILES) $(DISTRHO_UI_FILES)
mkdir -p $(shell dirname $@)
$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(DGL_LIBS) $(SHARED) -DDISTRHO_PLUGIN_TARGET_VST -o $@

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

-include $(OBJS_DSP:%.o=%.d)
ifeq ($(HAVE_DGL),true)
-include $(OBJS_UI:%.o=%.d)
endif

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

+ 32
- 0
plugins/bitcrush/DistrhoPluginInfo.h View File

@@ -0,0 +1,32 @@
/*
* 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_BRAND "DISTRHO"
#define DISTRHO_PLUGIN_NAME "MaBitcrush"
#define DISTRHO_PLUGIN_URI "http://distrho.sf.net/plugins/MaBitcrush"

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

#define DISTRHO_PLUGIN_DESCRIPTION "Max Gen Bitcrush example."
#define DISTRHO_PLUGIN_VERSION d_cconst('D', 'M', 'b', 'c')

#endif // DISTRHO_PLUGIN_INFO_H_INCLUDED

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

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

+ 40
- 0
plugins/bitcrush/Makefile View File

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

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

NAME = MaBitcrush

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

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

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

include ../Makefile.DPF-Max-Gen.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)

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

+ 184
- 0
plugins/bitcrush/gen_exported.cpp View File

@@ -0,0 +1,184 @@
#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;
double m_resolution_1;
double samplerate;
int vectorsize;
int __exception;
// re-initialize all member variables;
inline void reset(double __sr, int __vs) {
__exception = 0;
vectorsize = __vs;
samplerate = __sr;
m_resolution_1 = 6;
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;
};
// the main sample loop;
while ((__n--)) {
const double in1 = (*(__in1++));
double mul_50 = (in1 * m_resolution_1);
double ceil_49 = ceil(mul_50);
double div_48 = safediv(ceil_49, m_resolution_1);
double out1 = div_48;
double add_45 = (mul_50 + 0.5);
double floor_46 = floor(add_45);
double sub_44 = (floor_46 - 0.5);
double div_47 = safediv(sub_44, m_resolution_1);
double out2 = div_47;
// assign results to output buffer;
(*(__out1++)) = out1;
(*(__out2++)) = out2;
};
return __exception;
};
inline void set_resolution(double _value) {
m_resolution_1 = (_value < 1 ? 1 : (_value > 16 ? 16 : _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 1; }

/// 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_resolution(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_resolution_1; 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(1 * sizeof(ParamInfo));
self->__commonstate.numparams = 1;
// initialize parameter 0 ("m_resolution_1")
pi = self->__commonstate.params + 0;
pi->name = "resolution";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_resolution_1;
pi->defaultref = 0;
pi->hasinputminmax = false;
pi->inputmin = 0;
pi->inputmax = 1;
pi->hasminmax = true;
pi->outputmin = 1;
pi->outputmax = 16;
pi->exp = 0;
pi->units = "bits"; // 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/bitcrush/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::

+ 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" : [ ]
}

}

+ 89
- 0
plugins/common/DistrhoPluginMaxGen.cpp View File

@@ -0,0 +1,89 @@
/*
* 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.
*/
#include "DistrhoPluginMaxGen.hpp"
#include "gen_exported.h"
namespace gen = gen_exported;
START_NAMESPACE_DISTRHO
// -----------------------------------------------------------------------
DistrhoPluginMaxGen::DistrhoPluginMaxGen()
: Plugin(gen::num_params(), 0, 0), // 0 programs, 0 states
fGenState((CommonState*)gen::create(getSampleRate(), getBufferSize()))
{
gen::reset(fGenState);
}
DistrhoPluginMaxGen::~DistrhoPluginMaxGen()
{
gen::destroy(fGenState);
}
// -----------------------------------------------------------------------
// Init
void DistrhoPluginMaxGen::initParameter(uint32_t index, Parameter& parameter)
{
ParamInfo& info(fGenState->params[index]);
parameter.hints = kParameterIsAutomable;
parameter.name = info.name;
parameter.symbol = info.name;
parameter.unit = info.units;
parameter.ranges.def = info.defaultvalue;
parameter.ranges.min = info.outputmin;
parameter.ranges.max = info.outputmax;
}
// -----------------------------------------------------------------------
// Internal data
float DistrhoPluginMaxGen::getParameterValue(uint32_t index) const
{
double value = 0.0;
gen::getparameter(fGenState, index, &value);
return value;
}
void DistrhoPluginMaxGen::setParameterValue(uint32_t index, float value)
{
gen::setparameter(fGenState, index, value, nullptr);
}
// -----------------------------------------------------------------------
// Process
void DistrhoPluginMaxGen::run(const float** inputs, float** outputs, uint32_t frames)
{
gen::perform(fGenState, (float**)inputs, DISTRHO_PLUGIN_NUM_INPUTS, outputs, DISTRHO_PLUGIN_NUM_OUTPUTS, frames);
}
// -----------------------------------------------------------------------
Plugin* createPlugin()
{
return new DistrhoPluginMaxGen();
}
// -----------------------------------------------------------------------
END_NAMESPACE_DISTRHO
#include "gen_dsp/genlib.cpp"

+ 101
- 0
plugins/common/DistrhoPluginMaxGen.hpp View File

@@ -0,0 +1,101 @@
/*
* 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_MAX_GEN_HPP_INCLUDED
#define DISTRHO_PLUGIN_MAX_GEN_HPP_INCLUDED
#include "DistrhoPlugin.hpp"
#include "genlib.h"
START_NAMESPACE_DISTRHO
// -----------------------------------------------------------------------
class DistrhoPluginMaxGen : public Plugin
{
public:
DistrhoPluginMaxGen();
~DistrhoPluginMaxGen() override;
protected:
// -------------------------------------------------------------------
// Information
const char* getLabel() const noexcept override
{
return DISTRHO_PLUGIN_NAME;
}
const char* getDescription() const noexcept override
{
return DISTRHO_PLUGIN_DESCRIPTION;
}
const char* getMaker() const noexcept override
{
return "DISTRHO";
}
const char* getHomePage() const noexcept override
{
return "https://github.com/DISTRHO/DPF-Max-Gen";
}
const char* getLicense() const noexcept override
{
return "ISC";
}
uint32_t getVersion() const noexcept override
{
return d_version(0, 1, 0);
}
int64_t getUniqueId() const noexcept override
{
// TODO
return d_cconst('D', 'M', 'a', 'G');
}
// -------------------------------------------------------------------
// Init
void initParameter(uint32_t index, Parameter& parameter) override;
// -------------------------------------------------------------------
// Internal data
float getParameterValue(uint32_t index) const override;
void setParameterValue(uint32_t index, float value) override;
// -------------------------------------------------------------------
// Process
void run(const float** inputs, float** outputs, uint32_t frames) override;
// -------------------------------------------------------------------
private:
CommonState* fGenState;
DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(DistrhoPluginMaxGen)
};
// -----------------------------------------------------------------------
END_NAMESPACE_DISTRHO
#endif // DISTRHO_PLUGIN_MAX_GEN_HPP_INCLUDED

+ 354
- 0
plugins/common/gen_dsp/genlib.cpp View File

@@ -0,0 +1,354 @@
/*******************************************************************************************************************
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 "stdlib.h"
#include "stdio.h"
#include "string.h"

#ifdef pow
#undef pow
#endif
#include <cmath>
#include <malloc.h>

#define malloc_size malloc_usable_size

// DATA_MAXIMUM_ELEMENTS * 8 bytes = 256 mb limit
#define DATA_MAXIMUM_ELEMENTS (33554432)

//////////// export_genlib.cpp ////////////
// export version

void my_memset(void *p, int c, long size);
void my_memcpy(void *dst, const void *src, long size);

t_ptr sysmem_newptr(t_ptr_size size)
{
return (t_ptr)malloc(size);
}

t_ptr sysmem_newptrclear(t_ptr_size size)
{
t_ptr p = (t_ptr)malloc(size);
if (p)
my_memset(p, 0, size);
return p;
}

t_ptr sysmem_resizeptr(void *ptr, t_ptr_size newsize)
{
return (t_ptr)realloc(ptr, newsize);
}

t_ptr sysmem_resizeptrclear(void *ptr, t_ptr_size newsize)
{
long oldsize = malloc_size(ptr);
t_ptr p = (t_ptr)realloc(ptr, newsize);
if (p) {
if (newsize > oldsize)
my_memset((char *)p + oldsize, 0, newsize - oldsize);
}
return p;
}

t_ptr_size sysmem_ptrsize(void *ptr)
{
return malloc_size(ptr);
}

void sysmem_freeptr(void *ptr)
{
free(ptr);
}

void sysmem_copyptr(const void *src, void *dst, t_ptr_size bytes)
{
my_memcpy(dst, src, bytes);
}

void my_memset(void *p, int c, long size)
{
char *p2 = (char *)p;
int i;
for (i = 0; i < size; i++, p2++)
*p2 = c;
}

void my_memcpy(void *dst, const void *src, long size)
{
char *s2 = (char *)src;
char *d2 = (char *)dst;
int i;
for (i = 0; i < size; i++, s2++, d2++)
*d2 = *s2;
}

void set_zero64(t_sample *memory, long size)
{
long i;
for (i = 0; i < size; i++, memory++) {
*memory = 0.;
}
}

void genlib_report_error(const char *s)
{
fprintf(stderr, "%s\n", s);
}

void genlib_report_message(const char *s)
{
fprintf(stdout, "%s\n", s);
}

unsigned long systime_ticks(void)
{
return 0; // Gen code can deal with this
}

void * genlib_obtain_reference_from_string(const char * name) {
return 0; // to be implemented
}

// the rest is stuff to isolate gensym, attrs, atoms, buffers etc.
t_genlib_buffer * genlib_obtain_buffer_from_reference(void *ref)
{
return 0; // to be implemented
}

t_genlib_err genlib_buffer_edit_begin(t_genlib_buffer *b)
{
return 0; // to be implemented
}

t_genlib_err genlib_buffer_edit_end(t_genlib_buffer *b, long valid)
{
return 0; // to be implemented
}

t_genlib_err genlib_buffer_getinfo(t_genlib_buffer *b, t_genlib_buffer_info *info)
{
return 0; // to be implemented
}

char *genlib_reference_getname(void *ref)
{
return 0; // to be implemented
}

void genlib_buffer_dirty(t_genlib_buffer *b)
{
// to be implemented
}

t_genlib_err genlib_buffer_perform_begin(t_genlib_buffer *b)
{
return 0; // to be implemented
}
void genlib_buffer_perform_end(t_genlib_buffer *b)
{
// to be implemented
}

t_sample gen_msp_pow(t_sample value, t_sample power)
{
return pow(value, power);
}

void genlib_data_setbuffer(t_genlib_data *b, void *ref) {
genlib_report_error("not supported for export targets\n");
}

typedef struct {
t_genlib_data_info info;
t_sample cursor; // used by Delay
//t_symbol * name;
} t_dsp_gen_data;

t_genlib_data * genlib_obtain_data_from_reference(void *ref)
{
t_dsp_gen_data * self = (t_dsp_gen_data *)malloc(sizeof(t_dsp_gen_data));
self->info.dim = 0;
self->info.channels = 0;
self->info.data = 0;
self->cursor = 0;
return (t_genlib_data *)self;
}

t_genlib_err genlib_data_getinfo(t_genlib_data *b, t_genlib_data_info *info) {
t_dsp_gen_data * self = (t_dsp_gen_data *)b;
info->dim = self->info.dim;
info->channels = self->info.channels;
info->data = self->info.data;
return GENLIB_ERR_NONE;
}

void genlib_data_release(t_genlib_data *b) {
t_dsp_gen_data * self = (t_dsp_gen_data *)b;
if (self->info.data) {
genlib_sysmem_freeptr(self->info.data);
self->info.data = 0;
}
}

long genlib_data_getcursor(t_genlib_data *b) {
t_dsp_gen_data * self = (t_dsp_gen_data *)b;
return self->cursor;
}

void genlib_data_setcursor(t_genlib_data *b, long cursor) {
t_dsp_gen_data * self = (t_dsp_gen_data *)b;
self->cursor = cursor;
}

void genlib_data_resize(t_genlib_data *b, long s, long c) {
t_dsp_gen_data * self = (t_dsp_gen_data *)b;
size_t sz, oldsz, copysz;
t_sample * old = 0;
t_sample * replaced = 0;
int i, j, copydim, copychannels, olddim, oldchannels;
//printf("data resize %d %d\n", s, c);
// cache old for copying:
old = self->info.data;
olddim = self->info.dim;
oldchannels = self->info.channels;
// limit [data] size:
if (s * c > DATA_MAXIMUM_ELEMENTS) {
s = DATA_MAXIMUM_ELEMENTS/c;
genlib_report_message("warning: constraining [data] to < 256MB");
}
// bytes required:
sz = sizeof(t_sample) * s * c;
oldsz = sizeof(t_sample) * olddim * oldchannels;
if (old && sz == oldsz) {
// no need to re-allocate, just resize
// careful, audio thread may still be using it:
if (s > olddim) {
self->info.channels = c;
self->info.dim = s;
} else {
self->info.dim = s;
self->info.channels = c;
}
set_zero64(self->info.data, s * c);
return;
} else {
// allocate new:
replaced = (t_sample *)sysmem_newptr(sz);
// check allocation:
if (replaced == 0) {
genlib_report_error("allocating [data]: out of memory");
// try to reallocate with a default/minimal size instead:
if (s > 512 || c > 1) {
genlib_data_resize((t_genlib_data *)self, 512, 1);
} else {
// if this fails, then Max is kaput anyway...
genlib_data_resize((t_genlib_data *)self, 4, 1);
}
return;
}
// fill with zeroes:
set_zero64(replaced, s * c);
// copy in old data:
if (old) {
// frames to copy:
// clamped:
copydim = olddim > s ? s : olddim;
// use memcpy if channels haven't changed:
if (c == oldchannels) {
copysz = sizeof(t_sample) * copydim * c;
//post("reset resize (same channels) %p %p, %d", self->info.data, old, copysz);
memcpy(replaced, old, copysz);
} else {
// memcpy won't work if channels have changed,
// because data is interleaved.
// clamp channels copied:
copychannels = oldchannels > c ? c : oldchannels;
//post("reset resize (different channels) %p %p, %d %d", self->info.data, old, copydim, copychannels);
for (i = 0; i<copydim; i++) {
for (j = 0; j<copychannels; j++) {
replaced[j + i*c] = old[j + i*oldchannels];
}
}
}
}
// now update info:
if (old == 0) {
self->info.data = replaced;
self->info.dim = s;
self->info.channels = c;
} else {
// need to be careful; the audio thread may still be using it
// since dsp_gen_data is preserved through edits
// the order of resizing has to be carefully done
// to prevent indexing out of bounds
// (or maybe I'm being too paranoid here...)
if (oldsz > sz) {
// shrink size first
if (s > olddim) {
self->info.channels = c;
self->info.dim = s;
} else {
self->info.dim = s;
self->info.channels = c;
}
self->info.data = replaced;
} else {
// shrink size after
self->info.data = replaced;
if (s > olddim) {
self->info.channels = c;
self->info.dim = s;
} else {
self->info.dim = s;
self->info.channels = c;
}
}
// done with old:
sysmem_freeptr(old);
}
}
}

void genlib_reset_complete(void *data) {}

+ 120
- 0
plugins/common/gen_dsp/genlib.h View File

@@ -0,0 +1,120 @@
/*******************************************************************************************************************
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.
*******************************************************************************************************************/


#ifndef GENLIB_H
#define GENLIB_H 1

#include "genlib_common.h"

//////////// genlib.h ////////////
// genlib.h -- max (gen~) version

#ifndef GEN_WINDOWS
#ifndef _SIZE_T
#define _SIZE_T
typedef __typeof__(sizeof(int)) size_t;
#endif
#endif

#ifndef __INT32_TYPE__
#define __INT32_TYPE__ int
#endif

#ifdef MSP_ON_CLANG
// gen~ hosted:
typedef unsigned __INT32_TYPE__ uint32_t;
typedef unsigned __INT64_TYPE__ uint64_t;
#else
#ifdef __GNUC__
#include <stdint.h>
#endif
#endif

#define inf (__DBL_MAX__)
#define GEN_UINT_MAX (4294967295)
#define TWO_TO_32 (4294967296.0)

#define C74_CONST const

// max_types.h:
// #ifdef C74_X64
// typedef unsigned long long t_ptr_uint;
// typedef long long t_ptr_int;
// typedef double t_atom_float;
// typedef t_ptr_uint t_getbytes_size;
// #else
typedef unsigned long t_ptr_uint;
typedef long t_ptr_int;
typedef float t_atom_float;
typedef short t_getbytes_size;
// #endif

typedef uint32_t t_uint32;
typedef t_ptr_int t_atom_long; // the type that is an A_LONG in an atom

typedef t_ptr_int t_int; ///< an integer @ingroup misc
typedef t_ptr_uint t_ptr_size; ///< unsigned pointer-sized value for counting (like size_t) @ingroup misc
typedef t_ptr_int t_atom_long; ///< the type that is an A_LONG in a #t_atom @ingroup misc
typedef t_atom_long t_max_err; ///< an integer value suitable to be returned as an error code @ingroup misc

extern "C" {
// string reference handling:
void * genlib_obtain_reference_from_string(const char * name);
char *genlib_reference_getname(void *ref);
// buffer handling:
t_genlib_buffer *genlib_obtain_buffer_from_reference(void *ref);
t_genlib_err genlib_buffer_edit_begin(t_genlib_buffer *b);
t_genlib_err genlib_buffer_edit_end(t_genlib_buffer *b, long valid);
t_genlib_err genlib_buffer_getinfo(t_genlib_buffer *b, t_genlib_buffer_info *info);
void genlib_buffer_dirty(t_genlib_buffer *b);
t_genlib_err genlib_buffer_perform_begin(t_genlib_buffer *b);
void genlib_buffer_perform_end(t_genlib_buffer *b);
// data handling:
t_genlib_data *genlib_obtain_data_from_reference(void *ref);
t_genlib_err genlib_data_getinfo(t_genlib_data *b, t_genlib_data_info *info);
void genlib_data_resize(t_genlib_data *b, long dim, long channels);
void genlib_data_setbuffer(t_genlib_data *b, void *ref);
void genlib_data_release(t_genlib_data *b);
void genlib_data_setcursor(t_genlib_data *b, long cursor);
long genlib_data_getcursor(t_genlib_data *b);
// other notification:
void genlib_reset_complete(void *data);
// get/set state of parameters
size_t genlib_getstatesize(CommonState *cself, getparameter_method getmethod);
short genlib_getstate(CommonState *cself, char *state, getparameter_method getmethod);
short genlib_setstate(CommonState *cself, const char *state, setparameter_method setmethod);
}; // extern "C"
#define genlib_sysmem_newptr(s) sysmem_newptr(s)
#define genlib_sysmem_newptrclear(s) sysmem_newptrclear(s)
#define genlib_sysmem_resizeptr(p, s) sysmem_resizeptr(p, s)
#define genlib_sysmem_resizeptrclear(p, s) sysmem_resizeptrclear(p, s)
#define genlib_sysmem_ptrsize(p) sysmem_ptrsize(p)
#define genlib_sysmem_freeptr(p) sysmem_freeptr(p)
#define genlib_sysmem_copyptr(s, d, b) sysmem_copyptr(s, d, b)
#define genlib_set_zero64(d, n) set_zero64(d, n)
#define genlib_ticks systime_ticks

#endif // GENLIB_H

+ 108
- 0
plugins/common/gen_dsp/genlib_common.h View File

@@ -0,0 +1,108 @@
/*******************************************************************************************************************
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.
*******************************************************************************************************************/


#ifndef GENLIB_COMMON_H
#define GENLIB_COMMON_H 1

#include "genlib_common_win.h"

//////////// genlib_common.h ////////////
// common data structure header file -- this is the stuff required by the
// common code and accessed by the export and max code
#define DSP_GEN_MAX_SIGNALS 16

typedef float t_sample;
typedef float t_param;
typedef char *t_ptr;
typedef long t_genlib_err;
typedef enum {
GENLIB_ERR_NONE = 0, ///< No error
GENLIB_ERR_GENERIC = -1, ///< Generic error
GENLIB_ERR_INVALID_PTR = -2, ///< Invalid Pointer
GENLIB_ERR_DUPLICATE = -3, ///< Duplicate
GENLIB_ERR_OUT_OF_MEM = -4, ///< Out of memory
GENLIB_ERR_LOOP_OVERFLOW = 100, // too many iterations of loops in perform()
GENLIB_ERR_NULL_BUFFER = 101 // missing signal data in perform()
} e_genlib_errorcodes;

typedef enum {
GENLIB_PARAMTYPE_FLOAT = 0,
GENLIB_PARAMTYPE_SYM = 1
} e_genlib_paramtypes;

struct ParamInfo
{
t_param defaultvalue;
void * defaultref;
char hasinputminmax;
char hasminmax;
t_param inputmin, inputmax;
t_param outputmin, outputmax;
const char *name;
const char *units;
int paramtype; // 0 -> float64, 1 -> symbol (table name)
t_param exp; // future, for scaling
};

struct CommonState
{
t_sample sr;
int vs;
int numins;
int numouts;
const char **inputnames;
const char **outputnames;
int numparams;
ParamInfo *params;
void * parammap; // implementation-dependent
void * api; // implementation-dependent
};

// opaque interface to float32 buffer:
typedef struct _genlib_buffer t_genlib_buffer;
typedef struct {
char b_name[256]; ///< name of the buffer
float *b_samples; ///< stored with interleaved channels if multi-channel
long b_frames; ///< number of sample frames (each one is sizeof(float) * b_nchans bytes)
long b_nchans; ///< number of channels
long b_size; ///< size of buffer in floats
float b_sr; ///< sampling rate of the buffer
long b_modtime; ///< last modified time ("dirty" method)
long b_rfu[57]; ///< reserved for future use
} t_genlib_buffer_info;

// opaque interface to float64 buffer:
typedef struct _genlib_data t_genlib_data;
typedef struct {
int dim, channels;
t_sample * data;
} t_genlib_data_info;

typedef void (*setparameter_method) (CommonState *, long, t_param, void *);
typedef void (*getparameter_method) (CommonState *, long, t_param *);

#endif // GENLIB_COMMON_H



+ 43
- 0
plugins/common/gen_dsp/genlib_common_win.h View File

@@ -0,0 +1,43 @@
/*******************************************************************************************************************
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.
*******************************************************************************************************************/

#ifndef GENLIB_COMMON_WIN_H
#define GENLIB_COMMON_WIN_H

#ifdef _MSC_VER
#define GEN_WINDOWS
#endif

#ifdef GEN_WINDOWS

#include <malloc.h>
#include <limits>

typedef __int32 int32_t;
typedef unsigned __int32 uint32_t;
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
#define malloc_size _msize
#define __DBL_EPSILON__ (DBL_EPSILON)

#endif

#endif


+ 38
- 0
plugins/common/gen_dsp/genlib_exportfunctions.h View File

@@ -0,0 +1,38 @@
/*******************************************************************************************************************
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.
*******************************************************************************************************************/

#ifndef GENLIB_EXPORT_FUNCTIONS_H
#define GENLIB_EXPORT_FUNCTIONS_H 1

typedef char *t_ptr;

t_ptr sysmem_newptr(t_ptr_size size);
t_ptr sysmem_newptrclear(t_ptr_size size);
t_ptr sysmem_resizeptr(void *ptr, t_ptr_size newsize);
t_ptr sysmem_resizeptrclear(void *ptr, t_ptr_size newsize);
t_ptr_size sysmem_ptrsize(void *ptr);
void sysmem_freeptr(void *ptr);
void sysmem_copyptr(const void *src, void *dst, t_ptr_size bytes);
unsigned long systime_ticks(void);

void genlib_report_error(const char *s);
void genlib_report_message(const char *s);
void set_zero64(t_sample *mem, long size);

#endif // GENLIB_EXPORT_FUNCTIONS_H

+ 1374
- 0
plugins/common/gen_dsp/genlib_ops.h
File diff suppressed because it is too large
View File


+ 34
- 0
plugins/freeverb/DistrhoPluginInfo.h View File

@@ -0,0 +1,34 @@
/*
* 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_BRAND "DISTRHO"
#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:ReverbPlugin"

#define DISTRHO_PLUGIN_DESCRIPTION "Max Gen Freeverb example."
#define DISTRHO_PLUGIN_VERSION d_cconst('D', 'M', 'f', 'v')

#endif // DISTRHO_PLUGIN_INFO_H_INCLUDED

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

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

+ 40
- 0
plugins/freeverb/Makefile View File

@@ -0,0 +1,40 @@
#!/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.DPF-Max-Gen.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)

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

+ 420
- 0
plugins/freeverb/gen_exported.cpp View File

@@ -0,0 +1,420 @@
#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_24;
Delay m_delay_15;
Delay m_delay_13;
Delay m_delay_23;
Delay m_delay_9;
Delay m_delay_17;
Delay m_delay_21;
Delay m_delay_19;
Delay m_delay_22;
Delay m_delay_7;
Delay m_delay_11;
Delay m_delay_5;
double m_history_6;
double m_history_18;
double m_fb_1;
double m_history_20;
double samplerate;
double m_damp_2;
double m_history_8;
double m_history_16;
double m_history_14;
double m_fb_3;
double m_history_12;
double m_history_10;
double m_spread_4;
int vectorsize;
int __exception;
// re-initialize all member variables;
inline void reset(double __sr, int __vs) {
__exception = 0;
vectorsize = __vs;
samplerate = __sr;
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);
m_history_8 = 0;
m_delay_9.reset("m_delay_9", 2000);
m_history_10 = 0;
m_delay_11.reset("m_delay_11", 2000);
m_history_12 = 0;
m_delay_13.reset("m_delay_13", 2000);
m_history_14 = 0;
m_delay_15.reset("m_delay_15", 2000);
m_history_16 = 0;
m_delay_17.reset("m_delay_17", 2000);
m_history_18 = 0;
m_delay_19.reset("m_delay_19", 2000);
m_history_20 = 0;
m_delay_21.reset("m_delay_21", 2000);
m_delay_22.reset("m_delay_22", 2000);
m_delay_23.reset("m_delay_23", 2000);
m_delay_24.reset("m_delay_24", 2000);
genlib_reset_complete(this);
};
// the signal processing routine;
inline int perform(t_sample ** __ins, t_sample ** __outs, int __n) {
vectorsize = __n;
const t_sample * __in1 = __ins[0];
t_sample * __out1 = __outs[0];
if (__exception) {
return __exception;
} else if (( (__in1 == 0) || (__out1 == 0) )) {
__exception = GENLIB_ERR_NULL_BUFFER;
return __exception;
};
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_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();
m_delay_11.step();
m_delay_13.step();
m_delay_15.step();
m_delay_17.step();
m_delay_19.step();
m_delay_21.step();
m_delay_22.step();
m_delay_23.step();
m_delay_24.step();
// assign results to output buffer;
(*(__out1++)) = out1;
};
return __exception;
};
inline void set_fb2(double _value) {
m_fb_1 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value));
};
inline void set_damp(double _value) {
m_damp_2 = (_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;


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

/// Number of signal inputs and outputs

int gen_kernel_numins = 1;
int gen_kernel_numouts = 1;

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

/// Assistive lables for the signal inputs and outputs

const char * gen_kernel_innames[] = { "in1" };
const char * gen_kernel_outnames[] = { "out1" };

/// Invoke the signal process of a State object

int perform(CommonState *cself, t_sample **ins, long numins, t_sample **outs, long numouts, long n) {
State * self = (State *)cself;
return self->perform(ins, outs, n);
}

/// Reset all parameters and stateful operators of a State object

void reset(CommonState *cself) {
State * self = (State *)cself;
self->reset(cself->sr, cself->vs);
}

/// Set a parameter of a State object

void setparameter(CommonState *cself, long index, double value, void *ref) {
State * self = (State *)cself;
switch (index) {
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;
}
}

/// 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_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;
}
}

/// 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_fb_1")
pi = self->__commonstate.params + 0;
pi->name = "fb2";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
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 = 1;
pi->exp = 0;
pi->units = ""; // no units defined
// initialize parameter 1 ("m_damp_2")
pi = self->__commonstate.params + 1;
pi->name = "damp";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_damp_2;
pi->defaultref = 0;
pi->hasinputminmax = false;
pi->inputmin = 0;
pi->inputmax = 1;
pi->hasminmax = true;
pi->outputmin = 0;
pi->outputmax = 1;
pi->exp = 0;
pi->units = ""; // no units defined
// initialize parameter 2 ("m_fb_3")
pi = self->__commonstate.params + 2;
pi->name = "fb1";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_fb_3;
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_spread_4")
pi = self->__commonstate.params + 3;
pi->name = "spread";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
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 = 400;
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/freeverb/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::

+ 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
}
]
}

}

+ 34
- 0
plugins/gigaverb/DistrhoPluginInfo.h View File

@@ -0,0 +1,34 @@
/*
* 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_BRAND "DISTRHO"
#define DISTRHO_PLUGIN_NAME "MaGigaverb"
#define DISTRHO_PLUGIN_URI "http://distrho.sf.net/plugins/MaGigaverb"

#define DISTRHO_PLUGIN_HAS_UI 0
#define DISTRHO_PLUGIN_IS_RT_SAFE 0
#define DISTRHO_PLUGIN_NUM_INPUTS 2
#define DISTRHO_PLUGIN_NUM_OUTPUTS 2

#define DISTRHO_PLUGIN_LV2_CATEGORY "lv2:ReverbPlugin"

#define DISTRHO_PLUGIN_DESCRIPTION "Max Gen Gigaverb example."
#define DISTRHO_PLUGIN_VERSION d_cconst('D', 'M', 'g', 'v')

#endif // DISTRHO_PLUGIN_INFO_H_INCLUDED

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

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

+ 40
- 0
plugins/gigaverb/Makefile View File

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

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

NAME = MaGigaverb

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

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

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

include ../Makefile.DPF-Max-Gen.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)

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

+ 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::

+ 37
- 0
plugins/gigaverb/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::

+ 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


+ 35
- 0
plugins/pitchotto/DistrhoPluginInfo.h View File

@@ -0,0 +1,35 @@
/*
* 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_BRAND "Shiro"
#define DISTRHO_PLUGIN_NAME "Pitchotto"
#define DISTRHO_PLUGIN_URI "http://distrho.sf.net/plugins/Pitchotto"

#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:PitchPlugin"

#define DISTRHO_PLUGIN_DESCRIPTION "Pitchotto is a pitch-shifter based on the \"Pitch-Shift\"-genpatch in Max, where Phase-shifting is used to achieve different intervals.\n\
There are two shifted signals available, both with variable window-sizes for arpeggio-like sounds."
#define DISTRHO_PLUGIN_VERSION d_cconst('D', 'M', 'p', 'c')

#endif // DISTRHO_PLUGIN_INFO_H_INCLUDED

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

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

+ 40
- 0
plugins/pitchotto/Makefile View File

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

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

NAME = Pitchotto

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

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

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

include ../Makefile.DPF-Max-Gen.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)

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

+ 568
- 0
plugins/pitchotto/gen_exported.cpp View File

@@ -0,0 +1,568 @@
#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_12;
Delay m_delay_11;
Delta m_delta_22;
Delta m_delta_38;
Delta m_delta_41;
Delta m_delta_31;
Delta m_delta_28;
Delta m_delta_25;
Delta m_delta_44;
Delta m_delta_35;
Phasor m_phasor_34;
Phasor m_phasor_21;
Sah m_sah_23;
Sah m_sah_27;
Sah m_sah_42;
Sah m_sah_26;
Sah m_sah_24;
Sah m_sah_43;
Sah m_sah_36;
Sah m_sah_29;
Sah m_sah_40;
Sah m_sah_37;
Sah m_sah_30;
Sah m_sah_39;
Sah m_sah_32;
Sah m_sah_33;
Sah m_sah_46;
Sah m_sah_45;
double m_history_5;
double m_history_6;
double m_history_7;
double samples_to_seconds;
double m_history_4;
double m_history_2;
double m_history_3;
double samplerate;
double m_y_1;
double m_history_9;
double m_history_8;
double m_resonance_13;
double m_y_10;
double m_window_19;
double m_ratio_20;
double m_blur_17;
double m_ratio_18;
double m_window_15;
double m_cutoff_14;
double m_mix_16;
int vectorsize;
int __exception;
// re-initialize all member variables;
inline void reset(double __sr, int __vs) {
__exception = 0;
vectorsize = __vs;
samplerate = __sr;
m_y_1 = 0;
m_history_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_y_10 = 0;
m_delay_11.reset("m_delay_11", 96000);
m_delay_12.reset("m_delay_12", 96000);
m_resonance_13 = 0;
m_cutoff_14 = 2250;
m_window_15 = 100;
m_mix_16 = 0.5;
m_blur_17 = 0.25;
m_ratio_18 = 0.5;
m_window_19 = 100;
m_ratio_20 = 2;
samples_to_seconds = (1 / samplerate);
m_phasor_21.reset(0);
m_delta_22.reset(0);
m_sah_23.reset(0);
m_sah_24.reset(0);
m_delta_25.reset(0);
m_sah_26.reset(0);
m_sah_27.reset(0);
m_delta_28.reset(0);
m_sah_29.reset(0);
m_sah_30.reset(0);
m_delta_31.reset(0);
m_sah_32.reset(0);
m_sah_33.reset(0);
m_phasor_34.reset(0);
m_delta_35.reset(0);
m_sah_36.reset(0);
m_sah_37.reset(0);
m_delta_38.reset(0);
m_sah_39.reset(0);
m_sah_40.reset(0);
m_delta_41.reset(0);
m_sah_42.reset(0);
m_sah_43.reset(0);
m_delta_44.reset(0);
m_sah_45.reset(0);
m_sah_46.reset(0);
genlib_reset_complete(this);
};
// the signal processing routine;
inline int perform(t_sample ** __ins, t_sample ** __outs, int __n) {
vectorsize = __n;
const t_sample * __in1 = __ins[0];
t_sample * __out1 = __outs[0];
if (__exception) {
return __exception;
} else if (( (__in1 == 0) || (__out1 == 0) )) {
__exception = GENLIB_ERR_NULL_BUFFER;
return __exception;
};
double mul_2327 = (m_resonance_13 * 0.125);
double exp_2328 = exp(mul_2327);
double mul_2326 = (exp_2328 * 0.882497);
double mul_2322 = (mul_2326 * mul_2326);
double expr_2437 = safediv(((m_cutoff_14 * 2) * 3.1415926535898), 44100);
double cos_2325 = cos(expr_2437);
double mul_2324 = (cos_2325 * mul_2326);
double mul_2323 = (mul_2324 * -2);
double add_2321 = ((mul_2323 + mul_2322) + 1);
double mstosamps_2393 = (m_window_15 * (samplerate * 0.001));
double mstosamps_2309 = (m_window_19 * (samplerate * 0.001));
double rsub_2296 = (1 - m_ratio_20);
double mul_2295 = (rsub_2296 * 1000);
double div_2294 = safediv(mul_2295, m_window_19);
samples_to_seconds = (1 / samplerate);
double rsub_2380 = (1 - m_ratio_18);
double mul_2379 = (rsub_2380 * 1000);
double div_2378 = safediv(mul_2379, m_window_15);
// the main sample loop;
while ((__n--)) {
const double in1 = (*(__in1++));
double noise_2247 = noise();
double abs_2264 = fabs(noise_2247);
double mul_2270 = (abs_2264 * m_blur_17);
double noise_2246 = noise();
double abs_2263 = fabs(noise_2246);
double mul_2267 = (abs_2263 * m_blur_17);
double noise_2330 = noise();
double abs_2348 = fabs(noise_2330);
double mul_2354 = (abs_2348 * m_blur_17);
double noise_2332 = noise();
double abs_2350 = fabs(noise_2332);
double mul_2360 = (abs_2350 * m_blur_17);
double noise_2249 = noise();
double abs_2266 = fabs(noise_2249);
double mul_2276 = (abs_2266 * m_blur_17);
double noise_2248 = noise();
double abs_2265 = fabs(noise_2248);
double mul_2273 = (abs_2265 * m_blur_17);
double noise_2331 = noise();
double abs_2349 = fabs(noise_2331);
double mul_2357 = (abs_2349 * m_blur_17);
double noise_2329 = noise();
double abs_2347 = fabs(noise_2329);
double mul_2351 = (abs_2347 * m_blur_17);
double mul_2318 = (mul_2322 * m_y_10);
double mul_2319 = (mul_2323 * m_y_1);
double phasor_2315 = m_phasor_21(div_2294, samples_to_seconds);
double add_2293 = ((phasor_2315 + m_history_9) + 0.5);
double mod_2292 = safemod(add_2293, 1);
double delta_2272 = m_delta_22(mod_2292);
double sah_2252 = m_sah_23(mul_2270, delta_2272, 0);
double sah_2271 = m_sah_24(mstosamps_2309, delta_2272, 0);
double mul_2260 = (sah_2271 * mod_2292);
double sub_2291 = (mod_2292 - 0.5);
double mul_2290 = (sub_2291 * 3.1415926535898);
double cos_2289 = cos(mul_2290);
double mul_2279 = (cos_2289 * cos_2289);
double add_2287 = ((phasor_2315 + m_history_8) + 0.75);
double mod_2286 = safemod(add_2287, 1);
double delta_2269 = m_delta_25(mod_2286);
double sah_2250 = m_sah_26(mul_2267, delta_2269, 0);
double sah_2268 = m_sah_27(mstosamps_2309, delta_2269, 0);
double mul_2259 = (sah_2268 * mod_2286);
double sub_2285 = (mod_2286 - 0.5);
double mul_2284 = (sub_2285 * 3.1415926535898);
double cos_2283 = cos(mul_2284);
double mul_2278 = (cos_2283 * cos_2283);
double add_2314 = ((phasor_2315 + m_history_7) + 0);
double mod_2313 = safemod(add_2314, 1);
double delta_2257 = m_delta_28(mod_2313);
double sah_2256 = m_sah_29(mul_2276, delta_2257, 0);
double sah_2277 = m_sah_30(mstosamps_2309, delta_2257, 0);
double mul_2262 = (sah_2277 * mod_2313);
double sub_2312 = (mod_2313 - 0.5);
double mul_2311 = (sub_2312 * 3.1415926535898);
double cos_2310 = cos(mul_2311);
double mul_2281 = (cos_2310 * cos_2310);
double add_2308 = ((phasor_2315 + m_history_6) + 0.25);
double mod_2307 = safemod(add_2308, 1);
double delta_2275 = m_delta_31(mod_2307);
double sah_2254 = m_sah_32(mul_2273, delta_2275, 0);
double sah_2274 = m_sah_33(mstosamps_2309, delta_2275, 0);
double mul_2261 = (sah_2274 * mod_2307);
double tap_2300 = m_delay_12.read_linear(mul_2262);
double tap_2301 = m_delay_12.read_linear(mul_2261);
double tap_2302 = m_delay_12.read_linear(mul_2260);
double tap_2303 = m_delay_12.read_linear(mul_2259);
double mul_2282 = (tap_2303 * mul_2278);
double mul_2288 = (tap_2302 * mul_2279);
double mul_2298 = (tap_2300 * mul_2281);
double sub_2306 = (mod_2307 - 0.5);
double mul_2305 = (sub_2306 * 3.1415926535898);
double cos_2304 = cos(mul_2305);
double mul_2280 = (cos_2304 * cos_2304);
double mul_2297 = (tap_2301 * mul_2280);
double phasor_2399 = m_phasor_34(div_2378, samples_to_seconds);
double add_2377 = ((m_history_5 + phasor_2399) + 0.5);
double mod_2376 = safemod(add_2377, 1);
double delta_2356 = m_delta_35(mod_2376);
double sah_2335 = m_sah_36(mul_2354, delta_2356, 0);
double sah_2355 = m_sah_37(mstosamps_2393, delta_2356, 0);
double mul_2344 = (sah_2355 * mod_2376);
double sub_2375 = (mod_2376 - 0.5);
double mul_2374 = (sub_2375 * 3.1415926535898);
double cos_2373 = cos(mul_2374);
double mul_2363 = (cos_2373 * cos_2373);
double add_2398 = ((m_history_4 + phasor_2399) + 0);
double mod_2397 = safemod(add_2398, 1);
double delta_2340 = m_delta_38(mod_2397);
double sah_2339 = m_sah_39(mul_2360, delta_2340, 0);
double sah_2361 = m_sah_40(mstosamps_2393, delta_2340, 0);
double mul_2346 = (sah_2361 * mod_2397);
double sub_2396 = (mod_2397 - 0.5);
double mul_2395 = (sub_2396 * 3.1415926535898);
double cos_2394 = cos(mul_2395);
double mul_2365 = (cos_2394 * cos_2394);
double add_2392 = ((m_history_3 + phasor_2399) + 0.25);
double mod_2391 = safemod(add_2392, 1);
double delta_2359 = m_delta_41(mod_2391);
double sah_2337 = m_sah_42(mul_2357, delta_2359, 0);
double sah_2358 = m_sah_43(mstosamps_2393, delta_2359, 0);
double mul_2345 = (sah_2358 * mod_2391);
double sub_2390 = (mod_2391 - 0.5);
double mul_2389 = (sub_2390 * 3.1415926535898);
double cos_2388 = cos(mul_2389);
double mul_2364 = (cos_2388 * cos_2388);
double add_2371 = ((m_history_2 + phasor_2399) + 0.75);
double mod_2370 = safemod(add_2371, 1);
double delta_2353 = m_delta_44(mod_2370);
double sah_2333 = m_sah_45(mul_2351, delta_2353, 0);
double sah_2352 = m_sah_46(mstosamps_2393, delta_2353, 0);
double mul_2343 = (sah_2352 * mod_2370);
double tap_2384 = m_delay_11.read_linear(mul_2346);
double tap_2385 = m_delay_11.read_linear(mul_2345);
double tap_2386 = m_delay_11.read_linear(mul_2344);
double tap_2387 = m_delay_11.read_linear(mul_2343);
double mul_2382 = (tap_2384 * mul_2365);
double mul_2381 = (tap_2385 * mul_2364);
double mul_2372 = (tap_2386 * mul_2363);
double sub_2369 = (mod_2370 - 0.5);
double mul_2368 = (sub_2369 * 3.1415926535898);
double cos_2367 = cos(mul_2368);
double mul_2362 = (cos_2367 * cos_2367);
double mul_2366 = (tap_2387 * mul_2362);
double mul_2320 = ((((((((mul_2298 + mul_2297) + mul_2288) + mul_2282) + mul_2366) + mul_2372) + mul_2381) + mul_2382) * add_2321);
double sub_2317 = (mul_2320 - (mul_2319 + mul_2318));
double mix_2450 = (in1 + (m_mix_16 * (sub_2317 - in1)));
double out1 = mix_2450;
double y2_next_2440 = m_y_1;
double history_2253_next_2441 = sah_2252;
double history_2251_next_2442 = sah_2250;
double history_2258_next_2443 = sah_2256;
double history_2255_next_2444 = sah_2254;
double history_2336_next_2445 = sah_2335;
double history_2341_next_2446 = sah_2339;
double history_2338_next_2447 = sah_2337;
double history_2334_next_2448 = sah_2333;
double y1_next_2449 = sub_2317;
m_delay_12.write(in1);
m_delay_11.write(in1);
m_y_10 = y2_next_2440;
m_history_9 = history_2253_next_2441;
m_history_8 = history_2251_next_2442;
m_history_7 = history_2258_next_2443;
m_history_6 = history_2255_next_2444;
m_history_5 = history_2336_next_2445;
m_history_4 = history_2341_next_2446;
m_history_3 = history_2338_next_2447;
m_history_2 = history_2334_next_2448;
m_y_1 = y1_next_2449;
m_delay_11.step();
m_delay_12.step();
// assign results to output buffer;
(*(__out1++)) = out1;
};
return __exception;
};
inline void set_resonance(double _value) {
m_resonance_13 = (_value < 0 ? 0 : (_value > 0.25 ? 0.25 : _value));
};
inline void set_cutoff(double _value) {
m_cutoff_14 = (_value < 0 ? 0 : (_value > 3000 ? 3000 : _value));
};
inline void set_window1(double _value) {
m_window_15 = (_value < 0.1 ? 0.1 : (_value > 1000 ? 1000 : _value));
};
inline void set_mix(double _value) {
m_mix_16 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value));
};
inline void set_blur(double _value) {
m_blur_17 = (_value < 0.01 ? 0.01 : (_value > 0.25 ? 0.25 : _value));
};
inline void set_ratio1(double _value) {
m_ratio_18 = (_value < 0.5 ? 0.5 : (_value > 2 ? 2 : _value));
};
inline void set_window2(double _value) {
m_window_19 = (_value < 0.1 ? 0.1 : (_value > 1000 ? 1000 : _value));
};
inline void set_ratio2(double _value) {
m_ratio_20 = (_value < 0.5 ? 0.5 : (_value > 2 ? 2 : _value));
};
} State;


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

/// Number of signal inputs and outputs

int gen_kernel_numins = 1;
int gen_kernel_numouts = 1;

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

/// Assistive lables for the signal inputs and outputs

const char * gen_kernel_innames[] = { "in1" };
const char * gen_kernel_outnames[] = { "out1" };

/// Invoke the signal process of a State object

int perform(CommonState *cself, t_sample **ins, long numins, t_sample **outs, long numouts, long n) {
State * self = (State *)cself;
return self->perform(ins, outs, n);
}

/// Reset all parameters and stateful operators of a State object

void reset(CommonState *cself) {
State * self = (State *)cself;
self->reset(cself->sr, cself->vs);
}

/// Set a parameter of a State object

void setparameter(CommonState *cself, long index, double value, void *ref) {
State * self = (State *)cself;
switch (index) {
case 0: self->set_resonance(value); break;
case 1: self->set_cutoff(value); break;
case 2: self->set_window1(value); break;
case 3: self->set_mix(value); break;
case 4: self->set_blur(value); break;
case 5: self->set_ratio1(value); break;
case 6: self->set_window2(value); break;
case 7: self->set_ratio2(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_resonance_13; break;
case 1: *value = self->m_cutoff_14; break;
case 2: *value = self->m_window_15; break;
case 3: *value = self->m_mix_16; break;
case 4: *value = self->m_blur_17; break;
case 5: *value = self->m_ratio_18; break;
case 6: *value = self->m_window_19; break;
case 7: *value = self->m_ratio_20; 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_resonance_13")
pi = self->__commonstate.params + 0;
pi->name = "resonance";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_resonance_13;
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_cutoff_14")
pi = self->__commonstate.params + 1;
pi->name = "cutoff";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_cutoff_14;
pi->defaultref = 0;
pi->hasinputminmax = false;
pi->inputmin = 0;
pi->inputmax = 1;
pi->hasminmax = true;
pi->outputmin = 0;
pi->outputmax = 3000;
pi->exp = 0;
pi->units = ""; // no units defined
// initialize parameter 2 ("m_window_15")
pi = self->__commonstate.params + 2;
pi->name = "window1";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_window_15;
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 3 ("m_mix_16")
pi = self->__commonstate.params + 3;
pi->name = "mix";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_mix_16;
pi->defaultref = 0;
pi->hasinputminmax = false;
pi->inputmin = 0;
pi->inputmax = 1;
pi->hasminmax = true;
pi->outputmin = 0;
pi->outputmax = 1;
pi->exp = 0;
pi->units = ""; // no units defined
// initialize parameter 4 ("m_blur_17")
pi = self->__commonstate.params + 4;
pi->name = "blur";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_blur_17;
pi->defaultref = 0;
pi->hasinputminmax = false;
pi->inputmin = 0;
pi->inputmax = 1;
pi->hasminmax = true;
pi->outputmin = 0.01;
pi->outputmax = 0.25;
pi->exp = 0;
pi->units = ""; // no units defined
// initialize parameter 5 ("m_ratio_18")
pi = self->__commonstate.params + 5;
pi->name = "ratio1";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_ratio_18;
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 6 ("m_window_19")
pi = self->__commonstate.params + 6;
pi->name = "window2";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_window_19;
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 7 ("m_ratio_20")
pi = self->__commonstate.params + 7;
pi->name = "ratio2";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_ratio_20;
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
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/pitchotto/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::

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


+ 7288
- 0
plugins/pitchotto/pitchotto.maxpat
File diff suppressed because it is too large
View File


+ 34
- 0
plugins/pitchshift/DistrhoPluginInfo.h View File

@@ -0,0 +1,34 @@
/*
* 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_BRAND "DISTRHO"
#define DISTRHO_PLUGIN_NAME "MaPitchshift"
#define DISTRHO_PLUGIN_URI "http://distrho.sf.net/plugins/MaPitchshift"

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

#define DISTRHO_PLUGIN_LV2_CATEGORY "lv2:PitchPlugin"

#define DISTRHO_PLUGIN_DESCRIPTION "Max Gen Pitchshifter example."
#define DISTRHO_PLUGIN_VERSION d_cconst('D', 'M', 'p', 's')

#endif // DISTRHO_PLUGIN_INFO_H_INCLUDED

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

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

+ 40
- 0
plugins/pitchshift/Makefile View File

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

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

NAME = MaPitchshift

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

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

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

include ../Makefile.DPF-Max-Gen.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)

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

+ 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 = 1;
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


+ 34
- 0
plugins/shiroverb/DistrhoPluginInfo.h View File

@@ -0,0 +1,34 @@
/*
* 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_BRAND "Shiro"
#define DISTRHO_PLUGIN_NAME "Shiroverb"
#define DISTRHO_PLUGIN_URI "http://distrho.sf.net/plugins/Shiroverb"

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

#define DISTRHO_PLUGIN_LV2_CATEGORY "lv2:ReverbPlugin"

#define DISTRHO_PLUGIN_DESCRIPTION "Shiroverb is a shimmer-reverb based on the \"Gigaverb\"-genpatch, ported from the implementation by Juhana Sadeharju, and the \"Pitch-Shift\"-genpatch, both in Max."
#define DISTRHO_PLUGIN_VERSION d_cconst('D', 'M', 's', 'v')

#endif // DISTRHO_PLUGIN_INFO_H_INCLUDED

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

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

+ 40
- 0
plugins/shiroverb/Makefile View File

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

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

NAME = Shiroverb

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

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

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

include ../Makefile.DPF-Max-Gen.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)

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

+ 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_roomsize_34;
double m_tail_35;
double m_blur_36;
double m_damping_38;
double m_shimmer_33;
double m_decay_37;
double samples_to_seconds;
double m_early_32;
double m_ratio_25;
double m_spread_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_cutoff_31;
double m_history_7;
double m_history_9;
double m_tone_28;
double m_mix_29;
double m_history_8;
double m_resonance_27;
double m_y_11;
double m_history_10;
double m_window_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", 5000);
m_delay_13.reset("m_delay_13", 7000);
m_delay_14.reset("m_delay_14", 15000);
m_delay_15.reset("m_delay_15", 16000);
m_delay_16.reset("m_delay_16", 6000);
m_delay_17.reset("m_delay_17", 48000);
m_delay_18.reset("m_delay_18", 96000);
m_delay_19.reset("m_delay_19", 10000);
m_delay_20.reset("m_delay_20", 12000);
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_window_26 = 100;
m_resonance_27 = 0;
m_tone_28 = 0.5;
m_mix_29 = 0.5;
m_spread_30 = 25;
m_cutoff_31 = 3000;
m_early_32 = 0.25;
m_shimmer_33 = 0.5;
m_roomsize_34 = 150;
m_tail_35 = 0.25;
m_blur_36 = 0.25;
m_decay_37 = 180;
m_damping_38 = 0.75;
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_552 = (1 - m_tone_28);
double expr_1476 = safepow(0.001, safediv(1, (m_decay_37 * 44100)));
double expr_1477 = safediv((m_roomsize_34 * 44100), 340);
double mul_542 = (expr_1477 * 0.7071);
double expr_1469 = (-safepow(expr_1476, mul_542));
double mul_541 = (expr_1477 * 0.63245);
double expr_1468 = (-safepow(expr_1476, mul_541));
double mul_543 = (expr_1477 * 0.81649);
double expr_1470 = (-safepow(expr_1476, mul_543));
double mul_544 = (expr_1477 * 1);
double expr_1475 = (-safepow(expr_1476, mul_544));
double expr_1478 = safediv(((m_cutoff_31 * 2) * 3.1415926535898), 44100);
double cos_1010 = cos(expr_1478);
double mul_1012 = (m_resonance_27 * 0.125);
double exp_1013 = exp(mul_1012);
double mul_1011 = (exp_1013 * 0.882497);
double mul_1007 = (mul_1011 * mul_1011);
double mul_1009 = (cos_1010 * mul_1011);
double mul_1008 = (mul_1009 * -2);
double add_1006 = ((mul_1007 + mul_1008) + 1);
double mul_538 = (expr_1477 * 0.000527);
int int_537 = int(mul_538);
double mstosamps_963 = (m_window_26 * (samplerate * 0.001));
double add_467 = (expr_1477 + 5);
double expr_1471 = safepow(expr_1476, add_467);
double mul_478 = (m_spread_30 * -0.380445);
double add_477 = (mul_478 + 931);
double rsub_474 = (1341 - add_477);
double mul_487 = (int_537 * rsub_474);
double mul_506 = (m_spread_30 * 0.376623);
double add_505 = (mul_506 + 931);
double rsub_502 = (1341 - add_505);
double mul_513 = (int_537 * rsub_502);
double rsub_950 = (1 - m_ratio_25);
double mul_949 = (rsub_950 * 1000);
double div_948 = safediv(mul_949, m_window_26);
samples_to_seconds = (1 / samplerate);
double mul_473 = (expr_1477 * 0.41);
double add_470 = (mul_473 + 5);
double expr_1474 = safepow(expr_1476, add_470);
double mul_472 = (expr_1477 * 0.3);
double add_469 = (mul_472 + 5);
double expr_1473 = safepow(expr_1476, add_469);
double mul_471 = (expr_1477 * 0.155);
double add_468 = (mul_471 + 5);
double expr_1472 = safepow(expr_1476, add_468);
double mul_536 = (expr_1477 * 0.110732);
double mul_480 = (m_spread_30 * -0.568366);
double add_476 = (mul_480 + 369);
double rsub_475 = (add_477 - add_476);
double mul_494 = (int_537 * rsub_475);
double mul_522 = (m_spread_30 * 0.125541);
double add_504 = (mul_522 + 369);
double rsub_503 = (add_505 - add_504);
double mul_520 = (int_537 * rsub_503);
double add_479 = (mul_480 + 159);
double mul_501 = (int_537 * add_479);
double add_521 = (mul_522 + 159);
double mul_529 = (int_537 * add_521);
// the main sample loop;
while ((__n--)) {
const double in1 = (*(__in1++));
double noise_900 = noise();
double abs_917 = fabs(noise_900);
double mul_921 = (abs_917 * m_blur_36);
double noise_902 = noise();
double abs_919 = fabs(noise_902);
double mul_927 = (abs_919 * m_blur_36);
double noise_903 = noise();
double abs_920 = fabs(noise_903);
double mul_930 = (abs_920 * m_blur_36);
double noise_901 = noise();
double abs_918 = fabs(noise_901);
double mul_924 = (abs_918 * m_blur_36);
double tap_447 = m_delay_24.read_linear(mul_542);
double mul_443 = (tap_447 * expr_1469);
double mix_1521 = (mul_443 + (m_damping_38 * (m_history_10 - mul_443)));
double mix_445 = mix_1521;
double tap_441 = m_delay_23.read_linear(mul_541);
double mul_437 = (tap_441 * expr_1468);
double mix_1522 = (mul_437 + (m_damping_38 * (m_history_9 - mul_437)));
double mix_439 = mix_1522;
double tap_453 = m_delay_22.read_linear(mul_543);
double mul_449 = (tap_453 * expr_1470);
double mix_1523 = (mul_449 + (m_damping_38 * (m_history_8 - mul_449)));
double mix_451 = mix_1523;
double tap_549 = m_delay_21.read_linear(mul_544);
double mul_540 = (tap_549 * expr_1475);
double mix_1524 = (mul_540 + (m_damping_38 * (m_history_7 - mul_540)));
double mix_547 = mix_1524;
double mul_1003 = (mul_1007 * m_y_11);
double mul_1004 = (mul_1008 * m_y_2);
double add_431 = (mix_547 + mix_451);
double add_429 = (mix_445 + mix_439);
double add_424 = (add_431 + add_429);
double mul_407 = (add_424 * 0.5);
double sub_428 = (add_431 - add_429);
double mul_410 = (sub_428 * 0.5);
double sub_430 = (mix_547 - mix_451);
double sub_427 = (mix_445 - mix_439);
double sub_426 = (sub_430 - sub_427);
double mul_409 = (sub_426 * 0.5);
double add_425 = (sub_430 + sub_427);
double rsub_423 = (0 - add_425);
double mul_408 = (rsub_423 * 0.5);
double tap_486 = m_delay_20.read_linear(mul_487);
double mul_484 = (tap_486 * 0.625);
double tap_512 = m_delay_19.read_linear(mul_513);
double mul_510 = (tap_512 * 0.625);
double phasor_969 = m_phasor_39(div_948, samples_to_seconds);
double add_941 = ((phasor_969 + m_history_6) + 0.75);
double mod_940 = safemod(add_941, 1);
double delta_923 = m_delta_40(mod_940);
double sah_904 = m_sah_41(mul_921, delta_923, 0);
double sah_922 = m_sah_42(mstosamps_963, delta_923, 0);
double mul_913 = (sah_922 * mod_940);
double sub_939 = (mod_940 - 0.5);
double mul_938 = (sub_939 * 3.1415926535898);
double cos_937 = cos(mul_938);
double mul_932 = (cos_937 * cos_937);
double add_962 = ((phasor_969 + m_history_5) + 0.25);
double mod_961 = safemod(add_962, 1);
double delta_929 = m_delta_43(mod_961);
double sah_908 = m_sah_44(mul_927, delta_929, 0);
double sah_928 = m_sah_45(mstosamps_963, delta_929, 0);
double mul_915 = (sah_928 * mod_961);
double sub_960 = (mod_961 - 0.5);
double mul_959 = (sub_960 * 3.1415926535898);
double cos_958 = cos(mul_959);
double mul_934 = (cos_958 * cos_958);
double add_968 = ((phasor_969 + m_history_4) + 0);
double mod_967 = safemod(add_968, 1);
double delta_911 = m_delta_46(mod_967);
double sah_910 = m_sah_47(mul_930, delta_911, 0);
double sah_931 = m_sah_48(mstosamps_963, delta_911, 0);
double mul_916 = (sah_931 * mod_967);
double sub_966 = (mod_967 - 0.5);
double mul_965 = (sub_966 * 3.1415926535898);
double cos_964 = cos(mul_965);
double mul_935 = (cos_964 * cos_964);
double add_947 = ((phasor_969 + m_history_3) + 0.5);
double mod_946 = safemod(add_947, 1);
double delta_926 = m_delta_49(mod_946);
double sah_906 = m_sah_50(mul_924, delta_926, 0);
double sah_925 = m_sah_51(mstosamps_963, delta_926, 0);
double mul_914 = (sah_925 * mod_946);
double tap_954 = m_delay_18.read_linear(mul_916);
double tap_955 = m_delay_18.read_linear(mul_915);
double tap_956 = m_delay_18.read_linear(mul_914);
double tap_957 = m_delay_18.read_linear(mul_913);
double mul_952 = (tap_954 * mul_935);
double mul_951 = (tap_955 * mul_934);
double mul_936 = (tap_957 * mul_932);
double sub_945 = (mod_946 - 0.5);
double mul_944 = (sub_945 * 3.1415926535898);
double cos_943 = cos(mul_944);
double mul_933 = (cos_943 * cos_943);
double mul_942 = (tap_956 * mul_933);
double mul_1005 = ((((mul_936 + mul_942) + mul_951) + mul_952) * add_1006);
double sub_1002 = (mul_1005 - (mul_1003 + mul_1004));
double mix_1525 = (in1 + (m_shimmer_33 * (sub_1002 - in1)));
double mix_341 = mix_1525;
double mul_401 = (mix_341 * 0.707);
double mix_1526 = (mul_401 + (rsub_552 * (m_history_1 - mul_401)));
double mix_551 = mix_1526;
double tap_455 = m_delay_17.read_linear(add_470);
double tap_456 = m_delay_17.read_linear(add_469);
double tap_457 = m_delay_17.read_linear(add_468);
double tap_458 = m_delay_17.read_linear(add_467);
double mul_459 = (tap_458 * expr_1471);
double add_432 = (mul_407 + mul_459);
double mul_463 = (tap_456 * expr_1473);
double add_434 = (mul_409 + mul_463);
double mul_465 = (tap_455 * expr_1474);
double add_435 = (mul_410 + mul_465);
double mul_461 = (tap_457 * expr_1472);
double add_433 = (mul_408 + mul_461);
double tap_535 = m_delay_16.read_linear(mul_536);
double mul_533 = (tap_535 * 0.75);
double sub_532 = (mix_551 - mul_533);
double mul_531 = (sub_532 * 0.75);
double add_530 = (mul_531 + tap_535);
double tap_493 = m_delay_15.read_linear(mul_494);
double mul_491 = (tap_493 * 0.625);
double tap_519 = m_delay_14.read_linear(mul_520);
double mul_517 = (tap_519 * 0.625);
double tap_500 = m_delay_13.read_linear(mul_501);
double mul_498 = (tap_500 * 0.75);
double tap_528 = m_delay_12.read_linear(mul_529);
double mul_526 = (tap_528 * 0.75);
double mul_422 = (mul_410 * m_tail_35);
double mul_420 = (mul_408 * m_tail_35);
double add_406 = (mul_422 + mul_420);
double mul_421 = (mul_409 * m_tail_35);
double mul_419 = (mul_407 * m_tail_35);
double add_405 = (mul_421 + mul_419);
double sub_414 = (add_406 - add_405);
double mul_418 = (mul_465 * m_early_32);
double mul_416 = (mul_461 * m_early_32);
double add_404 = (mul_418 + mul_416);
double mul_417 = (mul_463 * m_early_32);
double mul_415 = (mul_459 * m_early_32);
double add_403 = (mul_417 + mul_415);
double sub_413 = (add_404 - add_403);
double add_400 = (sub_414 + sub_413);
double add_402 = (add_400 + mix_341);
double sub_497 = (add_402 - mul_498);
double mul_496 = (sub_497 * 0.75);
double add_495 = (mul_496 + tap_500);
double sub_490 = (add_495 - mul_491);
double mul_489 = (sub_490 * 0.625);
double add_488 = (mul_489 + tap_493);
double sub_483 = (add_488 - mul_484);
double mul_482 = (sub_483 * 0.625);
double add_481 = (mul_482 + tap_486);
double mul_1327 = (add_481 * m_mix_29);
double out2 = (mul_1327 + in1);
double add_412 = (add_400 + mix_341);
double sub_525 = (add_412 - mul_526);
double mul_524 = (sub_525 * 0.75);
double add_523 = (mul_524 + tap_528);
double sub_516 = (add_523 - mul_517);
double mul_515 = (sub_516 * 0.625);
double add_514 = (mul_515 + tap_519);
double sub_509 = (add_514 - mul_510);
double mul_508 = (sub_509 * 0.625);
double add_507 = (mul_508 + tap_512);
double mul_411 = (add_507 * m_mix_29);
double out1 = (in1 + mul_411);
double y2_next_1492 = m_y_2;
double history_444_next_1493 = mix_445;
double history_438_next_1494 = mix_439;
double history_450_next_1495 = mix_451;
double history_546_next_1496 = mix_547;
double history_905_next_1497 = sah_904;
double history_909_next_1498 = sah_908;
double history_912_next_1499 = sah_910;
double history_907_next_1500 = sah_906;
double y1_next_1501 = sub_1002;
double history_550_next_1502 = mix_551;
m_delay_24.write(add_433);
m_delay_23.write(add_432);
m_delay_22.write(add_434);
m_delay_21.write(add_435);
m_delay_20.write(sub_483);
m_delay_19.write(sub_509);
m_delay_18.write(in1);
m_delay_17.write(add_530);
m_delay_16.write(sub_532);
m_delay_15.write(sub_490);
m_delay_14.write(sub_516);
m_delay_13.write(sub_497);
m_delay_12.write(sub_525);
m_y_11 = y2_next_1492;
m_history_10 = history_444_next_1493;
m_history_9 = history_438_next_1494;
m_history_8 = history_450_next_1495;
m_history_7 = history_546_next_1496;
m_history_6 = history_905_next_1497;
m_history_5 = history_909_next_1498;
m_history_4 = history_912_next_1499;
m_history_3 = history_907_next_1500;
m_y_2 = y1_next_1501;
m_history_1 = history_550_next_1502;
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_window(double _value) {
m_window_26 = (_value < 0.1 ? 0.1 : (_value > 1000 ? 1000 : _value));
};
inline void set_resonance(double _value) {
m_resonance_27 = (_value < 0 ? 0 : (_value > 0.25 ? 0.25 : _value));
};
inline void set_tone(double _value) {
m_tone_28 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value));
};
inline void set_mix(double _value) {
m_mix_29 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value));
};
inline void set_spread(double _value) {
m_spread_30 = (_value < 0 ? 0 : (_value > 100 ? 100 : _value));
};
inline void set_cutoff(double _value) {
m_cutoff_31 = (_value < 0 ? 0 : (_value > 6000 ? 6000 : _value));
};
inline void set_early(double _value) {
m_early_32 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value));
};
inline void set_shimmer(double _value) {
m_shimmer_33 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value));
};
inline void set_roomsize(double _value) {
m_roomsize_34 = (_value < 0.1 ? 0.1 : (_value > 300 ? 300 : _value));
};
inline void set_tail(double _value) {
m_tail_35 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value));
};
inline void set_blur(double _value) {
m_blur_36 = (_value < 0.01 ? 0.01 : (_value > 0.25 ? 0.25 : _value));
};
inline void set_decay(double _value) {
m_decay_37 = (_value < 0.1 ? 0.1 : (_value > 360 ? 360 : _value));
};
inline void set_damping(double _value) {
m_damping_38 = (_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 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_window(value); break;
case 2: self->set_resonance(value); break;
case 3: self->set_tone(value); break;
case 4: self->set_mix(value); break;
case 5: self->set_spread(value); break;
case 6: self->set_cutoff(value); break;
case 7: self->set_early(value); break;
case 8: self->set_shimmer(value); break;
case 9: self->set_roomsize(value); break;
case 10: self->set_tail(value); break;
case 11: self->set_blur(value); break;
case 12: self->set_decay(value); break;
case 13: self->set_damping(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_window_26; break;
case 2: *value = self->m_resonance_27; break;
case 3: *value = self->m_tone_28; break;
case 4: *value = self->m_mix_29; break;
case 5: *value = self->m_spread_30; break;
case 6: *value = self->m_cutoff_31; break;
case 7: *value = self->m_early_32; break;
case 8: *value = self->m_shimmer_33; break;
case 9: *value = self->m_roomsize_34; break;
case 10: *value = self->m_tail_35; break;
case 11: *value = self->m_blur_36; break;
case 12: *value = self->m_decay_37; break;
case 13: *value = self->m_damping_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_window_26")
pi = self->__commonstate.params + 1;
pi->name = "window";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_window_26;
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_resonance_27")
pi = self->__commonstate.params + 2;
pi->name = "resonance";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_resonance_27;
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 3 ("m_tone_28")
pi = self->__commonstate.params + 3;
pi->name = "tone";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_tone_28;
pi->defaultref = 0;
pi->hasinputminmax = false;
pi->inputmin = 0;
pi->inputmax = 1;
pi->hasminmax = true;
pi->outputmin = 0;
pi->outputmax = 1;
pi->exp = 0;
pi->units = ""; // no units defined
// initialize parameter 4 ("m_mix_29")
pi = self->__commonstate.params + 4;
pi->name = "mix";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_mix_29;
pi->defaultref = 0;
pi->hasinputminmax = false;
pi->inputmin = 0;
pi->inputmax = 1;
pi->hasminmax = true;
pi->outputmin = 0;
pi->outputmax = 1;
pi->exp = 0;
pi->units = ""; // no units defined
// initialize parameter 5 ("m_spread_30")
pi = self->__commonstate.params + 5;
pi->name = "spread";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_spread_30;
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 6 ("m_cutoff_31")
pi = self->__commonstate.params + 6;
pi->name = "cutoff";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_cutoff_31;
pi->defaultref = 0;
pi->hasinputminmax = false;
pi->inputmin = 0;
pi->inputmax = 1;
pi->hasminmax = true;
pi->outputmin = 0;
pi->outputmax = 6000;
pi->exp = 0;
pi->units = ""; // no units defined
// initialize parameter 7 ("m_early_32")
pi = self->__commonstate.params + 7;
pi->name = "early";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_early_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_shimmer_33")
pi = self->__commonstate.params + 8;
pi->name = "shimmer";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_shimmer_33;
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 9 ("m_roomsize_34")
pi = self->__commonstate.params + 9;
pi->name = "roomsize";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_roomsize_34;
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 10 ("m_tail_35")
pi = self->__commonstate.params + 10;
pi->name = "tail";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_tail_35;
pi->defaultref = 0;
pi->hasinputminmax = false;
pi->inputmin = 0;
pi->inputmax = 1;
pi->hasminmax = true;
pi->outputmin = 0;
pi->outputmax = 1;
pi->exp = 0;
pi->units = ""; // no units defined
// initialize parameter 11 ("m_blur_36")
pi = self->__commonstate.params + 11;
pi->name = "blur";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_blur_36;
pi->defaultref = 0;
pi->hasinputminmax = false;
pi->inputmin = 0;
pi->inputmax = 1;
pi->hasminmax = true;
pi->outputmin = 0.01;
pi->outputmax = 0.25;
pi->exp = 0;
pi->units = ""; // no units defined
// initialize parameter 12 ("m_decay_37")
pi = self->__commonstate.params + 12;
pi->name = "decay";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_decay_37;
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 13 ("m_damping_38")
pi = self->__commonstate.params + 13;
pi->name = "damping";
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_damping_38;
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/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::

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


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


Loading…
Cancel
Save