Browse Source

Initial commit

pull/1/head
falkTX 4 years ago
commit
db21d6f7e3
100 changed files with 83912 additions and 0 deletions
  1. +171
    -0
      Makefile
  2. +233
    -0
      Makefile.mk
  3. +66
    -0
      _all.c
  4. +470
    -0
      _data.cpp
  5. +85
    -0
      distrho-3bandeq.cpp
  6. +10107
    -0
      distrho-3bandeq/DistrhoArtwork3BandEQ.cpp
  7. +40
    -0
      distrho-3bandeq/DistrhoArtwork3BandEQ.hpp
  8. +264
    -0
      distrho-3bandeq/DistrhoPlugin3BandEQ.cpp
  9. +123
    -0
      distrho-3bandeq/DistrhoPlugin3BandEQ.hpp
  10. +32
    -0
      distrho-3bandeq/DistrhoPluginInfo.h
  11. +211
    -0
      distrho-3bandeq/DistrhoUI3BandEQ.cpp
  12. +72
    -0
      distrho-3bandeq/DistrhoUI3BandEQ.hpp
  13. +85
    -0
      distrho-3bandsplitter.cpp
  14. +10107
    -0
      distrho-3bandsplitter/DistrhoArtwork3BandSplitter.cpp
  15. +40
    -0
      distrho-3bandsplitter/DistrhoArtwork3BandSplitter.hpp
  16. +272
    -0
      distrho-3bandsplitter/DistrhoPlugin3BandSplitter.cpp
  17. +123
    -0
      distrho-3bandsplitter/DistrhoPlugin3BandSplitter.hpp
  18. +32
    -0
      distrho-3bandsplitter/DistrhoPluginInfo.h
  19. +211
    -0
      distrho-3bandsplitter/DistrhoUI3BandSplitter.cpp
  20. +72
    -0
      distrho-3bandsplitter/DistrhoUI3BandSplitter.hpp
  21. +86
    -0
      distrho-kars.cpp
  22. +5264
    -0
      distrho-kars/DistrhoArtworkKars.cpp
  23. +20
    -0
      distrho-kars/DistrhoArtworkKars.hpp
  24. +31
    -0
      distrho-kars/DistrhoPluginInfo.h
  25. +214
    -0
      distrho-kars/DistrhoPluginKars.cpp
  26. +152
    -0
      distrho-kars/DistrhoPluginKars.hpp
  27. +77
    -0
      distrho-kars/DistrhoUIKars.cpp
  28. +60
    -0
      distrho-kars/DistrhoUIKars.hpp
  29. +87
    -0
      distrho-nekobi.cpp
  30. +6890
    -0
      distrho-nekobi/DistrhoArtworkNekobi.cpp
  31. +90
    -0
      distrho-nekobi/DistrhoArtworkNekobi.hpp
  32. +32
    -0
      distrho-nekobi/DistrhoPluginInfo.h
  33. +399
    -0
      distrho-nekobi/DistrhoPluginNekobi.cpp
  34. +131
    -0
      distrho-nekobi/DistrhoPluginNekobi.hpp
  35. +231
    -0
      distrho-nekobi/DistrhoUINekobi.cpp
  36. +86
    -0
      distrho-nekobi/DistrhoUINekobi.hpp
  37. +202
    -0
      distrho-nekobi/NekoWidget.hpp
  38. +1779
    -0
      distrho-nekobi/nekobee-src/minblep_tables.c
  39. +77
    -0
      distrho-nekobi/nekobee-src/nekobee.h
  40. +237
    -0
      distrho-nekobi/nekobee-src/nekobee_synth.c
  41. +132
    -0
      distrho-nekobi/nekobee-src/nekobee_synth.h
  42. +30
    -0
      distrho-nekobi/nekobee-src/nekobee_types.h
  43. +256
    -0
      distrho-nekobi/nekobee-src/nekobee_voice.c
  44. +183
    -0
      distrho-nekobi/nekobee-src/nekobee_voice.h
  45. +414
    -0
      distrho-nekobi/nekobee-src/nekobee_voice_render.c
  46. +85
    -0
      distrho-pingpongpan.cpp
  47. +5651
    -0
      distrho-pingpongpan/DistrhoArtworkPingPongPan.cpp
  48. +35
    -0
      distrho-pingpongpan/DistrhoArtworkPingPongPan.hpp
  49. +33
    -0
      distrho-pingpongpan/DistrhoPluginInfo.h
  50. +161
    -0
      distrho-pingpongpan/DistrhoPluginPingPongPan.cpp
  51. +114
    -0
      distrho-pingpongpan/DistrhoPluginPingPongPan.hpp
  52. +133
    -0
      distrho-pingpongpan/DistrhoUIPingPongPan.cpp
  53. +67
    -0
      distrho-pingpongpan/DistrhoUIPingPongPan.hpp
  54. +67
    -0
      distrho-prom.cpp
  55. +33
    -0
      distrho-prom/DistrhoPluginInfo.h
  56. +84
    -0
      distrho-prom/DistrhoPluginProM.cpp
  57. +106
    -0
      distrho-prom/DistrhoPluginProM.hpp
  58. +304
    -0
      distrho-prom/DistrhoUIProM.cpp
  59. +63
    -0
      distrho-prom/DistrhoUIProM.hpp
  60. +87
    -0
      distrho-vectorjuice.cpp
  61. +36
    -0
      distrho-vectorjuice/DistrhoPluginInfo.h
  62. +18123
    -0
      distrho-vectorjuice/VectorJuiceArtwork.cpp
  63. +55
    -0
      distrho-vectorjuice/VectorJuiceArtwork.hpp
  64. +391
    -0
      distrho-vectorjuice/VectorJuicePlugin.cpp
  65. +236
    -0
      distrho-vectorjuice/VectorJuicePlugin.hpp
  66. +461
    -0
      distrho-vectorjuice/VectorJuiceUI.cpp
  67. +99
    -0
      distrho-vectorjuice/VectorJuiceUI.hpp
  68. +87
    -0
      distrho-wobblejuice.cpp
  69. +36
    -0
      distrho-wobblejuice/DistrhoPluginInfo.h
  70. +10312
    -0
      distrho-wobblejuice/WobbleJuiceArtwork.cpp
  71. +35
    -0
      distrho-wobblejuice/WobbleJuiceArtwork.hpp
  72. +243
    -0
      distrho-wobblejuice/WobbleJuicePlugin.cpp
  73. +142
    -0
      distrho-wobblejuice/WobbleJuicePlugin.hpp
  74. +189
    -0
      distrho-wobblejuice/WobbleJuiceUI.cpp
  75. +75
    -0
      distrho-wobblejuice/WobbleJuiceUI.hpp
  76. +76
    -0
      distrho-wobblejuice/moogVCF.hxx
  77. +1502
    -0
      zynaddsubfx-fx.cpp
  78. +598
    -0
      zynaddsubfx-src.cpp
  79. +1092
    -0
      zynaddsubfx-synth.cpp
  80. +273
    -0
      zynaddsubfx-ui.cpp
  81. +121
    -0
      zynaddsubfx/Containers/MultiPseudoStack.cpp
  82. +66
    -0
      zynaddsubfx/Containers/MultiPseudoStack.h
  83. +436
    -0
      zynaddsubfx/Containers/NotePool.cpp
  84. +151
    -0
      zynaddsubfx/Containers/NotePool.h
  85. +43
    -0
      zynaddsubfx/Containers/ScratchString.cpp
  86. +22
    -0
      zynaddsubfx/Containers/ScratchString.h
  87. +429
    -0
      zynaddsubfx/DSP/AnalogFilter.cpp
  88. +84
    -0
      zynaddsubfx/DSP/AnalogFilter.h
  89. +97
    -0
      zynaddsubfx/DSP/FFTwrapper.cpp
  90. +66
    -0
      zynaddsubfx/DSP/FFTwrapper.h
  91. +71
    -0
      zynaddsubfx/DSP/Filter.cpp
  92. +60
    -0
      zynaddsubfx/DSP/Filter.h
  93. +221
    -0
      zynaddsubfx/DSP/FormantFilter.cpp
  94. +61
    -0
      zynaddsubfx/DSP/FormantFilter.h
  95. +235
    -0
      zynaddsubfx/DSP/SVFilter.cpp
  96. +74
    -0
      zynaddsubfx/DSP/SVFilter.h
  97. +202
    -0
      zynaddsubfx/DSP/Unison.cpp
  98. +76
    -0
      zynaddsubfx/DSP/Unison.h
  99. +272
    -0
      zynaddsubfx/Effects/Alienwah.cpp
  100. +65
    -0
      zynaddsubfx/Effects/Alienwah.h

+ 171
- 0
Makefile View File

@@ -0,0 +1,171 @@
#!/usr/bin/make -f
# Makefile for native-plugins #
# --------------------------- #
# Created by falkTX
#

# NOTE: this file assumes Makefile.mk has been included before

# ---------------------------------------------------------------------------------------------------------------------
# DPF plugins

OBJS_all += \
$(OBJDIR)/distrho-3bandeq.cpp.o \
$(OBJDIR)/distrho-3bandsplitter.cpp.o \
$(OBJDIR)/distrho-kars.cpp.o \
$(OBJDIR)/distrho-nekobi.cpp.o \
$(OBJDIR)/distrho-pingpongpan.cpp.o

ifeq ($(HAVE_DGL),true)
ifeq ($(HAVE_PROJECTM),true)
OBJS += $(OBJDIR)/distrho-prom.cpp.o
endif
endif

# ---------------------------------------------------------------------------------------------------------------------
# DPF plugins (Juice)

OBJS_all += \
$(OBJDIR)/distrho-vectorjuice.cpp.o \
$(OBJDIR)/distrho-wobblejuice.cpp.o

