filtcon.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. /*
  2. * Copyright (c) 1983-2013 Trevor Wishart and Composers Desktop Project Ltd
  3. * http://www.trevorwishart.co.uk
  4. * http://www.composersdesktop.com
  5. *
  6. This file is part of the CDP System.
  7. The CDP System is free software; you can redistribute it
  8. and/or modify it under the terms of the GNU Lesser General Public
  9. License as published by the Free Software Foundation; either
  10. version 2.1 of the License, or (at your option) any later version.
  11. The CDP System is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. GNU Lesser General Public License for more details.
  15. You should have received a copy of the GNU Lesser General Public
  16. License along with the CDP System; if not, write to the Free Software
  17. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  18. 02111-1307 USA
  19. *
  20. */
  21. /***************************** FILTERS ******************************/
  22. #define BSIZE (128)
  23. #define MINQ (0.001)
  24. #define MAXQ (10000.0)
  25. #define MIN_ACUITY (1.0/MAXQ)
  26. #define MAX_ACUITY (1.0)
  27. #define FLT_MINGAIN (0.001)
  28. #define FLT_MAXGAIN (10000.0)
  29. #define MINMIDI (0.0)
  30. #define MAXMIDI (127.0)
  31. //RWD was a whopping 10Hz!
  32. #define FLT_MINFRQ (0.1)
  33. #define FLT_MAXFRQ ((double)srate/2.0)
  34. #define FLT_MAX_FILTERS (2000)
  35. #define MINFILTAMP (0.001) /* Filter can't have zero gain (causes divide by zero) */
  36. /* This is near enough to zero to allow the maths to work */
  37. /* without the filter component biting */
  38. #define FLT_MAX_PSHIFT (48.0) /* 4 8vas in semitones */
  39. /* FLITITER */
  40. #define ITER_MONO (1)
  41. #define ITER_STEREO (2)
  42. #define MN_SHIFT (3)
  43. #define ST_SHIFT (4)
  44. #define ST_FLT_INTP_SHIFT (5)
  45. #define MN_FLT_INTP_SHIFT (6)
  46. #define FIXED_AMP (10) /* Converts flags above to flags below */
  47. #define U_MONO (11)
  48. #define U_STEREO (12)
  49. #define U_MN_SHIFT (13)
  50. #define U_ST_SHIFT (14)
  51. #define U_ST_INTP_SHIFT (15)
  52. #define U_MN_INTP_SHIFT (16)
  53. #define MIN_SHORT (-32768)
  54. #define MAX_SHORT (32767)
  55. #define FLT_SAFETY (512)
  56. #define FLT_OUTBUF (2)
  57. #define FLT_OVFLWBUF (3)
  58. /* FLTSWEEP */
  59. #define FLT_MINSWEEP (0.0001)
  60. #define FLT_MAXSWEEP (200.0)
  61. /* FSTATVAR */
  62. #define FLT_DEFAULT_FRQ (440.0)
  63. #define FLT_DEFAULT_LOFRQ (100.0)
  64. #define FLT_DEFAULT_HIFRQ (4000.0)
  65. #define FLT_DEFAULT_SWPFRQ (0.5)
  66. #define FLT_MININT (.25) /* 1/4 of a semitone: min step between filters */
  67. #define FLT_MAXINT (8.0 * SEMITONES_PER_OCTAVE)
  68. #define FLT_MINPRESCALE (-1.0)
  69. #define FLT_MAXPRESCALE (1.0)
  70. #define FLT_MAXEQPRESCALE (200.0)
  71. #define FLT_MINEQPRESCALE (1.0/FLT_MAXEQPRESCALE)
  72. #define FLT_MAXHARMS (200.0)
  73. #define FLT_DEFAULT_BW (200.0)
  74. #define FLT_DEFAULT_Q (20.0)
  75. #define FLT_DEFAULT_OFFSET (40.0)
  76. #define FLT_DEFAULT_INCOUNT (8.0)
  77. #define FLT_DEFAULT_INTSIZE (5.0)
  78. #define FLT_DEFAULT_HCNT (1.0)
  79. #define FLT_DEFAULT_ROLLOFF (-6.0)
  80. #define FLT_DEFAULT_ITERDELAY (1.0)
  81. #define FLT_DEFAULT_ALLPASSDELAY (10.0) /* MS */
  82. #define FLT_DEFAULT_SWPPHASE (0.25)
  83. #define FLT_MINDBGAIN (MIN_DB_ON_16_BIT)
  84. #define FLT_MAXDBGAIN (36.0) /* arbitrary!! */
  85. #define FLT_DEFAULT_LOHIPASS (1000.0)
  86. #define FLT_DEFAULT_LOHISTOP (600.0)
  87. #define FLT_DEFAULT_LOHIPASSMIDI (84.0)
  88. #define FLT_DEFAULT_LOHISTOPMIDI (72.0)
  89. #define FLT_DEFAULT_LOHI_ATTEN (-60.0)
  90. #define FLT_LBF (200)
  91. #define FLT_DEFAULT_LPHP_PRESCALE (0.9)
  92. #define FLT_MAXDELAY (32767.0)
  93. #define FLT_SPLICELEN (15.0)
  94. #define FLT_TAIL (20.0) /* 1 second allowed for filter to die to zero */