This goes slightly differently on the Windows platform on the one hand, and on the Mac and Linux platforms on the other. In a script you can either supply the complete path to the file, or supply a relative path.Ī complete path includes both the folder (directory) hierarchy and the name of the file. File selector windows ask the user to supply a single argument: the file name. The commands from the Open and Save menus, and several other commands whose names start with Read, Open, or Save, present a file selector window instead of a typical Praat settings window. text), and you can treat it as a string with the string methods described later on in this tutorial. You should remember, however, that the result is still a string (i.e. The tilde is probably the preferred way to write formula arguments. This means that you can write the example of section 4 in an analogous way:Ĭreate Sound from formula: “sine”, 1, 0.0, 1.0, 44100, ~ 1/2 * sin(2*pi*377*x) Therefore, there exists a special way for typing formula arguments, namely with the tilde ("~"):įormula: "correct", ~ self$ = self$ The required doubling of string-internal double quotes is awkward. Representation of strings, you would have to write this in the following way in a script:įormula: "correct", "self$ = self$ " command:Īccording to section 4 above, and according to Formulas 2.2. You would do this by selecting the Table and choosing the Formula. Imagine you have a Table object with a column “stimulus”, a column “response”, and a column “correct”, and you want to have a 1 in column “correct” if the texts in the columns “stimulus” and “response” are the same, and a 0 otherwise. Sometimes it would be a bit awkward to write a formula that contains double quotes. In a script they are written within quotes. in the New menu:Ĭreate Sound from formula: “sine”, 1, 0.0, 1.0, 44100, “1/2 * sin(2*pi*377*x)”īoth the first argument ( Name) and the sixth argument ( Formula) are text arguments. This last example will therefore again look like the following in a script:Ĭonsider another frequently used menu command, namely Create Sound from formula. In supplying arguments to a command in a script, there is no difference between an option menu and a radio box. For instance, the last example above could equally well have looked like "Curve" or "Poles" in the examples.Ī multiple-choice argument is sometimes represented by a choice box instead of by an option menu. In the script you write the text of the choice, i.e. The sixth argument in the above examples ( Drawing method) is a multiple-choice argument and is represented by an option menu. In the script you write it as "yes" (including the quotes) or "no" (or as 1 or 0). The fifth argument in the above examples ( Garnish) is a boolean argument (yes/no choice) and is represented by a check button. You just write them in the script as you would write them into the settings window. The first four arguments in the above examples are numeric arguments: they are (real or integer) numbers. If you want to draw the sound with different settings, say from 1 to 3.2 seconds, scaled between -1 and +1 instead of automatically, with garnishings off, and with the waveform drawn as poles, you would have the following settings window: The texts “(= all)” and “(= auto)” above are just Praat’s explanations of what it means to type a zero in those fields (namely “draw all times” and “use vertical autoscaling”, respectively) in a script they are superfluous and you shouldn’t write them. You see that in a script, all of the arguments are supplied after the command, preceded by a colon and separated by commas, in the same order as in the settings window, counted from top to bottom (and, within a line, from left to right). Pressing the OK button in the above window is equivalent to executing the following script line: In this example, all the settings have their standard values: you want to draw the whole time domain of the Sound, you want to have autoscaling vertically, you want to see garnishings around the picture (a box, labelled axes, and numbers), and you want the waveform to be drawn as a curve. six so-called settings (or in programming jargon: arguments): will appear in the Draw menu, and when you click it, Praat will present you with a settings window, which asks you to supply six pieces of additional information, i.e. Most commands in Praat require the user to supply additional information these are the commands whose title ends in “.”.įor instance, when you select a Sound, the command Draw. Not all menu commands are as simple as those on the previous page, which act immediately once you choose them from a menu (e.g.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |