# Make your own tunes

Compose a short melody on the swara pad, add rests and note lengths, then play it against your Sa, drone, and metronome.

This is a **scratch pad**, not a numbered home-path step. Use it after you know the swaras from Practice. Open the interactive page: [tunes.html](tunes.html).

## Quick start

1. Pick **Sa** in the bottom bar. Choose a **duration** in the toolbar, then tap keys or type tokens.
2. Put each vibhāg between `|` barlines — e.g. `| Sa Re Ga Ma |`. Beat counts and taal marks (X, 0, 2…) show in the preview.
3. Set **Taal** and **Start on beat** (sam = 1; many Teentaal bandishes start on beat 9). Press **Play** — with Metro on, playback waits for that matra.
4. Rest is `_` (never `R`). Bandish words: `Dha:Su`. Toolbar: `| bar`, `{} murki`, `// note`, `||:` … `:||` for repeats.

Quarter note = 1 beat at the current BPM. Tone, drone, and BPM follow the same bottom bar as Practice.

## Examples

Paste into the score box, or press **Example** on the harmonium for a full bandish (Teentaal, start beat 9).

**1 — Barlines, holds, and dugun** (Teentaal)

```
| Sa- Re [Ga Ma] | Pa Dha Ni Sa |
```

**2 — Ornaments** — kan `^ga`, meend `~`, murki `{ … }`, phrase slur `( … )`

```
| ^ga Ma Pa |
Sa~Re~Ga {Sa Re Ga} ( Dha:Su Ni:mi Pa:na )
```

**3 — Bandish sketch** — lyrics with colons; `||:` … `:||` plays twice

```
// mukhda — Teentaal, often khālī on beat 9
Dha:Su Ni:mi Pa:na | Ma:ja Ga:ga Re:re Sa:ga
// antara
||: Sa:aa Re:re Ga:ga Ma:ma :||
Pa/8:Pa Dha/8:dha Ni/8:ni Sa'/8:sa
```

**4 — Durations and rests**

```
Sa/2 Re Ga/8 Ma/8 Pa
Sa _ Re _ Ga Ma
||: Sa Re Ga Ma :||x3
```

## Syntax

