[comp.sys.amiga] Audio copper Instructions

nor1675@dsacg2.UUCP (Michael Figg) (06/29/89)

[Reposting of an article I don't think ever got out. Maybe it was the day
I pulled the plug on 64 users.]

Help! I'm trying to write a simple audio digitized sample player using the
copper. I have been hacking some code from a PD demo called 'dark' on fish
160 or 161. 'Dark' plays with both sprites and audio do it is hard to pick    
out what I need and don't need, as far as the copper instructions go. This 
might not be the best way to approach it but is a learning experience so I
want to finish it before trying to do it a better way, like using the   
regular audio routines and probably Rob Pecks' Audiotools. My questions now
are what really needs to be done to get the raw sample data into the 
registers? I understand (or atleast think I understand) the "CMOVE' macro
(along with CINIT and CEND)  but as far as I can tell this only crates the
copper instructions but doesn't execute them. I would think I would need to
merge the instructions (MrgCop) but since I'm not doing any graphics there
really isn't anything else to merge with. It would also seem that since I'm
not doing any graphics that I wouldn't need a view or viewport, but it seems
that all the copper functions depend on these. Am I even heading in the 
right direction? Any help would be appreciated. Thanks.

				    --Mike Figg

				      

-- 
-- 
"Hot Damn! Groat Cakes Again                   Michael Figg
Heavy on the thirty weight!"                   DLA Systems Automation Center
                                               Columbus, Oh.
                                               (614)-238-9036

wade@pnet01.cts.com (Wade Bickel) (07/01/89)

nor1675@dsacg2.UUCP (Michael Figg) writes:
>registers? I understand (or atleast think I understand) the "CMOVE' macro
>(along with CINIT and CEND)  but as far as I can tell this only crates the
>copper instructions but doesn't execute them. I would think I would need to
>merge the instructions (MrgCop) but since I'm not doing any graphics there
>really isn't anything else to merge with. It would also seem that since I'm
>not doing any graphics that I wouldn't need a view or viewport, but it seems
>that all the copper functions depend on these. Am I even heading in the 
>right direction? Any help would be appreciated. Thanks.

        Please don't take this wrong, but you need to study the function of
the copper a little more.  For simple applications what you do is use the
CINIT macro to start a USER copper list.  Then place the instructions you want
into the copper list using CWAIT and CMOVE, and end the list with the CEND
macro.  Then assign the list to the UCopList field of the ViewPort you wish to
use and then call MrgCop() which takes the copper lists found in the
ViewPort(s), merges them together (MakeVPort() creates some copper lists which
can be found in other feilds of the ViewPort), and assigns them to the View
copperlist pointers (actually there is one level of indirection from the View
pointers, but that's not really important here).  At this point a call to
LoadView() will activate the complete copperlists, which will include your
copperlist.

        If you need more help, send me E-Mail, and I'll elaborate, or pass
your questions to associates who are very experianced with the Copper/Blitter.
You may want to reconsider using the Copper for audio, as it is a beam sync
machine and may cause some problems when used with audio.


                                                        Have Fun,


                                                               Wade.

UUCP: {nosc ucsd hplabs!hp-sdd}!crash!pnet01!wade
ARPA: crash!pnet01!wade@nosc.mil
INET: wade@pnet01.cts.com