Electronic musical instrument, control method, and program

The electronic musical instrument addresses the issue of sound misalignment by using a control unit to determine and produce pitches aligned with the user's performance, ensuring accurate musical tone production.

JP2026111000APending Publication Date: 2026-07-03CASIO COMPUTER CO LTD

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

Technical Problem

Existing electronic musical instruments often produce sounds that do not accurately reflect the user's performance intention.

Method used

An electronic musical instrument with a control unit that determines a pitch closest to the user's specified operator within chord constituent tones, producing a first pitch if it is not currently being played, and a second pitch in the same direction as the previously specified operator if the first pitch is already being produced, ensuring alignment with the user's playing direction.

Benefits of technology

Enables the production of musical tones that accurately respond to the user's playing operations, enhancing the musical quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2026111000000001_ABST
    Figure 2026111000000001_ABST
Patent Text Reader

Abstract

To enable the production of good musical tones in response to the user's playing input. [Solution] The CPU of the electronic instrument determines the first pitch that is closest to the pitch corresponding to the pressed key from among the chord tones corresponding to the chord information at the time any key is pressed by the user in the currently playing song. If the first pitch is not being played, the CPU causes the sound-producing part to play at the first pitch. If the first pitch is being played, the CPU causes the sound-producing part to play at the second pitch, which is in the same direction as the first pitch included in the chord tones, relative to the direction of the pitch corresponding to the current key press relative to the pitch corresponding to the previous key press.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0004]

[0001] The present invention relates to an electronic musical instrument, a 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 user (performer) is replaced with one of the chord constituent tones based on the chord information of the piece of music and then sounded. For example, Patent Document 1 describes an electronic musical instrument that inputs chord information in the left half region and replaces the pitch (played pitch) input in the right half key range with the constituent tones of the input chord information and outputs it. Further, it is described that the chord constituent tone closest to the input pitch is selected as the output sound.

Prior Art Documents

Patent Documents

[0003]

Patent Document 1

Summary of the Invention

Problems to be Solved by the Invention

[0004] However, in the technique described in Patent Document 1, there are cases where a sound that does not reflect the user's performance intention is sounded.

[0005] The present invention has been made in view of the above problems, and an object thereof is to be able to produce a good musical sound according to the user's performance operation.

Means for Solving the Problems

[0006] To solve the above problems, the electronic musical instrument according to the present invention comprises a plurality of operators, a sound-producing unit, and a control unit. The control unit determines a first pitch that is closest to the pitch corresponding to the specified operator from among the chord constituent tones corresponding to the chord information at the timing specified by the user in the ongoing musical piece. If the first pitch is not currently being produced, the control unit produces the first pitch. If the first pitch is currently being produced, the control unit produces a second pitch which is in the same direction as the pitch corresponding to the currently specified operator when viewed from the pitch corresponding to the previously specified operator, and in the same direction as the first pitch included in the chord constituent tones. [Effects of the Invention]

[0007] According to the present invention, good musical tones can be produced in response to the user's playing operations. [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] This is a diagram illustrating the general operation of the electronic musical instrument in this embodiment. [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 functional processing performed in step S403 of Figure 4. [Figure 6] This flowchart shows the flow of the music progression process performed in step S404 of Figure 4. [Figure 7] This figure shows an example of a root note table. [Figure 8] This figure shows an example of a code type table. [Figure 9] This is a flowchart showing the flow of the performance operation process performed in step S405 of Figure 4. [Figure 10] This is a flowchart showing the flow of the keyboard algorithm executed in step S903 of Figure 9. [Figure 11] This is a flowchart showing the flow of the first candidate sound determination process performed in step S1001 of Figure 10. [Figure 12] This figure shows an example of a chord tone table. [Figure 13] This diagram explains the reason for executing steps S1112 through S1114 in Figure 11. [Figure 14] This diagram in Figure 11 explains the reason for executing the processes from steps S1115 to S1117. [Figure 15] This flowchart shows the flow of the second to fifth candidate sound determination process performed in step S1002 of Figure 10. [Figure 16] This flowchart shows the flow of the unpronounced pitch search process performed in step S1003 of Figure 10. [Figure 17] This flowchart shows the flow of the sound silencing process performed in step S906 of Figure 9. [Figure 18] This diagram illustrates the effects of this embodiment when playing legato. [Figure 19] This diagram illustrates the effects of this embodiment when playing chords. [Modes for carrying out the invention]

[0009] The embodiments for carrying out the present invention will be described below with reference to the drawings. However, the embodiments described below are subject to various technically preferred limitations for carrying out the present invention. Therefore, the technical scope of the present invention is not limited to the embodiments and illustrated examples below.

[0010] First, the configuration of the electronic musical instrument 1 according to an embodiment of the present invention will be described. When there is a key press by a performer who is a user, the electronic musical instrument 1 has a function of converting the pitch of the pressed key into a pitch calculated based on the chord information specified in the music piece and then sounding it.

[0011] 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.

[0012] The CPU 101 (processor) is a computer that controls each unit 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 and 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.

[0013] The ROM 102 stores programs and various data, etc. The programs stored in the ROM 102 include a program for executing a keyboard algorithm 201 described later. The RAM 103 provides a working memory space for the CPU 101 and temporarily stores data.

[0014] The storage unit 104 is composed of a non-volatile semiconductor memory such as a flash memory or an HDD (Hard Disk Drive), etc. The storage unit 104 stores programs and various data, etc. 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.

[0015] In this embodiment, the storage unit 104 stores musical data (e.g., SMF (Standard MIDI File)). The musical data includes events such as note-on events, note-off events, and control change events for one or more parts (e.g., melody part, obbligato part, electric guitar part, trumpet part, bass part, drum part, etc.) from the start to the end of the musical piece. 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.

[0016] Furthermore, song data includes chord information that represents the chord progression from the beginning to the end of the song. For example, if the song 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 string of the chord name. 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'.

[0017] Furthermore, the memory unit 104 stores the root note table 104a (see Figure 7), the chord type table 104b (see Figure 8), and the chord constituent note table 104c (see Figure 12). Details of these tables will be described later.

[0018] 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.

[0019] 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 a song to play from among multiple song data. The song start switch 162 is a switch for instructing the start of automatic playback of a song stored in the memory unit 104. The song stop switch 163 is a switch for instructing the stop of automatic playback of a song.

[0020] 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.

[0021] The keyboard 107 includes multiple keys (operators) and a detection unit for detecting pressed / released keys, and outputs performance information to the CPU 101 indicating the pitch, velocity, and timing of the keys pressed / released by the user. Pressing a key is an operation in which one of the multiple keys is selected.

[0022] 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.

[0023] Next, the operation of the electronic instrument 1 in this embodiment will be described. The CPU 101 of the electronic instrument 1 processes the music data sequentially in accordance with the progress of the music. As shown in Figure 3, the CPU 101 sends the chord information included in the system track in the music data to the keyboard algorithm 201, and instructs the sound source 108 to play the music for the performance information of the other tracks, thereby enabling automatic performance. According to the keyboard algorithm 201, the CPU 101 calculates the pitch that should be played in response to the player's operation (pressing) of the keyboard 107, based on the chord information received from the music data and the performance information from the keyboard 107, and instructs the sound source 108 to play the music. Upon receiving the instruction from the CPU 101, the sound source 108 plays the musical note of that pitch at the velocity of the key press.

