Electronic musical instrument, sound production control method, and program
The electronic musical instrument uses a control unit to switch between chord and melody tones based on elapsed time, addressing the challenge of seamless melody and chord production, ensuring high-quality sound playback.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- CASIO COMPUTER CO LTD
- Filing Date
- 2024-12-23
- Publication Date
- 2026-07-03
AI Technical Summary
Existing electronic musical instruments struggle to produce both melody and chords seamlessly without dividing the keyboard area, leading to poor sound quality when playing a piece of music.
The electronic musical instrument incorporates a control unit that determines the elapsed time since the last key press to decide whether to produce a chord tone or a melody tone based on the timing of the operation, using a predetermined time threshold to switch between chord and melody sounds.
Enables high-quality playback of melodies and chords regardless of how the user plays, allowing the melody to progress smoothly without key release and ensuring appropriate sounding of both components.
Smart Images

Figure 2026111002000001_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to an electronic musical instrument, a tone generation control method, and a program.
Background Art
[0002] Conventionally, in an electronic musical instrument, a technique is known in which chord information of a piece of music is acquired, and the pitch actually played by a performer (user) is replaced with any chord constituent tone and sounded based on the chord information of the piece of music. For example, Patent Document 1 describes an electronic musical instrument that inputs chord information in the left half of a keyboard and outputs the pitch (played pitch) input in the key range of the right half by replacing it with the constituent tones of the input chord information.
Prior Art Documents
Patent Documents
[0003]
Patent Document 1
Summary of the Invention
Problems to be Solved by the Invention
[0004] However, with the technique described in Patent Document 1, it is not possible to sound the melody and chords of a piece of music well without dividing the keyboard area.
[0005] The present invention has been made in view of the above problems, and an object thereof is to sound well regardless of how a user plays a piece of music including a melody and chords.
Means for Solving the Problems
[0006] To solve the above problems, the electronic musical instrument according to the present invention comprises a plurality of controls, a sound-producing unit, and a control unit. When a user operates one of the plurality of controls while a designated musical piece is in progress, the control unit determines whether a predetermined amount of time has elapsed since the operation immediately preceding the current operation. If it determines that the operation was performed before the predetermined time had elapsed, the control unit causes the sound-producing unit to produce a chord tone corresponding to the timing of the operation in the musical piece. If it determines that the operation was performed after the predetermined time had elapsed, the control unit causes the sound-producing unit to produce a melody tone corresponding to the timing of the operation in the musical piece. [Effects of the Invention]
[0007] According to the present invention, a musical piece including melody and chords can be played with good sound quality regardless of how the user plays it. [Brief explanation of the drawing]
[0008] [Figure 1] This is a block diagram showing the functional configuration of an electronic musical instrument according to an embodiment of the present invention. [Figure 2] This diagram schematically shows the main switches included in the control unit. [Figure 3] Figure 1 is a diagram illustrating the key aspects of the operation of the electronic musical instrument shown. [Figure 4] Figure 1 is a flowchart showing the flow of the main processing performed by the CPU. [Figure 5] This is a flowchart showing the flow of the music playback process performed in step S104 of Figure 4. [Figure 6] This is a flowchart showing the flow of the performance operation process performed in step S105 of Figure 4. [Figure 7] This is a flowchart showing the flow of the performance operation process performed in step S105 of Figure 4. [Figure 8] This is a flowchart showing the flow of the performance operation process performed in step S105 of Figure 4. [Figure 9]This is a flowchart showing the flow of the root tone determination process performed in step S314 of Figure 7. [Figure 10] This is a diagram illustrating the method for deriving candidate sounds for pronunciation. [Figure 11] Figure 1 shows two cases when a song is played (progressed) using an electronic musical instrument: one where the melody is played and another where chords are played. [Figure 12] Figure 1 shows the key press data (1 to 2 notes) and the corresponding sound generation data for the electronic musical instrument during the progression of a song. [Figure 13] Figure 1 shows the key press data (3 notes) and the corresponding sound generation data for the electronic musical instrument during the progression of a song. [Modes for carrying out the invention]
[0009] If the embodiments for carrying out the present invention described below are not adopted, for example, a melody produced in response to a key press will continue to be produced at the same pitch unless the key corresponding to the melody is released, and the next melody note will not be produced, resulting in the melody not progressing even as the music progresses. According to the present invention, even if the key that produced the melody is not released, new melody notes will be produced as appropriate by pressing new keys in accordance with the progress of the music, thus having the advantage of the melody progressing smoothly.
[0010] In this embodiment of the present invention, the ability to produce a melody sound is determined by the time difference between the current key press timing and the previous (immediately preceding) key press timing. However, in another embodiment, the ability to produce a melody sound may be determined by the time difference between the current key press timing and the previous key press timing that produced a melody sound.
[0011] In addition, in the embodiment of the present invention, 60 ticks are set as the predetermined time. However, instead of ticks, a time difference in real time (for example, 1 second) may be set. The predetermined time may be set to 40 ticks, which is shorter than 60 ticks. On the other hand, considering that the melody plays a central role in the music, it is desirable that the melody is appropriately and well sounded according to the user's performance operation. Setting a long time such as 100 ticks or 200 ticks as the predetermined time is considered undesirable from the perspective of appropriately sounding the melody. If no set time is provided, cases may occur where only the melody sound is emitted without the chord constituent sounds being emitted. In order to emit the melody sound and the chord constituent sounds well, another algorithm is required, increasing the CPU load.
[0012] Hereinafter, embodiments for implementing the present invention will be described with reference to the drawings. However, various technically preferable limitations for implementing the present invention are imposed on the embodiments described below. Therefore, the technical scope of the present invention is not limited to the following embodiments and illustrated examples.
[0013] First, the configuration of the electronic musical instrument 1 according to the embodiment of the present invention will be described. When there is a key press by the user, the electronic musical instrument 1 has a function of converting the pitch of the pressed key into the pitch calculated based on the melody or chord information specified in the music and outputting it.
[0014] As shown in FIG. 1, the electronic musical instrument 1 includes a CPU (Central Processing Unit) 101, a ROM (Read Only Memory) 102, a RAM (Random Access Memory) 103, a storage unit 104, a display unit 105, an operation unit 106, a keyboard 107, a sound source 108, a DAC (Digital Analog Converter) 109, an output unit 110, etc., and each unit is connected by a bus 112.
[0015] The CPU 101 (processor) is a computer that controls each part of the electronic musical instrument 1 and functions as a control unit. The CPU 101 reads out a specified program from the programs stored in the ROM 102 or the storage unit 104, expands it in the RAM 103, and executes various processes in cooperation with the expanded program. Note that the CPU 101 may be a plurality of CPUs, and a plurality of CPUs may execute the plurality of processes executed by the CPU 101.
[0016] The ROM 102 stores programs and various data. The RAM 103 provides a working memory space for the CPU 101 and temporarily stores data. In addition, the RAM 103 has a melody storage area that stores melody data of the melody at the current timing (current processing position) according to the progress of the music. In addition, the RAM 103 has a chord storage area that stores chord information at the current timing (current processing position) according to the progress of the music, and a chord constituent tone storage area that stores the chord constituent tones of the chord. In addition, the RAM 103 has a sounding melody area that stores the note number of the key-pressing position in association with the note number of the melody being sounded according to the key-pressing. In addition, the RAM 103 has a sounding chord area that stores the note number of the key-pressing position in association with the note number of the chord constituent tones being sounded according to the key-pressing. In addition, the RAM 103 has a music storage area for loading the music data of the selected music.
[0017] The storage unit 104 is composed of a non-volatile semiconductor memory such as a flash memory or an HDD (Hard Disk Drive). The storage unit 104 stores programs and various data. The storage unit 104 is not limited to being built into the electronic musical instrument 1, and may include an external recording medium such as an external HDD or a USB memory that is detachable from the electronic musical instrument 1.
[0018] In this embodiment, the storage unit 104 stores music data (e.g., SMF (Standard MIDI File)). The music data includes events such as note-on events, note-off events, and control change events for one or more parts (e.g., piano part, electric guitar part, trumpet part, bass part, drum part, etc.) from the start to the end of the music. Note-on events are events that instruct the sound to be produced and include at least information on pitch and velocity (strength). Note-off events are events that instruct the sound to be muted and include at least information on pitch. Control change events include events related to controlling the expression added to the musical sound, such as volume and tone quality, and events related to other controls such as master volume changes and panning. In this embodiment, the piano part is the melody part (which may also be called the user's performance part, first part, etc.), and the melody data is the event data for the piano part. However, the user may set which part is the melody part by operating the operation unit 106.
[0019] Furthermore, music data includes chord information. For example, if the music data is in SMF format, the chord information is stored in the 0th track, called the system track, using meta-event markers. The data format for SMF meta-events is FFH, event number, data length, and data. The event number for a marker is 6, the data length is the number of data bytes, and the data is a string. When using this marker to indicate a chord name, the string part should be the chord name string. For example, if the chord name is Cm7, the string length is 3, so the marker event in this case would be FFH, 06H, 03H, 'C', 'm', '7'.
[0020] Furthermore, the memory unit 104 stores a chord tone table (not shown). The chord tone table stores chord information (chord name) and the chord tones of the chord indicated by that chord information in association with each other. The chord tones are listed and stored in order from the lowest to the highest note, the root note.
[0021] The display unit 105 consists of an LCD (Liquid Crystal Display), an EL (Electro Luminescence) display, etc., and displays various information according to the display information instructed by the CPU 101.
[0022] The control unit 106 is composed of multiple push-button switches, etc. The control unit 106 detects the operation of the push-button switches and outputs an operation signal to the CPU 101. The control unit 106 includes the song selection switch 161, song start switch 162, song stop switch 163, etc., as shown in Figure 2. The song selection switch 161 is a switch for selecting the song to play from among multiple song data. The song start switch 162 is a switch for instructing the start of automatic playback of the song. The song stop switch 163 is a switch for instructing the stop of automatic playback of the song.
[0023] In this embodiment, the operation unit 106 is configured with push-button switches, but the operation unit 106 may also be configured to include a touch panel or the like attached to the display unit 105, and to output operation signals from the touch panel to the CPU 101.
[0024] The keyboard 107 includes multiple keys (operators (playing operators)) and a detection unit for detecting pressed / released keys, and outputs performance information to the CPU 101 indicating the pitch, velocity, and timing (tick) of the keys pressed / released by the user. Here, pressing a key is the operation of an operator to instruct sound production. Releasing a key is the release of the operation of the operator. In the claims of this application, operation of an operator refers to the operation of an operator to instruct sound production, i.e., pressing a key, and does not include releasing a key, which releases the operation of the operator.
[0025] The sound source 108 reads waveform data (audio data) pre-stored in the ROM 102 or generates waveform data and outputs it to the DAC 109, in accordance with instructions from the CPU 101. The DAC 109 performs D / A conversion on the waveform data output from the sound source 108 and outputs analog audio. The output unit 110 includes an amplifier and a speaker and amplifies and outputs the analog audio (instrument sounds, etc.) input from the DAC 109. The sound source 108, DAC 109, and output unit 110 constitute the sound generation unit 111.
[0026] Next, the operation of the electronic instrument 1 in this embodiment will be described. When a song is selected by the operation unit 106 and the start of the song is instructed, the CPU 101 of the electronic instrument 1 processes the song data sequentially in accordance with the progress of the song. Specifically, the CPU 101 advances the song as time progresses, and as shown in Figure 3, it acquires the melody data and chord information in the song data, and instructs the sound source 108 to produce sound for the other part data, causing immediate sound production (automatic performance). When the user operates (presses) a key on the keyboard 107, the CPU 101 determines the pitch of the musical note to be produced in response to that operation based on the melody data and chord information received from the song data and the position of the key press, and instructs the sound source 108 to produce the musical note at the determined pitch. The sound source 108, having received the production instruction from the CPU 101, produces the musical note at that pitch based on the velocity of the key press.
[0027] The processes performed in the electronic instrument 1 will be described below with reference to Figures 4 to 9. Each of the processes shown in Figures 4 to 9 is executed through the cooperation of the CPU 101 and the program stored in the ROM 102 or memory unit 104.
[0028] When the power to the electronic instrument 1 is turned on, the CPU 101 starts the main processing shown in Figure 4. In the main processing, the CPU 101 first performs initialization processing (step S101). In the initialization processing, each component of the electronic instrument 1 is initialized, as well as buffers and variables used in various processes.
[0029] Next, the CPU 101 performs a switch operation (step S102). In the switch operation, the CPU 101 acquires the operating status of the various switches on the operation unit 106.
[0030] Next, the CPU 101 executes a function (step S103). The function is the process of executing a function corresponding to the switch operation state obtained in the switch processing.
[0031] For example, when the song selection switch 161 is operated, the CPU 101 determines whether a song is currently playing. If it determines that a song is not currently playing, the CPU 101 executes the song selection process. If it determines that a song is currently playing, it stops the currently playing song and executes the song selection process. During the song selection process, the CPU 101 displays a list of selectable song names on the display unit 105 and waits for the user to select a song (specify a song). Once a song selection operation is performed, the CPU 101 reads the song data of the selected song from the storage unit 104 and loads it into the song storage area of the RAM 103. Any songs that were previously in the RAM 103 are overwritten and erased.
[0032] Furthermore, for example, if the music start switch 162 is operated, the CPU 101 executes the music start process. In the music start process, the CPU 101 initializes the variables and memory areas to be used in the music playback process described later, and starts the music based on the music data loaded into the music storage area of RAM 103. For example, the CPU 101 initializes the value of pre_tick, a variable that stores the tick of the previous key press, to -60. The CPU 101 also clears and initializes the data in the melody area and chord area of RAM 103.
[0033] Furthermore, for example, if the music stop switch 163 is operated, the CPU 101 executes a music stop process to stop the music that is currently playing.
[0034] Furthermore, if any other switches on the control unit 106 are operated, the CPU 101 will execute other functional processing in response to the operation of the control unit 106.
[0035] Next, CPU 101 executes the music playback process (step S104). The music playback process will be explained below with reference to Figure 5.
[0036] In the music playback process, first, the CPU 101 determines whether music is currently playing (step S200). If it determines that music is not playing (step S200; NO), the CPU 101 exits the music playback process and proceeds to step S105 in Figure 4. If it determines that music is playing (step S200; YES), the CPU 101 executes the music progression process (step S201). The music progression process advances the processing position in the music data by a time corresponding to the elapsed time since the last time the music progression process was executed.
[0037] Next, the CPU 101 determines whether or not there is an event to be processed at the processing location in the music data (step S202). If it determines that there is no event to be processed at the processing location in the music data (step S202; NO), the CPU 101 exits the music playback process and proceeds to step S105 in Figure 4.
[0038] If the CPU 101 determines that there is an event to be processed at a processing location in the song data (step S202; YES), it determines whether the event is a melody bend (step S203). Here, a melody bend refers to a note-on event or note-off event in the melody data of the song. If the CPU 101 determines that the event is a melody bend (step S203; YES), it deletes the previous melody data stored in the melody storage area of RAM 103 (step S204), stores the melody data at the current processing location in the melody storage area of RAM 103 (step S205), and proceeds to step S105 in Figure 4.
[0039] In step S203, if it is determined that the event is not a melody bend (step S203; NO), the CPU 101 determines whether the event is chord information or not (step S206). If it is determined that the event is chord information (step S206; YES), the CPU 101 deletes the previous chord information from the chord memory area of RAM 103 and deletes the previous chord tones from the chord tone memory area (step S207), and sets the root flag to off (step S208). The root flag is set when the root note of a chord is being played. Then, the CPU 101 stores the chord information of the current processing position in the chord memory area of RAM 103, and stores the chord tones corresponding to the chord information in the chord tone memory area of RAM 103 (step S209), and proceeds to step S105 in Figure 4. The CPU 101 refers to the chord tone table stored in the memory unit 104 to identify the chord tone corresponding to the current chord information and stores it in the chord tone storage area of the RAM 103.
[0040] On the other hand, if it is determined in step S206 that the event is not code information (step S206; NO), the CPU 101 performs other event processing (step S210) and proceeds to step S105 in Figure 4.
[0041] For example, if the event is a note-on event of a part other than the melody, the CPU 101 generates sound-producing instruction information to cause the sound-producing unit 111 to produce sound according to the note number and velocity included in the note-on event, and outputs it to the sound source 108. If the event is a note-off event of another part, the CPU 101 generates mute instruction information to cause the sound-producing unit 111 to stop (mute) the sound of the note number included in the note-off event, and outputs it to the sound source 108. If the event is any other event, such as a program change or a control change, the CPU 101 executes processing according to the event.
[0042] In step S105 of Figure 4, the CPU 101 executes the performance operation process (step S105). The performance operation process will be explained below with reference to Figures 6 to 9. In the performance operation process, first, the CPU 101 determines whether or not performance information has been input from the keyboard 107 (step S300). If it is determined that no performance information has been input from the keyboard 107 (step S300; NO), the CPU 101 proceeds to step S106 of Figure 4.
[0043] If the CPU determines that performance information has been input from keyboard 107 (step S300; YES), it determines whether or not the music is in progress (step S301). If the CPU determines that the music is in progress (step S301; YES), it determines whether or not the input performance information indicates that a key has been pressed (step S302). If the CPU determines that the input performance information indicates that a key has been pressed (step S302; YES), it obtains the tick of the key press and stores it in the variable cur_tick (step S303). The tick of the key press represents the time from the start of the music to the timing of the key press.
[0044] Next, the CPU 101 calculates the difference (elapsed time) between the tick of the previous key press stored in the variable pre_tick and the tick of the current key press stored in the variable cur_tick, and stores it in the variable tick_diff (step S304). Then, the value of the variable cur_tick is stored in the variable pre_tick (step S305). In this embodiment, the variable pre_tick is initially stored with a value of -60. This initial value is set so that the value of the variable tick_diff is 60 or greater, so that even if the first key press of the song is made within 60 ticks from the start of the song, the melody will be played if melody data exists.
[0045] Next, the CPU 101 determines whether the value of the variable tick_diff is equal to or greater than a threshold (60 ticks in this embodiment) (step S306). That is, it determines whether the current key press occurred 60 ticks or more after the previous key press. Here, the threshold of 60 ticks is a value determined assuming 32nd notes, but this is just an example, and other values may be used.
[0046] If the CPU determines that the value of the variable tick_diff is 60 or greater (step S306; YES), the CPU 101 determines whether or not a melody part exists at the current position of the song (step S307). Whether or not a melody part exists at the current position of the song can be determined, for example, by whether the melody data in the melody memory area of RAM 103 contains pitch information (not rest information).
[0047] If the CPU determines that a melody part exists at the current position in the music (step S307; YES), the CPU 101 processes the sound of the melody (melody sound) in response to the current key press. First, the CPU 101 determines whether the pitch (note number) of the melody currently being played is stored in the melody area of RAM 103. If it is stored, it generates mute instruction information to silence the melody currently being played and outputs it to the sound source 108. The CPU 101 also deletes the note number of the pitch that was instructed to be silenced and the note number of the corresponding key press position from the melody area of RAM 103 (step S308).
[0048] Next, the CPU 101 stores the note number of the pressed key as the note number of the pressed position in the melody area of RAM 103 (step S309). Then, the CPU 101 obtains the pitch (note number) of the current melody data stored in the melody storage area of RAM 103, generates sound production instruction information to cause the sound production unit 111 to produce sound according to the velocity at the time of pressing obtained from the obtained note number and performance information, and outputs it to the sound source 108 (step S310). Then, the CPU 101 stores the note number of the pitch for which sound production was instructed in the melody area of RAM 103, associating it with the note number of the pressed position stored in step S309 (step S311), and proceeds to step S106 in Figure 4.
[0049] On the other hand, if in step S306 it is determined that the value of the variable tick_diff is less than 60 (step S306; NO), or if in step S307 it is determined that there is no melody part at the current position of the song (step S307; NO), the CPU 101 proceeds to step S312 in Figure 7, and processes the sound of the chord tones in response to the current key press.
[0050] In step S312 of Figure 7, the CPU 101 determines whether the root flag is on or off (step S312). If it determines that the root flag is not on (step S312; NO), the CPU 101 stores the note number of the pressed key in the sound-producing code area of RAM 103 (step S313). Next, the CPU 101 executes the root tone determination process (step S314).
[0051] Here, we will explain the note numbers and octave ranges used in the following processing. Pitch is represented by note numbers defined in the MIDI standard. For example, on a typical 88-key piano, the middle key, C4, is 60, the rightmost key (highest note), C8, is 108, and the leftmost key (lowest note), A0, is 21. The remainder when the pitch is divided by 12 corresponds to the note name that represents the pitch within one octave. In this embodiment, we assign the numbers 0 to 11 in order to note names C through B, using C as the note name. That is, C4 and C8 are the same note name C and are represented by the number 0. On the other hand, the quotient when the pitch is divided by 12 represents the octave range that includes that pitch. The quotient when 21, the lowest pitch A0 on an 88-key piano, is divided by 12 is 1, so the octave range is 1. The quotient when 60, the pitch of C4, is divided by 12 is 5, so the octave range is 5. As shown in (Equation 1), the pitch (note number) can be calculated from the note name and octave range. Pitch = 12 × octave range + note name number…(Equation 1) Each octave contains notes numbered 0 through 11.
[0052] The root note determination process will now be explained with reference to Figure 9. First, the CPU 101 determines whether the root note of the current chord within the same octave range as the pressed key is lower (lower pitch) than the pressed key position (step S3141). The CPU 101 determines whether the root note (the lowest note of the chord constituents) of the current chord constituents stored in the chord constituent tone memory area of the RAM 103 within the same octave range as the pressed key is lower than the pressed key position.
[0053] If the CPU 101 determines that the root note of the current chord within the same octave range as the pressed key is lower than the pressed key position (step S3141; YES), the CPU 101 calculates root_bottom, which is the note number of the root note that is smaller than the note number of the pressed key position and is closest to the pressed key position (step S3142). Specifically, root_bottom is calculated using the following (Equation 2). root_bottom = root note number (root) + 12 × octave range of the key pressed position ... (Equation 2)
[0054] Next, the CPU 101 calculates root_top, which is the note number of the root tone that is greater than the note number of the key pressed position and is closest to the key pressed position, by adding 12 to root_bottom (step S3143), and then proceeds to step S3146.
[0055] If the CPU 101 determines that the root note of the current chord within the same octave range as the pressed key is not below the pressed key position (step S3141; NO), the CPU 101 calculates root_top, which is the note number of the root note that is greater than the note number of the pressed key position and is closest to the pressed key position (step S3144). Specifically, root_top is calculated using the following (Equation 3). root_top = root note number (root) + 12 × octave range of the key pressed position ... (Equation 3)
[0056] Next, the CPU 101 calculates root_bottom, which is the note number of the root tone closest to the key press position and is smaller than the note number of the key press position, by subtracting 12 from root_top (step S3145), and then proceeds to step S3146.
[0057] In step S3146, the CPU 101 calculates abs_top_oct, which is the absolute value of the difference between the note number of the key pressed position and root_top (step S3146). Next, the CPU 101 calculates abs_bottom_oct, which is the absolute value of the difference between the note number of the key pressed position and root_bottom (step S3147).
[0058] Next, it is determined whether abs_top_oct < abs_bottom_oct (step S3138). If it is determined that abs_top_oct < abs_bottom_oct (step S3148; YES), the CPU 101 determines the root note closest to the key-pressing position as abs_top_oct and stores it in the variable NRNN (Nearest Root Note Number) (step S3149), and proceeds to the process of step S315 in FIG. 7. If it is determined that abs_top_oct < abs_bottom_oct is not true (step S3148; NO), the CPU 101 determines the root note closest to the key-pressing position as abs_bottom_oct and stores it in the variable NRNN (step S3150), and proceeds to the process of step S315 in FIG. 7.
[0059] In step S315 of FIG. 7, the CPU 101 obtains the note number (value of NRNN) of the root note closest to the key-pressing position determined in the root note determination process, generates pronunciation instruction information for causing the sound generation unit 111 to perform pronunciation according to the obtained note number and the velocity at the time of key pressing, and outputs it to the sound source 108 (step S315). Then, the CPU 101 sets the root flag to on (step S316), and proceeds to step S326.
[0060] On the other hand, in step S312, if it is determined that the root flag is on (step S312; YES), that is, when the root note is being pronounced, the CPU 101 calculates the note name (note name number) of the key-pressing position (step S317). As described above, the note name (note name number) of the key-pressing position can be obtained by the remainder obtained by dividing the note number of the key-pressing position by 12.
[0061] Next, the CPU 101 derives (calculates) a chord tone that is higher than the root note (value of variable NRNN) and closest to the key pressed position as a candidate chord tone (step S318). Here, the chord tone that is higher than the root note and closest to the key pressed position is not necessarily located in the octave region that includes the key pressed position (called the first octave region), but may be located in the octave region one step above the first octave region (called the second octave region) or the octave region one step below the first octave region (called the third octave region). For example, as shown in Figure 10, if the current chord is Cm, the chord tones are (C, D♯, G), and if B3 in the first octave region is pressed, the chord tone that is higher than the root note and closest to the key pressed position is D♯ in the second octave region. Therefore, when deriving the candidate chord tone, the CPU 101 considers not only the chord tones in the first octave region, but also the chord tones in the second and third octave regions to derive the chord tone that is higher than the root note and closest to the key pressed position. For example, as shown in Figure 10, the note numbers for each note in the first octave range are set to 0 to 11, the note numbers for each note in the second octave range are set to 12 to 23 by adding 12 to each, and the note numbers for each note in the third octave range are set to -1 to -12 by subtracting 12 to each. Then, the chord tone that is higher than the root note (value of variable NRNN) and has the smallest absolute difference between the note number of the key pressed position and the note number of the chord tone is selected as the candidate chord tone for sound production. Note that, for example, if there are multiple chord tones closest to the key pressed position, such as when both adjacent notes to the key pressed position are chord tones, in this embodiment the lower one is prioritized, but the higher one may also be prioritized.
[0062] Next, the CPU 101 determines whether or not a candidate sound is currently being pronounced (step S319). For example, the CPU 101 refers to the currently-pronounced code area of RAM 103 to determine whether or not a candidate sound is currently being pronounced. If it determines that the candidate sound is not currently being pronounced (step S319; NO), the CPU 101 proceeds to step S325.
[0063] If the CPU determines that a candidate chord tone is currently being played (step S319; YES), it determines whether there are any unplayed chord tones (step S320). Here, chord tones are those within the same octave range as the root note of the variable NRNN. If the CPU determines that there are unplayed chord tones (step S320; YES), it derives the chord tone that is higher than the root note and closest to the key pressed position from among the unplayed chord tones as a candidate chord tone to be played (step S321), and proceeds to step S325.
[0064] If the CPU determines that there are no unpronounced chord tones (step S320; NO), it raises the candidate tones by one octave (step S322) and determines whether the candidate tones clash with the currently being pronounced tone by a semitone or whole tone (step S323). Here, the CPU determines that the candidate tones clash with the currently being pronounced tone by a semitone or whole tone if the pitch of the candidate tones is the same as or adjacent to the pitch of the currently being pronounced tone.
[0065] If the CPU determines that the candidate sound does not clash with the sound currently being pronounced by a semitone or whole tone (step S323; NO), the CPU 101 proceeds to step S325. If the CPU determines that the candidate sound does clash with the sound currently being pronounced by a semitone or whole tone (step S323; YES), the CPU 101 raises the candidate sound by another octave (step S324) and proceeds to step S325.
[0066] In step S325, the CPU 101 generates pronunciation instruction information to cause the sound generation unit 111 to pronounce the candidate sound according to the note number of the sound generation candidate and the velocity at the time of key press, and outputs it to the sound source 108 (step S325). Then, the CPU 101 stores the pitch of the instructed sound generation candidate in the sound generation code area of RAM 103, associating it with the note number of the key press position (step S326), and proceeds to step S106 in Figure 4.
[0067] On the other hand, if it is determined in step S302 that the key has not been pressed (i.e., released) (step S302; NO), the CPU 101 proceeds to step S327 in Figure 8, and searches for the note number of the released key from the note numbers of the pressed key stored in the melody area and chord area of RAM 103 (step S327).
[0068] Next, the CPU 101 determines, based on the search results, whether the released key is a key corresponding to the melody currently being played (melody key) (step S328). If it determines that the released key is a key corresponding to the melody currently being played (step S328; YES), the CPU 101 generates mute instruction information for the melody sound being played in response to that key and outputs it to the sound source 108 (step S329). Then, the CPU 101 deletes the note number of the released key and the note number of the pitch played in response to pressing this note number from the melody area of the RAM 103 (step S330), and proceeds to step S106 in Figure 4.
[0069] If the released key is determined not to be a key corresponding to the sound of a melody (step S328; NO), the CPU 101 determines whether the released key is a key corresponding to the sound of a root note (root key) (step S331). If the released key is determined to be a key corresponding to the sound of a root note (step S331; YES), the CPU 101 turns off the root flag (step S332) and proceeds to step S333. Here, the key corresponding to the sound of a root note is released, and the root note is muted in the next step, so the root flag, which indicates that the root note is being sounded, is turned off. If the released key is determined not to be a key corresponding to the sound of a root note (step S331; NO), the CPU 101 proceeds to step S333.
[0070] In step S333, the CPU 101 generates mute instruction information for the chord tone being sounded corresponding to the released key and outputs it to the sound source 108 (step S333). Then, the CPU 101 deletes the note number of the released key and the note number of the pitch sounded corresponding to pressing this note number from the sound-producing chord area of RAM 103 (step S334), and proceeds to step S106 in Figure 4.
[0071] On the other hand, if it is determined in step S301 that the music is not in progress (step S301; NO), the CPU 101 determines whether the input performance information indicates that a key has been pressed (step S335). If it is determined that the input performance information indicates that a key has been pressed (step S335; YES), the CPU 101 generates sound production instruction information for the pressed pitch and velocity and outputs it to the sound source 108 (step S336), and proceeds to step S106 in Figure 4. If it is determined that the input performance information does not indicate that a key has been pressed, i.e., that a key has been released (step S335; NO), the CPU 101 generates mute instruction information for the released pitch and outputs it to the sound source 108 (step S337), and proceeds to step S106 in Figure 4.
[0072] In step S106 of Figure 4, the CPU 101 performs sound generation processing (step S406). In sound generation processing, the CPU 101 causes the sound generation unit 111 to generate, mute, or modify musical tones based on instruction information such as sound generation instruction information, mute instruction information, timbre change, and volume change output to the sound source 108 during music playback processing or performance operation processing.
[0073] Next, the CPU 101 determines whether the power switch of the control unit 106 has been pressed (i.e., whether or not a power-off command has been issued) (step S107). If it determines that the power switch of the control unit 106 has not been pressed (step S107; NO), the CPU 101 returns to step S102 and repeats steps S102 to S107. If it determines that the power switch of the control unit 106 has been pressed (step S107; YES), the CPU 101 terminates the main processing.
[0074] Figure 11 shows the cases in which a melody is played and chords are played when a song is played (progressed) on the electronic instrument 1 using the above process. As shown in Figure 11, when the key is pressed at time t1 (the first key press in the song), melody M1 corresponding to the timing of time t1 in the song is played. When the key is pressed at time t2, which is 60 ticks or more after time t1, melody M2 corresponding to the timing of time t2 in the song is played. When the key is pressed at time t3, which is less than 60 ticks after time t2, chord tone C1 of the chord corresponding to the timing of time t3 in the song is played. When the key is pressed at time t4, which is less than 60 ticks after time t3, chord tone C2 of the chord corresponding to the timing of time t4 in the song is played. When the key is pressed at time t5, which is 60 ticks or more after time t4, melody M3 corresponding to the timing of time t5 in the song is played, even if melody M2 is still being played. At this time, the currently playing melody M2 is muted. In other words, if you press a key more than 60 ticks after the previous key press, you can mute the currently playing melody and start playing the next melody without releasing the key.
[0075] Thus, in the electronic instrument 1, the elapsed time since the last key press controls whether to play a melody or a chord, making it possible to easily play both melodies and chords without dividing the area of the 107 keys. Furthermore, since a melody can be played by pressing any key after a predetermined time (60 ticks), the melody can be switched without releasing the key corresponding to the currently playing melody.
[0076] Figures 12 and 13 show the key press data and corresponding sound generation data for the electronic instrument 1 described above during the progression of a musical piece. In Figures 12 and 13, the lower row shows the key press data, and the upper row shows the sound generation data. In Figures 12 and 13, the vertical axis represents pitch, the horizontal axis represents time, and the key press interval and sound generation interval are shown by shaded rectangles. A keyboard is displayed on the left side to make it easier to recognize the pitch. In addition, chord information for each timing on the horizontal axis is shown at the top. Figure 12 shows an example of the sound generation when a second key is pressed after 60 ticks or more have passed since the first key was pressed. Figure 13 shows an example of the sound generation when three notes (chords) are pressed almost simultaneously (with an interval of less than 60 ticks from the last key press) after 60 ticks or more have passed since the previous key press.
[0077] As shown in Figure 12, if a second key is pressed after 60 ticks or more have elapsed since the first key was pressed, the melody is updated to match the timing of the second key press, and the currently playing melody is muted. Thus, in this embodiment, by pressing a key 60 ticks or more after the previous key press, the melody can be played in sync with the progress of the music without releasing the previous key.
[0078] As shown in Figure 13, if multiple keys are pressed at short intervals of less than 60 ticks after more than 60 ticks have elapsed since the previous key press (a chord), the melody note is played for the first key press. For the next key press, the root note of the current chord (the root note closest to the key press) is played. For the next key press, a chord tone higher than the root note and closest to the key press position is played. If a chord (for example, the same chord) is pressed after more than 60 ticks have elapsed, the sound switches to the melody at the time of the key press and the chord tones corresponding to the number of key presses, with the root note as the lowest note. Therefore, as shown in Figure 13, the user can play the melody and chord tones in accordance with the progression of the song with a simple operation, such as repeatedly pressing the same chord. Also, since the root note is always the lowest note in chords, stable performance is possible.
[0079] As explained above, when a user operates (presses) any of the controls on the keyboard 107 during the progress of a designated song, the CPU 101 of the electronic instrument 1 determines whether a predetermined time has elapsed since the previous operation. If it determines that the operation was performed before the predetermined time had elapsed, the CPU 101 causes the sound generation unit 111 to produce the chord tones corresponding to the timing of the operation in the song. If it determines that the operation was performed after the predetermined time had elapsed, the CPU 101 causes the sound generation unit 111 to produce the melody tones corresponding to the timing of the operation in the song. Therefore, regardless of how the user plays a song that includes both melody and chords, the sound can be produced well. For example, regardless of which area of the keyboard 107 is operated, the melody or chord tones can be produced depending on the timing of the operation (press). If multiple controls are operated at almost the same time, it is also possible to produce both melody and chords simultaneously. Furthermore, even if the key that produced the melody is not released, a new melody tone can be produced by a new key press after a predetermined time has elapsed, as the song progresses.
[0080] Furthermore, for example, when the CPU 101 causes the sound generation unit 111 to play the melody at the timing of the operation in the song, if there is a melody already being played, the CPU 101 will mute the currently playing melody. In this way, it is possible to prevent the melodies from overlapping.
[0081] Furthermore, for example, if the CPU 101 determines that the current operation was performed before a predetermined time had elapsed since the previous operation, it determines whether the root note of the current chord of the song is currently being played. If it determines that the root note is not currently being played, it causes the sound generation unit 111 to play the root note. Therefore, the root note of the chord of the song can be prioritized for playback.
[0082] Furthermore, if the CPU 101 determines that the current operation was performed before a predetermined time had elapsed since the previous operation, and that the root note of the chord is currently being played, it will cause the sound-producing unit 111 to play an unplayed note of a chord higher than the root note. Therefore, stable performance becomes possible with the root note as the lowest note of the chord.
[0083] Furthermore, if the pitch that the CPU 101 intends to have the sound-producing unit 111 produce is the same as or adjacent to the pitch currently being produced, the CPU 101 will have the sound-producing unit produce a pitch one octave higher than the intended pitch. Therefore, it is possible to prevent adjacent sounds from clashing and to produce good musical tones.
[0084] Furthermore, the number of notes in the user's performance part that the CPU 101 causes the sound generation unit 111 to produce is equal to the number of controls operated by the user. Therefore, the number of notes produced can correspond to the user's performance.
[0085] The descriptions in the above embodiments are merely preferred examples of the electronic musical instrument, sound production control method, and program according to the present invention, and are not limited thereto.
[0086] For example, in the above embodiment, the main processing described above is executed by the cooperation of the CPU 101 and the program stored in the ROM 102 within the electronic instrument 1 to realize the functions of the present invention. However, the functions of the present invention may also be executed by a computer connected to the electronic instrument 1, but separate from the electronic instrument 1.
[0087] Furthermore, although the above embodiment described the case where the electronic instrument 1 is a keyboard instrument, other electronic instruments such as a wind synthesizer, electric guitar, or MIDI violin may also be used.
[0088] Furthermore, in the above embodiment, the candidate sounding tone derived in step S318 is a chord tone that is higher than the root tone (NRNN) and closest to the key pressed position, and the sounding tone derived in step S321 is a chord tone that is higher than the root tone and closest to the key pressed position among the unsounded chord tone tones, but the candidate sounding tone is not limited to the above. For example, the candidate sounding tone derived in step S318 may be a chord tone that is higher than the root tone (NRNN) and closest to the root tone, and the sounding tone derived in step S321 may be a chord tone that is higher than the root tone and closest to the root tone among the unsounded chord tone tones.
[0089] Furthermore, while the above embodiments disclose examples in which semiconductor memory such as ROM or hard disks are used as computer-readable media for the program according to the present invention, the invention is not limited to these examples. Portable recording media such as CD-ROMs can also be used as other computer-readable media. In addition, carrier waves can also be used as a medium for providing the data of the program according to the present invention via a communication line.
[0090] Furthermore, the detailed configuration and operation of the electronic instrument 1 can also be modified as appropriate, without departing from the spirit of the invention.
[0091] Although embodiments of the present invention have been described above, the technical scope of the present invention is not limited to the embodiments described above, but is determined based on the claims. Furthermore, equivalent scopes of the present invention that have been modified from the claims but are not related to the essence of the present invention are also included in the technical scope of the present invention. [Explanation of Symbols]
[0092] 1 Electronic musical instrument, 101 CPU, 102 ROM, 103 RAM, 104 Memory unit, 107 Keyboard, 111 Sound generation unit
Claims
1. Multiple operators, The pronunciation section, The system comprises a control unit, and the control unit is If the user operates one of the aforementioned multiple controls while the specified song is in progress, it is determined whether a predetermined amount of time has elapsed since the operation immediately preceding the current operation. If it is determined that the operation was performed before the predetermined time had elapsed, the sound-producing unit will produce the chord tones at the time the operation was performed in the song. If it is determined that the operation was performed after the predetermined time has elapsed, the sound-producing unit will produce the melody sound at the time the operation was performed in the song. Electronic musical instrument.
2. The control unit, When the aforementioned melody sound is produced by the sound-producing unit, if there is a melody sound being produced, the sound-producing unit is silenced the melody sound being produced. The electronic musical instrument according to claim 1.
3. The control unit, If it is determined that the action was performed before the predetermined time had elapsed, it is determined whether the root note among the chord tones is currently being played. If it is determined that the root note is not currently being played, the sound-producing unit is made to play the root note. The electronic musical instrument according to claim 1.
4. The control unit, If it is determined that the root note of the chord is currently being played, the sound-producing unit will play a musical note of a higher pitch than the root note that has not yet been played. The electronic musical instrument according to claim 3.
5. The control unit, If the pitch to be produced by the sound-producing unit is the same as or adjacent to the pitch currently being produced, the sound-producing unit will produce a pitch one octave higher than the pitch to be produced. The electronic musical instrument according to claim 4.
6. The number of notes in the user's performance part that the control unit causes the sound generation unit to produce is equal to the number of controls operated by the user. The electronic musical instrument according to any one of claims 1 to 5.
7. Computers If the user operates one of several controls while the specified song is in progress, the system will determine whether a predetermined amount of time has elapsed since the previous operation. If it is determined that the operation was performed before the predetermined time had elapsed, the sound-producing unit will produce the chord tones at the time the operation was performed in the song. If it is determined that the operation was performed after the predetermined time has elapsed, the sound-producing unit will produce the melody sound at the time the operation was performed in the song. Methods for controlling pronunciation.
8. On the computer, If the user operates one of several controls while the specified song is in progress, the system will determine whether a predetermined amount of time has elapsed since the previous operation. If it is determined that the operation was performed before the predetermined time had elapsed, the sound-producing unit will produce the chord tones at the time the operation was performed in the song. If it is determined that the operation was performed after the predetermined time has elapsed, the sound-producing unit will produce the melody sound at the time the operation was performed in the song. A program to execute a process.