NSF player for Java or Flash?

Discuss NSF files, FamiTracker, MML tools, or anything else related to NES music.

Moderator: Moderators

User avatar
Banshaku
Posts: 2404
Joined: Tue Jun 24, 2008 8:38 pm
Location: Japan
Contact:

Post by Banshaku »

For me, he's the "sound god" :P
tssf
Posts: 53
Joined: Sun Oct 19, 2008 2:37 pm

Post by tssf »

Blargg, Lavos sounds fine.

http://tssf.gamemusic.ca/Remakes/ZeroLavo.mp3 <- an MP3 of a Lavos remix I did back in the day, and it had a (albeit processed with reverb) sampled Lavos scream straight from Square's OSV.. (Can't get any more accurate than that)

.. It could be much worse though. You could have a scream that sounds like the Playstation/Nintendo DS version:
http://www.youtube.com/watch?v=zRyQf-R6xKM&fmt=21#t=5m41s
User avatar
blargg
Posts: 3717
Joined: Mon Sep 27, 2004 8:33 am
Location: Central Texas, USA
Contact:

Post by blargg »

As I remember, getting that sound correct meant figuring exactly how the pitch modulation worked, and finding how the BRR decoder behaved when pushed to decode more than 4 samples for each output sample. It's nice that even the fast DSP (which the Java version is based on) still plays it correctly.
User avatar
blargg
Posts: 3717
Joined: Mon Sep 27, 2004 8:33 am
Location: Central Texas, USA
Contact:

Post by blargg »

blargg wrote:Here's a test page for the player: GME Java test

Click on a song to start it. Previously played songs can be gone to via the Prev button. Click Stop to pause/unpause. If you check Playlist, when you click on a song it adds it to the list without stopping the current song.

The GUI is crap, because I don't use Java and my development machine is inadequate for Java development. The underlying library is clean, so I'm hoping someone can write a better front-end. Contact me and we can work on this.

Internally, it supports uncompressed files, gzipped files, and zip archives. It caches the file at the URL of the current playing song, so for example playing several tracks from the same NSF or from the same zip archive is fast and doesn't involve any re-downloading.

Please don't share the URL, as it probably has problems and I don't want massive bandwidth usage. Please let me know how you like it, what it needs, whatever. I need someone who uses Java regularly to take over the front-end and make it non-crappy.
User avatar
BMF54123
Posts: 410
Joined: Mon Aug 28, 2006 2:52 am
Contact:

Post by BMF54123 »

Weird...tssf's site works fine, but blargg's is silent. Doesn't look like the files ever actually start playing, since the counter is missing. :\

Firefox 3.6.3 here, dunno what version of Java (fairly recent I'm sure).
User avatar
blargg
Posts: 3717
Joined: Mon Sep 27, 2004 8:33 am
Location: Central Texas, USA
Contact:

Post by blargg »

Argh, forgot to update URLs on page when I moved it to a different server. Works now on my machine here. Thanks for notifying me of the problem.
tssf
Posts: 53
Joined: Sun Oct 19, 2008 2:37 pm

Post by tssf »

The only problem I've had is the fact that I can't make files that aren't archived play. Like, if I linked to MegaMan9.nsf, it would ignore it and not play anything.

Also, is there a way for it to generate a playlist without having to "add" the file to the playlist? (Kind of like a "play all tracks" function?)

This java player is extremely accurate and very awesome indeed, I hope it evolves into something very great :)
User avatar
blargg
Posts: 3717
Joined: Mon Sep 27, 2004 8:33 am
Location: Central Texas, USA
Contact:

Post by blargg »

Uncompressed files work for me. For example, <a href="javascript:gme.playFile('http://example.com/Blaster_Master.nsf','',3)">Blaster Master - Underground</a>. What HTML were you using to link a file?

There aren't any meta functions for playlists or track names embedded in files. My idea was that you'd build the appropriate JavaScript to add all the files from an album, using some database or other program. This gives you complete control over presentation and track length, without the need for a complex interface in the applet for selecting what to play.

I do need to add an addFile() function that doesn't play the track immediately (basically acts like Playlist checkbox is checked, regardless of whether it really is). I also noticed that the automatic next track code is commented out (and of course this doesn't do any automatic end-of-track silence detection, as I assume you specify an appropriate song length already). I had lots of problems with the front-end on my old iMac running a really old version of OS X (which is the newest computer I have, sadly). We need to find a Java programmer to work on the front-end.

