home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Acorn User 1
/
AU_CD1.iso
/
demos
/
s_to_z
/
symphony
/
PlayModule
/
!Help
/
Help
< prev
next >
Wrap
Text File
|
1995-02-20
|
21KB
|
308 lines
<title>Help : Digital Symphony Play Module</title>
<h1>Digital Symphony Play Module</h1><br>
The DSymPlay module provides all the code necessary for programmers of any level
to play Symphonies from within their own code. The module allows control of the
Symphony track using SWIs or from the command line, via the commands listed below.<br><br>
The module is provided so that including a soundtrack created by Digital Symphony in either
a game, or demo, etc... is a trivial task, which will be performed well, using little
processor time.
<hr>
<h2>More Details</h2><br>
Any registered owner of Digital Symphony may apply (by sending a disc and SAE to Oregan)
for further, more technically specific details about using the module. An additional
new version of the module will be supplied, which is optimised for ARM 3 use.
<hr>
<h2>Copyright</h2><br>
Copyright of the Digital Symphony play modules is owned by Oregan Software Developments,
and BASS. However the modules may be used freely in Freeware productions, but a licence
must be applied for when used in commercial, or Shareware products.<br><br>
Licences may be granted free of charge to registered Digital Symphony users, but in the
case of commercial use, a one off licence fee of £100 may be imposed.<br><br>
Please direct all applications to:<br><br>
<i>Oregan Software Developments<br>
36 Grosvenor Avenue<br>
Streetly<br>
Sutton Coldfield<br>
B74 3PE<p>
Tel: 0121 353 6044<br>
Fax: 0121 353 6472<br>
<hr>
<hr>
<h2>SWI Details</h2>
<r0>
<br>SWI Chunk name: DSym
<br>SWI Chunk base number: &45880
<br>
<br>-----------------------------------------------------------------------------
<br>SWI name Nr |Entry |Exit/Effect
<br>-----------------------------------------------------------------------------
<br>Load 00 |R0=-1 to free RMA buffers |If an error occured, then
<br> |or R0= 0 to load from | R0 points to error
<br> | memory | and V is set,
<br> |or R0 points to file name |else
<br> |R1= source start address | R0= length of track
<br> | (if R0=0) | in memory.
<br> |R2= 0 to load to RMA |
<br> |or R2= destination start |
<br> | address |
<br> |R3= size of destination |
<br> | buffer (if R2[]0) |
<br> |R4= 0 to claim buffer |
<br> | in RMA |
<br> |or R4= start address of |
<br> | buffer (32K space) |
<br> |A buffer address is needed only if the Symphony file
<br> | contains some packed data.
<br> |Buffers are word aligned.
<br> |In the case of packed data, the source and destination
<br> | buffers can't share any part of memory.
<br> |In the case of entirely non packed data, the two buffers
<br> | can share a part of memory provided
<br> | destination address [= source address. After the call
<br> | the source data has been altered because the
<br> | module needs to build an internal structure different
<br> | to the source structure of the tune.
<br> |Although the code is quite optimized, loading from
<br> | memory may take some time because all the data has to
<br> | be moved in memory. So don't expect loading 50 songs
<br> | per second with an ARM2|
<br>-----------------------------------------------------------------------------
<br>RestartSong 01 | - |Do a ResetParams,
<br> | |Tune position set to (0,0),
<br> | |Tune playing again.
<br>-----------------------------------------------------------------------------
<br>Vol 02 |R0= new overall volume |R0= previous overall volume
<br> | or -1 to read | (0-64).
<br> |Initial value is 64 |
<br>-----------------------------------------------------------------------------
<br>Stereo 03 |R0= voice number (0-7) |R1= previous stereo position
<br> |R1= new stereo position | (-127 to 127) for voice
<br> | or -128 to read | number R0.
<br> | |
<br> |Initial values are those of the Amiga.
<br>-----------------------------------------------------------------------------
<br>CutNote 04 |R0= voice number (0-7) |R1= previous note state on
<br> |R1]=0 to read state | voice number R0
<br> | [ 0 to stop note | [ 0 -] stopped
<br> | | ]=0 -] playing, = sample
<br> | | start address
<br> | |If R1]=0 then
<br> | | R2= offset in sample
<br> | | in 1/(2^12) units
<br>-----------------------------------------------------------------------------
<br>PlayInstrPacked 05 |R0= voice number (0-7) |The new note is put into a
<br> |R1= full note data |1-entry-per-voice buffer to be
<br> |R5= minimum sustain time |played.
<br> | (in 1/50th sec) |Setting a sustain time means
<br> |R6[]0 to wait for buffer |that the new note has
<br> | empty |priority on the tune notes
<br> | else don't wait |during this time.
<br>-----------------------------------------------------------------------------
<br>PlayInstr 06 |R0= voice number (0-7) |The new note is put into a
<br> |R1= note number (0-36) |1-entry-per-voice buffer to be
<br> |R2= sample number (0-63) |played.
<br> |R3= effect number (0-63) |Setting a sustain time means
<br> |R4= effect value (0-&FFF) |that the new note has
<br> |R5= minimum sustain time |priority on the tune notes
<br> | (in 1/50th sec) |during this time.
<br> |R6[]0 to wait for buffer |
<br> | empty |
<br> | else don't wait |
<br>-----------------------------------------------------------------------------
<br>ResetParams 07 | - |All parameters are reset
<br> | |(stereo,counters,effects,...)
<br> | |and do a FlushOutput.
<br>-----------------------------------------------------------------------------
<br>FlushOutput 08 | - |The current notes on all
<br> | |channels are cut.
<br>-----------------------------------------------------------------------------
<br>FreezeOutput 09 |R0= -1 to read output |R0= previous output status
<br> | status |( 0= off ie. no sound output
<br> | []-1 to set | []0= on )
<br>-----------------------------------------------------------------------------
<br>UpCallVector 0A |R0= -1 to read upcall |R0= previous upcall address
<br> | address |
<br> | = -2 to set default |
<br> | else new address |
<br>-----------------------------------------------------------------------------
<br>MaskVoice 0B |R0= voice number (0-7) |R0= previous voice status
<br> |R1= -1 to read voice stat | (0= off, []0=on)
<br> | []-1 to set voice status|The notes are still played
<br> | |but not heard for the voice.
<br>-----------------------------------------------------------------------------
<br>SongPos 0C |R0= -1 to read sequence ps|R0= previous sequence pos
<br> | []-1 to set |R1= previous pattern pos
<br> |R1= -1 to read pattern pos| (0-63)
<br> | []-1 to set |If pattern pos is changed
<br> | |then the current counter is
<br> | |reset to play the tune line
<br> | |as soon as possible.
<br>-----------------------------------------------------------------------------
<br>TuneControl 0D |R0= -1 to read status |R0= previous tune status
<br> | []-1 to set (lower byte)| (0= off, []0= on)
<br> | |Off means the tune decoder
<br> | |won't let play notes anymore,
<br> | |you can still play custom
<br> | |notes.
<br> | |Current notes still playing.
<br>-----------------------------------------------------------------------------
<br>Pause 0E | - |The tune is stopped and
<br> | |current notes on tune
<br> | |channels cut.
<br>-----------------------------------------------------------------------------
<br>Voices 0F |R0= -1 to read hardware |R0= previous hardware voices
<br> | voices number | number (1,2,4 or 8)
<br> | []-1 to set voices |
<br> |The change is taken into account during next configure.
<br> |Initial value is 4.
<br>-----------------------------------------------------------------------------
<br>Wait 10 |R0= voice number (0-7) |C is set if custom note
<br> | |buffer is not empty,
<br> | |else clear.
<br>-----------------------------------------------------------------------------
<br>IntState 11 | - |C is set if the call has
<br> | |interrupted the playing or
<br> | |filling routines.
<br>-----------------------------------------------------------------------------
<br>NoteInfo 12 | - |R0= address of current notes
<br> | | table (1 word per voice)
<br> | | note is 0 to 1023
<br> | |R1= address of current
<br> | | samples table (1 byte per
<br> | | voice)
<br> | | sample is 0 to 63
<br> | |R2= address of effects table
<br> | | (1 word per voice)
<br> | | bits 30-31 meaningless
<br> | | bits 16-21 effect nr
<br> | | bits 0-11 effect value
<br> | |R3= address of volumes table
<br> | | (1 byte per voice)
<br> | | volume is 0 to 64
<br>-----------------------------------------------------------------------------
<br>VuBar 13 |R0= voice number (0-7) |R1= Vu bar height (0-64)
<br>-----------------------------------------------------------------------------
<br>Loop 14 |R0= -1 to read loop contrl|R0= previous loop control
<br> | []-1 to set | ( 0= enabled,
<br> |R1= -1 to read loop flag | []0= disabled )
<br> | []-1 to set |R1[]0 if the tune has looped
<br> | | else not looped
<br> | |
<br> |Loop control is initially enabled.
<br> |If a song has looped and the loop is disabled, you can
<br> |continue playing using TuneControl.
<br>-----------------------------------------------------------------------------
<br>BufferAddress 15 | - |R0= current system hardware
<br> | | buffer address (with
<br> | | output data interleaved)
<br> | | 208 bytes per channel
<br>-----------------------------------------------------------------------------
<br>VuGravity 16 |R0= -1 to read Vu gravity |R0= previous gravity of Vu
<br> | []-1 to set (lower byte)| bars (0-255)
<br> |Initial value is 2. |
<br> |The change is taken into account during next configure.
<br>-----------------------------------------------------------------------------
<br>SampleRate 17 |R0= -1 to read sample rate|R0= previous sample rate
<br> | []-1 to set | (0-99) - determines
<br> | | sample output density.
<br> |Original value is 24. |
<br> |The change is taken into account during next configure.
<br>-----------------------------------------------------------------------------
<br>Configure 18 |R0= -1 to reinstall previous
<br> | configuration
<br> | []-1 to configure the system
<br> | with new voices number,
<br> | sample rate, Vu gravity and hardware speed.
<br>-----------------------------------------------------------------------------
<br>Params 19 | |R0= speed (1-&FFF)
<br> | |R1= tempo (1-&FFF)
<br> | |R2= counter (0-&FFE)
<br> |The counter varies from 1 to speed-1 at a speed
<br> |according to tempo (50 times a sec for default tempo)
<br>-----------------------------------------------------------------------------
<br>TuneInfo 1A | - |R0= tune length
<br> | |R1= number of patterns
<br>-----------------------------------------------------------------------------
<br>PlaySingle 1B | R0= -1 | Play pattern R1
<br> | or | or
<br> | R0[]-1 | Play from pos R0 to R1
<br> | |
<br> | and |
<br> | R2= -1 for no loop |
<br> | []-1 to loop |
<br> | |
<br> | or R0=-1 and R1=-1 | or Normal play.
<br> | |
<br> | |The pattern pos is set to 0.
<br> | |In the case of playing a
<br> | |part of the sequence, the
<br> | |current position is set to
<br> | |the first pos in that part.
<br>-----------------------------------------------------------------------------
<br>DefaultStereo 1C |R0= voice number (0-7) |R1= previous default stereo
<br> |R1= new default stereo |position (1 to 7) for
<br> | position |voice number R0
<br> | or 0 to read |
<br> | |
<br> |Initial values are those of the Amiga.
<br>-----------------------------------------------------------------------------
<br>InstrData 1D |R0= sample number (1-63) |The specs for sample R0
<br> |R1= sample data address |are changed to those on entry
<br> | or -1 to read |R1= previous address
<br> |R2= sample length |R2= previous length
<br> | or -1 to read |R3= previous repeat offset
<br> |R3= repeat offset |R4= previous repeat length
<br> | or -1 to read |R5= previous volume
<br> |R4= repeat length |R6= previous finetune
<br> | or -1 to read | (-8 to 7)
<br> |R5= volume (0-64) |
<br> | or -1 to read |
<br> |R6= finetune (0-&F) |
<br> | or -1 to read |
<br> |R1 to R4 must be 2-byte aligned.
<br> |Put a repeat length of 0 for no repeats.
<br> |Repeat length can't be 2.
<br> |Set bit 31 of R1 if the sample is signed linear.
<br> |The data is not moved i.e. it stays where you put it.
<br> |The data is also scaled to the current machine volume if
<br> |R1[]-1.
<br>-----------------------------------------------------------------------------
<br>HardSpeed 1E |R0= samples output |R0= previous parameter
<br> | frequency (in kHz) |R1= current hardware speed
<br> | or 0 for 'auto speed' | (in kHz)
<br> | or -1 to read |The buffer filling routine
<br> | |output frequency is changed
<br> | |to the one on entry
<br> |Initial mode is 24000 |
<br> |The change is taken into account during next configure.
<br> |
<br> |In 'auto speed' mode, the filling routine will try to
<br> |guess the current VIDC frequency for outputting samples
<br> |by averaging the number of calls to it and adjust its
<br> |tables to always have the same real pitch whatever the
<br> |hardware speed is. The 'auto speed' selects one of the
<br> |three following speeds currently:
<br> |
<br> | 24000 kHz (normal modes)
<br> | 25175 kHz (VGA modes)
<br> | 36000 kHz (multi sync modes)
<br> |
<br> |Too bad to have the same clock for graphics and sound|
<br>-----------------------------------------------------------------------------
<br>LoopType 1F |R0= loop type |R0= previous loop type
<br> | or -1 to read | (0 or 1)
<br> | |
<br> |Type 0: The loop flag is set if the tune reaches
<br> | position 0.
<br> |Type 1: The loop flag is set if the tune jumps to
<br> | a lower position.
<br>-----------------------------------------------------------------------------
<br>FillAddress 20 | - |R0= address of buffer filling
<br> | | routine
<br>-----------------------------------------------------------------------------
</r0>
<br><br><br><br><br>