Here's a small project I've been working on for the past couple of days:
It's a VGM player running on the NGP. In case you're wondering why it says "Snake by Ivan Mackintosh" on the screen it's because I haven't read up on how the video controller works yet, so I kinda piggy-backed on his code and just inserted my own code to upload a playback driver to the Z80 and communicate with it.
Good stuff! You're all over the place, coding away, aren't you? And from what I've seen over at Neo forums, you sure love those VGMs. Are you planning on developing this further? A public release with the ability to compile a selection of tunes, perhaps?
I really like this. Is it all running on the Z80? It would be awesome to see this as a release that could be plugged in to any other NGPC homebrew. Many coders find adding music to homebrew to be fairly difficult. I know I'm not a sound guy, but if I had a library of music and an easy way to add it, why not just pop it in there?
Keep up the great work, and keep us updated!!!
Quote:Is it all running on the Z80?
Since the sound data doesn't fit in the shared RAM all at once I send it over to the Z80 in small pieces. There's some code on the TLCS that routinely polls the Z80<->TLCS communications register to see how much of the data in the buffer the Z80 has consumed. If it's running low on data, the TLCS sends some more.
I suppose a better approach would be e.g. to let the Z80 trigger an interrupt on the TLCS side when the buffer is running low.
Quote:Are you planning on developing this further? A public release with the ability to compile a selection of tunes, perhaps?
That's the general idea. Though replacing the songs will probably require assembling the ROM yourself (I'm using AS for the TLCS code, and WLA-DX for the Z80 code).
Here's an updated version that supports multiple songs (you switch by pressing up/down):
You can download the ROM
here. I'll make the source available later when I've cleaned it up.
Since we're already on the topic of music, what options are there if you want to compose for the Neo Geo Pocket? There's the NeoTracker, but it doesn't seem too stable. When I run it on my XPSP3 machine, it eats up ~90% of the CPU time [earlier my antivirus insisted on running it in sandbox mode, but I turned all of that off].
Are there any other tools or trackers that can output music in a format compatible with / usable on NGP?
@mic_ - I like the font you chose for song titles. Tested it on my NGPC as well. Second tune is the only one that doesn't sound a bit off. What are the criteria for a VGM to sound correctly on NGP?
Again, awesome project. I think this could really help invigorate the scene and allow homebrew developers a nice easy way to add music to their creations. Keep us updated!
(04-15-2012, 12:20 AM)Morden Wrote: [ -> ]Are there any other tools or trackers that can output music in a format compatible with / usable on NGP?
I hope to add NGP support to my MML compiler at some point. Should be fairly strightforward since I already have playback code for the Sega Master System / Game Gear.
Of course, that won't help those that prefer trackers/sequencers. I'm pretty sure writing a replayer for songs made with Mod2Psg2 (a Master System tracker) wouldn't be all that difficult.
Quote:@mic_ - I like the font you chose for song titles. Tested it on my NGPC as well. Second tune is the only one that doesn't sound a bit off. What are the criteria for a VGM to sound correctly on NGP?
That's because the songs were made for the Master System, which has a PSG clock of 3,58 MHz, while it's 3,07 MHz on the NGP. I'm going to try to fix that.
I've added tables and code to get the pitch for the tone channels correct. Alas, I suspect that the shift register used for implmenting the noise channel on the T6W28 is 15 bits, and not 16 like on the chips used in the SMS/GG.
Since those basslines you hear in some of the songs are done using the noise channel's "periodic noise" mode (where it outputs a square wave), it'll have the wrong pitch (off by 6.67%) and duty cycle. A C1 would become a C+1/D-1, and a B1 would become something in between B1 and C2, etc.
The duty cycle I can do nothing about, but the pitch could be corrected. The problem is that there's only 4K of RAM for the Z80, and each of these pitch correction tables take up 2K, so I can have one that will make the tone channels sound ok, or one that will make the basslines sound ok, but not both.
I decided to go with the option of fixing the noise basslines so that they match the tone channels (meaning that the basslines and melodies will now _all_ be out of tune, but by the same amount) since that made the songs sound the least weird:
You can download the ROM + source code
here.