What's Sufficient For A Music Engine?

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
What's Sufficient For A Music Engine?
by on (#189603)
Hi all; just hoping for some feedback on my music engine. It - along with a Famitracker converter - is almost done to specifications I'm, I guess, happy with, but as I'm not a chip musician I don't really know if it's too constrictive.

It's actually for the Game Boy, but since the NES has fairly similar sound hardware I figured I'd just post here for maximum exposure to the correct audience (feel free to move it if you'd like mods).

Here's the basic specs:

  • Each frame must have the same pattern on all channels.
  • Each "row" can have one or more global effect that's executed before the channels are updated, such as tempo, master volume, or flow control.
  • There's underlying support for per-channel effects, although the only one I have implemented now is octave up/down (which Famitracker doesn't seem to support, anyway?)
  • Instruments, but all five sequences (volume, arpeggio, pitch, hipitch, duty) must have the same length/loop point. release points aren't supported.

If you were/are a musician, would you be able to work with this? Is there anything in particular that it's missing that you'd really want support for?
Re: What's Sufficient For A Music Engine?
by on (#189604)
"Each frame must have the same pattern on all channels."

This is space-inefficient for reuse of a drum pattern with a different bass and melody on top, or a bass pattern with different melody on top.
Re: What's Sufficient For A Music Engine?
by on (#189618)
There's simple LZ-style compression applied to the opcode stream while in ROM that should (hopefully) capture that, and the GB is fairly memory rich - the engine reserves an entire 4K bank for itself - so I suppose I'm not too worried about being space-inefficient. But then, I also suppose I don't know how large and complex a song might be :?

There's probably enough memory for 10 or so 64 row patterns when all's said and done. Is that enough?
Re: What's Sufficient For A Music Engine?
by on (#189622)
adam_smasher wrote:
There's simple LZ-style compression applied to the opcode stream while in ROM that should (hopefully) capture that, and the GB is fairly memory rich - the engine reserves an entire 4K bank for itself

Isn't 4K half the monochrome Game Boy's RAM? That doesn't leave much for the game unless it's as RAM-miserly as an NES game.

Quote:
There's probably enough memory for 10 or so 64 row patterns when all's said and done. Is that enough?

I've had longer tunes go way past 09. Remind me later to upload the FTM for something like "Byelomorye Dam Zone". (EDIT: I did; scroll down.)
Re: What's Sufficient For A Music Engine?
by on (#189625)
tepples wrote:
Isn't 4K half the monochrome Game Boy's RAM? That doesn't leave much for the game unless it's as RAM-miserly as an NES game.

It's half the RAM on the base system, but my game is an MBC1 game, which gives me (up to) an extra 32KB on the cart.
Re: What's Sufficient For A Music Engine?
by on (#189632)
Provided the game's publisher pays the cost of the extra 32 KiB RAM chip for each cartridge. How much does that add to the replication cost?
Re: What's Sufficient For A Music Engine?
by on (#189643)
My game has a save function, so we're going to need an SRAM chip anyway. I hopped onto Mouser, and assuming we wanted to make 1000 carts, it looks like we'd pay around 80 cents per for a roll of 1000 5v 256kbit chips. I can't find any smaller chips that are any cheaper.

Which is getting ahead of things anyway, any sort of cart production is very pie-in-the-sky ATM.

FWIW, I have no idea how it'll grow, but my core engine is, uh, maybe 40% done (?), and uses nowhere near 4KB on its own.

At any rate, duly noted on song length. Even if I could I'd rather not use 8KB of RAM just for the sound engine, so I might have to change things.