One token per note or rest, separated by spaces. Preview marks: [Bhatkhande legend](#bhatkhande-legend). Hold vs rest: [Dashes & dugun](#dashes--dugun--what-the-preview-means).

| Token | Meaning |
|---|---|
| `Sa` `Re` … `Ni` | shuddha swara — quarter (1 beat) unless you add a duration |
| `re` `ga` `dha` `ni` | komal (lowercase) |
| `Ma#` or `ma` | tivra Ma |
| `.Sa` `Sa,` / `Sa'` `Sa.` | mandra / taar — dot after name (no slash) is octave, not dotted rhythm |
| `Sa/2` `Sa/1` `Sa/8` `Sa/16` | half · whole · eighth · sixteenth — append `.` after the number to dot (× 1.5) |
| `Sa-` `Sa--` … | hold shorthand — same as `Sa/2`, `Sa/2.` … |
| `_` or lone `-` | rest — preview shows **-** with no swara above |
| `[Sa Re]` `Sa&Re` | dugun shorthand — same as `Sa/8 Re/8` |
| `\|` | barline — taal marks and beat meter per vibhāg |
| `\|\|:` … `:\|\|` | repeat phrase twice (`:\|\|x3` three times) |
| `// mukhda` `"slide"` | comment — shown, not played |
| `Sa:Su` | bandish syllable under the swara (`Sa:_` for held syllable) |
| `( Sa Re Ga )` | phrase slur — wide curve, several full matras (preview only) |
| `{ Sa Re Ga }` | murki — quick cluster in one matra |
| `^Ga` `Ma^Ga` | kan — grace swara before the main note |
| `Sa~Re~Ga` | meend — glide; `~` after each linked swara |

Never use `R` for rest — that is Re.

## Dashes & dugun — what the preview means

The preview uses **-** in two ways. What you *type* is not always a literal dash.

### Hold the same swara (continue — do not re-attack)

A dash **under the same swara** means keep singing this pitch for another matra.

| You type | Preview | Matras |
|---|---|---|
| `Sa` | **Sa** | 1 |
| `Sa/2` or `Sa-` | **Sa -** | 2 — half |
| `Sa/2.` or `Sa--` | **Sa - -** | 3 — dotted half |
| `Sa/1` or `Sa---` | **Sa - - -** | 4 — whole |

Shorthand: append `-` after a bare swara (no `/duration`) — each `-` adds one held matra.

### Rest (silence)

A dash **with no swara above it** is a **rest**. Type `_` or a lone `-` token.

| You type | Preview | Matras |
|---|---|---|
| `_` or `-` | **-** | 1 silent |
| `_/2` | **- -** | 2 silent |
| `Sa _ Re` | **Sa** · **-** · **Re** | note · rest · note |

### Dugun, tingun, chaugun (several events in one matra)

When two or more swaras share **one beat**, the preview draws a **tight bow** with **$** (chhand) underneath.

| Name | Per matra | Type (any one) |
|---|---|---|
| **Dugun** | 2 | `Sa/8 Re/8` · `[Sa Re]` · `Sa&Re` · `_/8 Pa/8` |
| **Tingun** (tigun) | 3 | `Sa/8 Re/8 Ga/8` · `[Sa Re Ga]` · `Sa&Re&Ga` |
| **Chaugun** | 4 | `Sa/16 Re/16 Ga/16 Ma/16` · `[Sa Re Ga Ma]` |

**Not the same as:** phrase slur `( … )` (several full matras); murki `{ … }` (one matra, dashed box); meend `Sa~Re` (arc above).

## Bhatkhande legend

What the preview draws when you type tokens like `Sa/2`, `_`, `Sa/8` — not staff notation.

### Swaras

| Preview | Meaning | Type |
|---|---|---|
| Sa Re Ga Ma Pa Dha Ni | shuddha, one matra each | `Sa Re Ga Ma Pa Dha Ni` |
| <u>re</u> <u>ga</u> <u>dha</u> <u>ni</u> | komal — underline | `re ga dha ni` |
| Ma with stroke above | tīvra Ma | `Ma#` or `ma` |

### Saptak (octave)

| Preview | Meaning | Type |
|---|---|---|
| Sa with two dots below | ati-mandra | `Sa,,` or `..Sa` |
| Sa with one dot below | mandra | `Sa,` or `.Sa` |
| Sa with no mark | madhya | `Sa` |
| Sa with one dot above | tār | `Sa'` or `Sa.` |
| Sa with two dots above | ati-tār | `Sa''` or `Sa..` |

### Matra (duration)

Hold vs rest dashes: [Dashes & dugun](#dashes--dugun--what-the-preview-means).

| Preview | Matras | Type |
|---|---|---|
| Sa | 1 — quarter | `Sa` or `Sa/4` |
| Sa - *(short dash)* | 1½ — dotted quarter | `Sa/4.` |
| Sa - | 2 — half | `Sa/2` |
| Sa - - | 3 — dotted half | `Sa/2.` |
| Sa - - - | 4 — whole | `Sa/1` |
| - | 1 silent (rest) | `_` |
| - - | 2 silent | `_/2` |

### Dugun, tingun, and chaugun

| Preview | Meaning | Type |
|---|---|---|
| Sa Re with bow + $ | dugun — two share one matra | `Sa/8 Re/8` · `[Sa Re]` |
| Sa Re Ga with bow | tingun — three share one matra | `[Sa Re Ga]` |
| Sa Re Ga Ma with tighter bow | chaugun — four share one matra | `[Sa Re Ga Ma]` |

### Ornaments & taal marks

| Preview | Meaning | Type |
|---|---|---|
| X / 2 / 0 / 3 above first swara | taal marks per vibhāg | `\|` + taal picker |
| small ga above Ma | kan | `^ga` · `Ma^ga` |
| Sa Re Ga with arc above | meend | `Sa~Re~Ga` |
| dashed box “murki” | quick cluster | `{ Sa Re Ga }` |

### Bars, lyrics, and repeats

| Preview | Meaning | Type |
|---|---|---|
| Sa \| Re | vibhāg | `\|` |
| ( Sa Re Ga ) curved under | phrase slur | `( Sa Re Ga )` |
| \|\|: Sa Re :\|\| | repeat twice (*do bār*) | `\|\|: … :\|\|` |
| mukhda label | comment | `// mukhda` or `"slide"` |
| Dha / Su under it | bandish syllable | `Dha:Su` |
| · under a hold | held syllable | `Sa:_` |

## How to use

1. Pick **Sa** (C2–B4). Same key as Practice.
2. Harmonium above the preview; taal marks and bar counts around the score. Type in the box at the bottom.
3. **Play** scrolls the preview to the sounding matra. Pad lights only during playback.
4. **Save locally** for a `.txt` you can move between devices. **Save in browser** for this browser only.

## Where tunes live

**On this site** — author’s library in `tunes-library.json` (GitHub). Play only; visitors cannot edit it.

**Save locally** — `.txt` download; **Load from disk** reopens it. On iPhone/iPad use Share → Save to Files.

**Save in browser** — `localStorage` only (`singing-tunes-v1`). Cleared with site data or on another device.

**Copy score** copies the text if you prefer to paste it yourself.
