Commands Reference
Complete reference for all notation commands
Commands control the behavior and layout of notation. This page provides a complete reference for all available commands.
Command Syntax
Commands start with a backslash and use parentheses for parameters:
\command
\command(value)
\command(param1, param2)
\command(param1, key=value)
Declaring Defaults in Front Matter
A song's tala, speed and line breaks usually hold for the whole song. Front matter can declare them once, as data, instead of as commands at the top of the body:
---
title: "Kunda Gowra"
ragam: "Malahari"
cycle: "|3|"
beatDuration: 2
breaks: 6
---
Sw: s , r m p , d p m p d p
- cycle, beatDuration and breaks take the
same values as
\cycle(...),\beatDuration(...)and\breaks(...).breakstakes one number or a list, such as[8, 8]. The keys match in any case. - They apply before the body, so a command in the body still overrides them.
- For a part of the song with a different tala or speed, wrap it in a block:
\section("Charanam") { \beatDuration(4) ... }. The change ends with the block. - A value the command would reject shows as a parse error naming the key.
- Front matter is one
key: valueper line. A value is a quoted or plain string, a number,true,false,null, or a list on one line such as[8, 8]. Nested values,- itemlists and multi-line strings show as a parse error naming the line.
\beatDuration Command
Sets how many notes fit in one beat. This is the primary way to control the "speed" of notation.
Syntax
\beatDuration(number)
Parameters
- number - Positive integer (default: 1)
Examples
Notes
Beat duration affects how notes are laid out in beats. At beatDuration(4), four notes occupy one beat. Speeds in Carnatic music double from a composition's first speed, so to notate them, double \beatDuration for each one: 1, 2 and 4, or 2, 4 and 8.
\cycle Command
Defines the rhythmic cycle (tala) for the notation. A cycle consists of multiple bars, each with a specified number of beats.
Syntax
\cycle("pattern")
Pattern Format
The pattern is a string with pipe-separated numbers representing beats per bar:
"|beats1|beats2|beats3|"
Examples
Common Talas
- Adi:
"|4|2|2|"(8 beats) - Rupaka:
"|2|4|"(6 beats) - Misra Chapu:
"|3|2|2|"(7 beats) - Khanda Chapu:
"|2|3|"(5 beats)
Notes
Each bar in the cycle can have different numbers of beats. The cycle repeats throughout the composition. Bars are associated with hand gestures (kriyas) that performers use to keep time.
\line Command
Creates a new line in the notation.
Syntax
\line
\line(marginText)
\line(marginText, offset=value)
Parameters
- marginText - Optional text to display in the margin
- offset - Optional offset for the line (fraction or number)
Examples
\role Command
Creates a new role for organizing different types of content.
Syntax
\role(name)
\role(name, notes=true)
\role(name, notes=false)
Parameters
- name - Name of the role (string)
- notes - Whether the role contains only notes (true) or also syllables (false). Default: false
Examples
Built-in Roles
- Sw - Swaras (notes), created by default
- Sh - Sahitya (lyrics), created by default
\breaks Command
Sets line break patterns for the layout.
Syntax
\breaks(num1, num2, num3, ...)
Parameters
- List of integers representing where to break lines
Example
\layout Command
Saves or applies a named layout configuration. This allows grouping sections with identical layout parameters.
Syntax
\layout(name)
Parameters
- name - Name of the layout (string)
Example
Notes
The first use of a layout name creates and saves it. Subsequent uses with the same name apply the saved configuration, even if the cycle, beatDuration, and breaks are identical.
Command Summary Table
| Command | Purpose | Parameters |
|---|---|---|
\beatDuration |
Set notes per beat | number |
\cycle |
Define tala pattern | pattern string |
\line |
Create new line | marginText?, offset? |
\role |
Create custom role | name, notes? |
\breaks |
Set line breaks | numbers... |
\layout |
Save/apply layout | name |