

        =================================================================
                             FA10 Sequencer Commands
                                  05/02/97 -med

        **** Note: The Sequencer commands are specific to the FA10 series 
        audiometers Do not rely on the sequencer commands to be available 
        in future instruments. 

        Command                                                    Number
        ----------------------------------------------------------------- 
        Get Sequencer Data                                       ****  20
        --------
         1014 H            The number 20 + 1000H
         0003 H            Three command words follow
         nnnn              Sequencer buffer number 
         iiii              Sequencer index
         ssss              Number of bytes to read
         zzzz              Inverted checksum

        Response
        --------
         9014 H            The number 20 + 9000H (-28652)
         cccc              Command size (variable count)
         nnnn              Sequencer buffer number 
         iiii              Sequencer index
         ssss              Number of bytes read
         xxxx              Sequencer data
         ....
         zzzz              Inverted checksum


        Each tone sequencer has an array of 255 bytes assigned to it. 
        Since the RS232 interface cannot read the full 255 bytes possible 
        in the sequencer array, the Get Sequencer Data command allows 
        portions of the array to be read by specifying the starting index 
        and the number of bytes you wish to read. The maximum number of 
        bytes that you can read in one chunk is 199. Attempting to read 
        more than 199 bytes will cause a command error to occur and the 
        command will be ignored. Sequencer 0 is left channel, 1 is right. 

        For more information of the format of the sequencer data and 
        operation of the sequencer program, refer to the sequencer 
        program description.













                                        1


        ----------------------------------------------------------------- 
        Set Sequencer Data                                        **** 21
        --------
         1015 H            The number 21 + 1000H
         cccc              Command size (variable count)
         nnnn              Sequencer buffer number 
         iiii              Sequencer index
         ssss              Number of bytes read
         xxxx              Sequencer buffer data 
         ....
         zzzz              Inverted checksum

        Since the RS232 interface cannot write the full 255 bytes 
        possible in the sequencer array, the Set Sequencer Data command 
        allows portions of the array to be written by specifying the 
        starting index and the number of bytes you wish to write followed 
        by the data to be written. The maximum number of bytes that you 
        can write in one chunk is 199. Attempting to write more than 199 
        bytes will cause a command error to occur and the command will be 
        ignored. Sequencer 0 is the left channel, 1 is right.

        The Sequencer data array can be updated while the sequencer is in 
        operation. This provides a mechanism to extend the sequencer 
        program size beyond the maximum 255 bytes by reloading the 
        sequencer data on-the-fly. The ability to load only a portion of 
        the sequencer array is key to this ability. 






























                                        2


        Command                                                    Number
        ----------------------------------------------------------------- 
        Get Sequencer Index                                       **** 22
        --------
         1016 H            The number 22 + 1000H
         0001 H            One data word follows
         nnnn              Sequencer buffer number 
         zzzz              Inverted checksum

        Response
        --------
         9016 H            The number 22 + 9000H (-28650)
         0001 H            One data word follows
         nnnn              Sequencer buffer index 
         zzzz              Inverted checksum

        Normally the sequencer will start at index zero, but the actual 
        starting index can be changed with the Set Sequencer Index 
        command. The Sequencer data can also be updated on-the-fly. To do 
        this though, it is required that the current index position of 
        the sequencer be known so that new program data will not 
        overwrite data currently in use. 

        The Get Sequencer Index function allows the current sequencer 
        index to be read to help prevent this problem. Overwriting 
        program data won't hurt the instrument, but it may cause the 
        sequencer program do strange things. Setting the sequencer index 
        to 255 will cause the sequencer program to terminate (the index 
        is set to zero, and sequence enable flag is turned off). 
        Sequencer 0 is left channel, 1 is right.


        ----------------------------------------------------------------- 
        Set Sequencer Index                                       **** 23
        --------
         1017 H            The number 21 + 1000H
         0002 H            Two data words follow
         nnnn              Sequencer buffer number 
         xxxx              Sequencer index
         zzzz              Inverted checksum

        Each tone sequencer has an array of 255 bytes assigned to it. 
        Normally the sequencer will start at index zero, but the actual 
        starting index can be changed with the Set Sequencer Index 
        command. The index can also be changed while the sequencer is in 
        operation if you need to do that. Sequencer 0 is the left 
        channel, 1 is right.









                                        3


        Command                                                    Number
        ----------------------------------------------------------------- 
        Get Sequencer Enable                                      **** 24
        --------
         1018 H            The number 24 + 1000H
         0001 H            One data word follows
         nnnn              Sequencer buffer number 
         zzzz              Inverted checksum

        Response
        --------
         9018 H            The number 24 + 9000H (-28648)
         0001 H            One data word follows
         nnnn              Sequencer enable flag
         zzzz              Inverted checksum

        Each sequencer can be turned on or off at any time. The Get 
        Sequencer Enable command allows the current operational condition 
        of the sequencer to be read. If the specified sequencer is on, 
        the response will be non-zero. If the sequencer is off, the 
        response will be zero. Sequencer 0 is left channel, 1 is right.


        ----------------------------------------------------------------- 
        Set Sequencer Enable                                      **** 25
        --------
         1019 H            The number 25 + 1000H
         0002 H            Two data words follow
         nnnn              Sequencer buffer number 
         xxxx              Sequencer enable flag
         zzzz              Inverted checksum


        Each sequencer can be turned on or off at any time. The sequencer 
        will start at the current index position. If the sequencer played 
        all the way to the end, the sequencer index will be set to 
        position zero. If the index position is not changed with the Set 
        Sequencer Index command, then the sequencer will start at 
        location zero. Sequencer 0 is the left channel, 1 is right.

















                                        4


        ----------------------------------------------------------------- 
        Get Sequencer Control Array                               **** 26
        --------
         101A H            The number 26 + 1000H
         0001 H            One data word follows
         nnnn              Sequencer buffer number 
         zzzz              Inverted checksum

        Response
        --------
         901A H            The number 20 + 9000H (-28646)
         0021 H            33 data words follow
         nnnn              Sequencer buffer number 
         xxxx              Sequencer control data
         ....
         zzzz              Inverted checksum

        ;format of control var array    <-- sequence control flags
        ;(0)  : sequence control flags  <  Bit0: 0=quiet, 1=play
        ;(1)  : Note style #1           <  Bit1: 0=Normal 1=Staccato
        ;(2)  : Note style #2           <  Bit2: 0=stereo 1=L+R (mono)
        ;(3)  : Note style #3           <  Bit3: 0=tone   1=NBN
        ;(4)  : Note style #4           <  Bit7: 0=flat   1=compressed
        ;(5)  : *reserved               <other bits currently unused
        ;(6)  : Counter #1              <----------------------------- 
        ;(7)  : Counter #2
        ;(8)  : Counter #3
        ;(9)  : Counter #4
        ;(10) : SEQNDX : Note Index        <--------------------
        ;(11) : SEQFRQ : Note Frequency    < these are updated
        ;(12) : SEQOCT : Note Octave       < each time a new   
        ;(13) : SEQDON : Note Duration On  < 'Note' is read
        ;(14) : SEQDOF : Note Duration Off <--------------------
        ;(15) : SQXDON : Work Duration On  <-- Working vars, used for
        ;(16) : SQXDOF : Work Duration Off <-- note loop timing
        ;(17) : SEQFCK : Filter Clock Cnt  <-------------------- 
        ;(18) : SEQFCP : Filter Clock Pre  <-- Filter clock stuff
        ;(19->29): *reserved
        ;(30) : Gosub stack index   <--------------------
        ;(31) : Gosub stack         <-- the gosub stack 
        ;(63) : End of Gosub stack  <-- handles calls

        Each sequencer has a control array of 64 bytes associated with 
        it. The control array may be read at any time to observe the 
        status of the operation. Sequencer 0 is the left channel, 1 is 
        right.

        This command is provided primarily for a diagnostic tool, and is 
        not intended for general purpose operation. The format and 
        operation of the control table may change in future instruments.






                                        5


        Command                                                    Number
        ----------------------------------------------------------------- 
        Get Sequencer Activity Information                        **** 27
        --------
         101B H            The number 26 + 1000H
         0000 H            No data follows
         EFE4 H            Inverted checksum

        Response
        --------
         901B H            The number 27 + 9000H (-28645)
         0003 H            Three data words follow
         xxxx              Sequencer activity information
         ....
         zzzz              Inverted checksum


        The returned array is an array of three integers (two bytes each) 
        in the following form:

           Enables [0]   
             Bit 0 : left sequencer enable
             Bit 1 : right sequencer enable
             Bit 2-15 : (not used)

           Index 1 [1] : Left Sequencer
                           Low byte  = Current index 
                           High byte = Current control flags 

           Index 2 [2] : Right sequencer      
                           Low byte  = Current index 
                           High byte = Current control flags 


        Each sequencer can be turned on or off at any time. The sequencer 
        will start at the current index position. If the sequencer played 
        all the way to the end, the sequencer index will be set to 
        position zero. If the index position is not changed with the Set 
        Sequencer Index command, then the sequencer will start at 
        location zero.

        Where more than one sequencer is in operation at the same time, 
        it may be desirable to obtain the enable/disable condition and 
        the current index position of the active arrays. The Get 
        Sequencer Activity Information command provides the current 
        enable flag conditions and index positions of all the sequencers.



        History: 04/27/92 -med created
                 05/02/97 -med revised
        <eof>




                                        6
