This file contains two parts:

   I. Effects commands and music files formats.
  II. SWI's and commands of the Digital Symphony players.


   PART I : Effect commands and music file formats of some music programs
   ----------------------------------------------------------------------

1.1. Amiga ProTracker V1.1B Effect Commands
     --------------------------------------
     (x-y,z) indicates z is done if value not in the range x to y.
     <command number in hex> <effect value in hex>

     0 xy Normal play or Arpeggio.
          x: first halfnote to add to pitch
          y: second halftone to add to pitch

     1 xx Slide Up.
          xx: pitch increase step

     2 xx Slide Down.
          xx: pitch decrease step

     3 xx Tone Portamento. 
          xx: pitch slide speed (0 for previous speed)

     4 xy Vibrato.
          x: pitch change speed (0 for previous speed)
          y: pitch change depth (0 for previous depth)

     5 xy Tone Portamento + Volume Slide.
          x: volume increase step (priority)
          y: volume decrease step

     6 xy Vibrato + Volume Slide.
          x: volume increase step (priority)
          y: volume decrease step

     7 xy Tremolo.
          x: volume change speed (0 for previous speed)
          y: volume change depth (0 for previous depth)

     8 xx Not used.

     9 xx Set Sample Offset.
          xx: offset in sample DIV 256 (loop restarted if illegal)
              0 for previous offset

     A xy Volume Slide.
          x: volume increase step (priority)
          y: volume decrease step

     B xx Position Jump.
          xx: song position (0-127, masked, 0 if illegal)

     C xx Set Volume.
          xx: volume (0-64,rounded). Linear.

     D xy Pattern Break.
          10*x+y: position to jump to in next pattern (0-63, 0)

     E 0x Set Filter.
          x: filter on (0) or filter off (1) (or power LED on/off)

     E 1x Fine Slide Up.
          x: value to add to pitch

     E 2x Fine Slide Down.
          x: value to subtract from pitch

     E 3x Glissando Control.
          x: on (1) or off (0) (use with Tone Portamento)
          When off, the slide is smooth else from halfnote to halfnote

     E 4x Set Vibrato Waveform.
          x: sine (0), ramp down (1), square (2)
             bit 2 is off if wave form has to be restarted each note

     E 5x Set Fine Tune.
          x: new fine tune value

     E 6x Jump to Loop.
          x: jump to loop, play x times
             if 0, the loop start is set to the current pattern position

     E 7x Set Tremolo Waveform.
          x: sine (0), ramp down (1), square (2)
             bit 2 is off if wave form has to be restarted each note

     E 8x Not used.

     E 9x Retrig Note.
          x: retrig note each x vblanks

     E Ax Fine Volume Slide Up.
          x: value to add to volume

     E Bx Fine Volume Slide Down.
          x: value to subtract from volume

     E Cx Note Cut.
          x: cut note after x vblanks (volume is only set to 0)

     E Dx Note Delay.
          x: number of vblanks for note delay

     E Ex Pattern Delay.
          x: delay pattern x notes

     E Fx Invert Loop.
          x: speed
             if 0, it's turned off
          Care must be taken using it: it inverts the sign of sample data
          inside sample loop, one byte each vblank

     F xx Set Speed.
          xx: speed (1-31,ignored) or tempo (32-255)
              Tempo unit: 1/24th vblanks per minute (defaults to 125)
              This is the CIA set speed command version

1.2. Archimedes Tracker V1.0+++ Effect Commands
     ------------------------------------------                    
     (x-y,z) indicates z is done if value not in the range x to y.
     <command character> <command number in hex> <effect value in hex>

     0 00 xy Normal play or Arpeggio.
             x: first halfnote to add
             y: second halftone to subtract

     1 01 xx Slide Up.
             xx: pitch increase step (4 bits?)

     2 02 xx Slide Down.
             xx: pitch decrease step (4 bits?)
                                         
     B 0B xx Break Pattern.

     E 0E xy Set Stereo.
             y: stereo position (1-7,ignored). 1=left 4=center 7=right
             
     G 10 xx Volume Slide Up.
             xx: speed (4 bits?)

     H 11 xx Volume Slide Down.
             xx: speed (4 bits?)

     J 13 xx Position Jump.
             xx: song position (0-127,masked)

     L 15 xy Line Jump. (not in manual)
             Jump to line 10*x+y in same pattern. (10*x+y>63 ignored)

     S 1C xy Set Speed.
             y: speed (1-15,ignored)

     V 1F xx Set Volume.
             xx: volume (0-255). Logarithmic.

