gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Audio > Impulse Tracker playback

#14421 - animension - Tue Jan 06, 2004 9:39 am

Hi all.

I know I posted a question regarding impulse tracker playback about 9 months ago. DekuTree64, I know you mentioned then that you were looking into IT playback but that it might not be practical for the GBA.

Well, I've been messing with various module formats such as S3M and XM, and to my dismay I have not been able to come up with any practical way to provide the quality of audio that IT allows with its New Note Action (NNA) feature to allow consecutive notes on the same channel to fade out even if a new note occurs on the same channel before the note completely makes its way through the envelope. It's just not the same without that precision control over the decay of each note.

Has anyone found / made a suitable IT player that is or could be implemented for the GBA?
_________________
"Beer is proof that God loves us and wants us to be happy."
-- Benjamin Franklin

#14432 - tepples - Tue Jan 06, 2004 4:57 pm

If you really love your NNAs, then allocate a pair of XM/S3M channels where you would use one IT channel with NNA.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#14444 - animension - Tue Jan 06, 2004 7:42 pm

That's still not a *practical* solution -- it's a hack, and I'd like to avoid something like that at all costs. Here's why: the composer is composing in MIDI and importing into IT. He's a composer, not a tracker. Which means *I* have to retrack into XM using 2 channels to simulate NNA's that are native to one channel in IT == hours of work. If the composer decides to change anything later down the road == hours of *wasted* work.
_________________
"Beer is proof that God loves us and wants us to be happy."
-- Benjamin Franklin

#14445 - tepples - Tue Jan 06, 2004 8:03 pm

What good reason has the composer given to refuse to learn to use Modplug Tracker?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#14447 - poslundc - Tue Jan 06, 2004 8:26 pm

My composer is using MIDI as well... he's just more comfortable/productive using it, and when you're paying him in future royalties it's hard to make an argument against that. :)

I've just made it clear to him what the limitations of the MOD format are, and that there may be some quality issues in converting from one format to another. He's going to try to obey those limits as best he can (eg. not using Note-OFFs but just replacing the sound in the current channel with a new one).

Dan.

#14448 - animension - Tue Jan 06, 2004 8:51 pm

Quote:

What good reason has the composer given to refuse to learn to use Modplug Tracker?


Mainly for the same reason poslundc metioned. He's much more comforatable with MIDI since he's worked with it for years. ModPlug is a tracker, not a sequencer, and since he's a musician who prefers musical notation ala half-notes, whole-notes, quarter-notes, etc, on treble and bass clef staves, he is using a sequencer that gives him the ability to see his music in the way he is most creative.

And as I mentioned already, if we intend to simulate NNA in XM using 2 (or more depending on the frequency which notes are played and the decay time of the instrument) channels for each IT channel that incorporates NNA, an enormous amount of time will have to be spent by either myself or the composer, should he choose to learn XM tracking, retracking the music -- not to mention the fact that changes cannot be made to the music without said retracking being done *again* for every change made in their respective patterns.

As a die-hard RPGer, I know that music has a very important role in conveying the mood of a particular scene or activity, and to have quality music rendered without doing it justice seems a crying shame, seeing it *should* be possible given the fact that the GBA is capable of rendering PCM audio. The limitation isn't the hardware, but rather that no software has been written to play IT format on the hardware -- yet.

If there are others interested in working on a project that will allow IT format playback, do let me know, as I am now considering porting a C library that samples IT files into PCM audio which can then be DMA'd to the DirectSound FIFO using interrupts.
_________________
"Beer is proof that God loves us and wants us to be happy."
-- Benjamin Franklin

#14458 - DekuTree64 - Wed Jan 07, 2004 12:44 am

Actually I did decide to write an IT player after all, and just strip it down some so it doesn't waste the whole ROM on its silly 500-something byte instrument headers. It sort of works now, though I haven't done many effects, or envelopes (one of the main reasons I wanted IT in the first place, so I will add them once it plays reliably), and it seems to skip playing notes here and there. The mixer supports full panning, and doesn't have any channel limits aside from having to cut down the max volume so it doesn't overflow 16 bits during the mixing process. It takes about 25% CPU for 16 channels, so it's not too fast, but it takes less than 1K of IWRAM.
I wouldn't count on it working properly anytime soon though, nomatter how much I work at it I never have gotten a good mixer/music player going, but hopefully I'll get it at least usable next time I do some work on it
_________________
___________
The best optimization is to do nothing at all.
Therefore a fully optimized program doesn't exist.
-Deku

#14472 - tepples - Wed Jan 07, 2004 5:37 am

animension wrote:
He's much more comforatable with MIDI since he's worked with it for years.

Have you considered implementing a .mid parser to run on the GBA?

Quote:
ModPlug is a tracker, not a sequencer, and since he's a musician who prefers musical notation ala half-notes, whole-notes, quarter-notes, etc, on treble and bass clef staves, he is using a sequencer that gives him the ability to see his music in the way he is most creative.

I guess that when I switched from .mid to .s3m for my own projects, I had a hump to go over as well, but I made it, and now I tend to think about music in tracker notation.

Quote:
if we intend to simulate NNA in XM using 2 (or more [...]) channels for each IT channel that incorporates NNA, an enormous amount of time will have to be spent by either myself or the composer, should he choose to learn XM tracking, retracking the music

Can't this re-tracking be done mechanically, by implementing an IT parser and half of a playback engine, dynamically allocating XM voices as needed, and writing the XM file?

Quote:
As a die-hard RPGer, I know that music has a very important role in conveying the mood of a particular scene or activity, and to have quality music rendered without doing it justice seems a crying shame, seeing it *should* be possible given the fact that the GBA is capable of rendering PCM audio. The limitation isn't the hardware, but rather that no software has been written to play IT format on the hardware -- yet.

Yes, I know that music is important enough in an RPG to justify spending half the CPU cycles thereon, but I'm wondering whether an 8.4 MHz ARM7TDMI processor (that is, half the GBA's CPU) can mix a dozen active channels plus another dozen released notes at a decent sample rate.

Quote:
I am now considering porting a C library that samples IT files into PCM audio which can then be DMA'd to the DirectSound FIFO using interrupts.

That's actually what you want to do on the GBA, but you'll definitely want to optimize the mixer and probably rewrite it in ARM assembly language. What sample rate are you targeting?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#14482 - animension - Wed Jan 07, 2004 7:27 am

As far as the audio sample rate goes, I'm gonna try to see how well the library performs with a small module using 8bit 11KHz output, and if it does well, keep pushing it to see how far it can go.,
_________________
"Beer is proof that God loves us and wants us to be happy."
-- Benjamin Franklin

#14655 - LOst? - Sat Jan 10, 2004 7:03 am

At this time I want FMOD for GBA with Impule Tracker playback

#15425 - yannis - Thu Jan 22, 2004 2:14 pm

Why would you need NNA's for GBA? It's a huge waste of CPU? Unless of course you just want to play music and do nothing else :)

Any in-game music you need to write should be able to be done in 6-8 channels.

An IT replayer should be simple to code as a XM player, just don't include CPU wasting functions like NNA, Filtering.

Something like Krawall that can play XM should be easily adaptable to play IT's with the same restrictions as the XM replayer. I mean it's only the format interperetation which is different, the core engine should be able to process the music the same way.
_________________
DS & GBA Audio Professional
www.GroovyAudio.com