Pitch Analysis with Tarsos - A Tool to Investigate CM?

Ideas and innovations in Indian classical music
Post Reply
joren
Posts: 3
Joined: 01 Mar 2012, 14:52

Pitch Analysis with Tarsos - A Tool to Investigate CM?

Post by joren »

I am not at all a connoisseur of carnatic music but i have seen a couple of discussions about pitch use on this forum and am wondering if one could use Tarsos to answer some of these, or related, questions:

Shruti intervals - practice versus theory
Pitch Analysis - A fun tool to investigate Shruti in CM

Tarsos is a software tool to do pitch analysis on any kind of music but I developed it mainly to analyse African music. You can find more information about Tarsos in the research paper and on the website you can download Tarsos. To give you an idea about the capabilities a screenshot is included below:

Image
You can spot 1) a pitch class histogram, with the most used pitches (in cents) 2) a pitch class interval table, which contains the intervals between the pitches 3) a piano roll like view on pitch, 4) a MIDI keyboard, tuned to the detected tone scale (the pitch classes from 1)) and 5) a waveform for browsing the audio.

I am looking forward to hear if you can use Tarsos on your music, and if there is feedback on how I could make it more useful for CM, please let me know!

Regards

Joren

VK RAMAN
Posts: 5009
Joined: 03 Feb 2010, 00:29

Re: Pitch Analysis with Tarsos - A Tool to Investigate CM?

Post by VK RAMAN »

Very interesting

vasanthakokilam
Posts: 10956
Joined: 03 Feb 2010, 00:01

Re: Pitch Analysis with Tarsos - A Tool to Investigate CM?

Post by vasanthakokilam »

Joren: I will take a look when I have some time. Thanks.

mahavishnu
Posts: 3341
Joined: 02 Feb 2010, 21:56

Re: Pitch Analysis with Tarsos - A Tool to Investigate CM?

Post by mahavishnu »

thanks, Joren. This is a very useful tool.
I just downloaded it. Will try it and let you know...

vasanthakokilam
Posts: 10956
Joined: 03 Feb 2010, 00:01

Re: Pitch Analysis with Tarsos - A Tool to Investigate CM?

Post by vasanthakokilam »

Joren: I am just starting to use your program. It has quite an impressive set of features. It should be useful to CM folks. Congratulations and thanks for sharing it with us. I will let you know of any specific feedback I may have after using it some more. Thanks.

vasanthakokilam
Posts: 10956
Joined: 03 Feb 2010, 00:01

Re: Pitch Analysis with Tarsos - A Tool to Investigate CM?

Post by vasanthakokilam »

Pro: Very good tool. Installation/launching is trivially easy. Just download and double click (Java Run Time is required on your computer).
Pro: It lets me learn that there is scope for improvement in my music
Con: It lets me learn how imperfect my music is ;)

The Pitch Doctor that Tarsos is, she already diagnosed two things for me:

I will have to check the fidelity of the mandra sthayi ( lower octave ) of my flute. There was too much deviation for my comfort.

Also, my flute is supposed to be a G but it turns out it is not quite G, at least the way I naturally play. Tarsos knows. My ears are not sensitive enough to detect the difference but I think Arun noticed it on a few occasions when it did not quite match the Radel produced G sruthi in the background.

I think it can be very useful to investigate CM, for the technically minded and curious ones. With good samples, you can find the upper and lower bounds of oscillatory gamakas and the method of execution of the gamaka. You can find the contour or curvature of the transition which is relatively more important than the 100% accuracy of the starting and landing point. Especially the exotic ones like Begada, Bhairavi, Thodi etc. One can try feeding samples from different schools and bANis and see if there are any differences. Of course, it works best with good samples. I think violin alapanas would be the best since it is as monophonic as you can get. (besides the sruthi).

It takes some time to get used to reading the various graphs. You need to think in terms of cents but once you get used to thinking about it, it is a lot easier than dealing with frequencies. Our music would not fall on 100 cent boundaries for the 12 notes but we can calibrate for that. ( especially to make sure our Ga3 is correct since it is quite beautiful when it is correct and not approximated to 100 cent boundary ).

