JPH07287571A - Sound signal conversion device - Google Patents

Sound signal conversion device

Info

Publication number
JPH07287571A
JPH07287571A JP6081392A JP8139294A JPH07287571A JP H07287571 A JPH07287571 A JP H07287571A JP 6081392 A JP6081392 A JP 6081392A JP 8139294 A JP8139294 A JP 8139294A JP H07287571 A JPH07287571 A JP H07287571A
Authority
JP
Japan
Prior art keywords
pitch
key
key code
stored
sound
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP6081392A
Other languages
Japanese (ja)
Other versions
JP3055392B2 (en
Inventor
Eiichiro Aoki
栄一郎 青木
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Yamaha Corp
Original Assignee
Yamaha Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Yamaha Corp filed Critical Yamaha Corp
Priority to JP6081392A priority Critical patent/JP3055392B2/en
Publication of JPH07287571A publication Critical patent/JPH07287571A/en
Application granted granted Critical
Publication of JP3055392B2 publication Critical patent/JP3055392B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Abstract

PURPOSE:To convert a sound signal into a correct key code irrespective of the kind of the inputted sound signal. CONSTITUTION:This sound signal conversion device is provided with a sound input means which inputs sound and generates the sound signal, a pitch extracting means which divides the sound signal generated by the sound input means into specific time sections and extracts pitches in the respective time sections, a mean pitch arithmetic means which calculates the mean pitch of the pitches extracted by the pitch extracting means, and a pitch information converting means which converts the mean pitch calculated by the mean pitch arithmetic means into pitch information. Further, the device has a sound input means which inputs a sound constituting music and generates a sound signal, a pitch extracting means which extracts a pitch from the sound signal generated by the sound input means, a pitch information converting means which converts the pitch extracted by the pitch extracting means into pitch information, a tone information supply mean which supplies tone information, and a pitch information correcting means which corrects the pitch information according to the tone information supplied from the tone information supply means.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は音声信号変換装置に関
し、特に入力された音声信号をキーコードに変換する変
換装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a voice signal converter, and more particularly to a converter for converting an input voice signal into a key code.

【0002】[0002]

【従来の技術】音声信号変換装置は、外部から入力され
る音声信号をキーコード(音高情報)に変換する装置で
ある。変換されたキーコードは、例えばMIDI形式の
演奏データとして扱うことができる。音源装置でこのよ
うな演奏データを楽音信号に変換すれば、発音可能な信
号となる。
2. Description of the Related Art A voice signal converter is a device for converting a voice signal input from the outside into a key code (pitch information). The converted key code can be treated as performance data in MIDI format, for example. If the tone generator converts such performance data into a tone signal, it becomes a signal that can be sounded.

【0003】音声信号変換装置は、逐次入力される音声
信号が何のキーコードであるのかを検出するための認識
処理を行う。音声信号から正しいキーコードを認識する
ことができる割合を示すキーコード認識率は、音声信号
変換装置に入力される音声信号の種類により大きく異な
る。
The voice signal converter performs a recognition process for detecting what key code the voice signals that are successively input are. The key code recognition rate, which indicates the rate at which a correct key code can be recognized from a voice signal, greatly differs depending on the type of voice signal input to the voice signal conversion device.

【0004】入力音声信号が楽器演奏により発せられた
ものであれば、キーコードの認識率はある程度高い値が
えられる。しかし、入力音声信号が人間の音声である場
合には、楽器演奏による音声の検出に比べてキーコード
の認識率が低い値になってしまう。
If the input voice signal is generated by playing a musical instrument, the key code recognition rate can be high to some extent. However, when the input voice signal is a human voice, the key code recognition rate becomes lower than that of the voice detection by playing a musical instrument.

【0005】人間の喉から発せられる声は、通常同一の
キーコードを持続して有することは少なく、揺らいだ音
になる。プロ歌手による歌声であっても、発せられる音
声信号中の基本周波数はある程度揺れてしまうために、
歌声から1音1音のキーコードを正確に認識することは
困難である。
The voice uttered from the human throat usually does not have the same key code continuously and becomes a fluttering sound. Even if it is a singing voice by a professional singer, since the fundamental frequency in the voice signal emitted fluctuates to some extent,
It is difficult to accurately recognize the key code for each note from the singing voice.

【0006】[0006]

【発明が解決しようとする課題】電子楽器のように、電
気信号の合成により生成される音声信号は、各周波数成
分の変動が少なく雑音がほとんど含まれていない信号で
ある。したがって、電子楽器による音声信号から対応す
るキーコードを認識することは比較的容易に行うことが
できる。
An audio signal generated by synthesizing electric signals, like an electronic musical instrument, is a signal in which fluctuations in each frequency component are small and almost no noise is included. Therefore, it is relatively easy to recognize the corresponding key code from the audio signal from the electronic musical instrument.

【0007】しかし、人間の発声等により発せられる音
声信号は、周波数成分の変動が大きいためにキーコード
を認識することが困難である。本発明の目的は、入力さ
れる音声信号の種類にかかわらず、音声信号を正しいキ
ーコードに変換することができる音声信号変換装置を提
供することである。
However, it is difficult to recognize the key code in the voice signal generated by human voice, etc., because the frequency component has a large variation. An object of the present invention is to provide an audio signal conversion device capable of converting an audio signal into a correct key code regardless of the type of the input audio signal.

【0008】[0008]

【課題を解決するための手段】本発明の音声信号変換装
置は、外部から供給される音声を入力して音声信号を生
成するための音声入力手段と、音声入力手段が生成する
音声信号を所定の時間区間に分割して各時間区間におけ
るピッチを抽出するためのピッチ抽出手段と、ピッチ抽
出手段により抽出される複数のピッチを平均化して平均
ピッチを演算するための平均ピッチ演算手段と、平均ピ
ッチ演算手段により演算される平均ピッチを音高情報に
変換するための音高情報変換手段とを有する。
SUMMARY OF THE INVENTION An audio signal converter according to the present invention has a predetermined audio input means for inputting an externally supplied audio to generate an audio signal and an audio signal generated by the audio input means. Pitch extracting means for dividing the time interval into a plurality of time intervals to extract a pitch in each time interval, an average pitch calculating means for averaging a plurality of pitches extracted by the pitch extracting means to calculate an average pitch, and an average Pitch information conversion means for converting the average pitch calculated by the pitch calculation means into pitch information.

【0009】また、本発明の音声信号変換装置は、外部
から楽曲を構成する音声を入力して音声信号を生成する
ための音声入力手段と、音声入力手段が生成する音声信
号からピッチを抽出するためのピッチ抽出手段と、ピッ
チ抽出手段により抽出されるピッチを音高情報に変換す
るための音高情報変換手段と、調情報を供給するための
調情報供給手段と、調情報供給手段から供給される調情
報に応じて音高情報を修正するための音高情報修正手段
とを有する。
Further, the audio signal conversion apparatus of the present invention extracts the pitch from the audio input means for externally inputting the audio forming the music to generate the audio signal and the audio signal generated by the audio input means. For extracting pitch information, pitch information converting means for converting the pitch extracted by the pitch extracting means into pitch information, key information supplying means for supplying key information, and key information supplying means. And pitch information modifying means for modifying the pitch information according to the key information.

【0010】[0010]

【作用】ピッチ抽出手段は、音声信号入力手段に入力さ
れた音声信号を所定の時間区間に分割して、各時間区間
毎のピッチを検出する。検出されたピッチは、平均ピッ
チ演算手段により複数の時間区間で平均化された後に、
音高情報に変換される。音高情報は、検出されたピッチ
を直接用いるよりも、平均化したピッチを用いた方が正
しい音高情報を得ることができる。
The pitch extracting means divides the voice signal input to the voice signal input means into predetermined time intervals and detects the pitch for each time interval. The detected pitch is averaged over a plurality of time intervals by the average pitch calculating means,
Converted to pitch information. As for the pitch information, it is possible to obtain correct pitch information by using the averaged pitch rather than directly using the detected pitch.

【0011】また、楽曲を構成する入力音声信号から検
出されたピッチを音高情報に変換した後に、音高情報
は、供給された調情報の音楽規則に応じて修正される。
音高情報の修正を行うことにより、正しい音高情報を得
ることができる。
Further, after the pitch detected from the input voice signal forming the music is converted into pitch information, the pitch information is modified according to the music rule of the supplied key information.
Correct pitch information can be obtained by correcting the pitch information.

【0012】[0012]

【実施例】図1は、本発明を実施するための音声信号変
換装置のシステム構成例を示す。音声信号変換装置は、
マイク1から入力される音声信号をキーコードに変換す
ることができる。変換されたキーコードは、音源4にお
いて対応するキーコードの楽音信号に変換され、サウン
ドシステム5から発音される。
DESCRIPTION OF THE PREFERRED EMBODIMENTS FIG. 1 shows an example of the system configuration of an audio signal converter for implementing the present invention. The audio signal converter is
A voice signal input from the microphone 1 can be converted into a key code. The converted key code is converted into a tone signal of the corresponding key code in the sound source 4, and is sounded by the sound system 5.

【0013】マイク1には、外部から歌声等の音声信号
が入力される。入力される音声信号は、例えば人の歌声
や楽器演奏等による楽音のアナログ信号である。スター
トスイッチを押すと、音声信号の入力が開始され、スト
ップスイッチを押すと、音声信号の入力が終了する。マ
イク1に入力された音声アナログ信号は、D/A変換器
2においてディジタル信号に変換され、バス11に供給
される。
A voice signal such as a singing voice is input to the microphone 1 from the outside. The input voice signal is, for example, an analog signal of a musical sound produced by a human singing voice or playing a musical instrument. Pressing the start switch starts the input of the audio signal, and pressing the stop switch ends the input of the audio signal. The voice analog signal input to the microphone 1 is converted into a digital signal in the D / A converter 2 and supplied to the bus 11.

【0014】CPU7は、バス11に供給された音声デ
ィジタル信号をキーコードに変換するために、各種の制
御処理を行う。正しいキーコードに変換するために、C
PU7は通常のキーコード変換処理の他に、平均ピッチ
検出と調内キーコードへの修正処理を行う。
The CPU 7 performs various control processes in order to convert the audio digital signal supplied to the bus 11 into a key code. C to convert to the correct key code
In addition to the normal key code conversion process, the PU 7 performs the average pitch detection and correction process to the in-key key code.

【0015】平均ピッチ検出は、マイク1に入力された
音声信号を量子化して、量子化された音声信号毎にピッ
チを検出する。そして、所定時間内で検出された複数の
ピッチの平均ピッチを求め、平均ピッチからキーコード
を算出する。平均ピッチを検出することにより、人の歌
声のように時間経過と共にピッチが変化しやすい性質の
音声信号であっても、正しいピッチを検出することがで
きる。
In the average pitch detection, the voice signal input to the microphone 1 is quantized and the pitch is detected for each quantized voice signal. Then, the average pitch of the plurality of pitches detected within the predetermined time is obtained, and the key code is calculated from the average pitch. By detecting the average pitch, it is possible to detect the correct pitch even in the case of a voice signal having a property in which the pitch easily changes with the passage of time such as a human singing voice.

【0016】調内キーコードへの修正処理は、まず、連
続してマイク1に入力された音声信号を楽曲とみなし
て、その楽曲の調を検出する。楽音の調が検出されれ
ば、その調に用いられやすいキーコードを予測すること
ができる。この音楽規則の知識を利用して、検出された
キーコードの修正処理を行う。これにより、誤認識によ
り検出されたキーコードを正しいキーコードに修正する
ことができる。
In the correction processing for the in-key key code, first, the audio signals continuously input to the microphone 1 are regarded as music, and the key of the music is detected. When a tone of a musical tone is detected, it is possible to predict a key code that is easy to use for that tone. Using the knowledge of the music rules, the detected key code is corrected. Thereby, the key code detected by the erroneous recognition can be corrected to the correct key code.

【0017】データメモリ(RAM)10は、入力音声
信号を楽音とみなしたときの調を検出するために必要な
データ等を記憶している。例えば、C長調、C短調等の
各調を構成する音名データを記憶しており、入力音声信
号のキーコードがどの調の構成音に該当するのかを調べ
ることにより、調の検出が行われる。
A data memory (RAM) 10 stores data necessary for detecting a key when the input voice signal is regarded as a musical tone. For example, note name data that constitutes each key such as C major and C minor is stored, and a key is detected by checking which key the input voice signal corresponds to. .

【0018】CPU7は、入力音声信号からキーコード
に変換した後に、変換したキーコードを基にして演奏デ
ータを生成する。生成された演奏データは音源4に供給
され、楽音信号が生成される。サウンドシステム5は、
音源4から供給される楽音信号に応じて楽音を発する。
After converting the input voice signal into a key code, the CPU 7 generates performance data based on the converted key code. The generated performance data is supplied to the sound source 4, and a musical tone signal is generated. Sound system 5
A musical tone is emitted according to the musical tone signal supplied from the sound source 4.

【0019】また、出力端子3の出力スイッチが押され
ると、生成された演奏データは、必要に応じてMIDI
形式のデータ等に変換され、出力端子3から外部機器に
出力される。
When the output switch of the output terminal 3 is pressed, the generated performance data is MIDI-generated as necessary.
The data is converted into format data or the like and output from the output terminal 3 to an external device.

【0020】プログラムメモリ(ROM)8は、演算プ
ログラムを記憶している。CPU7はこの演算プログラ
ムに従って、ワーキングメモリ(RAM)9に備えられ
たレジスタやバッファメモリ等のワーキングメモリを用
いて上述の各種演算処理を行う。
A program memory (ROM) 8 stores a calculation program. The CPU 7 performs the above-described various arithmetic processes using a working memory such as a register and a buffer memory provided in the working memory (RAM) 9 according to the arithmetic program.

【0021】タイマ6は、タイミング信号を生成し、所
定時間間隔でCPU7に割り込み信号を供給する。タイ
マ6は、例えば16分(音符)の長さ毎に割り込み信号
をCPU7に供給し、割り込み処理を実行させる。割り
込み処理は、外部から人がマイク1に歌声を入力する際
等に必要となるメトロノーム音を生成することもでき
る。
The timer 6 generates a timing signal and supplies an interrupt signal to the CPU 7 at predetermined time intervals. The timer 6 supplies an interrupt signal to the CPU 7 every 16 minutes (notes), for example, to execute interrupt processing. The interrupt processing can also generate a metronome sound that is necessary when a person inputs a singing voice into the microphone 1 from the outside.

【0022】CPU7は、バス11を介して、D/A変
換器2、プログラムメモリ8、ワーキングメモリ9、デ
ータメモリ10、音源4、出力端子3の制御を行う。図
2は、CPUが行う入力変換処理のメインルーチンを示
すフローチャートである。CPUは、まずステップP1
において、レジスタ類の初期化等の初期設定の処理を行
う。
The CPU 7 controls the D / A converter 2, the program memory 8, the working memory 9, the data memory 10, the sound source 4, and the output terminal 3 via the bus 11. FIG. 2 is a flowchart showing the main routine of the input conversion process performed by the CPU. First, the CPU executes step P1.
In step 1, initialization processing such as initialization of registers is performed.

【0023】ステップP2では、マイクから音声信号の
入力開始を指示するスタートスイッチが押されたか否か
を調べる。スタートスイッチが押されていなければ、音
声入力の処理を行わずにステップP9へ進む。
In step P2, it is checked whether or not the start switch for instructing the start of inputting a voice signal from the microphone has been pressed. If the start switch has not been pressed, the process proceeds to step P9 without performing voice input processing.

【0024】スタートスイッチが押されていれば、ステ
ップP11へ進み、音声入力処理のために必要なレジス
タやフラグ等の初期設定を行い、ステップP3へ進む。
ステップP3では、音声入力処理と平均ピッチ検出処理
を行う。音声入力処理は、マイクから入力される音声信
号をワーキングメモリに取り込む処理である。平均ピッ
チ検出は、入力された音声信号を量子化して、量子化さ
れた音声信号毎のピッチの平均値を検出する処理であ
る。処理の詳細は、後にフローチャートを参照しながら
説明する。
If the start switch is pressed, the process proceeds to step P11 to initialize registers and flags necessary for voice input processing, and then proceeds to step P3.
In step P3, voice input processing and average pitch detection processing are performed. The voice input process is a process of taking a voice signal input from the microphone into the working memory. The average pitch detection is a process of quantizing the input voice signal and detecting the average value of the pitch of each quantized voice signal. Details of the processing will be described later with reference to the flowchart.

【0025】ステップP4では、マイクから音声信号の
入力終了を指示するストップスイッチが押されたか否か
を調べる。ストップスイッチが押されていなければ、マ
イクに逐次入力される音声信号について、上述の音声入
力処理と平均ピッチ検出処理を繰り返し、ストップスイ
ッチが押されるまで処理を繰り返す。
In step P4, it is checked whether or not the stop switch for instructing the end of the voice signal input from the microphone has been pressed. If the stop switch is not pushed, the above-mentioned voice input process and average pitch detection process are repeated for voice signals sequentially input to the microphone, and the process is repeated until the stop switch is pushed.

【0026】ストップスイッチが押されると、ステップ
P5へ進み、音声信号の入力終了を示すエンドコードを
ワーキングメモリ中のメモリMEM()に格納する。上
述のステップで検出された所定時間毎の平均ピッチは、
既に配列メモリMEM()に格納されている。入力され
た音声信号の全ての平均ピッチが格納された後に、スト
ップスイッチが押されると、最後の配列のメモリMEM
(I)にエンドコードが格納される。
When the stop switch is pressed, the process proceeds to step P5, and the end code indicating the end of the input of the voice signal is stored in the memory MEM () in the working memory. The average pitch for each predetermined time detected in the above step is
It is already stored in the array memory MEM (). When the stop switch is pressed after all the average pitches of the input audio signal are stored, the memory MEM of the last array is stored.
The end code is stored in (I).

【0027】ステップP6では、メモリMEM()に格
納された音声信号の平均ピッチをキーコードに変換する
処理を行う。平均ピッチは、周波数で表されているの
で、その周波数で表される値をC4等で表されるキーコ
ードに変換する。詳細は、後述する。
In step P6, the average pitch of the audio signals stored in the memory MEM () is converted into a key code. Since the average pitch is represented by a frequency, the value represented by the frequency is converted into a key code represented by C4 or the like. Details will be described later.

【0028】ステップP7では、変換されたキーコード
の中で誤って変換されたキーコードの修正を行うための
処理を行う。まず、前ステップにおいて得られた複数の
キーコードを楽曲とみなして、その楽音の調を検出す
る。そして、検出された調の構成音に該当しないものに
ついては、誤ったキーコードに変換されたと判断して、
修正処理を行う。処理の詳細は、後にフローチャートを
参照しながら説明する。
In step P7, a process for correcting a key code that is erroneously converted in the converted key code is performed. First, the plurality of key codes obtained in the previous step are regarded as music, and the key of the musical sound is detected. And for those that do not correspond to the detected tones, it is determined that they have been converted to the wrong key code,
Perform correction processing. Details of the processing will be described later with reference to the flowchart.

【0029】ステップP8では、キーコードの検出およ
び修正が行われた後に、そのキーコードを基にして演奏
データの生成を行う。演奏データは、キーコードの他
に、発音開始を示すキーオンコード、発音の持続時間を
示すデュレーションコード、発音終了を示すキーオフコ
ード等のデータを含んでいる。詳細は、後述する。
In step P8, after the key code is detected and corrected, performance data is generated based on the key code. In addition to the key code, the performance data includes data such as a key-on code indicating the start of sounding, a duration code indicating the duration of sounding, and a key-off code indicating the end of sounding. Details will be described later.

【0030】ステップP9では、出力スイッチが押され
たか否かを調べる。出力スイッチが押されていれば、ス
テップP10へ進み、生成された演奏データを出力端子
から出力する。その後、ステップP2へ戻り、再び音声
入力開始のためのスタートスイッチが押されたか否かを
調べる。
In step P9, it is checked whether or not the output switch has been pressed. If the output switch is pressed, the process proceeds to step P10 and the generated performance data is output from the output terminal. Then, the process returns to step P2 to check again whether the start switch for starting the voice input is pressed.

【0031】ステップP9において、出力スイッチが押
されていないと判断されたときには、出力端子から演奏
データを出力することなく、直接ステップP2へ戻る。
図3は、図2のステップP3における音声入力処理と平
均ピッチ検出処理の詳細を示すフローチャートである。
When it is determined in step P9 that the output switch is not pressed, the process directly returns to step P2 without outputting performance data from the output terminal.
FIG. 3 is a flowchart showing details of the voice input process and the average pitch detection process in step P3 of FIG.

【0032】図2のメインルーチンにおいて、この音声
入力処理が行われる前に、ステップP11で音声入力処
理のための初期設定が既に行われている。初期設定で
は、キーオンフラグKON、ピッチレジスタF、フラグ
Q、カウンタI、カウンタNの初期化を行っている。各
フラグ等の初期設定方法を次に示す。
In the main routine of FIG. 2, before the voice input process is performed, the initial setting for the voice input process is already performed in step P11. In the initial setting, the key-on flag KON, the pitch register F, the flag Q, the counter I, and the counter N are initialized. The initial setting method of each flag is shown below.

【0033】まず、キーオンフラグKONを0にする。
キーオンフラグKONは、マイクから何らかの音声信号
が入力されている間は1を示し、入力される音声信号が
ほぼ0である間は0を示す。
First, the key-on flag KON is set to 0.
The key-on flag KON indicates 1 while any audio signal is input from the microphone, and indicates 0 when the input audio signal is almost 0.

【0034】次に、ピッチレジスタFを0にクリアす
る。ピッチレジスタFは、マイクから入力される音声信
号から検出されるピッチを格納するためのレジスタであ
る。ピッチとは、音高を表す周波数である。
Next, the pitch register F is cleared to 0. The pitch register F is a register for storing the pitch detected from the audio signal input from the microphone. Pitch is a frequency that represents a pitch.

【0035】そして、フラグQを0にする。フラグQ
は、タイマからの割り込み信号をきっかけとする割り込
み処理により、所定時間(例えば16分音符の長さ)間
隔で1にセットされる。フラグQは、所定の処理が行わ
れた後に0になるので、通常は0がセットされており、
所定時間間隔で一瞬1がセットされる。
Then, the flag Q is set to 0. Flag Q
Is set to 1 at a predetermined time interval (for example, the length of a 16th note) by an interrupt process triggered by an interrupt signal from the timer. Since the flag Q becomes 0 after the predetermined processing is performed, 0 is usually set,
1 is set momentarily at a predetermined time interval.

【0036】さらに、カウンタIおよびカウンタNを0
にリセットする。カウンタIは、求められる平均ピッチ
を格納する配列メモリMEM()の配列番号を示す。カ
ウンタNは、所定時間内に入力される音声信号の量子化
数をカウントする。
Further, the counter I and the counter N are set to 0.
Reset to. The counter I indicates the array number of the array memory MEM () that stores the calculated average pitch. The counter N counts the number of quantized audio signals input within a predetermined time.

【0037】以上の初期設定が行われた後に、音声入力
および平均ピッチ検出を行うための処理がステップQ2
から開始する。ステップQ2では、キーオンフラグKO
Nが0であるか否かを調べる。キーオンフラグKONが
0であれば、ステップQ3に進む。最初は、初期設定で
キーオンフラグKONが0に設定されているので、ステ
ップQ3に進む。
After the above initialization, the processing for voice input and average pitch detection is performed in step Q2.
Start with. In step Q2, the key-on flag KO
Check whether N is 0 or not. If the key-on flag KON is 0, the process proceeds to step Q3. Initially, the key-on flag KON is initially set to 0, so the routine proceeds to step Q3.

【0038】ステップQ3では、マイクから入力される
音声信号の入力レベルがしきい値#1を越えているか否
かを調べる。しきい値#1は、音声入力レベルの雑音レ
ベルを示す。しきい値#1を越えていなければ、入力が
無音状態であると判断して、入力音声信号の処理を行わ
ずにステップQ10へ進む。
In step Q3, it is checked whether or not the input level of the voice signal input from the microphone exceeds the threshold value # 1. The threshold # 1 indicates the noise level of the voice input level. If the threshold # 1 is not exceeded, it is determined that the input is in a silent state, and the processing of the input audio signal is not performed, and the process proceeds to step Q10.

【0039】音声入力レベルがしきい値#1を越えてい
れば、適正な音声入力があったとして、ステップQ4へ
進み、入力音声信号の処理を開始する。ステップQ4で
は、適正な音声入力の開始を示すために、キーオンフラ
グKONを1にする。その後、ステップQ5へ進む。
If the voice input level exceeds the threshold value # 1, it is determined that there is a proper voice input, and the process proceeds to step Q4 to start the processing of the input voice signal. In step Q4, the key-on flag KON is set to 1 to indicate the start of proper voice input. Then, it progresses to step Q5.

【0040】ステップQ5では、入力音声信号を基にし
てピッチ検出を行う。ディジタル信号系列で表される入
力音声信号に対して、ハミング窓やハニング窓等で所定
時間内の信号を切り出し、周波数解析を行う。周波数解
析を行うことにより、ピッチ(音高情報)を検出する。
In step Q5, pitch detection is performed based on the input voice signal. For an input voice signal represented by a digital signal sequence, a signal within a predetermined time is cut out by a Hamming window, a Hanning window, etc., and frequency analysis is performed. Pitch (pitch information) is detected by performing frequency analysis.

【0041】ステップQ6では、検出されたピッチをピ
ッチレジスタFに加算する。ピッチレジスタFには、初
期設定で0にセットされているので最初は、検出された
ピッチそのものの値がピッチレジスタFに格納される。
At step Q6, the detected pitch is added to the pitch register F. Since the pitch register F is initially set to 0, the value of the detected pitch itself is initially stored in the pitch register F.

【0042】ステップQ7では、カウンタNをインクリ
メントする。その後、ステップQ10へ進む。ステップ
Q10では、フラグQが1であるか否かを調べる。フラ
グQは、初期設定において0にセットされているので、
一旦図2のメインルーチンの処理へ戻る。もし、音声入
力の終了を指示するストップスイッチが押されていなけ
れば、再び上述の音声入力処理を繰り返すためにステッ
プQ2からの処理を再開する。ストップスイッチが押さ
れるまで、音声入力処理を繰り返すことにより、マイク
から逐次入力される音声信号を時間経過と共にリアルタ
イムに処理することができる。
At step Q7, the counter N is incremented. Then, it progresses to step Q10. In step Q10, it is checked whether or not the flag Q is 1. Since the flag Q is set to 0 in the initial setting,
The process once returns to the process of the main routine of FIG. If the stop switch for instructing the end of voice input is not pressed, the processing from step Q2 is restarted to repeat the above-mentioned voice input processing. By repeating the voice input process until the stop switch is pressed, the voice signals sequentially input from the microphone can be processed in real time over time.

【0043】音声入力処理を再開するために、ステップ
Q2において、再びキーオンフラグKONが0であるか
否かを調べる。既に上述の1回目のステップQ4の処理
でキーオンフラグKONが1にセットされているので、
ステップQ8へ進む。
In order to restart the voice input process, it is checked again in step Q2 whether the key-on flag KON is 0 or not. Since the key-on flag KON has already been set to 1 in the above-mentioned processing of the first step Q4,
Go to step Q8.

【0044】ステップQ8では、今回マイクから入力さ
れた音声入力レベルがしきい値#2よりも小さいか否か
を調べる。しきい値#2は、音声入力レベルの雑音レベ
ルを示す。しきい値#2を越えていれば、前回から適正
な音声信号が引き続き入力されていることを示す。一
方、しきい値#2を越えていなければ、マイクからの入
力が無音状態になったことを示す。
In step Q8, it is checked whether or not the voice input level input from the microphone this time is smaller than the threshold value # 2. The threshold # 2 indicates the noise level of the voice input level. If the threshold # 2 is exceeded, it indicates that the proper audio signal has been continuously input since the last time. On the other hand, if the threshold # 2 is not exceeded, it indicates that the input from the microphone is in the silent state.

【0045】ステップQ8において、音声入力レベルが
しきい値#2を越えていればマイクから音声入力が引き
続き行われていることを示すので、ステップQ5へ進
み、今回入力された音声信号の平均ピッチ検出の処理を
行う。
In step Q8, if the voice input level exceeds the threshold value # 2, it means that the voice is continuously input from the microphone. Therefore, the process proceeds to step Q5, and the average pitch of the voice signals input this time. Perform detection processing.

【0046】ステップQ5では、入力音声信号のピッチ
を検出し、検出したピッチをステップQ6においてピッ
チレジスタFに加算する。ステップQ7では、カウンタ
Nをインクリメントする。
In step Q5, the pitch of the input voice signal is detected, and the detected pitch is added to the pitch register F in step Q6. In step Q7, the counter N is incremented.

【0047】ストップスイッチが押されるまでの間は、
ピッチレジスタFにマイクから逐次入力される音声信号
のピッチが累算されていく。ピッチが累算される度にカ
ウンタNはインクリメントされるので、カウンタNには
ピッチレジスタFにピッチが累算された数が格納され
る。
Until the stop switch is pressed,
The pitch of the voice signal sequentially input from the microphone to the pitch register F is accumulated. Since the counter N is incremented each time the pitch is accumulated, the counter N stores the number of accumulated pitches in the pitch register F.

【0048】その後ステップQ10において、フラグQ
が1か否かを調べる。フラグQは、次に説明する割り込
み処理により値が決定される。図4は、CPUが行う割
り込み処理を示すフローチャートである。CPUは、タ
イマから例えば16分長(16分音符の時間長)の所定
の時間間隔で割り込み信号を受ける。CPUは、割り込
み信号を受けると以下の割り込み処理を行う。ここで、
割り込み処理は16分長間隔で行われるとする。
Thereafter, in step Q10, the flag Q
Check whether is 1. The value of the flag Q is determined by the interrupt processing described below. FIG. 4 is a flowchart showing an interrupt process performed by the CPU. The CPU receives an interrupt signal from the timer at a predetermined time interval of, for example, 16 minutes (time length of 16th note). Upon receiving the interrupt signal, the CPU performs the following interrupt processing. here,
It is assumed that interrupt processing is performed at 16-minute intervals.

【0049】まず、ステップR1においてフラグQを1
にセットする。そして、ステップR2において、クリッ
ク音を発生する。その後、割り込み処理を終了して、元
の音声入力の処理を再開する。
First, in step R1, the flag Q is set to 1
Set to. Then, in step R2, a click sound is generated. After that, the interrupt processing is ended and the processing of the original voice input is restarted.

【0050】以上のように、割り込み処理では16分長
間隔でフラグQを1にセットして、クリック音を発生す
る。クリック音は、メトロノームの役割を果たす。マイ
クから音声信号を入力する際には、16分長毎に鳴るク
リック音のテンポに合わせて入力を行えばよい。
As described above, in the interrupt process, the flag Q is set to 1 at 16-minute intervals and a click sound is generated. The click sound plays the role of a metronome. When a voice signal is input from the microphone, the input may be performed in accordance with the tempo of the click sound that sounds every 16 minutes.

【0051】図3のステップQ10では、16分長が経
過した時にフラグQが1であると判断され、ステップQ
11へ進む。ステップQ11では、カウンタNが0より
大きいか否かを調べる。カウンタNには、16分長の間
に量子化してピッチを検出した数が格納されている。も
し、マイクからの入力音声信号が16分長の間ずっと無
音状態であると判断されたときには、カウンタNは0を
示す。
In step Q10 of FIG. 3, it is determined that the flag Q is 1 when 16 minutes have passed, and step Q10
Proceed to 11. In step Q11, it is checked whether the counter N is larger than 0. The counter N stores the number of pitches detected by quantization during 16 minutes. If it is determined that the input audio signal from the microphone is silent for 16 minutes, the counter N shows 0.

【0052】上述のように、マイクに適正な音声入力が
されている際、カウンタNには1以上の数が格納されて
いるので、ステップQ12へ進む。ステップQ12で
は、次式により平均ピッチを求め、平均ピッチレジスタ
AFに格納する。
As described above, when a proper voice is input to the microphone, since the counter N stores a number of 1 or more, the process proceeds to step Q12. In step Q12, the average pitch is calculated by the following equation and stored in the average pitch register AF.

【0053】AF=F/N ピッチレジスタFには、16分長の間に検出されたピッ
チの累算値が格納されている。ピッチの累算値Fを量子
化数Nで割ることにより、ピッチの平均値AFを求める
ことができる。その後、ステップQ14へ進む。
AF = F / N The pitch register F stores the accumulated value of the pitch detected during the 16-minute length. By dividing the cumulative value F of pitches by the quantization number N, the average value AF of pitches can be obtained. Then, it progresses to step Q14.

【0054】一方、ステップQ11において、16分長
の間無音の音声入力状態が続いたときにはカウンタNが
0であるので、ステップQ13へ進む。ステップQ13
では、平均ピッチレジスタAFにオール1を格納する。
その後、ステップQ14へ進む。オール1とは、レジス
タを構成するビットを全て1にするような値を示す。平
均ピッチレジスタAFにオール1が格納されていれば、
16分長の無音状態である16分休符がマイクから入力
されたことになる。
On the other hand, in step Q11, when the silent voice input state continues for 16 minutes, the counter N is 0, so the routine proceeds to step Q13. Step Q13
Then, all 1s are stored in the average pitch register AF.
Then, it progresses to step Q14. All 1 indicates a value that makes all the bits configuring the register 1s. If all 1s are stored in the average pitch register AF,
The 16-minute rest, which is a 16-minute silent state, is input from the microphone.

【0055】ステップQ14では、求められた平均ピッ
チAFを配列メモリMEM(I)に格納する。カウンタ
Iは、初期設定にて0に設定されているので、平均ピッ
チAFは0番目の配列番号のメモリMEM(0)に格納
される。カウンタIは、求められた平均ピッチの番号を
示し、時間経過と共に0から順番に増加していく。
At step Q14, the calculated average pitch AF is stored in the array memory MEM (I). Since the counter I is initially set to 0, the average pitch AF is stored in the memory MEM (0) of the 0th array element number. The counter I indicates the obtained average pitch number, and sequentially increases from 0 with the passage of time.

【0056】ステップQ15では、カウンタIをインク
リメントして、次の平均ピッチの配列番号をセットす
る。ステップQ16では、ピッチレジスタF、カウンタ
N、フラグQのそれぞれに0をセットして、次の平均ピ
ッチを求めるための初期設定を行う。その後、図2のメ
インルーチンの処理に戻り、ストップスイッチが押され
るまで、以上の平均ピッチを求める処理を繰り返し行
う。
At step Q15, the counter I is incremented to set the array number of the next average pitch. In step Q16, 0 is set in each of the pitch register F, the counter N, and the flag Q, and initial setting for obtaining the next average pitch is performed. After that, the process returns to the process of the main routine of FIG. 2 and the process of obtaining the average pitch is repeated until the stop switch is pressed.

【0057】次に、マイクからの入力音声が無音状態に
なったときの処理を説明する。ステップQ2において、
前回時に適正な音声入力があれば、キーオンフラグKO
Nは1になっているので、ステップQ8へ進む。音声入
力レベルがしきい値#2よりも小さい値になっていれ
ば、ステップQ8で無音状態であると判断され、ステッ
プQ9へ進む。ステップQ9では、キーオンフラグKO
Nを0にして、ピッチ検出を行わないでステップQ10
へ進む。ステップQ10では、前述のように16分長毎
の平均ピッチを求める処理を行う。
Next, the processing when the voice input from the microphone becomes silent will be described. In step Q2,
If there was a proper voice input at the previous time, the key-on flag KO
Since N is 1, the process proceeds to step Q8. If the voice input level is smaller than the threshold value # 2, it is determined in step Q8 that there is no sound, and the process proceeds to step Q9. In step Q9, the key-on flag KO
If N is set to 0 and pitch detection is not performed, step Q10
Go to. In step Q10, the process of obtaining the average pitch for every 16 minutes is performed as described above.

【0058】以上のように、マイクから適正な音声入力
があったときには、16分長の範囲内で入力音声信号の
量子化を行い、量子化された信号毎のピッチを検出す
る。そして、検出されたピッチの累算値Fを量子化数N
で割ることにより、平均ピッチAFを求める。
As described above, when there is a proper voice input from the microphone, the input voice signal is quantized within a 16-minute length range, and the pitch of each quantized signal is detected. Then, the accumulated value F of the detected pitch is converted into the quantization number N
The average pitch AF is obtained by dividing by.

【0059】人の歌声等は、音声信号の揺れが大きいの
で、音声信号の局所的なピッチを検出するとピッチが頻
繁に変化し、ピッチの誤認識が生じやすい。そこで、入
力された音声信号を量子化して、量子化毎のピッチを検
出した後に平均ピッチを求めることにより、正しいピッ
チを検出することができる。求められた平均ピッチは配
列メモリMEM()に格納される。
Since the voice signal has a large fluctuation in human singing voice and the like, when the local pitch of the voice signal is detected, the pitch is frequently changed, and erroneous recognition of the pitch is likely to occur. Therefore, the correct pitch can be detected by quantizing the input voice signal, detecting the pitch for each quantization, and then obtaining the average pitch. The calculated average pitch is stored in the array memory MEM ().

【0060】図5は、メモリMEM()の構成例を示
す。メモリMEM()には、時間経過と共に求められた
平均ピッチが順番に格納されている。メモリ領域15に
は、求められた平均ピッチを示す周波数が格納されてい
る。平均ピッチは、16分長の間に適正な音声入力があ
ったときに求められるピッチの平均値である。
FIG. 5 shows a configuration example of the memory MEM (). The memory MEM () sequentially stores the average pitch obtained over time. The memory area 15 stores a frequency indicating the obtained average pitch. The average pitch is an average value of pitches obtained when a proper voice input is made within 16 minutes.

【0061】メモリ領域16には、オール1のデータが
格納されている。オール1のデータは、無音の音声入力
が16分長の間中続いたときに格納されるデータであ
り、16分休符を示す。
The memory area 16 stores all 1's data. The all-1 data is data stored when silent voice input continues for 16 minutes, and indicates a 16-minute rest.

【0062】メモリMEM()に格納されている周波数
は、16分音符のピッチを示す周波数である。ただし、
オール1が格納されているときには、16分音符のピッ
チを示すのではなく16分休符を意味する。
The frequency stored in the memory MEM () is a frequency indicating the pitch of a sixteenth note. However,
When all 1's are stored, it means a 16th rest instead of indicating the pitch of a 16th note.

【0063】エンドコード17は、ストップスイッチが
押されて、全ての音声入力が終了した後に、図2のステ
ップP5においてメモリMEM()中の最後の領域に格
納される。エンドコード17は、メモリMEM()に連
続して格納されている平均ピッチのデータの終了である
ことを示す。
The end code 17 is stored in the last area of the memory MEM () in step P5 of FIG. 2 after the stop switch has been pressed and all voice input has been completed. The end code 17 indicates the end of the average pitch data continuously stored in the memory MEM ().

【0064】図6は、図2のメインルーチン中のステッ
プP6で行うキーコード変換の処理の詳細を示すフロー
チャートである。キーコード変換は、メモリMEM()
に格納されている平均ピッチの周波数からキーコードへ
の変換を行う処理である。
FIG. 6 is a flow chart showing details of the key code conversion process performed in step P6 in the main routine of FIG. Key code conversion is performed in the memory MEM ()
This is a process for converting the frequency of the average pitch stored in the key code into a key code.

【0065】ステップS1では、平均ピッチ周波数が格
納されているメモリMEM()の中において最低の周波
数を示す平均ピッチを抽出し、最低周波数レジスタFm
inにその最低周波数を格納する。
In step S1, the average pitch showing the lowest frequency in the memory MEM () in which the average pitch frequency is stored is extracted, and the lowest frequency register Fm is extracted.
The lowest frequency is stored in in.

【0066】ステップS2では、メモリMEM()に格
納されている周波数を読み出し、レジスタFに格納す
る。そして、次式の計算により相対キーコードKCを求
める。 KC=12log2 (F/Fmin) 相対キーコードKCは、通常のセントの1/100の値
を示すものであり、最低周波数Fminを基準にして、
周波数Fがどれだけ高いのか又は低いのかを示す。周波
数Fが最低周波数Fminと同じ値であれば相対キーコ
ードKCは0になり、周波数Fが最低周波数Fminよ
りも半音高ければ相対キーコードKCは1になる。
In step S2, the frequency stored in the memory MEM () is read and stored in the register F. Then, the relative key code KC is obtained by the calculation of the following equation. KC = 12log 2 (F / Fmin) Relative key code KC indicates a value of 1/100 of the normal cent, and with the lowest frequency Fmin as a reference,
It shows how high or low the frequency F is. If the frequency F has the same value as the minimum frequency Fmin, the relative key code KC becomes 0, and if the frequency F is semitone higher than the minimum frequency Fmin, the relative key code KC becomes 1.

【0067】求められた相対キーコードKCは、周波数
が元々格納されていたメモリMEM()に再び格納され
る。同様にして、メモリMEM()に格納されている全
ての周波数を相対キーコードKCに変換する。メモリM
EM()には、最低周波数をFminを基準とした1/
100のセント表現が格納される。
The obtained relative key code KC is stored again in the memory MEM () where the frequency was originally stored. Similarly, all the frequencies stored in the memory MEM () are converted into the relative key code KC. Memory M
In EM (), the lowest frequency is 1 / based on Fmin.
100 cent representations are stored.

【0068】ステップS3では、最低周波数Fminを
その周波数に最も近いキーコードに変換し、最低周波数
のキーコードをレジスタKCminに格納する。例え
ば、周波数が440〔Hz〕であったとすればA4のキ
ーコードに変換して、レジスタKCminに格納する。
In step S3, the lowest frequency Fmin is converted into a key code closest to the frequency, and the lowest frequency key code is stored in the register KCmin. For example, if the frequency is 440 [Hz], it is converted into an A4 key code and stored in the register KCmin.

【0069】ステップS4では、メモリMEM()に格
納されている相対キーコードを読み出し、レジスタKC
に格納する。そして、次式の計算によりキーコードKを
求める。
In step S4, the relative key code stored in the memory MEM () is read out and stored in the register KC.
To store. Then, the key code K is obtained by the calculation of the following equation.

【0070】K=KC+KCmin キーコードKは、基準となる最低キーコードKCmin
に相対キーコードKCを加算することによりえられる絶
対キーコードである。
K = KC + KCmin The key code K is the lowest reference key code KCmin.
It is an absolute key code obtained by adding the relative key code KC to.

【0071】求められたキーコードKは、相対キーコー
ドが元々格納されていたメモリMEM()に再び格納さ
れる。同様にして、メモリMEM()に格納されている
全ての相対キーコードを絶対キーコードKに変換する。
メモリMEM()には、16分長毎のキーコードが格納
される。その後、図2のメインルーチンの処理に戻る。
The obtained key code K is stored again in the memory MEM () where the relative key code was originally stored. Similarly, all the relative key codes stored in the memory MEM () are converted into absolute key codes K.
The memory MEM () stores a key code for every 16 minutes. Then, the process returns to the main routine of FIG.

【0072】図7は、図2のメインルーチン中のステッ
プP7の調内キーコードへの修正処理の詳細を示すフロ
ーチャートである。ステップT1では、マイクから連続
して入力される音声信号の集合を楽曲とみなして、その
楽曲の調を検出する。データメモリには、調の構成音を
示す音名データが格納されている。
FIG. 7 is a flow chart showing the details of the correction processing for the in-key key code in step P7 in the main routine of FIG. In step T1, a set of audio signals continuously input from the microphone is regarded as a musical piece, and the key of the musical piece is detected. In the data memory, note name data indicating the constituent notes of the key are stored.

【0073】図8は、データメモリに格納されている調
の構成音の音名データを示す。調は、12音名(C,C
♯,・・・,B)をそれぞれ主音としたときの長調およ
び短調がそれぞれあり、それぞれの調についてのデータ
がデータメモリに格納されている。なお、より細かい調
に分けて格納してもよい。
FIG. 8 shows the note name data of the constituent tones stored in the data memory. Key is 12 note names (C, C
There are major and minor keys respectively when #, ..., B) are tones, and data for each key is stored in the data memory. In addition, you may divide and store in a finer tone.

【0074】例えば、C長調のメモリ領域21には、C
長調の構成音であるC,D,E,F,G,A,Bのコー
ドが格納されている。同様に、C♯長調のメモリ領域2
2には、C♯長調の構成音のコードが格納され、C短調
のメモリ領域23には、C短調の構成音のコードが格納
されている。
For example, in the C major memory area 21, C
The chords C, D, E, F, G, A, and B, which are major constituent tones, are stored. Similarly, memory area 2 in C # major
A code of a constituent sound of C # major is stored in 2, and a code of a constituent sound of C minor is stored in a memory area 23 in C minor.

【0075】調検出は、メモリMEM()に格納されて
いるキーコードが上記のデータメモリに記憶されている
調の中でどの調に一番合致するかを調べる。メモリME
M()のキーコードとデータメモリ中の調の構成音を比
較して、最も一致度の高い調を入力音声信号の調とす
る。
In the key detection, it is checked which key among the keys stored in the data memory the key code stored in the memory MEM () best matches. Memory ME
The key code of M () is compared with the constituent tones of the key in the data memory, and the key with the highest degree of coincidence is used as the key of the input voice signal.

【0076】主音レジスタTNには、検出された調の主
音(C,C♯,D等)を格納する。モードレジスタMD
には、検出された調のモード(長調または短調)を格納
する。調検出が行われた後、ステップT2へ進む。
The tonic register TN stores tones (C, C #, D, etc.) of the detected key. Mode register MD
Stores the detected key mode (major or minor). After the key detection is performed, the process proceeds to step T2.

【0077】なお、調検出の方法は、上述の方法に限ら
れず他の方法により調検出を行ってもよい。ステップT
2では、検出された調を用いて、キーコードを構成音に
丸め込む処理を行う。入力音声信号に対応するキーコー
ドが検出された調の構成音ではない場合、キーコードを
構成音のキーコードに正す。処理の詳細な説明を次に示
す。
The key detection method is not limited to the above-mentioned method, and the key detection may be performed by another method. Step T
In step 2, the detected key is used to round the key code into the constituent sounds. When the key code corresponding to the input voice signal is not the constituent sound of the detected key, the key code is corrected to the key code of the constituent sound. A detailed description of the process is given below.

【0078】図9は、図7のステップT2の調内音丸め
込み処理の詳細を示すフローチャートである。まず、基
準となる楽曲の最後の音の丸め込みを行い、その後に残
りの音の丸め込みを行う。その処理手順を以下に説明す
る。
FIG. 9 is a flow chart showing details of the in-tone tone rounding processing in step T2 of FIG. First, the last sound of the reference music is rounded, and then the remaining sounds are rounded. The processing procedure will be described below.

【0079】ステップU1では、メモリMEM()のm
番目(メモリMEM()のキーコードに順についてい
る、1番最後に格納されているキーコードの番号)のキ
ーコードを読み出す。
At step U1, m of the memory MEM () is stored.
The second (the key code number stored in the memory MEM () and the last stored key code number) key code is read.

【0080】ステップU2では、読み出したキーコード
が調内音(検出された調の構成音)であるか否かを調べ
る。調内音であれば、正しく検出されたキーコードであ
ると判断して、ステップU6へ進み、読み出したキーコ
ードそのものをレジスタKCに格納する。その後、ステ
ップU7へ進む。
In step U2, it is checked whether or not the read key code is an in-tone (constant tone of the detected tone). If it is an in-tone, it is determined that the key code has been correctly detected, and the process proceeds to step U6 to store the read key code itself in the register KC. Then, it progresses to step U7.

【0081】一方、読み出したキーコードが調内音でな
ければ、誤認識により検出されたキーコードであると判
断して、ステップU3へ進む。ステップU3では、読み
出されたm番目のキーコードを調内音に丸め込む処理を
行う。まず、読み出されたキーコードをそのキーコード
に最も近い調内音に変換する。もし、同じ位の近さの調
内音が複数あれば、次の優先順位に従った調内音に変換
する。
On the other hand, if the read key code is not an in-tone, it is determined that it is a key code detected by erroneous recognition, and the process proceeds to step U3. In step U3, the read m-th key code is rounded to the in-tone. First, the read key code is converted into an in-tone tone that is closest to the key code. If there are a plurality of intones that are close to each other, they are converted into intones according to the next priority.

【0082】 1度>5度>3度>2度>6度>7度>4度 例えば、検出された調がC長調であるとすると1度の音
がCであり、5度の音がGであり、3度の音がEであ
る。1度の音が最優先であり、続いて5度、3度、・・
・の順の調内音に変換される。
1 degree> 5 degrees> 3 degrees> 2 degrees> 6 degrees> 7 degrees> 4 degrees For example, if the detected key is C major, one tone is C and five tones are It is G, and the third tone is E. 1st sound is the highest priority, followed by 5th, 3rd, ...
・ It is converted into the internal tone in the order of.

【0083】楽曲の最後の音は、一般的にその調の1度
の音で終わり易いという規則がある。したがって、1度
の音を最優先し、続いて最後の音に成りやすい5度、3
度、・・・の順の音を優先させて変換を行う。そして、
ステップU4において、調内音に変換されたキーコード
をレジスタKCに格納する。
There is a rule that the last note of a musical composition is likely to end with one note of that key. Therefore, the 1st sound is given the highest priority, and then the 5th, 3
Conversion is performed by prioritizing the sounds in the order of degrees, ... And
In step U4, the key code converted into the in-tone is stored in the register KC.

【0084】ステップU5では、レジスタKCに格納さ
れているキーコードを元のキーコードを読み出した配列
番号のメモリMEM()に記憶し直す。レジスタKCに
は、調内音に修正されたキーコードが格納されている。
ただし、検出されたキーコードが調内音であるときに
は、正しい認識が行われたとして修正を行わずに検出さ
れたキーコードそのものがレジスタKCに格納されてい
る。
At step U5, the key code stored in the register KC is stored again in the memory MEM () of the array number from which the original key code is read. In the register KC, the key code corrected to the in-tone is stored.
However, when the detected key code is an in-tone tone, it is determined that the correct recognition is performed and the detected key code itself is stored in the register KC without correction.

【0085】ステップU7では、番号レジスタmをデク
リメントする。番号mの値を1小さくすることにより、
時間的に1つ前の音を表す番号mに変えることができ
る。番号mが示す1つ前の音についての処理を次に行
う。
At step U7, the number register m is decremented. By reducing the value of number m by 1,
It can be changed to the number m representing the immediately preceding sound. The process for the previous sound indicated by the number m is performed next.

【0086】ステップU8では、メモリMEM()に格
納されているm番目のキーコードを読み出す。読み出さ
れたキーコードは最後から2番目の音である。ステップ
U9では、読み出したキーコードが調内音であるか否か
を調べる。調内音であれば、正しく検出されたキーコー
ドであると判断して、メモリMEM()のm番目のキー
コードを修正せずにステップU14へ進み、レジスタK
Cにキーコードを格納した後にステップU13へ進む。
At step U8, the m-th key code stored in the memory MEM () is read. The read key code is the penultimate sound. In step U9, it is checked whether the read key code is an in-tone tone. If it is an in-tone, it is determined that the key code has been correctly detected, the process proceeds to step U14 without correcting the m-th key code of the memory MEM (), and the register K
After storing the key code in C, the process proceeds to step U13.

【0087】一方、読み出したキーコードが調内音でな
ければ、誤認識により検出されたキーコードであると判
断して、ステップU10へ進む。ステップU10では、
読み出したm番目のキーコードを調内音に丸め込む処理
を行う ステップU10では、読み出したキーコードをそのキー
コードに最も近い調内音に変換する。もし、同じ位の近
さの調内音が複数あるときには、レジスタKCに格納さ
れているキーコードに最も近い調内音に変換する。
On the other hand, if the read key code is not an in-tone, it is determined that it is a key code detected by erroneous recognition, and the process proceeds to step U10. In step U10,
A process of rounding the read m-th key code to an in-tone is performed In step U10, the read key code is converted into an in-tone that is closest to the key code. If there are a plurality of intones that are close to each other, they are converted into intones that are closest to the key code stored in the register KC.

【0088】レジスタKCには、ステップU4またはス
テップU6のいずれかで格納されたキーコードが記憶さ
れている。つまり、楽曲の最後の音の修正後のキーコー
ドが記憶されている。その最後の音のキーコードに最も
近いキーコードに優先的に変換される。
The register KC stores the key code stored in either step U4 or step U6. That is, the corrected key code of the last sound of the music is stored. The key code closest to the key code of the last sound is converted preferentially.

【0089】ステップU11では、調内音に修正変換さ
れたキーコードをレジスタKCに格納し、ステップU1
2でレジスタKCに格納されたキーコードをメモリME
M()の元の記憶場所に記憶し直す。
In step U11, the key code corrected and converted into the in-tone is stored in the register KC, and step U1
2 stores the key code stored in the register KC in the memory ME
Restore in the original memory location of M ().

【0090】ステップU13では、番号mが1であるか
否かを調べる。番号mが1であるということは、楽曲の
1番最初の音(最初にマイクから入力された音声信号の
音)についての調内音への修正処理を終了したことを示
す。修正処理は、楽曲の最後の音から最初の音まで順番
に行っているので、最初の音についての処理が終了すれ
ば、全ての音についての処理が終了したことになる。
In step U13, it is checked whether or not the number m is 1. The fact that the number m is 1 indicates that the correction process of the first sound of the music (the sound of the audio signal first input from the microphone) to the in-tone is completed. Since the correction process is performed in order from the last sound to the first sound of the music, when the processing for the first sound is completed, the processing for all the sounds is completed.

【0091】番号mが1でなければ、ステップU7へ戻
り、番号mをデクリメントして1つ前の音のキーコード
についての修正処理を繰り返す。メモリMEM()のm
番目のキーコードを読み出し、読み出したキーコードが
調内音であればキーコードの修正を行わない。読み出し
たキーコードが調内音でなければ、最も近い調内音のキ
ーコードに変換を行う。近い調内音が複数あるときに
は、1つ前の音の修正後のキーコードに近いキーコード
に優先的に変換する。
If the number m is not 1, the process returns to step U7, the number m is decremented, and the correction process for the key code of the preceding sound is repeated. Memory MEM () m
The second key code is read out, and if the read key code is within the tone, the key code is not corrected. If the read key code is not the in-tone, the key code of the closest in-tone is converted. When there are a plurality of similar in-tone tones, the key code close to the corrected key code of the preceding sound is preferentially converted.

【0092】楽曲の最後の音の優先順位は、前述のよう
に調の1度、5度の音等を基準にして決めたが、最後の
音以外の音の優先順位は、1つ前の音のキーコードに近
い音に優先して、キーコードを決める。最後の音のみ
は、調に関連した音になり易いからである。
As described above, the priority of the last note of the music is determined on the basis of the 1st and 5th notes of the key, but the priority of the notes other than the last note is the previous one. The key code is decided by giving priority to the sound close to the key code of the sound. This is because only the last sound is likely to be a key-related sound.

【0093】以上の修正処理により、誤認識されたキー
コードが修正されるとメモリMEM()に格納される。
修正処理が終了すると、図7の元の処理に戻る。なお、
以上のキーコードの修正処理では、全ての調外音を調内
音に修正する場合について述べたが、必ずしも全てを修
正する必要はない。例えば、1小節内でのみ効力を有す
る♯,♭等の臨時記号を用いて部分的に調外音を用いた
い場合もある。そのような場合には、検出された調にお
いて特に使用が禁止されている音(音名)のみを禁止さ
れていない音に修正するようにしてもよい。
When the erroneously recognized key code is corrected by the above correction processing, it is stored in the memory MEM ().
When the correction process is completed, the process returns to the original process of FIG. 7. In addition,
In the above key code correction processing, the case has been described in which all out-of-tune tones are corrected into in-tone sounds, but it is not necessary to correct all. For example, there is a case where it is desired to partially use the extratone by using accidentals such as # and ♭ which are effective only within one measure. In such a case, in the detected key, only the prohibited sound (note name) may be corrected to the prohibited sound.

【0094】また、調を用いてキーコードを修正する他
に、スケールの検出を行い使用する音高の幅を複数検出
し、検出された音高の幅より外の音については所定の音
高幅内の音に修正する処理を行ってもよい。スケールは
調性と和音によって定まり、スケールによって使用され
る音名が決まるので、この音名に対応する音高にそれぞ
れ幅を持たせることにより、使用される音高の幅が求め
られる。
In addition to correcting the key code by using the key, a scale is detected to detect a plurality of pitch ranges to be used, and a pitch outside the detected pitch range has a predetermined pitch. You may perform the process which corrects to the sound within width. Since the scale is determined by the tonality and chord, and the pitch name used is determined by the scale, the pitch range used can be determined by giving each pitch corresponding to this pitch a width.

【0095】図10は、図2のメインルーチン中のステ
ップP8の演奏データ変換処理の詳細を示すフローチャ
ートである。演奏データ変換は、入力音声信号から検出
されたキーコードを基にして、発音可能な演奏データ形
式への変換を行う。
FIG. 10 is a flow chart showing details of the performance data conversion process of step P8 in the main routine of FIG. The performance data conversion is performed based on the key code detected from the input voice signal and converted into a performance data format capable of producing sound.

【0096】ステップV1では、配列番号レジスタP、
デュレーションレジスタD、キーオンフラグKONにそ
れぞれ0をセットする。配列番号レジスタPは、キーコ
ードが格納されているメモリMEM()の配列番号を示
す。デュレーションレジスタDは、同一のキーコードを
発音し続ける持続時間または発音を行わない休符状態の
時間を格納する。キーオンフラグKONは、何らかのキ
ーコードを発音中であるときに1となり、いずれのキー
コードをも発音しないときには0となる。
At step V1, the array element number register P,
The duration register D and the key-on flag KON are set to 0, respectively. The array number register P indicates the array number of the memory MEM () in which the key code is stored. The duration register D stores a duration time during which the same key code is continuously sounded or a rest time time during which no sound is generated. The key-on flag KON becomes 1 when any key code is being sounded and becomes 0 when no key code is sounded.

【0097】ステップV2では、演奏データメモリ中の
書き込み位置を示す書き込みポインタを演奏データメモ
リの先頭にセットし、最初の演奏データの書き込みの準
備を行う。
In step V2, a write pointer indicating the writing position in the performance data memory is set at the beginning of the performance data memory to prepare for writing the first performance data.

【0098】ステップV3では、メモリMEM(P)に
エンドコードが格納されているか否かを調べる。配列番
号Pは、初期設定で0に設定されている。メモリMEM
()には、入力音声信号から検出された後に必要に応じ
て修正が行われたキーコードが格納されている。もし、
メモリMEM()にエンドコードが格納されていれば、
その配列番号の位置で音声入力が終了していることを示
す。
In step V3, it is checked whether the end code is stored in the memory MEM (P). The array element number P is set to 0 by default. Memory MEM
In (), a key code which is corrected as needed after being detected from the input voice signal is stored. if,
If the end code is stored in the memory MEM (),
Indicates that voice input is completed at the position of that array number.

【0099】メモリMEM(P)にエンドコードが格納
されていなければ、ステップV4へ進み、メモリMEM
(P)に格納されているキーコードを基にして演奏デー
タに変換する。配列番号Pについての演奏データ変換方
法は、後に説明する。
If the end code is not stored in the memory MEM (P), the process proceeds to step V4 and the memory MEM (P) is reached.
Based on the key code stored in (P), it is converted into performance data. The performance data conversion method for the array element number P will be described later.

【0100】メモリMEM(P)のキーコードについて
演奏データが生成された後には、ステップV5へ進み、
配列番号レジスタPをインクリメントして次の配列番号
についての演奏データの生成に備える。また、デュレー
ションレジスタDをインクリメントして発音の持続時間
をカウントする。デュレーションレジスタDが1増える
と、16分長の長さだけ持続時間が増加する。メモリM
EM()には、16分長毎にキーコードが格納されてい
るからである。
After the performance data is generated for the key code of the memory MEM (P), the process proceeds to step V5,
The array number register P is incremented to prepare for the generation of performance data for the next array number. Also, the duration register D is incremented to count the duration of sound generation. Increasing the duration register D by 1 increases the duration by a length of 16 minutes. Memory M
This is because the key code is stored in EM () every 16 minutes.

【0101】その後、ステップV3へ戻り、次の配列番
号Pに格納されているキーコード(MEM(P))がエ
ンドコードであるか否かを調べる。エンドコードでなけ
れば、ステップV4へ進み、メモリMEM(P)に格納
されているキーコードを基にして演奏データの生成を行
う。そして、ステップV5において、配列番号レジスタ
PとデュレーションレジスタDをそれぞれインクリメン
トする。
Then, the process returns to step V3, and it is checked whether the key code (MEM (P)) stored in the next array element number P is the end code. If it is not an end code, the process proceeds to step V4, and performance data is generated based on the key code stored in the memory MEM (P). Then, in step V5, the array number register P and the duration register D are each incremented.

【0102】デュレーションレジスタDには、同一のキ
ーコードが連続してメモリMEM()に格納されている
数が記憶される。例えば、A4のキーコードが1つだけ
現れて次にはキーコードが変わってしまうときには、デ
ュレーションレジスタDに1が格納され、A4の16分
音符を示す。また、A4のキーコードが2つ連続して続
けば、デュレーションレジスタDには2が格納され、A
4の8分音符を示す。
The duration register D stores the number of consecutive identical key codes stored in the memory MEM (). For example, when only one key code of A4 appears and the key code changes next time, 1 is stored in the duration register D to indicate the 16th note of A4. If two A4 key codes continue in succession, 2 is stored in the duration register D and A
The eighth note of 4 is shown.

【0103】ステップV3において、メモリMEM
(P)にエンドコードが格納されていると判断されたと
きには、キーコードの終了を示すので、ステップV6へ
進む。ステップV6では、キーオンフラグKONが1で
あるか否かを調べる。キーオンフラグKONが1であれ
ば、現在いずれかのキーコードを発音中であるこを演奏
データが示しているので、ステップV7へ進む。
In step V3, the memory MEM
If it is determined that the end code is stored in (P), this indicates the end of the key code, and the process proceeds to step V6. In step V6, it is checked whether or not the key-on flag KON is 1. If the key-on flag KON is 1, the performance data indicates that one of the key codes is currently being sounded, so the process proceeds to step V7.

【0104】ステップV7では、現在発音中のキーコー
ドについての発音持続時間を示すデュレーションレジス
タDの値をデュレーションコードと共に演奏データメモ
リに書き込む。デュレーションコードは、演奏データメ
モリにおいて、発音持続時間を示すデュレーションレジ
スタDのデータが次に続くことを示すコードであり、デ
ュレーションコードとデュレーションレジスタDのデー
タは、必ず組で演奏データメモリに書き込まれる。書き
込みを終了した後、演奏データメモリへの書き込みポイ
ンタを進めて次の書き込みの準備をする。
In step V7, the value of the duration register D indicating the sounding duration of the key code currently being sounded is written in the performance data memory together with the duration code. The duration code is a code indicating that the data of the duration register D indicating the sounding duration continues in the performance data memory, and the duration code and the data of the duration register D are always written in the performance data memory as a set. After the writing is completed, the write pointer to the performance data memory is advanced to prepare for the next writing.

【0105】ステップV8では、発音の終了を示すキー
オフコードと演奏データの終了を示すエンドコードを演
奏データメモリに書き込む。書き込みを終了した後、演
奏データの生成を終了して図2のメインルーチンの処理
に戻る。
At step V8, a key-off code indicating the end of tone generation and an end code indicating the end of performance data are written in the performance data memory. After the writing is finished, the performance data generation is finished and the process returns to the main routine of FIG.

【0106】ステップV6において、キーオンフラグK
ONが1でないと判断されたときには、現在発音中では
ないことを示すので、ステップV9へ進み、エンドコー
ドのみを演奏データメモリに書き込む。書き込みを終了
した後、図2のメインルーチンの処理へ戻る。
At step V6, the key-on flag K
When it is judged that ON is not 1, it means that the note is not being sounded at present, so the routine proceeds to step V9, and only the end code is written in the performance data memory. After the writing is completed, the process returns to the process of the main routine of FIG.

【0107】図11は、図10のステップV4における
演奏データ変換処理の詳細を示すフローチャートであ
る。メモリMEM(P)にエンドコードではなく、キー
コードが格納されているときに、メモリMEM(P)の
キーコードを基にして演奏データに変換する手順を示
す。
FIG. 11 is a flow chart showing details of the performance data conversion process in step V4 of FIG. When the key code is stored in the memory MEM (P) instead of the end code, the procedure for converting into the performance data based on the key code in the memory MEM (P) is shown.

【0108】ステップW1では、メモリMEM(P)に
オール1が格納されているか否かを調べる。オール1が
格納されていれば、入力が無音状態であることを示す。
メモリMEM(P)にオール1が格納されていなけれ
ば、何らかのキーコードが記憶されているので、そのキ
ーコードを基にした演奏データを生成するためにステッ
プW2へ進む。
In step W1, it is checked whether or not all 1's are stored in the memory MEM (P). If all 1's are stored, it indicates that the input is silent.
If all 1's are not stored in the memory MEM (P), some key code is stored, so the process proceeds to step W2 to generate performance data based on the key code.

【0109】ステップW2では、キーオンフラグKON
が1であるか否かを調べる。キーオンフラグKONが1
でなければ、今までキーオフで発音状態でなかったの
で、ステップW6へ進み、キーオンフラグKONを1に
して、ステップW7へ進む。
At step W2, the key-on flag KON
Check whether is 1. Key-on flag KON is 1
If not, since the key is off and no sound is being generated, the process proceeds to step W6, the key-on flag KON is set to 1, and the process proceeds to step W7.

【0110】ステップW7では、前回のキーオフを示す
休符の長さを示すデュレーションコードとデュレーショ
ンレジスタDの値を書き込む。書き込みを終了した後、
演奏データメモリの書き込みポインタを進めて、ステッ
プW8へ進む。
In step W7, the duration code indicating the rest length indicating the previous key-off and the value of the duration register D are written. After finishing writing
The write pointer of the performance data memory is advanced, and the process proceeds to step W8.

【0111】ステップW8では、演奏データメモリに今
回のキーオンを示すキーオンコードとメモリMEM
(P)に格納されているキーコードを書き込む。書き込
みを終了した後、演奏データメモリの書き込みポインタ
を進めて、ステップW9へ進む。
At step W8, a key-on code indicating the current key-on and the memory MEM are stored in the performance data memory.
Write the key code stored in (P). After the writing is completed, the write pointer of the performance data memory is advanced, and the process proceeds to step W9.

【0112】ステップW9では、演奏データメモリに書
き込んだメモリMEM(P)のキーコードをレジスタK
Cに格納する。レジスタKCに格納されたキーコード
は、次の配列番号P+1の処理おいて、同じキーコード
が連続しているか否かの判断に用いられる。
At step W9, the key code of the memory MEM (P) written in the performance data memory is stored in the register K.
Store in C. The key code stored in the register KC is used to determine whether or not the same key code is consecutive in the processing of the next array element number P + 1.

【0113】ステップW10では、今回演奏データメモ
リにキーオンコードと共に書き込まれたキーコードの持
続時間をカウントし直すために、デュレーションレジス
タDを0にリセットする。その後、図10の処理へ戻
り、次の配列番号P+1についての演奏データの生成処
理を行う。
At step W10, the duration register D is reset to 0 in order to re-count the duration of the key code written together with the key-on code in the performance data memory this time. After that, the process returns to the process of FIG. 10 to perform the performance data generation process for the next array element number P + 1.

【0114】次に、前回演奏データメモリに書き込んだ
キーコードと同じキーコードがメモリMEM(P)に格
納されている場合について説明する。つまり、メモリM
EM(P)のキーコードとMEM(P−1)のキーコー
ドが同じ場合である。
Next, the case where the same key code as the key code written in the performance data memory last time is stored in the memory MEM (P) will be described. That is, the memory M
This is the case where the key code of EM (P) and the key code of MEM (P-1) are the same.

【0115】その場合、ステップW1において、メモリ
MEM(P)にオール1が格納されていないと判断さ
れ、さらにステップW2において、前回から引き続き今
回もキーオン中であると判断され、ステップW3へ進
む。
In this case, it is determined in step W1 that all 1's are not stored in the memory MEM (P), and further in step W2, it is determined that the key is still on from the previous time, and the process proceeds to step W3.

【0116】ステップW3では、メモリMEM(P)に
格納されているキーコードとレジスタKCに格納されて
いるキーコードが同じであるか否かを調べる。レジスタ
KCには、前回から引き続きキーオン中であるキーコー
ドが格納されている。
In step W3, it is checked whether or not the key code stored in the memory MEM (P) is the same as the key code stored in the register KC. The register KC stores a key code that has been key-on since the last time.

【0117】メモリMEM(P)のキーコードとレジス
タKCのキーコードが同じであれば、今回の配列番号P
についても前回と同じキーコードを引き続き発音するこ
とを示すので、演奏データメモリには何も書き込まず
に、図10の処理へ戻り、デュレーションレジスタDの
値のみをインクリメントして、キーコードの発音持続時
間をカウントする。
If the key code of the memory MEM (P) and the key code of the register KC are the same, the current array element number P
Also indicates that the same key code as the previous time is to be sounded, so nothing is written to the performance data memory, the process returns to the process of FIG. 10, only the value of the duration register D is incremented, and the key code continues to sound. Count the time.

【0118】次に、前回演奏データメモリに書き込んだ
キーコードと異なるキーコードがメモリMEM(P)に
格納されている場合について説明する。つまり、キーオ
ン中において、発音すべきキーコードが変化する場合で
ある。
Next, a case where a key code different from the key code written in the performance data memory last time is stored in the memory MEM (P) will be described. That is, this is a case where the key code to be sounded changes during key-on.

【0119】その場合、ステップW1において、メモリ
MEM(P)にオール1が格納されていないと判断さ
れ、さらにステップW2において、前回から引き続き今
回もキーオン中であると判断され、ステップW3へ進
む。
In this case, it is determined in step W1 that all 1's are not stored in the memory MEM (P), and further in step W2, it is determined that the key is still on from the previous time, and the process proceeds to step W3.

【0120】ステップW3では、メモリMEM(P)に
格納されているキーコードとレジスタKCに格納されて
いるキーコードが同じであるか否かを調べる。メモリM
EM(P)のキーコードとレジスタKCのキーコードが
同じでなければ、今回の配列番号Pについての発音指示
は前回のものとは異なるキーコードの発音を意味するの
で、ステップW4へ進む。
At step W3, it is checked whether or not the key code stored in the memory MEM (P) is the same as the key code stored in the register KC. Memory M
If the key code of EM (P) and the key code of the register KC are not the same, the sounding instruction for the array element number P this time means sounding of a key code different from the previous one, so the process proceeds to step W4.

【0121】ステップW4では、演奏データメモリに前
回までのキーコードの発音の持続時間を示すデュレーシ
ョンレジスタDの値をデュレーションコードと共に書き
込む。書き込みを終了した後、演奏データメモリの書き
込みポインタを進めて、次の書き込みに備える。
At step W4, the value of the duration register D indicating the duration of the key code sounding up to the last time is written in the performance data memory together with the duration code. After the writing is completed, the write pointer of the performance data memory is advanced to prepare for the next writing.

【0122】ステップW5では、前回のキーコードにつ
いての発音終了を示すキーオフコードを演奏データメモ
リに書き込み、演奏データメモリの書き込みポインタを
進める。
In step W5, a key-off code indicating the end of sounding of the previous key code is written in the performance data memory, and the write pointer of the performance data memory is advanced.

【0123】ステップW8では、今回のキーコードにつ
いての発音開始を示すキーオンコードとメモリMEM
(P)に格納されているキーコードを演奏データメモリ
に書き込み、演奏データメモリの書き込みポインタを進
める。
At step W8, the key-on code indicating the start of sounding for the current key code and the memory MEM are displayed.
The key code stored in (P) is written in the performance data memory, and the write pointer of the performance data memory is advanced.

【0124】その後、ステップW9においてメモリME
M(P)に格納されているキーコードをレジスタKCに
格納し、ステップW10においてデュレーションレジス
タDを0にリセットし、次の発音持続時間をカウントし
直す。そして、図10の処理に戻り、次の配列番号P+
1についての処理を行う。
Then, in step W9, the memory ME
The key code stored in M (P) is stored in the register KC, the duration register D is reset to 0 in step W10, and the next sounding duration time is counted again. Then, returning to the processing of FIG. 10, the next array element number P +
The process for 1 is performed.

【0125】次に、メモリMEM(P)にキーコードで
ななく無音状態(休符)を示すオール1が格納されてい
る場合の演奏データ生成手順を説明する。その場合、ス
テップW1において、メモリMEM(P)にオール1が
格納されていると判断され、ステップW11に進む。
Next, the performance data generation procedure when the memory MEM (P) stores not all the key codes but all 1s indicating a silent state (rest) will be described. In that case, it is determined in step W1 that all 1s are stored in the memory MEM (P), and the process proceeds to step W11.

【0126】ステップW11では、キーオンフラグKO
Nが1であるか否かを調べる。キーオンフラグKONが
1であれば、キーオフを指示するためにステップW12
へ進み、キーオンフラグKONを0にする。
At step W11, the key-on flag KO
Check whether N is 1. If the key-on flag KON is 1, step W12 is performed to instruct the key-off.
Then, the key-on flag KON is set to 0.

【0127】ステップW13では、演奏データメモリに
前回までのキーコードの発音の持続時間を示すデュレー
ションコードとデュレーションレジスタDの値を書き込
む。書き込みを終了した後、演奏データメモリの書き込
みポインタを進めて、次の書き込みに備える。
At step W13, the duration code indicating the duration of the key code sounding up to the last time and the value of the duration register D are written in the performance data memory. After the writing is completed, the write pointer of the performance data memory is advanced to prepare for the next writing.

【0128】ステップW14では、前回のキーコードに
ついての発音終了を示すキーオフコードを演奏データメ
モリに書き込み、演奏データメモリの書き込みポインタ
を進める。その後、ステップW10へ進みデュレーショ
ンレジスタDを0にリセットして、キーオフ後の休符の
持続時間をカウントし直す。そして、図10の処理へ戻
り、次の配列番号P+1についての処理を行う。
In step W14, a key-off code indicating the end of sounding of the previous key code is written in the performance data memory, and the write pointer of the performance data memory is advanced. Then, the process proceeds to step W10, the duration register D is reset to 0, and the duration of the rest after the key-off is counted again. Then, the process returns to the process of FIG. 10 and the process for the next array element number P + 1 is performed.

【0129】メモリMEM(P)にオール1が格納され
ていると判断した後において、ステップW11でキーオ
ンフラグKONが1でないと判断されたときには、キー
オフの状態が前回から引き続いていることを示すので、
演奏データメモリに何も書き込まずに図10の処理に戻
り、キーオフ中である休符の持続時間を示すデュレーシ
ョンレジスタDをインクリメントし、次の配列番号P+
1についての処理を行う。
After it is determined that all 1s are stored in the memory MEM (P), if it is determined in step W11 that the key-on flag KON is not 1, it indicates that the key-off state has continued from the previous time. ,
The process returns to the processing of FIG. 10 without writing anything in the performance data memory, increments the duration register D indicating the duration of the rest in the key-off, and the next array element number P +
The process for 1 is performed.

【0130】以上、演奏データの生成手順を述べたが、
演奏データの形式は上述の形式に限られず、MIDI形
式等の演奏データを生成するようにしてもよい。本実施
例は、マイクから入力される音声信号に対して、量子化
処理を行った後に平均ピッチを検出することにより、ピ
ッチの変動に対して悪影響を受けることなく、正しいピ
ッチを検出することができる。
The procedure for generating performance data has been described above.
The format of the performance data is not limited to the above-mentioned format, and performance data in the MIDI format or the like may be generated. In the present embodiment, by detecting the average pitch after performing the quantization process on the voice signal input from the microphone, it is possible to detect the correct pitch without being adversely affected by the fluctuation of the pitch. it can.

【0131】また、検出されたピッチに対して、調検出
により得られる調を用いて、誤認識により検出されたピ
ッチの修正を行う。調によって決まる音楽規則を利用し
て、ピッチの修正処理を行うことにより、認識率の高い
ピッチ検出を実現することができる。検出修正されたピ
ッチは、演奏データ変換処理を行うことにより、発音可
能な演奏データに変換される。
Further, for the detected pitch, the pitch detected by erroneous recognition is corrected using the key obtained by the key detection. Pitch detection with a high recognition rate can be realized by performing pitch correction processing using a music rule determined by the key. The detected and corrected pitch is converted into playable performance data by performing performance data conversion processing.

【0132】なお、本実施例では、入力された音声から
調を検出したが、スイッチ等を用いて演奏者が調を入力
するようにしてもよい。以上実施例に沿って本発明を説
明したが、本発明はこれらに制限されるものではない。
例えば、種々の変更、改良、組合わせ等が可能なことは
当業者に自明であろう。
In this embodiment, the key is detected from the input voice, but the player may input the key using a switch or the like. Although the present invention has been described above with reference to the embodiments, the present invention is not limited thereto.
For example, it will be apparent to those skilled in the art that various changes, improvements, combinations, and the like can be made.

【0133】[0133]

【発明の効果】入力された音声信号から検出した複数の
時間区間毎のピッチについての平均ピッチを求めること
により、ピッチの細かな変動による悪影響を減らすこと
ができる。平均化されたピッチを基にして音高情報を生
成することにより、正しい音高情報を得ることができ
る。
EFFECTS OF THE INVENTION By obtaining the average pitch of the pitches for each of a plurality of time intervals detected from the input voice signal, it is possible to reduce the adverse effect due to the fine fluctuation of the pitch. Correct pitch information can be obtained by generating pitch information based on the averaged pitch.

【0134】また、楽曲を構成する入力音声信号から検
出された音高情報を基にして調の検出を行った後に、検
出された調の音楽規則に応じて音高情報の修正を行う。
音高情報の修正を行うことにより、正しい音高情報を得
ることができる。
Further, after detecting the key based on the pitch information detected from the input voice signal constituting the music, the pitch information is corrected according to the music rule of the detected key.
Correct pitch information can be obtained by correcting the pitch information.

【図面の簡単な説明】[Brief description of drawings]

【図1】 本発明を実施するための音声信号変換装置の
システム構成例を示すブロック図である。
FIG. 1 is a block diagram showing a system configuration example of an audio signal conversion device for carrying out the present invention.

【図2】 入力変換処理のメインルーチンを示すフロー
チャートである。
FIG. 2 is a flowchart showing a main routine of input conversion processing.

【図3】 図2のステップP3における音声入力処理と
平均ピッチ検出処理の詳細を示すフローチャートであ
る。
FIG. 3 is a flowchart showing details of voice input processing and average pitch detection processing in step P3 of FIG.

【図4】 CPUが行う割り込み処理を示すフローチャ
ートである。
FIG. 4 is a flowchart showing interrupt processing performed by a CPU.

【図5】 メモリMEM()の構成例を示す概念図であ
る。
FIG. 5 is a conceptual diagram showing a configuration example of a memory MEM ().

【図6】 図2のメインルーチン中のステップP6で行
うキーコード変換の処理の詳細を示すフローチャートで
ある。
FIG. 6 is a flowchart showing details of a key code conversion process performed in step P6 in the main routine of FIG.

【図7】 図2のメインルーチン中のステップP7の調
内キーコードへの修正処理の詳細を示すフローチャート
である。
FIG. 7 is a flowchart showing details of correction processing for a key key code in step P7 in the main routine of FIG.

【図8】 データメモリに格納されている調の構成音の
音名データを示す概念図である。
FIG. 8 is a conceptual diagram showing tone name data of a constituent tone of a key stored in a data memory.

【図9】 図7のステップT2の調内音丸め込み処理の
詳細を示すフローチャートである。
FIG. 9 is a flowchart showing details of in-tone tone rounding processing in step T2 of FIG. 7.

【図10】 図2のメインルーチン中のステップP8の
演奏データ変換処理の詳細を示すフローチャートであ
る。
10 is a flowchart showing details of the performance data conversion process of step P8 in the main routine of FIG.

【図11】 図10のステップV4における演奏データ
変換処理の詳細を示すフローチャートである。
FIG. 11 is a flowchart showing details of performance data conversion processing in step V4 of FIG.

【符号の説明】[Explanation of symbols]

1 マイク、 2 D/A変換器、 3 出力端
子、 4 音源、5 サウンドシステム、 6 タ
イマ、 7 CPU、 8 プログラムメモリ、
9 ワーキングメモリ、 10 データメモリ、
11 バス
1 microphone, 2 D / A converter, 3 output terminals, 4 sound sources, 5 sound system, 6 timer, 7 CPU, 8 program memory,
9 working memory, 10 data memory,
11 bus

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 外部から供給される音声を入力して音声
信号を生成するための音声入力手段と、 前記音声入力手段が生成する音声信号を所定の時間区間
に分割して該各時間区間におけるピッチを抽出するため
のピッチ抽出手段と、 前記ピッチ抽出手段により抽出される複数のピッチを平
均化して平均ピッチを演算するための平均ピッチ演算手
段と、 前記平均ピッチ演算手段により演算される平均ピッチを
音高情報に変換するための音高情報変換手段とを有する
音声信号変換装置。
1. A voice input means for inputting a voice supplied from the outside to generate a voice signal, and a voice signal generated by the voice input means is divided into predetermined time intervals to divide the time intervals. Pitch extracting means for extracting a pitch, average pitch calculating means for calculating an average pitch by averaging a plurality of pitches extracted by the pitch extracting means, and average pitch calculated by the average pitch calculating means Signal converting device having pitch information converting means for converting the sound into pitch information.
【請求項2】 外部から楽曲を構成する音声を入力して
音声信号を生成するための音声入力手段と、 前記音声入力手段が生成する音声信号からピッチを抽出
するためのピッチ抽出手段と、 前記ピッチ抽出手段により抽出されるピッチを音高情報
に変換するための音高情報変換手段と、 調情報を供給するための調情報供給手段と、 前記調情報手段から供給される調情報に応じて前記音高
情報を修正するための音高情報修正手段とを有する音声
信号変換装置。
2. A voice input unit for externally inputting a voice constituting a song to generate a voice signal, a pitch extracting unit for extracting a pitch from a voice signal generated by the voice input unit, Pitch information conversion means for converting the pitch extracted by the pitch extraction means into pitch information, key information supply means for supplying key information, and key information supplied from the key information means A voice signal converter having pitch information correcting means for correcting the pitch information.
JP6081392A 1994-04-20 1994-04-20 Audio signal converter Expired - Fee Related JP3055392B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP6081392A JP3055392B2 (en) 1994-04-20 1994-04-20 Audio signal converter

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP6081392A JP3055392B2 (en) 1994-04-20 1994-04-20 Audio signal converter

Publications (2)

Publication Number Publication Date
JPH07287571A true JPH07287571A (en) 1995-10-31
JP3055392B2 JP3055392B2 (en) 2000-06-26

Family

ID=13745039

Family Applications (1)

Application Number Title Priority Date Filing Date
JP6081392A Expired - Fee Related JP3055392B2 (en) 1994-04-20 1994-04-20 Audio signal converter

Country Status (1)

Country Link
JP (1) JP3055392B2 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000347659A (en) * 1999-03-26 2000-12-15 Nippon Telegr & Teleph Corp <Ntt> Music retrieving device and method, and storage medium recorded with music retrieving program
US7096186B2 (en) 1998-09-01 2006-08-22 Yamaha Corporation Device and method for analyzing and representing sound signals in the musical notation
JP2007248610A (en) * 2006-03-14 2007-09-27 Mitsubishi Electric Corp Musical piece analyzing method and musical piece analyzing device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7096186B2 (en) 1998-09-01 2006-08-22 Yamaha Corporation Device and method for analyzing and representing sound signals in the musical notation
JP2000347659A (en) * 1999-03-26 2000-12-15 Nippon Telegr & Teleph Corp <Ntt> Music retrieving device and method, and storage medium recorded with music retrieving program
JP2007248610A (en) * 2006-03-14 2007-09-27 Mitsubishi Electric Corp Musical piece analyzing method and musical piece analyzing device

Also Published As

Publication number Publication date
JP3055392B2 (en) 2000-06-26

Similar Documents

Publication Publication Date Title
JP2909085B2 (en) Pitch control system
JP2800465B2 (en) Electronic musical instrument
JP2879948B2 (en) Audio processing device
JP4179268B2 (en) Data synthesis apparatus and data synthesis processing program
JP2012068548A (en) Key determination device and key determination program
Dunne et al. Pianos and continued fractions
US6750390B2 (en) Automatic performing apparatus and electronic instrument
JP3055392B2 (en) Audio signal converter
CN108573689B (en) Electronic musical instrument, musical sound generating method, and recording medium
JP2745215B2 (en) Electronic string instrument
JP2661349B2 (en) Electronic musical instrument
Quiros et al. Real-time, loose-harmonic matching fundamental frequency estimation for musical signals
JP2555765B2 (en) Electronic musical instrument
JP7332002B2 (en) Electronic musical instrument, method and program
JP2500490B2 (en) Automatic accompaniment device
JP5151603B2 (en) Electronic musical instruments
JP3087753B2 (en) Electronic musical instrument
JP2540966B2 (en) Electronic musical instrument
JP2000187490A (en) Sound processing device
JP2768064B2 (en) Music synthesizer
Molina et al. Dissonance reduction in polyphonic audio using harmonic reorganization
JP2595796B2 (en) Electronic musical instrument
JP2537963B2 (en) Automatic playing device
Van Oudtshoorn Investigating the feasibility of near real-time music transcription on mobile devices
JPH05188961A (en) Automatic accompaniment device

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20000314

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313532

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090414

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090414

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100414

Year of fee payment: 10

LAPS Cancellation because of no payment of annual fees