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.

108 lines
3.0KB

  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
  7. modify it under the terms of the GNU General Public License
  8. as published by the Free Software Foundation; either version 2
  9. of the License, or (at your option) any later version.
  10. */
  11. #ifndef PAD_NOTE_H
  12. #define PAD_NOTE_H
  13. #include "SynthNote.h"
  14. #include "../globals.h"
  15. #include "Envelope.h"
  16. #include "LFO.h"
  17. namespace zyncarla {
  18. /**The "pad" synthesizer*/
  19. class PADnote:public SynthNote
  20. {
  21. public:
  22. PADnote(const PADnoteParameters *parameters, SynthParams pars,
  23. const int &interpolation, WatchManager *wm=0, const char *prefix=0);
  24. ~PADnote();
  25. SynthNote *cloneLegato(void);
  26. void legatonote(LegatoParams pars);
  27. int noteout(float *outl, float *outr);
  28. bool finished() const;
  29. void entomb(void);
  30. void releasekey();
  31. private:
  32. void setup(float freq, float velocity, int portamento_,
  33. int midinote, bool legato = false, WatchManager *wm=0, const char *prefix=0);
  34. void fadein(float *smps);
  35. void computecurrentparameters();
  36. bool finished_;
  37. const PADnoteParameters &pars;
  38. int poshi_l, poshi_r;
  39. float poslo;
  40. float basefreq;
  41. float BendAdjust;
  42. float OffsetHz;
  43. bool firsttime;
  44. int nsample, portamento;
  45. int Compute_Linear(float *outl,
  46. float *outr,
  47. int freqhi,
  48. float freqlo);
  49. int Compute_Cubic(float *outl,
  50. float *outr,
  51. int freqhi,
  52. float freqlo);
  53. struct {
  54. /******************************************
  55. * FREQUENCY GLOBAL PARAMETERS *
  56. ******************************************/
  57. float Detune; //cents
  58. Envelope *FreqEnvelope;
  59. LFO *FreqLfo;
  60. /********************************************
  61. * AMPLITUDE GLOBAL PARAMETERS *
  62. ********************************************/
  63. float Volume; // [ 0 .. 1 ]
  64. float Panning; // [ 0 .. 1 ]
  65. Envelope *AmpEnvelope;
  66. LFO *AmpLfo;
  67. float Fadein_adjustment;
  68. struct {
  69. int Enabled;
  70. float initialvalue, dt, t;
  71. } Punch;
  72. /******************************************
  73. * FILTER GLOBAL PARAMETERS *
  74. ******************************************/
  75. ModFilter *GlobalFilter;
  76. Envelope *FilterEnvelope;
  77. LFO *FilterLfo;
  78. } NoteGlobalPar;
  79. float globaloldamplitude, globalnewamplitude, velocity, realfreq;
  80. const int& interpolation;
  81. };
  82. }
  83. #endif