Romhacking => Newcomer's Board => Topic started by: superchuko on November 12, 2021, 10:07:06 pm

Title: GBA MIDI output over Link Port for high quality audio by hacking sound engines
Post by: superchuko on November 12, 2021, 10:07:06 pm

I'm looking for community advice regarding how to patch a sound engine on Game Boy Advance, (like Sappy,) to have it output music/audio data, (instrument, pitch, etc.,) over the Link Port instead of playing audio on the GBA itself.

The use case would be for higher quality audio than the GBA can natively provide, by either connecting a GBA to a PC/Mac with a Link Port to MIDI adapter for audio playback using a DAW/soundfont library, or possibly with Game Boy Player + Link adapter + version of Game Boy Interface that's modified to include sample playback. (I'd initially been discussing a more convoluted method of outputting music data from GBA to GameCube, but Extrems suggested the Link Port.)

I'm new to this particular forum, and I know there are a lot of projects and resources around inserting altered music into GBA sound engines, but I guess altering the engines themselves is probably done less frequently. So, I'd appreciate any advice, like where a good starting point would be. (I have some introductory knowledge of C++, though it's admittedly pretty rusty at this point.)

Title: Re: GBA MIDI output over Link Port for high quality audio by hacking sound engines
Post by: FAST6191 on November 14, 2021, 05:19:33 am
Personally I would go for emulation. Plenty there do fun things with sample rates (being an emulator you can do what you like after all) to go beyond the hardware. There were some going there during the GBA lifetime with ports of VBA but I don't know what the kids and golden ear types from HCS64 and all the audio ripping scenes are using in current space year.

That said the link port is pretty slow so it would be some kind of note on, note off midi style setup (which is not a world away from 95% of GBA audio -- the GBA does have wave options available to it, nowhere near as much as the DS has but you can play back wave audio* and some things do, but sappy and many of the other formats like krawall

*I could cover GBA audio hardware, and will elsewhere, but easier to start with and . Neither are the cute thing of abusing samples stitched sequentially either.

Personally I would either attack it at sappy level if that is a thing, or sit on the audio hardware ( htttp:// ) and duplicate whatever it does as link port packets** before having something like a teensy or arduino redo it as a more conventional format. There have been some people that attempted various levels of midi controller for this family but that was usually more on the DS side of things (DS midi wifi and DSserial stuff being among the more notable there). However scope for things exists and all the fun with various multiboot stuff (whether you want to do something like vbalinkreal but for audio vs just having serial data handled like any other serial data I don't know).

**this is how a lot of assembly additions work. Find something that is at least triggered by the same thing you care about and add a little detour along the way.

You will also face the sample quality issue as even with the best will in the world you are still going to suffer those (32 megabytes, though for most practical purposes less than 16 means you dropped sample quality as a matter of course -- even on the DS I have otherwise been talking up throughout this then much of it is still in the 11KHz range) so unless you are going to go in for something like the donkey kong music restorations; people discovered the sample library from the original composer program and redid things for that, as well as fun like which is more for graphics but better illustration of the kind of mindset/workflow likely needed there. This also says nothing of the composers maybe actually realising it sounds like it is at the bottom of a well and playing to that; for the video equivalent.

Title: Re: GBA MIDI output over Link Port for high quality audio by hacking sound engines
Post by: superchuko on November 15, 2021, 06:08:04 pm
Thanks for the feedback, FAST6191!

Yeah, software emulation (and FPGA implementation) can improve the sound quality quite a bit. I'm mostly interested in MIDI hacks because I think it would be neat to have better sound quality while also using OG hardware, and it doesn't seem like it would be an incredibly difficult type of hack.

A couple things I forgot to mention; I believe MIDI through the Link Port is already established with Nanoloop 1 and 2, though I haven't looked into all the features that it supports. And you can already buy MIDI adapters: Also, I was thinking of perhaps making some custom sample libraries for a few games using libraries I have, (which is more my area of expertise than hacking ROMs,) since the original samples aren't always the greatest.
Title: Re: GBA MIDI output over Link Port for high quality audio by hacking sound engines
Post by: YourNerdyJoe on November 26, 2021, 08:22:45 pm
The closest thing I've seen is
Doesn't like the source is available tho unless i missed it. Seems like catskull has this for sale if they ever get stock back in. has a "midi out" for gba. If you can find the source, it used the link port's general purpose mode to bit bang the midi packets, instead of an external micro.