home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Audio 4.94 - Over 11,000 Files
/
audio-11000.iso
/
amiga
/
players
/
modplyrs
/
dstrckr2.lha
/
DTL
/
docs
/
RexxFuncs.DOC
< prev
next >
Wrap
Text File
|
1993-12-17
|
39KB
|
1,066 lines
destracker.library Release 2.00 (v3.0) Documentation
as of Dec 18, 1993
Written by Darren Schebek
destracker.library, LScope, DTC, mJuke, and MODInfo are all
Designed and written by Darren Schebek
Copyright ⌐1992,1993 by Darren Schebek
All rights reserved
Library ARexx Functions
Here is an explanation of the ARexx functions currently supported by the
destracker.library. I'll admit that some of the names are a bit long, but
readability is next to godliness, I always say. :)
There are certain problems inherent with the Rexx interface that I will
try to solve in the future. The one that bugs me the most is that the
Own/Disown player routines use the address of the calling task's TCB in order
to determine who has a lock on the library and who doesn't. Problem is, ARexx
scripts all have the same TCB, that being the ARexx resident process. Oh
well, I'll have to come up with a more sophisticated way of handling library
ownership for a future release. This little problem does not cause contention
between ARexx tasks competing for use of the library, since they are both part
of the same task and so one cannot interrupt the other. This *does* mean that
two ARexx programs can still mess up the library parameters for each other if
such a situation occurs. I'll try to come up with a solution to this in a
future release.
It must be remembered that, since the library can in fact be owned by
another application, any function that does not have the word "Get" in it can
return an error string such as "*** Library has been owned by another prog.".
It should therefore be mentioned that error strings will always start with
"***", and warning strings always start with "+++" (like "+++ Input value was
trimmed.").
So, even though many functions listed below indicate that they return
nothing, they can still return an error string, which you really should be
checking for by saying "retval = DES_{function name}()" instead of just
DES_{function name}()". Having said that, here is a brief list of the
supported ARexx functions in alphabetical order. New functions for release
2.00 (library version 3.0) are indicated by an asterisk next to their
description...
DES_ApplyGTempo() Apply global tempo to song tempo opcodes.
DES_BeginPlay() Begin playing song at start position.
DES_ChannelEnable( [channelbits] ) *Enable/disable specific audio channels.
DES_ContPlay() Continue a previously paused song.
DES_CurPos( [curpos] ) Get/Set current position during playback.
DES_DefaultPath( [path] ) Function removed. See DES_ModulePath().
DES_DefTempo( [newtempo] ) Get/Set default tempo of a song.
DES_DisownPlayer() Unlock library so others can use it.
DES_EndPos( [endpos] ) Get/Set end position for playback.
DES_FadeGlobalVol( destvolume ) Fade global volume to any volume.
DES_Filter( [0/1] ) Get/Set status of the lo-pass filter.
DES_FineTempo( newfinetempo ) Get/Set global fine tempo.
DES_GetCurChVol( channelnum ) Get current volume of an audio channel.
DES_GetCurInstNum( channelnum ) Get current inst # of an audio channel.
DES_GetCurNoteNum( channelnum ) Get current note # of an audio channel.
DES_GetCurPer( channelnum ) Get current period of an audio channel.
DES_GetCurTempo() Get current tempo of a playing song.
DES_GetElapsedTime() Get elapsed playback time (HH:MM:SS:JJ)
DES_GetInstAddr( instnum ) Get addr in memory of an instrument.
DES_GetInstLength( instnum ) Get length of an instrument's sample.
DES_GetInstName( instnumber ) Get text name of an instrument.
DES_GetInstRepLen( instnum ) Get repeat length of an instrument.
DES_GetInstRepOff( instnum ) Get repeat offset of an instrument.
DES_GetItersLeft() Get # of iterations left to play.
DES_GetLockStat() Determine if someone owns the library.
DES_GetModFormat( [ [path]filename ] ) Get file format of a loaded module.
DES_GetModLength() Get total length of a loaded module.
DES_GetNewNoteHits() Get new note hit information.
DES_GetNumPatts() Get # of patterns in a loaded module.
DES_GetNumPos() Get # of positions in a loaded module.
DES_GetPlayStat() Get current play status of the library.
DES_GetSongAddr() This function no longer exists for r2.00.
DES_GlobalTempo( [newtempo] ) Get/Set global tempo.
DES_GlobalVol( [newvolume] ) Get/Set global volume.
DES_InstallMod( module ) "Load" a module already residing in memory.
DES_InstVol( instnum [,volume] ) Get/Set default volume of an instrument.
DES_Iterations( [numiter] ) Get/Set # of iterations to play song.
DES_LoadModule( [path]filename ) Load a song module from disk.
DES_LoopIntent( [loopflag] ) Get/Set/Clear loop intent playback flag.
DES_ModulePath( [pathname|"-"] ) Add/remove search path for DES_LoadModule().
DES_OwnPlayer() Lock library for private use only.
DES_PausePlay() Pause a currently playing song.
DES_ResetDefaults() Reset library parms to their defaults.
DES_SaveFormat( [format] ) Get/Set format that SaveModule uses.
DES_SaveModule( [path]filename ) Save a song module back to disk.
DES_SetTemporalEnd( time ) *Set end of play seq. based on time.
DES_SetTemporalPos( time ) *Set current song position based on time.
DES_SetTemporalStart( time ) *Set start of play seq. based on time.
DES_SongTitle( [newtitle] ) Get/Set the title of a loaded module.
DES_StartPos( [startpos] ) Get/Set start position for playback.
DES_StopPlay() Stops play sequence, resets song position.
DES_TempoInterp( [interpretflag] ) Get/Set tempo interpretation (BPM/non-BPM).
DES_TimingMode( [modenum] ) Get/Set timing mode (50Hz/60Hz).
DES_UnloadModule() Unload a song module from memory.
DES_VolFadeRate( [newrate] ) Get/Set rate at which volume fades occur.
Here now is an explanation of each function in greater detail. They are
listed in the same order as above:
--------------------------------
DES_ApplyGTempo()
Example:
call DES_ApplyGTempo() Apply global tempo to module.
Function:
Takes the global tempo setting (a signed value), and adds it to all tempo
commands in the currently loaded module. The global tempo is then set to
0. This is useful for songs that always play too fast or slow. Rather
than setting the global tempo for them each time you load it, you can
just set the global tempo, call DES_ApplyGTempo(), and then save the module
back to disk. Then it will always play at the faster/slower speed.
--------------------------------
DES_BeginPlay()
Example:
call DES_BeginPlay() Start play sequence a'playing.
Function:
Starts playing the currently defined play sequence. A play sequence
consists of a start position, end position, and number of iterations (see
DES_StartPos, DES_EndPos, and DES_Iterations).
--------------------------------
DES_ChannelEnable( [newenable] )
Examples:
call DES_ChannelEnable( 128+(1+2+8) ) Disable channels 0,1,3.
oldenable = DES_ChannelEnable( 2+4 ) Enable ch. 1,2. Save old enable bits.
enable status.
curenable = DES_ChannelEnable() Get current channel enable status.
Function:
Enable/disable channels. Each channel has a corresponding value associated
with it, as follows:
1 Channel #0
2 Channel #1
4 Channel #2
8 Channel #3
Specify the channels you'd like to affect by adding together their corres-
ponding input values. Then, if you want to enable the specified channels
then simply pass the resulting value to the function. If you want to
disable the specified channels, then add 128 to the result and then pass it
to the function. See the SetChannelEnable() function description in the
LibFuncs.DOC file for more information.
--------------------------------
DES_ContPlay()
Example:
call DES_ContinuePlay() Reactivate paused play sequence.
Function:
Reactivates the play sequence from where it was paused. Note that you
can also use DES_SetCurPos() while a play sequence is paused.
DES_ContPlay() will continue from the current position in this case.
--------------------------------
DES_CurPos( [curpos] )
Examples:
call DES_CurPos( 0 ) Immediately play at first position.
oldpos = DES_CurPos( 5 ) Go to position 5, remember old position.
curpos = DES_CurPos() Get current position in song.
Function:
Set the current position of a play sequence.
--------------------------------
DES_DefaultPath( [path] ) (now defunct)
This function has been removed from DES-Tracker as of release 1.5. It has
been replaced by the DES_ModulePath() function, described later on in this
document.
--------------------------------
DES_DefTempo( [newtempo] )
Examples:
call DES_DefTempo( 7 ) Set default tempo to 7.
oldtempo = DES_DefTempo( 6 ) Set default tempo to 6, save old
default tempo.
curtempo = DES_DefTempo() Get current default tempo.
Function:
Allows you to set/get the default tempo. This is the tempo that is
used for modules that do not set the tempo themselves. Such a module
is invincible to the DES_ApplyGTempo() function.
--------------------------------
DES_DisownPlayer()
Example:
call DES_DisownPlayer() Now anyone can use library.
Function:
Unlock library for public use.
--------------------------------
DES_EndPos( [endpos] )
Examples:
call DES_EndPos( 41 ) Set end position of play seq to 41.
oldendpos = DES_EndPos( 58 ) Set end pos to 58, save old end pos.
curendpos = DES_EndPos() Get current end position.
Function:
Set the end position of a play sequence.
--------------------------------
DES_FadeGlobalVol( destvolume )
Examples:
call DES_FadeGlobalVol( 20 ) Fade global volume to 20.
retval = DES_FadeGlobalVol( 20 ) Put error return status in retval.
Function:
Starts a global volume fade from the current global volume setting to the
specified volume at the current fade rate (see DES_VolFadeRate). You can
monitor the global volume using the DES_GlobalVol() function if you need
to know when the fade is finished.
--------------------------------
DES_Filter( [0/1] )
Examples:
call DES_Filter( 0 ) Turn low-pass filter off.
oldfilt = DES_Filter( 1 ) Turn filter on, save old filter setting.
curfilt = DES_Filter() Get current filter setting.
Function:
Turn low-pass filter on/off (0=off, 1=on).
--------------------------------
DES_FineTempo( newfinetempo )
Example:
finetempo = DES_FineTempo() Get current fine tempo setting.
oldftempo = DES_FineTempo(-38) Speed up song by a fine amount.
Function:
This function allows you to set the fine tempo of a song. The range of
values for fine tempo is -128..127 inclusive. This value affects the base
timing of the library's CIA player interrupt. No really in-depth
technical explanation is necessary for you to use the fine tempo. For the
most part, it is used for adjusting the tempo in very fine amounts until
the song plays at a speed that you're comfortable with. If you save the
song to disk using the library's SaveModule function, this fine tempo will
be stored in the file and remembered the next time you load the song. If
a song is loaded that does not contain this information, then the fine
tempo will be set to 0 by default.
--------------------------------
DES_GetCurChVol( channelnum )
Example:
vol = DES_GetCurChVol( 1 ) Get current volume of channel #1.
Function:
Returns current volume the the specified channel. This will be a value
from 0..64 inclusive.
--------------------------------
DES_GetCurInstNum( channelnum )
Example:
instnum = DES_GetCurInstNum(3) Get inst. # last used in channel #3.
Function:
Returns the slot number of the last instrument used in the specified audio
channel. Instrument slot numbers range from 0..30 inclusive.
--------------------------------
DES_GetCurNoteNum( channelnum )
Example:
notenum = DES_GetCurNoteNum(0) Get current note # for channel #0.
Function:
Returns the number of the last note played in the specified audio
channel. Values for channelnum are 0..3 inclusive. This function is
only valid while a module is playing. The note number is a value from
0..35 inclusive, representing the full three octave range. 0 is the
lowest note playable, and 35 is the highest. To determine the octave of
the note number, just divide it by 12. The remainder is the semitone
offset within the octave.
--------------------------------
DES_GetCurPer( channelnum )
Example:
period = DES_GetCurPer( 2 ) Get current period for channel #2.
Function:
Returns the period value for the last note played in the specified
channel. Period values are not terribly useful if you don't understand
how to interpret them. You can consult the Hardware Manual for a treatise
on period values and how they work. :)
--------------------------------
DES_GetCurTempo()
Example:
curtempo = DES_GetCurTempo() Get current tempo of song.
Function:
Returns the current tempo setting of an active play sequence. This is a
positive value ranging from 0 up to usually about 31 tops (although it
*can* go higher).
--------------------------------
DES_GetElapsedTime()
Example:
timestr = DES_GetElapsedTime() Get current elapsed play time.
Function:
This function returns the elapsed time for an active play sequence since
it was first started. The result is a string in the format HH:MM:SS:JJ,
where HH is hours, MM is minutes, SS is seconds, and JJ is jiffies (i.e.
60ths of a second).
--------------------------------
DES_GetInstAddr( instnum )
Example:
instaddr = DES_GetInstAddr(6) Get address of inst #6's sample data.
Function:
With this function you can obtain the address of a given instrument's
sample data.
--------------------------------
DES_GetInstLength( instnum )
Example:
instlen = DES_GetInstLength(8) Get length of inst. #8's sample data.
Function:
You can obtain the length of a given instrument's sample data with this
function. Simply pass the slot number of the instrument and the length of
the instrument is returned. The length returned is the size in BYTES of
the sample data (not in words).
--------------------------------
DES_GetInstName( instnumber )
Example:
instname = DES_GetInstName( 3 ) Get name of instrument #3.
Function:
Gets the name of the specified instrument. Values for instnumber are
0..30 inclusive.
--------------------------------
DES_GetInstRepLen( instnum )
Example:
ireplen = DES_GetInstRepLen(3) Get repeat length for inst. #3.
Function:
Allows you to acquire the repeat length for a given instrument. Again,
the length returned is in BYTES, not words.
--------------------------------
DES_GetInstRepOff( instnum )
Example:
irepoff = DES_GetInstRepOff(1) Get repeat offset for inst. #1.
Function:
Allows you to acquire the repeat offset value for a given instrument.
Note that the offset returned is the offset in BYTES, not words.
--------------------------------
DES_GetItersLeft()
Example:
Iterleft = DES_GetItersLeft() Get # of remaining iterations.
Function:
This function returns the number of iterations of the play sequence that
are still to be played, including the iteration currently playing. This
function is only useful while a play sequence is active.
--------------------------------
DES_GetLockStat()
Example:
stat = DES_GetLockStat() Get current library lock status.
Function:
Returns the current lock status of the library, i.e. whether or not
someone has owned the library (with the DES_OwnPlayer() function) or not.
A return value of 0 means that the library is not locked and all functions
can be called. A value of 1 means that the library has been owned by
someone (perhaps even you) and certain functions that affect the song,
play sequence parameters, or player status are disallowed unless you are
the one who owned the library.
--------------------------------
DES_GetModFormat( [ [path]filename ] )
Examples:
mformat = DES_GetModFormat() Return format of loaded module.
mformat = DES_GetModFormat('Killer') Return format of module on disk.
Function:
Returns the format of a module. If no input is specified, then the
format of the currently loaded module is returned. If a filename with
optional pathname is provided, then the specified file on disk is
examined and it's format is returned. The file on disk will not be
loaded, nor will this function affect any currently loaded module. If no
pathname is specified then the current directory is searched for the file.
Failing that, each path in the library's list of search paths is scanned.
See the description of the DES_ModulePath() function further on in this
document.
--------------------------------
DES_GetModLength()
Example:
mlength = DES_ModLength() Get length of module in memory.
Function:
Returns the length in bytes of the currently loaded module. This
includes all instruments.
--------------------------------
DES_GetNewNoteHits()
Example:
newnotes = BITXOR( oldnotes,DES_GetNewNoteHits() ) Get new note hits.
Function:
This function is not terribly useful for ARexx programs, but I threw it in
here anyway. The library has four status bits (1 for each audio channel)
that record new note hits by toggling the bit between 0 and 1 each time a
new note is played in the corresponding audio channel. Combining these
bits together, a value from 0..15 is the result (bit 0 of the result is
channel #0, bit 1 is channel #1, etc). By remembering the previous state
of these bits from the last time you read them, you can determine which
channels received new note hits since you last checked by simply getting
the new states of the bits and exclusive-ORing them with the previous
state. The resulting set bits indicate that a new note was played in the
corresponding channel. However, in order to work properly, these bits
must be scanned at least 50-60 times a second, which is certainly asking
quite a bit from an ARexx script. Hmmm. I'll have to come up with
something better in the future.
--------------------------------
DES_GetNumPatts()
Example:
numpatts = DES_GetNumPatts() Get # of patterns in a module.
Function:
This function returns the number of unique patterns in the currently
loaded module. Patterns are each 256 bytes in length and contain
information for 64 notes to play in a single audio channel.
--------------------------------
DES_GetNumPos()
Example:
numpos = DES_GetNumPos() Get # of positions in a module.
Function:
Returns the number of play positions in the currently loaded module,
regardless of the start and end position settings. Positions are groups
of four patterns to play simultaneously - one for each audio channel.
--------------------------------
DES_GetPlayStat()
Example:
stat = DES_GetPlayStat() Get current play status.
Function:
This function returns the current status of the player. It currenty
returns one of four strings. They are "NO MODULE LOADED" (if no module is
currently loaded), "PLAYING" (if a module is loaded and a play sequence is
active), "PLAY SEQ DONE" (if a song has finished playing), and "IDLE" (if
a module is loaded but no play sequence is active).
--------------------------------
DES_GetSongAddr() (function no longer exists for release 2.00, lib v3.0)
Example:
addr = DES_GetSongAddr() Get address in memory of module.
Function:
This function no longer exists. Major internal redesign of the library's
file system resulted in there not actually being any one pointer to the song
in memory. The song is now rather here and there in memory, once loaded.
--------------------------------
DES_GlobalTempo( [newtempo] )
Examples:
call DES_GlobalTempo( -1 ) Reduce effective tempo by 1.
oldgtempo = DES_GlobalTempo( 2 ) Increase effective tempo by 2.
curgtempo = DES_GlobalTempo() Get current global tempo.
Function:
Sets/gets the global tempo. This is a delta adjustment made dynamically
to all tempo commands in a module. Negative values for the global tempo
make the module play faster, positive values make it play slower. A value
of zero returns play to "normal" speed.
--------------------------------
DES_GlobalVol( [newvolume] )
Examples:
call DES_GlobalVol( 64 ) Set maximum global volume.
oldgvol = DES_GlobalVol( 24 ) Set volume to 24, save old volume.
curgvol = DES_GlobalVol() Get current global volume.
Function:
Set the global playback volume. All volumes are scaled down
proportionately. newvolume is a value from 0..64 inclusive.
--------------------------------
DES_InstallMod( module )
Examples:
retval = DES_InstallMod( mod ) Assumes module loaded into var called "mod".
Function:
This function behaves just like the LoadModule function except that this
one will "load" a module that already resides in memory. This can be
very useful. For more details see the InstallModule() function in the
"LibFuncs.DOC" file.
--------------------------------
DES_InstVol( instnum [,volume] )
Examples:
call DES_InstVol( 3,32 ) Set volume of instrument #3 to 32.
oldvol = DES_InstVol( 3,32 ) Set new volume. save old volume.
curvol = DES_InstVol( 3 ) Get default volume of instrument #3.
Function:
Sets the default volume for the specified instrument. instnum is a value
from 0..30 inclusive. The optional volume is a value from 0..64
inclusive.
--------------------------------
DES_Iterations( [numiter] )
Examples:
call DES_Iterations( 3 ) Play sequence plays three times.
olditer = DES_Iterations( 2 ) Set to two iterations, save old
# of iterations.
curiter = DES_Iterations() Get current setting of iterations.
Function:
Set the number of iterations for the play sequence. numiters is a value
from 0..255 inclusive. A value of 0 will cause the play sequence to
iterate forever.
--------------------------------
DES_LoadModule( [path]filename )
Examples:
retval = DES_LoadModule('Mod:Hamsters') Loads module MOD:HAMSTERS.
retval = DES_LoadModule('Hamsters') Loads HAMSTERS from default path.
Function:
Attempts to load the specified module into memory. If no path is given,
then the current directory is searched for the file. If the file isn't
found, then each path entry in the library's linked list of search paths
is examined (see DES_ModulePath() function further down). Several library
parameters are modified every time a new module is loaded. These include
the global tempo (reset to 0), timing mode (unless auto-timing-detection
is turned off, otherwise it is set to the timing mode of the new module
or, if the module has no timing info in it, it is set to 50Hz), and the
loop intent flag (reset to 0 unless new module has loop info in it).
See the explanation of the "LoadModule" function in the file "LibFuncs.DOC"
for more detailed information on this function.
--------------------------------
DES_LoopIntent( loopflag )
Example:
loopflag = DES_LoopIntent() Return current loop flag status.
oldflag = DES_LoopIntent(1) Set loop flag on, save old flag condition.
Function:
This function has no real use to the library itself, but the library will
save this flag with the song when you use the library's SaveModule
function (Rexx equivalent is DES_SaveModule()). When the song is later
loaded, you can obtain the status of this flag and act accordingly. For
example, if you write a jukebox program, you can examine this flag when
you load a song, and if the flag is set, you can loop the song and fade it
out (by using the DES_Iterations() and DES_FadeGlobalVol() functions).
Other parameters that are saved with the song include timing mode (i.e.
50Hz or 60Hz timing), default tempo, and fine tempo. Just remember that
the library itself doesn't use this flag, but supports it so you can
use it to your own benefit. If a song is loaded that does not have this
flag information stored in it, then the flag defaults to non-looping (0).
--------------------------------
DES_ModulePath( [pathname|"-"] )
Example:
curpaths = DES_ModulePath() Return string of all search paths.
curpaths = DES_ModulePath("Mods:") Add path "Mods:" to list of paths.
curpaths = DES_ModulePaths("-") Remove all paths from path list.
Function:
This function replaces the (no longer available) DES_DefaultPath()
function. As of release 1.5, DES-Tracker now maintains an internal list of
search paths used when loading modules. You can add a path to this list with
this function by merely giving the name of the path (e.g. "mods:classics").
If the path you specify already exists in the list, then it will be
removed. Also, by giving the "-" character as the pathname, you will remove
all paths from the list.
See also the DES_LoadModule() function, elsewhere in this document.
--------------------------------
DES_OwnPlayer()
Example:
call DES_OwnPlayer() Noone else can make library calls now.
Function:
Lock library for private use.
--------------------------------
DES_PausePlay()
Example:
call DES_PausePlay() Pause currently active play sequence.
Function:
Pauses an active play sequence. Note that elapsed time is suspended as
well.
--------------------------------
DES_ResetDefaults()
Example:
call DES_ResetDefaults() Reset library parameters to defaults.
Function:
This function resets several library parameters to their default values.
This is a convenient routine, since an application using the library
before you may have left these parameters in an unpredictable state. By
simply calling this routine, you can reset the following library
parameters to the following default values:
Global volume = 64
Global tempo = 0
Fine tempo = 0
Default tempo = 6
Volume fade rate = 6
# of iterations = 1
Save format = Soundtracker v2.6
Timing mode = Native (50Hz for PAL Amigas, 60Hz for NTSC).
Auto-timing detect = ON
Loop intent flag = 0 (non-looping)
Lo-pass filter = OFF
By calling this function, you are saved the hassle of having to set these
parameters individually when you first open the library. Of course, this
should be one of the first functions you should call (perhaps just after
you call OwnPlayer(), see above).
--------------------------------
DES_SaveFormat( [0/1] )
Examples:
call DES_SaveFormat( 0 ) Set save format to Soundtracker v2.6.
oldfmat = DES_SaveFormat( 1 ) Set save format to Noisetracker v2.0.
curfmat = DES_SaveFormat() Get current save format setting.
Function:
This function allows you to select the module file format that will be
used by the SaveModule function. A format value of 0 specifies
Soundtracker v2.6 format, and a value of 1 specifies Noisetracker v2.0
format. The default format used when the library is opened for the first
time is 0 (Soundtracker v2.6 format).
--------------------------------
DES_SaveModule( [path]filename )
Examples:
retval = DES_SaveModule('Mod:Hamsters') Save module as MOD:HAMSTERS.
retval = DES_SaveModule('Hamsters') Save HAMSTERS using default path.
retval = DES_SaveModule() Save using load path & filename.
Function:
Saves the currently loaded module to disk under the specified filename.
The library will save your module in the currently selected file format
(see the DES_SaveFormat() function above). The library also adds extra
information above and beyond the scope of the standard Sound/Noisetracker
file format. An extra construct is appended to the end of the saved
module that includes playback information such as the timing mode (i.e.
50Hz or 60Hz playback speed), loop intent (indicates whether song is meant
to loop when it reaches the end or just stop), default tempo and fine
tempo. The DES_LoadModule() function looks for this info when it loads a
song module. If this info exists, it is automatically used (of course,
you can still load the saved module with the Sound/Noisetracker editor,
but the extra info will be thrown away by the editor and will not save it
back if you save the song from the Tracker editor).
Note also that, as of release 1.5 of DES-Tracker, you can now call
DES_SaveModule() without a file specification at all. DES-Tracker now
remembers the path and filename of a module when it is loaded. Not
passing a file specification will cause this function to save the module
over top of itself on disk.
See also the DES_LoadModule() and DES_ModulePath() functions elsewhere in
this document.
--------------------------------
DES_SetTemporalEnd( time ) (New for release 2.00, lib v3.0)
Examples:
call DES_SetTemporalEnd( 8*3600 ) Set end position to 8 minutes
from beginning of song.
call DES_SetTemporalEnd( 300*60 ) Set end to 300 seconds (10 minutes)
from beginning of song.
Function:
This function allows you to set the end position of a play sequence based
on time. You specify the time in units of 60ths of a second. This
is the time relative to the beginning of the song (at position 0, note 0).
Note however, that the time you specify is relative to the beginning of
the song (position 0, note 0) and NOT the current start position.
If you specify a time that precedes the current play sequence start
position, then the end position will be set to one note after the start
position.
--------------------------------
DES_SetTemporalPos( time ) (New for release 2.00, lib v3.0)
Examples:
call DES_SetTemporalPos( 3600 ) Set current position to 1 minute from
beginning of song.
call DES_SetTemporalPos( 30 ) Set current position to half a second
from beginning of song.
Function:
This function allows you to set the current position of a currently
playing (or playing, but paused) song based on time. Time is specified in
the same way as it is for the DES_SetTemporalEnd() function above. Note
however, that the time you specify is always relative to the beginning of
the song (position 0, note 0).
Time can only be specified within the current iteration of the song. If
you specify a time that goes beyond the last note of the song, then the
current position will be set to the last note of the song.
--------------------------------
DES_SetTemporalStart( time ) (New for release 2.00, lib v3.0)
Examples:
call DES_SetTemporalStart( 3*3600 ) Set start position at 3 minutes
from beginning of song.
call DES_SetTemporalStart( 5*60 ) Set start to 5 seconds from
beginning of song.
Function:
This function allows you to set the start position of a play sequence
based on time. Time is specified in the same way as with
DES_SetTemporalEnd() above.
If you specify a time that goes beyond the current play sequence end
position, then the start position will be set to one note before the end
position.
--------------------------------
DES_SongTitle( [newtitle] )
Examples:
call DES_SongTitle( 'HamsterDance' ) Retitle module as "Hamster Dance".
oldname = DES_SongTitle( 'Gerbil Funk') Retitle as "Gerbil Funk", get
old song title.
title = DES_SongTitle() Get title of currently loaded module.
Function:
Not much to say here. Sets/gets the title of the currently loaded
module. The length of the title is limited to 20 characters, because of
the soundtracker/noisetracker file format. This does not include a
terminating NULL, meaning that your title can be a full 20 characters in
length.
--------------------------------
DES_StartPos( [startpos] )
Examples:
call DES_StartPos( 0 ) Set start position of play seq to 0.
oldstrtpos = DES_StartPos( 4 ) Set start pos to 4, save old start pos.
curstrtpos = DES_StartPos() Get current start position.
Function:
Set start position of play sequence. Positions start at 0 and go up to
the number of positions in the currently loaded module.
--------------------------------
DES_StopPlay()
Examples:
call DES_StopPlay() Stop current play sequence!
rcode = DES_StopPlay() Stop play seq, remember error status.
Function:
Immediately stops the current play sequence. This function will also
reset the song position to the play sequence's defined start position.
You must use DES_BeginPlay() to start the play sequence up again
(DES_ContPlay() will not work).
--------------------------------
DES_TempoInterp( [interpretflag] )
Example:
oldinterp = DES_TempoInterp(0) Enable BPM tempo interpretation. Will
return old tempo interpretation as well.
Function:
This function allows you to set the tempo interpretation for the currently
loaded module. This setting affects the way tempo commands (the ones
embedded in the music data) are treated.
If tempo interpretation is set to 0 (the default) then tempos in the range
1..31 are treated as normal tempo values, while tempos in the range 32.255
are treated as "BPM" ("Beats" Per Minute) tempo values, where a "beat"
represents 4 note events (hence "16 beats to the bar"). You don't have to
really understand BPM tempos to use this command, however.
If tempo interpretation is set to 1 (non-BPM) then all tempos in the range
1..255 are treated as normal tempo values, and BPM tempos are disabled.
When you save the currently loaded module back to disk, this setting is
saved along with it. When you load the song from then on into
DES-Tracker, the setting will be detected and set automatically.
--------------------------------
DES_TimingMode( modenum )
Example:
oldmode = DES_TimingMode(1) Switch to PAL (50Hz) timing. Remember
old timing mode as well.
Function:
Since some song modules were composed on PAL Amigas using editors that
played music from the vertical blank, they would run at 60Hz (about 20%
faster) when played on the same editor on an NTSC Amiga. Since there is
no way to tell what type of system a song module was originally composed
on (i.e. NTSC or PAL) by looking at it. This function allows you to switch
the library's player between PAL and NTSC timing, i.e. 50 and 60 Hz. Note
that the old timing mode value is returned. A value of 0 specifies NTSC
timing and a value of 1 specifies PAL timing.
--------------------------------
DES_UnloadModule()
Example:
retval = DES_UnloadModule() Remove current module from memory.
Function:
Removes the currently loaded module from memory, if a module is loaded,
that is.
--------------------------------
DES_VolFadeRate( [newrate] )
Examples:
call DES_VolFadeRate( 8 ) Set nice, slow volume fade speed.
oldrate = DES_VolFadeRate( 2 ) Set to faster fade speed, remember
old fade rate.
currate = DES_VolFadeRate() Get current volume fade rate.
Function:
Sets/gets the rate at which volume fades transpire (see DES_FadeGlobalVol).
Values for newrate are from 0..255 inclusive. Lower values result in
faster fades. Values greater than 20 may require next of kin to hear
completely.
--------------------------------
End of RexxFuncs.DOC