JPH04329599A - pitch extraction device - Google Patents

pitch extraction device

Info

Publication number
JPH04329599A
JPH04329599A JP10080391A JP10080391A JPH04329599A JP H04329599 A JPH04329599 A JP H04329599A JP 10080391 A JP10080391 A JP 10080391A JP 10080391 A JP10080391 A JP 10080391A JP H04329599 A JPH04329599 A JP H04329599A
Authority
JP
Japan
Prior art keywords
interval
measuring means
maximum value
pitch
value
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
JP10080391A
Other languages
Japanese (ja)
Other versions
JP3092197B2 (en
Inventor
Makoto Iwaooji
岩大路 誠
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.)
Casio Computer Co Ltd
Original Assignee
Casio Computer Co Ltd
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 Casio Computer Co Ltd filed Critical Casio Computer Co Ltd
Priority to JP10080391A priority Critical patent/JP3092197B2/en
Publication of JPH04329599A publication Critical patent/JPH04329599A/en
Priority to US08/154,157 priority patent/US5349130A/en
Application granted granted Critical
Publication of JP3092197B2 publication Critical patent/JP3092197B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Electrophonic Musical Instruments (AREA)
  • Measurement Of Mechanical Vibrations Or Ultrasonic Waves (AREA)

Abstract

(57)【要約】本公報は電子出願前の出願データであるた
め要約のデータは記録されません。
(57) [Summary] This bulletin contains application data before electronic filing, so abstract data is not recorded.

Description

【発明の詳細な説明】[Detailed description of the invention]

【0001】0001

【産業上の利用分野】本発明は、入力された音声信号か
ら、その波形のピッチ(音高)を抽出するピッチ抽出装
置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a pitch extraction device for extracting the pitch of a waveform from an input audio signal.

【0002】0002

【従来の技術】従来から、例えば人が歌う歌声やマイク
ロフォンから採取した楽音などの繰り返し波形からなる
音声信号から、そのピッチ周波数又はピッチ周期(以下
、単に「ピッチ」と呼ぶ)を抽出したいという要請が強
い。ピッチを抽出できれば、例えば、そのピッチの音高
に対応する楽音を電子楽器等から発音させることができ
るようになるなど、抽出されたピッチ情報を様々な処理
に用いることが可能となる。
[Prior Art] There has been a desire to extract the pitch frequency or pitch period (hereinafter simply referred to as "pitch") from an audio signal consisting of a repetitive waveform, such as a human singing voice or a musical tone collected from a microphone. is strong. If a pitch can be extracted, the extracted pitch information can be used in various processes, such as allowing an electronic musical instrument to produce a musical tone corresponding to the pitch of that pitch.

【0003】従来から、音声信号からピッチを抽出する
技術として種々の手法が提案されているが、その中でも
時間域の音声信号から直接ピッチを抽出する方式は、演
算量が少なく、リアルタイム処理が容易に実現可能であ
る。
[0003]Various methods have been proposed as techniques for extracting pitch from audio signals, but among them, methods for directly extracting pitch from audio signals in the time domain require a small amount of calculations and are easy to process in real time. This is possible.

【0004】時間域のピッチ抽出方式の第1の従来例と
しては、例えば、入力波形の隣接するゼロクロス点(振
幅が0となる時間位置)の間の時間を、その波形のピッ
チ周期として求める方式がある。
A first conventional example of a time-domain pitch extraction method is, for example, a method in which the time between adjacent zero-crossing points (time positions where the amplitude becomes 0) of an input waveform is determined as the pitch period of that waveform. There is.

【0005】また、第2の従来例として、入力波形をロ
ーパスフルタに通して倍音成分を除去してから、ゼロク
ロス間隔を抽出するようにした方式もある。更に、第3
の従来例として、入力波形の自己相関値を演算して、そ
の値がピークとなる自己相関のずれ量からピッチ周期を
抽出する方式も提案されている。
In addition, as a second conventional example, there is a method in which the input waveform is passed through a low-pass filter to remove overtone components, and then the zero-cross interval is extracted. Furthermore, the third
As a conventional example, a method has also been proposed in which the autocorrelation value of an input waveform is calculated and the pitch period is extracted from the deviation amount of the autocorrelation that reaches the peak value.

【0006】[0006]

【発明が解決しようとする課題】しかし、人の声などは
倍音をかなり含み、入力波形の1ピッチ周期中にゼロク
ロス点が何回か出現するため、第1の従来例のように単
純にゼロクロス間隔を抽出する方式では、正しい周期が
求められずピッチ抽出誤りが大きいという問題点を有し
ている。
[Problem to be Solved by the Invention] However, human voices contain a considerable amount of overtones, and zero-crossing points appear several times during one pitch period of the input waveform. The method of extracting the interval has the problem that the correct period cannot be obtained and pitch extraction errors are large.

【0007】また、第2の従来例では、ローパスフィル
タのカットオフ周波数を下げると、ピッチを抽出できる
音域が低い音域に限られてしまい、逆に、カットオフ周
波数を上げると倍音成分が残ってピッチ抽出誤りが増加
してしまうという、相反する問題点を有している。
Furthermore, in the second conventional example, when the cutoff frequency of the low-pass filter is lowered, the range from which pitches can be extracted is limited to the lower range, and conversely, when the cutoff frequency is raised, overtone components remain. This has the contradictory problem of increasing pitch extraction errors.

【0008】更に、第3の従来例は、時間域の処理であ
るにもかかわらず、非常に多くの演算量を必要とし、リ
アルタイムで入力波形のピッチを抽出する目的には適さ
ないという問題点を有している。
Furthermore, although the third conventional example is a time domain process, it requires a very large amount of calculation, and is not suitable for extracting the pitch of an input waveform in real time. have.

【0009】本発明の課題は、上述のような倍音成分に
よるゼロクロスの影響をなくし、一ピッチ周期に相当す
る入力波形のゼロクロス間隔の正しい計測を可能とする
ことにある。
An object of the present invention is to eliminate the influence of zero crossings caused by overtone components as described above, and to enable correct measurement of zero-crossing intervals of an input waveform corresponding to one pitch period.

【0010】0010

【課題を解決するための手段】本発明は、まず、入力波
形が負又は正の第1の極性から他方の第2の極性へゼロ
クロスするゼロクロス点からつぎに前記第2の極性から
前記第1の極性へゼロクロスするゼロクロス点までの間
隔を第1の間隔として計測する第1の間隔計測手段を有
する。
[Means for Solving the Problems] The present invention provides a method for firstly starting from a zero-crossing point where an input waveform zero-crosses from a negative or positive first polarity to the other second polarity, and then from the second polarity to the first polarity. It has a first interval measuring means that measures an interval to a zero-crossing point where the polarity zero-crosses as a first interval.

【0011】つぎに、第1の間隔計測手段が第1の間隔
の計測を行っている間の入力波形の各振幅の絶対値の最
大値を第1の振幅最大値として計測する第1の振幅最大
値計測手段を有する。
Next, the first amplitude is measured by measuring the maximum absolute value of each amplitude of the input waveform while the first interval measuring means measures the first interval as the first amplitude maximum value. It has a maximum value measuring means.

【0012】つぎに、第1の間隔計測手段による計測の
終了後、入力波形が第1の極性から第2の極性へゼロク
ロスするゼロクロス点からつぎに第2の極性から第1の
極性へゼロクロスするゼロクロス点までのそれぞれの区
間の間隔を第2の間隔として順次計測する第2の間隔計
測手段を有する。
Next, after the measurement by the first interval measuring means is completed, the input waveform zero-crosses from the first polarity to the second polarity, and then zero-crosses from the second polarity to the first polarity. It has a second interval measuring means that sequentially measures the interval of each section up to the zero crossing point as a second interval.

【0013】つぎに、第2の間隔計測手段が各第2の間
隔の計測を順次行っているそれぞれの区間において入力
波形の各振幅の絶対値の最大値を第2の振幅最大値とし
て順次計測する第2の振幅最大値計測手段を有する。
[0013] Next, the second interval measuring means sequentially measures the maximum absolute value of each amplitude of the input waveform as the second amplitude maximum value in each section in which each second interval is sequentially measured. It has a second amplitude maximum value measuring means.