# ---------------------------------------------------------------------------------------------------------------------
# ZynAddSubFX

ifeq ($(HAVE_ZYN_DEPS),true)
OBJS_all += \
$(OBJDIR)/zynaddsubfx-fx.cpp.o \
$(OBJDIR)/zynaddsubfx-src.cpp.o

ifneq ($(SKIP_ZYN_SYNTH),true)
OBJS_all += \
$(OBJDIR)/zynaddsubfx-synth.cpp.o
endif

ifeq ($(HAVE_ZYN_UI_DEPS),true)
TARGETS += resources/zynaddsubfx-ui$(APP_EXT)

ZYN_UI_FILES_CPP = \
external/zynaddsubfx/UI/ADnoteUI.cpp \
external/zynaddsubfx/UI/BankUI.cpp \
external/zynaddsubfx/UI/ConfigUI.cpp \
external/zynaddsubfx/UI/EffUI.cpp \
external/zynaddsubfx/UI/EnvelopeUI.cpp \
external/zynaddsubfx/UI/FilterUI.cpp \
external/zynaddsubfx/UI/LFOUI.cpp \
external/zynaddsubfx/UI/MasterUI.cpp \
external/zynaddsubfx/UI/MicrotonalUI.cpp \
external/zynaddsubfx/UI/OscilGenUI.cpp \
external/zynaddsubfx/UI/PADnoteUI.cpp \
external/zynaddsubfx/UI/PartUI.cpp \
external/zynaddsubfx/UI/PresetsUI.cpp \
external/zynaddsubfx/UI/ResonanceUI.cpp \
external/zynaddsubfx/UI/SUBnoteUI.cpp \
external/zynaddsubfx/UI/VirKeyboard.cpp

ZYN_UI_FILES_H = \
external/zynaddsubfx/UI/ADnoteUI.h \
external/zynaddsubfx/UI/BankUI.h \
external/zynaddsubfx/UI/ConfigUI.h \
external/zynaddsubfx/UI/EffUI.h \
external/zynaddsubfx/UI/EnvelopeUI.h \
external/zynaddsubfx/UI/FilterUI.h \
external/zynaddsubfx/UI/LFOUI.h \
external/zynaddsubfx/UI/MasterUI.h \
external/zynaddsubfx/UI/MicrotonalUI.h \
external/zynaddsubfx/UI/OscilGenUI.h \
external/zynaddsubfx/UI/PADnoteUI.h \
external/zynaddsubfx/UI/PartUI.h \
external/zynaddsubfx/UI/PresetsUI.h \
external/zynaddsubfx/UI/ResonanceUI.h \
external/zynaddsubfx/UI/SUBnoteUI.h \
external/zynaddsubfx/UI/VirKeyboard.h
endif
endif

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

external/zynaddsubfx/UI/%.cpp: external/zynaddsubfx/UI/%.fl
@echo "Generating $@|h"
@$(FLUID) -c -o external/zynaddsubfx/UI/$*.cpp -h external/zynaddsubfx/UI/$*.h $<

external/zynaddsubfx/UI/%.h: external/zynaddsubfx/UI/%.fl
@echo "Generating $@|cpp"
@$(FLUID) -c -o external/zynaddsubfx/UI/$*.cpp -h external/zynaddsubfx/UI/$*.h $<

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

$(OBJDIR)/distrho-3bandeq.cpp.o: external/distrho-3bandeq.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling $<"
@$(CXX) $< $(BUILD_CXX_FLAGS) $(DPF_FLAGS) -DDISTRHO_NAMESPACE=d3BandEQ -Iexternal/distrho-3bandeq -c -o $@

$(OBJDIR)/distrho-3bandsplitter.cpp.o: external/distrho-3bandsplitter.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling $<"
@$(CXX) $< $(BUILD_CXX_FLAGS) $(DPF_FLAGS) -DDISTRHO_NAMESPACE=d3BandSplitter -Iexternal/distrho-3bandsplitter -c -o $@

$(OBJDIR)/distrho-kars.cpp.o: external/distrho-kars.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling $<"
@$(CXX) $< $(BUILD_CXX_FLAGS) $(DPF_FLAGS) -DDISTRHO_NAMESPACE=dKars -Iexternal/distrho-kars -c -o $@

$(OBJDIR)/distrho-nekobi.cpp.o: external/distrho-nekobi.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling $<"
@$(CXX) $< $(BUILD_CXX_FLAGS) $(DPF_FLAGS) -DDISTRHO_NAMESPACE=dNekobi -Iexternal/distrho-nekobi -w -c -o $@

$(OBJDIR)/distrho-pingpongpan.cpp.o: external/distrho-pingpongpan.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling $<"
@$(CXX) $< $(BUILD_CXX_FLAGS) $(DPF_FLAGS) -DDISTRHO_NAMESPACE=dPingPongPan -Iexternal/distrho-pingpongpan -c -o $@

$(OBJDIR)/distrho-prom.cpp.o: external/distrho-prom.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling $<"
@$(CXX) $< $(BUILD_CXX_FLAGS) $(DPF_FLAGS) $(PROJECTM_FLAGS) -DDISTRHO_NAMESPACE=dProM -Iexternal/distrho-prom -c -o $@

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

$(OBJDIR)/distrho-vectorjuice.cpp.o: external/distrho-vectorjuice.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling $<"
@$(CXX) $< $(BUILD_CXX_FLAGS) $(DPF_FLAGS) -DDISTRHO_NAMESPACE=dVectorJuice -Iexternal/distrho-vectorjuice -c -o $@

$(OBJDIR)/distrho-wobblejuice.cpp.o: external/distrho-wobblejuice.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling $<"
@$(CXX) $< $(BUILD_CXX_FLAGS) $(DPF_FLAGS) -DDISTRHO_NAMESPACE=dWobbleJuice -Iexternal/distrho-wobblejuice -c -o $@

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

$(OBJDIR)/zynaddsubfx-fx.cpp.o: external/zynaddsubfx-fx.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling $<"
@$(CXX) $< $(BUILD_CXX_FLAGS) $(ZYN_DSP_FLAGS) -c -o $@

$(OBJDIR)/zynaddsubfx-synth.cpp.o: external/zynaddsubfx-synth.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling $<"
@$(CXX) $< $(BUILD_CXX_FLAGS) $(ZYN_DSP_FLAGS) -Wno-unused-parameter -c -o $@

$(OBJDIR)/zynaddsubfx-src.cpp.o: external/zynaddsubfx-src.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling $<"
@$(CXX) $< $(BUILD_CXX_FLAGS) $(ZYN_DSP_FLAGS) -Wno-unused-parameter -Wno-unused-variable -c -o $@

$(OBJDIR)/zynaddsubfx-ui.cpp.o: external/zynaddsubfx-ui.cpp $(ZYN_UI_FILES_H) $(ZYN_UI_FILES_CPP)
-@mkdir -p $(OBJDIR)
@echo "Compiling $<"
@$(CXX) $< $(BUILD_CXX_FLAGS) $(ZYN_UI_FLAGS) -Wno-unused-parameter -Wno-unused-variable -c -o $@

resources/zynaddsubfx-ui$(APP_EXT): $(OBJDIR)/zynaddsubfx-ui.cpp.o
-@mkdir -p ../resources
@echo "Linking zynaddsubfx-ui"
@$(CXX) $^ $(LINK_FLAGS) $(ZYN_UI_LIBS) -o $@

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

-include $(OBJDIR)/zynaddsubfx-ui.cpp.d

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

+ 233
- 0
Makefile.mk View File

@@ -0,0 +1,233 @@
#!/usr/bin/make -f
# Makefile for native-plugins #
# --------------------------- #
# Created by falkTX
#

ifeq ($(TESTBUILD),true)
ifeq ($(LINUX),true)
CXXFLAGS += -isystem /opt/kxstudio/include/ntk
endif
endif

ifeq ($(MACOS_OR_WIN32),true)
HAVE_DGL = true
SKIP_ZYN_SYNTH = true
else
HAVE_DGL = $(shell pkg-config --exists gl x11 && echo true)
endif

HAVE_NTK = $(shell pkg-config --exists ntk ntk_images && echo true)
HAVE_PROJECTM = $(shell pkg-config --exists libprojectM && echo true)
ifneq ($(MACOS_OLD),true)
HAVE_ZYN_DEPS = $(shell pkg-config --exists liblo fftw3 mxml zlib && echo true)
endif

# ---------------------------------------------------------------------------------------------------------------------
# Check for optional libs (special non-pkgconfig unix tests)

ifeq ($(UNIX),true)

# fltk doesn't have a pkg-config file but has fltk-config instead.
# Also, don't try looking for it if we already have NTK.
ifneq ($(HAVE_NTK),true)
ifeq ($(shell which fltk-config 1>/dev/null 2>/dev/null && echo true),true)
ifeq ($(shell which fluid 1>/dev/null 2>/dev/null && echo true),true)
HAVE_FLTK = true
endif
endif
endif

endif

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

ifeq ($(HAVE_FLTK),true)
HAVE_ZYN_UI_DEPS = true
endif
ifeq ($(HAVE_NTK),true)
HAVE_ZYN_UI_DEPS = true
endif

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

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

ifeq ($(HAVE_PROJECTM),true)
BASE_FLAGS += -DHAVE_PROJECTM
endif

ifeq ($(HAVE_ZYN_DEPS),true)
BASE_FLAGS += -DHAVE_ZYN_DEPS
ifeq ($(HAVE_ZYN_UI_DEPS),true)
BASE_FLAGS += -DHAVE_ZYN_UI_DEPS
endif
endif

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

