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.

PADnote.h 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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. bool firsttime;
  46. int nsample, portamento;
  47. int Compute_Linear(float *outl,
  48. float *outr,
  49. int freqhi,
  50. float freqlo);
  51. int Compute_Cubic(float *outl,
  52. float *outr,
  53. int freqhi,
  54. float freqlo);
  55. struct {
  56. /******************************************
  57. * FREQUENCY GLOBAL PARAMETERS *
  58. ******************************************/
  59. float Detune; //cents
  60. Envelope *FreqEnvelope;
  61. LFO *FreqLfo;
  62. /********************************************
  63. * AMPLITUDE GLOBAL PARAMETERS *
  64. ********************************************/
  65. float Volume; // [ 0 .. 1 ]
  66. float Panning; // [ 0 .. 1 ]
  67. Envelope *AmpEnvelope;
  68. LFO *AmpLfo;
  69. float Fadein_adjustment;
  70. struct {
  71. int Enabled;
  72. float initialvalue, dt, t;
  73. } Punch;
  74. /******************************************
  75. * FILTER GLOBAL PARAMETERS *
  76. ******************************************/
  77. class Filter * GlobalFilterL, *GlobalFilterR;
  78. float FilterCenterPitch; //octaves
  79. float FilterQ;
  80. float FilterFreqTracking;
  81. Envelope *FilterEnvelope;
  82. LFO *FilterLfo;
  83. } NoteGlobalPar;
  84. float globaloldamplitude, globalnewamplitude, velocity, realfreq;
  85. const int& interpolation;
  86. };
  87. #endif