That said, it took me some time to calibrate the cents to our swaras and reading off the swaras from the graph.

But it is worth the time I spent with it.

There is still a lot to learn about the tool. If Joren comes back to this thread and participates in the discussion, it may make the learning faster by answering any questions we may have.

Nick H
Posts: 9379
Joined: 03 Feb 2010, 02:03

Re: Pitch Analysis with Tarsos - A Tool to Investigate CM?

Post by Nick H »

It sounds like it really appeals to you both as a musician and as a techie --- and that you having a lot of fun with it. Fun of a serious and constructive kind :)

cmlover
Posts: 11498
Joined: 02 Feb 2010, 22:36

Re: Pitch Analysis with Tarsos - A Tool to Investigate CM?

Post by cmlover »

VK
I am struggling to get this work since I don't understand Java nor am I configured for it!
In a cents graph how could you distinguish mandra stayi from madhyama? I am puzzled?????
I tried finding the needle in the haystack which told me hamsadhvani is found 85% in mohanam!!!!! Now I want to search for short musical 'phrases' in ragas. Unfortunately the software will not tell me where they occur! Perhaps joren will come back and guide me ... (I hope)

vasanthakokilam
Posts: 10956
Joined: 03 Feb 2010, 00:01

Re: Pitch Analysis with Tarsos - A Tool to Investigate CM?

Post by vasanthakokilam »

CML, did you manage to run it and feed it a file? it was not clear. In any case, you do not need to know anything about java or any configuration etc. but you need to have installed Java Runtime. If you do not have it, Joren's tool would not even launch properly. So if his tool launches, you have got Java.

>In a cents graph how could you distinguish mandra stayi from madhyama? I am puzzled?????

It gives you both the absolute cents as well as modulo 1200. I am still not sure what cent 0 is ( which octave and which note? I assume it is A or C ) but that does not really matter that much. Once I know the cents value of my Sa, everything else is relative to that.

vasanthakokilam
Posts: 10956
Joined: 03 Feb 2010, 00:01

Re: Pitch Analysis with Tarsos - A Tool to Investigate CM?

Post by vasanthakokilam »

Nick H wrote:It sounds like it really appeals to you both as a musician and as a techie --- and that you having a lot of fun with it. Fun of a serious and constructive kind :)
yes, and fun of the fun kind too. I used MSG's awesomely sweet Bagyashree that akellaji shared a while back. it is a lot of fun to see, in little snippets of audio, the swaras and method of execution that brings out Bagyashree so well, in that unique MSG style.
It shows up reasonably well on Tarsos. But when I try to imitate that with the graphs as the guide, full humility sets in. I am so far away from getting it even over a 3 second snippet. Not surprising at all, of course. But soon that turns in to amazement and then a fun resolve to keep trying. To do that, I have to listen to the audio on repeat and watch the swara graph getting drawn in real time. That is entertainment in itself.

vasanthakokilam
Posts: 10956
Joined: 03 Feb 2010, 00:01

Re: Pitch Analysis with Tarsos - A Tool to Investigate CM?

Post by vasanthakokilam »

I just noticed in the configuration tab where it says 8.176 cents in C-1 with A tuned to 440Hz. This establishes the reference for converting the cents to our swaras for a given Kattai. I need to revisit my comment about my G flute.

mohan
Posts: 2806
Joined: 03 Feb 2010, 16:52

Re: Pitch Analysis with Tarsos - A Tool to Investigate CM?

Post by mohan »

vk - this table I put together long ago may help you as well
http://www.carnaticcorner.com/articles/sruthis.html

vasanthakokilam
Posts: 10956
Joined: 03 Feb 2010, 00:01

Re: Pitch Analysis with Tarsos - A Tool to Investigate CM?

Post by vasanthakokilam »

Yes, it is quite helpful. Thanks Mohan.