ifeq ($(HAVE_DGL),true)

ifeq ($(MACOS_OR_WIN32),true)
ifeq ($(MACOS),true)
DGL_LIBS = -framework OpenGL -framework Cocoa
endif
ifeq ($(WIN32),true)
DGL_LIBS = -lopengl32 -lgdi32
endif
else

DGL_FLAGS = $(shell pkg-config --cflags gl x11)
DGL_LIBS = $(shell pkg-config --libs gl x11)
endif

DGL_FLAGS += -DDGL_NAMESPACE=CarlaDGL -DDGL_FILE_BROWSER_DISABLED -DDGL_NO_SHARED_RESOURCES
endif

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

ifeq ($(HAVE_PROJECTM),true)
PROJECTM_FLAGS = $(shell pkg-config --cflags libprojectM)
PROJECTM_LIBS = $(shell pkg-config --libs libprojectM)
endif

# ---------------------------------------------------------------------------------------------------------------------
# Flags for DPF Plugins

DPF_FLAGS = -I$(CWDE)/modules/distrho

ifeq ($(HAVE_DGL),true)
ifneq ($(MACOS_OR_WIN32),true)
DPF_FLAGS += $(shell pkg-config --cflags gl)
endif
DPF_FLAGS += -I$(CWDE)/modules/dgl -DDGL_NAMESPACE=CarlaDGL -DDGL_FILE_BROWSER_DISABLED -DDGL_NO_SHARED_RESOURCES
endif

# ---------------------------------------------------------------------------------------------------------------------
# Flags for ZynAddSubFX (DSP and UI separated)

ifeq ($(HAVE_ZYN_DEPS),true)

# Common flags
ZYN_BASE_FLAGS = $(shell pkg-config --cflags liblo mxml)
ZYN_BASE_FLAGS += -Iexternal/zynaddsubfx -Iexternal/zynaddsubfx/rtosc
ifneq ($(WIN32),true)
ZYN_BASE_FLAGS += -DHAVE_ASYNC
endif

ZYN_BASE_LIBS = $(shell pkg-config --libs liblo mxml) -lpthread
ZYN_BASE_LIBS += $(LIBDL_LIBS)

# DSP flags
ZYN_DSP_FLAGS = $(ZYN_BASE_FLAGS)
ZYN_DSP_FLAGS += $(shell pkg-config --cflags fftw3 zlib)
ZYN_DSP_LIBS = $(ZYN_BASE_LIBS)
ZYN_DSP_LIBS += $(shell pkg-config --libs fftw3 zlib)

ifeq ($(SKIP_ZYN_SYNTH),true)
BASE_FLAGS += -DSKIP_ZYN_SYNTH
else
# UI flags
ifeq ($(HAVE_ZYN_UI_DEPS),true)

# Common UI flags
ZYN_UI_FLAGS = $(ZYN_BASE_FLAGS)
ZYN_UI_LIBS = $(ZYN_BASE_LIBS)

# NTK or FLTK UI flags
ifeq ($(HAVE_NTK),true)
FLUID = ntk-fluid
ZYN_UI_FLAGS += $(shell pkg-config --cflags ntk_images ntk) -DNTK_GUI
ZYN_UI_LIBS += $(shell pkg-config --libs ntk_images ntk)
else # HAVE_NTK
FLUID = fluid
ZYN_UI_FLAGS += $(shell fltk-config --use-images --cxxflags) -DFLTK_GUI
ZYN_UI_LIBS += $(shell fltk-config --use-images --ldflags)
endif # HAVE_NTK

# UI extra flags
ifeq ($(HAVE_X11),true)
ZYN_UI_FLAGS += $(shell pkg-config --cflags x11)
ZYN_UI_LIBS += $(shell pkg-config --libs x11)
endif
ifeq ($(LINUX),true)
ZYN_UI_LIBS += -lrt
endif

else # HAVE_ZYN_UI_DEPS

ZYN_DSP_FLAGS += -DNO_UI

endif # SKIP_ZYN_SYNTH
endif # HAVE_ZYN_UI_DEPS
endif # HAVE_ZYN_DEPS

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

NATIVE_PLUGINS_LIBS += $(DGL_LIBS)
NATIVE_PLUGINS_LIBS += $(PROJECTM_LIBS)
NATIVE_PLUGINS_LIBS += $(ZYN_DSP_LIBS)
NATIVE_PLUGINS_LIBS += $(ZITA_DSP_LIBS)

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

ifeq ($(HAVE_DGL),true)
ALL_LIBS += $(MODULEDIR)/dgl.a
endif

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

all:

install_external_plugins:
ifeq ($(HAVE_ZYN_DEPS),true)
ifeq ($(HAVE_ZYN_UI_DEPS),true)
# Create directories (zynaddsubfx)
install -d $(DESTDIR)$(DATADIR)/carla/resources/zynaddsubfx

# Install resources (zynaddsubfx)
install -m 644 \
bin/resources/zynaddsubfx/*.png \
$(DESTDIR)$(DATADIR)/carla/resources/zynaddsubfx

install -m 755 \
bin/resources/zynaddsubfx-ui \
$(DESTDIR)$(DATADIR)/carla/resources
endif
endif

features_print_external_plugins:
@printf -- "\n"
@printf -- "$(tS)---> External plugins: $(tE)\n"
ifeq ($(HAVE_DGL),true)
@printf -- "DPF Plugins: $(ANS_YES) (with UI)\n"
ifeq ($(HAVE_PROJECTM),true)
@printf -- "DPF ProM: $(ANS_YES)\n"
else
@printf -- "DPF ProM: $(ANS_NO) $(mS)missing libprojectM$(mE)\n"
endif
else
@printf -- "DPF Plugins: $(ANS_YES) (without UI)\n"
ifeq ($(HAVE_PROJECTM),true)
@printf -- "DPF ProM: $(ANS_NO) $(mS)missing OpenGL$(mE)\n"
else
@printf -- "DPF ProM: $(ANS_NO) $(mS)missing OpenGL and libprojectM$(mE)\n"
endif
endif
ifeq ($(HAVE_ZYN_DEPS),true)
ifeq ($(HAVE_ZYN_UI_DEPS),true)
ifeq ($(HAVE_NTK),true)
@printf -- "ZynAddSubFX: $(ANS_YES) (with NTK UI)\n"
else
@printf -- "ZynAddSubFX: $(ANS_YES) (with FLTK UI)\n"
endif
else
@printf -- "ZynAddSubFX: $(ANS_YES) (without UI) $(mS)FLTK or NTK missing$(mE)\n"
endif
else
@printf -- "ZynAddSubFX: $(ANS_NO) $(mS)liblo, fftw3, mxml or zlib missing$(mE)\n"
endif

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

+ 66
- 0
_all.c View File

@@ -0,0 +1,66 @@
/*
* Carla Native Plugins
* Copyright (C) 2012-2018 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* For a full copy of the GNU General Public License see the doc/GPL.txt file.
*/

#include "CarlaDefines.h"
#include "CarlaNative.h"

// --------------------------------------------------------------------------------------------------------------------

// DISTRHO plugins
extern void carla_register_native_plugin_distrho_3bandeq(void);
extern void carla_register_native_plugin_distrho_3bandsplitter(void);
extern void carla_register_native_plugin_distrho_kars(void);
extern void carla_register_native_plugin_distrho_nekobi(void);
extern void carla_register_native_plugin_distrho_pingpongpan(void);
extern void carla_register_native_plugin_distrho_prom(void);

// DISTRHO plugins (Juice)
extern void carla_register_native_plugin_distrho_vectorjuice(void);
extern void carla_register_native_plugin_distrho_wobblejuice(void);

// ZynAddSubFX
extern void carla_register_native_plugin_zynaddsubfx_fx(void);
extern void carla_register_native_plugin_zynaddsubfx_synth(void);

// --------------------------------------------------------------------------------------------------------------------

void carla_register_all_native_external_plugins(void)
{
// DISTRHO Plugins
carla_register_native_plugin_distrho_3bandeq();
carla_register_native_plugin_distrho_3bandsplitter();
carla_register_native_plugin_distrho_kars();
carla_register_native_plugin_distrho_nekobi();
carla_register_native_plugin_distrho_pingpongpan();
#if defined(HAVE_DGL) && defined(HAVE_PROJECTM)
carla_register_native_plugin_distrho_prom();
#endif

// DISTRHO plugins (Juice)
carla_register_native_plugin_distrho_vectorjuice();
carla_register_native_plugin_distrho_wobblejuice();

#ifdef HAVE_ZYN_DEPS
// ZynAddSubFX
carla_register_native_plugin_zynaddsubfx_fx();
# ifndef SKIP_ZYN_SYNTH
carla_register_native_plugin_zynaddsubfx_synth();
# endif
#endif
}

// --------------------------------------------------------------------------------------------------------------------

+ 470
- 0
_data.cpp View File

@@ -0,0 +1,470 @@
/*
* Carla Native Plugins
* Copyright (C) 2012-2018 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* For a full copy of the GNU General Public License see the doc/GPL.txt file.
*/

#include "CarlaNative.h"
#include "CarlaMIDI.h"
#include "CarlaUtils.hpp"

#ifndef CARLA_EXTERNAL_PLUGINS_INCLUDED_DIRECTLY
# define DESCFUNCS \
nullptr, nullptr, nullptr, nullptr, nullptr, \
nullptr, nullptr, nullptr, nullptr, nullptr, \
nullptr, nullptr, nullptr, nullptr, nullptr, \
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr

