#4269 - animension - Wed Mar 26, 2003 10:19 am
Does anyone know of any libraries for the GBA that support IT format files natively? I know that many IT files can be converted to XM or MOD or S3M or whatever, but I really like the IT instrument control that XM just simply doesn't have AFAIK. The ability to edit the attack and decay of each sound sample instrument is simply too good to pass up, especially since without it XM files sound... flat. I love the depth of sound IT instruments can provide with a controlled decay between each note.
So if anyone knows of any IT compatable playback libs, I'd appreciate a heads up.
Thanks!
_________________
"Beer is proof that God loves us and wants us to be happy."
-- Benjamin Franklin
#4368 - DekuTree64 - Sat Mar 29, 2003 12:06 am
Well, I'm planning to write an IT player, but it may be a while, since I'm having quite a lot of trouble with my mixer.
First, it worked fine and I wrote a nice MOD player for it and everything was good, then it stopped working, due to something I changed somewhere and didn't notice until I had no idea what all I'd changed since last time I turned sound on, but I came up with 2 much faster versions of it, one of which was just better optimizations (plus panning), and the other was a completely new and gloriously complicated plan, which I tried to write yesterday, but decided it was more trouble than it's worth, so now I'm back debugging the second version again.
But anyway, the MOD player for the first one worked fine, but with the addition of panning, it would be handy to have the per-note vol/pan control that MODs don't have, and now that I have some music player writing experience, I might as well write an IT player, since it has the most features. So I'll post here whenever it's done.
#4393 - SmileyDude - Sat Mar 29, 2003 7:02 pm
@DekuTree64: Periodic backups are your friend :) I always make sure to zip up my project directory before undergoing any major work (like re-writing the mixer :). At least that way, you can always fall back to what worked before :)
@animension: How many tracks do IT files have? Does IT support full stereo panning as well? I'm just wondering how much CPU would be required to playback IT files... it doesn't sound very practical to me, but maybe as a portable IT player, it could work :)
_________________
dennis
#4404 - DekuTree64 - Sun Mar 30, 2003 12:40 am
I think ITs can have up to 64 channels or something. My mixer does 8, but I think that's enough for most songs. And it does support panning, but it really doesn't cause that much of a speed hit if you have a 32-bit volume variable, with the left volume in the lower 16 bits, and right vol in the upper 16. Then you just multiply once and you have both volumes. And if you use mla, then you can add to the mixing buffer all in one instruction^^ Of course you have to separate them before writing the final mix, but I think it's worth it for stereo. It does take twice the RAM for mixing buffers though.
I think the main speed hit going from MOD to IT is the vol/pan/pitch envelopes. I think those will have to be processed more often than each player tick (probably every VBlank) to sound smooth enough, but aside from that I don't think there would be a big difference.
And I do have a backup of my old mixer, it's just that I could make it so much better anyway that it's not worth the trouble of searching out the problem with the old one.
#4433 - SmileyDude - Mon Mar 31, 2003 3:25 am
DekuTree64 wrote: |
I think ITs can have up to 64 channels or something. My mixer does 8, but I think that's enough for most songs. |
Wow... I was just happy that I got my mixer (written in C for now... but not for long :) to handle 2 channels per left/right (for MOD -- like it's supposed to be :)
Just some quick calculation -- to handle 64 channels @ 11050hz in mono means processing 707,200 samples per second. I don't know how much more the GBA could handle... especially considering that's just for the mixer alone. No tracking code, no UI, no game logic, etc, etc.
Would you even be able to hear 64 channels at 11050 on the GBA? I know my ears aren't that sensative, but I might be in the minority here :)
_________________
dennis
#4437 - DekuTree64 - Mon Mar 31, 2003 7:55 am
I'd seriously doubt it^^ I think 16 channels would be better than 8 if you could afford it (actually I might do that, since my mixer ignores all inactive channels anyway), but not really neccessary.
Oh, and the mixer is pretty much up and running now, using basically the same algorithm as the buggy one (I also found that bug when I couldn't figure out how I did something before, and then went and looked and it was overwriting all the samples just before playing them...), but copying sections of code into one IWRAM area as needed, so it doesn't need quite as much space. The mixing buffers are still pretty huge though, but I could probably get away with putting the final playing buffer in EWRAM, since it's only being written to once per frame (and read once by the DMA), but the 16-bit buffer where all the samples are added up gets read/written once per chanel per frame, so it pretty much has to be in IWRAM.
So if all goes well tomorrow, I'll have it finished up and get started on the IT player^^
#4487 - DekuTree64 - Tue Apr 01, 2003 6:47 pm
Well sorry Animension, but I got to reading up on the IT format, and the instrument data is pretty huge, so I don't think it would be very sensible in a GBA game. And besides, you can use vol slides and pan setting to simulate envelopes with MODs (of course you can't do both at the same time though...), it's just a little more trouble when writing the song.
And my old MOD player works fine, so I think I'll keep using it. It does need a few modifications to go with the new and improved mixer though.
I could upload it for other people to use, but it does require some hassle to set up. You need a table of all the samples in all your songs in your game, and a table of their names names for the converter program (which is currently part of my map editor, so I'd have to write a standalone version (not much trouble)) to search through so the actual player can just use an index value for each sample, and thus keep from having multiple copies of the same sample for different songs. Or I could just make it use numbers, so like in the MOD if you name a sample 5, then the converter just outputs a 5 for that sample's index instead of having a name table to search through (which I'm not sure how you'd get in a standalone converter).
Then you need a table of frequencies for each sample (one of the reasons ITs sound better than MODS is the ability to have higher frequency samples, and since you're not actually using the sample data from the MOD, but just the name of it for the lookup table, you can use whatever frequency you want, even though the original song was a MOD), and a length table (since higher frequency samples will have different lengths than the ones in the MOD (it could just do a little calculation with the frequency value, but it would always be the same anyway, so it's a waste of time and space to store the sample length in the MOD data)), and one for the loop start positions too, for the same reasons as the length table.
...that took a lot more words than it did thougths to explain^^ So do you want me to upload it, or would you rather just use a different player (check the sound appssection at www.devrs.com) and have copies of the same sample if it's used in more than one song?
#4489 - Daikath - Tue Apr 01, 2003 7:31 pm
Would be cool :), Im looking to write my own XM player so I could use some sourcecode to look through too see how other poeple did stuff. Where can you find techinfo on MOD formats though?
_________________
?There are no stupid questions but there are a LOT of inquisitive idiots.?
#4491 - DekuTree64 - Tue Apr 01, 2003 7:39 pm
www.wotsit.org has all the info on just about every file type ever made^^