cmlover
Posts: 11498
Joined: 02 Feb 2010, 22:36

Re: Pitch Analysis with Tarsos - A Tool to Investigate CM?

Post by cmlover »

With his D2 tuned at 440Hz which is 900 cents his swaras would be:

Code: Select all

Swara Cents Frequency
sa	 0	  261.6255653
ri1	100	277.182631
ri2	200	293.6647679
ga1	300	311.1269837
ga2	400	329.6275569
ma1	500	349.2282314
ma2	600	369.9944227
pa	 700	391.995436
da1	800	415.3046976
da2	900	440
ni1	1000  466.1637615
ni2	1100  493.8833013
Sa	1200	523.2511306
I do not understand the C being tuned to 8.176 cents which would yield
C at 262.8640Hz
If his C was indeed precisely 262Hz then his D2 would be 440.6297 Hz
which is not what he means.
I still wonder how you could identify mandra stayi from a cents graph unless absolute
frequencies are posted...

vasanthakokilam
Posts: 10956
Joined: 03 Feb 2010, 00:01

Re: Pitch Analysis with Tarsos - A Tool to Investigate CM?

Post by vasanthakokilam »

CML: See if this helps. I just played live and have Tarsos pitch transcribe it for me.

Notes:

1) My SA is 700 cents ( approx. 5 kattai )
2) I played S R2 G3 R2 S N3 D2 P D2 N3 S ( N, D and P are in lower octave ). ( Don't laugh at some of my shaky 'curvy' pitches. Then I will claim it is a new kind of gamaka and not a bug ;) )
3) Look at the vertical scale. It is absolute cents counting from Zero across all octaves and it also gives you the modulo 1200 value which is the cents within the octave. That is what I wrote before.


Image

cmlover
Posts: 11498
Joined: 02 Feb 2010, 22:36

Re: Pitch Analysis with Tarsos - A Tool to Investigate CM?

Post by cmlover »

Got your picture! Your flute is G and hence Sa is at 700 cents. The rest fall in place with your "gamakams" :D
Now what is this Pitch value. It is certainly not the frequency (Hz)?

I finally got the Java working. Will start experimenting...

vasanthakokilam
Posts: 10956
Joined: 03 Feb 2010, 00:01

Re: Pitch Analysis with Tarsos - A Tool to Investigate CM?

Post by vasanthakokilam »

>Now what is this Pitch value. It is certainly not the frequency (Hz)?

It is indeed the frequency of the Shadjam of my 5 kattai flute: In absolute cents it is 7900 cents and relative cents it is 700 cents within the octave. When converted to Hertz, 7900 cents is approximately 784 Hz.

The conversion is quite straight forward. The general formula is Frequency = Reference Freq * 2 raised to the power ( cents/1200 ). Reference Freq Tarsos uses is 8.1758. So, the freq of 7900 cents is 8.1758 * 2 power ( 7900/1200 ) = 8.1758 * 2 power 6.5833 = 8.1758 * 95.8894 = 783.97 Hz.

I like to do the above using the following steps, so the meaning is clearer and relatable.

1) Find the Octave from the absolute cents. 7900/1200 = 6
2) Tarsos reference C for absolute cents calculation is 8.1758 Hz. Multiply that by 2 power 6 ( = 64). 64 times 8.1758 is 523.25 Hz. That is C of the 6th octave (i.e 6th octave from reference C that Tarsos uses )
3) Multiply that (523.25) by 1.5 to get 784.875
4) That is G in that octave. That was the Shadjam of my 5 kattai flute.

Note: Step 3 uses the 3/2 ratio to get to G. If I used the equal tempered multiplier ( twelfth root of 2 raised to the power 7 = 1.49830707 ), you will get 783.9891. Close enough.

CML, you can cross check this against the table you included above. It shows Pa as 391.995436 Hz. That is one octave below mine. Multiply that by 2 to get 783.99 to get the same value as above.

Just as an aside, I checked my natural singing(!) voice with Tarsos at 1 kattai. It is at 131 Hz.

