Raga and Tala
What are the two systems behind Indian classical music, and how does a drummer land a phrase exactly on sam?
Near the end of a solo the tabla player launches a phrase three times and lands on the first beat of the cycle: a tihai, the equation (start - 1) + 3p + 2g - 1 = 0 modulo the cycle, solved in real time. Behind it are two systems. The drone: a tanpura whose curved bridge, modelled here as a string by finite differences with a one-sided contact, more than doubles its brightness for the first third of a second. The swaras: twelve positions, the 22 shrutis as one reconstruction, a pure Ga that locks onto the drone where a tempered one beats ten times a second, and intonation that musicians vary by raga and phrase. A raga is far more than a scale: Yaman and Bilawal differ by one note and a habit of movement; Bhupali uses five; gamakas mean that much of the time is spent between the named notes. Bhatkhande's ten thaats are ten of 32 possible scales; Venkatamakhin's 72 melakartas are generated and numbered, 29 the major scale. Tala is a cycle of claps and waves, Teentaal, Jhaptaal and Rupak heard and Adi kept by hand; a performance moves from alap to gat. The Tune becomes Bilawal: an alap over the drone, a gat in Teentaal, and a tihai landing on sam.
What you need. Part 5 for beats and consonance; Part 6 for commas; Part 11 for metre; Part 12 for scales; Part 14 for melody models; Part 15 for key profiles; Part 33 for cycles and modular arithmetic. Finite differences, modular arithmetic, combinatorics of scales.
- Ideas, mathematics and history
- the drone, swara and shruti, raga as a path, gamaka, the 72 melakartas, tala cycles, the arithmetic of the tihai
- What we build, compute and hear
- a tihai solver; a tanpura with its buzzing bridge; the Tune as an alap and gat
What you will be able to do
Foundations
- Hear a raga's notes against the drone, and tell two ragas with nearly the same scale apart.
- Keep a tala by hand and hear where sam falls.
- Explain what the tanpura's curved bridge does to its sound.
Full course
- Solve the tihai equation for any tala, start and phrase.
- Generate the thaats and the 72 melakartas, and place any scale among them.
- Model a string with a one-sided contact and measure its brightness.
Research
- Design a study of which features listeners use to recognise a raga.
Practice
- Work with the tradition's teaching methods (sargam, bols) when learning or recording this music.
Contents
Each chapter has a home level. Choose a track to see what to read and watch: Foundations 30 min · Full course 32 min · Research 35 min · Practice 32 min.
- 0Three times to samFoundations2 min
- 1The droneFoundations3 min
- 2Swara and shrutiFoundations4 min
- 3More than a scaleFoundations3 min
- 4GamakaFoundations3 min
- 5Thaats and melakartasFoundations3 min
- 6TalaFoundations3 min
- 7The tihai equationFoundations3 min
- 8How a performance unfoldsFoundations3 min
- 9Two traditions, and how they are taughtPractice3 min
- 10Frontier: computing ragaResearch2 min
- Variation 34, recap and problemsAll tracks2 min
Also on this page: Lecture · Key results · Try it · Lab · Problems · Notes and sources · Build the film.
Lecture
The text of each chapter is the film's narration, as it is spoken, so you can read along or revise without the film. The pictures are in the film. A dashed box stands for a number the film computes when it is rendered (hover over it to see what is computed); the README's figures for each chapter, where it lists them, follow the chapter's text.
Three times to samFoundations2 min
Listen to a sixteen-beat cycle on the tabla, over the drone of a tanpura. Then, in the second cycle, the drummer breaks off and plays a short phrase three times, with gaps, so that its very last stroke falls on the first beat of the next cycle, the sam. In a concert, this is the moment musicians and audience arrive together, often with a nod or a shout. It is called a tihai, and it is arithmetic done in real time.
A word before we begin. This part is about the classical music of north and south India, Hindustani and Carnatic. They are two of the world's great systems of melody and rhythm, centuries old and very much alive. The film explains their structure; it is no substitute for listening to their masters, which every viewer should do. Every sound here is our own model, a tanpura string, a tabla and a bowed tone, playing phrases written in the manner of the ragas named. Terms are given in their own languages, with their usual meanings.
Here is the plan. The drone, and the tanpura's buzzing bridge, built as a model. The notes, swara, and the old question of their tuning, shruti. Raga, which is far more than a scale. The thaats and the seventy-two melakartas, generated. Tala, the cycles of beats. The tihai equation, solved, and how a performance unfolds.
A few habits help when listening to this music. Find Sa in the drone first, and hear every note against it. In the slow opening, notice which notes the performer dwells on, and how each one is approached. Once the drum enters, count the cycle with your hands, the tala’s prescribed gesture on sam and a wave on khali; Rupak notably begins with a wave. Listen for a tihai coming: a phrase that begins to repeat. And listen to real performances: this film's models can only point the way.
1The droneFoundations3 min
Why does a tanpura buzz?
Indian classical music is heard against a drone. Every note of a raga is measured against Sa, the tonic, which sounds all the time. The tanpura is a long-necked lute with four strings and no frets, plucked slowly in a cycle, usually tuned Pa, Sa, Sa, and Sa an octave below, with Ma or Ni instead of Pa for some ragas. The drone fixes the reference against which every note's tuning is judged: Part 5's consonance, heard continuously.
The tanpura's sound comes from its bridge. The string does not leave the bridge at a sharp edge, as on a guitar. It lies across a wide, very gently curved surface of bone, adjusted with a cotton thread. As the string swings, the point where it lifts off the bridge moves back and forth. That moving contact shakes energy up into high partials, and the tone buzzes and shimmers. The effect, and the art of shaping the bridge, are both called jawari.
Monochord models it. A string, split into eighty pieces, obeys the wave equation step by step; the curved bridge is a surface the string may touch but never pass through. Pluck it with a sharp bridge, then with the curved one. A tenth of a second after the pluck, the plain string's brightness is hertz; with the curved bridge it is , and it stays bright for the first third of a second. Listen to both, and then to the four strings in their cycle.
The drone is tuned to the raga. Usually the first string is Pa, the fifth. But some ragas leave Pa out altogether, Malkauns for one, and a Pa in the drone would fight them. Then the first string is tuned to Ma, the fourth, or sometimes to Ni. Listen to the usual tuning, then the tuning with Ma.
The physics has a history. C. V. Raman, who later won a Nobel prize for light, studied the curved bridges of the sitar and tanpura in the 1920s. The contact between string and bridge is nonlinear: how loudly the string is plucked changes its tone. Modern simulations, by Vyasarayani and colleagues and by Stefan Bilbao's group, model the contact much as this one does. Ours is crude: a rigid bridge, no thread, motion in one plane only. But it shows the main effect: energy pushed up into high partials.
2Swara and shrutiFoundations4 min
How many notes are in an octave?
The notes are called swaras. There are seven, Sa, Re, Ga, Ma, Pa, Dha and Ni, sung as sargam, the way Western singers use do, re, mi. In this Hindustani naming scheme Sa and Pa have no komal or tivra variants; their sounding intonation and ornament still depend on practice. Re, Ga, Dha and Ni can be lowered, komal, and Ma can be raised, tivra. That gives twelve positions, like the piano's. In this film komal notes are written in lower case, tivra Ma with a mark, and a dot after a note means the octave below.
Between the twelve positions lies an old question. The Natyashastra, a treatise about two thousand years old, divides the octave into twenty-two shrutis. Later writers read them as just ratios, giving two versions of most notes, a comma apart, about twenty cents: here, one modern list, against twelve equal steps. Whether musicians ever sang twenty-two fixed pitches, or the shrutis described something else, is disputed among scholars.
Hear two of the shrutis. Re as nine eighths, two hundred and four cents, reached by stacking fifths. Re as ten ninths, one hundred and eighty-two cents, the step left when a pure third is split into two unequal tones. Each over the drone, then the two alternating alone. They differ by the syntonic comma of Part 6, twenty-one and a half cents: small; audibility depends on the listener, duration, timbre and context.
A question for your ears. Ga, the major third above Sa, held over the drone, twice: once at the piano's equal-tempered third, once at the pure ratio five to four. Which one beats, a shimmer against the drone, A or B?
A beats. At four hundred cents, the tempered Ga's fourth partial and the drone's tenth miss each other by about hertz, a fast shimmer. In this synthesis the five-to-four third aligns those particular partials and reduces their beating; this is not a single prescribed Ga for every raga. Against a drone, singers and string players can hear exactly where a note sits; the piano cannot adjust.
What do musicians actually do? In 1963 Nazir Jairazbhoy and A. W. Stone measured the intonation of Hindustani musicians. They found no fixed system: the same note varied between performers and between ragas. Later studies, with computer pitch tracking of many recordings, found that notes are better described as regions than as points. Where a note sits depends on the raga and on the phrase around it: the same swara can sit higher in one raga than in another. The real answer to how many notes there are lies in the ornaments, chapter four.
Why are Sa and Pa never altered? They are called achala, immovable. Pa is conventionally the fifth above Sa, often approached near the pure ratio, the drone's own other note. Every other note is chala: it has more than one form, and can move in ornament. So the fixed frame is Sa, Pa and the upper Sa, and everything else is placed against it, resting on the consonance of the fifth from Part 5.
3More than a scaleFoundations3 min
What makes a raga a raga?
A raga is not just a scale. It has one, but two ragas can share the same notes and still be different ragas. A raga has a way of climbing, the aroha, and a way of descending, the avaroha, often by different notes. It has characteristic phrases, pakad or calan, by which a listener recognises it within seconds. Hindustani accounts often identify prominent vadi and samvadi notes; their status and assignments vary by raga and school. And it has its own ways of approaching, shaking and leaving each note, the gamakas of the next chapter.
A question for your ears. Two ragas, each played as an ascent, a descent and a characteristic phrase of our own, over the drone. One is Bilawal, with the notes of the major scale. The other is Yaman, an evening raga, with a raised Ma. Which is Yaman, A or B?
B is Yaman. Its Ma is raised, tivra, written M with a mark, and it typically begins its climb from Ni below Sa and skips Sa and Pa on the way up. A is our simplified Bilawal-based teaching sketch, using the major-scale notes. Same Sa, the same five other notes, and a different raga: these sketches contrast a pitch alteration and a habit of movement; a complete raga identity needs more context.
A third raga, Bhupali, uses only five notes, Sa, Re, Ga, Pa and Dha, the pentatonic scale of Part 12: no Ma and no Ni at all. Its vadi, the note it dwells on, is Ga. Listen for how the phrases lean on Ga and come home through Re and the Dha below Sa.
A raga's movement has a grammar. Yaman climbs Ni, Re, Ga, raised Ma, Dha, Ni, Sa, avoiding Sa and Pa on the way up, and comes down through every note. Such rules are tendencies, taught by example rather than stated as laws, and great musicians bend them. Part 14's melody model could learn them, which note follows which in each raga, and computational studies do exactly that to recognise ragas, as the frontier chapter shows.
Ragas carry more than notes. The Hindustani tradition assigns them to times of day: Bhairav at dawn, Yaman in the early evening, and some to seasons, the Malhar ragas to the monsoon. Each carries a mood, a rasa: devotion, longing, heroism, peace. These associations are learned within the tradition, like film's chromatic mediants in Part 31. Part 46 asks how music carries emotion at all.
Ragas lean on particular notes. The vadi is the most important note, and the samvadi its partner, usually a fourth or fifth away. In Yaman, as commonly taught, the vadi is Ga and the samvadi Ni. In Bhupali, Ga and Dha. They are the raga's centre of gravity: phrases return to them and rest there. Part 15’s Western key profiles offer an analogy, not an equivalence with vadi theory.
4GamakaFoundations3 min
Where, exactly, is a note?
In this music ornaments are not decoration. Meend is a slow glide from one note to another. Andolan is a slow swing around a note, in some ragas only on particular notes. Kan is a grace note touched on the way in. Gamak is a fast, heavy oscillation. And the ornaments belong to the raga: the same note, ornamented the wrong way, makes a different raga, or no raga at all.
Here is one phrase of ours, S R G m G R G R S, drawn as pitch against time. First as plain notes, each held steady. Then with glides between them and slow swings on three of the notes. Listen to both over the drone, and watch the line: in the second, very little of the time is spent sitting exactly on a note.
Think about what this means. In this music much of the time is spent between the named pitches. How fast a glide moves, and the curve it follows, are part of the raga. An ordinary staff transcription often omits the precise curves and timing; detailed notation can add glissandi, ornament signs and other instructions, while oral teaching supplies much of the practice. Computer studies measure it directly from pitch tracks: how long, how deep, how fast each oscillation is. Here is one drawn.
Computational studies of raga draw a picture like this from real recordings. Track the pitch of a performance moment by moment and count how long it spends at each pitch, folded into one octave. This one is from a short alap of our own, with ornaments. There are peaks at the notes, Sa, Re, Ga, Pa, and wide skirts between them, where the glides and swings pass through. Real performances give much broader, raga-specific shapes, and the distribution can help discriminate ragas, including some sharing a scale, but is not a unique fingerprint and also reflects performer, phrase and recording.
Carnatic music has its own rich systems of ornament. Its theory names ten classical gamakas, and in practice the oscillation called kampita dominates: in some ragas almost every note moves. Notation gives the notes; the gamakas are learned from a teacher's voice. It is Part 10's question again: what can a score hold? Part 61 builds automatic pitch tracking, the tool all these studies rely on.
Here is the idea pushed further, in the manner of Carnatic singing: a phrase in which only Sa and Pa are held still, and every other note oscillates, some widely. Watch the line: the komal Ga and Ma swing through more than a semitone. In many Carnatic ragas, this movement is what the note is.
5Thaats and melakartasFoundations3 min
How many parent scales are there?
In the early twentieth century the Hindustani scholar Vishnu Narayan Bhatkhande sorted the ragas of the north into ten families by their scales, the thaats. With Sa and Pa fixed, and each of the other five notes in one of two forms, there are two to the fifth, thirty-two possible scales; the program lists them all, each as twelve cells. Bhatkhande's ten are lit: Bilawal, the major scale; Kalyan, with raised Ma; Bhairavi, with every flattable note flat; and Marwa, Purvi, Todi and Bhairav, with their lowered Re. Many ragas fit no thaat exactly, and the scheme is a teaching tool rather than a law.
Hear what a thaat changes. One phrase of ours, the same shape each time, in three thaats: Bilawal, the major scale; Kalyan, with its raised Ma; and Bhairav, with lowered Re and Dha, a morning sound with an augmented second between Re and Ga.
South Indian theorists developed a related exhaustive scale classification earlier. The scholar Venkatamakhin, in the seventeenth century, counted every scale with Sa and Pa, one of two Mas, and Ri and Ga in two of the four places between Sa and Ma, Dha and Ni in two of the four above Pa. Two Mas, six ways for the lower pair, six for the upper: seventy-two melakartas, the parent scales of Carnatic music. The current sampurna scheme and naming were standardized later, associated with Govindacharya. They are numbered in a fixed order; the program generates that modern scheme: number twenty-nine is the major scale, Dheerashankarabharanam, and sixty-five the Lydian, Mechakalyani. Bhatkhande's ten thaats are ten of the seventy-two.
The names hide a code. In the katapayadi system, consonants stand for digits, and the digits of a melakarta's first two syllables, reversed, give its number: in Dheerashankarabharanam, dha is nine and ra is two, so ninety-two reversed, twenty-nine. It is a memory system, like Part 33's yamataraja. From the seventy-two parent scales come thousands of ragas, each with its own rules.
The thaat system has gaps. Some ragas use both forms of a note: Khamaj climbs with Ni and descends with komal Ni. Some fit no thaat at all, or two at once. And many ragas share a thaat but differ in everything else. The thaat is a filing system for scales; the raga lives in the movement. Part 35's maqam builds its families differently, from smaller pieces.
6TalaFoundations3 min
How do you keep your place in a cycle of sixteen?
Now rhythm. A tala is a cycle of beats, matras, grouped into sections, vibhags. Each section begins with a clap of the hands, tali, or a wave, khali. In Hindustani terminology beat one is sam, a structural point of return that need not be the loudest beat, where phrases resolve. The tabla's basic pattern for each tala is its theka, spoken and learned as syllables called bols. In the khali section the drummer avoids the ringing bass strokes, so a listener can hear where in the cycle the music is.
Three talas, each one cycle and the next sam. Teentaal, sixteen beats in four sections of four, the most common tala of Hindustani music; its third section is khali, played with dry strokes. Jhaptaal, ten beats, two plus three plus two plus three. And Rupak, seven beats, three plus two plus two, unusual in starting on a wave: its sam is khali. X marks the sam's clap, the numbers the other claps, zero the waves.
Carnatic music organises tala differently. The Suladi system builds every tala from parts: a laghu, a clap followed by finger counts, of three, four, five, seven or nine beats; a drutam, a clap and a wave, two beats; and an anudrutam, one clap and one beat. Adi tala, a laghu of four and two drutams, eight beats in all, is the most common. Seven shapes times five laghu sizes give thirty-five talas, multiplied again by how each beat is subdivided. And the gestures are part of the music: audiences keep tala with their hands along with the performers.
The tala is not the drum pattern. The theka marks the tala, but the tala exists without it. In a tabla solo the drummer leaves the theka entirely and improvises against the cycle, while a melodic instrument keeps a repeating melody, the lehra, so everyone knows where sam is. The tala is a count shared in everyone's head; the sounds only point to it, as Part 11 found for metre in general.
Here is Adi tala as a Carnatic audience keeps it: a clap, then three counts on the fingers, little finger first, for the laghu of four; then a clap and a wave, twice, for the two drutams. Eight beats, twice round, and the clap of the next cycle. Try it with your own hands.
Tempo has its own vocabulary. Laya runs from vilambit, very slow, to drut, very fast. In slow Ektaal a cycle of twelve beats can last close to a minute, each beat divided many times. Performances often speed up across a whole piece. It is Part 11's metre, with cycles far longer than a Western bar. Part 37 compares timelines and cycles across the world.
7The tihai equationFoundations3 min
How do you land exactly on sam?
The tihai is an equation. A phrase of p beats is played three times, with a gap of g beats between the repetitions. It starts on beat s, and its last stroke must land on sam. Using one-based start beat s but time zero at sam, and equally spaced unit strokes whose phrase duration is p beats, the last stroke is at s minus one, plus three p, plus two g, minus one, and that must be a whole number of cycles. In the hook, s was five, p three and g two: four plus nine plus four minus one is sixteen, exactly one cycle of Teentaal. With no gap it is called bedam, without breath; with gaps, dumdar.
A program can list every solution. For a tihai starting on beat one, three, five or nine of Teentaal, with phrases up to eight beats and gaps up to four, here is every combination that lands on the next sam. From beat nine there is a gapless phrase of three; from beat three, a gapless five. Real tihais are usually counted in subdivisions of the beat, halves, thirds, quarters, which opens many more solutions, and drummers find them in their heads at speed.
A question for your ears. Two tihais, each after a full cycle of Teentaal. One repeats its phrase without gaps, bedam; the other leaves gaps, dumdar. Count along if you can. Which one breathes, A or B?
B breathes. It is the hook's tihai, three strokes and two beats of rest, three times. A packs a five-stroke phrase three times into fifteen beats with no rest at all. Both end exactly on sam: one equation, two solutions, two characters.
It goes further. A chakkardar is a tihai of tihais: each of its three parts is itself a phrase repeated three times, nine statements in all, and the last stroke still has to find sam. Carnatic music has its own forms, the korvai and the mora, often worked out across several speeds at once. The audience follows the arithmetic, and the landing is the shared reward. It is Part 33's mathematics, performed rather than proved.
The chakkardar's equation has one more layer. Each of its three parts is a tihai of span three p plus two inner gaps, and the parts are separated by two outer gaps: the whole spans three times three p plus two g one, plus two g two. Searching small phrases and gaps from four starting beats of Teentaal finds solutions; some need two or three cycles before the last stroke finds sam. The first few are listed.
8How a performance unfoldsFoundations3 min
Why does a concert start without a beat?
One common Hindustani plucked-instrument presentation can follow this arc; instruments and genres vary. It opens with alap: no pulse and no drum, the raga revealed note by note, often for a long time. Then jor: a pulse appears, still without the drum. Then jhala: fast, with the drone strings struck between the melody notes. A gat is a composition in a tala, with tabla, and improvisation around it, ending in tihais. Jhala can also follow the gat later, and other performance formats organize these stages differently. The contrast here is free exploration followed by explicit pulse and tala.
The alap has its own shape. It begins around Sa and works upward a few notes at a time. Each new note is introduced, dwelt on, and joined to the raga's characteristic phrases. The vadi is reached with weight, and the upper Sa is a climax. It is improvised, yet strictly within the raga's grammar: Part 22's idea of a grammar that generates, heard live.
Jhala can provide a climax before or after the gat, depending on the presentation. After each melody note the player strikes the high drone strings, the chikari, several times, so the melody rides on a rapid rhythmic pulse, and the whole thing accelerates. Here is a short jhala of our own: one melody note, three drone strokes, speeding up.
The gat holds the second half together. It is a fixed composition of a cycle or two, returned to again and again, and between returns come improvised variations, fast runs called tans, and tihais. The tabla accompanies, and answers with solos of its own; the players trade phrases, sawal-jawab, question and answer. The composition is the frame; most of the performance is made in the moment.
The voice is at the centre of both traditions. Dhrupad is the old, austere vocal form; khayal the main classical form today; and lighter forms, thumri, ghazal and bhajan, border on popular music. Carnatic concerts centre on composed songs, kritis, with improvised sections around them, many by the composers of around 1800 known as the trinity: Tyagaraja, Muthuswami Dikshitar and Syama Sastri. Part 40 turns to the song across traditions.
Time works differently here. A single raga can be explored for an hour or more, and concerts traditionally ran through the night, the ragas following the hours. Audiences respond aloud, praising a fine phrase and shouting when a tihai lands. Recording shortened performances to fit the three-minute disc, then the long-playing record, then streaming. Part 60 looks at how media shape music's forms.
9Two traditions, and how they are taughtPractice3 min
How is a raga learned?
There are two classical traditions. Hindustani music, of north India, Pakistan and Bangladesh, shaped in part by Persian and courtly traditions. Carnatic music, of the south, largely devotional in its texts, with a large composed repertory. They share raga, tala, the drone and improvisation within rules. They differ in instruments, sitar, sarod and tabla in the north, veena and mridangam in the south, and in their systems of scales and talas. Both are classical in the full sense, with theory, treatises and lineages.
How is this learned? Traditionally through the guru-shishya parampara: years of living and practising with a teacher. In the north the lineages are gharanas, schools each with their own style. Teaching is by imitation: the teacher sings, the student repeats. What passes on is not only notes but the gamakas, the timing, the taste. Today universities, recordings and online lessons have joined the old ways.
Rhythm is learned by speaking. Every tabla stroke has a syllable, a bol, and a composition is recited before it is played. In the south, solkattu, rhythmic syllables, is recited as an art in itself. It is a notation that is spoken: the voice holds rhythm as sargam holds melody, a memory aid for what is learned by ear, like Part 10's neumes.
The music lives today. Ravi Shankar and Ali Akbar Khan brought Hindustani music to world audiences from the 1950s. Film songs, fusion and jazz have borrowed ragas and talas. And the classical traditions themselves continue, in festivals and in the December music season of Chennai. Borrowing is easy; understanding takes the years the tradition asks for. Part 47 asks what all the world's musics share.
The instruments differ between north and south. In the north, the plucked sitar and sarod, the bowed sarangi, the bansuri flute and the shehnai, a double reed; and for rhythm, the tabla and the older pakhawaj. In the south, the veena, the violin, adopted in the nineteenth century and played seated, and the flute; and for rhythm, the mridangam, the clay pot ghatam and the frame drum kanjira. In both, the voice is the model every instrument tries to imitate.
10Frontier: computing ragaResearch2 min
Can a machine recognise a raga?
Computers have studied this music closely. The CompMusic project, led by Xavier Serra from 2011, built large collections of Hindustani and Carnatic recordings. It tracked pitch from the recordings and found the tonic automatically from the drone. It recognised ragas from pitch histograms and characteristic phrases, with reported above-chance results on particular annotated datasets and candidate sets. Related studies addressed tala tracking, sam detection and tabla-stroke transcription, with task-specific datasets and errors rather than universal performance. The tools are those of Parts 61 and 62, tuned to this music.
There are limits. Recognising a raga is not understanding it: a histogram cannot say why a phrase is beautiful. Intonation studies show variation by singer, raga, phrase and decade. Datasets favour famous performers and the recorded era. The most useful studies were built with musicians, not only about them. A model of a living tradition has to be checked by the people who practise it.
A concrete version. Collect performances of ragas that share a scale, with musicians' annotations of their phrases. Model each raga by its phrases and gamakas, not only its pitch histogram. Ask trained listeners which features they use to tell the ragas apart, and compare. What do listeners attend to when they recognise a raga? The answer would show how much of a raga lives in its notes, and how much in their motion.
Machines now try to play this music. Generative models trained on recordings can produce raga-like melodies. They pick up the scale and common phrases quickly; the gamakas and the long-form shape of a performance, less well. Questions of consent and credit arise when a living tradition is modelled from its musicians' recordings. And the tradition's own teachers are the right judges of whether a model is playing a raga at all. Part 65 builds machines that compose, and Part 66 machines that make sound.
Variation 34, recap and problemsAll tracks2 min
Every part ends by doing something to the Tune with what it built. The Tune is in the major scale, so here it supplies a simplified Bilawal-based sketch, not a complete idiomatic raga performance. First a short alap on its opening phrase, slow and free, with glides, over the drone. Then its first two phrases as a gat, one cycle of Teentaal with the tabla. Then a second cycle: four beats of theka and a tihai from beat five, the melody falling Ga, Re, Sa three times, the last Sa landing on sam.
Row thirty-four of the ledger: seconds; the measurement is the alap, the cycle and the tihai's arithmetic.
What did we find? The drone, and a curved bridge that pushes energy into high partials. Twelve positions for the notes, and intonation that varies with raga and phrase. A raga as ascent, descent, phrases, ornaments, time and mood. Ten thaats among thirty-two scales, and seventy-two melakartas. Tala, and the tihai as an equation. And the arc of a performance, from no pulse to fast pulse.
Five problems. One to compute, one to prove, one for your ears, one to build, and a research problem, marked with a star. Solutions are in this part's notes. Pause here.
Where does this come back? Next, in maqam, another great modal system. In timelines and cycles across the world. In improvisation and composing. In what all musics share. And in machines that track pitch and beat.
And in practice. Students learn sargam and bols by voice before they play a note. Tabla players compute tihais at speed, in performance. Electronic tanpuras now sit in many practice rooms. And film composers draw on ragas for melody and mood.
The books and papers this part follows. The full list, with notes, is in the README.
Where it goes next. Maqam in Part 35; timelines in Part 37; improvisation and composing in Part 42; universals in Part 47; pitch and beat tracking in Parts 61 and 62.
Key results
The part's results in one place, for revision.
Try it
Lab 34 · Raga and tala, computed
Model a tanpura string with and without its curved bridge; place any scale among the thaats and melakartas; solve tihais for any tala; and draw the pitch histogram of an ornamented phrase.
python -m videos.music.labs 34
needs numpy, scipy, matplotlib · download lab34.py ·
source on GitHubtihais in a 10-beat tala from beat 6 (p, g, cycles) (2,0,1), (4,2,2)
scale (0, 2, 4, 6, 7, 9, 11): thaat; melakarta number Kalyan; 65
brightness at 0.1 s and 0.3 s: sharp bridge / curved bridge (Hz) 583, 337 / 1211, 1127
ear problem: the raga of each phrase, in order (listen first) Yaman, Yaman, Yaman, Bilawal, Bilawal, Bilawal
A curved bridge pushes energy into high partials; a tihai is one modular equation; and an ornamented phrase spends much of its time between the named notes.
The code (72 lines; it asserts its own result)
"""Lab 34: raga and tala, computed: the tanpura's curved bridge, thaats and melakartas, a tihai solver for any tala,
gamaka contours and their pitch histogram, and phrases to name by ear."""
import numpy as np
from videos.coursekit import labs
from explainer.music.monochord import SR, Clip, concat, mix
from explainer.music.monochord import raga as R
TITLE = "Raga and tala, computed"
GOAL = ("Model a tanpura string with and without its curved bridge; place any scale among the thaats and melakartas; "
"solve tihais for any tala; and draw the pitch histogram of an ornamented phrase.")
TASKS = [
"Change CYCLE and START. Which tihais (phrase, gap) land on sam? Which are bedam (no gap)?",
"Choose a SCALE (seven pitch classes with Sa and Pa). Is it a thaat? Which melakarta is it?",
"Change the bridge DEPTH. How does the string's brightness in the first half-second change?",
]
CYCLE, START = 10, 6
SCALE = (0, 2, 4, 6, 7, 9, 11)
DEPTH = 0.008
def run(seed=0):
rng = np.random.default_rng(seed)
lab = labs.Lab()
sols = R.tihai(CYCLE, START, phrase_lengths=range(1, 7), gaps=range(0, 4))
lab.row(f"tihais in a {CYCLE}-beat tala from beat {START} (p, g, cycles)", ", ".join(f"({s['p']},{s['g']},{s['cycles']})" for s in sols) or "none")
for s in sols:
pos, strokes = START - 1, []
for _ in range(3):
strokes += list(range(pos, pos + s["p"]))
pos += s["p"] + s["g"]
assert strokes[-1] % CYCLE == 0
thaat = [k for k, v in R.THAATS.items() if tuple(v) == tuple(SCALE)]
mela = R.melakarta_number(SCALE) if tuple(SCALE) in R.melakartas() else None
lab.row(f"scale {SCALE}: thaat; melakarta number", f"{thaat[0] if thaat else '(none)'}; {mela}")
plain = R.jawari_string(130.0, 1.0, bridge=False)
jaw = R.jawari_string(130.0, 1.0, bridge=True, depth=DEPTH)
tp, cp = R.centroid_track(plain)
tj, cj = R.centroid_track(jaw)
lab.row("brightness at 0.1 s and 0.3 s: sharp bridge / curved bridge (Hz)",
f"{np.interp(0.1, tp, cp):.0f}, {np.interp(0.3, tp, cp):.0f} / {np.interp(0.1, tj, cj):.0f}, {np.interp(0.3, tj, cj):.0f}")
# Problem 3: phrases in Bilawal or Yaman
kinds, clips = [], []
for i in range(6):
name = ["Bilawal", "Yaman"][int(rng.integers(2))]
r = R.RAGAS[name]
notes = [(s, 0.32) for s in r["pakad"]]
c = R.gamaka_contour(notes, glide=0.06)
clips.append(Clip(R.voice_from_contour(c, 261.6), SR).at_level(-20.0))
kinds.append(name)
lab.audio = concat(clips, gap=1.0)
lab.row("ear problem: the raga of each phrase, in order (listen first)", ", ".join(kinds))
fig, (a, b) = labs.figure(2)
a.plot(tp, cp, label="sharp bridge")
a.plot(tj, cj, label="curved bridge")
a.set_xlabel("seconds")
a.set_ylabel("spectral centroid (Hz)")
a.legend(frameon=False)
a.set_title("the jawari's brightness")
alap = [(0, 1.2), (2, 0.8), (4, 1.2), (5, 0.8), (4, 1.0), (2, 0.8), (0, 1.6)]
con = R.gamaka_contour(alap, glide=0.3, shake={2: (0.5, 3.0)})
cents, h = R.pitch_histogram(con)
b.bar(cents, h, width=10, color=labs.GOLD)
b.set_xlabel("cents above Sa")
b.set_title("pitch histogram of an ornamented phrase")
lab.fig = fig
lab.note = ("A curved bridge pushes energy into high partials; a tihai is one modular equation; and an ornamented "
"phrase spends much of its time between the named notes.")
return lab
Now change it
- Change CYCLE and START. Which tihais (phrase, gap) land on sam? Which are bedam (no gap)?
- Choose a SCALE (seven pitch classes with Sa and Pa). Is it a thaat? Which melakarta is it?
- Change the bridge DEPTH. How does the string's brightness in the first half-second change?
Problems, with solutions
Try each problem before opening its solution.
-
Compute. Find every tihai in Jhaptaal (10 beats) that starts on beat 6, with phrases up to 6 beats.
Solution
With s = 6 the condition is 5 + 3p + 2g − 1 ≡ 0 (mod 10), i.e. 3p + 2g ≡ 6 (mod 10). With gaps up to 3 there are two: p = 2, g = 0 (a bedam tihai of six beats, landing on the next sam) and p = 4, g = 2 (sixteen beats, landing a cycle later). The lab prints the list for any tala, start and range.
-
Prove. Prove that there are exactly 72 melakartas under Venkatamakhin's rule.
Solution
Sa and Pa are fixed. Ma takes one of two forms. Ri and Ga occupy two of the four semitone places between Sa and Ma (C(4, 2) = 6 ways, each with Ri below Ga), and Dha and Ni two of the four places between Pa and the upper Sa (6 ways). Choices are independent: 2 × 6 × 6 = 72.
-
Ear. The lab plays phrases in Bilawal and in Yaman; name the raga of each.
Solution
The lab prints them. Listen for Ma: Yaman's is raised (a semitone below Pa) and its phrases often begin from Ni below Sa; Bilawal's Ma is natural.
-
Build. Add a moving thread to the tanpura model, and measure how the buzz changes.
Where to look.
raga.jawari_stringclamps the string to a fixed parabolic surface. Model the thread as a second, point-like obstacle at a chosen position near the bridge edge, move it in steps, and plot the brightness (spectral centroid) over the first second for each position; compare with published simulations of the tanpura bridge. -
★ What do listeners attend to when they recognise a raga?
Where the frontier is. Use performances of ragas with the same scale, annotated by musicians; build stimuli that keep or remove the phrases, the gamakas or the note weights; test trained and untrained listeners' recognition and confidence; report which features carry recognition, with intervals, and check the results with practitioners.
Notes and sources
Sources
- N. A. Jairazbhoy, The Rāgs of North Indian Music (1971); J. Bor (ed.), The Raga Guide (1999); M. Clayton, Time in Indian Music (2000); T. Viswanathan and M. H. Allen, Music in South India (2004).
- N. A. Jairazbhoy and A. W. Stone, "Intonation in present-day North Indian classical music", Bulletin of SOAS (1963).
- C. V. Raman, "On some Indian stringed instruments", Proceedings of the Indian Association for the Cultivation of Science (1921); C. P. Vyasarayani, S. Birkett and J. McPhee, "Modeling the dynamics of a vibrating string with a finite distributed unilateral constraint: application to the sitar", JASA (2009).
- X. Serra, "A multicultural approach in music information research", ISMIR (2011), and the CompMusic project's publications on tonic identification, raga recognition and rhythm (2011–2017).
- V. N. Bhatkhande, Hindusthani Sangeet Paddhati (1909–32); Venkatamakhin, Caturdaṇḍīprakāśikā (about 1660).
- Part 5 for consonance; Part 6 for commas; Part 9 for the tabla's membrane; Part 11 for metre; Part 33 for cycles.
- J. T. Titon (ed.), Worlds of Music: An Introduction to the Music of the World's Peoples (6th ed., 2017): the introductory textbook for Act VI.
About this partfrom its README
Part 34 of a sixty-eight-part course in music (see the series plan and
the syllabus), the first part of Act VI. Near the end of a solo the player launches a phrase three
times, and musicians and audience land together on the first beat of the cycle. The tihai is arithmetic done in real
time. This part learns the two systems behind it, raga and tala: the drone and the tanpura's buzzing bridge, the
swaras and the shruti question, ascent, descent and characteristic phrases, gamaka, the thaats and the seventy-two
melakartas, the talas and the tihai equation, how a performance unfolds, the two traditions and how they are taught,
and what computational studies can and cannot say. The models are Monochord's (explainer/music/monochord/raga.py);
every sound is ours: a tanpura string modelled by finite differences, tabla strokes by modal synthesis from Part 9's
loaded membrane, and melodic lines as a synthesized bowed tone. Phrases are written in the manner of the ragas named;
no recording is played. Published findings are the ones listed under Sources.
- Three times to sam. A cycle of Teentaal and a tihai (dha-ti-dha three times with gaps of two beats, from beat 5, its last stroke on sam), heard; a note on the traditions; how to listen; the plan.
- 1. The drone. Its role; the curved bridge and its thread; one string modelled with a sharp and a curved bridge (brightness 474 against 1,217 Hz at 0.1 s, 323 against 1,128 at 0.3 s) and the four-string cycle, heard; the drone retuned to Ma, heard; Raman and the physics of jawari.
- 2. Swara and shruti. The seven swaras and twelve positions; the 22 shrutis as one modern list of just ratios; two Res a comma apart (9/8 and 10/9), heard; an ear question (Ga at 400 cents beats about 10 times a second against the drone, at 386 it is still); why Sa and Pa never move; intonation measured (Jairazbhoy and Stone; later pitch tracking).
- 3. More than a scale. What a raga is; an ear question (Bilawal or Yaman: one note and a habit of movement apart); Bhupali's five notes, heard; a raga's grammar; vadi and samvadi; time, season and mood.
- 4. Gamaka. Meend, andolan, kan, gamak; the space between the notes; a phrase plain and ornamented, heard as a moving pitch line; the pitch histogram of an ornamented alap of ours; gamaka in Carnatic music; kampita, heard.
- 5. Thaats and melakartas. Bhatkhande's ten thaats among the 32 possible scales; one phrase in Bilawal, Kalyan and Bhairav, heard; the 72 melakartas generated and numbered (29 the major scale, 65 the Lydian); what thaats leave out; names that are numbers (katapayadi).
- 6. Tala. Cycles, claps and waves, theka and bols; Teentaal, Jhaptaal and Rupak, heard; the tala is not the drum pattern; Carnatic tala; Adi tala kept by hand, heard; tempo.
- 7. The tihai equation. (s − 1) + 3p + 2g − 1 ≡ 0 modulo the cycle; a solver's table for Teentaal; an ear question (bedam or dumdar?); tihais of tihais; 15 chakkardars found for small phrases and gaps.
- 8. How a performance unfolds. Alap, jor, jhala, gat; the alap's shape; a jhala of ours, heard; the gat; time and the audience; songs and singers.
- 9. Two traditions, and how they are taught. North and south; teacher and student; rhythm you can say; the instruments; today.
- 10. Frontier: computing raga. What CompMusic's studies can do; what they cannot; machines that play ragas; ★ research problem: what do listeners attend to when they recognise a raga?
- Variation 34, recap and problems. The Tune as Bilawal: an alap on its first phrase over the drone, its first two phrases as a gat in Teentaal with the tabla, then a tihai from beat 5 whose last note, Sa, lands on sam; the ledger; what we found; five problems; where it comes back; in practice; references; Part 35.
What is computed and built
python -m videos.music.music34.compute (about ten seconds) fills .cache/music34/.
| Item | What it computes | Checked against |
|---|---|---|
tanpura, dronema |
a string with and without the curved bridge; brightness over time; the drone with Pa and with Ma | the bridge brightens (tests) |
shruti, comma, ga |
the 22 shrutis in cents; two Res; Ga tempered and just over the drone | the syntonic comma |
raga, bhupali, thaats3 |
ascent, descent and phrases for Bilawal, Yaman and Bhupali; one phrase in three thaats | — |
gamaka, kampita |
contours with meend, andolan and kampita; a pitch histogram | — |
thaat |
the 32 scales of the thaat scheme; the 72 melakartas | Venkatamakhin's numbering (tests) |
tala, adi |
thekas of Teentaal, Jhaptaal, Rupak; Adi tala by hand | — |
hook, tihai, chakkardar |
tihais solved and heard; chakkardars counted | brute-force counting of strokes |
tune, variation |
Variation 34 | — |
Monochord's tools are held in tests/music/test_raga.py; this part's claims and clips in
tests/music/test_music34.py.
Sounds. The tanpura is a string by finite differences over a curved obstacle (a physical model); the tabla is modal synthesis on the modes of Part 9's loaded membrane; the melodic voice is an additive bowed-string-like tone following computed pitch contours (synthesized); the hand claps are filtered noise. There are no recordings.
What the models are, and are not. The tanpura model is one string in one plane, a rigid bridge with no thread, and an inelastic contact: it shows the jawari's added brightness but not its long, evolving shimmer, which depends on the thread and a gentler contact. The tabla has no pressure of the heel on the bayan beyond a fixed glide, and its bols are simplified. The phrases are ours, written to show the features named, not compositions or performances of the ragas; ragas are taught by teachers and learned by listening, and nothing here replaces that. The shruti list is one of several modern reconstructions.
Notes
The sounds are simplified teaching sketches, not certified idiomatic raga performances. The swara alterations and vadi terminology here primarily follow Hindustani accounts, with school-dependent intonation and emphasis. Pa’s achala status concerns note categories, not an absolute ban on pitch movement. Bilawal is not exhausted by the major-scale pitch set. The modern numbered sampurna melakarta scheme was standardized after Venkatamakhin; Suladi tala also uses one-beat anudrutam. Sam is a structural return, not necessarily a loud clap, and Rupak starts with khali. Instrumental performance orders vary, including jhala after gat. Histogram and recognition claims depend on task, candidate set and held-out recordings or performers; no recognition experiment is run here. Tihai arithmetic uses an explicitly one-based starting beat and equal-unit stroke model.
Companion material in this repository
The syllabus's plan for this partfrom SYLLABUS.md, the plan of record
- Hook: Teentaal and a tihai heard; a note on the traditions; how to listen; the plan.
- The drone: its role; the curved bridge; one string with sharp and curved bridges heard; the drone retuned to Ma; the physics.
- Swara and shruti: seven swaras, twelve positions; the 22 shrutis; two Res a comma apart heard; an ear question (which Ga beats?); Sa and Pa fixed; intonation measured.
- More than a scale: what a raga is; an ear question (Bilawal or Yaman?); Bhupali heard; grammar; vadi and samvadi; time and mood.
- Gamaka: kinds; the space between the notes; plain and ornamented heard; a pitch histogram; the south; kampita heard.
- Thaats and melakartas: 10 of 32; one phrase in three thaats heard; the 72 generated; what thaats leave out; katapayadi.
- Tala: cycles; three thekas heard; tala is not the drum; Carnatic tala; Adi tala by hand heard; tempo.
- The tihai equation: the equation; a solver's table; an ear question (bedam or dumdar?); tihais of tihais; chakkardars counted.
- How a performance unfolds: alap, jor, jhala, gat; the alap; a jhala heard; the gat; time and audience; songs.
- Two traditions, and how they are taught: north and south; teacher and student; bols; instruments; today.
- Frontier: computing raga; limits; machines that play ragas; the research problem.
- Variation 34: the Tune as Bilawal: alap, gat, tihai. Outro: problems, payoffs.
Covers: the drone and the tanpura's buzzing bridge; swara and the shruti question, with measured intonation;
ascent, descent and characteristic phrases; gamaka; thaat and the seventy-two melakartas; alap, jor, jhala and
gat; tala cycles; the tihai equation; Hindustani and Carnatic practice; how it is taught.
Built and computed: monochord/raga.py: a tanpura string by finite differences with a one-sided curved bridge
(brightness more than doubled for the first third of a second); tabla strokes by modal synthesis; the 32 thaat
scales and the 72 melakartas generated and numbered; a tihai solver checked by counting strokes, and chakkardars;
gamaka contours and a pitch histogram.
Variation 34: a study: the Tune's scale as Bilawal, an alap over the drone, then a gat with a tihai.
Frontier: computational raga analysis; intonation studies; what listeners attend to.
Rights: every sound is the film's own model (§2.4); the phrases are ours, in the manner of the ragas named; the
traditions are described with their own terms and sources.
Reading: Jairazbhoy; Bor (ed.), The Raga Guide; Clayton, Time in Indian Music; the CompMusic studies.
Build the film
python -m videos.music.music34.compute # the part's numbers, into .cache/music34
python tools/build.py music34 # render and assemble the film
EXPLAINER_TTS=silent python tools/qa_scene.py music34 Hook # one chapter, silent, with a contact sheet
Scenes: videos/music/music34. Setup: see the course page. Source of these notes: the README and the scenes' narration.
Build it
python -m videos.music.music34.compute # numbers and sounds (about ten seconds)
EXPLAINER_TTS=silent python tools/build.py music34 -q l --fps 15 # a silent-narration preview, with the sounds
python tools/qa_sound.py music34 --sync # the sound gates
python tools/dead_air.py renders/music34_480p.mp4 --sound music34 # no empty screen; no sound over a still one
python tools/lecture_length.py music34 # 30 to 60 minutes, listening included
python tools/build.py music34 # 1080p30, narrated
python -m pytest -q tests/music # Monochord against its references; this part's claims and clips
python -m videos.music.labs 34 # the lab (writes a figure and a short WAV)