
Rhythm and melody — music theory meets physics.
The Silent Kingdom
Long ago, the Dimasa kingdom in the hills of what is now Dima Hasao in Assam was a prosperous place. The terraced rice fields were green, the rivers ran clear, and the people were healthy. But something was missing, and nobody could say what.
There were no songs. There was no music. The people spoke and laughed and told stories, but no one had ever thought to sing. Celebrations were held in silence. Weddings had no melodies. Even children played without humming.
"Something is incomplete," said the old king, Hadambrasa, sitting on his wooden throne. "Our kingdom has everything — food, water, peace. But it feels as if the air itself is hungry."
The Princess in the Forest
The king's daughter, Dijou, was a restless girl who preferred the forest to the palace. She spent her days walking the trails through the Jatinga hills, listening to things no one else noticed.
One morning, she sat on a mossy rock beside a waterfall and closed her eyes. She heard the waterfall — not as noise, but as a pattern. Tha-da-dum, tha-da-dum. A rhythm, repeating. She heard a woodpecker drilling a tree — tak-tak-tak-tak — faster, lighter, layered on top of the waterfall's beat. She heard the wind in the bamboo grove — a low, hollow whooooo — like a voice without words.
"The forest is singing," Dijou whispered. "It has always been singing. We just never listened."
The First Instruments
Dijou ran home and gathered materials. She cut a length of bamboo and blew across the open end — it made the same hollow whooooo as the wind. She drilled holes along its length, and by covering them with her fingers, she could change the sound. Higher, lower, higher again. She had made a flute.
Next, she took a dried gourd and stretched a piece of deer hide across the top, tying it tight with vine. When she struck it with her palm, it made a deep thoom — the same heartbeat rhythm as the waterfall. She had made a drum.
Finally, she took a thin strip of bamboo and stretched a thread of silk across it. When she plucked the silk, it sang — a clear, bright note that hung in the air like a bird hovering. She had made a string.
Dijou brought her three instruments to the palace courtyard and began to play. She played the waterfall's rhythm on the drum. She played the wind's song on the flute. She plucked the string for the woodpecker's beat. And when all three sounds wove together, something happened that had never happened in the Dimasa kingdom before.
People stopped walking. They turned toward the sound. Their eyes widened. Some smiled. Some wept. A child began to sway. An old woman closed her eyes and moved her lips, shaping sounds she had never made before — the first humming the kingdom had ever heard.
The Kingdom Awakens
King Hadambrasa came to the courtyard. He listened to his daughter play, and for the first time in his long life, he felt the air was no longer hungry.
"This," he said. "This is what was missing. What do you call it?"
"I don't know," said Dijou. "The forest doesn't have a word for it. It just does it."
The king smiled. "Then we will give it a word. We will call it music."
Dijou taught the village children first. Within a week, every child had a bamboo flute. Within a month, there were drums in every household. Within a year, the Dimasa people had created songs for every occasion — for planting rice, for welcoming rain, for celebrating births, for saying goodbye.
The Forest's Gift
The Dimasa people never forgot where their music came from. Every song begins with a moment of silence — a pause to honour the forest that sang first. And the instruments are still made from the forest's materials: bamboo, gourd, hide, and silk.
If you visit the Dimasa hills today, you will hear music everywhere — in the fields, in the homes, in the festivals that light up the night. And if you listen very carefully to the forest itself, you will hear the original song — the waterfall, the woodpecker, the wind in the bamboo — still playing, as it has played since the beginning.
Dijou's gift was not invention. It was translation. She took the language of the forest and made it speak to human hearts.
The end.
Choose your level. Everyone starts with the story — the code gets deeper as you go.
Here is a taste of what Level 1 looks like for this lesson:
import numpy as np
import matplotlib.pyplot as plt
# Generate and plot musical intervals
t = np.linspace(0, 0.02, 1000) # 20 ms
fundamental = 261.6 # Middle C (Hz)
octave = fundamental * 2
fifth = fundamental * 3/2
fig, axes = plt.subplots(3, 1, figsize=(10, 6), sharex=True)
for ax, freq, name in zip(axes,
[fundamental, fifth, octave],
["Fundamental (C4: 261.6 Hz)", "Perfect Fifth (G4: 392.4 Hz)", "Octave (C5: 523.2 Hz)"]):
wave = np.sin(2 * np.pi * freq * t)
ax.plot(t * 1000, wave, linewidth=2)
ax.set_ylabel(name, fontsize=9)
ax.grid(alpha=0.3)
axes[-1].set_xlabel("Time (ms)")
fig.suptitle("Musical Intervals: Simple Frequency Ratios")
plt.tight_layout()
plt.show() # Can you see how the octave fits exactly 2 cycles where the fundamental fits 1?This is just the first of 6 coding exercises in Level 1. By Level 4, you will build: Build a Digital Rhythm Analyzer.
By Level 4, enrolled students build: Build a Digital Rhythm Analyzer
Free
Level 0: Listener
Stories, science concepts, diagrams, quizzes. No coding.
You are here
Level 0 is always free. Coding levels (1-4) are part of our 12-Month Curriculum.
Rhythm and melody — music theory meets physics.
The big idea: "How Music Came to the Dimasa Kingdom" teaches us about Music Theory & Vibrations — and you don't need to write a single line of code to understand it.
Sound is a pressure wave travelling through air. Frequency — the number of wave cycles per second, measured in Hertz (Hz) — determines what we perceive as pitch. Low frequencies (around 80–250 Hz) sound deep, like a drum or bass voice. High frequencies (2,000–4,000 Hz) sound shrill, like a whistle.
Musical pitch follows a logarithmic scale, not a linear one. Doubling the frequency raises the pitch by one octave — the most fundamental interval in music. Middle C vibrates at 261.6 Hz; the C one octave higher vibrates at 523.2 Hz (exactly double).
Prediction check: if you press a guitar string at its exact midpoint and pluck one half, what should happen to the pitch? The vibrating length is halved, so the frequency doubles — the note jumps up exactly one octave. Try it!
Key idea: Frequency determines pitch on a logarithmic scale — doubling the frequency raises pitch by one octave. This is why pressing a string at its midpoint produces a note one octave higher.
A musical scale is a set of notes chosen from the infinite range of possible pitches. Why do certain notes sound good together? Because the most pleasing intervals correspond to the simplest frequency ratios: octave = 2:1, perfect fifth = 3:2, perfect fourth = 4:3.
Dimasa music uses a pentatonic scale — five notes per octave rather than the Western twelve. Pentatonic scales are found independently on every continent because they are built from these simplest ratios. Play only the black keys on a piano and you hear a pentatonic scale — it sounds naturally harmonious because every interval is a simple ratio.
Analogy: imagine two pendulums swinging side by side. If their frequencies are in a simple ratio (like 2:1 or 3:2), they periodically sync up, creating a regular, predictable pattern. If the ratio is complex (like 7:5), the pattern seems random and dissonant. Our brains interpret simple-ratio sound patterns as consonant (pleasant) and complex ratios as dissonant.
Key idea: The most harmonious musical intervals correspond to simple frequency ratios. Pentatonic scales use the simplest ratios and appear independently in every musical culture.
Access all 130+ lessons, quizzes, interactive tools, and offline activities
Rhythm is the temporal structure of music — patterns of sound and silence organized in time. All rhythms can be described as **ratios of time interval...
When Dijou plays her flute, drum, and string, each sounds completely different even at the same pitch. The difference is **timbre** (pronounced "TAM-b...