[0024] The processes performed in the electronic instrument 1 will be described below with reference to Figures 4 to 17. Each of the processes shown in Figures 4 to 17 is executed through the cooperation of the CPU 101 and the program stored in the ROM 102 or memory unit 104.

[0025] 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 S401). In the initialization processing, each component of the electronic instrument 1 is initialized, as well as buffers and variables used in various processes.

[0026] Next, the CPU 101 performs a switch operation (step S402). In the switch operation, the CPU 101 acquires the operating status of the various switches on the operation unit 106.

[0027] Next, the CPU 101 executes a function process (step S403). The function process is the process of executing a function corresponding to the operating state of the switch obtained in the switch process.

[0028] As shown in Figure 5, in the functional processing, first the CPU 101 determines whether the song selection switch 161 has been operated (step S501). If it is determined that the song selection switch 161 has been operated (step S501; YES), the CPU 101 determines whether a song is in progress (playing) or not (step S502). If it is determined that a song is not in progress (step S502; NO), the CPU 101 proceeds to step S504. If it is determined that a song is in progress (step S502; YES), the CPU 101 stops the song that is in progress (step S503) and proceeds to step S504.

[0029] In step S504, the CPU 101 executes the song selection process (step S504) and proceeds to step S404 in Figure 4. During the song selection process, the CPU 101 displays a list of selectable song names on the display unit 105 and waits for the performer to select 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. Songs that were previously in the song storage area of ​​the RAM 103 are overwritten and erased.

[0030] On the other hand, if it is determined in step S501 that the song selection switch 161 has not been operated (step S501; NO), the CPU 101 determines whether or not the song start switch 162 has been operated (step S505). If it is determined that the song start switch 162 has been operated (step S505; YES), the CPU 101 determines whether or not the song data has been loaded into the song storage area of ​​RAM 103 (step S506). If it is determined that the song data has not been loaded into the song storage area of ​​RAM 103 (step S506; NO), the CPU 101 proceeds to step S404 in Figure 4.

[0031] If the CPU 101 determines that the music data has been loaded into the music storage area of ​​RAM 103 (step S506; YES), it determines whether or not the music is currently playing (step S507). If it determines that the music is currently playing (step S507; YES), the CPU 101 proceeds to step S404 in Figure 4.

[0032] If it is determined that a song is not currently playing (step S507; NO), the CPU 101 executes the song start process (step S508) and proceeds to step S404 in Figure 4. In the song start process, the CPU 101 starts automatic playback based on the song data loaded into the song storage area of ​​RAM 103. For example, the CPU 101 initializes variables and buffers (e.g., out_buf described later) that will be used in the song progression process described later. For example, the CPU 101 initializes each element of out_buf described later to -1. The CPU 101 also starts the song progression process described later based on the song data loaded into the song storage area of ​​RAM 103.

[0033] On the other hand, if in step S505 it is determined that the music start switch 162 has not been operated (step S505; NO), the CPU 101 determines whether or not the music stop switch 163 has been operated (step S509). If it is determined that the music stop switch 163 has been operated (step S509; YES), the CPU 101 determines whether or not music is in progress (step S510). If it is determined that music is in progress (step S510; YES), the CPU 101 executes a music stop process to stop the automatic playback of the music in progress (step S511), and proceeds to step S404 in Figure 4. If it is determined that music is not in progress (step S510; NO), the CPU 101 proceeds to step S404 in Figure 4.

[0034] On the other hand, if in step S509 it is determined that the music stop switch 163 has not been operated (step S509; NO), the CPU 101 performs other functional processing in response to the operation of the operation unit 106 (step S512), and then proceeds to step S404 in Figure 4.

[0035] In step S404 of Figure 4, the CPU 101 executes the music progression process (step S404). The music progression process is the process in which the CPU 101 advances the music (advances music playback) according to the passage of time, based on the music data of the selected song.

[0036] Referring to Figure 6, the music progression process performed in step S404 of Figure 4 will be explained. The music progression process is the process of advancing the music according to the passage of time.

[0037] In the music progression process, first, the CPU 101 determines whether music is currently being played automatically (step S601). If it determines that music is not being played (step S601; NO), the CPU 101 exits the music progression process and proceeds to step S405 in Figure 4. If it determines that music is being played (step S601; YES), the CPU 101 executes the time progression process (step S602). The time progression process advances the processing position in the music data according to the elapsed time from the time the time progression process was last executed to the present.

[0038] Next, the CPU 101 determines whether or not there is an event to be processed at the processing location in the music data (step S603). If it determines that there is no event to be processed at the processing location in the music data (step S603; NO), the CPU 101 exits the music progression process and proceeds to step S405 in Figure 4.

[0039] If the CPU 101 determines that there is an event to be processed at a processing location in the music data (step S603; YES), it determines whether the event is a note-on event (step S604). If it determines that the event is a note-on event (step S604; YES), the CPU 101 executes the note-on process (step S605) and proceeds to step S405 in Figure 4. In the note-on process, sound generation instruction information is generated to cause the sound generation unit 111 to produce a musical tone corresponding to the note number and velocity included in the note-on event, and this information is output to the sound source 108.

[0040] In step S604, if it is determined that the event is not a note-on event (step S604; NO), the CPU 101 determines whether the event is a note-off event (step S606). If it is determined that the event is a note-off event (step S606; YES), the CPU 101 executes the note-off process (step S607) and proceeds to step S405 in Figure 4. In the note-off process, mute instruction information is generated to cause the sound generation unit 111 to stop (mute) the sound of the musical tone corresponding to the note number included in the note-off event, and this information is output to the sound source 108.

[0041] In step S606, if it is determined that the event is not a noteoff (step S606; NO), the CPU 101 determines whether the event is code information or not (step S608). If it is determined that the event is code information (step S608; YES), the CPU 101 executes the code processing (step S609) and proceeds to step S405 in Figure 4.

[0042] In code processing, the CPU 101 first extracts the root and code type of the code from the code name specified by the marker event string in the music data. Next, the CPU 101 refers to the root note table 104a shown in Figure 7 and the code type table 104b shown in Figure 8, and stores the identification number (note name number) representing the root note of the code in the variable root, and the identification number (code type number) representing the code type of the code in the variable type. The root note table 104a is a table that stores the root note names of the code (C, C♯, D…) in association with their note name numbers (0, 1, 2…), as shown in Figure 7. The root note names are assigned note name numbers sequentially from 0 for C to 11 for B. For enharmonic equivalents such as C# and D♭, only the note name with a # and its note name number are stored. In the diagrams and subsequent explanations, "♭" is represented as "b". The chord type table 104b, as shown in Figure 8, is a table that stores chord types in association with chord type numbers (0, 1, 2…) that represent those chord types. In this embodiment, it corresponds to 18 chord types. It is possible to play a song even with fewer chord types, so the number of chord types may be less than this, or conversely, the number of chord types may be increased to correspond to tension chords such as 9th and 11th. From Figures 7 and 8, for example, if the string of the marker event is "Cm7", then 0 is stored in the variable root and 7 is stored in the variable type. If it is "B7b5", then 11 is set in the variable root and 10 is set in the variable type.