static const NativePluginDescriptor sNativePluginDescriptors[] = {
#endif

// --------------------------------------------------------------------------------------------------------------------
// DISTRHO Plugins

{
/* category */ NATIVE_PLUGIN_CATEGORY_EQ,
#ifdef HAVE_DGL
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE
|NATIVE_PLUGIN_HAS_UI
|NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD
|NATIVE_PLUGIN_USES_PARENT_ID),
#else
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE),
#endif
/* supports */ NATIVE_PLUGIN_SUPPORTS_NOTHING,
/* audioIns */ 2,
/* audioOuts */ 2,
/* midiIns */ 0,
/* midiOuts */ 0,
/* paramIns */ 6,
/* paramOuts */ 0,
/* name */ "3 Band EQ",
/* label */ "3bandeq",
/* maker */ "falkTX, Michael Gruhn",
/* copyright */ "LGPL",
DESCFUNCS
},
{
/* category */ NATIVE_PLUGIN_CATEGORY_EQ,
#ifdef HAVE_DGL
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE
|NATIVE_PLUGIN_HAS_UI
|NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD
|NATIVE_PLUGIN_USES_PARENT_ID),
#else
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE),
#endif
/* supports */ NATIVE_PLUGIN_SUPPORTS_NOTHING,
/* audioIns */ 2,
/* audioOuts */ 6,
/* midiIns */ 0,
/* midiOuts */ 0,
/* paramIns */ 6,
/* paramOuts */ 0,
/* name */ "3 Band Splitter",
/* label */ "3bandsplitter",
/* maker */ "falkTX, Michael Gruhn",
/* copyright */ "LGPL",
DESCFUNCS
},
{
/* category */ NATIVE_PLUGIN_CATEGORY_SYNTH,
#ifdef HAVE_DGL
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE
|NATIVE_PLUGIN_IS_SYNTH
|NATIVE_PLUGIN_HAS_UI
|NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD
|NATIVE_PLUGIN_USES_PARENT_ID),
#else
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE
|NATIVE_PLUGIN_IS_SYNTH),
#endif
/* supports */ NATIVE_PLUGIN_SUPPORTS_NOTHING,
/* audioIns */ 0,
/* audioOuts */ 1,
/* midiIns */ 1,
/* midiOuts */ 0,
/* paramIns */ 1,
/* paramOuts */ 0,
/* name */ "Kars",
/* label */ "kars",
/* maker */ "falkTX, Chris Cannam",
/* copyright */ "ISC",
DESCFUNCS
},
{
/* category */ NATIVE_PLUGIN_CATEGORY_SYNTH,
#ifdef HAVE_DGL
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE
|NATIVE_PLUGIN_IS_SYNTH
|NATIVE_PLUGIN_HAS_UI
|NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD
|NATIVE_PLUGIN_USES_PARENT_ID),
#else
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE
|NATIVE_PLUGIN_IS_SYNTH),
#endif
/* supports */ static_cast<NativePluginSupports>(NATIVE_PLUGIN_SUPPORTS_CONTROL_CHANGES
|NATIVE_PLUGIN_SUPPORTS_ALL_SOUND_OFF),
/* audioIns */ 0,
/* audioOuts */ 1,
/* midiIns */ 1,
/* midiOuts */ 0,
/* paramIns */ 8,
/* paramOuts */ 0,
/* name */ "Nekobi",
/* label */ "nekobi",
/* maker */ "falkTX, Sean Bolton and others",
/* copyright */ "GPL v2+",
DESCFUNCS
},
{
/* category */ NATIVE_PLUGIN_CATEGORY_UTILITY,
#ifdef HAVE_DGL
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE
|NATIVE_PLUGIN_HAS_UI
|NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD
|NATIVE_PLUGIN_USES_PARENT_ID),
#else
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE),
#endif
/* supports */ NATIVE_PLUGIN_SUPPORTS_NOTHING,
/* audioIns */ 2,
/* audioOuts */ 2,
/* midiIns */ 0,
/* midiOuts */ 0,
/* paramIns */ 2,
/* paramOuts */ 0,
/* name */ "Ping Pong Pan",
/* label */ "pingpongpan",
/* maker */ "falkTX, Michael Gruhn",
/* copyright */ "LGPL",
DESCFUNCS
},
#ifdef HAVE_DGL
#ifdef HAVE_PROJECTM
{
/* category */ NATIVE_PLUGIN_CATEGORY_UTILITY,
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE
|NATIVE_PLUGIN_HAS_UI
|NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD
|NATIVE_PLUGIN_USES_PARENT_ID),
/* supports */ NATIVE_PLUGIN_SUPPORTS_NOTHING,
/* audioIns */ 1,
/* audioOuts */ 1,
/* midiIns */ 0,
/* midiOuts */ 0,
/* paramIns */ 0,
/* paramOuts */ 0,
/* name */ "ProM",
/* label */ "prom",
/* maker */ "falkTX",
/* copyright */ "LGPL",
DESCFUNCS
},
#endif // HAVE_PROJECTM
#endif // HAVE_DGL

// --------------------------------------------------------------------------------------------------------------------
// DISTRHO plugins (Juice)

{
/* category */ NATIVE_PLUGIN_CATEGORY_DYNAMICS,
#ifdef HAVE_DGL
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE
|NATIVE_PLUGIN_HAS_UI
|NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD
|NATIVE_PLUGIN_USES_PARENT_ID
|NATIVE_PLUGIN_USES_TIME),
#else
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE
|NATIVE_PLUGIN_USES_TIME),
#endif
/* supports */ NATIVE_PLUGIN_SUPPORTS_NOTHING,
/* audioIns */ 2,
/* audioOuts */ 2,
/* midiIns */ 0,
/* midiOuts */ 0,
/* paramIns */ 6,
/* paramOuts */ 0,
/* name */ "WobbleJuice",
/* label */ "wobblejuice",
/* maker */ "Andre Sklenar",
/* copyright */ "GPL v2+",
DESCFUNCS
},
{
/* category */ NATIVE_PLUGIN_CATEGORY_UTILITY,
#ifdef HAVE_DGL
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE
|NATIVE_PLUGIN_HAS_UI
|NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD
|NATIVE_PLUGIN_USES_PARENT_ID
|NATIVE_PLUGIN_USES_TIME),
#else
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE
|NATIVE_PLUGIN_USES_TIME),
#endif
/* supports */ NATIVE_PLUGIN_SUPPORTS_NOTHING,
/* audioIns */ 8,
/* audioOuts */ 2,
/* midiIns */ 0,
/* midiOuts */ 0,
/* paramIns */ 13,
/* paramOuts */ 4,
/* name */ "VectorJuice",
/* label */ "vectorjuice",
/* maker */ "Andre Sklenar",
/* copyright */ "GPL v2+",
DESCFUNCS
},

// --------------------------------------------------------------------------------------------------------------------
// ZynAddSubFX

#ifdef HAVE_ZYN_DEPS
{
/* category */ NATIVE_PLUGIN_CATEGORY_MODULATOR,
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE
|NATIVE_PLUGIN_USES_PANNING
|NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS),
/* supports */ NATIVE_PLUGIN_SUPPORTS_NOTHING,
/* audioIns */ 2,
/* audioOuts */ 2,
/* midiIns */ 0,
/* midiOuts */ 0,
/* paramIns */ 11-2,
/* paramOuts */ 0,
/* name */ "ZynAlienWah",
/* label */ "zynalienwah",
/* maker */ "falkTX, Mark McCurry, Nasca Octavian Paul",
/* copyright */ "GNU GPL v2+",
DESCFUNCS
},
{
/* category */ NATIVE_PLUGIN_CATEGORY_MODULATOR,
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE
|NATIVE_PLUGIN_USES_PANNING
|NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS),
/* supports */ NATIVE_PLUGIN_SUPPORTS_NOTHING,
/* audioIns */ 2,
/* audioOuts */ 2,
/* midiIns */ 0,
/* midiOuts */ 0,
/* paramIns */ 12-2,
/* paramOuts */ 0,
/* name */ "ZynChorus",
/* label */ "zynchorus",
/* maker */ "falkTX, Mark McCurry, Nasca Octavian Paul",
/* copyright */ "GNU GPL v2+",
DESCFUNCS
},
{
/* category */ NATIVE_PLUGIN_CATEGORY_MODULATOR,
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_USES_PANNING
|NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS),
/* supports */ NATIVE_PLUGIN_SUPPORTS_NOTHING,
/* audioIns */ 2,
/* audioOuts */ 2,
/* midiIns */ 0,
/* midiOuts */ 0,
/* paramIns */ 11-2,
/* paramOuts */ 0,
/* name */ "ZynDistortion",
/* label */ "zyndistortion",
/* maker */ "falkTX, Mark McCurry, Nasca Octavian Paul",
/* copyright */ "GNU GPL v2+",
DESCFUNCS
},
{
/* category */ NATIVE_PLUGIN_CATEGORY_FILTER,
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_USES_PANNING
|NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS),
/* supports */ NATIVE_PLUGIN_SUPPORTS_NOTHING,
/* audioIns */ 2,
/* audioOuts */ 2,
/* midiIns */ 0,
/* midiOuts */ 0,
/* paramIns */ 10-2,
/* paramOuts */ 0,
/* name */ "ZynDynamicFilter",
/* label */ "zyndynamicfilter",
/* maker */ "falkTX, Mark McCurry, Nasca Octavian Paul",
/* copyright */ "GNU GPL v2+",
DESCFUNCS
},
{
/* category */ NATIVE_PLUGIN_CATEGORY_DELAY,
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE
|NATIVE_PLUGIN_USES_PANNING
|NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS),
/* supports */ NATIVE_PLUGIN_SUPPORTS_NOTHING,
/* audioIns */ 2,
/* audioOuts */ 2,
/* midiIns */ 0,
/* midiOuts */ 0,
/* paramIns */ 7-2,
/* paramOuts */ 0,
/* name */ "ZynEcho",
/* label */ "zynecho",
/* maker */ "falkTX, Mark McCurry, Nasca Octavian Paul",
/* copyright */ "GNU GPL v2+",
DESCFUNCS
},
{
/* category */ NATIVE_PLUGIN_CATEGORY_MODULATOR,
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_USES_PANNING
|NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS),
/* supports */ NATIVE_PLUGIN_SUPPORTS_NOTHING,
/* audioIns */ 2,
/* audioOuts */ 2,
/* midiIns */ 0,
/* midiOuts */ 0,
/* paramIns */ 15-2,
/* paramOuts */ 0,
/* name */ "ZynPhaser",
/* label */ "zynphaser",
/* maker */ "falkTX, Mark McCurry, Nasca Octavian Paul",
/* copyright */ "GNU GPL v2+",
DESCFUNCS
},
{
/* category */ NATIVE_PLUGIN_CATEGORY_DELAY,
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_USES_PANNING
|NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS),
/* supports */ NATIVE_PLUGIN_SUPPORTS_NOTHING,
/* audioIns */ 2,
/* audioOuts */ 2,
/* midiIns */ 0,
/* midiOuts */ 0,
/* paramIns */ 13-2,
/* paramOuts */ 0,
/* name */ "ZynReverb",
/* label */ "zynreverb",
/* maker */ "falkTX, Mark McCurry, Nasca Octavian Paul",
/* copyright */ "GNU GPL v2+",
DESCFUNCS
},
# ifndef SKIP_ZYN_SYNTH
{
/* category */ NATIVE_PLUGIN_CATEGORY_SYNTH,
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_SYNTH
# ifdef HAVE_ZYN_UI_DEPS
|NATIVE_PLUGIN_HAS_UI
# endif
|NATIVE_PLUGIN_USES_MULTI_PROGS
|NATIVE_PLUGIN_USES_STATE),
/* supports */ static_cast<NativePluginSupports>(NATIVE_PLUGIN_SUPPORTS_CONTROL_CHANGES
|NATIVE_PLUGIN_SUPPORTS_NOTE_AFTERTOUCH
|NATIVE_PLUGIN_SUPPORTS_PITCHBEND
|NATIVE_PLUGIN_SUPPORTS_ALL_SOUND_OFF),
/* audioIns */ 0,
/* audioOuts */ 2,
/* midiIns */ 1,
/* midiOuts */ 0,
/* paramIns */ 6,
/* paramOuts */ 0,
/* name */ "ZynAddSubFX",
/* label */ "zynaddsubfx",
/* maker */ "falkTX, Mark McCurry, Nasca Octavian Paul",
/* copyright */ "GNU GPL v2+",
DESCFUNCS
},
# endif // ! SKIP_ZYN_SYNTH
#endif // HAVE_ZYN_DEPS

