Playing NSF files (retro NES music) - help

BlitzMax Forums/BlitzMax Programming/Playing NSF files (retro NES music) - help

taxlerendiosk(Posted 2005) [#1]
Hello, first of all, I do know that NSF files actually involve NES code, they're not just a music module format, and I know that dumping the files to huge OGGs or something is what any reasonable person would do. But I'm difficult, so I'm trying (and failing) to get existing NSF player code "wrapped" or whatever it is in BlitzMax.

I've been looking at the source for FCE Ultra (from http://desnet.fobby.net/index.php?page=utilities&id=18), a very good open source NES emulator with a built-in NSF player, and while I can get the source to compile and so forth I have no idea how to cleanly separate the one bit for playing NSF files and then get that bit into Blitz. I also found this page: http://www.2a03.org/software.php which has the source for a couple of good Winamp plugins, including one that was written by the FCE Ultra guy, But I've still had no luck at all in working out what's involved in using stuff from other languages. I'm not a Blitz beginner, but I'm a beginner to *this* stuff. Is anyone interested in helping me out with this? I hopefully don't need a full solution, just someone who knows what they're doing to give me a kick in the right direction.

I'd be really grateful. Thanks!


taxlerendiosk(Posted 2005) [#2]
Ok, I've got NSFs playing, but it's far from ideal (for one thing there doesn't even seem to be any way to choose a different track). Anyway, using the Festalon Winamp plugin, the "wave out" plugin that comes with Winamp, and a third plugin called SXMS for something called Game Maker that I got from here: http://shaltif.shawn64.com/SITE/DLL.html (SXMS allows Winamp plugins to be used in Game Maker), I used pexports and dlltool to make a lib for SXMS and came up with this:

Import "-lsmxs2"

Strict

Extern "c"
	Function SXMS2_W_Init()
	Function SXMS2_W_LoadPlugOut:Double(PlugOutName:Byte Ptr)
	Function SXMS2_W_LoadPlugIn:Double(PlugInName:Byte Ptr)
	Function SXMS2_W_Play(Filename:Byte Ptr)
	Function SXMS2_W_Close()
	Function SXMS2_W_Configure(Arg0:Double)
End Extern

SXMS2_W_Init()

SXMS2_W_LoadPlugOut("out_wave.dll".ToCString())
SXMS2_W_LoadPlugIn("in_festalon.dll".ToCString())

'SXMS2_W_Configure(1)

SXMS2_W_Play("smb.nsf".ToCString())

Repeat
Until KeyHit(KEY_ESCAPE)

SXMS2_W_Close()


It seems kind of stupid to require people to download Winamp and get one of the default plugins out of it to have to do this, so I'll continue trying to improve things, but nethertheless - this rules!