├── .github ├── FUNDING.yml └── workflows │ └── build.yml ├── .gitignore ├── .gitmodules ├── LICENSE ├── Makefile ├── README.md └── plugins ├── 3BandEQ ├── DistrhoArtwork3BandEQ.cpp ├── DistrhoArtwork3BandEQ.hpp ├── DistrhoPlugin3BandEQ.cpp ├── DistrhoPlugin3BandEQ.hpp ├── DistrhoPluginInfo.h ├── DistrhoUI3BandEQ.cpp ├── DistrhoUI3BandEQ.hpp ├── Makefile ├── Screenshot.png └── artwork │ ├── about.png │ ├── aboutButtonHover.png │ ├── aboutButtonNormal.png │ ├── background.png │ ├── knob.png │ └── slider.png ├── 3BandSplitter ├── DistrhoArtwork3BandSplitter.cpp ├── DistrhoArtwork3BandSplitter.hpp ├── DistrhoPlugin3BandSplitter.cpp ├── DistrhoPlugin3BandSplitter.hpp ├── DistrhoPluginInfo.h ├── DistrhoUI3BandSplitter.cpp ├── DistrhoUI3BandSplitter.hpp ├── Makefile ├── Screenshot.png └── artwork │ ├── about.png │ ├── aboutButtonHover.png │ ├── aboutButtonNormal.png │ ├── background.png │ ├── knob.png │ └── slider.png └── PingPongPan ├── DistrhoArtworkPingPongPan.cpp ├── DistrhoArtworkPingPongPan.hpp ├── DistrhoPluginInfo.h ├── DistrhoPluginPingPongPan.cpp ├── DistrhoPluginPingPongPan.hpp ├── DistrhoUIPingPongPan.cpp ├── DistrhoUIPingPongPan.hpp ├── Makefile ├── Screenshot.png └── artwork ├── about.png ├── aboutButtonHover.png ├── aboutButtonNormal.png ├── background.png └── knob.png /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: falkTX 2 | liberapay: falkTX 3 | patreon: falkTX 4 | custom: "https://paypal.me/falkTX" 5 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: build 2 | 3 | on: 4 | push: 5 | branches: 6 | - '*' 7 | pull_request: 8 | branches: 9 | - '*' 10 | 11 | jobs: 12 | linux: 13 | strategy: 14 | matrix: 15 | target: [linux-arm64, linux-armhf, linux-i686, linux-riscv64, linux-x86_64] 16 | runs-on: ubuntu-20.04 17 | steps: 18 | - uses: actions/checkout@v4 19 | with: 20 | submodules: recursive 21 | - uses: distrho/dpf-makefile-action@v1 22 | with: 23 | target: ${{ matrix.target }} 24 | 25 | macos: 26 | strategy: 27 | matrix: 28 | target: [macos-intel, macos-universal] 29 | runs-on: macos-12 30 | steps: 31 | - uses: actions/checkout@v4 32 | with: 33 | submodules: recursive 34 | - uses: distrho/dpf-makefile-action@v1 35 | with: 36 | target: ${{ matrix.target }} 37 | 38 | windows: 39 | strategy: 40 | matrix: 41 | target: [win32, win64] 42 | runs-on: ubuntu-20.04 43 | steps: 44 | - uses: actions/checkout@v4 45 | with: 46 | submodules: recursive 47 | - uses: distrho/dpf-makefile-action@v1 48 | with: 49 | target: ${{ matrix.target }} 50 | 51 | pluginval: 52 | runs-on: ubuntu-20.04 53 | steps: 54 | - uses: actions/checkout@v4 55 | with: 56 | submodules: recursive 57 | - uses: distrho/dpf-makefile-action@v1 58 | with: 59 | target: pluginval 60 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.a 2 | *.d 3 | *.o 4 | 5 | *.exe 6 | *.dll 7 | *.dylib 8 | *.so 9 | *.zip 10 | 11 | .kdev_include_paths 12 | .kdev4/ 13 | 14 | bin/ 15 | build/ 16 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "dpf"] 2 | path = dpf 3 | url = https://github.com/DISTRHO/DPF 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | 9 | This version of the GNU Lesser General Public License incorporates 10 | the terms and conditions of version 3 of the GNU General Public 11 | License, supplemented by the additional permissions listed below. 12 | 13 | 0. Additional Definitions. 14 | 15 | As used herein, "this License" refers to version 3 of the GNU Lesser 16 | General Public License, and the "GNU GPL" refers to version 3 of the GNU 17 | General Public License. 18 | 19 | "The Library" refers to a covered work governed by this License, 20 | other than an Application or a Combined Work as defined below. 21 | 22 | An "Application" is any work that makes use of an interface provided 23 | by the Library, but which is not otherwise based on the Library. 24 | Defining a subclass of a class defined by the Library is deemed a mode 25 | of using an interface provided by the Library. 26 | 27 | A "Combined Work" is a work produced by combining or linking an 28 | Application with the Library. The particular version of the Library 29 | with which the Combined Work was made is also called the "Linked 30 | Version". 31 | 32 | The "Minimal Corresponding Source" for a Combined Work means the 33 | Corresponding Source for the Combined Work, excluding any source code 34 | for portions of the Combined Work that, considered in isolation, are 35 | based on the Application, and not on the Linked Version. 36 | 37 | The "Corresponding Application Code" for a Combined Work means the 38 | object code and/or source code for the Application, including any data 39 | and utility programs needed for reproducing the Combined Work from the 40 | Application, but excluding the System Libraries of the Combined Work. 41 | 42 | 1. Exception to Section 3 of the GNU GPL. 43 | 44 | You may convey a covered work under sections 3 and 4 of this License 45 | without being bound by section 3 of the GNU GPL. 46 | 47 | 2. Conveying Modified Versions. 48 | 49 | If you modify a copy of the Library, and, in your modifications, a 50 | facility refers to a function or data to be supplied by an Application 51 | that uses the facility (other than as an argument passed when the 52 | facility is invoked), then you may convey a copy of the modified 53 | version: 54 | 55 | a) under this License, provided that you make a good faith effort to 56 | ensure that, in the event an Application does not supply the 57 | function or data, the facility still operates, and performs 58 | whatever part of its purpose remains meaningful, or 59 | 60 | b) under the GNU GPL, with none of the additional permissions of 61 | this License applicable to that copy. 62 | 63 | 3. Object Code Incorporating Material from Library Header Files. 64 | 65 | The object code form of an Application may incorporate material from 66 | a header file that is part of the Library. You may convey such object 67 | code under terms of your choice, provided that, if the incorporated 68 | material is not limited to numerical parameters, data structure 69 | layouts and accessors, or small macros, inline functions and templates 70 | (ten or fewer lines in length), you do both of the following: 71 | 72 | a) Give prominent notice with each copy of the object code that the 73 | Library is used in it and that the Library and its use are 74 | covered by this License. 75 | 76 | b) Accompany the object code with a copy of the GNU GPL and this license 77 | document. 78 | 79 | 4. Combined Works. 80 | 81 | You may convey a Combined Work under terms of your choice that, 82 | taken together, effectively do not restrict modification of the 83 | portions of the Library contained in the Combined Work and reverse 84 | engineering for debugging such modifications, if you also do each of 85 | the following: 86 | 87 | a) Give prominent notice with each copy of the Combined Work that 88 | the Library is used in it and that the Library and its use are 89 | covered by this License. 90 | 91 | b) Accompany the Combined Work with a copy of the GNU GPL and this license 92 | document. 93 | 94 | c) For a Combined Work that displays copyright notices during 95 | execution, include the copyright notice for the Library among 96 | these notices, as well as a reference directing the user to the 97 | copies of the GNU GPL and this license document. 98 | 99 | d) Do one of the following: 100 | 101 | 0) Convey the Minimal Corresponding Source under the terms of this 102 | License, and the Corresponding Application Code in a form 103 | suitable for, and under terms that permit, the user to 104 | recombine or relink the Application with a modified version of 105 | the Linked Version to produce a modified Combined Work, in the 106 | manner specified by section 6 of the GNU GPL for conveying 107 | Corresponding Source. 108 | 109 | 1) Use a suitable shared library mechanism for linking with the 110 | Library. A suitable mechanism is one that (a) uses at run time 111 | a copy of the Library already present on the user's computer 112 | system, and (b) will operate properly with a modified version 113 | of the Library that is interface-compatible with the Linked 114 | Version. 115 | 116 | e) Provide Installation Information, but only if you would otherwise 117 | be required to provide such information under section 6 of the 118 | GNU GPL, and only to the extent that such information is 119 | necessary to install and execute a modified version of the 120 | Combined Work produced by recombining or relinking the 121 | Application with a modified version of the Linked Version. (If 122 | you use option 4d0, the Installation Information must accompany 123 | the Minimal Corresponding Source and Corresponding Application 124 | Code. If you use option 4d1, you must provide the Installation 125 | Information in the manner specified by section 6 of the GNU GPL 126 | for conveying Corresponding Source.) 127 | 128 | 5. Combined Libraries. 129 | 130 | You may place library facilities that are a work based on the 131 | Library side by side in a single library together with other library 132 | facilities that are not Applications and are not covered by this 133 | License, and convey such a combined library under terms of your 134 | choice, if you do both of the following: 135 | 136 | a) Accompany the combined library with a copy of the same work based 137 | on the Library, uncombined with any other library facilities, 138 | conveyed under the terms of this License. 139 | 140 | b) Give prominent notice with the combined library that part of it 141 | is a work based on the Library, and explaining where to find the 142 | accompanying uncombined form of the same work. 143 | 144 | 6. Revised Versions of the GNU Lesser General Public License. 145 | 146 | The Free Software Foundation may publish revised and/or new versions 147 | of the GNU Lesser General Public License from time to time. Such new 148 | versions will be similar in spirit to the present version, but may 149 | differ in detail to address new problems or concerns. 150 | 151 | Each version is given a distinguishing version number. If the 152 | Library as you received it specifies that a certain numbered version 153 | of the GNU Lesser General Public License "or any later version" 154 | applies to it, you have the option of following the terms and 155 | conditions either of that published version or of any later version 156 | published by the Free Software Foundation. If the Library as you 157 | received it does not specify a version number of the GNU Lesser 158 | General Public License, you may choose any version of the GNU Lesser 159 | General Public License ever published by the Free Software Foundation. 160 | 161 | If the Library as you received it specifies that a proxy can decide 162 | whether future versions of the GNU Lesser General Public License shall 163 | apply, that proxy's public statement of acceptance of any version is 164 | permanent authorization for you to choose that version for the 165 | Library. 166 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Makefile for DISTRHO Plugins # 3 | # ---------------------------- # 4 | # Created by falkTX 5 | # 6 | 7 | include dpf/Makefile.base.mk 8 | 9 | all: dgl plugins gen 10 | 11 | # -------------------------------------------------------------- 12 | 13 | dgl: 14 | ifeq ($(HAVE_CAIRO_OR_OPENGL),true) 15 | $(MAKE) -C dpf/dgl USE_FILE_BROWSER=false 16 | endif 17 | 18 | plugins: dgl 19 | $(MAKE) all -C plugins/3BandEQ 20 | $(MAKE) all -C plugins/3BandSplitter 21 | $(MAKE) all -C plugins/PingPongPan 22 | 23 | ifneq ($(CROSS_COMPILING),true) 24 | gen: plugins dpf/utils/lv2_ttl_generator 25 | @$(CURDIR)/dpf/utils/generate-ttl.sh 26 | 27 | dpf/utils/lv2_ttl_generator: 28 | $(MAKE) -C dpf/utils/lv2-ttl-generator 29 | else 30 | gen: 31 | endif 32 | 33 | # -------------------------------------------------------------- 34 | 35 | clean: 36 | $(MAKE) clean -C dpf/dgl 37 | $(MAKE) clean -C dpf/utils/lv2-ttl-generator 38 | $(MAKE) clean -C plugins/3BandEQ 39 | $(MAKE) clean -C plugins/3BandSplitter 40 | $(MAKE) clean -C plugins/PingPongPan 41 | rm -rf bin build 42 | 43 | # -------------------------------------------------------------- 44 | 45 | .PHONY: plugins 46 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DISTRHO Mini-Series 2 | 3 | A collection of small but useful plugins, based on the good old LOSER-Dev Plugins. 4 | 5 | This collection currently includes:
6 | - 3 Band EQ 7 | - 3 Band Splitter 8 | - Ping Pong Pan 9 | 10 | ## Screenshots 11 | 3 Band EQ:
12 | ![3 Band EQ](https://raw.githubusercontent.com/DISTRHO/mini-series/master/plugins/3BandEQ/Screenshot.png "3 Band EQ")
13 | 14 | Ping Pong Pan:
15 | ![Ping Pong Pan](https://raw.githubusercontent.com/DISTRHO/mini-series/master/plugins/PingPongPan/Screenshot.png "Ping Pong Pan")
16 | -------------------------------------------------------------------------------- /plugins/3BandEQ/DistrhoArtwork3BandEQ.hpp: -------------------------------------------------------------------------------- 1 | /* (Auto-generated binary data file). */ 2 | 3 | #ifndef BINARY_DISTRHOARTWORK3BANDEQ_HPP 4 | #define BINARY_DISTRHOARTWORK3BANDEQ_HPP 5 | 6 | namespace DistrhoArtwork3BandEQ 7 | { 8 | extern const char* aboutData; 9 | const unsigned int aboutDataSize = 172710; 10 | const unsigned int aboutWidth = 303; 11 | const unsigned int aboutHeight = 190; 12 | 13 | extern const char* aboutButtonHoverData; 14 | const unsigned int aboutButtonHoverDataSize = 5888; 15 | const unsigned int aboutButtonHoverWidth = 92; 16 | const unsigned int aboutButtonHoverHeight = 16; 17 | 18 | extern const char* aboutButtonNormalData; 19 | const unsigned int aboutButtonNormalDataSize = 5888; 20 | const unsigned int aboutButtonNormalWidth = 92; 21 | const unsigned int aboutButtonNormalHeight = 16; 22 | 23 | extern const char* backgroundData; 24 | const unsigned int backgroundDataSize = 437472; 25 | const unsigned int backgroundWidth = 392; 26 | const unsigned int backgroundHeight = 372; 27 | 28 | extern const char* knobData; 29 | const unsigned int knobDataSize = 15376; 30 | const unsigned int knobWidth = 62; 31 | const unsigned int knobHeight = 62; 32 | 33 | extern const char* sliderData; 34 | const unsigned int sliderDataSize = 6000; 35 | const unsigned int sliderWidth = 50; 36 | const unsigned int sliderHeight = 30; 37 | } 38 | 39 | #endif // BINARY_DISTRHOARTWORK3BANDEQ_HPP 40 | 41 | -------------------------------------------------------------------------------- /plugins/3BandEQ/DistrhoPlugin3BandEQ.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * DISTRHO 3BandEQ Plugin, based on 3BandEQ by Michael Gruhn 3 | * Copyright (C) 2007 Michael Gruhn 4 | * Copyright (C) 2012-2022 Filipe Coelho 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * For a full copy of the license see the LICENSE file. 16 | */ 17 | 18 | #include "DistrhoPlugin3BandEQ.hpp" 19 | 20 | #include 21 | 22 | static const float kAMP_DB = 8.656170245f; 23 | static const float kDC_ADD = 1e-30f; 24 | static const float kPI = 3.141592654f; 25 | 26 | START_NAMESPACE_DISTRHO 27 | 28 | // ----------------------------------------------------------------------- 29 | 30 | DistrhoPlugin3BandEQ::DistrhoPlugin3BandEQ() 31 | : Plugin(paramCount, 1, 0) // 1 program, 0 states 32 | { 33 | // set default values 34 | loadProgram(0); 35 | 36 | // reset 37 | deactivate(); 38 | } 39 | 40 | // ----------------------------------------------------------------------- 41 | // Init 42 | 43 | void DistrhoPlugin3BandEQ::initAudioPort(bool input, uint32_t index, AudioPort& port) 44 | { 45 | port.groupId = kPortGroupStereo; 46 | 47 | Plugin::initAudioPort(input, index, port); 48 | } 49 | 50 | void DistrhoPlugin3BandEQ::initParameter(uint32_t index, Parameter& parameter) 51 | { 52 | switch (index) 53 | { 54 | case paramLow: 55 | parameter.hints = kParameterIsAutomatable; 56 | parameter.name = "Low"; 57 | parameter.symbol = "low"; 58 | parameter.unit = "dB"; 59 | parameter.ranges.def = 0.0f; 60 | parameter.ranges.min = -24.0f; 61 | parameter.ranges.max = 24.0f; 62 | break; 63 | 64 | case paramMid: 65 | parameter.hints = kParameterIsAutomatable; 66 | parameter.name = "Mid"; 67 | parameter.symbol = "mid"; 68 | parameter.unit = "dB"; 69 | parameter.ranges.def = 0.0f; 70 | parameter.ranges.min = -24.0f; 71 | parameter.ranges.max = 24.0f; 72 | break; 73 | 74 | case paramHigh: 75 | parameter.hints = kParameterIsAutomatable; 76 | parameter.name = "High"; 77 | parameter.symbol = "high"; 78 | parameter.unit = "dB"; 79 | parameter.ranges.def = 0.0f; 80 | parameter.ranges.min = -24.0f; 81 | parameter.ranges.max = 24.0f; 82 | break; 83 | 84 | case paramMaster: 85 | parameter.hints = kParameterIsAutomatable; 86 | parameter.name = "Master"; 87 | parameter.symbol = "master"; 88 | parameter.unit = "dB"; 89 | parameter.ranges.def = 0.0f; 90 | parameter.ranges.min = -24.0f; 91 | parameter.ranges.max = 24.0f; 92 | break; 93 | 94 | case paramLowMidFreq: 95 | parameter.hints = kParameterIsAutomatable; 96 | parameter.name = "Low-Mid Freq"; 97 | parameter.symbol = "low_mid"; 98 | parameter.unit = "Hz"; 99 | parameter.ranges.def = 440.0f; 100 | parameter.ranges.min = 0.0f; 101 | parameter.ranges.max = 1000.0f; 102 | break; 103 | 104 | case paramMidHighFreq: 105 | parameter.hints = kParameterIsAutomatable; 106 | parameter.name = "Mid-High Freq"; 107 | parameter.symbol = "mid_high"; 108 | parameter.unit = "Hz"; 109 | parameter.ranges.def = 1000.0f; 110 | parameter.ranges.min = 1000.0f; 111 | parameter.ranges.max = 20000.0f; 112 | break; 113 | } 114 | } 115 | 116 | void DistrhoPlugin3BandEQ::initProgramName(uint32_t index, String& programName) 117 | { 118 | if (index != 0) 119 | return; 120 | 121 | programName = "Default"; 122 | } 123 | 124 | // ----------------------------------------------------------------------- 125 | // Internal data 126 | 127 | float DistrhoPlugin3BandEQ::getParameterValue(uint32_t index) const 128 | { 129 | switch (index) 130 | { 131 | case paramLow: 132 | return fLow; 133 | case paramMid: 134 | return fMid; 135 | case paramHigh: 136 | return fHigh; 137 | case paramMaster: 138 | return fMaster; 139 | case paramLowMidFreq: 140 | return fLowMidFreq; 141 | case paramMidHighFreq: 142 | return fMidHighFreq; 143 | default: 144 | return 0.0f; 145 | } 146 | } 147 | 148 | void DistrhoPlugin3BandEQ::setParameterValue(uint32_t index, float value) 149 | { 150 | if (getSampleRate() <= 0.0) 151 | return; 152 | 153 | switch (index) 154 | { 155 | case paramLow: 156 | fLow = value; 157 | lowVol = std::exp( (fLow/48.0f) * 48.0f / kAMP_DB); 158 | break; 159 | case paramMid: 160 | fMid = value; 161 | midVol = std::exp( (fMid/48.0f) * 48.0f / kAMP_DB); 162 | break; 163 | case paramHigh: 164 | fHigh = value; 165 | highVol = std::exp( (fHigh/48.0f) * 48.0f / kAMP_DB); 166 | break; 167 | case paramMaster: 168 | fMaster = value; 169 | outVol = std::exp( (fMaster/48.0f) * 48.0f / kAMP_DB); 170 | break; 171 | case paramLowMidFreq: 172 | fLowMidFreq = std::fmin(value, fMidHighFreq); 173 | freqLP = fLowMidFreq; 174 | xLP = std::exp(-2.0f * kPI * freqLP / (float)getSampleRate()); 175 | a0LP = 1.0f - xLP; 176 | b1LP = -xLP; 177 | break; 178 | case paramMidHighFreq: 179 | fMidHighFreq = std::fmax(value, fLowMidFreq); 180 | freqHP = fMidHighFreq; 181 | xHP = std::exp(-2.0f * kPI * freqHP / (float)getSampleRate()); 182 | a0HP = 1.0f - xHP; 183 | b1HP = -xHP; 184 | break; 185 | } 186 | } 187 | 188 | void DistrhoPlugin3BandEQ::loadProgram(uint32_t index) 189 | { 190 | if (index != 0) 191 | return; 192 | 193 | // Default values 194 | fLow = 0.0f; 195 | fMid = 0.0f; 196 | fHigh = 0.0f; 197 | fMaster = 0.0f; 198 | fLowMidFreq = 220.0f; 199 | fMidHighFreq = 2000.0f; 200 | 201 | // Internal stuff 202 | lowVol = midVol = highVol = outVol = 1.0f; 203 | freqLP = 200.0f; 204 | freqHP = 2000.0f; 205 | 206 | // reset filter values 207 | activate(); 208 | } 209 | 210 | // ----------------------------------------------------------------------- 211 | // Process 212 | 213 | void DistrhoPlugin3BandEQ::activate() 214 | { 215 | const float sr = (float)getSampleRate(); 216 | 217 | xLP = std::exp(-2.0f * kPI * freqLP / sr); 218 | 219 | a0LP = 1.0f - xLP; 220 | b1LP = -xLP; 221 | 222 | xHP = std::exp(-2.0f * kPI * freqHP / sr); 223 | a0HP = 1.0f - xHP; 224 | b1HP = -xHP; 225 | } 226 | 227 | void DistrhoPlugin3BandEQ::deactivate() 228 | { 229 | out1LP = out2LP = out1HP = out2HP = 0.0f; 230 | tmp1LP = tmp2LP = tmp1HP = tmp2HP = 0.0f; 231 | } 232 | 233 | void DistrhoPlugin3BandEQ::run(const float** inputs, float** outputs, uint32_t frames) 234 | { 235 | const float* in1 = inputs[0]; 236 | const float* in2 = inputs[1]; 237 | float* out1 = outputs[0]; 238 | float* out2 = outputs[1]; 239 | 240 | for (uint32_t i=0; i < frames; ++i) 241 | { 242 | tmp1LP = a0LP * in1[i] - b1LP * tmp1LP + kDC_ADD; 243 | tmp2LP = a0LP * in2[i] - b1LP * tmp2LP + kDC_ADD; 244 | out1LP = tmp1LP - kDC_ADD; 245 | out2LP = tmp2LP - kDC_ADD; 246 | 247 | tmp1HP = a0HP * in1[i] - b1HP * tmp1HP + kDC_ADD; 248 | tmp2HP = a0HP * in2[i] - b1HP * tmp2HP + kDC_ADD; 249 | out1HP = in1[i] - tmp1HP - kDC_ADD; 250 | out2HP = in2[i] - tmp2HP - kDC_ADD; 251 | 252 | out1[i] = (out1LP*lowVol + (in1[i] - out1LP - out1HP)*midVol + out1HP*highVol) * outVol; 253 | out2[i] = (out2LP*lowVol + (in2[i] - out2LP - out2HP)*midVol + out2HP*highVol) * outVol; 254 | } 255 | } 256 | 257 | // ----------------------------------------------------------------------- 258 | 259 | Plugin* createPlugin() 260 | { 261 | return new DistrhoPlugin3BandEQ(); 262 | } 263 | 264 | // ----------------------------------------------------------------------- 265 | 266 | END_NAMESPACE_DISTRHO 267 | -------------------------------------------------------------------------------- /plugins/3BandEQ/DistrhoPlugin3BandEQ.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * DISTRHO 3BandEQ Plugin, based on 3BandEQ by Michael Gruhn 3 | * Copyright (C) 2007 Michael Gruhn 4 | * Copyright (C) 2012-2022 Filipe Coelho 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * For a full copy of the license see the LICENSE file. 16 | */ 17 | 18 | #ifndef DISTRHO_PLUGIN_3BANDEQ_HPP_INCLUDED 19 | #define DISTRHO_PLUGIN_3BANDEQ_HPP_INCLUDED 20 | 21 | #include "DistrhoPlugin.hpp" 22 | 23 | START_NAMESPACE_DISTRHO 24 | 25 | // ----------------------------------------------------------------------- 26 | 27 | class DistrhoPlugin3BandEQ : public Plugin 28 | { 29 | public: 30 | enum Parameters 31 | { 32 | paramLow = 0, 33 | paramMid, 34 | paramHigh, 35 | paramMaster, 36 | paramLowMidFreq, 37 | paramMidHighFreq, 38 | paramCount 39 | }; 40 | 41 | DistrhoPlugin3BandEQ(); 42 | 43 | protected: 44 | // ------------------------------------------------------------------- 45 | // Information 46 | 47 | const char* getLabel() const noexcept override 48 | { 49 | return "3BandEQ"; 50 | } 51 | 52 | const char* getDescription() const override 53 | { 54 | return "3 Band Equalizer, stereo version."; 55 | } 56 | 57 | const char* getMaker() const noexcept override 58 | { 59 | return "DISTRHO"; 60 | } 61 | 62 | const char* getHomePage() const override 63 | { 64 | return "https://github.com/DISTRHO/Mini-Series"; 65 | } 66 | 67 | const char* getLicense() const noexcept override 68 | { 69 | return "LGPL"; 70 | } 71 | 72 | uint32_t getVersion() const noexcept override 73 | { 74 | return d_version(1, 0, 0); 75 | } 76 | 77 | // ------------------------------------------------------------------- 78 | // Init 79 | 80 | void initAudioPort(bool input, uint32_t index, AudioPort& port) override; 81 | void initParameter(uint32_t index, Parameter& parameter) override; 82 | void initProgramName(uint32_t index, String& programName) override; 83 | 84 | // ------------------------------------------------------------------- 85 | // Internal data 86 | 87 | float getParameterValue(uint32_t index) const override; 88 | void setParameterValue(uint32_t index, float value) override; 89 | void loadProgram(uint32_t index) override; 90 | 91 | // ------------------------------------------------------------------- 92 | // Process 93 | 94 | void activate() override; 95 | void deactivate() override; 96 | void run(const float** inputs, float** outputs, uint32_t frames) override; 97 | 98 | // ------------------------------------------------------------------- 99 | 100 | private: 101 | float fLow, fMid, fHigh, fMaster, fLowMidFreq, fMidHighFreq; 102 | 103 | float lowVol, midVol, highVol, outVol; 104 | float freqLP, freqHP; 105 | 106 | float xLP, a0LP, b1LP; 107 | float xHP, a0HP, b1HP; 108 | 109 | float out1LP, out2LP, out1HP, out2HP; 110 | float tmp1LP, tmp2LP, tmp1HP, tmp2HP; 111 | 112 | DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(DistrhoPlugin3BandEQ) 113 | }; 114 | 115 | // ----------------------------------------------------------------------- 116 | 117 | END_NAMESPACE_DISTRHO 118 | 119 | #endif // DISTRHO_PLUGIN_3BANDEQ_HPP_INCLUDED 120 | -------------------------------------------------------------------------------- /plugins/3BandEQ/DistrhoPluginInfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * DISTRHO 3BandEQ Plugin, based on 3BandEQ by Michael Gruhn 3 | * Copyright (C) 2012-2024 Filipe Coelho 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Lesser General Public License for more details. 13 | * 14 | * For a full copy of the license see the LICENSE file. 15 | */ 16 | 17 | #ifndef DISTRHO_PLUGIN_INFO_H_INCLUDED 18 | #define DISTRHO_PLUGIN_INFO_H_INCLUDED 19 | 20 | #define DISTRHO_PLUGIN_BRAND "DISTRHO" 21 | #define DISTRHO_PLUGIN_NAME "3 Band EQ" 22 | #define DISTRHO_PLUGIN_URI "http://distrho.sf.net/plugins/3BandEQ" 23 | #define DISTRHO_PLUGIN_CLAP_ID "studio.kx.distrho.3BandEQ" 24 | 25 | #define DISTRHO_PLUGIN_BRAND_ID Dstr 26 | #define DISTRHO_PLUGIN_UNIQUE_ID D3EQ 27 | 28 | #define DISTRHO_PLUGIN_HAS_UI 1 29 | #define DISTRHO_PLUGIN_IS_RT_SAFE 1 30 | #define DISTRHO_PLUGIN_NUM_INPUTS 2 31 | #define DISTRHO_PLUGIN_NUM_OUTPUTS 2 32 | #define DISTRHO_PLUGIN_WANT_PROGRAMS 1 33 | 34 | #define DISTRHO_PLUGIN_CLAP_FEATURES "audio-effect", "equalizer", "stereo" 35 | #define DISTRHO_PLUGIN_LV2_CATEGORY "lv2:EQPlugin" 36 | #define DISTRHO_PLUGIN_VST3_CATEGORIES "Fx|EQ" 37 | 38 | #define DPF_VST3_DONT_USE_BRAND_ID 39 | 40 | #endif // DISTRHO_PLUGIN_INFO_H_INCLUDED 41 | -------------------------------------------------------------------------------- /plugins/3BandEQ/DistrhoUI3BandEQ.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * DISTRHO 3BandEQ Plugin, based on 3BandEQ by Michael Gruhn 3 | * Copyright (C) 2012-2021 Filipe Coelho 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Lesser General Public License for more details. 13 | * 14 | * For a full copy of the license see the LICENSE file. 15 | */ 16 | 17 | #include "DistrhoPlugin3BandEQ.hpp" 18 | #include "DistrhoUI3BandEQ.hpp" 19 | 20 | START_NAMESPACE_DISTRHO 21 | 22 | namespace Art = DistrhoArtwork3BandEQ; 23 | 24 | // ----------------------------------------------------------------------- 25 | 26 | DistrhoUI3BandEQ::DistrhoUI3BandEQ() 27 | : UI(Art::backgroundWidth, Art::backgroundHeight, true), 28 | fImgBackground(Art::backgroundData, Art::backgroundWidth, Art::backgroundHeight, kImageFormatBGR), 29 | fAboutWindow(this) 30 | { 31 | // about 32 | Image aboutImage(Art::aboutData, Art::aboutWidth, Art::aboutHeight, kImageFormatBGR); 33 | fAboutWindow.setImage(aboutImage); 34 | 35 | // sliders 36 | Image sliderImage(Art::sliderData, Art::sliderWidth, Art::sliderHeight, kImageFormatBGRA); 37 | Point sliderPosStart(57, 43); 38 | Point sliderPosEnd(57, 43 + 160); 39 | 40 | // slider Low 41 | fSliderLow = new ImageSlider(this, sliderImage); 42 | fSliderLow->setId(DistrhoPlugin3BandEQ::paramLow); 43 | fSliderLow->setInverted(true); 44 | fSliderLow->setStartPos(sliderPosStart); 45 | fSliderLow->setEndPos(sliderPosEnd); 46 | fSliderLow->setRange(-24.0f, 24.0f); 47 | fSliderLow->setCallback(this); 48 | 49 | // slider Mid 50 | sliderPosStart.setX(120); 51 | sliderPosEnd.setX(120); 52 | fSliderMid = new ImageSlider(this, sliderImage); 53 | fSliderMid->setId(DistrhoPlugin3BandEQ::paramMid); 54 | fSliderMid->setInverted(true); 55 | fSliderMid->setStartPos(sliderPosStart); 56 | fSliderMid->setEndPos(sliderPosEnd); 57 | fSliderMid->setRange(-24.0f, 24.0f); 58 | fSliderMid->setCallback(this); 59 | 60 | // slider High 61 | sliderPosStart.setX(183); 62 | sliderPosEnd.setX(183); 63 | fSliderHigh = new ImageSlider(this, sliderImage); 64 | fSliderHigh->setId(DistrhoPlugin3BandEQ::paramHigh); 65 | fSliderHigh->setInverted(true); 66 | fSliderHigh->setStartPos(sliderPosStart); 67 | fSliderHigh->setEndPos(sliderPosEnd); 68 | fSliderHigh->setRange(-24.0f, 24.0f); 69 | fSliderHigh->setCallback(this); 70 | 71 | // slider Master 72 | sliderPosStart.setX(287); 73 | sliderPosEnd.setX(287); 74 | fSliderMaster = new ImageSlider(this, sliderImage); 75 | fSliderMaster->setId(DistrhoPlugin3BandEQ::paramMaster); 76 | fSliderMaster->setInverted(true); 77 | fSliderMaster->setStartPos(sliderPosStart); 78 | fSliderMaster->setEndPos(sliderPosEnd); 79 | fSliderMaster->setRange(-24.0f, 24.0f); 80 | fSliderMaster->setCallback(this); 81 | 82 | // knobs 83 | Image knobImage(Art::knobData, Art::knobWidth, Art::knobHeight, kImageFormatBGRA); 84 | 85 | // knob Low-Mid 86 | fKnobLowMid = new ImageKnob(this, knobImage, ImageKnob::Vertical); 87 | fKnobLowMid->setId(DistrhoPlugin3BandEQ::paramLowMidFreq); 88 | fKnobLowMid->setAbsolutePos(65, 269); 89 | fKnobLowMid->setRange(0.0f, 1000.0f); 90 | fKnobLowMid->setDefault(440.0f); 91 | fKnobLowMid->setRotationAngle(270); 92 | fKnobLowMid->setCallback(this); 93 | 94 | // knob Mid-High 95 | fKnobMidHigh = new ImageKnob(this, knobImage, ImageKnob::Vertical); 96 | fKnobMidHigh->setId(DistrhoPlugin3BandEQ::paramMidHighFreq); 97 | fKnobMidHigh->setAbsolutePos(159, 269); 98 | fKnobMidHigh->setRange(1000.0f, 20000.0f); 99 | fKnobMidHigh->setDefault(1000.0f); 100 | fKnobMidHigh->setRotationAngle(270); 101 | fKnobMidHigh->setCallback(this); 102 | 103 | // about button 104 | Image aboutImageNormal(Art::aboutButtonNormalData, Art::aboutButtonNormalWidth, Art::aboutButtonNormalHeight, kImageFormatBGRA); 105 | Image aboutImageHover(Art::aboutButtonHoverData, Art::aboutButtonHoverWidth, Art::aboutButtonHoverHeight, kImageFormatBGRA); 106 | fButtonAbout = new ImageButton(this, aboutImageNormal, aboutImageHover, aboutImageHover); 107 | fButtonAbout->setAbsolutePos(264, 300); 108 | fButtonAbout->setCallback(this); 109 | 110 | // set default values 111 | programLoaded(0); 112 | } 113 | 114 | // ----------------------------------------------------------------------- 115 | // DSP Callbacks 116 | 117 | void DistrhoUI3BandEQ::parameterChanged(uint32_t index, float value) 118 | { 119 | switch (index) 120 | { 121 | case DistrhoPlugin3BandEQ::paramLow: 122 | fSliderLow->setValue(value); 123 | break; 124 | case DistrhoPlugin3BandEQ::paramMid: 125 | fSliderMid->setValue(value); 126 | break; 127 | case DistrhoPlugin3BandEQ::paramHigh: 128 | fSliderHigh->setValue(value); 129 | break; 130 | case DistrhoPlugin3BandEQ::paramMaster: 131 | fSliderMaster->setValue(value); 132 | break; 133 | case DistrhoPlugin3BandEQ::paramLowMidFreq: 134 | fKnobLowMid->setValue(value); 135 | break; 136 | case DistrhoPlugin3BandEQ::paramMidHighFreq: 137 | fKnobMidHigh->setValue(value); 138 | break; 139 | } 140 | } 141 | 142 | void DistrhoUI3BandEQ::programLoaded(uint32_t index) 143 | { 144 | if (index != 0) 145 | return; 146 | 147 | // Default values 148 | fSliderLow->setValue(0.0f); 149 | fSliderMid->setValue(0.0f); 150 | fSliderHigh->setValue(0.0f); 151 | fSliderMaster->setValue(0.0f); 152 | fKnobLowMid->setValue(220.0f); 153 | fKnobMidHigh->setValue(2000.0f); 154 | } 155 | 156 | // ----------------------------------------------------------------------- 157 | // Widget Callbacks 158 | 159 | void DistrhoUI3BandEQ::imageButtonClicked(ImageButton* button, int) 160 | { 161 | if (button != fButtonAbout) 162 | return; 163 | 164 | fAboutWindow.runAsModal(); 165 | } 166 | 167 | void DistrhoUI3BandEQ::imageKnobDragStarted(ImageKnob* knob) 168 | { 169 | editParameter(knob->getId(), true); 170 | } 171 | 172 | void DistrhoUI3BandEQ::imageKnobDragFinished(ImageKnob* knob) 173 | { 174 | editParameter(knob->getId(), false); 175 | } 176 | 177 | void DistrhoUI3BandEQ::imageKnobValueChanged(ImageKnob* knob, float value) 178 | { 179 | setParameterValue(knob->getId(), value); 180 | } 181 | 182 | void DistrhoUI3BandEQ::imageSliderDragStarted(ImageSlider* slider) 183 | { 184 | editParameter(slider->getId(), true); 185 | } 186 | 187 | void DistrhoUI3BandEQ::imageSliderDragFinished(ImageSlider* slider) 188 | { 189 | editParameter(slider->getId(), false); 190 | } 191 | 192 | void DistrhoUI3BandEQ::imageSliderValueChanged(ImageSlider* slider, float value) 193 | { 194 | setParameterValue(slider->getId(), value); 195 | } 196 | 197 | void DistrhoUI3BandEQ::onDisplay() 198 | { 199 | const GraphicsContext& context(getGraphicsContext()); 200 | 201 | fImgBackground.draw(context); 202 | } 203 | 204 | // ----------------------------------------------------------------------- 205 | 206 | UI* createUI() 207 | { 208 | return new DistrhoUI3BandEQ(); 209 | } 210 | 211 | // ----------------------------------------------------------------------- 212 | 213 | END_NAMESPACE_DISTRHO 214 | -------------------------------------------------------------------------------- /plugins/3BandEQ/DistrhoUI3BandEQ.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * DISTRHO 3BandEQ Plugin, based on 3BandEQ by Michael Gruhn 3 | * Copyright (C) 2012-2015 Filipe Coelho 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Lesser General Public License for more details. 13 | * 14 | * For a full copy of the license see the LICENSE file. 15 | */ 16 | 17 | #ifndef DISTRHO_UI_3BANDEQ_HPP_INCLUDED 18 | #define DISTRHO_UI_3BANDEQ_HPP_INCLUDED 19 | 20 | #include "DistrhoUI.hpp" 21 | #include "ImageWidgets.hpp" 22 | 23 | #include "DistrhoArtwork3BandEQ.hpp" 24 | 25 | START_NAMESPACE_DISTRHO 26 | 27 | // ----------------------------------------------------------------------- 28 | 29 | class DistrhoUI3BandEQ : public UI, 30 | public ImageButton::Callback, 31 | public ImageKnob::Callback, 32 | public ImageSlider::Callback 33 | { 34 | public: 35 | DistrhoUI3BandEQ(); 36 | 37 | protected: 38 | // ------------------------------------------------------------------- 39 | // DSP Callbacks 40 | 41 | void parameterChanged(uint32_t index, float value) override; 42 | void programLoaded(uint32_t index) override; 43 | 44 | // ------------------------------------------------------------------- 45 | // Widget Callbacks 46 | 47 | void imageButtonClicked(ImageButton* button, int) override; 48 | void imageKnobDragStarted(ImageKnob* knob) override; 49 | void imageKnobDragFinished(ImageKnob* knob) override; 50 | void imageKnobValueChanged(ImageKnob* knob, float value) override; 51 | void imageSliderDragStarted(ImageSlider* slider) override; 52 | void imageSliderDragFinished(ImageSlider* slider) override; 53 | void imageSliderValueChanged(ImageSlider* slider, float value) override; 54 | 55 | void onDisplay() override; 56 | 57 | private: 58 | Image fImgBackground; 59 | ImageAboutWindow fAboutWindow; 60 | 61 | ScopedPointer fButtonAbout; 62 | ScopedPointer fKnobLowMid, fKnobMidHigh; 63 | ScopedPointer fSliderLow, fSliderMid, fSliderHigh, fSliderMaster; 64 | 65 | DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(DistrhoUI3BandEQ) 66 | }; 67 | 68 | // ----------------------------------------------------------------------- 69 | 70 | END_NAMESPACE_DISTRHO 71 | 72 | #endif // DISTRHO_UI_3BANDEQ_HPP_INCLUDED 73 | -------------------------------------------------------------------------------- /plugins/3BandEQ/Makefile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Makefile for DISTRHO Plugins # 3 | # ---------------------------- # 4 | # Created by falkTX 5 | # 6 | 7 | # -------------------------------------------------------------- 8 | # Project name, used for binaries 9 | 10 | NAME = 3BandEQ 11 | 12 | # -------------------------------------------------------------- 13 | # Files to build 14 | 15 | FILES_DSP = \ 16 | DistrhoPlugin3BandEQ.cpp 17 | 18 | FILES_UI = \ 19 | DistrhoArtwork3BandEQ.cpp \ 20 | DistrhoUI3BandEQ.cpp 21 | 22 | # -------------------------------------------------------------- 23 | # Do some magic 24 | 25 | UI_TYPE = generic 26 | SKIP_NATIVE_AUDIO_FALLBACK = true 27 | USE_FILE_BROWSER = false 28 | include ../../dpf/Makefile.plugins.mk 29 | 30 | # -------------------------------------------------------------- 31 | # Enable all possible plugin types 32 | 33 | TARGETS = au clap jack ladspa lv2_sep vst2 vst3 34 | 35 | ifeq ($(HAVE_CAIRO_OR_OPENGL)$(HAVE_LIBLO),truetrue) 36 | TARGETS += dssi 37 | endif 38 | 39 | all: $(TARGETS) 40 | 41 | # -------------------------------------------------------------- 42 | -------------------------------------------------------------------------------- /plugins/3BandEQ/Screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DISTRHO/Mini-Series/32b46120384ab0371258cd1fc4f287d71d689f33/plugins/3BandEQ/Screenshot.png -------------------------------------------------------------------------------- /plugins/3BandEQ/artwork/about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DISTRHO/Mini-Series/32b46120384ab0371258cd1fc4f287d71d689f33/plugins/3BandEQ/artwork/about.png -------------------------------------------------------------------------------- /plugins/3BandEQ/artwork/aboutButtonHover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DISTRHO/Mini-Series/32b46120384ab0371258cd1fc4f287d71d689f33/plugins/3BandEQ/artwork/aboutButtonHover.png -------------------------------------------------------------------------------- /plugins/3BandEQ/artwork/aboutButtonNormal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DISTRHO/Mini-Series/32b46120384ab0371258cd1fc4f287d71d689f33/plugins/3BandEQ/artwork/aboutButtonNormal.png -------------------------------------------------------------------------------- /plugins/3BandEQ/artwork/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DISTRHO/Mini-Series/32b46120384ab0371258cd1fc4f287d71d689f33/plugins/3BandEQ/artwork/background.png -------------------------------------------------------------------------------- /plugins/3BandEQ/artwork/knob.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DISTRHO/Mini-Series/32b46120384ab0371258cd1fc4f287d71d689f33/plugins/3BandEQ/artwork/knob.png -------------------------------------------------------------------------------- /plugins/3BandEQ/artwork/slider.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DISTRHO/Mini-Series/32b46120384ab0371258cd1fc4f287d71d689f33/plugins/3BandEQ/artwork/slider.png -------------------------------------------------------------------------------- /plugins/3BandSplitter/DistrhoArtwork3BandSplitter.hpp: -------------------------------------------------------------------------------- 1 | /* (Auto-generated binary data file). */ 2 | 3 | #ifndef BINARY_DISTRHOARTWORK3BANDSPLITTER_HPP 4 | #define BINARY_DISTRHOARTWORK3BANDSPLITTER_HPP 5 | 6 | namespace DistrhoArtwork3BandSplitter 7 | { 8 | extern const char* aboutData; 9 | const unsigned int aboutDataSize = 172710; 10 | const unsigned int aboutWidth = 303; 11 | const unsigned int aboutHeight = 190; 12 | 13 | extern const char* aboutButtonHoverData; 14 | const unsigned int aboutButtonHoverDataSize = 5888; 15 | const unsigned int aboutButtonHoverWidth = 92; 16 | const unsigned int aboutButtonHoverHeight = 16; 17 | 18 | extern const char* aboutButtonNormalData; 19 | const unsigned int aboutButtonNormalDataSize = 5888; 20 | const unsigned int aboutButtonNormalWidth = 92; 21 | const unsigned int aboutButtonNormalHeight = 16; 22 | 23 | extern const char* backgroundData; 24 | const unsigned int backgroundDataSize = 437472; 25 | const unsigned int backgroundWidth = 392; 26 | const unsigned int backgroundHeight = 372; 27 | 28 | extern const char* knobData; 29 | const unsigned int knobDataSize = 15376; 30 | const unsigned int knobWidth = 62; 31 | const unsigned int knobHeight = 62; 32 | 33 | extern const char* sliderData; 34 | const unsigned int sliderDataSize = 6000; 35 | const unsigned int sliderWidth = 50; 36 | const unsigned int sliderHeight = 30; 37 | } 38 | 39 | #endif // BINARY_DISTRHOARTWORK3BANDSPLITTER_HPP 40 | 41 | -------------------------------------------------------------------------------- /plugins/3BandSplitter/DistrhoPlugin3BandSplitter.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * DISTRHO 3BandSplitter Plugin, based on 3BandSplitter by Michael Gruhn 3 | * Copyright (C) 2007 Michael Gruhn 4 | * Copyright (C) 2012-2015 Filipe Coelho 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * For a full copy of the license see the LICENSE file. 16 | */ 17 | 18 | #include "DistrhoPlugin3BandSplitter.hpp" 19 | 20 | #include 21 | 22 | static const float kAMP_DB = 8.656170245f; 23 | static const float kDC_ADD = 1e-30f; 24 | static const float kPI = 3.141592654f; 25 | 26 | START_NAMESPACE_DISTRHO 27 | 28 | // ----------------------------------------------------------------------- 29 | 30 | DistrhoPlugin3BandSplitter::DistrhoPlugin3BandSplitter() 31 | : Plugin(paramCount, 1, 0) // 1 program, 0 states 32 | { 33 | // set default values 34 | loadProgram(0); 35 | 36 | // reset 37 | deactivate(); 38 | } 39 | 40 | // ----------------------------------------------------------------------- 41 | // Init 42 | 43 | void DistrhoPlugin3BandSplitter::initAudioPort(bool input, uint32_t index, AudioPort& port) 44 | { 45 | port.hints = 0x0; 46 | 47 | if (input) 48 | { 49 | switch (index) 50 | { 51 | case 0: 52 | port.name = "Input Left"; 53 | port.symbol = "in_left"; 54 | break; 55 | case 1: 56 | port.name = "Input Right"; 57 | port.symbol = "in_right"; 58 | break; 59 | } 60 | port.groupId = kPortGroupStereo; 61 | } 62 | else 63 | { 64 | switch (index) 65 | { 66 | case 0: 67 | port.name = "Output Left (Low)"; 68 | port.symbol = "in_left_low"; 69 | port.groupId = kPortGroupLow; 70 | break; 71 | case 1: 72 | port.name = "Output Right (Low)"; 73 | port.symbol = "in_right_low"; 74 | port.groupId = kPortGroupLow; 75 | break; 76 | case 2: 77 | port.name = "Output Left (Mid)"; 78 | port.symbol = "in_left_mid"; 79 | port.groupId = kPortGroupMid; 80 | break; 81 | case 3: 82 | port.name = "Output Right (Mid)"; 83 | port.symbol = "in_right_mid"; 84 | port.groupId = kPortGroupMid; 85 | break; 86 | case 4: 87 | port.name = "Output Left (High)"; 88 | port.symbol = "in_left_high"; 89 | port.groupId = kPortGroupHigh; 90 | break; 91 | case 5: 92 | port.name = "Output Right (High)"; 93 | port.symbol = "in_right_high"; 94 | port.groupId = kPortGroupHigh; 95 | break; 96 | } 97 | } 98 | } 99 | 100 | void DistrhoPlugin3BandSplitter::initParameter(uint32_t index, Parameter& parameter) 101 | { 102 | switch (index) 103 | { 104 | case paramLow: 105 | parameter.hints = kParameterIsAutomatable; 106 | parameter.name = "Low"; 107 | parameter.symbol = "low"; 108 | parameter.unit = "dB"; 109 | parameter.ranges.def = 0.0f; 110 | parameter.ranges.min = -24.0f; 111 | parameter.ranges.max = 24.0f; 112 | break; 113 | 114 | case paramMid: 115 | parameter.hints = kParameterIsAutomatable; 116 | parameter.name = "Mid"; 117 | parameter.symbol = "mid"; 118 | parameter.unit = "dB"; 119 | parameter.ranges.def = 0.0f; 120 | parameter.ranges.min = -24.0f; 121 | parameter.ranges.max = 24.0f; 122 | break; 123 | 124 | case paramHigh: 125 | parameter.hints = kParameterIsAutomatable; 126 | parameter.name = "High"; 127 | parameter.symbol = "high"; 128 | parameter.unit = "dB"; 129 | parameter.ranges.def = 0.0f; 130 | parameter.ranges.min = -24.0f; 131 | parameter.ranges.max = 24.0f; 132 | break; 133 | 134 | case paramMaster: 135 | parameter.hints = kParameterIsAutomatable; 136 | parameter.name = "Master"; 137 | parameter.symbol = "master"; 138 | parameter.unit = "dB"; 139 | parameter.ranges.def = 0.0f; 140 | parameter.ranges.min = -24.0f; 141 | parameter.ranges.max = 24.0f; 142 | break; 143 | 144 | case paramLowMidFreq: 145 | parameter.hints = kParameterIsAutomatable; 146 | parameter.name = "Low-Mid Freq"; 147 | parameter.symbol = "low_mid"; 148 | parameter.unit = "Hz"; 149 | parameter.ranges.def = 440.0f; 150 | parameter.ranges.min = 0.0f; 151 | parameter.ranges.max = 1000.0f; 152 | break; 153 | 154 | case paramMidHighFreq: 155 | parameter.hints = kParameterIsAutomatable; 156 | parameter.name = "Mid-High Freq"; 157 | parameter.symbol = "mid_high"; 158 | parameter.unit = "Hz"; 159 | parameter.ranges.def = 1000.0f; 160 | parameter.ranges.min = 1000.0f; 161 | parameter.ranges.max = 20000.0f; 162 | break; 163 | } 164 | } 165 | 166 | void DistrhoPlugin3BandSplitter::initPortGroup(uint32_t groupId, PortGroup& portGroup) 167 | { 168 | switch (groupId) 169 | { 170 | case kPortGroupLow: 171 | portGroup.name = "Low"; 172 | portGroup.symbol = "low"; 173 | break; 174 | case kPortGroupMid: 175 | portGroup.name = "Mid"; 176 | portGroup.symbol = "mid"; 177 | break; 178 | case kPortGroupHigh: 179 | portGroup.name = "High"; 180 | portGroup.symbol = "high"; 181 | break; 182 | } 183 | } 184 | 185 | void DistrhoPlugin3BandSplitter::initProgramName(uint32_t index, String& programName) 186 | { 187 | if (index != 0) 188 | return; 189 | 190 | programName = "Default"; 191 | } 192 | 193 | // ----------------------------------------------------------------------- 194 | // Internal data 195 | 196 | float DistrhoPlugin3BandSplitter::getParameterValue(uint32_t index) const 197 | { 198 | switch (index) 199 | { 200 | case paramLow: 201 | return fLow; 202 | case paramMid: 203 | return fMid; 204 | case paramHigh: 205 | return fHigh; 206 | case paramMaster: 207 | return fMaster; 208 | case paramLowMidFreq: 209 | return fLowMidFreq; 210 | case paramMidHighFreq: 211 | return fMidHighFreq; 212 | default: 213 | return 0.0f; 214 | } 215 | } 216 | 217 | void DistrhoPlugin3BandSplitter::setParameterValue(uint32_t index, float value) 218 | { 219 | if (getSampleRate() <= 0.0) 220 | return; 221 | 222 | switch (index) 223 | { 224 | case paramLow: 225 | fLow = value; 226 | lowVol = std::exp( (fLow/48.0f) * 48.0f / kAMP_DB); 227 | break; 228 | case paramMid: 229 | fMid = value; 230 | midVol = std::exp( (fMid/48.0f) * 48.0f / kAMP_DB); 231 | break; 232 | case paramHigh: 233 | fHigh = value; 234 | highVol = std::exp( (fHigh/48.0f) * 48.0f / kAMP_DB); 235 | break; 236 | case paramMaster: 237 | fMaster = value; 238 | outVol = std::exp( (fMaster/48.0f) * 48.0f / kAMP_DB); 239 | break; 240 | case paramLowMidFreq: 241 | fLowMidFreq = std::fmin(value, fMidHighFreq); 242 | freqLP = fLowMidFreq; 243 | xLP = std::exp(-2.0f * kPI * freqLP / (float)getSampleRate()); 244 | a0LP = 1.0f - xLP; 245 | b1LP = -xLP; 246 | break; 247 | case paramMidHighFreq: 248 | fMidHighFreq = std::fmax(value, fLowMidFreq); 249 | freqHP = fMidHighFreq; 250 | xHP = std::exp(-2.0f * kPI * freqHP / (float)getSampleRate()); 251 | a0HP = 1.0f - xHP; 252 | b1HP = -xHP; 253 | break; 254 | } 255 | } 256 | 257 | void DistrhoPlugin3BandSplitter::loadProgram(uint32_t index) 258 | { 259 | if (index != 0) 260 | return; 261 | 262 | // Default values 263 | fLow = 0.0f; 264 | fMid = 0.0f; 265 | fHigh = 0.0f; 266 | fMaster = 0.0f; 267 | fLowMidFreq = 220.0f; 268 | fMidHighFreq = 2000.0f; 269 | 270 | // Internal stuff 271 | lowVol = midVol = highVol = outVol = 1.0f; 272 | freqLP = 200.0f; 273 | freqHP = 2000.0f; 274 | 275 | // reset filter values 276 | activate(); 277 | } 278 | 279 | // ----------------------------------------------------------------------- 280 | // Process 281 | 282 | void DistrhoPlugin3BandSplitter::activate() 283 | { 284 | const float sr = (float)getSampleRate(); 285 | 286 | xLP = std::exp(-2.0f * kPI * freqLP / sr); 287 | 288 | a0LP = 1.0f - xLP; 289 | b1LP = -xLP; 290 | 291 | xHP = std::exp(-2.0f * kPI * freqHP / sr); 292 | a0HP = 1.0f - xHP; 293 | b1HP = -xHP; 294 | } 295 | 296 | void DistrhoPlugin3BandSplitter::deactivate() 297 | { 298 | out1LP = out2LP = out1HP = out2HP = 0.0f; 299 | tmp1LP = tmp2LP = tmp1HP = tmp2HP = 0.0f; 300 | } 301 | 302 | void DistrhoPlugin3BandSplitter::run(const float** inputs, float** outputs, uint32_t frames) 303 | { 304 | const float* in1 = inputs[0]; 305 | const float* in2 = inputs[1]; 306 | float* out1 = outputs[0]; 307 | float* out2 = outputs[1]; 308 | float* out3 = outputs[2]; 309 | float* out4 = outputs[3]; 310 | float* out5 = outputs[4]; 311 | float* out6 = outputs[5]; 312 | 313 | for (uint32_t i=0; i < frames; ++i) 314 | { 315 | tmp1LP = a0LP * in1[i] - b1LP * tmp1LP + kDC_ADD; 316 | tmp2LP = a0LP * in2[i] - b1LP * tmp2LP + kDC_ADD; 317 | out1LP = tmp1LP - kDC_ADD; 318 | out2LP = tmp2LP - kDC_ADD; 319 | 320 | tmp1HP = a0HP * in1[i] - b1HP * tmp1HP + kDC_ADD; 321 | tmp2HP = a0HP * in2[i] - b1HP * tmp2HP + kDC_ADD; 322 | out1HP = in1[i] - tmp1HP - kDC_ADD; 323 | out2HP = in2[i] - tmp2HP - kDC_ADD; 324 | 325 | out6[i] = out2HP*highVol * outVol; 326 | out5[i] = out1HP*highVol * outVol; 327 | out4[i] = (in2[i] - out2LP - out2HP)*midVol * outVol; 328 | out3[i] = (in1[i] - out1LP - out1HP)*midVol * outVol; 329 | out2[i] = out2LP*lowVol * outVol; 330 | out1[i] = out1LP*lowVol * outVol; 331 | } 332 | } 333 | 334 | // ----------------------------------------------------------------------- 335 | 336 | Plugin* createPlugin() 337 | { 338 | return new DistrhoPlugin3BandSplitter(); 339 | } 340 | 341 | // ----------------------------------------------------------------------- 342 | 343 | END_NAMESPACE_DISTRHO 344 | -------------------------------------------------------------------------------- /plugins/3BandSplitter/DistrhoPlugin3BandSplitter.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * DISTRHO 3BandSplitter Plugin, based on 3BandSplitter by Michael Gruhn 3 | * Copyright (C) 2007 Michael Gruhn 4 | * Copyright (C) 2012-2022 Filipe Coelho 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * For a full copy of the license see the LICENSE file. 16 | */ 17 | 18 | #ifndef DISTRHO_PLUGIN_3BANDSPLITTER_HPP_INCLUDED 19 | #define DISTRHO_PLUGIN_3BANDSPLITTER_HPP_INCLUDED 20 | 21 | #include "DistrhoPlugin.hpp" 22 | 23 | START_NAMESPACE_DISTRHO 24 | 25 | // ----------------------------------------------------------------------- 26 | 27 | class DistrhoPlugin3BandSplitter : public Plugin 28 | { 29 | public: 30 | enum Parameters 31 | { 32 | paramLow = 0, 33 | paramMid, 34 | paramHigh, 35 | paramMaster, 36 | paramLowMidFreq, 37 | paramMidHighFreq, 38 | paramCount 39 | }; 40 | 41 | enum PortGroups 42 | { 43 | kPortGroupLow, 44 | kPortGroupMid, 45 | kPortGroupHigh, 46 | kPortGroupCount 47 | }; 48 | 49 | DistrhoPlugin3BandSplitter(); 50 | 51 | protected: 52 | // ------------------------------------------------------------------- 53 | // Information 54 | 55 | const char* getLabel() const noexcept override 56 | { 57 | return "3BandSplitter"; 58 | } 59 | 60 | const char* getDescription() const override 61 | { 62 | return "3 Band Equalizer, split output version."; 63 | } 64 | 65 | const char* getMaker() const noexcept override 66 | { 67 | return "DISTRHO"; 68 | } 69 | 70 | const char* getHomePage() const override 71 | { 72 | return "https://github.com/DISTRHO/Mini-Series"; 73 | } 74 | 75 | const char* getLicense() const noexcept override 76 | { 77 | return "LGPL"; 78 | } 79 | 80 | uint32_t getVersion() const noexcept override 81 | { 82 | return d_version(1, 0, 0); 83 | } 84 | 85 | // ------------------------------------------------------------------- 86 | // Init 87 | 88 | void initAudioPort(bool input, uint32_t index, AudioPort& port) override; 89 | void initParameter(uint32_t index, Parameter& parameter) override; 90 | void initPortGroup(uint32_t groupId, PortGroup& portGroup) override; 91 | void initProgramName(uint32_t index, String& programName) override; 92 | 93 | // ------------------------------------------------------------------- 94 | // Internal data 95 | 96 | float getParameterValue(uint32_t index) const override; 97 | void setParameterValue(uint32_t index, float value) override; 98 | void loadProgram(uint32_t index) override; 99 | 100 | // ------------------------------------------------------------------- 101 | // Process 102 | 103 | void activate() override; 104 | void deactivate() override; 105 | void run(const float** inputs, float** outputs, uint32_t frames) override; 106 | 107 | // ------------------------------------------------------------------- 108 | 109 | private: 110 | float fLow, fMid, fHigh, fMaster, fLowMidFreq, fMidHighFreq; 111 | 112 | float lowVol, midVol, highVol, outVol; 113 | float freqLP, freqHP; 114 | 115 | float xLP, a0LP, b1LP; 116 | float xHP, a0HP, b1HP; 117 | 118 | float out1LP, out2LP, out1HP, out2HP; 119 | float tmp1LP, tmp2LP, tmp1HP, tmp2HP; 120 | 121 | DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(DistrhoPlugin3BandSplitter) 122 | }; 123 | 124 | // ----------------------------------------------------------------------- 125 | 126 | END_NAMESPACE_DISTRHO 127 | 128 | #endif // DISTRHO_PLUGIN_3BANDSPLITTER_HPP_INCLUDED 129 | -------------------------------------------------------------------------------- /plugins/3BandSplitter/DistrhoPluginInfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * DISTRHO 3BandSplitter Plugin, based on 3BandSplitter by Michael Gruhn 3 | * Copyright (C) 2012-2024 Filipe Coelho 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Lesser General Public License for more details. 13 | * 14 | * For a full copy of the license see the LICENSE file. 15 | */ 16 | 17 | #ifndef DISTRHO_PLUGIN_INFO_H_INCLUDED 18 | #define DISTRHO_PLUGIN_INFO_H_INCLUDED 19 | 20 | #define DISTRHO_PLUGIN_BRAND "DISTRHO" 21 | #define DISTRHO_PLUGIN_NAME "3 Band Splitter" 22 | #define DISTRHO_PLUGIN_URI "http://distrho.sf.net/plugins/3BandSplitter" 23 | #define DISTRHO_PLUGIN_CLAP_ID "studio.kx.distrho.3BandSplitter" 24 | 25 | #define DISTRHO_PLUGIN_BRAND_ID Dstr 26 | #define DISTRHO_PLUGIN_UNIQUE_ID D3ES 27 | 28 | #define DISTRHO_PLUGIN_HAS_UI 1 29 | #define DISTRHO_PLUGIN_IS_RT_SAFE 1 30 | #define DISTRHO_PLUGIN_NUM_INPUTS 2 31 | #define DISTRHO_PLUGIN_NUM_OUTPUTS 6 32 | #define DISTRHO_PLUGIN_WANT_PROGRAMS 1 33 | 34 | #define DISTRHO_PLUGIN_CLAP_FEATURES "audio-effect", "equalizer", "stereo" 35 | #define DISTRHO_PLUGIN_LV2_CATEGORY "lv2:EQPlugin" 36 | #define DISTRHO_PLUGIN_VST3_CATEGORIES "Fx|EQ" 37 | 38 | #define DPF_VST3_DONT_USE_BRAND_ID 39 | 40 | #endif // DISTRHO_PLUGIN_INFO_H_INCLUDED 41 | -------------------------------------------------------------------------------- /plugins/3BandSplitter/DistrhoUI3BandSplitter.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * DISTRHO 3BandSplitter Plugin, based on 3BandSplitter by Michael Gruhn 3 | * Copyright (C) 2012-2021 Filipe Coelho 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Lesser General Public License for more details. 13 | * 14 | * For a full copy of the license see the LICENSE file. 15 | */ 16 | 17 | #include "DistrhoPlugin3BandSplitter.hpp" 18 | #include "DistrhoUI3BandSplitter.hpp" 19 | 20 | START_NAMESPACE_DISTRHO 21 | 22 | namespace Art = DistrhoArtwork3BandSplitter; 23 | 24 | // ----------------------------------------------------------------------- 25 | 26 | DistrhoUI3BandSplitter::DistrhoUI3BandSplitter() 27 | : UI(Art::backgroundWidth, Art::backgroundHeight, true), 28 | fImgBackground(Art::backgroundData, Art::backgroundWidth, Art::backgroundHeight, kImageFormatBGR), 29 | fAboutWindow(this) 30 | { 31 | // about 32 | Image aboutImage(Art::aboutData, Art::aboutWidth, Art::aboutHeight, kImageFormatBGR); 33 | fAboutWindow.setImage(aboutImage); 34 | 35 | // sliders 36 | Image sliderImage(Art::sliderData, Art::sliderWidth, Art::sliderHeight, kImageFormatBGRA); 37 | Point sliderPosStart(57, 43); 38 | Point sliderPosEnd(57, 43 + 160); 39 | 40 | // slider Low 41 | fSliderLow = new ImageSlider(this, sliderImage); 42 | fSliderLow->setId(DistrhoPlugin3BandSplitter::paramLow); 43 | fSliderLow->setInverted(true); 44 | fSliderLow->setStartPos(sliderPosStart); 45 | fSliderLow->setEndPos(sliderPosEnd); 46 | fSliderLow->setRange(-24.0f, 24.0f); 47 | fSliderLow->setCallback(this); 48 | 49 | // slider Mid 50 | sliderPosStart.setX(120); 51 | sliderPosEnd.setX(120); 52 | fSliderMid = new ImageSlider(this, sliderImage); 53 | fSliderMid->setId(DistrhoPlugin3BandSplitter::paramMid); 54 | fSliderMid->setInverted(true); 55 | fSliderMid->setStartPos(sliderPosStart); 56 | fSliderMid->setEndPos(sliderPosEnd); 57 | fSliderMid->setRange(-24.0f, 24.0f); 58 | fSliderMid->setCallback(this); 59 | 60 | // slider High 61 | sliderPosStart.setX(183); 62 | sliderPosEnd.setX(183); 63 | fSliderHigh = new ImageSlider(this, sliderImage); 64 | fSliderHigh->setId(DistrhoPlugin3BandSplitter::paramHigh); 65 | fSliderHigh->setInverted(true); 66 | fSliderHigh->setStartPos(sliderPosStart); 67 | fSliderHigh->setEndPos(sliderPosEnd); 68 | fSliderHigh->setRange(-24.0f, 24.0f); 69 | fSliderHigh->setCallback(this); 70 | 71 | // slider Master 72 | sliderPosStart.setX(287); 73 | sliderPosEnd.setX(287); 74 | fSliderMaster = new ImageSlider(this, sliderImage); 75 | fSliderMaster->setId(DistrhoPlugin3BandSplitter::paramMaster); 76 | fSliderMaster->setInverted(true); 77 | fSliderMaster->setStartPos(sliderPosStart); 78 | fSliderMaster->setEndPos(sliderPosEnd); 79 | fSliderMaster->setRange(-24.0f, 24.0f); 80 | fSliderMaster->setCallback(this); 81 | 82 | // knobs 83 | Image knobImage(Art::knobData, Art::knobWidth, Art::knobHeight, kImageFormatBGRA); 84 | 85 | // knob Low-Mid 86 | fKnobLowMid = new ImageKnob(this, knobImage, ImageKnob::Vertical); 87 | fKnobLowMid->setId(DistrhoPlugin3BandSplitter::paramLowMidFreq); 88 | fKnobLowMid->setAbsolutePos(65, 269); 89 | fKnobLowMid->setRange(0.0f, 1000.0f); 90 | fKnobLowMid->setDefault(440.0f); 91 | fKnobLowMid->setRotationAngle(270); 92 | fKnobLowMid->setCallback(this); 93 | 94 | // knob Mid-High 95 | fKnobMidHigh = new ImageKnob(this, knobImage, ImageKnob::Vertical); 96 | fKnobMidHigh->setId(DistrhoPlugin3BandSplitter::paramMidHighFreq); 97 | fKnobMidHigh->setAbsolutePos(159, 269); 98 | fKnobMidHigh->setRange(1000.0f, 20000.0f); 99 | fKnobMidHigh->setDefault(1000.0f); 100 | fKnobMidHigh->setRotationAngle(270); 101 | fKnobMidHigh->setCallback(this); 102 | 103 | // about button 104 | Image aboutImageNormal(Art::aboutButtonNormalData, Art::aboutButtonNormalWidth, Art::aboutButtonNormalHeight, kImageFormatBGRA); 105 | Image aboutImageHover(Art::aboutButtonHoverData, Art::aboutButtonHoverWidth, Art::aboutButtonHoverHeight, kImageFormatBGRA); 106 | fButtonAbout = new ImageButton(this, aboutImageNormal, aboutImageHover, aboutImageHover); 107 | fButtonAbout->setAbsolutePos(264, 300); 108 | fButtonAbout->setCallback(this); 109 | 110 | // set default values 111 | programLoaded(0); 112 | } 113 | 114 | // ----------------------------------------------------------------------- 115 | // DSP Callbacks 116 | 117 | void DistrhoUI3BandSplitter::parameterChanged(uint32_t index, float value) 118 | { 119 | switch (index) 120 | { 121 | case DistrhoPlugin3BandSplitter::paramLow: 122 | fSliderLow->setValue(value); 123 | break; 124 | case DistrhoPlugin3BandSplitter::paramMid: 125 | fSliderMid->setValue(value); 126 | break; 127 | case DistrhoPlugin3BandSplitter::paramHigh: 128 | fSliderHigh->setValue(value); 129 | break; 130 | case DistrhoPlugin3BandSplitter::paramMaster: 131 | fSliderMaster->setValue(value); 132 | break; 133 | case DistrhoPlugin3BandSplitter::paramLowMidFreq: 134 | fKnobLowMid->setValue(value); 135 | break; 136 | case DistrhoPlugin3BandSplitter::paramMidHighFreq: 137 | fKnobMidHigh->setValue(value); 138 | break; 139 | } 140 | } 141 | 142 | void DistrhoUI3BandSplitter::programLoaded(uint32_t index) 143 | { 144 | if (index != 0) 145 | return; 146 | 147 | // Default values 148 | fSliderLow->setValue(0.0f); 149 | fSliderMid->setValue(0.0f); 150 | fSliderHigh->setValue(0.0f); 151 | fSliderMaster->setValue(0.0f); 152 | fKnobLowMid->setValue(220.0f); 153 | fKnobMidHigh->setValue(2000.0f); 154 | } 155 | 156 | // ----------------------------------------------------------------------- 157 | // Widget Callbacks 158 | 159 | void DistrhoUI3BandSplitter::imageButtonClicked(ImageButton* button, int) 160 | { 161 | if (button != fButtonAbout) 162 | return; 163 | 164 | fAboutWindow.runAsModal(); 165 | } 166 | 167 | void DistrhoUI3BandSplitter::imageKnobDragStarted(ImageKnob* knob) 168 | { 169 | editParameter(knob->getId(), true); 170 | } 171 | 172 | void DistrhoUI3BandSplitter::imageKnobDragFinished(ImageKnob* knob) 173 | { 174 | editParameter(knob->getId(), false); 175 | } 176 | 177 | void DistrhoUI3BandSplitter::imageKnobValueChanged(ImageKnob* knob, float value) 178 | { 179 | setParameterValue(knob->getId(), value); 180 | } 181 | 182 | void DistrhoUI3BandSplitter::imageSliderDragStarted(ImageSlider* slider) 183 | { 184 | editParameter(slider->getId(), true); 185 | } 186 | 187 | void DistrhoUI3BandSplitter::imageSliderDragFinished(ImageSlider* slider) 188 | { 189 | editParameter(slider->getId(), false); 190 | } 191 | 192 | void DistrhoUI3BandSplitter::imageSliderValueChanged(ImageSlider* slider, float value) 193 | { 194 | setParameterValue(slider->getId(), value); 195 | } 196 | 197 | void DistrhoUI3BandSplitter::onDisplay() 198 | { 199 | const GraphicsContext& context(getGraphicsContext()); 200 | 201 | fImgBackground.draw(context); 202 | } 203 | 204 | // ----------------------------------------------------------------------- 205 | 206 | UI* createUI() 207 | { 208 | return new DistrhoUI3BandSplitter(); 209 | } 210 | 211 | // ----------------------------------------------------------------------- 212 | 213 | END_NAMESPACE_DISTRHO 214 | -------------------------------------------------------------------------------- /plugins/3BandSplitter/DistrhoUI3BandSplitter.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * DISTRHO 3BandSplitter Plugin, based on 3BandSplitter by Michael Gruhn 3 | * Copyright (C) 2012-2015 Filipe Coelho 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Lesser General Public License for more details. 13 | * 14 | * For a full copy of the license see the LICENSE file. 15 | */ 16 | 17 | #ifndef DISTRHO_UI_3BANDSPLITTER_HPP_INCLUDED 18 | #define DISTRHO_UI_3BANDSPLITTER_HPP_INCLUDED 19 | 20 | #include "DistrhoUI.hpp" 21 | #include "ImageWidgets.hpp" 22 | 23 | #include "DistrhoArtwork3BandSplitter.hpp" 24 | 25 | START_NAMESPACE_DISTRHO 26 | 27 | // ----------------------------------------------------------------------- 28 | 29 | class DistrhoUI3BandSplitter : public UI, 30 | public ImageButton::Callback, 31 | public ImageKnob::Callback, 32 | public ImageSlider::Callback 33 | { 34 | public: 35 | DistrhoUI3BandSplitter(); 36 | 37 | protected: 38 | // ------------------------------------------------------------------- 39 | // DSP Callbacks 40 | 41 | void parameterChanged(uint32_t index, float value) override; 42 | void programLoaded(uint32_t index) override; 43 | 44 | // ------------------------------------------------------------------- 45 | // Widget Callbacks 46 | 47 | void imageButtonClicked(ImageButton* button, int) override; 48 | void imageKnobDragStarted(ImageKnob* knob) override; 49 | void imageKnobDragFinished(ImageKnob* knob) override; 50 | void imageKnobValueChanged(ImageKnob* knob, float value) override; 51 | void imageSliderDragStarted(ImageSlider* slider) override; 52 | void imageSliderDragFinished(ImageSlider* slider) override; 53 | void imageSliderValueChanged(ImageSlider* slider, float value) override; 54 | 55 | void onDisplay() override; 56 | 57 | private: 58 | Image fImgBackground; 59 | ImageAboutWindow fAboutWindow; 60 | 61 | ScopedPointer fButtonAbout; 62 | ScopedPointer fKnobLowMid, fKnobMidHigh; 63 | ScopedPointer fSliderLow, fSliderMid, fSliderHigh, fSliderMaster; 64 | 65 | DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(DistrhoUI3BandSplitter) 66 | }; 67 | 68 | // ----------------------------------------------------------------------- 69 | 70 | END_NAMESPACE_DISTRHO 71 | 72 | #endif // DISTRHO_UI_3BANDSPLITTER_HPP_INCLUDED 73 | -------------------------------------------------------------------------------- /plugins/3BandSplitter/Makefile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Makefile for DISTRHO Plugins # 3 | # ---------------------------- # 4 | # Created by falkTX 5 | # 6 | 7 | # -------------------------------------------------------------- 8 | # Project name, used for binaries 9 | 10 | NAME = 3BandSplitter 11 | 12 | # -------------------------------------------------------------- 13 | # Files to build 14 | 15 | FILES_DSP = \ 16 | DistrhoPlugin3BandSplitter.cpp 17 | 18 | FILES_UI = \ 19 | DistrhoArtwork3BandSplitter.cpp \ 20 | DistrhoUI3BandSplitter.cpp 21 | 22 | # -------------------------------------------------------------- 23 | # Do some magic 24 | 25 | UI_TYPE = generic 26 | SKIP_NATIVE_AUDIO_FALLBACK = true 27 | USE_FILE_BROWSER = false 28 | include ../../dpf/Makefile.plugins.mk 29 | 30 | # -------------------------------------------------------------- 31 | # Enable all possible plugin types 32 | 33 | TARGETS = au clap jack ladspa lv2_sep vst2 vst3 34 | 35 | ifeq ($(HAVE_CAIRO_OR_OPENGL)$(HAVE_LIBLO),truetrue) 36 | TARGETS += dssi 37 | endif 38 | 39 | all: $(TARGETS) 40 | 41 | # -------------------------------------------------------------- 42 | -------------------------------------------------------------------------------- /plugins/3BandSplitter/Screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DISTRHO/Mini-Series/32b46120384ab0371258cd1fc4f287d71d689f33/plugins/3BandSplitter/Screenshot.png -------------------------------------------------------------------------------- /plugins/3BandSplitter/artwork/about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DISTRHO/Mini-Series/32b46120384ab0371258cd1fc4f287d71d689f33/plugins/3BandSplitter/artwork/about.png -------------------------------------------------------------------------------- /plugins/3BandSplitter/artwork/aboutButtonHover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DISTRHO/Mini-Series/32b46120384ab0371258cd1fc4f287d71d689f33/plugins/3BandSplitter/artwork/aboutButtonHover.png -------------------------------------------------------------------------------- /plugins/3BandSplitter/artwork/aboutButtonNormal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DISTRHO/Mini-Series/32b46120384ab0371258cd1fc4f287d71d689f33/plugins/3BandSplitter/artwork/aboutButtonNormal.png -------------------------------------------------------------------------------- /plugins/3BandSplitter/artwork/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DISTRHO/Mini-Series/32b46120384ab0371258cd1fc4f287d71d689f33/plugins/3BandSplitter/artwork/background.png -------------------------------------------------------------------------------- /plugins/3BandSplitter/artwork/knob.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DISTRHO/Mini-Series/32b46120384ab0371258cd1fc4f287d71d689f33/plugins/3BandSplitter/artwork/knob.png -------------------------------------------------------------------------------- /plugins/3BandSplitter/artwork/slider.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DISTRHO/Mini-Series/32b46120384ab0371258cd1fc4f287d71d689f33/plugins/3BandSplitter/artwork/slider.png -------------------------------------------------------------------------------- /plugins/PingPongPan/DistrhoArtworkPingPongPan.hpp: -------------------------------------------------------------------------------- 1 | /* (Auto-generated binary data file). */ 2 | 3 | #ifndef BINARY_DISTRHOARTWORKPINGPONGPAN_HPP 4 | #define BINARY_DISTRHOARTWORKPINGPONGPAN_HPP 5 | 6 | namespace DistrhoArtworkPingPongPan 7 | { 8 | extern const char* aboutData; 9 | const unsigned int aboutDataSize = 172710; 10 | const unsigned int aboutWidth = 303; 11 | const unsigned int aboutHeight = 190; 12 | 13 | extern const char* aboutButtonHoverData; 14 | const unsigned int aboutButtonHoverDataSize = 7600; 15 | const unsigned int aboutButtonHoverWidth = 95; 16 | const unsigned int aboutButtonHoverHeight = 20; 17 | 18 | extern const char* aboutButtonNormalData; 19 | const unsigned int aboutButtonNormalDataSize = 7600; 20 | const unsigned int aboutButtonNormalWidth = 95; 21 | const unsigned int aboutButtonNormalHeight = 20; 22 | 23 | extern const char* backgroundData; 24 | const unsigned int backgroundDataSize = 157080; 25 | const unsigned int backgroundWidth = 308; 26 | const unsigned int backgroundHeight = 170; 27 | 28 | extern const char* knobData; 29 | const unsigned int knobDataSize = 17956; 30 | const unsigned int knobWidth = 67; 31 | const unsigned int knobHeight = 67; 32 | } 33 | 34 | #endif // BINARY_DISTRHOARTWORKPINGPONGPAN_HPP 35 | 36 | -------------------------------------------------------------------------------- /plugins/PingPongPan/DistrhoPluginInfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * DISTRHO PingPongPan Plugin, based on PingPongPan by Michael Gruhn 3 | * Copyright (C) 2012-2024 Filipe Coelho 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Lesser General Public License for more details. 13 | * 14 | * For a full copy of the license see the LICENSE file. 15 | */ 16 | 17 | #ifndef DISTRHO_PLUGIN_INFO_H_INCLUDED 18 | #define DISTRHO_PLUGIN_INFO_H_INCLUDED 19 | 20 | #define DISTRHO_PLUGIN_BRAND "DISTRHO" 21 | #define DISTRHO_PLUGIN_NAME "Ping Pong Pan" 22 | #define DISTRHO_PLUGIN_URI "http://distrho.sf.net/plugins/PingPongPan" 23 | #define DISTRHO_PLUGIN_CLAP_ID "studio.kx.distrho.PingPongPan" 24 | 25 | #define DISTRHO_PLUGIN_BRAND_ID Dstr 26 | #define DISTRHO_PLUGIN_UNIQUE_ID DPPP 27 | 28 | #define DISTRHO_PLUGIN_HAS_UI 1 29 | #define DISTRHO_PLUGIN_IS_RT_SAFE 1 30 | #define DISTRHO_PLUGIN_NUM_INPUTS 2 31 | #define DISTRHO_PLUGIN_NUM_OUTPUTS 2 32 | #define DISTRHO_PLUGIN_WANT_PROGRAMS 1 33 | 34 | #define DISTRHO_PLUGIN_CLAP_FEATURES "audio-effect", "stereo" 35 | #define DISTRHO_PLUGIN_LV2_CATEGORY "lv2:SpatialPlugin" 36 | #define DISTRHO_PLUGIN_VST3_CATEGORIES "Fx|Spatial" 37 | 38 | #define DPF_VST3_DONT_USE_BRAND_ID 39 | 40 | #endif // DISTRHO_PLUGIN_INFO_H_INCLUDED 41 | -------------------------------------------------------------------------------- /plugins/PingPongPan/DistrhoPluginPingPongPan.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * DISTRHO PingPongPan Plugin, based on PingPongPan by Michael Gruhn 3 | * Copyright (C) 2007 Michael Gruhn 4 | * Copyright (C) 2012-2015 Filipe Coelho 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * For a full copy of the license see the LICENSE file. 16 | */ 17 | 18 | #include "DistrhoPluginPingPongPan.hpp" 19 | 20 | #include 21 | 22 | static const float k2PI = 6.283185307f; 23 | 24 | START_NAMESPACE_DISTRHO 25 | 26 | // ----------------------------------------------------------------------- 27 | 28 | DistrhoPluginPingPongPan::DistrhoPluginPingPongPan() 29 | : Plugin(paramCount, 1, 0) // 1 program, 0 states 30 | { 31 | // set default values 32 | loadProgram(0); 33 | 34 | // reset 35 | deactivate(); 36 | } 37 | 38 | // ----------------------------------------------------------------------- 39 | // Init 40 | 41 | void DistrhoPluginPingPongPan::initAudioPort(bool input, uint32_t index, AudioPort& port) 42 | { 43 | port.groupId = kPortGroupStereo; 44 | 45 | Plugin::initAudioPort(input, index, port); 46 | } 47 | 48 | void DistrhoPluginPingPongPan::initParameter(uint32_t index, Parameter& parameter) 49 | { 50 | switch (index) 51 | { 52 | case paramFreq: 53 | parameter.hints = kParameterIsAutomatable; 54 | parameter.name = "Frequency"; 55 | parameter.symbol = "freq"; 56 | parameter.ranges.def = 50.0f; 57 | parameter.ranges.min = 0.0f; 58 | parameter.ranges.max = 100.0f; 59 | break; 60 | 61 | case paramWidth: 62 | parameter.hints = kParameterIsAutomatable; 63 | parameter.name = "Width"; 64 | parameter.symbol = "width"; 65 | parameter.unit = "%"; 66 | parameter.ranges.def = 75.0f; 67 | parameter.ranges.min = 0.0f; 68 | parameter.ranges.max = 100.0f; 69 | break; 70 | } 71 | } 72 | 73 | void DistrhoPluginPingPongPan::initProgramName(uint32_t index, String& programName) 74 | { 75 | if (index != 0) 76 | return; 77 | 78 | programName = "Default"; 79 | } 80 | 81 | // ----------------------------------------------------------------------- 82 | // Internal data 83 | 84 | float DistrhoPluginPingPongPan::getParameterValue(uint32_t index) const 85 | { 86 | switch (index) 87 | { 88 | case paramFreq: 89 | return fFreq; 90 | case paramWidth: 91 | return fWidth; 92 | default: 93 | return 0.0f; 94 | } 95 | } 96 | 97 | void DistrhoPluginPingPongPan::setParameterValue(uint32_t index, float value) 98 | { 99 | if (getSampleRate() <= 0.0) 100 | return; 101 | 102 | switch (index) 103 | { 104 | case paramFreq: 105 | fFreq = value; 106 | waveSpeed = (k2PI * fFreq / 100.0f)/(float)getSampleRate(); 107 | break; 108 | case paramWidth: 109 | fWidth = value; 110 | break; 111 | } 112 | } 113 | 114 | void DistrhoPluginPingPongPan::loadProgram(uint32_t index) 115 | { 116 | if (index != 0) 117 | return; 118 | 119 | // Default values 120 | fFreq = 50.0f; 121 | fWidth = 75.0f; 122 | 123 | // reset filter values 124 | activate(); 125 | } 126 | 127 | // ----------------------------------------------------------------------- 128 | // Process 129 | 130 | void DistrhoPluginPingPongPan::activate() 131 | { 132 | waveSpeed = (k2PI * fFreq / 100.0f)/(float)getSampleRate(); 133 | } 134 | 135 | void DistrhoPluginPingPongPan::deactivate() 136 | { 137 | wavePos = 0.0f; 138 | } 139 | 140 | void DistrhoPluginPingPongPan::run(const float** inputs, float** outputs, uint32_t frames) 141 | { 142 | const float* in1 = inputs[0]; 143 | const float* in2 = inputs[1]; 144 | float* out1 = outputs[0]; 145 | float* out2 = outputs[1]; 146 | 147 | for (uint32_t i=0; i < frames; ++i) 148 | { 149 | pan = std::fmin(std::fmax(std::sin(wavePos) * (fWidth/100.0f), -1.0f), 1.0f); 150 | 151 | if ((wavePos += waveSpeed) >= k2PI) 152 | wavePos -= k2PI; 153 | 154 | out1[i] = in1[i] * (pan > 0.0f ? 1.0f-pan : 1.0f); 155 | out2[i] = in2[i] * (pan < 0.0f ? 1.0f+pan : 1.0f); 156 | } 157 | } 158 | 159 | // ----------------------------------------------------------------------- 160 | 161 | Plugin* createPlugin() 162 | { 163 | return new DistrhoPluginPingPongPan(); 164 | } 165 | 166 | // ----------------------------------------------------------------------- 167 | 168 | END_NAMESPACE_DISTRHO 169 | -------------------------------------------------------------------------------- /plugins/PingPongPan/DistrhoPluginPingPongPan.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * DISTRHO PingPongPan Plugin, based on PingPongPan by Michael Gruhn 3 | * Copyright (C) 2007 Michael Gruhn 4 | * Copyright (C) 2012-2015 Filipe Coelho 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * For a full copy of the license see the LICENSE file. 16 | */ 17 | 18 | #ifndef DISTRHO_PLUGIN_PINGPONGPAN_HPP_INCLUDED 19 | #define DISTRHO_PLUGIN_PINGPONGPAN_HPP_INCLUDED 20 | 21 | #include "DistrhoPlugin.hpp" 22 | 23 | START_NAMESPACE_DISTRHO 24 | 25 | // ----------------------------------------------------------------------- 26 | 27 | class DistrhoPluginPingPongPan : public Plugin 28 | { 29 | public: 30 | enum Parameters 31 | { 32 | paramFreq = 0, 33 | paramWidth, 34 | paramCount 35 | }; 36 | 37 | DistrhoPluginPingPongPan(); 38 | 39 | protected: 40 | // ------------------------------------------------------------------- 41 | // Information 42 | 43 | const char* getLabel() const noexcept override 44 | { 45 | return "PingPongPan"; 46 | } 47 | 48 | const char* getDescription() const override 49 | { 50 | return "Ping Pong Panning."; 51 | } 52 | 53 | const char* getMaker() const noexcept override 54 | { 55 | return "DISTRHO"; 56 | } 57 | 58 | const char* getHomePage() const override 59 | { 60 | return "https://github.com/DISTRHO/Mini-Series"; 61 | } 62 | 63 | const char* getLicense() const noexcept override 64 | { 65 | return "LGPL"; 66 | } 67 | 68 | uint32_t getVersion() const noexcept override 69 | { 70 | return d_version(1, 0, 0); 71 | } 72 | 73 | // ------------------------------------------------------------------- 74 | // Init 75 | 76 | void initAudioPort(bool input, uint32_t index, AudioPort& port) override; 77 | void initParameter(uint32_t index, Parameter& parameter) override; 78 | void initProgramName(uint32_t index, String& programName) override; 79 | 80 | // ------------------------------------------------------------------- 81 | // Internal data 82 | 83 | float getParameterValue(uint32_t index) const override; 84 | void setParameterValue(uint32_t index, float value) override; 85 | void loadProgram(uint32_t index) override; 86 | 87 | // ------------------------------------------------------------------- 88 | // Process 89 | 90 | void activate() override; 91 | void deactivate() override; 92 | void run(const float** inputs, float** outputs, uint32_t frames) override; 93 | 94 | // ------------------------------------------------------------------- 95 | 96 | private: 97 | float fFreq; 98 | float fWidth; 99 | float waveSpeed; 100 | 101 | float pan, wavePos; 102 | 103 | DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(DistrhoPluginPingPongPan) 104 | }; 105 | 106 | // ----------------------------------------------------------------------- 107 | 108 | END_NAMESPACE_DISTRHO 109 | 110 | #endif // DISTRHO_PLUGIN_PINGPONGPAN_HPP_INCLUDED 111 | -------------------------------------------------------------------------------- /plugins/PingPongPan/DistrhoUIPingPongPan.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * DISTRHO PingPongPan Plugin, based on PingPongPan by Michael Gruhn 3 | * Copyright (C) 2012-2021 Filipe Coelho 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Lesser General Public License for more details. 13 | * 14 | * For a full copy of the license see the LICENSE file. 15 | */ 16 | 17 | #include "DistrhoPluginPingPongPan.hpp" 18 | #include "DistrhoUIPingPongPan.hpp" 19 | 20 | START_NAMESPACE_DISTRHO 21 | 22 | namespace Art = DistrhoArtworkPingPongPan; 23 | 24 | // ----------------------------------------------------------------------- 25 | 26 | DistrhoUIPingPongPan::DistrhoUIPingPongPan() 27 | : UI(Art::backgroundWidth, Art::backgroundHeight, true), 28 | fImgBackground(Art::backgroundData, Art::backgroundWidth, Art::backgroundHeight, kImageFormatBGR), 29 | fAboutWindow(this) 30 | { 31 | // about 32 | Image imageAbout(Art::aboutData, Art::aboutWidth, Art::aboutHeight, kImageFormatBGR); 33 | fAboutWindow.setImage(imageAbout); 34 | 35 | // knobs 36 | Image knobImage(Art::knobData, Art::knobWidth, Art::knobHeight, kImageFormatBGRA); 37 | 38 | // knob Low-Mid 39 | fKnobFreq = new ImageKnob(this, knobImage, ImageKnob::Vertical); 40 | fKnobFreq->setId(DistrhoPluginPingPongPan::paramFreq); 41 | fKnobFreq->setAbsolutePos(60, 58); 42 | fKnobFreq->setRange(0.0f, 100.0f); 43 | fKnobFreq->setDefault(50.0f); 44 | fKnobFreq->setRotationAngle(270); 45 | fKnobFreq->setCallback(this); 46 | 47 | // knob Mid-High 48 | fKnobWidth = new ImageKnob(this, knobImage, ImageKnob::Vertical); 49 | fKnobWidth->setId(DistrhoPluginPingPongPan::paramWidth); 50 | fKnobWidth->setAbsolutePos(182, 58); 51 | fKnobWidth->setRange(0.0f, 100.0f); 52 | fKnobWidth->setDefault(75.0f); 53 | fKnobWidth->setRotationAngle(270); 54 | fKnobWidth->setCallback(this); 55 | 56 | // about button 57 | Image aboutImageNormal(Art::aboutButtonNormalData, Art::aboutButtonNormalWidth, Art::aboutButtonNormalHeight, kImageFormatBGRA); 58 | Image aboutImageHover(Art::aboutButtonHoverData, Art::aboutButtonHoverWidth, Art::aboutButtonHoverHeight, kImageFormatBGRA); 59 | fButtonAbout = new ImageButton(this, aboutImageNormal, aboutImageHover, aboutImageHover); 60 | fButtonAbout->setAbsolutePos(183, 8); 61 | fButtonAbout->setCallback(this); 62 | 63 | // set default values 64 | programLoaded(0); 65 | } 66 | 67 | // ----------------------------------------------------------------------- 68 | // DSP Callbacks 69 | 70 | void DistrhoUIPingPongPan::parameterChanged(uint32_t index, float value) 71 | { 72 | switch (index) 73 | { 74 | case DistrhoPluginPingPongPan::paramFreq: 75 | fKnobFreq->setValue(value); 76 | break; 77 | case DistrhoPluginPingPongPan::paramWidth: 78 | fKnobWidth->setValue(value); 79 | break; 80 | } 81 | } 82 | 83 | void DistrhoUIPingPongPan::programLoaded(uint32_t index) 84 | { 85 | if (index != 0) 86 | return; 87 | 88 | // Default values 89 | fKnobFreq->setValue(50.0f); 90 | fKnobWidth->setValue(75.0f); 91 | } 92 | 93 | // ----------------------------------------------------------------------- 94 | // Widget Callbacks 95 | 96 | void DistrhoUIPingPongPan::imageButtonClicked(ImageButton* button, int) 97 | { 98 | if (button != fButtonAbout) 99 | return; 100 | 101 | fAboutWindow.runAsModal(); 102 | } 103 | 104 | void DistrhoUIPingPongPan::imageKnobDragStarted(ImageKnob* knob) 105 | { 106 | editParameter(knob->getId(), true); 107 | } 108 | 109 | void DistrhoUIPingPongPan::imageKnobDragFinished(ImageKnob* knob) 110 | { 111 | editParameter(knob->getId(), false); 112 | } 113 | 114 | void DistrhoUIPingPongPan::imageKnobValueChanged(ImageKnob* knob, float value) 115 | { 116 | setParameterValue(knob->getId(), value); 117 | } 118 | 119 | void DistrhoUIPingPongPan::onDisplay() 120 | { 121 | const GraphicsContext& context(getGraphicsContext()); 122 | 123 | fImgBackground.draw(context); 124 | } 125 | 126 | // ----------------------------------------------------------------------- 127 | 128 | UI* createUI() 129 | { 130 | return new DistrhoUIPingPongPan(); 131 | } 132 | 133 | // ----------------------------------------------------------------------- 134 | 135 | END_NAMESPACE_DISTRHO 136 | -------------------------------------------------------------------------------- /plugins/PingPongPan/DistrhoUIPingPongPan.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * DISTRHO PingPongPan Plugin, based on PingPongPan by Michael Gruhn 3 | * Copyright (C) 2012-2015 Filipe Coelho 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Lesser General Public License for more details. 13 | * 14 | * For a full copy of the license see the LICENSE file. 15 | */ 16 | 17 | #ifndef DISTRHO_UI_PINGPONGPAN_HPP_INCLUDED 18 | #define DISTRHO_UI_PINGPONGPAN_HPP_INCLUDED 19 | 20 | #include "DistrhoUI.hpp" 21 | #include "ImageWidgets.hpp" 22 | 23 | #include "DistrhoArtworkPingPongPan.hpp" 24 | 25 | START_NAMESPACE_DISTRHO 26 | 27 | // ----------------------------------------------------------------------- 28 | 29 | class DistrhoUIPingPongPan : public UI, 30 | public ImageButton::Callback, 31 | public ImageKnob::Callback 32 | { 33 | public: 34 | DistrhoUIPingPongPan(); 35 | 36 | protected: 37 | // ------------------------------------------------------------------- 38 | // DSP Callbacks 39 | 40 | void parameterChanged(uint32_t index, float value) override; 41 | void programLoaded(uint32_t index) override; 42 | 43 | // ------------------------------------------------------------------- 44 | // Widget Callbacks 45 | 46 | void imageButtonClicked(ImageButton* button, int) override; 47 | void imageKnobDragStarted(ImageKnob* knob) override; 48 | void imageKnobDragFinished(ImageKnob* knob) override; 49 | void imageKnobValueChanged(ImageKnob* knob, float value) override; 50 | 51 | void onDisplay() override; 52 | 53 | private: 54 | Image fImgBackground; 55 | ImageAboutWindow fAboutWindow; 56 | 57 | ScopedPointer fButtonAbout; 58 | ScopedPointer fKnobFreq, fKnobWidth; 59 | 60 | DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(DistrhoUIPingPongPan) 61 | }; 62 | 63 | // ----------------------------------------------------------------------- 64 | 65 | END_NAMESPACE_DISTRHO 66 | 67 | #endif // DISTRHO_UI_PINGPONGPAN_HPP_INCLUDED 68 | -------------------------------------------------------------------------------- /plugins/PingPongPan/Makefile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Makefile for DISTRHO Plugins # 3 | # ---------------------------- # 4 | # Created by falkTX 5 | # 6 | 7 | # -------------------------------------------------------------- 8 | # Project name, used for binaries 9 | 10 | NAME = PingPongPan 11 | 12 | # -------------------------------------------------------------- 13 | # Files to build 14 | 15 | FILES_DSP = \ 16 | DistrhoPluginPingPongPan.cpp 17 | 18 | FILES_UI = \ 19 | DistrhoArtworkPingPongPan.cpp \ 20 | DistrhoUIPingPongPan.cpp 21 | 22 | # -------------------------------------------------------------- 23 | # Do some magic 24 | 25 | UI_TYPE = generic 26 | SKIP_NATIVE_AUDIO_FALLBACK = true 27 | USE_FILE_BROWSER = false 28 | include ../../dpf/Makefile.plugins.mk 29 | 30 | # -------------------------------------------------------------- 31 | # Enable all possible plugin types 32 | 33 | TARGETS = au clap jack ladspa lv2_sep vst2 vst3 34 | 35 | ifeq ($(HAVE_CAIRO_OR_OPENGL)$(HAVE_LIBLO),truetrue) 36 | TARGETS += dssi 37 | endif 38 | 39 | all: $(TARGETS) 40 | 41 | # -------------------------------------------------------------- 42 | -------------------------------------------------------------------------------- /plugins/PingPongPan/Screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DISTRHO/Mini-Series/32b46120384ab0371258cd1fc4f287d71d689f33/plugins/PingPongPan/Screenshot.png -------------------------------------------------------------------------------- /plugins/PingPongPan/artwork/about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DISTRHO/Mini-Series/32b46120384ab0371258cd1fc4f287d71d689f33/plugins/PingPongPan/artwork/about.png -------------------------------------------------------------------------------- /plugins/PingPongPan/artwork/aboutButtonHover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DISTRHO/Mini-Series/32b46120384ab0371258cd1fc4f287d71d689f33/plugins/PingPongPan/artwork/aboutButtonHover.png -------------------------------------------------------------------------------- /plugins/PingPongPan/artwork/aboutButtonNormal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DISTRHO/Mini-Series/32b46120384ab0371258cd1fc4f287d71d689f33/plugins/PingPongPan/artwork/aboutButtonNormal.png -------------------------------------------------------------------------------- /plugins/PingPongPan/artwork/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DISTRHO/Mini-Series/32b46120384ab0371258cd1fc4f287d71d689f33/plugins/PingPongPan/artwork/background.png -------------------------------------------------------------------------------- /plugins/PingPongPan/artwork/knob.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DISTRHO/Mini-Series/32b46120384ab0371258cd1fc4f287d71d689f33/plugins/PingPongPan/artwork/knob.png --------------------------------------------------------------------------------