updated 16th January 2023

Table of Contents


Percy Grainger had pointed out the need for advanced technological tools for analysing music in the early 20th century. A major breakthrough was Seeger’s melograph in the 1950’s. From the 80s onward computers have been increasingly used for music analysis. Bel’s MMA in Bombay and my own PitchXtractor for the original Macintosh are examples. At present I consider PRAAT the best program, although there are others. PRAAT is made for linguistics, but it works well for certain types of music analysis. And, it’s free!

Why do we want this? For two reasons. First because it enables us to do certain types of analysis that cannot be done by the ear and the brain. To have a microscopic insight into melodic contours, to see the precise pitch of a given note, to have precise measurements of the duration of beats – they are all impossible without such a program. Secondly because when a musicologist makes an analysis – for instance a transcription (yes, a transcription is an analysis), no one really knows how the transcription is made. We do now know the cognitive processes that go on in the brain when converting souond to writing. When it is done by a computer program we can at least know how it is done, especially since the source code is public. Moreover the authors of PRAAT have written a number of articles explaining the algorhythms they have used and the models on which these are based.

I will discuss mainly two aspects of using PRAAT, research on melodic lines (pitch vs time), and research on rhythm. This is done in four parts, basic techniques for working with melody, doing pitch analysis through tonagrams, advanced techniques of working with melodic lines and working with rhythm.

What can we expect from PRAAT, or rather, what does PRAAT expect from us? PRAAT works with mono files, so if you have a stereo file you can use the CONVERT>CONVERT to mono command (see below). For the analysis of melodic lines/pitch you have to use a basically monodic piece. Multipart music, or music with a lot of (harmonic) accompaniment won’t work. Unless of course you can separate the voices, for instance by using directional mikes for each voice and analysing them separately. You can reassemble the voices into a single image afterwards. You could even give the different voices different colours. Also, PRAAT is made for speech analysis and therefore works best with the human voice. Instruments in which sympathetic strings strongly resonate (piano, sitar, sarangi) won’t work well or not at all. Instruments that produce chords (piano, sitar, guitar, violin if two strings are used at the same time) also will not work.


Modern pitch extraction works by making an educated guess about the perceived frequency of the fundamental. Musical sound usually is a complex waveform, i.e. there is a fundamental and a number of partials. If you have a fundamental of 100 Hz (tonic), there will be partials of 200 Hz (octave), 300 Hz (fifth above octave), 400 Hz (double octave), 500 Hz (harmonic major third above double octave), etc. As you may note, the sequence of intervals is: fundamental, octave, fifth, fourth, major third, etc. Up to the nineteen-ninetees we tried to simply extract the fundamental directly from the sound by using filters. For many reasons this is a technique now considered obsolete. Instead, modern pitch extraction looks at the partials, sees their relative distances and then applies an algorhythm for calculating the position of the fundamental. Now if there is a main voice with some accompaniment, PRAAT is usually able to isolate the main partials, disregard the confusion of the partials of the accompaniment and come to a good estimate of the fundamental of the main voice. However, if there are two voices with a more or less equal volume singing a fifth apart (lets say at 100 and 150 Hz), PRAAT will integrate the partials of the two voices and calculate the fundamental from there. Evidently, we would want to have two fundamentals, one for each voice. But PRAAT always assumes there is only one fundamental (although it does consider a number of “candidates” for the fundamental), which in this case will be the octave below the first voice (50 Hz – since this is the fundamental that will contain all the partials of the two voices). Similar problems arise with instruments that have sympathetic strings or that produce chords.

PRAAT can work with a number of sound file formats, but basically they should be uncompressed. Of course, you can decompress an mp3 or AAC file, and I have had good results with this, but it is not advised because the process of compression-decompression creates artefacts that may interfere with the analysis. PRAAT also has its own input facility that will let you record through a mike (internal or external) or through a line input. PRAAT can also read files directly from a CD.

In the first lesson, I will go through the main steps of working with a melodic line. I have prepared a very short recording made straight with the built-in mike of my iBook. They are called nada.aif and bhairavi.aif and can be downloaded here: praat manual sound files

