Exploring the Melakartha Ragas of Carnatic Music with Python
Unraveling the Melakartha Ragas: A Python Journey into the Heart of Carnatic Music
Carnatic music, one of the two major classical music traditions of India, boasts a rich tapestry of ragas, each with its own unique melodic structure and emotive qualities. Among the foundational elements of Carnatic music are the Melakartha ragas, a set of 72 ragas that serve as the basis for countless compositions and improvisations.
కర్ణాటక సంగీతంలో రిషభం, గాంధారం, ధైవతం, నిషాదంలో మూడు, మధ్యమంలో రెండు, పంచమం, షడ్జంలో ఒక్కొక్కటి చొప్పున 16 స్వరాలు ఉన్నాయి.
In this post, we'll delve into the world of Melakartha ragas and explore how Python can be used to generate and understand these fundamental musical entities.
Understanding Melakartha Ragas
Melakartha ragas form the backbone of Carnatic music, providing a systematic framework for organizing and studying ragas. Each Melakartha raga is characterized by its specific arrangement of swaras (musical notes) in both ascending (Arohanam) and descending (Avarohanam) scales. These ragas are grouped into sets known as chakras, with each chakra consisting of six ragas.
Python Script to Generate Melakartha Ragas
Let's dive into a Python script that generates the 72 Melakartha ragas:
# Python script to generate Melakartha ragas
import itertools
# Function to convert binary representation to notes for Ri/Ga combination
def binary_to_notes_ri_ga(binary):
notes_mapping = {
'1100': 'Ri1 Ri2(Ga1)',
'1010': 'Ri1 Ri3(Ga2)',
'1001': 'Ri1 Ga3',
'0110': 'Ri2(Ga1) Ri3(Ga2)',
'0101': 'Ri2(Ga1) Ga3',
'0011': 'Ri3(Ga2) Ga3'
}
return notes_mapping.get(binary, "Invalid binary representation")
# Function to convert binary representation to notes for Dha/Ni combination
def binary_to_notes_dha_ni(binary):
notes_mapping = {
'1100': 'Dha1 Dha2(Ni1)',
'1010': 'Dha1 Dha3(Ni2)',
'1001': 'Dha1 Ni3',
'0110': 'Dha2(Ni1) Dha3(Ni2)',
'0101': 'Dha2(Ni1) Ni3',
'0011': 'Dha3(Ni2) Ni3'
}
return notes_mapping.get(binary, "Invalid binary representation")
# Define swaras for each position
sa_list, pa_list = ['S'], ['P']
ri_ga_list = ['1100', '1010', '1001', '0110', '0101', '0011']
ma_list = ['M1', 'M2']
da_ni_list = ri_ga_list
# Generate combinations for each Ma
for ma in ma_list:
combinations = itertools.product(sa_list, ri_ga_list, [ma], pa_list, da_ni_list, sa_list)
combination_list = list(combinations)
# Print raga details for each combination
for i, combination in enumerate(combination_list):
combination = list(combination)
combination[1] = binary_to_notes_ri_ga(combination[1])
combination[4] = binary_to_notes_dha_ni(combination[4])
print(f"{i+1:02d}", " ".join(combination))
Melakarta (Katapayadi sankhya ) chart :
(Ref: https://commons.wikimedia.org/wiki/Melakarta_ragams)
Shuddha Madhyama Melakartas:
01 S Ri1 Ri2(Ga1) M1 P Dha1 Dha2(Ni1) S
02 S Ri1 Ri2(Ga1) M1 P Dha1 Dha3(Ni2) S
03 S Ri1 Ri2(Ga1) M1 P Dha1 Ni3 S
04 S Ri1 Ri2(Ga1) M1 P Dha2(Ni1) Dha3(Ni2) S
05 S Ri1 Ri2(Ga1) M1 P Dha2(Ni1) Ni3 S
06 S Ri1 Ri2(Ga1) M1 P Dha3(Ni2) Ni3 S
07 S Ri1 Ri3(Ga2) M1 P Dha1 Dha2(Ni1) S
08 S Ri1 Ri3(Ga2) M1 P Dha1 Dha3(Ni2) S
09 S Ri1 Ri3(Ga2) M1 P Dha1 Ni3 S
10 S Ri1 Ri3(Ga2) M1 P Dha2(Ni1) Dha3(Ni2) S
11 S Ri1 Ri3(Ga2) M1 P Dha2(Ni1) Ni3 S
12 S Ri1 Ri3(Ga2) M1 P Dha3(Ni2) Ni3 S
13 S Ri1 Ga3 M1 P Dha1 Dha2(Ni1) S
14 S Ri1 Ga3 M1 P Dha1 Dha3(Ni2) S
15 S Ri1 Ga3 M1 P Dha1 Ni3 S
16 S Ri1 Ga3 M1 P Dha2(Ni1) Dha3(Ni2) S
17 S Ri1 Ga3 M1 P Dha2(Ni1) Ni3 S
18 S Ri1 Ga3 M1 P Dha3(Ni2) Ni3 S
19 S Ri2(Ga1) Ri3(Ga2) M1 P Dha1 Dha2(Ni1) S
20 S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dha2(Ni1) Ni3 S
36 S Ri3(Ga2) Ga3 M2 P Dha3(Ni2) Ni3 S
Conclusion
With the help of Python, we've gained insights into the intricate world of Melakartha ragas in Carnatic music. By understanding the structure and organization of these ragas, musicians and enthusiasts can deepen their appreciation and exploration of this timeless musical tradition.