#Aquest script permet d'extreure els valors de temps (tira 1) i d'f0 (tira 2) a partir d'una textgrid en què haurem marcat #els punts que ens interessen. En aquest cas, tenim 5 punts de temps (tira 1) i 2 punts d'f0 (tira 2). #1 de febrer de 2010 form Enter parent directory names comment Enter directory name where sound files are kept: sentence dirSound comment Enter directory name where text grid files are kept: sentence dirTextGrid endform Create Strings as file list... Sounds 'dirSound$'\*.wav Create Strings as file list... TextGrids 'dirTextGrid$'\*.TextGrid select Strings Sounds Sort select Strings TextGrids Sort numberOfFiles = Get number of strings Create Table... table numberOfFiles 7 Set column label (index)... 1 Name Set column label (index)... 2 t0 Set column label (index)... 3 s0 Set column label (index)... 4 sf Set column label (index)... 5 tp Set column label (index)... 6 tf Set column label (index)... 7 l Set column label (index)... 8 h for i to numberOfFiles select Strings TextGrids gridName$ = Get string... i Read from file... 'dirTextGrid$'\'gridName$' a = Get time of point... 1 1 t0 = a*1000 t0$ = fixed$ ('t0', 3) b = Get time of point... 1 2 s0 = b*1000 s0$ = fixed$ ('s0', 3) c = Get time of point... 1 3 sf = c*1000 sf$ = fixed$ ('sf', 3) d = Get time of point... 1 4 tp = d*1000 tp$ = fixed$ ('tp', 3) f = Get time of point... 1 5 tf = f*1000 tf$ = fixed$ ('tf', 3) tl = Get time of point... 2 1 th = Get time of point... 2 2 select Table table select Table table Set string value... i t0 't0$' Set string value... i s0 's0$' Set string value... i sf 'sf$' Set string value... i tp 'tp$' Set string value... i tf 'tf$' select Strings Sounds soundName$ = Get string... i Read from file... 'dirSound$'\'soundName$' To Pitch... 0 75 600 l = Get value at time... 'tl' Hertz Linear l$ = fixed$ ('l', 2) h = Get value at time... 'th' Hertz Linear h$ = fixed$ ('h', 2) l$ = fixed$ ('l', 2) h$ = fixed$ ('h', 2) select Table table Set string value... i Name 'soundName$' Set string value... i l 'l$' Set string value... i h 'h$' select all minus Strings Sounds minus Strings TextGrids minus Table table Remove endfor form Write Table to table file: sentence dirTable endform select all minus Table table Remove exit