# sound file and textgrid # Made 2013/11/11 # By Toshio Matsuura # wav file and textgrid file must have the same name. form Painter sentence Directory C:\root\ word filename word starttime 0 word endtime 1.5 word spec_max 5000 word dynamic_range 50 word pitch_max 500 word pitch_min 0 endform #open file Read from file... 'directory$'/'filename$'.wav Read from file... 'directory$'/'filename$'.TextGrid Erase all do ("Font size...", 12) do ("Black") select Sound 'filename$' do ("Select inner viewport...", 0.5, 5, 0.5, 1) do ("Draw...", 'starttime$', 'endtime$', 0, 0, "no", "Curve") #do ("Draw inner box") #paint spectrogram do ("To Spectrogram...", 0.005, 'spec_max$', 0.002, 20, "Gaussian") do ("Select inner viewport...", 0.5, 5, 1, 2.5) do ("Paint...", 'starttime$', 'endtime$', 0, 'spec_max$', 100, "yes", 50, 6, 0, "no") do ("Draw inner box") do ("Marks left...", 2, "yes", "no", "no") #paint pitch #if you want to change color of pitch, remove # #do ("Blue") selectObject ("Sound 'filename$'") do ("To Pitch...", 0.01, 75, 600) do ("Speckle...", 'starttime$', 'endtime$', 0, 500, "no") do ("Marks right...", 2, "yes", "no", "no") #paint textgrid #if you changed color, remove # #do ("Black") selectObject ("TextGrid 'filename$'") do ("Select inner viewport...", 0.5, 5, 0.5, 3.2) do ("Draw...", 'starttime$', 'endtime$', "yes", "yes", "no") do ("Marks bottom...", 2, "yes", "no","no") #text do ("Axes...", 0, 100, 0, 100) do ("Text special...", -5, "centre", 50, "half", "Times", 12, "90", "Spectrogram (Hz)") do ("Text special...", 105, "centre", 50, "half", "Times", 12, "270", "Pitch (Hz)") do ("Text special...", 50, "centre", -10, "half", "Times", 12, "0", "Time (sec.)") do ("Draw inner box") do ("Select outer viewport...", 0.1, 5.4, 0.45, 3.6)