One day I felt like streaming my music compositions and arrangements made in ModPlug, FamiTracker, and Pently on someone's Discord server. But Discord music bots tend to support only more common audio formats based on compressed samples, such as MP3 and occasionally Ogg Vorbis. So before I can use LAME and oggenc, I first need to turn them into RIFF WAVE files.
So one night, I felt like writing a wrapper around a couple player libraries that I could put in a shell script to render NSF and S3M to RIFF WAVE to MP3/Ogg. Currently it wraps these:
These two libraries cover most formats in which I have composed over the past 15 years. In the late 1990s, when I developed games using old Allegro, I composed music in Standard MIDI File format, but I dropped that around 2001 in favor of tracker formats where I could more portably control mixing among instruments and between the music and sound effects. And my potatobook's Atom N450 CPU renders NSF at roughly 60x speed.
C source code is included, but not a binary for a popular pane-ful PC operating system. I haven't tested it in anything but GNU/Linux on x86-64. Dependencies are GME, DUMB, GCC, and GNU Make, as described in the build instructions. The license of both this wrapper and DUMB is the zlib License; GME is LGPLv2.1, which requires letting end users relink an updated, ABI-compatible library with an existing application.
So one night, I felt like writing a wrapper around a couple player libraries that I could put in a shell script to render NSF and S3M to RIFF WAVE to MP3/Ogg. Currently it wraps these:
- Game_Music_Emu (GME), originally by blargg, now maintained by kode54
- Dynamic Universal Music Bibliotheque (DUMB), originally by Ben Davis, now also maintained by kode54
These two libraries cover most formats in which I have composed over the past 15 years. In the late 1990s, when I developed games using old Allegro, I composed music in Standard MIDI File format, but I dropped that around 2001 in favor of tracker formats where I could more portably control mixing among instruments and between the music and sound effects. And my potatobook's Atom N450 CPU renders NSF at roughly 60x speed.
C source code is included, but not a binary for a popular pane-ful PC operating system. I haven't tested it in anything but GNU/Linux on x86-64. Dependencies are GME, DUMB, GCC, and GNU Make, as described in the build instructions. The license of both this wrapper and DUMB is the zlib License; GME is LGPLv2.1, which requires letting end users relink an updated, ABI-compatible library with an existing application.
Code:
$ ./gmewav --help
usage: gmewav [options] vgmfile wavfile
options:
-h, -?, --help show this usage info
-t LENGTH render LENGTH seconds of audio (default: 150.0)
-f LENGTH fade out the last LENGTH seconds (default: 0.0)
-m MOVEMENT render movement MOVEMENT (default: 1)
Supported game music formats (Game_Music_Emu):
vgm, gym, spc, sap, nsf, nsfe, ay, gbs, hes, kss
Supported module formats (Dynamic Universal Music Bibliotheque):
it, xm, s3m, mod
usage: gmewav [options] vgmfile wavfile
options:
-h, -?, --help show this usage info
-t LENGTH render LENGTH seconds of audio (default: 150.0)
-f LENGTH fade out the last LENGTH seconds (default: 0.0)
-m MOVEMENT render movement MOVEMENT (default: 1)
Supported game music formats (Game_Music_Emu):
vgm, gym, spc, sap, nsf, nsfe, ay, gbs, hes, kss
Supported module formats (Dynamic Universal Music Bibliotheque):
it, xm, s3m, mod