###This is a PRAAT-Script that draws a sound selection together with ###textgrid and pitch contour from thr Editor window into the Praat picture window ##########Before running the script you need to #### fully highlight all the sound selection in the editor window (the visible part needs to match with your selection ) and ####check Show pitch in the Menu select all name$=selected$("TextGrid") editor Extract sound selection (preserve times) #Show pitch Extract visible pitch contour start_selec=Get start of selection end_selec=Get end of selection lenght_selec=Get selection length endeditor Erase all form Viewport definition real left_viewport_horiz 0 real right_viewport_horiz 12 real left_viewport_verti 0 real right_viewport_verti 7 comment top_text(=leave empty if you want) text top_text endform Select outer viewport... left_viewport_horiz right_viewport_horiz left_viewport_verti right_viewport_verti select TextGrid 'name$' Draw... start_selec end_selec yes yes yes select Sound untitled right_viewport_verti2=right_viewport_verti/3 Select outer viewport... left_viewport_horiz right_viewport_horiz left_viewport_verti right_viewport_verti2 Draw... 0 0 0 0 no curve select Pitch untitled left_viewport_verti2=right_viewport_verti/5.4 right_viewport_verti3=right_viewport_verti-left_viewport_verti2 Select outer viewport... left_viewport_horiz right_viewport_horiz left_viewport_verti2 right_viewport_verti3 Speckle semitones... 0 0 -12 30 no Marks left every... 1 3 yes yes yes Select outer viewport... left_viewport_horiz right_viewport_horiz left_viewport_verti right_viewport_verti Text top... yes 'top_text$' select Pitch untitled Remove select Sound untitled Remove ############Sven Grawunder, MPI Eva Leipzig, 12/2006