| 1 | /* Art_Speaker_Delta.cpp |
| 2 | * |
| 3 | * Copyright (C) 1992-2005,2009,2011,2016-2019,2021 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 | |
| 19 | #include "Art_Speaker_Delta.h"cxx . . $ `<file>/artsynth/Art_Speaker_Delta.h`/ |
| 20 | #include "Art_Speaker.h"cxx . . $ `<file>/artsynth/Art_Speaker.h`/ |
| 21 | |
| 22 | void Art_Speaker_intoDeltacxx . . $ Art_Speaker_intoDelta(9162de1c621f26a0). (Artcxx . . $ Art# art, Speakercxx . . $ Speaker# speaker, Deltacxx . . $ Delta# delta) |
| 23 | { |
| 24 | double f = speaker -> relativeSizecxx . . $ structSpeaker#relativeSize. * 1e-3; |
| 25 | double xe [30], ye [30], xi [30], yi [30], xmm [30], ymm [30]; |
| 26 | |
| 27 | /* Lungs. */ |
| 28 | |
| 29 | for (integercxx . . $ integer# itube = 7; itube <= 18; itube ++) |
| 30 | delta -> tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).itube]. Dyeqcxx . . $ structDelta_Tube#Dyeq. = 120 * f * (1 + art -> artcxx . . $ structArt#art. [(int) kArt_musclecxx . . $ kArt_muscle#::LUNGScxx . . $ kArt_muscle#LUNGS.]); |
| 31 | |
| 32 | /* Glottis. */ |
| 33 | |
| 34 | { |
| 35 | Delta_Tubecxx . . $ Delta_Tube# t = & delta -> tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).36]; |
| 36 | t -> Dyeqcxx . . $ structDelta_Tube#Dyeq. = f * (5 - 10 * art -> artcxx . . $ structArt#art. [(int) kArt_musclecxx . . $ kArt_muscle#::INTERARYTENOIDcxx . . $ kArt_muscle#INTERARYTENOID.] |
| 37 | + 3 * art -> artcxx . . $ structArt#art. [(int) kArt_musclecxx . . $ kArt_muscle#::POSTERIOR_CRICOARYTENOIDcxx . . $ kArt_muscle#POSTERIOR_CRICOARYTENOID.] |
| 38 | - 3 * art -> artcxx . . $ structArt#art. [(int) kArt_musclecxx . . $ kArt_muscle#::LATERAL_CRICOARYTENOIDcxx . . $ kArt_muscle#LATERAL_CRICOARYTENOID.]); // 4.38 |
| 39 | t -> k1cxx . . $ structDelta_Tube#k1. = speaker -> lowerCordcxx . . $ structSpeaker#lowerCord..k1cxx . . $ structSpeaker_CordSpring#k1. * (1 + art -> artcxx . . $ structArt#art. [(int) kArt_musclecxx . . $ kArt_muscle#::CRICOTHYROIDcxx . . $ kArt_muscle#CRICOTHYROID.]); |
| 40 | t -> k3cxx . . $ structDelta_Tube#k3. = t -> k1cxx . . $ structDelta_Tube#k1. * (20 / t -> Dzcxx . . $ structDelta_Tube#Dz.) * (20 / t -> Dzcxx . . $ structDelta_Tube#Dz.); |
| 41 | } |
| 42 | if (speaker -> cordcxx . . $ structSpeaker#cord..numberOfMassescxx . . $ structSpeaker_CordDimensions#numberOfMasses. >= 2) { |
| 43 | Delta_Tubecxx . . $ Delta_Tube# t = & delta -> tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).37]; |
| 44 | t -> Dyeqcxx . . $ structDelta_Tube#Dyeq. = delta -> tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).36]. Dyeqcxx . . $ structDelta_Tube#Dyeq.; |
| 45 | t -> k1cxx . . $ structDelta_Tube#k1. = speaker -> upperCordcxx . . $ structSpeaker#upperCord..k1cxx . . $ structSpeaker_CordSpring#k1. * (1 + art -> artcxx . . $ structArt#art. [(int) kArt_musclecxx . . $ kArt_muscle#::CRICOTHYROIDcxx . . $ kArt_muscle#CRICOTHYROID.]); |
| 46 | t -> k3cxx . . $ structDelta_Tube#k3. = t -> k1cxx . . $ structDelta_Tube#k1. * (20 / t -> Dzcxx . . $ structDelta_Tube#Dz.) * (20 / t -> Dzcxx . . $ structDelta_Tube#Dz.); |
| 47 | } |
| 48 | if (speaker -> cordcxx . . $ structSpeaker#cord..numberOfMassescxx . . $ structSpeaker_CordDimensions#numberOfMasses. >= 10) { |
| 49 | delta -> tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).84]. Dyeqcxx . . $ structDelta_Tube#Dyeq. = 0.75 * 1 * f + 0.25 * delta -> tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).36]. Dyeqcxx . . $ structDelta_Tube#Dyeq.; |
| 50 | delta -> tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).85]. Dyeqcxx . . $ structDelta_Tube#Dyeq. = 0.50 * 1 * f + 0.50 * delta -> tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).36]. Dyeqcxx . . $ structDelta_Tube#Dyeq.; |
| 51 | delta -> tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).86]. Dyeqcxx . . $ structDelta_Tube#Dyeq. = 0.25 * 1 * f + 0.75 * delta -> tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).36]. Dyeqcxx . . $ structDelta_Tube#Dyeq.; |
| 52 | delta -> tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).84]. k1cxx . . $ structDelta_Tube#k1. = 0.75 * 160 + 0.25 * delta -> tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).36]. k1cxx . . $ structDelta_Tube#k1.; |
| 53 | delta -> tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).85]. k1cxx . . $ structDelta_Tube#k1. = 0.50 * 160 + 0.50 * delta -> tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).36]. k1cxx . . $ structDelta_Tube#k1.; |
| 54 | delta -> tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).86]. k1cxx . . $ structDelta_Tube#k1. = 0.25 * 160 + 0.75 * delta -> tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).36]. k1cxx . . $ structDelta_Tube#k1.; |
| 55 | for (integercxx . . $ integer# itube = 84; itube <= 86; itube ++) |
| 56 | delta -> tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).itube]. k3cxx . . $ structDelta_Tube#k3. = delta -> tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).itube]. k1cxx . . $ structDelta_Tube#k1. * |
| 57 | (20 / delta -> tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).itube]. Dzcxx . . $ structDelta_Tube#Dz.) * (20 / delta -> tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).itube]. Dzcxx . . $ structDelta_Tube#Dz.); |
| 58 | } |
| 59 | |
| 60 | /* Vocal tract. */ |
| 61 | |
| 62 | bool closed [40]; |
| 63 | Art_Speaker_meshVocalTractcxx . . $ Art_Speaker_meshVocalTract(75285077b25cabf8). (art, speaker, xi, yi, xe, ye, xmm, ymm, closed); |
| 64 | for (integercxx . . $ integer# itube = 38; itube <= 64; itube ++) { |
| 65 | Delta_Tubecxx . . $ Delta_Tube# t = & delta -> tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).itube]; |
| 66 | integercxx . . $ integer# i = itube - 37; |
| 67 | double dx = xmm [i] - xmm [i + 1]; |
| 68 | double dy = ymm [i] - ymm [i + 1]; |
| 69 | t -> Dxeqcxx . . $ structDelta_Tube#Dxeq. = hypotcxx . . $ hypot(b71928d39fde4295). (dx, dy); |
| 70 | dx = xe [i] - xi [i]; |
| 71 | dy = ye [i] - yi [i]; |
| 72 | t -> Dyeqcxx . . $ structDelta_Tube#Dyeq. = hypotcxx . . $ hypot(b71928d39fde4295). (dx, dy); |
| 73 | if (closed [i]) |
| 74 | t -> Dyeqcxx . . $ structDelta_Tube#Dyeq. = - t -> Dyeqcxx . . $ structDelta_Tube#Dyeq.; |
| 75 | } |
| 76 | delta -> tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).65]. Dxeqcxx . . $ structDelta_Tube#Dxeq. = delta -> tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).51]. Dxeqcxx . . $ structDelta_Tube#Dxeq. = delta -> tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).50]. Dxeqcxx . . $ structDelta_Tube#Dxeq.; |
| 77 | /* Voor [r]: thy tubes [60]. Brel = 0.1; thy tubes [60]. k1 = 3; */ |
| 78 | |
| 79 | /* Nasopharyngeal port. */ |
| 80 | |
| 81 | delta -> tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).65]. Dyeqcxx . . $ structDelta_Tube#Dyeq. = f * (18 - 25 * art -> artcxx . . $ structArt#art. [(int) kArt_musclecxx . . $ kArt_muscle#::LEVATOR_PALATINIcxx . . $ kArt_muscle#LEVATOR_PALATINI.]); // 4.40 |
| 82 | |
| 83 | for (integercxx . . $ integer# itube = 1; itube <= delta -> numberOfTubescxx . . $ structDelta#numberOfTubes.; itube ++) { |
| 84 | Delta_Tubecxx . . $ Delta_Tube# t = & delta -> tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).itube]; |
| 85 | t -> s1cxx . . $ structDelta_Tube#s1. = 5e6 * t -> Dxeqcxx . . $ structDelta_Tube#Dxeq. * t -> Dzeqcxx . . $ structDelta_Tube#Dzeq.; |
| 86 | t -> s3cxx . . $ structDelta_Tube#s3. = t -> s1cxx . . $ structDelta_Tube#s1. / (0.9e-3 * 0.9e-3); |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | /* End of file Art_Speaker_Delta.cpp */ |