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.

849 lines
21KB

  1. /*
  2. * Carla Native Plugins
  3. * Copyright (C) 2012-2014 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 "CarlaMIDI.h"
  19. #include "CarlaThread.hpp"
  20. #include "LinkedList.hpp"
  21. #include "CarlaMathUtils.hpp"
  22. #include "zynaddsubfx/DSP/FFTwrapper.h"
  23. #include "zynaddsubfx/Misc/Master.h"
  24. #include "zynaddsubfx/Misc/Part.h"
  25. #include "zynaddsubfx/Misc/Util.h"
  26. #ifdef WANT_ZYNADDSUBFX_UI
  27. # ifdef override
  28. # define override_hack
  29. # undef override
  30. # endif
  31. # include "zynaddsubfx/UI/common.H"
  32. # include "zynaddsubfx/UI/MasterUI.h"
  33. # include <FL/Fl_Shared_Image.H>
  34. # include <FL/Fl_Tiled_Image.H>
  35. # include <FL/Fl_Theme.H>
  36. # ifdef override_hack
  37. # define override
  38. # undef override_hack
  39. # endif
  40. #endif
  41. #include <ctime>
  42. #include <set>
  43. #include <string>
  44. #ifdef WANT_ZYNADDSUBFX_UI
  45. static Fl_Tiled_Image* gModuleBackdrop = nullptr;
  46. static CarlaString gPixmapPath;
  47. extern CarlaString gUiPixmapPath;
  48. void set_module_parameters(Fl_Widget* o)
  49. {
  50. CARLA_ASSERT(gModuleBackdrop != nullptr);
  51. o->box(FL_DOWN_FRAME);
  52. o->align(o->align() | FL_ALIGN_IMAGE_BACKDROP);
  53. o->color(FL_BLACK);
  54. o->labeltype(FL_SHADOW_LABEL);
  55. if (gModuleBackdrop != nullptr)
  56. o->image(gModuleBackdrop);
  57. }
  58. #endif
  59. // -----------------------------------------------------------------------
  60. class ZynAddSubFxPrograms
  61. {
  62. public:
  63. ZynAddSubFxPrograms()
  64. : fInitiated(false)
  65. {
  66. }
  67. ~ZynAddSubFxPrograms()
  68. {
  69. if (! fInitiated)
  70. return;
  71. for (LinkedList<const ProgramInfo*>::Itenerator it = fPrograms.begin(); it.valid(); it.next())
  72. {
  73. const ProgramInfo* const& pInfo(it.getValue());
  74. delete pInfo;
  75. }
  76. fPrograms.clear();
  77. FFT_cleanup();
  78. }
  79. void init()
  80. {
  81. if (fInitiated)
  82. return;
  83. fInitiated = true;
  84. fPrograms.append(new ProgramInfo(0, 0, "default"));
  85. Master& master(Master::getInstance());
  86. pthread_mutex_lock(&master.mutex);
  87. // refresh banks
  88. master.bank.rescanforbanks();
  89. for (uint32_t i=0, size = master.bank.banks.size(); i < size; ++i)
  90. {
  91. if (master.bank.banks[i].dir.empty())
  92. continue;
  93. master.bank.loadbank(master.bank.banks[i].dir);
  94. for (unsigned int instrument = 0; instrument < BANK_SIZE; ++instrument)
  95. {
  96. const std::string insName(master.bank.getname(instrument));
  97. if (insName.empty() || insName[0] == '\0' || insName[0] == ' ')
  98. continue;
  99. fPrograms.append(new ProgramInfo(i+1, instrument, insName.c_str()));
  100. }
  101. }
  102. pthread_mutex_unlock(&master.mutex);
  103. }
  104. void load(Master* const master, const uint8_t channel, const uint32_t bank, const uint32_t program)
  105. {
  106. if (bank == 0)
  107. {
  108. pthread_mutex_lock(&master->mutex);
  109. master->partonoff(channel, 1);
  110. master->part[channel]->defaults();
  111. master->part[channel]->applyparameters(false);
  112. pthread_mutex_unlock(&master->mutex);
  113. return;
  114. }
  115. const std::string& bankdir(master->bank.banks[bank-1].dir);
  116. if (! bankdir.empty())
  117. {
  118. pthread_mutex_lock(&master->mutex);
  119. master->partonoff(channel, 1);
  120. master->bank.loadbank(bankdir);
  121. master->bank.loadfromslot(program, master->part[channel]);
  122. master->part[channel]->applyparameters(false);
  123. pthread_mutex_unlock(&master->mutex);
  124. }
  125. }
  126. uint32_t count()
  127. {
  128. return fPrograms.count();
  129. }
  130. const NativeMidiProgram* getInfo(const uint32_t index)
  131. {
  132. if (index >= fPrograms.count())
  133. return nullptr;
  134. const ProgramInfo* const pInfo(fPrograms.getAt(index, nullptr));
  135. CARLA_SAFE_ASSERT_RETURN(pInfo != nullptr, nullptr);
  136. fRetProgram.bank = pInfo->bank;
  137. fRetProgram.program = pInfo->prog;
  138. fRetProgram.name = pInfo->name;
  139. return &fRetProgram;
  140. }
  141. private:
  142. struct ProgramInfo {
  143. uint32_t bank;
  144. uint32_t prog;
  145. const char* name;
  146. ProgramInfo(uint32_t bank_, uint32_t prog_, const char* name_)
  147. : bank(bank_),
  148. prog(prog_),
  149. name(carla_strdup(name_)) {}
  150. ~ProgramInfo()
  151. {
  152. if (name != nullptr)
  153. {
  154. delete[] name;
  155. name = nullptr;
  156. }
  157. }
  158. #ifdef CARLA_PROPER_CPP11_SUPPORT
  159. ProgramInfo() = delete;
  160. ProgramInfo(ProgramInfo&) = delete;
  161. ProgramInfo(const ProgramInfo&) = delete;
  162. ProgramInfo& operator=(ProgramInfo&);
  163. ProgramInfo& operator=(const ProgramInfo&);
  164. #endif
  165. };
  166. bool fInitiated;
  167. NativeMidiProgram fRetProgram;
  168. LinkedList<const ProgramInfo*> fPrograms;
  169. CARLA_DECLARE_NON_COPY_CLASS(ZynAddSubFxPrograms)
  170. };
  171. static ZynAddSubFxPrograms sPrograms;
  172. // -----------------------------------------------------------------------
  173. class ZynAddSubFxInstanceCount
  174. {
  175. public:
  176. ZynAddSubFxInstanceCount()
  177. : fCount(0)
  178. {
  179. }
  180. ~ZynAddSubFxInstanceCount()
  181. {
  182. CARLA_ASSERT(fCount == 0);
  183. }
  184. void addOne(const NativeHostDescriptor* const host)
  185. {
  186. if (fCount++ == 0)
  187. {
  188. CARLA_ASSERT(synth == nullptr);
  189. CARLA_ASSERT(denormalkillbuf == nullptr);
  190. reinit(host);
  191. #ifdef WANT_ZYNADDSUBFX_UI
  192. if (gPixmapPath.isEmpty())
  193. {
  194. gPixmapPath = host->resourceDir;
  195. gPixmapPath += "/zynaddsubfx/";
  196. gUiPixmapPath = gPixmapPath;
  197. }
  198. #endif
  199. }
  200. }
  201. void removeOne()
  202. {
  203. if (--fCount == 0)
  204. {
  205. CARLA_ASSERT(synth != nullptr);
  206. CARLA_ASSERT(denormalkillbuf != nullptr);
  207. Master::deleteInstance();
  208. delete[] denormalkillbuf;
  209. denormalkillbuf = nullptr;
  210. delete synth;
  211. synth = nullptr;
  212. }
  213. }
  214. void reinit(const NativeHostDescriptor* const host)
  215. {
  216. Master::deleteInstance();
  217. if (denormalkillbuf != nullptr)
  218. {
  219. delete[] denormalkillbuf;
  220. denormalkillbuf = nullptr;
  221. }
  222. if (synth != nullptr)
  223. {
  224. delete synth;
  225. synth = nullptr;
  226. }
  227. synth = new SYNTH_T();
  228. synth->buffersize = host->get_buffer_size(host->handle);
  229. synth->samplerate = host->get_sample_rate(host->handle);
  230. if (synth->buffersize > 32)
  231. synth->buffersize = 32;
  232. synth->alias();
  233. config.init();
  234. config.cfg.SoundBufferSize = synth->buffersize;
  235. config.cfg.SampleRate = synth->samplerate;
  236. config.cfg.GzipCompression = 0;
  237. sprng(std::time(nullptr));
  238. denormalkillbuf = new float[synth->buffersize];
  239. for (int i=0; i < synth->buffersize; ++i)
  240. denormalkillbuf[i] = (RND - 0.5f) * 1e-16;
  241. Master::getInstance();
  242. }
  243. void maybeReinit(const NativeHostDescriptor* const host)
  244. {
  245. if (host->get_buffer_size(host->handle) == static_cast<uint32_t>(synth->buffersize) &&
  246. host->get_sample_rate(host->handle) == static_cast<double>(synth->samplerate))
  247. return;
  248. reinit(host);
  249. }
  250. private:
  251. int fCount;
  252. CARLA_DECLARE_NON_COPY_CLASS(ZynAddSubFxInstanceCount)
  253. };
  254. static ZynAddSubFxInstanceCount sInstanceCount;
  255. // -----------------------------------------------------------------------
  256. class ZynAddSubFxThread : public CarlaThread
  257. {
  258. public:
  259. ZynAddSubFxThread(Master* const master, const NativeHostDescriptor* const host)
  260. : CarlaThread("ZynAddSubFxThread"),
  261. fMaster(master),
  262. kHost(host),
  263. #ifdef WANT_ZYNADDSUBFX_UI
  264. fUi(nullptr),
  265. fUiClosed(0),
  266. fNextUiAction(-1),
  267. #endif
  268. fChangeProgram(false),
  269. fNextChannel(0),
  270. fNextBank(0),
  271. fNextProgram(0)
  272. {
  273. }
  274. ~ZynAddSubFxThread()
  275. {
  276. #ifdef WANT_ZYNADDSUBFX_UI
  277. // must be closed by now
  278. CARLA_ASSERT(fUi == nullptr);
  279. #endif
  280. }
  281. void loadProgramLater(const uint8_t channel, const uint32_t bank, const uint32_t program)
  282. {
  283. fNextChannel = channel;
  284. fNextBank = bank;
  285. fNextProgram = program;
  286. fChangeProgram = true;
  287. }
  288. void stopLoadProgramLater()
  289. {
  290. fChangeProgram = false;
  291. fNextChannel = 0;
  292. fNextBank = 0;
  293. fNextProgram = 0;
  294. }
  295. void setMaster(Master* const master)
  296. {
  297. fMaster = master;
  298. }
  299. #ifdef WANT_ZYNADDSUBFX_UI
  300. void uiHide()
  301. {
  302. fNextUiAction = 0;
  303. }
  304. void uiShow()
  305. {
  306. fNextUiAction = 1;
  307. }
  308. void uiRepaint()
  309. {
  310. if (fUi != nullptr)
  311. fNextUiAction = 2;
  312. }
  313. void uiChangeName(const char* const name)
  314. {
  315. if (fUi != nullptr)
  316. {
  317. Fl::lock();
  318. fUi->masterwindow->label(name);
  319. Fl::unlock();
  320. }
  321. }
  322. #endif
  323. protected:
  324. void run() override
  325. {
  326. while (! shouldThreadExit())
  327. {
  328. #ifdef WANT_ZYNADDSUBFX_UI
  329. Fl::lock();
  330. if (fNextUiAction == 2) // repaint
  331. {
  332. CARLA_ASSERT(fUi != nullptr);
  333. if (fUi != nullptr)
  334. fUi->refresh_master_ui();
  335. }
  336. else if (fNextUiAction == 1) // init/show
  337. {
  338. static bool initialized = false;
  339. if (! initialized)
  340. {
  341. initialized = true;
  342. fl_register_images();
  343. Fl_Dial::default_style(Fl_Dial::PIXMAP_DIAL);
  344. if (Fl_Shared_Image* const img = Fl_Shared_Image::get(gPixmapPath + "knob.png"))
  345. Fl_Dial::default_image(img);
  346. if (Fl_Shared_Image* const img = Fl_Shared_Image::get(gPixmapPath + "window_backdrop.png"))
  347. Fl::scheme_bg(new Fl_Tiled_Image(img));
  348. if(Fl_Shared_Image* const img = Fl_Shared_Image::get(gPixmapPath + "module_backdrop.png"))
  349. gModuleBackdrop = new Fl_Tiled_Image(img);
  350. Fl::background(50, 50, 50);
  351. Fl::background2(70, 70, 70);
  352. Fl::foreground(255, 255, 255);
  353. Fl_Theme::set("Cairo");
  354. }
  355. if (fUi == nullptr)
  356. {
  357. fUiClosed = 0;
  358. fUi = new MasterUI(fMaster, &fUiClosed);
  359. fUi->masterwindow->label(kHost->uiName);
  360. fUi->showUI();
  361. }
  362. else
  363. fUi->showUI();
  364. }
  365. else if (fNextUiAction == 0) // close
  366. {
  367. CARLA_ASSERT(fUi != nullptr);
  368. if (fUi != nullptr)
  369. {
  370. delete fUi;
  371. fUi = nullptr;
  372. }
  373. }
  374. fNextUiAction = -1;
  375. if (fUiClosed != 0)
  376. {
  377. fUiClosed = 0;
  378. fNextUiAction = 0;
  379. kHost->ui_closed(kHost->handle);
  380. }
  381. Fl::check();
  382. Fl::unlock();
  383. #endif
  384. if (fChangeProgram)
  385. {
  386. fChangeProgram = false;
  387. sPrograms.load(fMaster, fNextChannel, fNextBank, fNextProgram);
  388. fNextChannel = 0;
  389. fNextBank = 0;
  390. fNextProgram = 0;
  391. #ifdef WANT_ZYNADDSUBFX_UI
  392. if (fUi != nullptr)
  393. {
  394. Fl::lock();
  395. fUi->refresh_master_ui();
  396. Fl::unlock();
  397. }
  398. #endif
  399. carla_msleep(15);
  400. }
  401. else
  402. {
  403. carla_msleep(30);
  404. }
  405. }
  406. #ifdef WANT_ZYNADDSUBFX_UI
  407. if (shouldThreadExit() || fUi != nullptr)
  408. {
  409. Fl::lock();
  410. delete fUi;
  411. fUi = nullptr;
  412. Fl::check();
  413. Fl::unlock();
  414. }
  415. #endif
  416. }
  417. private:
  418. Master* fMaster;
  419. const NativeHostDescriptor* const kHost;
  420. #ifdef WANT_ZYNADDSUBFX_UI
  421. MasterUI* fUi;
  422. int fUiClosed;
  423. volatile int fNextUiAction;
  424. #endif
  425. volatile bool fChangeProgram;
  426. volatile uint8_t fNextChannel;
  427. volatile uint32_t fNextBank;
  428. volatile uint32_t fNextProgram;
  429. };
  430. // -----------------------------------------------------------------------
  431. class ZynAddSubFxPlugin : public NativePluginClass
  432. {
  433. public:
  434. ZynAddSubFxPlugin(const NativeHostDescriptor* const host)
  435. : NativePluginClass(host),
  436. fMaster(new Master()),
  437. fSampleRate(getSampleRate()),
  438. fIsActive(false),
  439. fThread(fMaster, host)
  440. {
  441. fThread.startThread();
  442. for (int i = 0; i < NUM_MIDI_PARTS; ++i)
  443. fMaster->partonoff(i, 1);
  444. sPrograms.init();
  445. #if 0
  446. // create instance if needed
  447. getGlobalMutex();
  448. #endif
  449. }
  450. ~ZynAddSubFxPlugin() override
  451. {
  452. deleteMaster();
  453. }
  454. protected:
  455. // -------------------------------------------------------------------
  456. // Plugin midi-program calls
  457. uint32_t getMidiProgramCount() const override
  458. {
  459. return sPrograms.count();
  460. }
  461. const NativeMidiProgram* getMidiProgramInfo(const uint32_t index) const override
  462. {
  463. return sPrograms.getInfo(index);
  464. }
  465. // -------------------------------------------------------------------
  466. // Plugin state calls
  467. void setMidiProgram(const uint8_t channel, const uint32_t bank, const uint32_t program) override
  468. {
  469. if (bank >= fMaster->bank.banks.size())
  470. return;
  471. if (program >= BANK_SIZE)
  472. return;
  473. if (isOffline() || ! fIsActive)
  474. {
  475. sPrograms.load(fMaster, channel, bank, program);
  476. #ifdef WANT_ZYNADDSUBFX_UI
  477. fThread.uiRepaint();
  478. #endif
  479. }
  480. else
  481. fThread.loadProgramLater(channel, bank, program);
  482. }
  483. void setCustomData(const char* const key, const char* const value) override
  484. {
  485. CARLA_SAFE_ASSERT_RETURN(key != nullptr,);
  486. CARLA_SAFE_ASSERT_RETURN(value != nullptr,);
  487. pthread_mutex_lock(&fMaster->mutex);
  488. if (std::strcmp(key, "CarlaAlternateFile1") == 0) // xmz
  489. {
  490. fMaster->defaults();
  491. fMaster->loadXML(value);
  492. }
  493. else if (std::strcmp(key, "CarlaAlternateFile2") == 0) // xiz
  494. {
  495. fMaster->part[0]->defaultsinstrument();
  496. fMaster->part[0]->loadXMLinstrument(value);
  497. }
  498. pthread_mutex_unlock(&fMaster->mutex);
  499. fMaster->applyparameters();
  500. }
  501. // -------------------------------------------------------------------
  502. // Plugin process calls
  503. void activate() override
  504. {
  505. fIsActive = true;
  506. }
  507. void deactivate() override
  508. {
  509. fIsActive = false;
  510. }
  511. void process(float**, float** const outBuffer, const uint32_t frames, const NativeMidiEvent* const midiEvents, const uint32_t midiEventCount) override
  512. {
  513. if (pthread_mutex_trylock(&fMaster->mutex) != 0)
  514. {
  515. FLOAT_CLEAR(outBuffer[0], frames);
  516. FLOAT_CLEAR(outBuffer[1], frames);
  517. return;
  518. }
  519. #if 0
  520. const CarlaMutexLocker csm(getGlobalMutex());
  521. #endif
  522. for (uint32_t i=0; i < midiEventCount; ++i)
  523. {
  524. const NativeMidiEvent* const midiEvent(&midiEvents[i]);
  525. const uint8_t status = MIDI_GET_STATUS_FROM_DATA(midiEvent->data);
  526. const uint8_t channel = MIDI_GET_CHANNEL_FROM_DATA(midiEvent->data);
  527. if (MIDI_IS_STATUS_NOTE_OFF(status))
  528. {
  529. const uint8_t note = midiEvent->data[1];
  530. fMaster->noteOff(channel, note);
  531. }
  532. else if (MIDI_IS_STATUS_NOTE_ON(status))
  533. {
  534. const uint8_t note = midiEvent->data[1];
  535. const uint8_t velo = midiEvent->data[2];
  536. fMaster->noteOn(channel, note, velo);
  537. }
  538. else if (MIDI_IS_STATUS_POLYPHONIC_AFTERTOUCH(status))
  539. {
  540. const uint8_t note = midiEvent->data[1];
  541. const uint8_t pressure = midiEvent->data[2];
  542. fMaster->polyphonicAftertouch(channel, note, pressure);
  543. }
  544. else if (MIDI_IS_STATUS_CONTROL_CHANGE(status))
  545. {
  546. const uint8_t control = midiEvent->data[1];
  547. const uint8_t value = midiEvent->data[2];
  548. fMaster->setController(channel, control, value);
  549. }
  550. else if (MIDI_IS_STATUS_PITCH_WHEEL_CONTROL(status))
  551. {
  552. const uint8_t lsb = midiEvent->data[1];
  553. const uint8_t msb = midiEvent->data[2];
  554. const int value = ((msb << 7) | lsb) - 8192;
  555. fMaster->setController(channel, C_pitchwheel, value);
  556. }
  557. }
  558. fMaster->GetAudioOutSamples(frames, fSampleRate, outBuffer[0], outBuffer[1]);
  559. pthread_mutex_unlock(&fMaster->mutex);
  560. }
  561. #ifdef WANT_ZYNADDSUBFX_UI
  562. // -------------------------------------------------------------------
  563. // Plugin UI calls
  564. void uiShow(const bool show) override
  565. {
  566. if (show)
  567. fThread.uiShow();
  568. else
  569. fThread.uiHide();
  570. }
  571. #endif
  572. // -------------------------------------------------------------------
  573. // Plugin state calls
  574. char* getState() const override
  575. {
  576. config.save();
  577. char* data = nullptr;
  578. fMaster->getalldata(&data);
  579. return data;
  580. }
  581. void setState(const char* const data) override
  582. {
  583. fThread.stopLoadProgramLater();
  584. fMaster->putalldata((char*)data, 0);
  585. fMaster->applyparameters(true);
  586. }
  587. // -------------------------------------------------------------------
  588. // Plugin dispatcher
  589. // TODO - save&load current state
  590. void bufferSizeChanged(const uint32_t) final
  591. {
  592. deleteMaster();
  593. sInstanceCount.maybeReinit(getHostHandle());
  594. initMaster();
  595. }
  596. void sampleRateChanged(const double sampleRate) final
  597. {
  598. fSampleRate = sampleRate;
  599. deleteMaster();
  600. sInstanceCount.maybeReinit(getHostHandle());
  601. initMaster();
  602. }
  603. void initMaster()
  604. {
  605. fMaster = new Master();
  606. fThread.setMaster(fMaster);
  607. fThread.startThread();
  608. for (int i = 0; i < NUM_MIDI_PARTS; ++i)
  609. fMaster->partonoff(i, 1);
  610. }
  611. void deleteMaster()
  612. {
  613. //ensure that everything has stopped
  614. pthread_mutex_lock(&fMaster->mutex);
  615. pthread_mutex_unlock(&fMaster->mutex);
  616. fThread.stopThread(-1);
  617. delete fMaster;
  618. fMaster = nullptr;
  619. }
  620. #ifdef WANT_ZYNADDSUBFX_UI
  621. void uiNameChanged(const char* const uiName) override
  622. {
  623. fThread.uiChangeName(uiName);
  624. }
  625. #endif
  626. // -------------------------------------------------------------------
  627. private:
  628. Master* fMaster;
  629. unsigned fSampleRate;
  630. bool fIsActive;
  631. ZynAddSubFxThread fThread;
  632. #if 0
  633. // -------------------------------------------------------------------
  634. static CarlaMutex& getGlobalMutex() noexcept
  635. {
  636. static CarlaMutex m;
  637. return m;
  638. }
  639. #endif
  640. // -------------------------------------------------------------------
  641. public:
  642. static NativePluginHandle _instantiate(const NativeHostDescriptor* host)
  643. {
  644. sInstanceCount.addOne(host);
  645. return new ZynAddSubFxPlugin(host);
  646. }
  647. static void _cleanup(NativePluginHandle handle)
  648. {
  649. delete (ZynAddSubFxPlugin*)handle;
  650. sInstanceCount.removeOne();
  651. }
  652. CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(ZynAddSubFxPlugin)
  653. };
  654. // -----------------------------------------------------------------------
  655. static const NativePluginDescriptor zynaddsubfxDesc = {
  656. /* category */ PLUGIN_CATEGORY_SYNTH,
  657. #ifdef WANT_ZYNADDSUBFX_UI
  658. /* hints */ static_cast<NativePluginHints>(PLUGIN_IS_SYNTH|PLUGIN_HAS_UI|PLUGIN_USES_MULTI_PROGS|PLUGIN_USES_STATE),
  659. #else
  660. /* hints */ static_cast<NativePluginHints>(PLUGIN_IS_SYNTH|PLUGIN_USES_MULTI_PROGS|PLUGIN_USES_STATE),
  661. #endif
  662. /* supports */ static_cast<NativePluginSupports>(PLUGIN_SUPPORTS_CONTROL_CHANGES|PLUGIN_SUPPORTS_NOTE_AFTERTOUCH|PLUGIN_SUPPORTS_PITCHBEND|PLUGIN_SUPPORTS_ALL_SOUND_OFF),
  663. /* audioIns */ 0,
  664. /* audioOuts */ 2,
  665. /* midiIns */ 1,
  666. /* midiOuts */ 0,
  667. /* paramIns */ 0,
  668. /* paramOuts */ 0,
  669. /* name */ "ZynAddSubFX",
  670. /* label */ "zynaddsubfx",
  671. /* maker */ "falkTX, Mark McCurry, Nasca Octavian Paul",
  672. /* copyright */ "GNU GPL v2+",
  673. PluginDescriptorFILL(ZynAddSubFxPlugin)
  674. };
  675. // -----------------------------------------------------------------------
  676. CARLA_EXPORT
  677. void carla_register_native_plugin_zynaddsubfx_synth()
  678. {
  679. carla_register_native_plugin(&zynaddsubfxDesc);
  680. }
  681. // -----------------------------------------------------------------------