Debian Codegraph @

artsynth/Speaker_to_Delta.cpp

raw symbols SCIP
1 /* Speaker_to_Delta.cpp
2 *
3 * Copyright (C) 1992-2005,2006,2011,2015-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.h"cxx . . $ `<file>/artsynth/Art_Speaker.h`/
20 #include "Speaker_to_Delta.h"cxx . . $ `<file>/artsynth/Speaker_to_Delta.h`/
21 #define SMOOTH_LUNGScxx . . $ `artsynth/Speaker_to_Delta.cpp:21:9`! true
22 #define FIRST_TUBEcxx . . $ `artsynth/Speaker_to_Delta.cpp:22:9`! 7
23
24 autoDeltacxx . . $ autoDelta# Speaker_to_Deltacxx . . $ Speaker_to_Delta(e5572b05f6403c80). (Speakercxx . . $ Speaker# me) {
25 double f = mycxx . . $ `melder/melder.h:44:9`! relativeSizecxx . . $ structSpeaker#relativeSize. * 1e-3; // we shall use millimetres and grams
26 double xe [30], ye [30], xi [30], yi [30], xmm [30], ymm [30], dx, dy;
27 autoDeltacxx . . $ autoDelta# thee = Delta_createcxx . . $ Delta_create(42b4abae2ec5400). (89);
28 Melder_assertcxx . . $ `melder/melder_assert.h:39:10`! (mycxx . . $ `melder/melder.h:44:9`! cord.numberOfMasses == 1 || mycxx . . $ `melder/melder.h:44:9`! cord.numberOfMasses == 2 || mycxx . . $ `melder/melder.h:44:9`! cord.numberOfMasses == 10);
29
30 /* Lungs: tubes 1..23. */
31
32 for (integercxx . . $ integer# itube = 1; itube <= 23; itube ++) {
33 Delta_Tubecxx . . $ Delta_Tube# t = & thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).itube];
34 t -> Dxcxx . . $ structDelta_Tube#Dx. = t -> Dxeqcxx . . $ structDelta_Tube#Dxeq. = 10.0 * f;
35 t -> Dycxx . . $ structDelta_Tube#Dy. = t -> Dyeqcxx . . $ structDelta_Tube#Dyeq. = 100.0 * f;
36 t -> Dzcxx . . $ structDelta_Tube#Dz. = t -> Dzeqcxx . . $ structDelta_Tube#Dzeq. = 230.0 * f;
37 t -> masscxx . . $ structDelta_Tube#mass. = 10.0 * mycxx . . $ `melder/melder.h:44:9`! relativeSizecxx . . $ structSpeaker#relativeSize. * t -> Dxcxx . . $ structDelta_Tube#Dx. * t -> Dzcxx . . $ structDelta_Tube#Dz.; // 80 * f; 35 * Dx * Dz
38 t -> k1cxx . . $ structDelta_Tube#k1. = 200.0; // 90000 * Dx * Dz; Newtons per metre
39 t -> k3cxx . . $ structDelta_Tube#k3. = 0.0;
40 t -> Brelcxx . . $ structDelta_Tube#Brel. = 0.8;
41 t -> parallelcxx . . $ structDelta_Tube#parallel. = 1000;
42 }
43
44 /* Bronchi: tubes 24..29. */
45
46 for (integercxx . . $ integer# itube = 24; itube <= 29; itube ++) {
47 Delta_Tubecxx . . $ Delta_Tube# t = & thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).itube];
48 t -> Dxcxx . . $ structDelta_Tube#Dx. = t -> Dxeqcxx . . $ structDelta_Tube#Dxeq. = 10.0 * f;
49 t -> Dycxx . . $ structDelta_Tube#Dy. = t -> Dyeqcxx . . $ structDelta_Tube#Dyeq. = 15.0 * f;
50 t -> Dzcxx . . $ structDelta_Tube#Dz. = t -> Dzeqcxx . . $ structDelta_Tube#Dzeq. = 30.0 * f;
51 t -> masscxx . . $ structDelta_Tube#mass. = 10.0 * f;
52 t -> k1cxx . . $ structDelta_Tube#k1. = 40.0; // 125000 * Dx * Dz; Newtons per metre
53 t -> k3cxx . . $ structDelta_Tube#k3. = 0.0;
54 t -> Brelcxx . . $ structDelta_Tube#Brel. = 0.8;
55 }
56
57 /* Trachea: tubes 30..35; four of these may be replaced by conus elasticus (see below). */
58
59 for (integercxx . . $ integer# itube = 30; itube <= 35; itube ++) {
60 Delta_Tubecxx . . $ Delta_Tube# t = & thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).itube];
61 t -> Dxcxx . . $ structDelta_Tube#Dx. = t -> Dxeqcxx . . $ structDelta_Tube#Dxeq. = 10.0 * f;
62 t -> Dycxx . . $ structDelta_Tube#Dy. = t -> Dyeqcxx . . $ structDelta_Tube#Dyeq. = 15.0 * f;
63 t -> Dzcxx . . $ structDelta_Tube#Dz. = t -> Dzeqcxx . . $ structDelta_Tube#Dzeq. = 16.0 * f;
64 t -> masscxx . . $ structDelta_Tube#mass. = 5.0 * f;
65 t -> k1cxx . . $ structDelta_Tube#k1. = 160.0; // 100000 * Dx * Dz; Newtons per metre
66 t -> k3cxx . . $ structDelta_Tube#k3. = 0.0;
67 t -> Brelcxx . . $ structDelta_Tube#Brel. = 0.8;
68 }
69
70 if (SMOOTH_LUNGScxx . . $ `artsynth/Speaker_to_Delta.cpp:21:9`!) {
71 structcxx . . $ Speaker_to_Delta(e5572b05f6403c80).$anonymous_type_0# { integercxx . . $ integer# itubecxx . . $ Speaker_to_Delta(e5572b05f6403c80).$anonymous_type_0#itube.; double Dycxx . . $ Speaker_to_Delta(e5572b05f6403c80).$anonymous_type_0#Dy., Dzcxx . . $ Speaker_to_Delta(e5572b05f6403c80).$anonymous_type_0#Dz., parallelcxx . . $ Speaker_to_Delta(e5572b05f6403c80).$anonymous_type_0#parallel.; } data [] = {
72 { 7, 120.0, 240.0, 5000.0 }, { 8, 120.0, 240.0, 5000.0 }, { 9, 120.0, 240.0, 5000.0 },
73 { 10, 120.0, 240.0, 5000.0 }, { 11, 120.0, 240.0, 5000.0 }, { 12, 120.0, 240.0, 5000.0 },
74 { 13, 120.0, 240.0, 2500.0 }, { 14, 120.0, 240.0, 1250.0 }, { 15, 120.0, 240.0, 640.0 },
75 { 16, 120.0, 240.0, 320.0 }, { 17, 120.0, 240.0, 160.0 }, { 18, 120.0, 140.0, 80.0 },
76 { 19, 70.0, 70.0, 40.0 }, { 20, 35.0, 35.0, 20.0 }, { 21, 18.0, 18.0, 10.0 },
77 { 22, 12.0, 12.0, 5.0 }, { 23, 12.0, 12.0, 3.0 }, { 24, 18.0, 9.0, 2.0 },
78 { 25, 18.0, 19.0, 2.0 }, { } };
79 for (integercxx . . $ integer# i = 0; data [i]. itubecxx . . $ Speaker_to_Delta(e5572b05f6403c80).$anonymous_type_0#itube.; i ++) {
80 Delta_Tubecxx . . $ Delta_Tube# t = & thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).data [i]. itubecxx . . $ Speaker_to_Delta(e5572b05f6403c80).$anonymous_type_0#itube.];
81 t -> Dycxx . . $ structDelta_Tube#Dy. = t -> Dyeqcxx . . $ structDelta_Tube#Dyeq. = data [i]. Dycxx . . $ Speaker_to_Delta(e5572b05f6403c80).$anonymous_type_0#Dy. * f;
82 t -> Dzcxx . . $ structDelta_Tube#Dz. = t -> Dzeqcxx . . $ structDelta_Tube#Dzeq. = data [i]. Dzcxx . . $ Speaker_to_Delta(e5572b05f6403c80).$anonymous_type_0#Dz. * f;
83 t -> parallelcxx . . $ structDelta_Tube#parallel. = data [i]. parallelcxx . . $ Speaker_to_Delta(e5572b05f6403c80).$anonymous_type_0#parallel.;
84 }
85 for (integercxx . . $ integer# itube = 26; itube <= 35; itube ++) {
86 Delta_Tubecxx . . $ Delta_Tube# t = & thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).itube];
87 t -> Dycxx . . $ structDelta_Tube#Dy. = t -> Dyeqcxx . . $ structDelta_Tube#Dyeq. = 11.0 * f;
88 t -> Dzcxx . . $ structDelta_Tube#Dz. = t -> Dzeqcxx . . $ structDelta_Tube#Dzeq. = 14.0 * f;
89 t -> parallelcxx . . $ structDelta_Tube#parallel. = 1;
90 }
91 for (integercxx . . $ integer# itube = FIRST_TUBEcxx . . $ `artsynth/Speaker_to_Delta.cpp:22:9`!; itube <= 18; itube ++) {
92 Delta_Tubecxx . . $ Delta_Tube# t = & thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).itube];
93 t -> Dxcxx . . $ structDelta_Tube#Dx. = t -> Dxeqcxx . . $ structDelta_Tube#Dxeq. = 10.0 * f;
94 t -> masscxx . . $ structDelta_Tube#mass. = 10.0 * mycxx . . $ `melder/melder.h:44:9`! relativeSizecxx . . $ structSpeaker#relativeSize. * t -> Dxcxx . . $ structDelta_Tube#Dx. * t -> Dzcxx . . $ structDelta_Tube#Dz.; // 10 mm
95 t -> k1cxx . . $ structDelta_Tube#k1. = 1e5 * t -> Dxcxx . . $ structDelta_Tube#Dx. * t -> Dzcxx . . $ structDelta_Tube#Dz.; // elastic tissue: 1 mbar/mm
96 t -> k3cxx . . $ structDelta_Tube#k3. = 0.0;
97 t -> Brelcxx . . $ structDelta_Tube#Brel. = 1.0;
98 }
99 for (integercxx . . $ integer# itube = 19; itube <= 35; itube ++) {
100 Delta_Tubecxx . . $ Delta_Tube# t = & thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).itube];
101 t -> Dxcxx . . $ structDelta_Tube#Dx. = t -> Dxeqcxx . . $ structDelta_Tube#Dxeq. = 10.0 * f;
102 t -> masscxx . . $ structDelta_Tube#mass. = 3.0 * mycxx . . $ `melder/melder.h:44:9`! relativeSizecxx . . $ structSpeaker#relativeSize. * t -> Dxcxx . . $ structDelta_Tube#Dx. * t -> Dzcxx . . $ structDelta_Tube#Dz.; // 3 mm
103 t -> k1cxx . . $ structDelta_Tube#k1. = 10e5 * t -> Dxcxx . . $ structDelta_Tube#Dx. * t -> Dzcxx . . $ structDelta_Tube#Dz.; // cartilage: 10 mbar/mm
104 t -> k3cxx . . $ structDelta_Tube#k3. = 0.0;
105 t -> Brelcxx . . $ structDelta_Tube#Brel. = 1.0;
106 }
107 }
108
109 /* Glottis: tubes 36 and 37; the last one may be disconnected (see below). */
110 {
111 Delta_Tubecxx . . $ Delta_Tube# t = & thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).36];
112 t -> Dxcxx . . $ structDelta_Tube#Dx. = t -> Dxeqcxx . . $ structDelta_Tube#Dxeq. = mycxx . . $ `melder/melder.h:44:9`! lowerCordcxx . . $ structSpeaker#lowerCord..thicknesscxx . . $ structSpeaker_CordSpring#thickness.;
113 t -> Dycxx . . $ structDelta_Tube#Dy. = t -> Dyeqcxx . . $ structDelta_Tube#Dyeq. = 0.0;
114 t -> Dzcxx . . $ structDelta_Tube#Dz. = t -> Dzeqcxx . . $ structDelta_Tube#Dzeq. = mycxx . . $ `melder/melder.h:44:9`! cordcxx . . $ structSpeaker#cord..lengthcxx . . $ structSpeaker_CordDimensions#length.;
115 t -> masscxx . . $ structDelta_Tube#mass. = mycxx . . $ `melder/melder.h:44:9`! lowerCordcxx . . $ structSpeaker#lowerCord..masscxx . . $ structSpeaker_CordSpring#mass.;
116 t -> k1cxx . . $ structDelta_Tube#k1. = mycxx . . $ `melder/melder.h:44:9`! lowerCordcxx . . $ structSpeaker#lowerCord..k1cxx . . $ structSpeaker_CordSpring#k1.;
117 t -> k3cxx . . $ structDelta_Tube#k3. = t -> k1cxx . . $ structDelta_Tube#k1. * (20.0 / t -> Dzcxx . . $ structDelta_Tube#Dz.) * (20.0 / t -> Dzcxx . . $ structDelta_Tube#Dz.);
118 t -> Brelcxx . . $ structDelta_Tube#Brel. = 0.2;
119 }
120
121 /*
122 * Fill in the values for the upper part of the glottis (tube 37) only if there is no one-mass model.
123 */
124 if (mycxx . . $ `melder/melder.h:44:9`! cordcxx . . $ structSpeaker#cord..numberOfMassescxx . . $ structSpeaker_CordDimensions#numberOfMasses. >= 2) {
125 Delta_Tubecxx . . $ Delta_Tube# t = & thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).37];
126 t -> Dxcxx . . $ structDelta_Tube#Dx. = t -> Dxeqcxx . . $ structDelta_Tube#Dxeq. = mycxx . . $ `melder/melder.h:44:9`! upperCordcxx . . $ structSpeaker#upperCord..thicknesscxx . . $ structSpeaker_CordSpring#thickness.;
127 t -> Dycxx . . $ structDelta_Tube#Dy. = t -> Dyeqcxx . . $ structDelta_Tube#Dyeq. = 0.0;
128 t -> Dzcxx . . $ structDelta_Tube#Dz. = t -> Dzeqcxx . . $ structDelta_Tube#Dzeq. = mycxx . . $ `melder/melder.h:44:9`! cordcxx . . $ structSpeaker#cord..lengthcxx . . $ structSpeaker_CordDimensions#length.;
129 t -> masscxx . . $ structDelta_Tube#mass. = mycxx . . $ `melder/melder.h:44:9`! upperCordcxx . . $ structSpeaker#upperCord..masscxx . . $ structSpeaker_CordSpring#mass.;
130 t -> k1cxx . . $ structDelta_Tube#k1. = mycxx . . $ `melder/melder.h:44:9`! upperCordcxx . . $ structSpeaker#upperCord..k1cxx . . $ structSpeaker_CordSpring#k1.;
131 t -> k3cxx . . $ structDelta_Tube#k3. = t -> k1cxx . . $ structDelta_Tube#k1. * (20.0 / t -> Dzcxx . . $ structDelta_Tube#Dz.) * (20.0 / t -> Dzcxx . . $ structDelta_Tube#Dz.);
132 t -> Brelcxx . . $ structDelta_Tube#Brel. = 0.2;
133
134 /* Couple spring with lower cord. */
135 t -> k1left1cxx . . $ structDelta_Tube#k1left1. = thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).36]. k1right1cxx . . $ structDelta_Tube#k1right1. = 1.0;
136 }
137
138 /*
139 * Fill in the values for the conus elasticus (tubes 79..86) only if we want to model it.
140 */
141 if (mycxx . . $ `melder/melder.h:44:9`! cordcxx . . $ structSpeaker#cord..numberOfMassescxx . . $ structSpeaker_CordDimensions#numberOfMasses. == 10) {
142 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).79]. Dxcxx . . $ structDelta_Tube#Dx. = thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).79]. Dxeqcxx . . $ structDelta_Tube#Dxeq. = 8.0 * f;
143 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).80]. Dxcxx . . $ structDelta_Tube#Dx. = thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).80]. Dxeqcxx . . $ structDelta_Tube#Dxeq. = 7.0 * f;
144 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).81]. Dxcxx . . $ structDelta_Tube#Dx. = thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).81]. Dxeqcxx . . $ structDelta_Tube#Dxeq. = 6.0 * f;
145 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).82]. Dxcxx . . $ structDelta_Tube#Dx. = thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).82]. Dxeqcxx . . $ structDelta_Tube#Dxeq. = 5.0 * f;
146 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).83]. Dxcxx . . $ structDelta_Tube#Dx. = thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).83]. Dxeqcxx . . $ structDelta_Tube#Dxeq. = 4.0 * f;
147 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).84]. Dxcxx . . $ structDelta_Tube#Dx. = thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).84]. Dxeqcxx . . $ structDelta_Tube#Dxeq. = 0.75 * 4.0 * f + 0.25 * mycxx . . $ `melder/melder.h:44:9`! lowerCordcxx . . $ structSpeaker#lowerCord..thicknesscxx . . $ structSpeaker_CordSpring#thickness.;
148 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).85]. Dxcxx . . $ structDelta_Tube#Dx. = thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).85]. Dxeqcxx . . $ structDelta_Tube#Dxeq. = 0.50 * 4.0 * f + 0.50 * mycxx . . $ `melder/melder.h:44:9`! lowerCordcxx . . $ structSpeaker#lowerCord..thicknesscxx . . $ structSpeaker_CordSpring#thickness.;
149 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).86]. Dxcxx . . $ structDelta_Tube#Dx. = thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).86]. Dxeqcxx . . $ structDelta_Tube#Dxeq. = 0.25 * 4.0 * f + 0.75 * mycxx . . $ `melder/melder.h:44:9`! lowerCordcxx . . $ structSpeaker#lowerCord..thicknesscxx . . $ structSpeaker_CordSpring#thickness.;
150
151 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).79]. Dycxx . . $ structDelta_Tube#Dy. = thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).79]. Dyeqcxx . . $ structDelta_Tube#Dyeq. = 11.0 * f;
152 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).80]. Dycxx . . $ structDelta_Tube#Dy. = thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).80]. Dyeqcxx . . $ structDelta_Tube#Dyeq. = 7.0 * f;
153 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).81]. Dycxx . . $ structDelta_Tube#Dy. = thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).81]. Dyeqcxx . . $ structDelta_Tube#Dyeq. = 4.0 * f;
154 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).82]. Dycxx . . $ structDelta_Tube#Dy. = thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).82]. Dyeqcxx . . $ structDelta_Tube#Dyeq. = 2.0 * f;
155 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).83]. Dycxx . . $ structDelta_Tube#Dy. = thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).83]. Dyeqcxx . . $ structDelta_Tube#Dyeq. = 1.0 * f;
156 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).84]. Dycxx . . $ structDelta_Tube#Dy. = thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).84]. Dyeqcxx . . $ structDelta_Tube#Dyeq. = 0.75 * f;
157 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).85]. Dycxx . . $ structDelta_Tube#Dy. = thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).85]. Dyeqcxx . . $ structDelta_Tube#Dyeq. = 0.50 * f;
158 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).86]. Dycxx . . $ structDelta_Tube#Dy. = thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).86]. Dyeqcxx . . $ structDelta_Tube#Dyeq. = 0.25 * f;
159
160 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).79]. Dzcxx . . $ structDelta_Tube#Dz. = thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).79]. Dzeqcxx . . $ structDelta_Tube#Dzeq. = 16.0 * f;
161 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).80]. Dzcxx . . $ structDelta_Tube#Dz. = thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).80]. Dzeqcxx . . $ structDelta_Tube#Dzeq. = 16.0 * f;
162 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).81]. Dzcxx . . $ structDelta_Tube#Dz. = thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).81]. Dzeqcxx . . $ structDelta_Tube#Dzeq. = 16.0 * f;
163 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).82]. Dzcxx . . $ structDelta_Tube#Dz. = thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).82]. Dzeqcxx . . $ structDelta_Tube#Dzeq. = 16.0 * f;
164 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).83]. Dzcxx . . $ structDelta_Tube#Dz. = thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).83]. Dzeqcxx . . $ structDelta_Tube#Dzeq. = 16.0 * f;
165 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).84]. Dzcxx . . $ structDelta_Tube#Dz. = thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).84]. Dzeqcxx . . $ structDelta_Tube#Dzeq. = 0.75 * 16.0 * f + 0.25 * mycxx . . $ `melder/melder.h:44:9`! cordcxx . . $ structSpeaker#cord..lengthcxx . . $ structSpeaker_CordDimensions#length.;
166 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).85]. Dzcxx . . $ structDelta_Tube#Dz. = thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).85]. Dzeqcxx . . $ structDelta_Tube#Dzeq. = 0.50 * 16.0 * f + 0.50 * mycxx . . $ `melder/melder.h:44:9`! cordcxx . . $ structSpeaker#cord..lengthcxx . . $ structSpeaker_CordDimensions#length.;
167 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).86]. Dzcxx . . $ structDelta_Tube#Dz. = thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).86]. Dzeqcxx . . $ structDelta_Tube#Dzeq. = 0.25 * 16.0 * f + 0.75 * mycxx . . $ `melder/melder.h:44:9`! cordcxx . . $ structSpeaker#cord..lengthcxx . . $ structSpeaker_CordDimensions#length.;
168
169 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).79]. k1cxx . . $ structDelta_Tube#k1. = 160.0;
170 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).80]. k1cxx . . $ structDelta_Tube#k1. = 160.0;
171 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).81]. k1cxx . . $ structDelta_Tube#k1. = 160.0;
172 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).82]. k1cxx . . $ structDelta_Tube#k1. = 160.0;
173 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).83]. k1cxx . . $ structDelta_Tube#k1. = 160.0;
174 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).84]. k1cxx . . $ structDelta_Tube#k1. = 0.75 * 160.0 * f + 0.25 * mycxx . . $ `melder/melder.h:44:9`! lowerCordcxx . . $ structSpeaker#lowerCord..k1cxx . . $ structSpeaker_CordSpring#k1.;
175 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).85]. k1cxx . . $ structDelta_Tube#k1. = 0.50 * 160.0 * f + 0.50 * mycxx . . $ `melder/melder.h:44:9`! lowerCordcxx . . $ structSpeaker#lowerCord..k1cxx . . $ structSpeaker_CordSpring#k1.;
176 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).86]. k1cxx . . $ structDelta_Tube#k1. = 0.25 * 160.0 * f + 0.75 * mycxx . . $ `melder/melder.h:44:9`! lowerCordcxx . . $ structSpeaker#lowerCord..k1cxx . . $ structSpeaker_CordSpring#k1.;
177
178 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).79]. Brelcxx . . $ structDelta_Tube#Brel. = 0.7;
179 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).80]. Brelcxx . . $ structDelta_Tube#Brel. = 0.6;
180 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).81]. Brelcxx . . $ structDelta_Tube#Brel. = 0.5;
181 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).82]. Brelcxx . . $ structDelta_Tube#Brel. = 0.4;
182 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).83]. Brelcxx . . $ structDelta_Tube#Brel. = 0.3;
183 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).84]. Brelcxx . . $ structDelta_Tube#Brel. = 0.2;
184 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).85]. Brelcxx . . $ structDelta_Tube#Brel. = 0.2;
185 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).86]. Brelcxx . . $ structDelta_Tube#Brel. = 0.2;
186
187 for (integercxx . . $ integer# itube = 79; itube <= 86; itube ++) {
188 Delta_Tubecxx . . $ Delta_Tube# t = & thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).itube];
189 t -> masscxx . . $ structDelta_Tube#mass. = t -> Dxcxx . . $ structDelta_Tube#Dx. * t -> Dzcxx . . $ structDelta_Tube#Dz. / (30.0 * f);
190 t -> k3cxx . . $ structDelta_Tube#k3. = t -> k1cxx . . $ structDelta_Tube#k1. * (20.0 / t -> Dzcxx . . $ structDelta_Tube#Dz.) * (20.0 / t -> Dzcxx . . $ structDelta_Tube#Dz.);
191 t -> k1left1cxx . . $ structDelta_Tube#k1left1. = t -> k1right1cxx . . $ structDelta_Tube#k1right1. = 1.0;
192 }
193 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).79]. k1left1cxx . . $ structDelta_Tube#k1left1. = 0.0;
194 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).36]. k1left1cxx . . $ structDelta_Tube#k1left1. = 1.0; // the essence: couple spring with lower vocal cords
195 }
196
197 /*
198 * Fill in the values of the glottal shunt only if we want to model it.
199 */
200 if (mycxx . . $ `melder/melder.h:44:9`! shuntcxx . . $ structSpeaker#shunt..Dxcxx . . $ structSpeaker_GlottalShunt#Dx. != 0.0) {
201 for (integercxx . . $ integer# itube = 87; itube <= 89; itube ++) {
202 Delta_Tubecxx . . $ Delta_Tube# t = & thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).itube];
203 t -> Dxcxx . . $ structDelta_Tube#Dx. = t -> Dxeqcxx . . $ structDelta_Tube#Dxeq. = mycxx . . $ `melder/melder.h:44:9`! shuntcxx . . $ structSpeaker#shunt..Dxcxx . . $ structSpeaker_GlottalShunt#Dx.;
204 t -> Dycxx . . $ structDelta_Tube#Dy. = t -> Dyeqcxx . . $ structDelta_Tube#Dyeq. = mycxx . . $ `melder/melder.h:44:9`! shuntcxx . . $ structSpeaker#shunt..Dycxx . . $ structSpeaker_GlottalShunt#Dy.;
205 t -> Dzcxx . . $ structDelta_Tube#Dz. = t -> Dzeqcxx . . $ structDelta_Tube#Dzeq. = mycxx . . $ `melder/melder.h:44:9`! shuntcxx . . $ structSpeaker#shunt..Dzcxx . . $ structSpeaker_GlottalShunt#Dz.;
206 t -> masscxx . . $ structDelta_Tube#mass. = 3.0 * mycxx . . $ `melder/melder.h:44:9`! upperCordcxx . . $ structSpeaker#upperCord..masscxx . . $ structSpeaker_CordSpring#mass.; // heavy...
207 t -> k1cxx . . $ structDelta_Tube#k1. = 3.0 * mycxx . . $ `melder/melder.h:44:9`! upperCordcxx . . $ structSpeaker#upperCord..k1cxx . . $ structSpeaker_CordSpring#k1.; // ...and stiff...
208 t -> k3cxx . . $ structDelta_Tube#k3. = t -> k1cxx . . $ structDelta_Tube#k1. * (20.0 / t -> Dzcxx . . $ structDelta_Tube#Dz.) * (20.0 / t -> Dzcxx . . $ structDelta_Tube#Dz.);
209 t -> Brelcxx . . $ structDelta_Tube#Brel. = 3.0; // ...and inelastic, so that the walls will not vibrate
210 }
211 }
212
213 /* Vocal tract from neutral articulation. */
214 bool closed [40];
215 {
216 autoArtcxx . . $ autoArt# art = Art_createcxx . . $ Art_create(23bf0cc812f7d3d7). ();
217 Art_Speaker_meshVocalTractcxx . . $ Art_Speaker_meshVocalTract(75285077b25cabf8). (art.getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(), me, xi, yi, xe, ye, xmm, ymm, closed);
218 }
219
220 /* Pharynx and mouth: tubes 38..64. */
221
222 for (integercxx . . $ integer# itube = 38; itube <= 64; itube ++) {
223 Delta_Tubecxx . . $ Delta_Tube# t = & thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).itube];
224 integercxx . . $ integer# i = itube - 37;
225 dx = xmm [i] - xmm [i + 1];
226 dy = ymm [i] - ymm [i + 1];
227 t -> Dxcxx . . $ structDelta_Tube#Dx. = t -> Dxeqcxx . . $ structDelta_Tube#Dxeq. = hypotcxx . . $ hypot(b71928d39fde4295). (dx, dy);
228 dx = xe [i] - xi [i];
229 dy = ye [i] - yi [i];
230 t -> Dyeqcxx . . $ structDelta_Tube#Dyeq. = hypotcxx . . $ hypot(b71928d39fde4295). (dx, dy);
231 if (closed [i])
232 t -> Dyeqcxx . . $ structDelta_Tube#Dyeq. = - t -> Dyeqcxx . . $ structDelta_Tube#Dyeq.;
233 t -> Dycxx . . $ structDelta_Tube#Dy. = t -> Dyeqcxx . . $ structDelta_Tube#Dyeq.;
234 t -> Dzcxx . . $ structDelta_Tube#Dz. = t -> Dzeqcxx . . $ structDelta_Tube#Dzeq. = 0.015;
235 t -> masscxx . . $ structDelta_Tube#mass. = 0.006;
236 t -> k1cxx . . $ structDelta_Tube#k1. = 30.0;
237 t -> k3cxx . . $ structDelta_Tube#k3. = 0.0;
238 t -> Brelcxx . . $ structDelta_Tube#Brel. = 1.0;
239 }
240 /* For tongue-tip vibration [r]: thy tube [60]. Brel = 0.1; thy tube [60]. k1 = 3; */
241
242 /* Nose: tubes 65..78. */
243
244 for (integercxx . . $ integer# itube = 65; itube <= 78; itube ++) {
245 Delta_Tubecxx . . $ Delta_Tube# t = & thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).itube];
246 t -> Dxcxx . . $ structDelta_Tube#Dx. = t -> Dxeqcxx . . $ structDelta_Tube#Dxeq. = mycxx . . $ `melder/melder.h:44:9`! nosecxx . . $ structSpeaker#nose..Dxcxx . . $ structSpeaker_Nose#Dx.;
247 t -> Dycxx . . $ structDelta_Tube#Dy. = t -> Dyeqcxx . . $ structDelta_Tube#Dyeq. = mycxx . . $ `melder/melder.h:44:9`! nosecxx . . $ structSpeaker#nose..weqcxx . . $ structSpeaker_Nose#weq. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).itube - 64];
248 t -> Dzcxx . . $ structDelta_Tube#Dz. = t -> Dzeqcxx . . $ structDelta_Tube#Dzeq. = mycxx . . $ `melder/melder.h:44:9`! nosecxx . . $ structSpeaker#nose..Dzcxx . . $ structSpeaker_Nose#Dz.;
249 t -> masscxx . . $ structDelta_Tube#mass. = 0.006;
250 t -> k1cxx . . $ structDelta_Tube#k1. = 100.0;
251 t -> k3cxx . . $ structDelta_Tube#k3. = 0.0;
252 t -> Brelcxx . . $ structDelta_Tube#Brel. = 1.0;
253 }
254 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).65]. Dycxx . . $ structDelta_Tube#Dy. = thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).65]. Dyeqcxx . . $ structDelta_Tube#Dyeq. = 0.0; // override: nasopharyngeal port closed
255
256 /* The default structure:
257 * every tube is connected on the left to the previous tube (index one lower).
258 * This corresponds to a two-mass model of the vocal cords without shunt.
259 */
260 for (integercxx . . $ integer# itube = SMOOTH_LUNGScxx . . $ `artsynth/Speaker_to_Delta.cpp:21:9`! ? FIRST_TUBEcxx . . $ `artsynth/Speaker_to_Delta.cpp:22:9`! : 1; itube <= thycxx . . $ `melder/melder.h:45:9`! numberOfTubescxx . . $ structDelta#numberOfTubes.; itube ++) {
261 Delta_Tubecxx . . $ Delta_Tube# t = & thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).itube];
262 t -> s1cxx . . $ structDelta_Tube#s1. = 5e6 * t -> Dxcxx . . $ structDelta_Tube#Dx. * t -> Dzcxx . . $ structDelta_Tube#Dz.;
263 t -> s3cxx . . $ structDelta_Tube#s3. = t -> s1cxx . . $ structDelta_Tube#s1. / (0.9e-3 * 0.9e-3);
264 t -> dycxx . . $ structDelta_Tube#dy. = 1e-5;
265 t -> left1cxx . . $ structDelta_Tube#left1. = t - 1; // connect to the previous tube on the left
266 t -> right1cxx . . $ structDelta_Tube#right1. = t + 1; // connect to the next tube on the right
267 }
268
269 /***** Connections: boundaries and interfaces. *****/
270
271 /* The leftmost boundary: the diaphragm (tube 1).
272 * Disconnect on the left.
273 */
274 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).SMOOTH_LUNGScxx . . $ `artsynth/Speaker_to_Delta.cpp:21:9`! ? FIRST_TUBEcxx . . $ `artsynth/Speaker_to_Delta.cpp:22:9`! : 1]. left1cxx . . $ structDelta_Tube#left1. = nullptr; // closed at diaphragm
275
276 /* Optional one-mass model of the vocal cords.
277 * Short-circuit over tube 37 (upper glottis).
278 */
279 if (mycxx . . $ `melder/melder.h:44:9`! cordcxx . . $ structSpeaker#cord..numberOfMassescxx . . $ structSpeaker_CordDimensions#numberOfMasses. == 1) {
280
281 /* Connect the right side of tube 36 to the left side of tube 38. */
282 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).36]. right1cxx . . $ structDelta_Tube#right1. = & thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).38];
283 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).38]. left1cxx . . $ structDelta_Tube#left1. = & thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).36];
284
285 /* Disconnect tube 37 on both sides. */
286 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).37]. left1cxx . . $ structDelta_Tube#left1. = thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).37]. right1cxx . . $ structDelta_Tube#right1. = nullptr;
287 }
288
289 /* Optionally couple vocal cords with conus elasticus.
290 * Replace tubes 32..35 (upper trachea) by tubes 79..86 (conus elasticus).
291 */
292 if (mycxx . . $ `melder/melder.h:44:9`! cordcxx . . $ structSpeaker#cord..numberOfMassescxx . . $ structSpeaker_CordDimensions#numberOfMasses. == 10) {
293
294 /* Connect the right side of tube 31 to the left side of tube 79. */
295 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).31]. right1cxx . . $ structDelta_Tube#right1. = & thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).79];
296 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).79]. left1cxx . . $ structDelta_Tube#left1. = & thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).31];
297
298 /* Connect the right side of tube 86 to the left side of tube 36. */
299 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).86]. right1cxx . . $ structDelta_Tube#right1. = & thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).36];
300 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).36]. left1cxx . . $ structDelta_Tube#left1. = & thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).86];
301
302 /* Disconnect tubes 32..35 on both sides. */
303 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).32]. left1cxx . . $ structDelta_Tube#left1. = thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).32]. right1cxx . . $ structDelta_Tube#right1. = nullptr;
304 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).33]. left1cxx . . $ structDelta_Tube#left1. = thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).33]. right1cxx . . $ structDelta_Tube#right1. = nullptr;
305 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).34]. left1cxx . . $ structDelta_Tube#left1. = thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).34]. right1cxx . . $ structDelta_Tube#right1. = nullptr;
306 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).35]. left1cxx . . $ structDelta_Tube#left1. = thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).35]. right1cxx . . $ structDelta_Tube#right1. = nullptr;
307 } else {
308
309 /* Disconnect tubes 79..86 on both sides. */
310 for (integercxx . . $ integer# itube = 79; itube <= 86; itube ++)
311 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).itube]. left1cxx . . $ structDelta_Tube#left1. = thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).itube]. right1cxx . . $ structDelta_Tube#right1. = nullptr;
312 }
313
314 /* Optionally add a shunt parallel to the glottis.
315 * Create a side branch from tube 34/35 (or 85/86) to tube 38/39 with tubes 87..89.
316 */
317 if (mycxx . . $ `melder/melder.h:44:9`! shuntcxx . . $ structSpeaker#shunt..Dxcxx . . $ structSpeaker_GlottalShunt#Dx. != 0.0) {
318 integercxx . . $ integer# topOfTrachea = ( mycxx . . $ `melder/melder.h:44:9`! cordcxx . . $ structSpeaker#cord..numberOfMassescxx . . $ structSpeaker_CordDimensions#numberOfMasses. == 10 ? 86 : 35 );
319
320 /* Create a three-way interface below the shunt.
321 * Connect lowest shunt tube (87) with top of trachea (34/35 or 85/86).
322 */
323 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).topOfTrachea - 1]. right2cxx . . $ structDelta_Tube#right2. = & thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).87]; // trachea to shunt
324 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).87]. left1cxx . . $ structDelta_Tube#left1. = & thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).topOfTrachea - 1]; // shunt to trachea
325 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).87]. Dxeqcxx . . $ structDelta_Tube#Dxeq. = thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).topOfTrachea - 1]. Dxeqcxx . . $ structDelta_Tube#Dxeq. = thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).topOfTrachea]. Dxeqcxx . . $ structDelta_Tube#Dxeq.; // equal length
326 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).87]. Dxcxx . . $ structDelta_Tube#Dx. = thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).topOfTrachea - 1]. Dxcxx . . $ structDelta_Tube#Dx. = thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).topOfTrachea]. Dxcxx . . $ structDelta_Tube#Dx.;
327
328 /* Create a three-way interface above the shunt.
329 * Connect highest shunt tube (89) with bottom of pharynx (38/39).
330 */
331 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).89]. right1cxx . . $ structDelta_Tube#right1. = & thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).39]; // shunt to pharynx
332 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).39]. left2cxx . . $ structDelta_Tube#left2. = & thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).89]; // pharynx to shunt
333 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).89]. Dxeqcxx . . $ structDelta_Tube#Dxeq. = thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).39]. Dxeqcxx . . $ structDelta_Tube#Dxeq. = thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).38]. Dxeqcxx . . $ structDelta_Tube#Dxeq.; // all three of equal length
334 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).89]. Dxcxx . . $ structDelta_Tube#Dx. = thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).39]. Dxcxx . . $ structDelta_Tube#Dx. = thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).38]. Dxcxx . . $ structDelta_Tube#Dx.;
335 } else {
336
337 /* Disconnect tubes 87..89 on both sides. */
338 for (integercxx . . $ integer# itube = 87; itube <= 89; itube ++)
339 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).itube]. left1cxx . . $ structDelta_Tube#left1. = thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).itube]. right1cxx . . $ structDelta_Tube#right1. = nullptr;
340 }
341
342 /* Create a three-way interface at the nasopharyngeal port.
343 * Connect tubes 50 (pharynx), 51 (mouth), and 65 (nose).
344 */
345 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).50]. right2cxx . . $ structDelta_Tube#right2. = & thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).65]; // pharynx to nose
346 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).65]. left1cxx . . $ structDelta_Tube#left1. = & thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).50]; // nose to pharynx
347 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).65]. Dxeqcxx . . $ structDelta_Tube#Dxeq. = thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).51]. Dxeqcxx . . $ structDelta_Tube#Dxeq. = thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).50]. Dxeqcxx . . $ structDelta_Tube#Dxeq.; // all three must be of equal length
348 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).65]. Dxcxx . . $ structDelta_Tube#Dx. = thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).51]. Dxcxx . . $ structDelta_Tube#Dx. = thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).50]. Dxcxx . . $ structDelta_Tube#Dx.;
349
350 /* The rightmost boundaries: the lips (tube 64) and the nostrils (tube 78).
351 * Disconnect on the right.
352 */
353 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).64]. right1cxx . . $ structDelta_Tube#right1. = nullptr; // radiation at the lips
354 thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).78]. right1cxx . . $ structDelta_Tube#right1. = nullptr; // radiation at the nostrils
355
356 for (integercxx . . $ integer# itube = 1; itube <= thycxx . . $ `melder/melder.h:45:9`! numberOfTubescxx . . $ structDelta#numberOfTubes.; itube ++) {
357 Delta_Tubecxx . . $ Delta_Tube# t = & thycxx . . $ `melder/melder.h:45:9`! tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).itube];
358 Melder_assertcxx . . $ `melder/melder_assert.h:39:10`! (! t->left1 || t->left1->right1 == t || t->left1->right2 == t);
359 Melder_assertcxx . . $ `melder/melder_assert.h:39:10`! (! t->left2 || t->left2->right1 == t);
360 Melder_assertcxx . . $ `melder/melder_assert.h:39:10`! (! t->right1 || t->right1->left1 == t || t->right1->left2 == t);
361 Melder_assertcxx . . $ `melder/melder_assert.h:39:10`! (! t->right2 || t->right2->left1 == t);
362 }
363 return theecxx . . $ autoSomeThing#autoSomeThing(b79141a71f7bc86f).;
364 }
365
366 /* End of file Speaker_to_Delta.cpp */