# # Run sample scripts for digit-string experiment # (only the parts dealing with digit durations) # # # We start with audio/TextGrid pairs: # MYL_List8.wav MYL_List8.TextGrid # MYL_NList4.wav MYL_NList4.TextGrid # MYL_NList4a.wav MYL_NList4a.TextGrid # ################################################################# # # 1. To look at the effects of phrase position on duration. # We run praat scripts to get durations from TextGrid files: # ################################################################# # praat GetDurations MYL_List8 1 praat GetDurations MYL_NList4 1 praat GetDurations MYL_NList4a 1 # # (MYL_NList4a is one number string recorded separately) # # Outputs are in e.g. MYL_List8.dur1 # # Format is one label per line, e.g. # # 2.095 0 2.095 #034 # 0.356 2.095 2.451 6 # 0.356 2.451 2.807 0 # 0.437 2.807 3.244 6 # 0.224 3.244 3.468 8 # 0.373 3.468 3.841 7 # 0.236 3.841 4.077 3 # 0.437 4.077 4.513 4 # ################################################### # # 2. Now, since all our phrases are 7-digit numbers, # it's convenient to make a data matrix # where each line is one digit string. # ################################################### # for f in MYL_List8 MYL_NList4 MYL_NList4a do gawk ' # string number: NF==4 && ($4 ~ /^[#][0-9]+$/) { if(onw)printf("\n") # except at first, start a new line printf("\"%s\"",$4) # put quotes around string number onw=1 } # digit label: NF==4 && ($4 ~ /^[0-9]$/) {printf(" %s %g",$4,$1)} END {printf("\n")}' $f.dur1 >$f.ldur1 done # ######################################################### # # 3. A wrinkle -- we need to combine NList4 and NList4a # and use 'sort' to get all the lines in order again # (because one of the strings was wrong in the first recording) # ######################################################### # cat MYL_NList4.ldur1 MYL_NList4a.ldur1 | sort >MYL_NList4.out # # ######################################################## # # 4. And now we can run an R script to create some plots: ######################################################## # R --vanilla