1 /* 2 * Copyright (C) 2020 Linux Studio Plugins Project <https://lsp-plug.in/> 3 * (C) 2020 Vladimir Sadovnikov <sadko4u@gmail.com> 4 * 5 * This file is part of lsp-plugins 6 * Created on: 13 фев. 2017 г. 7 * 8 * lsp-plugins is free software: you can redistribute it and/or modify 9 * it under the terms of the GNU Lesser General Public License as published by 10 * the Free Software Foundation, either version 3 of the License, or 11 * any later version. 12 * 13 * lsp-plugins is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU Lesser General Public License for more details. 17 * 18 * You should have received a copy of the GNU Lesser General Public License 19 * along with lsp-plugins. If not, see <https://www.gnu.org/licenses/>. 20 */ 21 22 #include <metadata/plugins.h> 23 #include <metadata/ports.h> 24 #include <metadata/developers.h> 25 26 namespace lsp 27 { 28 //------------------------------------------------------------------------- 29 // Impulse reverb 30 31 static const port_item_t ir_files[] = 32 { 33 { "None", "file.none" }, 34 { "File 1", "file.f1" }, 35 { "File 2", "file.f2" }, 36 { "File 3", "file.f3" }, 37 { "File 4", "file.f4" }, 38 { NULL, NULL } 39 }; 40 41 static const port_item_t ir_tracks[] = 42 { 43 { "Track 1", "file.t1" }, 44 { "Track 2", "file.t2" }, 45 { "Track 3", "file.t3" }, 46 { "Track 4", "file.t4" }, 47 { "Track 5", "file.t5" }, 48 { "Track 6", "file.t6" }, 49 { "Track 7", "file.t7" }, 50 { "Track 8", "file.t8" }, 51 { NULL, NULL } 52 }; 53 54 static const port_item_t ir_fft_rank[] = 55 { 56 { "512", NULL }, 57 { "1024", NULL }, 58 { "2048", NULL }, 59 { "4096", NULL }, 60 { "8192", NULL }, 61 { "16384", NULL }, 62 { "32768", NULL }, 63 { "65536", NULL }, 64 { NULL, NULL } 65 }; 66 67 static const port_item_t ir_file_select[] = 68 { 69 { "File 1", "file.f1" }, 70 { "File 2", "file.f2" }, 71 { "File 3", "file.f3" }, 72 { "File 4", "file.f4" }, 73 { NULL, NULL } 74 }; 75 76 static const port_item_t filter_slope[] = 77 { 78 { "off", "eq.slope.off" }, 79 { "12 dB/oct", "eq.slope.12dbo" }, 80 { "24 dB/oct", "eq.slope.24dbo" }, 81 { "36 dB/oct", "eq.slope.36dbo" }, 82 { NULL, NULL } 83 }; 84 85 #define IR_PAN_MONO \ 86 PAN_CTL("p", "Panorama", 0.0f) 87 88 #define IR_PAN_STEREO \ 89 PAN_CTL("pl", "Left channel panorama", -100.0f), \ 90 PAN_CTL("pr", "Right channel panorama", 100.0f) 91 92 #define IR_COMMON(pan) \ 93 BYPASS, \ 94 COMBO("fsel", "File selector", 0, ir_file_select), \ 95 COMBO("fft", "FFT size", impulse_reverb_base_metadata::FFT_RANK_DEFAULT, ir_fft_rank), \ 96 CONTROL("pd", "Pre-delay", U_MSEC, impulse_reverb_base_metadata::PREDELAY), \ 97 pan, \ 98 DRY_GAIN(1.0f), \ 99 WET_GAIN(1.0f), \ 100 OUT_GAIN 101 102 #define IR_SAMPLE_FILE(id, label) \ 103 PATH("ifn" id, "Impulse file" label), \ 104 CONTROL("ihc" id, "Head cut" label, U_MSEC, impulse_reverb_base_metadata::CONV_LENGTH), \ 105 CONTROL("itc" id, "Tail cut" label, U_MSEC, impulse_reverb_base_metadata::CONV_LENGTH), \ 106 CONTROL("ifi" id, "Fade in" label, U_MSEC, impulse_reverb_base_metadata::CONV_LENGTH), \ 107 CONTROL("ifo" id, "Fade out" label, U_MSEC, impulse_reverb_base_metadata::CONV_LENGTH), \ 108 TRIGGER("ils" id, "Impulse listen" label), \ 109 SWITCH("irv" id, "Impulse reverse" label, 0.0f), \ 110 STATUS("ifs" id, "Load status" label), \ 111 METER("ifl" id, "Impulse length" label, U_MSEC, impulse_reverb_base_metadata::CONV_LENGTH), \ 112 MESH("ifd" id, "Impulse file contents" label, impulse_reverb_base_metadata::TRACKS_MAX, impulse_reverb_base_metadata::MESH_SIZE) 113 114 #define IR_CONVOLVER_MONO(id, label, track, mix) \ 115 COMBO("csf" id, "Channel source file" label, 0, ir_files), \ 116 COMBO("cst" id, "Channel source track" label, track, ir_tracks), \ 117 AMP_GAIN100("mk" id, "Makeup gain" label, 1.0f), \ 118 SWITCH("cam" id, "Channel mute" label, 0.0f), \ 119 BLINK("ca" id, "Channel activity" label), \ 120 CONTROL("pd" id, "Channel pre-delay" label, U_MSEC, impulse_reverb_base_metadata::PREDELAY), \ 121 PAN_CTL("com" id, "Channel Left/Right output mix" label, mix) 122 123 #define IR_CONVOLVER_STEREO(id, label, track, in_mix, out_mix) \ 124 PAN_CTL("cim" id, "Left/Right input mix" label, in_mix), \ 125 IR_CONVOLVER_MONO(id, label, track, out_mix) 126 127 #define IR_EQ_BAND(id, freq) \ 128 CONTROL("eq_" #id, "Band " freq "Hz gain", U_GAIN_AMP, impulse_reverb_base_metadata::BA) 129 130 #define IR_EQUALIZER \ 131 SWITCH("wpp", "Wet post-process", 0), \ 132 SWITCH("eqv", "Equalizer visibility", 0), \ 133 COMBO("lcm", "Low-cut mode", 0, filter_slope), \ 134 CONTROL("lcf", "Low-cut frequency", U_HZ, impulse_reverb_base_metadata::LCF), \ 135 IR_EQ_BAND(0, "50"), \ 136 IR_EQ_BAND(1, "107"), \ 137 IR_EQ_BAND(2, "227"), \ 138 IR_EQ_BAND(3, "484"), \ 139 IR_EQ_BAND(4, "1 k"), \ 140 IR_EQ_BAND(5, "2.2 k"), \ 141 IR_EQ_BAND(6, "4.7 k"), \ 142 IR_EQ_BAND(7, "10 k"), \ 143 COMBO("hcm", "High-cut mode", 0, filter_slope), \ 144 CONTROL("hcf", "High-cut frequency", U_HZ, impulse_reverb_base_metadata::HCF) 145 146 static const port_t impulse_reverb_mono_ports[] = 147 { 148 // Input audio ports 149 AUDIO_INPUT_MONO, 150 AUDIO_OUTPUT_LEFT, 151 AUDIO_OUTPUT_RIGHT, 152 IR_COMMON(IR_PAN_MONO), 153 154 // Input controls 155 IR_SAMPLE_FILE("0", " 0"), 156 IR_SAMPLE_FILE("1", " 1"), 157 IR_SAMPLE_FILE("2", " 2"), 158 IR_SAMPLE_FILE("3", " 3"), 159 IR_CONVOLVER_MONO("0", " 0", 0, -100.0f), 160 IR_CONVOLVER_MONO("1", " 1", 1, +100.0f), 161 IR_CONVOLVER_MONO("2", " 2", 0, -100.0f), 162 IR_CONVOLVER_MONO("3", " 3", 1, +100.0f), 163 164 // Impulse response equalizer 165 IR_EQUALIZER, 166 167 PORTS_END 168 }; 169 170 static const port_t impulse_reverb_stereo_ports[] = 171 { 172 // Input audio ports 173 PORTS_STEREO_PLUGIN, 174 IR_COMMON(IR_PAN_STEREO), 175 176 // Input controls 177 IR_SAMPLE_FILE("0", " 0"), 178 IR_SAMPLE_FILE("1", " 1"), 179 IR_SAMPLE_FILE("2", " 2"), 180 IR_SAMPLE_FILE("3", " 3"), 181 IR_CONVOLVER_STEREO("0", " 0", 0, -100.0f, -100.0f), 182 IR_CONVOLVER_STEREO("1", " 1", 1, -100.0f, +100.0f), 183 IR_CONVOLVER_STEREO("2", " 2", 2, +100.0f, -100.0f), 184 IR_CONVOLVER_STEREO("3", " 3", 3, +100.0f, +100.0f), 185 186 // Impulse response equalizer 187 IR_EQUALIZER, 188 189 PORTS_END 190 }; 191 192 static const int impulse_reverb_classes[] = { C_REVERB, -1 }; 193 194 const plugin_metadata_t impulse_reverb_mono_metadata::metadata = 195 { 196 "Impulsnachhall Mono", 197 "Impulse Reverb Mono", 198 "INH1M", 199 &developers::v_sadovnikov, 200 "impulse_reverb_mono", 201 "fggq", 202 0, 203 LSP_VERSION(1, 0, 1), 204 impulse_reverb_classes, 205 E_NONE, 206 impulse_reverb_mono_ports, 207 "convolution/impulse_reverb/mono.xml", 208 NULL, 209 mono_to_stereo_plugin_port_groups 210 }; 211 212 const plugin_metadata_t impulse_reverb_stereo_metadata::metadata = 213 { 214 "Impulsnachhall Stereo", 215 "Impulse Reverb Stereo", 216 "INH1S", 217 &developers::v_sadovnikov, 218 "impulse_reverb_stereo", 219 "o9zj", 220 0, 221 LSP_VERSION(1, 0, 1), 222 impulse_reverb_classes, 223 E_NONE, 224 impulse_reverb_stereo_ports, 225 "convolution/impulse_reverb/stereo.xml", 226 NULL, 227 stereo_plugin_port_groups 228 }; 229 } 230 231 232 233