@x0 Wow, this is really well done. I don't think I'd have noticed if you hadn't said.
@x0 Do we have the source for it somewhere?
@x0 Yeah I guess it would be NSF, sorry for the ambiguity. I haven't played with this stuff in years and never knew how to actually make them.
@simon You effectively need a compiler. Programs that take music in their own format and stick it in an NSF ROM, along with a replay routine. Assuming the NSF doesn't do crazy things like modifying the base framerate or adding too many chips at once, you can load the ROM onto a cart and play it on real hardware.
@simon Presumably the compiler compresses the absolute hell out of the music first, and maybe expands macros or does some kind of space optimization involving subroutines, but the ultimate result is a bunch of static ROM including music data for the driver and the driver code itself, compiled into 6502 instructions.
@simon Thus, NSF players have to act almost like complete NES emulators, including the main CPU and its audioo part, timing circuits including VBlank interrupt, and the like. They can be sparse about the PPU though. When people rip NSFs from games, they primarily rip the game's own reply routine and data, stripping extra junk, and possibly tweak it to conform to some constraints of emulation.
@simon This is the same for formats like GBS for the game boy, GSF/PSF/SSF, SID for the C64, among others. This contrasts with formats like VGM, GYM, AY and YM, which are made by running the replay routine in an emulator and logging every write it makes to the audio chip with timing information. TO play it back you need only emulate the audio chip, and simply send all the register writes that the program did.
@x0 I had no idea. I just assumed there was some kind of external music format. Makes me even more impressed that people have taken the time to rip this stuff apart and keep it alive.
@simon And the trackers and other compilers to make purely custom music for the NES at some point had to have internal routines coded in 6502 assembly. E.G. FamiTracker, PPMCK. This is no different from the way it was before, all games with music had a playback routine. It's just these routines were written in the 2000s and 2010s.
@x0 that tracker file must be long. But it’s impressive
@ronald I don't actually know what tracker they used to make this, as it really seems to me like someone would write this in a technically polyphonic program with gaps on each line which automatically fits them all together. But I'm not aware of a program that does that, or how its replay routine would work. If they made that in FamiTracker I'd be impressed. If they made it in MML I'd be gobsmacked.
@ronald Or hell, they could have written their own driver. I've seen that done before, somebody made a modified replay routine that did software mixing of a single piano sample stored in ROM like a Game Boy Advance routine would do, such that it would play the complete Super Mario World athletic theme by streaming 7-bit samples to the DAC. Like this. https://sndup.net/bf5n/a #audio
@x0 wow, this was made using a NES chip?
@ronald Only technically. Normally the sampling capability of the NES is given some addresses and numbers and streams DPCM to the DAC. The sound of its DPCM is very distinctive. But you can also write to a certain register which immediately writes that value to the DAC and holds it there, you have 7 bits of resolution for that. This driver very quickly writes to that register. Games have done that before as well, though they can't do anythihng else because so many CPU cycles are tied up in those writes. But they'll be streaming a single sample from memory. Software mixing to do the same thing is virtually unheard of for the NES. The Game Boy Advance games had to do that all the time though, because Nintendo just gave them a stereo 8-bit DAC that only took direct writes. Their SDK had a driver that would take sequence data, MIDI-like, and sample banks, and do the mixing to play it.
@ronald One of the few games I know to use DAC streaming, though it's just samples from memory, is the game Skate Or Die 2, the Search for Double Trouble, which did this on its title screen. https://www.youtube.com/watch?v=77BpfYUqKc4
@x0 Dude! I love 8bit Chiptunes. I follow the pandora station
@x0 ...all on a *single* audio channel? ...WOW.