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

@kongyo2/saens

v0.3.0

Published

Experimental library that splices an input audio's nearest-pitch segments into the notes of a reference MIDI file.

Readme

saens

入力音声そのものの断片を切り貼りして、同梱の元曲(元データ.mid + その原曲 2.wav)を 「無理やり歌わせる」——いわゆる空耳/人力系ミームの合成を自動化した実験的な TypeScript ライブラリです。

元曲(参照 2.wav)を MIDI ノート単位のスライスに区切り、各スライスについて、その区間の参照の 発音(音素)にスライス全体で最も似ていて MIDI ノート近傍のピッチを持つ入力位置を選び、そこから **入力の生サンプルをそのまま(verbatim に)**コピーして貼り付けます。出力は合成音ではなく 入力そのものの生スライスの寄せ集め(繋ぎ目だけ短くクロスフェード)。手作業の切り貼りと同じく、 入力全体を前後に飛び回って元曲へ並べ替えます。

発音の明瞭さは入力素材に依存します。 澄んだ(調波的な)声を入力にすると、選ばれる生スライスも 澄んだ音節になり発音がはっきりします。逆に broadband/ノイズ的な入力では発音の解像度は上がりません (=素材の物理的上限)。狙いは自然な歌唱ではなく、元ネタを生のまま元曲に強引に乗せる“無理やり感”です。

最小コマンド(npx)

npx @kongyo2/saens --audio input.wav --out output.wav

元データ.mid と、その原曲 2.wav はパッケージに同梱されます。--audio が切り貼りされる素材(声)で、 2.wav は歌詞・発音のガイド(合わせ先)として常に内部で使われます。

質感の調整

spliceAudioFromMidi のオプションで“発音(言葉の解像度) ⇔ 生スライス感”のトレードオフを振れます。

  • minSliceSeconds … スライスの最短長(既定 0.06)。
  • maxSliceSeconds … スライスの最長長(既定 0.12)。短いほど各スライスが参照の言葉に密着し発音寄り長いほど生の塊が大きく「元ネタそのまま感(verbatim)」が強い。
  • crossfadeSeconds … 繋ぎ目のクロスフェード長。短いほどスライスが生のまま(既定 6ms)。
  • pitchTolerance … MIDI 音程からどれだけ外れた入力まで許すか(オクターブ畳み込み・既定 2 半音)。