Sound Emulation Foundry - ppmckc ed.
ブラウザだけで動くファミコン(RP2A03)+拡張音源のMML制作環境。あわせて
NSF / NSFe / SPC / KSS / GBS / HES / VGM / PSF の再生・可視化・MML変換ができる。
MMLコンパイラ・6502アセンブラ・NSFジェネレーター・各音源のエミュレータはすべて自前のJavaScriptで、
外部ライブラリを使っていない。index.html をブラウザで開けばそれだけで動く
(ローカルに置いた file:// 直開きでも、静的サーバーに置いても同じ)。
名前の「ppmckc ed.」は、MMLの方言とNSF書き出し用サウンドドライバをファミコン用MMLコンパイラ
ppmck / ppmckc に合わせてあることを指す。ppmck そのものの移植や派生ではなく、
仕様を実測で確かめながら書き起こした別実装で、独自に拡張した部分もある
(どのコマンドが ppmck 由来でどれが独自拡張かは、MMLコマンドヘルプと
src/mml/compiler.js の冒頭に全部書いてある)。
MMLを書きながら、音量・音色・ピッチ・ノートの4種類のエンベロープを1画面で編集する。
鳴らすと、チャンネルごとの音程・音量・波形とピアノロールが演奏に同期して動く
(曲は2A03だけで書いたオリジナル「星間航路」)。
できること
- MMLで作曲して
.nsf を書き出す — ppmck方言のMML。2A03の5ch(パルス×2・三角波・ノイズ・DPCM)に加えて
VRC6 / VRC7 / MMC5 / N163 / SUNSOFT 5B / FDS に対応する。エンベロープ(@v @vr @@)、
ピッチ系(EP MP PT PS s)、ノートエンベロープ(EN)などのppmck拡張コマンドも
ブラウザ再生とNSF書き出しの両方で動く。バンク切り替え対応なので4KBを超えるチャンネルも書ける
- 実機の曲を読んで聴く — NSF / NSFe / SPC / KSS / GBS / HES / VGM / PSF(PlayStation、PSF1)。zip・7z・RAR(SPC曲集の .rsn を含む)・LZH/LHA・gzipの中身も開ける。
CPUと音源をエミュレートして鳴らすので、曲送り・シーク・早送り・ch単位のミュートと音量調整ができる
- ゲームを遊びながら録音する — 自前のファミコン(.nes/.fds)と MSX(.rom/.mx1/.mx2/.dsk。MSX1〜MSX2+、turbo R は実 BIOS が要る)の
エミュレータをブラウザの中で動かし、遊んでいる最中のサウンドレジスタの書き込みを VGM に録る。効果音や処理落ちの入った「ゲームを使った演奏」を
そのまま残せるし、変換設定の「録音の補正」で曲だけにもできる。鍵盤表示・ピアノロールは演奏中も追随し、巻き戻し(逆再生)・状態保存・早送りがある。
MSX は C-BIOS を同梱しているのでカートリッジ ROM はそのまま遊べる(ディスクと turbo R は実 BIOS を [BIOS] で控える)。
zip/7z/RAR/LZH の中の ROM やディスクもそのまま開け、複数枚のディスクは 1 台にまとまって [disk] で枚数と面を選べる
- 鳴っている音を見る — 鍵盤表示とピアノロールが、チャンネルごとの音程・音量・音色・
波形・使用中のPCMサンプルを演奏に同期して描く
- 読んだ曲をMMLへ変換する — 解析・学習・自分用アレンジの下地に。「MMLへ変換」で、鳴っているレジスタ列からMMLを起こす。
借用先チャンネルの割り当て(1つのパートを複数chで交互に鳴らす曲は、それらを1パートに「まとめる」指定、
逆に1つのchを別の借用先へも載せる「複製」(移調・デチューン・遅延つき)もできる)、
同じ音符列のチャンネルを
AB c4 の共通行で書く出力書式(変換設定)、
基準ピッチの自動検出、エンベロープとビブラートの抽出、
PCMのDPCM化までを通しで行う。変換の細かさは「⚙ 変換設定」で選べる
- 音色と波形を編集する — FDS波形・N163波形・VRC7 FM音色・4種のエンベロープ・
DPCMサンプルに、それぞれ専用のエディタがある
- 演奏して打ち込む — PC鍵盤と画面のピアノで音を出し、そのまま録音してMMLにできる。
メトロノーム付き
- 聴音(鼻歌・楽器の単音をMMLに) — マイクか音声ファイルの単旋律をピッチ検出して音符にする。
声/楽器のプリセットと、区切り・検出のしきい値をスライダーで調整でき、取り込んだ音はWAVで保存できる
- 音声ファイルに書き出す — WAV / FLAC / AAC
- 動画にする — ピアノロール+鍵盤+MMLエディタ(色分け・再生ハイライト・追随)の絵つきで MP4(H.264 + AAC)。
X などにそのまま貼れる。画面構成・解像度・向きは選べる。ファイル再生(NSF/SPC/KSS/GBS/HES/VGM/PSF)も
ロール+鍵盤で出せる(Chromium系ブラウザ)
- 楽譜にする — MusicXML書き出しと五線表示
- 外部エディタで書く —
.mml をディスク上の正本にして、VS Code や秀丸などで編集できる。
保存すると約1秒で取り込まれる
- 表示・MMLコマンドリファレンスとも日本語と英語
English
Sound Emulation Foundry - ppmckc ed. is a browser-based music workstation for the
Famicom / NES sound hardware (RP2A03) and its expansion chips. No build step, no external
libraries: open index.html in Chrome or Edge and it runs, either from a local file://
path or from any static server.
- Compose in MML and export
.nsf. The MML dialect and the exported NES sound driver
follow ppmck / ppmckc. Five 2A03 channels (2 pulse, triangle, noise, DPCM) plus
VRC6 / VRC7 / MMC5 / N163 / SUNSOFT 5B (FME-7) / FDS, with the ppmck extension commands
(@v @vr @@ EP MP PT PS s EN ...) working both in browser playback and
in the exported NSF. Bank switching is supported, so a channel may exceed 4 KB.
- Play chiptune files. NSF / NSFe / SPC / KSS / GBS / HES / VGM / PSF (PSF1), including
files inside zip / 7z / RAR (including .rsn SPC sets) / LZH / gzip. The CPU and the sound chips are emulated, so you get track
select, seeking, fast-forward, and per-channel mute and volume.
- Record while you play. Built-in Famicom/NES (.nes/.fds) and MSX (.rom/.mx1/.mx2/.dsk;
MSX1 to MSX2+, turbo R needs a real BIOS) emulators run inside the browser and record the
sound-register writes of your play session to VGM, sound effects and slowdown included
(or cleaned up to the music alone by the conversion settings). Rewind, save states and
fast-forward are there; MSX cartridges run on the bundled C-BIOS. ROMs and disks inside
zip / 7z / RAR / LZH open directly, and multi-disk sets go into one drive with a disk/side picker.
- See what is playing. A keyboard view and a piano roll draw pitch, volume, timbre,
waveform and the PCM sample in use for every channel, in sync with playback.
- Convert a song back into MML. The register writes are turned into MML: channel
assignment, reference-pitch detection, envelope and vibrato extraction, and PCM-to-DPCM
conversion.
- Edit tones and waveforms. Dedicated editors for FDS waves, N163 waves, VRC7 FM tones,
four kinds of envelope, and DPCM samples.
- Play it in. A PC-keyboard and on-screen piano with a metronome; record what you play
straight into MML.
- Export audio as WAV / FLAC / AAC, and sheet music as MusicXML.
- Export video as MP4 (H.264 + AAC) with the piano roll, keyboard and the highlighted MML
editor on screen, ready to post on X. Layout, resolution and orientation are selectable
File playback (NSF/SPC/KSS/GBS/HES/VGM/PSF) exports with the roll and keyboard
(Chromium-based browsers).
- Link to a song. Opening the app with
?nsf=<file address>&song=<n> loads that file,
so an app URL plus a file address makes one shareable link. Nothing is hosted here: the
visitor's browser fetches the address directly, which means the host has to allow CORS
(GitHub raw and Gist both do). Playback still needs one press of ▶, because browsers do
not let it start on its own.
The interface, the bundled sample MML and the in-app MML command reference are all available
in Japanese and English. The documentation in this repository is Japanese only.
This is the beginning of the README. Read the rest at the original. Read the full README ↗