// --------------------------------------------------------------------------------------------------------------------
// Experimental plugins

#ifdef HAVE_EXPERIMENTAL_PLUGINS
{
/* category */ NATIVE_PLUGIN_CATEGORY_MODULATOR,
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE
|NATIVE_PLUGIN_HAS_UI
|NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS
|NATIVE_PLUGIN_USES_STATE),
/* supports */ NATIVE_PLUGIN_SUPPORTS_NOTHING,
/* audioIns */ 1,
/* audioOuts */ 1,
/* midiIns */ 1,
/* midiOuts */ 0,
/* paramIns */ 6,
/* paramOuts */ 0,
/* name */ "AT1",
/* label */ "at1",
/* maker */ "falkTX, Fons Adriaensen",
/* copyright */ "GPL v2+",
DESCFUNCS
},
{
/* category */ NATIVE_PLUGIN_CATEGORY_FILTER,
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE
|NATIVE_PLUGIN_HAS_UI
|NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS),
/* supports */ NATIVE_PLUGIN_SUPPORTS_NOTHING,
/* audioIns */ 2,
/* audioOuts */ 2,
/* midiIns */ 0,
/* midiOuts */ 0,
/* paramIns */ 6,
/* paramOuts */ 0,
/* name */ "BLS1",
/* label */ "bls1",
/* maker */ "falkTX, Fons Adriaensen",
/* copyright */ "GPL v2+",
DESCFUNCS
},
{
/* category */ NATIVE_PLUGIN_CATEGORY_DELAY,
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE
|NATIVE_PLUGIN_HAS_UI
|NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS),
/* supports */ NATIVE_PLUGIN_SUPPORTS_NOTHING,
/* audioIns */ 2,
/* audioOuts */ 4,
/* midiIns */ 0,
/* midiOuts */ 0,
/* paramIns */ 10,
/* paramOuts */ 0,
/* name */ "REV1 (Ambisonic)",
/* label */ "rev1-ambisonic",
/* maker */ "falkTX, Fons Adriaensen",
/* copyright */ "GPL v2+",
DESCFUNCS
},
{
/* category */ NATIVE_PLUGIN_CATEGORY_DELAY,
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE
|NATIVE_PLUGIN_HAS_UI
|NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS),
/* supports */ NATIVE_PLUGIN_SUPPORTS_NOTHING,
/* audioIns */ 2,
/* audioOuts */ 2,
/* midiIns */ 0,
/* midiOuts */ 0,
/* paramIns */ 10,
/* paramOuts */ 0,
/* name */ "REV1 (Stereo)",
/* label */ "rev1-stereo",
/* maker */ "falkTX, Fons Adriaensen",
/* copyright */ "GPL v2+",
DESCFUNCS
},
#endif // HAVE_EXPERIMENTAL_PLUGINS

// --------------------------------------------------------------------------------------------------------------------

#ifndef CARLA_EXTERNAL_PLUGINS_INCLUDED_DIRECTLY
}
#endif

+ 85
- 0
distrho-3bandeq.cpp View File

@@ -0,0 +1,85 @@
/*
* Carla Native Plugins
* Copyright (C) 2012-2017 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* For a full copy of the GNU General Public License see the doc/GPL.txt file.
*/

// config fix
#include "distrho-3bandeq/DistrhoPluginInfo.h"

#if DISTRHO_PLUGIN_HAS_UI && ! defined(HAVE_DGL)
# undef DISTRHO_PLUGIN_HAS_UI
# define DISTRHO_PLUGIN_HAS_UI 0
#endif

#include "CarlaMathUtils.hpp"
#include "CarlaJuceUtils.hpp"

// Plugin Code
#include "distrho-3bandeq/DistrhoArtwork3BandEQ.cpp"
#include "distrho-3bandeq/DistrhoPlugin3BandEQ.cpp"
#ifdef HAVE_DGL
#include "distrho-3bandeq/DistrhoUI3BandEQ.cpp"
#endif

// DISTRHO Code
#define DISTRHO_PLUGIN_TARGET_CARLA
#include "DistrhoPluginMain.cpp"
#ifdef HAVE_DGL
#include "DistrhoUIMain.cpp"
#endif

START_NAMESPACE_DISTRHO

// -----------------------------------------------------------------------

static const NativePluginDescriptor _3bandeqDesc = {
/* category */ NATIVE_PLUGIN_CATEGORY_EQ,
#ifdef HAVE_DGL
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE
|NATIVE_PLUGIN_HAS_UI
|NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD
|NATIVE_PLUGIN_USES_PARENT_ID),
#else
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE),
#endif
/* supports */ NATIVE_PLUGIN_SUPPORTS_NOTHING,
/* audioIns */ DISTRHO_PLUGIN_NUM_INPUTS,
/* audioOuts */ DISTRHO_PLUGIN_NUM_OUTPUTS,
/* midiIns */ 0,
/* midiOuts */ 0,
/* paramIns */ DistrhoPlugin3BandEQ::paramCount,
/* paramOuts */ 0,
/* name */ DISTRHO_PLUGIN_NAME,
/* label */ "3bandeq",
/* maker */ "falkTX, Michael Gruhn",
/* copyright */ "LGPL",
PluginDescriptorFILL(PluginCarla)
};

END_NAMESPACE_DISTRHO

// -----------------------------------------------------------------------

CARLA_EXPORT
void carla_register_native_plugin_distrho_3bandeq();

CARLA_EXPORT
void carla_register_native_plugin_distrho_3bandeq()
{
USE_NAMESPACE_DISTRHO
carla_register_native_plugin(&_3bandeqDesc);
}

// -----------------------------------------------------------------------

+ 10107
- 0
distrho-3bandeq/DistrhoArtwork3BandEQ.cpp
File diff suppressed because it is too large
View File


+ 40
- 0
distrho-3bandeq/DistrhoArtwork3BandEQ.hpp View File

@@ -0,0 +1,40 @@
/* (Auto-generated binary data file). */

#ifndef BINARY_DISTRHOARTWORK3BANDEQ_HPP
#define BINARY_DISTRHOARTWORK3BANDEQ_HPP

namespace DistrhoArtwork3BandEQ
{
extern const char* aboutData;
const unsigned int aboutDataSize = 172710;
const unsigned int aboutWidth = 303;
const unsigned int aboutHeight = 190;

extern const char* aboutButtonHoverData;
const unsigned int aboutButtonHoverDataSize = 5888;
const unsigned int aboutButtonHoverWidth = 92;
const unsigned int aboutButtonHoverHeight = 16;

extern const char* aboutButtonNormalData;
const unsigned int aboutButtonNormalDataSize = 5888;
const unsigned int aboutButtonNormalWidth = 92;
const unsigned int aboutButtonNormalHeight = 16;

extern const char* backgroundData;
const unsigned int backgroundDataSize = 437472;
const unsigned int backgroundWidth = 392;
const unsigned int backgroundHeight = 372;

extern const char* knobData;
const unsigned int knobDataSize = 15376;
const unsigned int knobWidth = 62;
const unsigned int knobHeight = 62;

extern const char* sliderData;
const unsigned int sliderDataSize = 6000;
const unsigned int sliderWidth = 50;
const unsigned int sliderHeight = 30;
}

