Skip to content

Commit

Permalink
fixed bug which set intervalLabel when trying to use intervalNum
Browse files Browse the repository at this point in the history
  • Loading branch information
kirbyj committed Dec 16, 2017
1 parent 7f4088d commit 7ca81d2
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
6 changes: 6 additions & 0 deletions getoq.praat
Expand Up @@ -155,6 +155,12 @@ procedure getoq: .manualCheck
################################

if .manualCheck == 1
## Remove existing Matrix objects since new ones will be created
select Matrix 'name$'_degg
plus Matrix 'name$'_howard
Remove

## Now add/remove points
select PointProcess 'name$'_degg_both
plus Sound 'name$'_degg
View & Edit
Expand Down
5 changes: 3 additions & 2 deletions oqmaster.praat
Expand Up @@ -45,7 +45,7 @@ form File info
integer intervalTier 3
comment Label of interval of interest (blank for none/all)
word intervalLabel v
comment Number of interval interest (0 for none/all)
comment Number of interval of interest (0 for none/all)
integer intervalNum 0
comment Separator (-, _ ...) when parsing token names
word separator _
Expand Down Expand Up @@ -131,7 +131,8 @@ for x from startFile to number_of_files
start_time = Get start time of interval... intervalTier intervalNum
end_time = Get end time of interval... intervalTier intervalNum
## overwrite intervalLabel$ with something more useful
intervalLabel$ = Get label of interval... intervalTier intervalNum
## problem: doing this means that we will not enter this condition next time
#intervalLabel$ = Get label of interval... intervalTier intervalNum

## if nothing, just use the label of the first tier
else
Expand Down
14 changes: 12 additions & 2 deletions writelns.praat
Expand Up @@ -21,17 +21,27 @@ procedure writelns
## be dealt with at the analysis stage (e.g., by replacing 0s with
## NAs in R).

## get interval label if we don't have it
if intervalNum <> 0
select TextGrid 'name$'
printIntervalLabel$ = Get label of interval... intervalTier intervalNum
else
printIntervalLabel$ = intervalLabel$
endif

for i from 1 to nb_periods-1
## DEGG
select Matrix 'name$'_degg
currPeriod = Get value in cell... i 1
pstart = Get value in cell... i 2
pend = Get value in cell... i 3
f0 = Get value in cell... i 4
degg_oq = Get value in cell... i 5
appendFileLine: "'directory$''outfile$'", name$, ",", lingVars$, intervalLabel$, ",degg,", currPeriod, ",", pstart, ",", pend, ",", f0, ",", degg_oq
appendFileLine: "'directory$''outfile$'", name$, ",", lingVars$, printIntervalLabel$, ",degg,", currPeriod, ",", pstart, ",", pend, ",", f0, ",", degg_oq
## Howard
select Matrix 'name$'_howard
howard_oq = Get value in cell... i 5
appendFileLine: "'directory$''outfile$'", name$, ",", lingVars$, intervalLabel$, ",howard,", currPeriod, ",", pstart, ",", pend, ",", f0, ",", howard_oq
appendFileLine: "'directory$''outfile$'", name$, ",", lingVars$, printIntervalLabel$, ",howard,", currPeriod, ",", pstart, ",", pend, ",", f0, ",", howard_oq
endfor

## Save PointProcess object
Expand Down

0 comments on commit 7ca81d2

Please sign in to comment.