0

I need to find the second to last segment in a segment tier (1) within a word on the word tier (3). So far, I have:

# Find the word in the word tier
n = Get number of intervals: 3
for i to n
  label$ = Get label of interval: 3, i
  if label$ == ‘.word$’
    index = i
    i += n
  endif
endfor

# get the start and end point of that word
startingpoint = Get starting point... 3 index
endpoint = Get end point... 3 index

and then I'm not sure how to limit the search to just the word I found previously. The easiest way to approach this, I think, is if there was some way to count the intervals on tier 1 within the word boundary get the information from the total number of intervals - 1.

1

I believe I have found a way to do what I want by adding this to the above script:

 # get the last_segment interval number
 last_segment = Get low interval at time: 1, endpoint
 penult_segment = last_segment - 1

 # get vowel label and start and end
 vowellabel$ = Get label of interval: 1, penult_segment

 # get the start time and end time of the interval
 vowelstart = Get starting point... 1 penult_segment
 vowelend = Get end point... 1 penult_segment
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.