PDA

View Full Version : Modular NSF library for NES music



blargg
12-03-2005, 09:38 PM
A while back, someone mentioned (http://www.armageddongames.net/showpost.php?p=981889&postcount=82) adding support for NSF (NES) game music (http://en.wikipedia.org/wiki/Nsf) files. I put together a simple NSF player module that uses SDL (http://www.libsdl.org/) for audio output, though it could easily be changed to use something else. There's a C interface so you can use it from normal C code. Support for GBS, SPC, VGM, and GYM can also be enabled if you want. It's based on my Game_Music_Emu library (http://www.slack.net/~ant/libs/#Game_Music_Emu). The source code and demo is here:

Nsf_Player-0.2.7.zip (http://www.slack.net/~ant/libs/Nsf_Player-0.2.7.zip)

Let me know if you encounter any problems or are interested in this and want more features (like fading songs out).



#include "gme/Music_Player.h"

game_music_load( "zelda.nsf" );
game_music_start( 1 ); // start track 1
...
game_music_stop();

Dark Nation
12-06-2005, 11:26 AM
This looks nice. I sent you an e-mail about it. Please let me know if you don't get it.