BTW, there is a setting in Tarsos in the configuration tab where it can show the Y axis in absolute frequency in Hertz instead of absolute frequency in Cents.

cmlover
Posts: 11498
Joined: 02 Feb 2010, 22:36

Re: Pitch Analysis with Tarsos - A Tool to Investigate CM?

Post by cmlover »

Many thanks VK. That clarifies all my doubts.
Incidentally I noticed
2^(6900/1200)*8.1758 = 440Hz as you had guessed....
This is indeed a useful tool for subtle pitch analysis.
Looks like it will be useful to visually plot and investigate gamakams. Actually the Aro/Avaro of ragas can be codified
using visual "fingerprint" plots. We should start experimenting....
I hope Arun will comment..

nri
Posts: 80
Joined: 21 Feb 2010, 11:05

Re: Pitch Analysis with Tarsos - A Tool to Investigate CM?

Post by nri »

Played around with Tarsos and it was quite fun. Gamakams are pleasing to the eyes, unlike to the ears :-)
vasanthakokilam,
How did you configure the Y-axis to show absolute frequencies in Hz?
nri

vasanthakokilam
Posts: 10956
Joined: 03 Feb 2010, 00:01

Re: Pitch Analysis with Tarsos - A Tool to Investigate CM?

Post by vasanthakokilam »

nri: In the configuration tab, look for 'pitch contour unit' and set it to HERTZ.
You will have to resize the configuration tab to see the various configurable items. If you hover over a particular item, the tool tip will give you the list of possible values for that item.

nri
Posts: 80
Joined: 21 Feb 2010, 11:05

Re: Pitch Analysis with Tarsos - A Tool to Investigate CM?

Post by nri »

Thanks, vasanthakokilam. You made it easy.

joren
Posts: 3
Joined: 01 Mar 2012, 14:52

Re: Pitch Analysis with Tarsos - A Tool to Investigate CM?

Post by joren »

Hello guys, nice to hear you find Tarsos useful.

It seems like most of the questions posed here are already solved, sorry for the delay. There were some questions about pitch representation, to answer those i have written a blog post about pitch representation in Tarsos. It explains pitch representation in general and why I chose to use 8.176Hz as a reference for the cents scale. As said above it is indeed a C-1 and you can change it in the configuration panel.

To help starting users I have created two screencasts of tarsos. This one shows the basic functionality (with an old UI). The other shows how you can use Tarsos live.

As a sidenote: you can change the reference tuning. By default the 12 western pitches are used but you can load any tuning. Tunings are defined in scale files, which are simple text files. For more info, please see the Tarsos manual.

If there are requests of features, something like 'if this or that was included in Tarsos it would be more useful for CM". Please, let me know.

cmlover
Posts: 11498
Joined: 02 Feb 2010, 22:36

Re: Pitch Analysis with Tarsos - A Tool to Investigate CM?

Post by cmlover »

welcome back!
I was playing with your "Audio fingerprinter" to find a needle in the haystack.
When I give a clip and ask it to find in another file (haystack) it gives me a percentage
(say 85%) of finding it. How do I interpret this? More importantly how do I find where the needle is
located in the haystack?
This will be useful for locating musical phrases in CM in musical renderings if properly used
(If my understanding is correct....)

vasanthakokilam
Posts: 10956
Joined: 03 Feb 2010, 00:01

Re: Pitch Analysis with Tarsos - A Tool to Investigate CM?

Post by vasanthakokilam »

Joren: Thanks for checking back in. Please do so often and participate.

I have been using Tarsos for the past week off and on to get familiar. I think it is going to be useful to me and others.
I very much like your no-frills style of writing the documentation!!

You asked for some feedback on whether it is useful for CM and any feature additions we can use. Let me write about that below.

Here is my first cut list of where it is starting to be useful to me personally.

1) One objective I have is for it to help me convert a piece of indian classical ( or film ) music to notes. It does not have to do it perfectly but just give me the approximate idea. I can pick it up from there. In addition to serving that purpose, I hope it will also increase my ability to convert a melody to notes myself,over time.

