SuperNSF PCM+PSG driver

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
SuperNSF PCM+PSG driver
by on (#71845)
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.

by on (#71852)
THIS IS REALLY AMAZING !!
Sounds about GBA quality.

by on (#71864)
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?

by on (#71866)
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.

by on (#71885)
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.

by on (#71886)
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?

by on (#71892)
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/

by on (#71893)
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. :)

by on (#71895)
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.

by on (#71896)
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?

by on (#71900)
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.

by on (#71922)
Quote:
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.

by on (#71927)
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".

by on (#72038)
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