1. Technical Field
The present invention relates to a memory access controller suitable for use in generating a musical sound signal by a personal computer.
2. Background Art
In recent years, there has been known a system for composing a memory tone generator using a personal computer to thereby generate a musical sound signal based on musical performance information. In such a system, wave data stored in a hard disk are read into a buffer memory in units of partial data (data block, for example one cluster), and contents of this buffer memory are further transmitted to a waveform memory. An envelope is then given to the wave data in this waveform memory, and a sound effect process is performed thereto, whereby the musical sound signal is generated (Patent Documents 1 to 3). In the hard disk, however, due to a large time lag until the data are actually read after receiving a read instruction from a CPU, the CPU needs to output the read instruction in advance to the hard disk before a time when the partial data (data block) is actually required.
[Patent Document 1]
Japanese Patent Publication No. 2671747
[Patent Document 2]
Japanese Patent Publication No. 2768204
[Patent Document 3]
Japanese Patent Publication No. 2798077
For instance, Patent Document 2 discloses a technique providing a pair of memory regions of a “first half” and a “last half” in the waveform memory for every sound channel to continuously play back the wave data by alternately accessing the pair of the regions. In this technique, successive address spaces are given to the regions of the “first half” and the “last half”, and the regions of the “first half” and the “last half” are alternately read by a tone generator circuit. As a result, a read address is changed in the shape of a sawtooth wave. When a readout of the region of the “first half” is completed by the tone generator circuit, an interruption is generated to the CPU and, under the control of the CPU, new partial data are read from the hard disk to the region of the “first half”. In parallel with this, the region of the “last half” is read by the tone generator circuit, and the musical sound signal is then synthesized based on the partial data in the region of the “last half”.
Similarly, when the readout of the region of the “last half” is completed by the tone generator circuit, an interruption is generated to the CPU and, under the control of the CPU, new partial data are read from the hard disk to the region of the “last half”. In parallel with this, the region of the “first half” is read by the tone generator circuit, and the musical sound signal is then synthesized. In this way, a partial data transmission to one region and a playback of data using the other region are repeatedly performed. Here, a speed of reading respective regions is determined based on a pitch (f-number) of the corresponding sound channel. Accordingly, one kind of wave data can be applied now to various pitches.
A progress situation of read addresses of a plurality of channels will now be explained using
Incidentally, when the interruptions intensively occur like this, partial data will come to be read from a hard disk almost continuously. In order to write the wave data read from the hard disk in a buffer memory, however, it is necessary to transmit in advance the wave data previously stored in the buffer memory, to the waveform memory. As a result, even when the hard disk itself is in a readable state, there is a need to suspend the data read from the hard disk depending on a state of the buffer memory, whereby there has been a problem that the supply of the partial data does not meet the requirement.
When the periods of the sawtooth waves are different for every channel as shown in
The present invention has been made in view of the foregoing situation, and aims to provide an access controller which can promptly transmit respective wave data to the waveform memory. The present invention also aims to provide an access controller and a musical sound signal generating method, which allow the transmission of each partial data on an optimal schedule according to a timing when the partial data of each sound channel are required.
The present invention for solving the aforementioned problems is characterized by having following configurations. It should be noted that a term inside parentheses is an exemplification.
In a first aspect of the invention, there is provided an access controller apparatus applied to a musical sound signal generating system having a first disk-like recording medium (36) for storing wave data in units of a block (cluster) having a predetermined size, a control section (6) for determining a block to be read next from the first recording medium (36), a second recording medium (22) for storing wave data and having an access speed faster than that of the first recording medium (36), and a musical sound signal generation section (20) for reading wave data from the second recording medium (22) at a speed corresponding to a reproduction rate of each sound channel to thereby generate a musical sound signal through each sound channel, the access controller comprising: a next waveform request signal generating section (20) that operates when a readout of the wave data of one block stored in the second recording medium (22) is completed in a sound channel, for supplying a next waveform request signal (interruption signal of block reproduction completion) which requests a next block of the wave data for said sound channel, to the control section (6); first and second buffer memories (28, 30) respectively connected to first and second buses (27, 29) which are independent from each other; a first transmitting section (32) that operates when receiving block specifying information (sound channel i and next waveform block number NW(i)) which specifies a block to be read next from the first recording medium (36), from the control section (6), for transmitting the wave data of the specified block to one of the first and second buffer memories (28, 30) while reading the specified block of the wave data from the first recording medium (36); and a second transmitting section (26) that operates when the transmitting of the wave data to said one of the first and second buffer memories (28, 30) by the first transmitting section (32) is completed, and during a period when the musical sound signal generation section (20) is not accessing the second recording medium (22), for transmitting the wave data of the specified block to the second recording medium (22) from said one of the first and second buffer memories (28, 30), to which the wave data of the specified block have been transmitted by the first transmitting section (32).
Moreover, in the inventive access controller apparatus, on condition that transmitting of the wave data of a previous block by the first transmitting section (32) has been completed, the control section (6) supplies the block specifying information (sound channel i and next waveform block number NW(i)) according to the next waveform request signal (interruption signal of block reproduction completion) to the first transmitting section (32), and enables the second transmitting section (26) to set a destination region of the wave data of the next block specified by the block specifying information in the second recording medium (22).
In a second aspect of the invention, there is provided an access controller apparatus applied to a musical sound signal generating system including a first recording medium (36) for storing wave data, a second recording medium (22) having an access speed faster than that of the first recording medium (36), a transmitting section (26, 32) for reading wave data sequentially in units of a data block composing a part of the wave data to thereby transmit the wave data to the second recording medium (22), and a musical sound signal generating section (20) having a plurality of sound channels each of which reads the wave data from the second recording medium (22) at a speed corresponding to a reproduction rate of each sound channel to reproduce a musical sound signal according to the read wave data, the access controller apparatus comprising: a detecting section (24, SP60 through SP70, and SP46) for detecting a sound channel which will complete the reproducing of the data block stored in the second recording medium (22) at the earliest timing among the sound channels capable of reading a next data block which should be transmitted to the second recording medium (22), and a sound channel specifying section (24, SP48) for specifying the sound channel detected by the detecting section as a sound channel for which the transmitting section (26, 32) should transmit the next data block.
Moreover, in the inventive access controller apparatus, the musical sound signal generating system has a rate storage section (12) for storing the reproduction rate of each sound channel, the first recording medium (36) is a recording medium for storing the wave data in units of a data block having a predetermined size (cluster), and the second recording medium (22) has a pair of storage regions (BiF, BiR) for each sound channel and each of the data locks is alternately written to the pair of the storage regions.
Moreover, in the inventive access controller apparatus, the detecting section produces a list of the sound channels in an ascending order of the timings at which the respective sound channels complete reproducing of the block data stored in the second recording medium (22) for detecting the sound channel ranked at the top order in the list.
Moreover, according to the second aspect of the invention, there is provided a musical sound signal generating method performed in a musical sound signal generating system, wherein the musical sound signal generating system includes a first recording medium (36) for storing wave data, a second recording medium (22) having an access speed faster than that of the first recording medium (36), a transmitting section (26, 32) for reading the wave data sequentially in units of a data block composing a part of the wave data from the first recording medium (36) to thereby transmit the wave data to the second recording medium (22), and a musical sound signal generation section (20) having a plurality of sound channels each of which reads the wave data from the second recording medium (22) at a speed corresponding to a reproduction rate of each sound channel to reproduce a musical sound signal according to the read wave data, the musical sound signal generating method causing a processor (6) to execute: a detecting step (SP60 through SP70, and SP46) of detecting a sound channel which will complete the reproducing of the data block stored in the second recording medium (22) at the earliest timing among the sound channels capable of reading a next data block which should be transmitted to the second recording medium (22), and a sound channel specifying step (SP48) of specifying the sound channel detected in the detecting step as a sound channel for which the next data block should be transmitted to the second recording medium by the transmitting section (26, 32).
Moreover, in the inventive musical sound signal generating method, the musical sound signal generating system has a rate storage section (12) for storing the reproduction rate of each sound channel, the first recording medium (36) is a recording medium for storing the wave data in units of the data block having a predetermined size (cluster), the second recording medium (22) has a pair of storage regions (BiF, BiR) for each sound channel such that each data block is alternately written to either of the pair of the storage regions, and the detecting step includes producing a list (SP68) of the sound channels in an ascending order of the timings at which the respective sound channels complete the reproducing of the data blocks stored in the second recording medium (22) for detecting the sound channel ranked at a top order in the list.
As described above, according to the first aspect of the present invention, when receiving the block specifying information, the first transmitting section transmits the wave data of the block to either of the first and second buffer memories while reading the wave data of the block from the first recording medium, and the second transmitting section transmits the wave data to the second recording medium from the buffer memory to which the wave data has been transmitted, during the period when the musical sound signal generation section is not accessing the second recording medium, thereby making it possible to promptly transmit the wave data to the second recording medium.
As described above, according to the second aspect of the present invention, among the sound channels available for reading the next partial data to the second recording medium, the sound channel whose playback by the partial data stored in the second recording medium will be completed at the earliest timing is detected, and the detected sound channel is specified as the sound channel given the top priority to which the partial data should be transmitted immediately by the transmitting section, thereby making it possible to transmit respective partial data on the optimal schedule according to the timing when the partial data of respective sound channels are required.
FIGS. 2(a) through 2(c) are an operation explanatory diagram according to the first embodiment;
FIGS. 4(a) through 4(c) are a flow chart showing various processing routines according to the first embodiment;
FIGS. 7(a) through 7(d) are a flow chart showing various processing routines according to a second embodiment; and
FIGS. 8(a) through 8(d) are an operation explanatory diagram according to the first and second embodiments.
Next, a configuration of a musical sound signal generating system of a first embodiment according to the present invention will be explained with reference to
The musical sound signal generating system according to the present embodiment is composed of a general-purpose personal computer, a sound board incorporated in the personal computer, and an application program operable on an operating system (OS) of the personal computer. In
Reference numeral 8 represents a DMA control circuit for executing various controls for outputting and inputting data from and to the RAM 12, without passing through the CPU 6. Reference numeral 36 represents a hard disk for storing the operating system of the personal computer, and the application program, the wave data, or the like of the musical sound signal generating system. In addition, reference numeral 38 represents a CD-RW drive for outputting and inputting data from and to a disk, such as CD-ROM, CD-R, and CD-RW. Reference numeral 34 represents an IDE I/O section for executing input/output processing to/from these hard disk 36 and CD-RW drive 38. Incidentally, various data are written on the hard disk 36 using a “cluster” (for example, 16 bit×32 k-word) as a unit, under the control of the IDE I/O section 34.
Reference numeral 40 represents a sound card in which the tone generator circuit 20 for synthesizing the musical sound signals of the maximum number of sound channels m (m is, for example 64) is provided. Reference numeral 22 represents a waveform memory (semiconductor memory) in which the partial data, each being approximately equivalent to several top clusters of respective wave data stored in the hard disk 36 are stored. Upon supplying a note-on signal from the CPU 6 to the sound card 40, the sound card 40 needs to start synthesizing the musical sound signals immediately, but if the hard disk 36 is accessed in order to obtain the wave data, a time lag will occur until the wave data are actually read. For that reason, by reading only top portions of respective wave data into the waveform memory 22 in advance, the time lag is eliminated.
Reference numerals 28 and 30 represent buffer memories (semiconductor memories) for transmitting the wave data from the hard disk 36 to the waveform memory 22, each having a capacity equivalent to “one cluster”, and are respectively connected to the buses 27 and 29 which are mutually independent. Reference numerals 26 and 32 represent transmission processing sections, in which the transmission processing section 26 transmits the wave data equivalent to “one cluster”, which are already read into the buffer memories 28 and 30, from the hard disk 36 to the waveform memory 22 during a period when the tone generator circuit 20 is not accessing the waveform memory 22. Meanwhile, the transmission processing section 32 reads the wave data equivalent to “one cluster” from the hard disk 36 according to an instruction from the CPU 6, and transmits the wave data to either buffer memory of the buffer memories 28 and 30, to which the transmission by the transmission processing section 26 has been completed.
The tone generator circuit 20 described above is provided with a plurality of sound channels, where it generates a read address for every sound channel to thereby read the wave data from the waveform memory 22, gives an envelope to the read wave data, and synthesizes the musical sound signals for every sound channel. Moreover, the tone generator circuit 20 mixes a plurality of synthesized musical sound signals, and adds effects, such as a reverb or the like, to the mixed musical sound signal thereto. Reference numeral 18 represents a sound system composed of an amplifier, a loudspeaker, or the like, for sounding the musical sound signal to which the effects are added. It should be noted that a transmission control section 24 shown with the broken line among respective components in
1.2.1. Initialization Processing
When the application program of the musical sound signal generating system is activated on the OS of the personal computer, the wave data stored in a predetermined directory in the hard disk 36 are searched, wave data corresponding regions A1 through An shown in
A region for management data 50 shown in
In the management data 50, the number of elements EN of the request list (the number of transmission requests), a start channel number SC of the request list, and an end channel number MC of the request list are stored as a header data 52. Meanwhile, in the channel data 54-i according to each sound channel i, a next channel number NC(i) for indicating a next channel number in the request list, and a previous channel number PC(i) for indicating a previous channel number in the request list are stored. In other words, the request list is composed of EN elements in total obtained by sequentially linking an element of the sound channel indicated by the next channel number NC(i) with an element of the start channel number indicated by SC. Incidentally, in various kinds of processing described later, operations, such as adding a new element to the request list, deleting any element from the request list, changing a rank of the element, or the like will be executed. All of these operations will be executed by rewriting the aforementioned number of elements EN, start channel number SC, end channel number MC, and next channel number NC(i) and previous channel number PC(i) of each sound channel i, but the substantial addresses of respective channel data 54-1 through 54-m would not necessarily be changed.
In addition, following information on the sound channel i is also stored in the channel data 54-i.
Change flag CF(i): this flag is set to “1” when an order of the channel data 54-i in the request list needs to be revised, and set to “0” when there is no necessity of revising the order.
Transmission enabling flag TE(i): this flag is set to “1” when transmitting the partial data from the hard disk 36 to the channel corresponding region BiF or BiR is permitted, and is set to “0” when it is not permitted.
Transmission time limit TL(i): this data indicates a time to be a limit when the transmission of the partial data from the hard disk 36 to the channel corresponding region BiF or BiR should be completed. In
Next waveform block number NW(i): block numbers have been given to the partial data composing the respective wave data in ascending order. That is, a block number of the top portion to be read into the wave data corresponding region Ai is “1”, block numbers of “2”, “3”, . . . are given to subsequent partial data for every equivalent of “one cluster”. The next waveform block number NW(i) represents a block number of the partial data to be subsequently transmitted to the channel corresponding region BiF or BiR from the hard disk 36.
Reproduction rate DR(i): this data represents an address interval in the case of reading the waveform memory 22 and the buffer memories 28 and 30, and is determined corresponding to a pitch (f-number) of the sound channel i.
Interruption time IT(i): this data represents a time when a block reproduction completing interruption is finally generated to the sound channel i. It should be noted that the block reproduction completing interruption is generated at the timing when the playback of the partial data stored in a wave data corresponding region Ap and the channel corresponding region BiF or BiR is completed.
1.2.2. Generation of Note-On Event
When a note-on event is generated in the MIDI signal supplied from a sequencer program within the personal computer, or the communication interface 14, a note-on event processing routine shown in
In
Next, when the procedure proceeds to Step SP8, a sound instruction is transmitted to the sound card 40 so as to start the sound of the sound channel i. As a result, in the tone generator circuit 20, a readout of the wave data corresponding region Ap is started. Next, when the procedure proceeds to Step SP10, the next waveform block number NW(i) according to the sound channel i is set to “2”, and the transmission enabling flag TE(i) is set to “1”. In other words, as for the sound channel i, since it is in a state where only the wave data corresponding region Ap of the block number “1” is currently being read from the hard disk 36, the next waveform block number NW(i) is set to “2” which is the number of the block to be read next.
In addition, the channel corresponding region BiF as a region in which the partial data according to this next waveform block number NW(i) should be read is in a state ready for immediately reading the partial data, whereby the transmission enabling flag TE(i) is set to “1”. Further, at Step SP10, the change flag CF(i) is set to “1”, and the transmission time limit TL(i) is set to a scheduled time when the playback of the partial data in the wave data corresponding region Ai will be completed. Moreover, the reproduction rate DR(i) is set corresponding to the pitch (f-number) of the sound channel i, and the interruption time IT(i) is set to “0” ( “0” indicates that the block reproduction completing interruption has not been generated yet).
Next, when the procedure proceeds to Step SP12, the channel data 54-i is added to the bottom of the request list. This is for requesting a transmission of the partial data of the block number “2” of the sound channel i. More specifically, supposing that the sound channel of the bottom of the request list is “j” in an actual situation, the next channel number NC(j) of the sound channel j is set to “i”, and the previous channel number PC(i) of the sound channel i is set to “j”. The next channel number NC(i) of the sound channel i is set to “0” for indicating the bottom of the list. Next, when the procedure proceeds to Step SP14, it is determined whether or not any partial data are being transmitted from the hard disk 36 to the buffer memory 28 or 30. If it is determined “YES” here, the procedure of this routine is immediately completed. Meanwhile, if it determined “NO” here, the procedure proceeds to Step SP16, where a transmission control subroutine which will be described (in
1.2.3. Summary of Interruption Processing
Next, referring to FIGS. 8(a) through 8(d), a summary of various kinds of interrupt processing according to the present embodiment will be explained. In these Figures, it is supposed that the musical sound signals are synthesized from the wave data in the first and third sound channels. Accordingly, in the tone generator circuit 20, while the channel corresponding regions B1F and B1R are alternately read in the period according to a reproduction rate DR(1) of the first sound channel, the channel corresponding regions B3F and B3R will also be alternately read in the period according to a reproduction rate DR(3) of the third sound channel. It should be noted that a hatched region in the waveform memory 22 in these figures is a region in which the partial data is stored and not yet read by the tone generator circuit 20.
Next, in
Next, in
Incidentally, in
Next, in
As described above, the transmission processing from the buffer memories 28 and 30 to the channel corresponding regions BiF and BiR executed by the transmission processing section 26 is not executed until the occurrence of the timing when the tone generator circuit 20 is not reading the waveform memory 22. However, such timing will occur frequently. Besides, since such transmission processing is a transmission between semiconductor memories, the procedure is completed shortly after the procedure is actually started. Meanwhile, the transmission processing from the hard disk 36 to the buffer memories 28 and 30 by the transmission processing section 32 is accompanied with a mechanical operation such as a head movement, a disk rotation or the like, resulting in very slow processing as compared with the transmission processing by the transmission processing section 26. In other words, when the transmission processing section 32 starts the transmission processing to either one of the buffer memories 28 and 30, the other buffer memory will surely be in empty state by the time when the transmission processing is completed. Accordingly, as will be understood, there may not probably occurs such a situation that, for example, although the hard disk 36 is in a data transmittable state, the data transmission is kept standing by because of an incomplete preparation on the side of the transmission processing sections 26 and 32. After all, according to the present embodiment, the maximum transmission speed of the partial data from the hard disk 36 to the waveform memory 22 is mostly determined by the performance of the hard disk 36, thereby making it possible to sufficiently make the best performance of the hard disk 36. As will be understood, such a feature, from the CPU 6 point of view, may result in that, “Shortly after the transmission end interruption is generated (when the transmission to either one of the buffer memories is completed), the transmission to the other buffer memory may be started”. As a result, in the CPU 6, it is not necessary to confirm whether or not the other buffer memory is empty, and the procedure is not kept waiting due to a reason that “The other buffer memory is not empty”, either. That makes it possible to further reduce a burden against the CPU 6.
1.2.4. Operation of Sound Card 40 Referring now to FIGS. 2(a) and 2(b), an operation in the sound card 40 will be explained. As described above, generating of the note-on event according to the sound channel i initiates the readout of the partial data in the wave data corresponding region Ap according to the sound channel. Readout procedure is executed for every predetermined sampling period, and the reproduction rate DR(i) is added to the read address for every sampling period. Here, since the reproduction rate DR(i) can be defined as the number of decimal places, a calculated value of the read address which is an accumulation result of the reproduction rate DR(i) will normally have the number of decimal places. In such a case, sampling values of the addresses preceding or following the calculation result are read, and an interpolation operation is performed based on a fractional value. As a result, even when the calculated value of the read address has a fractional value, sampling values with a reduced return noise can be calculated.
Here, upon completing the readout of the wave data corresponding region Ap, the partial data in the channel corresponding regions BiF and BiR corresponding to the sound channel i are alternately read thereafter. Subsequently, in the tone generator circuit 20, while the envelope is given to the read partial data, a sound effect process is also executed as required, so that the resultant musical sound signal is sounded via the sound system 18. In addition, in the tone generator circuit 20, when any readout among the wave data corresponding region Ap, and the channel corresponding regions BiF and BiR is completed, the block reproduction completing interruption to the CPU 6 occurs. Meanwhile, when the partial data transmission from the hard disk 36 to the buffer memories 28 and 30 is completed with respect to any one of the sound channels, the transmission end interruption occurs.
1.2.5. Procedure of Transmission Control Subroutine (
When the transmission control subroutine shown in
Next, when the procedure proceeds to Step SP46, it will be determined whether or not the transmission enabling flag TE(j) according to the sound channel j is “1”. If it is determined “NO” here, the procedure will return to Step SP40, and the procedure of the aforementioned Steps SP40 through SP44 is executed to the next transmission request of the sound channel j in the request list. This is because even when a certain sound channel is positioned in the top of the request list, unless the transmission enabling flag according to the sound channel is “1”, the transmission of the channel cannot be started, and therefore the transmission of the sound channel having the next high priority level is executed.
As described above, when the sound channel j with the highest priority level within the request list, among the sound channels which can transmit, is detected, the procedure will proceed to Step SP48. Here, the CPU 6 instructs the transmission processing section 32 to perform the transmission processing accompanied by the sound channel j and the next waveform block number NW(j). As a result, in the wave data which are stored in the hard disk 36 and are allocated to the sound channel j under the control of the transmission processing section 32, the partial data by one cluster specified by the next waveform block number NW(j) are read, and the transmission to the buffer memory 28 or 30 is started. Moreover, at the Step SP48, the CPU 6 specifies the channel corresponding region (BjF or BjR) to which the transmitted partial data should be further transmitted for the transmission processing section 26. In the CPU 6, the transmission request according to the sound channel j is then deleted from the request list.
Next, when the procedure proceeds to Step SP50, the next waveform block number NW(j) according to the sound channel j is incremented by “1”, and the transmission enabling flag TE(j) is set to “0”. Here, the reason why the transmission enabling flag TE(j) is set to “0” will be explained. As described above, in the tone generator circuit 20, when the readout of the wave data corresponding region Ap is completed, the channel corresponding regions BjF and BjR in the sound channel j are alternately read. When the aforementioned Step SP48 is executed in the situation, the partial data are transmitted to the buffer memory 28 or 30, and after an appropriate time, the partial data are transmitted to “a region not under readout at present” of the channel corresponding regions BjF and BjR.
When the next waveform block number NW(j) is incremented by “1” at Step SP50, a destination region according to the next waveform block number NW(j) will be “a region under readout at present” of the channel corresponding regions BjF and BjR. Accordingly, such a transmission processing cannot be executed immediately, and it is necessary to put a restriction so that the transmission processing will not be executed until the completion of the readout of “the region under readout at present”. For this reason, at Step SP50, the transmission enabling flag TE(j) is set to “0”.
Next, when the procedure proceeds to Step SP52, it is determined whether or not the partial data (block number=NW(j)-1), the transmission of which has previously started at Step SP48, are the final partial data of the wave data. If it is determined “YES” here, the procedure proceeds to Step SP54, where an instruction is issued to the tone generator circuit 20 to perform silencing processing of the sound channel j. In other words, when the tone generator circuit 20 receives the instruction, the musical sound signal of the sound channel j is gradually faded out, and the sound channel j is released after an appropriate time. Meanwhile, if it is determined “NO” at Step SP50, the procedure will proceed to Step SP56. Here, the transmission request of next waveform block number NW(j) is added to the bottom of the request list. As described above, since the contents of the request list are read from the top, the transmission request is processed in the order of arrival even in the worst case. Moreover, when the background processing routine which will be described later (
Further, at Step SP56, while the change flag CF(j) is set to “1”, the transmission time limit TL(j) is updated. First, although the transmission request of the next waveform block number NW(j) is added to the bottom of the request list, the priority of this transmission request is not necessarily the lowest priority among the transmission requests included in the request list. Accordingly, in order to review the priority level in background processing which will be described later, it is necessary to set the change flag CF(j) to “1”. Meanwhile, the transmission time limit TL(j) is set to a scheduled time when the playback of all of the partial data that have already been transmitted to the channel corresponding regions BjF and BjR (or that have started to be transmitted at Step SP48) will complete. According to the procedure described above, the procedure of this subroutine is completed.
1.2.6. Event Processing of Block Reproduction Completion (
When the block reproduction completing interruption occurs in any sound channel i, event processing of block reproduction completion shown in
In addition, when the interruption time IT(i) is updated, the transmission time limit TL(i) is recalculated and updated based on the interruption time IT(i) and the reproduction rate DR(i) of this sound channel i. Since a value of the transmission time limit TL(i) before the update should be the same as that of the interruption time IT(i) unless the pitch of the sound channel i changes, calculating a new transmission time limit TL(i) based on the transmission time limit TL(i) before the update may also be considered. In practice, when the pitch is changed a little by operation of a pitchbend or th like, however, the transmission time limit TL(i) before the update is out of coincidence with the interruption time IT(i). For this reason, it is desirable to recalculate the transmission time limit TL(i) based on the newest interruption time IT(i) and reproduction rate DR(i). Next, when the procedure proceeds to Step SP24, it is determined whether or not certain partial data are being transmitted from the hard disk 36 to the buffer memory 28 or 30. If it is determined “YES” here, the procedure of this routine is immediately completed. Meanwhile, if it determined “NO” here, the procedure proceeds to Step SP26, and the aforementioned “transmission control subroutine (
1.2.7. Transmission End Event Processing (
In the sound card 40, upon completing the transmission to any region in the buffer memories 28 and 30, the transmission end interruption occurs and a transmission end event processing routine shown in
1.2.8. Background Processing (
The CPU 6 can process a plurality of tasks at the same time, and an activity ratio of the CPU 6 is always monitored. If the activity ratio becomes lower than a predetermined value, the background processing routine shown in
Meanwhile, if it is determined “YES” at Step SP62, the procedure proceeds to Step SP64, the found channel number is substituted for the variable i. Next, when the procedure proceeds to Step SP68, a position to which the transmission request of the transmission time limit TL(i) is to be moved is detected from the top of the request list. In other words, the transmission time limit TL(j) of the sound channel j other than the sound channel i is sequentially searched from the top of the request list, and if the transmission time limit TL(j) later than the transmission time limit TL(i) is found, the transmission request of the sound channel i is moved to a position immediately preceding the sound channel j in the request list.
Next, when the procedure proceeds to Step SP70, the change flag CF(i) is set to “0”. Next, when the procedure proceeds to Step SP72, it is determined whether or not some processing other than the background processing is executed. If it is determined “NO” here, the procedure of Steps SP60 through SP70 is repeated. Meanwhile, if it is determined “YES” at Step SP72, in order to give priority to other procedure, the routine is immediately terminated.
As described above, according to the routine, since the transmission requests of the respective sound channels are sorted in ascending order of the transmission time limit TL, in the aforementioned transmission control subroutine (
Next, a second embodiment of the present invention will be explained. Although a hardware configuration of the second embodiment is the same as that of the first embodiment, a transmission control section 24 shown with a broken line is added to the sound card 40. This transmission control section 24 controls the sequence of the sound channels to which the partial data are transmitted from the hard disk 36.
2.2.1. Initialization Processing
When the application program of the musical sound signal generating system is activated in the personal computer, in a manner similar to that of the aforementioned first embodiment, the wave data stored in a predetermined directory in the hard disk 36 are searched, the wave data corresponding regions A1 through An are secured in the waveform memory 22, and the partial data of the top portions of these wave data are stored in the wave data corresponding regions A1 through An, respectively. Moreover, the channel corresponding regions B1F, B2F . . . , BmF and B1R, B2R . . . , BmR, each having “one cluster” equivalent length, are secured in the buffer memories 28 and 30 for respective sound channels, respectively.
Next, a region for management data is then secured in the RAM 12 of the personal computer, but the management data in the embodiment is different from that of the first embodiment, so that data relevant to the “request list” are not included. In other words, the data corresponding to the header data 52 are not included in the management data, and the start channel number SC and the end channel number MC are not included in the respective channel data 54-1 through 54-m. It is because the information corresponding thereto is controlled by the transmission control section 24 in the present embodiment.
2.2.2. Generation of Note-On Event
When a note-on event is generated in the MIDI signal or the like supplied from the communication interface 14, a note-on event processing routine shown in
In the Steps SP82 through SP88 of that routine, a procedure similar to that of Steps SP2 through SP8 of the first embodiment is executed. That is, the sound channel i is allocated to the note-on event, and while the wave data are determined, various parameters are set to the sound channel i of the tone generator circuit 20, and a sound instruction is transmitted to the sound card 40.
Next, when the procedure proceeds to Step SP90, the next waveform block number NW(i) in the channel data 54-i in the RAM 12 is set to “2”. Next, when the procedure proceeds to Step SP94, it is determined whether or not certain partial data are being transmitted from the hard disk 36 to the buffer memory 28 or 30. If it is determined “YES” here, the procedure of this routine is immediately terminated. Meanwhile, if it determined “NO” here, the procedure proceeds to Step SP96, and a transmission control subroutine, which will be described (in
2.2.3. Operation of Sound Card 40
In the sound card 40, operation of portions other than the transmission control section 24 is similar to that of the first embodiment. In the embodiment, following procedures are further executed in the transmission control section 24.
First, in the transmission control section 24, there is generated a “channel number list” which is a list for listing sound channels that satisfy all of following conditions among all the sound channels during sounding.
(1) The partial data can be transmitted to either of the channel corresponding regions BiF and BiR according to the sound channel i.
(2) A silencing instruction to the sound channel i is not received from the CPU 6.
In addition, a value (for example, “0”) which is a channel number not being actually present is added to the bottom of the list. In the transmission control section 24, the transmission time limit TL(i) allowing the playback of the wave data is calculated for all of the sound channels i belonging to this channel number list based on the partial data already written in the waveform memory 22, and the “channel number list” which is a list obtained by sorting the channel numbers in ascending order of this transmission time limit TL(i) is generated. However, since the transmission control section 24 itself does not concern whether or not the next waveform block number NW(i) is present, a sound channel in which the next waveform block is not actually present may also be included in the channel number list.
In addition, the channel number list generated in the transmission control section 24 can be freely read using the CPU 6. In the transmission control section 24, the channel corresponding regions BjF and BjR of the respective sound channels j are successively monitored, and according to the propriety of partial data transmission, the sound channel j is added to the channel number list, or the sound channel j is deleted from the channel number list. Additionally, at the same time, this list is successively sorted according to the transmission time limit TL(i) as described above. Accordingly, for example, if the CPU 6 reads the top of the channel number list, it causes reading of a sound channel i having a free channel corresponding region BiF or BiR and the highest order after the sort.
2.2.4. Transmission Control Subroutine
When the transmission control subroutine shown in
If it is determined “NO” here, the routine procedure is immediately terminated. Meanwhile, if it is determined “YES” here, the procedure proceeds to Step SP124, it is determined whether or not the partial data corresponding to the next waveform block number NW(i) are present. For example, in the case when the transmission of a whole block of the corresponding wave data is completed, it is determined “NO” here and the procedure proceeds to Step SP125, where the silencing instruction of the sound channel i is provided from the CPU 6 to the tone generator circuit 20. As a result, the musical sound signal of the sound channel i is gradually faded out, and the sound channel i is released after an appropriate time. Moreover, when this silencing instruction is detected by the transmission control section 24, an element according to the sound channel i is deleted from the channel number list. When the procedure then returns to Step SP120, the next channel number is read from the transmission control section 24, and the determinations of Steps SP122 and SP124 are repeated.
If it is determined “YES” at Step SP124, the procedure proceeds to Step SP126. Here, the CPU 6 instructs the transmission processing section 32 to perform the transmission processing accompanied by the sound channel j and the next waveform block number NW(j). As a result, in the wave data, which are stored in the hard disk 36 and allocated to the sound channel j under the control of the transmission processing section 32, the partial data by one cluster specified by the next waveform block number NW(j) are read, and the transmission to the buffer memory 28 or 30 is started. Further, in the Step SP126, the CPU 6 specifies the channel corresponding region (BjF or BjR) to which the transmitted partial data should be further transmitted for the transmission processing section 26. Next, when the procedure proceeds to Step SP128, the next waveform block number NW(i) is incremented by “1”, and the procedure of the routine is then completed.
2.2.5. Event Processing of Block Reproduction Completion (
When the block reproduction completing interruption is generated in any sound channel, an event processing routine of block reproduction completion shown in
2.2.6. Transmission end Event Processing (
In the sound card 40, upon completing the transmission to any region in the buffer memories 28 and 30, the transmission end interruption occurs and a transmission end event processing routine shown in
As described above, according to the present embodiment, except for management of the next waveform block number NW or the like, most of the management of the channel number list corresponding to the request list of the first embodiment is left to the transmission control section 24 which is hardware. Thereby, the present embodiment can reduce a processing load on the CPU 6 as compared with the first embodiment.
The present invention is not limited to the embodiments described above, but various modifications may be made to the present invention, for example as follows.
(1) In the aforementioned respective embodiments, various procedures have been executed with the application program-which operates on the personal computer, but this application program may be distributed by storing only the same in the recording media, such as CD-ROM, flexible disk, or the like, or also distributed through a transmission path.
(2) In the aforementioned respective embodiments, the buffer memories 28 and 30 and the waveform memory 22 have been incorporated in the sound card 40, but the incorporation of these memories may be omitted by securing areas for these memories in the RAM 12.
(3) In the aforementioned respective embodiments, the “reproduction rate DR(i)” has been determined corresponding to the pitch (f-number) of the sound channel i, but the “reproduction rate” of the present invention does not need to be uniquely determined corresponding to the pitch (f-number). For example, it would be considered that the wave data stored in the hard disk 36 might be wave data obtained by compressing data, and in that case, a rate for the partial data in the buffer memories 28 and 30 to be consumed with respect to the same f-number is lower than that of the uncompressing wave data. Moreover, since resolutions of the wave data may be different for every wave data, such as “8 bits”, “16 bits”, “24 bits”, or the like, the higher the resolution of the wave data becomes, the faster the rate for the partial data in the buffer memories 28 and 30 to be consumed becomes.
(4) Moreover, in the aforementioned respective embodiments, the request list has been created based on the transmission time limit TL of one block partial data to be transmitted next, but the request list may be created so that the transmission time limits TLs of a plurality of n blocks to be transmitted thereafter may be calculated and the calculated transmission time limits TLs may be all included.
(5) In addition, in the aforementioned embodiments, all the sound channels during sounding have been included in the request list, but only a sound channel i in which either of the channel corresponding regions BiF and BiR is writable may be included in the request list.
(6) In addition, as another configuration method of the request list, the request list may be composed of only the sound channels having subsequent unread partial data in the hard disk 36.
(7) In addition, as for the wave data whose whole size is small, the whole wave data is stored in the waveform memory 22 as an attack portion, so that the wave data may be played back without transmitting the wave data from the hard disk 36.
In such a case, before executing Step SP10 of
Step SP10′: the next waveform block number NW(i) is set to a state of “nothing” (for example, “0”), and the transmission enabling flag TE(i) is set as “0”.
Step SP90′: the next waveform block number NW(i) is set to a state of “nothing” (for example, “0”).
(8) In the aforementioned embodiments, the channel corresponding regions B1F, B1R, B2F, B2R . . . , BmF, BmR have been secured to all the sound channels corresponding to the maximum number of sound channels m. However, “the wave data, the whole of which is stored in the waveform memory 22 as the attack portion” as the aforementioned modified embodiment does not require such channel corresponding regions. Accordingly, a part of the sound channels of the tone generator circuit 20 are intended for exclusive sound channels for the wave data, so that the number of channel corresponding regions may be reduced by the number corresponding to the number of exclusive sound channels.
(9) In the aforementioned embodiments, at the time of activation of the application program, the partial data of the top portions of the respective wave data have been read to the wave data corresponding regions A1 through An, but the timing of reading the wave data is not limited to this. For example, these wave data may be read upon activating the OS. Moreover, if a part of the waveform memory 22 is composed of a nonvolatile memory, such as a flash memory, a battery backup type RAM, or the like, once the partial data of the top portion are read, it will become unnecessary to read the partial data again whenever the OS and the application program are activated. Further, if a part of the waveform memory 22 is composed of a ROM and the partial data of the top portion are stored therein, the read itself may be made unnecessary.
(10) In addition, in the aforementioned embodiments, although the background processing routine (
(11) In addition, at the Step SP68 of the aforementioned embodiments, it is also possible t o detect the position where the transmission request of the transmission time limit TL(i) should be inserted from the bottom of the request list. In this case, however, a sound channel whose change flag CF(j) is “1” needs to be ignored. In other words, the transmission time limits TLs(j) of sound channels j other than the sound channel i are sequentially searched from the bottom of the request list, and, if there is found “a sound channel j which has a transmission time limit TL(j) earlier than the transmission time limit TL(i) and whose change flag CF(j) is “0””, the transmission request of the sound channel i may be inserted in the position immediately following the sound channel j.
(12) In addition, while the data amount of “one block” which is a unit for the hard disk 36 to store the wave data has been the same as “one cluster” in the aforementioned embodiments, they need not be always coincident with each other. In other words, “one block” may be composed of “a plurality of clusters”.
(13) In addition, in the aforementioned embodiments, the example of applying the hard disk 36 as the first recording medium has been explained, but MO, CD, DVD, or the like may be applied as the first recording medium.
(14) In addition, in the aforementioned embodiments, the two channel corresponding regions BiF and BiR have been provided in the waveform memory 22 for every sound channel i, but “3” or more channel corresponding regions may be provided for every sound channel i.
(15) In addition, the channel corresponding regions of respective sound channels do not need to be separated into the equivalents of “one cluster” each. In other words, the channel corresponding region may be composed of one region having a size equal to or more than “two clusters” (not limited to the integral multiples of “one cluster”) for one sound channel. In such a case, a write pointer for indicating to which address the write is completed, and a read pointer for indicating to which address the readout is completed may be secured in the RAM 12 for every sound channel, and when a difference between both pointers becomes one cluster or more, the block reproduction completing interruption may be generated.
(16) In addition, in this example, when a total of the channel corresponding regions of one sound channel exceeds the equivalent of “two clusters”, the block reproduction completing interruption may be generated at every timing when the difference between both pointers exceeds two clusters. For example, if the channel corresponding region is the equivalent of “three clusters”, the block reproduction completing interruption is generated whenever the difference between both pointers becomes two clusters, the partial data transmission from the hard disk 36 to the waveform memory 22 via the buffer memories 28 and 30 is performed twice, the partial data of the equivalent of “two clusters” may be supplied in one-time block reproduction completing interruption.
Number | Date | Country | Kind |
---|---|---|---|
2004-378785 | Dec 2004 | JP | national |
2004-378794 | Dec 2004 | JP | national |