<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Madhur Raj N on Medium]]></title>
        <description><![CDATA[Stories by Madhur Raj N on Medium]]></description>
        <link>https://medium.com/@madhurrajn?source=rss-2f627feaea5b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*9XD7StWRnqNHxaQL</url>
            <title>Stories by Madhur Raj N on Medium</title>
            <link>https://medium.com/@madhurrajn?source=rss-2f627feaea5b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 22:26:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@madhurrajn/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Two ragas, the same notes]]></title>
            <link>https://medium.com/@madhurrajn/two-ragas-the-same-notes-1b3fdad8c31e?source=rss-2f627feaea5b------2</link>
            <guid isPermaLink="false">https://medium.com/p/1b3fdad8c31e</guid>
            <category><![CDATA[indian-classical-music]]></category>
            <category><![CDATA[music-theory]]></category>
            <category><![CDATA[signal-processing]]></category>
            <category><![CDATA[carnatic-music]]></category>
            <category><![CDATA[music-technology]]></category>
            <dc:creator><![CDATA[Madhur Raj N]]></dc:creator>
            <pubDate>Mon, 16 Nov 2026 18:39:53 GMT</pubDate>
            <atom:updated>2026-11-16T18:39:53.414Z</atom:updated>
            <content:encoded><![CDATA[<h3>The Manji that never came up</h3><p>A few days after I wrote about finding Sa, I played a Manji recording from YouTube to my app. The live guesses went through Revati and a few other ragas. It never said Manji. So I went back through what the app had heard, second by second, to see why.</p><p>Two things were going on. For the first few seconds the app had Sa on the Pa below the real Sa, and heard from there, the notes fit Revati. That is the kind of Sa mistake I wrote about in <a href="https://medium.com/@madhurrajn/identifying-sa-digitally-is-harder-than-i-thought-630a54909694">my last article</a>. The second thing is what this article is about. Even after Sa was right, Manji was never really in the running, because Manji uses the same swaras as Bhairavi.</p><h3>A raga is more than its swaras</h3><p>When we learn a raga, we start with its arohanam and avarohanam. It is easy to think of the raga as those swaras. A computer thinks that way very easily, because swaras are the part it can measure.</p><p>But many ragas share their swaras. In my app’s raga list, Manji has the same swaras as Bhairavi, going up and coming down. Arabhi and Devagandhari have the same arohanam and avarohanam too. Some books give Devagandhari a touch of N2 coming down, and on paper that is all that separates them. People who know these ragas do not mix them up. They hear the phrases: which swaras go together, where the voice rests, which notes are only touched on the way to another, and the shape of the gamakas.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_DJHZfzGqL-iWu7z85wGxA.png" /><figcaption>Swaras used by each raga, going up and coming down together</figcaption></figure><p>So when an app hears exactly the swaras of Bhairavi, it has not heard enough to say Bhairavi. It could just as well be Manji. The swaras narrow it down to a family. The phrases decide.</p><h3>A small raga inside a big one</h3><p>The next one was Gambhira Nattai. I played it, and the live guess said Shankarabharanam.</p><p>Gambhira Nattai has five swaras: S G3 M1 P N3. Every one of them is also in Shankarabharanam, which has seven. So nothing the singer holds is wrong for Shankarabharanam. If the app also hears a little R2 or D2, maybe inside a glide, Shankarabharanam fits even better. A bigger raga can always explain the notes of a smaller one that sits inside it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8tl6GVlXTItkHU99kvfnDQ.png" /><figcaption>Gambhira Nattai’s five swaras within Shankarabharanam’s seven</figcaption></figure><p>A listener goes the other way. Part of what makes Gambhira Nattai sound like itself is what it leaves out. It goes from S straight to G3 and from P straight to N3, and you notice that R and D never come. For an app, noticing that something is missing is much harder than noticing that something is there. It has to decide whether a swara was really never sung, or sung so briefly that it slipped past.</p><h3>A difference that only comes on the way down</h3><p>Then there was a Kalyana Vasantham that the app named Chandrakauns.</p><p>Going up, the two ragas are the same: S G2 M1 D1 N3 S. Coming down, Kalyana Vasantham adds P and R2: S N3 D1 P M1 G2 R2 S. Chandrakauns comes down without them: S N3 D1 M1 G2 S.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KxYLy8PWUYn471xO6_HAnA.png" /><figcaption>Arohanam and avarohanam of the two ragas</figcaption></figure><p>So the whole difference is two swaras, and only on the way down. In the take I checked, P and R2 did come, but quickly, inside phrases sliding down towards Sa. To the ear they were clearly there. On the pitch graph they were short blips between the notes that were held. Take the blips away as passing notes, and what is left is exactly Chandrakauns.</p><h3>Held notes and passing notes</h3><p>All three cases come back to one question. When has a swara been sung?</p><p>In Carnatic music very few swaras are a flat, steady pitch. The voice slides into notes, swings around them and passes through others on the way. If an app counts every pitch the voice passes through, every raga starts to look like all twelve swaras. If it counts only the notes that are held still, it throws away swaras that were really sung, like the P and R2 in that Kalyana Vasantham.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dVOf43u47yXY156GY64r7g.png" /><figcaption>How held and passing notes look on a pitch graph</figcaption></figure><p>I checked how much time each swara actually gets in some of the recordings I test with. In two Shankarabharanam takes, N3 took up only about 2 to 3 percent of the singing, and it never stayed still for even a sixth of a second. Both were clearly Shankarabharanam. On the pitch graph, N3 was a few thin crossings.</p><h3>What a rasika hears</h3><p>A rasika does not count swaras. Within a few phrases they know Manji from Bhairavi, from a turn of phrase that only one of them uses, the notes the singer keeps coming back to, and the shape of a gamaka. They also know which ragas are common, so a quick R2 inside a fast phrase does not make them doubt Gambhira Nattai.</p><p>An app that only looks at swaras will keep making these mistakes, however well it measures pitch. What I have changed so far is small. When the app names a raga, it also names the close ones the notes cannot rule out, like “Close: Kalyana Vasantham”. And when you tell it the right raga, it remembers that on your phone. Teaching it the phrases themselves needs recordings of these ragas that I am allowed to learn from, and for ragas like Manji there are not many.</p><p>If you sing or teach any of these ragas and would be happy to record a few minutes for this, I would like to hear from you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1b3fdad8c31e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Identifying Sa digitally is harder than I thought]]></title>
            <link>https://medium.com/@madhurrajn/identifying-sa-digitally-is-harder-than-i-thought-630a54909694?source=rss-2f627feaea5b------2</link>
            <guid isPermaLink="false">https://medium.com/p/630a54909694</guid>
            <category><![CDATA[indian-classical-music]]></category>
            <category><![CDATA[signal-processing]]></category>
            <category><![CDATA[music-technology]]></category>
            <category><![CDATA[carnatic-music]]></category>
            <category><![CDATA[app-development]]></category>
            <dc:creator><![CDATA[Madhur Raj N]]></dc:creator>
            <pubDate>Sun, 18 Oct 2026 14:39:32 GMT</pubDate>
            <atom:updated>2026-10-18T14:39:32.133Z</atom:updated>
            <content:encoded><![CDATA[<p>Over the last 8 years I have been building a practice app for Carnatic music. It has a tanpura, tala, a pitch check, an evaluation of your singing and raga identification.</p><p>When I started, I was sure the hard part would be ragas. 72 melakartas, hundreds of janyas, all the gamakas. Finding Sa looked like a small first step. It was not. Sa became the problem I spent the most time on, and even today it is behind many of the mistakes the app makes.</p><p>In this post I want to write about why Sa is so hard to find. I won’t go into how the app does it (that’s for another post, and honestly it is still changing), but the problem itself is interesting, and I think anyone building software for Indian classical music will hit it sooner or later.</p><h3>First, what is Sa?</h3><p>If you are not from a Carnatic background: Sa is the base note. Ri, Ga, Ma, Pa, Da and Ni are all counted from Sa.</p><p>The catch is that Sa is not a fixed pitch. In Western music, A is 440 Hz. In Carnatic music every singer picks a Sa that suits their voice. Men usually sing somewhere around C or D, a lot of women around G or A. We say it in kattai: “I sing in 5 kattai” means my Sa is near G. Near, not exactly. Nobody minds if your Sa sits a little between two piano keys, because only the distance from Sa matters.</p><p>On stage the tanpura holds this Sa for everyone. Three of its strings are tuned to Sa and one to Pa (sometimes Ma), and the singer, violinist and mridangam artist all follow it.</p><h3>Why the app needs Sa for everything</h3><p>Almost every feature in the app goes through Sa.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ejHv8NXmraCFVJmyWm0jHw.png" /><figcaption>Every feature reads the singing through Sa</figcaption></figure><p>The microphone only gives me a pitch in Hz, and Hz means nothing in Carnatic music until you know Sa. Once Sa is known, a pitch becomes a swara: this is Ga, this is Pa. Only then can the app tell a student their Ga is a little flat, or say the song looks like Mohanam.</p><p>If Sa is wrong, everything after it is wrong, and the app says it with full confidence. It will tell you “your Ga is 40 cents sharp” when you actually sang a perfect Ma.</p><h3>Where it gets difficult</h3><h4>The note sung most is not always Sa</h4><p>My first idea was simple: find the note the singer stays on the longest and call it Sa.</p><p>It works sometimes. But many ragas spend most of their time on other notes. One recording I tested had more than a minute of the singer moving around Pa and Ga, touching Sa only now and then, and no tanpura that I could hear. Count the notes and Pa wins easily.</p><h4>Pa looks a lot like Sa</h4><p>This one took me a while to understand. In Carnatic music almost every note is sung with gamakas. The notes shake, slide and move. Only Sa and Pa are held still.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jPOdb8uRO9uayywYoOp1Ng.png" /><figcaption>A sketch of a phrase: Sa and Pa held steady, the other notes with gamakas</figcaption></figure><p>So when the software finds a nice steady note that the singer keeps coming back to, it could be Sa, or it could be Pa. And if you take Pa as Sa, the other notes still make some raga, just a different one. That is how Todi and Mukhari got mixed up in one of my tests.</p><h4>No Pa? Then Ma causes the trouble</h4><p>Some ragas don’t have Pa at all, like Vasantha or Hindolam. Then Ma becomes the confusing note. If you treat Ma as Sa, the real Sa above it looks exactly like a Pa. One of my Vasantha recordings came back as a completely different raga because of this.</p><h4>The tanpura doesn’t always save you</h4><p>I expected the tanpura to solve everything. When you can hear it, it is the best clue there is. In the gaps between phrases it is often the only sound left.</p><p>But the Pa string rings as loud as the Sa strings. So the drone gives you two strong notes, a fifth apart, and you still have to decide which one is Sa.</p><p>It gets worse for ragas without Pa, where that string is tuned to Ma. Look at these two tanpuras:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X-2gbmwBbOYSwRTFCxMjTQ.png" /><figcaption>A Pa-tuned tanpura on F and a Ma-tuned tanpura on C give the same two notes</figcaption></figure><p>Both give you the notes C and F. One has Sa on F, the other has Sa on C, and from the drone alone you can’t tell which.</p><p>There is one more strange thing. When two strings ring together, the pitch tracker sometimes hears a note that nobody is playing, a kind of ghost note from the two strings combined. On a Ma-tuned tanpura that ghost note is Ma again, and it can come out louder than the real Sa.</p><p>And on a phone, the tanpura is often very faint or not there at all. In concert recordings it is buried under the voice, violin and mridangam.</p><h4>Same notes, different raga</h4><p>This is the part I find most beautiful about Carnatic music, and the most annoying when you write software for it. Take the five notes of Mohanam and move Sa to another of those notes. You get a different raga from the same notes. Musicians call this graha bhedam.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u7fnpgYgAzw5CZ-yuncJqQ.png" /><figcaption>Graha bhedam: the same five notes as five ragas, depending on where Sa is</figcaption></figure><p>So Sa and raga depend on each other. To know the raga you need Sa. To be sure about Sa, it helps a lot to know the raga. You can’t find one first and then the other. And a raga the app knows well can sometimes fit a wrong Sa better than a rare raga fits the right one.</p><h4>Which octave?</h4><p>Even with the right note, you still have to pick the right octave. A song that moves between Pa and the upper Sa looks very much like a song that moves between the lower Pa and Sa. Same width, Pa at one end and Sa at the other.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ysneVkuRWyWQ8bQ_Kgtygg.png" /><figcaption>The octave problem: two passages with the same shape</figcaption></figure><p>Early on, I took the octave from the Sa set in the app. That works for your own singing. But when you use Identify on someone else’s song, your Sa setting has nothing to do with it, and the app got confused.</p><h4>Practice is not a concert</h4><p>Most research on finding the tonic uses concert recordings: long performances, professional singers with steady pitch, a tanpura in the background. A student practising at home gives you 15 seconds of varisai on a phone, no tanpura, and a Sa that slowly drifts as they get tired. Some phrases never touch Sa at all.</p><p>And if they sing without the app’s tanpura, they might not even be at the Sa they set in the app. If I measure them against the setting, every note looks wrong. If I ignore the setting, I lose my best hint.</p><h3>How musicians do it</h3><p>What still amazes me is this. An experienced listener can walk into a concert in the middle of an alapana and know where Sa is within a few seconds, without any tanpura. They are not counting notes. They hear which notes are steady and which are shaken, where the phrases come to rest, which phrases belong to which raga. Sa and raga come to them together. Ask them how and they will just say “you can hear it”.</p><p>That is really what the app has to learn to do.</p><h3>Where the app is today</h3><p>Like I said, I’ll keep the details for another post. In short, no single clue works on its own. Every clue above fails somewhere, so the app has to use them together and let them check each other.</p><p>On concert recordings with a tanpura it gets Sa right most of the time. Practice recordings on a phone without a tanpura are harder, and ragas without Pa still trip it up. When the raga comes out wrong, a wrong Sa is still one of the main reasons.</p><p>So the app also lets you simply tell it your Sa, by singing it for a few seconds or by picking your kattai. If you practise with the app’s tanpura on, that is the Sa it measures you against.</p><h3>One last thing</h3><p>Sa changing from singer to singer is not a flaw in the music, it is how the music works. Everyone sings at a pitch that is comfortable for them and everything else is relative to that. A man at 2 kattai and a woman at 5½ kattai sing the same Kalyani. Software just has to respect that.</p><p>If you have a recording where Sa is tricky to find, please send it to me (with the singer’s permission) to madhurrajn@gmail.com. Those recordings help me the most.</p><p>The app is called Carnatic Tanpura, Tala &amp; Pitch, and it will be on Google Play soon.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=630a54909694" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>