About me

  • FamiTracker orchestrator [youtube.com]
  • Failed composer Composer on hiatus
  • Failed programmer Amateur programmer
  • Temporarily obsessed with the code of FamiTracker
  • I made this page just for the FamiTracker thing actually

NSF to FamiTracker decompiler: a brief history
based on what little information I could find on my own

If you're here, you already know FamiTracker can export NSF files. [nesdev.org]

Generic NSFs can be imported to FamiTracker by playing them one frame at a time and translating sound registers to FamiTracker notes and commands. This is what nsfimport by rainwarrior does. [rainwarrior.ca]

NSFs compiled with FamiTracker have a recognizable format that can be decompiled almost exactly back to the original module (minus names, bookmarks, unused patterns and samples, and sample mappings).
This is what NSF Decompiler by goluigi/golgi does for modules made with 0cc-Famitracker 0.3.11 or earlier. [forums.famitracker.com via the Wayback Machine]

As of writing, 0cc-FamiTracker 0.3.11 is 9 years old and FamiTracker has had 34 new releases across 3 different branches (0cc, j0cc and Dn). [github.com]

The format hasn't changed much, but the driver (needed to find the data) has; and now that the Famitracker forums are offline and an update by goluigi/golgi is unlikely, the full version of this bit of history lives on only in the memory of older FamiTrackers, and any evidence is tucked away in archives such as ChipJockey's FamiTracker Archive. [twitter.com, drive.google.com]

NSF decompiler

Anyway I wrote a NSF-to-FT decompiler that should work for modules exported with 0cc 0.3.13 or later, up to Dn 0.5.0.2.
It's written in javascript and runs locally (no server uploads/downloads) on any modern browser (tbh I only tested it on firefox)
It comes with a general FamiTracker reader compatible with all modules up to Dn 0.4.0.1, and an exporter that targets Dn 0.4.0.1.

Source:
explain.txt: somewhat detailed explanation (WIP)
linearBuffer.js: general binary file reading
ftText_v1.js: parses a FamiTracker text export
ftModule_v1.js: reads and writes a FamiTracker module
ftNsf_v1.js: reads an NSF file and decompiles it if possible


So that's the page. That's the NSF to FamiTracker decompiler. That's just changing data from one format to another, nothing fancy.

I mean, it would be nice if I played the module back to you...

In-browser FamiTracker player

So here's why I've been barely making music from fall 2022 to the start of 2024.
apuWorklet_bigfile.js
I started this when Firefox wouldn't accept "import"s in audio worklets, that's why it's a monstrous all-in-one file.
An emulator of all Famicom audio chips I know of what's a VT02+? never heard of it written in javascript.
( I made a test page for it, but it's horribly patched together.)

Source for the rest of the player:
channel.js
ftfx.js
instrument.js
writer.js
channel2a03.js
channeldpcm.js
channelvrc6.js
This is an ongoing recreation (not a straight port) of parts of FamiTracker.
There are some inaccuracies, but I can play 2A03/VRC6/MMC5 modules well enough.

I am going to redesign it into something more readable. For now it runs on modern browsers, but mobile browsers will struggle, and older PC/laptops can have a hard time with VRC7 and FDS.

What's next

  • Finishing decompiler documentation, including how FamiTracker can make straight up wrong or unplayable NSFs.
  • Playable text or JSON exports of my own modules.
  • Player channels for VRC7/FDS/N163/S5B.
  • The big audio engine redesign.