-
Notifications
You must be signed in to change notification settings - Fork 36
/
point_dumper.praat
28 lines (22 loc) · 1 KB
/
point_dumper.praat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# This spits the labels of all the points on Tier, along with their timepoints
# Written by Will Styler, for Meghan Dabkowski
# Specify where you want the output to live
resultfile$ = "/Users/stylerw/Desktop/results.txt"
header_row$ = "SoundFile" + tab$ + "Point" + tab$ + "Label" + tab$ + "TimepointSeconds" + newline$
fileappend "'resultfile$'" 'header_row$'
# This works on whatever sound you have selected in the objects window. Make sure the Textgrid is in the objects window too.
sn$ = selected$ ("Sound")
select Sound 'sn$'
select TextGrid 'sn$'
# Change the below "1" to "2" if your points are on tier 2
numint = Get number of points... 1
# Start the loop
for i from 1 to numint
select TextGrid 'sn$'
# Change the below "1" to "2" if your points are on tier 2
label$ = Get label of point... 1 'i'
time = Get time of point... 1 'i'
# Spit the results into a text file
result_row$ = "'sn$'" + tab$ + "'i'" + tab$ + "'label$'" + tab$ + "'time:5'" + newline$
fileappend "'resultfile$'" 'result_row$'
endfor