DISTRHO Nekobi
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.

131 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-2022 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. #include "nekobee-src/nekobee_synth.h"
  22. START_NAMESPACE_DISTRHO
  23. // -----------------------------------------------------------------------
  24. class DistrhoPluginNekobi : public Plugin
  25. {
  26. public:
  27. enum Parameters
  28. {
  29. paramWaveform = 0,
  30. paramTuning,
  31. paramCutoff,
  32. paramResonance,
  33. paramEnvMod,
  34. paramDecay,
  35. paramAccent,
  36. paramVolume,
  37. paramCount
  38. };
  39. DistrhoPluginNekobi();
  40. ~DistrhoPluginNekobi() override;
  41. protected:
  42. // -------------------------------------------------------------------
  43. // Information
  44. const char* getLabel() const noexcept override
  45. {
  46. return "Nekobi";
  47. }
  48. const char* getDescription() const override
  49. {
  50. return "Simple single-oscillator synth based on the Roland TB-303.";
  51. }
  52. const char* getMaker() const noexcept override
  53. {
  54. return "Sean Bolton, falkTX";
  55. }
  56. const char* getHomePage() const override
  57. {
  58. return "https://github.com/DISTRHO/Nekobi";
  59. }
  60. const char* getLicense() const noexcept override
  61. {
  62. return "GPL v2+";
  63. }
  64. uint32_t getVersion() const noexcept override
  65. {
  66. return d_version(1, 1, 0);
  67. }
  68. int64_t getUniqueId() const noexcept override
  69. {
  70. return d_cconst('D', 'N', 'e', 'k');
  71. }
  72. // -------------------------------------------------------------------
  73. // Init
  74. void initAudioPort(bool input, uint32_t index, AudioPort& port) override;
  75. void initParameter(uint32_t index, Parameter& parameter) override;
  76. // -------------------------------------------------------------------
  77. // Internal data
  78. float getParameterValue(uint32_t index) const override;
  79. void setParameterValue(uint32_t index, float value) override;
  80. // -------------------------------------------------------------------
  81. // Process
  82. void activate() override;
  83. void deactivate() override;
  84. void run(const float**, float** outputs, uint32_t frames, const MidiEvent* midiEvents, uint32_t midiEventCount) override;
  85. // -------------------------------------------------------------------
  86. private:
  87. struct ParamValues {
  88. float waveform;
  89. float tuning;
  90. float cutoff;
  91. float resonance;
  92. float envMod;
  93. float decay;
  94. float accent;
  95. float volume;
  96. } fParams;
  97. nekobee_synth_t fSynth;
  98. DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(DistrhoPluginNekobi)
  99. };
  100. // -----------------------------------------------------------------------
  101. END_NAMESPACE_DISTRHO
  102. #endif // DISTRHO_PLUGIN_NEKOBI_HPP_INCLUDED