[0043] If, in step S608, it is determined that the event is not code information (step S608; NO), the CPU 101 performs other event processing (step S610) and proceeds to step S405 in Figure 4.

[0044] The events processed in step S610 are all events except note-on, note-off, and chord information. For example, this includes tempo changes included in the system track, EOT (End Of Track) processing at the end of track data (ending processing for that track), program changes that instruct timbre changes, and control changes such as expressions that instruct volume changes. If all tracks reach the EOT event at this point and playback processing for all tracks is complete, the music stops and the music enters a stopped state.

[0045] In step S405 of Figure 4, the CPU 101 executes the performance operation process (step S405). The performance operation process executes processing in response to the player's operation of the keyboard 107, based on the performance information input from the keyboard 107. For example, if the input performance information is a note-on event, the CPU 101 sends the pitch specified in the note-on event to the keyboard algorithm 201, determines the pitch to be played according to the keyboard algorithm 201, generates sound production instruction information instructing the system to play the musical note of the determined pitch at the velocity value specified in the performance operation, and outputs this to the sound source 108. Further details will be described later.

[0046] Next, 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 sounds based on the instruction information such as sound generation instruction information, mute instruction information, timbre change, and volume change output to the sound source 108 during the music progression processing or performance operation processing.

[0047] Next, the CPU 101 determines whether or not the power switch of the control unit 106 has been pressed (i.e., whether or not a power-off command has been issued) (step S407). If it determines that the power switch of the control unit 106 has not been pressed (step S407; NO), the CPU 101 returns to step S402 and repeats steps S402 to S407. If it determines that the power switch of the control unit 106 has been pressed (step S407; YES), the CPU 101 terminates the main processing.

[0048] The performance operation process will be explained in detail below with reference to Figures 9 to 17. As shown in Figure 9, in the performance operation process, first, the CPU 101 determines whether or not performance information has been input from the keyboard 107 (step S900). If it is determined that no performance information has been input (step S900; NO), the CPU 101 terminates the performance operation process.

[0049] If the CPU determines that performance information has been input from keyboard 107 (step S900; YES), it determines whether or not a song is in progress (step S901). If it determines that a song is in progress (step S901; YES), the CPU determines whether or not the input performance information indicates that a key has been pressed (step S902). If it determines that the input performance information indicates that a key has been pressed (step S902; YES), the CPU executes the keyboard algorithm to determine the pitch to be played (step S903). The keyboard algorithm here is keyboard algorithm 201 in Figure 3, but in the following explanation it will be described as a software subroutine and will simply be referred to as the keyboard algorithm.

[0050] The keyboard algorithm executed in step S903 will be described below with reference to Figures 10 to 16. The keyboard algorithm is a process that determines the pitch to be produced in response to a key press based on the chord information of the music. First, the keyboard algorithm calculates five candidate pitches, from the first candidate note to the fifth candidate note, as candidates for the pitch to be produced. Then, it checks whether each candidate note is currently being produced, starting with the first candidate note. If it is not being produced, that candidate note is set as the determined pitch. If all five candidate notes are currently being produced, it is determined that it is impossible to produce a pitch, and the variable free_idx is set to -1 before exiting the process.

[0051] Here, we will explain why there are five candidate notes. Suppose a performer presses four keys with four fingers of either their left or right hand, and then presses a fifth key. In this case, when the fifth key is pressed, it is possible that the first to fourth candidate notes have already been played. The number of candidate notes is set to five so that it is still possible to play notes even in this case. In other words, all notes will be played even if all five fingers of one hand are pressed simultaneously. Note that when both hands are pressed simultaneously, there is a difference in pitch between the keys pressed by the right and left hands, so a shortage of candidate notes due to already played notes does not usually occur. In this application, the maximum number of chord constituent notes is set to five, but there is no limit to the number of keys that can be played simultaneously. The number of keys that can be played simultaneously can be set to any number according to the performance of the electronic instrument.

[0052] As shown in Figure 10, in the keyboard algorithm, first, the CPU 101 stores the pitch corresponding to the pressed key in the variable now_key (step S1000). In this embodiment, the pitch stored in the variable now_key is the note number defined in the MIDI (Musical Instrument Digital Interface) standard. That is, C4, the middle key of a typical 88-key piano, is 60, C8, the rightmost key (highest note), is 108, and A0, the leftmost key (lowest note), is 21.

[0053] Next, the CPU 101 performs the first candidate note determination process (step S1001). In the first candidate note determination process, the CPU 101 determines the first candidate note to be the pitch (first pitch) that is closest to the pitch corresponding to the key pressed by the performer, among the chord constituent notes corresponding to the chord information (chord information obtained by chord processing) at the current timing (timing of key press) in the ongoing song.

[0054] Referring to Figure 11, the flow of the first candidate tone determination process will be explained in detail. First, the CPU 101 stores the remainder obtained by dividing the pitch of the variable now_key by the number of notes in one octave, which is 12, in the variable key_note. Similarly, the CPU 101 stores the quotient obtained by dividing the value of the variable now_key by 12 in the variable key_oct (step S1101).

[0055] Here, the remainder when the pitch is divided by 12 corresponds to the note name that represents the pitch within one octave. In this embodiment, as shown in Figure 7, note name C is set to 0, and note name numbers up to 11 are assigned to note names in order. That is, C4 and C8 are the same note name C and are represented by note name number 0. Therefore, the value of the variable key_note is the note name number that represents the note name of the pitch corresponding to the key pressed this time. On the other hand, the quotient when the pitch is divided by 12 represents the octave range in which that pitch is contained. For example, the quotient when the note number 21, which is the lowest pitch A0 on an 88-key piano, is divided by 12 is 1, so the octave range is 1. The quotient when the note number 60, which is C4, is divided by 12 is 5, so the octave range is 5. As shown in (Equation 1), the pitch can be calculated from the note name number and the octave range. Pitch = 12 × octave range + note name number…(Equation 1) For example, if the note name is C and the octave range is 5, then 12 × 5 + 0 = 60, and the pitch C4 can be calculated.

[0056] Next, CPU 101 initializes the variable tbl_idx to 0 and the variable smallest to a sufficiently large number, 999 (S1102). The variable tbl_idx is used as an index for the chord tone table 104c shown in Figure 12. The variable smallest holds the minimum difference between the note name number of the pressed key and the note name number of the chord tone.

