| 1 |
/* |
| 2 |
* Dragonfly Reverb, copyright (c) 2019 Michael Willis, Rob van den Berg |
| 3 |
* |
| 4 |
* This program is free software; you can redistribute it and/or |
| 5 |
* modify it under the terms of the GNU General Public License as |
| 6 |
* published by the Free Software Foundation; either version 3 of |
| 7 |
* the License, or any later version. |
| 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 General Public License for more details. |
| 13 |
* |
| 14 |
* For a full copy of the GNU General Public License see the LICENSE file. |
| 15 |
*/ |
| 16 |
|
| 17 |
#include <cstdint> |
| 18 |
#include <Param.hpp> |
| 19 |
|
| 20 |
#ifndef DISTRHO_PLUGIN_INFO_H_INCLUDED |
| 21 |
#define DISTRHO_PLUGIN_INFO_H_INCLUDED |
| 22 |
|
| 23 |
#define DISTRHO_PLUGIN_BRAND "Dragonfly" |
| 24 |
#define DISTRHO_PLUGIN_NAME "Dragonfly Plate Reverb" |
| 25 |
#define DISTRHO_PLUGIN_URI "urn:dragonfly:plate" |
| 26 |
#define DISTRHO_PLUGIN_CLAP_ID "michaelwillis.dragonfly.plate" |
| 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_STATE 1 |
| 33 |
|
| 34 |
#define DISTRHO_PLUGIN_LV2_CATEGORY "lv2:ReverbPlugin" |
| 35 |
#define DISTRHO_PLUGIN_VST3_CATEGORIES "Fx|Reverb|Stereo" |
| 36 |
#define DISTRHO_PLUGIN_CLAP_FEATURES "audio-effect", "reverb", "stereo" |
| 37 |
|
| 38 |
#include "Artwork.hpp" |
| 39 |
|
| 40 |
#define DISTRHO_UI_DEFAULT_WIDTH Artwork::backgroundWidth |
| 41 |
#define DISTRHO_UI_DEFAULT_HEIGHT Artwork::backgroundHeight |
| 42 |
|
| 43 |
enum Algorithms { |
| 44 |
ALGORITHM_NREV = 0, |
| 45 |
ALGORITHM_NREV_B, |
| 46 |
ALGORITHM_STREV, |
| 47 |
ALGORITHM_COUNT |
| 48 |
}; |
| 49 |
|
| 50 |
static const char *algorithmNames[ALGORITHM_COUNT] = { |
| 51 |
"Simple", |
| 52 |
"Nested", |
| 53 |
"Tank" |
| 54 |
}; |
| 55 |
|
| 56 |
enum Parameters |
| 57 |
{ |
| 58 |
paramDry = 0, |
| 59 |
paramWet, |
| 60 |
|
| 61 |
paramAlgorithm, |
| 62 |
|
| 63 |
paramWidth, |
| 64 |
paramPredelay, |
| 65 |
paramDecay, |
| 66 |
|
| 67 |
paramLowCut, |
| 68 |
paramHighCut, |
| 69 |
paramDamp, |
| 70 |
|
| 71 |
paramCount |
| 72 |
}; |
| 73 |
|
| 74 |
static const Param PARAMS[paramCount] = { |
| 75 |
{paramDry, "Dry Level", "dry_level", 0.0f, 100.0f, "%"}, |
| 76 |
{paramWet, "Wet Level", "early_level", 0.0f, 100.0f, "%"}, |
| 77 |
{paramAlgorithm, "Algorithm", "algorithm", 0.0f, 2.0f, ""}, |
| 78 |
{paramWidth, "Width", "width", 50.0f, 150.0f, "%"}, |
| 79 |
{paramPredelay, "Predelay", "predelay", 0.0f, 100.0f, "ms"}, |
| 80 |
{paramDecay, "Decay", "decay", 0.1f, 10.0f, "s"}, |
| 81 |
{paramLowCut, "Low Cut", "low_cut", 0.0f, 200.0f, "Hz"}, |
| 82 |
{paramHighCut, "High Cut", "high_cut", 1000.0f, 16000.0f, "Hz"}, |
| 83 |
{paramDamp, "Dampen", "early_damp", 1000.0f, 16000.0f, "Hz"} |
| 84 |
}; |
| 85 |
|
| 86 |
static const int NUM_PRESETS = 8; |
| 87 |
|
| 88 |
typedef struct { |
| 89 |
const char *name; |
| 90 |
const float params[paramCount]; |
| 91 |
} Preset; |
| 92 |
|
| 93 |
static const Preset presets[NUM_PRESETS] = { |
| 94 |
// dry, wet, algorithm, width, delay, decay, low cut, high cut, damp |
| 95 |
{"Abrupt Plate", { 80.0, 20.0, ALGORITHM_NREV_B, 100, 20.0, 0.2, 50, 10000, 7000 } }, |
| 96 |
{"Bright Plate", { 80.0, 20.0, ALGORITHM_NREV_B, 100, 0.0, 0.4, 200, 16000, 13000 } }, |
| 97 |
{"Clear Plate", { 80.0, 20.0, ALGORITHM_NREV_B, 100, 0.0, 0.6, 100, 13000, 7000 } }, |
| 98 |
{"Dark Plate", { 80.0, 20.0, ALGORITHM_NREV_B, 100, 0.0, 0.8, 50, 7000, 4000 } }, |
| 99 |
{"Foil Tray", { 80.0, 20.0, ALGORITHM_NREV, 50, 0.0, 0.3, 200, 16000, 13000 } }, |
| 100 |
{"Metal Roof", { 80.0, 20.0, ALGORITHM_NREV, 120, 20.0, 0.5, 100, 13000, 10000 } }, |
| 101 |
{"Narrow Tank", { 80.0, 20.0, ALGORITHM_STREV, 60, 10.0, 0.6, 50, 10000, 7000 } }, |
| 102 |
{"Phat Tank", { 80.0, 20.0, ALGORITHM_STREV, 150, 10.0, 1.0, 50, 10000, 4000 } } |
| 103 |
}; |
| 104 |
|
| 105 |
static const int DEFAULT_PRESET = 1; |
| 106 |
|
| 107 |
|
| 108 |
#endif // DISTRHO_PLUGIN_INFO_H_INCLUDED |