External plugins for 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.

134 lines
3.5KB

  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. paramBypass,
  40. paramCount
  41. };
  42. DistrhoPluginNekobi();
  43. ~DistrhoPluginNekobi() override;
  44. protected:
  45. // -------------------------------------------------------------------
  46. // Information
  47. const char* getLabel() const noexcept override
  48. {
  49. return "Nekobi";
  50. }
  51. const char* getDescription() const override
  52. {
  53. return "Simple single-oscillator synth based on the Roland TB-303.";
  54. }
  55. const char* getMaker() const noexcept override
  56. {
  57. return "Sean Bolton, falkTX";
  58. }
  59. const char* getHomePage() const override
  60. {
  61. return "https://github.com/DISTRHO/Nekobi";
  62. }
  63. const char* getLicense() const noexcept override
  64. {
  65. return "GPL v2+";
  66. }
  67. uint32_t getVersion() const noexcept override
  68. {
  69. return d_version(1, 1, 0);
  70. }
  71. int64_t getUniqueId() const noexcept override
  72. {
  73. return d_cconst('D', 'N', 'e', 'k');
  74. }
  75. // -------------------------------------------------------------------
  76. // Init
  77. void initParameter(uint32_t index, Parameter& parameter) override;
  78. // -------------------------------------------------------------------
  79. // Internal data
  80. float getParameterValue(uint32_t index) const override;
  81. void setParameterValue(uint32_t index, float value) override;
  82. // -------------------------------------------------------------------
  83. // Process
  84. void activate() override;
  85. void deactivate() override;
  86. void run(const float**, float** outputs, uint32_t frames, const MidiEvent* midiEvents, uint32_t midiEventCount) override;
  87. // -------------------------------------------------------------------
  88. private:
  89. struct ParamValues {
  90. float waveform;
  91. float tuning;
  92. float cutoff;
  93. float resonance;
  94. float envMod;
  95. float decay;
  96. float accent;
  97. float volume;
  98. bool bypass;
  99. } fParams;
  100. nekobee_synth_t fSynth;
  101. DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(DistrhoPluginNekobi)
  102. };
  103. // -----------------------------------------------------------------------
  104. END_NAMESPACE_DISTRHO
  105. #endif // DISTRHO_PLUGIN_NEKOBI_HPP_INCLUDED