1.3. Archimedes Symphony V1.00 Effect Commands
     -----------------------------------------
     (x-y,z) indicates z is done if value not in the range x to y.
     <command number in hex> <effect value in hex>

     00 xyz Normal play or Arpeggio + Volume Slide Up.
            x: volume increase step
            y: first halfnote to add
            z: second halftone to add

     01 xyy Slide Up + Volume Slide Up.
            x: volume increase step
            yy: pitch increase step

     02 xyy Slide Down + Volume Slide Up.
            x: volume increase step
            yy: pitch decrease step

     03 xyy Tone Portamento. 
            yy: pitch slide speed (0 for previous speed)

     04 xyz Vibrato.
            y: pitch change speed (0 for previous speed)
            z: pitch change depth (0 for previous depth)

     05 xyz Tone Portamento + Volume Slide.
            y: volume increase step (priority)
            z: volume decrease step

     06 xyz Vibrato + Volume Slide.
            y: volume increase step (priority)
            z: volume decrease step

     07 xyz Tremolo.
            y: volume change speed (0 for previous speed)
            z: volume change depth (0 for previous depth)

     09 xxx Set Sample Offset.
            xxx: offset in sample DIV 128 (loop restarted if illegal)
                 0 for previous offset

     0A xyz Volume Slide + Fine Slide Up.
            x: value to add to pitch
            y: volume increase step (priority)
            z: volume decrease step

     0B xxx Position Jump.
            xxx: song position (0 if illegal)

     0C xyy Set Volume.
            yy: volume (0-64,rounded). Linear.

     0D xyy Pattern Break.
            yy: break position in next pattern (0-63, 0)

     0E xxx Not used.

     0F xxx Set Speed.
            xxx: speed (1-4095,ignored). Default is 6

     10 xxy Filter Control. (Not implemented)
            y: filter on (0) or filter off (1)

     11 xyy Fine Slide Up + Fine Volume Slide Up.
            x: value to add to volume
            yy: value to add to pitch

     12 xyy Fine Slide Down + Fine Volume Slide Up.
            x: value to add to volume
            yy: value to subtract from pitch

     13 xxy Glissando Control.
            y: on (1) or off (0) (use with Tone Portamento)
            When off, the slide is smooth else from halfnote to halfnote

     14 xxy Set Vibrato Waveform.
            y: sine (0), ramp down (1), square (2)
               bit 2 is off if wave form has to be restarted each note

     15 xxy Set Fine Tune.
            y: new fine tune value

     16 xxx Jump to Loop.
            xxx: jump to loop, play xxx times
                 if 0, the loop start is set to the current pattern position

     17 xxy Set Tremolo Waveform.
            y: sine (0), ramp down (1), square (2)
               bit 2 is off if wave form has to be restarted each note

     19 xxx Retrig Note.
            xxx: retrig note each xxx vblanks

     1A xyy Fine Slide Up + Fine Volume Slide Down.
            x: value to subtract from volume
            yy: value to add to pitch

     1B xyy Fine Slide Down + Fine Volume Slide Down.
            x: value to subtract from volume
            yy: value to subtract from pitch

     1C xxx Note Cut.
            xxx: cut note after xxx vblanks (volume is only set to 0)

     1D xxx Note Delay.
            xxx: number of vblanks for note delay

     1E xxx Pattern Delay.
            xxx: delay pattern xxx notes

     1F xxy Invert Loop.
            y: speed
               if 0, it's turned off
               Care must be taken using it: it inverts the sign of sample
               data inside sample loop, one byte each vblank

     20 xyz Normal play or Arpeggio + Volume Slide Down.
            x: volume decrease step
            y: first halfnote to add
            z: second halftone to add

     21 xyy Slide Up + Volume Slide Down.
            x: volume decrease step
            yy: pitch increase step

     22 xyy Slide Down + Volume Slide Down.
            x: volume decrease step
            yy: pitch decrease step

     2A xyz Volume Slide + Fine Slide Down.
            x: value to subtract from pitch
            y: volume increase step (priority)
            z: volume decrease step

     2B xyy Line Jump.
            yy: Line to jump to in same pattern. (0-63, 0)

     2F xxx Set Tempo.
            xxx: new tempo value (1-4095,ignored).
                 Unit: 1/20th vblanks per second (defaults to 1000)

     30 xxy Set Stereo.
            if y and 7 =0 then xx = stereo position (0-127 is 0 to 127,
                                    129-255 is -1 to -127, 128 ignored)
            if y and 7 >0 then y = stereo position (1-7,ignored).
                               1=left 4=center 7=right

     31 xxx Song Upcall.
            The CPU performs a linked branch to the song upcall vector.
            The routine can corrupt all registers and must preserve SVC mode
            on return using MOVS PC,R14
            Registers contain the following:
            R0= xxx
            R4= full note address + 4
            R5= voice number (0 to 7)

     32 xxx Unset Sample Repeat.
            The sample contines to be played until it ends, but without loops