PART 1: Basics of working with melodic contours

Opening a sound file in the editor


What you see may be something like this in Macos (on Windows or Linux it will be a bit different…). It’s not particularly promising, apart from the view of Lej da Segl (Lake Sils) in the background as my desktop :-).

  • Choose Open > Read from file from the Praat objects window and navigate to the file nada.aif. (If you are using a file that is stereo convert it to mono now by Convert > Convert to mono. This will produce a new entry in the Objects panel with the word mono at the end.)

The next screen is already more intriguing:

The sound file has appeared as well as a host of buttons. Try the Play button. If don’t hear me singing the first line of the famous dhrupad ‘Nadabrahma sarvavyapi jana’ composed by Dilip Chandra Vedi in the raga Tilak kamod, you may have to fiddle some with your sound output. Does it sound awful? Sorry for that, I didn’t practice lately – too busy writing manuals and all. Now try the View & Edit button. Your screen should look like this (although it may well look like the next screen, that depends on certain presets in PRAAT):

Open the menu View > Show analyses … switch off the spectogram and set the longest analysis (s) to 20 and press OK.

The soundfile is 16,5 seconds so we should set the longest analysis to a higher value. And we switched off the spectogram to get rid of the clutter. You can try for yourself what it looks like if you switch other options on.

The upper half of the screen shows the waveform. By clicking anywhere in the white part you relocate the red line. It is the point from where you start playing. The tab key starts or stops playing. Under Play you have more options for playing: the whole window or a selection of your choice. If you stop the playing by hitting the tab key the red line gets relocated to where you stopped. If you want to stop without relocating the red line you can press escape. [Sometimes playback will lag behind the movement of the cursor. This is because the computer has to load a part of the soundfile into active memory. If you stop playback (escape) and start it again (tab) it will play correctly (this is a system thing, not a PRAAT problem).]

By dragging over a portion you can make a selection as I did in the previous screen. The tab button will now play only the selection. This really is the tonic of the song (sa in indian music), on the words sarvavyapi . On the right we see that the display shows a range from 75 to 500 Hz. The readout of the horizontal red section is approximately 120 Hz. On the bottom we see the duration of the two sections left and right of the red line, below the duration of the window, and below that the duration of the whole piece.

Press OK and go to Pitch > Pitch settings ..., select the following options and press APPLY

I have chosen 90 Hz as the lower limit of the pitch and 240 as upper limit. Since the tonic is at 120 the lower limit is a fourth below the tonic and the upper limit is an octave above the tonic. Depending on the range of the music you may want to adjust these values. Notice that I have also selected cross-correlation instead of autocorrelation. If you just select each one and press APPLY you can see that some specks at the left side of the screen are not seen in cross-correlation. They are garbage.

Now the melodic contour is better spaced. By clicking the cursor on any position you get a readout in Hz on the right. In the menu Pitch>Pitch settings you can also see the position in semitones. Better even is to make selections of the notes, the readout on the right will give you the average of the selection! Can we have horizontal gridlines of semitones and maybe vertical ones of seconds as well? Unfortunately not in this window, it is a desideratum I have deposited with the makers of the program. However, there are ways of having a more perfect image. I will come to that soon.

At this stage I want to point out a few niceties. First of all, you can select any portion of the window and then press the button select at the left bottom to get a good close up. The other buttons will let you see the whole soundfile (all) or zoom in or out by a factor 2. When you zoom in or out or to a selection only the horizontal scale is changed. To change the vertical scale you go to Pitch > Advanced pitch settings … and change the viewrange according to your needs. You can also define a selection manually. For the following screen I have first chosen the menu Select > select … , 9 to 14, pressed the button sel and then I have used the Pitch > Advanced pitch settings … and set the view range to –1 to 10.

Screen Shot 2015-01-31 at 09.56.30