【0014】さらに、第1の間隔計測手段による計測が
開始されたゼロクロス点からの間隔を逐次計測する第3
の間隔計測手段を有する。上述の第1、第2、第3の各
間隔計測手段は、例えばカウンタによって構成される。
[0014] Furthermore, the third interval measuring means sequentially measures the interval from the zero cross point at which the measurement by the first interval measuring means has started.
It has interval measuring means. Each of the above-mentioned first, second, and third interval measuring means is constituted by, for example, a counter.

【0015】また、第2の計測手段が各第2の間隔の計
測を開始した各時点において第3の間隔計測手段が計測
している間隔を周期情報として順次更新しながら記憶す
る間隔記憶手段を有する。
[0015] Also, an interval storage means is provided which sequentially updates and stores the intervals measured by the third interval measuring means as periodic information at each point in time when the second measuring means starts measuring each second interval. have

【0016】加えて、第1の間隔計測手段が計測した第
1の間隔と第2の間隔計測手段が順次計測した各第2の
間隔が所定の許容誤差範囲内で一致し、かつ第1の振幅
最大値計測手段が計測した第1の振幅最大値と第2の振
幅最大値計測手段が順次計測した各第2の振幅最大値が
所定の許容誤差範囲内で一致したか否かを順次判定する
判定手段を有する。
In addition, the first interval measured by the first interval measuring means and each second interval sequentially measured by the second interval measuring means match within a predetermined tolerance range, and Sequentially determining whether the first amplitude maximum value measured by the amplitude maximum value measuring means and each second amplitude maximum value sequentially measured by the second amplitude maximum value measuring means match within a predetermined tolerance range. It has a determination means.

【0017】そして、判定手段が一致を検出した時点で
時間記憶手段に記憶されている周期情報を入力波形のピ
ッチ情報として出力し、その後、第1の間隔計測手段に
よる計測処理から順に各処理を繰り返させることにより
入力波形からピッチ情報を順次抽出する繰り返し制御手
段を有する。
[0017] Then, at the time when the determining means detects a match, the period information stored in the time storage means is outputted as pitch information of the input waveform, and thereafter, each process is performed in order from the measurement process by the first interval measuring means. It has a repetition control means that sequentially extracts pitch information from an input waveform by repeating the repetition.

【0018】上述の発明の構成において、判定手段が一
致を検出しなかった時点において、第3の間隔計測手段
が計測している間隔が予め設定された最低音のピッチ周
期に対応する間隔を越えたか否かを判定し、越えたと判
定した場合に、第1の間隔計測手段による計測処理から
各処理をやり直させる制限手段を有するように構成でき
る。
In the configuration of the invention described above, at the time when the determining means does not detect a match, the interval measured by the third interval measuring means exceeds the interval corresponding to the preset pitch period of the lowest note. It may be configured to include a limiting means that determines whether or not the interval has exceeded the interval, and when it is determined that the interval has been exceeded, causes each process to be restarted from the measurement process by the first interval measuring means.

【0019】[0019]

【作用】音声信号は、ピッチ周期毎に1つ以上の波形の
山が繰り返す波形として構成され、各ピッチ周期内の各
波形の山は連続するピッチ周期間で相似形を呈する。そ
して、隣接するピッチ周期のほぼ相似の波形の山のそれ
ぞれの両端のゼロクロス点間の間隔及び山の高さは、互
いにほぼ等しいという特徴を有する。
[Operation] The audio signal is constructed as a waveform in which one or more waveform crests repeat in each pitch period, and each waveform crest within each pitch period exhibits a similar shape in consecutive pitch periods. Further, the pitch between the zero crossing points at both ends of the crests of substantially similar waveforms of adjacent pitch periods and the heights of the crests are substantially equal to each other.

【0020】本発明は、この点に着目して、まず、第1
の間隔計測手段が1つの波形の山の両端のゼロクロス点
の間隔を計測し、第1の振幅最大値計測手段がその山の
高さに対応する第1の振幅最大値を計測する。また、第
2の間隔計測手段がそれ以後順次現れる山の両端のゼロ
クロス点の間隔を順次計測し、第2の振幅最大値計測手
段が各山の高さに対応する第2の振幅最大値を計測する
[0020] The present invention focuses on this point, and first, the first
The interval measuring means measures the interval between zero-crossing points at both ends of one waveform peak, and the first amplitude maximum value measuring means measures the first amplitude maximum value corresponding to the height of the peak. Further, the second interval measuring means sequentially measures the intervals between the zero crossing points at both ends of the peaks that appear sequentially from then on, and the second maximum amplitude value measuring means measures the second maximum amplitude value corresponding to the height of each peak. measure.

【0021】そして、判定手段が、上述の第1の間隔と
それぞれの第2の間隔が所定の許容誤差範囲内で一致し
、かつ第1の振幅最大値とそれぞれの第2の振幅最大値
が所定の許容誤差範囲内で一致したか否かを順次判定し
、一致した時点における第1の間隔に対応する山から当
該第2の間隔に対応する山の先頭までの間隔をピッチ情
報として抽出する。このピッチ情報は、間隔記憶手段に
記憶された第3の計測手段の各計測間隔である周期情報
として得ることができる。
[0021]The determining means determines that the first interval and each second interval match within a predetermined tolerance range, and the first amplitude maximum value and each second amplitude maximum value are equal to each other within a predetermined tolerance range. It is sequentially determined whether or not there is a match within a predetermined tolerance range, and the interval from the peak corresponding to the first interval to the top of the peak corresponding to the second interval at the time of the match is extracted as pitch information. . This pitch information can be obtained as period information that is each measurement interval of the third measuring means stored in the interval storage means.

【0022】このようにして、倍音成分による影響に関
わらず、入力波形のピッチを安定して抽出することがで
きる。
[0022] In this way, the pitch of the input waveform can be stably extracted regardless of the influence of overtone components.

【0023】[0023]

【実施例】以下、図面を参照しながら本発明の実施例に
つき説明する。 <実施例の構成>図1は、本発明の実施例の全体構成図
である。
Embodiments Hereinafter, embodiments of the present invention will be described with reference to the drawings. <Configuration of Embodiment> FIG. 1 is an overall configuration diagram of an embodiment of the present invention.

【0024】同図において、例えば特には図示しないマ
イクロフォンによって採取された1人の人が歌う歌声や
アナログ楽器の単音の演奏音などのアナログ信号は、直
流成分を除くためのキャパシタ1を介してA/D変換器
2に入力され、デジタル信号に変換される。
In the figure, an analog signal such as the singing voice of one person or the sound of a single note played by an analog musical instrument collected by a microphone (not shown) is input to A via a capacitor 1 for removing DC components. The signal is input to the /D converter 2 and converted into a digital signal.

【0025】CPU(中央演算制御装置)3は、RAM
(Random Access Memory)4をワ
ークメモリとして、ROM(Read Only Me
mory)9に記憶されたプログラムを実行することに
より、入力音声信号の音高(ピッチ)に関する情報を抽
出する。
[0025] The CPU (central processing and control unit) 3 has a RAM
(Random Access Memory) 4 is used as work memory, ROM (Read Only Me
By executing the program stored in the memory) 9, information regarding the pitch of the input audio signal is extracted.

【0026】つぎに、音源5はCPU3の制御により、
上記音高に関する情報に基づくノートナンバーと、演奏
者が音色選択スイッチ(図示はしていない)などで選択
した音色(例えば、上記歌声とはまったく異なるトラン
ペットなどの管楽器の音色)を有する楽音信号を生成す
る。そのあと、生成された楽音信号はD/A変換器6で
アナログの楽音信号に変換され、増幅器7を介してスピ
ーカ8から楽音として放音される。
Next, the sound source 5 is controlled by the CPU 3.
A musical tone signal having a note number based on the above-mentioned pitch information and a tone selected by the performer using a tone selection switch (not shown) (for example, a tone of a wind instrument such as a trumpet that is completely different from the above-mentioned singing voice). generate. Thereafter, the generated musical tone signal is converted into an analog musical tone signal by a D/A converter 6, and is emitted as a musical tone from a speaker 8 via an amplifier 7.

【0027】なお、ROM9には、上述のプログラムの
他に、後述するように、ピッチ抽出時に用いられる種々
のデータや、得られた入力信号の周期とノートナンバー
との対応を示すテーブル等を有する。
[0027] In addition to the above-mentioned programs, the ROM 9 also contains various data used for pitch extraction, a table showing the correspondence between the period of the obtained input signal and the note number, etc., as will be described later. .

