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.

97 lines
2.6KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCETICE project - Copyright 2008 by Lucio Asnaghi.
  4. JUCETICE is based around the JUCE library - "Jules' Utility Class Extensions"
  5. Copyright 2008 by Julian Storer.
  6. ------------------------------------------------------------------------------
  7. JUCE and JUCETICE can be redistributed and/or modified under the terms of
  8. the GNU Lesser General Public License, as published by the Free Software
  9. Foundation; either version 2 of the License, or (at your option) any later
  10. version.
  11. JUCE and JUCETICE are distributed in the hope that they 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. You should have received a copy of the GNU Lesser General Public License
  16. along with JUCE and JUCETICE; if not, visit www.gnu.org/licenses or write to
  17. Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  18. Boston, MA 02111-1307 USA
  19. ==============================================================================
  20. @author rockhardbuns
  21. @tweaker Lucio Asnaghi
  22. @tweaker falkTX
  23. ==============================================================================
  24. */
  25. #ifndef DISTRHO_VEX_VOICE_HEADER_INCLUDED
  26. #define DISTRHO_VEX_VOICE_HEADER_INCLUDED
  27. #ifndef CARLA_EXPORT
  28. #define CARLA_EXPORT
  29. #endif
  30. #ifdef CARLA_EXPORT
  31. #include "juce_audio_basics.h"
  32. #else
  33. #include "../StandardHeader.h"
  34. #endif
  35. #include "VexADSR.h"
  36. #include "VexWaveRenderer.h"
  37. class VexVoice
  38. {
  39. public:
  40. VexVoice(const float* const p, int poff, WaveRenderer& w, float sr = 44100);
  41. void updateParameterPtr(const float* const p);
  42. void doProcess(float* outBufferL, float* outBufferR, int bufferSize);
  43. void start(float f, float v, int n, int preroll, double s, long o);
  44. void release(int p);
  45. void quickRelease();
  46. void kill();
  47. void update(const int index);
  48. long getOrdinal() const;
  49. int getNote() const;
  50. bool getIsOn() const;
  51. bool getIsReleased() const;
  52. private:
  53. OscSet oL;
  54. OscSet oR;
  55. WaveRenderer& wr;
  56. VexADSR aadsr;
  57. VexADSR fadsr;
  58. const float* parameters;
  59. const int poff;
  60. bool isOn, isReleased;
  61. int note;
  62. long Ordinal;
  63. float Avelocity;
  64. float Fvelocity;
  65. double SampleRate;
  66. float BaseFrequency;
  67. float lfoC, LFOA, LFOF;
  68. float lfoS[2];
  69. float lowL, bandL, highL, lowR, bandR, highR, q, cut;
  70. };
  71. #endif // DISTRHO_VEX_VOICE_HEADER_INCLUDED