I would like to know what is the average size in general for the music engine that have been seen either for commercial games or that people developed by themselves? And in the size, not just the code but any LUT and pre-generated data that they may have required to make it work.
Simple question but maybe difficult to answer. I'm sure Neil can give his comment about is current Ninju and people that did their own sound engine like Bregalad, Celius, Tepples too. I have no knowledge about NSF ripping but maybe rippers knows about the size of the commercial ones.
Any information on the subject will be appreciated.
With or without the music sequences and instrument definitions?
(
My last post on the topic)
The driver code (SFX internal code too) and it's internal LUT only without the music data and instruments data specific for that song. It seems that your driver is only 768 bytes, which is quite small and it's a good thing.
The latest FT driver is easily 4.2k because of the all the new effects. I'm trimming it to remove what I don't need for my mm9 project. I'm down to 3.6k and still trimming.
I just want to know if it's was common for commercial games to have big driver or not. I guess it all depends on the features of the driver.
The Guardian Legend's sound engine is 2,439 bytes:
Code takes up 1782 bytes.
LUTs take up 657 bytes. These tables include all the volume envelopes and pitch envelopes, since The Guardian Legend doesn't use an instrument system. If you don't want to count these, LUTs only take up 295 bytes (for a sound engine total of 2077).
That's the only sound engine I know about in great detail, so I can't comment on averages.
Wasn't 16kB a fairly common memory budget given to musicians for all the code + data needed for the soundtrack? I recall seeing that figure a few times.
Banshaku wrote:
I just want to know if it's was common for commercial games to have big driver or not. I guess it all depends on the features of the driver.
A sound driver in a more complex (i.e. bigger) game will tend to have more features because they fit. Compare the music of Binary Land to that of Kirby's Adventure or Silver Surfer.
The driver I use im my current game is fairly small, about 650 bytes total (including all code to run sound, start and stop music&SFX, lockup tables, but no music/SFX data itself).
As my game is 32kb so I don't want to waste a lot of music. It's possible to come with a very small driver, that only fetches data and write stuff to registers, and then come with a customizable effect system, so that you waste as much size as you want for the extra effect (like vibratoes, software pitch slides, arpeggio, etc...)
Use the SVN build of FCEUX, and use the Code/Data Logger on all the songs in an NSF. You can use this to get an accurate readout of your desired data this way(Bytes Logged As Code), though, this only accounts for code actually used, not likely the error-recovery code, or branches not used due to no sound effect usage.
I suggest FCEUX because it works with the speedup button. If you're willing to wait, then you can use my copy of FCEUXDSP, which is pre-built and on my page.
Nerdtracker 2 is about 3kB.. not sure of the exact size, but that's what I budget for it. Probably a little under 600 bytes of it are LUTs.
All code & tables (but no music data) in Nijuu is currently about the 6.5k mark. But don't use Nijuu as a benchmark, it's not written to be ROM-space friendly really
The music engine I designed, which has a decent amount of features (volume envelopes, pitch bends, looping, detune, sound effects, etc) is 1476 bytes. This is just the code, the lookup tables, and blank placeholders for the data (so it'll compile
).
My music data is a little bulky though, each note being two bytes (pitch, duration). That and I still would need to add a few commands to allow less redundancy in the music data. On the plus side, it's easy to code the music in hex!
If NT2 is already around 3k, this seems to be the norm for a driver used with a tracker then. The more flexibility you add, the more it will grow. For now I will stop worrying about size unless it's really an issue.
The 16k limit mentioned before.. That's quite small so if you want to add a lot of music... If you have to be quite creative on the coding/data format side.
My music engine is currently just over two kilobytes, which I suppose isn't that great since my game is 32k. Though it does seem to perform pretty fast and be fairly flexible. Music data should be very small, though sometimes it's hard to determine sizes for certain sounds since some are defined with code rather than just bytes (they are still considered data even though they are made of 6502 instructions though). It is kind of impossible for me to determine now the exact sizes of music, as I am still in the engine making stage of game design; I'm saving data creation for the end.
Quote:
The 16k limit mentioned before.. That's quite small so if you want to add a lot of music... If you have to be quite creative on the coding/data format side.
Either that or you just make a few songs that you repeat throughout the game.
As for driver sizes (code + LUTs, not including music data), most of the ones I've written (SN76489, YM2413, YM2151, YM2612, AY-3-8910, Konami SCC, SID) are between 1.5 and 3.5 kB in size. That's just ROM, though - some of them can use over 1 kB of RAM depending on how many channels you're using.