【0028】上述の回路構成により、以下に説明する基
本動作原理に従って、入力される音声信号からピッチデ
ータ(以後、略称する場合は、単にピッチと呼ぶ)の抽
出が行われる。<実施例の基本動作原理>通常、例えば
人の歌声などのように、ピッチ感が明瞭でかつ単音で演
奏される音声は、図2に示すように、ピッチ周期(例え
ば■)毎に繰り返される、ほぼ相似の波形要素(例えば
同図のaとd、bとe、cとf)で構成されている。
With the above-described circuit configuration, pitch data (hereinafter simply referred to as pitch) is extracted from the input audio signal in accordance with the basic operating principle described below. <Basic operating principle of the embodiment> Normally, a voice that has a clear sense of pitch and is played as a single note, such as a human singing voice, is repeated every pitch cycle (for example, ■) as shown in FIG. , are composed of substantially similar waveform elements (for example, a and d, b and e, and c and f in the figure).

【0029】このような音声は、その音声に含まれる倍
音成分のために、その波形が振幅0の基準レベルを横切
るゼロクロス点を1ピッチ周期内に数多く有している。 そのため、このような周期性を有する波形からそのピッ
チ周期を求めるには、いずれのゼロクロス点の間をピッ
チ周期とするかを決定しなければならないが、上述のよ
うな周期性を有する波形にはつぎのような特徴がある。
Such a voice has many zero-crossing points within one pitch period where its waveform crosses a reference level with zero amplitude due to the overtone components contained in the voice. Therefore, in order to find the pitch period from a waveform with such periodicity, it is necessary to determine which zero-crossing points should be used as the pitch period. There are characteristics like.

【0030】すなわち、隣接するピッチ周期のほぼ同形
の波形(例えば上記aとd)のそれぞれのゼロクロス点
(例えばZ1〜Z2とZ7〜Z8)で定まる区間(例え
ば■と■)の時間と、A/D変換された振幅値の最大値
(例えばPaとPd)はほぼ等しい。
That is, the time of the section (for example, ■ and ■) determined by the respective zero-crossing points (for example, Z1 to Z2 and Z7 to Z8) of substantially the same waveforms of adjacent pitch periods (for example, a and d above), and A The maximum values of the /D-converted amplitude values (for example, Pa and Pd) are approximately equal.

【0031】本発明は、この点に着目して、隣接するゼ
ロクロス点間の時間と振幅の最大値の両方の両方がほぼ
等しい2つの区間(例えば■と■)を見出すことにより
、その2つの区間のそれぞれの開始点(例えばZ1とZ
7)の間の時間間隔を抽出して、ピッチ周期を抽出する
Focusing on this point, the present invention finds two sections (for example, ■ and ■) in which both the time between adjacent zero crossing points and the maximum value of amplitude are approximately equal, and thereby The respective starting points of the interval (e.g. Z1 and Z
7) to extract the pitch period.

【0032】上述のような基本動作原理に従って動作す
る本実施例の動作について、以下に説明する。 <実施例の概要>図2において、例えば、波形aのゼロ
クロス点Z1〜Z2の区間■の時間がカウントされ、そ
のカウント値COUNT 1 が第1のカウンタに保持
される。つぎに、波形aと同じ極性を有する波形b、c
、d・・・のそれぞれの区間■、■、■の時間が順次カ
ウントされ、そのカウント値COUNT 2 は、CO
UNT 1 とほぼ等しい値が得られるまで順次更新さ
れながら、第2のカウンタに保持される。
The operation of this embodiment, which operates according to the basic operating principle as described above, will be explained below. <Summary of the Embodiment> In FIG. 2, for example, the time in section 2 between zero crossing points Z1 and Z2 of waveform a is counted, and the count value COUNT 1 is held in a first counter. Next, waveforms b and c having the same polarity as waveform a
, d..., the time of each interval ■, ■, ■ is sequentially counted, and the count value COUNT 2 is CO
It is held in the second counter while being sequentially updated until a value approximately equal to UNT 1 is obtained.

【0033】この場合に、ゼロクロス点Z1から、波形
b、c、dのそれぞれのゼロクロス点Z3、Z5、Z7
までの時間■、■、および■が第3のカウンタによって
カウントされる。そのカウント値COUNT 3は、こ
の入力音声信号のピッチ周期となる可能性を有するので
、ピッチ周期となるカウント値が得られるまで、順次更
新されながらRAM4内の変数PITCOUNTER 
に保存される。また、波形aの振幅の最大値PaがRA
M4内の変数MAX 1 に、波形b、c、dのそれぞ
れの最大値Pb 、Pc 、Pd が、順次更新されな
がらRAM4内の変数MAX2 に書き込まれてゆく。
In this case, from zero cross point Z1 to zero cross points Z3, Z5, and Z7 of waveforms b, c, and d, respectively.
The times ■, ■, and ■ are counted by a third counter. Since the count value COUNT 3 has the possibility of becoming the pitch period of this input audio signal, the variable PITCOUNTER in RAM 4 is updated sequentially until the count value that becomes the pitch period is obtained.
will be saved in Also, the maximum value Pa of the amplitude of waveform a is RA
The maximum values Pb, Pc, and Pd of waveforms b, c, and d are written to the variable MAX2 in the RAM4 while being sequentially updated to the variable MAX1 in the M4.

【0034】そして、区間■の時間とほぼ等しい時間を
有する区間■が見出され、また両区間■、■のそれぞれ
の振幅の最大値に相当する各変数Pa とPd に書き
込まれた値が、ほぼ等しいことが確認されると、両区間
■、■のそれぞれのゼロクロス点Z1、Z7の間の時間
■に相当するカウンタ値が上記メモリ変数PIT CO
UNTER から読み出され、ピッチ周期として確定さ
れる。そして、そのピッチ周期に対応するノートナンバ
ーがROM9内のテーブルから求められる。 <本実施例の動作>つぎに、上述の動作原理に従い、入
力波形のピッチを求める動作を、図3〜図7の動作フロ
ーチャートを用いて説明する。これらの動作フローチャ
ートは、図1のCPU3が、ROM9内に記憶されてい
る制御プログラムを実行する動作として実現される。
Then, an interval ■ having a time almost equal to the time of the interval ■ is found, and the values written in the variables Pa and Pd corresponding to the maximum values of the respective amplitudes of both the intervals ■ and ■ are as follows. When it is confirmed that they are almost equal, the counter value corresponding to the time ■ between the zero crossing points Z1 and Z7 of both sections ■ and ■ is stored in the memory variable PIT CO.
It is read from UNTER and determined as the pitch period. Then, the note number corresponding to that pitch period is determined from the table in the ROM 9. <Operation of this Embodiment> Next, the operation of determining the pitch of an input waveform according to the above-mentioned operating principle will be explained using the operation flowcharts of FIGS. 3 to 7. These operation flowcharts are realized as operations in which the CPU 3 in FIG. 1 executes a control program stored in the ROM 9.

【0035】図3において、まず、RAM4のイニシャ
ル・セットが行われる。すなわち、音声信号を読み出す
時点がその信号波形のいかなる状態(status)に
対応するかを示すステータス・フラグ(STATUS 
FLAG 、図2参照)、入力音声信号の波形エンベロ
ープの大きさを示す変数ENV、ピッチ抽出の結果得ら
れたピッチに対応するノートナンバーを保持する変数P
IT 、現在発音中のノートナンバーを保持する変数O
N NOW、第1、第2、第3の3個のカウンタのそれ
ぞれのカウント値を保持する変数COUNT 1,CO
UNT 2,COUNT 3 、および1つ前のA/D
変換値を保持する変数ADMEM などの各内容がすべ
てクリアされる(ステップS301)。なお、PIT 
やONNOW の値が0ということは、それぞれピッチ
抽出された音が無い、または現在発音中の音が無いこと
を示す。
In FIG. 3, first, the RAM 4 is initialized. In other words, a status flag (STATUS) indicates which state of the signal waveform the time point at which the audio signal is read corresponds to.
FLAG (see Figure 2), a variable ENV that indicates the size of the waveform envelope of the input audio signal, and a variable P that holds the note number corresponding to the pitch obtained as a result of pitch extraction.
IT, variable O that holds the currently sounding note number
N NOW, variable COUNT 1, CO that holds each count value of the first, second, and third three counters.
UNT 2, COUNT 3, and previous A/D
The contents of the variable ADMEM, which holds the converted value, are all cleared (step S301). In addition, PIT
A value of 0 or ONNOW indicates that there is no pitch-extracted sound, or that there is no sound currently being produced.

