Skip to content
roomi fields

Composing with structure

Saṅgītaratnākara, OCR text

The text of the four volumes of the Adyar edition (1943-1953) of the Saṅgītaratnākara, read by OCR and published as text files.

archived last change 3 May 2026 licence CC-BY-SA-4.0

Source code

The scans of the Adyar edition of Śārṅgadeva’s Saṅgītaratnākara (13th century), with Siṃhabhūpāla’s Sudhākara commentary, are on archive.org; this repository gathers their text, one file per volume, so that it can be searched and processed. Its main limitation: this is raw OCR, not a critical edition; the text keeps its misreadings and print marks, and a quotation must always be checked against the printed book.

No demo: these are text files, readable directly in the repository.

One file per volume, in page order

FileVolumeChapters (adhyāya)YearSource of the text
vol1_ocr.txt1I, Svaragata1943archive.org OCR
vol2_archiveorg_ocr.txt2II to IV, Rāgaviveka, Prakīrṇaka, Prabandha1944archive.org OCR
vol2_custom_ocr.txt2the same1944OCR redone for this repository
vol3_ocr.txt3V and VI, Tāla, Vādya1951archive.org OCR
vol4_ocr.txt4VII, Nartana1953archive.org OCR

Volume 2 comes in two readings. The second, made with Tesseract 5.3.4 and its Sanskrit model, marks every page (=== PAGE N ===, 380 marks) and comes with vol2_metadata.json, which locates the 22 śruti, the 15 gamaka, the grāma, and the pages of the rāga and tāla catalogues. The README recommends the archive.org reading for quoting, the second one for finding a page.

Getting started

git clone https://github.com/roomi-fields/sangitaratnakara-ocr.git
cd sangitaratnakara-ocr
grep -n "रागाङ्ग" vol2_custom_ocr.txt

The search for rāgāṅga returns 19 lines, and the page mark before each one locates the passage. Rerun on 28 September 2026. The first line found also shows the limitation: “भाषा रागाङ्गाणि माषाङ्गाणि क्रियाङ्ाप्युपाङ्गानीति”, where माषाङ्गाणि is a misreading of भाषाङ्गाणि.

What it does

  • Provide the text of the four volumes, about 6.6 MB, the Sanskrit and its commentary.
  • Place every passage of volume 2 on its page, through the page marks.
  • Provide the reading pipeline for volume 2: extract_sangitaratnakara.py, under the MIT licence, reusable for another Sanskrit text.

Where it stands

Archived on GitHub, read-only; the content was published in a single day, on 3 May 2026.

Not done: splitting the text into entries, one rāga, tāla or karaṇa at a time; cleaning the stamps; comparison with the other recension, the one Kallinātha comments on in the Kalānidhi. According to its README, this text feeds the ICM project.

Repository · Volume 1 on archive.org · Volume 2 · Volume 3 · Volume 4

Thanks to the Adyar Library and Research Centre and to S. Subrahmaṇya Śāstrī, editor of these four volumes, to archive.org, which keeps the scans, and to the Tesseract project for its Sanskrit models.

How it was made. Claude Code (Claude Opus 5.5), from the repository, its README and its release notes. Method