aMUSE
====
Current Version : v0.284
Download here!=======
ChangeLog
=======
v 0.284
+ Added function isChannelPaused
+ Added function isChannelPlaying
+ Added function isChannelStopped
v 0.252
+ Added function channelSetLoop
+ Added fucntion channelRemoveLoop
v 0.249
! adding a Channel that already exist will remove the old channel properly before.
! renamed function channelPosSet to channelPosSetByte
! renamed function channelPosGet to channelPosGetByte
+ Added function channelPosSetMS
+ Added function channelPosGetMS
+ Added check if a channel really exists for all functions
+ Fixed bug with Saving games crashing the games under certain conditions
v0.236 - Initial Release
============
Description / Usage
============
aMUSE v0.284
============
aMUSE is a Plugin that replaces the WME Internal music system. It also supports serialization and
deserialization ( saving and loading games ). This PlugIn is using the BASS Audio Library ( bass.dll ), please
note that you need to buy a License if you want to use BASS on a commercial Project. Same goes for the MP3 De-
coder included in BASS. See bass_license.txt for further information.
The main purpose for me was, that it was note possible with WME to play a number of music files 100%
synchronous, they always were 10-50 ms asynchronous. The following fileformats are supported ( according
to the Author of BASS Library, I did not test them all

WAV/AIFF/MP3/MP2/MP1/OGG/XM/IT/S3M/MOD/MTM/UMX
I'm using this for example, to fade-in an additional musictrack containg just a single instrument when
the Character starts walking.
Please note that this Plugin is under heavy development, may contain bugs and hidden features

Use at your own risk.
To use this plugin, you should write the following lines in your scripts:
// base.inc
global muse;
// game.script, in the on "QuitGame" Section
{
// quit the game
muse.shutDown(); // <--- ADD THIS LINE
Game.QuitGame();
}
// game.script, or where ever you want to initialize the music system, add:
muse = new aMUSE();
Now, these are the functions included so far:
*********** GENERIC FUNCTIONS ***********
====== addChannel(int ChannelNo, string filename);
Creates a new Channel <ChannelNo> using the file <filename>
====== freeChannel(int ChannelNo);
Stops playback of Channel <ChannelNo> and removes the Data from Memory.
====== play(int ChannelNo, bool loop);
Starts playback of Channel <ChannelNo>, if loop is true then...guess...right, it will loop

====== stop(int ChannelNo);
Stops playback of Channel <ChannelNo>, does NOT reset the Streams current position.
======= shutdown();
Removes all streams from memory and shuts down aMUSE . Use this function on QuitGame Event in your game.script.
*********** VOLUME FUNCTIONS ***********
====== channelVolInc(int ChannelNo, int value);
Increases Volume of Channel <ChannelNo> by <value> percent.
====== channelVolDec(int ChannelNo, int value);
Decreases Volume of Channel <ChannelNo> by <value> percent.
====== channelVolFadeTo(int ChannelNo, int value, int time);
Fades Volume of Channel <ChannelNo> to <value> (percent), in the given amount of <time> ( milliseconds ).
====== channelVolGet(int ChannelNo);
Returns the current Volume of Channel <ChannelNo> in percent.
====== channelVolSet(int ChannelNo, int value);
Sets the Volume of Channel <ChannelNo> to <value> in percent.
====== crossFade(int chanFrom, int chanTo, int value);
Crossfades from Channel <chanFrom> to Channel <chanTo> in the given Amount of <time> (milliseconds);
The Target Channel will have the same volume after crossfading as the source channel had.
*********** POSITIONING FUNCTIONS ***********
======= channelPosSetByte(int ChannelNo, string Value);
Sets the Byteposition of Channel <ChannelNo>. The string has to represent a valid number ( will be converted to unsigned long long.
======= channelPosGetByte(int ChannelNo);
Returns the Byteposition of Channel <ChannelNo>.
======= channelPosSetMS(int ChannelNo, string Value);
Sets the Position of Channel <ChannelNo> in Milliseconds. The string has to represent a valid number ( will be converted to unsigned long long.
======= channelPosGetMS(int ChannelNo);
Returns the Position of Channel <ChannelNo> in Milliseconds.
*********** Looping functions ***************
======= channelSetLoop(int ChannelNo, string start, string end);
Lets Channel <ChannelNo> loop between <start> and <end> ( in ms ). Is not affected by the "loop" flag in the play function.
======= channelRemoveLoop(int ChannelNo);
Removes the Loop on Channel <ChannelNo);
*********** Channel Information *************
======= isChannelPlaying(int ChannelNo);
Returns 1 if <channel> is currently playing, otherwise 0
======= isChannelPaused(int ChannelNo);
Returns 1 if <channel> is currently paused, otherwise 0
======= isChannelStopped(int ChannelNo);
Returns 1 if <channel> is currently stopped, otherwise 0
Cheers,
Spellbreaker