diff --git a/docs/.claude/settings.local.json b/docs/.claude/settings.local.json
new file mode 100644
index 0000000..e45680a
--- /dev/null
+++ b/docs/.claude/settings.local.json
@@ -0,0 +1,15 @@
+{
+ "permissions": {
+ "allow": [
+ "Bash(pnpm build:*)",
+ "Bash(npm info:*)",
+ "Bash(cat:*)",
+ "Bash(ls:*)",
+ "Bash(grep:*)",
+ "Bash(pnpm run buildbase:*)",
+ "Bash(xargs basename:*)"
+ ],
+ "deny": [],
+ "ask": []
+ }
+}
diff --git a/docs/content/api/integration-guide/index.html b/docs/content/api/integration-guide/index.html
index a73ecbb..519552e 100644
--- a/docs/content/api/integration-guide/index.html
+++ b/docs/content/api/integration-guide/index.html
@@ -83,7 +83,7 @@
CDN / Vanilla HTML
\cycle("|4|2|2|")
Sw: S R G M P D N S.
Sh: sa ri ga ma pa dha ni sa
-
+
diff --git a/docs/content/api/integration-guide/nodejs/index.html b/docs/content/api/integration-guide/nodejs/index.html
index c6a2525..900bc4b 100644
--- a/docs/content/api/integration-guide/nodejs/index.html
+++ b/docs/content/api/integration-guide/nodejs/index.html
@@ -86,11 +86,11 @@ Accessing Notation Structure
\cycle("|4|2|2|")
\line("Pallavi")
-Sw: S , R , | G , M , | P , D , | N , S. , ||
-Sh: ni , nnu , | ko , ri , | va , ra , | nam , ma , ||
+Sw: S , R , G , M , P , D , N , S. ,
+Sh: ni , nnu , ko , ri , va , ra , nam , ma ,
\line("Anupallavi")
-Sw: S. , N , | D , P , | M , G , | R , S , ||
-Sh: en , na , | gu , ru , | sva , mi , | ra , ya , ||
+Sw: S. , N , D , P , M , G , R , S ,
+Sh: en , na , gu , ru , sva , mi , ra , ya ,
Validation
diff --git a/docs/content/api/integration-guide/react/index.html b/docs/content/api/integration-guide/react/index.html
index ffcbc66..882582a 100644
--- a/docs/content/api/integration-guide/react/index.html
+++ b/docs/content/api/integration-guide/react/index.html
@@ -73,7 +73,7 @@ Basic NotationViewer Component
\cycle("|4|2|2|")
Sw: S R G M P D N S.
Sh: sa ri ga ma pa dha ni sa
-
+
@@ -156,7 +156,7 @@ Component with Source Display and Editing
\line("Pallavi")
Sw: S , R , G , M , P , D , N , S. ,
Sh: ni , nnu , ko , ri , va , ra , nam , ma ,
-
+
diff --git a/docs/content/api/integration-guide/vue/index.html b/docs/content/api/integration-guide/vue/index.html
index a74a3b3..48f5e4f 100644
--- a/docs/content/api/integration-guide/vue/index.html
+++ b/docs/content/api/integration-guide/vue/index.html
@@ -79,7 +79,7 @@ Basic NotationViewer Component
\cycle("|4|2|2|")
Sw: S R G M P D N S.
Sh: sa ri ga ma pa dha ni sa
-
+
@@ -191,7 +191,7 @@ Component with Source Display and Editing
\line("Pallavi")
Sw: S , R , G , M , P , D , N , S. ,
Sh: ni , nnu , ko , ri , va , ra , nam , ma ,
-
+
diff --git a/docs/content/api/integration-guide/web-components/index.html b/docs/content/api/integration-guide/web-components/index.html
index 8ba297d..8070d4d 100644
--- a/docs/content/api/integration-guide/web-components/index.html
+++ b/docs/content/api/integration-guide/web-components/index.html
@@ -189,7 +189,7 @@ Advanced: External Source
\beatDuration(4)
\line("Pallavi")
Sw: S , R , G , M , P , D , N , S. ,
-Sh: ni , nnu , ko , ri , va , ra , nam , ma ,
+Sh: ni , nnu , ko , ri , va , ra , nam , ma ,
Interactive Features
diff --git a/docs/content/api/styling/index.html b/docs/content/api/styling/index.html
index fb116b0..74449ee 100644
--- a/docs/content/api/styling/index.html
+++ b/docs/content/api/styling/index.html
@@ -156,7 +156,7 @@ Ocean Theme
\cycle("|4|2|2|")
\beatDuration(4)
Sw: S R G M , P D , N S.
-
+
@@ -165,7 +165,7 @@
Forest Theme
\cycle("|4|2|2|")
\beatDuration(4)
Sw: S R G M , P D , N S.
-
+
@@ -174,7 +174,7 @@
Sunset Theme
\cycle("|4|2|2|")
\beatDuration(4)
Sw: S R G M , P D , N S.
-
+
CSS for Scoped Themes
diff --git a/docs/content/demos/playgrounds/model-events/index.html b/docs/content/demos/playgrounds/model-events/index.html
index 1e8c7c0..b72fde5 100644
--- a/docs/content/demos/playgrounds/model-events/index.html
+++ b/docs/content/demos/playgrounds/model-events/index.html
@@ -94,7 +94,7 @@ Notation Syntax
S R G M | Individual notes |
S. or S' | Higher octave |
.S or S, | Lower octave |
- , or _ | Space/silence |
+ , | Space/silence |
[ G M P ] | Group (atoms share duration) |
2 S | Duration prefix (S has duration 2) |
diff --git a/docs/content/examples/basic-varnam/index.html b/docs/content/examples/basic-varnam/index.html
index 37e6bf6..65cbca9 100644
--- a/docs/content/examples/basic-varnam/index.html
+++ b/docs/content/examples/basic-varnam/index.html
@@ -163,7 +163,7 @@ Tips for Varnam Notation
- Always align swaras and sahitya on the same beat
- - Use underscores (
_) for sustained notes or pauses
+ - Use commas (
,) for sustained notes or pauses
- Use
\line() to separate sections clearly
- Mark speed changes in muktayi swarams
diff --git a/docs/content/examples/complex-gamakas/index.html b/docs/content/examples/complex-gamakas/index.html
index 099cc09..550ee89 100644
--- a/docs/content/examples/complex-gamakas/index.html
+++ b/docs/content/examples/complex-gamakas/index.html
@@ -94,8 +94,8 @@ Combining with Speed Changes
Practical Tips
- - Use
kampitam for sustained oscillating notes
- - Use
jaru for smooth glides between notes
+ - Use
~ before a note for kampitam, the sustained oscillation
+ - Use
~/ and ~\ for jaaru, the glide up into or down into a note
- Use
~ for quick ornamental touches
- Study raga-specific gamaka patterns
- Listen to masters to understand proper gamaka application
diff --git a/docs/content/examples/organizing-compositions/index.html b/docs/content/examples/organizing-compositions/index.html
index 38ec352..c32233f 100644
--- a/docs/content/examples/organizing-compositions/index.html
+++ b/docs/content/examples/organizing-compositions/index.html
@@ -14,16 +14,16 @@ Using Lines to Separate Sections
\beatDuration(4)
\line("Pallavi")
-Sw: S R G M , P D N S. , ___ ___ , ___ ___ |
-Sh: sa ri ga ma , pa dha ni sa , ___ ___ , ___ ___ ||
+Sw: S R G M , P D N S. , , , , , , , , , , , , , ,
+Sh: sa ri ga ma , pa dha ni sa , , , , , , , , , , , , , ,
\line("Anupallavi")
-Sw: S. R. G. M. , P. D. N. S.. , ___ ___ , ___ ___ |
-Sh: sa ri ga ma , pa dha ni sa , ___ ___ , ___ ___ ||
+Sw: S. R. G. M. , P. D. N. S.. , , , , , , , , , , , , , ,
+Sh: sa ri ga ma , pa dha ni sa , , , , , , , , , , , , , ,
\line("Charanam")
-Sw: P D S. R. , S. D P M , G M P D , S. ___ |
-Sh: pa dha sa ri , sa dha pa ma , ga ma pa dha , sa ___ ||
+Sw: P D S. R. , S. D P M , G M P D , S. , , ,
+Sh: pa dha sa ri , sa dha pa ma , ga ma pa dha , sa , , ,
Separating Swaras and Sahitya
@@ -35,10 +35,10 @@ Separating Swaras and Sahitya
\beatDuration(4)
\line("Pallavi - Swaras")
-Sw: S R G M , P M G R , S R G M , P ___ ___ ___ |
+Sw: S R G M , P M G R , S R G M , P , , , , , , , , ,
\line("Pallavi - Sahitya")
-Sh: nin nu ko ri , va ra da nun , nu ko ri , va ___ ___ ___ ||
+Sh: nin nu ko ri , va ra da nun , nu ko ri , va , , , , , , , , ,
Multi-Speed Sections
@@ -50,13 +50,13 @@ Multi-Speed Sections
\beatDuration(4)
\line("Muktayi Swaram - 1st Speed")
-S R G M , P D N S. , ___ ___ , ___ ___ |
+S R G M , P D N S. , , , , , , , , , , , , , ,
\line("Muktayi Swaram - 2nd Speed")
-SR GM PD NS. , R.S. DP MG RS , ___ ___ ___ ___ , ___ ___ ___ ___ |
+SR GM PD NS. , R.S. DP MG RS , , , , , , , , , , , , , , , , , , , , , , , , , ,
\line("Muktayi Swaram - 3rd Speed")
-SRG GMP PDN NS.R. , R.S.D DPN PMG GRS , ___ ___ ___ ___ , ___ ___ ___ ___ |
+SRG GMP PDN NS.R. , R.S.D DPN PMG GRS , , , , , , , , , , , , , , , , , , , , , , , , , ,
Long Kriti Structure
@@ -68,35 +68,37 @@ Long Kriti Structure
\beatDuration(4)
\line("==== PALLAVI ====")
-Sw: S R G M , P D N S. , ___ ___ , ___ ___ |
-Sh: bro va bha ra ma , moo la ra ma chan , dra ___ , ___ ___ ||
+Sw: S R G M , P D N S. , , , , , , , , , , , , , ,
+Sh: bro va bha ra ma , moo la ra ma chan , dra , , , , , , , , , ,
\line("==== ANUPALLAVI ====")
-Sw: S. R. G. M. , P. D. N. S.. , ___ ___ , ___ ___ |
-Sh: de va de va , ja ya ja ya , ___ ___ , ___ ___ ||
+Sw: S. R. G. M. , P. D. N. S.. , , , , , , , , , , , , , ,
+Sh: de va de va , ja ya ja ya , , , , , , , , , , , , , ,
\line("==== CHARANAM 1 ====")
-Sw: P D S. R. , S. D P M , G R S ___ , ___ ___ ___ ___ |
-Sh: ka ru na ni dhi , ra ma bha dra , nin ne ___ , ___ ___ ___ ___ ||
+Sw: P D S. R. , S. D P M , G R S , , , , , , , , , , , , , , , ,
+Sh: ka ru na ni dhi , ra ma bha dra , nin ne , , , , , , , , , , , , , , , ,
\line("==== CHARANAM 2 ====")
-Sw: S R G M , P M G R , S R G M , P ___ ___ ___ |
-Sh: sa da sa dhi ya , tya ga ra ja , vi nu ta , ra ___ ___ ___ ||
+Sw: S R G M , P M G R , S R G M , P , , , , , , , , ,
+Sh: sa da sa dhi ya , tya ga ra ja , vi nu ta , ra , , , , , , , , ,
Using Comments for Annotations
-Add performance notes or reminders:
+Anything after // on a line is ignored by the parser, so performance notes and
+reminders can sit next to the notation they describe rather than in a line title:
Organizing Repetitions
@@ -108,10 +110,10 @@ Organizing Repetitions
\beatDuration(4)
\line("Pallavi [Repeat 2x]")
-Sw: S R G M , P D N S. , ___ ___ , ___ ___ ||
+Sw: S R G M , P D N S. , , , , , , , , , , , , , ,
\line("Anupallavi")
-Sw: S. R. G. M. , P. D. N. S.. , ___ ___ , ___ ___ ||
+Sw: S. R. G. M. , P. D. N. S.. , , , , , , , , , , , , , ,
\line("[Return to Pallavi]")
@@ -125,10 +127,10 @@ Breaking Long Phrases
\beatDuration(4)
\line("Extended Swaram - Part 1")
-SR GM PD NS. , R.S. DP MG RS , SR GM PD NS. , R.S. DP MG RS |
+SR GM PD NS. , R.S. DP MG RS , SR GM PD NS. , R.S. DP MG RS
\line("Extended Swaram - Part 2")
-S.R. G.M. P.D. N.S.. , R..S.. D..N.. P..D.. M..P.. , G..M.. R..G.. S..R.. ___ , ___ ___ ___ ___ |
+S.R. G.M. P.D. N.S.. , R..S.. D..N.. P..D.. M..P.. , G..M.. R..G.. S..R.. , , , , , , , , , , , , , , , ,
Organizing by Tala Avartanams
@@ -140,13 +142,13 @@ Organizing by Tala Avartanams
\beatDuration(4)
\line("Avartanam 1")
-S R G M , P D N S. , ___ ___ , ___ ___ |
+S R G M , P D N S. , , , , , , , , , , , , , ,
\line("Avartanam 2")
-S. R. G. M. , P. D. N. S.. , ___ ___ , ___ ___ |
+S. R. G. M. , P. D. N. S.. , , , , , , , , , , , , , ,
\line("Avartanam 3")
-S.. D.. N.. S.. , P. M. G. R. , S. ___ ___ , ___ ___ ___ ||
+S.. D.. N.. S.. , P. M. G. R. , S. , , , , , , , , , , , , , , , ,
Best Practices
@@ -156,7 +158,7 @@ Best Practices
- Visual separation - Use
\line() liberally to separate sections
- Alignment - Keep swaras and sahitya aligned on the same beats
- Speed markers - Always label speed changes (1st, 2nd, 3rd speed)
- - Tala markers - Use
| and || to mark avartanam boundaries
+ - Tala markers - Drawn for you from the cycle, one line at the end of each bar and a double line at the end of the avartanam
- Whitespace - Don't be afraid of empty space for readability
- Comments - Add performance notes where helpful
- Logical grouping - Group related phrases together
@@ -167,7 +169,6 @@ Template for a Complete Composition
\cycle("|4|2|2|")
\beatDuration(4)
-\accidentals() // Add accidentals if needed
\line("==== PALLAVI ====")
Sw: // Add swaras
diff --git a/docs/content/examples/percussion/index.html b/docs/content/examples/percussion/index.html
index 96da43a..dc6dd61 100644
--- a/docs/content/examples/percussion/index.html
+++ b/docs/content/examples/percussion/index.html
@@ -7,15 +7,17 @@
Basic Approach: Using Comments
-The simplest way is to add percussion as comments or labels:
+The simplest way is to write the solkattu as a comment above the line it belongs to. Anything
+after // is ignored by the parser, so it stays in the source without becoming part of
+the notation:
Separate Percussion Line
@@ -27,10 +29,10 @@ Separate Percussion Line
\beatDuration(4)
\line("Melody")
-Sw: S R G M , P D N S. , R. S. N D , P M G R |
+Sw: S R G M , P D N S. , R. S. N D , P M G R
\line("Mridangam")
-Pe: ta ka dhi mi , ta ka jha nu , ta ki ta ta , ka dhi mi ta |
+Pe: ta ka dhi mi , ta ka jha nu , ta ki ta ta , ka dhi mi ta
Common Mridangam Patterns
@@ -42,10 +44,10 @@ Basic Adi Tala Pattern
\beatDuration(4)
\line("Swaras")
-Sw: S R G M , P D N S. , ___ ___ , ___ ___ |
+Sw: S R G M , P D N S. , , , , , , , , , , , , , ,
\line("Mridangam Pattern")
-Pe: ta ka ta ki , ta ta ka dhi , mi ta ka , jha nu ta |
+Pe: ta ka ta ki , ta ta ka dhi , mi ta ka , jha nu ta
Chatusram in Adi Tala
@@ -54,8 +56,8 @@ Chatusram in Adi Tala
\cycle("|4|2|2|")
\beatDuration(4)
-Sw: SRGM PDNS. R.G.M.P. D.N.S..R.. , ___ ___ ___ ___ , ___ ___ ___ ___ |
-Pe: taka dimi taka jhanu , taki tata kadhi mita , ___ ___ ___ ___ , ___ ___ ___ ___ |
+Sw: SRGM PDNS. R.G.M.P. D.N.S..R.. , , , , , , , , , , , , , , , , , , , , , , , , , ,
+Pe: taka dimi taka jhanu , taki tata kadhi mita , , , , , , , , , , , , , , , , , , , , , , , , , ,
Tisram in Adi Tala
@@ -64,8 +66,8 @@ Tisram in Adi Tala
\cycle("|4|2|2|")
\beatDuration(4)
-Sw: SRG MPD NS. R.G. , M.P. D.N. S..R.. G..M.. , P..D.. N..S... ___ ___ , ___ ___ ___ ___ |
-Pe: tak adh imi tak adh , ita kit ata kat adh , imi tak adh ___ , ___ ___ ___ ___ |
+Sw: SRG MPD NS. R.G. , M.P. D.N. S..R.. G..M.. , P..D.. N..S... , , , , , , , , , , , , , , , , , , ,
+Pe: tak adh imi tak adh , ita kit ata kat adh , imi tak adh , , , , , , , , , , , , , , , ,
Mridangam in Different Talas
@@ -76,8 +78,8 @@ Rupaka Tala (6 beats)
\cycle("|2|4|")
\beatDuration(4)
-Sw: S R , G M P D N S. |
-Pe: ta ka , dhi mi ta ka jha nu |
+Sw: S R , G M P D N S.
+Pe: ta ka , dhi mi ta ka jha nu
Misra Chapu (7 beats)
@@ -86,8 +88,8 @@ Misra Chapu (7 beats)
\cycle("|3|2|2|")
\beatDuration(4)
-Sw: S R G , M P , D N |
-Pe: ta ka dhi , mi ta , ka jha ||
+Sw: S R G , M P , D N
+Pe: ta ka dhi , mi ta , ka jha
Mridangam Korvai Patterns
@@ -99,16 +101,16 @@ Mridangam Korvai Patterns
\beatDuration(4)
\line("Korvai - First Iteration")
-Pe: ta ka dhi mi ta ka jha nu , ta ri ki ta ta ka dhi mi , ta ka jha nu ___ , ___ ___ ___ ___ |
+Pe: ta ka dhi mi ta ka jha nu , ta ri ki ta ta ka dhi mi , ta ka jha nu , , , , , , , , , , , , , , , ,
\line("Korvai - Second Iteration")
-Pe: ta ka dhi mi ta ka jha nu , ta ri ki ta ta ka dhi mi , ta ka jha nu ___ , ___ ___ ___ ___ |
+Pe: ta ka dhi mi ta ka jha nu , ta ri ki ta ta ka dhi mi , ta ka jha nu , , , , , , , , , , , , , , , ,
\line("Korvai - Third Iteration")
-Pe: ta ka dhi mi ta ka jha nu , ta ri ki ta ta ka dhi mi , ta ka jha nu ___ , ___ ___ ___ ___ |
+Pe: ta ka dhi mi ta ka jha nu , ta ri ki ta ta ka dhi mi , ta ka jha nu , , , , , , , , , , , , , , , ,
\line("Mohra (Ending)")
-Pe: ta ___ dhi mi ___ , ___ ta ___ , ___ ___ ___ ||
+Pe: ta , , , dhi mi , , , , , , , ta , , , , , , , , , , , , ,
Thani Avartanam Structure
@@ -120,13 +122,13 @@ Thani Avartanam Structure
\beatDuration(4)
\line("Section 1 - Simple Patterns")
-Pe: ta ka dhi mi , ta ka jha nu , ta ki ta ta , ka dhi mi ta |
+Pe: ta ka dhi mi , ta ka jha nu , ta ki ta ta , ka dhi mi ta
\line("Section 2 - Increase Complexity")
-Pe: taka dimi taka jhanu , taki tata kadhi mita , takajhanu tari kita , dimi taka jhanu ta |
+Pe: taka dimi taka jhanu , taki tata kadhi mita , takajhanu tari kita , dimi taka jhanu ta
\line("Section 3 - Korvai")
-Pe: takadimi takajhanu tarikita , takadimi takajhanu tarikita , takadimi takajhanu tarikita , ta ___ dhi mi ___ ||
+Pe: takadimi takajhanu tarikita , takadimi takajhanu tarikita , takadimi takajhanu tarikita , ta , , , dhi mi , , ,
Combining with Swaras
@@ -138,12 +140,12 @@ Combining with Swaras
\beatDuration(4)
\line("Pallavi")
-Sw: S R G M , P M G R , S R G M , P ___ ___ ___ |
-Pe: ta ka dhi mi , ta ka jha nu , ta ri ki ta , ta ___ ___ ___ ||
+Sw: S R G M , P M G R , S R G M , P , , , , , , , , ,
+Pe: ta ka dhi mi , ta ka jha nu , ta ri ki ta , ta , , , , , , , , ,
\line("Swaram Passage")
-Sw: SR GM PD NS. , R.S. DP MG RS , ___ ___ ___ ___ , ___ ___ ___ ___ |
-Pe: taka dimi taka jhanu , taki tata kadh imi ta , ___ ___ ___ ___ , ___ ___ ___ ___ ||
+Sw: SR GM PD NS. , R.S. DP MG RS , , , , , , , , , , , , , , , , , , , , , , , , , ,
+Pe: taka dimi taka jhanu , taki tata kadh imi ta , , , , , , , , , , , , , , , , , , , , , , , , , ,
Tabla Patterns
@@ -155,10 +157,10 @@ Tabla Patterns
\beatDuration(4)
\line("Melody")
-Sw: S R G M , P D N S. , R. G. M. P. , D. N. S.. R.. |
+Sw: S R G M , P D N S. , R. G. M. P. , D. N. S.. R..
\line("Tabla (Teental)")
-Pe: dha dhin dhin dha , dha dhin dhin dha , dha tin tin ta , ta dhin dhin dha |
+Pe: dha dhin dhin dha , dha dhin dhin dha , dha tin tin ta , ta dhin dhin dha
Notation Symbols
@@ -178,7 +180,7 @@ Practical Tips
- Use a separate line prefixed with
Pe: for percussion
- Align percussion syllables with corresponding melody beats
- Mark korvai iterations clearly (1st, 2nd, 3rd)
- - Use
___ for rests or sustained tones
+ - Use
, for a held beat and - for an explicit rest
- Study traditional korvai patterns and their variations
- Practice reciting solkattu (vocal percussion syllables)
- Consider the interaction between melody and percussion
diff --git a/docs/content/examples/ragam-tanam-pallavi/index.html b/docs/content/examples/ragam-tanam-pallavi/index.html
index eeacd9f..15558a2 100644
--- a/docs/content/examples/ragam-tanam-pallavi/index.html
+++ b/docs/content/examples/ragam-tanam-pallavi/index.html
@@ -16,19 +16,17 @@ Structure Overview
Ragam Section
-The ragam is a free exploration. Use \noTala to indicate no fixed rhythm:
+The ragam is a free exploration with no fixed rhythm. There is no command for that yet, so the example below leaves out \cycle and lets the default apply:
-\noTala
-\accidentals(M#)
\line("Alapana - Lower Octave")
-S _ _ R , G _ M# _ , P _ _ _
+S , , R , G , "M#" , , P , , ,
\line("Alapana - Middle Octave")
-M# P D N , S. _ _ R. , G. M#. P. D.
+"M#" P D N , S. , , R. , G. "M#." P. D.
\line("Alapana - Descent")
-S. _ D N , P M# G R , S _ _ _
+S. , D N , P "M#" G R , S , , ,
Tanam Section
@@ -36,14 +34,12 @@ Tanam Section
Tanam introduces rhythm but maintains freedom. Mark it with \line("Tanam"):
-\noTala
-\accidentals(M#)
\line("Tanam")
-S R G M# , P D N S. , ta na na tom , ta na na tom
+S R G "M#" , P D N S. , ta na na tom , ta na na tom
-S. R. G. M#. , P. D. N. S.. , ta na na tom , ta na na tom
+S. R. G. "M#." , P. D. N. S.. , ta na na tom , ta na na tom
-S.. D. N. S. , P M# G R , S _ _ _ , ta nom _ _
+S.. D. N. S. , P "M#" G R , S , , , , ta nom , ,
Pallavi - Setting the Tala
@@ -53,10 +49,9 @@ Pallavi - Setting the Tala
\cycle("|3|2|2|")
\beatDuration(4)
-\accidentals(M#)
\line("Pallavi - Misra Chapu")
-Sw: S R G M# , P D N , S. R. G. |
-Sh: ga na na tha , bho vi , ka ra na ||
+Sw: S R G "M#" , P D N , S. R. G.
+Sh: ga na na tha , bho vi , ka ra na
Pallavi - First Speed
@@ -66,10 +61,9 @@ Pallavi - First Speed
\cycle("|3|2|2|")
\beatDuration(4)
-\accidentals(M#)
\line("1st Speed Variation")
-S R G M# , P M# G R , S R G M# |
-P D N S. , R. S. N D , P M# G R ||
+S R G "M#" , P "M#" G R , S R G "M#"
+P D N S. , R. S. N D , P "M#" G R
Pallavi - Second Speed
@@ -77,10 +71,9 @@ Pallavi - Second Speed
\cycle("|3|2|2|")
\beatDuration(4)
-\accidentals(M#)
\line("2nd Speed Variation")
-SR GM# PD , NS. R.S. ND , PM# GR SR |
-GM# PD NS. , R.G. M#.P. D.N. , S.R. G.M#. P.D. ||
+SR "GM#" PD , NS. R.S. ND , "PM#" GR SR
+"GM#" PD NS. , R.G. "M#.P." D.N. , S.R. "G.M#." P.D.
Pallavi - Third Speed (Tisram)
@@ -88,10 +81,9 @@ Pallavi - Third Speed (Tisram)
\cycle("|3|2|2|")
\beatDuration(4)
-\accidentals(M#)
\line("3rd Speed Variation (Tisram)")
-SRG GM#P PDN , NS.R. R.S.N NDP , PM#G GRS SRG |
-GM#P PDN NS.R. , R.G.M#. M#.P.D. D.N.S.. , S..D.N. N.S.P PM#G ||
+SRG "GM#P" PDN , NS.R. R.S.N NDP , "PM#G" GRS SRG
+"GM#P" PDN NS.R. , "R.G.M#." "M#.P.D." D.N.S.. , S..D.N. N.S.P "PM#G"
Kalpana Swarams
@@ -101,16 +93,15 @@ Kalpana Swarams
\cycle("|3|2|2|")
\beatDuration(4)
-\accidentals(M#)
\line("Kalpana Swaram 1")
-SR GM# PD , NS. R.S. ND , PM# GR SR |
+SR "GM#" PD , NS. R.S. ND , "PM#" GR SR
\line("Return to Pallavi")
-S R G M# , P D N , S. R. G. ||
+S R G "M#" , P D N , S. R. G.
\line("Kalpana Swaram 2")
-S.D. N.S. S.P , PM# M#G GR , RS SR RG |
+S.D. N.S. S.P , "PM#" "M#G" GR , RS SR RG
\line("Return to Pallavi")
-S R G M# , P D N , S. R. G. ||
+S R G "M#" , P D N , S. R. G.
Complete RTP Structure
@@ -131,7 +122,7 @@ Complete RTP Structure
Tips for RTP Notation
- - Use
\noTala for ragam and tanam sections
+ - Leave out
\cycle in ragam and tanam sections, which have no fixed rhythm
- Choose interesting talas for pallavi (not just Adi tala)
- Mark each speed variation clearly with
\line()
- Always return to the pallavi line after kalpana swarams
@@ -144,5 +135,5 @@ See Also
diff --git a/docs/content/examples/tisram/index.html b/docs/content/examples/tisram/index.html
index b866028..7b03801 100644
--- a/docs/content/examples/tisram/index.html
+++ b/docs/content/examples/tisram/index.html
@@ -13,7 +13,7 @@ Understanding Tisram
\cycle("|4|2|2|")
\beatDuration(4)
\line("Tisram - 3 notes per beat")
-SRG MPD NS. R.G. , M.P. D.N. S..R.. G..M.. , P..D.. N..S... ___ ___ , ___ ___ ___ ___
+SRG MPD NS. R.G. , M.P. D.N. S..R.. G..M.. , P..D.. N..S... , , , , , , , , , , , , , , , , , , ,
Tisram vs Chatusram (4 notes per beat)
@@ -24,10 +24,10 @@ Tisram vs Chatusram (4 notes per beat)
\cycle("|4|2|2|")
\beatDuration(4)
\line("Chatusram (4 per beat)")
-SRGM PDNS. R.G.M. P.D.N. , S..R..G..M.. P..D..N..S... , ___ ___ , ___ ___
+SRGM PDNS. R.G.M. P.D.N. , S..R..G..M.. P..D..N..S... , , , , , , , , , , , , , ,
\line("Tisram (3 per beat)")
-SRG MPD NS. R.G. , M.P. D.N. S..R.. G..M.. , P..D.. N..S... ___ , ___ ___ ___
+SRG MPD NS. R.G. , M.P. D.N. S..R.. G..M.. , P..D.. N..S... , , , , , , , , , , , , ,
Tisram in Different Talas
@@ -45,8 +45,8 @@ Rupaka Tala (6 beats)
\cycle("|2|4|")
\beatDuration(4)
-SRG MPD , NS. R.G. M.P. D.N. |
-S..R.. G..M.. , P..D.. N..S... ___
+SRG MPD , NS. R.G. M.P. D.N.
+S..R.. G..M.. , P..D.. N..S... , , ,
Misra Chapu (7 beats)
@@ -54,8 +54,8 @@ Misra Chapu (7 beats)
\cycle("|3|2|2|")
\beatDuration(4)
-SRG MPD NS. , R.G. M.P. , D.N. S..R.. |
-G..M.. P..D.. N..S... , ___ ___ , ___ ___
+SRG MPD NS. , R.G. M.P. , D.N. S..R..
+G..M.. P..D.. N..S... , , , , , , , , , , , , , ,
Kanda Chapu (5 beats) - Natural Tisram Feel
@@ -65,7 +65,7 @@ Kanda Chapu (5 beats) - Natural Tisram Feel
\cycle("|2|3|")
\beatDuration(4)
-SRG MPD , NS. R.G. M.P. |
+SRG MPD , NS. R.G. M.P.
D.N. S..R.. , G..M.. P..D.. N..S...
@@ -76,7 +76,7 @@ Ascending Patterns
\cycle("|4|2|2|")
\beatDuration(4)
-SRG RGM GMP MPD , PDN DNS. NS.R. S.R.G. , R.G.M. G.M.P. M.P.D. P.D.N. , D.N.S.. ___ ___ ___
+SRG RGM GMP MPD , PDN DNS. NS.R. S.R.G. , R.G.M. G.M.P. M.P.D. P.D.N. , D.N.S.. , , , , , , , , ,
Descending Patterns
@@ -92,7 +92,7 @@ Mixed Patterns
\cycle("|4|2|2|")
\beatDuration(4)
-SRG SRG MGP MGP , PDN PDN S.R.G. S.R.G. , M.P.D. M.P.D. N.S..R.. N.S..R.. , G..M..P.. ___ ___ ___
+SRG SRG MGP MGP , PDN PDN S.R.G. S.R.G. , M.P.D. M.P.D. N.S..R.. N.S..R.. , G..M..P.. , , , , , , , , ,
Tisram with Gamakas
@@ -102,7 +102,7 @@ Tisram with Gamakas
\cycle("|4|2|2|")
\beatDuration(4)
-(SRG kampitam) MPD NS.R.G. (M.P.D. jaru N.S..) , (S..D..N.. kampitam) N..S..P.. P..M..G.. (MGR jaru S) , ___ ___ ___ ___ , ___ ___ ___ ___
+~ SRG MPD NS.R.G. M.P.D. ~/ N.S.. , ~ S..D..N.. N..S..P.. P..M..G.. MGR ~/ S , , , , , , , , , , , , , , , , , , , , , , , , , ,
Converting from Chatusram to Tisram
@@ -113,10 +113,10 @@ Converting from Chatusram to Tisram
\cycle("|4|2|2|")
\beatDuration(4)
\line("Original (Chatusram - 4 per beat)")
-SRGM PDNS. R.G.M.P. D.N.S..R.. , ___ ___ ___ ___ , ___ ___ ___ ___ , ___ ___ ___ ___
+SRGM PDNS. R.G.M.P. D.N.S..R.. , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
\line("Converted (Tisram - 3 per beat)")
-SRG MPD NS. R.G. , M.P. D.N. S..R.. G..M.. , P..D.. N..S... ___ ___ , ___ ___ ___ ___
+SRG MPD NS. R.G. , M.P. D.N. S..R.. G..M.. , P..D.. N..S... , , , , , , , , , , , , , , , , , , ,
Practical Tips
diff --git a/docs/content/index.html b/docs/content/index.html
index 0f561db..e3f67e4 100644
--- a/docs/content/index.html
+++ b/docs/content/index.html
@@ -47,7 +47,7 @@ Quick Example
Sw: S R G M P D N S.
Sh: sa ri ga ma pa dha ni sa
-
+
See more in the Examples section
diff --git a/docs/content/reference/embellishments/index.html b/docs/content/reference/embellishments/index.html
index 5cd1e63..e91ed13 100644
--- a/docs/content/reference/embellishments/index.html
+++ b/docs/content/reference/embellishments/index.html
@@ -22,7 +22,7 @@ Kampitam (~)
\beatDuration(4)
-S R ~ G M P ~
+S ~ R G ~ M P
Example usage: p , S..n S..n S..n shows kampitam oscillating between notes.
@@ -75,7 +75,7 @@ Kandippu (~✓ or ~./ or ~.\)
\beatDuration(4)
-S. , , , n ~./ , P , , ,
+S. , , , ~./ n , P , , ,
Vaali (~~)
@@ -115,7 +115,7 @@ Spuritam (~∴ or ~:-)
\beatDuration(4)
-[S R] ~:- [G M]
+[S R] [~:- G M]
Prathyagatam (~∵ or ~-:)
@@ -124,7 +124,7 @@ Prathyagatam (~∵ or ~-:)
\beatDuration(4)
-[M G] ~-: [R S]
+[M G] [~-: R S]
Gamaka Summary Table
diff --git a/docs/content/reference/syntax/index.html b/docs/content/reference/syntax/index.html
index d8ab904..3a6ba16 100644
--- a/docs/content/reference/syntax/index.html
+++ b/docs/content/reference/syntax/index.html
@@ -69,7 +69,7 @@ Spaces (Karvais)
, | Space (Karvai) | 1 unit |
; | Double space | 2 units |
- _ | Silent space | 1 unit (not displayed) |
+ _ | Silent space (not implemented yet) | 1 unit (not displayed) |
@@ -77,7 +77,7 @@ Spaces (Karvais)
S , R ; G , , M
-Silent spaces consume duration without displaying the space symbol, useful to avoid clutter.
+Silent spaces are meant to consume duration without displaying the space symbol, to avoid clutter. They are not implemented yet, so use , for now.
Rests
@@ -147,7 +147,7 @@ Embellishments
Embellishments start with a tilde and continue until whitespace:
-S ~kampita R G ~jaru M
+S ~ R G ~/ M
See the Embellishments Reference for details.
@@ -197,20 +197,22 @@ Per-Role Markers
Comments
-Use // for line comments:
+Use // for line comments. Everything from the // to the end of the
+line is skipped, whether it starts the line or trails the notation on it:
-
// This is a comment
+
+P D N S. // and this one trails the notation
+
-Block comments are also supported:
+Block comments work the same way and can span lines:
-/* This is a
+
+
Grammar Summary
diff --git a/docs/content/tutorials/01-basics/index.html b/docs/content/tutorials/01-basics/index.html
index 8ce2aa9..ed33d6e 100644
--- a/docs/content/tutorials/01-basics/index.html
+++ b/docs/content/tutorials/01-basics/index.html
@@ -48,7 +48,7 @@ Spaces (Karvais)
Spaces indicate empty durations where the previous note continues. Use commas:
-, S , R , , G M; P ;
+, S , R , , G M; P ;
D N S. ,
@@ -65,8 +65,8 @@ Spaces (Karvais)
S ; R ; G ,
-M ; P ; D ,
-N , ; S. ; ,
+M ; P ; D ,
+N , ; S. ; ,
Groups
diff --git a/docs/content/tutorials/02-commands/index.html b/docs/content/tutorials/02-commands/index.html
index 0685b69..eab2a78 100644
--- a/docs/content/tutorials/02-commands/index.html
+++ b/docs/content/tutorials/02-commands/index.html
@@ -23,16 +23,16 @@ Beat Duration
\beatDuration(4)
- S S R - S S R - S R S S R R G G M M
- R R G - R R G - R G R R G G M M P P
- G G M - G G M - G M G G M M P P D D
- M M P - M M P - M P M M P P D D N N
- P P D - P P D - P D P P D D N N S. S.
- S. S. N - S. S. N - S. N S. S. N N D D P P
- N N D - N N D - N D N N D D P P M M
- D D P - D D P - D P D D P P M M G G
- P P M - P P M - P M P P M M G G R R
- M M G - M M G - M G M M G G R R S S
+ S S R - S S R - S R S S R R G G M M
+ R R G - R R G - R G R R G G M M P P
+ G G M - G G M - G M G G M M P P D D
+ M M P - M M P - M P M M P P D D N N
+ P P D - P P D - P D P P D D N N S. S.
+ S. S. N - S. S. N - S. N S. S. N N D D P P
+ N N D - N N D - N D N N D D P P M M
+ D D P - D D P - D P D D P P M M G G
+ P P M - P P M - P M P P M M G G R R
+ M M G - M M G - M G M M G G R R S S
This is commonly used to notate different speeds in Carnatic music without changing the actual notation.
diff --git a/docs/tests/examples.spec.ts b/docs/tests/examples.spec.ts
new file mode 100644
index 0000000..4fb7db8
--- /dev/null
+++ b/docs/tests/examples.spec.ts
@@ -0,0 +1,107 @@
+import * as fs from "fs";
+import * as path from "path";
+import { load } from "../../src/loader";
+
+const CONTENT_ROOT = path.resolve(__dirname, "..", "content");
+
+type Example = { file: string; id: string; body: string };
+
+function htmlFiles(dir: string): string[] {
+ const out: string[] = [];
+ for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
+ const full = path.join(dir, entry.name);
+ if (entry.isDirectory()) out.push(...htmlFiles(full));
+ else if (entry.name.endsWith(".html")) out.push(full);
+ }
+ return out;
+}
+
+function decode(s: string): string {
+ return s
+ .replace(/</g, "<")
+ .replace(/>/g, ">")
+ .replace(/"/g, '"')
+ .replace(/'/g, "'")
+ .replace(/&/g, "&");
+}
+
+// Drops commented-out regions, which never reach the browser and so are not examples. A single
+// regex replace leaves a dangling ``, and one that never closes
+// swallows the rest of the document.
+export function stripComments(html: string): string {
+ let out = "";
+ let cursor = 0;
+ while (cursor < html.length) {
+ const start = html.indexOf("", start + "".length;
+ }
+ return out;
+}
+
+function collect(): Example[] {
+ const out: Example[] = [];
+ for (const file of htmlFiles(CONTENT_ROOT)) {
+ const src = stripComments(fs.readFileSync(file, "utf8"));
+ for (const m of src.matchAll(/]*)>([\s\S]*?)<\/notation>/g)) {
+ const body = decode(m[2]).trim();
+ // The visual-tests page builds its elements from a Go range, so its body is a
+ // template rather than notation.
+ if (body.includes("{{")) continue;
+ const id = /id="([^"]*)"/.exec(m[1])?.[1] ?? path.basename(path.dirname(file));
+ out.push({ file: path.relative(CONTENT_ROOT, file), id, body });
+ }
+ }
+ return out;
+}
+
+const examples = collect();
+
+describe("stripComments", () => {
+ test("removes a comment and keeps what surrounds it", () => {
+ expect(stripComments("ac")).toBe("ac");
+ });
+
+ test("removes every comment in the string", () => {
+ expect(stripComments("abc")).toBe("abc");
+ });
+
+ test("drops the rest of the document when a comment never closes", () => {
+ expect(stripComments("atail")).toBe("tail");
+ expect(stripComments("ac