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.

DistrhoPluginNekobi.hpp 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. /*
  2. * DISTRHO Nekobi Plugin, based on Nekobee by Sean Bolton and others.
  3. * Copyright (C) 2004 Sean Bolton and others
  4. * Copyright (C) 2013-2015 Filipe Coelho <falktx@falktx.com>
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License as
  8. * published by the Free Software Foundation; either version 2 of
  9. * the License, or any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * For a full copy of the GNU General Public License see the LICENSE file.
  17. */
  18. #ifndef DISTRHO_PLUGIN_NEKOBI_HPP_INCLUDED
  19. #define DISTRHO_PLUGIN_NEKOBI_HPP_INCLUDED
  20. #include "DistrhoPlugin.hpp"
  21. extern "C" {
  22. #include "nekobee-src/nekobee_synth.h"
  23. }
  24. START_NAMESPACE_DISTRHO
  25. // -----------------------------------------------------------------------
  26. class DistrhoPluginNekobi : public Plugin
  27. {
  28. public:
  29. enum Parameters
  30. {
  31. paramWaveform = 0,
  32. paramTuning,
  33. paramCutoff,
  34. paramResonance,
  35. paramEnvMod,
  36. paramDecay,
  37. paramAccent,
  38. paramVolume,
  39. paramCount
  40. };
  41. DistrhoPluginNekobi();
  42. ~DistrhoPluginNekobi() override;
  43. protected:
  44. // -------------------------------------------------------------------
  45. // Information
  46. const char* getLabel() const noexcept override
  47. {
  48. return "Nekobi";
  49. }
  50. const char* getMaker() const noexcept override
  51. {
  52. return "Sean Bolton, falkTX";
  53. }
  54. const char* getLicense() const noexcept override
  55. {
  56. return "GPL v2+";
  57. }
  58. uint32_t getVersion() const noexcept override
  59. {
  60. return 0x1000;
  61. }
  62. int64_t getUniqueId() const noexcept override
  63. {
  64. return d_cconst('D', 'N', 'e', 'k');
  65. }
  66. // -------------------------------------------------------------------
  67. // Init
  68. void initParameter(uint32_t index, Parameter& parameter) override;
  69. // -------------------------------------------------------------------
  70. // Internal data
  71. float getParameterValue(uint32_t index) const override;
  72. void setParameterValue(uint32_t index, float value) override;
  73. // -------------------------------------------------------------------
  74. // Process
  75. void activate() override;
  76. void deactivate() override;
  77. void run(const float**, float** outputs, uint32_t frames, const MidiEvent* midiEvents, uint32_t midiEventCount) override;
  78. // -------------------------------------------------------------------
  79. private:
  80. struct ParamValues {
  81. float waveform;
  82. float tuning;
  83. float cutoff;
  84. float resonance;
  85. float envMod;
  86. float decay;
  87. float accent;
  88. float volume;
  89. } fParams;
  90. nekobee_synth_t fSynth;
  91. DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(DistrhoPluginNekobi)
  92. };
  93. // -----------------------------------------------------------------------
  94. END_NAMESPACE_DISTRHO
  95. #endif // DISTRHO_PLUGIN_NEKOBI_HPP_INCLUDED