2.1. Amiga ProTracker V1.1B Song/Module Format (Filetype &001)
     ---------------------------------------------------------
     Rem: files handled by Amiga ProTracker, NoiseTracker, SoundTracker,
          IntuiTracker, ...

     Offset  Bytes  Description
     ------  -----  -----------
        0     20    Songname. Trailing null bytes at the end.

     Information for sample 1-31:

     Offset  Bytes  Description
     ------  -----  -----------
       20     22    Samplename. Pad with null bytes.
       42      2    Length DIV 2. 
       44      1    Lower four bits: finetune value (signed 4 bits)
                    Upper four bits: not used (should be 0).
       45      1    Volume for sample 1. Range is &00-&40 (0-64).
       46      2    Repeat offset DIV 2.
       48      2    Repeat length DIV 2.

     Information for the next 30 samples starts here. It's just like the
     info for sample 1.

     Offset  Bytes  Description
     ------  -----  -----------
       50     30    Sample 2...
       80     30    Sample 3...
        .
        .
        .
      890     30    Sample 30...
      920     30    Sample 31...

     Offset  Bytes  Description
     ------  -----  -----------
      950      1    Songlength (1-128).
      951      1    Well... this little byte here is set to 127, so that old
                    trackers will search through all patterns when loading.
                    NoiseTracker uses this byte for restart, but we don't.
      952    128    Song positions 0-127. Each hold a number from 0-63 that
                    tells the tracker what pattern to play at that position.
     1080      4    The four letters "M.K." - This is something
                    Mahoney & Kaktus inserted when they increased the number
                    of samples from 15 to 31. If it's not there, the
                    module/song uses 15 samples or the text has been removed
                    to make the module harder to rip. Startrekker puts
                    "FLT4" or "FLT8" there instead. "M&K!" may be present,
                    too.

     Offset  Bytes  Description
     ------  -----  -----------
     1084    1024   Data for pattern 00.
        .
        .
        .
     xxxx  Number of patterns stored is equal to the highest pattern number
           in the song position table (at offset 952-1079).

     Each note is stored as 4 bytes, and all four notes at each position in
     the pattern are stored after each other.

     Position          Notes data
     -------- ------------------------------ 
        00    chan 1  chan 2  chan 3  chan 4
        01    chan 1  chan 2  chan 3  chan 4
        02    chan 1  chan 2  chan 3  chan 4
       etc.

     Info for each note:
     -------------------      
     bits 24-31: effect value (0-255).
          20-23: lower 4 bits of sample number (0-15).
          16-19: effect command number (0-15).
           8-15: lower 8 bits of note period (0-255).
           4- 7: upper 4 bits of sample number (0-1).
           0- 3: higher 4 bits of note period (0-3).

     Period table for Tuning 0, normal:
     ----------------------------------
       C-1 to B-1 : 856,808,762,720,678,640,604,570,538,508,480,453
       C-2 to B-2 : 428,404,381,360,339,320,302,285,269,254,240,226
       C-3 to B-3 : 214,202,190,180,170,160,151,143,135,127,120,113

     To determine what note to show, scan through the table until you find
     the same period as the one in the note. Use the index to look up in
     a notenames table.

     This is the data stored in a normal song. A packed song starts with the
     four letters "PACK".

     In a module, all the samples are stored right after the pattern data.
     To determine where a sample starts and stops, you use the sample info
     structures in the beginning of the file (from offset 20). Their format
     is linear signed.

     ProTracker CIA (Complex Interface Adapter) Timer Tempo Calculations
                                      AMIGA
     -------------------------------------------------------------------
     Fcolor                        = 4.43361825 MHz (PAL color carrier freq)
     CPU Clock   = Fcolor * 1.6    = 7.0937892  MHz
     CIA Clock   = CPU Clock / 10  = 709.37892  KHz
     50 Hz Timer = CIA Clock / 50  = 14187.5784
     Tempo num.  = 50 Hz Timer*125 = 1773447

     For NTSC: CPU Clock = 7.1590905 MHz --> Tempo num. = 1789773

      To calculate tempo we use the formula: TimerValue = 1773447 / Tempo
      The timer is only a word, so the available tempo range is 28-255 (++).
      Tempo 125 will give a normal 50 Hz timer (VBlank).

      A normal ProTracker VBlank song tempo can be calculated as follows:
      We want to know the tempo in BPM (Beats Per Minute), or rather quarter-
      notes per minute. Four notes makes up a quarternote.
      First find interrupts per minute: 60 seconds * 50 per second = 3000
      Divide by interrupts per quarter note = 4 notes * speed
      This gives: Tempo = 3000/(4*speed)
      Simplified: Tempo = 750/speed
      For a normal song in speed 6 this formula gives: 750/6 = 125 BPM

