What's Sufficient For A Music Engine?

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

Moderator: Moderators

Post Reply
adam_smasher
Posts: 271
Joined: Sun Mar 27, 2011 10:49 am
Location: Victoria, BC

What's Sufficient For A Music Engine?

Post by adam_smasher »

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?
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: What's Sufficient For A Music Engine?

Post by tepples »

"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.
adam_smasher
Posts: 271
Joined: Sun Mar 27, 2011 10:49 am
Location: Victoria, BC

Re: What's Sufficient For A Music Engine?

Post by adam_smasher »

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?
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: What's Sufficient For A Music Engine?

Post by tepples »

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.
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.)
adam_smasher
Posts: 271
Joined: Sun Mar 27, 2011 10:49 am
Location: Victoria, BC

Re: What's Sufficient For A Music Engine?

Post by adam_smasher »

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.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: What's Sufficient For A Music Engine?

Post by tepples »

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?
adam_smasher
Posts: 271
Joined: Sun Mar 27, 2011 10:49 am
Location: Victoria, BC

Re: What's Sufficient For A Music Engine?

Post by adam_smasher »

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.
Post Reply