Praat scripting notes: Difference between revisions

From Helpful
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 4: Line 4:
<!--
<!--


Types
There are broadly two types: numeric and string


Form types
 
  sentence
Form types [https://www.fon.hum.uva.nl/praat/manual/Scripting_6_1__Arguments_to_the_script.html] represent types and some GUI filtering of their values
word - string without spaces
  sentence - string with spaces
text - string with spaces
  comment
  comment
real
positive - real > 0
  integer
  integer
  positive
  natural - integer >= 1
 
realvector
positivevector
integervector
naturalvector
boolean
choice
option
infile
outfile
folder
 
 




Line 22: Line 43:


String variable names end with dollar, numerics do not
String variable names end with dollar, numerics do not
fileReadable(path$) - returns 1 if readable, 0 if not
readfile$(path$) - return file contents as string
readfile(path$) - return number from text file
https://www.fon.hum.uva.nl/praat/manual/_readFile-S_.html




Line 30: Line 60:
  runSubprocess$(cmd$) - runSubprocess(cmd$) and return its output
  runSubprocess$(cmd$) - runSubprocess(cmd$) and return its output
  runSystem$
  runSystem$
runScript [https://www.fon.hum.uva.nl/praat/manual/_runScript_.html]
pauseScript [https://www.fon.hum.uva.nl/praat/manual/_pauseScript_.html]
sendsocket fonsg19.hum.uva.nl:6667 display hallo.wav
https://www.fon.hum.uva.nl/praat/manual/Scripting_6_9__Calling_from_the_command_line.html




Line 75: Line 118:




* [ select all
* [ Remove




Line 93: Line 132:




for i from 1 to nFiles
for i from 1 to nFiles
  mycode
    mycode
endfor
endfor
 
while x < 0
    x = x + 2 * pi
endwhile
 
throws = 0
repeat
    eyes = randomInteger (1, 6) + randomInteger (1, 6)
    throws = throws + 1
until eyes = 12
writeInfoLine: "It took me ", throws, " trials to throw 12 with two dice."
 
 


if i < 20 and word$ = “STIM”
if i < 20 and word$ = “STIM”
Line 104: Line 156:
   do this
   do this
endif
endif
Procedures:
https://www.fon.hum.uva.nl/praat/manual/Scripting_5_5__Procedures.html




Line 120: Line 188:
Why does "Get number of files" or "Get String" work?
Why does "Get number of files" or "Get String" work?


'''Get is a little magical'''


 
* Get mean...
 
'''Get is a little magical'''





Revision as of 13:11, 20 June 2024