Did switching to integer arithmetic improve performance? (Do you have some numbers?)
BSD licence!
Thanks :-*
Oh and right now there isnāt a way to cleanly exit the demo player. Pressing ctrl+c can result in an endless loop of the last frame (until you reboot), because the cleanup stuff isnāt reached.
There are several ways to fix it, but it would make the programm more complicated, which isnāt necessarly a good thing. So, just print a message that itās better to let it run through
Did switching to integer arithmetic improve performance? (Do you have some numbers?)
[/quote]
I measured the time it takes to mix the entire song at 44100hz with linear interpolation without writing the result on a bunch of different versions, all use integer arithmetic except for KBMod.
Even the slowest of these only takes 2% of this cpu
IBXM is nearly 4x faster than KBMod. Floating point has quite a speed penalty!
āIBXM-Fastmixā is a test version that directly mixes into a mono 8 bit byte array and only supports forward sample loops. Since itās only 50% faster and poor quality I probably wonāt follow it up.
The fastest player with good quality mixing is MicroMod 0.83, but only by 10% or so, which did surprise me, given how naive the mixing code is in that player. IBXM sounds much better, anyway I may be able to optimise it to close that gap.
The slowness of MicroMod 0.98 comes as no surprise. Iām surprised itās not slower, given how much buffer copying it does.
I see, Iāve never come across that problem before. Iāll bear it in mind.
as you know, im using micromod in my (still very early) game, and as a test I stuck it in the actual game loop to test if it made any noticable diff to the speed, and with 640x480 parallax scrolling (32x32 tiles 2 layers, 1 opaque and the foreground bitmasked) with a 96x64 player sprite, upto about 8 or so bullets and had 10 84x124 (i think! :-/) āenemyā dudes wandering about (not that there will be THAT many enemies on screen at once at that size in the actual game!) it still ran lovely! even got a few sound effects playing over the top when the lil fella walks and fires etc!
(MicroMod V 0.98kX is the one im using)
so even micromod gets the BIG Thumbs up from me! well chuffed with it!
The framework is now feature complete, and the interface is not likely to change. Probably still has quite a few bugs, though. XM is an amazingly quirky format. Some might even say ābaroqueā
All the effects that I want to implement are now done. Iāve had some feedback and it appears that playback is very accurate (or as he put it, āblimmin amazing!!ā) and much better than kbxm. Certainly good enough for gaming!
Also there has been a bit more tuning and bugfixing, and the commandline player application now lets you choose the interpolation.
Some more MOD related bits and pieces. I guess itās a hobby of mine :-/
This one has some tuning of the MOD playback, so PC mods with more than 4 channels now work well. Thereās still no S3M loader, but you can always convert to XM if youāre desperate ā¦
If IBXM is too bulky for you, try http://geocities.com/sunet2000/Micromod.java - a full featured MOD-only player with a turbocharged mixer in less than 600 lines of code, which compiles to just one 12k class
Has this been tested on the MacOSX? My OpenAL wrapper produced noise there - Iāve fixed it locally (its just the change of edianess on the platform - but Iām not sure whether the change need to be in IBXM or just locally for OpenAL users? Java Sound might well morph the endian-ness out of the question.
Interesting. The current version only ouputs 16-bit little-endian stereo as a byte stream. It doesnāt surprise me that Macs default to big-endian for their audio system.
Is it possible to tell OpenAL to expect little-endian input?
Doesnāt seem like it - though Iām not sure - I still have to ask OpenAL nicely to do stuff for me.
I just hacked in a change in IBXM where it adds the two bytes to the buffer to swap them round if ByteOrder.nativeOrder() came back the otherway round. Seems to work fine but I havenāt made it available for fear that itād break JavaSound (I donāt use JavaSound)
Thanks again for the great library, my game music is 84k because of this - brilliant!