[0057] The chord tone table 104c, as shown in Figure 12, is a two-dimensional array of 18 rows x 5 columns, listing the constituent notes of each chord type when the root is C, starting from the lowest note. Each constituent note of each chord type is described by its note number. -1 indicates that no constituent note exists. To calculate the constituent notes of a chord with a different root from the chord tone table 104c, simply add the note number of the root to the note number of each constituent note. For example, the root of C major is 0, so the constituent notes are 0, 4, and 7 (C, E, G). For G major, as shown in Figure 7, the note number corresponding to the root G is 7, so we add 7 to each constituent note to get 7, 11, and 14 (G, B, D). In Figure 12, for clarity, the chord type and the note names of the constituent notes are added as comments to each row of the two-dimensional array. Each element of the chord tone table 104c shown in Figure 12 can be identified by tbl[a][b]. 'a' is an index indicating the position of the chord type (chord type number), and 'b' is an index indicating the position of the constituent notes when the chord tones are listed from the bass side.

[0058] Next, the CPU 101, based on the chord type number set in the variable type in S609 of Figure 6 and the variable tbl_idx, selects one chord tone from the chord tone table 104c that corresponds to the chord information at the current timing in the ongoing song and stores it in the variable chd_note (S1103).

[0059] Next, the CPU 101 determines whether the value of the variable chd_note is -1 (step S1104). If it determines that the value of the variable chd_note is -1 (step S1104; YES), the CPU 101 determines that it is an invalid constituent note and proceeds to step S1105 to move on to the next constituent note. In step S1105, the CPU 101 increments the variable tbl_idx (step S1105), and if it determines that tbl_idx is less than 5 (step S1106; YES), it returns to step S1103 and retrieves a constituent note from the chord constituent note table 104c again. However, in this embodiment, if the value of the variable chd_note is obtained as -1, there are no further valid constituent notes, so in effect, S1118 is executed using the constituent notes processed up to this point.

[0060] If the CPU determines that the value of the variable chd_note is not -1 (step S1104; NO), the CPU 101 adds the root note number set in the variable root in S609 to the variable chd_note (step S1107). This process calculates one of the chord tones corresponding to the current chord name of the song.

[0061] Next, CPU 101 sets the remainder obtained by dividing the variable chd_note by 12 to the variable chd_note (step S1108). Step S1108 is a process to keep the calculated note names within an octave range. For example, among the G major chord notes mentioned above, 7 remains the same when the remainder is taken by 12, but 14 becomes 2. In other words, as a result of the process in step S1108, the value of the variable chd_note becomes one of the numbers from 0 to 11. This process is necessary to calculate the note name closest to the sound corresponding to the key press.

[0062] Next, CPU 101 sets the absolute value of the difference between the value of the variable chd_note and the value of the variable key_note set in S1101 into the variable diff (step S1109). That is, the difference between the note name number of the selected chord tone and the note name number corresponding to the pressed key is set into the variable diff.

[0063] Next, CPU101 determines whether the value of the variable diff is smaller than the variable smallest (minimum difference) (step S1110). Here, since the variable smallest is set to 999 on the first run, S1110 is always determined to be YES on the first run. If it is determined that the value of the variable diff is smaller than the variable smallest (step S1110; YES), CPU101 sets the value of the variable diff to the variable smallest, sets the value of the variable tbl_idx to the variable nearest_idx, and sets the value of the variable chd_note to the variable nearest_note (step S1111), and proceeds to step S1112. As a result, the difference between the note name number of the constituent note closest to the currently pressed key and the note name number of the pressed key, the index of the chord constituent note at this time, and the note name number of the chord constituent note are set in each variable. If it is determined that the value of the variable diff is not smaller than the variable smallest (step S1110; NO), CPU101 proceeds to step S1112.

[0064] In step S1112, the CPU 101 adds 12 to the variable chd_note and sets the absolute value of the difference between the note name number of the variable chd_note raised by one octave and the variable key_note to the variable diff (step S1112). Then, the CPU 101 determines whether the value of the variable diff, which is the difference between the note name number of the octave higher and the note name number of the pressed key, is smaller than the value of the variable smallest (step S1113).

[0065] If the CPU determines that the value of the variable diff, which is the difference between the note name number one octave higher and the note name number of the pressed key, is smaller than the value of the variable smallest (step S1113; YES), the CPU 101 determines that a constituent note closer to the pressed key has been found and sets the value of the variable diff to the variable smallest, the value of the variable tbl_idx to the variable nearest_idx, and the value of the variable chd_note plus 12, i.e., the note name number one octave higher, to the variable nearest_note (S1114), and proceeds to step S1115. If the CPU determines that the value of the variable diff, which is the difference between the note name number one octave higher and the note name number of the pressed key, is not smaller than the value of the variable smallest (step S1113; NO), the CPU 101 proceeds to step S1115.

[0066] In step S1115, the CPU 101 subtracts 12 from the variable chd_note, that is, sets the absolute value of the difference between the note name number obtained by lowering the note name number of the variable chd_note by one octave and the variable key_note to the variable diff (step S1115). Then, the CPU 101 determines whether the value of the variable diff, which is the difference between the note name number one octave lower and the note name number of the pressed key, is smaller than the value of the variable smallest (step S1116).

[0067] If the CPU determines that the value of the variable diff, which is the difference between the note name number one octave lower and the note name number of the pressed key, is smaller than the value of the variable smallest (step S1116; YES), the CPU 101 determines that a constituent note closer to the pressed key has been found, sets the value of the variable diff to the variable smallest, the value of the variable tbl_idx to the variable nearest_idx, and the value obtained by subtracting 12 from chd_note, i.e., the note name number one octave lower, to nearest_note (S1117), and proceeds to step S1105. If the CPU determines that the variable diff, which is the difference between the note name number one octave lower and the note name number of the pressed key, is not smaller than the variable smallest (step S1116; NO), the CPU 101 proceeds to step S1105.

[0068] Here, referring to Figure 13, we will explain why we compare the absolute value of the difference between the note name number obtained by adding 12 to chd_note, that is, the note name number obtained by raising the note name number of chd_note by one octave, and key_note, which is the note name number corresponding to the pressed key, with the variable smallest. In this embodiment, the pitch is converted to a note name in order to limit the range of pitch to one octave, and this is treated as a note name number from 0 to 11. This significantly reduces the number of data that make up the chord tone table 104c, and also simplifies the process of finding the pitch close to the pressed key. The process from steps S1109 to S1111 described above corresponds to comparing the difference between the chord tone in the key range labeled "center" in Figure 13 and the note name of the pressed key with the smallest difference up to that point. As an example, consider the case where the chord is C major and the note name corresponding to the pressed key is B(11). The note names of the chord tone of C major are C(0), E(4), and G(7), which are the shaded parts in Figure 13. The constituent note with the smallest difference between the pressed key B(11) and the other note is G(7). Therefore, if we find the smallest difference only in the middle section, the constituent note G is selected. However, in reality, the chord constituent note closest to the pressed key B is the C one octave higher, which is to its right (the key with a dot pattern in Figure 13). In order to select this C one octave higher as the note name closest to the pressed key, it is necessary to perform the processes from S1112 to S1114.

