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.

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