KlattGrid_def.h 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. /* KlattGrid_def.h
  2. *
  3. * Copyright (C) 2008-2011 David Weenink, 2015 Paul Boersma
  4. *
  5. * This code is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or (at
  8. * your option) any later version.
  9. *
  10. * This code is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. * See the GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this work. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #define ooSTRUCT PhonationPoint
  19. oo_DEFINE_CLASS (PhonationPoint, AnyPoint)
  20. oo_DOUBLE (period) // 1/F0
  21. oo_DOUBLE (openPhase)
  22. oo_DOUBLE (collisionPhase)
  23. oo_DOUBLE (te) // time from glottis open to exponential decay or closing
  24. oo_DOUBLE (power1) // flow function
  25. oo_DOUBLE (power2)
  26. oo_DOUBLE (pulseScale) // multiplier for diplophonia, shimmer
  27. oo_END_CLASS (PhonationPoint)
  28. #undef ooSTRUCT
  29. #define ooSTRUCT PhonationTier
  30. oo_DEFINE_CLASS (PhonationTier, Function)
  31. oo_COLLECTION_OF (SortedSetOfDoubleOf, points, PhonationPoint, 0)
  32. #if oo_DECLARING
  33. AnyTier_METHODS
  34. #endif
  35. oo_END_CLASS (PhonationTier)
  36. #undef ooSTRUCT
  37. #define ooSTRUCT PhonationGridPlayOptions
  38. oo_DEFINE_CLASS (PhonationGridPlayOptions, Daata)
  39. oo_INT (voicing)
  40. oo_INT (aspiration)
  41. oo_INT (breathiness)
  42. oo_INT (flutter)
  43. oo_INT (doublePulsing)
  44. oo_INT (collisionPhase)
  45. oo_INT (spectralTilt)
  46. oo_INT (flowFunction) // 1: user-defined with tiers (power1, power2); 2: (2,3); 3: (3,4)
  47. oo_INT (flowDerivative)
  48. oo_DOUBLE (maximumPeriod)
  49. oo_END_CLASS (PhonationGridPlayOptions)
  50. #undef ooSTRUCT
  51. #define ooSTRUCT PhonationGrid
  52. oo_DEFINE_CLASS (PhonationGrid, Function)
  53. oo_OBJECT (PitchTier, 0, pitch)
  54. oo_OBJECT (RealTier, 0, flutter) // [0,1]
  55. oo_OBJECT (IntensityTier, 0, voicingAmplitude) // dB
  56. oo_OBJECT (RealTier, 0, doublePulsing) // [0,1]
  57. oo_OBJECT (RealTier, 0, openPhase) // (0,1)
  58. oo_OBJECT (RealTier, 0, collisionPhase) //
  59. oo_OBJECT (RealTier, 0, power1) // 2,3..
  60. oo_OBJECT (RealTier, 0, power2) // 3,4.. power2>power1
  61. oo_OBJECT (IntensityTier, 0, spectralTilt) // dB
  62. oo_OBJECT (IntensityTier, 0, aspirationAmplitude) // dB
  63. oo_OBJECT (IntensityTier, 0, breathinessAmplitude) // dB
  64. #if ! oo_READING && ! oo_WRITING
  65. oo_OBJECT (PhonationGridPlayOptions, 0, options)
  66. #endif
  67. #if oo_READING
  68. options = PhonationGridPlayOptions_create ();
  69. PhonationGrid_setNames (this);
  70. #endif
  71. #if oo_DECLARING
  72. void v_info ()
  73. override;
  74. #endif
  75. oo_END_CLASS (PhonationGrid)
  76. #undef ooSTRUCT
  77. #define ooSTRUCT VocalTractGridPlayOptions
  78. oo_DEFINE_CLASS (VocalTractGridPlayOptions, Daata)
  79. oo_INT (filterModel)
  80. oo_INTEGER (startOralFormant)
  81. oo_INTEGER (endOralFormant)
  82. oo_INTEGER (startNasalFormant)
  83. oo_INTEGER (endNasalFormant)
  84. oo_INTEGER (startNasalAntiFormant)
  85. oo_INTEGER (endNasalAntiFormant)
  86. oo_END_CLASS (VocalTractGridPlayOptions)
  87. #undef ooSTRUCT
  88. #define ooSTRUCT VocalTractGrid
  89. oo_DEFINE_CLASS (VocalTractGrid, Function)
  90. oo_OBJECT (FormantGrid, 0, oral_formants)
  91. oo_OBJECT (FormantGrid, 0, nasal_formants)
  92. oo_OBJECT (FormantGrid, 0, nasal_antiformants)
  93. // for parallel synthesis
  94. oo_COLLECTION_OF (OrderedOf, oral_formants_amplitudes, IntensityTier, 0)
  95. oo_COLLECTION_OF (OrderedOf, nasal_formants_amplitudes, IntensityTier, 0)
  96. #if ! oo_READING && ! oo_WRITING
  97. oo_OBJECT (VocalTractGridPlayOptions, 0, options)
  98. #endif
  99. #if oo_READING
  100. options = VocalTractGridPlayOptions_create ();
  101. VocalTractGrid_setNames (this);
  102. #endif
  103. #if oo_DECLARING
  104. void v_info ()
  105. override;
  106. #endif
  107. oo_END_CLASS (VocalTractGrid)
  108. #undef ooSTRUCT
  109. #define ooSTRUCT CouplingGridPlayOptions
  110. oo_DEFINE_CLASS (CouplingGridPlayOptions, Daata)
  111. oo_INTEGER (startTrachealFormant)
  112. oo_INTEGER (endTrachealFormant)
  113. oo_INTEGER (startTrachealAntiFormant)
  114. oo_INTEGER (endTrachealAntiFormant)
  115. oo_INTEGER (startDeltaFormant)
  116. oo_INTEGER (endDeltaFormant)
  117. oo_INTEGER (startDeltaBandwidth)
  118. oo_INTEGER (endDeltaBandwidth)
  119. oo_INT (openglottis)
  120. oo_DOUBLE (fadeFraction)
  121. oo_END_CLASS (CouplingGridPlayOptions)
  122. #undef ooSTRUCT
  123. #define ooSTRUCT CouplingGrid
  124. oo_DEFINE_CLASS (CouplingGrid, Function)
  125. oo_OBJECT (FormantGrid, 0, tracheal_formants)
  126. oo_OBJECT (FormantGrid, 0, tracheal_antiformants)
  127. oo_COLLECTION_OF (OrderedOf, tracheal_formants_amplitudes, IntensityTier, 0)
  128. oo_OBJECT (FormantGrid, 0, delta_formants)
  129. #if ! oo_READING && ! oo_WRITING
  130. oo_OBJECT (PhonationTier, 0, glottis)
  131. oo_OBJECT (CouplingGridPlayOptions, 0, options)
  132. #endif
  133. #if oo_READING
  134. options = CouplingGridPlayOptions_create ();
  135. glottis = PhonationTier_create (xmin, xmax);
  136. CouplingGrid_setNames (this);
  137. #endif
  138. #if oo_DECLARING
  139. void v_info ()
  140. override;
  141. #endif
  142. oo_END_CLASS (CouplingGrid)
  143. #undef ooSTRUCT
  144. #define ooSTRUCT FricationGridPlayOptions
  145. oo_DEFINE_CLASS (FricationGridPlayOptions, Daata)
  146. oo_INTEGER (startFricationFormant)
  147. oo_INTEGER (endFricationFormant)
  148. oo_INT (bypass)
  149. oo_END_CLASS (FricationGridPlayOptions)
  150. #undef ooSTRUCT
  151. #define ooSTRUCT FricationGrid
  152. oo_DEFINE_CLASS (FricationGrid, Function)
  153. oo_OBJECT (IntensityTier, 0, fricationAmplitude) // dB
  154. oo_OBJECT (FormantGrid, 0, frication_formants)
  155. oo_COLLECTION_OF (OrderedOf, frication_formants_amplitudes, IntensityTier, 0)
  156. oo_OBJECT (IntensityTier, 0, bypass) // dB
  157. #if ! oo_READING && ! oo_WRITING
  158. oo_OBJECT (FricationGridPlayOptions, 0, options)
  159. #endif
  160. #if oo_READING
  161. options = FricationGridPlayOptions_create ();
  162. FricationGrid_setNames (this);
  163. #endif
  164. #if oo_DECLARING
  165. void v_info ()
  166. override;
  167. #endif
  168. oo_END_CLASS (FricationGrid)
  169. #undef ooSTRUCT
  170. #define ooSTRUCT KlattGridPlayOptions
  171. oo_DEFINE_CLASS (KlattGridPlayOptions, Daata)
  172. oo_DOUBLE (samplingFrequency)
  173. oo_INT (scalePeak)
  174. oo_DOUBLE (xmin)
  175. oo_DOUBLE (xmax)
  176. oo_END_CLASS (KlattGridPlayOptions)
  177. #undef ooSTRUCT
  178. #define ooSTRUCT KlattGrid
  179. oo_DEFINE_CLASS (KlattGrid, Function)
  180. oo_OBJECT (PhonationGrid, 0, phonation) // glottal source
  181. oo_OBJECT (VocalTractGrid, 0, vocalTract) // filter
  182. oo_OBJECT (CouplingGrid, 0, coupling) // coupling between source and filter
  183. oo_OBJECT (FricationGrid, 0, frication) // frication source
  184. oo_OBJECT (IntensityTier, 0, gain) // final scaling
  185. #if !oo_READING && !oo_WRITING
  186. oo_OBJECT (KlattGridPlayOptions, 0, options)
  187. #endif
  188. #if oo_READING
  189. options = KlattGridPlayOptions_create ();
  190. KlattGrid_setNames (this);
  191. #endif
  192. #if oo_DECLARING
  193. void v_info ()
  194. override;
  195. #endif
  196. oo_END_CLASS (KlattGrid)
  197. #undef ooSTRUCT
  198. /* End of file KlattGrid_def.h */