Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (499)
Games in Android Showcase (118)
games submitted by our members
Games in WIP (567)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 [2] 3
  ignore  |  Print  
  Java MOD/XM Playback  (Read 24512 times)
0 Members and 1 Guest are viewing this topic.
Offline c_lilian

Senior Member


Projects: 1


Java games will probably rock someday...


« Reply #30 - Posted 2005-03-24 06:50:10 »

Thank you

So you'll have to update the demo applet, which has a class version of '49' (java 1.5).

Lilian

Offline Mark_J

Senior Newbie




Java games rock!


« Reply #31 - Posted 2005-03-24 20:22:18 »

Look forward to a new version!
ive currently got your micromod libraries working in some *VERY* early game code and the mods play great......until I try to put everything into a jar file and then my code just dies as with a previous members post, couldnt fathom out how to get the mod file loaded from within the jar file etc.!
Searched for more info on the RandomAccessFile to see if I could get it working but no luck (still a newbie so some of the docs may as well be written in Swahili  Cheesy)

PS. great to be able to hear some classic Amiga mods again!

total noob, so forgive my complete and utter dumb questions!
Offline mumart

Junior Member


Medals: 1
Projects: 1


IBXM Java Music Player


« Reply #32 - Posted 2005-03-24 22:39:38 »

A neat trick for getting hold of files inside jars is to make use of a classloader. This works for me with images, so it should work with mods aswell.

If you put the file in the same place as the current class, this should return a URL to the file, whether it's in a Jar or not:

URL url = this.getClass().getResource("filename");
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline mumart

Junior Member


Medals: 1
Projects: 1


IBXM Java Music Player


« Reply #33 - Posted 2005-03-24 22:41:18 »

Quote
Thank you

So you'll have to update the demo applet, which has a class version of '49' (java 1.5).

Lilian


Doh! Will recompile.
Offline Mark_J

Senior Newbie




Java games rock!


« Reply #34 - Posted 2005-03-25 08:56:07 »

Got the classloader getting the file path etc, but just cant fathom out how to then pass the info to the:
1  
module = ModuleLoader.read(new RandomAccessFile(modFile, "r"));


as it keeps throwing an error no matter how i try to pass the url to it (even converting to a String it lets it compile, but then get a NullPointerException  :-/)

total noob, so forgive my complete and utter dumb questions!
Offline mumart

Junior Member


Medals: 1
Projects: 1


IBXM Java Music Player


« Reply #35 - Posted 2005-03-25 13:20:51 »

Quote
Got the classloader getting the file path etc, but just cant fathom out how to then pass the info to the:
1  
module = ModuleLoader.read(new RandomAccessFile(modFile, "r"));


as it keeps throwing an error no matter how i try to pass the url to it (even converting to a String it lets it compile, but then get a NullPointerException  :-/)


Here's a micromod jar with a built-in mod to show you how it's done.

You'll probably need Java 1.5 to run the jar, because that's what I compiled it with. [EDIT] I've rebuilt it, and it should work on 1.3+ now.

http://geocities.com/sunet2000/micromod098.jar

Cheers,
Martin


Offline mumart

Junior Member


Medals: 1
Projects: 1


IBXM Java Music Player


« Reply #36 - Posted 2005-03-25 13:58:16 »

Quote
Thank you

So you'll have to update the demo applet, which has a class version of '49' (java 1.5).

Lilian


OK, I've recompiled the applet with -source 1.3 and -target 1.1, so it'll work on pretty much anything that has a JavaSound implementation now.

Martin.
Offline Mark_J

Senior Newbie




Java games rock!


« Reply #37 - Posted 2005-03-25 16:10:16 »

Thanks Martin, just about to download the jar file!

Fingers crossed the game will get finished (first EVER game on the PC so its a REALLY slow process hehehe)
so you'll be able to see your name in lights (well, lots of phosphor dots anyway! hehehe) with the mod player credit!  Grin

PS. Just downloaded it! nice music! hehe.. takes me back to the mid 70's when i was a teeny tiny kid! haha..

PPS! works great! thanks m8! much appreciated!

