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.

137 lines
3.7KB

  1. /*
  2. * Segment Juice Plugin
  3. * Copyright (C) 2014 Andre Sklenar <andre.sklenar@gmail.com>, www.juicelab.cz
  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. #ifndef SEGMENTJUICEPLUGIN_HPP_INCLUDED
  18. #define SEGMENTJUICEPLUGIN_HPP_INCLUDED
  19. #include "DistrhoPlugin.hpp"
  20. #include <iostream>
  21. #include "Synth.hxx"
  22. START_NAMESPACE_DISTRHO
  23. // -----------------------------------------------------------------------
  24. class SegmentJuicePlugin : public Plugin
  25. {
  26. public:
  27. enum Parameters
  28. {
  29. paramWave1 = 0,
  30. paramWave2,
  31. paramWave3,
  32. paramWave4,
  33. paramWave5,
  34. paramWave6,
  35. paramFM1,
  36. paramFM2,
  37. paramFM3,
  38. paramFM4,
  39. paramFM5,
  40. paramFM6,
  41. paramPan1,
  42. paramPan2,
  43. paramPan3,
  44. paramPan4,
  45. paramPan5,
  46. paramPan6,
  47. paramAmp1,
  48. paramAmp2,
  49. paramAmp3,
  50. paramAmp4,
  51. paramAmp5,
  52. paramAmp6,
  53. paramAttack,
  54. paramDecay,
  55. paramSustain,
  56. paramRelease,
  57. paramStereo,
  58. paramTune,
  59. paramVolume,
  60. paramGlide,
  61. paramCount
  62. };
  63. SegmentJuicePlugin();
  64. ~SegmentJuicePlugin() override;
  65. protected:
  66. // -------------------------------------------------------------------
  67. // Information
  68. const char* d_getLabel() const noexcept override
  69. {
  70. return "SegmentJuice";
  71. }
  72. const char* d_getMaker() const noexcept override
  73. {
  74. return "Andre Sklenar";
  75. }
  76. const char* d_getLicense() const noexcept override
  77. {
  78. return "GPL v2+";
  79. }
  80. uint32_t d_getVersion() const noexcept override
  81. {
  82. return 0x1000;
  83. }
  84. long d_getUniqueId() const noexcept override
  85. {
  86. return d_cconst('S', 'g', 't', 'J');
  87. }
  88. // -------------------------------------------------------------------
  89. // Init
  90. void d_initParameter(uint32_t index, Parameter& parameter) override;
  91. void d_initProgramName(uint32_t index, d_string& programName) override;
  92. // -------------------------------------------------------------------
  93. // Internal data
  94. float d_getParameterValue(uint32_t index) const override;
  95. void d_setParameterValue(uint32_t index, float value) override;
  96. void d_setProgram(uint32_t index) override;
  97. // -------------------------------------------------------------------
  98. // Process
  99. void d_activate() override;
  100. void d_deactivate() override;
  101. void d_run(const float** inputs, float** outputs, uint32_t frames, const MidiEvent* midiEvents, uint32_t midiEventCount) override;
  102. // -------------------------------------------------------------------
  103. private:
  104. CSynth synthL, synthR;
  105. float wave1, wave2, wave3, wave4, wave5, wave6;
  106. float FM1, FM2, FM3, FM4, FM5, FM6;
  107. float pan1, pan2, pan3, pan4, pan5, pan6;
  108. float amp1, amp2, amp3, amp4, amp5, amp6;
  109. float attack, decay, sustain, release, stereo, tune, volume, glide;
  110. };
  111. // -----------------------------------------------------------------------
  112. END_NAMESPACE_DISTRHO
  113. #endif // SEGMENTJUICE_HPP_INCLUDED