#endif // BINARY_DISTRHOARTWORK3BANDEQ_HPP


+ 264
- 0
distrho-3bandeq/DistrhoPlugin3BandEQ.cpp View File

@@ -0,0 +1,264 @@
/*
* DISTRHO 3BandEQ Plugin, based on 3BandEQ by Michael Gruhn
* Copyright (C) 2007 Michael Gruhn <michael-gruhn@web.de>
* Copyright (C) 2012-2015 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* For a full copy of the license see the LICENSE file.
*/
#include "DistrhoPlugin3BandEQ.hpp"
#include <cmath>
static const float kAMP_DB = 8.656170245f;
static const float kDC_ADD = 1e-30f;
static const float kPI = 3.141592654f;
START_NAMESPACE_DISTRHO
// -----------------------------------------------------------------------
DistrhoPlugin3BandEQ::DistrhoPlugin3BandEQ()
: Plugin(paramCount, 1, 0) // 1 program, 0 states
{
// set default values
loadProgram(0);
// reset
deactivate();
}
// -----------------------------------------------------------------------
// Init
void DistrhoPlugin3BandEQ::initParameter(uint32_t index, Parameter& parameter)
{
switch (index)
{
case paramLow:
parameter.hints = kParameterIsAutomable;
parameter.name = "Low";
parameter.symbol = "low";
parameter.unit = "dB";
parameter.ranges.def = 0.0f;
parameter.ranges.min = -24.0f;
parameter.ranges.max = 24.0f;
break;
case paramMid:
parameter.hints = kParameterIsAutomable;
parameter.name = "Mid";
parameter.symbol = "mid";
parameter.unit = "dB";
parameter.ranges.def = 0.0f;
parameter.ranges.min = -24.0f;
parameter.ranges.max = 24.0f;
break;
case paramHigh:
parameter.hints = kParameterIsAutomable;
parameter.name = "High";
parameter.symbol = "high";
parameter.unit = "dB";
parameter.ranges.def = 0.0f;
parameter.ranges.min = -24.0f;
parameter.ranges.max = 24.0f;
break;
case paramMaster:
parameter.hints = kParameterIsAutomable;
parameter.name = "Master";
parameter.symbol = "master";
parameter.unit = "dB";
parameter.ranges.def = 0.0f;
parameter.ranges.min = -24.0f;
parameter.ranges.max = 24.0f;
break;
case paramLowMidFreq:
parameter.hints = kParameterIsAutomable;
parameter.name = "Low-Mid Freq";
parameter.symbol = "low_mid";
parameter.unit = "Hz";
parameter.ranges.def = 440.0f;
parameter.ranges.min = 0.0f;
parameter.ranges.max = 1000.0f;
break;
case paramMidHighFreq:
parameter.hints = kParameterIsAutomable;
parameter.name = "Mid-High Freq";
parameter.symbol = "mid_high";
parameter.unit = "Hz";
parameter.ranges.def = 1000.0f;
parameter.ranges.min = 1000.0f;
parameter.ranges.max = 20000.0f;
break;
}
}
void DistrhoPlugin3BandEQ::initProgramName(uint32_t index, String& programName)
{
if (index != 0)
return;
programName = "Default";
}
// -----------------------------------------------------------------------
// Internal data
float DistrhoPlugin3BandEQ::getParameterValue(uint32_t index) const
{
switch (index)
{
case paramLow:
return fLow;
case paramMid:
return fMid;
case paramHigh:
return fHigh;
case paramMaster:
return fMaster;
case paramLowMidFreq:
return fLowMidFreq;
case paramMidHighFreq:
return fMidHighFreq;
default:
return 0.0f;
}
}
void DistrhoPlugin3BandEQ::setParameterValue(uint32_t index, float value)
{
if (getSampleRate() <= 0.0)
return;
switch (index)
{
case paramLow:
fLow = value;
lowVol = std::exp( (fLow/48.0f) * 48.0f / kAMP_DB);
break;
case paramMid:
fMid = value;
midVol = std::exp( (fMid/48.0f) * 48.0f / kAMP_DB);
break;
case paramHigh:
fHigh = value;
highVol = std::exp( (fHigh/48.0f) * 48.0f / kAMP_DB);
break;
case paramMaster:
fMaster = value;
outVol = std::exp( (fMaster/48.0f) * 48.0f / kAMP_DB);
break;
case paramLowMidFreq:
fLowMidFreq = std::fmin(value, fMidHighFreq);
freqLP = fLowMidFreq;
xLP = std::exp(-2.0f * kPI * freqLP / (float)getSampleRate());
a0LP = 1.0f - xLP;
b1LP = -xLP;
break;
case paramMidHighFreq:
fMidHighFreq = std::fmax(value, fLowMidFreq);
freqHP = fMidHighFreq;
xHP = std::exp(-2.0f * kPI * freqHP / (float)getSampleRate());
a0HP = 1.0f - xHP;
b1HP = -xHP;
break;
}
}
void DistrhoPlugin3BandEQ::loadProgram(uint32_t index)
{
if (index != 0)
return;
// Default values
fLow = 0.0f;
fMid = 0.0f;
fHigh = 0.0f;
fMaster = 0.0f;
fLowMidFreq = 220.0f;
fMidHighFreq = 2000.0f;
// Internal stuff
lowVol = midVol = highVol = outVol = 1.0f;
freqLP = 200.0f;
freqHP = 2000.0f;
// reset filter values
activate();
}
// -----------------------------------------------------------------------
// Process
void DistrhoPlugin3BandEQ::activate()
{
const float sr = (float)getSampleRate();
xLP = std::exp(-2.0f * kPI * freqLP / sr);
#ifdef DISTRHO_OS_WINDOWS
// don't ask me why, but this fixes a crash/exception below on windows...
printf("%f\n", -xLP);
#endif
a0LP = 1.0f - xLP;
b1LP = -xLP;
xHP = std::exp(-2.0f * kPI * freqHP / sr);
a0HP = 1.0f - xHP;
b1HP = -xHP;
}
void DistrhoPlugin3BandEQ::deactivate()
{
out1LP = out2LP = out1HP = out2HP = 0.0f;
tmp1LP = tmp2LP = tmp1HP = tmp2HP = 0.0f;
}
void DistrhoPlugin3BandEQ::run(const float** inputs, float** outputs, uint32_t frames)
{
const float* in1 = inputs[0];
const float* in2 = inputs[1];
float* out1 = outputs[0];
float* out2 = outputs[1];
for (uint32_t i=0; i < frames; ++i)
{
tmp1LP = a0LP * in1[i] - b1LP * tmp1LP + kDC_ADD;
tmp2LP = a0LP * in2[i] - b1LP * tmp2LP + kDC_ADD;
out1LP = tmp1LP - kDC_ADD;
out2LP = tmp2LP - kDC_ADD;
tmp1HP = a0HP * in1[i] - b1HP * tmp1HP + kDC_ADD;
tmp2HP = a0HP * in2[i] - b1HP * tmp2HP + kDC_ADD;
out1HP = in1[i] - tmp1HP - kDC_ADD;
out2HP = in2[i] - tmp2HP - kDC_ADD;
out1[i] = (out1LP*lowVol + (in1[i] - out1LP - out1HP)*midVol + out1HP*highVol) * outVol;
out2[i] = (out2LP*lowVol + (in2[i] - out2LP - out2HP)*midVol + out2HP*highVol) * outVol;
}
}
// -----------------------------------------------------------------------
Plugin* createPlugin()
{
return new DistrhoPlugin3BandEQ();
}
// -----------------------------------------------------------------------
END_NAMESPACE_DISTRHO

+ 123
- 0
distrho-3bandeq/DistrhoPlugin3BandEQ.hpp View File

@@ -0,0 +1,123 @@
/*
* DISTRHO 3BandEQ Plugin, based on 3BandEQ by Michael Gruhn
* Copyright (C) 2007 Michael Gruhn <michael-gruhn@web.de>
* Copyright (C) 2012-2015 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* For a full copy of the license see the LICENSE file.
*/
#ifndef DISTRHO_PLUGIN_3BANDEQ_HPP_INCLUDED
#define DISTRHO_PLUGIN_3BANDEQ_HPP_INCLUDED
#include "DistrhoPlugin.hpp"
START_NAMESPACE_DISTRHO
// -----------------------------------------------------------------------
class DistrhoPlugin3BandEQ : public Plugin
{
public:
enum Parameters
{
paramLow = 0,
paramMid,
paramHigh,
paramMaster,
paramLowMidFreq,
paramMidHighFreq,
paramCount
};
DistrhoPlugin3BandEQ();
protected:
// -------------------------------------------------------------------
// Information
const char* getLabel() const noexcept override
{
return "3BandEQ";
}
const char* getDescription() const override
{
return "3 Band Equalizer, stereo version.";
}
const char* getMaker() const noexcept override
{
return "DISTRHO";
}
const char* getHomePage() const override
{
return "https://github.com/DISTRHO/Mini-Series";
}
const char* getLicense() const noexcept override
{
return "LGPL";
}
uint32_t getVersion() const noexcept override
{
return d_version(1, 0, 0);
}
int64_t getUniqueId() const noexcept override
{
return d_cconst('D', '3', 'E', 'Q');
}
// -------------------------------------------------------------------
// Init
void initParameter(uint32_t index, Parameter& parameter) override;
void initProgramName(uint32_t index, String& programName) override;
// -------------------------------------------------------------------
// Internal data
float getParameterValue(uint32_t index) const override;
void setParameterValue(uint32_t index, float value) override;
void loadProgram(uint32_t index) override;
// -------------------------------------------------------------------
// Process
void activate() override;
void deactivate() override;
void run(const float** inputs, float** outputs, uint32_t frames) override;
// -------------------------------------------------------------------
private:
float fLow, fMid, fHigh, fMaster, fLowMidFreq, fMidHighFreq;
float lowVol, midVol, highVol, outVol;
float freqLP, freqHP;
float xLP, a0LP, b1LP;
float xHP, a0HP, b1HP;
float out1LP, out2LP, out1HP, out2HP;
float tmp1LP, tmp2LP, tmp1HP, tmp2HP;
DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(DistrhoPlugin3BandEQ)
};
// -----------------------------------------------------------------------
END_NAMESPACE_DISTRHO
#endif // DISTRHO_PLUGIN_3BANDEQ_HPP_INCLUDED

