Abstract:
A time-divisional data register comprises a shift register and a latch and is used for transferring data from a first apparatus operating at a relatively high speed to a second apparatus performing a time-divisional processing at a relatively low speed or long first period. The shift register operating at a second period shorter than the first period fetches data transmitted from the first apparatus with a designated time-divisional channel to which the data is to be assigned, stores the fetched data at a storage position corresponding to the designated channel and then outputs repetitively the stored data for each channel in turn at the second period. The latch latches the outputs from the shift register and outputs the latched data in synchronism with tile processing period of each channel in the second apparatus.

Description:
This is a continuation of application Ser. No. 07/748,103 filed on Aug. 21, 1991, now abandoned. 
    
    
     BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     The present invention relates to a time-divisional register for temporarily storing data to be used in respective time-divisional channels when time-divisional processing is performed and, more particularly, to a time-divisional data register used for asynchronously transferring data from a first apparatus (e.g., a CPU) to a second apparatus (e.g., a sound source of an electronic musical instrument) for performing time-divisional processing at a relatively long period. 
     2. Description of the Prior Art 
     In a digital electronic musical instrument, the operations of the overall apparatus are controlled using a central processing unit (CPU). In this case, the CPU fetches data from respective operation members such as a keyboard, a pedal, and the like, and forms musical tone control data for controlling synthesis of tones on the basis of these operation member data. The CPU then transfers the formed data to a sound source. In order to allow polyphonic tone generation without complicating a circuit arrangement as much as possible, the sound source performs time-divisional processing with which a memory, an arithmetic circuit, and the like can be shared by a plurality of channels. 
     FIG. 7 shows a conventional time-divisional data register for transferring data such as tone control data from the CPU to the sound source in the electronic musical instrument. FIG. 4B shows operation timings of the respective sections of the register. The sound source executes 16-channel time-divisional processing at a 1-25-μs processing period T A  for each channel, i.e., at a relatively long time-divisional period T D  of 20 μs for 16 channels, so as to allow polyphonic tone generation of 16 tones. 
     In FIG. 7, a 16-stage shift register 1 is driven in response to a clock CLKA, and sequentially shifts data supplied to an input terminal IN and those stored in the respective stages to an output side at the period T A . More specifically, data supplied to the input terminal IN is transmitted to an output terminal OUT with a delay of 16×T A  (=T D ). 
     In FIG. 4B, a clock CLKA is a clock having the period T A  (1.25 μs), and a clock CLKD is a clock having the period T D  (=16×T A  =20 μs). 
     In FIG. 7, a selector 2 is normally applied with an L-level signal at its select terminal SA, selects data DTA supplied to an input terminal B, and supplies the selected data to the input terminal IN of the shift register 1. More specifically, data written in the shift register 1 is normally circulated at the time-divisional period T D , and tone forming data of corresponding channels are sequentially output in synchronism with the processing period T A  of each time-divisional channel in the sound source. 
     When data DTA to be supplied to the sound source is to be rewritten, a CPU (not shown) supplies new data DATA, a number CH of a time-divisional channel whose data is to be rewritten with the new data, and an L-level write instruction signal R/W. The data DATA is supplied to a latch 3, the channel number CH is supplied to a channel timing coincidence detection circuit 4, and the write instruction signal R/W is supplied to an inverter 5. The write instruction signal R/W is set at L level since it designates a normal read mode at H level. 
     The latch 3 latches the data DATA in response to the leading edge of the clock CLKD. The channel timing coincidence detection circuit 4 comprises a channel counter (not shown) for counting the clock CLKA. When a channel number as a count value of the channel counter coincides with the channel number CH sent from the CPU, the circuit 4 outputs an H-level coincidence signal CT. FIG. 4B shows a case wherein the channel number CH designated by the CPU is 5. 
     The H-level coincidence signal CT is supplied to one input terminal of an AND gate 6. On the other hand, the other input terminal of the AND gate 6 receives an H-level signal obtained by inverting the L-level write instruction signal R/W by the inverter 5. Therefore, the output from the AND gate 6 goes to H level, and is supplied to the select terminal SA of the selector 2. Thus, the selector 2 selects the output data supplied from the latch 3 to its input terminal A, and supplies the selected data to the input terminal IN of the shift register 1. The respective stages of the shift register 1 fetch data at their input side in response to the leading edge of the clock CLKA. More specifically, data in first to 15th stages of the shift register 1 are shifted by one stage at a timing corresponding to the channel number CH (=5) designated by the CPU, and are stored in the second to 16th stages. At the same time, the data DATA latched by the latch 3 is written in the first stage of the shift register 1. 
     In this manner, in the conventional time-divisional data register, an access time for rewriting one data is equal to one time-divisional period T D  (=20μs). More specifically, an apparatus which transfers data (e.g., a CPU) cannot execute next write processing until a timing corresponding to a channel to which data to be transferred of an apparatus which receives data (e.g., a sound source) is reached, and the data write processing is ended. For this reason, the CPU may have to wait for a maximum of 2×T D  =40 μs until one data is written in a given channel. In particular, when a plurality of data are to be written, a long time is undesirably required for write processing. 
     When, e. g. , the CPU directly writes data in a plurality of channels without using the latch 3, if data are written in all the 16 channels, a total of a wait time until a timing corresponding to the first channel, and a write time requires a maximum of 2T D , and a long time is required for write processing again. 
     When a plurality of peripheral devices which perform time-divisional processing at different periods are connected, it is difficult to perform parallel data transfer between time peripheral devices and a first apparatus so as to shorten a processing time in the first apparatus. 
     SUMMARY OF THE INVENTION 
     It is an object of the present invention to provide a time-divisional data register and a method for asynchronously transferring data from a first apparatus such as a CPU to a second apparatus such as a sound source for performing time-divisional processing at a relative low speed, which register can shorten an access time from the first apparatus. 
     It is a second object of the present invention to provide a time-divisional data register and a method which, when a plurality of peripheral devices for performing time-divisional processing at different periods are connected, can adjust access times from the first apparatus, and hence, can perform parallel data transfer between the peripheral devices and the first apparatus so as to shorten a processing time. 
     In order to achieve the above objects, in a time-divisional data register and a method for asynchronously transferring data from a first apparatus to a second apparatus for performing time-divisional processing of a plurality of channels at a relatively long first period, data transmitted from the First apparatus is fetched and written to be temporarily stored in time-divisional data storage means at a relatively high speed, and thereafter, a processing period is converted to a low-speed period according to time-divisional processing. 
     According to the present Invention, after data from the first apparatus for transferring data is fetched and stored at a relatively high speed, the data is transferred at a timing matching with a time-divisional speed of the second apparatus for receiving data. Therefore, tile first apparatus does not require a long processing time for data write (transfer) processing. 
     The present invention preferably applied to an electronic musical instrument. 
     Since the write period of the first apparatus can be set to be different from the time-divisional period of the second apparatus, if a plurality of peripheral devices are connected, the access periods from the first apparatus to the respective peripheral devices can be set to be the same or to have a predetermined integer ratio. Therefore, since parallel accesses to the respective peripheral devices can be made by time division, a time required to access from the first apparatus to each peripheral device can be shortened. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a block diagram showing the overall arrangement of an electronic musical instrument according to an embodiment of the present invention; 
     FIG. 2 is a block diagram showing in detail a sound source circuit shown in FIG. 1; 
     FIG. 3 is a block diagram showing in detail a time-divisional data register shown in FIG. 2; 
     FIG. 4A is a timing chart of operations of the respective sections of the time-divisional data register shown in FIG. 3; 
     FIG. 4B is a timing chart of operations of respective sections of a conventional time-divisional data register shown in FIG. 7; 
     FIG. 5 is a block diagram showing in detail a timing generator shown in FIG. 3; 
     FIG. 6 is a timing chart showing operations of respective sections in the timing generator shown in FIG. 5; and 
     FIG. 7 is a block diagram showing an arrangement of the conventional time-divisional data register. 
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT 
     An embodiment of the present invention will be described hereinafter with reference to the accompanying drawings. 
     FIG. 1 is a block diagram showing the overall arrangement of an electronic musical instrument according to an embodiment of the present invention. 
     This electronic musical instrument controls the overall operations using a central processing unit (CPU) 11. The CPU 11 is connected, through a bidirectional bus line 12, a program memory 13 for storing a control program for the CPU 11, and various data necessary for generating tones, a working memory 14 for storing various data generated when the CPU 11 executes the control program, a key state detection circuit 15 for detecting key operations on a keyboard, and generating key code data KC representing an operated key, a key ON signal KON or a key OFF signal KOF representing an operation state of the operated key, key velocity data KV representing a key ON speed, and the like, and a sound source 16. The sound source 16 is connected to a sound system 17. 
     FIG. 2 shows in detail the sound source 16 shown in FIG. 1. 
     In the sound source shown in FIG. 2, a register of the conventional sound source shown in FIG. 7 is replaced with a register shown in FIG. 3 as a characteristic feature of the present invention. 
     In FIG. 2, a phase generator 22 receives key code data KC, and a key ON signal KON from the CPU 11 (FIG. 1) via a register 21, and determines phase data of a tone waveform to be generated in accordance with the key code data KC. The phase generator 22 generates the determined phase data in accordance with a transfer timing of the key ON signal KON. 
     An address generator 23 receives phase data IP from the phase generator 22, and also receives tone color data TC, key velocity data KV, a key OFF signal KOF, key code data KC, and a key ON signal KON from the CPU 11 via the register 21. The generator 23 generates an address for reading out tone waveform data from a waveform memory 24 on the basis of these data. In this case, the address generator 23 determines a storage area of tone waveform data in the waveform memory 24 on the basis of the tone color data TC, the key velocity data KV, and the key code KC, determines a read address in the determined storage area on the basis of the phase data IP, and starts generation of the address in response to the key ON signal KON. In addition, the tone waveform data is switched to a predetermined key OFF waveforth in response to the key OFF signal KOF. 
     An envelope generator 25 receives the same tone color data TC, key velocity data KV, key OFF signal KOF, key code data KC, and key ON signal KON as those received by the address generator 23 from the CPU 11 via the register 21, and generates envelope waveform data on the basis of these tone color data TC, key velocity data KV, and key code data KC. The key ON signal KON serves as a start signal for generation of envelope waveform data, i.e., a tone, and the key OFF signal KOF serves as a start signal of tone muting processing. 
     A multiplier 26 multiplies the tone waveform data supplied from the waveform memory 24 with the envelope waveform data supplied from the envelope generator 25, thus providing an envelope to the tone waveform. 
     An accumulator 27 adds 16 tone waveform data time-divisionally outputted through the multiplier 26. Thus, 16 tones are acoustically mixed. Output data from the accumulator 27 is supplied to the sound system 17 (FIG. 1). 
     The sound system 17 comprises a D/A converter, an amplifier, a loudspeaker, and the like (not shown). The sound system 17 converts the output data from the accumulator 27 into an analog signal, and amplifies the analog signal, thereby driving the loudspeaker. Thus, a mixed tone of tones formed by the 16 time-divisional channels of the sound source 16 is produced from the loudspeaker as an acoustic tone. 
     FIG. 3 shows in detail the register 21 in FIG. 2, and FIG. 4A shows timings of operations of the respective sections of the register shown in FIG. 3. 
     The register shown in FIG. 3 uses, as clocks for driving a shift register 1 and a latch 3, high-speed clocks CLKB and CLKC whose periods are 1/4 those of the clocks CLKA and CLKD in the prior art shown in FIG. 7, and is constituted by adding, to the period art shown in FIG. 7, a latch 7 for latching transfer data, at a period closer to the time-divisional processing prior T A  of the sound source, sequentially outputted from the shift register 1 in correspondence with the respective time-divisional channels at a period T B  (=0.3125 μs) of the clock CLKB, a timing generator 8 for generating a clock TM for fetching transfer data, and a delay circuit 9 for fetching the output from the latch 7 in response to the leading edge of the clock CLKA having the period T A  (=1.25 μs), and holding the fetched data for one period defined between the leading edges of the two adjacent clocks CLKA. 
     In the register shown in FIG. 3, write processing of data from the CPU 11 (FIG. 1), and data circulating processing in the shift register 1 and a selector 2 are performed in substantially the same manner as in the prior art except that these processing operations are performed at a high speed four times those in the prior art since the clocks CLKB and CLKC are faster by four times than the conventional clocks CLKA and CLKD. Note that data are arranged in the shift register 1 in the order of channels 0, 4, 8, C, 1, 5, 9, D, 2, 6, A, E, 3, 7, B, and F in hexadecimal notation, as shown in FIG. 4A, so that data can be sequentially outputted from the delay circuit 9 in the order from the channel 0 to the channel 15 (F in hexadecimal notation). On the other hand, data may be arranged in the shift register 1 in the order of channels 0 to F. In this case, time-divisional processing in the sound source is executed in the order of channels 0, 4, 8, . . . , B, and F. In the following description, the channel number CH is expressed by hexadecimal notation. 
     In the register shown in FIG. 3, read processing is executed every four clocks CLKB in principle. In this case, however, data of only four channels of the 16 channels are repetitively read out. Thus, as shown in FIG. 4A, the read clock TM is delayed by one clock CLKB (one channel) every time data of four channels are read out. After data for the 16 channels are read out, a delay time of three clocks caused by reading out data for the 16 channels are restored. 
     FIG. 5 shows an arrangement of the timing generator for generating the read clock TM. 
     In FIG. 5, a pulse generator 51 generates pulses P11, P12, P13, and P14 which go to H level in turn for a 1/2 period of the clock CLKD, as shown in FIG. 6. 
     As shown in FIG. 6, a pulse generator 52 generates pulses P21 which have the period T A  of the clock CLKA, whose width is slightly narrower than 1/2-T A , and whose leading edges are synchronous with the pulses P11 to P14. The generator 52 also generates pulses P22, P23, and P24 whose phases are sequentially shifted by one period T B  of the clock CLKB from the pulses P21. 
     An AND gate 53 outputs four pulses P21 having a phase delay of 0 while the pulse P11 corresponding to the first 1/4 period of the clock CLKD is at H level. AND gates 54 to 56 output four pulses P22 to P24 each respectively having phase delays of 1T B  to 3T B  while the pulses P12 to P14 corresponding to the second to fourth 1/4 periods of the clock CLKD are at H level. 
     The outputs from these AND gates 53 to 56 are mixed by an OR gate 57, thereby obtaining the timing pulse TM, as shown in FIG. 4A. The phase of the timing pulse TM is slightly delayed from the clock CLKA. 
     Referring back to FIG. 3, the latch 7 fetches output data DTB from the shift register 1 in response to the leading edge of the pulse TM outputted from the timing generator 8, and outputs it as latched data DTC. 
     The delay circuit 9 fetches the output data DTC from the latch 7 in response to the leading edge of the clock CLKA, and outputs it as data DTA in response to the leading edge of the next clock CLKA. The output data DTA is held until it is updated with data for the next channel at the leading ledge of the next clock CLKA. 
     As described above, in the register shown in FIG. 3, data DATA from the CPU 11 (FIG. 1) can be written at a period T C  1/4 the conventional period T D , and data can be supplied to the sound source 16 (FIG. 1) at the period T A  as an original time-divisional speed of the sound source. More specifically, the data write processing speed of the CPU 11 can be increased four times without modifying the sound source 16 except for the register 21. 
     Modification of the Embodiment 
     The present invention is not limited to the above embodiment, and may be properly modified. 
     For example, in the above embodiment, the ratio of a write speed from the CPU to a time-divisional processing speed in the sound source is set to be 4. However, this speed ratio may be arbitrarily set. In particular, if the speed ratio is set to be other than an integer multiple of the number of time-divisional channels or the number of stages of the shift register, one of the latch 7 and the delay circuit 9, and the timing generator 8 can be omitted. When the latch 7 is left, the clock CLKA is used as a latch signal for the latch 7. 
     A data arrangement in the shift register 1 may be set in the order of 0, D, A, 7, 4, 1, E, B, 8, 5, 2, F, C, 9, 6, and 3 when the speed ratio=5; 0, 7, E, 5, C, 3, A, 1, 8, F, 6, D, 4, B, 2, and 9 when the speed ratio =7; F, E, D, . . . , 2, 1, and 0 when the speed ratio =15; and 0, 1, 2, . . . , D, E, and F when the speed ratio =17.