[comp.sys.atari.st] MV16 sound cartridge.

adm2@doc.ic.ac.uk (Alan David Messer) (06/18/91)

Hi,

	Well about a month ago,I posted a request for information about using
the MV16 sound cartridge,what comes with BAT,for playing samples.I receive
little response,unfortunately apart from Dave Lockwood <thanks Dave>.So I 
imagine,that not many people out there know how to use it,so after some work
,I have finally worked out how to use it <I think>.

	So what follows is a describtion of how to play samples through the
MV16 sound cartridge,which gives 16-channels of mono 8-bit sound!

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

The first thing that must be understood is that,because the MV16 plugs into the
cartridge port then it is not possible to write data directly to it along the
data bus.This is due to the MMU or GLUE,which has this area $FA0000 to $FBFFFF
marked as read-only.So what is needed is to find the way in which the volume
and channel data is passed to the cartridge.

Now as Dave,rightly pointed out,this is simply done by using the address lines.
So to send some data to the cartridge port,you simply place the data as the 
lower 1->15 bits of an address in the range $FA0000 to $FBFFFF and then when
you read this address,those lines are setup correctly.

NOTE:- That the cartridge port is Word addressed and so even though the address
may be described as bits 0->23,the zero bit is not used in the cartridge port
,so that even addresses are always used! And the higher bit`s describe the
cartridge port area of 128k at $FA0000.So this gives us the bits 1->15 thru
the cartridge port.

Now all that was needed was to work out which of the bits 1->15 did what,with
a MV16 plugged in.To do this,I sat down with my trustly electronics/computer
reference books,a ST and a disassembled MV16 and se about some reverse
engineering!

And this is what I found.Firstly bits 1->4 ,of the address,denote what channel
to use.And secondly the bits 5->12,of the address,denote the volume data to
play on that channel.So an addresses bit pattern looks like this:

	Bit  1  1  1  1  1  1  0  0  0  0  0  0  0  0  0  0
             5  4  3  2  1  0  9  8  7  6  5  4  3  2  1  0
        ----------------------------------------------------
        $FA  #  #  #  D  D  D  D  D  D  D  D  C  C  C  C  #
        ----------------------------------------------------
         |   |     |  |                    |  |        |  |
    Higher   < N/A >  < volume data 8-bits >  < channel>  Not used     
     Bits
     Give
     $FA

So to play the data 10101010 on channel 16 (1111) then you only need to use:

	MOVE $FA155E,R0 where $FA155E is the hex (111110100001010101011110)
                                                  |      |   |      ||  |
                                                  < $FA  >   <volume><ch>

And it`s as easy as that... 

	So if you`re thinking of producing some sort of sample playing program,
either commercial or PD,please include support for the MV16 sound cartridge!!!

NOTE:- To test if the cartridge is present,play a note of zero volume and if you
can a none zero value back then it's there,I think...

NOTE:- These are only provisional outcomings and are not guaranteed to be 
       perhaps after the summer,if there are any correction needed then a newer
       version will be published... If you wish to upload load this to a archive
       or BBs please feel free.
--
+----------------------------+------------------------------------------------+
| Alan Messer.               | Janet:    adm2@doc.ic.ac.uk                    |
| Dept. of Computing,        | Internet: adm2%doc.ic.ac.uk@nsfnet-relay.ac.uk |
| Imperial College,          | BITNET:   adm2%doc.ic.ac.uk@ukacrl             |