It is currently Tue Dec 12, 2017 10:52 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: My music engine
PostPosted: Fri Jul 26, 2013 4:51 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19335
Location: NE Indiana, USA (NTSC)
I made a game-oriented music engine for one project and reused it for Thwaite and two other games in the bundle, as well as its menu. NovaYoshi has been using it for his own project. I wrote NSF and NES wrappers, as seen in my NSF of these games. Memory consumption is on the order of 36 bytes zero page and 80 bytes BSS.

Right now, music is coded as .byt statements, with symbols for phrase bytecode and macros for song commands. Perhaps I should polish it up and write a compiler for a proper input language inspired by MML but not compatible with any MCK.


Top
 Profile  
 
 Post subject: Re: My music engine
PostPosted: Sat Jul 27, 2013 12:13 am 
Offline
User avatar

Joined: Mon Feb 07, 2011 12:46 pm
Posts: 941
Do you support other mappers including some which have expansion audio?

_________________
.


Top
 Profile  
 
 Post subject: Re: My music engine
PostPosted: Sat Jul 27, 2013 5:06 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19335
Location: NE Indiana, USA (NTSC)
Mappers provide three services: bank switching, IRQs, and expansion audio. I tried to make the music data format small enough that a typical NES game soundtrack could fit in a single 16 KiB bank. (Look at the size of the NSF that I linked above.) I can see where IRQs would be used for $4011 writes (as in blargg's sawtooth wave hack) but not much else, and that hack not only doesn't work in NSFs but also can cause audible artifacts when an ongoing OAM DMA blocks IRQ handler execution, as Dwedit pointed out.

I chose not to support expansion audio for three reasons:
  • I don't own a Famicom and a T-cart to test on.
  • Using expansion audio in homebrew involves either an expensive PowerPak, donor carts, or an old PC with a parallel port capable of running DOS and the FDS loader, making it difficult to distribute a game that uses expansion audio.
  • It'd increase the RAM footprint, which might not be so bad because most of these include built-in PRG RAM decoding.
But I do plan to distribute it as free software so that you can write your own patch adding VRC6, MMC5 or 5B support.

As I get various parts of the compiler done, I'll start to give lessons on the syntax for some features that I'm working on, such as building drums out of sound effects, playing phrases with transpositions, and adding swing to a phrase.


Top
 Profile  
 
 Post subject: Re: My music engine
PostPosted: Sat Jul 27, 2013 5:23 am 
Offline

Joined: Sat Jan 23, 2010 11:41 pm
Posts: 1161
Considering that Famitracker now has standartized text export, I guess it could be possible to make a converter for this format?

As we have quite many sound/music engines now, I think it would be useful to have a Wiki page that lists them all, along with their capabilities, assembler formats, licenses, etc, so people could actually know about them and use in their projects.


Top
 Profile  
 
 Post subject: Re: My music engine
PostPosted: Sat Jul 27, 2013 5:37 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19335
Location: NE Indiana, USA (NTSC)
I could make a basic converter for FT text export, but it would mostly be a tool for quickly entering phrases, as it wouldn't sound the same. The envelope paradigm differs, and the player doesn't use the MOD tempo/speed paradigm, and phrases can be started at any time, not just on pattern boundaries, and phrases can be transposed, and phrases can be shared among the three tone generator channels (as demonstrated in "Leck mich im Arsch" in the demo), and one channel can play attacks on top of another channel. There's a bit of impedance mismatch between FT's data model and mine.

ROM footprint of player: about 1.3 KiB


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group