2.2. Archimedes Tracker V1.0+++ File Formats
     ---------------------------------------
     
     Sample chunk format
     -------------------
     This is the component of a Tracker sample file (Filetype &CB5).
     
       Field length Contents
       ------------ --------
          4 bytes   The string "SAMP"
          4 bytes   Chunk length (i.e. total size -8)
          4 bytes   The string "SNAM"
          4 bytes   Sample name length (20)
         20 bytes   Sample name padded with zero's
          4 bytes   The string "SVOL"
          4 bytes   Value 4
          4 bytes   Sample volume (0-255). Logarithmic
          4 bytes   The string "SLEN"
          4 bytes   Value 4
          4 bytes   Sample length (multiple of 4 otherwise Tracker crashes!)
          4 bytes   The string "ROFS"
          4 bytes   Value 4
          4 bytes   Repeat offset
          4 bytes   The string "RLEN"
          4 bytes   Value 4
          4 bytes   Repeat length
          4 bytes   The string "SDAT"
          4 bytes   Sample length (multiple of 4): xx
         xx bytes   Sample data in logarithmic format

       Note: the manual states that not all sub-chunks may be present. But
             until now they've always been there.

     Pattern chunk format
     --------------------
     This is the component of a Tracker pattern file (Filetype &FF1).
     
       Field length Contents
       ------------ --------
          4 bytes   The string "PATT"
          4 bytes   Chunk length (i.e. number of voices * 256 - the manual
                    says it's always 2048, that's false! ): xx
         xx bytes   Notes

         Each note is stored as 4 bytes, and all x notes at each position in
         the pattern are stored after each other.
     
         Position         Notes data
         -------- ---------------------------
            00    chan 1  chan 2  ...  chan x
            01    chan 1  chan 2  ...  chan x
            02    chan 1  chan 2  ...  chan x
           etc.

         Info for each note:
         -------------------      
         bits 24-31: note number (0-36).
              16-23: sample number (0-36).
               8-15: effect command number.
               0- 7: effect value (0-255).
     
         Note numbers table:
         -------------------
           C-1 to B-1 : 01 to 12
           C-2 to B-2 : 13 to 24
           C-3 to B-3 : 25 to 36

     Module format
     -------------
     This is the format of a Tracker module file (Filetype &CB6).
     
       Field length Contents
       ------------ --------
          4 bytes   The string "MUSX"
          4 bytes   Chunk length (i.e. total size -8)
          4 bytes   The string "TINF"
          4 bytes   Value 4
          4 bytes   Date of version in BCD format: YYYYMMDD (bytes 1 to 4)
          4 bytes   The string "MVOX"
          4 bytes   Value 4
          4 bytes   Number of voices (1-8)
          4 bytes   The string "STER"
          4 bytes   Value 8
          8 bytes   Default stereo positions for 8 channels. See the command.
          4 bytes   The string "MNAM"
          4 bytes   Tune name length (32)
         32 bytes   Tune name padded with zero's
          4 bytes   the string "ANAM"
          4 bytes   Author name length (32)
         32 bytes   Author name padded with zero's
          4 bytes   the string "MLEN"
          4 bytes   Value 4
          4 bytes   Tune length (1-128)
          4 bytes   the string "PNUM"
          4 bytes   Value 4
          4 bytes   Number of defined patterns (1-64)
          4 bytes   the string "PLEN"
          4 bytes   Value 64
         64 bytes   Length of each pattern (0-64)
          4 bytes   the string "SEQU"
          4 bytes   Value 128
        128 bytes   pattern number to be played at each position (0-63)

       This is followed by a pattern chunk for each defined pattern.
       After that, there is a sample chunk for each of the 36 samples.

       Note that such a file can contain more than one module (MUSX chunk)
       but practically it's very rare and not easy to handle...

       Such a format for a music module is a bit silly since nearly all
       chunks have a constant length.
   
