| 1 | /* Art_Speaker_to_VocalTract.cpp |
| 2 | * |
| 3 | * Copyright (C) 1992-2005,2008,2011,2015-2017,2019 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 "Delta.h"cxx . . $ `<file>/artsynth/Delta.h`/ |
| 20 | #include "Speaker_to_Delta.h"cxx . . $ `<file>/artsynth/Speaker_to_Delta.h`/ |
| 21 | #include "Art_Speaker_Delta.h"cxx . . $ `<file>/artsynth/Art_Speaker_Delta.h`/ |
| 22 | #include "Art_Speaker_to_VocalTract.h"cxx . . $ `<file>/artsynth/Art_Speaker_to_VocalTract.h`/ |
| 23 | |
| 24 | autoVocalTractcxx . . $ autoVocalTract# Art_Speaker_to_VocalTractcxx . . $ Art_Speaker_to_VocalTract(1735b417481694c2). (Artcxx . . $ Art# art, Speakercxx . . $ Speaker# speaker) { |
| 25 | autoDeltacxx . . $ autoDelta# delta = Speaker_to_Deltacxx . . $ Speaker_to_Delta(e5572b05f6403c80). (speaker); |
| 26 | Art_Speaker_intoDeltacxx . . $ Art_Speaker_intoDelta(9162de1c621f26a0). (art, speaker, delta.getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).()); |
| 27 | double area [300]; |
| 28 | constexpr double sectionLength = 0.001; // one millimetre |
| 29 | integercxx . . $ integer# numberOfSections = 0; |
| 30 | for (integercxx . . $ integer# isection = 1; isection <= 27; isection ++) { |
| 31 | Delta_Tubecxx . . $ Delta_Tube# tube = & delta ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). tubescxx . . $ structDelta#tubes. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).37 + isection]; |
| 32 | integercxx . . $ integer# numberOfConstantSections = Melder_iroundcxx . . $ `melder/melder_ftoi.h:78:9`! (tube -> Dxeqcxx . . $ structDelta_Tube#Dxeq. / sectionLength); |
| 33 | double constantArea = tube -> Dyeqcxx . . $ structDelta_Tube#Dyeq. * tube -> Dzeqcxx . . $ structDelta_Tube#Dzeq.; |
| 34 | for (integercxx . . $ integer# jsection = 1; jsection <= numberOfConstantSections; jsection ++) |
| 35 | area [++ numberOfSections] = constantArea; |
| 36 | } |
| 37 | autoVocalTractcxx . . $ autoVocalTract# thee = VocalTract_createcxx . . $ VocalTract_create(a5d85e6da9521b1d). (numberOfSections, sectionLength); |
| 38 | for (integercxx . . $ integer# isection = 1; isection <= numberOfSections; isection ++) |
| 39 | thycxx . . $ `melder/melder.h:45:9`! zcxx . . $ structMatrix#z. [cxx . . $ automatrix#`operator[]`(2d545b3cb3f8e666).1] [cxx . . $ vector#`operator[]`(8a4599b8835d1ce1).isection] = area [isection]; |
| 40 | return theecxx . . $ autoSomeThing#autoSomeThing(b79141a71f7bc86f).; |
| 41 | } |
| 42 | |
| 43 | /* End of file Art_Speaker_to_VocalTract.cpp */ |