The degree to which the picture resembles your own mental visualization of the sound is arbitrary. There is no rule for the right proportion between horizontal and vertical scaling. Also, you may see things in the graph that you don’t hear. Probably, if you would use a program to slow down the music (Quicktime on Mac does it very well) to half its normal speed you would start hearing (some of) the things you see. And then when you play the music at normal speed again you will notice that you actually did hear those things you saw, but never knew it because you heard them in a different way from what they look like. These are really very interesting problems of perception and methodology that will not be discussed here. But elsewhere on this site I have discussed some of them.

Drawing the contour in a Picture window

Our next task is to draw the melodic line to a grid of semitones. To do this is a little more involved. It involves three steps:

  1. Perfect the pitch line by fine tuning the parameters in Advanced Pitch Settings
  2. Cleaning up the pitch line
  3. Transposing the pitch line so that the tonic is at 100 Hz which represents zero semitones in PRAAT (actually we can choose between 100, 200 and 440 Hz).

N.B.: Part 3 applies these steps to another recording and also adds some other approaches to getting a meaningful visual representation of melodic lines.

Perfecting the pitch line

In the window “1. sound nada ” open Pitch>Advanced pitch settings and arrange the two windows as follows:

Now you can change the values of each of these parameters and press APPLY to see the result. This is very intricate and I must confess I don’t know exactly what each of the parameters represents. The official PRAAT manual isn’t very clear on this either. The following is what I think about it, may the authors of PRAAT may not have the same ideas.

The maximum number of candidates: Candidates are partials that are used to compute the assumed fundamental. You can quickly try 2, 5, 10 candidates. It sometimes makes a world of difference, but usually you can leave the standard 15.

Silence threshold: Really very straightforward. In the upper part of the sound window you can see places where the sound is very soft or gone. If you like you can also switch on the intensity (Analyses>Show analyses> switch on intensity) which will show a green line in the lower section. Now you have to fine-tune the silence threshold in such a way that the softer parts are suppressed. Where there is very little intensity PRAAT will make wild guesses. With some trial and error I settled for 0.25.

Voicing threshold is another interesting one. Voiced-unvoiced in phonetics: all vowels are voiced, and some consonants as well, but others are not. In our case consonants do not generally have pitch, so we want them to be suppressed. Just see the difference between 0.99, 0.95 and 0.90. I settle for the latter.

The next two parameters can be useful if PRAAT makes errors of octaves. In music this happens especially with certain instruments and also with background sounds (see introduction). Finally, the voiced-unvoiced cost can correct faulty estimates of the pitch because of certain consonants. It is rarely relevant in music.

Cleaning the pitch line

Select Sound nada in the objects panel and press the button analyse periodicity and select to pitch (cc). Set the values equal to the ones we have found like this.

A new entry will appear in the list, called pitch nada. It will also be selected. Press View and edit. Press Time > select and put in the values from 0.7 to 1.4. Now if you manoeuvre to the “sound nada” window you will notice that the selection is the same. And you will also see that the first part of that selection is silence. Press the button “sel” (bottom left). Play the selection (tab). In the first half there is silence. Then, with the beginning of sound you actually hear “nnnn” and then “aaaa-“. We want to simply suppress everything before the “aaaa” because the pitch is not very distinct. Select that portion (say 1.03 to 1.23), switch to Pitch nada and choose Pitch>unvoice. You will notice that actually the part of “nnnn” is more pitched than I suggested. Anyway, you could also just unvoice (silence) the portion from 1.03 to 1.08. Similarly you can go through the whole Pitch file and make small corrections.

Transpose the tonic to 100 Hz

Select pitch nada in the objects winter, press the button modify and move the cursor to formula. Enter the following formula: self*100/121.3. Note that applying this formula changes the values inside this pitch file, so if you want to go back you’ll have to apply the reverse formula. Basically, the step periodicity to pitch (ac) does the same thing as what we have in the lower part of the window – create a pitch line. The only difference is that it is now a list of values called pitch nada. Applying the formula thing is the transposition of those values to a tonic of 100 Hz, instead of the original value to which I sang. This list we are going to draw in the picture window. Before drawing it, we set the viewport of this window. To do this move the picture window to the left of your screen. Then draw the lower right corner to the right until you have filled your screen. Now drag your cursor from the top left to a point on the low right so that you have a selection of 6 (down) by 9 (right). Your screen should look like this:

