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)
\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. This is commonly used to notate first speed (1-2 notes per beat), second speed (4 notes per beat), and third speed (8 notes per beat) in Carnatic music.
\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 |