【0036】つづいて、入力音声信号の1サンプリング
分のA/D変換の終了を待って(S302)、つぎのス
テップS303に進み、CPU3内のレジスタreg1
にA/D変換したデータがセットされる。
Next, after waiting for the completion of A/D conversion for one sampling of the input audio signal (S302), the process proceeds to the next step S303, where the register reg1 in the CPU 3 is
A/D converted data is set to .

【0037】そのあと、ステータス・フラグによって処
理が3つに分岐される(ステップS304)。最初は、
図2のステータス・フラグ=0の状態であるので、ステ
ップS305に進む。ステータス・フラグ=0の状態で
は、入力波形の負側から正側へのゼロクロスの点Z1を
検出するために、1つ前のA/D変換値ADMEM が
負で、かつ現在のA/D変換値が格納されているreg
1が、正であるか否かが判定される。
Thereafter, the process is branched into three depending on the status flag (step S304). Initially,
Since the status flag in FIG. 2 is 0, the process advances to step S305. When the status flag = 0, in order to detect the zero-crossing point Z1 from the negative side to the positive side of the input waveform, the previous A/D conversion value ADMEM is negative and the current A/D conversion value ADMEM is negative. reg where the value is stored
It is determined whether or not 1 is positive.

【0038】今の場合、ステップS305の判定はNO
であり、ステップS307に進む。そして、今回A/D
変換値がセットされたreg1の値が変数ADMEM 
に移され(ステップS307)、エンベロープ抽出(ス
テップS308)、楽音のノートオン/ノートオフ処理
(発音/消音処理、ステップS309)と進み、再びA
/D変換終了待ちとなる(ステップS302)。
In this case, the determination in step S305 is NO.
Therefore, the process advances to step S307. And this time A/D
The value of reg1 with the conversion value set is the variable ADMEM
(step S307), envelope extraction (step S308), musical tone note-on/note-off processing (sound generation/mute processing, step S309), and then A again.
The process waits for the completion of /D conversion (step S302).

【0039】上記エンベロープ抽出(ステップS308
)と楽音のノートオン/ノートオフ(ステップS309
)に関する処理は、図5、図6のそれぞれの動作フロー
チャートに示されている。
[0039] Envelope extraction (step S308)
) and musical tone note-on/note-off (step S309
) are shown in the operation flowcharts of FIGS. 5 and 6.

【0040】図5において、まず、現在のA/D変換値
(reg1の内容)の絶対値が演算され(ステップS5
01)、そのあとローパスフィルタを通されて(デジタ
ルフィルタリング演算の実行による)、入力波形が整形
される(ステップS502)。そしてその結果得られた
値が変数ENV に格納される(ステップS503)。
In FIG. 5, first, the absolute value of the current A/D conversion value (the contents of reg1) is calculated (step S5).
01), and then passed through a low-pass filter (by performing a digital filtering operation) to shape the input waveform (step S502). The value obtained as a result is stored in the variable ENV (step S503).

【0041】図6のノートオン/ノートオフ処理では、
まず変数ENV の大きさが所定の閾値(THRESH
OLD)を超え、かつノートナンバーを保持する変数P
IT の値が0より大きいか否かが判定される(ステッ
プS601)。
In the note-on/note-off process shown in FIG.
First, the size of the variable ENV is set to a predetermined threshold (THRESH
A variable P that exceeds OLD) and holds the note number
It is determined whether the value of IT is greater than 0 (step S601).

【0042】その判定がNOならば、第1図の音源5の
すべて発音中の音の消音が指示され、かつ発音中の音が
無いことを示すために、変数ON NOWがクリアされ
て(ステップS606)、メインルーチン(図3)に戻
る。
If the determination is NO, the muting of all sounds being produced by the sound source 5 in FIG. 1 is instructed, and the variable ON NOW is cleared to indicate that no sounds are being produced (step S606), the process returns to the main routine (FIG. 3).

【0043】また、ステップS601の判定がYESな
らば、ステップS602で現在発音中の音がないか否か
が判定され、その判定がYESならば、ステップS60
5に進む。 ステップS602の判定がNOならば、発音中のノート
ナンバーを示す変数ON NOWと抽出されたノートナ
ンバーを示す変数PIT の各値が比較される(ステッ
プS603)。比較の結果、両者が一致すれば、再発音
する必要がないのでメインルーチン(図3)に戻り、一
致しなければ、発音すべきノートナンバーが変化したこ
とになり、現在発音中の音の消音を音源5に指示し(ス
テップS604)、そのあとステップS605に進む。
If the determination in step S601 is YES, it is determined in step S602 whether or not there is a sound currently being produced. If the determination is YES, step S60
Proceed to step 5. If the determination in step S602 is NO, the values of the variable ON NOW indicating the note number currently being sounded and the variable PIT indicating the extracted note number are compared (step S603). As a result of the comparison, if the two match, there is no need to re-sound, and the process returns to the main routine (Figure 3); if they do not match, the note number to be sounded has changed, and the currently sounding note is muted. is instructed to the sound source 5 (step S604), and then the process advances to step S605.

【0044】ステップS605において、ノートナンバ
ーを示す変数PIT に応じた発音指示が行われるとと
もに、変数ON NOWに変数PIT の値が代入され
て、現在、変数PIT に対応するピッチを有する楽音
を発音中であることが示される。そのあとメインルーチ
ン(図3)に戻る。
In step S605, a sound generation instruction is given in accordance with the variable PIT indicating the note number, and the value of the variable PIT is assigned to the variable ON NOW, so that a musical tone having a pitch corresponding to the variable PIT is currently being produced. It is shown that Thereafter, the process returns to the main routine (FIG. 3).

【0045】以上の処理は、負側から正側へのゼロクロ
ス点(図2のZ1)に到達するまで繰り返され、やがて
、図3のステップS305の判定がYESとなり、ステ
ータス・フラグSTATUS FLAG が1にされる
(ステップS306)。 ここで図2に示す区間■の時間のカウント値COUNT
 1 、および時間■、または■、■のカウント値CO
UNT 3 に初期値の1がセットされ、さらにCOU
NT 1 のカウントアップ中の入力波形の最大振幅値
を得るために、変数MAX 1 に現在のA/D変換値
であるレジスタreg 1 の値が書き込まれる。
The above processing is repeated until the zero crossing point from the negative side to the positive side (Z1 in FIG. 2) is reached, and eventually the determination in step S305 in FIG. 3 becomes YES, and the status flag STATUS FLAG becomes 1. (step S306). Here, the count value COUNT of the time in section ■ shown in FIG.
1, and the count value CO of time ■, or ■, ■
The initial value 1 is set to UNT 3, and COU
In order to obtain the maximum amplitude value of the input waveform during the count-up of NT 1 , the value of the register reg 1 which is the current A/D conversion value is written into the variable MAX 1 .

【0046】このあと前述と同様な動作が行われて、ふ
たたびステップS304に戻る。ここで、STATUS
 FLAG =1 の状態となったため、ステップS3
10に移る。この状態では、図2の区分■に例示される
時間をカウントするために、第1のカウンタとしての変
数COUNT 1 (以下、第1のカウンタCOUNT
 1 と呼ぶ)のインクリメントが、また、区分■に例
示される時間をカウントするために第3のカウンタとし
ての変数COUNT 3 (以下、第3のカウンタCO
UNT 3 と呼ぶ)のインクリメントがそれぞれ開始
される。
[0046] After this, the same operation as described above is performed, and the process returns to step S304. Here, STATUS
Since the state is FLAG = 1, step S3
Move on to 10. In this state, the variable COUNT 1 (hereinafter referred to as the first counter COUNT
1) is also used as a third counter to count the time exemplified in section ■.
(referred to as UNT 3 ) is started.

【0047】まず、ステップS310において、入力波
形の正側から負側へのゼロクロス点、すなわち図2の区
間■の終了点であるゼロクロス点Z2を検出するために
、1つ前のA/D変換値が書き込まれた変数ADMEM
 の値が正で、かつ現在のA/D変換値が書き込まれた
レジスタreg 1 の値が負であるか否かが判定され
る。
First, in step S310, in order to detect the zero-crossing point Z2 from the positive side to the negative side of the input waveform, that is, the end point of section 2 in FIG. Variable ADMEM with value written
It is determined whether the value of is positive and the value of register reg 1 to which the current A/D conversion value is written is negative.

