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.

815 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));
  135. fRetProgram.bank = pInfo->bank;
  136. fRetProgram.program = pInfo->prog;
  137. fRetProgram.name = pInfo->name;
  138. return &fRetProgram;
  139. }
  140. private:
  141. struct ProgramInfo {
  142. uint32_t bank;
  143. uint32_t prog;
  144. const char* name;
  145. ProgramInfo(uint32_t bank_, uint32_t prog_, const char* name_)
  146. : bank(bank_),
  147. prog(prog_),
  148. name(carla_strdup(name_)) {}
  149. ~ProgramInfo()
  150. {
  151. if (name != nullptr)
  152. {
  153. delete[] name;
  154. name = nullptr;
  155. }
  156. }
  157. #ifdef CARLA_PROPER_CPP11_SUPPORT
  158. ProgramInfo() = delete;
  159. ProgramInfo(ProgramInfo&) = delete;
  160. ProgramInfo(const ProgramInfo&) = delete;
  161. ProgramInfo& operator=(ProgramInfo&);
  162. ProgramInfo& operator=(const ProgramInfo&);
  163. #endif
  164. };
  165. bool fInitiated;
  166. NativeMidiProgram fRetProgram;
  167. LinkedList<const ProgramInfo*> fPrograms;
  168. CARLA_DECLARE_NON_COPY_CLASS(ZynAddSubFxPrograms)
  169. };
  170. static ZynAddSubFxPrograms sPrograms;
  171. // -----------------------------------------------------------------------
  172. class ZynAddSubFxInstanceCount
  173. {
  174. public:
  175. ZynAddSubFxInstanceCount()
  176. : fCount(0)
  177. {
  178. }
  179. ~ZynAddSubFxInstanceCount()
  180. {
  181. CARLA_ASSERT(fCount == 0);
  182. }
  183. void addOne(const NativeHostDescriptor* const host)
  184. {
  185. if (fCount++ == 0)
  186. {
  187. CARLA_ASSERT(synth == nullptr);
  188. CARLA_ASSERT(denormalkillbuf == nullptr);
  189. reinit(host);
  190. #ifdef WANT_ZYNADDSUBFX_UI
  191. if (gPixmapPath.isEmpty())
  192. {
  193. gPixmapPath = host->resourceDir;
  194. gPixmapPath += "/zynaddsubfx/";
  195. gUiPixmapPath = gPixmapPath;
  196. }
  197. #endif
  198. }
  199. }
  200. void removeOne()
  201. {
  202. if (--fCount == 0)
  203. {
  204. CARLA_ASSERT(synth != nullptr);
  205. CARLA_ASSERT(denormalkillbuf != nullptr);
  206. Master::deleteInstance();
  207. delete[] denormalkillbuf;
  208. denormalkillbuf = nullptr;
  209. delete synth;
  210. synth = nullptr;
  211. }
  212. }
  213. void reinit(const NativeHostDescriptor* const host)
  214. {
  215. Master::deleteInstance();
  216. if (denormalkillbuf != nullptr)
  217. {
  218. delete[] denormalkillbuf;
  219. denormalkillbuf = nullptr;
  220. }
  221. if (synth != nullptr)
  222. {
  223. delete synth;
  224. synth = nullptr;
  225. }
  226. synth = new SYNTH_T();
  227. synth->buffersize = host->get_buffer_size(host->handle);
  228. synth->samplerate = host->get_sample_rate(host->handle);
  229. if (synth->buffersize > 32)
  230. synth->buffersize = 32;
  231. synth->alias();
  232. config.init();
  233. config.cfg.SoundBufferSize = synth->buffersize;
  234. config.cfg.SampleRate = synth->samplerate;
  235. config.cfg.GzipCompression = 0;
  236. sprng(std::time(nullptr));
  237. denormalkillbuf = new float[synth->buffersize];
  238. for (int i=0; i < synth->buffersize; ++i)
  239. denormalkillbuf[i] = (RND - 0.5f) * 1e-16;
  240. Master::getInstance();
  241. }
  242. void maybeReinit(const NativeHostDescriptor* const host)
  243. {
  244. if (host->get_buffer_size(host->handle) == static_cast<uint32_t>(synth->buffersize) &&
  245. host->get_sample_rate(host->handle) == static_cast<double>(synth->samplerate))
  246. return;
  247. reinit(host);
  248. }
  249. private:
  250. int fCount;
  251. CARLA_DECLARE_NON_COPY_CLASS(ZynAddSubFxInstanceCount)
  252. };
  253. static ZynAddSubFxInstanceCount sInstanceCount;
  254. // -----------------------------------------------------------------------
  255. class ZynAddSubFxThread : public CarlaThread
  256. {
  257. public:
  258. ZynAddSubFxThread(Master* const master, const NativeHostDescriptor* const host)
  259. : CarlaThread("ZynAddSubFxThread"),
  260. fMaster(master),
  261. kHost(host),
  262. #ifdef WANT_ZYNADDSUBFX_UI
  263. fUi(nullptr),
  264. fUiClosed(0),
  265. fNextUiAction(-1),
  266. #endif
  267. fChangeProgram(false),
  268. fNextChannel(0),
  269. fNextBank(0),
  270. fNextProgram(0)
  271. {
  272. }
  273. ~ZynAddSubFxThread()
  274. {
  275. #ifdef WANT_ZYNADDSUBFX_UI
  276. // must be closed by now
  277. CARLA_ASSERT(fUi == nullptr);
  278. #endif
  279. }
  280. void loadProgramLater(const uint8_t channel, const uint32_t bank, const uint32_t program)
  281. {
  282. fNextChannel = channel;
  283. fNextBank = bank;
  284. fNextProgram = program;
  285. fChangeProgram = true;
  286. }
  287. void stopLoadProgramLater()
  288. {
  289. fChangeProgram = false;
  290. fNextChannel = 0;
  291. fNextBank = 0;
  292. fNextProgram = 0;
  293. }
  294. void setMaster(Master* const master)
  295. {
  296. fMaster = master;
  297. }
  298. #ifdef WANT_ZYNADDSUBFX_UI
  299. void uiHide()
  300. {
  301. fNextUiAction = 0;
  302. }
  303. void uiShow()
  304. {
  305. fNextUiAction = 1;
  306. }
  307. void uiRepaint()
  308. {
  309. if (fUi != nullptr)
  310. fNextUiAction = 2;
  311. }
  312. void uiChangeName(const char* const name)
  313. {
  314. if (fUi != nullptr)
  315. {
  316. Fl::lock();
  317. fUi->masterwindow->label(name);
  318. Fl::unlock();
  319. }
  320. }
  321. #endif
  322. protected:
  323. void run() override
  324. {
  325. while (! shouldThreadExit())
  326. {
  327. #ifdef WANT_ZYNADDSUBFX_UI
  328. Fl::lock();
  329. if (fNextUiAction == 2) // repaint
  330. {
  331. CARLA_ASSERT(fUi != nullptr);
  332. if (fUi != nullptr)
  333. fUi->refresh_master_ui();
  334. }
  335. else if (fNextUiAction == 1) // init/show
  336. {
  337. static bool initialized = false;
  338. if (! initialized)
  339. {
  340. initialized = true;
  341. fl_register_images();
  342. Fl_Dial::default_style(Fl_Dial::PIXMAP_DIAL);
  343. if (Fl_Shared_Image* const img = Fl_Shared_Image::get(gPixmapPath + "knob.png"))
  344. Fl_Dial::default_image(img);
  345. if (Fl_Shared_Image* const img = Fl_Shared_Image::get(gPixmapPath + "window_backdrop.png"))
  346. Fl::scheme_bg(new Fl_Tiled_Image(img));
  347. if(Fl_Shared_Image* const img = Fl_Shared_Image::get(gPixmapPath + "module_backdrop.png"))
  348. gModuleBackdrop = new Fl_Tiled_Image(img);
  349. Fl::background(50, 50, 50);
  350. Fl::background2(70, 70, 70);
  351. Fl::foreground(255, 255, 255);
  352. Fl_Theme::set("Cairo");
  353. }
  354. CARLA_ASSERT(fUi == nullptr);
  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. }
  363. else if (fNextUiAction == 0) // close
  364. {
  365. CARLA_ASSERT(fUi != nullptr);
  366. if (fUi != nullptr)
  367. {
  368. delete fUi;
  369. fUi = nullptr;
  370. }
  371. }
  372. fNextUiAction = -1;
  373. if (fUiClosed != 0)
  374. {
  375. fUiClosed = 0;
  376. fNextUiAction = 0;
  377. kHost->ui_closed(kHost->handle);
  378. }
  379. Fl::check();
  380. Fl::unlock();
  381. #endif
  382. if (fChangeProgram)
  383. {
  384. fChangeProgram = false;
  385. sPrograms.load(fMaster, fNextChannel, fNextBank, fNextProgram);
  386. fNextChannel = 0;
  387. fNextBank = 0;
  388. fNextProgram = 0;
  389. #ifdef WANT_ZYNADDSUBFX_UI
  390. if (fUi != nullptr)
  391. {
  392. Fl::lock();
  393. fUi->refresh_master_ui();
  394. Fl::unlock();
  395. }
  396. #endif
  397. carla_msleep(15);
  398. }
  399. else
  400. {
  401. carla_msleep(30);
  402. }
  403. }
  404. #ifdef WANT_ZYNADDSUBFX_UI
  405. if (shouldThreadExit() || fUi != nullptr)
  406. {
  407. Fl::lock();
  408. delete fUi;
  409. fUi = nullptr;
  410. Fl::check();
  411. Fl::unlock();
  412. }
  413. #endif
  414. }
  415. private:
  416. Master* fMaster;
  417. const NativeHostDescriptor* const kHost;
  418. #ifdef WANT_ZYNADDSUBFX_UI
  419. MasterUI* fUi;
  420. int fUiClosed;
  421. volatile int fNextUiAction;
  422. #endif
  423. volatile bool fChangeProgram;
  424. volatile uint8_t fNextChannel;
  425. volatile uint32_t fNextBank;
  426. volatile uint32_t fNextProgram;
  427. };
  428. // -----------------------------------------------------------------------
  429. class ZynAddSubFxPlugin : public NativePluginClass
  430. {
  431. public:
  432. ZynAddSubFxPlugin(const NativeHostDescriptor* const host)
  433. : NativePluginClass(host),
  434. fMaster(new Master()),
  435. fSampleRate(getSampleRate()),
  436. fIsActive(false),
  437. fThread(fMaster, host)
  438. {
  439. fThread.startThread();
  440. for (int i = 0; i < NUM_MIDI_PARTS; ++i)
  441. fMaster->partonoff(i, 1);
  442. sPrograms.init();
  443. }
  444. ~ZynAddSubFxPlugin() override
  445. {
  446. deleteMaster();
  447. }
  448. protected:
  449. // -------------------------------------------------------------------
  450. // Plugin midi-program calls
  451. uint32_t getMidiProgramCount() const override
  452. {
  453. return sPrograms.count();
  454. }
  455. const NativeMidiProgram* getMidiProgramInfo(const uint32_t index) const override
  456. {
  457. return sPrograms.getInfo(index);
  458. }
  459. // -------------------------------------------------------------------
  460. // Plugin state calls
  461. void setMidiProgram(const uint8_t channel, const uint32_t bank, const uint32_t program) override
  462. {
  463. if (bank >= fMaster->bank.banks.size())
  464. return;
  465. if (program >= BANK_SIZE)
  466. return;
  467. if (isOffline() || ! fIsActive)
  468. {
  469. sPrograms.load(fMaster, channel, bank, program);
  470. #ifdef WANT_ZYNADDSUBFX_UI
  471. fThread.uiRepaint();
  472. #endif
  473. }
  474. else
  475. fThread.loadProgramLater(channel, bank, program);
  476. }
  477. void setCustomData(const char* const key, const char* const value) override
  478. {
  479. CARLA_SAFE_ASSERT_RETURN(key != nullptr,);
  480. CARLA_SAFE_ASSERT_RETURN(value != nullptr,);
  481. if (std::strcmp(key, "CarlaAlternateFile1") == 0) // xmz
  482. fMaster->loadXML(value);
  483. else if (std::strcmp(key, "CarlaAlternateFile2") == 0) // xiz
  484. fMaster->part[0]->loadXMLinstrument(value);
  485. }
  486. // -------------------------------------------------------------------
  487. // Plugin process calls
  488. void activate() override
  489. {
  490. fIsActive = true;
  491. }
  492. void deactivate() override
  493. {
  494. fIsActive = false;
  495. }
  496. void process(float**, float** const outBuffer, const uint32_t frames, const NativeMidiEvent* const midiEvents, const uint32_t midiEventCount) override
  497. {
  498. if (pthread_mutex_trylock(&fMaster->mutex) != 0)
  499. {
  500. FLOAT_CLEAR(outBuffer[0], frames);
  501. FLOAT_CLEAR(outBuffer[1], frames);
  502. return;
  503. }
  504. for (uint32_t i=0; i < midiEventCount; ++i)
  505. {
  506. const NativeMidiEvent* const midiEvent(&midiEvents[i]);
  507. const uint8_t status = MIDI_GET_STATUS_FROM_DATA(midiEvent->data);
  508. const uint8_t channel = MIDI_GET_CHANNEL_FROM_DATA(midiEvent->data);
  509. if (MIDI_IS_STATUS_NOTE_OFF(status))
  510. {
  511. const uint8_t note = midiEvent->data[1];
  512. fMaster->noteOff(channel, note);
  513. }
  514. else if (MIDI_IS_STATUS_NOTE_ON(status))
  515. {
  516. const uint8_t note = midiEvent->data[1];
  517. const uint8_t velo = midiEvent->data[2];
  518. fMaster->noteOn(channel, note, velo);
  519. }
  520. else if (MIDI_IS_STATUS_POLYPHONIC_AFTERTOUCH(status))
  521. {
  522. const uint8_t note = midiEvent->data[1];
  523. const uint8_t pressure = midiEvent->data[2];
  524. fMaster->polyphonicAftertouch(channel, note, pressure);
  525. }
  526. else if (MIDI_IS_STATUS_CONTROL_CHANGE(status))
  527. {
  528. const uint8_t control = midiEvent->data[1];
  529. const uint8_t value = midiEvent->data[2];
  530. fMaster->setController(channel, control, value);
  531. }
  532. else if (MIDI_IS_STATUS_PITCH_WHEEL_CONTROL(status))
  533. {
  534. const uint8_t lsb = midiEvent->data[1];
  535. const uint8_t msb = midiEvent->data[2];
  536. const int value = ((msb << 7) | lsb) - 8192;
  537. fMaster->setController(channel, C_pitchwheel, value);
  538. }
  539. }
  540. fMaster->GetAudioOutSamples(frames, fSampleRate, outBuffer[0], outBuffer[1]);
  541. pthread_mutex_unlock(&fMaster->mutex);
  542. }
  543. #ifdef WANT_ZYNADDSUBFX_UI
  544. // -------------------------------------------------------------------
  545. // Plugin UI calls
  546. void uiShow(const bool show) override
  547. {
  548. if (show)
  549. fThread.uiShow();
  550. else
  551. fThread.uiHide();
  552. }
  553. #endif
  554. // -------------------------------------------------------------------
  555. // Plugin state calls
  556. char* getState() const override
  557. {
  558. config.save();
  559. char* data = nullptr;
  560. fMaster->getalldata(&data);
  561. return data;
  562. }
  563. void setState(const char* const data) override
  564. {
  565. fThread.stopLoadProgramLater();
  566. fMaster->putalldata((char*)data, 0);
  567. fMaster->applyparameters(true);
  568. }
  569. // -------------------------------------------------------------------
  570. // Plugin dispatcher
  571. // TODO - save&load current state
  572. void bufferSizeChanged(const uint32_t) final
  573. {
  574. deleteMaster();
  575. sInstanceCount.maybeReinit(getHostHandle());
  576. initMaster();
  577. }
  578. void sampleRateChanged(const double sampleRate) final
  579. {
  580. fSampleRate = sampleRate;
  581. deleteMaster();
  582. sInstanceCount.maybeReinit(getHostHandle());
  583. initMaster();
  584. }
  585. void initMaster()
  586. {
  587. fMaster = new Master();
  588. fThread.setMaster(fMaster);
  589. fThread.startThread();
  590. for (int i = 0; i < NUM_MIDI_PARTS; ++i)
  591. fMaster->partonoff(i, 1);
  592. }
  593. void deleteMaster()
  594. {
  595. //ensure that everything has stopped
  596. pthread_mutex_lock(&fMaster->mutex);
  597. pthread_mutex_unlock(&fMaster->mutex);
  598. fThread.stopThread(-1);
  599. delete fMaster;
  600. fMaster = nullptr;
  601. }
  602. #ifdef WANT_ZYNADDSUBFX_UI
  603. void uiNameChanged(const char* const uiName) override
  604. {
  605. fThread.uiChangeName(uiName);
  606. }
  607. #endif
  608. // -------------------------------------------------------------------
  609. private:
  610. Master* fMaster;
  611. unsigned fSampleRate;
  612. bool fIsActive;
  613. ZynAddSubFxThread fThread;
  614. public:
  615. static NativePluginHandle _instantiate(const NativeHostDescriptor* host)
  616. {
  617. sInstanceCount.addOne(host);
  618. return new ZynAddSubFxPlugin(host);
  619. }
  620. static void _cleanup(NativePluginHandle handle)
  621. {
  622. delete (ZynAddSubFxPlugin*)handle;
  623. sInstanceCount.removeOne();
  624. }
  625. CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(ZynAddSubFxPlugin)
  626. };
  627. // -----------------------------------------------------------------------
  628. static const NativePluginDescriptor zynaddsubfxDesc = {
  629. /* category */ PLUGIN_CATEGORY_SYNTH,
  630. #ifdef WANT_ZYNADDSUBFX_UI
  631. /* hints */ static_cast<NativePluginHints>(PLUGIN_IS_SYNTH|PLUGIN_HAS_UI|PLUGIN_USES_MULTI_PROGS|PLUGIN_USES_STATE),
  632. #else
  633. /* hints */ static_cast<NativePluginHints>(PLUGIN_IS_SYNTH|PLUGIN_USES_MULTI_PROGS|PLUGIN_USES_STATE),
  634. #endif
  635. /* supports */ static_cast<NativePluginSupports>(PLUGIN_SUPPORTS_CONTROL_CHANGES|PLUGIN_SUPPORTS_NOTE_AFTERTOUCH|PLUGIN_SUPPORTS_PITCHBEND|PLUGIN_SUPPORTS_ALL_SOUND_OFF),
  636. /* audioIns */ 0,
  637. /* audioOuts */ 2,
  638. /* midiIns */ 1,
  639. /* midiOuts */ 0,
  640. /* paramIns */ 0,
  641. /* paramOuts */ 0,
  642. /* name */ "ZynAddSubFX",
  643. /* label */ "zynaddsubfx",
  644. /* maker */ "falkTX, Mark McCurry, Nasca Octavian Paul",
  645. /* copyright */ "GNU GPL v2+",
  646. PluginDescriptorFILL(ZynAddSubFxPlugin)
  647. };
  648. // -----------------------------------------------------------------------
  649. CARLA_EXPORT
  650. void carla_register_native_plugin_zynaddsubfx_synth()
  651. {
  652. carla_register_native_plugin(&zynaddsubfxDesc);
  653. }
  654. // -----------------------------------------------------------------------