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.

92 lines
2.5KB

  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. ==============================================================================
  23. */
  24. #ifndef __JUCETICE_VEXCVOICE_HEADER__
  25. #define __JUCETICE_VEXCVOICE_HEADER__
  26. #ifdef CARLA_EXPORT
  27. #include "juce_audio_basics.h"
  28. #else
  29. #include "../StandardHeader.h"
  30. #endif
  31. #include "cADSR.h"
  32. #include "cWaveRenderer.h"
  33. class VexVoice
  34. {
  35. public:
  36. VexVoice(const float* const p, int poff, WaveRenderer& w, float sr = 44100);
  37. void updateParameterPtr(const float* const p);
  38. void doProcess(float* outBufferL, float* outBufferR, int bufferSize);
  39. void start(float f, float v, int n, int preroll, double s, long o);
  40. void release(int p);
  41. void quickRelease();
  42. void kill();
  43. void update(const int index);
  44. long getOrdinal() const;
  45. int getNote() const;
  46. bool getIsOn() const;
  47. bool getIsReleased() const;
  48. private:
  49. OscSet oL;
  50. OscSet oR;
  51. WaveRenderer& wr;
  52. VexADSR aadsr;
  53. VexADSR fadsr;
  54. const float* parameters;
  55. const int poff;
  56. bool isOn, isReleased;
  57. int note;
  58. long Ordinal;
  59. float Avelocity;
  60. float Fvelocity;
  61. double SampleRate;
  62. float BaseFrequency;
  63. float lfoC, LFOA, LFOP, LFOF;
  64. float lfoS[2];
  65. float lowL, bandL, highL, lowR, bandR, highR, q, cut;
  66. };
  67. #endif