total noob, so forgive my complete and utter dumb questions!
Offline mumart

Junior Member


Medals: 1
Projects: 1


IBXM Java Music Player


« Reply #38 - Posted 2005-03-25 16:25:58 »

Quote
Thanks Martin, just about to download the jar file!

Fingers crossed the game will get finished (first EVER game on the PC so its a REALLY slow process hehehe)
so you'll be able to see your name in lights (well, lots of phosphor dots anyway! hehehe) with the mod player credit!  Grin

PS. Just downloaded it! nice music! hehe.. takes me back to the mid 70's when i was a teeny tiny kid! haha..


Nice one! Java can be hard work at times. I think the classes are usually well designed, but they don't seem to do much to help you get things done. Getting drag and drop to work was an exercise in futility!

Cheers,
Martin
Offline mumart

Junior Member


Medals: 1
Projects: 1


IBXM Java Music Player


« Reply #39 - Posted 2005-04-07 19:00:16 »

OK, I didn't make the 2-week deadline, but it's good to put pressure on yourself from time to time!

Here's an alpha of my new player, called IBXM. I've spent the last couple of days tuning it, and it sounds much better than KBXM on a lot of modules.

http://geocities.com/sunet2000/ibxm-alpha26.jar

Plays MOD and XMs. S3M support is not done (but only because I haven't written the loader yet). SPI is coming soon.

The player is 100% integer arithmetic, and has generally cleaner code than KBXM (which itself wasn't so bad IMO).

Use the commandline to test (as usual):
java -jar ibxm-alpha26.jar <modfile>

Cheers,
Martin
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline oNyx

JGO Coder


Medals: 2


pixels! :x


« Reply #40 - Posted 2005-04-08 02:32:56 »

Good work Smiley

Did switching to integer arithmetic improve performance? (Do you have some numbers?)

>BSD licence!

Thanks Kiss

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 Wink

弾幕 ☆ @mahonnaiseblog
Offline mumart

Junior Member


Medals: 1
Projects: 1


IBXM Java Music Player


« Reply #41 - Posted 2005-04-08 10:16:34 »

Quote
Good work Smiley

Did switching to integer arithmetic improve performance? (Do you have some numbers?)



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.

Tests done on a 1500mhz Sempron with Java 1.5.0:

Song: Jogeir Lilljedahl - Guitar Slinger (299 seconds)

MicroMod 0.83 : 1516ms
MicroMod 0.98 : 2250ms
KBMod : 6359ms
IBXM: 1672ms
IBXM-Fastmix: 1156ms

Song: TNT - Once More TNT (195 seconds)

MicroMod 0.83 : 906ms
MicroMod 0.98 : 1297ms
KBMod : 3344ms
IBXM: 984ms
IBXM-Fastmix: 687ms

Even the slowest of these only takes 2% of this cpu Smiley

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

Quote

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 Wink


I see, I've never come across that problem before. I'll bear it in mind.

Cheers,
Martin
Offline oNyx

JGO Coder


Medals: 2


pixels! :x


« Reply #42 - Posted 2005-04-08 13:02:26 »

Wow. It's surprisngly fast Shocked

Good to know Smiley

弾幕 ☆ @mahonnaiseblog
Offline Mark_J

Senior Newbie




Java games rock!


« Reply #43 - Posted 2005-04-08 16:11:25 »

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!

total noob, so forgive my complete and utter dumb questions!
Offline mumart

Junior Member


Medals: 1
Projects: 1


IBXM Java Music Player


« Reply #44 - Posted 2005-04-09 23:53:59 »

In the spirit of not keeping things back, here's another alpha!

http://geocities.com/sunet2000/ibxm-alpha30.jar

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" Smiley

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.

Next job is S3M Smiley

Cheers,
Martin
Offline JoC

Junior Member




I love YaBB 1G - SP1!


« Reply #45 - Posted 2005-04-10 11:39:47 »

Very nice, tested it with some old amiga .mod and .xm worked like a charm. Keep up the good work.  Smiley Smiley
Offline mumart

Junior Member


Medals: 1
Projects: 1


IBXM Java Music Player


« Reply #46 - Posted 2005-04-14 16:55:20 »

Another day, another alpha. There are a couple of major fixes (any xm that attempted a global volume slide down would simply fall silent).

There's also a seekable InputStream for use in an SPI, and a WAV InputStream.

http://geocities.com/sunet2000/ibxm-alpha31.jar

Cheers,
Martin
Offline mumart

Junior Member


Medals: 1
Projects: 1


IBXM Java Music Player


« Reply #47 - Posted 2005-05-09 14:38:19 »

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

http://geocities.com/sunet2000/ibxm-alpha31c.jar

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 Smiley

I'll update the website soon.

Cheers,
Martin
Offline sunet2000

Senior Newbie




I want my mumart account back!


« Reply #48 - Posted 2006-04-25 23:51:20 »

Had an attack of enthusiasm a couple of weeks ago.
IBXM now has cleaner code, faster mixing, and S3M is finally supported! After only 12 months!

http://geocities.com/sunet2000/

Cheers,
Martin
Offline oNyx

JGO Coder


Medals: 2


pixels! :x


« Reply #49 - Posted 2006-04-26 02:13:59 »

Wee \Grin/

弾幕 ☆ @mahonnaiseblog
Offline kevglass

JGO Kernel


Medals: 169
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #50 - Posted 2006-04-26 02:34:51 »

Very very very cool! Smiley

Kev

Offline kevglass

JGO Kernel


Medals: 169
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #51 - Posted 2006-04-26 06:14:55 »

Couple of under-tested classes for using the lib to play back through OpenAL (LWJGL) are here:

http://www.cokeandcode.com/ibxm/

Great work again, really appreciate the efforts!

Kev

Offline Matzon

JGO Knight


Medals: 19
Projects: 1


I'm gonna wring your pants!


« Reply #52 - Posted 2006-04-26 06:58:23 »

uh - nice and small - great wrapper kev

Offline sunet2000

Senior Newbie




I want my mumart account back!


« Reply #53 - Posted 2006-05-26 21:43:11 »

Thanks for the feedback, guys!

Slightly updated version, with a couple of small fixes and improvements to the mixing (15% faster).

http://geocities.com/sunet2000/ibxm-alpha47.jar

Cheers,
Martin
Offline oNyx

JGO Coder


Medals: 2


pixels! :x


« Reply #54 - Posted 2006-05-27 05:13:59 »

Thanks for sharing Smiley

弾幕 ☆ @mahonnaiseblog
Offline kevglass

JGO Kernel


Medals: 169
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #55 - Posted 2006-06-13 20:11:27 »

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.

Thoughts?

Kev

Offline sunet2000

Senior Newbie




I want my mumart account back!


« Reply #56 - Posted 2006-06-14 22:01:34 »

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?

Offline kevglass

JGO Kernel


Medals: 169
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #57 - Posted 2006-06-14 22:52:35 »

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!

Kev

Offline kaffiene
« Reply #58 - Posted 2006-06-15 01:36:56 »

Does anyone know any good software for composing mods?
Offline oNyx

JGO Coder


Medals: 2


pixels! :x


« Reply #59 - Posted 2006-06-15 02:02:40 »

Maybe just using some setter for enabling that automatic endian twisting?

>Does anyone know any good software for composing mods?

modplug, bero, milky, skale (I dont like that one because it sounds quite different)...

http://en.wikipedia.org/wiki/Tracker#List_of_trackers_.28software.29

弾幕 ☆ @mahonnaiseblog
Pages: 1 [2] 3
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Pippogeek (38 views)
2014-09-24 16:13:29

Pippogeek (29 views)
2014-09-24 16:12:22

Pippogeek (18 views)
2014-09-24 16:12:06

Grunnt (42 views)
2014-09-23 14:38:19

radar3301 (24 views)
2014-09-21 23:33:17

BurntPizza (61 views)
2014-09-21 02:42:18

BurntPizza (31 views)
2014-09-21 01:30:30

moogie (36 views)
2014-09-21 00:26:15

UprightPath (49 views)
2014-09-20 20:14:06

BurntPizza (53 views)
2014-09-19 03:14:18
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!