Apparatus for generating a musical tone signal in accordance with an input waveform signal

Abstract: There is disclosed an apparatus for generating a musical tone signal in accordance with an input waveform signal, comprising a sounding commanding means for providing a command to generate a musical tone having a designated frequency, level judging means for judging whether an amplitude level of said input waveform signal is below a predetermined value, continue judging means for judging whether the input signal amplitude level below the predetermined level continues for a predetermined period of time and sounding stop commanding means for stopping sounding when said continue judging means judges that said input signal amplitude level state continues for the predetermined time.

Description: The present invention relates to an apparatus for generating a musical tone signal in accordance with an input waveform signal, and more particularly to an electronic string instrument such as an electronic guitar or a guitar synthesizer incorporating such an apparatus. In recent days, there have been developed musical instruments of the type in which a pitch (frequency) is extracted from a waveform signal generated by a natural or conventional musical instrument, and under control of the extracted pitch, a sound source of an electronic circuitry is driven to artificially generate a sound such as a musical tone. In this type of musical instruments, the pitch extraction still involves some problems to urgently be solved. Typical pitch extraction systems are a zero-cross point detection system and a peak detection system. The zero-cross point detection system detects the time intervals between zero-cross points in the input waveform, and uses them as periods of the artificial sound. The input waveform frequently contains harmonics which should have been removed by filters such as low-pass filters. The detection system does not operate well for such input waveforms. If it is applied, the detected pitches contain many errors. In order to prevent these errors, complicated software processings, for example, to check the duty of the input waveform, are required. It is technically difficult to realize this. The peak-detection system detects maximum and minimum peak points of the input waveform signal, and sets and resets a flip-flop at the peak points, to generate a period signal, e.g., a rectangular wave signal. (Peak detection systems are disclosed in KOKOKU Nos. 57-37074 (corresponding to US-A- 4,117,757) and 57-58672, KOKAI Nos. 55-55398, 55-152597 (Utility Model), and 61-26090. The peak detection system determines the period of the artificial sound waveform by the time interval between the adjacent maximum peaks, for example. This feature causes reduction of the reliability of the detected pitches, and a slow response to frequency change of the input natural sound waveform. Use of the R-S flip-flop makes the instrument circuitry inflexible in generic use and makes it difficult to construct so-called intelligent musical instruments having data processing functions. Other proposals of a pitch detection are disclosed in KOKAI Nos. 55-87196 and 55-159495, and KOKOKU No. 61-51793. In KOKAI 55-87196 it is suggested to measure the period of the input natural sound waveform, and then converts the measured value into a frequency number, which in turn is sent to the sound source. However, any novel technical proposal for the period measurement is not disclosed in this specification. KOKAI 55-159495 and KOKOKU 61-51793 disclose a frequency stabilizing technique in which, when the adjacent extracted periods are substantially the same, the sounding of the musical instrument starts. A sounding command is not sent to the sound source until at least two periods elapse. In this respect, these conventional systems involve the response performance problem. To obtain a quick response, the sounding should start as soon as possible. Utility Model KOKOKU No. 62-20871 (corresponding to US-A-4,606,255) discloses another frequency stabilizing technique. In a string musical instrument, a vibration of one string affects the vibration of another string. Extremely, the latter vibrates resonating at the vibration frequency of the former. However, this system yields high costs because the mechanical parts are used, and can imperfectly remove the resonance. Furthermore, document GB-A-2 138 988 on which the preamble of present independent claim 1 is based, discloses an apparatus for generating a musical tone signal in accordance with an input waveform signal comprising detecting means for detecting an amplitude level and a frequency of an input waveform signal as well as sounding commanding means for providing a command to generate a musical tone having the frequency of the input waveform signal detected by the detecting means. A level judging means judges whether the amplitude level of the input waveform signal detected by the detecting means is below a predetermined value. However, the note-off processing at once executes to stop the sounding if the peak level is below a predetermined level. Finally, document GB-A-2 162 989 discloses an electronic musical instrument having a sampling function wherein an input waveform signal is stored and the desired pitch is assigned to the stored signal to generate a desired musical sound. According to this conventional system a zero-crossing point of the stored waveform signal is detected and the level of the waveform signals is compared with a predetermined level. It therefore is an object of the present invention to execute the note-off when the input signal level below a predetermined level continues for a predetermined time operation, thereby improving the performance of the arrangement. According to the present invention this object is achieved by the measures indicated in present independent claim 1. The advantages of the present invention will become apparent and obvious to those skilled in the pertinent art by referring to the following description provided in connection with the accompanying drawings of which: Fig. 1 shows typical waveforms to which the musical instrument according to an example of the present invention is applicable with the improved response; Fig. 2 shows a circuit arrangement of the example of a musical instrument; Fig. 3 shows a flowchart of an interrupt routine executed by the CPU in the example; Figs. 4A and 4B show a flowchart of a main routine of the CPU in the example; Fig. 5 shows a timing chart useful in explaining the operation for sounding start when the musical instrument of the example receives a waveform of an input signal; Fig. 6 shows a timing chart useful in explaining the operation for sounding start when the musical instrument of the example receives another waveform of an input signal; Fig. 7 shows a timing chart useful in explaining the operation for muting when the musical instrument of the example receives a waveform of an input signal; Fig. 8 shows a waveform for explaining the technical problems to be solved by the embodiment according to the present invention; Fig. 9 shows a block diagram of the embodiment; Fig. 10 shows a set of waveforms of the signals at the key portions in the embodiment; Figs. 11A and 11B show a timing chart a flowchart of a main routine executed by the CPU used in the embodiment; Fig. 12 shows a timing chart for explaining the muting operation when the mute is executed in the tenth embodiment; In an example, the present invention is embodied in an electronic guitar. Vibrations of six strings of the electronic guitar are picked up by pickups (not shown). The pickups convert the mechanical vibrations of the strings into electrical signals. These signals as musical tone signals are input to six input terminals 1. These input signals are amplified by amplifiers 2, and applied to low-pass filters 3. These filters respectively remove the high frequency components of these signals to extract the fundamental waveform of these input signals. Each of the input signal of the fundamental waveform is applied to maximum peak detector (MAX) 4, minimum peak detector (MIN) 5, zero cross point detector 6 and A/D converter 411. Each maximum peak detectors 4 detects the maximum peak point of an input signal waveform. At the trailing edge of the detected pulse signal, flip-flop (FF) 214 located at the post stage of each detector 4 outputs the Q output at high level. The output signal of FF 214 and the inverted output of inverter 230 coupled with zero-cross point detector 6 are applied to AND gate 224, The output signal from AND gate 224 is applied as interrupt signal INTan (where n is any of 1 to 6 figures) to CPU 600. Similarly, each minimum peak detectors 5 detects the minimum peak point of an input signal waveform. At the leading edge of the detected pulse signal, flip-flop (FF) 215 located at the post stage of each detector 5 outputs the Q output at high level. The output signal of FF 215 and the output of the zero-cross point detector 6 are applied to AND gate 225. The output signal from AND gate 225 is applied as interrupt 6 signal INTbn (where n is any of 1 to 6 figures) to CPU 600. Thus, when the maximum peak point is detected and FF 214 is logical high at the Q output, if the waveform crosses the zero level from the positive domain to the negative domain, interrupt signal INTan is applied to CPU 600. When the minimum peak point is detected and FF 215 is logical high at the Q output, if the waveform crosses the zero level from the negative domain to the positive domain, interrupt signal INTbn is applied to CPU 600. Immediately after receiving the interrupt signal INTan or INTbn, CPU 600 applies clear signal CLan (where n is any of 1 to 6) or CLbn to FF214 or 215. In turn, the corresponding FF is reset. Accordingly, until the next maximum or minimum peak point is detected, even if the waveform crosses the zero level any number of times, the corresponding FF remains reset, and therefore CPU 600 is never interrupted. When CPU 600 receives interrupt signal INTan for the zero-cross point encountered immediately after the maximum peak point is detected, CPU 600 computes a difference between the present count of counter 7 and that of counter 7 as the waveform previously crosses the zero level immediately after the maximum peak point. Similarly, when interrupt signal INTbn is generated, CPU 600 computes a difference between the present count of counter 7 and that of counter 7 as the waveform previously crosses the zero level immediately after the minimum peak point. Every time interrupt signals INTan and INTbn are generated, CPU 600 stores the counts of counter 7 into work memory 601. The time count data as the count difference is transferred from CPU 600 to frequency ROM 8, directly or after it is converted into a key code. The frequency data with one period of the counter data is read out, and sent to sound source circuit 9, where a musical tone signal is generated. Sound system 10 receives this and starts the sounding of the musical tone. A/D converter 411 is contained in each pitch extraction circuit P1 to P6. The output signal of FFs 214 and 215 are applied as read-in signals to latch 412, via OR gate 413. In response to the signal from OR gate 413, latch 412 fetches the digital output of A/D converter 411. With such an arrangement, each latch 412 latches the maximum or minimum peak point of the input signal waveform, so that CPU 600 can readily fetch these peak values. The output signal of each OR gate 413 is applied as each signal L1 to L6 to CPU 600. An example of an electronic guitar will be described referring to Figs. 1 to 7. This example is proposed with the intention to improve of an accuracy of pitch extraction. When the input signal waveform rises, it is necessary to quickly extract the pitches of the waveform, and to send a sounding start command based on the extracted pitch to the sound source circuit. Generally, when the sound is generated, various kinds of waveforms appear. If the fundamental wave component is obtained from the generated found by using a low-pass filter, it is very difficult to determine the measuring points for pitch extraction, with the influence by the characteristics of the filter. Some examples of the output waveform of the low-pass filter are illustrated in Fig. 1. The waveform as shown in Fig. 1(a) frequently appears when a string is picked. If the pitch of that waveform is determined by the time intervals respective between the zero-cross points after the maximum and minimum peak points, the controller of the musical instrument may frequently treat the time interval of (a) as one period. The true one period, in this case, is the interval of (b). Thus, if the response is quickened at the start of sounding, the musical instrument mistakenly operated. A possible measure taken for this problem is to use a large threshold level (corresponding to the ON level in the figure), which is for checking whether or not the waveform as shown in Fig. 1(a) is caused by the vibration of a string, and not to detect the waveform levels below the threshold level. When a weak waveform as shown in Fig. 1(b) comes in, however, this measure considers that no string vibration is produced. In this case, of course, no sound is produced from the sound source circuit and it is extremely unnatural when hearing the sound from the guitar. The period measurement starts when both the positive and negative peak points appear as shown in Fig. 1(c). In the case of the input waveform of (c), the period of (c) is not measured, but the period of (d) is measured. This indicates that the sounding start timing is slightly delayed. This example is directed to solve the problem of the sounding start timing delay. To solve this problem, the maximum and minimum peaks immediately after the waveform rises are compared. A time interval is detected, and used as the period of the musical tone waveform. The time interval is the point relating to the larger peak point is used as the sounding start point. The peak point, which is similarly detected and exists in the same domain as that of the larger peak point, is used as the end of the time interval. A controller directs the start of sounding the musical tone at the frequency as defined by the detected period. The point relating to the maximum and minimum peak points may be the zero-cross point immediately after or before the maximum or minimum peak point, or may be the maximum or minimum peak point per se. 2. Description of Arrangement and Operation 1) Arrangement An overall circuit arrangement of the example is illustrated in Fig. 2. CPU 600 receives interrupt signals INTan and INTbn (n is any of 1 to 6) from pitch extraction circuits P1 to P6, and cooperates with work memory 601 to work out the period data. 2) Operation A interrupt routine, which is applied for CPU 600, and a main routine are illustrated in Figs. 3, 4A and 4B. Although these routines are for only one string operation, the same processings are correspondingly applied for other five string operations. In processing these six string operations, CPU 600 executes the processings for six strings in a time divisional manner. Before proceeding with the detailed description of the CPU operation, main registers in work memory 601 will first be described. A STEP register contains four stages 0, 1, 2, and 3. The contents of the STEP register progressively change, as shown in Fig. 5(b) or Fig. 6(b), as the string is picked and vibrates (Fig. 5(a) or Fig. 6(a)). The contents 0 of this register represents the note-off state. A SIGN register is used for indicating that the zero-cross point for period measurement is after the maximum peak point or the minimum peak point. The contents 1 of the register indicates that the zero-cross point after the maximum peak point, and the contents 2 of the register indicates the zero-cross point after the minimum peak point. A REVERCE register stores the data to check whether the interrupt processing has been made, which is executed at the arrival of the zero-cross point after the peak point which is located in opposition to the zero-cross point as given by the SIGN register. A T register stores the count of counter 7 at a specific point to measure the period of the input waveform. Count 7 free runs responsive to a given clock signal. An AMP (i) register stores the maximum or minimum peak value, more exactly, its absolute value, which is applied from A/D converter 11 and latched in latch 12. An AMP (1) register stores the maximum peak value, and an AMP (2) is for minimum peak value storage. A PERIOD register stores the data of measured. On the basis of the contents of this register, CPU 600 executes the frequency control against frequency ROM 8 and sound source circuit 9. As will be described later, for various types of judgement, three constants (threshold levels) are contained in CPU 600. The first constants is ONLEVI. As shown in Fig. 5(a) and Fig. 6(a), the system is in the note-off mode. In this mode, when a peak level larger than ONLEVI, the CPU considers that a string has been picked, and starts the period measurement. ONLEVII is used in such a way that in the note-on mode, when the difference between the previous and this-time detection levels is above the level of ONLEVEII, the CPU executes the relative-on processing even if the tremolo, for example, is used. OFFLEV is used in such a manner that in the note-on mode, if the peak value detected is below this level of OFFLEV, the note-off processing is executed (Fig. 7). A main routine and interrupt routines, which are used in the example, will be described. The preparatory knowledge as mentioned above will assist you in understanding the routine description to follow. CPU 600 receives the output signal of AND gate 224 or 225 as interrupt signal INTa or INTb, and executes the interrupt processing shown in Fig. 3. When receiving interrupt signal INTa, the CPU executes step P1 and sets the a-register to "1". When receiving interrupt signal INTb, the CPU 600 executes step P2 and sets the same resistor to "2". In step P3, CPU 600 presets the count of counter 7 into the t-register in the CPU. In the next step P4, the CPU fetches the peak level data in A/D converter 411, and sets that data into the b-register of CPU 600. In step P5, CPU 600 clears FF 214 or 215. In step P6, CPU 600 transfers the contents of the a-, b-, and c- registers to work memory 601 for storage. At this point, the interrupt processing is completed. In step Q1 of the main routine (Figs. 4A and 4B), CPU 600 judges whether or not the contents of the a'-, b'-, and c'-registers have been stored into work memory 601, through the interrupt processing. Primed characters a', b' and c' corresponds to a, b and c above, and indicate that these items of data have previously stored, respectively. If no interrupt processing has been executed, the answer to step Q1 is NO, and CPU 600 repeats the execution of step Q1. If the answer is YES, the CPU 600 advances to step Q2. In this step, the CPU reads out the registered contents a', b' and t'. Then, the CPU 600 goes to step Q3, and reads out the peak value at the peak point of the same type (maximum or minimum) which has been stored in AMP (a') register. The CPU 600 sets the peak value b' extracted this time into AMP (a') register. In step Q4 to Q6, the CPU 600 checks if the contents of STEP register is 3, 2 or 1. When the system of the electronic guitar under discussion is in the initial condition, the STEP register is 0, and therefore the answer to steps Q4, Q5 and Q6 is NO. In step Q7, the CPU checks if the peak value b' detected this time is above or below the level of ONLEVI. If the peak value b' is below ONLEVI, the sounding start processing is not executed and the CPU 600 returns to step Q1. If it is above ONLEVI, step Q7 gives the answer of YES and the CPU 600 advances to step Q8. In step Q8, the CPU sets "1" to the STEP register. In the next step Q9, the CPU sets "0" to the REVERSE register. In step Q10, the CPU inputs the value of a' into the SIGN register. The value of a' is "1" at the zero-cross point immediately after the maximum peak point, and is "2" at the zero-cross point immediately after the minimum peak point. In step Q11, the value of t' is set in the T register. As the result of it, the value of a' is set in the SIGN register, that of b' in the AMP register, and that of t' in the T register. In this instance, the value of the SIGN register is "1" (Fig. 5(a) and Fig. 6(a)). Then, the CPU returns to step Q1 again. The processing of the main routine immediately after zero-cross point Zero 1 in Fig. 5(a) and Fig. 6(a) is completed through the execution of the sequence of processing steps as explained above. The main routine immediately after the zero-cross point Zero 2 will be described. In this processing, steps Q1, Q2, Q3, Q4, Q5 and Q6 will be executed . If the answer YES is given in step Q6, the CPU 600 advances to step Q12. When the input waveform rises at the time of waveform inputting as shown in Fig. 5(a) and Fig. 6(a), the SIGN register is "1". Since the present wave of the waveform has passed the negative peak, the register is "2" and NO is given. When the zero-cross point immediately after the peak point with the same polarity is reached, this step gives YES. The CPU 600 does not execute any further processing and returns to step Q1. In step Q12, NO is given, and after that, the CPU advances to Q13 and sets 2 in the STEP register (see Fig.5(b) and Fig.6(b)). Following step Q13, the CPU 600 executes step Q14 and compares the previous peak point (AMP (SIGN)) with the present peak point (b'). If the previous value X0 is smaller than the present value (X1>X0) as shown in Fig. 5(a), YES will be given. To set up the period measuring start point at time point t' (Fig. 5(c)), the CPU 600 jumps from step Q14 to steps Q10 and Q11, to set 2 in the SIGN register and at the same time to transfer the contents of the t'-register to the T register. On the contrary, if the previous peak point is above the present peak point, X1<X0, as shown in Fig. 6(a), NO is given in step Q14 and 1 is set in the REVERSE register in step Q15. In this case, the previous point 1 is maintained in the SIGN register. As the result of it, the previous zero-cross point Zero 1 is the period measuring start point, in this case (see Fig. 6(c)). When the CPU 600 executes the main flow after the next zero-cross point (Zero 3) is passed, the CPU advances to step Q16 after YES is given in step Q5. The present value of a' is 1, that of the SIGN register is 2 as shown in Fig. 5, and that of the SIGN register is 1 as shown in Fig. 6. Therefore, in the case of Fig. 5, NO is given in step Q16 and the CPU advances to Q15 and returns to Q1. In other words, CPU 600 recognizes that the first peak point (amplitude X2) is passed after the period measurement starts. In Fig. 6, the CPU 600 has the answer of YES in step Q16 and advances to step Q17 to check if the value of the REVERSE register is 1. If the value of the REVERSE register is not 1, the CPU judges NO and returns to step Q1. As mentioned above, after execution of step Q15, the value of this register is 1. Then, the CPU 600 advances to step Q17 and Q18, and inputs 3 in the STEP register (see Fig. 6). In step 19, the CPU 600 subtracts the value of the T register, i.e. the time of the zero-cross point Zero 1, from the value of the counter 7 given by the this-time interrupt processing, and the CPU loads it in the PERIOD register. The time length PERIOD shown in Fig. 6(c) is that of one period. In step Q20, the CPU transfers the contents of t' to the T register, and starts the new period measurement. In step Q12, CPU 600 issues a sounding start (note-on) command to frequency ROM 8 and sound source circuit 9 in accordance with the contents of the PERIOD register. At this time, the sounding starts. In the case of Fig. 5, the main flow after the next zero-cross point Zero 4 is executed again, and the CPU 600 jumps from step Q5 to Q16. Since the value of the SIGN register is now 2, YES is given in step Q16. Subsequently, steps Q17 to Q21 are executed. At this time, CPU 600 recognizes the time interval from zero-cross points Zero 2 to Zero 4 shown in Fig. 5(c), as one period. The guitar starts the sounding of the musical tone at the frequency as defined by the time length recognized (see Fig. 5). Thus, the period measurement is executed from the next zero-cross point after the peak point whose value is big. the period measurement is completed at the next zero-cross point located in the same side as the previous peak point. As the result of it, the period of low-pass filter 3 output waveform is extracted. After the sounding start processing, the CPU 600 advances from step Q4 to step Q22 in the main routine processing, and checks if the value of the present peak point b' is above OFFLEV as shown in Fig. 7. If now that value is above this level, the CPU 600 advances to step Q23, and judge whether or not the relative-on processing should be executed. In other words, the CPU 600 checks if the value of the present peak point (b') is above that of the previous peak point by ONLEVII, i.e. checks if the value of the extracted peak point rapidly increases during sounding. When a string is picked, the vibration of the string gradually damps toward zero. NO is given in step Q23. In case that before the vibration of the string previously picked damps to zero, another string is picked by the tremolo playing, for example, the answer to step Q23 is often YES. In this case, the CPU 600 jumps to step Q8 after judging YES in Q23, and then executes step Q9 to step Q11. As a result, the CPU 600 sets "1" in the STEP register, and subsequently executes the same processing as that of the sounding start. In other words, after loading "1" in the STEP register, the CPU 600 executes step Q16 to step Q21 again, and executes the relative-on processing. In the normal picking, the CPU 600 executes step Q23 followed by step Q24, and compares the contents of a'-register with those of the SIGN register. If these do not coincide, the CPU advances to step Q15 for the interrupt processing at the next zero-cross point. If these coincide, the CPU 600 proceeds to step Q2 because the present wave of the waveform has the peaks with the opposite polarities (positive and negative peaks) in the past. Then the CPU 600 judges whether or not the value of the REVERSE register is "1". If the result is NO, it returns directly to step Q1. If YES is given, the CPU advances from step Q25 to step Q26. Then the contents of the T register is subtracted from those of the t' register for obtaining a new period, and the result is set in the PERIOD register. In step Q27, the contents of t' register are transferred to the T register. Subsequently, on the basis of the value of the PERIOD register obtained in step Q28, CPU 600 executes the frequency control for frequency ROM8 and sound source circuit 9. Thus, this example discretely picks up a variation of the frequency of string vibration, and controls the frequency according to the picked up discrete data in a real time manner. The CPU 600 advances from step Q28 to step Q29, and clears the REVERSE register, and finally executes the period measuring. As described above, when the string vibration damps and the peak value becomes below the level of OFFLEV, the CPU 600 jumps from step Q22 to step Q30 to clear the STEP register. In the next step Q31, the note-off processing is executed, and the CPU 600 gives the note-off command to sound source circuit 9, to stop the sounding of musical tone. Thus, if the waveform as shown in Fig. 32(a) is input, the time length of (b) is measured, and as the measurement terminates, the sounding start processing is executed. Since the on-level may be reduced, the vibration as shown in Fig. 32(b) can be detected. In the case of the waveform of Fig. 32(c), the sounding starts as soon as the period of (c) or the first wave is measured. Therefore, the sounding can be quickly started, providing a quick response. In the above-mentioned embodiment, the CPU 600 executes the interrupt processing at the zero-cross point immediately after each peak point followed by the various types of processings such as the sounding start, period calculation, relative-on and note-off. If necessary, these processings can be executed when each peak point is detected or when the zero-cross point immediately before the peak point is detected. Any other suitable measure may be taken for obtaining the reference point. 3. Effects As described above, the maximum and minimum peak values immediately after the input waveform rises, are compared with each other. A time interval is detected as the period of the waveform. The time interval starts at a point relating to the larger peak point, and terminates at a peak point which is located in the same domain as that of the peak point as detected in a similar way, and satisfies a predetermined condition. The period control is performed by using the detective period. With such a scheme, the exact period measurement can be quickly performed at the start of sounding, with lessened delay when the waveform rises. Embodiment 1. General An embodiment of an electronic guitar according to the present invention will be described referring to Figs. 8 to 12. Technical problems to which this embodiment is directed is illustrated in Fig. 8. In the figure, (j) indicates an input waveform, (k) an envelope connecting positive peaks, (1) a waveform of a positive peak detect signal, (m) an envelope connecting negative peaks, and (n) a waveform of a negative peak detection signal. As shown in Fig. 8, when the input waveform abruptly damps by the mute playing, for example, if the peak level is below a predetermined level OFFLEV, control executes the note-off processing to stop the sounding. In this approach, however, it is very difficult to pick up peak points. For this reason, the note-off processing is delayed. According to this embodiment, if the input signal level abruptly damps to such an extent to make it difficult to detect the peaks of the input signal waveform, this damping can be detected quickly and reliably, and the note-off processing can be executed. When the input signal waveform drops below a predetermined value for a predetermined period of time, control gives a note-off command. 2. Description of Arrangement and Operation 1) Arrangement An overall arrangement of this embodiment is shown in Fig. 9. This arrangement is substantially equal to that of Fig. 2. Like portions are designated by like symbols in Fig. 2, for simplicity. Some of main features of this embodiment are 1) to apply a latch lock to latch 412 at the maximum (positive) and minimum (negative) peak detections, via OR gates 1016 and 1017, and 2) to apply a clock signal CL through AND gate 1026 'and OR gate 1017 when CPU 1000 applies a latch command signal L in logical high. The waveforms (a) to (g) of the signals at key portions in Fig. 9 are shown in Fig. 10. Of those signals, latch command signal (g) continues logical high during the period ranging from an instant that CPU 1000 fetches the peak values from latch 412 at the maximum and minimum peak points in response to interrupt signals INTa and INTb until the next peak detect signals (b) and (c) are applied. During the period with application of interrupt signals INTan and INTbn ("n" is any of 1 to 6), in the case of a sine wave as an input signal waveform, the peak values are latched in the first half of the wave between the top and bottom, i.e. between the zero-cross point and the maximum or minimum peak point. In the range from the maximum or minimum peak point and the next zero-cross point, the peak value is held. The output signal from each latch 412 is applied to CPU 1000. This data is used for controlling the controls such as note-on, note-off, pitch extraction start, pitch extraction stop, and control of sounding level (volume control). The peak values as latched in each latch 412 before the output of latch command signals L1 to L6 are stopped, are successively stored into work memory 601. When the absolute value of the data representative of the waveform level as applied from A/D converter 411 is above a predetermined value, CPU 1000 executes the note-on and the pitch (fundamental frequency) extraction. When the data is below the note-off level OFFLEVE shown in Fig. 12, the volume level is abruptly stopped to terminate the sounding. The operation of this will be given in detail later. In the circuit arrangement, A/D converter 411 is provided for each pitch extraction circuit P1 to P6. If necessary, a single A/D converter may be used in common for those pitch extraction circuits, and be operated in a time-divisional manner. 2) Operation A main routine of CPU 1000 is illustrated in Fig. 11. A interrupt routine, which is applied for CPU 1000, may be substantially equal to that of CPU 600 of Fig. 3. Although these routines are for only one string operation, the same processings are correspondingly applied for other five string operations. In processing these six string operations, CPU 1000 executes the processings for six strings in a time divisional manner. Figs. 5 and 6 will be used for explaining the operation of this embodiment. a) Registers in work memory 601 Before proceeding with the detailed description of the CPU operation, main registers in work memory 601 will first be described. A STEP register contains four stages 0, 1, 2, and 3. The contents of the STEP register progressively change, as shown in Fig. 5(b) or Fig. 6(b), as the string is picked and vibrates (Fig. 5(a) or Fig. 6(a)). The contents 0 of this register represents the note-off state. A SIGN register is use for indicating that the zero-cross point for period measurement is after the maximum peak point or the minimum peak point. The contents 1 of the register indicates that the zero-cross point after the maximum peak point, and the contents 2 of the register indicates the zero-cross point after the minimum peak point. A REVERCE register stores the data to check whether the interrupt processing has been made, which is executed at the arrival of the zero-cross point after the peak point which is located in opposition to the zero-cross point as given by the SIGN register. This is used for checking the pitch (fundamental frequency) extraction control for each period. A T register stores the count of counter 7 at a specific point to measure the period of the input waveform. Count 7 free runs responsive to a given clock signal. An AMP (i) register stores the maximum or minimum peak value, more exactly, its absolute value, which is applied from A/D converter 411 and latched in 412. An AMP (1) register stores the maximum peak value, and an AMP (2) is for minimum peak value storage. A PERIOD register stores the data of measured. On the basis of the contents of this register, CPU 1000 executes the frequency control against frequency RDM 8 and sound source circuit 9. An OFF register contains "1" when the level data of the input waveform latched in latch 412 is below OFFLEV as the note-off level shown in Fig. 12. It contains "0" when it is above OFFLEV during the sounding. An OFT register stores the count of counter 7 when 21" is set in the OF register. If the time duration of the state of "1" in the OF register is a predetermined time duration, for example, the period of of a string vibration in the open string mode, more exactly, 12 msec for the sixth string, for example, the note-off processing is executed. As will be described later, for various types of judgement, three constants (threshold levels) are contained in CPU 1000. The first constants is ONLEVI. As shown in Fig. 5(a) and Fig. 6(a), the system is in the note-off mode. In this mode, when a peak level larger than ONLEVI is detected, the CPU decides that a string has been picked, and starts the period measurement. ONLEVII is used in such a way that in the note-on mode, when the difference between the previous and this-time detection levels is above the level of ONLEVEII, the CPU executes the relative-on processing even if the tremolo, for example, is used. OFFLEV is used in such a manner that in the note-on mode, if the peak value detected is below this level of OFFLEV, the note-off processing is executed (Fig. 12(a)). A main routine and interrupt routines, which are used in the tenth embodiment, will be described. The preparatory knowledge as mentioned above will assist you in understanding the routine description to follow. b) Processing of the main routine In step S1001 of the main routine (Figs. 11A and 11B), CPU 1000 judges whether or not the contents of the a'-, b'-, and c'-registers have been stored into work memory 601, through the interrupt processing. Primed characters a', b', and c' corresponds to a, b and c above, and indicate that these items of data have previously stored, respectively. If no interrupt processing has been executed, the answer to step S1001 is NO, and the CPU repeats the execution of step S1001 by going through the note-off processing in steps S1030 to S1038. If the answer is YES, the CPU 1000 advances to step S1002. In this step, the CPU 1000 reads out the registered contents a', b' and t'. Then, the CPU 1000 goes to step S1002, and reads out the peak value at the peak point of the same type (maximum or minimum) which has been stored in AMP (a') register. The CPU 1000 sets the peak value b' extracted this time into AMP (a') register. In steps S1004 to S1006, the CPU 1000 checks if the contents of STEP register is 3, 2 or 1. When the system of the electronic guitar under discussion is in the initial condition, the STEP register is 0, and therefore the answer to steps S1004, S1005 and S1006 is NO. In step S1007, the CPU 1000 checks if the peak value b' detected this time is above or below the level of ONLEVI. If the peak value b' is below ONLEVI, the sounding start processing is not executed, and the CPU 1000 returns to step S1001. if it is above ONLEVI as shown in Fig. 5(a) and Fig. 6(a), step S1007 gives the answer of YES, and the CPU 1000 advances to step S1008. In step S1008, the CPU 1000 sets "1" in the STEP register. In the next step S1009, the CPU 1000 sets "0" in the REVERSE register. In step S1010, the CPU 1000 inputs the value of a'-register into the SIGN register. The value of a'-register is "1" at the zero-cross point immediately after the maximum peak point, and is "2" at the zero-cross point immediately after the minimum peak point. In step S1011, the value of t'-register is set in the T register. As a result, the contents of a'- register is set in the SIGN register (now SING is "1" in the case of Figs. 5(a) and Fig. 6(a)), the contents of the b'-register is set in the AMP register. The contents of the t'-register is loaded into the T register. Then, the CPU 1000 returns to step S1. The processing of the main routine immediately after the zero-cross point Zero 1 in Fig. 5(a) and Fig. 6(a) is completed through the execution of the sequence of processing steps explained above. The main routine immediately after the zero-cross point Zero 2 will be described. In this processing, the data set processing and the note-on step discrimination processing in steps S1001, S1002, S1003, S1004, S1005 and S1006 will be executed. If the answer YES is given in step S1006, the CPU 1000 advances to step S1012. When the input waveform rises at the time of waveform inputting as shown in Fig. 5(a) and Fig. 6(a), the SIGN register contains "1". Since the present wave of the waveform has passed the negative peak, the a'- register contains "2", and NO is given. When the zero-cross point immediately after the peak point with the same polarity is reached, YES is given in this step S1012. The CPU 1000 does not execute any further processing and returns to step S1001. In step S1012, NO is given, and then, the CPU advances to step S1013, and sets "2" in the STEP register (see Fig. 5(b)). Following step S1013, the CPU 1000 executes step S1014, and compares the previous peak point (AMP (SIGN)) with the present peak point (b'). If the previous value X0 is smaller than the present value (x1>x0) as shown in Fig. 5(a), YES will be given. To set up the period measuring start point at time point t' (Fig. 5(c)), the CPU 1000 jumps from step S1014 to steps S1010 and S1011, to set "2" in the SIGN register and at the same time to transfer the contents of the t'-register to the T register. On the contrary, if the previous peak point is above the present peak point, x1<x0, as shown in Fig. 6(a), NO is given in step S1014 and "1" is set in the REVERSE register. In this case, the previous point "1" is maintained in the SIGN register. As a result, thE previous zero-cross point Zero 1 is the the period measuring start point, in this case (see Fig. 6(C)). When the CPU executes the main flow after the next zero-cross point (Zero 3) is passed, the CPU 1000 advances to step S1016 after YES is given in step S1005. The present value of the a'-register is "1", that of the SIGN register is "2" as shown in Fig. 5, and that of the SIGN register is "1" as shown in Fig. 6. Therefore, in the case of Fig. 5, NO is given in step S1016 and the CPU 1000 advances to step S1015 and returns to step S1001. In other words, CPU 1000 recognizes that the first peak point (amplitude × 2) is passed after the period measurement starts. In Fig. 6, the CPU 1000 has the answer of YES in step S1016, and advances to step S1017 to check if the REVERSE register contains "1". If the value of the REVERSE register is "1", the CPU 1000 has the answer of NO, and returns to step S1001. As mentioned above, after execution of step S1015, the value of this register is "1". Then, the CPU advances to step S1018, and inputs "3" in the STEP register (see Fig. 6(b)). In step S1019, the CPU 1000 substracts the value of the T register, i.e., the time of the zero-cross point Zero 1, from the value of the counter 7 given by the this-time interrupt processing, and the CPU 1000 loads it in the PERIOD register. 6 The time length PERIOD shown in Fig. 6(c) is that of one period. In step S1020, the CPU transfers the contents of the t'-register to the T register, and starts the new period measurement. In step S1021, CPU 1000 issues a sounding start (note-on) command to frequency ROM 8 and sound source circuit 9 in accordance with the contents of the PERIOD register. At this time, the sounding starts. In the case of Fig. 5, the main flow after the next zero-cross point Zero 4 is executed again, and the CPU jumps from step S1005 to S1016. Since the value of the SIGN register is now 2, YES is given in step S1016. Subsequently, the sounding start processing in steps S1017 to S1021 are executed. At this time, CPU 1000 recognizes the time interval from zero-cross points Zero 2 to Zero 4 shown in Fig. 5(c), as one period. The guitar starts the sounding of the musical tone at the frequency as defined by the time length recognized (see Fig. 5(d)). Thus, the period measurement is executed from the next zero-cross point after the peak point whose value is big. The period measurement is completed at the next zero-cross point located in the same side as the previous peak point. As the result of it, the period of low-pass filter 3 output waveform is extracted. After the sounding start processing, the CPU 1000 advances from step S1004 to step S1023 in the main routine processing, and judges whether or not the relative-on processing should be executed. In other words, the CPU 1000 checks if the value of the present peak point (b') is above that of the previous peak point by ONLEVII, i.e. checks if the value of the extracted peak point rapidly increases during sounding. When a string is picked, the vibration of the string gradually damps toward zero. NO is given in step S1023. In case that before the vibration of the string previously picked damps to zero, another string is picked by the tremolo playing, for example, the answer to step S1023 is often YES. In this case, the CPU 1000 jumps to step S1008 after judging YES in S1023, and then executes the preparatory processing for note-on in step S1009 to step S1001. As a result, the CPU 1000 sets "1" in the STEP register, and subsequently executes the same processing as that of the sounding start. In other words, after loading "1" in the STEP register, the CPU 1000 executes step S1016 to step S1021 again, and executes the relative-on processing. In the normal picking, the CPU 1000 executes step S1023 followed by step S1024, and compares the contents of the a'-register with those of the SIGN register. If these do not coincide, the CPU 1000 advances to step S1015 for the interrupt processing at the next zero-cross point. If these coincide, the CPU proceeds to step S1025 because the present wave of the waveform has the peaks with the opposite polarities (positive and negative peaks) in the past. Then the CPU 1000 judges whether or not the value of the REVERSE register is "1". If the result is NO, it returns directly to step S1001. If YES is given, the CPU 1000 advances from step S1025 to step S1026. Then the contents of the T register is subtracted from those of the t'-register for obtaining a new period, and the result is set in the PERIOD register. In step S1027, the contents of the t'-register are transferred to the T register. Subsequently, on the basis of the value of the PERIOD register obtained in step S1028, CPU 1000 executes the frequency (pitch) control for frequency ROM 8 and sound source circuit 9. Thus, this embodiment discretely picks up a variation of the frequency of string vibration, and controls the frequency according to the picked up discrete data in a real time manner. The CPU 1000 advances from step S1028 to step S1029, and clears the REVERSE register, and finally executes the period measuring. When the string vibration abruptly damps by the mute playing, and the peak level falls below OFFLEV, as shown in Fig.12, in step S1030, CPU 1000 decides that the present contents of the STEP register is 3. As shown in Fig. 12(c), the CPU 1000 detects that the waveform level of the input signal, which is derived from A/D converter 411 and latched in latch 412, becomes below the note-off level OFFLEV (step S1031). "1" is set in the OF register which has stored "0", and the count of counter 7 is set to the OFT register. The CPU returns step S1001 (steps S1023 to S1034). Since the peak value is below the OFFLEV level, if the input waveform reaches the peak, the waveform level of the signal, which is applied from A/D converter 412 to latch 412, never exceeds OFFLEV. Therefore, the CPU never goes from steps S1030 and S1031 to step S1038, so that "1" is maintained in the OF register. If the state that the waveform level is below OFFLEV is continued for the length of one wave of the string vibration, for 12 msec or more in the case of the sixth string, CPU 1000 in step S1035 recognizes this by using the difference between the count as set in the OFT register and the present count of counter 7. In step S1036, CPU 1000 clears the STEP register and the OF register, and executes the note-off processing in step S1037, and gives a note-off command to sound source circuit 9, to stop the sounding. In this way, the note-off processing can be executed quickly and reliably, even if the waveform level abruptly changes, by detecting that the waveform level below OFFLEV for 12 msec, for example. Since such damping temporarily occurs, if the peak level exceeds OFFLEV, CPU 1000 detects this in step S1031, and clears the OF register in step S1038, and does not execute the note-off processing. Therefore, if the abrupt drop of the waveform level occurs as shown in Fig. 8, and neither of interrupt signals INTa and INTb is generated, clock signal CL is always applied to latch 412. The latch command signal L as indicated by (8) in Fig. 10 keeps high level state. Then, the output of A/D converter 411 is applied to CPU 1000 via latch 12. The CPU executes the note-off processing according to this peak value. As a result, the note-off response is improved. The above-mentioned embodiment is so arranged that when the waveform level of the 6th string is below the level of OFFLEV, the note-off is executed. In an alternatively, the note-off may be executed when such a level of the input waveform is continued for the other time duration than 12 ms, i.e., the period or more of the musical tone as generated by the electronic guitar. The above-mentioned embodiment is also so arranged that CPU 1000 executes the interrupt processing immediately at the zero-cross point after each peak point, followed by the note-on start, period computation, relative-on, note-off start, etc.. These processings may be performed immediately after each peak point detection. In this case, the same effects as those attained by the former case may be attained. Additionally, these processings may be done upon detection of the zero-cross point immediately before the peak point. Any other suitable measure may be used for the reference point setting up. Each processing, which is executed in the main routine in the above-mentioned embodiment, may be done in each interrupt processing. While in the above-mentioned embodiment, the present invention is applied for the electronic guitar, it can be applied for any other systems of the type in which pitches are extracted from a sound signal or an electrical vibration as input from a microphone, for example, and an acoustic signal, which is different from the original signal, is generated at the pitches or note frequencies corresponding to those of the original signal. Specific examples of such are electronic pianos with key boards, electronic wind instruments, electronic string instruments such as electronic violins and koto (Japanese string instrument). 3. Effects As described above, in the above-mentioned embodiment, when the input signal level below a predetermined level continues for a predetermined time duration, the note-off is executed. If the mute playing is made, and the waveform abruptly drops to such a level to be too low for detecting the peak point, the level drop can reliably and quickly be detected, to execute the note-off processing. This cannot be realized by the conventional system of the type in which the note-off is executed upon detection of the dropping of the peak of the input signal wave below a predetermined value. With such an arrangement, good performance is obtained. The electronic system of the electronic guitar more quickly enters the new note-on processing of the musical tone.

Claims: Apparatus for generating a musical tone signal in accordance with an input waveform signal, comprising: detecting means (P1-P6, 8, 1000, S1001-S1021, S1023-S1029) for detecting an amplitude level and a frequency of an input waveform signal; sounding commanding means (1000, S1021) for providing a command to generate a musical tone having the frequency of the input waveform signal detected by said detecting means (P1-P6, 8, 1000, S1001-S1021, S1023-Sl029), and level judging means (1000, S1031) for judging whether the amplitude level of said input waveform signal detected by said detecting means is below a predetermined value; characterized by: continue judging means (1000, S1035) for judging whether the input signal amplitude level below the pretermined level continues for a pretermined period of time; and sounding stop commanding means (1000, S1037) for stopping sounding when said continue judging means (1000, S1035) judges that said input signal amplitude level state continues for the predetermined time. The apparatus according to claim 1, characterized in that said detecting means (P1-P6, 8, 1000, S1001-S1021, S1023-S1029) includes: measuring means (P1-P6, 7, S1014-S1020, S1023-S1027) for measuring a given time period of said input waveform signal; and determining means (8, 1000, S1021, S1028) for determining the frequency of said input waveform signal based on the measured time period. The apparatus according to claim 2, characterized in that said measuring means (P1-P6, 7, S1014-S1020, S1023-S1027) measures a time duration between two zero-cross points following two successive peak points having a predetermined polarity of said input waveform signal. The apparatus according to claim 2, characterized in that said measuring means (P1-P6, 7, S1014-S1020, S1023-S1027) measures a time duration between two zero-cross points immediately before two successive peak points having a predetermined polarity of said input waveform signal.

Inventors: OBATA KATSUHIKO, UCHIYAMA SHIGERU, OBATA, KATSUHIKO, UCHIYAMA, SHIGERU, Obata, Katsuhiko, Patent Dept. Dev. Div Hamura R&amp;D, Uchiyama, Shigeru, Patent Dep. Dev. Div Hamura R&amp;D
Applicants: CASIO COMPUTER CO LTD, CASIO COMPUTER COMPANY LIMITED
Application year: 1987
Main classification: G10H3
IPC codes: G10H3