2.3. Archimedes Symphony Module/Song Format
     --------------------------------------
     Such tunes are composed of a list of positions which refer to the
     pattern that has to be played through a given channel at that song
     position. It's possible to play nothing instead of a pattern.

     The ranges are as follows:
     --------------------------
     Voices: 1 to 8
     Tune length: 0 to 4096 (&1000)
     Pattern number: 0 to 4095 (&FFF)
     
     A pattern is composed of 64 notes.

     Each note is stored as 4 bytes (A 32 bit-word), and of course all notes
     are stored after each other.

     Position Notes data
     -------- ----------
        00      chan i
        01      chan i
        02      chan i
       etc.
     
     Info for each note:
     -------------------
     bits 20-31: effect value (0-4095).
          14-19: effect command number (0-63).
          13-13: not used for now (should be 0).
           6-12: sample number (0-63).
           0- 5: note number (0-36).

     Note numbers table:
     -------------------
       C-1 to B-1 : 01 to 12
       C-2 to B-2 : 13 to 24
       C-3 to B-3 : 25 to 36

     Sample file format (Filetype &10A)
     ----------------------------------
       Field length Contents
       ------------ --------
          8 bytes   The string "BASSSAMP". Byte value= ASCII code - 64
          1 byte    Version number (currently 0)
          1 byte    Name length: xx
         xx bytes   Name
          3 bytes   Length DIV 2
          3 bytes   Repeat offset DIV 2
          3 bytes   Repeat length DIV 2
          1 byte    Packing system (0= not packed, 1= packed)
         yy bytes   Data:
                    Packing=0 : logarithmic (yy=length)
                    Packing=1 : 13-bit LZW applied to sample data
                                differences (yy multiple of 4)
        0-3 bytes   Zero's to fill last file word

     Pattern file format (Filetype &FFD)
     -----------------------------------
       Field length Contents
       ------------ --------
          8 bytes   The string "BASSPTRN". Byte value= ASCII code - 64
          1 byte    Version number (currently 0)
          1 byte    Contents: 0 for a sequence, 1 for some patterns
        0-1 byte    Number of sequence lines (only if Contents=0): z
          2 bytes   Length: number of sequence positions
                    or number of patterns: xx
         yy bytes   Data:
                    Contents=0 : For each line
                                     For xx positions
                                         Pattern number (2 bytes each)
                                 (yy=2*xx*z)
                    Contents=1 : patterns data (yy=256*xx)

     Module/Song file format (Filetype &10B)
     ---------------------------------------
       Field length Contents
       ------------ --------
          8 bytes   The string "BASSTRAK". Byte value= ASCII code - 64
          1 byte    Version number (currently 0)
          1 byte    Number of voices (1 to 8): z
          2 bytes   Track length in positions: y (0 to &1000)
          2 bytes   Number of defined patterns: p (0 to &1000)
          3 bytes   Information text length: il

          For the 63 samples, we have:

       (  1 byte    Sample name length: sn
       (            (bit 7 set if all its data is blanked: lengths, vol, ft)
       (            (bit 6 reserved)
       (  3 bytes   Sample length DIV 2

          1 byte    Track name length: x
          x bytes   Track name
          8 bytes   Effects allowed table. 1 bit per effect (0=no, 1=allowed)
      If y>0 then
        ( 1 byte    Packing system for sequence (0= not packed, 1= packed)
        ( s bytes   Sequence data:
        (           Packing=0 : For each position
        (                           For each voice
        (                               Pattern number (2 bytes)
        (                       (s= 2*y*z)
        (           Packing=1 : 13-bit LZW applied to overall sequence data
        (                       (s multiple of 4)

      If p>0 then
        ( For each pk-pattern chunk (all 2000 patterns but the last):
        (       1 byte  Packing system for chunk (0= not packed, 1= packed)
        (       b bytes Pattern data:
        (               Packing=0 : For each pattern
        (                             For each pattern position (0 to 63)
        (                               Full note value (1 word)
        (                           (b= 4*64*pk)
        (               Packing=1 : 13-bit LZW applied to chunk data
        (                           (b multiple of 4)

          For the 63 samples, we have:

       ( sn bytes   Sample name
       (  3 bytes   Sample repeat offset DIV 2
       (  3 bytes   Sample repeat length DIV 2
       (  1 byte    Sample volume (0 to 64)
       (  1 byte    Sample fine tune (-8 to 7)
       (  1 byte    Packing system for sample (0= not packed, 1= packed)
       ( If sample length>0 then
       (   ( sy bytes Data:
       (   (          Packing=0 : logarithmic (sy= sample length)
       (   (          Packing=1 : 13-bit LZW applied to sample data
       (   (                      differences (sy multiple of 4)

      If il>0 then
        ( 1 byte    Packing system for information text
        (           (0= not packed, 1= packed)
        ( i bytes   Information text:
        (           Packing=0 : Text (i=il)
        (           Packing=1 : 13-bit LZW applied to information text
        (                       (i multiple of 4)

        0-3 bytes   Zero's to fill last file word




        PART II : Digital Symphony SWI's and commands information
        ---------------------------------------------------------

The following calls are used in the 1 music-player module (the one generated
by the Digital Symphony application) and in the multi music player module
(file DSymPlay).
These modules are Freeware. If you wish to use them in some commercial
software then write to the authors of Digital Symphony, we'll try do find an
arrangement for fees.

Nearly all SWI's should never be used while interrupting the player routine
(i.e. they're not reentrant). See the list for the SWI that allows to know
if the player routine has been interrupted or not.

You can call a SWI via this * command:

  *DSym <SWI name> [<R0 value> [<R1 value> <...> ]]

  Of course you can't get results this way.
  The unspecified values are set to 0 before calling the corresponding SWI.

  A value may be:
    - Any string readable by the OS_ReadUnsigned SWI (see the PRM).
    - The latter string preceeded by the minus sign for a negative number.
  You can specify a pointer to a string (i.e. when a file name is required)
  only for R0 value: just put the string between quotes.

Some examples:
  Set the overall volume to 64: *DSym Vol 64
  Load file $.MegaMix: *DSym Load "$.MegaMix"
  Set stereo of channel 2 to -127: *DSym Stereo 2 -&7F

Instead of installing the player module in RMA (that requires to have some
memory free, very annoying in demos), you could directly patch the module
into your code with or without linking it to RMA modules. In the latter case,
you could still use SWI's by calling a special routine with R11 containing
the SWI number. That is, if the module is located at label 'ModStart' you
can set the volume to 64 with the following lines:

               MOV R0,#64
               MOV R11,#2
               BL  ModStart+44

The advantages of using a generated 1 music-player is that only the useful
routines are included and its tune data is arranged to get more efficient
results through compaction.

These SWI's allow you to play tunes in your own programs and making sound
effects. While the tune is playing you can make additional sound effects
(produce 'custom notes') in the same way the tune does. In fact, you could
play a tune by producing notes stored in your own tables.
If you'd like to play your notes while the tune is playing, you can do it
on the voices used by the tune, but with some tunes there can be some clashes
with samples and notes. So it's preferable to play them on the free voices
(the ones with the highest number).
For example, with a tune with 3 rows in its sequence and 4 configured voices,
you could safely play your notes on the 4th voice.

Chunk name: DSym
Chunk base number: &45880

Should work on A5000's and current VIDC enhancers (i.e. no pitch bending)
without any additional code.

SWI DSym_Load does not work in the 1 music-player.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
SWI name         Nr !Entry                     !Exit/Effect
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Load             00 !R0=-1 to free RMA buffers !If an error occured, then
                    !or R0= 0 to load from     !   R0 points to error        
                    !         memory           !   and V is set,
                    !or R0 points to file name !else
                    !R1= source start address  !   R0= length of track
                    !    (if R0=0)             !       in memory.
                    !R2= 0 to load to RMA      !
                    !or R2= destination start  !
                    !       address            !
                    !R3= size of destination   !
                    !    buffer (if R2<>0)     !
                    !R4= 0 to claim buffer     !
                    !    in RMA                !
                    !or R4= start address of   !
                    !   buffer (32K space)     !
                    !A buffer address is needed only if the Symphony file
                    !contains some packed data.
--------------------+--------------------------+-----------------------------
RestartSong      01 ! -                        !Parameters are reset,
                    !                          !Tune position set to (0,0),
                    !                          !Tune playing again.
--------------------+--------------------------+-----------------------------
Vol              02 !R0= new overall volume    !R0= previous overall volume
                    !    or -1 to read         !    (0-64).
--------------------+--------------------------+-----------------------------
Stereo           03 !R0= voice number (0-7)    !R1= previous stereo position
                    !R1= new stereo position   !    (-127 to 127) for voice
                    !    or -128 to read       !    number R0.
--------------------+--------------------------+-----------------------------
CutNote          04 !R0= voice number (0-7)    !R1= previous note state on
                    !R1= -1 to read state      !    voice number R0
                    !  <>-1 to stop note       !   (0= stopped, <>0= playing)
--------------------+--------------------------+-----------------------------
PlayInstrPacked  05 !R0= voice number (0-7)    !The new note is put into the
                    !R1= full note data        !buffer to be played.
                    !R5= minimum sustain time  !Setting a sustain time means
                    !    (in 1/50th sec)       !that the new note has
                    !R6<>0 to wait for buffer  !priority on the tune notes
                    !      empty               !during this time.
                    !      else don't wait     !
--------------------+--------------------------+-----------------------------
PlayInstr        06 !R0= voice number (0-7)    !The new note is put into the
                    !R1= note number (0-36)    !buffer to be played.
                    !R2= sample number (0-63)  !Setting a sustain time means
                    !R3= effect number (0-63)  !that the new note has
                    !R4= effect value (0-&FFF) !priority on the tune notes
                    !R5= minimum sustain time  !during this time.
                    !    (in 1/50th sec)       ! 
                    !R6<>0 to wait for buffer  ! 
                    !      empty               ! 
                    !      else don't wait     !
--------------------+--------------------------+-----------------------------
ResetParams      07 ! -                        !All parameters are reset
                    !                          !(stereo,counters,effects,...)
                    !                          !and current notes cut on all
                    !                          !channels.
--------------------+--------------------------+-----------------------------
FlushOutput      08 ! -                        !The current notes on all
                    !                          !channels are cut.
--------------------+--------------------------+-----------------------------
FreezeOutput     09 !R0= -1 to read output     !R0= previous output status
                    !        status            !(  0= off i.e. nothing played
                    !   <>-1 to set            ! <>0= on )
--------------------+--------------------------+-----------------------------
UpCallVector     0A !R0= -1 to read upcall     !R0= previous upcall address
                    !       address            !
                    !  = -2 to set default     !
                    !  else set                !
--------------------+--------------------------+-----------------------------
MaskVoice        0B !R0= voice number (0-7)    !R0= previous voice status
                    !R1= -1 to read voice stat !    (0= off, <>0=on)
                    !  <>-1 to set voice status!The notes are still played
                    !                          !but not heard on the voice.
--------------------+--------------------------+-----------------------------
SongPos          0C !R0= -1 to read sequence ps!R0= previous sequence pos
                    !  <>-1 to set             !R1= previous pattern pos
                    !R1= -1 to read pattern pos!    (0-63)
                    !  <>-1 to set             !If pattern pos is changed
                    !                          !then the current counter is
                    !                          !reset to play the tune line
                    !                          !as soon as possible.
--------------------+--------------------------+-----------------------------
TuneControl      0D !R0= -1 to read status     !R0= previous tune status
                    !  <>-1 to set (lower byte)!    (0= off, <>0= on)
                    !                          !Off means the tune decoder
                    !                          !won't let play notes anymore,
                    !                          !you can still play custom
                    !                          !notes.
                    !                          !Current notes still playing.
--------------------+--------------------------+-----------------------------
Pause            0E ! -                        !The tune is stopped and
                    !                          !current notes on tune
                    !                          !channels cut.
--------------------+--------------------------+-----------------------------
Voices           0F !R0= -1 to read hardware   !R0= previous hardware voices
                    !       voices number      !    number (1,2,4 or 8)
                    !  <>-1 to set voices      !
                    !The change is taken into account during next configure.
--------------------+--------------------------+-----------------------------
Wait             10 !R0= voice number (0-7)    !C is set if custom note
                    !                          !buffer is not empty,
                    !                          !else clear.
--------------------+--------------------------+-----------------------------
IntState         11 ! -                        !C is set if the call has
                    !                          !interrupted the playing or
                    !                          !filling routines.
--------------------+--------------------------+-----------------------------
NoteInfo         12 ! -                        !R0= address of current notes
                    !                          !    table (1 word per voice)
                    !                          !    note is 0 to 1023
                    !                          !R1= address of current
                    !                          !    samples table (1 byte per
                    !                          !    voice)
                    !                          !    sample is 0 to 63
                    !                          !R2= address of effects table
                    !                          !    (1 word per voice)
                    !                          !    bits 30-31 meaningless
                    !                          !    bits 16-21 effect nr
                    !                          !    bits  0-11 effect value
                    !                          !R3= address of volumes table
                    !                          !    (1 byte per voice)
                    !                          !    volume is 0 to 64
--------------------+--------------------------+-----------------------------
VuBar            13 !R0= voice number (0-7)    !R1= Vu bar height (0-64)
--------------------+--------------------------+-----------------------------
Loop             14 !R0= -1 to read loop status!R0= previous loop status
                    !  <>-1 to set             !    (  0= enabled,
                    !                          !     <>0= disabled )
                    !                          !R1<>0 if the tune has looped
                    !                          !      else not looped
--------------------+--------------------------+-----------------------------
BufferAddress    15 ! -                        !R0= current system hardware
                    !                          !    buffer address (with
                    !                          !    output data interleaved)
--------------------+--------------------------+-----------------------------
VuGravity        16 !R0= -1 to read Vu gravity !R0= previous gravity of Vu
                    !  <>-1 to set (lower byte)!    bars (0-255)
                    !The change is taken into account during next configure.
--------------------+--------------------------+-----------------------------
SampleRate       17 !R0= -1 to read sample rate!R0= previous sample rate
                    !  <>-1 to set             !    (0-99) - determines
                    !                          !    sample output density.
                    !The change is taken into account during next configure.
--------------------+--------------------------+-----------------------------
Configure        18 !R0= -1 to reinstall previous
                    !       configuration      
                    !  <>-1 to configure the system
                    !       with new voices number,
                    !       sample rate and Vu gravity.
--------------------+--------------------------+-----------------------------
Params           19 !                          !R0= speed (1-&FFF)
                    !                          !R1= tempo (1-&FFF)
                    !                          !R2= counter (0-&FFE)
                    !The counter varies from 1 to speed-1 at a speed
                    !according to tempo (50 times a sec for default tempo)
--------------------+--------------------------+-----------------------------
TuneInfo         1A ! -                        !R0= tune length
                    !                          !R1= number of patterns
--------------------+--------------------------+-----------------------------
PlaySingle       1B !   R0= -1                 !   Play pattern R1
                    ! or                       ! or
                    !    R0<>-1                !    Play from pos R0 to R1
                    ! R2= -1 to not loop at end!
                    !   <>-1 to loop           !
                    !                          !
                    ! or R0=-1 and R1=-1       ! or Normal play.
                    !                          !
                    !                          !The pattern pos is set to 0.
                    !                          !In the case of playing a
                    !                          !part of the sequence, the
                    !                          !current position is set to
                    !                          !the first pos in that part.
--------------------+--------------------------+-----------------------------
DefaultStereo    1C !R0= voice number (0-7)    !R1= previous default stereo
                    !R1= new default stereo    !position (1 to 7) for
                    !    position              !voice number R0
                    !    or 0 to read          !
--------------------+--------------------------+-----------------------------

So, with such a tool in the hands of (good) demo and game writers, we hope
to see more and more demos and games with decent (if not very good) sound,
and never listen again to the horrible *noises* made by the previous lamer
samples replayers and SoundTracker player(s?) !!!

Our addresses are:
------------------
Bernard Jungen             Gil Damoiseaux
27, Friddericht            153, rue du Vivier
B-6706 Autelbas            B-6730 Rossignol
Belgium                    Belgium

 1992 B. Jungen & G. Damoiseaux for BASS.
