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

starry-midi-visualizer

v0.3.1

Published

基于 Node.js 开发的 MIDI 可视化渲染器,支持包括 Android 在内的多种平台。

Readme

StarryMidiVisualizer

基于 Node.js 开发的 MIDI 可视化渲染器,支持包括 Android 在内的多种平台。

Node.js npm GitHub

安装

准备工作

Windows / Linux / macOS

  1. 下载并安装 Node.js (最低 v18,建议使用 LTS 版本)。

  2. 安装 Yarn。

# 安装 Yarn
npm install -g yarn
  1. 下载并安装 FFmpeg,确保其在命令行中可用。
# 检查 FFmpeg 版本
ffmpeg -version

Android

  1. 下载并安装 Termux

  2. 在 Termux 中依次执行以下命令 (若加载速度过慢,请使用 termux-change-repo 更换国内源):

# 更新软件包
pkg update && pkg upgrade

# 安装必要的依赖和运行环境
pkg install openssl nodejs-lts python3 libpixman libcairo pango xorgproto libexpat ffmpeg

# 防止 node-gyp 报错
mkdir ~/.gyp && echo "{'variables':{'android_ndk_path':''}}" > ~/.gyp/include.gypi

# 安装 Yarn
npm install -g yarn

选择安装方式

全局安装 (推荐)

  • 提供命令行工具

  • 在任意目录下快捷使用

yarn global add starry-midi-visualizer

作为依赖 (尚未完善)

  • 安装到 Node.js 项目中

  • 通过 API 进行二次开发

yarn add starry-midi-visualizer

使用方法

全局安装后,可以使用 smvsmvc 命令。

若不提供参数,程序将会扫描并列出当前目录下的所有 .mid 文件以供选择。

Usage:
  smv [options] [arguments]

Options:
  -h, --help                 print help (this message)
  -v, --version              print version
  -r, --resolution <value>   output video resolution (default: 1920x1080)
  -f, --framerate <fps>      output video framerate (default: 60)
  --crf <value>              ffmpeg crf (default: 16)
  -o, --output <path>        output video file (default: <filename>.mp4)
  -b, --bgcolor <hex>        background color (default: 0x000000)
  -k, --keyh <pixels>        keyboard height (default: 156)
  -l, --line <hex>           shows a colored line on keyboard
  -c, --colormode <mode>     note color based on 'channel' or 'track' (default: channel)
  --border                   apply borders to notes and disable highlight
  -s, --notespeed <ratio>    pixPerTick = vHeight / 2 / TPQN * <ratio> (default: 1)
  -t, --starttime <seconds>  set the start time offset (default: -1)
  -d, --duration <seconds>   set the cut duration

Examples:
  smv song.mid
  smv -r 2560x1440 -k 208 -s 1.5
  smv song.mid -b 0xC0C0C0 --border -o ../Videos/song.mp4
Usage:
  smvc [options] [arguments]

Options:
  -h, --help                 print help (this message)
  -v, --version              print version
  -r, --resolution <value>   output video resolution (default: 720x60)
  -f, --framerate <fps>      output video framerate (default: 60)
  --crf <value>              ffmpeg crf (default: 16)
  -o, --output <path>        output video file (default: <filename>_counter.mp4)
  -F, --font <path>          the font file to use
  -a, --align <hex>          text align (default: left)
  -c, --txcolor <hex>        text color (default: 0xFFFFFF)
  -b, --bgcolor <hex>        background color (default: 0xA0A0A0)
  -w, --bdwidth <pixels>     border width (default: 2)
  -B, --bdcolor <hex>        border color (default: 0x252525)
  -t, --starttime <seconds>  set the start time offset (default: -1)
  -d, --duration <seconds>   set the cut duration

设置内存限制

Node.js 默认的内存限制在 1 GB 左右,能够加载约 800 万音符的 MIDI 文件。设置环境变量可以提升此限制。

以下命令设置的环境变量只在当前 Shell 窗口有效。若需要永久生效,请使用 setx 命令 (Windows) 或是修改配置文件。

Windows

# 设置内存限制为 8192 MB
set NODE_OPTIONS="--max-old-space-size=8192"

Linux / macOS / Android

# 设置内存限制为 4096 MB
export NODE_OPTIONS="--max-old-space-size=4096"

API 参考

🤔