Short:    Amiga Port of the *IX tracker MikMod.    
Version:  2.09.
Uploader: bybell@cse.psu.edu (Tony Bybell)
Author:   bybell@cse.psu.edu (Tony Bybell)
Type:     mus/play

Why another MOD player for the Amiga?
Because Intro to Compiler Construction is driving me nuts and I need a break
from LR(k) grammars!

But seriously, the reason I ported this to the Amiga is simple: with the
PowerPC coming soon to the Amiga community, the 680x0 modplayers out there
aren't going to be a viable solution anymore since in terms of speed, C code
on a PPC will easily outstrip assembler on a 68040. Nonetheless, this still
does output regular mods at 22.5kHz per channel in stereo or 44.1 in mono.
As far as XM files go, I hope you have an '060... (The price for
portability, *snif*) Remember you can only get 44.1 if you do the mode
promotion trick to double your audio bandwidth...

This was compiled on an '040 and the compiler sez it'll work on all
processors, but I haven't been able to test it out on anything besides an
A4000. It's probably useless on a 68000 because of the processor intensive
nature of the sound mixing used. (Even regular mod files are mixed at 16-bit
then truncated to 14 bits--all in the name of portability, *snif again*.)

What is it?
This is the Amiga port of MikMod2.09 by Jean-Paul Mikkers. Built-in drivers
for eight and 14-bit Paula sound have been included. Paula14c will be
forthcoming if there is a demand for it. I was going to do this using AHI ,
but for some reason the hook function called by the AHIA_SoundFunc tag kept
crashing my machine. Sorry, Toccata owners. (Well, at least until I can
figure out how to get the hooks working w/o crashing.)

The sound drivers are:
1. Paula 14-bit output driver v1.1a
2. Paula Eight-bit output driver v1.0
3. MikMod music.raw file output driver v1.0
4. MikMod Nosound Driver v2.0 - (c) Creative Silence

By default, Paula14 is used. Something to keep in mind here...note that you
can write out music.raw files for especially slow machines if you use the
-d3 option from the command line. It can then be played using Play16. (e.g.,
Play16 music.raw raw signed bits 16 tracks 2 filter off out paula14)

Module players included are:
1. Portable XM loader v0.4
2. Portable UNI loader v0.3 (This is the internal MikMod format)
3. Portable ULT loader v0.1
4. Portable STM Loader - V 1.2
5. Portable S3M loader v0.2
6. Portable MTM loader v0.1
7. Portable MOD loader v0.11
8. Portable MOD-15 loader v0.1

Miscellany:
Note that all calculations are done internally in 16-bit mode. Using the
eight-bit modes only truncates the output as it copies to Chip RAM.

I handle the 14-bit code in a really bizarre way to keep myself from having
to worry about timing issues. I do a BeginIO() on the channel 0 then write
to chip registers for the rest. Call me lazy, but I have a full courseload
this semester. I'll do this the proper way sometime, but if anyone wants to
beat me to the punch, go ahead. But for now if it crashes your machine or
causes memory leaks the size of Nebraska, please don't burn my house down or
ping-flood my server. ;)

The original archive mikmod209.tgz is also included in case anyone wants to
do diffs on this and see what I changed to get this to run on the Amiga.
Additionally, all the original legalese and caveats are present in that
included archive.

If you're motivated, you can rework the drivers or do whatever you want.
If you have the source, do what you want with it. If you want to port this
to your HP Laserjet, go do it, hehe! 

Have fun!

01Feb97
Tony Bybell
bybell@cse.psu.edu
http://www.cse.psu.edu/~bybell/

----------------------------------------------------------------------------

Notes:
1) A stock Amiga 4000/040 can successfully play a 4-channel mod file at the
following rates:

mikmod -f 22050 mymodule.mod
mikmod -f 44100 -m mymodule.mod

Higher rates are possible but it depends on background tasks running.

2) Moving the mouse or executing any programs may cause the sound to break
up. I am working on a fix for this.

3) Switching between 8 and 14-bit mode without rebooting causes strange
results. This is being looked into. If you really want to use 8-bit mode, I
suggest using the -8 switch. (I only used this to test that 14-bit mode
really works. You set the volume at 5% and play with -8 then without it.
14-bit mode is an appreciable difference!) That way, when you switch back to
14-bit mode, things will sound normal since you never left 14-bit mode in
the first place!

4) The s.a, s.o files handle the AUD0 interrupt. (It sends a signal back to
the program to tell it that it's OK to continue.) Note that hard disk access
also seems to trigger a level4 interrupt. This is being looked into. The s.a
file is the only nonportable file in this archive as it's 680x0 specific
code usd to signal the AUD0 interrupt back to the Wait() in the update code
for Paula14. Regular 8-bit Paula doesn't need s.o.

5) This is far from "production quality," but it does work... I'm getting
rid of bugs as I find them, but since I'm in my last semester of Computer
Engineering, I'm kind of busy working on other projects like SimYacht for
X-Windows for my project class so I have less time to devote to my Amiga
stuff but I keep trying! =)

----------------------------------------------------------------------------