+ 32
- 0
distrho-3bandeq/DistrhoPluginInfo.h View File

@@ -0,0 +1,32 @@
/*
* DISTRHO 3BandEQ Plugin, based on 3BandEQ by Michael Gruhn
* Copyright (C) 2012-2015 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* For a full copy of the license see the LICENSE file.
*/

#ifndef DISTRHO_PLUGIN_INFO_H_INCLUDED
#define DISTRHO_PLUGIN_INFO_H_INCLUDED

#define DISTRHO_PLUGIN_BRAND "DISTRHO"
#define DISTRHO_PLUGIN_NAME "3 Band EQ"
#define DISTRHO_PLUGIN_URI "http://distrho.sf.net/plugins/3BandEQ"

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

#define DISTRHO_PLUGIN_LV2_CATEGORY "lv2:EQPlugin"

#endif // DISTRHO_PLUGIN_INFO_H_INCLUDED

+ 211
- 0
distrho-3bandeq/DistrhoUI3BandEQ.cpp View File

@@ -0,0 +1,211 @@
/*
* DISTRHO 3BandEQ Plugin, based on 3BandEQ by Michael Gruhn
* Copyright (C) 2012-2015 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* For a full copy of the license see the LICENSE file.
*/

#include "DistrhoPlugin3BandEQ.hpp"
#include "DistrhoUI3BandEQ.hpp"

START_NAMESPACE_DISTRHO

namespace Art = DistrhoArtwork3BandEQ;

// -----------------------------------------------------------------------

DistrhoUI3BandEQ::DistrhoUI3BandEQ()
: UI(Art::backgroundWidth, Art::backgroundHeight),
fImgBackground(Art::backgroundData, Art::backgroundWidth, Art::backgroundHeight, GL_BGR),
fAboutWindow(this)
{
// about
Image aboutImage(Art::aboutData, Art::aboutWidth, Art::aboutHeight, GL_BGR);
fAboutWindow.setImage(aboutImage);

// sliders
Image sliderImage(Art::sliderData, Art::sliderWidth, Art::sliderHeight);
Point<int> sliderPosStart(57, 43);
Point<int> sliderPosEnd(57, 43 + 160);

// slider Low
fSliderLow = new ImageSlider(this, sliderImage);
fSliderLow->setId(DistrhoPlugin3BandEQ::paramLow);
fSliderLow->setInverted(true);
fSliderLow->setStartPos(sliderPosStart);
fSliderLow->setEndPos(sliderPosEnd);
fSliderLow->setRange(-24.0f, 24.0f);
fSliderLow->setCallback(this);

// slider Mid
sliderPosStart.setX(120);
sliderPosEnd.setX(120);
fSliderMid = new ImageSlider(this, sliderImage);
fSliderMid->setId(DistrhoPlugin3BandEQ::paramMid);
fSliderMid->setInverted(true);
fSliderMid->setStartPos(sliderPosStart);
fSliderMid->setEndPos(sliderPosEnd);
fSliderMid->setRange(-24.0f, 24.0f);
fSliderMid->setCallback(this);

// slider High
sliderPosStart.setX(183);
sliderPosEnd.setX(183);
fSliderHigh = new ImageSlider(this, sliderImage);
fSliderHigh->setId(DistrhoPlugin3BandEQ::paramHigh);
fSliderHigh->setInverted(true);
fSliderHigh->setStartPos(sliderPosStart);
fSliderHigh->setEndPos(sliderPosEnd);
fSliderHigh->setRange(-24.0f, 24.0f);
fSliderHigh->setCallback(this);

// slider Master
sliderPosStart.setX(287);
sliderPosEnd.setX(287);
fSliderMaster = new ImageSlider(this, sliderImage);
fSliderMaster->setId(DistrhoPlugin3BandEQ::paramMaster);
fSliderMaster->setInverted(true);
fSliderMaster->setStartPos(sliderPosStart);
fSliderMaster->setEndPos(sliderPosEnd);
fSliderMaster->setRange(-24.0f, 24.0f);
fSliderMaster->setCallback(this);

// knobs
Image knobImage(Art::knobData, Art::knobWidth, Art::knobHeight);

// knob Low-Mid
fKnobLowMid = new ImageKnob(this, knobImage, ImageKnob::Vertical);
fKnobLowMid->setId(DistrhoPlugin3BandEQ::paramLowMidFreq);
fKnobLowMid->setAbsolutePos(65, 269);
fKnobLowMid->setRange(0.0f, 1000.0f);
fKnobLowMid->setDefault(440.0f);
fKnobLowMid->setRotationAngle(270);
fKnobLowMid->setCallback(this);

// knob Mid-High
fKnobMidHigh = new ImageKnob(this, knobImage, ImageKnob::Vertical);
fKnobMidHigh->setId(DistrhoPlugin3BandEQ::paramMidHighFreq);
fKnobMidHigh->setAbsolutePos(159, 269);
fKnobMidHigh->setRange(1000.0f, 20000.0f);
fKnobMidHigh->setDefault(1000.0f);
fKnobMidHigh->setRotationAngle(270);
fKnobMidHigh->setCallback(this);

// about button
Image aboutImageNormal(Art::aboutButtonNormalData, Art::aboutButtonNormalWidth, Art::aboutButtonNormalHeight);
Image aboutImageHover(Art::aboutButtonHoverData, Art::aboutButtonHoverWidth, Art::aboutButtonHoverHeight);
fButtonAbout = new ImageButton(this, aboutImageNormal, aboutImageHover, aboutImageHover);
fButtonAbout->setAbsolutePos(264, 300);
fButtonAbout->setCallback(this);

// set default values
programLoaded(0);
}

// -----------------------------------------------------------------------
// DSP Callbacks

void DistrhoUI3BandEQ::parameterChanged(uint32_t index, float value)
{
switch (index)
{
case DistrhoPlugin3BandEQ::paramLow:
fSliderLow->setValue(value);
break;
case DistrhoPlugin3BandEQ::paramMid:
fSliderMid->setValue(value);
break;
case DistrhoPlugin3BandEQ::paramHigh:
fSliderHigh->setValue(value);
break;
case DistrhoPlugin3BandEQ::paramMaster:
fSliderMaster->setValue(value);
break;
case DistrhoPlugin3BandEQ::paramLowMidFreq:
fKnobLowMid->setValue(value);
break;
case DistrhoPlugin3BandEQ::paramMidHighFreq:
fKnobMidHigh->setValue(value);
break;
}
}

void DistrhoUI3BandEQ::programLoaded(uint32_t index)
{
if (index != 0)
return;

// Default values
fSliderLow->setValue(0.0f);
fSliderMid->setValue(0.0f);
fSliderHigh->setValue(0.0f);
fSliderMaster->setValue(0.0f);
fKnobLowMid->setValue(220.0f);
fKnobMidHigh->setValue(2000.0f);
}

// -----------------------------------------------------------------------
// Widget Callbacks

void DistrhoUI3BandEQ::imageButtonClicked(ImageButton* button, int)
{
if (button != fButtonAbout)
return;

fAboutWindow.exec();
}

void DistrhoUI3BandEQ::imageKnobDragStarted(ImageKnob* knob)
{
editParameter(knob->getId(), true);
}

void DistrhoUI3BandEQ::imageKnobDragFinished(ImageKnob* knob)
{
editParameter(knob->getId(), false);
}

void DistrhoUI3BandEQ::imageKnobValueChanged(ImageKnob* knob, float value)
{
setParameterValue(knob->getId(), value);
}

void DistrhoUI3BandEQ::imageSliderDragStarted(ImageSlider* slider)
{
editParameter(slider->getId(), true);
}

void DistrhoUI3BandEQ::imageSliderDragFinished(ImageSlider* slider)
{
editParameter(slider->getId(), false);
}

void DistrhoUI3BandEQ::imageSliderValueChanged(ImageSlider* slider, float value)
{
setParameterValue(slider->getId(), value);
}

void DistrhoUI3BandEQ::onDisplay()
{
fImgBackground.draw();
}

// -----------------------------------------------------------------------

UI* createUI()
{
return new DistrhoUI3BandEQ();
}

// -----------------------------------------------------------------------

END_NAMESPACE_DISTRHO

+ 72
- 0
distrho-3bandeq/DistrhoUI3BandEQ.hpp View File

@@ -0,0 +1,72 @@
/*
* DISTRHO 3BandEQ Plugin, based on 3BandEQ by Michael Gruhn
* Copyright (C) 2012-2015 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* For a full copy of the license see the LICENSE file.
*/

#ifndef DISTRHO_UI_3BANDEQ_HPP_INCLUDED
#define DISTRHO_UI_3BANDEQ_HPP_INCLUDED

#include "DistrhoUI.hpp"
#include "ImageWidgets.hpp"

