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

@r_masseater/song-format

v0.2.7

Published

The .fumx song format: a reader that turns a song into a typed value, key and chord analysis, import from TypeScript with Vite, a language server, MIDI and Ableton Live Set conversion that checks the result against the original, and a song report.

Readme

@r_masseater/song-format

Tooling for .fumx songs: import a song from TypeScript with Vite, edit it with a language server, convert a MIDI file to .fumx with a check against the original, and print a report of its keys, chords and repeated bars.

It requires Vite+ and Node.js 26 or later. effect and vite-plus are peer dependencies. It also holds the grammar and the reader of .fumx.

vp add @r_masseater/song-format effect vite-plus

Read a song

import { readSong } from "@r_masseater/song-format";
import { Effect } from "effect";

const text = `song "lint me"

instrument lead sample "lead.flac" root C4

track lead instrument lead

bar meter 4/4 tempo 120bpm {
  lead: C4 1/4, E4 1/4, B5 1/2 vel 0.9
  lead.cc 64: 127 1/2, 0 1/2
}
`;

const source = await Effect.runPromise(
  readSong({ path: "/song.fumx", read: () => Effect.succeed(text) }),
);
if (source.status === "valid") {
  const tooHigh = source.song.notes.filter((note) => note.midi > 79);
}

readSong follows import statements through read, so the files can come from disk, memory or a network. An invalid file gives issues with a path, line and column. The messages are in Japanese. outline.comments lists the // and /* */ comments of the entry file with their line and column, so tools such as linters can read directives from them.

Times are integer ticks, TICKS_PER_WHOLE to a whole note; fractionOf prints them as 1/4. @r_masseater/song-format/analysis estimates what the notes imply but the file does not write: the key of a range of bars (keyIn), the chord on each beat (chordsOf) and bars that repeat. analyze returns all of them for a song, and soundingsOf lists the notes of unmuted tracks with their track role, source line and column, and the spelling and pitch class as written. Chord names follow that spelling, so E G C is CM/E, not Em#5.

@r_masseater/song-format/language exports the Langium grammar and modules for editors and language servers.

Import a song

Add the Vite plugin. TypeScript then reads a compiled song as a value.

import { fumx } from "@r_masseater/song-format/vite";
import { defineConfig } from "vite-plus";

export default defineConfig({ plugins: [fumx()] });
import { song } from "./song.fumx";

The plugin writes song.d.fumx.ts next to each song. For the TypeScript server to follow the import, list the package as a content mapper in tsconfig.json.

{
  "compilerOptions": { "allowArbitraryExtensions": true },
  "contentMappers": [{ "package": "@r_masseater/song-format", "extensions": [".fumx"] }]
}

Commands

song-report <file> prints, as JSON, the keys, chords and repeated bars derived from a song file. A reader that cannot listen to the song checks what was written from this output.

midi-to-fumx <file> converts a Standard MIDI File to .fumx. It reads the written .fumx back, compares it with the events of the original MIDI, and fails if even one differs.

fumx-language-server serves the .fumx language over stdio for editors.

vp exec song-report song.fumx
vp exec midi-to-fumx song.mid

Convert from code

import { midiToFumx } from "@r_masseater/song-format/convert-midi";

midiToFumx takes a parsed MIDI file and returns the .fumx text. compareWithMidi reports how the written song differs from the original.

Agent skills

The package ships agent skills in skills/. Add permissions: { "@r_masseater/song-format": { skills: true } } to pnpm-workspace.yaml and vp install links them into the skill directories of your agents.

License

MIT