Opening - Programming the music processor AY 3-8910.

Faultless #03
 ╔═══════════════════ ═══════════════════╗
  ║Section:Opening;                      ║
  ║Article:Programming AY 3-8910;     ║
  ║Text: Vorozhkin Alexander.            ║
  ╚═══════════════════ ═══════════════════╝


   In this section I will tell you about the program
  mmmming the music processor. For
  There are two controls for the music processor
  port with address #FFFD - selection address
  register and with address #BFFD - port address
  for reading. The music processor has
  16 eight-bit registers, numbered
  reserved from R0 to R15. In order to
  write data to any of the registers,
  you need to do the following operations:

   LD BC,#FFFD ;Reselection port address
                   hystra
   LD A,N ;Register number
   OUT (C),A ;Register select
   LD B,#BF ;Address for data selection
                   (C = #FD)
   LD A,N ;Data
   OUT (C),A ;Write data to register

   Now I would like to explain to you in detail
  thread purpose of all registers:

   R0 - R5 ;Form three pairs for
                   setting the pitch.
                   For each of the three
                   catch: R0,R1 - channel A;
                   R2,R3 - channel B;R4,R5 -
                   channel C. In these pairs
                   only 12 is used
                   bit, thus numberdetermining height
                   sound lies within
                   from 0 to 4095.
 
   R6 ;Sets the white frequency
                   noise.To set the noise
                   younger ones are used
                   6 bits from 0 to 5.
   R7 ;Controls the mixer
                   channels. Junior three bi-
                   they are used for
                   digital output control
                   that tone for everyone
                   from three channels.Bits
                   3,4,5 are used for
                   output control hour-
                   totes of noise. Bits 6 and 7
                   prohibition of input functions
                   yes.

   R8 - R10 ;Control amplitude
                   sound accordingly in
                   channels A, B, C. Volume
                   lies between 0
                   up to 15 that is, using
                   The least significant 4 bits are present.

   R11 - R12 ;Form a pair and set
                   envelope speed.Is-
                   use all 16 bits
                   these registers. In them
                   you can write down the values
                   range from 0 to 65535.Than
                   the higher the number, the more
                   rate of change ogi-
                   beating.
   R13 ;Envelope generator.Is-enjoys younger 4
                   bit: bit 0 - delay;
                   bit 1 - interleaving;
                   bit 2 - attack; bit 3 -
                   continuation.
   R14 - R15 ;When programming to
                   the sound does not affect.
                   used to manage
                   data bus connection and porting
                   input/output areas.

   It is also possible with the help of a music processor
  playback of digital audio. To reproduce
  works are used 4-bit re-
  Sound amplitude meter, from R8 to R10. For
  as an example we give a program to reproduce
  number of digital images:
   D.I.
   LD HL,Address
   LD DE,Length
   LD BC,#FFFD
   LD A, Channel ;8 - A,9 - B,10 - C
   OUT(C),A
   LD B,#BF ;_OUT1
   LD A,(HL)
   OUT(C),A
   LD B, Delay ; from 1 to 255
   DJNZ$
   INC HL
   DEC DE
   LD A,D
   OR E
   JR NZ,_OUT1
   EI
   RET
   I think the explanation for this example is
  will not be required.
   AY is only capable of playing 4
  bit sound. For higher quality reproduction
  works are used such devices-
  properties like COVOX,SOUNDRIVE,ULTRAVOX.

Share your thoughts about the article