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.

116 lines
3.6KB

  1. /*
  2. ZynAddSubFX - a software synthesizer
  3. SUBnoteParameters.h - Parameters for SUBnote (SUBsynth)
  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 SUB_NOTE_PARAMETERS_H
  18. #define SUB_NOTE_PARAMETERS_H
  19. #include <stdint.h>
  20. #include "../globals.h"
  21. #include "Presets.h"
  22. class SUBnoteParameters:public Presets
  23. {
  24. public:
  25. SUBnoteParameters(const AbsTime *time_ = nullptr);
  26. ~SUBnoteParameters();
  27. void add2XML(XMLwrapper& xml);
  28. void defaults();
  29. void getfromXML(XMLwrapper& xml);
  30. void updateFrequencyMultipliers(void);
  31. void paste(SUBnoteParameters &sub);
  32. //Parameters
  33. //AMPLITUDE PARAMETRERS
  34. unsigned char Pstereo; //0 for mono,1 for stereo
  35. unsigned char PVolume;
  36. unsigned char PPanning;
  37. unsigned char PAmpVelocityScaleFunction;
  38. EnvelopeParams *AmpEnvelope;
  39. //Frequency Parameters
  40. unsigned short int PDetune;
  41. unsigned short int PCoarseDetune;
  42. unsigned char PDetuneType;
  43. unsigned char PFreqEnvelopeEnabled;
  44. EnvelopeParams *FreqEnvelope;
  45. unsigned char PBandWidthEnvelopeEnabled;
  46. EnvelopeParams *BandWidthEnvelope;
  47. unsigned char PBendAdjust;
  48. unsigned char POffsetHz;
  49. //Filter Parameters (Global)
  50. unsigned char PGlobalFilterEnabled;
  51. FilterParams *GlobalFilter;
  52. unsigned char PGlobalFilterVelocityScale;
  53. unsigned char PGlobalFilterVelocityScaleFunction;
  54. EnvelopeParams *GlobalFilterEnvelope;
  55. //Other Parameters
  56. //If the base frequency is fixed to 440 Hz
  57. unsigned char Pfixedfreq;
  58. /* Equal temperate (this is used only if the Pfixedfreq is enabled)
  59. If this parameter is 0, the frequency is fixed (to 440 Hz);
  60. if this parameter is 64, 1 MIDI halftone -> 1 frequency halftone */
  61. unsigned char PfixedfreqET;
  62. // Overtone spread parameters
  63. struct {
  64. unsigned char type;
  65. unsigned char par1;
  66. unsigned char par2;
  67. unsigned char par3;
  68. } POvertoneSpread;
  69. float POvertoneFreqMult[MAX_SUB_HARMONICS];
  70. //how many times the filters are applied
  71. unsigned char Pnumstages;
  72. //bandwidth
  73. unsigned char Pbandwidth;
  74. //How the magnitudes are computed (0=linear,1=-60dB,2=-60dB)
  75. unsigned char Phmagtype;
  76. //Magnitudes
  77. unsigned char Phmag[MAX_SUB_HARMONICS];
  78. //Relative BandWidth ("64"=1.0f)
  79. unsigned char Phrelbw[MAX_SUB_HARMONICS];
  80. //how much the bandwidth is increased according to lower/higher frequency; 64-default
  81. unsigned char Pbwscale;
  82. //how the harmonics start("0"=0,"1"=random,"2"=1)
  83. unsigned char Pstart;
  84. const AbsTime *time;
  85. int64_t last_update_timestamp;
  86. static const rtosc::Ports &ports;
  87. };
  88. #endif