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

jianpu-pitch

v0.1.0

Published

Offline numbered-music pitch helpers: scale degrees to MIDI, note names and frequencies. By 简谱小站.

Readme

jianpu-pitch

Small, offline pitch helpers for numbered music notation (简谱). Convert a scale degree to a MIDI note, a chromatic note name, or a frequency. No dependencies, network requests, song database, or account required.

Made for the 简谱小站 — clear, A4-printable numbered scores companion pitch tool.

Install

npm install jianpu-pitch

Example

import { degreeToMidi, midiToFrequency, midiToNoteName, parseDegrees } from 'jianpu-pitch';

const midi = degreeToMidi(6, { key: 'C' }); // 69
midiToNoteName(midi);                      // 'A4'
midiToFrequency(midi);                     // 440
degreeToMidi(1, { key: 'G' });              // 67 = G4
degreeToMidi(0);                           // null (rest)

const notes = parseDegrees("1 2 #4 | 5 1' 6, 0");
const pitches = notes.map(({ degree, ...modifiers }) =>
  degreeToMidi(degree, { key: 'D', ...modifiers })
);

Conventions

  • 1 is the tonic named by key; 1=C starts on C4 by default, 1=G on G4. tonicOctave changes that scientific-pitch octave. octave shifts it by -3 to +3 octaves.
  • Degrees 1 through 7 use the intervals 0, 2, 4, 5, 7, 9, 11 semitones. 0 is a rest. accidental is -1, 0, or 1.
  • parseDegrees accepts whitespace/bar-separated degrees, optional #/b (also ♯/♭), and one to three apostrophes for upper octaves or commas for lower octaves. Example: 1', 6,. It does not infer minor keys, rhythm, lyrics, dots, ties, or complete scores. A bar is only a separator. Accidentals affect one token only.
  • midiToNoteName uses chromatic sharp names (A#, not Bb), not contextual enharmonic spelling.
  • Equal temperament, A4=440 Hz by default. Invalid input throws. MIDI range: 0–127; input limit: 128 notes / 4096 characters.
  • ESM and TypeScript declarations. Node 18+ and modern browsers.

中文说明

这是一个独立的小型音高工具。可以将简谱级数换算为 MIDI 音高、音名和频率,适合做唱谱练习、音高按钮和教学小工具。它不识别图片、不搜索歌曲、不包含网站的处理流程,也不是完整简谱解析器。

找谱、预览标准版和大字版、了解 A4 打印,请访问 简谱小站官网。

License

MIT. This license covers this package only.