2) Gamakas are a tough and complex thing in CM. (Duh!) I will have to see how well the contour that Tarsos draws maps to the standard technique we use to produce the gamakas. The more I look into it, the more complex it becomes. I was exploring a 10 second violin piece by MSG ( Bagyasree raga I wrote about earlier ). The distance between just playing the notes and the actual effect of MSG's music is miles apart even in that 10 seconds of music. I need to add in little subtle things here and there to make it even come close to bringing his Bagyasree motif to life. I think Tarsos's annotation graph is going to help eventually. I first need to notate what effect a particular curvature produces. It is going to be an ongoing process.

3) As a third goal, I think it helps people check their note purity ( sruthi suddham ). Holding 'Sa' (C) or Ga ('E') constantly is itself a big task for amateurs. Mine was quite wavy, embarrassingly so. But at least I know now why my attempts at singing is so bad and what I need to do to improve. With some conscious practice I can bring the karvai notes more steady. I then checked some professionals and Tarsos annotation graph was quite straight and horizontal for them. So Tarsos can help in establishing the target goal from a sample of a professional/teacher and then folks can practice live until their graph matches the target. Believe me, it is not easy to keep Tarsos happy!!. Even if I can somehow get it to match for 5 seconds, it can deviate significantly unless one has good voice technique. For example, it is not just enough to have accurate note production at good lung air volume but one needs to keep it equally accurate as the amount of air in the lungs keeps getting less and less ( at the low end of the breathing cycle ). Tarsos catches and shows all those mistakes quite glaringly.

In terms of features, first some CM specific ones and then some general 'wouldn't be nice' requests. I am hitting you with a lot. Don't feel obligated. This is just for your consideration if and when you have time to add some enhancements.

CM specific wish list:

1) Label the Y axis with CM solfa syllables. You can do it by a simple rule. For example, if the user specifies S is '700 cents', then you label 800 as R1, 900 as R2, 1000 G2, 1100 etc. Here is the full mapping for this example.
( 700 S, 800 R1, 900 R2, 1000 G2, 1100 G3, 1200 M1, 1300 M2, 1400 P, 1500 D1, 1600 D2, 1700 N2, 1800 N3, 1900 S' 2000 R1' 2100 R2' etc. ) Different folks will have different cent values for S but the intervals are the same. The above mappings are only approximate for CM but that is good enough.

2) Optionally, It will be good if you can label the annotation graph itself with the solfa symbols when there is a steady note, or a region of oscillatory activity over a flat line but now I am getting greedy.

3) Optionally, on the horizontal scale, have the ability to mark off Rhythm cycles. The user can mark places on the X axis with some symbols for one cycle and then you can apply that same pattern to the right of that till the end of the song ( or a specified number of cycles ). At the minimum, marking the start of one cycle alone ( and the end of the cycle as a result ) can be very useful. The automatically drawn X axis markers will not be right since the musicians may not have the most perfect rhythmic timing. To accommodate that, as you do elsewhere in the program, provide a drag and adjust type of method for the user to adjust it.

If you have any questions on these, please feel free to ask.

General 'wouldn't be nice' kind of suggestions:

1) Save key strokes to get the annotations view. Currently, I have to first dislodge the annotations window, make it bigger, then hit the 'fit to screen' button before I get useful information from it. It will be good, if I can define the upper and lower bound for that window ahead of time ( or save a previous manually created setting ), so it shows only that range and in that size upon launch.

2) It will be useful to have a 'live' view of that annotation window. Meaning, if the graph reaches the end of the window and more music has passed, I need to hit that 'fit to screen' button for it to show the new data. It will be good if it scrolls automatically to the left.

3) I use that 'fit to window' button a lot but still its meaning is not clear since at times it does not behave quite what I thought it will. For example, if I zoomed in to a particular frequency band and if I hit that button, it sometimes shows a region where there is no data.

