
Dhun AI — Indian Classical Music Composition System
An AI-powered system that composes classical Indian music (dhuns) from Hindi lyrics using raag theory, mood detection, and real-time audio synthesis.
Dhun AI is a sophisticated full-stack application that bridges ancient Indian classical music theory with modern artificial intelligence. Users input Hindi lyrics and the system — powered by Groq AI for mood detection and a custom raag-based melody engine — generates authentic classical compositions in real time. The platform supports 6 raags, 5 instruments, live audio playback via Web Audio API, and WAV export. Built end-to-end with Next.js, Supabase, and Tone.js, Dhun AI is one of the most culturally unique AI projects in the Indian developer space.
Indian classical music (raag-based composition) follows complex mathematical and emotional rules that take decades to master. There is no modern, accessible digital tool that lets everyday users — especially Hindi speakers — experience the process of composing a classical dhun from their own lyrics. Existing AI music tools are Western-centric and completely ignore the depth of Indian raag theory.
Built a full-stack AI music composition platform that implements genuine raag theory — aroha, avaroha, vadi, samvadi note rules — combined with Groq AI for lyric mood analysis. The system maps detected emotions to appropriate raags, generates note sequences respecting classical constraints, and synthesizes real-time audio with oscillator-based instrument simulation. Users can compose, visualize, play, and export their dhuns — all in the browser.
- 1Implementing authentic raag theory algorithms — aroha/avaroha patterns, vadi/samvadi note emphasis — mathematically in JavaScript
- 2Real-time oscillator-based audio synthesis with ADSR envelopes, reverb, and low-pass filters for 5 different Indian instruments
- 3Integrating Groq AI for Hindi lyric mood detection and mapping emotions to appropriate raags
- 4Designing a multi-page responsive UI that respects Indian classical aesthetics while staying modern
- 5Building a complete backend with 10+ API routes for composition, analysis, training, gallery, and export
- 6WAV file export from browser-rendered Web Audio API output
- 7Supabase PostgreSQL schema design for raags, instruments, composed songs, and training data with fallback mock data