SuperNSF PCM+PSG driver

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

Moderator: Moderators

Post Reply
coda
Posts: 1
Joined: Thu Dec 23, 2010 11:21 pm

SuperNSF PCM+PSG driver

Post by coda »

hi everyone.
some songs were quietly entered in this past Famicompo Mini (september) that used a new sort of driver.

http://dl.dropbox.com/u/2316004/entry001.nsf
http://dl.dropbox.com/u/2316004/entry046.nsf
http://dl.dropbox.com/u/2316004/entry068.nsf

what you may notice about these songs is that they play multiple PCM samples (up to 4 channels) and 2a03 and VRC6 at the same time :)

we also made a straight up MOD player version
http://dl.dropbox.com/u/2316004/bananasp.nsf

the tool itself has been released (to little fanfare), so it feel it's a good time to post about it, especially as stuff like NSF v2 and pornotracker are being developed. and i figured this forum would be interested if no one else is.

tool:
http://lmao.rotfl.at/upload/B00daW/supernsf.zip

i didn't do any coding but i was involved with the development of supernsf and its predecessors. it uses $4011 to do cpu cycle-timed software mixing at around 12khz (different rate, and different driver for each number of PCM channels from 1 to 4) and supports some basic instrument macros like mml/famitracker. the cpu cycle timing actually causes the pitch to vary slightly relative to the PSG channels across different players, but not catastrophically. of course whatever the driver does also causes seeking to break in many players.

i supposed that's all the interesting stuff i have to say about it.
User avatar
Bregalad
Posts: 8036
Joined: Fri Nov 12, 2004 2:49 pm
Location: Caen, France

Post by Bregalad »

THIS IS REALLY AMAZING !!
Sounds about GBA quality.
Useless, lumbering half-wits don't scare us.
User avatar
Dwedit
Posts: 4470
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Post by Dwedit »

Yes, indeed it's amazing. I was reading another page which seemed to highlight a flamewar about whether or not it's "Legitimate" to use mixed PCM in NSF competitions. (My opinion: it isn't)

The obvious problem is that it seems next to impossible to use this engine in a game, except for a static screen with no tricks. The "Rickrolled" demo showed us that you can still pull off one PPU write and scroll every frame even with streaming PCM playing, but I wouldn't throw in any OAM updates in there.

Edit: I wonder if this could be done with a cycle-based IRQ mapper? It takes about 41 CPU cycles to respond to an IRQ and play a pre-mixed sample. So if you make the sample rate 16384Hz, playback takes 37% CPU usage. Mixing happens in another thread, is it fast enough to keep up?
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

Dwedit wrote:The obvious problem is that it seems next to impossible to use this engine in a game, except for a static screen with no tricks.
In other words, a title screen or other cut scene. There's a reason that Wheel of Fortune and Skate or Die 2 have samples in their title screen music, and there's a reason that Castlevania: Circle of the Moon and Animal Crossing: Wild World have streaming samples instead of sequenced music for their title screens.
User avatar
B00daW
Posts: 586
Joined: Thu Jan 03, 2008 1:48 pm

Post by B00daW »

tepples:

That's why I think the engine would be perfect for first person adventure games, like a Princess Tomato, Shadowgate, Deja Vu, or Metal Slader Glory remake. :)

Dwedit:

The purpose of Battle of the Bits (for the most part) is abusing old hardware and formats. We also have competitions sometimes where the rules dictate how big a song might be. For example: It might be nice to use Shiru's engine to see how small we can make NSFs.
User avatar
Dwedit
Posts: 4470
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Post by Dwedit »

So this mixes channels through the 7-bit PCM channel. Has anyone tried to play 4-bit digital samples through the Square and noise channels?
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
User avatar
thefox
Posts: 3139
Joined: Mon Jan 03, 2005 10:36 am
Location: Tampere, Finland
Contact:

Post by thefox »

Dwedit wrote:So this mixes channels through the 7-bit PCM channel. Has anyone tried to play 4-bit digital samples through the Square and noise channels?
http://kkfos.aspekt.fi/2010/11/14/4-bit ... e-channel/
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi
User avatar
B00daW
Posts: 586
Joined: Thu Jan 03, 2008 1:48 pm

Post by B00daW »

http://average.truechiptilldeath.com/ne ... pernsf.zip

Strobe's Apache server seems to be down at the moment.

Dwedit: Yep, it's all done through $4011. As for the pulse and noise channels, that sounds like delicious abuse. SN7 PSG used pulse abuse for PWM and PCM samples. It should be possible, but I haven't heard of anyone doing it. Memblers's Squeedo does some really interesting things with the pulse and triangle channels. #mod_shrine, coda's crew, has also thought of making some FM abuse out of the triangle channel with IRQ support of NSF2. The gates are open for more wank. :)
User avatar
Hamtaro126
Posts: 786
Joined: Thu Jan 19, 2006 5:08 pm

Post by Hamtaro126 »

Plus the SuperNSF name is taken by a replacement format for SPC files (Uses SPC700 in the original format) so at least rename it into Enhanced NSF (ENF) or something along the lines.
AKA SmilyMZX/AtariHacker.
User avatar
B00daW
Posts: 586
Joined: Thu Jan 03, 2008 1:48 pm

Post by B00daW »

thefox wrote:
Dwedit wrote:So this mixes channels through the 7-bit PCM channel. Has anyone tried to play 4-bit digital samples through the Square and noise channels?
http://kkfos.aspekt.fi/2010/11/14/4-bit ... e-channel/
My bad. However, I can't seem to get the thing to work on PowerPak. Is this for PAL only?
User avatar
thefox
Posts: 3139
Joined: Mon Jan 03, 2005 10:36 am
Location: Tampere, Finland
Contact:

Post by thefox »

B00daW wrote:
thefox wrote:
Dwedit wrote:So this mixes channels through the 7-bit PCM channel. Has anyone tried to play 4-bit digital samples through the Square and noise channels?
http://kkfos.aspekt.fi/2010/11/14/4-bit ... e-channel/
My bad. However, I can't seem to get the thing to work on PowerPak. Is this for PAL only?
Hmm, shouldn't be.
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi
User avatar
Bregalad
Posts: 8036
Joined: Fri Nov 12, 2004 2:49 pm
Location: Caen, France

Post by Bregalad »

and there's a reason that Castlevania: Circle of the Moon [...] have streaming samples instead of sequenced music for their title screens.
Not really -> the GBA have to stream data anyway if you don't want to be restricted to GBC sound. Castlevania COTM just uses the standard sappy sound engine and the streamed song isn't even compressed.
Also check my Final Fantasy V and VI advance sound restoration hacks where I introduced streamed songs at the place of sequenced ones, without changing anything in the code.

But I'd agree a title screen with a music like that would be awesome.
Useless, lumbering half-wits don't scare us.
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

Bregalad wrote:Not really -> the GBA have to stream data anyway if you don't want to be restricted to GBC sound.
I'm aware of that; I've written a mixed GBC/PCM music engine for the GBA (used in TOD) and a compressed music player for the GBA (stand-alone and in a game). I was trying to point out that game developers are willing to spend far more resources on the first impression to put players in the mood of "awesome".
User avatar
mukunda
Posts: 4
Joined: Tue Apr 28, 2009 10:24 pm
Location: denver

Post by mukunda »

Dwedit wrote:So this mixes channels through the 7-bit PCM channel. Has anyone tried to play 4-bit digital samples through the Square and noise channels?
(For the next Famicompo mini Classical) :P
Post Reply