SYSTEM ARCHITECTURE · TYPESAFE JEV + ACOUSTIC DSP
How Swaraga Works
End-to-end signal and decision topology from raw vocal audio to calibrated Hindustani and Carnatic raga judgments.
01 ACOUSTIC DSP & YIN F0 SCIENCE
Shadja-Locked F0 & 1200¢ Trajectory
- Decodes vocal audio at
16 kHzvia Web Audio API and computes the YIN cumulative mean normalized difference functiond'(τ) = d(τ) / ((1/τ)∑d(j))with parabolic interpolation. - Locks tonic
Savia harmonic fifth/fourth (Pa/Ma) pitch-class salience and maps frames toc = 1200 log₂(f₀ / f_Sa) mod 1200. - Applies a 7-point median filter and
>350¢transient consonant despiker to segment continuous Svara-Lipi note ribbons.
02 RAGA COMBINATORICS (962 NAMED + 34,848+ OPEN-SET)
Concert Repertoire vs. Mathematical Scales
- Concert vs. Compendia: ~300–500 ragas are actively performed in concerts; classical encyclopedias (Sangita Sampradaya Pradarshini, Raga Nidhi) document ~1,000 named ragas.
- 34,848 Upanga Janya Scales: Venkatamakhin's 72 Melakartas × 484 straight 5/6/7-note (Audava / Shadava / Sampurna) Aroha × Avaroha subsets yield
72 × 484 = 34,848scales, plus open-ended Vakra & Bhashanga phrasing ("Ananta vai ragah").
03 TWO-STAGE FULL-CATALOG & OPEN-SET MATCHER
962 Catalogued Ragas + 13th Janya Hypothesis
- 962 Named Ragas: Indexes 72 Melakartas, 807 Carnatic Janyas, 61 Hindustani Thaat ragas, and 22 Dual Hindustani–Carnatic pairs.
- Stage 1 Shortlist: Scores all 962 ragas via
0.42·Recall − 1.15·VarjyaLeak + 0.32·Jaccard + 0.28·Pakad + VadiBonusto forward the top 12 candidates. - Stage 2 Open-Set (
out_of_catalog): Adds a 13th hypothesis that synthesizes the exact Janya Jati, parent Melakarta, and nearest Thaat for any uncatalogued scale.
04 SYSTEM ONE PRIMITIVES & DUAL RUNTIME
10 Batched Judgments & Zero-Key Browser WASM
- 10 Primitives: 4×
choice()(Primary Raga, Parent Thaat, Idiom, Prahar), 2×score()(Gamaka & Rasa 0–3 rubrics), and 4×noul()(Pakad & Vadi verifiers). - Hierarchical Beam: Ranks candidates by geometric beam
√(P(Thaat) × P(Raga)). - Cloud BYOK or Local WASM: Evaluates via
POST /v1/systemone(jev-latest) or auto-loads OpenJev (@wllama/wllamaQwen3-0.6B) in-browser when no API key is present.