[0069] The same can happen for the octave below. For example, consider the case where the chord is E minor and the note corresponding to the pressed key is C(0). In this case, the notes that make up the E minor chord are E(4), G(7), and B(11), as shown in the shaded area of ​​Figure 14. Therefore, if we compare the pressed key only in the central part of Figure 14, E will be selected as the chord note closest to C. However, the chord note closest to C is actually B, which is one octave lower to the left (the key with the dot pattern in Figure 14). Therefore, in order to select this B one octave lower as the note closest to the pressed key, it is necessary to perform the processes from steps S1115 to S1117.

[0070] Returning to Figure 11, in step S1105, the CPU 101 increments the variable tbl_idx, which is the index of the chord tone (step S1105), and determines whether the value of tbl_idx is less than 5 (step S1106). If it determines that the value of tbl_idx is less than 5 (step S1106; YES), the CPU 101 returns to step S1103 and repeats the process from S1103.

[0071] If the CPU determines that the value of tbl_idx is 5 or greater (step S1106; NO), the CPU 101 calculates the pitch from the value of the variable nearest_note and the value of key_oct, which indicates the octave range of the pressed key, based on (Equation 1), sets it as the 0th element, which is the first element of note_buf, a buffer of candidate sounds for pronunciation (step S1118), and proceeds to step S1002 in Figure 10.

[0072] As a result of the above first candidate note determination process, the first candidate note set in note_buf[0] will be the pitch of the chord tone that is closest to the pitch of the pressed key in the current chord in the song. In this embodiment, the comparison between the note name number of the chord tone and the note name number of the pressed key and the smallest difference up to that point is performed in order from the lowest note of the chord tone. Therefore, if the difference is the same pitch, the candidate note on the lower side will be selected. Specifically, if the key pressed is D(2), C(0) and E(4) both have a difference of 2 from D, but C is compared first, so C is selected. However, this is just one embodiment, and it is also possible to select the higher-pitched note when the difference is the same.

[0073] In step S1002 of Figure 10, the CPU 101 executes the process for determining the second to fifth candidate notes. The second to fifth candidate notes are candidates for the second pitch that will be pronounced if the first candidate note is currently being pronounced. As shown in Figure 15, in the process for determining the second to fifth candidate notes, the CPU 101 first sets the value of nearest_idx, which is the index of the constituent note closest to the pitch of the pressed key, calculated in the first candidate note determination process, to the variable tbl_idx (S1201). For example, if the constituent note closest to the pitch of the pressed key in a C major chord is C, the index is set to 0; if it is E, the index is set to 1.

[0074] Next, the CPU 101 determines whether the value of the variable now_key, which is the pitch of the currently pressed key (key press pitch), is greater than or equal to the value of the variable prev_key, which is the pitch of the previous key press (step S1202). Step S1202 determines whether the key presses (pitch of the key presses) are in an upward or downward direction in the performer's playing. In this embodiment, if the value of the variable now_key is equal to the value of the variable prev_key, which is the pitch of the previous key press, the system proceeds to step S1203, but it may also proceed to step S1205.

[0075] If the CPU 101 determines that the value of the variable now_key is greater than or equal to the value of the variable prev_key (step S1202; YES), it sets the flag high_flg, which indicates that the key press is in the upward direction, to true (step S1203).

[0076] Next, CPU101 increments the value of the variable tbl_idx (step S1204) and proceeds to step S1207. Here, incrementing means adding to the index and moving to the next element. However, if the element is an invalid element, -1, it moves further forward, and if the end of the array is reached, the index is reset to 0 and the index returns to the beginning of the array. For example, if the code is in the C major and the value of the variable tbl_idx is 2, incrementing it will result in 3. From Figure 12, the third element of the C major is -1, so CPU101 further increments the value of the variable tbl_idx to 4. However, the fourth element is also -1, so the value of the variable tbl_idx is reset to 0 to point to the 0th element, 0.

[0077] In step S1202, if it is determined that the variable now_key is smaller than the variable prev_key (step S1202; NO), the CPU 101 sets high_flg to false (step S1205).

[0078] Next, CPU101 decrements the value of the variable tbl_idx (step S1206) and proceeds to step S1207. Here, decrementing means subtracting the index to return to the previous element, but if the index reaches the beginning of the array, 0, the index is set to 4, which is the end of the array. As with decrementing, if the element is an invalid element, -1, it is decremented again. For example, if the code is in the C major and the value of the variable tbl_idx is 0, decrementing it in reverse will result in 4, which points to the end of the array. As shown in Figure 12, the fourth element of the C major is -1, so CPU101 decrements the value of the variable tbl_idx to 3, but since the third element is also -1, it decrements it again to point to the second element, 7.

[0079] In step S1207, the CPU 101 sets the variable i, which will be used as the loop counter, to 1 (step S1207).

[0080] Next, the CPU 101 obtains the note name numbers of the chord constituents corresponding to the values ​​of the variables type and tbl_idx, which indicate the chord type of the current chord, from the chord constituents table 104c, adds the value of the variable root to the obtained note name numbers, and sets it in the variable chd_note (step S1208). Next, the CPU 101 calculates the pitch from the value of the variable chd_note and the value of key_oct, which indicates the octave range of the key pressed, based on (Equation 1), and sets it in the i-th element of note_buf (step S1209).

[0081] Next, CPU101 determines whether high_flg is true or not (step S1210). If high_flg is determined to be true (step S1210; YES), CPU101 determines whether the element of the previous note_buf is greater than the element of the current note_buf (step S1211). If the previous element is determined to be greater than the current element (step S1211; YES), CPU101 adds 12 to the current element (step S1212) and proceeds to step S1213. That is, the pitch is raised by one octave. If the previous element is determined not to be greater than the current element (step S1211; NO), CPU101 proceeds to step S1213.

[0082] In step S1213, the CPU 101 advances the value of the variable tbl_idx (step S1213) and proceeds to step S1217. The process in step S1213 is the same as the process in step S1204 described above, so we will refer to that explanation.

[0083] In step S1210, if high_flg is determined to be false (step S1210; NO), CPU 101 determines whether the element of the previous note_buf is smaller than the element of the current note_buf (step S1214). If it is determined that the previous element is smaller than the current element (step S1214; YES), CPU 101 subtracts 12 from the current element (step S1215) and proceeds to step S1216. That is, the pitch is lowered by one octave. If it is determined that the previous element is not smaller than the current element (step S1214; NO), CPU 101 proceeds to step S1216.

[0084] In step S1216, the CPU 101 reverses the value of the variable tbl_idx (step S1216) and proceeds to step S1217. The process in step S1216 is the same as the process in step S1206 described above, so we will refer to that explanation.

[0085] In step S1217, CPU 101 increments the variable i (S1217) and determines whether i is less than 5 (step S1218). If it determines that i is less than 5 (step S1218; YES), CPU 101 returns to step S1208 and repeats the process from S1208. This sets the elements from index 1 to index 4 of the note_buf, which is the sound candidate buffer. These become the second to fifth candidate notes. In this process, when the performer presses a key in the upward direction, the second candidate note is always selected to have a higher pitch than the first candidate note, and these are then set in note_buf in ascending order. Conversely, when the performer presses a key in the downward direction, the second candidate note is always selected to have a lower pitch than the first candidate note, and these are then set in note_buf in descending order. If it is determined that i is 5 or greater (step S1218; NO), the CPU 101 sets the value of the variable now_key to the variable prev_key (step S1219) and proceeds to step S1003 in Figure 10.

