Spectrum Progress #02
19 января 1997

Entries programmer - the musical programming of the processor AY-8912/10.

<b>Entries programmer</b> - the musical programming of the processor
 AY-8912/10.
  (C) Dennis Parinov, 1997.



  Music processor includes 16 registers. 14 were used to 
generate sound. 


  In order to put in the register of musical coprocessor are 
any data, you must: 

1) Select a register to record data


   LD BC, # FFFD

   LD A, the register number 0 - 13

   OUT (C), A

2) write data


   LD BC, # BFFD

   LD A, kakoe any number 0 - 255

   OUT (C), A


  To read the data from the register must:

1) Select a register to record data


   LD BC, # FFFD

   LD A, the register number 0 - 13

   OUT (C), A
2) read data

   IN A, (C)


  The first six registers are used to
set the pitch of each channel of
range 0 - 4095.

  Registers R0, R1 - frequency sound channel A.

  Registers R2, R3 - frequency sound channel B.

  Registers R4, R5 - frequency sound channel C.


  Register R6 - determines the frequency output

  noise for the three channels from a range of 0 - 31.


  Register R7 - controls audio channels

  d7d6d5d4d3d2d1d0

   xx prohibits the sounding channel A.

                   prohibits the sounding of the channel B.

                   prohibits the sounding of the channel C.

                   prohibits noise channel A.

                   prohibits noise channel B.

                   prohibits noise channel C.


  The following three registers are used to
set the volume in the range 0 - 15.
4-th bit indicates that the volume will be
changing the way specified in R13 and with
speed indications in R11/R12.


  Register R8 - determines the volume of channel A.

  Register R9 - determines the volume of channel B.

  Register R10 - determines the volume of the channel C.


  Registers R11, R12 - determine the rate of
change the volume from 0 to 65535. (On
Practice change reg. R11 malooschutimo,
so it suffices to specify only reg. R12)


  Register R13 - uprovlyaet formation
envelope of output signal:

 # 0, # 1, # 2, # 3, # 9 - fading, then quietly;
 # 4, # 5, # 6, # 7, # F - growth, then quietly;
 # B - decay, then loudly;
 # D - the increase, then zromko;
 # 8 - recurring decay;
 # C - repeated growth;
 # E - repeated growth and

      damping;
 # A - recurring decay and

      growth;


  And now a few examples demonstrating the legend.


  Before applying to the program in the register A
need to record the effect of number from 1 to 4.

, BT: A - number of effect from 1 - 4.

AY_EFF LD HL, EFFECT1; Calculate

        LD BC, # 000E; starting address
NEFF ADD HL, BC; effect next

        DEC A; for selected.

        JP NZ, NEFF;

        DEC HL; HL at the end of the chosen
                           ; Nnogo effect.

        LD A, # 0D; Start with reg-ra R13

        LD C, # FD;
NREG LD B, # FF; Select Registry AY

        OUT (C), A; for recording data.

        LD B, # BF; entry in the register AY

        OUTD; bytes of (HL) and

                           , A reduction in HL 1.

        DEC A; Reduced rates

                           ; Register AY, if

        JP P, NREG; he Є 0, continue.

        RET; Otherwise exit.

; Effect is used in various boot'ah at
; Startup programs.

EFFECT1 DEFW # 0080, # 0001, # 0000; tone frequency

   ; For channels A, B, C

        DEFB # 00; frequency noise

        DEFB # 38; 00111000 Off. noise.

        DEFB # 10, # 10, # 10; loudly. channel. A, B, C

        DEFW # 1500; volume change

        DEFB # 01; damping

, The effect of the program Honey Commander.

EFFECT2 DEFW # 203C, # 2064, # 208C

        DEFB # 00

        DEFB # 38

        DEFB # 10, # 10, # 10

        DEFW # 0810

        DEFB # 01

; Effect 2 of Honey Commander.

EFFECT3 DEFW # 2050, # 2060, # 2070

        DEFB # 01

        DEFB # 00

        DEFB # 10, # 10, # 10

        DEFW # 0400

        DEFB # 01

; Effect reminiscent of rotation of the blades
; Helicopter.

EFFECT4 DEFW # 0000, # 0000, # 0000

        DEFB # 00

        DEFB # 07

        DEFB # 10, # 10, # 10

        DEFW # 0100

        DEFB # 0E


  In conclusion, about one bad moment.
Sometimes when reading from the disk from the speakers is heard
buzz - this is due to the fact that the programmer does not 
choke muz.protsessor. Usually, do this again to initialize the 
player tunes. 

  In any case, we present a program stifles muz.protsessor.

RES_AY LD HL, # 0D00

        LD DE, # FFBF

        LD C, # FD
RES_AY1 LD B, D

        OUT (C), H

        LD B, E

        OUT (C), L

        DEC H

        JP P, RES_AY1

        RET


                       *




Other articles:

From the Editor - Cheat Sheet - information on the management of the magazine.

From the Editor - The authors worked on the second issue of Spectrum Progress.

Toolkit - An article about the new operating system OS DOMAIN.

Toolkit - The article on the instrumental system for Spectrum "THE GRAPHIC ADVENTURE CREATOR".

Toolkit - An article about how to work the system to develop games Adventyurnyh "THE GRAPHIC ADVENTURE CREATOR".

Toolkit - Manual program "XPLAYER 78".

Toolkit - Instructions for use software package "ZX-WINWORD", intended for the preparation of illustrated texts.

Game room - Novella to the new national game "RETURN TO HOME 4.

Game room - a brief description of the new national game "RETURN TO HOME 4.

Game room - Novella and the description of the game "DEMON'S REVENGE".

Entries programmer - the musical programming of the processor AY-8912/10.

Entries programmer - Basic programming API for Domain OS.

piece of iron - "SPRINTER-97: Specifications.

piece of iron - "SPRINTER-97: Video System.

piece of iron - "SPRINTER-97": graphic accelerator.

Contest - The contest for the best name for your new computer r. "PETERS".

News - Information about the game "RETURN TO HOME 5" (Deadly worlds invasion Torostoidov) game is a continuation of "RETURN TO HOME 4.

News - information about a new text editor "TEXTWRITER" demo.

News - impressions of the failure ENLIGHT'97.

Aquarius - Programmers ... in terms of approach to work.

Forum - Information about the computer network SPbZXNet in St. Petersburg.

Forum - questionnaires, Alexei Lebedev (CONDOR SOFT) among users of ZX Spectrum in 1997

Forum - Interview with the famous Yaroslavl programmer Romanov R. (NICODIM).

Forum - An interview with Nikolay Noskov and Ivan Makarchenko, creators of "PETERS".

Advertising - free advertising and ad ...


Темы: Игры, Программное обеспечение, Пресса, Аппаратное обеспечение, Сеть, Демосцена, Люди, Программирование

Similar articles:
Amiga Club - compare the performance of Amigo and PC. As far as Amiga relevant in today's games?
Games TOP 10 - The best ten game programs from DOC'a and Sanalex'a.
All life is a game - Novella to the game "Operation RR" (End).
Advertising - Hedgehogs and worldwide sales of CD-R discs.
Iron - KAY: ZX Spectrum Ttransformer.

В этот день...   3 May