| 1 | /* FormantPathEditor.cpp |
| 2 | * |
| 3 | * Copyright (C) 2020-2023 David Weenink, 2022-2024 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 "FormantPathEditor.h"cxx . . $ `<file>/LPC/FormantPathEditor.h`/ |
| 20 | #include "FormantPath_to_IntervalTier.h"cxx . . $ `<file>/LPC/FormantPath_to_IntervalTier.h`/ |
| 21 | #include "Graphics_extensions.h"cxx . . $ `<file>/dwsys/Graphics_extensions.h`/ |
| 22 | #include "EditorM.h"cxx . . $ `<file>/sys/EditorM.h`/ |
| 23 | #include "Formant_extensions.h"cxx . . $ `<file>/LPC/Formant_extensions.h`/ |
| 24 | #include "LPC_and_Formant.h"cxx . . $ `<file>/LPC/LPC_and_Formant.h`/ |
| 25 | #include "NUM2.h"cxx . . $ `<file>/dwsys/NUM2.h`/ |
| 26 | #include "NUMselect.h"cxx . . $ `<file>/dwsys/NUMselect.h`/ |
| 27 | #include "PitchTier.h"cxx . . $ `<file>/fon/PitchTier.h`/ |
| 28 | #include "PitchTier_to_PointProcess.h"cxx . . $ `<file>/fon/PitchTier_to_PointProcess.h`/ |
| 29 | #include "Sound_and_LPC.h"cxx . . $ `<file>/LPC/Sound_and_LPC.h`/ |
| 30 | #include "Sound_extensions.h"cxx . . $ `<file>/dwtools/Sound_extensions.h`/ |
| 31 | #include "TextGrid_extensions.h"cxx . . $ `<file>/dwtools/TextGrid_extensions.h`/ |
| 32 | |
| 33 | Thing_implementcxx . . $ `sys/Thing.h:65:9`! (FormantPathEditor, FunctionEditor, 0); |
| 34 | |
| 35 | #include "Prefs_define.h"cxx . . $ `<file>/sys/Prefs_define.h`/ |
| 36 | #include "FormantPathEditor_prefs.h"cxx . . $ `<file>/LPC/FormantPathEditor_prefs.h`/ |
| 37 | #include "Prefs_install.h"cxx . . $ `<file>/sys/Prefs_install.h`/ |
| 38 | #include "FormantPathEditor_prefs.h"cxx . . $ `<file>/LPC/FormantPathEditor_prefs.h`/ |
| 39 | #include "Prefs_copyToInstance.h"cxx . . $ `<file>/sys/Prefs_copyToInstance.h`/ |
| 40 | #include "FormantPathEditor_prefs.h"cxx . . $ `<file>/LPC/FormantPathEditor_prefs.h`/ |
| 41 | #include "PointProcess_and_Sound.h"cxx . . $ `<file>/fon/PointProcess_and_Sound.h`/ |
| 42 | |
| 43 | void structFormantPathEditorcxx . . $ structFormantPathEditor# :: v1_infocxx . . $ structFormantPathEditor#v1_info(49f6e7a06ebc5aa8). () { |
| 44 | FormantPathEditor_Parentcxx . . $ FormantPathEditor_Parent# :: v1_infocxx . . $ structFunctionEditor#v1_info(49f6e7a06ebc5aa8). (); |
| 45 | } |
| 46 | |
| 47 | /* |
| 48 | MelderColour markedCandidatesColour = MelderColour (0.984, 0.951, 0.020); // Melder_YELLOW |
| 49 | In the selectionViewer, the following light yellow colour combines better with the chosen colours |
| 50 | for the odd and even numbered formants (Melder_RED and Melder_PURPLE, respectively). |
| 51 | */ |
| 52 | MelderColourcxx . . $ MelderColour# markedCandidatesColourcxx . . $ markedCandidatesColour. = MelderColourcxx . . $ MelderColour#MelderColour(98dd472ac7e5c3d4). (0.984,0.984, 0.7); |
| 53 | |
| 54 | /********** UTILITIES **********/ |
| 55 | |
| 56 | #define MAX_Tcxx . . $ `LPC/FormantPathEditor.cpp:56:9`! 0.02000000001 /* Maximum interval between two voice pulses (otherwise voiceless). */ |
| 57 | |
| 58 | static autoPitchTiercxx . . $ autoPitchTier# Pitch_to_PitchTier_partcxx . . $ Pitch_to_PitchTier_part(118f6b16d69c1fac). (Pitchcxx . . $ Pitch# me, double startTime, double endTime) { |
| 59 | try { |
| 60 | autoPitchTiercxx . . $ autoPitchTier# thee = PitchTier_createcxx . . $ PitchTier_create(6e304f2c8cc67c9c). (startTime, endTime); |
| 61 | for (integercxx . . $ integer# i = 1; i <= mycxx . . $ `melder/melder.h:44:9`! nxcxx . . $ structSampled#nx.; i ++) { |
| 62 | const double time = Sampled_indexToXcxx . . $ Sampled_indexToX(65bcd2c9acbb3dd5). (me, i); |
| 63 | if (time < startTime) |
| 64 | continue; |
| 65 | if (time > endTime) |
| 66 | break; |
| 67 | const double frequency = mycxx . . $ `melder/melder.h:44:9`! framescxx . . $ structPitch#frames. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).i]. candidatescxx . . $ structPitch_Frame#candidates. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).1]. frequencycxx . . $ structPitch_Candidate#frequency.; |
| 68 | /* |
| 69 | Count only voiced frames. |
| 70 | */ |
| 71 | if (Pitch_util_frequencyIsVoicedcxx . . $ Pitch_util_frequencyIsVoiced(828b76dce88fac). (frequency, mycxx . . $ `melder/melder.h:44:9`! ceilingcxx . . $ structPitch#ceiling.)) { |
| 72 | RealTier_addPointcxx . . $ RealTier_addPoint(d84c0874d617a544). (thee.getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(), time, frequency); |
| 73 | } |
| 74 | } |
| 75 | return theecxx . . $ autoSomeThing#autoSomeThing(b79141a71f7bc86f).; |
| 76 | } catch (MelderErrorcxx . . $ MelderError#) { |
| 77 | Melder_throwcxx . . $ `melder/melder_error.h:77:9`! (me, U": part not converted to PitchTier."); |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | static autoPointProcesscxx . . $ autoPointProcess# PointProcess_extractPartcxx . . $ PointProcess_extractPart(36eae8ae3bdcadc8). (PointProcesscxx . . $ PointProcess# me, double startTime, double endTime) { |
| 82 | try { |
| 83 | integercxx . . $ integer# i1 = 1, i2 = mycxx . . $ `melder/melder.h:44:9`! ntcxx . . $ structPointProcess#nt.; |
| 84 | while (i1 <= mycxx . . $ `melder/melder.h:44:9`! ntcxx . . $ structPointProcess#nt. && mycxx . . $ `melder/melder.h:44:9`! tcxx . . $ structPointProcess#t. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).i1] < startTime) |
| 85 | i1 ++; |
| 86 | while (i2 >= 1 && mycxx . . $ `melder/melder.h:44:9`! tcxx . . $ structPointProcess#t. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).i2] > endTime) |
| 87 | i2 --; |
| 88 | const integercxx . . $ integer# nt = i2 - i1 + 1; |
| 89 | Melder_requirecxx . . $ `melder/melder_require.h:21:9`! (nt > 0, |
| 90 | U"There must be at least one point in the interval."); |
| 91 | autoPointProcesscxx . . $ autoPointProcess# thee = PointProcess_createcxx . . $ PointProcess_create(7a858f446a8dd7cc). (startTime, endTime, nt); |
| 92 | thycxx . . $ `melder/melder.h:45:9`! ntcxx . . $ structPointProcess#nt. = nt; |
| 93 | thycxx . . $ `melder/melder.h:45:9`! tcxx . . $ structPointProcess#t..sizecxx . . $ autovector#size. = nt; |
| 94 | thycxx . . $ `melder/melder.h:45:9`! tcxx . . $ structPointProcess#t..getcxx . . $ autovector#get(e8d1da7fe68a6585).() <<=cxx . . $ `operator<<=`(adea042513329390). mycxx . . $ `melder/melder.h:44:9`! tcxx . . $ structPointProcess#t..partcxx . . $ autovector#part(2d8d48654ca64e70). (i1, i2); |
| 95 | return theecxx . . $ autoSomeThing#autoSomeThing(b79141a71f7bc86f).; |
| 96 | } catch (MelderErrorcxx . . $ MelderError#) { |
| 97 | Melder_throwcxx . . $ `melder/melder_error.h:77:9`! (me, U": could not extract part."); |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | static autoSoundcxx . . $ autoSound# FormantPathEditor_getResynthesiscxx . . $ FormantPathEditor_getResynthesis(3add1d3d7be3d8ff). (FormantPathEditorcxx . . $ FormantPathEditor# me, double startTime, double endTime) { |
| 102 | try { |
| 103 | SoundAnalysisArea_haveVisiblePitchcxx . . $ SoundAnalysisArea_haveVisiblePitch(16a0e84e612eeb2). (mycxx . . $ `melder/melder.h:44:9`! formantPathAreacxx . . $ structFormantPathEditor#formantPathArea(e5a7ab802631ed92).().getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).()); |
| 104 | Pitchcxx . . $ Pitch# pitch = mycxx . . $ `melder/melder.h:44:9`! formantPathAreacxx . . $ structFormantPathEditor#formantPathArea(e5a7ab802631ed92).() ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). d_pitchcxx . . $ structSoundAnalysisArea#d_pitch..getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(); |
| 105 | autoPitchTiercxx . . $ autoPitchTier# pitchtierPart = Pitch_to_PitchTier_partcxx . . $ Pitch_to_PitchTier_part(118f6b16d69c1fac). (pitch, startTime, endTime); |
| 106 | |
| 107 | SoundAnalysisArea_haveVisiblePulsescxx . . $ SoundAnalysisArea_haveVisiblePulses(16a0e84e612eeb2). (mycxx . . $ `melder/melder.h:44:9`! formantPathAreacxx . . $ structFormantPathEditor#formantPathArea(e5a7ab802631ed92).().getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).()); |
| 108 | PointProcesscxx . . $ PointProcess# pulses = mycxx . . $ `melder/melder.h:44:9`! formantPathAreacxx . . $ structFormantPathEditor#formantPathArea(e5a7ab802631ed92).() ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). d_pulsescxx . . $ structSoundAnalysisArea#d_pulses..getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(); |
| 109 | autoPointProcesscxx . . $ autoPointProcess# pulsesPart = PointProcess_extractPartcxx . . $ PointProcess_extractPart(36eae8ae3bdcadc8). (pulses, startTime, endTime); |
| 110 | |
| 111 | autoPointProcesscxx . . $ autoPointProcess# pulses2 = PitchTier_Point_to_PointProcesscxx . . $ PitchTier_Point_to_PointProcess(cf9e1213cef3e948). (pitchtierPart.getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(), pulsesPart.getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(), MAX_Tcxx . . $ `LPC/FormantPathEditor.cpp:56:9`!); |
| 112 | const double samplingFrequency = 22050.0; |
| 113 | autoSoundcxx . . $ autoSound# train = PointProcess_to_Sound_pulseTraincxx . . $ PointProcess_to_Sound_pulseTrain(187ff6b615b4a390). (pulses2.getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(), samplingFrequency , 0.7, 0.05, 30); |
| 114 | |
| 115 | autoFormantcxx . . $ autoFormant# formantPart = Formant_extractPartcxx . . $ Formant_extractPart(ffc03f71e55e4841). (mycxx . . $ `melder/melder.h:44:9`! formantPathAreacxx . . $ structFormantPathEditor#formantPathArea(e5a7ab802631ed92).() ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). d_formantcxx . . $ structSoundAnalysisArea#d_formant..getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(), startTime, endTime); |
| 116 | autoLPCcxx . . $ autoLPC# lpc = Formant_to_LPCcxx . . $ Formant_to_LPC(d5e8f4892869150a). (formantPart.getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(), 1.0 / samplingFrequency); |
| 117 | |
| 118 | autoSoundcxx . . $ autoSound# sound = LPC_Sound_filtercxx . . $ LPC_Sound_filter(94682ef9887ad8d9). (lpc.getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(), train.getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(), false); |
| 119 | Vector_scalecxx . . $ Vector_scale(54f31cdb89d1acde). (sound.getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(), 0.99); |
| 120 | constexpr double fadeTime = 0.005; |
| 121 | Sound_fadecxx . . $ Sound_fade(3d2526c498c6aff2). (sound.getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(), 0, sound ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). xmincxx . . $ structFunction#xmin., fadeTime, false, true); |
| 122 | Sound_fadecxx . . $ Sound_fade(3d2526c498c6aff2). (sound.getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(), 0, sound ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). xmaxcxx . . $ structFunction#xmax., -fadeTime, true, true); |
| 123 | return soundcxx . . $ autoSomeThing#autoSomeThing(b79141a71f7bc86f).; |
| 124 | } catch (MelderErrorcxx . . $ MelderError#) { |
| 125 | Melder_throwcxx . . $ `melder/melder_error.h:77:9`! (U"Could not synthesize."); |
| 126 | } |
| 127 | } |
| 128 | |
| 129 | static void FormantPathEditor_getDrawingDatacxx . . $ FormantPathEditor_getDrawingData(e7e315f693409568). (FormantPathEditorcxx . . $ FormantPathEditor# me, double *out_startTime, double *out_endTime, double *out_xCursor, double *out_yCursor) { |
| 130 | double startTime = mycxx . . $ `melder/melder.h:44:9`! startWindowcxx . . $ structFunctionEditor#startWindow., endTime = mycxx . . $ `melder/melder.h:44:9`! endWindowcxx . . $ structFunctionEditor#endWindow.; |
| 131 | double xCursor; |
| 132 | if (mycxx . . $ `melder/melder.h:44:9`! startSelectioncxx . . $ structFunctionEditor#startSelection. == mycxx . . $ `melder/melder.h:44:9`! endSelectioncxx . . $ structFunctionEditor#endSelection.) { |
| 133 | startTime = mycxx . . $ `melder/melder.h:44:9`! startWindowcxx . . $ structFunctionEditor#startWindow.; |
| 134 | endTime = mycxx . . $ `melder/melder.h:44:9`! endWindowcxx . . $ structFunctionEditor#endWindow.; |
| 135 | xCursor = mycxx . . $ `melder/melder.h:44:9`! startSelectioncxx . . $ structFunctionEditor#startSelection.; |
| 136 | } else { |
| 137 | startTime = mycxx . . $ `melder/melder.h:44:9`! startSelectioncxx . . $ structFunctionEditor#startSelection.; |
| 138 | endTime = mycxx . . $ `melder/melder.h:44:9`! endSelectioncxx . . $ structFunctionEditor#endSelection.; |
| 139 | xCursor = mycxx . . $ `melder/melder.h:44:9`! tmincxx . . $ structFunctionEditor#tmin. - 1.0; // don't show |
| 140 | } |
| 141 | if (out_startTime) |
| 142 | *out_startTime = startTime; |
| 143 | if (out_endTime) |
| 144 | *out_endTime = endTime; |
| 145 | if (out_xCursor) |
| 146 | *out_xCursor = xCursor; |
| 147 | if (out_yCursor) |
| 148 | *out_yCursor = ( mycxx . . $ `melder/melder.h:44:9`! formantPathAreacxx . . $ structFormantPathEditor#formantPathArea(e5a7ab802631ed92).() ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). d_spectrogram_cursorcxx . . $ structSoundAnalysisArea#d_spectrogram_cursor. > mycxx . . $ `melder/melder.h:44:9`! formantPathAreacxx . . $ structFormantPathEditor#formantPathArea(e5a7ab802631ed92).() ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). instancePref_spectrogram_viewFromcxx . . $ structSoundAnalysisArea#instancePref_spectrogram_viewFrom(21b6c25e127938e2).() && |
| 149 | mycxx . . $ `melder/melder.h:44:9`! formantPathAreacxx . . $ structFormantPathEditor#formantPathArea(e5a7ab802631ed92).() ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). d_spectrogram_cursorcxx . . $ structSoundAnalysisArea#d_spectrogram_cursor. < mycxx . . $ `melder/melder.h:44:9`! formantPathAreacxx . . $ structFormantPathEditor#formantPathArea(e5a7ab802631ed92).() ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). instancePref_spectrogram_viewTocxx . . $ structSoundAnalysisArea#instancePref_spectrogram_viewTo(21b6c25e127938e2).() ? mycxx . . $ `melder/melder.h:44:9`! formantPathAreacxx . . $ structFormantPathEditor#formantPathArea(e5a7ab802631ed92).() ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). d_spectrogram_cursorcxx . . $ structSoundAnalysisArea#d_spectrogram_cursor. : -1000.0 ); |
| 150 | } |
| 151 | |
| 152 | static void Formant_replaceFramescxx . . $ Formant_replaceFrames(6f187ebc7e28df48). (Formantcxx . . $ Formant# target, integercxx . . $ integer# beginFrame, integercxx . . $ integer# endFrame, Formantcxx . . $ Formant# source) { |
| 153 | // Precondition target and source have exactly the same Sampled xmin, xmax, x1, nx, dx |
| 154 | if (beginFrame == endFrame && beginFrame == 0) { |
| 155 | beginFrame = 1; |
| 156 | endFrame = target -> nxcxx . . $ structSampled#nx.; |
| 157 | } |
| 158 | Melder_requirecxx . . $ `melder/melder_require.h:21:9`! (beginFrame <= endFrame, |
| 159 | U"The start frame should not be after the end frame."); |
| 160 | Melder_requirecxx . . $ `melder/melder_require.h:21:9`! (beginFrame > 0, |
| 161 | U"The begin frame should be larger than zero."); |
| 162 | Melder_requirecxx . . $ `melder/melder_require.h:21:9`! (endFrame <= target->nx, |
| 163 | U"The end frame sould not be larger than ", target->nx); |
| 164 | for (integercxx . . $ integer# iframe = beginFrame ; iframe <= endFrame; iframe ++) { |
| 165 | Formant_Framecxx . . $ Formant_Frame# targetFrame = & target -> framescxx . . $ structFormant#frames. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).iframe]; |
| 166 | Formant_Framecxx . . $ Formant_Frame# sourceFrame = & source -> framescxx . . $ structFormant#frames. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).iframe]; |
| 167 | sourceFrame -> copycxx . . $ structFormant_Frame#copy(92dd45543ac3dd98). (targetFrame); |
| 168 | } |
| 169 | } |
| 170 | |
| 171 | static void FormantPathEditor_effectuateCandidateSelectioncxx . . $ FormantPathEditor_effectuateCandidateSelection(11f1bddca2c9a783). (FormantPathEditorcxx . . $ FormantPathEditor# me, integercxx . . $ integer# candidate) { |
| 172 | if (candidate > 0 && candidate <= mycxx . . $ `melder/melder.h:44:9`! formantPathcxx . . $ structFormantPathEditor#formantPath(455ff8d8cd4b76c5).() -> formantCandidatescxx . . $ structFormantPath#formantCandidates..sizecxx . . $ CollectionOf#size.) { |
| 173 | double tmin_ = mycxx . . $ `melder/melder.h:44:9`! startWindowcxx . . $ structFunctionEditor#startWindow., tmax_ = mycxx . . $ `melder/melder.h:44:9`! endWindowcxx . . $ structFunctionEditor#endWindow.; |
| 174 | if (mycxx . . $ `melder/melder.h:44:9`! startSelectioncxx . . $ structFunctionEditor#startSelection. < mycxx . . $ `melder/melder.h:44:9`! endSelectioncxx . . $ structFunctionEditor#endSelection.) { |
| 175 | tmin_ = mycxx . . $ `melder/melder.h:44:9`! startSelectioncxx . . $ structFunctionEditor#startSelection.; |
| 176 | tmax_ = mycxx . . $ `melder/melder.h:44:9`! endSelectioncxx . . $ structFunctionEditor#endSelection.; |
| 177 | } |
| 178 | mycxx . . $ `melder/melder.h:44:9`! selectedCandidatecxx . . $ structFormantPathEditor#selectedCandidate. = candidate; |
| 179 | Editor_savecxx . . $ Editor_save(ed6f6b1571b749af). (me, U"Change ceiling"); |
| 180 | integercxx . . $ integer# ifmin, ifmax; |
| 181 | Sampled_getWindowSamplescxx . . $ Sampled_getWindowSamples(fe99094ed5bb3f6a). (mycxx . . $ `melder/melder.h:44:9`! formantPathcxx . . $ structFormantPathEditor#formantPath(455ff8d8cd4b76c5).(), tmin_, tmax_, & ifmin, & ifmax); |
| 182 | TextGrid_addInterval_forcecxx . . $ TextGrid_addInterval_force(d24aedbcce6a15af). (mycxx . . $ `melder/melder.h:44:9`! formantPathcxx . . $ structFormantPathEditor#formantPath(455ff8d8cd4b76c5).() -> pathcxx . . $ structFormantPath#path..getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(), tmin_, tmax_, 1_integercxx . . $ `operator""_integer`(85240eb457c3721a)., Melder_integercxx . . $ Melder_integer(7b348ebc2004441d). (candidate)); |
| 183 | Formantcxx . . $ Formant# source = mycxx . . $ `melder/melder.h:44:9`! formantPathcxx . . $ structFormantPathEditor#formantPath(455ff8d8cd4b76c5).() -> formantCandidatescxx . . $ structFormantPath#formantCandidates..atcxx . . $ CollectionOf#at. [cxx . . $ ArrayOf#`operator[]`(a7f36fee1ae21897).mycxx . . $ `melder/melder.h:44:9`! selectedCandidatecxx . . $ structFormantPathEditor#selectedCandidate.]; |
| 184 | Formant_replaceFramescxx . . $ Formant_replaceFrames(6f187ebc7e28df48). (mycxx . . $ `melder/melder.h:44:9`! formantPathAreacxx . . $ structFormantPathEditor#formantPathArea(e5a7ab802631ed92).() ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). d_formantcxx . . $ structSoundAnalysisArea#d_formant..getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(), ifmin, ifmax, source); |
| 185 | } |
| 186 | } |
| 187 | |
| 188 | /********** METHODS **********/ |
| 189 | |
| 190 | /***** TIER MENU *****/ |
| 191 | |
| 192 | static void menu_cb_candidate_modellingSettingscxx . . $ menu_cb_candidate_modellingSettings(d1b4f7c01a287e76). (FormantPathEditorcxx . . $ FormantPathEditor# me, EDITOR_ARGScxx . . $ `sys/EditorM.h:25:9`!) { |
| 193 | EDITOR_FORMcxx . . $ `sys/EditorM.h:33:9`! (U"Candidate modelling settings", U"Candidate modelling settings...") |
| 194 | SENTENCEcxx . . $ `sys/EditorM.h:195:9`! (parameters_string, U"Coefficients by track", mycxx . . $ `melder/melder.h:44:9`! default_modeler_numberOfParametersPerTrack()) |
| 195 | POSITIVEcxx . . $ `sys/EditorM.h:117:9`! (varianceExponent, U"Variance exponent", U"1.25") |
| 196 | EDITOR_OKcxx . . $ `sys/EditorM.h:38:9`! |
| 197 | SET_STRINGcxx . . $ `sys/EditorM.h:477:9`! (parameters_string, mycxx . . $ `melder/melder.h:44:9`! instancePref_modeler_numberOfParametersPerTrack()) |
| 198 | EDITOR_DOcxx . . $ `sys/EditorM.h:43:9`! |
| 199 | mycxx . . $ `melder/melder.h:44:9`! setInstancePref_modeler_numberOfParametersPerTrackcxx . . $ structFormantPathEditor#setInstancePref_modeler_numberOfParametersPerTrack(ff00d524ab0355ec). (parameters_string); |
| 200 | autoINTVECcxx . . $ autoINTVEC# parameters = splitByWhitespaceWithRanges_INTVECcxx . . $ splitByWhitespaceWithRanges_INTVEC(40f9f82be0ce91de). (mycxx . . $ `melder/melder.h:44:9`! instancePref_modeler_numberOfParametersPerTrackcxx . . $ structFormantPathEditor#instancePref_modeler_numberOfParametersPerTrack(d608cbfe2b610d03).()); |
| 201 | Melder_requirecxx . . $ `melder/melder_require.h:21:9`! (parameters.size > 0, |
| 202 | U"At least one coefficient should be given."); |
| 203 | const integercxx . . $ integer# numberOfTracks = FormantPath_getNumberOfFormantTrackscxx . . $ FormantPath_getNumberOfFormantTracks(57eee78a3ac77977). (mycxx . . $ `melder/melder.h:44:9`! formantPathcxx . . $ structFormantPathEditor#formantPath(455ff8d8cd4b76c5).()); |
| 204 | Melder_requirecxx . . $ `melder/melder_require.h:21:9`! (parameters.size <= numberOfTracks, |
| 205 | U"The number of coefficients (", parameters.size, U") should not exceed the number of tracks (", numberOfTracks, U")."); |
| 206 | Melder_requirecxx . . $ `melder/melder_require.h:21:9`! (num::NUMmin_e (parameters.get()) > 0.0, |
| 207 | U"All coefficients should be larger than zero."); |
| 208 | mycxx . . $ `melder/melder.h:44:9`! setInstancePref_modeler_varianceExponentcxx . . $ structFormantPathEditor#setInstancePref_modeler_varianceExponent(ba8836b59fb42830). (varianceExponent); |
| 209 | FunctionEditor_redrawcxx . . $ FunctionEditor_redraw(8d3b84f45830d365). (me); |
| 210 | EDITOR_ENDcxx . . $ `sys/EditorM.h:80:9`! |
| 211 | } |
| 212 | |
| 213 | static double FormantPath_getRoundedMaximumCeilingcxx . . $ FormantPath_getRoundedMaximumCeiling(700e17416a18b1e). (FormantPathcxx . . $ FormantPath# me) { |
| 214 | const integercxx . . $ integer# ceiling = 100 * Melder_iroundDowncxx . . $ Melder_iroundDown(a6e4a4c8b00c35a3). ((mycxx . . $ `melder/melder.h:44:9`! ceilingscxx . . $ structFormantPath#ceilings. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).mycxx . . $ `melder/melder.h:44:9`! ceilingscxx . . $ structFormantPath#ceilings..sizecxx . . $ autovector#size.] + 100.1) / 100.0); |
| 215 | return (double) ceiling; |
| 216 | } |
| 217 | |
| 218 | static void menu_cb_AdvancedCandidateDrawingSettingscxx . . $ menu_cb_AdvancedCandidateDrawingSettings(d1b4f7c01a287e76). (FormantPathEditorcxx . . $ FormantPathEditor# me, EDITOR_ARGScxx . . $ `sys/EditorM.h:25:9`!) { |
| 219 | EDITOR_FORMcxx . . $ `sys/EditorM.h:33:9`! (U"Candidate drawing settings", nullptr) |
| 220 | BOOLEANcxx . . $ `sys/EditorM.h:228:9`! (drawEstimatedModels, U"Draw estimated models", mycxx . . $ `melder/melder.h:44:9`! default_candidate_draw_estimatedModels()) |
| 221 | POSITIVEcxx . . $ `sys/EditorM.h:117:9`! (yGridLineEvery_Hz, U"Hor. grid lines every (Hz)", mycxx . . $ `melder/melder.h:44:9`! default_candidate_draw_yGridLineEvery_Hz()) |
| 222 | COMMENTcxx . . $ `sys/EditorM.h:237:9`! (U"Set the maximum frequency for the display of the candidates...") |
| 223 | POSITIVEcxx . . $ `sys/EditorM.h:117:9`! (maximumFrequency, U"Maximum frequency (Hz)", mycxx . . $ `melder/melder.h:44:9`! default_candidate_draw_maximumFrequency()) |
| 224 | COMMENTcxx . . $ `sys/EditorM.h:237:9`! (U"...or, overrule this setting by using the maximum ceiling instead...") |
| 225 | BOOLEANcxx . . $ `sys/EditorM.h:228:9`! (useMaximumCeiling, U"Use maximum ceiling", mycxx . . $ `melder/melder.h:44:9`! default_candidate_draw_useMaximumCeiling()) |
| 226 | COMMENTcxx . . $ `sys/EditorM.h:237:9`! (U"If you want the Spectrogram and the candidates to have the same maximum frequency.") |
| 227 | BOOLEANcxx . . $ `sys/EditorM.h:228:9`! (adjustSpectrogramView, U"Adjust spectrogram view", mycxx . . $ `melder/melder.h:44:9`! default_candidate_draw_adjustSpectrogramView()); |
| 228 | BOOLEANcxx . . $ `sys/EditorM.h:228:9`! (drawErrorBars, U"Draw bandwidths", mycxx . . $ `melder/melder.h:44:9`! default_candidate_draw_showBandwidths()) |
| 229 | EDITOR_OKcxx . . $ `sys/EditorM.h:38:9`! |
| 230 | SET_BOOLEANcxx . . $ `sys/EditorM.h:471:9`! (drawEstimatedModels, mycxx . . $ `melder/melder.h:44:9`! instancePref_candidate_draw_estimatedModels()) |
| 231 | SET_REALcxx . . $ `sys/EditorM.h:462:9`! (yGridLineEvery_Hz, mycxx . . $ `melder/melder.h:44:9`! instancePref_candidate_draw_yGridLineEvery_Hz()) |
| 232 | SET_REALcxx . . $ `sys/EditorM.h:462:9`! (maximumFrequency, mycxx . . $ `melder/melder.h:44:9`! instancePref_candidate_draw_maximumFrequency()) |
| 233 | SET_BOOLEANcxx . . $ `sys/EditorM.h:471:9`! (useMaximumCeiling, mycxx . . $ `melder/melder.h:44:9`! instancePref_candidate_draw_useMaximumCeiling()) |
| 234 | SET_BOOLEANcxx . . $ `sys/EditorM.h:471:9`! (adjustSpectrogramView, mycxx . . $ `melder/melder.h:44:9`! instancePref_candidate_draw_adjustSpectrogramView()) |
| 235 | SET_BOOLEANcxx . . $ `sys/EditorM.h:471:9`! (drawErrorBars, mycxx . . $ `melder/melder.h:44:9`! instancePref_candidate_draw_showBandwidths()) |
| 236 | EDITOR_DOcxx . . $ `sys/EditorM.h:43:9`! |
| 237 | mycxx . . $ `melder/melder.h:44:9`! setInstancePref_candidate_draw_estimatedModelscxx . . $ structFormantPathEditor#setInstancePref_candidate_draw_estimatedModels(b45ddcbc8423892c). (drawEstimatedModels); |
| 238 | if (useMaximumCeiling) |
| 239 | maximumFrequency = FormantPath_getRoundedMaximumCeilingcxx . . $ FormantPath_getRoundedMaximumCeiling(700e17416a18b1e). (mycxx . . $ `melder/melder.h:44:9`! formantPathcxx . . $ structFormantPathEditor#formantPath(455ff8d8cd4b76c5).()); |
| 240 | mycxx . . $ `melder/melder.h:44:9`! setInstancePref_candidate_draw_maximumFrequencycxx . . $ structFormantPathEditor#setInstancePref_candidate_draw_maximumFrequency(ba8836b59fb42830). (maximumFrequency); |
| 241 | mycxx . . $ `melder/melder.h:44:9`! setInstancePref_candidate_draw_yGridLineEvery_Hzcxx . . $ structFormantPathEditor#setInstancePref_candidate_draw_yGridLineEvery_Hz(ba8836b59fb42830). (yGridLineEvery_Hz); |
| 242 | mycxx . . $ `melder/melder.h:44:9`! setInstancePref_candidate_draw_adjustSpectrogramViewcxx . . $ structFormantPathEditor#setInstancePref_candidate_draw_adjustSpectrogramView(b45ddcbc8423892c). (adjustSpectrogramView); |
| 243 | if (adjustSpectrogramView) |
| 244 | mycxx . . $ `melder/melder.h:44:9`! formantPathAreacxx . . $ structFormantPathEditor#formantPathArea(e5a7ab802631ed92).() ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). setInstancePref_spectrogram_viewTocxx . . $ structSoundAnalysisArea#setInstancePref_spectrogram_viewTo(ba8836b59fb42830). (maximumFrequency); |
| 245 | mycxx . . $ `melder/melder.h:44:9`! setInstancePref_candidate_draw_showBandwidthscxx . . $ structFormantPathEditor#setInstancePref_candidate_draw_showBandwidths(b45ddcbc8423892c). (drawErrorBars); |
| 246 | FunctionEditor_redrawcxx . . $ FunctionEditor_redraw(8d3b84f45830d365). (me); |
| 247 | Editor_broadcastDataChangedcxx . . $ Editor_broadcastDataChanged(c0154a85f79216c7). (me); |
| 248 | EDITOR_ENDcxx . . $ `sys/EditorM.h:80:9`! |
| 249 | } |
| 250 | |
| 251 | static void menu_cb_candidates_FindPathcxx . . $ menu_cb_candidates_FindPath(d1b4f7c01a287e76). (FormantPathEditorcxx . . $ FormantPathEditor# me, EDITOR_ARGScxx . . $ `sys/EditorM.h:25:9`!) { |
| 252 | EDITOR_FORMcxx . . $ `sys/EditorM.h:33:9`! (U"Find path", nullptr) |
| 253 | COMMENTcxx . . $ `sys/EditorM.h:237:9`! (U"Within frame:") |
| 254 | REALcxx . . $ `sys/EditorM.h:95:9`! (qWeight, U"F/B weight (0-1)", U"1.0") |
| 255 | COMMENTcxx . . $ `sys/EditorM.h:237:9`! (U"Between frames:") |
| 256 | REALcxx . . $ `sys/EditorM.h:95:9`! (frequencyChangeWeight, U"Frequency change weight (0-1)", U"1.0") |
| 257 | REALcxx . . $ `sys/EditorM.h:95:9`! (stressWeight, U"Stress weight (0-1)", U"1.0") |
| 258 | REALcxx . . $ `sys/EditorM.h:95:9`! (ceilingChangeWeight, U"Ceiling change weight (0-1)", U"1.0") |
| 259 | POSITIVEcxx . . $ `sys/EditorM.h:117:9`! (intensityModulationStepSize, U"Intensity modulation step size (dB)", U"5.0") |
| 260 | COMMENTcxx . . $ `sys/EditorM.h:237:9`! (U"Global stress parameters:") |
| 261 | POSITIVEcxx . . $ `sys/EditorM.h:117:9`! (windowLength, U"Window length", U"0.035") |
| 262 | EDITOR_OKcxx . . $ `sys/EditorM.h:38:9`! |
| 263 | EDITOR_DOcxx . . $ `sys/EditorM.h:43:9`! |
| 264 | autoINTVECcxx . . $ autoINTVEC# parameters = splitByWhitespaceWithRanges_INTVECcxx . . $ splitByWhitespaceWithRanges_INTVEC(40f9f82be0ce91de). (mycxx . . $ `melder/melder.h:44:9`! instancePref_modeler_numberOfParametersPerTrackcxx . . $ structFormantPathEditor#instancePref_modeler_numberOfParametersPerTrack(d608cbfe2b610d03).()); |
| 265 | FormantPath_pathFindercxx . . $ FormantPath_pathFinder(c152c93180464ef5). (mycxx . . $ `melder/melder.h:44:9`! formantPathcxx . . $ structFormantPathEditor#formantPath(455ff8d8cd4b76c5).(), qWeight, frequencyChangeWeight, stressWeight, ceilingChangeWeight, |
| 266 | intensityModulationStepSize, windowLength, parameterscxx . . $ constvector#constvector(eac9d6ec4c4bfecd)..getcxx . . $ autovector#get(e8d1da7fe68a6585).(), mycxx . . $ `melder/melder.h:44:9`! instancePref_modeler_varianceExponentcxx . . $ structFormantPathEditor#instancePref_modeler_varianceExponent(21b6c25e127938e2).()); |
| 267 | mycxx . . $ `melder/melder.h:44:9`! formantPathAreacxx . . $ structFormantPathEditor#formantPathArea(e5a7ab802631ed92).() ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). d_formantcxx . . $ structSoundAnalysisArea#d_formant. =cxx . . $ autoSomeThing#`operator=`(80cc59814f7161e8). FormantPath_extractFormantcxx . . $ FormantPath_extractFormant(c1105e94bde1773c). (mycxx . . $ `melder/melder.h:44:9`! formantPathcxx . . $ structFormantPathEditor#formantPath(455ff8d8cd4b76c5).()); |
| 268 | FunctionEditor_redrawcxx . . $ FunctionEditor_redraw(8d3b84f45830d365). (me); |
| 269 | Editor_broadcastDataChangedcxx . . $ Editor_broadcastDataChanged(c0154a85f79216c7). (me); |
| 270 | EDITOR_ENDcxx . . $ `sys/EditorM.h:80:9`! |
| 271 | } |
| 272 | |
| 273 | static void menu_cb_selectCandidateWithlowestStresscxx . . $ menu_cb_selectCandidateWithlowestStress(d1b4f7c01a287e76). (FormantPathEditorcxx . . $ FormantPathEditor# me, EDITOR_ARGScxx . . $ `sys/EditorM.h:25:9`!) { |
| 274 | double startTime = mycxx . . $ `melder/melder.h:44:9`! startSelectioncxx . . $ structFunctionEditor#startSelection., endTime = mycxx . . $ `melder/melder.h:44:9`! endSelectioncxx . . $ structFunctionEditor#endSelection.; |
| 275 | if (mycxx . . $ `melder/melder.h:44:9`! startSelectioncxx . . $ structFunctionEditor#startSelection. == mycxx . . $ `melder/melder.h:44:9`! endSelectioncxx . . $ structFunctionEditor#endSelection.) { |
| 276 | startTime = mycxx . . $ `melder/melder.h:44:9`! startWindowcxx . . $ structFunctionEditor#startWindow.; |
| 277 | endTime = mycxx . . $ `melder/melder.h:44:9`! endWindowcxx . . $ structFunctionEditor#endWindow.; |
| 278 | } |
| 279 | autoINTVECcxx . . $ autoINTVEC# parameters = splitByWhitespaceWithRanges_INTVECcxx . . $ splitByWhitespaceWithRanges_INTVEC(40f9f82be0ce91de). (mycxx . . $ `melder/melder.h:44:9`! instancePref_modeler_numberOfParametersPerTrackcxx . . $ structFormantPathEditor#instancePref_modeler_numberOfParametersPerTrack(d608cbfe2b610d03).()); |
| 280 | autoVECcxx . . $ autoVEC# stresses = FormantPath_getStressOfCandidatescxx . . $ FormantPath_getStressOfCandidates(ac0ceb70b18df84f). (mycxx . . $ `melder/melder.h:44:9`! formantPathcxx . . $ structFormantPathEditor#formantPath(455ff8d8cd4b76c5).(), startTime, endTime, 0, 0, parameterscxx . . $ constvector#constvector(eac9d6ec4c4bfecd)..getcxx . . $ autovector#get(e8d1da7fe68a6585).(), |
| 281 | mycxx . . $ `melder/melder.h:44:9`! instancePref_modeler_varianceExponentcxx . . $ structFormantPathEditor#instancePref_modeler_varianceExponent(21b6c25e127938e2).()); |
| 282 | const integercxx . . $ integer# minPos = NUMminPoscxx . . $ NUMminPos(99bbb1d062110345). (stressescxx . . $ constvectorview#constvectorview(eac9d6ec4c4bfecd)..getcxx . . $ autovector#get(e8d1da7fe68a6585).()); |
| 283 | Editor_savecxx . . $ Editor_save(ed6f6b1571b749af). (me, U"Change ceiling"); |
| 284 | FormantPathEditor_effectuateCandidateSelectioncxx . . $ FormantPathEditor_effectuateCandidateSelection(11f1bddca2c9a783). (me, minPos); |
| 285 | FunctionEditor_redrawcxx . . $ FunctionEditor_redraw(8d3b84f45830d365). (me); |
| 286 | Editor_broadcastDataChangedcxx . . $ Editor_broadcastDataChanged(c0154a85f79216c7). (me); |
| 287 | } |
| 288 | |
| 289 | static void menu_cb_DrawVisibleCandidatescxx . . $ menu_cb_DrawVisibleCandidates(d1b4f7c01a287e76). (FormantPathEditorcxx . . $ FormantPathEditor# me, EDITOR_ARGScxx . . $ `sys/EditorM.h:25:9`!) { |
| 290 | EDITOR_FORMcxx . . $ `sys/EditorM.h:33:9`! (U"Draw visible candidates", nullptr) |
| 291 | mycxx . . $ `melder/melder.h:44:9`! v_form_pictureWindowcxx . . $ structDataGui#v_form_pictureWindow(2b98fae8e13abb61). (cmd); |
| 292 | mycxx . . $ `melder/melder.h:44:9`! v_form_pictureMarginscxx . . $ structDataGui#v_form_pictureMargins(2b98fae8e13abb61). (cmd); |
| 293 | BOOLEANcxx . . $ `sys/EditorM.h:228:9`! (crossHairs, U"Draw cross hairs", 0) |
| 294 | BOOLEANcxx . . $ `sys/EditorM.h:228:9`! (garnish, U"Garnish", mycxx . . $ `melder/melder.h:44:9`! formantPathArea() -> default_picture_garnish()); |
| 295 | EDITOR_OKcxx . . $ `sys/EditorM.h:38:9`! |
| 296 | mycxx . . $ `melder/melder.h:44:9`! v_ok_pictureWindowcxx . . $ structDataGui#v_ok_pictureWindow(2b98fae8e13abb61). (cmd); |
| 297 | mycxx . . $ `melder/melder.h:44:9`! v_ok_pictureMarginscxx . . $ structDataGui#v_ok_pictureMargins(2b98fae8e13abb61). (cmd); |
| 298 | SET_BOOLEANcxx . . $ `sys/EditorM.h:471:9`! (garnish, mycxx . . $ `melder/melder.h:44:9`! formantPathArea() -> classPref_picture_garnish()) |
| 299 | EDITOR_DOcxx . . $ `sys/EditorM.h:43:9`! |
| 300 | mycxx . . $ `melder/melder.h:44:9`! v_do_pictureWindowcxx . . $ structDataGui#v_do_pictureWindow(2b98fae8e13abb61). (cmd); |
| 301 | mycxx . . $ `melder/melder.h:44:9`! v_do_pictureMarginscxx . . $ structDataGui#v_do_pictureMargins(2b98fae8e13abb61). (cmd); |
| 302 | mycxx . . $ `melder/melder.h:44:9`! formantPathAreacxx . . $ structFormantPathEditor#formantPathArea(e5a7ab802631ed92).() ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). setClassPref_picture_garnishcxx . . $ structFunctionArea#setClassPref_picture_garnish(b45ddcbc8423892c). (garnish); |
| 303 | DataGui_openPraatPicturecxx . . $ DataGui_openPraatPicture(4c5cf9f1c6ae526). (me); |
| 304 | Graphics_setInnercxx . . $ Graphics_setInner(2d838ed765120c5d). (mycxx . . $ `melder/melder.h:44:9`! pictureGraphicscxx . . $ structDataGui#pictureGraphics(5af6864da672d398).()); |
| 305 | double startTime, endTime, xCursor, yCursor; |
| 306 | FormantPathEditor_getDrawingDatacxx . . $ FormantPathEditor_getDrawingData(e7e315f693409568). (me, & startTime, & endTime, & xCursor, & yCursor); |
| 307 | autoINTVECcxx . . $ autoINTVEC# parameters = splitByWhitespaceWithRanges_INTVECcxx . . $ splitByWhitespaceWithRanges_INTVEC(40f9f82be0ce91de). (mycxx . . $ `melder/melder.h:44:9`! instancePref_modeler_numberOfParametersPerTrackcxx . . $ structFormantPathEditor#instancePref_modeler_numberOfParametersPerTrack(d608cbfe2b610d03).()); |
| 308 | constexpr double xSpace_fraction = 0.1, ySpace_fraction = 0.2; |
| 309 | FormantPath_drawAsGrid_insidecxx . . $ FormantPath_drawAsGrid_inside(b4ff202d0916fa3d). (mycxx . . $ `melder/melder.h:44:9`! formantPathcxx . . $ structFormantPathEditor#formantPath(455ff8d8cd4b76c5).(), mycxx . . $ `melder/melder.h:44:9`! pictureGraphicscxx . . $ structDataGui#pictureGraphics(5af6864da672d398).(), startTime, endTime, |
| 310 | mycxx . . $ `melder/melder.h:44:9`! instancePref_candidate_draw_maximumFrequencycxx . . $ structFormantPathEditor#instancePref_candidate_draw_maximumFrequency(21b6c25e127938e2).(), 1, 5, |
| 311 | mycxx . . $ `melder/melder.h:44:9`! instancePref_candidate_draw_showBandwidthscxx . . $ structFormantPathEditor#instancePref_candidate_draw_showBandwidths(50ce9a9e25b4a850).(), Melder_REDcxx . . $ Melder_RED., Melder_PURPLEcxx . . $ Melder_PURPLE., 0, 0, |
| 312 | xSpace_fraction, ySpace_fraction, mycxx . . $ `melder/melder.h:44:9`! instancePref_candidate_draw_yGridLineEvery_Hzcxx . . $ structFormantPathEditor#instancePref_candidate_draw_yGridLineEvery_Hz(21b6c25e127938e2).(), |
| 313 | xCursor, yCursor, markedCandidatesColourcxx . . $ markedCandidatesColour., parameterscxx . . $ constvector#constvector(eac9d6ec4c4bfecd)..getcxx . . $ autovector#get(e8d1da7fe68a6585).(), true, true, |
| 314 | mycxx . . $ `melder/melder.h:44:9`! instancePref_modeler_varianceExponentcxx . . $ structFormantPathEditor#instancePref_modeler_varianceExponent(21b6c25e127938e2).(), mycxx . . $ `melder/melder.h:44:9`! instancePref_candidate_draw_estimatedModelscxx . . $ structFormantPathEditor#instancePref_candidate_draw_estimatedModels(50ce9a9e25b4a850).(), true |
| 315 | ); |
| 316 | Graphics_unsetInnercxx . . $ Graphics_unsetInner(2d838ed765120c5d). (mycxx . . $ `melder/melder.h:44:9`! pictureGraphicscxx . . $ structDataGui#pictureGraphics(5af6864da672d398).()); |
| 317 | DataGui_closePraatPicturecxx . . $ DataGui_closePraatPicture(4c5cf9f1c6ae526). (me); |
| 318 | EDITOR_ENDcxx . . $ `sys/EditorM.h:80:9`! |
| 319 | } |
| 320 | |
| 321 | static void menu_cb_play_resynthesiscxx . . $ menu_cb_play_resynthesis(d1b4f7c01a287e76). (FormantPathEditorcxx . . $ FormantPathEditor# me, EDITOR_ARGScxx . . $ `sys/EditorM.h:25:9`!) { |
| 322 | PLAY_DATAcxx . . $ `sys/EditorM.h:535:9`! |
| 323 | MelderAudio_stopPlayingcxx . . $ MelderAudio_stopPlaying(efaadfb7dc14930a). (MelderAudio_IMPLICITcxx . . $ `melder/melder_audio.h:57:9`!); |
| 324 | double startTime,endTime; |
| 325 | FormantPathEditor_getDrawingDatacxx . . $ FormantPathEditor_getDrawingData(e7e315f693409568). (me, & startTime, & endTime, nullptr, nullptr); |
| 326 | autoSoundcxx . . $ autoSound# resynthesis = FormantPathEditor_getResynthesiscxx . . $ FormantPathEditor_getResynthesis(3add1d3d7be3d8ff). (me, startTime, endTime); |
| 327 | Sound_playPartcxx . . $ Sound_playPart(4a8b47ed00757136). (resynthesis.getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(), startTime, endTime, theFunctionEditor_playCallbackcxx . . $ MelderCallback#MelderCallback(b367fc31b94dacdb)., me); |
| 328 | PLAY_DATA_ENDcxx . . $ `sys/EditorM.h:537:9`! |
| 329 | } |
| 330 | |
| 331 | static void menu_cb_extract_resynthesiscxx . . $ menu_cb_extract_resynthesis(d1b4f7c01a287e76). (FormantPathEditorcxx . . $ FormantPathEditor# me, EDITOR_ARGScxx . . $ `sys/EditorM.h:25:9`!) { |
| 332 | CONVERT_DATA_TO_ONEcxx . . $ `sys/EditorM.h:616:9`! |
| 333 | double startTime,endTime; |
| 334 | FormantPathEditor_getDrawingDatacxx . . $ FormantPathEditor_getDrawingData(e7e315f693409568). (me, & startTime, & endTime, nullptr, nullptr); |
| 335 | |
| 336 | autoSoundcxx . . $ autoSound# result = FormantPathEditor_getResynthesiscxx . . $ FormantPathEditor_getResynthesis(3add1d3d7be3d8ff). (me, startTime, endTime); |
| 337 | CONVERT_DATA_TO_ONE_ENDcxx . . $ `sys/EditorM.h:618:9`! (U"untitled") |
| 338 | } |
| 339 | |
| 340 | static void INFO_DATA__ceilingOfCandidatecxx . . $ INFO_DATA__ceilingOfCandidate(d1b4f7c01a287e76). (FormantPathEditorcxx . . $ FormantPathEditor# me, EDITOR_ARGScxx . . $ `sys/EditorM.h:25:9`!) { |
| 341 | INFO_DATAcxx . . $ `sys/EditorM.h:544:9`! |
| 342 | if (mycxx . . $ `melder/melder.h:44:9`! selectedCandidatecxx . . $ structFormantPathEditor#selectedCandidate. > 0 && mycxx . . $ `melder/melder.h:44:9`! selectedCandidatecxx . . $ structFormantPathEditor#selectedCandidate. <= mycxx . . $ `melder/melder.h:44:9`! formantPathcxx . . $ structFormantPathEditor#formantPath(455ff8d8cd4b76c5).() -> ceilingscxx . . $ structFormantPath#ceilings..sizecxx . . $ autovector#size.) |
| 343 | Melder_informationcxx . . $ Melder_information(3eb398314feba58b). (Melder_doublecxx . . $ Melder_double(f05d861d9dbec9b2). (mycxx . . $ `melder/melder.h:44:9`! formantPathcxx . . $ structFormantPathEditor#formantPath(455ff8d8cd4b76c5).() -> ceilingscxx . . $ structFormantPath#ceilings. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).mycxx . . $ `melder/melder.h:44:9`! selectedCandidatecxx . . $ structFormantPathEditor#selectedCandidate.])); |
| 344 | else |
| 345 | Melder_informationcxx . . $ Melder_information(3eb398314feba58b). (U"--undefined--"); |
| 346 | INFO_DATA_ENDcxx . . $ `sys/EditorM.h:546:9`! |
| 347 | } |
| 348 | |
| 349 | static void INFO_DATA__stressOfFitsListingcxx . . $ INFO_DATA__stressOfFitsListing(d1b4f7c01a287e76). (FormantPathEditorcxx . . $ FormantPathEditor# me, EDITOR_ARGScxx . . $ `sys/EditorM.h:25:9`!) { |
| 350 | INFO_DATAcxx . . $ `sys/EditorM.h:544:9`! |
| 351 | double startTime = mycxx . . $ `melder/melder.h:44:9`! startSelectioncxx . . $ structFunctionEditor#startSelection., endTime = mycxx . . $ `melder/melder.h:44:9`! endSelectioncxx . . $ structFunctionEditor#endSelection.; |
| 352 | if (mycxx . . $ `melder/melder.h:44:9`! startSelectioncxx . . $ structFunctionEditor#startSelection. == mycxx . . $ `melder/melder.h:44:9`! endSelectioncxx . . $ structFunctionEditor#endSelection.) { |
| 353 | startTime = mycxx . . $ `melder/melder.h:44:9`! startWindowcxx . . $ structFunctionEditor#startWindow.; |
| 354 | endTime = mycxx . . $ `melder/melder.h:44:9`! endWindowcxx . . $ structFunctionEditor#endWindow.; |
| 355 | } |
| 356 | autoINTVECcxx . . $ autoINTVEC# parameters = splitByWhitespaceWithRanges_INTVECcxx . . $ splitByWhitespaceWithRanges_INTVEC(40f9f82be0ce91de). (mycxx . . $ `melder/melder.h:44:9`! instancePref_modeler_numberOfParametersPerTrackcxx . . $ structFormantPathEditor#instancePref_modeler_numberOfParametersPerTrack(d608cbfe2b610d03).()); |
| 357 | const integercxx . . $ integer# numberOfStressDecimals = 2, numberOfTimeDecimals = 6; |
| 358 | autoTablecxx . . $ autoTable# stressTable = FormantPath_downTo_Table_stressescxx . . $ FormantPath_downTo_Table_stresses(e75cb988ad3d5f1a). (mycxx . . $ `melder/melder.h:44:9`! formantPathcxx . . $ structFormantPathEditor#formantPath(455ff8d8cd4b76c5).(), startTime, endTime, parameterscxx . . $ constvector#constvector(eac9d6ec4c4bfecd)..getcxx . . $ autovector#get(e8d1da7fe68a6585).(), |
| 359 | mycxx . . $ `melder/melder.h:44:9`! instancePref_modeler_varianceExponentcxx . . $ structFormantPathEditor#instancePref_modeler_varianceExponent(21b6c25e127938e2).(), numberOfStressDecimals, true, numberOfTimeDecimals); |
| 360 | Table_listcxx . . $ Table_list(8e854cd23ee58a8f). (stressTable.getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(), false); |
| 361 | INFO_DATA_ENDcxx . . $ `sys/EditorM.h:546:9`! |
| 362 | } |
| 363 | |
| 364 | /***** HELP MENU *****/ |
| 365 | |
| 366 | static void menu_cb_FormantPathEditorHelpcxx . . $ menu_cb_FormantPathEditorHelp(d1b4f7c01a287e76). (FormantPathEditorcxx . . $ FormantPathEditor#, EDITOR_ARGScxx . . $ `sys/EditorM.h:25:9`!) { |
| 367 | Melder_helpcxx . . $ Melder_help(ff00d524ab0355ec). (U"FormantPathEditor"); |
| 368 | } |
| 369 | |
| 370 | static void menu_cb_AboutSpecialSymbolscxx . . $ menu_cb_AboutSpecialSymbols(d1b4f7c01a287e76). (FormantPathEditorcxx . . $ FormantPathEditor#, EDITOR_ARGScxx . . $ `sys/EditorM.h:25:9`!) { |
| 371 | Melder_helpcxx . . $ Melder_help(ff00d524ab0355ec). (U"Special symbols"); |
| 372 | } |
| 373 | |
| 374 | static void menu_cb_PhoneticSymbolscxx . . $ menu_cb_PhoneticSymbols(d1b4f7c01a287e76). (FormantPathEditorcxx . . $ FormantPathEditor#, EDITOR_ARGScxx . . $ `sys/EditorM.h:25:9`!) { |
| 375 | Melder_helpcxx . . $ Melder_help(ff00d524ab0355ec). (U"Phonetic symbols"); |
| 376 | } |
| 377 | |
| 378 | static void menu_cb_AboutTextStylescxx . . $ menu_cb_AboutTextStyles(d1b4f7c01a287e76). (FormantPathEditorcxx . . $ FormantPathEditor#, EDITOR_ARGScxx . . $ `sys/EditorM.h:25:9`!) { |
| 379 | Melder_helpcxx . . $ Melder_help(ff00d524ab0355ec). (U"Text styles"); |
| 380 | } |
| 381 | |
| 382 | void structFormantPathEditorcxx . . $ structFormantPathEditor# :: v_createMenuscxx . . $ structFormantPathEditor#v_createMenus(49f6e7a06ebc5aa8). () { |
| 383 | FormantPathEditor_Parentcxx . . $ FormantPathEditor_Parent# :: v_createMenuscxx . . $ structFunctionEditor#v_createMenus(49f6e7a06ebc5aa8). (); |
| 384 | EditorMenucxx . . $ EditorMenu# menu = Editor_addMenucxx . . $ Editor_addMenu(8b39ac34ca8e016f). (this, U"Candidates", 0); |
| 385 | EditorMenu_addCommandcxx . . $ EditorMenu_addCommand(b3c50ad5ffa1d58a). (menu, U"Candidate modelling settings...", 0, menu_cb_candidate_modellingSettingscxx . . $ MelderCallback#MelderCallback(aaa169a015c1cf97).); |
| 386 | EditorMenu_addCommandcxx . . $ EditorMenu_addCommand(b3c50ad5ffa1d58a). (menu, U"Advanced candidate drawing settings...", 0, menu_cb_AdvancedCandidateDrawingSettingscxx . . $ MelderCallback#MelderCallback(aaa169a015c1cf97).); |
| 387 | EditorMenu_addCommandcxx . . $ EditorMenu_addCommand(b3c50ad5ffa1d58a). (menu, U"- Draw candidates to picture window:", 0, nullptrcxx . . $ MelderCallback#MelderCallback(fc624d2cd197112).); |
| 388 | EditorMenu_addCommandcxx . . $ EditorMenu_addCommand(b3c50ad5ffa1d58a). (menu, U"Draw visible candidates...", 1, menu_cb_DrawVisibleCandidatescxx . . $ MelderCallback#MelderCallback(aaa169a015c1cf97).); |
| 389 | EditorMenu_addCommandcxx . . $ EditorMenu_addCommand(b3c50ad5ffa1d58a). (menu, U"- Select candidates:", 0, nullptrcxx . . $ MelderCallback#MelderCallback(fc624d2cd197112).); |
| 390 | EditorMenu_addCommandcxx . . $ EditorMenu_addCommand(b3c50ad5ffa1d58a). (menu, U"Select candidate with lowest stress", 1, menu_cb_selectCandidateWithlowestStresscxx . . $ MelderCallback#MelderCallback(aaa169a015c1cf97).); |
| 391 | EditorMenu_addCommandcxx . . $ EditorMenu_addCommand(b3c50ad5ffa1d58a). (menu, U"Find path...", 1, menu_cb_candidates_FindPathcxx . . $ MelderCallback#MelderCallback(aaa169a015c1cf97).); |
| 392 | EditorMenu_addCommandcxx . . $ EditorMenu_addCommand(b3c50ad5ffa1d58a). (menu, U"- Query candidates:", 0, nullptrcxx . . $ MelderCallback#MelderCallback(fc624d2cd197112).); |
| 393 | EditorMenu_addCommandcxx . . $ EditorMenu_addCommand(b3c50ad5ffa1d58a). (menu, U"Get ceiling of candidate", 1, INFO_DATA__ceilingOfCandidatecxx . . $ MelderCallback#MelderCallback(aaa169a015c1cf97).); |
| 394 | EditorMenu_addCommandcxx . . $ EditorMenu_addCommand(b3c50ad5ffa1d58a). (menu, U"Stress of fits listing", 1, INFO_DATA__stressOfFitsListingcxx . . $ MelderCallback#MelderCallback(aaa169a015c1cf97).); |
| 395 | if (soundAreacxx . . $ structFormantPathEditor#soundArea(f75ec617f241a3e6).()) { |
| 396 | EditorMenu_addCommandcxx . . $ EditorMenu_addCommand(b3c50ad5ffa1d58a). (menu, U"- Candidate resynthesis:", 0, nullptrcxx . . $ MelderCallback#MelderCallback(fc624d2cd197112).); |
| 397 | EditorMenu_addCommandcxx . . $ EditorMenu_addCommand(b3c50ad5ffa1d58a). (menu, U"Play resynthesis", 1, menu_cb_play_resynthesiscxx . . $ MelderCallback#MelderCallback(aaa169a015c1cf97).); |
| 398 | EditorMenu_addCommandcxx . . $ EditorMenu_addCommand(b3c50ad5ffa1d58a). (menu, U"Extract resynthesis", 1, menu_cb_extract_resynthesiscxx . . $ MelderCallback#MelderCallback(aaa169a015c1cf97).); |
| 399 | } |
| 400 | } |
| 401 | |
| 402 | void structFormantPathEditorcxx . . $ structFormantPathEditor# :: v_createMenuItems_helpcxx . . $ structFormantPathEditor#v_createMenuItems_help(6ea9c8c6ea2f58a9). (EditorMenucxx . . $ EditorMenu# menu) { |
| 403 | FormantPathEditor_Parentcxx . . $ FormantPathEditor_Parent# :: v_createMenuItems_helpcxx . . $ structFunctionEditor#v_createMenuItems_help(6ea9c8c6ea2f58a9). (menu); |
| 404 | EditorMenu_addCommandcxx . . $ EditorMenu_addCommand(b3c50ad5ffa1d58a). (menu, U"FormantPathEditor help", '?', menu_cb_FormantPathEditorHelpcxx . . $ MelderCallback#MelderCallback(aaa169a015c1cf97).); |
| 405 | EditorMenu_addCommandcxx . . $ EditorMenu_addCommand(b3c50ad5ffa1d58a). (menu, U"About special symbols", 0, menu_cb_AboutSpecialSymbolscxx . . $ MelderCallback#MelderCallback(aaa169a015c1cf97).); |
| 406 | EditorMenu_addCommandcxx . . $ EditorMenu_addCommand(b3c50ad5ffa1d58a). (menu, U"Phonetic symbols", 0, menu_cb_PhoneticSymbolscxx . . $ MelderCallback#MelderCallback(aaa169a015c1cf97).); |
| 407 | EditorMenu_addCommandcxx . . $ EditorMenu_addCommand(b3c50ad5ffa1d58a). (menu, U"About text styles", 0, menu_cb_AboutTextStylescxx . . $ MelderCallback#MelderCallback(aaa169a015c1cf97).); |
| 408 | } |
| 409 | |
| 410 | /********** DRAWING AREA **********/ |
| 411 | |
| 412 | void structFormantPathEditorcxx . . $ structFormantPathEditor# :: v_drawSelectionViewercxx . . $ structFormantPathEditor#v_drawSelectionViewer(49f6e7a06ebc5aa8). () { |
| 413 | static double previousStartTime, previousEndTime; |
| 414 | constexpr double xSpace_fraction = 0.1, ySpace_fraction = 0.2; |
| 415 | Graphics_setColourcxx . . $ Graphics_setColour(eb47b9513d3f4721). (ourcxx . . $ `melder/melder.h:42:9`! graphicscxx . . $ structFunctionEditor#graphics..getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(), Melder_WHITEcxx . . $ Melder_WHITE.); |
| 416 | Graphics_fillRectanglecxx . . $ Graphics_fillRectangle(72bdb7937dbb13da). (ourcxx . . $ `melder/melder.h:42:9`! graphicscxx . . $ structFunctionEditor#graphics..getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(), 0.0, 1.0, 0.0, 1.0); |
| 417 | Graphics_setColourcxx . . $ Graphics_setColour(eb47b9513d3f4721). (ourcxx . . $ `melder/melder.h:42:9`! graphicscxx . . $ structFunctionEditor#graphics..getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(), Melder_BLACKcxx . . $ Melder_BLACK.); |
| 418 | Graphics_setFontSizecxx . . $ Graphics_setFontSize(2514a1c07b6be5e2). (ourcxx . . $ `melder/melder.h:42:9`! graphicscxx . . $ structFunctionEditor#graphics..getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(), 10.0); |
| 419 | Graphics_setTextAlignmentcxx . . $ Graphics_setTextAlignment(a697afee548943ae). (ourcxx . . $ `melder/melder.h:42:9`! graphicscxx . . $ structFunctionEditor#graphics..getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(), Graphics_CENTREcxx . . $ `sys/Graphics.h:250:9`!, Graphics_HALFcxx . . $ `sys/Graphics.h:253:9`!); |
| 420 | double startTime, endTime = endWindowcxx . . $ structFunctionEditor#endWindow., xCursor, yCursor; |
| 421 | FormantPathEditor_getDrawingDatacxx . . $ FormantPathEditor_getDrawingData(e7e315f693409568). (this, & startTime, & endTime, & xCursor, & yCursor); |
| 422 | const integercxx . . $ integer# nrow = 0, ncol = 0; |
| 423 | if (startTime != previousStartTime || endTime != previousEndTime) |
| 424 | ourcxx . . $ `melder/melder.h:42:9`! selectedCandidatecxx . . $ structFormantPathEditor#selectedCandidate. = 0; |
| 425 | autoINTVECcxx . . $ autoINTVEC# parameters = splitByWhitespaceWithRanges_INTVECcxx . . $ splitByWhitespaceWithRanges_INTVEC(40f9f82be0ce91de). (ourcxx . . $ `melder/melder.h:42:9`! instancePref_modeler_numberOfParametersPerTrackcxx . . $ structFormantPathEditor#instancePref_modeler_numberOfParametersPerTrack(d608cbfe2b610d03).()); |
| 426 | MelderColourcxx . . $ MelderColour# oddColour = MelderColour_fromColourNamecxx . . $ MelderColour_fromColourName(ddf3ca81f5326095). (ourcxx . . $ `melder/melder.h:42:9`! formantPathAreacxx . . $ structFormantPathEditor#formantPathArea(e5a7ab802631ed92).() ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). instancePref_formant_path_oddColourcxx . . $ structFormantPathArea#instancePref_formant_path_oddColour(d608cbfe2b610d03).()); |
| 427 | MelderColourcxx . . $ MelderColour# evenColour = MelderColour_fromColourNamecxx . . $ MelderColour_fromColourName(ddf3ca81f5326095). (ourcxx . . $ `melder/melder.h:42:9`! formantPathAreacxx . . $ structFormantPathEditor#formantPathArea(e5a7ab802631ed92).() ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). instancePref_formant_path_evenColourcxx . . $ structFormantPathArea#instancePref_formant_path_evenColour(d608cbfe2b610d03).()); |
| 428 | /* |
| 429 | Put the number of model coefficients per track at the top |
| 430 | */ |
| 431 | Graphics_setWindowcxx . . $ Graphics_setWindow(72bdb7937dbb13da). (ourcxx . . $ `melder/melder.h:42:9`! graphicscxx . . $ structFunctionEditor#graphics..getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(), 0.0, 1.0, 0.0, 1.0); |
| 432 | autoMelderStringcxx . . $ autoMelderString# infoAtTopcxx . . $ autoMelderString#autoMelderString(49f6e7a06ebc5aa8).; |
| 433 | MelderString_appendcxx . . $ MelderString_append(65be51a793e0ff96). (& infoAtTop, U"Coefficients by track: ", ourcxx . . $ `melder/melder.h:42:9`! instancePref_modeler_numberOfParametersPerTrackcxx . . $ structFormantPathEditor#instancePref_modeler_numberOfParametersPerTrack(d608cbfe2b610d03).()); |
| 434 | Graphics_setTextAlignmentcxx . . $ Graphics_setTextAlignment(a697afee548943ae). (ourcxx . . $ `melder/melder.h:42:9`! graphicscxx . . $ structFunctionEditor#graphics..getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(), Graphics_CENTREcxx . . $ `sys/Graphics.h:250:9`!, Graphics_BOTTOMcxx . . $ `sys/Graphics.h:252:9`!); |
| 435 | Graphics_textcxx . . $ Graphics_text(bd267f534253e388). (ourcxx . . $ `melder/melder.h:42:9`! graphicscxx . . $ structFunctionEditor#graphics..getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(), 0.5, 1.0, infoAtTop.stringcxx . . $ MelderString#string.); |
| 436 | /* |
| 437 | Now do the inset |
| 438 | */ |
| 439 | Graphics_setInnercxx . . $ Graphics_setInner(2d838ed765120c5d). (ourcxx . . $ `melder/melder.h:42:9`! graphicscxx . . $ structFunctionEditor#graphics..getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).()); |
| 440 | FormantPath_drawAsGrid_insidecxx . . $ FormantPath_drawAsGrid_inside(b4ff202d0916fa3d). (ourcxx . . $ `melder/melder.h:42:9`! formantPathcxx . . $ structFormantPathEditor#formantPath(455ff8d8cd4b76c5).(), ourcxx . . $ `melder/melder.h:42:9`! graphicscxx . . $ structFunctionEditor#graphics..getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(), startTime, endTime, |
| 441 | ourcxx . . $ `melder/melder.h:42:9`! instancePref_candidate_draw_maximumFrequencycxx . . $ structFormantPathEditor#instancePref_candidate_draw_maximumFrequency(21b6c25e127938e2).(), 1, 5, ourcxx . . $ `melder/melder.h:42:9`! instancePref_candidate_draw_showBandwidthscxx . . $ structFormantPathEditor#instancePref_candidate_draw_showBandwidths(50ce9a9e25b4a850).(), oddColour, evenColour, |
| 442 | nrow, ncol, xSpace_fraction, ySpace_fraction, ourcxx . . $ `melder/melder.h:42:9`! instancePref_candidate_draw_yGridLineEvery_Hzcxx . . $ structFormantPathEditor#instancePref_candidate_draw_yGridLineEvery_Hz(21b6c25e127938e2).(), xCursor, yCursor, markedCandidatesColourcxx . . $ markedCandidatesColour., |
| 443 | parameterscxx . . $ constvector#constvector(eac9d6ec4c4bfecd)..getcxx . . $ autovector#get(e8d1da7fe68a6585).(), true, true, ourcxx . . $ `melder/melder.h:42:9`! instancePref_modeler_varianceExponentcxx . . $ structFormantPathEditor#instancePref_modeler_varianceExponent(21b6c25e127938e2).(), ourcxx . . $ `melder/melder.h:42:9`! instancePref_candidate_draw_estimatedModelscxx . . $ structFormantPathEditor#instancePref_candidate_draw_estimatedModels(50ce9a9e25b4a850).(), true |
| 444 | ); |
| 445 | /* |
| 446 | If we don't have clicked on a candidate, one or more have been implicitely coloured / selected. |
| 447 | Find out which one so we can set the 'selectedCandidate' |
| 448 | */ |
| 449 | if (selectedCandidatecxx . . $ structFormantPathEditor#selectedCandidate. == 0) |
| 450 | selectedCandidatecxx . . $ structFormantPathEditor#selectedCandidate. = FormantPath_getUniqueCandidateInIntervalcxx . . $ FormantPath_getUniqueCandidateInInterval(786bab8c8334d64b). (ourcxx . . $ `melder/melder.h:42:9`! formantPathcxx . . $ structFormantPathEditor#formantPath(455ff8d8cd4b76c5).(), startTime, endTime); |
| 451 | Graphics_unsetInnercxx . . $ Graphics_unsetInner(2d838ed765120c5d). (ourcxx . . $ `melder/melder.h:42:9`! graphicscxx . . $ structFunctionEditor#graphics..getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).()); |
| 452 | previousStartTime = startTime; |
| 453 | previousEndTime = endTime; |
| 454 | } |
| 455 | |
| 456 | void structFormantPathEditorcxx . . $ structFormantPathEditor# :: v_clickSelectionViewercxx . . $ structFormantPathEditor#v_clickSelectionViewer(bc12c9ec15586e6a). (double xWC, double yWC) { |
| 457 | /* |
| 458 | On which of the modelers was the click? |
| 459 | */ |
| 460 | integercxx . . $ integer# numberOfRows, numberOfColumns; |
| 461 | const integercxx . . $ integer# numberOfCandidates = ourcxx . . $ `melder/melder.h:42:9`! formantPathcxx . . $ structFormantPathEditor#formantPath(455ff8d8cd4b76c5).() -> formantCandidatescxx . . $ structFormantPath#formantCandidates..sizecxx . . $ CollectionOf#size.; |
| 462 | getGridLayoutcxx . . $ getGridLayout(b76a3bd1263aa692). (numberOfCandidates, & numberOfRows, & numberOfColumns); |
| 463 | integercxx . . $ integer# candidate = getGridCellIndexcxx . . $ getGridCellIndex(eeaa97481e11fa24). (xWC, yWC, numberOfRows, numberOfColumns); |
| 464 | FormantPathEditor_effectuateCandidateSelectioncxx . . $ FormantPathEditor_effectuateCandidateSelection(11f1bddca2c9a783). (this, candidate); |
| 465 | FunctionEditor_redrawcxx . . $ FunctionEditor_redraw(8d3b84f45830d365). (this); |
| 466 | Editor_broadcastDataChangedcxx . . $ Editor_broadcastDataChanged(c0154a85f79216c7). (this); |
| 467 | } |
| 468 | |
| 469 | void structFormantPathEditorcxx . . $ structFormantPathEditor# :: v_playcxx . . $ structFormantPathEditor#v_play(bc12c9ec15586e6a). (double startingTime, double endTime) { |
| 470 | if (ourcxx . . $ `melder/melder.h:42:9`! soundAreacxx . . $ structFormantPathEditor#soundArea(f75ec617f241a3e6).()) { |
| 471 | if (ourcxx . . $ `melder/melder.h:42:9`! clickWasModifiedByShiftKeycxx . . $ structFunctionEditor#clickWasModifiedByShiftKey.) { |
| 472 | autoSoundcxx . . $ autoSound# resynthesis = FormantPathEditor_getResynthesiscxx . . $ FormantPathEditor_getResynthesis(3add1d3d7be3d8ff). (this, startingTime, endTime); |
| 473 | Sound_playPartcxx . . $ Sound_playPart(4a8b47ed00757136). (resynthesis.getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(), startingTime, endTime, theFunctionEditor_playCallbackcxx . . $ MelderCallback#MelderCallback(b367fc31b94dacdb)., this); |
| 474 | ourcxx . . $ `melder/melder.h:42:9`! clickWasModifiedByShiftKeycxx . . $ structFunctionEditor#clickWasModifiedByShiftKey. = false; |
| 475 | } else { |
| 476 | SoundArea_playcxx . . $ SoundArea_play(8591d98d1e7b94a5). (ourcxx . . $ `melder/melder.h:42:9`! soundAreacxx . . $ structFormantPathEditor#soundArea(f75ec617f241a3e6).().getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(), startingTime, endTime); |
| 477 | } |
| 478 | } |
| 479 | } |
| 480 | |
| 481 | |
| 482 | /********** EXPORTED **********/ |
| 483 | |
| 484 | autoFormantPathEditorcxx . . $ autoFormantPathEditor# FormantPathEditor_createcxx . . $ FormantPathEditor_create(63cecf2aa6e9941d). (conststring32cxx . . $ conststring32# title, FormantPathcxx . . $ FormantPath# formantPath, Soundcxx . . $ Sound# soundToCopy, TextGridcxx . . $ TextGrid# textGridToCopy) { |
| 485 | try { |
| 486 | autoFormantPathEditorcxx . . $ autoFormantPathEditor# me = Thing_newcxx . . $ `sys/Thing.h:514:9`! (FormantPathEditor); |
| 487 | if (soundToCopy) |
| 488 | mycxx . . $ `melder/melder.h:44:9`! soundAreacxx . . $ structFormantPathEditor#soundArea(f75ec617f241a3e6).() =cxx . . $ autoSomeThing#`operator=`(80cc59814f7161e8). SoundArea_createcxx . . $ SoundArea_create(4b60938fec9a8242). (false, soundToCopy, me.getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).()); |
| 489 | mycxx . . $ `melder/melder.h:44:9`! formantPathAreacxx . . $ structFormantPathEditor#formantPathArea(e5a7ab802631ed92).() =cxx . . $ autoSomeThing#`operator=`(80cc59814f7161e8). |
| 490 | soundToCopy |
| 491 | ? |
| 492 | FormantPathArea_createcxx . . $ FormantPathArea_create(2f381489e8aabd87). (true, soundToCopy, me.getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).()) |
| 493 | : |
| 494 | (cxx . . $ autoSomeThing#autoSomeThing(327dc2ad7b4df21).autoFormantPathAreacxx . . $ autoFormantPathArea#) FormantPathArea_without_Sound_createcxx . . $ FormantPathArea_without_Sound_create(33816a244c78d743). (true, nullptr, me.getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).()) |
| 495 | ; |
| 496 | mycxx . . $ `melder/melder.h:44:9`! formantPathAreacxx . . $ structFormantPathEditor#formantPathArea(e5a7ab802631ed92).() ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). _formantPathcxx . . $ structFormantPathArea#_formantPath. = formantPath; |
| 497 | if (textGridToCopy) |
| 498 | mycxx . . $ `melder/melder.h:44:9`! textGridAreacxx . . $ structFormantPathEditor#textGridArea(fd24f7f644037235).() =cxx . . $ autoSomeThing#`operator=`(80cc59814f7161e8). TextGridArea_createcxx . . $ TextGridArea_create(f68f4a3a607552fc). (false, textGridToCopy, me.getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).()); |
| 499 | FunctionEditor_initcxx . . $ FunctionEditor_init(719bc58b4917372e). (me.getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(), title, formantPath); |
| 500 | mycxx . . $ `melder/melder.h:44:9`! formantPathAreacxx . . $ structFormantPathEditor#formantPathArea(e5a7ab802631ed92).() ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). d_formantcxx . . $ structSoundAnalysisArea#d_formant. =cxx . . $ autoSomeThing#`operator=`(80cc59814f7161e8). FormantPath_extractFormantcxx . . $ FormantPath_extractFormant(c1105e94bde1773c). (formantPath); // BUG: should be in other places |
| 501 | if (mycxx . . $ `melder/melder.h:44:9`! instancePref_modeler_numberOfParametersPerTrackcxx . . $ structFormantPathEditor#instancePref_modeler_numberOfParametersPerTrack(d608cbfe2b610d03).() [0] == U'\0') |
| 502 | mycxx . . $ `melder/melder.h:44:9`! setInstancePref_modeler_numberOfParametersPerTrackcxx . . $ structFormantPathEditor#setInstancePref_modeler_numberOfParametersPerTrack(ff00d524ab0355ec). (mycxx . . $ `melder/melder.h:44:9`! default_modeler_numberOfParametersPerTrackcxx . . $ structFormantPathEditor#default_modeler_numberOfParametersPerTrack(d608cbfe2b610d03).()); |
| 503 | if (mycxx . . $ `melder/melder.h:44:9`! formantPathAreacxx . . $ structFormantPathEditor#formantPathArea(e5a7ab802631ed92).() ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). instancePref_formant_default_colourcxx . . $ structFormantPathArea#instancePref_formant_default_colour(d608cbfe2b610d03).() [0] == U'\0') |
| 504 | mycxx . . $ `melder/melder.h:44:9`! formantPathAreacxx . . $ structFormantPathEditor#formantPathArea(e5a7ab802631ed92).() ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). setInstancePref_formant_default_colourcxx . . $ structFormantPathArea#setInstancePref_formant_default_colour(ff00d524ab0355ec). (mycxx . . $ `melder/melder.h:44:9`! formantPathAreacxx . . $ structFormantPathEditor#formantPathArea(e5a7ab802631ed92).() ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). default_formant_default_colourcxx . . $ structFormantPathArea#default_formant_default_colour(d608cbfe2b610d03). ()); |
| 505 | if (mycxx . . $ `melder/melder.h:44:9`! formantPathAreacxx . . $ structFormantPathEditor#formantPathArea(e5a7ab802631ed92).() ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). instancePref_formant_path_oddColourcxx . . $ structFormantPathArea#instancePref_formant_path_oddColour(d608cbfe2b610d03).() [0] == U'\0') |
| 506 | mycxx . . $ `melder/melder.h:44:9`! formantPathAreacxx . . $ structFormantPathEditor#formantPathArea(e5a7ab802631ed92).() ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). setInstancePref_formant_path_oddColourcxx . . $ structFormantPathArea#setInstancePref_formant_path_oddColour(ff00d524ab0355ec). (mycxx . . $ `melder/melder.h:44:9`! formantPathAreacxx . . $ structFormantPathEditor#formantPathArea(e5a7ab802631ed92).() ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). default_formant_path_oddColourcxx . . $ structFormantPathArea#default_formant_path_oddColour(d608cbfe2b610d03). ()); |
| 507 | if (mycxx . . $ `melder/melder.h:44:9`! formantPathAreacxx . . $ structFormantPathEditor#formantPathArea(e5a7ab802631ed92).() ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). instancePref_formant_path_evenColourcxx . . $ structFormantPathArea#instancePref_formant_path_evenColour(d608cbfe2b610d03).() [0] == U'\0') |
| 508 | mycxx . . $ `melder/melder.h:44:9`! formantPathAreacxx . . $ structFormantPathEditor#formantPathArea(e5a7ab802631ed92).() ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). setInstancePref_formant_path_evenColourcxx . . $ structFormantPathArea#setInstancePref_formant_path_evenColour(ff00d524ab0355ec). (mycxx . . $ `melder/melder.h:44:9`! formantPathAreacxx . . $ structFormantPathEditor#formantPathArea(e5a7ab802631ed92).() ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). default_formant_path_evenColourcxx . . $ structFormantPathArea#default_formant_path_evenColour(d608cbfe2b610d03). ()); |
| 509 | if (mycxx . . $ `melder/melder.h:44:9`! formantPathAreacxx . . $ structFormantPathEditor#formantPathArea(e5a7ab802631ed92).() ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). instancePref_formant_selected_colourcxx . . $ structFormantPathArea#instancePref_formant_selected_colour(d608cbfe2b610d03).() [0] == U'\0') |
| 510 | mycxx . . $ `melder/melder.h:44:9`! formantPathAreacxx . . $ structFormantPathEditor#formantPathArea(e5a7ab802631ed92).() ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). setInstancePref_formant_selected_colourcxx . . $ structFormantPathArea#setInstancePref_formant_selected_colour(ff00d524ab0355ec). (mycxx . . $ `melder/melder.h:44:9`! formantPathAreacxx . . $ structFormantPathEditor#formantPathArea(e5a7ab802631ed92).() ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). default_formant_selected_colourcxx . . $ structFormantPathArea#default_formant_selected_colour(d608cbfe2b610d03). ()); |
| 511 | return mecxx . . $ autoSomeThing#autoSomeThing(b79141a71f7bc86f).; |
| 512 | } catch (MelderErrorcxx . . $ MelderError#) { |
| 513 | Melder_throwcxx . . $ `melder/melder_error.h:77:9`! (U"FormantPathEditor window not created."); |
| 514 | } |
| 515 | } |
| 516 | |
| 517 | /* End of file FormantPathEditor.cpp */ |