【0048】その判定がNOなら、第1のカウンタCO
UNT 1 の値が1増加させられ(ステップS311
)、図7の最大値検出ルーチンに進む(ステップS31
2)。図7では、現在の入力値が変数MAX 1 の値
以上であるか否かが判定され(ステップS701)、M
AX 1 以上であればMAX 1 に現在の入力値が
代入される(ステップS702)。一方、MAX 1 
より小さければなにもしないで、図3の処理に戻る。 このようにして、変数MAX 1 の値として、A/D
変換値の最大値が求められる。
If the determination is NO, the first counter CO
The value of UNT 1 is increased by 1 (step S311
), the process proceeds to the maximum value detection routine in FIG. 7 (step S31
2). In FIG. 7, it is determined whether the current input value is greater than or equal to the value of the variable MAX 1 (step S701), and M
If it is greater than or equal to AX 1 , the current input value is assigned to MAX 1 (step S702). On the other hand, MAX 1
If it is smaller, nothing is done and the process returns to FIG. 3. In this way, as the value of the variable MAX 1, A/D
The maximum value of the converted values is determined.

【0049】上述のステップS312の処理の後、ステ
ップS314に進み、第3のカウンタCOUNT3 の
値が1増加させられる。以後、ステップS310→S3
11→S312→S314→S307→S308→S3
09→S302〜S304→S310・・・のループ処
理が繰り返され、繰り返し処理毎に第1のカウンタCO
UNT 1および第3のカウンタCOUNT 3 の値
が1づつ増加される。
After the process of step S312 described above, the process proceeds to step S314, where the value of the third counter COUNT3 is incremented by one. After that, step S310→S3
11→S312→S314→S307→S308→S3
The loop processing of 09→S302 to S304→S310... is repeated, and the first counter CO is
The values of UNT 1 and the third counter COUNT 3 are incremented by one.

【0050】そして、ステップS310の判定がYES
になり、正側から負側へのゼロクロス点Z2に到達する
と、ステータス・フラグが2にされる(ステップS31
2)。その後、ステップS314に進み、COUNT 
3 の値が1増加されたあと、ステップS307→S3
08→S309と進み、ステップS302に戻る。
[0050]Then, the determination in step S310 is YES.
When the zero crossing point Z2 from the positive side to the negative side is reached, the status flag is set to 2 (step S31
2). After that, the process advances to step S314, and the COUNT
After the value of 3 is increased by 1, step S307→S3
08→S309, and returns to step S302.

【0051】以上のようなループ処理が行われて、図2
の区間■の時間に相当するカウンタ値が第1のカウンタ
COUNT 1 に保持され、また、波形aの振幅値の
最大値が変数MAX 1 にそれぞれ保持される。
After the above loop processing is performed, the image shown in FIG.
A counter value corresponding to the time of interval (3) is held in the first counter COUNT 1 , and a maximum value of the amplitude value of waveform a is held in the variable MAX 1 .

【0052】つぎに、ステップS312でステータス・
フラグは2にされているので、今回はステップS302
〜S304から、図4のステップS401→S402と
進む。ステップS402では、負側から正側へのゼロク
ロス点(図4のZ3)を検出するために、図3のステッ
プS305と同じ処理、すなわち、変数ADMEM の
値(1つ前のA/D変換値)が負で、かつレジスタre
g1の値(現在のA/D変換値)が正であるか否かが判
定される。
Next, in step S312, the status
Since the flag is set to 2, this time step S302
From ~S304, the process proceeds to steps S401→S402 in FIG. In step S402, in order to detect the zero crossing point from the negative side to the positive side (Z3 in FIG. 4), the same process as in step S305 in FIG. ) is negative and register re
It is determined whether the value of g1 (current A/D conversion value) is positive.

【0053】その判定がNOである間は、S402→S
314(図3)→S307〜S309→S302〜S3
04→S401(図4)→S402・・・のループ処理
が繰り返され、各繰り返し毎に第3のカウンタCOUN
T 3 のカウント値が1づつ増加させられる(S31
4)。
[0053] While the determination is NO, S402→S
314 (Figure 3) → S307 to S309 → S302 to S3
The loop processing of 04→S401 (FIG. 4)→S402... is repeated, and the third counter COUNT
The count value of T 3 is increased by 1 (S31
4).

【0054】そして、ステップS402の判定がYES
になって、負側から正側へのゼロクロス点Z3に到達す
ると、ステータス・フラグが3にされ、このときのCO
UNT 3 の値(図2の時間■に相当)が変数PIT
 COUNTER に保存される(ステップS403)
。このPIT COUNTER の値は、抽出すべきピ
ッチに対応する周期の候補、すなわち、図2の区間■の
カウント値になる可能性を有するものとして、保持され
る。そして、第2カウンタとしての変数COUNT2を
1ずつ増加することが開始される。
[0054] Then, the determination in step S402 is YES.
When the zero crossing point Z3 from the negative side to the positive side is reached, the status flag is set to 3, and the CO at this time is
The value of UNT 3 (corresponding to time ■ in Figure 2) is the variable PIT
Saved in COUNTER (step S403)
. The value of this PIT COUNTER is held as a candidate for the cycle corresponding to the pitch to be extracted, that is, as a value that has the possibility of becoming the count value of section 2 in FIG. Then, the variable COUNT2, which serves as the second counter, starts to be incremented by one.

【0055】その後、ステップS403→S314(図
3)〜S309→S302〜S304→S401(図4
)と進む。今回はSTATUS FLAG =3 の状
態となったため、ステップS401からステップS40
4に進む。この状態ではSTATUS FLAG =1
 の状態と同様な処理により、COUNT 2 のカウ
ントを増加させ、MAX 2 に入力波形の最大値が求
められる。
After that, steps S403→S314 (FIG. 3) to S309→S302 to S304→S401 (FIG. 4)
) and proceed. This time, the state is STATUS FLAG = 3, so steps S401 to S40 are performed.
Proceed to step 4. In this state, STATUS FLAG = 1
Through the same processing as in the state of , the count of COUNT 2 is increased and the maximum value of the input waveform is determined as MAX 2 .

【0056】まず、ステップS404において、入力波
形の正側から負側へのゼロクロス点、すなわち図2の区
間■の終了点に相当するゼロクロス点Z4を検出するた
めに、変数ADEMの値(1つ前のA/D 変換値)が
正で、かつレジスタreg1の値(現在のA/D 変換
値)が負であるか否かが判定される(ステップS404
)。
First, in step S404, the value of the variable ADEM (one It is determined whether the previous A/D conversion value) is positive and the value of register reg1 (current A/D conversion value) is negative (step S404).
).

【0057】この判定がNOの間は、ステップS404
→S405〜S406→S314(図3)〜S309→
S302〜S304→S401(図4)→S404のル
ープ処理が繰り返され、各繰り返しにおいてステップS
405の処理が行われる毎に、第2のカウンタCOUN
T 2 に値1が加えられるとともに、ステップS40
6で変数MAX 2 にA/D変換値の最大値が求めら
れる。
[0057] While this determination is NO, step S404
→S405-S406→S314 (Figure 3)-S309→
The loop processing of S302 to S304 → S401 (FIG. 4) → S404 is repeated, and in each repetition, step S
Every time the process 405 is performed, the second counter COUN
The value 1 is added to T 2 and step S40
6, the maximum value of the A/D conversion value is determined in the variable MAX 2 .

【0058】MAX 2 に最大値を求めるルーチンは
、STATUS FLAG =1 の状態と同様な処理
であり、図7のステップS703以降に示されている。 ここでは、現在の入力値が変数MAX 2 の値以上で
あるか否かが判定され(ステップS703)、MAX 
2 以上であればMAX 2 に現在の入力値が代入さ
れる(ステップS704)。一方、MAX 2 より小
さければなにもしないで、図4の処理に戻る。このよう
にして、変数MAX 2 の値として、A/D変換値の
最大値が求められる。
The routine for determining the maximum value of MAX 2 is the same process as in the state of STATUS FLAG = 1, and is shown from step S703 onward in FIG. Here, it is determined whether the current input value is greater than or equal to the value of the variable MAX 2 (step S703), and MAX
If it is 2 or more, the current input value is substituted into MAX 2 (step S704). On the other hand, if it is smaller than MAX 2 , nothing is done and the process returns to the process of FIG. 4 . In this way, the maximum value of the A/D conversion value is determined as the value of the variable MAX 2 .