It would be cool if someone provided a 7z and/or RAR reader for Java, then this applet could play NSF music from all the archives out there. I cringe at the thought of a RAR reader in Java, allocating 40MB or more just to access a file.
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

RAR is non-free. As for 7-Zip, check out LZMA SDK.
tssf
Posts: 53
Joined: Sun Oct 19, 2008 2:37 pm

Post by tssf »

blargg wrote:Uncompressed files work for me. For example, <a href="javascript:gme.playFile('http://example.com/Blaster_Master.nsf','',3)">Blaster Master - Underground</a>. What HTML were you using to link a file?

There aren't any meta functions for playlists or track names embedded in files. My idea was that you'd build the appropriate JavaScript to add all the files from an album, using some database or other program. This gives you complete control over presentation and track length, without the need for a complex interface in the applet for selecting what to play.

I do need to add an addFile() function that doesn't play the track immediately (basically acts like Playlist checkbox is checked, regardless of whether it really is). I also noticed that the automatic next track code is commented out (and of course this doesn't do any automatic end-of-track silence detection, as I assume you specify an appropriate song length already). I had lots of problems with the front-end on my old iMac running a really old version of OS X (which is the newest computer I have, sadly). We need to find a Java programmer to work on the front-end.

It would be cool if someone provided a 7z and/or RAR reader for Java, then this applet could play NSF music from all the archives out there. I cringe at the thought of a RAR reader in Java, allocating 40MB or more just to access a file.
Oddly enough I linked it the same way your example states. It's not a big deal, I mean archiving the NSF files speeds up the playing delay time due to download speed (I'm capped) anyway.

I was wondering if it had RAR support, I never did try..but it's not a big deal.. if it can save space and just have ZIP support, that should work just as well.

Any thoughts on adding a PSF loader to your library? Hehe. Kidding of course. That's probably way too much, and to think some PSFs use libraries, you'd have to definitely load the instrumentation file before anything would play..which I guess wouldn't be too hard, you'd just have to add an extra string.

Anyway great work. I'm hoping for a better GUI in the future, but a lot of people need to get wind of this app before it will probably get the support it needs.. perhaps make an announcement on zophar or something?
User avatar
blargg
Posts: 3717
Joined: Mon Sep 27, 2004 8:33 am
Location: Central Texas, USA
Contact:

Post by blargg »

I actually found a port of unrar for Java, but none of my computers have a new enough Java runtime to even run it, so I can't test it. I didn't see any Java versions of 7-zip, just the low-level LZMA SDK, so no easy way to support that.

I really need to find someone who can take over this project, at least everything except the emulation code. I don't have what it takes to move this much farther forward. I've been sitting on it for almost two years now, so at least it's seen the light of day.
Ichinisan
Posts: 10
Joined: Sun Feb 19, 2012 1:11 pm

Post by Ichinisan »

Doesn't work for me.

I extracted Game_Music_Emu_Java.zip to a folder, then created "test.html" in the folder. I've experimented with files both extracted and not, with various parameters, but I never hear a peep from the player.

Here's the contents of my test.html:

Code: Select all

<html>
<head>
<title>GME Player</title>
</head>
<body>
<div id="divgmeplayer">
	<APPLET archive="gme.jar" code="gme" name="gme" width=400 height=100>
		<PARAM NAME="BACKGROUND" VALUE="1">
	</APPLET><br>
	<a href="javascript:gme.playFile('batman.nsf','',1)">Batman Stage 1</a><br>
</div>
</body>
</html>
How can I make it play the damn NSF file?

Thanks, Blargg!

[edit]
Note: I couldn't get tsst's site to play either, but then it suddenly started working. Mine still doesn't work.
Ichinisan
Posts: 10
Joined: Sun Feb 19, 2012 1:11 pm

Post by Ichinisan »

...and now, mine has started working.

I can't figure out why only the first two TMNT4 SPC tracks will play.

http://dl.dropbox.com/u/19038986/Game_M ... /test.html

Let me know if it works for you. I have to click a track and then click "Prev" to make it work.
Post Reply