| 1 | /* praat_MultiSampledSpectrogram.cpp |
| 2 | * |
| 3 | * Copyright (C) 2021-2023 David Weenink |
| 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. See the GNU |
| 13 | * 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 "praatM.h"cxx . . $ `<file>/sys/praatM.h`/ |
| 20 | |
| 21 | #include "AnalyticSound.h"cxx . . $ `<file>/dwtools/AnalyticSound.h`/ |
| 22 | #include "ConstantQSpectrograms.h"cxx . . $ `<file>/dwtools/ConstantQSpectrograms.h`/ |
| 23 | #include "MultiSampledSpectrogram.h"cxx . . $ `<file>/dwtools/MultiSampledSpectrogram.h`/ |
| 24 | #include "Sound_and_MultiSampledSpectrogram.h"cxx . . $ `<file>/dwtools/Sound_and_MultiSampledSpectrogram.h`/ |
| 25 | #include "Spectrum_and_MultiSampledSpectrogram.h"cxx . . $ `<file>/dwtools/Spectrum_and_MultiSampledSpectrogram.h`/ |
| 26 | |
| 27 | DIRECTcxx . . $ `sys/praatM.h:412:9`! (CONVERT_EACH_TO_ONE__AnalyticSound_toIntensity) { |
| 28 | CONVERT_EACH_TO_ONEcxx . . $ `sys/praatM.h:1119:9`! (AnalyticSound) |
| 29 | autoIntensitycxx . . $ autoIntensity# result = AnalyticSound_to_Intensitycxx . . $ AnalyticSound_to_Intensity(4b690d3b08e0f604). (me); |
| 30 | CONVERT_EACH_TO_ONE_ENDcxx . . $ `sys/praatM.h:1121:9`! (mycxx . . $ `melder/melder.h:44:9`! name.get()) |
| 31 | } |
| 32 | |
| 33 | DIRECTcxx . . $ `sys/praatM.h:412:9`! (CONVERT_EACH_TO_ONE__AnalyticSound_toSound) { |
| 34 | CONVERT_EACH_TO_ONEcxx . . $ `sys/praatM.h:1119:9`! (AnalyticSound) |
| 35 | autoSoundcxx . . $ autoSound# result = AnalyticSound_to_Soundcxx . . $ AnalyticSound_to_Sound(e40d05aa54df2f1e). (me); |
| 36 | CONVERT_EACH_TO_ONE_ENDcxx . . $ `sys/praatM.h:1121:9`! (mycxx . . $ `melder/melder.h:44:9`! name.get()) |
| 37 | } |
| 38 | |
| 39 | FORMcxx . . $ `sys/praatM.h:79:9`! (MODIFY_EACH_WEAK__MultiSampledSpectrogram_formula, U"MultiSampledSpectrogram: Formula", U"MultiSampledSpectrogram: Formula...") { |
| 40 | FORMULAcxx . . $ `sys/praatM.h:148:9`! (formula, U"Formula", U"2 * self") |
| 41 | OKcxx . . $ `sys/praatM.h:327:9`! |
| 42 | DOcxx . . $ `sys/praatM.h:354:9`! |
| 43 | MODIFY_EACH_WEAKcxx . . $ `sys/praatM.h:1025:9`! (MultiSampledSpectrogram) |
| 44 | MultiSampledSpectrogram_formulacxx . . $ MultiSampledSpectrogram_formula(9d01cb27578888e0). (me, formula, interpreter); |
| 45 | MODIFY_EACH_WEAK_ENDcxx . . $ `sys/praatM.h:1028:9`! |
| 46 | } |
| 47 | |
| 48 | FORMcxx . . $ `sys/praatM.h:79:9`! (MODIFY_EACH_WEAK__MultiSampledSpectrogram_formula_part, U"MultiSampledSpectrogram: Formula (part)", U"MultiSampledSpectrogram: Formula...") { |
| 49 | REALcxx . . $ `sys/praatM.h:92:9`! (fromTime, U"From time", U"0.0") |
| 50 | REALcxx . . $ `sys/praatM.h:92:9`! (toTime, U"To time", U"0.0 (= all)") |
| 51 | REALcxx . . $ `sys/praatM.h:92:9`! (fromFrequency, U"From frequency (Hz)", U"100.0") |
| 52 | REALcxx . . $ `sys/praatM.h:92:9`! (toFrequency, U"To Frequency (Hz)", U"200.0") |
| 53 | FORMULAcxx . . $ `sys/praatM.h:148:9`! (formula, U"Formula", U"2 * self") |
| 54 | OKcxx . . $ `sys/praatM.h:327:9`! |
| 55 | DOcxx . . $ `sys/praatM.h:354:9`! |
| 56 | MODIFY_EACH_WEAKcxx . . $ `sys/praatM.h:1025:9`! (MultiSampledSpectrogram) |
| 57 | MultiSampledSpectrogram_formula_partcxx . . $ MultiSampledSpectrogram_formula_part(f0c580ff93e15909). (me, fromTime, toTime, fromFrequency, toFrequency, formula, interpreter); |
| 58 | MODIFY_EACH_WEAK_ENDcxx . . $ `sys/praatM.h:1028:9`! |
| 59 | } |
| 60 | |
| 61 | FORMcxx . . $ `sys/praatM.h:79:9`! (GRAPHICS_EACH__ConstantQLog2FSpectrogram_paint, U"ConstantQLog2FSpectrogram: Paint", nullptr) { |
| 62 | REALcxx . . $ `sys/praatM.h:92:9`! (xmin, U"left Time range (s)", U"0.0") |
| 63 | REALcxx . . $ `sys/praatM.h:92:9`! (xmax, U"right Time range (s)", U"0.0 (= all)") |
| 64 | REALcxx . . $ `sys/praatM.h:92:9`! (ymin, U"left Frequency range (Hz)", U"0.0") |
| 65 | REALcxx . . $ `sys/praatM.h:92:9`! (ymax, U"right Frequency range (Hz)", U"0.0 (= auto)") |
| 66 | POSITIVEcxx . . $ `sys/praatM.h:104:9`! (dBRange, U"Dynamic range (dB)", U"50.0") |
| 67 | BOOLEANcxx . . $ `sys/praatM.h:130:9`! (garnish, U"Garnish", true); |
| 68 | OKcxx . . $ `sys/praatM.h:327:9`! |
| 69 | DOcxx . . $ `sys/praatM.h:354:9`! |
| 70 | GRAPHICS_EACHcxx . . $ `sys/praatM.h:697:9`! (ConstantQLog2FSpectrogram) |
| 71 | ConstantQLog2FSpectrogram_paintcxx . . $ ConstantQLog2FSpectrogram_paint(7044c70a4c992fd2). (me, GRAPHICScxx . . $ `sys/praat.h:204:9`!, xmin, xmax, ymin, ymax, dBRange, garnish); |
| 72 | GRAPHICS_EACH_ENDcxx . . $ `sys/praatM.h:700:9`! |
| 73 | } |
| 74 | |
| 75 | DIRECTcxx . . $ `sys/praatM.h:412:9`! (CONVERT_EACH_TO_ONE__MultiSampledSpectrogram_to_Sound) { |
| 76 | CONVERT_EACH_TO_ONEcxx . . $ `sys/praatM.h:1119:9`! (MultiSampledSpectrogram) |
| 77 | autoSoundcxx . . $ autoSound# result = MultiSampledSpectrogram_to_Soundcxx . . $ MultiSampledSpectrogram_to_Sound(a21fff60469ac77a). (me); |
| 78 | CONVERT_EACH_TO_ONE_ENDcxx . . $ `sys/praatM.h:1121:9`! (mycxx . . $ `melder/melder.h:44:9`! name.get()) |
| 79 | } |
| 80 | |
| 81 | FORMcxx . . $ `sys/praatM.h:79:9`! (CONVERT_EACH_TO_ONE__MultiSampledSpectrogram_to_Sound_frequencyBin, U"MultiSampledSpectrogram: To Sound (frequencyBin)", nullptr) { |
| 82 | NATURALcxx . . $ `sys/praatM.h:120:9`! (frequencyBinNumber, U"Frequency bin number", U"1") |
| 83 | OKcxx . . $ `sys/praatM.h:327:9`! |
| 84 | DOcxx . . $ `sys/praatM.h:354:9`! |
| 85 | CONVERT_EACH_TO_ONEcxx . . $ `sys/praatM.h:1119:9`! (MultiSampledSpectrogram) |
| 86 | autoSoundcxx . . $ autoSound# result = MultiSampledSpectrogram_to_Sound_frequencyBincxx . . $ MultiSampledSpectrogram_to_Sound_frequencyBin(2b2008b6861fa653). (me, frequencyBinNumber); |
| 87 | CONVERT_EACH_TO_ONE_ENDcxx . . $ `sys/praatM.h:1121:9`! (mycxx . . $ `melder/melder.h:44:9`! name.get(), U"_",frequencyBinNumber) |
| 88 | } |
| 89 | |
| 90 | DIRECTcxx . . $ `sys/praatM.h:412:9`! (CONVERT_EACH_TO_ONE__MultiSampledSpectrogram_to_Spectrum) { |
| 91 | CONVERT_EACH_TO_ONEcxx . . $ `sys/praatM.h:1119:9`! (MultiSampledSpectrogram) |
| 92 | autoSpectrumcxx . . $ autoSpectrum# result = MultiSampledSpectrogram_to_Spectrumcxx . . $ MultiSampledSpectrogram_to_Spectrum(f80e55b4ddb107af). (me); |
| 93 | CONVERT_EACH_TO_ONE_ENDcxx . . $ `sys/praatM.h:1121:9`! (mycxx . . $ `melder/melder.h:44:9`! name.get()) |
| 94 | } |
| 95 | |
| 96 | FORMcxx . . $ `sys/praatM.h:79:9`! (CONVERT_EACH_TO_ONE__ConstantQLog2FSpectrogram_translateSpectrum, U"", nullptr) { |
| 97 | REALcxx . . $ `sys/praatM.h:92:9`! (fromTime, U"From time", U"0.0") |
| 98 | REALcxx . . $ `sys/praatM.h:92:9`! (toTime, U"To time", U"0.0 (= all)") |
| 99 | REALcxx . . $ `sys/praatM.h:92:9`! (fromFrequency, U"From frequency (Hz)", U"100.0") |
| 100 | REALcxx . . $ `sys/praatM.h:92:9`! (numberOfBins, U"Number of bins", U"5.0") |
| 101 | OKcxx . . $ `sys/praatM.h:327:9`! |
| 102 | DOcxx . . $ `sys/praatM.h:354:9`! |
| 103 | CONVERT_EACH_TO_ONEcxx . . $ `sys/praatM.h:1119:9`! (ConstantQLog2FSpectrogram) |
| 104 | autoConstantQLog2FSpectrogramcxx . . $ autoConstantQLog2FSpectrogram# result = ConstantQLog2FSpectrogram_translateSpectrumcxx . . $ ConstantQLog2FSpectrogram_translateSpectrum(decf33055da53aef). (me, fromTime, toTime, fromFrequency, numberOfBins); |
| 105 | CONVERT_EACH_TO_ONE_ENDcxx . . $ `sys/praatM.h:1121:9`! (mycxx . . $ `melder/melder.h:44:9`! name.get()) |
| 106 | } |
| 107 | |
| 108 | FORMcxx . . $ `sys/praatM.h:79:9`! (CONVERT_EACH_TO_ONE__Sound_to_ConstantQLog2FSpectrogram, U"Sound: To ConstantQLog2FSpectrogram", U"Sound: To ConstantQLog2FSpectrogram...") { |
| 109 | POSITIVEcxx . . $ `sys/praatM.h:104:9`! (f1, U"Lowest frequency (Hz)", U"110.0 (=440*2^(-2))") |
| 110 | REALcxx . . $ `sys/praatM.h:92:9`! (fmax, U"Maximum frequency (Hz)", U"0.0 (= Nyquist)") |
| 111 | NATURALcxx . . $ `sys/praatM.h:120:9`! (numberOfFrequencyBinsPerOctave, U"Number of frequency bins / octave", U"24") |
| 112 | POSITIVEcxx . . $ `sys/praatM.h:104:9`! (frequencyResolutionInBins, U"Frequency resolution (bins)", U"1.0") |
| 113 | POSITIVEcxx . . $ `sys/praatM.h:104:9`! (timeOversamplingFactor, U"Time oversampling factor", U"1.0") |
| 114 | CHOICE_ENUMcxx . . $ `sys/praatM.h:249:9`! (kSound_windowShape, filterShape, |
| 115 | U"Filter shape", kSound_windowShape::DEFAULT) |
| 116 | OKcxx . . $ `sys/praatM.h:327:9`! |
| 117 | DOcxx . . $ `sys/praatM.h:354:9`! |
| 118 | CONVERT_EACH_TO_ONEcxx . . $ `sys/praatM.h:1119:9`! (Sound) |
| 119 | autoConstantQLog2FSpectrogramcxx . . $ autoConstantQLog2FSpectrogram# result = Sound_to_ConstantQLog2FSpectrogramcxx . . $ Sound_to_ConstantQLog2FSpectrogram(b479bf2c3e27b2ee). (me, f1, fmax, |
| 120 | numberOfFrequencyBinsPerOctave, frequencyResolutionInBins, timeOversamplingFactor, filterShape |
| 121 | ); |
| 122 | CONVERT_EACH_TO_ONE_ENDcxx . . $ `sys/praatM.h:1121:9`! (mycxx . . $ `melder/melder.h:44:9`! name.get()) |
| 123 | } |
| 124 | |
| 125 | DIRECTcxx . . $ `sys/praatM.h:412:9`! (CONVERT_EACH_TO_ONE__Sound_to_AnalyticSound) { |
| 126 | CONVERT_EACH_TO_ONEcxx . . $ `sys/praatM.h:1119:9`! (Sound) |
| 127 | autoAnalyticSoundcxx . . $ autoAnalyticSound# result = Sound_to_AnalyticSoundcxx . . $ Sound_to_AnalyticSound(c91414eca4bcdab1). (me); |
| 128 | CONVERT_EACH_TO_ONE_ENDcxx . . $ `sys/praatM.h:1121:9`! (mycxx . . $ `melder/melder.h:44:9`! name.get()) |
| 129 | } |
| 130 | |
| 131 | FORMcxx . . $ `sys/praatM.h:79:9`! (GRAPHICS_EACH__GaborSpectrogram_paint, U"GaborSpectrogram: Paint", nullptr) { |
| 132 | REALcxx . . $ `sys/praatM.h:92:9`! (xmin, U"left Time range (s)", U"0.0") |
| 133 | REALcxx . . $ `sys/praatM.h:92:9`! (xmax, U"right Time range (s)", U"0.0 (= all)") |
| 134 | REALcxx . . $ `sys/praatM.h:92:9`! (ymin, U"left Frequency range (Hz)", U"0.0") |
| 135 | REALcxx . . $ `sys/praatM.h:92:9`! (ymax, U"right Frequency range (Hz)", U"0.0 (= auto)") |
| 136 | POSITIVEcxx . . $ `sys/praatM.h:104:9`! (dBRange, U"Dynamic range (dB)", U"50.0") |
| 137 | BOOLEANcxx . . $ `sys/praatM.h:130:9`! (garnish, U"Garnish", true); |
| 138 | OKcxx . . $ `sys/praatM.h:327:9`! |
| 139 | DOcxx . . $ `sys/praatM.h:354:9`! |
| 140 | GRAPHICS_EACHcxx . . $ `sys/praatM.h:697:9`! (GaborSpectrogram) |
| 141 | GaborSpectrogram_paintcxx . . $ GaborSpectrogram_paint(943fc4f4780261aa). (me, GRAPHICScxx . . $ `sys/praat.h:204:9`!, xmin, xmax, ymin, ymax, dBRange, garnish); |
| 142 | GRAPHICS_EACH_ENDcxx . . $ `sys/praatM.h:700:9`! |
| 143 | } |
| 144 | |
| 145 | FORMcxx . . $ `sys/praatM.h:79:9`! (CONVERT_EACH_TO_ONE__Sound_to_GaborSpectrogram, U"Sound: To GaborSpectrogram", U"Sound: To ConstantQLog2FSpectrogram...") { |
| 146 | REALcxx . . $ `sys/praatM.h:92:9`! (fmax, U"Maximum frequency (Hz)", U"0.0 (= Nyquist)") |
| 147 | POSITIVEcxx . . $ `sys/praatM.h:104:9`! (filterBandwidth, U"Filter bandwidth (Hz)", U"40.0") |
| 148 | POSITIVEcxx . . $ `sys/praatM.h:104:9`! (frequencyStep, U"Frequency step (hz)", U"20.0") |
| 149 | POSITIVEcxx . . $ `sys/praatM.h:104:9`! (timeOversamplingFactor, U"Time oversampling factor", U"1.0") |
| 150 | CHOICE_ENUMcxx . . $ `sys/praatM.h:249:9`! (kSound_windowShape, filterShape, |
| 151 | U"Filter shape", kSound_windowShape::DEFAULT) |
| 152 | OKcxx . . $ `sys/praatM.h:327:9`! |
| 153 | DOcxx . . $ `sys/praatM.h:354:9`! |
| 154 | CONVERT_EACH_TO_ONEcxx . . $ `sys/praatM.h:1119:9`! (Sound) |
| 155 | autoGaborSpectrogramcxx . . $ autoGaborSpectrogram# result = Sound_to_GaborSpectrogramcxx . . $ Sound_to_GaborSpectrogram(56c564cbf60aeff2). (me, fmax, filterBandwidth, |
| 156 | frequencyStep, timeOversamplingFactor, filterShape |
| 157 | ); |
| 158 | CONVERT_EACH_TO_ONE_ENDcxx . . $ `sys/praatM.h:1121:9`! (mycxx . . $ `melder/melder.h:44:9`! name.get()) |
| 159 | } |
| 160 | |
| 161 | void praat_MultiSampledSpectrograms_genericscxx . . $ praat_MultiSampledSpectrograms_generics(b2b8400651464df9). (ClassInfocxx . . $ ClassInfo# klas) { |
| 162 | praat_addAction1cxx . . $ `sys/praat.h:72:9`! (klas, 0, U"Formula...", nullptr, 0, |
| 163 | MODIFY_EACH_WEAK__MultiSampledSpectrogram_formula); |
| 164 | praat_addAction1cxx . . $ `sys/praat.h:72:9`! (klas, 0, U"Formula (part)...", nullptr, 0, |
| 165 | MODIFY_EACH_WEAK__MultiSampledSpectrogram_formula_part); |
| 166 | praat_addAction1cxx . . $ `sys/praat.h:72:9`! (klas, 0, U"To Sound", nullptr, 0, |
| 167 | CONVERT_EACH_TO_ONE__MultiSampledSpectrogram_to_Sound); |
| 168 | praat_addAction1cxx . . $ `sys/praat.h:72:9`! (klas, 0, U"To Sound (frequencyBin)...", nullptr, 0, |
| 169 | CONVERT_EACH_TO_ONE__MultiSampledSpectrogram_to_Sound_frequencyBin); |
| 170 | praat_addAction1cxx . . $ `sys/praat.h:72:9`! (klas, 0, U"To Spectrum", nullptr, 0, |
| 171 | CONVERT_EACH_TO_ONE__MultiSampledSpectrogram_to_Spectrum); |
| 172 | } |
| 173 | |
| 174 | void praat_MultiSampledSpectrogram_initcxx . . $ praat_MultiSampledSpectrogram_init(49f6e7a06ebc5aa8). (); |
| 175 | void praat_MultiSampledSpectrogram_initcxx . . $ praat_MultiSampledSpectrogram_init(49f6e7a06ebc5aa8). () { |
| 176 | Thing_recognizeClassesByNamecxx . . $ Thing_recognizeClassesByName(f327490b5edb0dcb). (classAnalyticSoundcxx . . $ classAnalyticSound., classConstantQLog2FSpectrogramcxx . . $ classConstantQLog2FSpectrogram., classFrequencyBincxx . . $ classFrequencyBin., |
| 177 | classGaborSpectrogramcxx . . $ classGaborSpectrogram., classMultiSampledSpectrogramcxx . . $ classMultiSampledSpectrogram.); |
| 178 | |
| 179 | praat_addAction1cxx . . $ `sys/praat.h:72:9`! (classAnalyticSound, 0, U"To Intensity", nullptr, 0, |
| 180 | CONVERT_EACH_TO_ONE__AnalyticSound_toIntensity); |
| 181 | praat_addAction1cxx . . $ `sys/praat.h:72:9`! (classAnalyticSound, 0, U"To Sound", nullptr, 0, |
| 182 | CONVERT_EACH_TO_ONE__AnalyticSound_toSound); |
| 183 | |
| 184 | praat_addAction1cxx . . $ `sys/praat.h:72:9`! (classConstantQLog2FSpectrogram, 0, U"Paint...", nullptr, 0, |
| 185 | GRAPHICS_EACH__ConstantQLog2FSpectrogram_paint); |
| 186 | praat_MultiSampledSpectrograms_genericscxx . . $ praat_MultiSampledSpectrograms_generics(b2b8400651464df9). (classConstantQLog2FSpectrogramcxx . . $ classConstantQLog2FSpectrogram.); |
| 187 | praat_addAction1cxx . . $ `sys/praat.h:72:9`! (classConstantQLog2FSpectrogram, 0, U"Translate spectrum...", nullptr, 0, |
| 188 | CONVERT_EACH_TO_ONE__ConstantQLog2FSpectrogram_translateSpectrum); |
| 189 | |
| 190 | praat_addAction1cxx . . $ `sys/praat.h:72:9`! (classSound, 0, U"To ConstantQLog2FSpectrogram...", U"To ComplexSpectrogram...", GuiMenu_DEPTH_1cxx . . $ `sys/Gui.h:862:9`! | GuiMenu_HIDDENcxx . . $ `sys/Gui.h:869:9`!, |
| 191 | CONVERT_EACH_TO_ONE__Sound_to_ConstantQLog2FSpectrogram); |
| 192 | praat_addAction1cxx . . $ `sys/praat.h:72:9`! (classSound, 0, U"To AnalyticSound", U"Resample...", GuiMenu_DEPTH_1cxx . . $ `sys/Gui.h:862:9`! | GuiMenu_HIDDENcxx . . $ `sys/Gui.h:869:9`!, |
| 193 | CONVERT_EACH_TO_ONE__Sound_to_AnalyticSound); |
| 194 | |
| 195 | |
| 196 | praat_addAction1cxx . . $ `sys/praat.h:72:9`! (classGaborSpectrogram, 0, U"Paint...", nullptr, 0, |
| 197 | GRAPHICS_EACH__GaborSpectrogram_paint); |
| 198 | praat_MultiSampledSpectrograms_genericscxx . . $ praat_MultiSampledSpectrograms_generics(b2b8400651464df9). (classGaborSpectrogramcxx . . $ classGaborSpectrogram.); |
| 199 | praat_addAction1cxx . . $ `sys/praat.h:72:9`! (classSound, 0, U"To GaborSpectrogram...", U"To ComplexSpectrogram...", GuiMenu_DEPTH_1cxx . . $ `sys/Gui.h:862:9`! | GuiMenu_HIDDENcxx . . $ `sys/Gui.h:869:9`!, |
| 200 | CONVERT_EACH_TO_ONE__Sound_to_GaborSpectrogram); |
| 201 | } |
| 202 | |
| 203 | /* End of file praat_MultiSampledSpectrogram.cpp */ |
| 204 |