【0059】上述の処理によって今回は、図2の入力波
形の区間■の時間と波形bの最大値Pb が求められる
ことになる。なお、上述の各繰り返し毎に第3のカウン
タCOUNT 3 の値も1づつ増加される(S314
)。
By the above-described processing, the time of section 3 of the input waveform in FIG. 2 and the maximum value Pb of waveform b are now determined. Note that the value of the third counter COUNT 3 is also increased by 1 for each repetition described above (S314).
).

【0060】ステップS404の判定がYESになると
、ゼロクロス点Z4が検出されたことになり、ここでス
テータス・フラグが4に変えられる(ステップS407
)。その後、図3のステップS314に進み、COUN
T 3 が値1増加されたあと、ステップS307→S
308→S309〜S401(図4)と進む。
[0060] If the determination in step S404 becomes YES, it means that the zero cross point Z4 has been detected, and the status flag is changed to 4 here (step S407).
). After that, the process advances to step S314 in FIG.
After T 3 is increased by 1, step S307→S
308→S309 to S401 (FIG. 4).

【0061】今回はSTATUS FLAG =4 の
状態となったため、ステップS401からステップS4
08に進む。この状態では、図2の区分■に対して区分
■、■、■が順次比較され、区分■とほぼ等しい時間を
有する区分■が見出されたとき、さらに、区間■、■の
それぞれの波形aとdのA/D変換値の最大値である変
数MAX 1 とMAX 2 の値が比較され、これら
がほぼ等しくなることを判別することによって、図2の
区分■の時間を入力波形のピッチ周期と定める処理動作
が行われる。
[0061] This time, since STATUS FLAG = 4, steps S401 to S4 are executed.
Proceed to 08. In this state, the sections ■, ■, and ■ are sequentially compared with the section ■ in FIG. The values of variables MAX 1 and MAX 2 , which are the maximum values of the A/D conversion values of a and d, are compared, and by determining that they are almost equal, the pitch of the input waveform is determined by A processing operation defined as a period is performed.

【0062】まず、いままでに得られた第1のカウンタ
COUNT 1 と第2のカウンタCOUNT 2のそ
れぞれの値がほぼ等しいか否か、すなわち、COUNT
 1 とCOUNT 2 のそれぞれの値の差の絶対値
が、許容誤差範囲内にあるか否かが判定される(ステッ
プS408)。この許容誤差範囲は、入力信号のサンプ
リング周波数とピッチ周波数に依存するが、経験的に決
定される。
First, check whether the values of the first counter COUNT 1 and the second counter COUNT 2 obtained so far are approximately equal, that is, COUNT
It is determined whether the absolute value of the difference between the values of 1 and COUNT 2 is within the allowable error range (step S408). This tolerance range depends on the sampling frequency and pitch frequency of the input signal, but is determined empirically.

【0063】今の場合は、COUNT 1 とCOUN
T 2 は、それぞれ図2の区間■と■のカウント値を
保持しているため、ステップS408の判定はNOとな
りステップS409に進む。ここで、入力音声信号に雑
音などが混入すると、それが原因となって、ステップS
408の判定がNOの状態が異常に長く続き、楽音の発
音指示が行われない場合がある。
[0063] In this case, COUNT 1 and COUNT
Since T 2 holds the count values of sections ■ and ■ in FIG. 2, respectively, the determination in step S408 is NO and the process proceeds to step S409. Here, if noise or the like is mixed into the input audio signal, this will cause the step S
There are cases where the NO determination in step 408 continues for an abnormally long time, and no instruction to produce musical tones is given.

【0064】このような異常状態の発生を防ぐために、
音声信号のピッチ周期とされるべき時間をカウントする
第3のカウンタCOUNT 3 の値が常に監視され、
その値が音声信号の最低音のピッチ周期に比べてはるか
に大きい値を有する所定の制限値LIMIT を超えて
いるか否かが判定される(ステップS409)。
[0064] In order to prevent the occurrence of such abnormal conditions,
the value of a third counter COUNT 3 counting the time to be taken as the pitch period of the audio signal is constantly monitored;
It is determined whether the value exceeds a predetermined limit value LIMIT which is much larger than the pitch period of the lowest tone of the audio signal (step S409).

【0065】この制限値も前述の許容誤差範囲と同様、
経験的に決定される。例えばサンプリング周波数を20
KHz 、最低抽出音高(ピッチ)を110.5Hz 
(音名:A1に相当)とすると、20000 ÷110
.5 =180.995 ・・・となるため、制限値は
180前後とすればよい。
[0065] This limit value is similar to the above-mentioned allowable error range,
Determined empirically. For example, set the sampling frequency to 20
KHz, minimum extracted pitch (pitch) is 110.5Hz
(note name: equivalent to A1), then 20000 ÷ 110
.. 5 = 180.995... Therefore, the limit value may be set around 180.

【0066】ステップS409の判定がYESの場合、
すなわち異常状態の場合は、図3のステップS315に
進み、図2の音源5に対して、すべての発音中の音を消
音する指示がなされるとともに、変数ON NOWがク
リアされる。そのあと、ステップS301に戻って、ふ
たたび上述のピッチ抽出の処理動作が実行し直される。
[0066] If the determination in step S409 is YES,
That is, in the case of an abnormal state, the process advances to step S315 in FIG. 3, where the sound source 5 in FIG. 2 is instructed to mute all the sounds being produced, and the variable ON NOW is cleared. After that, the process returns to step S301, and the above-described pitch extraction processing operation is executed again.

【0067】ステップS409の判定がNOの場合は、
ステップS410に進んで、変数MAX2の値は現在値
reg1に書きかえられ、更に第2のカウンタCOUN
T 2 の値がクリアされ、ステータス・フラグは2に
戻される。そして、ふたたび、つぎのゼロクロスを求め
るための処理に入る。このとき変数PIT COUNT
ER に保持された値は無効となるが、第3のカウンタ
COUNT 3 は依然カウントアップをつづけており
、また、第1のカウンタCOUNT 1 も図2の区間
■のカウント値を保持している。
[0067] If the determination in step S409 is NO,
Proceeding to step S410, the value of the variable MAX2 is rewritten to the current value reg1, and the second counter COUNT
The value of T 2 is cleared and the status flag is set back to 2. Then, the process begins again to find the next zero cross. At this time, the variable PIT COUNT
Although the value held in ER becomes invalid, the third counter COUNT 3 continues to count up, and the first counter COUNT 1 also holds the count value in section 2 in FIG.

【0068】上述のようにしてステータス・フラグの2
の状態に戻された後は、前回と同様にステータス・フラ
グの3の状態、4の状態と進み、第2のカウンタCOU
NT 2 には図2の区間■のカウント値、変数PIT
 COUNTER には同図の区間■の始まりから区間
■のゼロクロス点Z5までのカウント値(図2の■)が
保持される。また、変数MAX 2 に書き込まれたA
/D変換値の最大値はクリアされ、あらたに波形cの最
大値が求め直される。
2 of the status flags as described above.
After returning to the state, the status flag progresses through the 3 state and 4 state as before, and the second counter COU
NT 2 is the count value of section ■ in Figure 2, variable PIT
COUNTER holds the count value (■ in FIG. 2) from the start of section (2) in the figure to the zero cross point Z5 of section (2). Also, A written in the variable MAX 2
The maximum value of the /D conversion value is cleared, and the maximum value of waveform c is newly determined.

【0069】しかし、今回もCOUNT 1 の値(区
分■の時間に対応)とCOUNT 2 の値(区分■の
時間に対応)が一致しないため、ステップS408の判
定がNOとなる。そのためステップS409を介してス
テップS410に進み、ふたたびステータス・フラグが
2の状態から実行し直されることになる。
However, this time as well, the value of COUNT 1 (corresponding to the time in category ■) and the value of COUNT 2 (corresponding to the time in category ■) do not match, so the determination in step S408 is NO. Therefore, the process advances to step S410 via step S409, and the execution is restarted from the state where the status flag is 2.

【0070】そして、このつぎにステータス・フラグが
、ふたたび4の状態になったとき、COUNT 2 は
図2の区間■のカウント値を保持し、一方、PIT C
OUNTER は同図の時間■のカウント値を保持して
いる。そして、ステップS408において、初めてYE
Sと判定され、ステップS411に進む。
Next, when the status flag becomes 4 again, COUNT 2 retains the count value of section ■ in FIG. 2, while PIT C
OUNTER holds the count value at time ■ in the figure. Then, in step S408, Y for the first time.
It is determined as S, and the process advances to step S411.