[0086] In step S1003 of Figure 10, the CPU 101 performs an unpronounced pitch search process. The unpronounced pitch search process checks whether the musical notes (candidate notes) of the pitch in the candidate sounding buffer are currently being played, starting with the first candidate note, and determines the candidate notes that are not currently being played as the pitches to be played.

[0087] As shown in Figure 16, in the unplayed pitch search process, first, the CPU 101 sets the variable i, which is used as the index of note_buf, a buffer of candidate sounds (1st to 5th candidate sounds), to 0, and sets the variable free_idx, which indicates the free index of out_buf, a buffer of the pitch of the musical sound currently being played, to -1, indicating an invalid state (step S1301). Furthermore, the CPU 101 initializes the variable j, which is used as the index of out_buf, to 0 (step S1302). Here, out_buf is an array of structures, and the structure members include a key member, which is the pitch of the pressed key, and a note member, which is the pitch of the musical sound actually being played by pressing that key. The number of elements in the array is described as the constant MAX, but this value should be determined according to the number of sounds that the sound source 108 can play simultaneously and the specifications of the electronic instrument 1. In this embodiment, 32 is assumed as the constant MAX, but a different value may be selected.

[0088] Next, CPU 101 determines whether the note member of the j-th element of out_buf is -1 (step S1303). If the note member of the j-th element is -1, it indicates that the element is empty. If it is determined that the note member of the j-th element of out_buf is -1 (step S1303; YES), CPU 101 stores the value of variable j in the variable free_idx (step S1304) and proceeds to step S1309. If the note member of the j-th element of out_buf is -1, the j-th element can be assigned a pitch later, so the value of variable j is stored in the variable free_idx, which indicates an empty index.

[0089] If the CPU determines that the note member of the j-th element of out_buf is not -1 (step S1303; NO), then that element is being pronounced. In this case, the CPU 101 compares the note member of that element with the i-th element of note_buf (step S1305). If they are equal (step S1305; YES), the CPU 101 increments i (step S1306). If the note member of the j-th element of out_buf and the i-th element of note_buf are equal, then the i-th element of note_buf (the candidate sound for pronunciation) is being pronounced. In this case, the CPU 101 increments i so that the next element of note_buf becomes the subject of comparison with the note member of out_buf.

[0090] Next, CPU 101 determines whether i is 5 or greater (step S1307). If it determines that i is not 5 or greater (step S1307; NO), CPU 101 returns to step S1302 and repeats the process from S1302. If it determines that i is 5 or greater (step S1307; YES), CPU 101 sets the variable free_idx to -1 to indicate invalidity (step S1308) and proceeds to step S904 in Figure 9. If i is 5 or greater, all pronunciation candidates are being pronounced, and the pronunciation is abandoned, so the variable free_idx is set to -1 to indicate invalidity.

[0091] On the other hand, if the note member of the j-th element of out_buf does not match the i-th element of note_buf (step S1305; NO), CPU101 increments j (step S1309) to compare the value of the next element of out_buf with the value of the i-th element of note_buf.

[0092] Next, CPU101 determines whether j is less than MAX (number of elements in the array) (step S1310). If it determines that j is less than MAX (step S1310; YES), CPU101 returns to step S1303 and compares the next element with the value of note_buf. If it determines that the variable j has reached MAX (step S1310; NO), CPU101 determines whether the variable free_idx is -1 (step S1311). Here, if j has reached MAX, it means that all elements of out_buf, i.e., the pitch of all musical notes being played, did not match the i-th element of note_buf. In other words, the candidate note of note_buf[i] is not currently being played, so if there is space in out_buf, it can be played. However, if the variable free_idx is -1, it indicates that there is no space in the buffer during playback, so it cannot be played.

[0093] If the CPU determines that the variable free_idx is -1 (step S1311; YES), the CPU 101 proceeds to step S904 in Figure 9. If the CPU determines that free_idx is not -1 (step S1311; NO), the CPU 101 sets the value of note_buf[i] to the note member of out_buf[free_idx], sets the value of the variable now_key which indicates the pitch of the key pressed to the key member of out_buf[free_idx] (step S1312), and proceeds to step S904 in Figure 9. The pitch set in the note member of out_buf[free_idx] becomes the pitch of the musical note to be produced (determined pitch).

[0094] In step S904 of Figure 9, the CPU 101 determines whether the variable free_idx is -1 or not (S904).

[0095] If the CPU determines that the variable free_idx is not -1 (step S904; NO), the CPU 101 generates pitch output instruction information determined by the keyboard algorithm and outputs it to the sound source 108 (step S905), and terminates the performance operation process. If the CPU determines that the variable free_idx is -1 (step S904; YES), the CPU 101 terminates the performance operation process.

[0096] On the other hand, in step S902, if it is determined that the performance information input by the keyboard 107 is not a key press, i.e., a key release (step S902; NO), the CPU 101 performs a sound mute process (step S906) and terminates the performance operation process.

[0097] As shown in Figure 17, in the sound silencing process, the CPU 101 first sets the pitch of the released key to the variable now_key (step S1400). The CPU 101 also sets the variable i, which is the index of out_buf, to 0 (step S1401).

[0098] Next, the CPU 101 determines whether the key member of out_buf[i] is equal to the value of the variable now_key (step S1402). If it determines that the value of the key member of out_buf[i] is equal to the value of the variable now_key (step S1402; YES), the CPU 101 generates pitch mute instruction information for the note member of out_buf[i] and outputs it to the sound source 108 (step S1403). If the key member of out_buf[i] is equal to the pitch of the released key, the note member of out_buf[i] is the sound that should be mute.

[0099] Next, CPU 101 sets the key and note members of out_buf[i] to -1 to indicate that the element in out_buf[i] is empty (step S1404), and terminates the playback operation process.

[0100] On the other hand, if the CPU determines that the key member of out_buf[i] and the value of the variable now_key are not equal (step S1402; NO), the CPU 101 increments i to proceed to the next element of out_buf (step S1405). Next, the CPU 101 determines whether i is less than the maximum number of elements in out_buf (step S1416). If it determines that i is less than the maximum number of elements in out_buf (step S1416; YES), the CPU 101 returns to step S1402 and repeats the process from S1402. If it determines that i has reached the maximum number of elements in out_buf (step S1416; NO), the CPU 101 terminates the playback operation process.

[0101] On the other hand, in step S901 of Figure 9, if it is determined that the music is not in progress (step S901; NO), the CPU 101 determines whether the input performance information indicates that a key has been pressed (step S907). If it is determined that the input performance information indicates that a key has been pressed (step S907; YES), the CPU 101 generates sound production instruction information for the pressed pitch and outputs it to the sound source 108 (step S908), and terminates the performance operation process. 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 S907; NO), the CPU 101 generates mute instruction information for the released pitch and outputs it to the sound source 108 (step S909), and terminates the performance operation process.

