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

@thinkridge/rlib-soundfont

v0.0.6

Published

SoundFont, FM, and PSG audio rendering for SMF/MIDI

Readme

@thinkridge/rlib-soundfont

SoundFont, FM, and PSG audio rendering for Web / Node.js, powered by WebAssembly.

Converts Standard MIDI Files (SMF) to WAV audio. Each track can be rendered through a SoundFont (.sf2), or through the built-in FM (YM2203/OPN) or PSG (SSG) chiptune synth engines — freely mixed within a single song.

Features

  • Works in both Node.js and modern browsers
  • Decode SoundFont (.sf2) files
  • Convert SMF (MIDI) → WAV audio
  • Built-in FM (YM2203/OPN) and PSG (SSG) synth engines, powered by the ymfm sound chip emulator
  • SoundFont, FM, and PSG tracks can be freely mixed within a single SMF
  • Powered by WebAssembly (fast and portable)
  • No external runtime dependencies

Demo

  • https://rlib-mml.thinkridge.jp/

    An interactive demo that lets you create, compile, and play MML entirely in the browser.
    Supports SoundFont, FM, and PSG based playback. No installation required.

Repository

  • Monorepo root
    https://github.com/thinkridge/rlib-Sounds

  • Package location (@thinkridge/rlib-soundfont)
    https://github.com/thinkridge/rlib-Sounds/tree/main/rlib-SoundFont/npmpackage

Installation

npm install @thinkridge/rlib-soundfont

Usage (Node.js)

import * as fs from "node:fs/promises";
import { RlibSoundfont } from "@thinkridge/rlib-soundfont";

const rlibSoundfont = new RlibSoundfont();
try {
  const sf2Binary = new Uint8Array(await fs.readFile("example.sf2"));
  const smfBinary = new Uint8Array(await fs.readFile("test.mid"));
  await rlibSoundfont.initSoundfont(sf2Binary);
  const wavBinary = await rlibSoundfont.smfToWav(smfBinary); // smf -> wav
} catch (e) {
  console.error(e);
} finally {
  rlibSoundfont.dispose();
}

Rendering SoundFont / FM / PSG tracks

No separate API is needed to use the FM/PSG engines — smfToWav() picks the renderer per track automatically, using the instrument named in each track's Track Name meta event (the same convention used by rlib-MML's CreatePort(instrument:...)):

  • "fm" — rendered with the built-in FM (YM2203/OPN) synth engine
  • "psg" — rendered with the built-in PSG (SSG) synth engine
  • any other name (including the default, unnamed track) — rendered with the SoundFont passed to initSoundfont()

A single SMF can freely mix SoundFont, FM, and PSG tracks. Custom voice presets can also be embedded in the SMF via rlib-MML's DefinePresetFM() / DefinePresetPSG() meta events.

License

MIT © Thinkridge Co., Ltd.

Notes

This package's WebAssembly build is compiled from the C++ core at rlib-SoundFont/src, which includes a vendored copy of the ymfm FM/PSG sound chip emulation library (https://github.com/aaronsgiles/ymfm) under rlib-SoundFont/src/ymfm. ymfm is released under the BSD 3-Clause License, Copyright (c) 2021, Aaron Giles. See rlib-SoundFont/src/ymfm/LICENSE for the full license text.

Build

This package is published with prebuilt artifacts. End users do not need emsdk or Docker.