Tetorica FM2612 (hello_ymfm_wasm)

Small browser-side demos, documentation, and reusable code for YM2612, ymfm, WebAssembly, and VGM playback.

Open For AI documentation

Goals

This repository has four goals:

This repository also provides YM2612 WebAssembly modules and JavaScript interfaces for browser-side use.

Repository: https://github.com/kyorohiro/hello_ymfm_wasm

These demos use ymfm by Aaron Giles under the BSD 3-Clause License.

Tetorica Tools (Genesis / Mega Drive)

YM2612 Playground Try a small JavaScript playground with play(), beat(), liveLoop(), and raw fm access. Try with Nuked-OPN2 →
YM2612 Synth Demo Try a small YM2612Synth keyboard with a guitar-like PC key layout and preset switching. Try with Nuked-OPN2 →
FM2612 VGM Analyzer Inspect parsed commands, watch 6 YM2612 channels, and export snapshot data or TFI patches. Sound chip support → Try with Nuked-OPN2 →

Tetorica Tools (Experimental: PC-98, Neo Geo)

Experimental OPN-family FM modes and a MIDI live coding app for macOS. Genesis / Mega Drive support remains the project's primary goal.

PC-98 Sound: YM2608 Experimental YM2608 FM mode for PC-98 style sound. FM is available now; SSG, Rhythm, and ADPCM-B will be added as dedicated APIs. Open PC-98 YM2608 Playground →
PC-98 Sound: YM2203 Experimental three-channel YM2203 FM mode for earlier PC-98 compatible sound. Open PC-98 YM2203 Playground (3 FM channels) →
Neo Geo Sound: YM2610 Experimental four-channel YM2610 FM mode for Neo Geo style sound. SSG and ADPCM-A/B will be added as dedicated APIs. Open Neo Geo YM2610 Playground →
Tetorica MIDI Playground Live-code MIDI melodies and loops in JavaScript. Connect this macOS app to GarageBand, a DAW, or a MIDI instrument. Download for macOS → View on itch.io →

Introduction

Demos

Sega Genesis / Mega Drive YM2612 FM Introduction with JavaScript

The YM2612 is the FM sound chip used in the Sega Mega Drive / Genesis. This repository focuses on learning the chip, understanding how ymfm exposes it, and replaying it in the browser.

Start here if you want pin notes, beep-oriented register notes, or VGM basics in browser-readable pages.

Embed YM2612 WASM in Web Apps and Games

This repository provides browser-side YM2612 and Sega PSG WASM files, JavaScript wrappers, a YM2612 synth layer, VGM playback support, a Genesis audio engine, and AudioWorklet-based output paths for Web sites, Web apps, and browser games.

Start here if you want to understand the runtime and embed YM2612 sound into a browser app or game.

Available Files

The browser-side implementation is split into small layers so that each part can also be used independently.

Releases: https://github.com/kyorohiro/hello_ymfm_wasm/releases

GitHub Releases is the primary download entry point for packaged wasm and browser-side runtime files.

web_runtime is this embeddable runtime, source file by source file (the files listed below). web_runtime_exsample is a runnable embedding sample bundle (the same runtime plus a few HTML demo pages) for a quick look at it working.

Examples and Documentation

YM2612Synth TFI / VGI import demo →

References

ymfm, libymfm.wasm, MAME, retropc.net, YM2612 pin reference, VGMPF YM2612, SpritesMind thread, chipmusic YM2612, DefleMask, GENajam, megatoy, Maple's Garden article, Aidan Lawrence's Sega Genesis video game music player, Zophar's Domain Genesis Music, SMS Power