News: 11 March 2016 - Forum Rules

Author Topic: GBA MIDI output over Link Port for high quality audio by hacking sound engines  (Read 433 times)

superchuko

  • Jr. Member
  • **
  • Posts: 2
    • View Profile
Hello!

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.)

Thanks!

FAST6191

  • Hero Member
  • *****
  • Posts: 3344
    • View Profile
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 https://hcs64.com/mboard/forum.php 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 https://knzl.at/krawall/ https://github.com/MCJack123/UnkrawerterGBA)

*I could cover GBA audio hardware, and will elsewhere, but easier to start with http://www.gameboy-advance.net/emulated/musicplayer_advance_gba_mp3.htm and https://github.com/pinobatch/gsmplayer-gba . 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://problemkaputt.de/gbatek.htm#gbasoundcontroller http://belogic.com/gba/ ) 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 http://www.brolinembedded.se/projects/keyboard/ https://web.archive.org/web/20120628204500/http://www.reinerziegler.de/GBA/gba.htm 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; https://www.youtube.com/watch?v=WW--iJYcZNE people discovered the sample library from the original composer program and redid things for that, as well as fun like https://www.youtube.com/watch?v=bsCN0Yx2Vbs 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; http://bogost.com/games/a_television_simulator/ for the video equivalent.


superchuko

  • Jr. Member
  • **
  • Posts: 2
    • View Profile
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: http://www.nanoloop.com/midi/. 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.

YourNerdyJoe

  • Jr. Member
  • **
  • Posts: 4
    • View Profile
The closest thing I've seen is http://spritesmods.com/?art=gbamidi
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.

https://web.archive.org/web/20130520185936/http://gba.atlantes.org/index_en.html 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.