npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

tonus

v0.1.8

Published

Medieval music analysis and performance: GABC plainchant exports, liturgical calendar, tuning systems, ephemeris, and the harmony of the spheres

Downloads

1,161

Readme

tonus

tonus is a medieval music and cosmology library. It covers:

  • pitch, tuning, hexachords, and the eight church modes
  • the liturgical calendar, the feast of the day, and mass selection
  • the chant repertoire in GABC: propers, ordinary, office, and psalm tones
  • chant rhythm and performance shaping, rendered to MIDI or MusicXML
  • planetary positions voiced as tuned pitch across the classical theorists' "harmony of the spheres"

tonus is implemented in TypeScript and its API is a single namespace of methods. Every result is deterministic: the same query returns the same answer, computed locally from data that ships with the package, with no network calls.

Install

npm install tonus

ESM only. Node ≥ 20; works in the browser through a bundler. No runtime dependencies. Roughly 5,500 chants and the full 642-entry calendar ship in the package — 6.5 MB unpacked, 1.5 MB packed.

Documentation

One page per engine, in dependency order. Each page states its rules, then its theory and historical context, then its sources.

  • Index — Table of contents and conventions.
  • Tuningtemperamentum. The medieval pitch system: temperaments, Guidonian gamut and hand, hexachordal solmization and mutations, eight modes, and psalm tones. Depends on nothing else in the library.
  • Calendarfestum, pascha. The Tridentine liturgical calendar resolved against dual-computus Easter: feasts with their authentic ranks, grades, and seasons, and the movable anchors of any year.
  • Chantcantus, proprium, ordinarium, officium, psalmus. The Solesmes books in GABC: Mass propers, the Kyriale, the Office hours, the psalter.
  • Scorenotatio. GABC into tuned notes: phrases, syllables, Solesmes arsis/thesis rhythm, prosody, the analytic imprint.
  • Heavenscaelum, harmonia. An ephemeris computed from JPL orbital elements, voiced through the planetary doctrines of Boethius, Nicomachus, Pliny, and Ptolemy.

These pages are the middle of a three-level ladder: the API docs here link down into the code, where the full theory, provenance, and editorial reasoning live in comments beside what they explain. Read as deep as you care to. Sources for concepts, scholarship, and data are listed in BIBLIOGRAPHY.md; where sources disagree or run out, tonus makes an editorial call, recorded in the code and glossed in the page's Theory & Context section.

The tuning engine

The tuning engine is self-contained; every other engine resolves its pitches through it.

import tonus from "tonus";

const t = tonus.temperamentum({ mode: 1 }); // Pythagorean, mode 1

t.nota("D4");
// 293.33 Hz — the final of mode 1, tuned through pure fifths

t.gradus("D4");
// Delasolre: RE of the natural hexachord, role "finalis",
// middle finger, base joint, on the Guidonian hand

t.intervallum("D4", "A4");
// Quinta (alias Diapente), perfect — final to tenor

t.tonus();
// psalm tone 1, differentia 1g:
// intonatio F3–A3–C4, mediatio C4–A3–G3–A3, terminatio C4–A3–G3–A3–G3

The liturgical stack

The remaining engines compose:

const [feast] = tonus.festum({ date: new Date("2026-12-25") });
// nomen: "In Nativitate Domini", ritus: "Duplex I classis",
// grade: "duplex-i", tempus: "Tempus Nativitatis"

const [introit] = tonus.proprium({ feast, office: "in" });
// "Puer natus est", mode 7, GABC from the Liber Usualis

const score = tonus.notatio(introit, { temperamentum: t });
// phrases, syllables, tuned pitches, arsis/thesis rhythm, prosody, imprint

const harmony = tonus.harmonia(tonus.caelum({ date: feast.date }));
// each visible planet voiced as pitch and Greek vowel, after Boethius

Development

npm test          # builds and runs the suite (node --test)

The data files in src/data/ are generated by a separate extraction pipeline (tonus-corpus). Edits happen there, not here.

License

MIT. Chant and liturgical data derive from GregoBase and Divinum Officium; see BIBLIOGRAPHY.md for full attribution.