I am trying to make a praatscript that extracts jitter and shimmer values from each interval of a textgrid (phoneme).
I define all necessary objects before looping through the intervals, and then call jitter or shimmer at each interval. All jitter functions work fine, but shimmer functions produce an error:
"Command "Get shimmer (local)..." not available for current selection."
I can't figure out the cause of this. I don't see a reason why jitter works for the selection but not shimmer. The praatscript is as follows.
select Sound 'thisSound$'
To Pitch (ac): 0, 100, 15, "yes", 0.03, 0.45, 0.01, 0.35, 0.14, 500
select Sound 'thisSound$'
To PointProcess (periodic, cc)... 100 500
select Sound 'thisSound$'
To Harmonicity (cc)... 0.01 100 0.1 1
# Loop through each interval on the phoneme tier.
for thisInterval from 1 to numberOfPhonemes
# Get the label of the interval
select TextGrid 'thisTextGrid$'
thisPhoneme$ = Get label of interval: 1, thisInterval
# Jitter measurements
select PointProcess 'thisSound$'
meanlocaljitter = Get jitter (local)... thisPhonemeStartTime thisPhonemeEndTime 0.0001 0.02 1.3
select PointProcess 'thisSound$'
meanlocalshimmer = Get shimmer (local)... thisPhonemeStartTime thisPhonemeEndTime 0.0001 0.02 1.3 1.6
I have tried not reselecting the PointProcess. I have also tried other variations of shimmer functions with no success.. I dont understand why the shimmer command can't run on the selection if the jitter command can?
Thanks for your help!
For the shimmer command, you need to have a sound object and a point process object selected.
So add something like the following before the line where you run the shimmer command: