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 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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. /**The "pad" synthesizer*/
  18. class PADnote:public SynthNote
  19. {
  20. public:
  21. PADnote(const PADnoteParameters *parameters, SynthParams pars,
  22. const int &interpolation, WatchManager *wm=0, const char *prefix=0);
  23. ~PADnote();
  24. SynthNote *cloneLegato(void);
  25. void legatonote(LegatoParams pars);
  26. int noteout(float *outl, float *outr);
  27. bool finished() const;
  28. void entomb(void);
  29. void releasekey();
  30. private:
  31. void setup(float freq, float velocity, int portamento_,
  32. int midinote, bool legato = false, WatchManager *wm=0, const char *prefix=0);
  33. void fadein(float *smps);
  34. void computecurrentparameters();
  35. bool finished_;
  36. const PADnoteParameters &pars;
  37. int poshi_l, poshi_r;
  38. float poslo;
  39. float basefreq;
  40. float BendAdjust;
  41. float OffsetHz;
  42. bool firsttime;
  43. int nsample, portamento;
  44. int Compute_Linear(float *outl,
  45. float *outr,
  46. int freqhi,
  47. float freqlo);
  48. int Compute_Cubic(float *outl,
  49. float *outr,
  50. int freqhi,
  51. float freqlo);
  52. struct {
  53. /******************************************
  54. * FREQUENCY GLOBAL PARAMETERS *
  55. ******************************************/
  56. float Detune; //cents
  57. Envelope *FreqEnvelope;
  58. LFO *FreqLfo;
  59. /********************************************
  60. * AMPLITUDE GLOBAL PARAMETERS *
  61. ********************************************/
  62. float Volume; // [ 0 .. 1 ]
  63. float Panning; // [ 0 .. 1 ]
  64. Envelope *AmpEnvelope;
  65. LFO *AmpLfo;
  66. float Fadein_adjustment;
  67. struct {
  68. int Enabled;
  69. float initialvalue, dt, t;
  70. } Punch;
  71. /******************************************
  72. * FILTER GLOBAL PARAMETERS *
  73. ******************************************/
  74. ModFilter *GlobalFilter;
  75. Envelope *FilterEnvelope;
  76. LFO *FilterLfo;
  77. } NoteGlobalPar;
  78. float globaloldamplitude, globalnewamplitude, velocity, realfreq;
  79. const int& interpolation;
  80. };
  81. #endif