Praat Scripting Language Tutorial
spring 2014 | GLSA workshop / sociophonetics
PSL in a nutshell:what you need to know to read, write, modify, and develop scripts
editor:Shuo Zhang | PSLtut (main)site(sociophonetics) | FAQ | exercises | Praat Script Archive
official references: scripting (official) | formulas(official)
editor:Shuo Zhang | PSLtut (main)site(sociophonetics) | FAQ | exercises | Praat Script Archive
official references: scripting (official) | formulas(official)
META@ What is PSL?
Praat Scripting Language is a scripting language used to: (1)automate and control commands and actions in defined Praat; (2)perform some general programming tasks; (3)maybe more. @ What can PSL do? Often people think of PSL as just automating repeated actions that you can perform manually in Praat. But the truth is, the PSL gives you a powerful tool to do much more that you cannot do manually, either because of the sheer volume of the commands and actions, or due to the nature of the task that requires more sophisticated control of the flow or computation. In general, if you are doing something manually in Praat, chances are you can script it, even you think it might be impossible. Look at types of tasks outline on this page for an idea. @ What is a scripting language? In general and in this context, scripting language is used in a specific domain to automate the execution of tasks which could alternatively be executed one-by-one by a human operator (Wikipedia). Other loose uses of "scripts" include referring to high-level but general purpose programming languages such as python and perl as scripts. The distinction is obvious: you can use a general purpose programming language to do many more things (such as create a video game) that you cannot do with a scripting language. @ Why is PSL easy to learn? PSL is indeed a good place to start learning about programming for two reasons. First, it is very high level, meaning it's close to human languages and farther from the languages machine can interpret. Second, because PSL is used in special domain and is not general purpose, there is only a limited set of modules you will need to learn to master the inventory of things you can do. This is very NOT overwhelming for beginners. (see a comparison) @ Why use PSL? (points due to Shigeto Kawahara)
LANGUAGE ELEMENTS
|
3 WAYS OF DOING PSL
INPUT&OUTPUT
TYPES OF COMMON TASKS
MISC.& ADVANCED TOPICS
THE HARD PART
SOMETHING TO WORK ON
|
baka_n_p2.textgrid |
baka_n_p2.wav |
f1-f2-general2.praat |
modification-task.praat |
More programming/scripting challenges/links
- The only way to learn scripting is to write them! Here you can work through a set of challenges/tasks I wrote. Have fun!
- Praat user group (ask if there is a hard question)
- my Praat Script Archive