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.

117 lines
3.4KB

  1. /*
  2. ZynAddSubFX - a software synthesizer
  3. PADnote.h - The "pad" synthesizer
  4. Copyright (C) 2002-2005 Nasca Octavian Paul
  5. Author: Nasca Octavian Paul
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of version 2 of the GNU General Public License
  8. as published by the Free Software Foundation.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License (version 2 or later) for more details.
  13. You should have received a copy of the GNU General Public License (version 2)
  14. along with this program; if not, write to the Free Software Foundation,
  15. Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  16. */
  17. #ifndef PAD_NOTE_H
  18. #define PAD_NOTE_H
  19. #include "SynthNote.h"
  20. #include "../globals.h"
  21. #include "Envelope.h"
  22. #include "LFO.h"
  23. /**The "pad" synthesizer*/
  24. class PADnote:public SynthNote
  25. {
  26. public:
  27. PADnote(const PADnoteParameters *parameters, SynthParams pars,
  28. const int &interpolation);
  29. ~PADnote();
  30. SynthNote *cloneLegato(void);
  31. void legatonote(LegatoParams pars);
  32. int noteout(float *outl, float *outr);
  33. int finished() const;
  34. void releasekey();
  35. private:
  36. void setup(float freq, float velocity, int portamento_,
  37. int midinote, bool legato = false);
  38. void fadein(float *smps);
  39. void computecurrentparameters();
  40. bool finished_;
  41. const PADnoteParameters &pars;
  42. int poshi_l, poshi_r;
  43. float poslo;
  44. float basefreq;
  45. float BendAdjust;
  46. float OffsetHz;
  47. bool firsttime;
  48. int nsample, portamento;
  49. int Compute_Linear(float *outl,
  50. float *outr,
  51. int freqhi,
  52. float freqlo);
  53. int Compute_Cubic(float *outl,
  54. float *outr,
  55. int freqhi,
  56. float freqlo);
  57. struct {
  58. /******************************************
  59. * FREQUENCY GLOBAL PARAMETERS *
  60. ******************************************/
  61. float Detune; //cents
  62. Envelope *FreqEnvelope;
  63. LFO *FreqLfo;
  64. /********************************************
  65. * AMPLITUDE GLOBAL PARAMETERS *
  66. ********************************************/
  67. float Volume; // [ 0 .. 1 ]
  68. float Panning; // [ 0 .. 1 ]
  69. Envelope *AmpEnvelope;
  70. LFO *AmpLfo;
  71. float Fadein_adjustment;
  72. struct {
  73. int Enabled;
  74. float initialvalue, dt, t;
  75. } Punch;
  76. /******************************************
  77. * FILTER GLOBAL PARAMETERS *
  78. ******************************************/
  79. class Filter * GlobalFilterL, *GlobalFilterR;
  80. float FilterCenterPitch; //octaves
  81. float FilterQ;
  82. float FilterFreqTracking;
  83. Envelope *FilterEnvelope;
  84. LFO *FilterLfo;
  85. } NoteGlobalPar;
  86. float globaloldamplitude, globalnewamplitude, velocity, realfreq;
  87. const int& interpolation;
  88. };
  89. #endif