Seeking Help with Praat Script - Need Experienced Eye to Spot Error


julekcecelewski@...
 

Hello everyone,

I am currently writing a fairly simple Praat script, but I can't seem to find the error. I am attaching my script and I am certain that someone more experienced than me will immediately see the problem. Thank you for your responses, and sorry if this problem is too basic for your level, please be patient with the beginner that I am.


Boersma Paul
 

dear Julek,

when you report a bug in your script, there are typically three things we need to know:

1. in what situation did you run it (Praat version, platform, the data)?

2. what did you expect would happen (e.g. the script should walk through all files, writing XXX into file YYY)?

3. what happened instead (if there was an error message, then please cite it in its entirety)?

Without those things, I will not be able to see where the biggest (or first) problem lies.

One thing that I see in your code is:

  Filter (pre-emphasis): 50  
soundFiltered = selected ('sound')
select 'soundFiltered'

Here you mean

  Filter (pre-emphasis): 50  
soundFiltered = selected ("Sound")

Otherwise, your third line (which is superfluous, by the way) will give the error "No object with number 1" or so, if the second line doesn't give an error. Thus, `sound` is the ID of the Sound object that you created earlier, and if that is 123, your second line is trying to get the ID of the 123th currently selected object, which is something totally different.

In any case, the following would be better, and works in a single line:

soundFiltered = Filter (pre-emphasis): 50

best wishes,
Paul

On 12 Mar 2023, at 10:00, julekcecelewski via groups.io <julekcecelewski@...> wrote:

Hello everyone,

I am currently writing a fairly simple Praat script, but I can't seem to find the error. I am attaching my script and I am certain that someone more experienced than me will immediately see the problem. Thank you for your responses, and sorry if this problem is too basic for your level, please be patient with the beginner that I am.

<script_analyse_formants_l_test.praat>

_____

Paul Boersma
Professor of Phonetic Sciences
University of Amsterdam
Spuistraat 134, room 632
1012VB Amsterdam, The Netherlands
http://www.fon.hum.uva.nl/paul/


julekcecelewski@...
 

Dear Paul,

Thank you very much for your response and your attention.
You are absolutely right about the information that it is important to mention. I should have specified that I was not getting an error message and that the script seemed to be running through the loops without extracting the formant values.
I am working on the latest version of Praat software (2 March, 64-bit edition for Windows).

In my TextGrid, tire 1 corresponds to the word-level (written form), tire 2 to the phonological transcription (word-level), and tire 3 to the phoneme level, as segmented by WebMAUS.
The script should iterate through the intervals on tire 4 (syllables, manually specified on selected occurrences), each syllable corresponding either to a sequence of lV or wV, or to Vl or Vw, and depending on the syllabic structure, extract the values of F1 and F2 at each 1/10 of the entire duration of the consonant and up to the middle of the vowel.

For now, after making some modifications, the script is working, it just seems very heavy for Praat. I suppose there may be redundancies that I could have avoided and that slow down the execution.
I am attaching below the version after the modifications.


Boersma Paul
 

dear Julek,

I can see several causes that make your script slow:

1. you are computing the formant curve for your `soundFiltered` every time in your inner loop, i.e. `nb_intervalles` times. Once (before the loop) would be enough.

2. you don't remove `grille`, `soundFiltered`, and the result from your Hann band filtering after use, so the list of objects will grow to show 3 times `nFichiers` objects.

The first point is probably the big one.

And a suggestion: to make your script more readable, you could consider un-indenting some if-blocks and some "select formantTrack" parts, as well as lines 171–173. You can use "Shift left" from the Edit menu for that.

best wishes,
Paul

On 12 Mar 2023, at 15:17, julekcecelewski via groups.io <julekcecelewski@...> wrote:

Dear Paul,

Thank you very much for your response and your attention.
You are absolutely right about the information that it is important to mention. I should have specified that I was not getting an error message and that the script seemed to be running through the loops without extracting the formant values.
I am working on the latest version of Praat software (2 March, 64-bit edition for Windows).

In my TextGrid, tire 1 corresponds to the word-level (written form), tire 2 to the phonological transcription (word-level), and tire 3 to the phoneme level, as segmented by WebMAUS.
The script should iterate through the intervals on tire 4 (syllables, manually specified on selected occurrences), each syllable corresponding either to a sequence of lV or wV, or to Vl or Vw, and depending on the syllabic structure, extract the values of F1 and F2 at each 1/10 of the entire duration of the consonant and up to the middle of the vowel.

For now, after making some modifications, the script is working, it just seems very heavy for Praat. I suppose there may be redundancies that I could have avoided and that slow down the execution.
I am attaching below the version after the modifications.
<script_analyse_formants_l_test.praat>

_____

Paul Boersma
Professor of Phonetic Sciences
University of Amsterdam
Spuistraat 134, room 632
1012VB Amsterdam, The Netherlands
http://www.fon.hum.uva.nl/paul/