4) May be we need another button which is a simple refresh of that annotation window without changing the frequency scale but just move forward in the time dimension. This is useful when I have zoomed in to a portion and I want to keep it that way but look at what is to my right, on the time scale.

Even without any of the above features, Tarsos is a very useful program. Thanks Joren for all the hard work on this. I encourage others to give it a try and provide suggestions on how/where we can put it to good use.

Joren, If we find any bugs, where do you want us to send them to? Thanks.

cmlover
Posts: 11498
Joined: 02 Feb 2010, 22:36

Re: Pitch Analysis with Tarsos - A Tool to Investigate CM?

Post by cmlover »

well said VK!
Joren can help enormously in our technical discussions...
Tarsos has strong potentials for CM developments..

joren
Posts: 3
Joined: 01 Mar 2012, 14:52

Re: Pitch Analysis with Tarsos - A Tool to Investigate CM?

Post by joren »

Thanks for the useful feedback. Resetting your workbench to the previous state is something that should be present for sure. I tried this before but it did not work for some reason. Let's try again.

The other remarks are very useful as well, but some are more easy to implement than others, so I will see what I can do. I will keep an eye on this thread. Bugs can be emailed to joren.six@hogent.be or handled via github.

To cmlover: the fingerprinting system works by comparing pitch class histograms and indicate how much two sequences of notes match. It does not take into account absolute pitch but the pitch intervals. Details can be found in the paper A Robust Audio Fingerprinter Based on Pitch Class Histograms - Applications for Ethnic Music Archives. The 85% match can be interpreted as "the same pitch intervals were most of the time used and also the relative use of pitch classes, the tempo, is similar".

cmlover
Posts: 11498
Joined: 02 Feb 2010, 22:36

Re: Pitch Analysis with Tarsos - A Tool to Investigate CM?

Post by cmlover »

Thanks joren for the prompt reply and participation.
I had misunderstood the "pitch class fingerprinting" as identifying musical phrases from a fresh piece (haystack). I'll read your paper carefully to get the feel of the process. At the outset it appears it will be useful in identifying ragas (the explicit ones!) in CM. That itself will be a major contribution.
Our more mathematically oriented friends can give you feedback to adapt it for "robust raga identification" in a noisy CM milieu.

vasanthakokilam
Posts: 10956
Joined: 03 Feb 2010, 00:01

Re: Pitch Analysis with Tarsos - A Tool to Investigate CM?

Post by vasanthakokilam »

CML: Tarsos already supports a scheme close to 'raga identification'. It is more like scale identification. It uses scales specified in the Scala notation and then matches the pitch class histogram of a piece of music with scale definitions to find a match. I will have to give it a try.

cmlover
Posts: 11498
Joined: 02 Feb 2010, 22:36

Re: Pitch Analysis with Tarsos - A Tool to Investigate CM?

Post by cmlover »

Interesting!
Do please show me by an example when you get the time...

vasanthakokilam
Posts: 10956
Joined: 03 Feb 2010, 00:01

Re: Pitch Analysis with Tarsos - A Tool to Investigate CM?

Post by vasanthakokilam »

Joren: I tried the scale match using the procedure you outline in your manual

Find the most similar scale to the current scale from a folder of
Scala les.
1. Detect the tone scale of a song. See section 2.3. Important: peak
detection needs to be nished.
2. Create a folder with a number of scala les.
3. Open the folder using the File-Open... menu.
4. The closest scale is detected from the folder and overlayed on the
detected pitch class histogram.

Where will I see the matched scale displayed? Will it tell me if it can not find a match? Will it display the name of the scale that it matched?

In my test, I could not see it do anything. Though my sample was not a strict match to the scala file I made for Shankarabharanam. It is possible I did not do it right. Here is my scale definition.

! Shankarabharanm-G.scl
Shankarabharanam
7
!
200
400
600
700
900
1100
1200

This is actually the Major scale with 700 cents as my 'Sa'.

See if you can give us an example on how to do it with such a scale definition. Thanks.

Post Reply