Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

zynaddsubfx-fx.cpp 45KB

11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
9 years ago
10 years ago
9 years ago
10 years ago
9 years ago
10 years ago
9 years ago
10 years ago
9 years ago
10 years ago
9 years ago
10 years ago
9 years ago
10 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502
  1. /*
  2. * Carla Native Plugins
  3. * Copyright (C) 2012-2017 Filipe Coelho <falktx@falktx.com>
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License as
  7. * published by the Free Software Foundation; either version 2 of
  8. * the License, or any later version.
  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 General Public License for more details.
  14. *
  15. * For a full copy of the GNU General Public License see the doc/GPL.txt file.
  16. */
  17. #include "CarlaNative.hpp"
  18. #include "CarlaMathUtils.hpp"
  19. #if defined(__clang__)
  20. # pragma clang diagnostic push
  21. # pragma clang diagnostic ignored "-Weffc++"
  22. #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
  23. # pragma GCC diagnostic push
  24. # pragma GCC diagnostic ignored "-Weffc++"
  25. # pragma GCC diagnostic ignored "-Wconversion"
  26. # pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
  27. # pragma GCC diagnostic ignored "-Wsign-conversion"
  28. # pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
  29. #endif
  30. #include "Misc/Allocator.h"
  31. #include "Effects/Alienwah.h"
  32. #include "Effects/Chorus.h"
  33. #include "Effects/Distorsion.h"
  34. #include "Effects/DynamicFilter.h"
  35. #include "Effects/Echo.h"
  36. #include "Effects/Phaser.h"
  37. #include "Effects/Reverb.h"
  38. #if defined(__clang__)
  39. # pragma clang diagnostic pop
  40. #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
  41. # pragma GCC diagnostic pop
  42. #endif
  43. #include "water/maths/MathsFunctions.h"
  44. using water::roundToIntAccurate;
  45. using namespace zyncarla;
  46. // -----------------------------------------------------------------------
  47. template<class ZynFX>
  48. class FxAbstractPlugin : public NativePluginClass
  49. {
  50. protected:
  51. FxAbstractPlugin(const NativeHostDescriptor* const host, const uint32_t paramCount, const uint32_t programCount)
  52. : NativePluginClass(host),
  53. fParamCount(paramCount-2), // volume and pan handled by host
  54. fProgramCount(programCount),
  55. fParamValues(new uchar[paramCount]),
  56. fParamsChanged(new bool[paramCount]),
  57. fNextProgram(-1),
  58. fBufferSize(getBufferSize()),
  59. fSampleRate(getSampleRate()),
  60. fFilterParams(nullptr),
  61. fEffect(nullptr),
  62. efxoutl(nullptr),
  63. efxoutr(nullptr),
  64. fAllocator()
  65. {
  66. efxoutl = new float[fBufferSize];
  67. efxoutr = new float[fBufferSize];
  68. carla_zeroFloats(efxoutl, fBufferSize);
  69. carla_zeroFloats(efxoutr, fBufferSize);
  70. std::memset(fParamsChanged, 0, sizeof(bool)*fParamCount);
  71. doReinit(true);
  72. }
  73. ~FxAbstractPlugin() override
  74. {
  75. if (efxoutl != nullptr)
  76. {
  77. delete[] efxoutl;
  78. efxoutl = nullptr;
  79. }
  80. if (efxoutr != nullptr)
  81. {
  82. delete[] efxoutr;
  83. efxoutr = nullptr;
  84. }
  85. if (fEffect != nullptr)
  86. {
  87. delete fEffect;
  88. fEffect = nullptr;
  89. }
  90. }
  91. // -------------------------------------------------------------------
  92. // Plugin parameter calls
  93. uint32_t getParameterCount() const final
  94. {
  95. return fParamCount;
  96. }
  97. float getParameterValue(const uint32_t index) const final
  98. {
  99. return static_cast<float>(fEffect->getpar(static_cast<int>(index+2)));
  100. }
  101. // -------------------------------------------------------------------
  102. // Plugin midi-program calls
  103. uint32_t getMidiProgramCount() const final
  104. {
  105. return fProgramCount;
  106. }
  107. // -------------------------------------------------------------------
  108. // Plugin state calls
  109. void setParameterValue(const uint32_t index, const float value) final
  110. {
  111. const int ivalue(roundToIntAccurate(carla_fixedValue(0.0f, 127.0f, value)));
  112. fParamValues[index] = static_cast<uchar>(ivalue);
  113. fParamsChanged[index] = true;
  114. }
  115. void setMidiProgram(const uint8_t, const uint32_t, const uint32_t program) final
  116. {
  117. fNextProgram = static_cast<int32_t>(program);
  118. }
  119. // -------------------------------------------------------------------
  120. // Plugin process calls
  121. void activate() final
  122. {
  123. fEffect->cleanup();
  124. }
  125. void process(float** const inBuffer, float** const outBuffer, const uint32_t frames, const NativeMidiEvent* const, const uint32_t) final
  126. {
  127. if (outBuffer[0] != inBuffer[0])
  128. carla_copyWithMultiply(outBuffer[0], inBuffer[0], 0.5f, frames);
  129. else
  130. carla_multiply(outBuffer[0], 0.5f, frames);
  131. if (outBuffer[1] != inBuffer[1])
  132. carla_copyWithMultiply(outBuffer[1], inBuffer[1], 0.5f, frames);
  133. else
  134. carla_multiply(outBuffer[1], 0.5f, frames);
  135. const int32_t nextProgram = fNextProgram;
  136. fNextProgram = -1;
  137. if (nextProgram >= 0)
  138. {
  139. fEffect->setpreset(static_cast<uchar>(nextProgram));
  140. // reset volume and pan
  141. fEffect->changepar(0, 127);
  142. fEffect->changepar(1, 64);
  143. // ignore next
  144. std::memset(fParamsChanged, 0, sizeof(bool)*fParamCount);
  145. }
  146. else
  147. {
  148. for (int i=0, count=static_cast<int>(fParamCount); i<count; ++i)
  149. {
  150. if (! fParamsChanged[i])
  151. continue;
  152. fEffect->changepar(i+2, fParamValues[i]);
  153. fParamsChanged[i] = false;
  154. }
  155. }
  156. fEffect->out(Stereo<float*>(inBuffer[0], inBuffer[1]));
  157. carla_addWithMultiply(outBuffer[0], efxoutl, 0.5f, frames);
  158. carla_addWithMultiply(outBuffer[1], efxoutr, 0.5f, frames);
  159. }
  160. // -------------------------------------------------------------------
  161. // Plugin dispatcher
  162. void bufferSizeChanged(const uint32_t bufferSize) final
  163. {
  164. if (fBufferSize == bufferSize)
  165. return;
  166. fBufferSize = bufferSize;
  167. delete[] efxoutl;
  168. delete[] efxoutr;
  169. efxoutl = new float[bufferSize];
  170. efxoutr = new float[bufferSize];
  171. carla_zeroFloats(efxoutl, bufferSize);
  172. carla_zeroFloats(efxoutr, bufferSize);
  173. doReinit(false);
  174. }
  175. void sampleRateChanged(const double sampleRate) final
  176. {
  177. if (carla_isEqual(fSampleRate, sampleRate))
  178. return;
  179. fSampleRate = sampleRate;
  180. doReinit(false);
  181. }
  182. void doReinit(const bool firstInit)
  183. {
  184. uchar params[fParamCount];
  185. if (fEffect != nullptr)
  186. {
  187. for (int i=0, count=static_cast<int>(fParamCount); i<count; ++i)
  188. params[i] = fEffect->getpar(i+2);
  189. delete fEffect;
  190. }
  191. EffectParams pars(fAllocator, false, efxoutl, efxoutr, 0,
  192. static_cast<uint>(fSampleRate), static_cast<int>(fBufferSize), &fFilterParams);
  193. fEffect = new ZynFX(pars);
  194. if (firstInit)
  195. {
  196. fEffect->setpreset(0);
  197. for (int i=0, count=static_cast<int>(fParamCount); i<count; ++i)
  198. fParamValues[i] = fEffect->getpar(i+2);
  199. }
  200. else
  201. {
  202. for (int i=0, count=static_cast<int>(fParamCount); i<count; ++i)
  203. fEffect->changepar(i+2, params[i]);
  204. }
  205. // reset volume and pan
  206. fEffect->changepar(0, 127);
  207. fEffect->changepar(1, 64);
  208. }
  209. // -------------------------------------------------------------------
  210. const uint32_t fParamCount;
  211. const uint32_t fProgramCount;
  212. uchar* const fParamValues;
  213. bool* const fParamsChanged;
  214. int32_t fNextProgram;
  215. uint32_t fBufferSize;
  216. double fSampleRate;
  217. FilterParams fFilterParams;
  218. Effect* fEffect;
  219. float* efxoutl;
  220. float* efxoutr;
  221. AllocatorClass fAllocator;
  222. CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(FxAbstractPlugin)
  223. };
  224. // -----------------------------------------------------------------------
  225. class FxAlienWahPlugin : public FxAbstractPlugin<Alienwah>
  226. {
  227. public:
  228. FxAlienWahPlugin(const NativeHostDescriptor* const host)
  229. : FxAbstractPlugin(host, 11, 4) {}
  230. protected:
  231. // -------------------------------------------------------------------
  232. // Plugin parameter calls
  233. const NativeParameter* getParameterInfo(const uint32_t index) const override
  234. {
  235. if (index >= fParamCount)
  236. return nullptr;
  237. static NativeParameter param;
  238. static NativeParameterScalePoint scalePoints[2];
  239. int hints = NATIVE_PARAMETER_IS_ENABLED|NATIVE_PARAMETER_IS_INTEGER;
  240. param.name = nullptr;
  241. param.unit = nullptr;
  242. param.ranges.def = 1.0f;
  243. param.ranges.min = 0.0f;
  244. param.ranges.max = 127.0f;
  245. param.ranges.step = 1.0f;
  246. param.ranges.stepSmall = 1.0f;
  247. param.ranges.stepLarge = 20.0f;
  248. param.scalePointCount = 0;
  249. param.scalePoints = nullptr;
  250. switch (index)
  251. {
  252. case 0:
  253. hints |= NATIVE_PARAMETER_IS_AUTOMABLE;
  254. param.name = "LFO Frequency";
  255. param.ranges.def = 70.0f;
  256. break;
  257. case 1:
  258. hints |= NATIVE_PARAMETER_IS_AUTOMABLE;
  259. param.name = "LFO Randomness";
  260. param.ranges.def = 0.0f;
  261. break;
  262. case 2:
  263. hints |= NATIVE_PARAMETER_IS_AUTOMABLE|NATIVE_PARAMETER_IS_BOOLEAN|NATIVE_PARAMETER_USES_SCALEPOINTS;
  264. param.name = "LFO Type";
  265. param.ranges.def = 0.0f;
  266. param.ranges.max = 1.0f;
  267. param.scalePointCount = 2;
  268. param.scalePoints = scalePoints;
  269. scalePoints[0].label = "Sine";
  270. scalePoints[1].label = "Triangle";
  271. scalePoints[0].value = 0.0f;
  272. scalePoints[1].value = 1.0f;
  273. break;
  274. case 3:
  275. hints |= NATIVE_PARAMETER_IS_AUTOMABLE;
  276. param.name = "LFO Stereo";
  277. param.ranges.def = 62.0f;
  278. break;
  279. case 4:
  280. hints |= NATIVE_PARAMETER_IS_AUTOMABLE;
  281. param.name = "Depth";
  282. param.ranges.def = 60.0f;
  283. break;
  284. case 5:
  285. hints |= NATIVE_PARAMETER_IS_AUTOMABLE;
  286. param.name = "Feedback";
  287. param.ranges.def = 105.0f;
  288. break;
  289. case 6:
  290. param.name = "Delay";
  291. param.ranges.def = 25.0f;
  292. param.ranges.min = 1.0f;
  293. param.ranges.max = 100.0f;
  294. break;
  295. case 7:
  296. hints |= NATIVE_PARAMETER_IS_AUTOMABLE;
  297. param.name = "L/R Cross";
  298. param.ranges.def = 0.0f;
  299. break;
  300. case 8:
  301. hints |= NATIVE_PARAMETER_IS_AUTOMABLE;
  302. param.name = "Phase";
  303. param.ranges.def = 64.0f;
  304. break;
  305. }
  306. param.hints = static_cast<NativeParameterHints>(hints);
  307. return &param;
  308. }
  309. // -------------------------------------------------------------------
  310. // Plugin midi-program calls
  311. const NativeMidiProgram* getMidiProgramInfo(const uint32_t index) const override
  312. {
  313. if (index >= fProgramCount)
  314. return nullptr;
  315. static NativeMidiProgram midiProg;
  316. midiProg.bank = 0;
  317. midiProg.program = index;
  318. switch (index)
  319. {
  320. case 0:
  321. midiProg.name = "AlienWah1";
  322. break;
  323. case 1:
  324. midiProg.name = "AlienWah2";
  325. break;
  326. case 2:
  327. midiProg.name = "AlienWah3";
  328. break;
  329. case 3:
  330. midiProg.name = "AlienWah4";
  331. break;
  332. default:
  333. midiProg.name = nullptr;
  334. break;
  335. }
  336. return &midiProg;
  337. }
  338. // -------------------------------------------------------------------
  339. PluginClassEND(FxAlienWahPlugin)
  340. CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(FxAlienWahPlugin)
  341. };
  342. // -----------------------------------------------------------------------
  343. class FxChorusPlugin : public FxAbstractPlugin<Chorus>
  344. {
  345. public:
  346. FxChorusPlugin(const NativeHostDescriptor* const host)
  347. : FxAbstractPlugin(host, 12, 10) {}
  348. protected:
  349. // -------------------------------------------------------------------
  350. // Plugin parameter calls
  351. const NativeParameter* getParameterInfo(const uint32_t index) const override
  352. {
  353. if (index >= fParamCount)
  354. return nullptr;
  355. static NativeParameter param;
  356. static NativeParameterScalePoint scalePoints[2];
  357. int hints = NATIVE_PARAMETER_IS_ENABLED|NATIVE_PARAMETER_IS_INTEGER;
  358. param.name = nullptr;
  359. param.unit = nullptr;
  360. param.ranges.def = 1.0f;
  361. param.ranges.min = 0.0f;
  362. param.ranges.max = 127.0f;
  363. param.ranges.step = 1.0f;
  364. param.ranges.stepSmall = 1.0f;
  365. param.ranges.stepLarge = 20.0f;
  366. param.scalePointCount = 0;
  367. param.scalePoints = nullptr;
  368. switch (index)
  369. {
  370. case 0:
  371. hints |= NATIVE_PARAMETER_IS_AUTOMABLE;
  372. param.name = "LFO Frequency";
  373. param.ranges.def = 50.0f;
  374. break;
  375. case 1:
  376. hints |= NATIVE_PARAMETER_IS_AUTOMABLE;
  377. param.name = "LFO Randomness";
  378. param.ranges.def = 0.0f;
  379. break;
  380. case 2:
  381. hints |= NATIVE_PARAMETER_IS_AUTOMABLE|NATIVE_PARAMETER_IS_BOOLEAN|NATIVE_PARAMETER_USES_SCALEPOINTS;
  382. param.name = "LFO Type";
  383. param.ranges.def = 0.0f;
  384. param.ranges.max = 1.0f;
  385. param.scalePointCount = 2;
  386. param.scalePoints = scalePoints;
  387. scalePoints[0].label = "Sine";
  388. scalePoints[1].label = "Triangle";
  389. scalePoints[0].value = 0.0f;
  390. scalePoints[1].value = 1.0f;
  391. break;
  392. case 3:
  393. hints |= NATIVE_PARAMETER_IS_AUTOMABLE;
  394. param.name = "LFO Stereo";
  395. param.ranges.def = 90.0f;
  396. break;
  397. case 4:
  398. hints |= NATIVE_PARAMETER_IS_AUTOMABLE;
  399. param.name = "Depth";
  400. param.ranges.def = 40.0f;
  401. break;
  402. case 5:
  403. hints |= NATIVE_PARAMETER_IS_AUTOMABLE;
  404. param.name = "Delay";
  405. param.ranges.def = 85.0f;
  406. break;
  407. case 6:
  408. hints |= NATIVE_PARAMETER_IS_AUTOMABLE;
  409. param.name = "Feedback";
  410. param.ranges.def = 64.0f;
  411. break;
  412. case 7:
  413. hints |= NATIVE_PARAMETER_IS_AUTOMABLE;
  414. param.name = "L/R Cross";
  415. param.ranges.def = 119.0f;
  416. break;
  417. case 8:
  418. hints |= NATIVE_PARAMETER_IS_AUTOMABLE|NATIVE_PARAMETER_IS_BOOLEAN;
  419. param.name = "Flange Mode";
  420. param.ranges.def = 0.0f;
  421. param.ranges.max = 1.0f;
  422. break;
  423. case 9:
  424. hints |= NATIVE_PARAMETER_IS_AUTOMABLE|NATIVE_PARAMETER_IS_BOOLEAN;
  425. param.name = "Subtract Output";
  426. param.ranges.def = 0.0f;
  427. param.ranges.max = 1.0f;
  428. break;
  429. }
  430. param.hints = static_cast<NativeParameterHints>(hints);
  431. return &param;
  432. }
  433. // -------------------------------------------------------------------
  434. // Plugin midi-program calls
  435. const NativeMidiProgram* getMidiProgramInfo(const uint32_t index) const override
  436. {
  437. if (index >= fProgramCount)
  438. return nullptr;
  439. static NativeMidiProgram midiProg;
  440. midiProg.bank = 0;
  441. midiProg.program = index;
  442. switch (index)
  443. {
  444. case 0:
  445. midiProg.name = "Chorus1";
  446. break;
  447. case 1:
  448. midiProg.name = "Chorus2";
  449. break;
  450. case 2:
  451. midiProg.name = "Chorus3";
  452. break;
  453. case 3:
  454. midiProg.name = "Celeste1";
  455. break;
  456. case 4:
  457. midiProg.name = "Celeste2";
  458. break;
  459. case 5:
  460. midiProg.name = "Flange1";
  461. break;
  462. case 6:
  463. midiProg.name = "Flange2";
  464. break;
  465. case 7:
  466. midiProg.name = "Flange3";
  467. break;
  468. case 8:
  469. midiProg.name = "Flange4";
  470. break;
  471. case 9:
  472. midiProg.name = "Flange5";
  473. break;
  474. default:
  475. midiProg.name = nullptr;
  476. break;
  477. }
  478. return &midiProg;
  479. }
  480. // -------------------------------------------------------------------
  481. PluginClassEND(FxChorusPlugin)
  482. CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(FxChorusPlugin)
  483. };
  484. // -----------------------------------------------------------------------
  485. class FxDistortionPlugin : public FxAbstractPlugin<Distorsion>
  486. {
  487. public:
  488. FxDistortionPlugin(const NativeHostDescriptor* const host)
  489. : FxAbstractPlugin(host, 11, 6) {}
  490. protected:
  491. // -------------------------------------------------------------------
  492. // Plugin parameter calls
  493. const NativeParameter* getParameterInfo(const uint32_t index) const override
  494. {
  495. if (index >= fParamCount)
  496. return nullptr;
  497. static NativeParameter param;
  498. static NativeParameterScalePoint scalePoints[14];
  499. int hints = NATIVE_PARAMETER_IS_ENABLED|NATIVE_PARAMETER_IS_INTEGER;
  500. param.name = nullptr;
  501. param.unit = nullptr;
  502. param.ranges.def = 1.0f;
  503. param.ranges.min = 0.0f;
  504. param.ranges.max = 127.0f;
  505. param.ranges.step = 1.0f;
  506. param.ranges.stepSmall = 1.0f;
  507. param.ranges.stepLarge = 20.0f;
  508. param.scalePointCount = 0;
  509. param.scalePoints = nullptr;
  510. switch (index)
  511. {
  512. case 0:
  513. hints |= NATIVE_PARAMETER_IS_AUTOMABLE;
  514. param.name = "L/R Cross";
  515. param.ranges.def = 35.0f;
  516. break;
  517. case 1:
  518. hints |= NATIVE_PARAMETER_IS_AUTOMABLE;
  519. param.name = "Drive";
  520. param.ranges.def = 56.0f;
  521. break;
  522. case 2:
  523. hints |= NATIVE_PARAMETER_IS_AUTOMABLE;
  524. param.name = "Level";
  525. param.ranges.def = 70.0f;
  526. break;
  527. case 3:
  528. hints |= NATIVE_PARAMETER_IS_AUTOMABLE|NATIVE_PARAMETER_USES_SCALEPOINTS;
  529. param.name = "Type";
  530. param.ranges.def = 0.0f;
  531. param.ranges.max = 13.0f;
  532. param.scalePointCount = 14;
  533. param.scalePoints = scalePoints;
  534. scalePoints[ 0].label = "Arctangent";
  535. scalePoints[ 1].label = "Asymmetric";
  536. scalePoints[ 2].label = "Pow";
  537. scalePoints[ 3].label = "Sine";
  538. scalePoints[ 4].label = "Quantisize";
  539. scalePoints[ 5].label = "Zigzag";
  540. scalePoints[ 6].label = "Limiter";
  541. scalePoints[ 7].label = "Upper Limiter";
  542. scalePoints[ 8].label = "Lower Limiter";
  543. scalePoints[ 9].label = "Inverse Limiter";
  544. scalePoints[10].label = "Clip";
  545. scalePoints[11].label = "Asym2";
  546. scalePoints[12].label = "Pow2";
  547. scalePoints[13].label = "Sigmoid";
  548. scalePoints[ 0].value = 0.0f;
  549. scalePoints[ 1].value = 1.0f;
  550. scalePoints[ 2].value = 2.0f;
  551. scalePoints[ 3].value = 3.0f;
  552. scalePoints[ 4].value = 4.0f;
  553. scalePoints[ 5].value = 5.0f;
  554. scalePoints[ 6].value = 6.0f;
  555. scalePoints[ 7].value = 7.0f;
  556. scalePoints[ 8].value = 8.0f;
  557. scalePoints[ 9].value = 9.0f;
  558. scalePoints[10].value = 10.0f;
  559. scalePoints[11].value = 11.0f;
  560. scalePoints[12].value = 12.0f;
  561. scalePoints[13].value = 13.0f;
  562. break;
  563. case 4:
  564. hints |= NATIVE_PARAMETER_IS_AUTOMABLE|NATIVE_PARAMETER_IS_BOOLEAN;
  565. param.name = "Negate";
  566. param.ranges.def = 0.0f;
  567. param.ranges.max = 1.0f;
  568. break;
  569. case 5:
  570. hints |= NATIVE_PARAMETER_IS_AUTOMABLE;
  571. param.name = "Low-Pass Filter";
  572. param.ranges.def = 96.0f;
  573. break;
  574. case 6:
  575. hints |= NATIVE_PARAMETER_IS_AUTOMABLE;
  576. param.name = "High-Pass Filter";
  577. param.ranges.def = 0.0f;
  578. break;
  579. case 7:
  580. hints |= NATIVE_PARAMETER_IS_AUTOMABLE|NATIVE_PARAMETER_IS_BOOLEAN;
  581. param.name = "Stereo";
  582. param.ranges.def = 0.0f;
  583. param.ranges.max = 1.0f;
  584. break;
  585. case 8:
  586. hints |= NATIVE_PARAMETER_IS_AUTOMABLE|NATIVE_PARAMETER_IS_BOOLEAN;
  587. param.name = "Pre-Filtering";
  588. param.ranges.def = 0.0f;
  589. param.ranges.max = 1.0f;
  590. break;
  591. }
  592. param.hints = static_cast<NativeParameterHints>(hints);
  593. return &param;
  594. }
  595. // -------------------------------------------------------------------
  596. // Plugin midi-program calls
  597. const NativeMidiProgram* getMidiProgramInfo(const uint32_t index) const override
  598. {
  599. if (index >= fProgramCount)
  600. return nullptr;
  601. static NativeMidiProgram midiProg;
  602. midiProg.bank = 0;
  603. midiProg.program = index;
  604. switch (index)
  605. {
  606. case 0:
  607. midiProg.name = "Overdrive 1";
  608. break;
  609. case 1:
  610. midiProg.name = "Overdrive 2";
  611. break;
  612. case 2:
  613. midiProg.name = "A. Exciter 1";
  614. break;
  615. case 3:
  616. midiProg.name = "A. Exciter 2";
  617. break;
  618. case 4:
  619. midiProg.name = "Guitar Amp";
  620. break;
  621. case 5:
  622. midiProg.name = "Quantisize";
  623. break;
  624. default:
  625. midiProg.name = nullptr;
  626. break;
  627. }
  628. return &midiProg;
  629. }
  630. // -------------------------------------------------------------------
  631. PluginClassEND(FxDistortionPlugin)
  632. CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(FxDistortionPlugin)
  633. };
  634. // -----------------------------------------------------------------------
  635. class FxDynamicFilterPlugin : public FxAbstractPlugin<DynamicFilter>
  636. {
  637. public:
  638. FxDynamicFilterPlugin(const NativeHostDescriptor* const host)
  639. : FxAbstractPlugin(host, 10, 5) {}
  640. protected:
  641. // -------------------------------------------------------------------
  642. // Plugin parameter calls
  643. const NativeParameter* getParameterInfo(const uint32_t index) const override
  644. {
  645. if (index >= fParamCount)
  646. return nullptr;
  647. static NativeParameter param;
  648. static NativeParameterScalePoint scalePoints[2];
  649. int hints = NATIVE_PARAMETER_IS_ENABLED|NATIVE_PARAMETER_IS_INTEGER;
  650. param.name = nullptr;
  651. param.unit = nullptr;
  652. param.ranges.def = 1.0f;
  653. param.ranges.min = 0.0f;
  654. param.ranges.max = 127.0f;
  655. param.ranges.step = 1.0f;
  656. param.ranges.stepSmall = 1.0f;
  657. param.ranges.stepLarge = 20.0f;
  658. param.scalePointCount = 0;
  659. param.scalePoints = nullptr;
  660. switch (index)
  661. {
  662. case 0:
  663. hints |= NATIVE_PARAMETER_IS_AUTOMABLE;
  664. param.name = "LFO Frequency";
  665. param.ranges.def = 80.0f;
  666. break;
  667. case 1:
  668. hints |= NATIVE_PARAMETER_IS_AUTOMABLE;
  669. param.name = "LFO Randomness";
  670. param.ranges.def = 0.0f;
  671. break;
  672. case 2:
  673. hints |= NATIVE_PARAMETER_IS_AUTOMABLE|NATIVE_PARAMETER_IS_BOOLEAN|NATIVE_PARAMETER_USES_SCALEPOINTS;
  674. param.name = "LFO Type";
  675. param.ranges.def = 0.0f;
  676. param.ranges.max = 1.0f;
  677. param.scalePointCount = 2;
  678. param.scalePoints = scalePoints;
  679. scalePoints[0].label = "Sine";
  680. scalePoints[1].label = "Triangle";
  681. scalePoints[0].value = 0.0f;
  682. scalePoints[1].value = 1.0f;
  683. break;
  684. case 3:
  685. hints |= NATIVE_PARAMETER_IS_AUTOMABLE;
  686. param.name = "LFO Stereo";
  687. param.ranges.def = 64.0f;
  688. break;
  689. case 4:
  690. hints |= NATIVE_PARAMETER_IS_AUTOMABLE;
  691. param.name = "LFO Depth";
  692. param.ranges.def = 0.0f;
  693. break;
  694. case 5:
  695. hints |= NATIVE_PARAMETER_IS_AUTOMABLE;
  696. param.name = "Amp sns";
  697. param.ranges.def = 90.0f;
  698. break;
  699. case 6:
  700. hints |= NATIVE_PARAMETER_IS_AUTOMABLE|NATIVE_PARAMETER_IS_BOOLEAN;
  701. param.name = "Amp sns inv";
  702. param.ranges.def = 0.0f;
  703. param.ranges.max = 1.0f;
  704. break;
  705. case 7:
  706. hints |= NATIVE_PARAMETER_IS_AUTOMABLE;
  707. param.name = "Amp Smooth";
  708. param.ranges.def = 60.0f;
  709. break;
  710. }
  711. param.hints = static_cast<NativeParameterHints>(hints);
  712. return &param;
  713. }
  714. // -------------------------------------------------------------------
  715. // Plugin midi-program calls
  716. const NativeMidiProgram* getMidiProgramInfo(const uint32_t index) const override
  717. {
  718. if (index >= fProgramCount)
  719. return nullptr;
  720. static NativeMidiProgram midiProg;
  721. midiProg.bank = 0;
  722. midiProg.program = index;
  723. switch (index)
  724. {
  725. case 0:
  726. midiProg.name = "WahWah";
  727. break;
  728. case 1:
  729. midiProg.name = "AutoWah";
  730. break;
  731. case 2:
  732. midiProg.name = "Sweep";
  733. break;
  734. case 3:
  735. midiProg.name = "VocalMorph1";
  736. break;
  737. case 4:
  738. midiProg.name = "VocalMorph2";
  739. break;
  740. default:
  741. midiProg.name = nullptr;
  742. break;
  743. }
  744. return &midiProg;
  745. }
  746. // -------------------------------------------------------------------
  747. PluginClassEND(FxDynamicFilterPlugin)
  748. CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(FxDynamicFilterPlugin)
  749. };
  750. // -----------------------------------------------------------------------
  751. class FxEchoPlugin : public FxAbstractPlugin<Echo>
  752. {
  753. public:
  754. FxEchoPlugin(const NativeHostDescriptor* const host)
  755. : FxAbstractPlugin(host, 7, 9) {}
  756. protected:
  757. // -------------------------------------------------------------------
  758. // Plugin parameter calls
  759. const NativeParameter* getParameterInfo(const uint32_t index) const override
  760. {
  761. if (index >= fParamCount)
  762. return nullptr;
  763. static NativeParameter param;
  764. int hints = NATIVE_PARAMETER_IS_ENABLED|NATIVE_PARAMETER_IS_INTEGER;
  765. param.name = nullptr;
  766. param.unit = nullptr;
  767. param.ranges.def = 1.0f;
  768. param.ranges.min = 0.0f;
  769. param.ranges.max = 127.0f;
  770. param.ranges.step = 1.0f;
  771. param.ranges.stepSmall = 1.0f;
  772. param.ranges.stepLarge = 20.0f;
  773. param.scalePointCount = 0;
  774. param.scalePoints = nullptr;
  775. switch (index)
  776. {
  777. case 0:
  778. hints |= NATIVE_PARAMETER_IS_AUTOMABLE;
  779. param.name = "Delay";
  780. param.ranges.def = 35.0f;
  781. break;
  782. case 1:
  783. hints |= NATIVE_PARAMETER_IS_AUTOMABLE;
  784. param.name = "L/R Delay";
  785. param.ranges.def = 64.0f;
  786. break;
  787. case 2:
  788. hints |= NATIVE_PARAMETER_IS_AUTOMABLE;
  789. param.name = "L/R Cross";
  790. param.ranges.def = 30.0f;
  791. break;
  792. case 3:
  793. hints |= NATIVE_PARAMETER_IS_AUTOMABLE;
  794. param.name = "Feedback";
  795. param.ranges.def = 59.0f;
  796. break;
  797. case 4:
  798. hints |= NATIVE_PARAMETER_IS_AUTOMABLE;
  799. param.name = "High Damp";
  800. param.ranges.def = 0.0f;
  801. break;
  802. }
  803. param.hints = static_cast<NativeParameterHints>(hints);
  804. return &param;
  805. }
  806. // -------------------------------------------------------------------
  807. // Plugin midi-program calls
  808. const NativeMidiProgram* getMidiProgramInfo(const uint32_t index) const override
  809. {
  810. if (index >= fProgramCount)
  811. return nullptr;
  812. static NativeMidiProgram midiProg;
  813. midiProg.bank = 0;
  814. midiProg.program = index;
  815. switch (index)
  816. {
  817. case 0:
  818. midiProg.name = "Echo 1";
  819. break;
  820. case 1:
  821. midiProg.name = "Echo 2";
  822. break;
  823. case 2:
  824. midiProg.name = "Echo 3";
  825. break;
  826. case 3:
  827. midiProg.name = "Simple Echo";
  828. break;
  829. case 4:
  830. midiProg.name = "Canyon";
  831. break;
  832. case 5:
  833. midiProg.name = "Panning Echo 1";
  834. break;
  835. case 6:
  836. midiProg.name = "Panning Echo 2";
  837. break;
  838. case 7:
  839. midiProg.name = "Panning Echo 3";
  840. break;
  841. case 8:
  842. midiProg.name = "Feedback Echo";
  843. break;
  844. default:
  845. midiProg.name = nullptr;
  846. break;
  847. }
  848. return &midiProg;
  849. }
  850. // -------------------------------------------------------------------
  851. PluginClassEND(FxEchoPlugin)
  852. CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(FxEchoPlugin)
  853. };
  854. // -----------------------------------------------------------------------
  855. class FxPhaserPlugin : public FxAbstractPlugin<Phaser>
  856. {
  857. public:
  858. FxPhaserPlugin(const NativeHostDescriptor* const host)
  859. : FxAbstractPlugin(host, 15, 12) {}
  860. protected:
  861. // -------------------------------------------------------------------
  862. // Plugin parameter calls
  863. const NativeParameter* getParameterInfo(const uint32_t index) const override
  864. {
  865. if (index >= fParamCount)
  866. return nullptr;
  867. static NativeParameter param;
  868. static NativeParameterScalePoint scalePoints[2];
  869. int hints = NATIVE_PARAMETER_IS_ENABLED|NATIVE_PARAMETER_IS_INTEGER;
  870. param.name = nullptr;
  871. param.unit = nullptr;
  872. param.ranges.def = 1.0f;
  873. param.ranges.min = 0.0f;
  874. param.ranges.max = 127.0f;
  875. param.ranges.step = 1.0f;
  876. param.ranges.stepSmall = 1.0f;
  877. param.ranges.stepLarge = 20.0f;
  878. param.scalePointCount = 0;
  879. param.scalePoints = nullptr;
  880. switch (index)
  881. {
  882. case 0:
  883. hints |= NATIVE_PARAMETER_IS_AUTOMABLE;
  884. param.name = "LFO Frequency";
  885. param.ranges.def = 36.0f;
  886. break;
  887. case 1:
  888. hints |= NATIVE_PARAMETER_IS_AUTOMABLE;
  889. param.name = "LFO Randomness";
  890. param.ranges.def = 0.0f;
  891. break;
  892. case 2:
  893. hints |= NATIVE_PARAMETER_IS_AUTOMABLE|NATIVE_PARAMETER_IS_BOOLEAN|NATIVE_PARAMETER_USES_SCALEPOINTS;
  894. param.name = "LFO Type";
  895. param.ranges.def = 0.0f;
  896. param.ranges.max = 1.0f;
  897. param.scalePointCount = 2;
  898. param.scalePoints = scalePoints;
  899. scalePoints[0].label = "Sine";
  900. scalePoints[1].label = "Triangle";
  901. scalePoints[0].value = 0.0f;
  902. scalePoints[1].value = 1.0f;
  903. break;
  904. case 3:
  905. hints |= NATIVE_PARAMETER_IS_AUTOMABLE;
  906. param.name = "LFO Stereo";
  907. param.ranges.def = 64.0f;
  908. break;
  909. case 4:
  910. hints |= NATIVE_PARAMETER_IS_AUTOMABLE;
  911. param.name = "Depth";
  912. param.ranges.def = 110.0f;
  913. break;
  914. case 5:
  915. hints |= NATIVE_PARAMETER_IS_AUTOMABLE;
  916. param.name = "Feedback";
  917. param.ranges.def = 64.0f;
  918. break;
  919. case 6:
  920. param.name = "Stages";
  921. param.ranges.def = 1.0f;
  922. param.ranges.min = 1.0f;
  923. param.ranges.max = 12.0f;
  924. break;
  925. case 7:
  926. hints |= NATIVE_PARAMETER_IS_AUTOMABLE;
  927. param.name = "L/R Cross|Offset";
  928. param.ranges.def = 0.0f;
  929. break;
  930. case 8:
  931. hints |= NATIVE_PARAMETER_IS_AUTOMABLE|NATIVE_PARAMETER_IS_BOOLEAN;
  932. param.name = "Subtract Output";
  933. param.ranges.def = 0.0f;
  934. param.ranges.max = 1.0f;
  935. break;
  936. case 9:
  937. hints |= NATIVE_PARAMETER_IS_AUTOMABLE;
  938. param.name = "Phase|Width";
  939. param.ranges.def = 20.0f;
  940. break;
  941. case 10:
  942. hints |= NATIVE_PARAMETER_IS_AUTOMABLE|NATIVE_PARAMETER_IS_BOOLEAN;
  943. param.name = "Hyper";
  944. param.ranges.def = 0.0f;
  945. param.ranges.max = 1.0f;
  946. break;
  947. case 11:
  948. hints |= NATIVE_PARAMETER_IS_AUTOMABLE;
  949. param.name = "Distortion";
  950. param.ranges.def = 0.0f;
  951. break;
  952. case 12:
  953. hints |= NATIVE_PARAMETER_IS_AUTOMABLE|NATIVE_PARAMETER_IS_BOOLEAN;
  954. param.name = "Analog";
  955. param.ranges.def = 0.0f;
  956. param.ranges.max = 1.0f;
  957. break;
  958. }
  959. param.hints = static_cast<NativeParameterHints>(hints);
  960. return &param;
  961. }
  962. // -------------------------------------------------------------------
  963. // Plugin midi-program calls
  964. const NativeMidiProgram* getMidiProgramInfo(const uint32_t index) const override
  965. {
  966. if (index >= fProgramCount)
  967. return nullptr;
  968. static NativeMidiProgram midiProg;
  969. midiProg.bank = 0;
  970. midiProg.program = index;
  971. switch (index)
  972. {
  973. case 0:
  974. midiProg.name = "Phaser 1";
  975. break;
  976. case 1:
  977. midiProg.name = "Phaser 2";
  978. break;
  979. case 2:
  980. midiProg.name = "Phaser 3";
  981. break;
  982. case 3:
  983. midiProg.name = "Phaser 4";
  984. break;
  985. case 4:
  986. midiProg.name = "Phaser 5";
  987. break;
  988. case 5:
  989. midiProg.name = "Phaser 6";
  990. break;
  991. case 6:
  992. midiProg.name = "APhaser 1";
  993. break;
  994. case 7:
  995. midiProg.name = "APhaser 2";
  996. break;
  997. case 8:
  998. midiProg.name = "APhaser 3";
  999. break;
  1000. case 9:
  1001. midiProg.name = "APhaser 4";
  1002. break;
  1003. case 10:
  1004. midiProg.name = "APhaser 5";
  1005. break;
  1006. case 11:
  1007. midiProg.name = "APhaser 6";
  1008. break;
  1009. default:
  1010. midiProg.name = nullptr;
  1011. break;
  1012. }
  1013. return &midiProg;
  1014. }
  1015. // -------------------------------------------------------------------
  1016. PluginClassEND(FxPhaserPlugin)
  1017. CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(FxPhaserPlugin)
  1018. };
  1019. // -----------------------------------------------------------------------
  1020. class FxReverbPlugin : public FxAbstractPlugin<Reverb>
  1021. {
  1022. public:
  1023. FxReverbPlugin(const NativeHostDescriptor* const host)
  1024. : FxAbstractPlugin(host, 13, 13) {}
  1025. protected:
  1026. // -------------------------------------------------------------------
  1027. // Plugin parameter calls
  1028. const NativeParameter* getParameterInfo(const uint32_t index) const override
  1029. {
  1030. if (index >= fParamCount)
  1031. return nullptr;
  1032. static NativeParameter param;
  1033. static NativeParameterScalePoint scalePoints[3];
  1034. int hints = NATIVE_PARAMETER_IS_ENABLED|NATIVE_PARAMETER_IS_INTEGER;
  1035. param.name = nullptr;
  1036. param.unit = nullptr;
  1037. param.ranges.def = 1.0f;
  1038. param.ranges.min = 0.0f;
  1039. param.ranges.max = 127.0f;
  1040. param.ranges.step = 1.0f;
  1041. param.ranges.stepSmall = 1.0f;
  1042. param.ranges.stepLarge = 20.0f;
  1043. param.scalePointCount = 0;
  1044. param.scalePoints = nullptr;
  1045. switch (index)
  1046. {
  1047. case 0:
  1048. hints |= NATIVE_PARAMETER_IS_AUTOMABLE;
  1049. param.name = "Time";
  1050. param.ranges.def = 63.0f;
  1051. break;
  1052. case 1:
  1053. param.name = "Delay";
  1054. param.ranges.def = 24.0f;
  1055. break;
  1056. case 2:
  1057. hints |= NATIVE_PARAMETER_IS_AUTOMABLE;
  1058. param.name = "Feedback";
  1059. param.ranges.def = 0.0f;
  1060. break;
  1061. case 3:
  1062. hints = 0x0;
  1063. param.name = "bw";
  1064. break;
  1065. case 4:
  1066. hints = 0x0;
  1067. param.name = "E/R";
  1068. break;
  1069. case 5:
  1070. param.name = "Low-Pass Filter";
  1071. param.ranges.def = 85.0f;
  1072. break;
  1073. case 6:
  1074. param.name = "High-Pass Filter";
  1075. param.ranges.def = 5.0f;
  1076. break;
  1077. case 7:
  1078. hints |= NATIVE_PARAMETER_IS_AUTOMABLE;
  1079. param.name = "Damp";
  1080. param.ranges.def = 83.0f;
  1081. param.ranges.min = 64.0f;
  1082. break;
  1083. case 8:
  1084. hints |= NATIVE_PARAMETER_USES_SCALEPOINTS;
  1085. param.name = "Type";
  1086. param.ranges.def = 1.0f;
  1087. param.ranges.max = 2.0f;
  1088. param.scalePointCount = 3;
  1089. param.scalePoints = scalePoints;
  1090. scalePoints[0].label = "Random";
  1091. scalePoints[1].label = "Freeverb";
  1092. scalePoints[2].label = "Bandwidth";
  1093. scalePoints[0].value = 0.0f;
  1094. scalePoints[1].value = 1.0f;
  1095. scalePoints[2].value = 2.0f;
  1096. break;
  1097. case 9:
  1098. param.name = "Room size";
  1099. param.ranges.def = 64.0f;
  1100. param.ranges.min = 1.0f;
  1101. break;
  1102. case 10:
  1103. param.name = "Bandwidth";
  1104. param.ranges.def = 20.0f;
  1105. break;
  1106. }
  1107. param.hints = static_cast<NativeParameterHints>(hints);
  1108. return &param;
  1109. }
  1110. // -------------------------------------------------------------------
  1111. // Plugin midi-program calls
  1112. const NativeMidiProgram* getMidiProgramInfo(const uint32_t index) const override
  1113. {
  1114. if (index >= fProgramCount)
  1115. return nullptr;
  1116. static NativeMidiProgram midiProg;
  1117. midiProg.bank = 0;
  1118. midiProg.program = index;
  1119. switch (index)
  1120. {
  1121. case 0:
  1122. midiProg.name = "Cathedral1";
  1123. break;
  1124. case 1:
  1125. midiProg.name = "Cathedral2";
  1126. break;
  1127. case 2:
  1128. midiProg.name = "Cathedral3";
  1129. break;
  1130. case 3:
  1131. midiProg.name = "Hall1";
  1132. break;
  1133. case 4:
  1134. midiProg.name = "Hall2";
  1135. break;
  1136. case 5:
  1137. midiProg.name = "Room1";
  1138. break;
  1139. case 6:
  1140. midiProg.name = "Room2";
  1141. break;
  1142. case 7:
  1143. midiProg.name = "Basement";
  1144. break;
  1145. case 8:
  1146. midiProg.name = "Tunnel";
  1147. break;
  1148. case 9:
  1149. midiProg.name = "Echoed1";
  1150. break;
  1151. case 10:
  1152. midiProg.name = "Echoed2";
  1153. break;
  1154. case 11:
  1155. midiProg.name = "VeryLong1";
  1156. break;
  1157. case 12:
  1158. midiProg.name = "VeryLong2";
  1159. break;
  1160. default:
  1161. midiProg.name = nullptr;
  1162. break;
  1163. }
  1164. return &midiProg;
  1165. }
  1166. // -------------------------------------------------------------------
  1167. PluginClassEND(FxReverbPlugin)
  1168. CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(FxReverbPlugin)
  1169. };
  1170. // -----------------------------------------------------------------------
  1171. static const NativePluginDescriptor fxAlienWahDesc = {
  1172. /* category */ NATIVE_PLUGIN_CATEGORY_MODULATOR,
  1173. /* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE
  1174. |NATIVE_PLUGIN_USES_PANNING
  1175. |NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS),
  1176. /* supports */ NATIVE_PLUGIN_SUPPORTS_NOTHING,
  1177. /* audioIns */ 2,
  1178. /* audioOuts */ 2,
  1179. /* midiIns */ 0,
  1180. /* midiOuts */ 0,
  1181. /* paramIns */ 11-2,
  1182. /* paramOuts */ 0,
  1183. /* name */ "ZynAlienWah",
  1184. /* label */ "zynalienwah",
  1185. /* maker */ "falkTX, Mark McCurry, Nasca Octavian Paul",
  1186. /* copyright */ "GNU GPL v2+",
  1187. PluginDescriptorFILL(FxAlienWahPlugin)
  1188. };
  1189. static const NativePluginDescriptor fxChorusDesc = {
  1190. /* category */ NATIVE_PLUGIN_CATEGORY_MODULATOR,
  1191. /* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE
  1192. |NATIVE_PLUGIN_USES_PANNING
  1193. |NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS),
  1194. /* supports */ NATIVE_PLUGIN_SUPPORTS_NOTHING,
  1195. /* audioIns */ 2,
  1196. /* audioOuts */ 2,
  1197. /* midiIns */ 0,
  1198. /* midiOuts */ 0,
  1199. /* paramIns */ 12-2,
  1200. /* paramOuts */ 0,
  1201. /* name */ "ZynChorus",
  1202. /* label */ "zynchorus",
  1203. /* maker */ "falkTX, Mark McCurry, Nasca Octavian Paul",
  1204. /* copyright */ "GNU GPL v2+",
  1205. PluginDescriptorFILL(FxChorusPlugin)
  1206. };
  1207. static const NativePluginDescriptor fxDistortionDesc = {
  1208. /* category */ NATIVE_PLUGIN_CATEGORY_MODULATOR,
  1209. /* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_USES_PANNING
  1210. |NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS),
  1211. /* supports */ NATIVE_PLUGIN_SUPPORTS_NOTHING,
  1212. /* audioIns */ 2,
  1213. /* audioOuts */ 2,
  1214. /* midiIns */ 0,
  1215. /* midiOuts */ 0,
  1216. /* paramIns */ 11-2,
  1217. /* paramOuts */ 0,
  1218. /* name */ "ZynDistortion",
  1219. /* label */ "zyndistortion",
  1220. /* maker */ "falkTX, Mark McCurry, Nasca Octavian Paul",
  1221. /* copyright */ "GNU GPL v2+",
  1222. PluginDescriptorFILL(FxDistortionPlugin)
  1223. };
  1224. static const NativePluginDescriptor fxDynamicFilterDesc = {
  1225. /* category */ NATIVE_PLUGIN_CATEGORY_FILTER,
  1226. /* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_USES_PANNING
  1227. |NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS),
  1228. /* supports */ NATIVE_PLUGIN_SUPPORTS_NOTHING,
  1229. /* audioIns */ 2,
  1230. /* audioOuts */ 2,
  1231. /* midiIns */ 0,
  1232. /* midiOuts */ 0,
  1233. /* paramIns */ 10-2,
  1234. /* paramOuts */ 0,
  1235. /* name */ "ZynDynamicFilter",
  1236. /* label */ "zyndynamicfilter",
  1237. /* maker */ "falkTX, Mark McCurry, Nasca Octavian Paul",
  1238. /* copyright */ "GNU GPL v2+",
  1239. PluginDescriptorFILL(FxDynamicFilterPlugin)
  1240. };
  1241. static const NativePluginDescriptor fxEchoDesc = {
  1242. /* category */ NATIVE_PLUGIN_CATEGORY_DELAY,
  1243. /* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE
  1244. |NATIVE_PLUGIN_USES_PANNING
  1245. |NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS),
  1246. /* supports */ NATIVE_PLUGIN_SUPPORTS_NOTHING,
  1247. /* audioIns */ 2,
  1248. /* audioOuts */ 2,
  1249. /* midiIns */ 0,
  1250. /* midiOuts */ 0,
  1251. /* paramIns */ 7-2,
  1252. /* paramOuts */ 0,
  1253. /* name */ "ZynEcho",
  1254. /* label */ "zynecho",
  1255. /* maker */ "falkTX, Mark McCurry, Nasca Octavian Paul",
  1256. /* copyright */ "GNU GPL v2+",
  1257. PluginDescriptorFILL(FxEchoPlugin)
  1258. };
  1259. static const NativePluginDescriptor fxPhaserDesc = {
  1260. /* category */ NATIVE_PLUGIN_CATEGORY_MODULATOR,
  1261. /* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_USES_PANNING
  1262. |NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS),
  1263. /* supports */ NATIVE_PLUGIN_SUPPORTS_NOTHING,
  1264. /* audioIns */ 2,
  1265. /* audioOuts */ 2,
  1266. /* midiIns */ 0,
  1267. /* midiOuts */ 0,
  1268. /* paramIns */ 15-2,
  1269. /* paramOuts */ 0,
  1270. /* name */ "ZynPhaser",
  1271. /* label */ "zynphaser",
  1272. /* maker */ "falkTX, Mark McCurry, Nasca Octavian Paul",
  1273. /* copyright */ "GNU GPL v2+",
  1274. PluginDescriptorFILL(FxPhaserPlugin)
  1275. };
  1276. static const NativePluginDescriptor fxReverbDesc = {
  1277. /* category */ NATIVE_PLUGIN_CATEGORY_DELAY,
  1278. /* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_USES_PANNING
  1279. |NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS),
  1280. /* supports */ NATIVE_PLUGIN_SUPPORTS_NOTHING,
  1281. /* audioIns */ 2,
  1282. /* audioOuts */ 2,
  1283. /* midiIns */ 0,
  1284. /* midiOuts */ 0,
  1285. /* paramIns */ 13-2,
  1286. /* paramOuts */ 0,
  1287. /* name */ "ZynReverb",
  1288. /* label */ "zynreverb",
  1289. /* maker */ "falkTX, Mark McCurry, Nasca Octavian Paul",
  1290. /* copyright */ "GNU GPL v2+",
  1291. PluginDescriptorFILL(FxReverbPlugin)
  1292. };
  1293. // -----------------------------------------------------------------------
  1294. CARLA_EXPORT
  1295. void carla_register_native_plugin_zynaddsubfx_fx();
  1296. CARLA_EXPORT
  1297. void carla_register_native_plugin_zynaddsubfx_fx()
  1298. {
  1299. carla_register_native_plugin(&fxAlienWahDesc);
  1300. carla_register_native_plugin(&fxChorusDesc);
  1301. carla_register_native_plugin(&fxDistortionDesc);
  1302. carla_register_native_plugin(&fxDynamicFilterDesc);
  1303. carla_register_native_plugin(&fxEchoDesc);
  1304. carla_register_native_plugin(&fxPhaserDesc);
  1305. carla_register_native_plugin(&fxReverbDesc);
  1306. }
  1307. // -----------------------------------------------------------------------