1 /* praat_Tiers.cpp
2  *
3  * Copyright (C) 1992-2018,2020,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 "Ltas.h"
20 #include "PitchTier_to_PointProcess.h"
21 #include "PitchTier_to_Sound.h"
22 #include "Matrix_and_PointProcess.h"
23 #include "PointProcess_and_Sound.h"
24 #include "Sound_PointProcess.h"
25 #include "SpectrumTier.h"
26 #include "TextGrid.h"
27 #include "VoiceAnalysis.h"
28 
29 #include "praat_Tiers.h"
ModuleDebugStreamRef(const DbiModuleDescriptor & Module,std::unique_ptr<MappedBlockStream> Stream)30 
31 // MARK: - AMPLITUDETIER
32 
33 // MARK: New
34 
35 FORM (NEW1_AmplitudeTier_create, U"Create empty AmplitudeTier", nullptr) {
36 	WORD (name, U"Name", U"empty")
37 	REAL (startTime, U"Start time (s)", U"0.0")
38 	REAL (endTime, U"End time (s)", U"1.0")
39 	OK
40 DO
41 	Melder_require (endTime > startTime,
42 		U"The end time should be greater than the start time.");
43 	CREATE_ONE
44 		autoAmplitudeTier result = AmplitudeTier_create (startTime, endTime);
45 	CREATE_ONE_END (name)
46 }
47 
48 // MARK: Help
49 
reloadSerialize(BinaryStreamReader & Reader)50 DIRECT (HELP_AmplitudeTier_help) {
51 	HELP (U"AmplitudeTier")
52 }
53 
54 // MARK: View & Edit
55 
56 DIRECT (EDITOR_ONE_WITH_ONE_AmplitudeTier_viewAndEdit) {
57 	EDITOR_ONE_WITH_ONE (an,AmplitudeTier, Sound)   // Sound may be null
58 		autoAmplitudeTierEditor editor = AmplitudeTierEditor_create (ID_AND_FULL_NAME, me, you, true);
59 	EDITOR_ONE_WITH_ONE_END
60 }
61 
62 DIRECT (HINT_AmplitudeTier_Sound_viewAndEdit) {
63 	INFO_NONE
64 		Melder_information (U"To include a copy of a Sound in your AmplitudeTier window:\n"
65 			"   select an AmplitudeTier and a Sound, and click \"View & Edit\".");
66 	INFO_NONE_END
67 }
68 
69 // MARK: Query
70 
71 FORM (REAL_AmplitudeTier_getShimmer_local, U"AmplitudeTier: Get shimmer (local)", U"AmplitudeTier: Get shimmer (local)...") {
72 	REAL (shortestPeriod, U"Shortest period (s)", U"0.0001")
73 	REAL (longestPeriod, U"Longest period (s)", U"0.02")
74 	POSITIVE (maximumAmplitudeFactor, U"Maximum amplitude factor", U"1.6")
75 	OK
76 DO
77 	QUERY_ONE_FOR_REAL (AmplitudeTier)
78 		double result = AmplitudeTier_getShimmer_local (me, shortestPeriod, longestPeriod, maximumAmplitudeFactor);
79 	QUERY_ONE_FOR_REAL_END (U" (local shimmer)")
80 }
81 
82 FORM (REAL_AmplitudeTier_getShimmer_local_dB, U"AmplitudeTier: Get shimmer (local, dB)", U"AmplitudeTier: Get shimmer (local, dB)...") {
83 	REAL (shortestPeriod, U"Shortest period (s)", U"0.0001")
84 	REAL (longestPeriod, U"Longest period (s)", U"0.02")
85 	POSITIVE (maximumAmplitudeFactor, U"Maximum amplitude factor", U"1.6")
86 	OK
87 DO
88 	QUERY_ONE_FOR_REAL (AmplitudeTier)
89 		double result = AmplitudeTier_getShimmer_local_dB (me, shortestPeriod, longestPeriod, maximumAmplitudeFactor);
getSymbolArrayForScope(uint32_t ScopeBegin) const90 	QUERY_ONE_FOR_REAL_END (U" dB (local shimmer)")
91 }
92 
93 FORM (REAL_AmplitudeTier_getShimmer_apq3, U"AmplitudeTier: Get shimmer (apq3)", U"AmplitudeTier: Get shimmer (apq3)...") {
94 	REAL (shortestPeriod, U"Shortest period (s)", U"0.0001")
95 	REAL (longestPeriod, U"Longest period (s)", U"0.02")
96 	POSITIVE (maximumAmplitudeFactor, U"Maximum amplitude factor", U"1.6")
97 	OK
98 DO
99 	QUERY_ONE_FOR_REAL (AmplitudeTier)
100 		double result = AmplitudeTier_getShimmer_apq3 (me, shortestPeriod, longestPeriod, maximumAmplitudeFactor);
101 	QUERY_ONE_FOR_REAL_END (U" (apq3 shimmer)")
102 }
103 
104 FORM (REAL_AmplitudeTier_getShimmer_apq5, U"AmplitudeTier: Get shimmer (apq5)", U"AmplitudeTier: Get shimmer (apq5)...") {
105 	REAL (shortestPeriod, U"Shortest period (s)", U"0.0001")
getGlobalRefsSubstream() const106 	REAL (longestPeriod, U"Longest period (s)", U"0.02")
107 	POSITIVE (maximumAmplitudeFactor, U"Maximum amplitude factor", U"1.6")
108 	OK
109 DO
110 	QUERY_ONE_FOR_REAL (AmplitudeTier)
111 		double result = AmplitudeTier_getShimmer_apq5 (me, shortestPeriod, longestPeriod, maximumAmplitudeFactor);
112 	QUERY_ONE_FOR_REAL_END (U" (apq5 shimmer)")
113 }
114 
readSymbolAtOffset(uint32_t Offset) const115 FORM (REAL_AmplitudeTier_getShimmer_apq11, U"AmplitudeTier: Get shimmer (apq11)", U"AmplitudeTier: Get shimmer (apq11)...") {
116 	REAL (shortestPeriod, U"Shortest period (s)", U"0.0001")
117 	REAL (longestPeriod, U"Longest period (s)", U"0.02")
118 	POSITIVE (maximumAmplitudeFactor, U"Maximum amplitude factor", U"1.6")
119 	OK
120 DO
121 	QUERY_ONE_FOR_REAL (AmplitudeTier)
122 		double result = AmplitudeTier_getShimmer_apq11 (me, shortestPeriod, longestPeriod, maximumAmplitudeFactor);
123 	QUERY_ONE_FOR_REAL_END (U" (apq11 shimmer)")
124 }
125 
hasDebugSubsections() const126 FORM (REAL_AmplitudeTier_getShimmer_dda, U"AmplitudeTier: Get shimmer (dda)", U"AmplitudeTier: Get shimmer (dda)...") {
127 	REAL (shortestPeriod, U"Shortest period (s)", U"0.0001")
128 	REAL (longestPeriod, U"Longest period (s)", U"0.02")
129 	POSITIVE (maximumAmplitudeFactor, U"Maximum amplitude factor", U"1.6")
130 	OK
131 DO
132 	QUERY_ONE_FOR_REAL (AmplitudeTier)
133 		double result = AmplitudeTier_getShimmer_dda (me, shortestPeriod, longestPeriod, maximumAmplitudeFactor);
134 	QUERY_ONE_FOR_REAL_END (U" (dda shimmer)")
135 }
136 
137 /*
138 FORM (REAL_AmplitudeTier_getValueAtTime, U"Get AmplitudeTier value", U"AmplitudeTier: Get value at time...") {
139 	REAL (time, U"Time (s)", U"0.5")
140 	OK
141 DO
142 	QUERY_ONE_FOR_REAL (AmplitudeTier)
143 		double result = RealTier_getValueAtTime (me, time);
144 	QUERY_ONE_FOR_REAL_END (U" Pa")
145 }
146 
147 FORM (REAL_AmplitudeTier_getValueAtIndex, U"Get AmplitudeTier value", U"AmplitudeTier: Get value at index...") {
148 	INTEGER (pointNumber, U"Point number", U"10")
149 	OK
150 DO
151 	QUERY_ONE_FOR_REAL (AmplitudeTier)
152 		double result = RealTier_getValueAtIndex (me, pointNumber);
153 	QUERY_ONE_FOR_REAL_END (U" Pa")
154 }
155 */
156 
157 // MARK: Modify
158 
159 FORM (MODIFY_AmplitudeTier_addPoint, U"Add one point", U"AmplitudeTier: Add point...") {
160 	REAL (time, U"Time (s)", U"0.5")
161 	REAL (soundPressure, U"Sound pressure (Pa)", U"0.8")
162 	OK
163 DO
164 	MODIFY_EACH (AmplitudeTier)
165 		RealTier_addPoint (me, time, soundPressure);
166 	MODIFY_EACH_END
167 }
168 
169 FORM (MODIFY_AmplitudeTier_formula, U"AmplitudeTier: Formula", U"AmplitudeTier: Formula...") {
170 	LABEL (U"# ncol = the number of points")
171 	LABEL (U"for col from 1 to ncol")
172 	LABEL (U"   # x = the time of the colth point, in seconds")
173 	LABEL (U"   # self = the value of the colth point, in Pascal")
174 	LABEL (U"   self = `formula'")
175 	LABEL (U"endfor")
176 	FORMULA (formula, U"Formula", U"- self ; upside down")
177 	OK
178 DO
179 	MODIFY_EACH_WEAK (AmplitudeTier)
180 		RealTier_formula (me, formula, interpreter, nullptr);
181 	MODIFY_EACH_WEAK_END
182 }
183 
184 // MARK: Synthesize
185 
186 FORM (NEW_AmplitudeTier_to_Sound, U"AmplitudeTier: To Sound (pulse train)", U"AmplitudeTier: To Sound (pulse train)...") {
187 	POSITIVE (samplingFrequency, U"Sampling frequency (Hz)", U"44100.0")
188 	NATURAL (interpolationDepth, U"Interpolation depth (samples)", U"2000")
189 	OK
190 DO
191 	CONVERT_EACH_TO_ONE (AmplitudeTier)
192 		autoSound result = AmplitudeTier_to_Sound (me, samplingFrequency, interpolationDepth);
193 	CONVERT_EACH_TO_ONE_END (my name.get())
194 }
195 
196 // MARK: Convert
197 
198 DIRECT (NEW_AmplitudeTier_downto_PointProcess) {
199 	CONVERT_EACH_TO_ONE (AmplitudeTier)
200 		autoPointProcess result = AnyTier_downto_PointProcess (me->asAnyTier());
201 	CONVERT_EACH_TO_ONE_END (my name.get())
202 }
203 
204 DIRECT (NEW_AmplitudeTier_downto_RealTier) {
205 	CONVERT_EACH_TO_ONE (AmplitudeTier)
206 		autoRealTier result = AnyRealTier_downto_RealTier (me);
207 	CONVERT_EACH_TO_ONE_END (my name.get())
208 }
209 
210 DIRECT (NEW_AmplitudeTier_downto_TableOfReal) {
211 	CONVERT_EACH_TO_ONE (AmplitudeTier)
212 		autoTableOfReal result = AmplitudeTier_downto_TableOfReal (me);
213 	CONVERT_EACH_TO_ONE_END (my name.get())
214 }
215 
216 FORM (NEW_AmplitudeTier_to_IntensityTier, U"AmplitudeTier: To IntensityTier", U"AmplitudeTier: To IntensityTier...") {
217 	REAL (threshold, U"Threshold (dB)", U"-10000.0")
218 	OK
219 DO
220 	CONVERT_EACH_TO_ONE (AmplitudeTier)
221 		autoIntensityTier result = AmplitudeTier_to_IntensityTier (me, threshold);
222 	CONVERT_EACH_TO_ONE_END (my name.get())
223 }
224 
225 // MARK: - AMPLITUDETIER & SOUND
226 
227 DIRECT (NEW1_Sound_AmplitudeTier_multiply) {
228 	CONVERT_ONE_AND_ONE_TO_ONE (Sound, AmplitudeTier)
229 		autoSound result = Sound_AmplitudeTier_multiply (me, you);
230 	CONVERT_ONE_AND_ONE_TO_ONE_END (my name.get(), U"_amp")
231 }
232 
233 // MARK: - DURATIONTIER
234 
235 // MARK: New
236 
237 FORM (NEW1_DurationTier_create, U"Create empty DurationTier", U"Create DurationTier...") {
238 	WORD (name, U"Name", U"empty")
239 	REAL (startTime, U"Start time (s)", U"0.0")
240 	REAL (endTime, U"End time (s)", U"1.0")
241 	OK
242 DO
243 	Melder_require (endTime > startTime,
244 		U"Your end time should be greater than your start time.");
245 	CREATE_ONE
246 		autoDurationTier result = DurationTier_create (startTime, endTime);
247 	CREATE_ONE_END (name)
248 }
249 
250 // MARK: Help
251 
252 DIRECT (HELP_DurationTier_help) {
253 	HELP (U"DurationTier")
254 }
255 
256 // MARK: View & Edit
257 
258 DIRECT (EDITOR_ONE_WITH_ONE_DurationTier_edit) {
259 	EDITOR_ONE_WITH_ONE (a,DurationTier, Sound)   // Sound may be null
260 		autoDurationTierEditor editor = DurationTierEditor_create (ID_AND_FULL_NAME, me, you, true);
261 	EDITOR_ONE_WITH_ONE_END
262 }
263 
264 DIRECT (HINT_DurationTier_Sound_edit) {
265 	INFO_NONE
266 		Melder_information (U"To include a copy of a Sound in your DurationTier window:\n"
267 			"   select a DurationTier and a Sound, and click \"View & Edit\".");
268 	INFO_NONE_END
269 }
270 
271 DIRECT (HINT_DurationTier_Manipulation_replace) {
272 	INFO_NONE
273 		Melder_information (U"To replace the DurationTier in a Manipulation object,\n"
274 			"select a DurationTier object and a Manipulation object\nand choose \"Replace duration\".");
275 	INFO_NONE_END
276 }
277 
278 // MARK: Query
279 
280 FORM (REAL_DurationTier_getTargetDuration, U"Get target duration", nullptr) {
281 	REAL (fromSourceTime, U"left Source time range (s)", U"0.0")
282 	REAL (toSourceTime, U"right Source time range (s)", U"1.0")
283 	OK
284 DO
285 	QUERY_ONE_FOR_REAL (DurationTier)
286 		double result = RealTier_getArea (me, fromSourceTime, toSourceTime);
287 	QUERY_ONE_FOR_REAL_END (U" seconds")
288 }
289 
290 FORM (REAL_DurationTier_getValueAtTime, U"Get DurationTier value", U"DurationTier: Get value at time...") {
291 	REAL (sourceTime, U"Source time (s)", U"0.5")
292 	OK
293 DO
294 	QUERY_ONE_FOR_REAL (DurationTier)
295 		double result = RealTier_getValueAtTime (me, sourceTime);
296 	QUERY_ONE_FOR_REAL_END (U" (relative duration)")
297 }
298 
299 FORM (REAL_DurationTier_getValueAtIndex, U"Get DurationTier value", U"Duration: Get value at index...") {
300 	INTEGER (pointNumber, U"Point number", U"10")
301 	OK
302 DO
303 	QUERY_ONE_FOR_REAL (DurationTier)
304 		double result = RealTier_getValueAtIndex (me, pointNumber);
305 	QUERY_ONE_FOR_REAL_END (U" (relative duration)")
306 }
307 
308 // MARK: Modify
309 
310 FORM (MODIFY_DurationTier_addPoint, U"Add one point to DurationTier", U"DurationTier: Add point...") {
311 	REAL (time, U"Time (s)", U"0.5")
312 	REAL (relativeDuration, U"Relative duration", U"1.5")
313 	OK
314 DO
315 	MODIFY_EACH (DurationTier)
316 		RealTier_addPoint (me, time, relativeDuration);
317 	MODIFY_EACH_END
318 }
319 
320 FORM (MODIFY_DurationTier_formula, U"DurationTier: Formula", U"DurationTier: Formula...") {
321 	LABEL (U"# ncol = the number of points")
322 	LABEL (U"for col from 1 to ncol")
323 	LABEL (U"   # x = the time of the colth point, in seconds")
324 	LABEL (U"   # self = the value of the colth point, in relative units")
325 	LABEL (U"   self = `formula'")
326 	LABEL (U"endfor")
327 	FORMULA (formula, U"Formula", U"self * 1.5 ; slow down")
328 	OK
329 DO
330 	MODIFY_EACH_WEAK (DurationTier)
331 		RealTier_formula (me, formula, interpreter, nullptr);
332 	MODIFY_EACH_WEAK_END
333 }
334 
335 // MARK: Convert
336 
337 DIRECT (NEW_DurationTier_downto_PointProcess) {
338 	CONVERT_EACH_TO_ONE (DurationTier)
339 		autoPointProcess result = AnyTier_downto_PointProcess (me->asAnyTier());
340 	CONVERT_EACH_TO_ONE_END (my name.get())
341 }
342 
343 DIRECT (NEW_DurationTier_downto_RealTier) {
344 	CONVERT_EACH_TO_ONE (DurationTier)
345 		autoRealTier result = AnyRealTier_downto_RealTier (me);
346 	CONVERT_EACH_TO_ONE_END (my name.get())
347 }
348 
349 // MARK: - FORMANTGRID
350 
351 // MARK: New
352 
353 FORM (NEW1_FormantGrid_create, U"Create FormantGrid", nullptr) {
354 	WORD (name, U"Name", U"schwa")
355 	REAL (startTime, U"Start time (s)", U"0.0")
356 	REAL (endTime, U"End time (s)", U"1.0")
357 	NATURAL (numberOfFormants, U"Number of formants", U"10")
358 	POSITIVE (initialFirstFormant, U"Initial first formant (Hz)", U"550.0")
359 	POSITIVE (initialFormatSpacing, U"Initial formant spacing (Hz)", U"1100.0")
360 	REAL (initialFirstBandwidth, U"Initial first bandwidth (Hz)", U"60.0")
361 	REAL (initialBandwidthSpacing, U"Initial bandwidth spacing (Hz)", U"50.0")
362 	OK
363 DO
364 	Melder_require (endTime > startTime,
365 		U"Your end time should be greater than your start time.");
366 	CREATE_ONE
367 		autoFormantGrid result = FormantGrid_create (startTime, endTime, numberOfFormants,
368 			initialFirstFormant, initialFormatSpacing, initialFirstBandwidth, initialBandwidthSpacing);
369 	CREATE_ONE_END (name)
370 }
371 
372 // MARK: Help
373 
374 DIRECT (HELP_FormantGrid_help) {
375 	HELP (U"FormantGrid")
376 }
377 
378 // MARK: View & Edit
379 
380 static void cb_FormantGridEditor_publish (Editor /* me */, autoDaata publish) {
381 	/*
382 		Keep the gate for error handling.
383 	*/
384 	try {
385 		praat_new (publish.move(), U"fromFormantGridEditor");
386 		praat_updateSelection ();
387 	} catch (MelderError) {
388 		Melder_flushError ();
389 	}
390 }
391 DIRECT (EDITOR_ONE_FormantGrid_edit) {
392 	EDITOR_ONE (a,FormantGrid)
393 		autoFormantGridEditor editor = FormantGridEditor_create (ID_AND_FULL_NAME, me);
394 		Editor_setPublicationCallback (editor.get(), cb_FormantGridEditor_publish);
395 	EDITOR_ONE_END
396 }
397 
398 // MARK: Modify
399 
400 FORM (MODIFY_FormantGrid_formula_frequencies, U"FormantGrid: Formula (frequencies)", U"Formant: Formula (frequencies)...") {
401 	LABEL (U"row is formant number, col is point number:")
402 	LABEL (U"   for row from 1 to nrow do for col from 1 to ncol do F (row, col) :=")
403 	FORMULA (formula, U"Formula", U"if row = 2 then self + 200 else self fi")
404 	OK
405 DO
406 	MODIFY_EACH_WEAK (FormantGrid)
407 		FormantGrid_formula_frequencies (me, formula, interpreter, nullptr);
408 	MODIFY_EACH_WEAK_END
409 }
410 
411 FORM (MODIFY_FormantGrid_formula_bandwidths, U"FormantGrid: Formula (bandwidths)", U"Formant: Formula (bandwidths)...") {
412 	LABEL (U"row is formant number, col is point number:")
413 	LABEL (U"   for row from 1 to nrow do for col from 1 to ncol do B (row, col) :=")
414 	LABEL (U"self [] is the FormantGrid itself, so it returns frequencies, not bandwidths!")
415 	FORMULA (formula, U"Formula", U"self / 10 ; one tenth of the formant frequency")
416 	OK
417 DO
418 	MODIFY_EACH_WEAK (FormantGrid)
419 		FormantGrid_formula_bandwidths (me, formula, interpreter, nullptr);
420 	MODIFY_EACH_WEAK_END
421 }
422 
423 FORM (MODIFY_FormantGrid_addFormantPoint, U"FormantGrid: Add formant point", U"FormantGrid: Add formant point...") {
424 	NATURAL (formantNumber, U"Formant number", U"1")
425 	REAL (time, U"Time (s)", U"0.5")
426 	POSITIVE (frequency, U"Frequency (Hz)", U"550.0")
427 	OK
428 DO
429 	MODIFY_EACH (FormantGrid)
430 		FormantGrid_addFormantPoint (me, formantNumber, time, frequency);
431 	MODIFY_EACH_END
432 }
433 
434 FORM (MODIFY_FormantGrid_addBandwidthPoint, U"FormantGrid: Add bandwidth point", U"FormantGrid: Add bandwidth point...") {
435 	NATURAL (formantNumber, U"Formant number", U"1")
436 	REAL (time, U"Time (s)", U"0.5")
437 	POSITIVE (bandwidth, U"Bandwidth (Hz)", U"100.0")
438 	OK
439 DO
440 	MODIFY_EACH (FormantGrid)
441 		FormantGrid_addBandwidthPoint (me, formantNumber, time, bandwidth);
442 	MODIFY_EACH_END
443 }
444 
445 FORM (MODIFY_FormantGrid_removeBandwidthPointsBetween, U"Remove bandwidth points between", U"FormantGrid: Remove bandwidth points between...") {
446 	NATURAL (formantNumber, U"Formant number", U"1")
447 	REAL (fromTime, U"From time (s)", U"0.3")
448 	REAL (toTime, U"To time (s)", U"0.7")
449 	OK
450 DO
451 	MODIFY_EACH (FormantGrid)
452 		FormantGrid_removeBandwidthPointsBetween (me, formantNumber, fromTime, toTime);
453 	MODIFY_EACH_END
454 }
455 
456 FORM (MODIFY_FormantGrid_removeFormantPointsBetween, U"Remove formant points between", U"FormantGrid: Remove formant points between...") {
457 	NATURAL (formantNumber, U"Formant number", U"1")
458 	REAL (fromTime, U"From time (s)", U"0.3")
459 	REAL (toTime, U"To time (s)", U"0.7")
460 	OK
461 DO
462 	MODIFY_EACH (FormantGrid)
463 		FormantGrid_removeFormantPointsBetween (me, formantNumber, fromTime, toTime);
464 	MODIFY_EACH_END
465 }
466 
467 // MARK: Convert
468 
469 FORM (NEW_FormantGrid_to_Formant, U"FormantGrid: To Formant", nullptr) {
470 	POSITIVE (timeStep, U"Time step (s)", U"0.01")
471 	REAL (intensity, U"Intensity (Pa\u00B2)", U"0.1")
472 	OK
473 DO
474 	Melder_require (intensity >= 0.0,
475 		U"The intensity cannot be negative.");
476 	CONVERT_EACH_TO_ONE (FormantGrid)
477 		autoFormant result = FormantGrid_to_Formant (me, timeStep, intensity);
478 	CONVERT_EACH_TO_ONE_END (my name.get())
479 }
480 
481 // MARK: - FORMANTGRID & SOUND
482 
483 DIRECT (NEW1_Sound_FormantGrid_filter) {
484 	CONVERT_ONE_AND_ONE_TO_ONE (Sound, FormantGrid)
485 		autoSound result = Sound_FormantGrid_filter (me, you);
486 	CONVERT_ONE_AND_ONE_TO_ONE_END (my name.get(), U"_filt")
487 }
488 
489 DIRECT (NEW1_Sound_FormantGrid_filter_noscale) {
490 	CONVERT_ONE_AND_ONE_TO_ONE (Sound, FormantGrid)
491 		autoSound result = Sound_FormantGrid_filter_noscale (me, you);
492 	CONVERT_ONE_AND_ONE_TO_ONE_END (my name.get(), U"_filt")
493 }
494 
495 // MARK: - FORMANTTIER
496 
497 // MARK: New
498 
499 FORM (NEW1_FormantTier_create, U"Create empty FormantTier", nullptr) {
500 	WORD (name, U"Name", U"empty")
501 	REAL (startTime, U"Start time (s)", U"0.0")
502 	REAL (endTime, U"End time (s)", U"1.0")
503 	OK
504 DO
505 	Melder_require (endTime > startTime,
506 		U"Your end time should be greater than your start time.");
507 	CREATE_ONE
508 		autoFormantTier result = FormantTier_create (startTime, endTime);
509 	CREATE_ONE_END (name)
510 }
511 
512 // MARK: Draw
513 
514 FORM (GRAPHICS_FormantTier_speckle, U"Draw FormantTier", nullptr) {
515 	praat_TimeFunction_RANGE (fromTime, toTime)
516 	POSITIVE (maximumFrequency, U"Maximum frequency (Hz)", U"5500.0")
517 	BOOLEAN (garnish, U"Garnish", true)
518 	OK
519 DO
520 	GRAPHICS_EACH (FormantTier)
521 		FormantTier_speckle (me, GRAPHICS, fromTime, toTime, maximumFrequency, garnish);
522 	GRAPHICS_EACH_END
523 }
524 
525 // MARK: Query
526 
527 FORM (REAL_FormantTier_getValueAtTime, U"FormantTier: Get value", U"FormantTier: Get value at time...") {
528 	NATURAL (formantNumber, U"Formant number", U"1")
529 	REAL (time, U"Time (s)", U"0.5")
530 	OK
531 DO
532 	QUERY_ONE_FOR_REAL (FormantTier)
533 		double result = FormantTier_getValueAtTime (me, formantNumber, time);
534 	QUERY_ONE_FOR_REAL_END (U" Hz")
535 }
536 
537 FORM (REAL_FormantTier_getBandwidthAtTime, U"FormantTier: Get bandwidth", U"FormantTier: Get bandwidth at time...") {
538 	NATURAL (formantNumber, U"Formant number", U"1")
539 	REAL (time, U"Time (s)", U"0.5")
540 	OK
541 DO
542 	QUERY_ONE_FOR_REAL (FormantTier)
543 		double result = FormantTier_getBandwidthAtTime (me, formantNumber, time);
544 	QUERY_ONE_FOR_REAL_END (U" Hz")
545 }
546 
547 // MARK: Modify
548 
549 FORM (MODIFY_FormantTier_addPoint, U"Add one point", U"FormantTier: Add point...") {
550 	REAL (time, U"Time (s)", U"0.5")
551 	TEXTFIELD (formantBandwidthPairs, U"Frequencies and bandwidths (Hz)", U"500 50 1500 100 2500 150 3500 200 4500 300", 5)
552 	OK
553 DO
554 	autoFormantPoint point = FormantPoint_create (time, 10);
555 	double *f = & point -> formant [0], *b = & point -> bandwidth [0];
556 	conststring8 fbpairs = Melder_peek32to8 (formantBandwidthPairs);
557 	int numberOfFormants = sscanf (fbpairs, "%lf%lf%lf%lf%lf%lf%lf%lf%lf%lf%lf%lf%lf%lf%lf%lf%lf%lf%lf%lf",
558 		f+1, b+1, f+2, b+2, f+3, b+3, f+4, b+4, f+5, b+5, f+6, b+6, f+7, b+7, f+8, b+8, f+9, b+9, f+10, b+10) / 2;
559 	Melder_require (numberOfFormants >= 1,
560 		U"The number of formant-bandwidth pairs must be at least 1.");
561 	point -> numberOfFormants = numberOfFormants;
562 	MODIFY_EACH (FormantTier)
563 		autoFormantPoint point2 = Data_copy (point.get());
564 		AnyTier_addPoint_move (me->asAnyTier(), point2.move());
565 	MODIFY_EACH_END
566 }
567 
568 // MARK: Convert
569 
570 FORM (NEW_FormantTier_downto_TableOfReal, U"Down to TableOfReal", nullptr) {
571 	BOOLEAN (includeFormants, U"Include formants", true)
572 	BOOLEAN (includeBandwidths, U"Include bandwidths", false)
573 	OK
574 DO
575 	CONVERT_EACH_TO_ONE (FormantTier)
576 		autoTableOfReal result = FormantTier_downto_TableOfReal (me, includeFormants, includeBandwidths);
577 	CONVERT_EACH_TO_ONE_END (my name.get())
578 }
579 
580 // MARK: - FORMANTTIER & SOUND
581 
582 DIRECT (NEW1_Sound_FormantTier_filter) {
583 	CONVERT_ONE_AND_ONE_TO_ONE (Sound, FormantTier)
584 		autoSound result = Sound_FormantTier_filter (me, you);
585 	CONVERT_ONE_AND_ONE_TO_ONE_END (my name.get(), U"_filt")
586 }
587 
588 DIRECT (NEW1_Sound_FormantTier_filter_noscale) {
589 	CONVERT_ONE_AND_ONE_TO_ONE (Sound, FormantTier)
590 		autoSound result = Sound_FormantTier_filter_noscale (me, you);
591 	CONVERT_ONE_AND_ONE_TO_ONE_END (my name.get(), U"_filt")
592 }
593 
594 // MARK: - INTENSITYTIER
595 
596 // MARK: New
597 
598 FORM (NEW1_IntensityTier_create, U"Create empty IntensityTier", nullptr) {
599 	WORD (name, U"Name", U"empty")
600 	REAL (startTime, U"Start time (s)", U"0.0")
601 	REAL (endTime, U"End time (s)", U"1.0")
602 	OK
603 DO
604 	Melder_require (endTime > startTime,
605 		U"Your end time should be greater than your start time.");
606 	CREATE_ONE
607 		autoIntensityTier result = IntensityTier_create (startTime, endTime);
608 	CREATE_ONE_END (name)
609 }
610 
611 // MARK: Help
612 
613 DIRECT (HELP_IntensityTier_help) {
614 	HELP (U"IntensityTier")
615 }
616 
617 // MARK: View & Edit
618 
619 DIRECT (EDITOR_ONE_WITH_ONE_IntensityTier_viewAndEdit) {
620 	EDITOR_ONE_WITH_ONE (an,IntensityTier, Sound)   // Sound may be null
621 		autoIntensityTierEditor editor = IntensityTierEditor_create (ID_AND_FULL_NAME, me, you, true);
622 	EDITOR_ONE_WITH_ONE_END
623 }
624 
625 DIRECT (HINT_IntensityTier_Sound_viewAndEdit) {
626 	INFO_NONE
627 		Melder_information (U"To include a copy of a Sound in your IntensityTier window:\n"
628 			"   select an IntensityTier and a Sound, and click \"View & Edit\".");
629 	INFO_NONE_END
630 }
631 
632 // MARK: Query
633 
634 FORM (REAL_IntensityTier_getValueAtTime, U"Get IntensityTier value", U"IntensityTier: Get value at time...") {
635 	REAL (time, U"Time (s)", U"0.5")
636 	OK
637 DO
638 	QUERY_ONE_FOR_REAL (IntensityTier)
639 		const double result = RealTier_getValueAtTime (me, time);
640 	QUERY_ONE_FOR_REAL_END (U" dB")
641 }
642 
643 FORM (REAL_IntensityTier_getValueAtIndex, U"Get IntensityTier value", U"IntensityTier: Get value at index...") {
644 	INTEGER (pointNumber, U"Point number", U"10")
645 	OK
646 DO
647 	QUERY_ONE_FOR_REAL (IntensityTier)
648 		const double result = RealTier_getValueAtIndex (me, pointNumber);
649 	QUERY_ONE_FOR_REAL_END (U" dB")
650 }
651 
652 // MARK: Modify
653 
654 FORM (MODIFY_IntensityTier_addPoint, U"Add one point", U"IntensityTier: Add point...") {
655 	REAL (time, U"Time (s)", U"0.5")
656 	REAL (intensity, U"Intensity (dB)", U"75")
657 	OK
658 DO
659 	MODIFY_EACH (IntensityTier)
660 		RealTier_addPoint (me, time, intensity);
661 	MODIFY_EACH_END
662 }
663 
664 FORM (MODIFY_IntensityTier_formula, U"IntensityTier: Formula", U"IntensityTier: Formula...") {
665 	LABEL (U"# ncol = the number of points")
666 	LABEL (U"for col from 1 to ncol")
667 	LABEL (U"   # x = the time of the colth point, in seconds")
668 	LABEL (U"   # self = the value of the colth point, in dB")
669 	LABEL (U"   self = `formula`")
670 	LABEL (U"endfor")
671 	FORMULA (formula, U"Formula", U"self + 3.0")
672 	OK
673 DO
674 	MODIFY_EACH_WEAK (IntensityTier)
675 		RealTier_formula (me, formula, interpreter, nullptr);
676 	MODIFY_EACH_WEAK_END
677 }
678 
679 // MARK: Convert
680 
681 DIRECT (NEW_IntensityTier_downto_PointProcess) {
682 	CONVERT_EACH_TO_ONE (IntensityTier)
683 		autoPointProcess result = AnyTier_downto_PointProcess (me->asAnyTier());
684 	CONVERT_EACH_TO_ONE_END (my name.get())
685 }
686 
687 DIRECT (NEW_IntensityTier_downto_RealTier) {
688 	CONVERT_EACH_TO_ONE (IntensityTier)
689 		autoRealTier result = AnyRealTier_downto_RealTier (me);
690 	CONVERT_EACH_TO_ONE_END (my name.get())
691 }
692 
693 DIRECT (NEW_IntensityTier_downto_TableOfReal) {
694 	CONVERT_EACH_TO_ONE (IntensityTier)
695 		autoTableOfReal result = IntensityTier_downto_TableOfReal (me);
696 	CONVERT_EACH_TO_ONE_END (my name.get())
697 }
698 
699 DIRECT (NEW_IntensityTier_to_AmplitudeTier) {
700 	CONVERT_EACH_TO_ONE (IntensityTier)
701 		autoAmplitudeTier result = IntensityTier_to_AmplitudeTier (me);
702 	CONVERT_EACH_TO_ONE_END (my name.get())
703 }
704 
705 // MARK: - INTENSITYTIER & POINTPROCESS
706 
707 DIRECT (NEW1_IntensityTier_PointProcess_to_IntensityTier) {
708 	CONVERT_ONE_AND_ONE_TO_ONE (IntensityTier, PointProcess)
709 		autoIntensityTier result = IntensityTier_PointProcess_to_IntensityTier (me, you);
710 	CONVERT_ONE_AND_ONE_TO_ONE_END (my name.get())
711 }
712 
713 // MARK: - INTENSITYTIER & SOUND
714 
715 DIRECT (NEW1_Sound_IntensityTier_multiply_old) {
716 	CONVERT_ONE_AND_ONE_TO_ONE (Sound, IntensityTier)
717 		autoSound result = Sound_IntensityTier_multiply (me, you, true);
718 	CONVERT_ONE_AND_ONE_TO_ONE_END (my name.get(), U"_int")
719 }
720 
721 FORM (NEW1_Sound_IntensityTier_multiply, U"Sound & IntervalTier: Multiply", nullptr) {
722 	BOOLEAN (scaleTo09, U"Scale to 0.9", true)
723 	OK
724 DO
725 	CONVERT_ONE_AND_ONE_TO_ONE (Sound, IntensityTier)
726 		autoSound result = Sound_IntensityTier_multiply (me, you, scaleTo09);
727 	CONVERT_ONE_AND_ONE_TO_ONE_END (my name.get(), U"_int")
728 }
729 
730 // MARK: - PITCHTIER
731 
732 FORM (MODIFY_PitchTier_addPoint, U"PitchTier: Add point", U"PitchTier: Add point...") {
733 	REAL (time, U"Time (s)", U"0.5")
734 	REAL (pitch, U"Pitch (Hz)", U"200.0")
735 	OK
736 DO
737 	MODIFY_EACH (PitchTier)
738 		RealTier_addPoint (me, time, pitch);
739 	MODIFY_EACH_END
740 }
741 
742 FORM (NEW1_PitchTier_create, U"Create empty PitchTier", nullptr) {
743 	WORD (name, U"Name", U"empty")
744 	REAL (startTime, U"Start time (s)", U"0.0")
745 	REAL (endTime, U"End time (s)", U"1.0")
746 	OK
747 DO
748 	Melder_require (endTime > startTime,
749 		U"Your end time should be greater than your start time.");
750 	CREATE_ONE
751 		autoPitchTier result = PitchTier_create (startTime, endTime);
752 	CREATE_ONE_END (name)
753 }
754 
755 DIRECT (NEW_PitchTier_downto_PointProcess) {
756 	CONVERT_EACH_TO_ONE (PitchTier)
757 		autoPointProcess result = AnyTier_downto_PointProcess (me->asAnyTier());
758 	CONVERT_EACH_TO_ONE_END (my name.get())
759 }
760 
761 DIRECT (NEW_PitchTier_downto_RealTier) {
762 	CONVERT_EACH_TO_ONE (RealTier)
763 		autoRealTier result = AnyRealTier_downto_RealTier (me);
764 	CONVERT_EACH_TO_ONE_END (my name.get())
765 }
766 
767 FORM (NEW_PitchTier_downto_TableOfReal, U"PitchTier: Down to TableOfReal", nullptr) {
768 	RADIOx (unit, U"Unit", 1, 0)
769 		RADIOBUTTON (U"Hertz")
770 		RADIOBUTTON (U"semitones")
771 	OK
772 DO
773 	CONVERT_EACH_TO_ONE (PitchTier)
774 		autoTableOfReal result = PitchTier_downto_TableOfReal (me, unit);
775 	CONVERT_EACH_TO_ONE_END (my name.get())
776 }
777 
778 FORM (GRAPHICS_old_PitchTier_draw, U"PitchTier: Draw", nullptr) {
779 	praat_TimeFunction_RANGE (fromTime, toTime)
780 	REAL (fromFrequency, U"left Frequency range (Hz)", U"0.0")
781 	POSITIVE (toFrequency, U"right Frequency range (Hz)", U"500.0")
782 	BOOLEAN (garnish, U"Garnish", true)
783 	OK
784 DO
785 	Melder_require (toFrequency > fromFrequency,
786 		U"Your maximum frequency should be greater than your minimum frequency.");
787 	GRAPHICS_EACH (PitchTier)
788 		PitchTier_draw (me, GRAPHICS, fromTime, toTime, fromFrequency, toFrequency,
789 			garnish, U"lines and speckles");
790 	GRAPHICS_EACH_END
791 }
792 
793 FORM (GRAPHICS_PitchTier_draw, U"PitchTier: Draw", nullptr) {
794 	praat_TimeFunction_RANGE (fromTime, toTime)
795 	REAL (fromFrequency, U"left Frequency range (Hz)", U"0.0")
796 	POSITIVE (toFrequency, U"right Frequency range (Hz)", U"500.0")
797 	BOOLEAN (garnish, U"Garnish", true)
798 	LABEL (U"")
799 	OPTIONMENUSTR (drawingMethod, U"Drawing method", 1)
800 		OPTION (U"lines")
801 		OPTION (U"speckles")
802 		OPTION (U"lines and speckles")
803 	OK
804 DO_ALTERNATIVE (GRAPHICS_old_PitchTier_draw)
805 	Melder_require (toFrequency > fromFrequency,
806 		U"Your maximum frequency should be greater than your minimum frequency.");
807 	GRAPHICS_EACH (PitchTier)
808 		PitchTier_draw (me, GRAPHICS, fromTime, toTime, fromFrequency, toFrequency, garnish, drawingMethod);
809 	GRAPHICS_EACH_END
810 }
811 
812 DIRECT (EDITOR_ONE_WITH_ONE_PitchTier_viewAndEdit) {
813 	EDITOR_ONE_WITH_ONE (a,PitchTier, Sound)   // Sound may be null
814 		autoPitchTierEditor editor = PitchTierEditor_create (ID_AND_FULL_NAME, me, you, true);
815 	EDITOR_ONE_WITH_ONE_END
816 }
817 
818 FORM (MODIFY_PitchTier_formula, U"PitchTier: Formula", U"PitchTier: Formula...") {
819 	LABEL (U"# ncol = the number of points")
820 	LABEL (U"for col from 1 to ncol")
821 	LABEL (U"   # x = the time of the colth point, in seconds")
822 	LABEL (U"   # self = the value of the colth point, in hertz")
823 	LABEL (U"   self = `formula`")
824 	LABEL (U"endfor")
825 	FORMULA (formula, U"Formula", U"self * 2 ; one octave up")
826 	OK
827 DO
828 	MODIFY_EACH_WEAK (PitchTier)
829 		RealTier_formula (me, formula, interpreter, nullptr);
830 	MODIFY_EACH_WEAK_END
831 }
832 
833 FORM (REAL_PitchTier_getMean_curve, U"PitchTier: Get mean (curve)", U"PitchTier: Get mean (curve)...") {
834 	praat_TimeFunction_RANGE (fromTime, toTime)
835 	OK
836 DO
837 	QUERY_ONE_FOR_REAL (PitchTier)
838 		double result = RealTier_getMean_curve (me, fromTime, toTime);
839 	QUERY_ONE_FOR_REAL_END (U" Hz")
840 }
841 
842 FORM (REAL_PitchTier_getMean_points, U"PitchTier: Get mean (points)", U"PitchTier: Get mean (points)...") {
843 	praat_TimeFunction_RANGE (fromTime, toTime)
844 	OK
845 DO
846 	QUERY_ONE_FOR_REAL (PitchTier)
847 		double result = RealTier_getMean_points (me, fromTime, toTime);
848 	QUERY_ONE_FOR_REAL_END (U" Hz")
849 }
850 
851 FORM (REAL_PitchTier_getStandardDeviation_curve, U"PitchTier: Get standard deviation (curve)", U"PitchTier: Get standard deviation (curve)...") {
852 	praat_TimeFunction_RANGE (fromTime, toTime)
853 	OK
854 DO
855 	QUERY_ONE_FOR_REAL (PitchTier)
856 		double result = RealTier_getStandardDeviation_curve (me, fromTime, toTime);
857 	QUERY_ONE_FOR_REAL_END (U" Hz")
858 }
859 
860 FORM (REAL_PitchTier_getStandardDeviation_points, U"PitchTier: Get standard deviation (points)", U"PitchTier: Get standard deviation (points)...") {
861 	praat_TimeFunction_RANGE (fromTime, toTime)
862 	OK
863 DO
864 	QUERY_ONE_FOR_REAL (PitchTier)
865 		double result = RealTier_getStandardDeviation_points (me, fromTime, toTime);
866 	QUERY_ONE_FOR_REAL_END (U" Hz")
867 }
868 
869 FORM (REAL_PitchTier_getValueAtTime, U"PitchTier: Get value at time", U"PitchTier: Get value at time...") {
870 	REAL (time, U"Time (s)", U"0.5")
871 	OK
872 DO
873 	QUERY_ONE_FOR_REAL (PitchTier)
874 		double result = RealTier_getValueAtTime (me, time);
875 	QUERY_ONE_FOR_REAL_END (U" Hz")
876 }
877 
878 FORM (REAL_PitchTier_getValueAtIndex, U"PitchTier: Get value at index", U"PitchTier: Get value at index...") {
879 	INTEGER (pointNumber, U"Point number", U"10")
880 	OK
881 DO
882 	QUERY_ONE_FOR_REAL (PitchTier)
883 		double result = RealTier_getValueAtIndex (me, pointNumber);
884 	QUERY_ONE_FOR_REAL_END (U" Hz")
885 }
886 
887 DIRECT (HELP_PitchTier_help) {
888 	HELP (U"PitchTier")
889 }
890 
891 DIRECT (PLAY_PitchTier_hum) {
892 	PLAY_EACH (PitchTier)
893 		PitchTier_hum (me);
894 	PLAY_EACH_END
895 }
896 
897 FORM (MODIFY_PitchTier_interpolateQuadratically, U"PitchTier: Interpolate quadratically", nullptr) {
898 	NATURAL (numberOfPointsPerParabola, U"Number of points per parabola", U"4")
899 	RADIOx (unit, U"Unit", 2, 0)
900 		RADIOBUTTON (U"Hz")
901 		RADIOBUTTON (U"semitones")
902 	OK
903 DO
904 	MODIFY_EACH (PitchTier)
905 		RealTier_interpolateQuadratically (me, numberOfPointsPerParabola, unit);
906 	MODIFY_EACH_END
907 }
908 
909 DIRECT (PLAY_PitchTier_play) {
910 	PLAY_EACH (PitchTier)
911 		PitchTier_play (me);
912 	PLAY_EACH_END
913 }
914 
915 DIRECT (PLAY_PitchTier_playSine) {
916 	PLAY_EACH (PitchTier)
917 		PitchTier_playPart_sine (me, 0.0, 0.0);
918 	PLAY_EACH_END
919 }
920 
921 FORM (MODIFY_PitchTier_shiftFrequencies, U"PitchTier: Shift frequencies", nullptr) {
922 	REAL (fromTime, U"left Time range (s)", U"0.0")
923 	REAL (toTime, U"right Time range (s)", U"1000.0")
924 	REAL (frequencyShift, U"Frequency shift", U"-20.0")
925 	OPTIONMENU (unit_i, U"Unit", 1)
926 		OPTION (U"Hertz")
927 		OPTION (U"mel")
928 		OPTION (U"logHertz")
929 		OPTION (U"semitones")
930 		OPTION (U"ERB")
931 	OK
932 DO
933 	kPitch_unit unit =
934 		unit_i == 1 ? kPitch_unit::HERTZ :
935 		unit_i == 2 ? kPitch_unit::MEL :
936 		unit_i == 3 ? kPitch_unit::LOG_HERTZ :
937 		unit_i == 4 ? kPitch_unit::SEMITONES_1 :
938 		kPitch_unit::ERB;
939 	MODIFY_EACH_WEAK (PitchTier)
940 		PitchTier_shiftFrequencies (me, fromTime, toTime, frequencyShift, unit);
941 	MODIFY_EACH_WEAK_END
942 }
943 
944 FORM (MODIFY_PitchTier_multiplyFrequencies, U"PitchTier: Multiply frequencies", nullptr){
945 	REAL (fromTime, U"left Time range (s)", U"0.0")
946 	REAL (toTime, U"right Time range (s)", U"1000.0")
947 	POSITIVE (factor, U"Factor", U"1.2")
948 	OK
949 DO
950 	MODIFY_EACH (PitchTier)
951 		PitchTier_multiplyFrequencies (me, fromTime, toTime, factor);
952 	MODIFY_EACH_END
953 }
954 
955 FORM (MODIFY_PitchTier_stylize, U"PitchTier: Stylize", U"PitchTier: Stylize...") {
956 	REAL (frequencyResolution, U"Frequency resolution", U"4.0")
957 	RADIOx (unit, U"Unit", 2, 0)
958 		RADIOBUTTON (U"Hz")
959 		RADIOBUTTON (U"semitones")
960 	OK
961 DO
962 	MODIFY_EACH (PitchTier)
963 		PitchTier_stylize (me, frequencyResolution, unit);
964 	MODIFY_EACH_END
965 }
966 
967 DIRECT (NEW_PitchTier_to_PointProcess) {
968 	CONVERT_EACH_TO_ONE (PitchTier)
969 		autoPointProcess result = PitchTier_to_PointProcess (me);
970 	CONVERT_EACH_TO_ONE_END (my name.get())
971 }
972 
973 FORM (NEW_PitchTier_to_Sound_phonation, U"PitchTier: To Sound (phonation)", nullptr) {
974 	POSITIVE (samplingFrequency, U"Sampling frequency (Hz)", U"44100")
975 	POSITIVE (adaptationFactor, U"Adaptation factor", U"1.0")
976 	POSITIVE (maximumPeriod, U"Maximum period (s)", U"0.05")
977 	POSITIVE (openPhase, U"Open phase", U"0.7")
978 	REAL (collisionPhase, U"Collision phase", U"0.03")
979 	POSITIVE (power1, U"Power 1", U"3.0")
980 	POSITIVE (power2, U"Power 2", U"4.0")
981 	BOOLEAN (hum, U"Hum", false)
982 	OK
983 DO
984 	CONVERT_EACH_TO_ONE (PitchTier)
985 		autoSound result = PitchTier_to_Sound_phonation (me, samplingFrequency,
986 			adaptationFactor, maximumPeriod, openPhase, collisionPhase, power1, power2, hum);
987 	CONVERT_EACH_TO_ONE_END (my name.get())
988 }
989 
990 FORM (NEW_PitchTier_to_Sound_pulseTrain, U"PitchTier: To Sound (pulse train)", nullptr) {
991 	POSITIVE (samplingFrequency, U"Sampling frequency (Hz)", U"44100")
992 	POSITIVE (adaptationFactor, U"Adaptation factor", U"1.0")
993 	POSITIVE (adaptationTime, U"Adaptation time", U"0.05")
994 	NATURAL (interpolationDepth, U"Interpolation depth (samples)", U"2000")
995 	BOOLEAN (hum, U"Hum", false)
996 	OK
997 DO
998 	CONVERT_EACH_TO_ONE (PitchTier)
999 		autoSound result = PitchTier_to_Sound_pulseTrain (me, samplingFrequency,
1000 			adaptationFactor, adaptationTime, interpolationDepth, hum);
1001 	CONVERT_EACH_TO_ONE_END (my name.get())
1002 }
1003 
1004 FORM (NEW_PitchTier_to_Sound_sine, U"PitchTier: To Sound (sine)", nullptr) {
1005 	POSITIVE (samplingFrequency, U"Sampling frequency (Hz)", U"44100.0")
1006 	OK
1007 DO
1008 	CONVERT_EACH_TO_ONE (PitchTier)
1009 		autoSound result = PitchTier_to_Sound_sine (me, 0.0, 0.0, samplingFrequency);
1010 	CONVERT_EACH_TO_ONE_END (my name.get())
1011 }
1012 
1013 DIRECT (HINT_PitchTier_Sound_viewAndEdit) {
1014 	INFO_NONE
1015 		Melder_information (U"To include a copy of a Sound in your PitchTier window:\n"
1016 			"   select a PitchTier and a Sound, and click \"View & Edit\".");
1017 	INFO_NONE_END
1018 }
1019 
1020 FORM_SAVE (SAVE_PitchTier_writeToPitchTierSpreadsheetFile, U"Save PitchTier as spreadsheet", nullptr, U"PitchTier") {
1021 	SAVE_ONE (PitchTier)
1022 		PitchTier_writeToPitchTierSpreadsheetFile (me, file);
1023 	SAVE_ONE_END
1024 }
1025 
1026 FORM_SAVE (SAVE_PitchTier_writeToHeaderlessSpreadsheetFile, U"Save PitchTier as spreadsheet", nullptr, U"txt") {
1027 	SAVE_ONE (PitchTier)
1028 		PitchTier_writeToHeaderlessSpreadsheetFile (me, file);
1029 	SAVE_ONE_END
1030 }
1031 
1032 DIRECT (INFO_PitchTier_Manipulation_replace) {
1033 	INFO_NONE
1034 		Melder_information (U"To replace the PitchTier in a Manipulation object,\n"
1035 			"select a PitchTier object and a Manipulation object\nand choose \"Replace pitch\".");
1036 	INFO_NONE_END
1037 }
1038 
1039 // MARK: - PITCHTIER & POINTPROCESS
1040 
1041 DIRECT (NEW1_PitchTier_PointProcess_to_PitchTier) {
1042 	CONVERT_ONE_AND_ONE_TO_ONE (PitchTier, PointProcess)
1043 		autoPitchTier result = PitchTier_PointProcess_to_PitchTier (me, you);
1044 	CONVERT_ONE_AND_ONE_TO_ONE_END (my name.get())
1045 }
1046 
1047 // MARK: - POINTPROCESS
1048 
1049 FORM (MODIFY_PointProcess_addPoint, U"PointProcess: Add point", U"PointProcess: Add point...") {
1050 	REAL (time, U"Time (s)", U"0.5")
1051 	OK
1052 DO
1053 	MODIFY_EACH (PointProcess)
1054 		PointProcess_addPoint (me, time);
1055 	MODIFY_EACH_END
1056 }
1057 
1058 FORM (MODIFY_PointProcess_addPoints, U"PointProcess: Add points", U"PointProcess: Add point...") {
1059 	REALVECTOR (times, U"Times", WHITESPACE_SEPARATED_, U"0.1 0.2 0.5")
1060 	OK
1061 DO
1062 	MODIFY_EACH (PointProcess)
1063 		PointProcess_addPoints (me, times);
1064 	MODIFY_EACH_END
1065 }
1066 
1067 FORM (NEW1_PointProcess_createEmpty, U"Create an empty PointProcess", U"Create empty PointProcess...") {
1068 	WORD (name, U"Name", U"empty")
1069 	REAL (startTime, U"Start time (s)", U"0.0")
1070 	REAL (endTime, U"End time (s)", U"1.0")
1071 	OK
1072 DO
1073 	Melder_require (endTime >= startTime,
1074 		U"Your end time (", endTime, U") should not be less than your start time (", startTime, U").");
1075 	CREATE_ONE
1076 		autoPointProcess result = PointProcess_create (startTime, endTime, 0);
1077 	CREATE_ONE_END (name)
1078 }
1079 
1080 FORM (NEW1_PointProcess_createPoissonProcess, U"Create Poisson process", U"Create Poisson process...") {
1081 	WORD (name, U"Name", U"poisson")
1082 	REAL (startTime, U"Start time (s)", U"0.0")
1083 	REAL (endTime, U"End time (s)", U"1.0")
1084 	POSITIVE (density, U"Density (/s)", U"100.0")
1085 	OK
1086 DO
1087 	Melder_require (endTime >= startTime,
1088 		U"Your end time (", endTime, U") should not be less than your start time (", startTime, U").");
1089 	CREATE_ONE
1090 		autoPointProcess result = PointProcess_createPoissonProcess (startTime, endTime, density);
1091 	CREATE_ONE_END (name)
1092 }
1093 
1094 DIRECT (NEW1_PointProcesses_difference) {
1095 	CONVERT_TWO_TO_ONE (PointProcess)
1096 		autoPointProcess result = PointProcesses_difference (me, you);
1097 	CONVERT_TWO_TO_ONE_END (U"difference")
1098 }
1099 
1100 FORM (GRAPHICS_PointProcess_draw, U"PointProcess: Draw", nullptr) {
1101 	praat_TimeFunction_RANGE (fromTime, toTime)
1102 	BOOLEAN (garnish, U"Garnish", true)
1103 	OK
1104 DO
1105 	GRAPHICS_EACH (PointProcess)
1106 		PointProcess_draw (me, GRAPHICS, fromTime, toTime, garnish);
1107 	GRAPHICS_EACH_END
1108 }
1109 
1110 DIRECT (EDITOR_ONE_WITH_ONE_PointProcess_viewAndEdit) {
1111 	EDITOR_ONE_WITH_ONE (a,PointProcess, Sound)   // Sound may be null
1112 		autoPointEditor editor = PointEditor_create (ID_AND_FULL_NAME, me, you);
1113 	EDITOR_ONE_WITH_ONE_END
1114 }
1115 
1116 FORM (MODIFY_PointProcess_fill, U"PointProcess: Fill", nullptr) {
1117 	praat_TimeFunction_RANGE (fromTime, toTime)
1118 	POSITIVE (period, U"Period (s)", U"0.01")
1119 	OK
1120 DO
1121 	MODIFY_EACH_WEAK (PointProcess)
1122 		PointProcess_fill (me, fromTime, toTime, period);
1123 	MODIFY_EACH_WEAK_END
1124 }
1125 
1126 FORM (REAL_PointProcess_getInterval, U"PointProcess: Get interval", U"PointProcess: Get interval...") {
1127 	REAL (time, U"Time (s)", U"0.5")
1128 	OK
1129 DO
1130 	QUERY_ONE_FOR_REAL (PointProcess)
1131 		double result = PointProcess_getInterval (me, time);
1132 	QUERY_ONE_FOR_REAL_END (U" seconds")
1133 }
1134 
1135 #define dia_PointProcess_getRangeProperty(fromTime,toTime,shortestPeriod,longestPeriod,maximumPeriodfactor) \
1136 	praat_TimeFunction_RANGE (fromTime, toTime) \
1137 	REAL (shortestPeriod, U"Shortest period (s)", U"0.0001") \
1138 	REAL (longestPeriod, U"Longest period (s)", U"0.02") \
1139 	POSITIVE (maximumPeriodFactor, U"Maximum period factor", U"1.3")
1140 
1141 FORM (REAL_PointProcess_getJitter_local, U"PointProcess: Get jitter (local)", U"PointProcess: Get jitter (local)...") {
1142 	dia_PointProcess_getRangeProperty (fromTime, toTime, shortestPeriod, longestPeriod, maximumPeriodfactor)
1143 	OK
1144 DO
1145 	QUERY_ONE_FOR_REAL (PointProcess)
1146 		double result = PointProcess_getJitter_local (me, fromTime, toTime,
1147 			shortestPeriod, longestPeriod, maximumPeriodFactor);
1148 	QUERY_ONE_FOR_REAL_END (U" (local jitter)")
1149 }
1150 
1151 FORM (REAL_PointProcess_getJitter_local_absolute, U"PointProcess: Get jitter (local, absolute)", U"PointProcess: Get jitter (local, absolute)...") {
1152 	dia_PointProcess_getRangeProperty (fromTime, toTime, shortestPeriod, longestPeriod, maximumPeriodfactor)
1153 	OK
1154 DO
1155 	QUERY_ONE_FOR_REAL (PointProcess)
1156 		double result = PointProcess_getJitter_local_absolute (me, fromTime, toTime,
1157 			shortestPeriod, longestPeriod, maximumPeriodFactor);
1158 	QUERY_ONE_FOR_REAL_END (U" seconds (local absolute jitter)")
1159 }
1160 
1161 FORM (REAL_PointProcess_getJitter_rap, U"PointProcess: Get jitter (rap)", U"PointProcess: Get jitter (rap)...") {
1162 	dia_PointProcess_getRangeProperty (fromTime, toTime, shortestPeriod, longestPeriod, maximumPeriodfactor)
1163 	OK
1164 DO
1165 	QUERY_ONE_FOR_REAL (PointProcess)
1166 		double result = PointProcess_getJitter_rap (me, fromTime, toTime,
1167 			shortestPeriod, longestPeriod, maximumPeriodFactor);
1168 	QUERY_ONE_FOR_REAL_END (U" (rap jitter)")
1169 }
1170 
1171 FORM (REAL_PointProcess_getJitter_ppq5, U"PointProcess: Get jitter (ppq5)", U"PointProcess: Get jitter (ppq5)...") {
1172 	dia_PointProcess_getRangeProperty (fromTime, toTime, shortestPeriod, longestPeriod, maximumPeriodfactor)
1173 	OK
1174 DO
1175 	QUERY_ONE_FOR_REAL (PointProcess)
1176 		double result = PointProcess_getJitter_ppq5 (me, fromTime, toTime,
1177 			shortestPeriod, longestPeriod, maximumPeriodFactor);
1178 	QUERY_ONE_FOR_REAL_END (U" (ppq5 jitter)")
1179 }
1180 
1181 FORM (REAL_PointProcess_getJitter_ddp, U"PointProcess: Get jitter (ddp)", U"PointProcess: Get jitter (ddp)...") {
1182 	dia_PointProcess_getRangeProperty (fromTime, toTime, shortestPeriod, longestPeriod, maximumPeriodfactor)
1183 	OK
1184 DO
1185 	QUERY_ONE_FOR_REAL (PointProcess)
1186 		double result = PointProcess_getJitter_ddp (me, fromTime, toTime,
1187 			shortestPeriod, longestPeriod, maximumPeriodFactor);
1188 	QUERY_ONE_FOR_REAL_END (U" (ddp jitter)")
1189 }
1190 
1191 FORM (REAL_PointProcess_getMeanPeriod, U"PointProcess: Get mean period", U"PointProcess: Get mean period...") {
1192 	dia_PointProcess_getRangeProperty (fromTime, toTime, shortestPeriod, longestPeriod, maximumPeriodfactor)
1193 	OK
1194 DO
1195 	QUERY_ONE_FOR_REAL (PointProcess)
1196 		double result = PointProcess_getMeanPeriod (me, fromTime, toTime,
1197 			shortestPeriod, longestPeriod, maximumPeriodFactor);
1198 	QUERY_ONE_FOR_REAL_END (U" seconds (mean period)")
1199 }
1200 
1201 FORM (REAL_PointProcess_getStdevPeriod, U"PointProcess: Get stdev period", U"PointProcess: Get stdev period...") {
1202 	dia_PointProcess_getRangeProperty (fromTime, toTime, shortestPeriod, longestPeriod, maximumPeriodfactor)
1203 	OK
1204 DO
1205 	QUERY_ONE_FOR_REAL (PointProcess)
1206 		double result = PointProcess_getStdevPeriod (me, fromTime, toTime,
1207 			shortestPeriod, longestPeriod, maximumPeriodFactor);
1208 	QUERY_ONE_FOR_REAL_END (U" (stdev period)")
1209 }
1210 
1211 FORM (INTEGER_PointProcess_getLowIndex, U"PointProcess: Get low index", U"PointProcess: Get low index...") {
1212 	REAL (time, U"Time (s)", U"0.5")
1213 	OK
1214 DO
1215 	QUERY_ONE_FOR_REAL (PointProcess)
1216 		integer result = PointProcess_getLowIndex (me, time);
1217 	QUERY_ONE_FOR_REAL_END (U" (low index)")
1218 }
1219 
1220 FORM (INTEGER_PointProcess_getHighIndex, U"PointProcess: Get high index", U"PointProcess: Get high index...") {
1221 	REAL (time, U"Time (s)", U"0.5")
1222 	OK
1223 DO
1224 	QUERY_ONE_FOR_REAL (PointProcess)
1225 		integer result = PointProcess_getHighIndex (me, time);
1226 	QUERY_ONE_FOR_REAL_END (U" (high index)")
1227 }
1228 
1229 FORM (INTEGER_PointProcess_getNearestIndex, U"PointProcess: Get nearest index", U"PointProcess: Get nearest index...") {
1230 	REAL (time, U"Time (s)", U"0.5")
1231 	OK
1232 DO
1233 	QUERY_ONE_FOR_REAL (PointProcess)
1234 		integer result = PointProcess_getNearestIndex (me, time);
1235 	QUERY_ONE_FOR_REAL_END (U" (nearest index)")
1236 }
1237 
1238 DIRECT (INTEGER_PointProcess_getNumberOfPoints) {
1239 	QUERY_ONE_FOR_REAL (PointProcess)
1240 		integer result = my nt;
1241 	QUERY_ONE_FOR_REAL_END (U" points")
1242 }
1243 
1244 FORM (INTEGER_PointProcess_getNumberOfPeriods, U"PointProcess: Get number of periods", U"PointProcess: Get number of periods...") {
1245 	dia_PointProcess_getRangeProperty (fromTime, toTime, shortestPeriod, longestPeriod, maximumPeriodfactor)
1246 	OK
1247 DO
1248 	QUERY_ONE_FOR_REAL (PointProcess)
1249 		integer result = PointProcess_getNumberOfPeriods (me, fromTime, toTime,
1250 			shortestPeriod, longestPeriod, maximumPeriodFactor);
1251 	QUERY_ONE_FOR_REAL_END (U" periods")
1252 }
1253 
1254 FORM (REAL_PointProcess_getTimeFromIndex, U"Get time", 0 /*"PointProcess: Get time from index..."*/) {
1255 	NATURAL (pointNumber, U"Point number", U"10")
1256 	OK
1257 DO
1258 	QUERY_ONE_FOR_REAL (PointProcess)
1259 		const double result =
1260 			pointNumber > my nt ? undefined : my t [pointNumber];
1261 	QUERY_ONE_FOR_REAL_END (U" seconds")
1262 }
1263 
1264 DIRECT (HELP_PointProcess_help) {
1265 	HELP (U"PointProcess")
1266 }
1267 
1268 DIRECT (PLAY_PointProcess_hum) {
1269 	PLAY_EACH (PointProcess)
1270 		PointProcess_hum (me, my xmin, my xmax);
1271 	PLAY_EACH_END
1272 }
1273 
1274 DIRECT (NEW1_PointProcesses_intersection) {
1275 	CONVERT_TWO_TO_ONE (PointProcess)
1276 		autoPointProcess result = PointProcesses_intersection (me, you);
1277 	CONVERT_TWO_TO_ONE_END (U"intersection")
1278 }
1279 
1280 DIRECT (PLAY_PointProcess_play) {
1281 	PLAY_EACH (PointProcess)
1282 		PointProcess_play (me);
1283 	PLAY_EACH_END
1284 }
1285 
1286 FORM (MODIFY_PointProcess_removePoint, U"PointProcess: Remove point", U"PointProcess: Remove point...") {
1287 	NATURAL (pointNumber, U"Point number", U"1")
1288 	OK
1289 DO
1290 	MODIFY_EACH (PointProcess)
1291 		PointProcess_removePoint (me, pointNumber);
1292 	MODIFY_EACH_END
1293 }
1294 
1295 FORM (MODIFY_PointProcess_removePointNear, U"PointProcess: Remove point near", U"PointProcess: Remove point near...") {
1296 	REAL (time, U"Time (s)", U"0.5")
1297 	OK
1298 DO
1299 	MODIFY_EACH (PointProcess)
1300 		PointProcess_removePointNear (me, time);
1301 	MODIFY_EACH_END
1302 }
1303 
1304 FORM (MODIFY_PointProcess_removePoints, U"PointProcess: Remove points", U"PointProcess: Remove points...") {
1305 	NATURAL (fromPointNumber, U"From point number", U"1")
1306 	NATURAL (toPointNumber, U"To point number", U"10")
1307 	OK
1308 DO
1309 	MODIFY_EACH (PointProcess)
1310 		PointProcess_removePoints (me, fromPointNumber, toPointNumber);
1311 	MODIFY_EACH_END
1312 }
1313 
1314 FORM (MODIFY_PointProcess_removePointsBetween, U"PointProcess: Remove points between", U"PointProcess: Remove points between...") {
1315 	REAL (fromTime, U"left Time range (s)", U"0.3")
1316 	REAL (toTime, U"right Time range (s)", U"0.7")
1317 	OK
1318 DO
1319 	MODIFY_EACH (PointProcess)
1320 		PointProcess_removePointsBetween (me, fromTime, toTime);
1321 	MODIFY_EACH_END
1322 }
1323 
1324 DIRECT (NEW_PointProcess_to_IntervalTier) {
1325 	CONVERT_EACH_TO_ONE (PointProcess)
1326 		autoIntervalTier result = IntervalTier_create (my xmin, my xmax);
1327 	CONVERT_EACH_TO_ONE_END (my name.get())
1328 }
1329 
1330 DIRECT (NEW_PointProcess_to_Matrix) {
1331 	CONVERT_EACH_TO_ONE (PointProcess)
1332 		autoMatrix result = PointProcess_to_Matrix (me);
1333 	CONVERT_EACH_TO_ONE_END (my name.get())
1334 }
1335 
1336 FORM (NEW_PointProcess_to_PitchTier, U"PointProcess: To PitchTier", U"PointProcess: To PitchTier...") {
1337 	POSITIVE (maximumInterval, U"Maximum interval (s)", U"0.02")
1338 	OK
1339 DO
1340 	CONVERT_EACH_TO_ONE (PointProcess)
1341 		autoPitchTier result = PointProcess_to_PitchTier (me, maximumInterval);
1342 	CONVERT_EACH_TO_ONE_END (my name.get())
1343 }
1344 
1345 FORM (NEW_PointProcess_to_TextGrid, U"PointProcess: To TextGrid...", U"PointProcess: To TextGrid...") {
1346 	SENTENCE (tierNames, U"Tier names", U"Mary John bell")
1347 	SENTENCE (pointTiers, U"Point tiers", U"bell")
1348 	OK
1349 DO
1350 	CONVERT_EACH_TO_ONE (PointProcess)
1351 		autoTextGrid result = TextGrid_create (my xmin, my xmax, tierNames, pointTiers);
1352 	CONVERT_EACH_TO_ONE_END (my name.get())
1353 }
1354 
1355 FORM (NEW_PointProcess_to_TextGrid_vuv, U"PointProcess: To TextGrid (vuv)...", U"PointProcess: To TextGrid (vuv)...") {
1356 	POSITIVE (maximumPeriod, U"Maximum period (s)", U"0.02")
1357 	REAL (meanPeriod, U"Mean period (s)", U"0.01")
1358 	OK
1359 DO
1360 	CONVERT_EACH_TO_ONE (PointProcess)
1361 		autoTextGrid result = PointProcess_to_TextGrid_vuv (me, maximumPeriod, meanPeriod);
1362 	CONVERT_EACH_TO_ONE_END (my name.get())
1363 }
1364 
1365 DIRECT (NEW_PointProcess_to_TextTier) {
1366 	CONVERT_EACH_TO_ONE (PointProcess)
1367 		autoTextTier result = TextTier_create (my xmin, my xmax);
1368 	CONVERT_EACH_TO_ONE_END (my name.get())
1369 }
1370 
1371 FORM (NEW_PointProcess_to_Sound_phonation, U"PointProcess: To Sound (phonation)", U"PointProcess: To Sound (phonation)...") {
1372 	POSITIVE (samplingFrequency, U"Sampling frequency (Hz)", U"44100.0")
1373 	POSITIVE (adaptationFactor, U"Adaptation factor", U"1.0")
1374 	POSITIVE (maximumPeriod, U"Maximum period (s)", U"0.05")
1375 	POSITIVE (openPhase, U"Open phase", U"0.7")
1376 	REAL (collisionPhase, U"Collision phase", U"0.03")
1377 	POSITIVE (power1, U"Power 1", U"3.0")
1378 	POSITIVE (power2, U"Power 2", U"4.0")
1379 	OK
1380 DO
1381 	CONVERT_EACH_TO_ONE (PointProcess)
1382 		autoSound result = PointProcess_to_Sound_phonation (me, samplingFrequency,
1383 			adaptationFactor, maximumPeriod, openPhase, collisionPhase, power1, power2);
1384 	CONVERT_EACH_TO_ONE_END (my name.get())
1385 }
1386 
1387 FORM (NEW_PointProcess_to_Sound_pulseTrain, U"PointProcess: To Sound (pulse train)", U"PointProcess: To Sound (pulse train)...") {
1388 	POSITIVE (samplingFrequency, U"Sampling frequency (Hz)", U"44100.0")
1389 	POSITIVE (adaptationFactor, U"Adaptation factor", U"1.0")
1390 	POSITIVE (adaptationTime, U"Adaptation time (s)", U"0.05")
1391 	NATURAL (interpolationDepth, U"Interpolation depth (samples)", U"2000")
1392 	OK
1393 DO
1394 	CONVERT_EACH_TO_ONE (PointProcess)
1395 		autoSound result = PointProcess_to_Sound_pulseTrain (me, samplingFrequency,
1396 			adaptationFactor, adaptationTime, interpolationDepth);
1397 	CONVERT_EACH_TO_ONE_END (my name.get())
1398 }
1399 
1400 DIRECT (NEW_PointProcess_to_Sound_hum) {
1401 	CONVERT_EACH_TO_ONE (PointProcess)
1402 		autoSound result = PointProcess_to_Sound_hum (me);
1403 	CONVERT_EACH_TO_ONE_END (my name.get())
1404 }
1405 
1406 DIRECT (NEW1_PointProcesses_union) {
1407 	CONVERT_TWO_TO_ONE (PointProcess)
1408 		autoPointProcess result = PointProcesses_union (me, you);
1409 	CONVERT_TWO_TO_ONE_END (U"union")
1410 }
1411 
1412 FORM (NEW_PointProcess_upto_IntensityTier, U"PointProcess: Up to IntensityTier", U"PointProcess: Up to IntensityTier...") {
1413 	POSITIVE (intensity, U"Intensity (dB)", U"70.0")
1414 	OK
1415 DO
1416 	CONVERT_EACH_TO_ONE (PointProcess)
1417 		autoIntensityTier result = PointProcess_upto_IntensityTier (me, intensity);
1418 	CONVERT_EACH_TO_ONE_END (my name.get())
1419 }
1420 
1421 FORM (NEW_PointProcess_upto_PitchTier, U"PointProcess: Up to PitchTier", U"PointProcess: Up to PitchTier...") {
1422 	POSITIVE (frequency, U"Frequency (Hz)", U"190.0")
1423 	OK
1424 DO
1425 	CONVERT_EACH_TO_ONE (PointProcess)
1426 		autoPitchTier result = PointProcess_upto_PitchTier (me, frequency);
1427 	CONVERT_EACH_TO_ONE_END (my name.get())
1428 }
1429 
1430 FORM (NEW_PointProcess_upto_TextTier, U"PointProcess: Up to TextTier", U"PointProcess: Up to TextTier...") {
1431 	SENTENCE (text, U"Text", U"")
1432 	OK
1433 DO
1434 	CONVERT_EACH_TO_ONE (PointProcess)
1435 		autoTextTier result = PointProcess_upto_TextTier (me, text);
1436 	CONVERT_EACH_TO_ONE_END (my name.get())
1437 }
1438 
1439 FORM (MODIFY_PointProcess_voice, U"PointProcess: Fill unvoiced parts", nullptr) {
1440 	POSITIVE (period, U"Period (s)", U"0.01")
1441 	POSITIVE (maximumVoicedPeriod, U"Maximum voiced period (s)", U"0.02000000001")
1442 	OK
1443 DO
1444 	MODIFY_EACH_WEAK (PointProcess)
1445 		PointProcess_voice (me, period, maximumVoicedPeriod);
1446 	MODIFY_EACH_WEAK_END
1447 }
1448 
1449 DIRECT (HINT_PointProcess_Sound_viewAndEdit) {
1450 	INFO_NONE
1451 		Melder_information (U"To include a copy of a Sound in your PointProcess window:\n"
1452 			"   select a PointProcess and a Sound, and click \"View & Edit\".");
1453 	INFO_NONE_END
1454 }
1455 
1456 // MARK: - POINTPROCESS & SOUND
1457 
1458 DIRECT (MODIFY_Point_Sound_transplantDomain) {
1459 	MODIFY_FIRST_OF_ONE_AND_ONE (PointProcess, Sound)
1460 		my xmin = your xmin;
1461 		my xmax = your xmax;
1462 	MODIFY_FIRST_OF_ONE_AND_ONE_END
1463 }
1464 
1465 FORM (REAL_Point_Sound_getShimmer_local, U"PointProcess & Sound: Get shimmer (local)", U"PointProcess & Sound: Get shimmer (local)...") {
1466 	dia_PointProcess_getRangeProperty (fromTime, toTime, shortestPeriod, longestPeriod, maximumPeriodfactor)
1467 	POSITIVE (maximumAmplitudeFactor, U"Maximum amplitude factor", U"1.6")
1468 	OK
1469 DO
1470 	QUERY_ONE_AND_ONE_FOR_REAL (PointProcess, Sound)
1471 		double result = PointProcess_Sound_getShimmer_local (me, you, fromTime, toTime,
1472 			shortestPeriod, longestPeriod, maximumPeriodFactor, maximumAmplitudeFactor);
1473 	QUERY_ONE_AND_ONE_FOR_REAL_END (U" (local shimmer)");
1474 }
1475 
1476 FORM (REAL_Point_Sound_getShimmer_local_dB, U"PointProcess & Sound: Get shimmer (local, dB)", U"PointProcess & Sound: Get shimmer (local, dB)...") {
1477 	dia_PointProcess_getRangeProperty (fromTime, toTime, shortestPeriod, longestPeriod, maximumPeriodfactor)
1478 	POSITIVE (maximumAmplitudeFactor, U"Maximum amplitude factor", U"1.6")
1479 	OK
1480 DO
1481 	QUERY_ONE_AND_ONE_FOR_REAL (PointProcess, Sound)
1482 		double result = PointProcess_Sound_getShimmer_local_dB (me, you, fromTime, toTime,
1483 			shortestPeriod, longestPeriod, maximumPeriodFactor, maximumAmplitudeFactor);
1484 	QUERY_ONE_AND_ONE_FOR_REAL_END (U" dB (local shimmer)");
1485 }
1486 
1487 FORM (REAL_Point_Sound_getShimmer_apq3, U"PointProcess & Sound: Get shimmer (apq3)", U"PointProcess & Sound: Get shimmer (apq3)...") {
1488 	dia_PointProcess_getRangeProperty (fromTime, toTime, shortestPeriod, longestPeriod, maximumPeriodfactor)
1489 	POSITIVE (maximumAmplitudeFactor, U"Maximum amplitude factor", U"1.6")
1490 	OK
1491 DO
1492 	QUERY_ONE_AND_ONE_FOR_REAL (PointProcess, Sound)
1493 		double result = PointProcess_Sound_getShimmer_apq3 (me, you, fromTime, toTime,
1494 			shortestPeriod, longestPeriod, maximumPeriodFactor, maximumAmplitudeFactor);
1495 	QUERY_ONE_AND_ONE_FOR_REAL_END (U" (apq3 shimmer)");
1496 }
1497 
1498 FORM (REAL_Point_Sound_getShimmer_apq5, U"PointProcess & Sound: Get shimmer (apq)", U"PointProcess & Sound: Get shimmer (apq5)...") {
1499 	dia_PointProcess_getRangeProperty (fromTime, toTime, shortestPeriod, longestPeriod, maximumPeriodfactor)
1500 	POSITIVE (maximumAmplitudeFactor, U"Maximum amplitude factor", U"1.6")
1501 	OK
1502 DO
1503 	QUERY_ONE_AND_ONE_FOR_REAL (PointProcess, Sound)
1504 		double result = PointProcess_Sound_getShimmer_apq5 (me, you, fromTime, toTime,
1505 			shortestPeriod, longestPeriod, maximumPeriodFactor, maximumAmplitudeFactor);
1506 	QUERY_ONE_AND_ONE_FOR_REAL_END (U" (apq5 shimmer)");
1507 }
1508 
1509 FORM (REAL_Point_Sound_getShimmer_apq11, U"PointProcess & Sound: Get shimmer (apq11)", U"PointProcess & Sound: Get shimmer (apq11)...") {
1510 	dia_PointProcess_getRangeProperty (fromTime, toTime, shortestPeriod, longestPeriod, maximumPeriodfactor)
1511 	POSITIVE (maximumAmplitudeFactor, U"Maximum amplitude factor", U"1.6")
1512 	OK
1513 DO
1514 	QUERY_ONE_AND_ONE_FOR_REAL (PointProcess, Sound)
1515 		double result = PointProcess_Sound_getShimmer_apq11 (me, you, fromTime, toTime,
1516 			shortestPeriod, longestPeriod, maximumPeriodFactor, maximumAmplitudeFactor);
1517 	QUERY_ONE_AND_ONE_FOR_REAL_END (U" (apq11 shimmer)");
1518 }
1519 
1520 FORM (REAL_Point_Sound_getShimmer_dda, U"PointProcess & Sound: Get shimmer (dda)", U"PointProcess & Sound: Get shimmer (dda)...") {
1521 	dia_PointProcess_getRangeProperty (fromTime, toTime, shortestPeriod, longestPeriod, maximumPeriodfactor)
1522 	POSITIVE (maximumAmplitudeFactor, U"Maximum amplitude factor", U"1.6")
1523 	OK
1524 DO
1525 	QUERY_ONE_AND_ONE_FOR_REAL (PointProcess, Sound)
1526 		double result = PointProcess_Sound_getShimmer_dda (me, you, fromTime, toTime,
1527 			shortestPeriod, longestPeriod, maximumPeriodFactor, maximumAmplitudeFactor);
1528 	QUERY_ONE_AND_ONE_FOR_REAL_END (U" (dda shimmer)");
1529 }
1530 
1531 FORM (NEW1_PointProcess_Sound_to_AmplitudeTier_period, U"PointProcess & Sound: To AmplitudeTier (period)", nullptr) {
1532 	dia_PointProcess_getRangeProperty (fromTime, toTime, shortestPeriod, longestPeriod, maximumPeriodfactor)
1533 	OK
1534 DO
1535 	CONVERT_ONE_AND_ONE_TO_ONE (PointProcess, Sound)
1536 		autoAmplitudeTier result = PointProcess_Sound_to_AmplitudeTier_period (me, you, fromTime, toTime,
1537 			shortestPeriod, longestPeriod, maximumPeriodFactor);
1538 	CONVERT_ONE_AND_ONE_TO_ONE_END (your name.get(), U"_", my name.get())
1539 }
1540 
1541 DIRECT (NEW1_PointProcess_Sound_to_AmplitudeTier_point) {
1542 	CONVERT_ONE_AND_ONE_TO_ONE (PointProcess, Sound)
1543 		autoAmplitudeTier result = PointProcess_Sound_to_AmplitudeTier_point (me, you);
1544 	CONVERT_ONE_AND_ONE_TO_ONE_END (your name.get(), U"_", my name.get());
1545 }
1546 
1547 FORM (NEW1_PointProcess_Sound_to_Ltas, U"PointProcess & Sound: To Ltas", nullptr) {
1548 	POSITIVE (maximumFrequency, U"Maximum frequency (Hz)", U"5000.0")
1549 	POSITIVE (bandwidth, U"Band width (Hz)", U"100.0")
1550 	REAL (shortestPeriod, U"Shortest period (s)", U"0.0001")
1551 	REAL (longestPeriod, U"Longest period (s)", U"0.02")
1552 	POSITIVE (maximumPeriodFactor, U"Maximum period factor", U"1.3")
1553 	OK
1554 DO
1555 	CONVERT_ONE_AND_ONE_TO_ONE (PointProcess, Sound)
1556 		autoLtas result = PointProcess_Sound_to_Ltas (me, you,
1557 			maximumFrequency, bandwidth, shortestPeriod, longestPeriod, maximumPeriodFactor);
1558 	CONVERT_ONE_AND_ONE_TO_ONE_END (your name.get())
1559 }
1560 
1561 FORM (NEW1_PointProcess_Sound_to_Ltas_harmonics, U"PointProcess & Sound: To Ltas (harmonics", nullptr) {
1562 	NATURAL (maximumHarmonic, U"Maximum harmonic", U"20")
1563 	REAL (shortestPeriod, U"Shortest period (s)", U"0.0001")
1564 	REAL (longestPeriod, U"Longest period (s)", U"0.02")
1565 	POSITIVE (maximumPeriodFactor, U"Maximum period factor", U"1.3")
1566 	OK
1567 DO
1568 	CONVERT_ONE_AND_ONE_TO_ONE (PointProcess, Sound)
1569 		autoLtas result = PointProcess_Sound_to_Ltas_harmonics (me, you,
1570 			maximumHarmonic, shortestPeriod, longestPeriod, maximumPeriodFactor);
1571 	CONVERT_ONE_AND_ONE_TO_ONE_END (your name.get())
1572 }
1573 
1574 FORM (NEW1_Sound_PointProcess_to_SoundEnsemble_correlate, U"Sound & PointProcess: To SoundEnsemble (correlate)", nullptr) {
1575 	REAL (fromTime, U"From time (s)", U"-0.1")
1576 	REAL (toTime, U"To time (s)", U"1.0")
1577 	OK
1578 DO
1579 	CONVERT_ONE_AND_ONE_TO_ONE (Sound, PointProcess)
1580 		autoSound result = Sound_PointProcess_to_SoundEnsemble_correlate (me, you, fromTime, toTime);
1581 	CONVERT_ONE_AND_ONE_TO_ONE_END (your name.get())
1582 }
1583 
1584 // MARK: - REALTIER
1585 
1586 // MARK: New
1587 
1588 FORM (NEW1_RealTier_create, U"Create empty RealTier", nullptr) {
1589 	WORD (name, U"Name", U"empty")
1590 	REAL (startTime, U"Start time (s)", U"0.0")
1591 	REAL (endTime, U"End time (s)", U"1.0")
1592 	OK
1593 DO
1594 	Melder_require (endTime > startTime,
1595 		U"Your end time should be greater than your start time.");
1596 	CREATE_ONE
1597 		autoRealTier result = RealTier_create (startTime, endTime);
1598 	CREATE_ONE_END (name)
1599 }
1600 
1601 // MARK: Help
1602 
1603 DIRECT (HELP_RealTier_help) {
1604 	HELP (U"RealTier")
1605 }
1606 
1607 // MARK: View & Edit
1608 
1609 DIRECT (EDITOR_ONE_WITH_ONE_RealTier_viewAndEdit) {
1610 	EDITOR_ONE_WITH_ONE (a,RealTier, Sound)   // Sound may be null
1611 		autoRealTierEditor editor = RealTierEditor_create (ID_AND_FULL_NAME, me, you, true);
1612 	EDITOR_ONE_WITH_ONE_END
1613 }
1614 
1615 DIRECT (HINT_RealTier_Sound_viewAndEdit) {
1616 	INFO_NONE
1617 		Melder_information (U"To include a copy of a Sound in your RealTier window:\n"
1618 			"   select a RealTier and a Sound, and click \"View & Edit\".");
1619 	INFO_NONE_END
1620 }
1621 
1622 // MARK: Query
1623 
1624 FORM (REAL_RealTier_getValueAtTime, U"Get RealTier value", U"RealTier: Get value at time...") {
1625 	REAL (time, U"Time (s)", U"0.5")
1626 	OK
1627 DO
1628 	QUERY_ONE_FOR_REAL (RealTier)
1629 		const double result = RealTier_getValueAtTime (me, time);
1630 	QUERY_ONE_FOR_REAL_END (U"")
1631 }
1632 
1633 FORM (REAL_RealTier_getValueAtIndex, U"Get RealTier value", U"RealTier: Get value at index...") {
1634 	INTEGER (pointNumber, U"Point number", U"10")
1635 	OK
1636 DO
1637 	QUERY_ONE_FOR_REAL (IntensityTier)
1638 		const double result = RealTier_getValueAtIndex (me, pointNumber);
1639 	QUERY_ONE_FOR_REAL_END (U"")
1640 }
1641 
1642 // MARK: Modify
1643 
1644 FORM (MODIFY_RealTier_addPoint, U"Add one point", U"RealTier: Add point...") {
1645 	REAL (time, U"Time (s)", U"0.5")
1646 	REAL (intensity, U"Intensity (dB)", U"75")
1647 	OK
1648 DO
1649 	MODIFY_EACH (RealTier)
1650 		RealTier_addPoint (me, time, intensity);
1651 	MODIFY_EACH_END
1652 }
1653 
1654 FORM (MODIFY_RealTier_formula, U"RealTier: Formula", U"RealTier: Formula...") {
1655 	LABEL (U"# ncol = the number of points")
1656 	LABEL (U"for col from 1 to ncol")
1657 	LABEL (U"   # x = the time of the colth point, in seconds")
1658 	LABEL (U"   # self = the value of the colth point")
1659 	LABEL (U"   self = `formula`")
1660 	LABEL (U"endfor")
1661 	FORMULA (formula, U"Formula", U"self + 3.0")
1662 	OK
1663 DO
1664 	MODIFY_EACH_WEAK (RealTier)
1665 		RealTier_formula (me, formula, interpreter, nullptr);
1666 	MODIFY_EACH_WEAK_END
1667 }
1668 
1669 // MARK: Convert
1670 
1671 DIRECT (NEW_RealTier_downto_PointProcess) {
1672 	CONVERT_EACH_TO_ONE (RealTier)
1673 		autoPointProcess result = AnyTier_downto_PointProcess (me->asAnyTier());
1674 	CONVERT_EACH_TO_ONE_END (my name.get())
1675 }
1676 
1677 DIRECT (NEW_RealTier_downto_TableOfReal) {
1678 	CONVERT_EACH_TO_ONE (RealTier)
1679 		autoTableOfReal result = RealTier_downto_TableOfReal (me, U"Time (s)", U"Y");
1680 	CONVERT_EACH_TO_ONE_END (my name.get())
1681 }
1682 
1683 // MARK: Cast
1684 
1685 DIRECT (NEW_RealTier_to_AmplitudeTier) {
1686 	CONVERT_EACH_TO_ONE (RealTier)
1687 		autoAmplitudeTier result = RealTier_to_AmplitudeTier (me);
1688 	CONVERT_EACH_TO_ONE_END (my name.get())
1689 }
1690 
1691 DIRECT (NEW_RealTier_to_DurationTier) {
1692 	CONVERT_EACH_TO_ONE (RealTier)
1693 		autoDurationTier result = RealTier_to_DurationTier (me);
1694 	CONVERT_EACH_TO_ONE_END (my name.get())
1695 }
1696 
1697 DIRECT (NEW_RealTier_to_IntensityTier) {
1698 	CONVERT_EACH_TO_ONE (RealTier)
1699 		autoIntensityTier result = RealTier_to_IntensityTier (me);
1700 	CONVERT_EACH_TO_ONE_END (my name.get())
1701 }
1702 
1703 DIRECT (NEW_RealTier_to_PitchTier) {
1704 	CONVERT_EACH_TO_ONE (RealTier)
1705 		autoPitchTier result = RealTier_to_PitchTier (me);
1706 	CONVERT_EACH_TO_ONE_END (my name.get())
1707 }
1708 
1709 // MARK: - REALTIER & POINTPROCESS
1710 
1711 DIRECT (NEW1_RealTier_PointProcess_to_RealTier) {
1712 	CONVERT_ONE_AND_ONE_TO_ONE (RealTier, PointProcess)
1713 		autoRealTier result = RealTier_PointProcess_to_RealTier (me, you);
1714 	CONVERT_ONE_AND_ONE_TO_ONE_END (my name.get())
1715 }
1716 
1717 // MARK: - SPECTRUMTIER
1718 
1719 DIRECT (NEW_SpectrumTier_downto_Table) {
1720 	CONVERT_EACH_TO_ONE (SpectrumTier)
1721 		autoTable result = SpectrumTier_downto_Table (me, true, true, true);
1722 	CONVERT_EACH_TO_ONE_END (my name.get())
1723 }
1724 
1725 FORM (GRAPHICS_old_SpectrumTier_draw, U"SpectrumTier: Draw", nullptr) {   // 2010-10-19
1726 	REAL (fromFrequency, U"left Frequency range (Hz)", U"0.0")
1727 	REAL (toFrequency, U"right Frequency range (Hz)", U"10000.0")
1728 	REAL (fromPower, U"left Power range (dB)", U"20.0")
1729 	REAL (toPower, U"right Power range (dB)", U"80.0")
1730 	BOOLEAN (garnish, U"Garnish", true)
1731 	OK
1732 DO
1733 	GRAPHICS_EACH (SpectrumTier)
1734 		SpectrumTier_draw (me, GRAPHICS, fromFrequency, toFrequency,
1735 			fromPower, toPower, garnish, U"lines and speckles");
1736 	GRAPHICS_EACH_END
1737 }
1738 
1739 FORM (GRAPHICS_SpectrumTier_draw, U"SpectrumTier: Draw", nullptr) {
1740 	REAL (fromFrequency, U"left Frequency range (Hz)", U"0.0")
1741 	REAL (toFrequency, U"right Frequency range (Hz)", U"10000.0")
1742 	REAL (fromPower, U"left Power range (dB)", U"20.0")
1743 	REAL (toPower, U"right Power range (dB)", U"80.0")
1744 	BOOLEAN (garnish, U"Garnish", true)
1745 	LABEL (U"")
1746 	OPTIONMENUSTR (drawingMethod, U"Drawing method", 1)
1747 		OPTION (U"lines")
1748 		OPTION (U"speckles")
1749 		OPTION (U"lines and speckles")
1750 	OK
1751 DO_ALTERNATIVE (GRAPHICS_old_SpectrumTier_draw)
1752 	GRAPHICS_EACH (SpectrumTier)
1753 		SpectrumTier_draw (me, GRAPHICS, fromFrequency, toFrequency,
1754 			fromPower, toPower, garnish, drawingMethod);
1755 	GRAPHICS_EACH_END
1756 }
1757 
1758 FORM (LIST_SpectrumTier_list, U"SpectrumTier: List", nullptr) {
1759 	BOOLEAN (includeIndexes, U"Include indexes", true)
1760 	BOOLEAN (includeFrequency, U"Include frequency", true)
1761 	BOOLEAN (includePowerDensity, U"Include power density", true)
1762 	OK
1763 DO
1764 	INFO_ONE (SpectrumTier)
1765 		SpectrumTier_list (me, includeIndexes, includeFrequency, includePowerDensity);
1766 	INFO_ONE_END
1767 }
1768 
1769 FORM (MODIFY_SpectrumTier_removePointsBelow, U"SpectrumTier: Remove points below", nullptr) {
1770 	REAL (removeAllPointsBelow, U"Remove all points below (dB)", U"40.0")
1771 	OK
1772 DO
1773 	MODIFY_EACH (SpectrumTier)
1774 		RealTier_removePointsBelow (me, removeAllPointsBelow);
1775 	MODIFY_EACH_END
1776 }
1777 
1778 // MARK: - buttons
1779 
1780 void praat_Tiers_init () {
1781 	Thing_recognizeClassesByName (classPointProcess,
1782 		classRealPoint, classRealTier,
1783 		classPitchTier, classIntensityTier, classDurationTier, classAmplitudeTier,
1784 		classSpectrumTier,
1785 		classFormantPoint, classFormantTier, classFormantGrid,
1786 		nullptr);
1787 
1788 	praat_addMenuCommand (U"Objects", U"New", U"Tiers", nullptr, 0, nullptr);
1789 		praat_addMenuCommand (U"Objects", U"New", U"Create empty PointProcess...", nullptr, 1, NEW1_PointProcess_createEmpty);
1790 		praat_addMenuCommand (U"Objects", U"New", U"Create Poisson process...", nullptr, 1, NEW1_PointProcess_createPoissonProcess);
1791 		praat_addMenuCommand (U"Objects", U"New", U"-- new tiers ---", nullptr, 1, nullptr);
1792 		praat_addMenuCommand (U"Objects", U"New", U"Create PitchTier...", nullptr, 1, NEW1_PitchTier_create);
1793 		praat_addMenuCommand (U"Objects", U"New", U"Create FormantGrid...", nullptr, 1, NEW1_FormantGrid_create);
1794 		praat_addMenuCommand (U"Objects", U"New", U"Create FormantTier...", nullptr, praat_HIDDEN | praat_DEPTH_1, NEW1_FormantTier_create);
1795 		praat_addMenuCommand (U"Objects", U"New", U"Create IntensityTier...", nullptr, 1, NEW1_IntensityTier_create);
1796 		praat_addMenuCommand (U"Objects", U"New", U"Create DurationTier...", nullptr, 1, NEW1_DurationTier_create);
1797 		praat_addMenuCommand (U"Objects", U"New", U"Create AmplitudeTier...", nullptr, 1, NEW1_AmplitudeTier_create);
1798 		praat_addMenuCommand (U"Objects", U"New", U"Create RealTier...", nullptr, 1, NEW1_RealTier_create);
1799 
1800 	praat_addAction1 (classAmplitudeTier, 0, U"AmplitudeTier help", nullptr, 0, HELP_AmplitudeTier_help);
1801 	praat_addAction1 (classAmplitudeTier, 1, U"View & Edit", nullptr, praat_ATTRACTIVE, EDITOR_ONE_WITH_ONE_AmplitudeTier_viewAndEdit);
1802 	praat_addAction1 (classAmplitudeTier, 1,   U"Edit", nullptr, praat_DEPRECATED_2011, EDITOR_ONE_WITH_ONE_AmplitudeTier_viewAndEdit);
1803 	praat_addAction1 (classAmplitudeTier, 0, U"View & Edit with Sound?", nullptr, 0, HINT_AmplitudeTier_Sound_viewAndEdit);
1804 	praat_addAction1 (classAmplitudeTier, 0, U"Query -", nullptr, 0, nullptr);
1805 		praat_TimeTier_query_init (classAmplitudeTier);
1806 		praat_addAction1 (classAmplitudeTier, 1, U"Get shimmer (local)...", nullptr, 1, REAL_AmplitudeTier_getShimmer_local);
1807 		praat_addAction1 (classAmplitudeTier, 1, U"Get shimmer (local_dB)...", nullptr, 1, REAL_AmplitudeTier_getShimmer_local_dB);
1808 		praat_addAction1 (classAmplitudeTier, 1, U"Get shimmer (apq3)...", nullptr, 1, REAL_AmplitudeTier_getShimmer_apq3);
1809 		praat_addAction1 (classAmplitudeTier, 1, U"Get shimmer (apq5)...", nullptr, 1, REAL_AmplitudeTier_getShimmer_apq5);
1810 		praat_addAction1 (classAmplitudeTier, 1, U"Get shimmer (apq11)...", nullptr, 1, REAL_AmplitudeTier_getShimmer_apq11);
1811 		praat_addAction1 (classAmplitudeTier, 1, U"Get shimmer (dda)...", nullptr, 1, REAL_AmplitudeTier_getShimmer_dda);
1812 	praat_addAction1 (classAmplitudeTier, 0, U"Modify -", nullptr, 0, nullptr);
1813 		praat_TimeTier_modify_init (classAmplitudeTier);
1814 		praat_addAction1 (classAmplitudeTier, 0, U"Add point...", nullptr, 1, MODIFY_AmplitudeTier_addPoint);
1815 		praat_addAction1 (classAmplitudeTier, 0, U"Formula...", nullptr, 1, MODIFY_AmplitudeTier_formula);
1816 	praat_addAction1 (classAmplitudeTier, 0, U"Synthesize", nullptr, 0, nullptr);
1817 		praat_addAction1 (classAmplitudeTier, 0, U"To Sound (pulse train)...", nullptr, 0, NEW_AmplitudeTier_to_Sound);
1818 	praat_addAction1 (classAmplitudeTier, 0, U"Convert", nullptr, 0, nullptr);
1819 		praat_addAction1 (classAmplitudeTier, 0, U"To IntensityTier...", nullptr, 0, NEW_AmplitudeTier_to_IntensityTier);
1820 		praat_addAction1 (classAmplitudeTier, 0, U"Down to PointProcess", nullptr, 0, NEW_AmplitudeTier_downto_PointProcess);
1821 		praat_addAction1 (classAmplitudeTier, 0, U"Down to RealTier", nullptr, 0, NEW_AmplitudeTier_downto_RealTier);
1822 		praat_addAction1 (classAmplitudeTier, 0, U"Down to TableOfReal", nullptr, 0, NEW_AmplitudeTier_downto_TableOfReal);
1823 
1824 	praat_addAction1 (classDurationTier, 0, U"DurationTier help", nullptr, 0, HELP_DurationTier_help);
1825 	praat_addAction1 (classDurationTier, 1, U"View & Edit", nullptr, praat_ATTRACTIVE, EDITOR_ONE_WITH_ONE_DurationTier_edit);
1826 	praat_addAction1 (classDurationTier, 1,   U"Edit", nullptr, praat_DEPRECATED_2011, EDITOR_ONE_WITH_ONE_DurationTier_edit);
1827 	praat_addAction1 (classDurationTier, 0, U"View & Edit with Sound?", nullptr, 0, HINT_DurationTier_Sound_edit);
1828 	praat_addAction1 (classDurationTier, 0, U"& Manipulation: Replace?", nullptr, 0, HINT_DurationTier_Manipulation_replace);
1829 	praat_addAction1 (classDurationTier, 0, U"Query -", nullptr, 0, nullptr);
1830 		praat_TimeTier_query_init (classDurationTier);
1831 		praat_addAction1 (classDurationTier, 1, U"-- get content --", nullptr, 1, nullptr);
1832 		praat_addAction1 (classDurationTier, 1, U"Get value at time...", nullptr, 1, REAL_DurationTier_getValueAtTime);
1833 		praat_addAction1 (classDurationTier, 1, U"Get value at index...", nullptr, 1, REAL_DurationTier_getValueAtIndex);
1834 		praat_addAction1 (classDurationTier, 1, U"Get target duration...", nullptr, 1, REAL_DurationTier_getTargetDuration);
1835 	praat_addAction1 (classDurationTier, 0, U"Modify -", nullptr, 0, nullptr);
1836 		praat_TimeTier_modify_init (classDurationTier);
1837 		praat_addAction1 (classDurationTier, 0, U"Add point...", nullptr, 1, MODIFY_DurationTier_addPoint);
1838 		praat_addAction1 (classDurationTier, 0, U"Formula...", nullptr, 1, MODIFY_DurationTier_formula);
1839 	praat_addAction1 (classDurationTier, 0, U"Convert", nullptr, 0, nullptr);
1840 		praat_addAction1 (classDurationTier, 0, U"Down to PointProcess", nullptr, 0, NEW_DurationTier_downto_PointProcess);
1841 		praat_addAction1 (classDurationTier, 0, U"Down to RealTier", nullptr, 0, NEW_DurationTier_downto_RealTier);
1842 
1843 	praat_addAction1 (classFormantGrid, 0, U"FormantGrid help", nullptr, 0, HELP_FormantGrid_help);
1844 	praat_addAction1 (classFormantGrid, 1, U"View & Edit", nullptr, praat_ATTRACTIVE, EDITOR_ONE_FormantGrid_edit);
1845 	praat_addAction1 (classFormantGrid, 1,   U"Edit", U"*View & Edit", praat_DEPRECATED_2011, EDITOR_ONE_FormantGrid_edit);
1846 	praat_addAction1 (classFormantGrid, 0, U"Modify -", nullptr, 0, nullptr);
1847 		praat_TimeFunction_modify_init (classFormantGrid);
1848 		praat_addAction1 (classFormantGrid, 0, U"Formula (frequencies)...", nullptr, 1, MODIFY_FormantGrid_formula_frequencies);
1849 		//praat_addAction1 (classFormantGrid, 0, U"Formula (bandwidths)...", nullptr, 1, MODIFY_FormantGrid_formula_bandwidths);
1850 		praat_addAction1 (classFormantGrid, 0, U"Add formant point...", nullptr, 1, MODIFY_FormantGrid_addFormantPoint);
1851 		praat_addAction1 (classFormantGrid, 0, U"Add bandwidth point...", nullptr, 1, MODIFY_FormantGrid_addBandwidthPoint);
1852 		praat_addAction1 (classFormantGrid, 0, U"Remove formant points between...", nullptr, 1, MODIFY_FormantGrid_removeFormantPointsBetween);
1853 		praat_addAction1 (classFormantGrid, 0, U"Remove bandwidth points between...", nullptr, 1, MODIFY_FormantGrid_removeBandwidthPointsBetween);
1854 	praat_addAction1 (classFormantGrid, 0, U"Convert -", nullptr, 0, nullptr);
1855 		praat_addAction1 (classFormantGrid, 0, U"To Formant...", nullptr, 1, NEW_FormantGrid_to_Formant);
1856 
1857 	praat_addAction1 (classFormantTier, 0, U"Draw -", nullptr, 0, nullptr);
1858 		praat_addAction1 (classFormantTier, 0, U"Speckle...", nullptr, 1, GRAPHICS_FormantTier_speckle);
1859 	praat_addAction1 (classFormantTier, 0, U"Query -", nullptr, 0, nullptr);
1860 		praat_TimeTier_query_init (classFormantTier);
1861 		praat_addAction1 (classFormantTier, 1, U"-- get value --", nullptr, 1, nullptr);
1862 		praat_addAction1 (classFormantTier, 1, U"Get value at time...", nullptr, 1, REAL_FormantTier_getValueAtTime);
1863 		praat_addAction1 (classFormantTier, 1, U"Get bandwidth at time...", nullptr, 1, REAL_FormantTier_getBandwidthAtTime);
1864 	praat_addAction1 (classFormantTier, 0, U"Modify -", nullptr, 0, nullptr);
1865 		praat_TimeTier_modify_init (classFormantTier);
1866 		praat_addAction1 (classFormantTier, 0, U"Add point...", nullptr, 1, MODIFY_FormantTier_addPoint);
1867 	praat_addAction1 (classFormantTier, 0, U"Down", nullptr, 0, nullptr);
1868 		praat_addAction1 (classFormantTier, 0, U"Down to TableOfReal...", nullptr, 0, NEW_FormantTier_downto_TableOfReal);
1869 
1870 	praat_addAction1 (classIntensityTier, 0, U"IntensityTier help", nullptr, 0, HELP_IntensityTier_help);
1871 	praat_addAction1 (classIntensityTier, 1, U"View & Edit", nullptr, praat_ATTRACTIVE, EDITOR_ONE_WITH_ONE_IntensityTier_viewAndEdit);
1872 	praat_addAction1 (classIntensityTier, 1,   U"Edit", U"*View & Edit", praat_DEPRECATED_2011, EDITOR_ONE_WITH_ONE_IntensityTier_viewAndEdit);
1873 	praat_addAction1 (classIntensityTier, 0, U"View & Edit with Sound?", nullptr, 0, HINT_IntensityTier_Sound_viewAndEdit);
1874 	praat_addAction1 (classIntensityTier, 0, U"Query -", nullptr, 0, nullptr);
1875 		praat_TimeTier_query_init (classIntensityTier);
1876 		praat_addAction1 (classIntensityTier, 1, U"-- get content --", nullptr, 1, nullptr);
1877 		praat_addAction1 (classIntensityTier, 1, U"Get value at time...", nullptr, 1, REAL_IntensityTier_getValueAtTime);
1878 		praat_addAction1 (classIntensityTier, 1, U"Get value at index...", nullptr, 1, REAL_IntensityTier_getValueAtIndex);
1879 	praat_addAction1 (classIntensityTier, 0, U"Modify -", nullptr, 0, nullptr);
1880 		praat_TimeTier_modify_init (classIntensityTier);
1881 		praat_addAction1 (classIntensityTier, 0, U"Add point...", nullptr, 1, MODIFY_IntensityTier_addPoint);
1882 		praat_addAction1 (classIntensityTier, 0, U"Formula...", nullptr, 1, MODIFY_IntensityTier_formula);
1883 	praat_addAction1 (classIntensityTier, 0, U"Convert", nullptr, 0, nullptr);
1884 		praat_addAction1 (classIntensityTier, 0, U"To AmplitudeTier", nullptr, 0, NEW_IntensityTier_to_AmplitudeTier);
1885 		praat_addAction1 (classIntensityTier, 0, U"Down to PointProcess", nullptr, 0, NEW_IntensityTier_downto_PointProcess);
1886 		praat_addAction1 (classIntensityTier, 0, U"Down to RealTier", nullptr, 0, NEW_IntensityTier_downto_RealTier);
1887 		praat_addAction1 (classIntensityTier, 0, U"Down to TableOfReal", nullptr, 0, NEW_IntensityTier_downto_TableOfReal);
1888 
1889 	praat_addAction1 (classPitchTier, 1, U"Save as PitchTier spreadsheet file...", nullptr, 0, SAVE_PitchTier_writeToPitchTierSpreadsheetFile);
1890 	praat_addAction1 (classPitchTier, 1,   U"Write to PitchTier spreadsheet file...", U"*Save as PitchTier spreadsheet file...", praat_DEPRECATED_2011, SAVE_PitchTier_writeToPitchTierSpreadsheetFile);
1891 	praat_addAction1 (classPitchTier, 1, U"Save as headerless spreadsheet file...", nullptr, 0, SAVE_PitchTier_writeToHeaderlessSpreadsheetFile);
1892 	praat_addAction1 (classPitchTier, 1,   U"Write to headerless spreadsheet file...", U"*Save as headerless spreadsheet file...", praat_DEPRECATED_2011, SAVE_PitchTier_writeToHeaderlessSpreadsheetFile);
1893 	praat_addAction1 (classPitchTier, 0, U"PitchTier help", nullptr, 0, HELP_PitchTier_help);
1894 	praat_addAction1 (classPitchTier, 1, U"View & Edit", nullptr, praat_ATTRACTIVE, EDITOR_ONE_WITH_ONE_PitchTier_viewAndEdit);
1895 	praat_addAction1 (classPitchTier, 1,   U"Edit", U"*View & Edit", praat_DEPRECATED_2011, EDITOR_ONE_WITH_ONE_PitchTier_viewAndEdit);
1896 	praat_addAction1 (classPitchTier, 0, U"View & Edit with Sound?", nullptr, 0, HINT_PitchTier_Sound_viewAndEdit);
1897 	praat_addAction1 (classPitchTier, 0, U"Play -", nullptr, 0, nullptr);
1898 	praat_addAction1 (classPitchTier, 0, U"Play pulses", nullptr, 1, PLAY_PitchTier_play);
1899 	praat_addAction1 (classPitchTier, 0, U"Hum", nullptr, 1, PLAY_PitchTier_hum);
1900 	praat_addAction1 (classPitchTier, 0, U"Play sine", nullptr, 1, PLAY_PitchTier_playSine);
1901 	praat_addAction1 (classPitchTier, 0, U"Draw...", nullptr, 0, GRAPHICS_PitchTier_draw);
1902 	praat_addAction1 (classPitchTier, 0, U"& Manipulation: Replace?", nullptr, 0, INFO_PitchTier_Manipulation_replace);
1903 	praat_addAction1 (classPitchTier, 0, U"Query -", nullptr, 0, nullptr);
1904 		praat_TimeTier_query_init (classPitchTier);
1905 		praat_addAction1 (classPitchTier, 1, U"-- get content --", nullptr, 1, nullptr);
1906 		praat_addAction1 (classPitchTier, 1, U"Get value at time...", nullptr, 1, REAL_PitchTier_getValueAtTime);
1907 		praat_addAction1 (classPitchTier, 1, U"Get value at index...", nullptr, 1, REAL_PitchTier_getValueAtIndex);
1908 		praat_addAction1 (classPitchTier, 1, U"-- get statistics --", nullptr, 1, nullptr);
1909 		praat_addAction1 (classPitchTier, 1, U"Get mean (curve)...", nullptr, 1, REAL_PitchTier_getMean_curve);
1910 		praat_addAction1 (classPitchTier, 1, U"Get mean (points)...", nullptr, 1, REAL_PitchTier_getMean_points);
1911 		praat_addAction1 (classPitchTier, 1, U"Get standard deviation (curve)...", nullptr, 1, REAL_PitchTier_getStandardDeviation_curve);
1912 		praat_addAction1 (classPitchTier, 1, U"Get standard deviation (points)...", nullptr, 1, REAL_PitchTier_getStandardDeviation_points);
1913 	praat_addAction1 (classPitchTier, 0, U"Modify -", nullptr, 0, nullptr);
1914 		praat_TimeTier_modify_init (classPitchTier);
1915 		praat_addAction1 (classPitchTier, 0, U"Add point...", nullptr, 1, MODIFY_PitchTier_addPoint);
1916 		praat_addAction1 (classPitchTier, 0, U"Formula...", nullptr, 1, MODIFY_PitchTier_formula);
1917 		praat_addAction1 (classPitchTier, 0, U"-- stylize --", nullptr, 1, nullptr);
1918 		praat_addAction1 (classPitchTier, 0, U"Stylize...", nullptr, 1, MODIFY_PitchTier_stylize);
1919 		praat_addAction1 (classPitchTier, 0, U"Interpolate quadratically...", nullptr, 1, MODIFY_PitchTier_interpolateQuadratically);
1920 		praat_addAction1 (classPitchTier, 0, U"-- modify frequencies --", nullptr, 1, nullptr);
1921 		praat_addAction1 (classPitchTier, 0, U"Shift frequencies...", nullptr, 1, MODIFY_PitchTier_shiftFrequencies);
1922 		praat_addAction1 (classPitchTier, 0, U"Multiply frequencies...", nullptr, 1, MODIFY_PitchTier_multiplyFrequencies);
1923 	praat_addAction1 (classPitchTier, 0, U"Synthesize -", nullptr, 0, nullptr);
1924 		praat_addAction1 (classPitchTier, 0, U"To PointProcess", nullptr, 1, NEW_PitchTier_to_PointProcess);
1925 		praat_addAction1 (classPitchTier, 0, U"To Sound (pulse train)...", nullptr, 1, NEW_PitchTier_to_Sound_pulseTrain);
1926 		praat_addAction1 (classPitchTier, 0, U"To Sound (phonation)...", nullptr, 1, NEW_PitchTier_to_Sound_phonation);
1927 		praat_addAction1 (classPitchTier, 0, U"To Sound (sine)...", nullptr, 1, NEW_PitchTier_to_Sound_sine);
1928 	praat_addAction1 (classPitchTier, 0, U"Convert -", nullptr, 0, nullptr);
1929 		praat_addAction1 (classPitchTier, 0, U"Down to PointProcess", nullptr, 1, NEW_PitchTier_downto_PointProcess);
1930 		praat_addAction1 (classPitchTier, 0, U"Down to RealTier", nullptr, 0, NEW_PitchTier_downto_RealTier);
1931 		praat_addAction1 (classPitchTier, 0, U"Down to TableOfReal...", nullptr, 1, NEW_PitchTier_downto_TableOfReal);
1932 
1933 	praat_addAction1 (classPointProcess, 0, U"PointProcess help", nullptr, 0, HELP_PointProcess_help);
1934 	praat_addAction1 (classPointProcess, 1, U"View & Edit", nullptr, praat_ATTRACTIVE, EDITOR_ONE_WITH_ONE_PointProcess_viewAndEdit);
1935 	praat_addAction1 (classPointProcess, 1,   U"View & Edit alone", U"*View & Edit", praat_DEPRECATED_2011, EDITOR_ONE_WITH_ONE_PointProcess_viewAndEdit);
1936 	praat_addAction1 (classPointProcess, 1,   U"Edit alone", U"*View & Edit", praat_DEPRECATED_2011, EDITOR_ONE_WITH_ONE_PointProcess_viewAndEdit);
1937 	praat_addAction1 (classPointProcess, 0, U"View & Edit with Sound?", nullptr, praat_NO_API, HINT_PointProcess_Sound_viewAndEdit);
1938 	praat_addAction1 (classPointProcess, 0, U"Play -", nullptr, 0, nullptr);
1939 		praat_addAction1 (classPointProcess, 0, U"Play as pulse train", nullptr, 1, PLAY_PointProcess_play);
1940 		praat_addAction1 (classPointProcess, 0, U"Hum", nullptr, 1, PLAY_PointProcess_hum);
1941 	praat_addAction1 (classPointProcess, 0, U"Draw...", nullptr, 0, GRAPHICS_PointProcess_draw);
1942 	praat_addAction1 (classPointProcess, 0, U"Query -", nullptr, 0, nullptr);
1943 		praat_TimeFunction_query_init (classPointProcess);
1944 		praat_addAction1 (classPointProcess, 1, U"-- script get --", nullptr, 1, nullptr);
1945 		praat_addAction1 (classPointProcess, 1, U"Get number of points", nullptr, 1, INTEGER_PointProcess_getNumberOfPoints);
1946 		praat_addAction1 (classPointProcess, 1, U"Get low index...", nullptr, 1, INTEGER_PointProcess_getLowIndex);
1947 		praat_addAction1 (classPointProcess, 1, U"Get high index...", nullptr, 1, INTEGER_PointProcess_getHighIndex);
1948 		praat_addAction1 (classPointProcess, 1, U"Get nearest index...", nullptr, 1, INTEGER_PointProcess_getNearestIndex);
1949 		praat_addAction1 (classPointProcess, 1, U"Get time from index...", nullptr, 1, REAL_PointProcess_getTimeFromIndex);
1950 		praat_addAction1 (classPointProcess, 1, U"Get interval...", nullptr, 1, REAL_PointProcess_getInterval);
1951 		praat_addAction1 (classPointProcess, 1, U"-- periods --", nullptr, 1, nullptr);
1952 		praat_addAction1 (classPointProcess, 1, U"Get number of periods...", nullptr, 1, INTEGER_PointProcess_getNumberOfPeriods);
1953 		praat_addAction1 (classPointProcess, 1, U"Get mean period...", nullptr, 1, REAL_PointProcess_getMeanPeriod);
1954 		praat_addAction1 (classPointProcess, 1, U"Get stdev period...", nullptr, 1, REAL_PointProcess_getStdevPeriod);
1955 		praat_addAction1 (classPointProcess, 1, U"Get jitter (local)...", nullptr, 1, REAL_PointProcess_getJitter_local);
1956 		praat_addAction1 (classPointProcess, 1, U"Get jitter (local, absolute)...", nullptr, 1, REAL_PointProcess_getJitter_local_absolute);
1957 		praat_addAction1 (classPointProcess, 1, U"Get jitter (rap)...", nullptr, 1, REAL_PointProcess_getJitter_rap);
1958 		praat_addAction1 (classPointProcess, 1, U"Get jitter (ppq5)...", nullptr, 1, REAL_PointProcess_getJitter_ppq5);
1959 		praat_addAction1 (classPointProcess, 1, U"Get jitter (ddp)...", nullptr, 1, REAL_PointProcess_getJitter_ddp);
1960 	praat_addAction1 (classPointProcess, 0, U"Modify -", nullptr, 0, nullptr);
1961 		praat_TimeFunction_modify_init (classPointProcess);
1962 		praat_addAction1 (classPointProcess, 0, U"Add point...", nullptr, 1, MODIFY_PointProcess_addPoint);
1963 		praat_addAction1 (classPointProcess, 0, U"Add points...", nullptr, 1, MODIFY_PointProcess_addPoints);
1964 		praat_addAction1 (classPointProcess, 0, U"Remove point...", nullptr, 1, MODIFY_PointProcess_removePoint);
1965 		praat_addAction1 (classPointProcess, 0, U"Remove point near...", nullptr, 1, MODIFY_PointProcess_removePointNear);
1966 		praat_addAction1 (classPointProcess, 0, U"Remove points...", nullptr, 1, MODIFY_PointProcess_removePoints);
1967 		praat_addAction1 (classPointProcess, 0, U"Remove points between...", nullptr, 1, MODIFY_PointProcess_removePointsBetween);
1968 		praat_addAction1 (classPointProcess, 0, U"-- voice --", nullptr, 1, nullptr);
1969 		praat_addAction1 (classPointProcess, 0, U"Fill...", nullptr, 1, MODIFY_PointProcess_fill);
1970 		praat_addAction1 (classPointProcess, 0, U"Voice...", nullptr, 1, MODIFY_PointProcess_voice);
1971 	praat_addAction1 (classPointProcess, 0, U"Annotate -", nullptr, 0, nullptr);
1972 		praat_addAction1 (classPointProcess, 0, U"To TextGrid...", nullptr, 1, NEW_PointProcess_to_TextGrid);
1973 		praat_addAction1 (classPointProcess, 0, U"-- to single tier --", nullptr, 1, nullptr);
1974 		praat_addAction1 (classPointProcess, 0, U"To TextTier", nullptr, 1, NEW_PointProcess_to_TextTier);
1975 		praat_addAction1 (classPointProcess, 0, U"To IntervalTier", nullptr, 1, NEW_PointProcess_to_IntervalTier);
1976 	praat_addAction1 (classPointProcess, 0, U"Analyse -", nullptr, 0, nullptr);
1977 		praat_addAction1 (classPointProcess, 0, U"To PitchTier...", nullptr, 1, NEW_PointProcess_to_PitchTier);
1978 		praat_addAction1 (classPointProcess, 0, U"To TextGrid (vuv)...", nullptr, 1, NEW_PointProcess_to_TextGrid_vuv);
1979 	praat_addAction1 (classPointProcess, 0, U"Synthesize -", nullptr, 0, nullptr);
1980 		praat_addAction1 (classPointProcess, 0, U"To Sound (pulse train)...", nullptr, 1, NEW_PointProcess_to_Sound_pulseTrain);
1981 		praat_addAction1 (classPointProcess, 0, U"To Sound (phonation)...", nullptr, 1, NEW_PointProcess_to_Sound_phonation);
1982 		praat_addAction1 (classPointProcess, 0, U"To Sound (hum)", nullptr, 1, NEW_PointProcess_to_Sound_hum);
1983 	praat_addAction1 (classPointProcess, 0, U"Convert -", nullptr, 0, nullptr);
1984 		praat_addAction1 (classPointProcess, 0, U"Hack", nullptr, 1, nullptr);
1985 			praat_addAction1 (classPointProcess, 0, U"To Matrix", nullptr, 2, NEW_PointProcess_to_Matrix);
1986 			praat_addAction1 (classPointProcess, 0, U"Up to TextTier...", nullptr, 2, NEW_PointProcess_upto_TextTier);
1987 			praat_addAction1 (classPointProcess, 0, U"Up to PitchTier...", nullptr, 2, NEW_PointProcess_upto_PitchTier);
1988 			praat_addAction1 (classPointProcess, 0, U"Up to IntensityTier...", nullptr, 2, NEW_PointProcess_upto_IntensityTier);
1989 	praat_addAction1 (classPointProcess, 0, U"Combine -", nullptr, 0, nullptr);
1990 		praat_addAction1 (classPointProcess, 2, U"Union", nullptr, 1, NEW1_PointProcesses_union);
1991 		praat_addAction1 (classPointProcess, 2, U"Intersection", nullptr, 1, NEW1_PointProcesses_intersection);
1992 		praat_addAction1 (classPointProcess, 2, U"Difference", nullptr, 1, NEW1_PointProcesses_difference);
1993 
1994 	praat_addAction1 (classRealTier, 0, U"RealTier help", nullptr, 0, HELP_RealTier_help);
1995 	praat_addAction1 (classRealTier, 1, U"View & Edit", nullptr, praat_ATTRACTIVE, EDITOR_ONE_WITH_ONE_RealTier_viewAndEdit);
1996 	praat_addAction1 (classRealTier, 1,   U"Edit", U"*View & Edit", praat_DEPRECATED_2011, EDITOR_ONE_WITH_ONE_RealTier_viewAndEdit);
1997 	praat_addAction1 (classRealTier, 0, U"View & Edit with Sound?", nullptr, 0, HINT_RealTier_Sound_viewAndEdit);
1998 	praat_addAction1 (classRealTier, 0, U"Query -", nullptr, 0, nullptr);
1999 		praat_TimeTier_query_init (classRealTier);
2000 		praat_addAction1 (classRealTier, 1, U"-- get content --", nullptr, 1, nullptr);
2001 		praat_addAction1 (classRealTier, 1, U"Get value at time...", nullptr, 1, REAL_RealTier_getValueAtTime);
2002 		praat_addAction1 (classRealTier, 1, U"Get value at index...", nullptr, 1, REAL_RealTier_getValueAtIndex);
2003 	praat_addAction1 (classRealTier, 0, U"Modify -", nullptr, 0, nullptr);
2004 		praat_TimeTier_modify_init (classRealTier);
2005 		praat_addAction1 (classRealTier, 0, U"Add point...", nullptr, 1, MODIFY_RealTier_addPoint);
2006 		praat_addAction1 (classRealTier, 0, U"Formula...", nullptr, 1, MODIFY_RealTier_formula);
2007 	praat_addAction1 (classRealTier, 0, U"Convert", nullptr, 0, nullptr);
2008 		praat_addAction1 (classRealTier, 0, U"Down to PointProcess", nullptr, 0, NEW_RealTier_downto_PointProcess);
2009 		praat_addAction1 (classRealTier, 0, U"Down to TableOfReal", nullptr, 0, NEW_RealTier_downto_TableOfReal);
2010 	praat_addAction1 (classRealTier, 0, U"Cast", nullptr, 0, nullptr);
2011 		praat_addAction1 (classRealTier, 0, U"To PitchTier", nullptr, 0, NEW_RealTier_to_PitchTier);
2012 		praat_addAction1 (classRealTier, 0, U"To IntensityTier", nullptr, 0, NEW_RealTier_to_IntensityTier);
2013 		praat_addAction1 (classRealTier, 0, U"To DurationTier", nullptr, 0, NEW_RealTier_to_DurationTier);
2014 		praat_addAction1 (classRealTier, 0, U"To AmplitudeTier", nullptr, 0, NEW_RealTier_to_AmplitudeTier);
2015 
2016 	praat_addAction1 (classSpectrumTier, 0, U"Draw...", nullptr, 0, GRAPHICS_SpectrumTier_draw);
2017 	praat_addAction1 (classSpectrumTier, 0, U"Tabulate -", nullptr, 0, nullptr);
2018 		praat_addAction1 (classSpectrumTier, 1, U"List...", nullptr, 1, LIST_SpectrumTier_list);
2019 		praat_addAction1 (classSpectrumTier, 0, U"Down to Table", nullptr, 1, NEW_SpectrumTier_downto_Table);
2020 	praat_addAction1 (classSpectrumTier, 0, U"Remove points below...", nullptr, 0, MODIFY_SpectrumTier_removePointsBelow);
2021 
2022 	praat_addAction2 (classAmplitudeTier, 1, classSound, 1, U"View & Edit", nullptr, praat_ATTRACTIVE, EDITOR_ONE_WITH_ONE_AmplitudeTier_viewAndEdit);
2023 	praat_addAction2 (classAmplitudeTier, 1, classSound, 1,   U"Edit", U"*View & Edit", praat_DEPRECATED_2011, EDITOR_ONE_WITH_ONE_AmplitudeTier_viewAndEdit);
2024 	praat_addAction2 (classAmplitudeTier, 1, classSound, 1, U"Multiply", nullptr, 0, NEW1_Sound_AmplitudeTier_multiply);
2025 	praat_addAction2 (classDurationTier, 1, classSound, 1, U"View & Edit", nullptr, praat_ATTRACTIVE, EDITOR_ONE_WITH_ONE_DurationTier_edit);
2026 	praat_addAction2 (classDurationTier, 1, classSound, 1,   U"Edit", nullptr, praat_DEPRECATED_2011, EDITOR_ONE_WITH_ONE_DurationTier_edit);
2027 	praat_addAction2 (classFormantGrid, 1, classSound, 1, U"Filter", nullptr, 0, NEW1_Sound_FormantGrid_filter);
2028 	praat_addAction2 (classFormantGrid, 1, classSound, 1, U"Filter (no scale)", nullptr, 0, NEW1_Sound_FormantGrid_filter_noscale);
2029 	praat_addAction2 (classFormantTier, 1, classSound, 1, U"Filter", nullptr, 0, NEW1_Sound_FormantTier_filter);
2030 	praat_addAction2 (classFormantTier, 1, classSound, 1, U"Filter (no scale)", nullptr, 0, NEW1_Sound_FormantTier_filter_noscale);
2031 	praat_addAction2 (classIntensityTier, 1, classPointProcess, 1, U"To IntensityTier", nullptr, 0, NEW1_IntensityTier_PointProcess_to_IntensityTier);
2032 	praat_addAction2 (classIntensityTier, 1, classSound, 1, U"View & Edit", nullptr, praat_ATTRACTIVE, EDITOR_ONE_WITH_ONE_IntensityTier_viewAndEdit);
2033 	praat_addAction2 (classIntensityTier, 1, classSound, 1,   U"Edit", U"*View & Edit", praat_DEPRECATED_2011, EDITOR_ONE_WITH_ONE_IntensityTier_viewAndEdit);
2034 	praat_addAction2 (classIntensityTier, 1, classSound, 1, U"Multiply...", nullptr, 0, NEW1_Sound_IntensityTier_multiply);
2035 	praat_addAction2 (classIntensityTier, 1, classSound, 1,   U"Multiply", U"*Multiply...", praat_DEPRECATED_2005, NEW1_Sound_IntensityTier_multiply_old);
2036 	praat_addAction2 (classPitchTier, 1, classPointProcess, 1, U"To PitchTier", nullptr, 0, NEW1_PitchTier_PointProcess_to_PitchTier);
2037 	praat_addAction2 (classPitchTier, 1, classSound, 1, U"View & Edit", nullptr, praat_ATTRACTIVE, EDITOR_ONE_WITH_ONE_PitchTier_viewAndEdit);
2038 	praat_addAction2 (classPitchTier, 1, classSound, 1,   U"Edit", U"*View & Edit", praat_DEPRECATED_2011, EDITOR_ONE_WITH_ONE_PitchTier_viewAndEdit);
2039 	praat_addAction2 (classPointProcess, 1, classSound, 1, U"View & Edit", nullptr, praat_ATTRACTIVE, EDITOR_ONE_WITH_ONE_PointProcess_viewAndEdit);
2040 	praat_addAction2 (classPointProcess, 1, classSound, 1,   U"Edit", U"*View & Edit", praat_DEPRECATED_2011, EDITOR_ONE_WITH_ONE_PointProcess_viewAndEdit);
2041 praat_addAction2 (classPointProcess, 1, classSound, 1, U"Query", nullptr, 0, nullptr);
2042 	praat_addAction2 (classPointProcess, 1, classSound, 1, U"Get shimmer (local)...", nullptr, 0, REAL_Point_Sound_getShimmer_local);
2043 	praat_addAction2 (classPointProcess, 1, classSound, 1, U"Get shimmer (local_dB)...", nullptr, 0, REAL_Point_Sound_getShimmer_local_dB);
2044 	praat_addAction2 (classPointProcess, 1, classSound, 1, U"Get shimmer (apq3)...", nullptr, 0, REAL_Point_Sound_getShimmer_apq3);
2045 	praat_addAction2 (classPointProcess, 1, classSound, 1, U"Get shimmer (apq5)...", nullptr, 0, REAL_Point_Sound_getShimmer_apq5);
2046 	praat_addAction2 (classPointProcess, 1, classSound, 1, U"Get shimmer (apq11)...", nullptr, 0, REAL_Point_Sound_getShimmer_apq11);
2047 	praat_addAction2 (classPointProcess, 1, classSound, 1, U"Get shimmer (dda)...", nullptr, 0, REAL_Point_Sound_getShimmer_dda);
2048 praat_addAction2 (classPointProcess, 1, classSound, 1, U"Modify", nullptr, 0, nullptr);
2049 	praat_addAction2 (classPointProcess, 1, classSound, 1, U"Transplant time domain", nullptr, 0, MODIFY_Point_Sound_transplantDomain);
2050 praat_addAction2 (classPointProcess, 1, classSound, 1, U"Analyse", nullptr, 0, nullptr);
2051 	/*praat_addAction2 (classPointProcess, 1, classSound, 1, U"To Manipulation", nullptr, 0, NEW1_Sound_PointProcess_to_Manipulation);*/
2052 	praat_addAction2 (classPointProcess, 1, classSound, 1, U"To AmplitudeTier (point)", nullptr, 0, NEW1_PointProcess_Sound_to_AmplitudeTier_point);
2053 	praat_addAction2 (classPointProcess, 1, classSound, 1, U"To AmplitudeTier (period)...", nullptr, 0, NEW1_PointProcess_Sound_to_AmplitudeTier_period);
2054 	praat_addAction2 (classPointProcess, 1, classSound, 1, U"To Ltas...", nullptr, 0, NEW1_PointProcess_Sound_to_Ltas);
2055 	praat_addAction2 (classPointProcess, 1, classSound, 1, U"To Ltas (only harmonics)...", nullptr, 0, NEW1_PointProcess_Sound_to_Ltas_harmonics);
2056 praat_addAction2 (classPointProcess, 1, classSound, 1, U"Synthesize", nullptr, 0, nullptr);
2057 	praat_addAction2 (classPointProcess, 1, classSound, 1, U"To Sound ensemble...", nullptr, 0, NEW1_Sound_PointProcess_to_SoundEnsemble_correlate);
2058 	praat_addAction2 (classRealTier, 1, classPointProcess, 1, U"To RealTier", nullptr, 0, NEW1_RealTier_PointProcess_to_RealTier);
2059 	praat_addAction2 (classRealTier, 1, classSound, 1, U"View & Edit", nullptr, praat_ATTRACTIVE, EDITOR_ONE_WITH_ONE_RealTier_viewAndEdit);
2060 	praat_addAction2 (classRealTier, 1, classSound, 1,   U"Edit", U"*View & Edit", praat_DEPRECATED_2011, EDITOR_ONE_WITH_ONE_RealTier_viewAndEdit);
2061 }
2062 
2063 /* End of file praat_Tiers.cpp */
2064