qerthi.blogg.se

Praat shortcuts
Praat shortcuts












praat shortcuts

Variables are where the true power and flexibility of programming come to play. You could have written appendInfoLine: 3 + 8, but that would be short-sighted. Here we assign two variables, add them up, and print the result to the Info Window.

PRAAT SHORTCUTS SERIES

You abstract away from a specific number and just have an entity that represents a number, which can be changed and reused in a series of commands, no matter what it's value is: We can treat this variable just like a number, make calculations with it, change its value, rinse and repeat. Who cares? Why are we talking about variables? Well, VARIABLES ARE INCREDIBLY USEFUL AND ARE BASICALLY THE WHOLE POINT OF PROGRAMMING. We'll talk more about this in the next section. The dollar sign at the end of a variable name is legal, but it has a special meaning in Praat. Which of these are legal variable names in Praat, and why?ġ. You should always stick to one naming convention throughout a script to simplify your life.

praat shortcuts praat shortcuts

I personally prefer camel case because I find it easier to type, but it really doesn't matter. You can either use underscores instead of spaces, or use what's known as camel case, where every subsequent word begins with a capital letter: In order to make variable names more readable there are two common practices used to make up for the lack of spaces. Those of us used to a Roman script have a hard time reading words without spaces (not a problem for you, Thailand!!! Whaddup China!!!). Variables are case sensitive (rollsRoyce is not the same variable as rollsroyce). It cannot contain spaces or other "weird" characters like accents or pound signs or the like. Here are the rules for variable names in Praat (hopefully I haven't left anything out):Ī variable can be composed of a combination of letters and numbers, but Praat requires that it start with a lowercase letter. Check out the error message, and be happy that you understand it. Open a new scripting window, type "Number of kids = 2" (without the quotes), and run it. Short so I won't get mad about typing it a bunch of times and am less likely to type it wrong and meaningful so I won't have trouble remembering what it means when I come back to it a few weeks later.īut why didn't I just write "Number of kids = 2"? Besides being long, this would cause an error and Praat would not finish the script, because it has restrictions on what a variable name can look like. I've chosen a name that is short and meaningful. Hopefully it's easy to guess that this variable represents "number of kids". This isn't really required, but is considered good style and supposedly improves readability of your code.

  • Another thing is that there is a single space on either side of the assignment operator.
  • Its job is to take values and assign them to variables. It doesn't really mean "equals", it's actually called the assignment operator.
  • We use the "=" sign, although there's a subtle difference between the way we normally think of it and the way it's used here.
  • In Praat's language this is a requirement.
  • Secondly, note that the variable (age) is on the left hand side and the value (34) is on the right.
  • no easy answer to that now, hang in there. When I first started learning to program, I found it hard to know what parts in a script were made up by the programmer, and what parts were built-in Praat commands. It might as well have been asdfg (although that's a stupid idea). There are a few key details to note here. which means we've made a container named "age" and have filled it with the number thirty-four. In programmer parlance, we've assigned the number 34 to a variable called "age". Variables are essentially containers that hold information. We will do that soon, but I think that will be much easier to explain and understand in a more profound way if we talk first about variables and data types in PraatĪ fundamental part of programming is manipulating variables. A lot of tutorials at this point would jump right in and start showing you shortcuts to start Praat programming, but please resist the urge.














    Praat shortcuts