txtucon.h 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  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. /******************************** TEXTURE ******************************/
  22. /* CONSTANTS FOR TEXTURE */
  23. #define TEXTURE_MIN_DUR (0.01)
  24. #define TEXTURE_MAX_DUR (1.0)
  25. #define MAX_PACKTIME (60.0)
  26. #define DENSITY_DEFAULT (0.1)
  27. #define DEFAULT_SKIP (0.25)
  28. #define MAX_SCAT_TEXTURE (10.0)
  29. #define EIGHT_8VA_UP (96.0)
  30. #define EIGHT_8VA_DOWN (-96.0)
  31. #define DEFAULT_TEXDUR (4.0)
  32. #define DEFAULT_TEXDENS (10.0)
  33. #define DEFAULT_TEXSCAT (0.5)
  34. #define MIN_MULT (0.01)
  35. #define MAX_MULT (100.0)
  36. #define TEXTURE_SPLICELEN (15.0) /* 15 MS */
  37. #define TEXTURE_SAFETY (1.0) /* 1 MS: min snd-dur between splices */
  38. #define TEXTURE_DEFAULT_DUR (10.0)
  39. #define DEFAULT_PITCH (60.0) /* middle C */
  40. #define DEFAULT_HF_GPRANGE (8.0)
  41. #define DEFAULT_GPSIZE (4.0)
  42. #define HALF_OCTAVE (6.0)
  43. #define TEX_CENTRE (0.5)
  44. #define TEX_LEFT (0.0)
  45. #define TEX_RIGHT (1.0)
  46. #define MAX_SPREAD (1.0)
  47. #define MAX_GPRANGE (128.0)
  48. #define TEXTURE_SEPARATOR ('#') /* Character in notedata file to indicate next motif */
  49. /************************* MAX ELEMENT-REPETITIONS ALLOWED IN PERMS *************************/
  50. #define SPACE_REPETS (2) /* for param PM_SPACE */
  51. #define PITCH_REPETS (1) /* for param PM_PITCH */
  52. #define AMP_REPETS (1) /* for param PM_AMP */
  53. #define DUR_REPETS (1) /* for param PM_DUR */
  54. #define INSNO_REPETS (2) /* for param PM_INSNO */
  55. #define GPRANG_REPETS (1) /* for param PM_GPRANG */
  56. #define GPSIZE_REPETS (1) /* for param PM_GPSIZE */
  57. #define GPDENS_REPETS (1) /* for param PM_GPDENS */
  58. #define GPCNTR_REPETS (2) /* for param PM_GPCNTR */
  59. #define GPPICH_REPETS (1) /* for param PM_GPPICH */
  60. #define ORNPOS_REPETS (2) /* for param PM_ORNPOS */
  61. #define GPSPAC_REPETS (1) /* for param PM_GPSPAC */
  62. #define ORIENT_REPETS (1) /* for param PM_ORIENT */
  63. #define DECABV_REPETS (1) /* for param PM_DECABV */
  64. #define MULT_REPETS (1) /* for param PM_MULT */
  65. #define WHICH_REPETS (1) /* for param PM_WHICH */
  66. #define GPPICH2_REPETS (1) /* for param PM_GPPICH2 */
  67. /* CONSTANTS connected with these same permutation functions */
  68. #define PM_SPACE (0) /* L/R decision on events : Oldname NOUGHT */
  69. #define PM_PITCH (1) /* PITCH of events : Oldname ONE */
  70. #define PM_AMP (2) /* AMPLITUDE of events : Oldname TWO */
  71. #define PM_DUR (3) /* DURATION of events : Oldname THREE */
  72. #define PM_INSNO (4) /* INSTR_NO of events : Oldname FOUR */
  73. #define PM_GPRANG (5) /* RANGE of group : Oldname FIVE */
  74. #define PM_GPSIZE (6) /* SIZE of group : Oldname SIX */
  75. #define PM_GPDENS (7) /* DENSITY (notedur) of group : Oldname SEVEN */
  76. #define PM_GPCNTR (8) /* SELECT AMP CONTOUR of group : Oldname EIGHT */
  77. #define PM_GPPICH (9) /* PITCH OF NOTE in a group : Oldname NINE */
  78. #define PM_ORNPOS (10) /* PRE- or POST- ornament : Oldname TEN */
  79. #define PM_GPSPAC (11) /* SPATIALISE NOTE in a group : Oldname ELEVEN */
  80. #define PM_ORIENT (12) /* SELECT RANGE ORIENTATION of decoration Oldname TWELVE */
  81. #define PM_DECABV (13) /* SELECT ABOVE/BELOW of centred dec. notes Oldname THIRTEEN */
  82. #define PM_MULT (14) /* MULTIPLIER for duration motifs/ornmnts Oldname FOURTEEN */
  83. #define PM_WHICH (15) /* Select which motif to use as m or ornmnt Oldname FIFTEEN */
  84. #define PM_GPPICH2 (16) /* as 9 for other half of centred HF group Oldname SIXTEEN */
  85. #define DECOR_FIRST (0)
  86. #define DECOR_HIGHEST (1)
  87. #define DECOR_EVERY (2)
  88. /************************* TEXTURE PARAMETERS ******************************/
  89. /* SIMPLE_TEX (0) 00000000 00000000 */
  90. #define ISPRE_DECORORN (1) /* -------- -------1 */
  91. #define ISPOST_DECORORN (2) /* -------- ------1- */
  92. #define IS_HS (4) /* -------- -----1-- */
  93. #define ISMANY_HFLDS (8) /* -------- ----1--- */
  94. #define IS_GROUPS (16) /* -------- ---1---- */
  95. #define IS_DECOR (32) /* -------- --1----- */
  96. #define IS_MOTIFS (64) /* -------- -1------ */
  97. #define IS_ORNATE (128) /* -------- 1------- */
  98. #define MOTIF_IN_HF (256) /* -------1 -------- */
  99. #define ISTIMED (512) /* ------1- -------- */
  100. #define ISHARM (1024) /* -----1-- -------- */
  101. #define GET_DECORNPOS (3) /* -------- ------11 */
  102. #define IS_CLUMPED (0xF0) /* -------- 1111---- */
  103. #define IS_DEC_OR_GRP (0x30) /* -------- --11---- */
  104. #define IS_MTF_OR_GRP (0x50) /* -------- -1-1---- */
  105. #define IS_ORN_OR_DEC (0xA0) /* -------- 1-1----- */
  106. #define ORN_DEC_OR_TIMED (0x2A0)/* ------1- 1-1----- */
  107. #define IS_ORNDEC_OR_MTF (0xE0) /* -------- 111----- */
  108. #define IS_ORN_OR_MTF (0xC0) /* -------- 11------ */
  109. extern int texflag; /* bitflag for type of texture */
  110. #define MAXNAMECNT (9)
  111. /* AMPLITUDE TYPES SPECIFIED BY USER */
  112. #define IS_MIXED (0)
  113. #define IS_CRESC (1)
  114. #define IS_FLAT (2)
  115. #define IS_DECRESC (3)
  116. #define IS_FLAT_AND_CRESC (4)
  117. #define IS_CRESC_AND_DECRESC (5)
  118. #define IS_FLAT_AND_DECRESC (6)
  119. #define IS_DIRECTIONAL (7)
  120. #define IS_DIREC_OR_FLAT (8)
  121. /* AMPLITUDE TYPES RETURNED FROM GETAMPTYPE */
  122. #define FLAT (0)
  123. #define CRESC (1)
  124. #define DECRESC (2)
  125. #define IS_STILL (0)
  126. #define IS_SCATTER (1)
  127. #define IS_INWARD (2)
  128. #define IS_OUTWARD (3)
  129. #define IS_FOLLOWING (4)
  130. #define IS_CONTRARY (5)
  131. #define IS_DIRECTED(x) ((x)==IS_FOLLOWING || (x)==IS_CONTRARY)
  132. /* INTERNAL FLAGS */
  133. #define INTERNAL_FLAGS_CNT (2) /* COUNT OF FLAGS BELOW */
  134. #define IS_PRE (7) /* flags decorations precede decd notes (default) POST */
  135. #define DECCENTRE (8) /* flags decorations etc are centred on tset-pitch */
  136. #define PERMCNT (17) /* number of permutation options, see texture0.h */
  137. /* For more readable code WHICH_CHORDNOTE */
  138. /* Externally (to user) FORCEHI flag selects HIGH (as against FIRST) note */
  139. /* Internally that flag can have 3 vals (FIRST,HIGHEST,EVERY..NOTE) */
  140. /* So the NEW, more informative, name is used internally */
  141. /******* GLOBAL VALUES ****/
  142. #define MIDITOP (127.0) /* Maximum pitch midi note */
  143. #define MIDIBOT (1.0) /* Minimum pitch midi note */
  144. #define BANDCNT (5) /* no.of range-bands each param divided into, for randperms */
  145. #define LAYERCNT (8) /* for weighted bands, there are 8 equal layers
  146. band 1 = layer 1:
  147. band 2 = layers 2 & 3:
  148. band 3 = layers 4 & 5:
  149. band 4 = layers 6 & 7:
  150. band 5 = layer 8:
  151. */
  152. #define LOW_A (6.875) /* Frequency of A below MIDI 0 */
  153. /* HOW DECORATION PITCHES CENTRE ON DECORATED LINE PITCHES */
  154. #define DEC_CENTRED (0)
  155. #define DEC_ABOVE (1)
  156. #define DEC_BELOW (2)
  157. #define DEC_C_A (3)
  158. #define DEC_C_B (4)
  159. #define DEC_A_B (5)
  160. #define DEC_C_A_B (6)
  161. #define TEXTURE_MAX_SKIP (100.0)
  162. #define TEXTURE_MAX_TGRID (10000.0)
  163. #define TEXTURE_MAX_PHGRID (1000.0)