[0102] The effects of this embodiment will be explained below with reference to Figures 18 to 19. In Figures 18 to 19, the vertical position of each rectangle indicates the pitch, and the horizontal length indicates the note length. A keyboard is displayed on the left side to make it easier to recognize the pitch. In the following example, the chord is assumed to be C major (composed of notes C, E, and G).

[0103] Figure 18(a) shows examples of key presses when a performer plays C3 to E4 on keyboard 107 legato. In Figure 18(a), each key press is labeled N1 to N10. Even when not playing legato, unless playing staccato, the end of one key press and the beginning of the next key press usually overlap to some extent. In other words, there is a period of time when two notes are pressed simultaneously.

[0104] Figure 18(b) shows an example of sound production according to this embodiment when a performer plays the piece shown in Figure 18(a). In Figure 18(b), the sounds corresponding to each of the key presses N1 to N10 in Figure 18(a) are indicated by O1 to O10. The chord tone closest to the pitch C3 of the first key press N1 is C3, so C3 is first produced as sound O1 corresponding to key press N1. The chord tone closest to the pitch D3 of the second key press N2 is C3, but C3 is already being produced. Also, the position of the D3 pressed this time has moved higher than the C3 pressed previously. Therefore, among the unproduced chord tones higher than C3, the next closest to C3 (i.e., the chord tone closest to the pitch D3 of key press N2), which is E3, is produced as sound O2 corresponding to key press N2. The chord tone closest to the pitch E3 of the third key press N3 is E3, but E3 is already being produced. Furthermore, the position of the E3 key pressed this time has moved higher than the D3 key pressed previously. Therefore, among the unplayed chord tones higher than E3, the next closest chord tones to E3 (i.e., the closest to the pitch of the pressed key N3, E3) is G3, which is played as the note O3 corresponding to the pressed key N3. The chord tone closest to the pitch of the fourth pressed key N4, F3, is E3. At this time, E3 is not being played. Therefore, E3 is played as the note O4 corresponding to the pressed key N4. The pitch of the subsequent notes is determined in the same manner. There are parts where the pitch of the notes drops by 3 semitones (notes O4, O8), but the pitch of the notes played at these points is the chord tone closest to the pitch of the key pressed by the performer, and because of this drop in pitch, subsequent key presses will not produce pitches that deviate significantly from the pitch of the key pressed. Thus, in this embodiment, the musical tone with the pitch closest to the pressed note among the chord tones is sounded, and if the closest musical tone is already being sounded, an unsounded note is selected from the chord tones and sounded based on the direction of the pitch of the current key press relative to the previous key press. As a result, as shown in Figure 18(b), the performer's intention to play is reflected, and the sound produced does not deviate from the pressed note.

[0105] Figure 18(c) shows an example of sound production in Comparative Example 1 (Japanese Patent Publication No. 2000-172253) when a performer plays the same piece as shown in Figure 18(a). In Figure 18(c), the sounds corresponding to each of the key presses N1 to N10 in Figure 18(a) are indicated by O1 to O10. In Comparative Example 1, the chord tone closest to the pitch of the pressed key is produced. Because the judgment is based solely on the criterion of the chord tone closest to the pitch of the pressed key, the same pitch C3 is produced for both the sound O1 corresponding to key press N1 (where C3 is pressed) and the sound O2 corresponding to key press N2 (where D3 is pressed). Similarly, the same pitch E3 is produced for both the sound O3 corresponding to key press N3 (where E3 is pressed) and the sound O4 corresponding to key press N4 (where F3 is pressed). Subsequent key presses also produce sounds at the same pitch for multiple keys. In other words, even if the performer intends to change the key they are playing, the same note is produced repeatedly, and the performer's intentions are not reflected. Furthermore, in Comparative Example 1, there is a section D in which two notes of the same pitch are produced simultaneously. However, in typical electronic instruments using PCM sound sources, the same pitch is produced using the same waveform data. Therefore, a difference in the timing of sound production can cause phase interference, resulting in sounds canceling each other out or creating distortion, which is undesirable.

[0106] Figure 18(d) shows an example of sound production in Comparative Example 2 (Japanese Patent Publication No. 2004-177893) when a performer plays the same piece as shown in Figure 18(a). In Figure 18(d), the sounds corresponding to each of the key presses N1 to N10 in Figure 18(a) are indicated by O1 to O10. In Comparative Example 2, if the key pressed by the performer is higher than the key pressed before it, an unsounded note higher than the previously played chord note is selected to produce the chord tone. If there is no unsounded note higher than the previously played chord note in the candidate buffer, the next note corresponding to the previously played note is adjusted one octave higher and produced. If the key pressed by the performer is lower than the key pressed before it, the above "high" is replaced with "low". In addition, the octave of the selected pitch is corrected according to the octave difference between the reference octave and the octave of the key pressed.

[0107] In Comparative Example 2, as shown in Figure 18(d), the pitch of the key presses N1 to N3 rises, so C3, E3, and G3 are selected and pronounced sequentially as pronunciations O1 to O3. When F3 is pressed, key press N4 selects C3, but because it is an upward press, C4, which is one octave higher than C3, is pronounced as pronunciation O4. Similarly, E4 and G4 are pronounced as pronunciations O5 and O6 corresponding to key presses N5 and N6, respectively. Since Comparative Example 2 only mentions adjustments up to one octave higher, the pronunciations C4, E4, and G4 are repeated as pronunciations O7 to O9 corresponding to key presses N7 to N9. Although not shown in the figure, when key press N10, the octave range of the key press is different from the octave range of the previous key presses. If the original octave range of the key press is used as the reference octave range, then C5, which is one octave higher than C4, is pronounced as pronunciation O10 corresponding to key press N10. In Comparative Example 2, the pitch rises up to a certain point, reflecting the performer's intention, but then the pitch drops by 7 semitones, and the subsequent pitch becomes far removed from the pitch that was actually played.

[0108] Figure 19(a) shows examples of key presses when a performer plays a chord. Each key press is labeled N1 to N6. As shown in Figure 19(a), first, C3, D3, and E3 are pressed almost simultaneously as keys N1 to N3 (referred to as key press A), and then, F3, G3, and A3 are pressed almost simultaneously as keys N4 to N6 (referred to as key press B). However, in key press A and key press B, the lower notes are pressed earlier in time. That is, the direction of each key press in key press A and key press B is upward.