【0071】ステップS411では、さらに、変数MA
X 1 に保持されている波形aのA/D変換値の最大
値と、変数MAX 2 に保持されている波形dのA/
D変換値の最大値がほぼ一致するか否かが判定される。
In step S411, the variable MA
The maximum value of the A/D conversion value of waveform a held in X 1 and the A/D conversion value of waveform d held in variable MAX 2
It is determined whether the maximum values of the D-converted values substantially match.

【0072】この判定がNOとされたときには、正しい
ピッチ周期に対応する波形ではないと判定されて、ステ
ップS409に進み、STATUS FLAG =2 
の状態から処理が実行し直されて新たな波形が検索され
る。
When this determination is NO, it is determined that the waveform does not correspond to the correct pitch period, and the process proceeds to step S409, where STATUS FLAG =2.
The process is re-executed from this state and a new waveform is searched for.

【0073】一方、ステップS411の判定がYESと
された場合には、正しいピッチ周期に対応する波形が求
まったと判定されて、ステップS412に進む。このと
きの入力波形のピッチ周期の正しい値は、PIT CO
UNTER に保持されている第3のカウンタCOUN
T 3 の値(図2の■)となる。そして、この値に対
応するノートナンバーが図1のROM9内のテーブルか
ら読み出され、変数PIT に移される(ステップS4
12)。
On the other hand, if the determination in step S411 is YES, it is determined that a waveform corresponding to the correct pitch period has been found, and the process advances to step S412. The correct value of the pitch period of the input waveform at this time is PIT CO
The third counter COUNT held in UNTER
The value of T 3 (■ in FIG. 2) is obtained. Then, the note number corresponding to this value is read from the table in the ROM 9 in FIG. 1 and is transferred to the variable PIT (step S4
12).

【0074】つぎに、ステータス・フラグと、すべての
カウンタと、変数MAX 1 及びMAX 2の各内容
がクリアされ、初期状態にリセットされる(ステップS
413)。そのあと、図3のステップS307〜S30
9のノートオン/オフ処理に進み、この処理において、
上述の入力音声信号のピッチ(音高)に対応するノート
ナンバーを有する楽音の新たな発音指示がなされる。
Next, the status flag, all counters, and the contents of variables MAX 1 and MAX 2 are cleared and reset to the initial state (step S
413). After that, steps S307 to S30 in FIG.
Proceed to note on/off processing in step 9, and in this process,
A new production instruction for a musical tone having a note number corresponding to the pitch (pitch) of the above-mentioned input audio signal is given.

【0075】すなわち、ステップS309に対応する図
6のフローで、ステップS601の判定がYESとなっ
た後、ステップS602で現在発音中の音がない(YE
S)と判定されたら、前述したように、ステップS60
5で、ノートナンバーを示す変数PIT に応じた発音
指示が行われる。また、ステップS602で現在発音中
の音がある(NO)と判定されたら、前述したように、
ステップS603で、発音中のノートナンバーを示す変
数ON NOWと抽出されたノートナンバーを示す変数
PIT の各値が比較される。その比較の結果、両者が
一致すれば、再発音する必要がないのでメインルーチン
(図3)に戻り、一致しなければ、発音すべきノートナ
ンバーが変化したことになり、現在発音中の音の消音が
音源5に指示され(ステップS604)、そのあとステ
ップS605で、新たなノートナンバーが格納された変
数PIT に応じた新たな発音指示が行われる。
That is, in the flow of FIG. 6 corresponding to step S309, after the determination in step S601 is YES, it is determined in step S602 that there is no sound currently being produced (YES).
S), as described above, step S60
At step 5, a pronunciation instruction is given in accordance with the variable PIT indicating the note number. Furthermore, if it is determined in step S602 that there is a sound currently being produced (NO), as described above,
In step S603, the values of the variable ON NOW indicating the note number currently being sounded and the variable PIT indicating the extracted note number are compared. As a result of the comparison, if the two match, there is no need to re-sound, and the process returns to the main routine (Figure 3); if they do not match, the note number to be sounded has changed, and the currently sounding note is The sound source 5 is instructed to mute (step S604), and then, in step S605, a new sound generation instruction is given in accordance with the variable PIT in which the new note number is stored.

【0076】以上の発音指示の後、図3のステップS3
09→S302〜S304へ進み、STATUS FL
AG=0 の状態から、いままでと同様な動作が繰り返
される。以上説明した実施例では、波形の振幅値0の基
準レベルに対して、正側の波形部分(例えば、図2の波
形a、b、c、d・・・)について、それぞれの区分の
時間とA/D変換値の最大値を比較してピッチを抽出し
たが、本発明はこれに限られることなく、負側の波形部
分を用いてもまったく同様ピッチ抽出動作を行うことが
できる。
After the above pronunciation instructions, step S3 in FIG.
09 → Proceed to S302-S304 and STATUS FL
From the state of AG=0, the same operation as before is repeated. In the embodiment described above, for the waveform portions on the positive side (for example, waveforms a, b, c, d, etc. in FIG. 2) with respect to the reference level of the waveform amplitude value 0, the time of each section is Although the pitch is extracted by comparing the maximum value of the A/D conversion values, the present invention is not limited to this, and the pitch extraction operation can be performed in exactly the same way using the negative side waveform portion.

【0077】さらに、基準レベルに対して正側と負側の
それぞれの波形について、並行して上述のピッチ抽出動
作を行い、それぞれの第3のカウンタCOUNT 3 
の値が所定の誤差を許容して一致した場合に、例えば2
つのCOUNT 3 の値の平均値を入力波形のピッチ
周期として求めれば、より精度の高いピッチ抽出が可能
である。
Furthermore, the above-described pitch extraction operation is performed in parallel for each of the waveforms on the positive side and negative side with respect to the reference level, and the respective third counters COUNT 3
For example, if the values of 2 and 2 agree with each other with a predetermined error allowed,
If the average value of the two COUNT 3 values is determined as the pitch period of the input waveform, pitch extraction with higher accuracy is possible.

【0078】また、図6のノートオン/オフの処理では
、発音中の楽音のピッチが変化した場合には、一度、消
音してから発音し直すような処理を行っているが、この
場合に、例えばエンベロープがそれほど変化してなけれ
ば消音はせずに音高のみを変化させるように、図2の音
源5に対して指示を行うことも可能である。
In addition, in the note on/off process shown in FIG. 6, if the pitch of the musical tone being sounded changes, the process is performed such as muting the sound and then reproducing it. For example, if the envelope has not changed much, it is also possible to instruct the sound source 5 in FIG. 2 to change only the pitch without muting the sound.

【0079】[0079]

【発明の効果】本発明によれば、ゼロクロス点間の間隔
がほぼ等しく波形の山が相似であると判別される時点を
抽出することによって、倍音成分による影響に関わらず
、入力波形のピッチを安定して抽出することが可能とな
る。この場合、特に、ゼロクロス点間の間隔だけでなく
、波形の山の高さに相当する振幅最大値も判定要素とす
ることで、より正確なピッチ抽出が可能となる。
According to the present invention, the pitch of the input waveform can be adjusted regardless of the influence of overtone components by extracting the point in time when the intervals between zero crossing points are almost equal and the peaks of the waveform are determined to be similar. It becomes possible to extract stably. In this case, in particular, more accurate pitch extraction is possible by using not only the interval between zero-crossing points but also the maximum amplitude value corresponding to the height of the peak of the waveform as a determining factor.

【0080】これにより、例えば倍音を含む歌声や楽音
などの音声波形から、その音高を示すピッチを確実に抽
出することが可能となる。
[0080] This makes it possible to reliably extract, for example, a pitch indicating the pitch from a voice waveform such as a singing voice or musical tone that includes overtones.

【図面の簡単な説明】[Brief explanation of the drawing]

【図1】本発明の一実施例の全体構成図である。FIG. 1 is an overall configuration diagram of an embodiment of the present invention.

【図2】入力音声信号の波形図である。FIG. 2 is a waveform diagram of an input audio signal.

【図3】本実施例の動作フローチャート(その1)であ
る。
FIG. 3 is an operation flowchart (Part 1) of this embodiment.

【図4】本実施例の動作フローチャート(その2)であ
る。
FIG. 4 is an operation flowchart (Part 2) of this embodiment.

【図5】本実施例のエンベロープ検出に関する動作フロ
ーチャートである。
FIG. 5 is an operational flowchart regarding envelope detection in this embodiment.