#include "DistrhoArtwork3BandEQ.hpp"

START_NAMESPACE_DISTRHO

// -----------------------------------------------------------------------

class DistrhoUI3BandEQ : public UI,
public ImageButton::Callback,
public ImageKnob::Callback,
public ImageSlider::Callback
{
public:
DistrhoUI3BandEQ();

protected:
// -------------------------------------------------------------------
// DSP Callbacks

void parameterChanged(uint32_t index, float value) override;
void programLoaded(uint32_t index) override;

// -------------------------------------------------------------------
// Widget Callbacks

void imageButtonClicked(ImageButton* button, int) override;
void imageKnobDragStarted(ImageKnob* knob) override;
void imageKnobDragFinished(ImageKnob* knob) override;
void imageKnobValueChanged(ImageKnob* knob, float value) override;
void imageSliderDragStarted(ImageSlider* slider) override;
void imageSliderDragFinished(ImageSlider* slider) override;
void imageSliderValueChanged(ImageSlider* slider, float value) override;

void onDisplay() override;

private:
Image fImgBackground;
ImageAboutWindow fAboutWindow;

ScopedPointer<ImageButton> fButtonAbout;
ScopedPointer<ImageKnob> fKnobLowMid, fKnobMidHigh;
ScopedPointer<ImageSlider> fSliderLow, fSliderMid, fSliderHigh, fSliderMaster;

DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(DistrhoUI3BandEQ)
};

// -----------------------------------------------------------------------

END_NAMESPACE_DISTRHO

#endif // DISTRHO_UI_3BANDEQ_HPP_INCLUDED

+ 85
- 0
distrho-3bandsplitter.cpp View File

@@ -0,0 +1,85 @@
/*
* Carla Native Plugins
* Copyright (C) 2012-2017 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* For a full copy of the GNU General Public License see the doc/GPL.txt file.
*/

// config fix
#include "distrho-3bandsplitter/DistrhoPluginInfo.h"

#if DISTRHO_PLUGIN_HAS_UI && ! defined(HAVE_DGL)
# undef DISTRHO_PLUGIN_HAS_UI
# define DISTRHO_PLUGIN_HAS_UI 0
#endif

#include "CarlaMathUtils.hpp"
#include "CarlaJuceUtils.hpp"

// Plugin Code
#include "distrho-3bandsplitter/DistrhoArtwork3BandSplitter.cpp"
#include "distrho-3bandsplitter/DistrhoPlugin3BandSplitter.cpp"
#ifdef HAVE_DGL
#include "distrho-3bandsplitter/DistrhoUI3BandSplitter.cpp"
#endif

// DISTRHO Code
#define DISTRHO_PLUGIN_TARGET_CARLA
#include "DistrhoPluginMain.cpp"
#ifdef HAVE_DGL
#include "DistrhoUIMain.cpp"
#endif

START_NAMESPACE_DISTRHO

// -----------------------------------------------------------------------

static const NativePluginDescriptor _3bandsplitterDesc = {
/* category */ NATIVE_PLUGIN_CATEGORY_EQ,
#ifdef HAVE_DGL
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE
|NATIVE_PLUGIN_HAS_UI
|NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD
|NATIVE_PLUGIN_USES_PARENT_ID),
#else
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE),
#endif
/* supports */ NATIVE_PLUGIN_SUPPORTS_NOTHING,
/* audioIns */ DISTRHO_PLUGIN_NUM_INPUTS,
/* audioOuts */ DISTRHO_PLUGIN_NUM_OUTPUTS,
/* midiIns */ 0,
/* midiOuts */ 0,
/* paramIns */ DistrhoPlugin3BandSplitter::paramCount,
/* paramOuts */ 0,
/* name */ DISTRHO_PLUGIN_NAME,
/* label */ "3bandsplitter",
/* maker */ "falkTX, Michael Gruhn",
/* copyright */ "LGPL",
PluginDescriptorFILL(PluginCarla)
};

END_NAMESPACE_DISTRHO

// -----------------------------------------------------------------------

CARLA_EXPORT
void carla_register_native_plugin_distrho_3bandsplitter();

CARLA_EXPORT
void carla_register_native_plugin_distrho_3bandsplitter()
{
USE_NAMESPACE_DISTRHO
carla_register_native_plugin(&_3bandsplitterDesc);
}

// -----------------------------------------------------------------------

+ 10107
- 0
distrho-3bandsplitter/DistrhoArtwork3BandSplitter.cpp
File diff suppressed because it is too large
View File


+ 40
- 0
distrho-3bandsplitter/DistrhoArtwork3BandSplitter.hpp View File

@@ -0,0 +1,40 @@
/* (Auto-generated binary data file). */

#ifndef BINARY_DISTRHOARTWORK3BANDSPLITTER_HPP
#define BINARY_DISTRHOARTWORK3BANDSPLITTER_HPP

namespace DistrhoArtwork3BandSplitter
{
extern const char* aboutData;
const unsigned int aboutDataSize = 172710;
const unsigned int aboutWidth = 303;
const unsigned int aboutHeight = 190;

extern const char* aboutButtonHoverData;
const unsigned int aboutButtonHoverDataSize = 5888;
const unsigned int aboutButtonHoverWidth = 92;
const unsigned int aboutButtonHoverHeight = 16;

extern const char* aboutButtonNormalData;
const unsigned int aboutButtonNormalDataSize = 5888;
const unsigned int aboutButtonNormalWidth = 92;
const unsigned int aboutButtonNormalHeight = 16;

extern const char* backgroundData;
const unsigned int backgroundDataSize = 437472;
const unsigned int backgroundWidth = 392;
const unsigned int backgroundHeight = 372;

extern const char* knobData;
const unsigned int knobDataSize = 15376;
const unsigned int knobWidth = 62;
const unsigned int knobHeight = 62;

extern const char* sliderData;
const unsigned int sliderDataSize = 6000;
const unsigned int sliderWidth = 50;
const unsigned int sliderHeight = 30;
}

#endif // BINARY_DISTRHOARTWORK3BANDSPLITTER_HPP


+ 272
- 0
distrho-3bandsplitter/DistrhoPlugin3BandSplitter.cpp View File

@@ -0,0 +1,272 @@
/*
* DISTRHO 3BandSplitter Plugin, based on 3BandSplitter by Michael Gruhn
* Copyright (C) 2007 Michael Gruhn <michael-gruhn@web.de>
* Copyright (C) 2012-2015 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* For a full copy of the license see the LICENSE file.
*/
#include "DistrhoPlugin3BandSplitter.hpp"
#include <cmath>
static const float kAMP_DB = 8.656170245f;
static const float kDC_ADD = 1e-30f;
static const float kPI = 3.141592654f;
START_NAMESPACE_DISTRHO
// -----------------------------------------------------------------------
DistrhoPlugin3BandSplitter::DistrhoPlugin3BandSplitter()
: Plugin(paramCount, 1, 0) // 1 program, 0 states
{
// set default values
loadProgram(0);
// reset
deactivate();
}
// -----------------------------------------------------------------------
// Init
void DistrhoPlugin3BandSplitter::initParameter(uint32_t index, Parameter& parameter)
{
switch (index)
{
case paramLow:
parameter.hints = kParameterIsAutomable;
parameter.name = "Low";
parameter.symbol = "low";
parameter.unit = "dB";
parameter.ranges.def = 0.0f;
parameter.ranges.min = -24.0f;
parameter.ranges.max = 24.0f;
break;
case paramMid:
parameter.hints = kParameterIsAutomable;
parameter.name = "Mid";
parameter.symbol = "mid";
parameter.unit = "dB";
parameter.ranges.def = 0.0f;
parameter.ranges.min = -24.0f;
parameter.ranges.max = 24.0f;
break;
case paramHigh:
parameter.hints = kParameterIsAutomable;
parameter.name = "High";
parameter.symbol = "high";
parameter.unit = "dB";
parameter.ranges.def = 0.0f;
parameter.ranges.min = -24.0f;
parameter.ranges.max = 24.0f;
break;
case paramMaster:
parameter.hints = kParameterIsAutomable;
parameter.name = "Master";
parameter.symbol = "master";
parameter.unit = "dB";
parameter.ranges.def = 0.0f;
parameter.ranges.min = -24.0f;
parameter.ranges.max = 24.0f;
break;
case paramLowMidFreq:
parameter.hints = kParameterIsAutomable;
parameter.name = "Low-Mid Freq";
parameter.symbol = "low_mid";
parameter.unit = "Hz";
parameter.ranges.def = 440.0f;
parameter.ranges.min = 0.0f;
parameter.ranges.max = 1000.0f;
break;
case paramMidHighFreq:
parameter.hints = kParameterIsAutomable;
parameter.name = "Mid-High Freq";
parameter.symbol = "mid_high";
parameter.unit = "Hz";
parameter.ranges.def = 1000.0f;
parameter.ranges.min = 1000.0f;
parameter.ranges.max = 20000.0f;
break;
}
}
void DistrhoPlugin3BandSplitter::initProgramName(uint32_t index, String& programName)
{
if (index != 0)
return;
programName = "Default";
}
// -----------------------------------------------------------------------
// Internal data
float DistrhoPlugin3BandSplitter::getParameterValue(uint32_t index) const
{
switch (index)
{
case paramLow:
return fLow;
case paramMid:
return fMid;
case paramHigh:
return fHigh;
case paramMaster:
return fMaster;
case paramLowMidFreq:
return fLowMidFreq;
case paramMidHighFreq:
return fMidHighFreq;
default:
return 0.0f;
}
}
void DistrhoPlugin3BandSplitter::setParameterValue(uint32_t index, float value)
{
if (getSampleRate() <= 0.0)
return;