Skip to content

Commit 3caf535

Browse files
committed
feat: redesign blog architecture and add content
1 parent 398fd07 commit 3caf535

16 files changed

Lines changed: 569 additions & 51 deletions

docs/blog/01-deep-dive-ai-carnatic.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Harmonizing traditional Indian Classical Music with Artificial Intelligence requ
77

88
In this post, we dive deep into the technical architecture of DeepRaaga, dissecting the 'how' behind our models.
99

10-
**[Image of LSTM Architecture / DeepRaaga Pipeline]**
10+
![DeepRaaga LSTM Neural Architecture](/DeepRaaga/blog-images/carnatic_lstm_flow.png)
1111

1212
## 1. The Challenge of Representation: Sequences and Gamakas
1313

@@ -33,7 +33,5 @@ The heart of DeepRaaga's generative capability lies in our **Raga-Conditioned Lo
3333

3434
When an LSTM is properly conditioned on a raga, it learns to avoid universally forbidden notes (*Apaswaras*) and probabilistically favors the **Sancharas** unique to that raga.
3535

36-
**[Image of Raga-Conditioned LSTM Flow]**
37-
3836
## What's Next?
3937
Deep learning models offer incredible promise for modeling the unstructured beauty of Carnatic music. But the journey has just begun. We're consistently updating our NoteSequence parsers and experimenting with Transformer architectures to improve long-range dependencies. Let's cultivate a platform that serves as a National Knowledge Repository of Music.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Harmonizing Heritage: AI-Driven Preservation of Indian Classical Music
2+
3+
In a landmark conversation between Prime Minister Narendra Modi and musician Ramesh Vinayakam, the focus was clear: India’s musical heritage needs a digital backbone. Vinayakam demonstrated that the "gamakas" (microtonal oscillations) of Carnatic music—long thought to be too fluid for Western notation—could be systematically captured.
4+
5+
[Watch the Discussion](https://www.youtube.com/watch?v=NynwiSIJmkE)
6+
7+
The vision set forth was the creation of a "complete knowledge repository" for the country. DeepRaaga is an open-source response to that call, bridging the gap between ancient melodic grammar and modern Deep Learning.
8+
9+
## The Challenge of Raga Logic
10+
Unlike Western scales, a Raga is a living entity with strict melodic rules:
11+
12+
* **Arohana/Avarohana:** Specific patterns for ascending and descending.
13+
* **Gamakas:** The curves between notes that define a Raga’s "soul."
14+
* **Vadi/Samvadi:** High-significance notes that act as melodic anchors.
15+
16+
## DeepRaaga’s Technical Architecture
17+
To move from raw audio to intelligent generation, DeepRaaga follows a specialized pipeline:
18+
19+
### 1. Data Transformation (The NoteSequence Pipeline)
20+
The project utilizes MIDI and MusicXML as the primary data source. Using a NoteSequence format (pioneered by Magenta), we convert raw musical events into a structured protobuf-based representation.
21+
22+
* **Quantization:** Essential for aligning traditional performances to a temporal grid without losing the pitch-specific identity of the raga.
23+
24+
### 2. The Neural Engine: Raga-Conditioned LSTMs
25+
At its core, DeepRaaga utilizes Recurrent Neural Networks (RNNs), specifically Long Short-Term Memory (LSTM) layers.
26+
27+
* **Sequential Learning:** LSTMs are uniquely suited for music because they "remember" the previous notes, allowing the model to follow the strict phraseology (Sancharas) of a raga.
28+
* **Conditioning:** By passing a Raga_ID as a latent vector, the model is "conditioned" to stay within the boundaries of a specific scale, preventing the AI from "hallucinating" notes outside the permitted set.
29+
30+
### 3. Real-Time Interaction
31+
The stack combines a Python/FastAPI backend (hosting the TensorFlow/PyTorch models) with a React-based frontend. This allows a user to select a Raga (e.g., Mayamalavagowla) and receive a generated MIDI sequence that can be played instantly via Tone.js in the browser.
32+
33+
## The Roadmap: The Science of Musicology
34+
Aligned with the PM's vision of a "complete repository," DeepRaaga is evolving to include:
35+
36+
* **Melakarta Mapping:** Teaching the AI the relationship between parent and derived (Janya) ragas.
37+
* **Tala-Awareness:** Integrating rhythmic cycle constraints so melody and rhythm are generated in sync.
38+
* **Chronobiological Suggestions:** Implementing time-of-day logic to suggest ragas based on traditional performance windows.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Democratizing Carnatic Music Education Through AI
2+
3+
**Date:** April 11, 2026
4+
**Author:** DeepRaaga Core Team
5+
6+
For centuries, Indian Classical Music has been passed down through the *Guru-Shishya Parampara*—a sacred, individualized lineage of teaching. While this preserves the authenticity and highly stylized nature of various traditions (Gharanas/Banis), it inherently limits accessibility.
7+
8+
![Digital Learning Environment](/DeepRaaga/blog-images/ai_digital_shishya.png)
9+
10+
With DeepRaaga, our vision extends beyond simple algorithmic generation; we are building a pedagogical tool meant to democratize classical music education on a global scale.
11+
12+
## The Barrier to Entry
13+
14+
Learning Carnatic music involves mastering immense complexity early on. A student must learn to distinguish between a *Chatushruti Rishabha* and a *Suddha Rishabha*, not just as static pitches, but as fluid entities that slide into neighboring notes. Without a Guru physically present to correct the pitch and the microtonal oscillation (Gamaka), students often struggle to grasp the "feel" of a Raga.
15+
16+
## How DeepRaaga Acts as a Digital Digital Guide
17+
18+
The core architecture of DeepRaaga, powered by Raga-Conditioned LSTMs, offers a unique solution to this accessibility problem:
19+
20+
1. **Infinite, On-Demand Variations:** A student learning *Kalyani* can ask DeepRaaga to generate infinite variations of ascending and descending Sancharas (phrases) specific to that Raga. They can listen, imitate, and internalize the grammar.
21+
2. **Visualizing the Invisible:** By translating traditional audio into our structured NoteSequence pipeline, we pave the way for real-time visual feedback interfaces in the future. Students will be able to see their own Gamakas plotted against DeepRaaga's mathematically generated "ideal" Gamakas.
22+
3. **Preserving Rare Ragas:** Many rare Janya ragas are known only to a handful of masters. By feeding historical recordings into our quantization and neural engine pipeline, DeepRaaga can immortalize the unique phraseology of these fading ragas, allowing any student to study them interactively.
23+
24+
## The Road Ahead
25+
26+
DeepRaaga does not seek to replace the Guru. Rather, it serves as an intelligent "Raga Sandbox"—a companion tool that allows students to experiment, jam, and understand melodic boundaries freely. We are deeply aligned with the vision of creating a comprehensive digital repository that empowers the next generation of classical musicians, no matter where they are in the world.

docs/blog/04-the-future-of-tala.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Beyond Melody: The Computational Challenge of Carnatic Rhythm (Tala)
2+
3+
**Date:** April 12, 2026
4+
**Author:** DeepRaaga Core Team
5+
6+
To date, the primary architectural focus of DeepRaaga has been understanding melodic grammar. We successfully implemented Raga-Conditioned LSTMs to capture the ascending and descending rules (Arohana/Avarohana) and the microtonal "soul" of individual ragas. However, Indian Classical Music is a dual-engine system. Melody (Raga) is inexorably bound to rhythm (Tala).
7+
8+
As we align with the vision of creating a complete digital repository, we must solve one of the most complex computational problems in musicology: generating Tala-aware sequences.
9+
10+
![Carnatic Tala Rhythm Cycles](/DeepRaaga/blog-images/carnatic_rhythm_tala.png)
11+
12+
## Understanding the Tala Framework
13+
14+
Western music generally operates on relatively straightforward time signatures (e.g., 4/4 or 3/4). In contrast, a Carnatic Tala is a complex, cyclic time measure made up of specific structural elements (*Angas*).
15+
16+
The most common, *Adi Tala*, is an 8-beat cycle, but it is internally structured as 4 + 2 + 2. When a performer improvises, the melodic phrases (Sancharas) must logically resolve at specific critical waypoints within this cycle, particularly on the *Samam* (the first beat) or the *Eduppu* (a specific offset beat).
17+
18+
## Integrating Rhythm into Deep Learning
19+
20+
Currently, DeepRaaga's quantization models align notes to a temporal grid. The next phase of our architectural evolution brings in **Tala-Awareness**.
21+
22+
### 1. Multi-Conditioning the LSTM
23+
Instead of passing only a `Raga_ID` to condition the neural network, our updated architecture will introduce a `Tala_Context_Vector`. This vector will feed the model continuous information about:
24+
* The current position within the Tala cycle.
25+
* The distance to the next major resolution point (*Samam*).
26+
27+
### 2. Reinforcement Learning for Resolution
28+
Predicting the next note probabilistically works well for infinite melodic wandering, but classical music requires structural tension and release. We are exploring Reinforcement Learning (RL) techniques where the generator is "rewarded" for constructing melodic phrases that mathematically resolve perfectly onto the *Samam*.
29+
30+
## The Ultimate Vision
31+
32+
Our goal is not just an AI that plays notes, but an AI that understands the underlying mathematical poetry of Carnatic music. By marrying our existing Raga-Conditioned neural engine with a robust rhythmic awareness framework, DeepRaaga will step closer to generating fully structured *Alapanas* and *Kalpanaswaras* that are virtually indistinguishable from human composition.
33+
34+
Stay tuned as we push our TensorFlow pipelines into the rhythmic dimension!
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Inside the DeepRaaga Neural Engine: Code Internals
2+
3+
We often talk about the profound implications of merging Deep Learning with ancient musical grammar. Today, we're popping the hood to show you exactly how the DeepRaaga core models operate on a code level.
4+
5+
![DeepRaaga Code Internals](/DeepRaaga/blog-images/deepraaga_code_internals.png)
6+
7+
## 1. The Preprocessing Pipeline (`data_ingestion.py`)
8+
9+
Before a neural network can generate a Carnatic Sanchara, it must understand the raw audio. We don't feed raw waveform data (like `.wav` or `.mp3`) directly into our LSTM block; the dimensionality is too high to effectively parse logical raga grammar.
10+
11+
Instead, we extract semantic data:
12+
```python
13+
def extract_note_sequence(midi_path):
14+
"""
15+
Parses complex MIDI files into Magenta NoteSequences,
16+
preserving pitch bends and gamaka arrays.
17+
"""
18+
raw_sequence = midi_io.midi_file_to_note_sequence(midi_path)
19+
quantized_sequence = sequences_lib.quantize_note_sequence(raw_sequence, steps_per_quarter=4)
20+
return quantized_sequence
21+
```
22+
By utilizing `NoteSequence` protobufs, we structure the music into an array of discrete and continuous events, maintaining the microtonal bends essential to Carnatic ragas.
23+
24+
## 2. Raga-Conditioned LSTM Training Loop (`train_model.py`)
25+
26+
The magic behind DeepRaaga is the **Conditioning Vector**. We do not use a single monolithic model for all Indian music. We inject the *Raga_ID* straight into the LSTM state.
27+
28+
```python
29+
# Pseudo-code for our conditioning block
30+
class RagaLSTM(tf.keras.Model):
31+
def __init__(self, vocab_size, raga_classes):
32+
super(RagaLSTM, self).__init__()
33+
self.raga_embedding = tf.keras.layers.Embedding(raga_classes, 64)
34+
self.note_embedding = tf.keras.layers.Embedding(vocab_size, 128)
35+
self.lstm = tf.keras.layers.LSTM(256, return_sequences=True)
36+
self.dense = tf.keras.layers.Dense(vocab_size, activation='softmax')
37+
38+
def call(self, inputs, raga_id):
39+
# The raga latent vector acts as a strong bias
40+
condition = self.raga_embedding(raga_id)
41+
x = self.note_embedding(inputs)
42+
43+
# Inject context alongside the sequence data
44+
context_injected = tf.concat([x, condition], axis=-1)
45+
lstm_out = self.lstm(context_injected)
46+
return self.dense(lstm_out)
47+
```
48+
This forces the LSTM to constrain its probabilistic output strictly to the allowed *Arohana/Avarohana* of the injected context.
49+
50+
## 3. Real-Time Generation via FastAPI (`app.py`)
51+
52+
To make these models accessible on the web, we wrap the inference logic in an asynchronous FastAPI server. When you adjust the "Temperature" or "Raga" sliders on our React frontend, a REST call triggers the generation:
53+
54+
```python
55+
@app.post("/api/generate")
56+
async def generate_melody(request: GenerationRequest):
57+
raga_vector = get_raga_embedding(request.raga_name)
58+
seed_sequence = generate_seed(request.raga_name)
59+
60+
# Run autoregressive generation
61+
output = model.generate(
62+
seed=seed_sequence,
63+
condition=raga_vector,
64+
temperature=request.temperature
65+
)
66+
67+
return {"midi_data": sequence_to_midi_base64(output)}
68+
```
69+
70+
By decoupling the Heavy ML operations from the frontend, DeepRaaga achieves ultra-fast inference while letting you play the generated MIDI results seamlessly through `Tone.js`.

docs/blog/06-how-to-contribute.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Join the Chorus: How to Contribute to DeepRaaga
2+
3+
DeepRaaga is an open-source initiative. Our mission is to digitize and preserve Indian Classical Music using AI, but a project of this scale cannot be built in a silo. We need the collaborative power of Machine Learning engineers, React developers, and Carnatic musicians to build this National Knowledge Repository.
4+
5+
![Open Source Collaboration](/DeepRaaga/blog-images/opensource_contribution.png)
6+
7+
## Who Are We Looking For?
8+
9+
Whether you write Python syntax or musical syntax, there is a place for you in the DeepRaaga repository:
10+
11+
### 1. The Musicologists (Data Contribution)
12+
An AI is only as good as the data it learns from. Currently, our biggest bottleneck is perfectly quantized, annotated MIDI data of rare ragas and complex talas.
13+
* **How to help:** If you are a musician, you can contribute by recording strict Arohana/Avarohana scales and Sancharas into your DAW (Logic, Ableton, FL Studio) and exporting them as MIDI files.
14+
* **Reviewing outputs:** We need trained ears to review the outputs of our generative models and highlight *Apaswaras* (forbidden notes) so we can tune our reinforcement learning penalty weights.
15+
16+
### 2. The ML Engineers (Core Modeling)
17+
If you eat TensorFlow and PyTorch for breakfast, we have complex architectural problems to solve.
18+
* **How to help:** We are looking to transition parts of our `RagaLSTM` pipelines into Transformer-based architectures (e.g., MusicLM derivatives) to capture longer-range dependencies in *Alapanas*.
19+
* **Tala-Awareness:** Help us build our new `Tala_Context_Vector` injection logic to allow rhythmically synced MIDI generation.
20+
21+
### 3. The Frontend Developers (UI/UX)
22+
DeepRaaga's React interface is the bridge between our complex math and the end user.
23+
* **How to help:** We want to build an interactive "Raga Sandbox." This involves heavy use of `Tone.js` and Web Audio APIs for real-time synthesis. If you are passionate about React, visualizations, and WebGL, we need help drawing real-time microtonal pitch graphs for students to compare against.
24+
25+
## Getting Started
26+
27+
Contributing is incredibly simple:
28+
1. **Fork the Repository:** Head over to our [GitHub Repository](https://github.com/sgmoorthy/DeepRaaga) and click Fork.
29+
2. **Setup the Environment:** Follow the `README.md` to spin up the FastAPI backend (`pip install -r requirements.txt`) and the Vite frontend (`npm install && npm run dev`).
30+
3. **Pick an Issue:** Check out the `good-first-issue` labels on our GitHub boards.
31+
32+
Let’s harmonize our heritage together!

0 commit comments

Comments
 (0)