2008年11月4日 星期二

Praat script resources

Page contents How to use this page Some basic operations Directory of scripts by type and description Links: other online collections of Praat scripts
How to use this page
How to run a script
Scripts save Praat users time and effort by automating a sequence of operations. To run a Praat script, go to the Control menu in the Praat objects window and select New Praat script. Then pull up the code for the desired script by clicking on one of the links below. Copy all the code there (e.g. highlight and Ctrl-C on a PC) and paste it into the new untitled script window. Finally, select Run > Run (or type Ctrl-R) in the untitled script window to execute the script. How to save a script or add it to the menu
In the open untitled script window with the new script pasted in the text box, go to the File menu to Save the script to a convenient location. The Add to fixed menu... command under File can be used to add the current script to one of the head menus in the Praat objects window. Menus can be edited (e.g. to remove previously added scripts) by going to Control > Preferences > Buttons and clicking on the desired command. How to script in Praat
See the Scripting tutorial under Help in Praat objects or try Setsuko Shirai's tutorial.
Some basic operations
Under construction.
Praat script directory by type and description
Directory categories Sound file management Text grid management Analysis of sounds using text grids Segmentation and extraction Drawing pictures Noise and speech manipulation More sound analysis
Sound file management
get-files (Kevin Ryan)Open multiple files from the specified directory at once.
get-files-from-list (Bert Remijsen)Open multiple files enumerated in a list in the specified text file (BR's description).
remove-all (Kevin Ryan)Remove all objects from object list.
change-sample-rate-or-format (Mietta Lennes)Resample and/or change the format of a set of sound files (ML's description).
concatenate-sounds (Kevin Ryan)Concatenate (daisy-chain) two or more selected Sound objects into one Sound object.
duplicate-sound (Kevin Ryan)Concatenate (daisy-chain) a Sound object with itself the specified number of times.
combine-sounds (Chris Darwin)Combine (merge) two Sounds with specified gains.
script-installation-script (Niels Petersen)An example of a script used to install several scripts to the Praat menus (NP's scripts).
wave-maker (Kevin Ryan)Create multiple varied sine waves at once in the object list and/or a directory (useful for testing scripts).
Text grid management
grid-maker (Kevin Ryan)Make or edit text grids for a set of sound files. See also K. Crosswhite's amply commented grid maker and reviewer scripts (and their descriptions). KR's version improves on these mainly by combining them: if a grid exists, it opens it, otherwise it sets up a new one.
label-from-text-file (Mietta Lennes)Replace interval labels in selected TextGrid with labeled text from a file (ML's description and a streamlined version).
open-multiple-textgrids (John Tøndering)Open multiple text grids from a directory at once (JT's scripts).
mark-pauses (Mietta Lennes)Mark pauses in a LongSound (can then run segmenter to get separate files) (ML's description); cf. word-chomper.
total-duration-of-labeled-segments (Mietta Lennes)Total the duration of labeled segments of a TextGrid (ML's description).
align-textgrid-markers (Mietta Lennes)Align TextGrid interval markers in tier one to those in tier two if they are sufficiently close (ML's description).
Analysis of sounds using text grids
duration-logger (Katherine Crosswhite)Log durations between labeled markers in a set of text grids (KC's description).cf. Mietta Lennes' version, calculate-segment-durations, and its description.
startpoint-logger (Mietta Lennes)Similar to the above script, but make file with startpoint of each labeled interval (ML's description).
formant-logger (Katherine Crosswhite)Log midpoint F0-F3 and duration of vowels delimited by labeled markers in a set of text grids (KC's description).
formant-logger (Mietta Lennes)Log midpoint F1-F3 of text grid labeled intervals for a set of Sound/TextGrid pairs (ML's description).
For F1/F2 logging, see also Bert Remijsen's scripts for using either the point tier or the interval tier to mark vowels.
draw-formant-chart (Mietta Lennes)Reports and logs midpoint F1-F2 of vowels delimited by labeled markers in a set of text grids (ML's description).
log-pitch-maxima (Mietta Lennes)Get F0 maxima of all text grid labeled intervals for a number of Sound-TextGrid pairs (ML's description).See also ML's log-data-from-two-tiers, which gets pitch maxima and corresponding syllable durations (description).
log-f0-extrema-using-momel (Bert Remijsen et al.)Use the MOMEL (Hirst & Espesser) algorithm to log pitch turning points to TextGrid (BR's description; MOMEL).
Segmentation and extraction
segmenter (Katherine Crosswhite)Extract clips demarcated by labeled markers into individual AIFF or WAV files (KC's description).
word-chomper (Joe Toscano)Take a WAV file and split it into smaller files corresponding to utterances (JT's description).
timed-segmenter (Kevin Ryan)Divide a LongSound into smaller files of a specified time length (e.g. 10s each, 1min each).
segment-to-aiffs-and-log, segment-to-wavs-and-log (Mietta Lennes)Extract textgrid-demarcated clips from LongSound into numbered files and log markers (ML's description).
segment-to-labeled-aiffs, segment-to-labeled-wavs (Mietta Lennes)Extract textgrid-demarcated clips from LongSound into files named after textgrid markers (ML's description).
extract-voiced-portions (John Tøndering)Extract and concatenate voiced portions of selected Sound to create new voiced-portions-only Sound (JT's description).
save-selection-to-sound-and-textgrid (Mietta Lennes)From an open LongSound TextGrid, save selected portion of LongSound and its TextGrid (ML's description).
from-segmentation-data-files-to-text-grids (Mietta Lennes)Convert data files listing segment startpoints and labels to TextGrids; cf. endpoint version (ML's description).
Drawing pictures
draw-sample-figure (Hugo Quené)Demonstrates how to draw a figure (graph) using a script (HQ's scripts).
Functional phonology, Paul Boersma's 1998 dissertation, has a number of sophisticated figure drawing scripts,e.g., draw-lungs and draw-muscle-effects in Chapter 2: Articulation model.
draw-distribution-bar (Mietta Lennes)Draw a makeshift bar showing distribution of labeled intervals from a file of timepoint, label pairs (ML's description).
draw-source-filter-model (Niels Petersen)Draw the components of the source-filter model of vowel production to the Picture window (NP's scripts).
draw-formant-point-to-bark-chart (possibly buggy; Mietta Lennes)Draw a one-Bark vowel circle from given formant values (Hz) on a Bark-scale F1/F2 chart.Cf. draw-formant-point-to-erb-chart: same as above script except Erb-scale chart (ML's descriptions).
make-matrix-of-plots (Chris Darwin)Create a matrix of plots; format these plots by changing the script code (try it with the defaults).
Noise and speech manipulation
create-sustained-vowel (Niels Petersen)Create a sustained vowel of the specified type using the LF source model (NP's scripts).
create-waveforms (Niels Petersen)Create various kinds of waveforms (sawtooth, square, sine, white noise, pink noise, etc.) (NP's scripts).
comb-filter-noise (Chris Darwin)Generate and comb-filter white noise.
shannon-am-noise (Chris Darwin)Produce Shannon-type AM noise from a selected Sound file using four bands.
vocal-tract-change (Chris Darwin)Change size of vocal tract (formants, but not duration/pitch); cf. vocal-tract-change-dynamic, which leaves the F0 altered.
sine-wave-speech (Chris Darwin)Create three-formant sine-wave speech using selected Sound object.
metronome (Hugo Quené)Simple one-beat metronome; see HQ's scripts page for several more complex metronomes. Careful: the default durations are very long; they should be set shorter before testing, lest Praat be tied up for minutes. Also, references to mywhoosh.wav should be changed to some extant WAV or removed.
More sound analysis
adjust-intensity (Katherine Crosswhite)Scale a set of sounds so that their peak amplitudes are identical (KC's description).
amplitude-gating (Niels Petersen)Gates the selected Sound object in and out (in intensity) using specified rise and fall times (NP's scripts).
voice-report (Niels Petersen)Generate a customized “voice report” for the selected Sound (NP's scripts).
adjust-f0-and-duration (Chris Darwin)Globally alter fundamental frequency and/or duration of all selected Sound objects.
mark-vowel-onsets (Hugo Quené)Find the vowel onsets in a selected Sound and log their timepoints in a new PointProcess;can then use HQ's write-pp to record the PointProcess timepoints in a data file (HQ's scripts).
draw-fft-spectrum (Mietta Lennes)Draw and save FFT spectrum for 40 ms window around cursor; run from sound editor (ML's description).
draw-lpc-spectrum (Niels Petersen)Like draw-fft-spectrum above, but LPC spectrum; based on M. Lennes' draw-lpc-spectrum script.
create-analysis-table (Setsuko Shirai)Create a table showing pitch, intensity, and formants every 10 ms for a set of WAVs (untested; SS's Praat page).
pitch-unit-conversion (Niels Petersen)Convert between different types of units, e.g. Hertz to Semitones, Bark, or Mel (NP's scripts).
annotate-using-manpage (John Tøndering)Annotate a TextGrid with phonetic symbols using ManPage (see JT's description).
make-stereo (Chris Darwin)Combine selected Sounds to make a stereo Sound file.
spectral-rotation (Chris Darwin)
F2 track correcter: setup, fix-formants (see Katherine Crosswhite's description).
Praat scripts: links and online collections
In no particular order:
Praat: main Praat website (e.g. download the program).
Praat users group: Yahoo! discussion group for Praat users; some scripts available in database.
Mietta Lennes: a large number of scripts, many quite involved, with very informative descriptions.
Setsuko Shirai: a PDF introduction to Praat scripting and a few scripts.
Johan Frid: one of the largest collections online, but most of the scripts are old and need to be updated to work.
Chris Darwin: CD's advanced scripts for e.g. sine-wave speech, Shannon AM-noise speech, resizing vocal tract, etc.
Paul Boersma: explore links for various highly tailored scripts associated with PB's 1998 dissertation.
Katherine Crosswhite: the code of the first few scripts is very well documented; good for learning Praat scripting.
Hugo Quené: some neat scripts, including several metronomes.
Niels Petersen: 20-some scripts at the bottom.
Bert Remijsen: some very well explained scripts, with sample input.
John Tøndering: a “Label.man” (annotate from ManPage) package plus a few other common scripts.
Joe Toscano: a few scripts, including “Word Chomper.”
Gabriël Beckers: some acoustic scripts, but apparently not formatted properly with newlines.
Michael J. Owren: downloadable GSU PraatTools, "scripts for analyzing, modifying, and synthesizing sounds using Praat"
From:http://www.humnet.ucla.edu/humnet/linguistics/faciliti/facilities/acoustic/praat.html

1 則留言:

枉 草鞋/Vương Siêuhề/왕 초혜/おう ちょうケイ/چاوحى ,وُاڭ/WANG, Tschau=Hsi 提到...

不錯.為何一〇年不寫了?本人正欲學阿拉伯語,分不清強調輔音與一般輔音的發音差別