

We typed the (case-sensitive!) name of the command from the Object Window, followed by a colon, then we typed a list of numbers separated by commas. Set aside for a moment the initial "formObj = ", we'll come back to that. We're going to turn this into code:įormObj = To Formant (burg): 0, 5, 5500, 0.025, 50Īnalyze this carefully and pay attention to the details. , but don't hit enter, leave the popup window open and visible. Click on the Sound object to select it, select Analyse spectrum - To Formant (Burg).

Remove that Formant object we created, and open a new script from Praat > New Praat Script, save it as something like "commandsPractice.praat".
Praat software download how to#
So now let's start thinking about how to turn these commands into code. There's a lot of stuff there I had never heard of before but ended up making my life easier. Take a peek at what kind of objects Praat has in the manual, search for Types of objects. Similarly, if you want to look at Pitch, you can select a Sound object and create a Pitch object (Analyse periodicity-), and likewise for intensity. Everything available to you in the familiar Editor Window, and much more, is available to you through these commands. Make sure it's selected and check out the buttons on the right, particularly Query. Click "Analyse spectrum > To Formant (burg)." and accept the default values. Let's say you're planning on doing some formant analyses. Look at the buttons on the right, see what's available. Click on the Sound object so it's the only one highlighted. Start to click on them to get some ideas. The commands contained in these buttons are the ones we will emulate in our scripts. Instead of clicking View & Edit, look at the other buttons on the right panel of the object window (such as Draw., Extract -, or Query -). (What would happen if a popup window from another application came up? Mice work with coordinates on the screen, what if your window is not in exactly the same place the next time you run the program?) It's important for you to understand that your script is not a copy of what you do with your mouse. Don't think about scripting the editors until you are already comfortable with scripting, and you know exactly what you're doing, because 99% of the time there is a better way. IN PRAAT SCRIPTS, YOU WILL ALMOST NEVER BE USING THESE WINDOWS, and there are good reasons for it. Normally, in point and click interaction with Praat, you would click View & Edit, and use the dropdown menus and mouse clicks to do your analyses. You should see a Sound object and a TextGrid object in Praat's object window, both named "consonants". Open Praat, and open consonants.wav and consonants.TextGrid found in the folder "praatTutorial/sampleData/".
Praat software download zip file#
If you haven't already downloaded the zip file that accompanies the tutorial, go to the Downloads page in the top right menu, and put it in your "Documents" folder. So how do you find out what you are able to do with Praat's scripting language? What objects and commands are available to you? What you need now to be able to use this knowledge is to find out what Praat's capabilities are, and later to repeat the actions you want. You are starting to understand how to use variables, and that you have to pay attention to the type of variable (number or string). We are now ready to start talking about doing useful things in Praat.
