?

Log in

No account? Create an account
The ragam chart version 1.0 - Arvind Narayanan's journal [entries|archive|friends|userinfo]

The ragam chart version 1.0 [Jan. 9th, 2006|02:14 pm]
Arvind Narayanan
[Tags|]

Another tool for Carnatic pedagogy - a layout of ragams on a 2D chart! Ragams close together on the chart are supposed to sound similar.

Force directed graph layout is a wonderful class of algorithms for generating a layout of a graph on a plane in a way that is useful and intuitive for humans to visualize. Suppose you have a graph with weighted edges, the algorithm assumes that nodes are point masses connected by attractive-repulsive force fields (i.e, repulsive at small distances and attractive at large distances; imagine springs) whose strengths are related to the weight of the corresponding edge. The algorithm starts with a random initial configuration of the masses, and uses any of a gazillion techniques (say simulated annealing) to find the resting configuration of minimal potential energy.

But to lay out ragams on chart, how does one define the edge weights? I simply considered the Hamming distance between the scales; i.e, if a note is found in one ragam but not in the other, then it contributes one unit to the distance. The weight between two edges is inversely related to the distance, so that the more notes two ragams share, the greater the edge weight. This is very crude and ignores most of the information about the ragam. However, it is an excellent starting point and already gives surprisingly good/useful results. For instance, one of my favorite clusters is Hanumatodi/Asaveri/Ahiri/Desiyatodi/Dhanyasi near the top left.

Ragam chart version 1 - 2200x2200 png (180K). Uses alpha transparency, so might look like crap in Internet explorer. Get firefox.

There are 180 ragams in the chart, the 72 melakartas plus 108 janyas. The janyas were chosen somewhat arbitrarily based on familiarity, because I couldn't find a definitive list of the most common ragams. The layout tool I used was ccvisu, which is not great but has all the basic features. Plus it generates svg output which is great. (Livejournal won't let me upload svgs for some reason, so I was forced to convert it to png before uploading. Grrrr.)

There are two main things that need to be improved:
* layout - the melakartas need to be in a different color. I can do this by scriptomatically postprocessing the svg. Python-fu! Also, a few of the raga labels overlap with others, which I can easily hand-edit.
* Ragam similarity algorithm. This is the main problem. One obvious improvement is to look at the arohanam scale and the avarohanam scale separately. I plan to implement that. However, I have no idea how to incorporate information about gamakams, tempo or anything else because I don't have that information in the first place. A list of each ragam's gamakams would greatly improve the accuracy of the chart. I've tried googling and found nothing. Does anyone know if such a list exists?

Oh, and two things:
* 'Scriptomatically' needs to be a word!
* I SVG :)

Update: version 2 released (2000x2000 png, 200K). The layout issues have been fixed. I find it fascinating how the melakaratas (blue) cluster together in the center. The algorithm should be slightly better now because it considers the scale of the arohana and avarohana separately. For example Sri is close to Madhyamavati whereas it wasn't in version 1. Of course, it still completely ignores gamakams and everything else. (SVG is also available if anyone wants to hack on it.)
LinkReply

Comments:
From: (Anonymous)
2006-01-09 08:03 am (UTC)
gamakams are classified in the sangeetha sampradaya pradarshini available at guruguha.org . A profound rAga like bhairavi can have all sorts of gamakams as "kampitam" "orikai" etc. at most of its svaras. You might want to download the text from guruguha.org ( the translation is not at all good but I don't know if that can be helped because even the tamizh version doesn't seem to give too clear explanations ).

Now I have many doubts regarding the result, like how did Arabhi, sAma and shuddha sAvEri fall so away from each other, how did kAmbhOji get closer to shankarAbharaNam than kalyANi etc. ( from a gamakam point of view it is kind of clear why this should be the case but you don't seem to have incorporated gamakams )?

Another interesting thing seems to be that mOhanam seems closer to harikAmbhOji than shankarAbharaNam or kalyANi according to your diagram; and incidentally mOhanam is treated as a janyam of harikAmbhOji though its scale is also a part of shankarAbharaNam and kalyANi. The same applies to shuddhasAvEri. To be frank I haven't really got a hang of your algorithm; can you point to something that gives more details?

Thanks and regards,
Sandeep
(Reply) (Thread)
[User Picture]From: arvindn
2006-01-09 09:54 am (UTC)
Hey, this is a crude first approximation. If some ragams are close to each other and you can't see how it is most probably by coincidence. Also keep in mind that the whole concept of layout generation is the collapsing of a high dimensional space (in this case at least 12) into two dimensions, and so it is inevitable that there will be adjacent ragams that aren't supposed to be near each other. But the algorithm tries to minimize such occurences (while also making sure that neighbors in the high-D space are also neighbors in the 2D space.)

The guruguha.org text looks interesting. Let me see if I can get the latex files from them; those will be much more useful than the pdfs.

See if Introduction to Force-Directed Graph Layout helps; if not I will try to find a better description.
(Reply) (Parent) (Thread)
[User Picture]From: arvindn
2006-01-09 10:15 am (UTC)
I think the updated version 2 is somewhat better, but not much. I had another idea for improving the algorithm without gamakams: compute the distance with a bedam or tiruppam or rotation value of 1, 0 and -1 and take the minimum; if the minimum is found with 1 or -1 then impose a small penalty. This will bring (say) revati and shivaranjani closer. Do you think this is worth implementing?
(Reply) (Parent) (Thread)
From: (Anonymous)
2006-01-09 11:02 am (UTC)
I am slightly skeptical of the rotation thing ( what do bedam and tiruppam mean? Rotation? ) because (hanuma)tODi can be rotated to get (mEca)kalyANi!

By the way when I asked why kAmbhOji was closer to shankarAbharaNam etc. I wasn't pointing to the inadequacies in implementation or representation but suggesting that something you did with the scale alone seemed to imply some things about the gamakam-wise similarities too.

Is there any way you can feed in as data for a rAga a bunch of san~cAras with a "gamaka" value ( kampitam etc. ) for each svara and do pattern matching to calculate distance according to how long common substrings they have? Some pattern clustering or so? ( am I rambling? )
(Reply) (Parent) (Thread)
[User Picture]From: arvindn
2006-01-09 11:18 am (UTC)
Yeah, that's the whole idea. If the data is there then code can easily be written to take advantage of it. All I need is a mapping from each svara of each raga to a gamakam type.
(Reply) (Parent) (Thread)
From: (Anonymous)
2006-01-09 11:47 am (UTC)
You mean, mapping each svara to a set of gamakam types ( the same svara gets different gamakams in different san~cArams ). Probably you will once again have to call for volunteers, this time for the mapping excercise :-))

Also how would one incorporate the orders : sa ma ga ma pa dha ni sa being different from sa ga ma pa dha ni sa?
(Reply) (Parent) (Thread)
[User Picture]From: sunson
2006-01-09 10:59 pm (UTC)
Sexy stuff. But I don't find some of the 'grouping' very sensible. Very much on the lines of what Sandeep has pointed out.
(Reply) (Thread)