【図6】本実施例のノートオン/オフに関する動作フロ
ーチャートである。
FIG. 6 is an operation flowchart regarding note on/off in this embodiment.

【図7】本実施例の入力波形の最大値検出に関する動作
フローチャートである。
FIG. 7 is an operation flowchart regarding maximum value detection of an input waveform according to the present embodiment.

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

1    キャパシタ 2    A/D変換器 3    CPU 4    RAM 5    音源 6    D/A変換器 7    増幅器 8    スピーカ 9    ROM 1 Capacitor 2 A/D converter 3 CPU 4 RAM 5 Sound source 6 D/A converter 7 Amplifier 8 Speaker 9 ROM

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】入力波形が負又は正の第1の極性から他方
の第2の極性へゼロクロスするゼロクロス点からつぎに
前記第2の極性から前記第1の極性へゼロクロスするゼ
ロクロス点までの間隔を第1の間隔として計測する第1
の間隔計測手段と、該第1の間隔計測手段が前記第1の
間隔の計測を行っている間の前記入力波形の各振幅の最
大値を第1の振幅最大値として計測する第1の振幅最大
値計測手段と、前記第1の間隔計測手段による計測の終
了後、前記入力波形が前記第1の極性から前記第2の極
性へゼロクロスするゼロクロス点からつぎに前記第2の
極性から前記第1の極性へゼロクロスするゼロクロス点
までのそれぞれの区間の間隔を第2の間隔として順次計
測する第2の間隔計測手段と、該第2の間隔計測手段が
前記各第2の間隔の計測を順次行っているそれぞれの区
間において前記入力波形の各振幅の絶対値の最大値を第
2の振幅最大値値として順次計測する第2の振幅最大値
計測手段と、前記第1の間隔計測手段による計測が開始
されたゼロクロス点からの間隔を逐次計測する第3の間
隔計測手段と、前記第2の計測手段が前記各第2の間隔
の計測を開始した各時点において前記第3の間隔計測手
段が計測している間隔を周期情報として順次更新しなが
ら記憶する間隔記憶手段と、前記第1の間隔計測手段が
計測した前記第1の間隔と前記第2の間隔計測手段が順
次計測した前記各第2の間隔が所定の許容誤差範囲内で
一致し、かつ前記第1の振幅最大値計測手段が計測した
前記第1の振幅最大値と前記第2の振幅最大値計測手段
が順次計測した前記各第2の振幅最大値が所定の許容誤
差範囲内で一致したか否かを順次判定する判定手段と、
該判定手段が前記一致を検出した時点で前記時間記憶手
段に記憶されている前記周期情報を前記入力波形のピッ
チ情報として出力し、その後、前記第1の間隔計測手段
による計測処理から順に前記各処理を繰り返させること
により前記入力波形からピッチ情報を順次抽出する繰り
返し制御手段と、を有することを特徴とするピッチ抽出
装置。
[Claim 1] An interval from a zero-crossing point where an input waveform zero-crosses from a negative or positive first polarity to the other second polarity to a zero-crossing point where the input waveform zero-crosses from the second polarity to the first polarity. The first interval is measured as the first interval.
and a first amplitude that measures the maximum value of each amplitude of the input waveform while the first interval measuring means measures the first interval as a first amplitude maximum value. After the measurement by the maximum value measuring means and the first interval measuring means is completed, the input waveform zero-crosses from the first polarity to the second polarity, and then from the second polarity to the second polarity. a second interval measuring means that sequentially measures intervals of each section up to a zero crossing point where the zero crosses to a polarity of 1 as a second interval; and the second interval measuring means sequentially measures the respective second intervals. measurement by a second amplitude maximum value measuring means that sequentially measures the maximum absolute value of each amplitude of the input waveform as a second amplitude maximum value in each interval in which the measurement is performed; and a measurement by the first interval measuring means. a third interval measuring means for sequentially measuring the interval from the zero crossing point at which the second interval is started; an interval storage means for sequentially updating and storing measured intervals as cycle information; and the first interval measured by the first interval measuring means and each of the intervals sequentially measured by the second interval measuring means. the first amplitude maximum value measured by the first amplitude maximum value measuring means and the second amplitude maximum value measuring means successively measured by the first amplitude maximum value measuring means and the second amplitude maximum value measuring means. determining means for sequentially determining whether or not the second maximum amplitude values match within a predetermined tolerance range;
At the time when the determination means detects the coincidence, the period information stored in the time storage means is outputted as pitch information of the input waveform, and thereafter, each of the period information is sequentially measured starting from the measurement processing by the first interval measurement means. A pitch extraction device comprising: repetition control means for sequentially extracting pitch information from the input waveform by repeating processing.
【請求項2】前記判定手段が前記一致を検出しなかった
時点において、前記第3の間隔計測手段が計測している
間隔が予め設定された最低音のピッチ周期に対応する間
隔を越えたか否かを判定し、越えたと判定した場合に、
前記第1の間隔計測手段による計測処理から前記各処理
をやり直させる制限手段を、更に有することを特徴とす
る請求項1に記載のピッチ抽出装置。
2. At the time when the determining means does not detect the coincidence, it is determined whether the interval being measured by the third interval measuring means exceeds a preset interval corresponding to the pitch period of the lowest note. If it is determined that the
2. The pitch extraction device according to claim 1, further comprising a limiting means for redoing each of the processes from the measurement process by the first interval measuring means.
JP10080391A 1991-05-02 1991-05-02 Pitch extraction device Expired - Fee Related JP3092197B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP10080391A JP3092197B2 (en) 1991-05-02 1991-05-02 Pitch extraction device
US08/154,157 US5349130A (en) 1991-05-02 1993-11-17 Pitch extracting apparatus having means for measuring interval between zero-crossing points of a waveform

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP10080391A JP3092197B2 (en) 1991-05-02 1991-05-02 Pitch extraction device

Publications (2)

Publication Number Publication Date
JPH04329599A true JPH04329599A (en) 1992-11-18
JP3092197B2 JP3092197B2 (en) 2000-09-25

Family

ID=14283553

Family Applications (1)

Application Number Title Priority Date Filing Date
JP10080391A Expired - Fee Related JP3092197B2 (en) 1991-05-02 1991-05-02 Pitch extraction device

Country Status (1)

Country Link
JP (1) JP3092197B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0736889U (en) * 1993-12-22 1995-07-11 株式会社小仙ミシン商会 Toilet paper holder

Also Published As

Publication number Publication date
JP3092197B2 (en) 2000-09-25

Similar Documents

Publication Publication Date Title
Moorer On the transcription of musical sound by computer
Raphael Automatic segmentation of acoustic musical signals using hidden Markov models
Chafe et al. Toward an intelligent editor of digital audio: Recognition of musical constructs
US8859872B2 (en) Method for giving feedback on a musical performance
CN108038146A (en) Musical performance artificial intelligence analysis method, system and equipment
CN113823270A (en) Rhythm score determination method, medium, device and computing equipment
WO2019180830A1 (en) Singing evaluating method, singing evaluating device, and program
WO2007010638A1 (en) Automatic music transcriptor and program
JP3279204B2 (en) Sound signal analyzer and performance information generator
JPH04329599A (en) pitch extraction device
JP3092198B2 (en) Pitch extraction device
Polfreman Comparing Onset Detection & Perceptual Attack Time.
JP4048249B2 (en) Karaoke equipment
JP4198046B2 (en) Electronic stringed instruments
JPH0519792A (en) Pitch extractor
JP2006227452A (en) Tuning device and method of controlling the same
EP0264955B1 (en) Apparatus for determining the pitch of a substantially periodic input signal
JP2532424B2 (en) Waveform signal input controller
JPS63136088A (en) Input controller for electronic musical instrument
JP4360527B2 (en) Pitch detection method
JP3028041B2 (en) Music element extraction device
JP2604403B2 (en) Automatic music transcription method and device
JP2508035B2 (en) Input waveform signal controller
JPH0659668A (en) Automatic transcription device for rhythm instruments
JPH0972779A (en) Pitch detector for waveform of speech

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: 20000627

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

Free format text: PAYMENT UNTIL: 20070728

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20080728

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20080728

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20090728

Year of fee payment: 9

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

Free format text: PAYMENT UNTIL: 20090728

Year of fee payment: 9

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

Free format text: PAYMENT UNTIL: 20100728

Year of fee payment: 10

LAPS Cancellation because of no payment of annual fees