Screen Shot 2015-01-31 at 10.59.53

On a bigger screen you might make the viewport (the rectangle with blue border) bigger. Minimize this window or drag it a bit to the right so that you see the praat objects window again. Press the draw button and select draw semitones (re 100 Hz). Use the following settings:

Screen Shot 2015-01-31 at 10.08.15

Press OK and the picture window comes to the fore. It still has no grid marks. To get them choose Margins > Marks left every … and use the following settings.

Screen Shot 2015-01-31 at 10.09.44

Screen Shot 2015-01-31 at 10.09.50

Finally, you could also apply the Margins > Marks bottom every … command to have a time indication.

Now this melogram is something we can send home! In simplified Indian sargam notation it reads like this:

|’G ^R | / M G | S S | S / GR | G N | S S |

Further cosmetics would perhaps involve setting the time scale differently, so that the beats of the song actually correspond to the marks on the bottom (now they are seconds). I’m sure you can figure that out quite easily.

Assembling image and sound, making ‘music in motion’

N.B. This section is no longer practicable. Quicktime has no longer has a pro version. So you’ll have to resort to other options.

Unfortunately, this charming image cannot be “played”. However, you can easily put it together with the original sound in Quicktime 7 (still downloadable), iMovie, Aftereffects, Hype or even Keynote. In Quicktime (pro version, very cheap!) it works like this: First, still in PRAAT’ picture window, select File > copy to clipboard. Now open the original soundfile in Quicktime (start Quicktime, select File > Open movie in a new player and navigate to nada.aif. Choose File > Save as … and press the radio button make movie independent. Now choose Edit > Add scaled and you’re done! Don’t forget to choose File > save to save the movie. If you’re halfway clever with Quicktime you may also use the File > Export command, fiddle with the settings and get a super compressed file that still sounds perfect.

Quicktime doesn’t really give you a cursor with the exact location of time in the pitch graph, for that you’ll have to use Flash, a HTML5 editor or After Effects. The latter was used for our AUTRIM graphs. In the first video below I simply assembled sound, image and a moving cursor in Keynote and exported that to a quicktime movie. That took about 5 minutes. But I would advise Hype for a more solid solution. That’s how the second example was done.

Assembled in Keynote and exported to Quicktime

Assembled in Hype and exported to Quicktime

Note that Hype does not export and embed the sound in the exported video, you’ll have to add the sound in the same way we assembled sound and image in quicktime above. And in that sense, you really only need to create the moving cursor in Hype and for the rest use the instructions for quicktime above. On the other hand, you may want to create HTML5 in Hype and integrate that directly into a website. I have done this in the following Hype movie of Faiyaz Khan’s rendition of gandhar in Darbari kanada.

I created the full graph at once from PRAAT, by setting the viewport to a width of 130, exported this to EPS and then transformed it to JPG. Then, in hype I made the graph into a moving object.

PART 2: Creating a ‘tonagram’, analysis of pitches

Finally, we can put all the pitch measurements into a histogram (we call this a tonagram), showing the intonations used in the piece. Perform the following steps.

  • in the picture window choose Edit > Erase all. Minimize the picture window.
  • go to the objects window
  • select pitch nada (click once on it) if it isn’t already selected
  • press the button convert and select down to pitchtier
  • press the button convert and select down to table of real and select the radiobutton “semitones”
  • press the button convert and select to matrix
  • press the button draw and select draw distribution
  • use the following settings:

Screen Shot 2015-01-31 at 10.24.41

Just a short note on the settings for the Draw distribution command: The minimum value to maximum value range represents 5 semitones below the tonic (the fifth of the lower octave) to 7 semitones above the tonic (the fifth). 1200 bins, means that I am using 100 bins per semitone, which means every pitch measurement goes down to a one cent bin.

  • choose Margins > Marks bottom every … and use the settings like this:

Screen Shot 2015-01-31 at 11.12.44

The result should look like this:

Screen Shot 2015-01-31 at 10.25.58

If you would use 120 bins you would get the following image:

Screen Shot 2015-01-31 at 11.11.50

Whatever you find more instructive… Do take note of the lowish position of the major third – it may average out at 385, more or less the ‘harmonic major third’. Not so surprising as I was having a tanpura sound file playing through the headphones. Indeed, modern computers can easily play a sound and at the same time record another.

The picture window gives you a lote of options for drawing ticks, lines and numbers, all in the Margins menu. You can experiment with that. If you don’t like something you can Edit > undo it. If necessary, erase the picture (Edit > Erase all) and redraw it by going to the objects window and choosing draw again. You can also set the pen color in the picture window (Pen), but you have to do that before you draw. Under the file menu you will find many commands for copying and saving the picture. Use whatever you’re comfortable with.

PART 3: Advanced work on melodic contours

Sound input methods

First a brief note on different ways to get the sound in. On a computer with a mike, like my iBook, PRAAT handles this very smoothly. First let’s clean the slate. Erase the picture window and minimize it. If you have any editing window open also close it. Now go the object window and select all the items there (shift-clicking makes a continuous selection, control or command-clicking selects/deselects individual items). Press the remove button at the bottom of the window. Now choose New > Record stereo Sound…. On the iBook you can’t use record mono sound, because the sound input system simply is stereo. But that doesn’t matter. On other computers it may work the other way around. Now bring your mouth a little close to the mike, press record and starting singing away. Press stop when you’re done. Now either press save left channel to list or save right channel to list and you can perform all the techniques from PART 1.

Working with long pieces of music

The next trick you may like to know is how to work with bigger files. Any piece longer than a couple (say 4) minutes, would be considered a Long soundfile. In fact it depends on your internal memory how long a normal soundfile can be, simply because it is loaded entirely into memory. On modern Macs under OS X you’ll hardly ever need the Read long sound file command.

  • put a CD with some long tracks by a female vocalist in the computer. I had Kishori Amonkar lying around here, but Aicha Redouane will be great as well – or any other female voice. But if you don’t have the right kind of music, don’t worry, I have included a small selection (bhairavi.aif) that is going to be used for the rest of the advanced work.
  • choose Read > Open long sound file …
  • navigate to the track on the CD you want to open.

The two stereo sounds are shown in the upper part, and in the lower part you may see some garbage. The reason for this is that our settings are still the same from the first part. In fact PRAAT remembers the settings over sessions, even when you install an update. Not only do we want to adjust the settings for a female voice, but also modify them for use with longer pieces.

  • choose View > Time steps settings …
  • press the upper button (which should say Automatic and change it to View dependent. Set the value in the Number of time steps per view box to 1000. This is a wonderful option, because you get a higher resolution as you zoom in, while computing time always remains the same. If your computer is very slow, you may want to use a value of 500 or even 250 here.
  • Choose Pitch > Pitch settings … , press revert to standards and then change the analysis range to 200 to 600.
  • Choose Pitch > Advanced pitch settings and press revert to standards.

From here you should be able to see a good pitch line, like the one shown below.

screen 18

Some very important points:

  • for female vocalists you need to have a different analysis range. I usually have 200 to 600 for female voices. Male voices can be more tricky, often they are really too low. You may want to start out with a value of 75 to 300 and then try narrowing it down a little.
  • The standard method of PRAAT is to use the same values for the analysis range and the view range. This is preferable, but sometimes you may want to change the vertical perspective without changing the analysis range. You do that in the Advanced pitch settings dialogue box. However, be careful, if you have changed the units in the Pitch settings dialogue to Semitones, your values in the view range of the Advanced pitch settings have to correspond. Carefully study the way we have done this in the first part to grasp the technique, otherwise you’ll be looking at a blank screen and wonder what happened to your melodic line (it’s really just out of range).

Editing the pitch contour

For the next portion of this tutorial we use the file bhairavi.aif

  • in the object window choose Read > Read from file … and navigate to bhairavi.aif
  • press the edit button
  • your screen should look like this:

screen 19

Notice that the melodic contour appears to be thick and consist of isolated dots. This is because PRAAT finds our resolution of 1000 measurements for this soundfile too low. To let PRAAT do the job according to its own standards just go to View > Time step settings … and press revert to standards. The new screen looks like this:

screen 20

There are two small problems with the image. In the lower corner there is some garbage, and in the middle, near the red line, there is a glitch. We could try to improve this by working with the advanced pitch settings as I explained above, but we can also manually improve the file before “drawing” it in the “picture window”. Perform the following steps:

  • first minimize the edit window.
  • In the object window click on the button Periodicity and choose to pitch (ac)… Change the pitch floor to 200.
  • A new file is created, Pitch bhairavi. Click on Edit.
  • In the new screen drag your cursor from the far left to about one centimeter to the right from there as I have done in the following screen.

screen 21

To make such a selection take care to drag over white area. If you click in the purple or black area it won’t work.

  • now press the sel button at the bottom.

Your screen will look like this:

screen 22

Pay attention where I have positioned the cursor, on the empty space between the blue lines. If you click there, part of the space becomes blue and the corresponding purple disappears. It really meansyou have “muted” or “unvoiced” the garbage.

  • repeat this until all the garbage from this portion is gone
  • Press the all button at the bottom
  • Make a selection of the glitch in the middle of the screen, like this:

screen 23

  • press the sel button again
  • narrow down your selection so that you only select the glitch:

screen 24

  • choose Selection > Octave up

Lo and behold:

screen 25

What has happened here is that PRAAT has made an octave error in estimating the fundamental pitch. In pitch extraction this happens quite a lot – octave and fifth errors. But PRAAT also indicates other candidates it has found, and in this case we can correct the contour by giving an octave up command.

PRAAT does destructive editing, which means that all changes are saved immediately in the pitch bhairavi file. Now if you move one screen to the left (by clicking in the left part of the horizontal scroll bar at the bottom), you will see another small glitch, which however cannot be corrected. You may just silence it in the same way we did in the beginning.

From here you can use all the steps described in part one to create a Picture. I got the following result (as I have measured the octave of the tonic as 425 Hz, the formula for correcting the tonic would be self*2*100/425).

screen 26

In sargam it would read: PDNSRG – RGRSNDPM GMD – –

Logging and scripting

Logging is a very fast way for keeping track of manual readouts. Perform the following steps:

  • if you still have the sound bhairavi window open bring it to the front
  • if you closed it you go to the object window, click on sound bhairavi and on edit
  • choose Query > Log settings…

You will get the following dialog:

screen 27

Make sure you have changed the button menu on top to log file only and removed the Hz in the Log 1 format, before clicking OK. In the Query menu you will see the keyboard shortcuts for getting the log values (on the iBook it’s F12, but to access that you have to keep the fn key down).

  • close the dialogue by pressing OK
  • go to Pitch > pitch settings… and choose semitones
  • make a selection of a horizontal portion of the melodic contour (a ‘note’!)
  • press the shortcut key (F12)
  • repeat the previous two steps a few times

Now on your desktop (or wherever you have directed it in the log file 1 box), there is a file called PitchLog, which you can open with any text editor or word processor (or spreadsheet). Mine looks like this:

Time 2.783391 seconds, pitch 26.98
Time 3.281450 seconds, pitch 25.12
Time 3.582164 seconds, pitch 25.12
Time 6.617504 seconds, pitch 20.92

Notice that these semitone values are not transposed to a tonic of 100 Hz. The ‘formula’ was applied to Pitch bhairavi, not Sound bhairavi. The latter file remained unchanged (it cannot be changed).

For further information on logging see the manual. By opening Query > Log settings … and clicking on the help button on the lower left corner of the dialogue you go there directly. By formatting your log files correctly you can get them straight into your spreadsheet or statistics program.

To conclude the second part a short, easy but essential introduction to scripting. Some people may start shivering at the idea of scripting. That’s like programming! But scripting in PRAAT is just about the easiest system of scripting I’ve ever come across, and it beats the hell out of performing all those commands manually. If you have just a few good scripts they will be a boon forever.

  • from the top level menu choose Praat > new script.
  • In the script window choose Edit > paste history

Wow! Every single command you have chosen in this session has been remembered. What a mess! But if you look carefully you’ll see there are many things there that you’ve done manually which means you have an overview of all the changes you made. That comes in very handy when you want to remember what you did.

Now copy the following script and paste it in a new empty script:

select Sound bhairavi
To Pitch (ac)… 0.001 200 10 no 0.1 0.1 0.01 0.9 0.14 600
select Pitch bhairavi
Formula… self*200/425
Viewport… 0 12 0 8
Erase all
Draw semitones… 0 0 0 16 no
One mark left… 0 yes yes yes
One mark left… 1 yes yes yes
One mark left… 2 yes yes yes
One mark left… 3 yes yes yes
One mark left… 5 yes yes yes
One mark left… 7 yes yes yes
One mark left… 8 yes yes yes
One mark left… 10 yes yes yes
One mark left… 12 yes yes yes
One mark left… 13 yes yes yes
One mark left… 14 yes yes yes
One mark left… 15 yes yes yes
Marks bottom every… 1 1 yes yes no

  • choose Run > Run

The computer goes to work, after a little while the picture window comes to the front and draws the melogram. You will notice that the editing work we have done on the pitch bhairavi file is not included in this picture – the glitch is still there. However, we can also use a part of the script:

  • minimize the picture window
  • click on the first “Pitch bhairavi” in the object window. This the one you edited
  • select the lines from viewport down in the script window as shown below:

screen 28

  • choose Run > Run selection

Your screen should now look like this:

screen 29

It is easy to understand what the script does. First it selects the audio file in the object window. Then it performs the Periodicity > to Pitch (ac) command with a list of parameters. Then it selects the resulting Pitch bhairavi file (and it knows how to pick the new one, even though the names are the same). It applies the formula for adjusting the tonic to 100 Hz (0 semitones). It sets the viewport (drawing area) of the picture window, erases the window and performs the draw command. Notice the third and fourth parameters 0 and 16 – it is the range of semitones for the horizontal scale. Finally, it draws individual horizontal semitone lines, in this case for a common Bhairavi scale, C Db D Eb F G Ab Bb.

When we ran only a selection we have simply used the old Pitch bhairavi, that we had edited and to which we had applied the formula for adjusting the tonic. Which means the first four lines were not needed. The script steps will now be applied to the currently selected file in the object window. Be careful therefore that you have selected the correct file.

Finally, an example of a script for making a tonagram:

select Sound bhairavi
To Pitch (ac)… 0.002 200 15 no 0.1 0.45 0.01 0.35 0.14 600
select Pitch bhairavi
Formula… self*200/425
Down to PitchTier
Down to TableOfReal… Semitones
To Matrix
Viewport… 0 12 0 8
Erase all
Draw distribution… 0 0 0 0 4 16 1200 0 0 no
One mark bottom… 5 yes yes yes
One mark bottom… 7 yes yes yes
One mark bottom… 8 yes yes yes
One mark bottom… 10 yes yes yes
One mark bottom… 12 yes yes yes
One mark bottom… 13 yes yes yes
One mark bottom… 14 yes yes yes
One mark bottom… 15 yes yes yes

Copy and paste this script in a new empty script and run it. I think the script is really very self-evident. All the actions we had performed step by step manually in the first part are now executed automatically. Moreover, with scripting it is very easy to copy and past the individual draw commands for the vertical note positions. As you can see I have again drawn a Bhairavi scale, this time showing the range of 4 to 16 semitones. Of course this sound file is way too short and the movements are way too fast to make a decent tonagram, but still, we can recognize some of the peaks as belonging to the bhairavi scale. If you would process the whole soundfile you may want to change a few lines here and there. I used the command Read > read two files from stereo file and got two new files in my objects window. I have opened the file Sound left with the edit button, and changed the view > time step settings dialogue to view dependent, with number of time steps set to 500. Then I applied the following script.

select Sound left
To Pitch (ac)… 0.01 200 15 no 0.1 0.45 0.01 0.35 0.14 600
select Pitch left
Formula… self*200/429
Down to PitchTier
Down to TableOfReal… Semitones
To Matrix
Viewport… 0 12 0 8
Erase all
Draw distribution… 0 0 0 0 0 16 1600 0 0 no
One mark bottom… 0 yes yes yes
One mark bottom… 1 yes yes yes
One mark bottom… 2 yes yes yes
One mark bottom… 3 yes yes yes
One mark bottom… 5 yes yes yes
One mark bottom… 7 yes yes yes
One mark bottom… 8 yes yes yes
One mark bottom… 10 yes yes yes
One mark bottom… 12 yes yes yes
One mark bottom… 13 yes yes yes
One mark bottom… 14 yes yes yes
One mark bottom… 15 yes yes yes

Notice the first parameter in the second line, it means 100 steps per second, which is very little – but works fine for tongrams. Notice also I have adapted the upper tonic-correction to 429, a value found after some browsing through the file. The result looks like this:

screen 30

For those familiar with Indian music this is quite interesting. There is hardly any komal re (Db) and both dha and ga seem to be on the low side. You wouldn’t expect that in Bhairavi.

PART 4: Working with rhythm

  • Empty your slate by removing all the files in the object window.
  • Read in the nada.aif file.
  • Open it with the edit button.
  • Reset all parameters to default (go to Pitch > pitch analysis and press reset to standards, go to Pitch > advanced pitch settings and to the same, go to View > Time step settings and do the same.
  • Minimize the Sound nada editor window.
  • Select the Sound nada file in the object window if it isn’t already selected.
  • Press the button Label and segment and choose to Textgrid.
  • Change tier names to “rhythm” (there are three names suggested here, they will produce three tiers, but we want only one for now). The other field doesn’t matter.
  • Select BOTH the files Sound nada AND Textgrid nada (by shift-clicking or command/control-clicking).
  • Press edit.
  • Click with the mouse at the very beginning of where I start singing Nada

Your screen should look like this.

screen 31

  • Now click the arrow in the little circle at the point where I have shown above. The line in the textgrid becomes solid.
  • Repeat this at the point where I sing da, bra, ma, sa, va, vya, a, pi, ja, a, na and at the end of the sound.
  • Click in the space between the first and second marker and type “na” (without the quotes). Proceed to put the syllables in the subsequent beats.

If you haven’t placed a marker correctly you can click on it and drag it to the right place. To remove a marker you can click on it and choose Boundary > remove.

The result should look like this:

screen 32

By clicking in each of the beats you can see at the bottom how long it takes. You may notice I have created rather irregular beats – so much for (lack of) practice. Of course, deriving beats from a simple song without drum accompaniment isn’t ideal. And even with the drum it is pretty difficult, you may want to do some heavy slowdowning! You might like to give the bhairavi.aif a try, and don’t feel ashamed if you find it difficult to coordinate the beats with the markers. Sometimes the waveform can help out, but often it can also be misleading.

The division of the time intervals can be exported to a textfile by choosing File > write textgrid to textfile. You can import such a file in any text program. Like this:

Screen Shot 2015-01-31 at 00.36.23

After some cleaning up in Excel I got the following table:

Where to go now?

Judging by the many menus and the more than 1000 pages of manual there is much more you can do with PRAAT. The manual pages are an important source, and at the website you find a lot of information and some (references to) tutorials. Apart from certain desiderata mentioned in the text I am also negotiating an automatic notation system.

Finally a point of methodology. A tool like PRAAT is great because it takes away, or at least reduces, subjectivity. But beware that there is manual work, like the corrections in the Pitch editor, horizontal vs vertical scaling, using settings that give result “I like”, and certainly the placing of rhythmic markers. So make sure to explicitate this, otherwise PRAAT will be as black a box as any musicologist’s brain.