[0109] Figure 19(b) shows an example of sound production according to this embodiment when a performer plays the chord shown in Figure 19(a). In Figure 19(b), the sounds corresponding to each of the key presses N1 to N6 in Figure 19(a) are indicated by O1 to O6. For key press A, the sounds O1 to O3 corresponding to key presses N1 to N3 are C3, E3, and G3. For key press B, for key press N4 (pitch F3), the closest chord tone, E3, is produced. For key press N5 (pitch G3), the closest chord tone, G3, is produced. For key press N6 (pitch A3), although the closest chord tone is G3, since it is currently being produced, C4, which is the next closest chord tone to G3 (i.e., the closest to the pitch A3 of key press N6) among the unproduced chord tones higher than G3, is produced as sound production O6 corresponding to key press N6. As shown in Figure 19(b), in this embodiment, the musical note with the pitch closest to the pressed note among the chord tones is played. If the closest musical note is already being played, an unplayed note from the chord tones is selected and played based on the direction of the pitch of the current key press relative to the previous key press. This allows the player's intention to play to be reflected even when inputting chords. Furthermore, since an unplayed note is selected, the played notes will not be duplicated. In other words, it can also handle chord performance.

[0110] Figure 19(c) shows an example of sound production in Comparative Example 2 when a performer plays the chord shown in Figure 19(a). In Figure 19(c), the sounds corresponding to each of the key presses N1 to N6 in Figure 19(a) are indicated by O1 to O6. For key press A, the sounds O1 to O3 corresponding to key presses N1 to N3 are C3, E3, and G3. For key press B, key press N4 (pitch F3), since there are no chord notes in the C chord range that are higher than the G3 produced corresponding to key press N3 within the same octave range, it returns to C3, and then, to make the pitch higher than the G3 produced as sound production O3 corresponding to key press N3, C4 is produced, which is one octave higher. Similarly, E4 and G4 are produced as sounds O5 and O6 corresponding to key presses N5 and N6. In other words, a high pitch that deviates from the pitch of the key pressed by the performer is produced.

[0111] In the keyboard algorithm explained in Figure 10, candidate notes 1 through 5 were determined and stored in note_buf. Then, the system checked whether note_buf was currently playing, starting with the first candidate note. If not, it played the note. In other words, all candidate notes were determined first, and then it was checked whether a candidate note was currently playing. However, it would be possible to check whether a determined candidate note was currently playing each time a candidate note was determined, and if it was not playing, it would be treated as the determined pitch and subsequent candidate note calculations would not be performed. This would allow the calculated candidate note to be played immediately if it is not playing, eliminating the need to calculate subsequent candidate notes and thus reducing the processing load.

[0112] As explained above, the CPU 101 of the electronic instrument 1 determines the first pitch closest to the pitch corresponding to the pressed key from among the chord tones corresponding to the chord information at the time any key is pressed by the user in the ongoing song. If the first pitch tone is not currently being played, the CPU 101 instructs the sound generation unit 111 to play the first pitch tone. If the first pitch tone is already being played, the CPU 101 instructs the sound generation unit 111 to play the second pitch tone, which is in the same direction as the first pitch included in the chord tones, relative to the direction of the pitch corresponding to the current key press relative to the pitch corresponding to the previous key press. Therefore, in response to the user's performance operation, good musical tones can be produced that reflect the user's intention to play and harmonize with the chords of the song.

[0113] For example, if the CPU 101 is currently producing a musical note of the first pitch, and the direction of the pitch corresponding to the current key press is upward relative to the pitch corresponding to the previous key press, the CPU 101 will cause the sound-producing unit 111 to produce a second pitch that is higher than the first pitch included in the chord tones. Therefore, when the user presses a key in the direction of rising pitch, a good musical note that reflects the user's intention to play in an upward direction can be produced.

[0114] For example, the CPU 101 causes the sound generation unit 111 to produce a second pitch that is higher than the first pitch included in the chord tones, is not currently being played, and is closest to the pitch corresponding to the key that was just pressed. Therefore, it is possible to produce good music that harmonizes with the chords of the song without deviating from the user's performance, and without sounds canceling each other out or creating distortions.

[0115] Furthermore, for example, if the CPU 101 is currently producing a musical note of the first pitch, and the direction of the pitch corresponding to the current key press is downward relative to the pitch corresponding to the previous key press, the CPU 101 will cause the sound-producing unit 111 to produce a pitch lower than the first pitch included in the chord tones as the second pitch. Therefore, when the user presses a key in the downward direction of the pitch, a good musical note that reflects the user's intention to play in a downward direction can be produced.

[0116] For example, the CPU 101 causes the sound generation unit 111 to produce a second pitch, which is the closest pitch to the current key press among the pitches that are lower than the first pitch included in the chord tones and are not currently being played. Therefore, it is possible to produce good music that harmonizes with the chords of the song without deviating from the user's performance, and without sounds canceling each other out or creating distortions.

[0117] The descriptions in the above embodiments are merely preferred examples of the electronic musical instrument, control method, and program according to the present invention, and are not limited thereto.

[0118] 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.

[0119] 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.

[0120] 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.

[0121] 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.

[0122] 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]

[0123] 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 In a song in progress, from among the chord tones corresponding to the chord information at the timing specified by the user, the first pitch closest to the pitch corresponding to the specified operator is determined. If the first pitch is not currently being produced, the sound-producing unit is instructed to produce the first pitch. If the first pitch is being produced, the sound-producing unit is instructed to produce a second pitch, which is in the same direction as the first pitch included in the chord constituent notes, relative to the pitch corresponding to the previously specified operator. Electronic musical instrument.

2. The control unit, when a musical tone of the first pitch is being produced and the direction of the pitch corresponding to the currently specified operator relative to the pitch corresponding to the previously specified operator is upward, causes the sound-producing unit to produce a pitch higher than the first pitch included in the chord constituent tone as the second pitch. The electronic musical instrument according to claim 1.

3. The control unit causes the sound-producing unit to produce a second pitch, which is a pitch higher than the first pitch included in the chord constituent tones and is not currently being produced, and which is closest to the pitch corresponding to the operator specified this time. The electronic musical instrument according to claim 2.

4. The control unit, when a musical tone of the first pitch is being produced and the direction of the pitch corresponding to the currently specified operator relative to the previously specified pitch corresponding to the operator is downward, causes the sound-producing unit to produce a pitch lower than the first pitch included in the chord constituent tone as the second pitch. The electronic musical instrument according to claim 1.

5. The control unit causes the sound-producing unit to produce a second pitch, which is a pitch lower than the first pitch included in the chord constituent tones and is not currently being produced, and which is closest to the pitch corresponding to the operator specified this time. The electronic musical instrument according to claim 4.

6. Computers From among the chord tones corresponding to the chord information at the timing specified by the user in the ongoing song, the first pitch closest to the pitch corresponding to the specified operator is determined. If the first pitch is not currently being produced, the sound-producing unit is instructed to produce the first pitch. When the first pitch is being played, the sound-producing unit is instructed to play a second pitch, which is in the same direction as the first pitch included in the chord, relative to the pitch corresponding to the previously specified operator. Control method.

7. On the computer, From among the chord tones corresponding to the chord information at the timing specified by the user in the ongoing song, the first pitch closest to the pitch corresponding to the specified operator is determined. If the first pitch is not currently being produced, the sound-producing unit is instructed to produce the first pitch. When the first pitch is being played, the sound-producing unit is instructed to play a second pitch, which is in the same direction as the first pitch included in the chord, relative to the pitch corresponding to the previously specified operator. A program to execute a process.