1. Shlomi Fish
  2. shlomi-fish-homepage


shlomi-fish-homepage / t2 / jmikmod / README.java.txt

Welcome to the beta port of MikMod to Java. This document is made of
the following sections:

-1- Introduction
-2- Compatibility
-3- Building the program
-4- Running the program
-5- Copyright
-6- Why did I do it and future intentions
-7- List of relevant URLs

-1- Introduction

This is a port of the MikMod MOD-player to Java. MikMod is basically
written in ANSI C, so a lot of recoding was involved in converting it
to Java. The documents in this directory are specific for the Java
port; for more information about the structure of the code, you should
consult the documents in the docs/ sub-directory of the standard MikMod
for UNIX distribution.

The other file in this directory are:

Changes_From_C.txt  - lists the changes I applied to convert the code
                      from C to Java.
mikmod.txt          - the copyright policy (copied from the ANSI C
Optimizing.txt      - some ideas about how to optimize the code.

This distribution is source only, so you'll need a Java compiler (such
as the JDK's 'javac' to compile it). Please read the other sections of
this document before you try to use it.

	Shlomi Fish

-2- Compatibility

This package was developed on the JDK v. 1.0.2 on an i386-Linux. I
tested it and it compiled on JDK 1.1.x, but with many warnings about
"deprecated" API functions.

To play sound through the audio driver, one needs to write a native
Java extension in C. The archive contains the code for a Linux
extension for JDK 1.0.2. I think the code for other platforms can be
written without modifying the Java source. "Playing" by writing to the
"music.raw" file can be done on any Java virtual machine.

JavaSoft's site mentions that a "Java Sound API" is planned, so a
MikMod driver that uses it can be written, once the sound API becomes
available to the public.

The code is based on mikmod for UNIX v. 2.14 which is available in the
Linux archive on sunsite.unc.edu . (I think it's some 2.13-2.14
intermediate version) To modify it to the latest version, I suggest
running 'diff' between the two versions, to see where changes were
applied. Then find the corresponding places in the Java code, and
modify it accordingly.

This code was tested on a Pentium 166 running Linux (2.0.x) with
JDK1.0.2. Both mikmod and mikcvt run smoothly but very slow. Java
mikmod took on average 80% of the system's CPU according to the output
of the "ps" command.

It was also compiled and run on a Pentium Pro with WinNT 4.0 and JDK
1.1.4. Both programs run much faster, but it's probably because of the
faster computer.

-3- Building the program

The make file "source/Makefile" is intended for GNU make, so if it's
present you can just type 'make' to build everything. The default java
compiler name is javac, and if it isn't you'll need to modify the
makefile a bit.

Building the audio-driver is not trivial on a machine which isn't
Linux. The makefile and and source files under the sub-directory
'source/dll' can generate it on a Linux, but they need to be modified,
and possibly re-generated by "javah" so they'll compile on another
platform. You can use the drivers in the MikMod for UNIX package to
code the native driver for your platform.

-4- Running the program

Both programs should be run from a command shell (they are Java
applications that make use of the command line arguments). To invoke
Java MikMod type:

java MikModApp [standard mikmod arguments]

and for Java mikcvt:

java MikCvtApp [file path]

Everything should work much like the C programs except that:

1. Output is not fully compatible.

2. Input is not available. (press Ctrl-C to abort the program).

3. It could be much slower.

-5- Copyright

The copyright policy remains the same as in mikmod for UNIX. You can
review it in the file "mikmod.txt" in the docs/ sub-directory of the
mikmod archive.

It is also included in this archive, for reference.

-6- Why did I do it and future intentions

Well, I did it for fun and so I can experience more with the Java
language. As far as I'm concerned those objectives were achieved, even
though MikMod for Java is not very operational because it's slow.

There is a list of code modifications I believe can be applied to
optimize it in the file Optimizations.txt. Also, can someone test it on
a JIT-based Java runtime environment? (and let me know of the results)

Finally, if someone (preferablly with some time, and a
computer that is permanently connected to the Internet) wishes to take
over this "project", I would be more than happy to do so. Right now, it
doesn't look like there's much interest in it anyway.

-7- List of relevant URLs


       The MikMod Development Homepage - contains latest sources to
the UNIX version, info on several mailing lists and links to other
MikMod related places.


	Various Information about Sun's JDK.


	Kaffe is a freely available JIT-based runtime environment for