JP3104350B2 - Transcription device - Google Patents

Transcription device

Info

Publication number
JP3104350B2
JP3104350B2 JP03336685A JP33668591A JP3104350B2 JP 3104350 B2 JP3104350 B2 JP 3104350B2 JP 03336685 A JP03336685 A JP 03336685A JP 33668591 A JP33668591 A JP 33668591A JP 3104350 B2 JP3104350 B2 JP 3104350B2
Authority
JP
Japan
Prior art keywords
note
length
data
melody
time
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.)
Expired - Fee Related
Application number
JP03336685A
Other languages
Japanese (ja)
Other versions
JPH05165464A (en
Inventor
林  哲也
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 JP03336685A priority Critical patent/JP3104350B2/en
Publication of JPH05165464A publication Critical patent/JPH05165464A/en
Application granted granted Critical
Publication of JP3104350B2 publication Critical patent/JP3104350B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Electrophonic Musical Instruments (AREA)
  • Auxiliary Devices For Music (AREA)

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【産業上の利用分野】本発明は、入力されるメロディを
構成する各メロディ音の発音開始、発音終了を示すイベ
ントデータに基づいて音符データを作成する採譜装置に
関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a musical notation apparatus for creating note data based on event data indicating the start and end of sounding of each melody sound constituting an input melody.

【0002】[0002]

【従来の技術】オーディオ信号などとして再生されるメ
ロディを音符化することができれば、メロディの内容を
記録できるだけでなく、そのメロディの内容を楽譜とし
てディスプレイや出力用紙に再現することが可能とな
る。従って、このような採譜装置は、作曲活動などの補
助装置として有用である。
2. Description of the Related Art If a melody reproduced as an audio signal or the like can be converted into a musical note, not only can the content of the melody be recorded, but also the content of the melody can be reproduced as a musical score on a display or an output sheet. Therefore, such a music transcription device is useful as an auxiliary device for music composition activities and the like.

【0003】同時に複数の楽音が重なって再生される場
合には、その音符化を行うことは困難であるが、メロデ
ィのように単音が再生される場合には、メロディが再生
されるオーディオ信号などからピッチ抽出を行いながら
メロディの音符化を行うことは可能である。
When a plurality of musical tones are reproduced at the same time, it is difficult to convert them into notes. However, when a single tone is reproduced like a melody, an audio signal or the like from which the melody is reproduced is used. It is possible to convert the melody into notes while extracting the pitch from the melody.

【0004】音符化を行うにあたっては、各メロディ音
の再生タイミングを、楽譜に表現することが可能な音符
長の単位にそろえる必要が生じる。このような処理は、
一般にクオンタイズと呼ばれている。
[0004] In performing note conversion, it is necessary to align the reproduction timing of each melody sound with a unit of note length that can be expressed in a musical score. Such processing is
Generally called quantize.

【0005】例えば、楽譜上の最小音符単位が16分音
符である場合には、各メロディ音の再生の開始タイミン
グと終了タイミングを、16分音符によって規定される
基準時間単位にクオンタイズする必要がある。
For example, when the minimum note unit on a musical score is a sixteenth note, it is necessary to quantize the reproduction start and end timings of each melody sound to a reference time unit defined by the sixteenth note. .

【0006】従来のクオンタイズ方式としては、オーデ
ィオ信号などから検出されるメロディに対応する発音情
報(イベント)を、単純に例えば16分音符に相当する
時間単位で記録してゆく方式が考えられる。
As a conventional quantization method, a method in which pronunciation information (event) corresponding to a melody detected from an audio signal or the like is simply recorded in a time unit corresponding to, for example, a sixteenth note can be considered.

【0007】[0007]

【発明が解決しようとする課題】しかし、メロディのよ
うに単音が再生される場合においても、例えばレガート
再生のように、短時間ではあるが2つのメロディ音が重
なる場合が生じ得る。このような場合には、2つのメロ
ディ音のノートオフイベントとノートオンイベントは例
えば16分音符に相当する時間単位より短い時間内に発
生し得るため、上述のように単純な記録方式では、これ
らの連続するイベントを正しく記録することができず、
2つのメロディ音を適切に2つの音符にクオンタイズす
ることができないという問題点を有している。
However, even when a single sound is reproduced like a melody, a case where two melody sounds overlap for a short time, such as legato reproduction, may occur. In such a case, the note-off event and the note-on event of the two melody sounds can occur within a time shorter than a time unit corresponding to, for example, a sixteenth note. Can't properly record consecutive events,
There is a problem that two melody sounds cannot be properly quantized into two notes.

【0008】本発明の課題は、入力されるメロディ音が
重なる場合においても、2つのメロディを適切に処理し
て音符化することにある。
An object of the present invention is to appropriately process two melodies and convert them into notes even when input melody sounds overlap.

【0009】[0009]

【課題を解決するための手段】本発明は、次のような音
符データ生成手段を有することを前提とする。なお、こ
のような音符データ生成手段は、本出願の出願人が特願
平2−123789号の特許出願において開示した発明
に基づくものである。
The present invention is premised on having the following note data generating means. Such a note data generating means is based on the invention disclosed by the applicant of the present application in a patent application of Japanese Patent Application No. 2-123789.

【0010】すなわち、音符データ生成手段は、予めR
AMなどに記憶されそこから順次入力される楽音の発音
開始又は発音終了のイベントの発生を示すイベントデー
タ、順次入力される前記楽音の音高を示す音高データ、
及び順次入力される前記イベントデータの発生タイミン
グの間を所定の最小計測単位時間を単位とした経過時間
によって示す時間データに基づいて、有効な発音区間及
び有効な発音区間以外の消音区間を最小計測単位時間を
単位とする時間軸上で順次決定する。
[0010] That is, the note data generating means preliminarily sets R
Event data indicating the occurrence of a sound start or sound end event of a musical tone which is stored in the AM or the like and sequentially input thereto, pitch data indicating the pitch of the musical tone sequentially input;
And a minimum measurement of a valid sounding section and a mute section other than a valid sounding section based on time data indicating the time between occurrence timings of the sequentially input event data in units of a predetermined minimum measuring unit time. It is determined sequentially on a time axis with unit time as a unit.

【0011】次に、音符データ生成手段は、上述の有効
な発音区間に対応した音長で、かつ、音高データに基づ
いた音高の音符を表す音符データと、消音区間に対応し
た音長の休符を表す休符データとを順次生成する。
Next, the note data generating means includes note data representing a note having a pitch corresponding to the above-mentioned effective sounding section and having a pitch based on the pitch data, and a note length corresponding to the silence section. And rest data representing the rest of the rest.

【0012】上述の前提のもとで、本発明による音符デ
ータ生成手段は、次のような構成を有することを特徴と
する。すなわち、まず、音符データ生成手段は、順次入
力されるイベントデータ、音高データ及び時間データの
各組に基づいて、最小計測単位時間を単位とする時間軸
上で発音開始位置と発音終了位置を順次決定する。
Under the above-mentioned premise, the note data generating means according to the present invention has the following configuration. That is, first, the note data generation means determines a sound start position and a sound end position on a time axis in units of the minimum measurement unit time based on each set of event data, pitch data and time data which are sequentially input. Determined sequentially.

【0013】つぎに、音符データ生成手段は、上述のよ
うに順次決定される各発音開始位置とそれに対応する発
音終了位置の間に他の発音開始位置が存在する場合であ
って、各発音開始位置からそれに対応する発音終了位置
までの第1の時間長と他の発音開始位置からそれに対応
する発音終了位置までの第2の時間長が共に所定の最小
音符長の1/2より長い場合には、各発音開始位置から
他の発音開始位置までを各発音開始位置に対応する発音
区間として順次決定する。
Next, the note data generating means determines whether or not there is another sounding start position between each sounding start position sequentially determined as described above and the corresponding sounding end position. When both the first time length from the position to the corresponding sound generation end position and the second time length from the other sound generation start position to the corresponding sound generation end position are longer than 1/2 of the predetermined minimum note length, Determines sequentially from each tone generation start position to another tone generation start position as a tone generation section corresponding to each tone generation start position.

【0014】一方、音符データ生成手段は、上述の第1
の時間長と第2の時間長のうち何れか一方が所定の最小
音符長の1/2より短い場合には、各発音開始位置から
他の発音開始位置に対応する発音終了位置までを各発音
開始位置に対応する発音区間として順次決定すると共
に、所定の最小音符長の1/2より短い時間長に対応す
る音高データを他方の時間長に対応する音高データの内
容により書き換える。
On the other hand, the note data generating means is provided with the first
If either one of the time length of the second sound and the second time length is shorter than 1/2 of the predetermined minimum note length, the sound generation from each sounding start position to the sounding end position corresponding to another sounding start position is performed. The sound generation section is sequentially determined as the sounding section corresponding to the start position, and the pitch data corresponding to the time length shorter than 1/2 of the predetermined minimum note length is rewritten with the content of the pitch data corresponding to the other time length.

【0015】そして、音符データ生成手段は、このよう
にして順次決定される発音区間の時間長が所定の最小音
符長の1/2より長い場合にその発音区間を有効な発音
区間として決定する。
The note data generating means determines the sounding section as an effective sounding section when the time length of the sounding section sequentially determined in this way is longer than 1/2 of a predetermined minimum note length.

【0016】以上の動作の後、音符データ生成手段は、
次のようにして音符データを生成する。すなわち、ま
ず、音符データ生成手段は、上述のようにして決定され
た有効な発音区間の発音開始位置が、所定の最小音符長
を単位とする時間軸上でその発音開始位置が含まれる最
小音符長の範囲の前半に含まれるなら、その最小音符長
の範囲の先頭位置を音符区間の発音開始位置とする音符
データを生成し、後半に含まれるなら、その最小音符長
の範囲のつぎの最小音符長の範囲の先頭位置を音符区間
の発音開始位置とする音符データを生成する。
After the above operation, the note data generating means:
The note data is generated as follows. That is, first, the note data generation means determines that the sounding start position of the valid sounding section determined as described above is the minimum note including the sounding start position on the time axis in units of a predetermined minimum note length. If it is included in the first half of the length range, it generates note data with the start position of the minimum note length range as the note start position of the note interval, and if it is included in the latter half, it generates the next minimum note length range Note data is generated with the start position of the range of note length as the sounding start position of the note section.

【0017】次に、音符データ生成手段は、上述のよう
にして決定された有効な発音区間の終了位置が、所定の
最小音符長を単位とする時間軸上でその終了位置が含ま
れる最小音符長の範囲の前半に含まれるなら、その最小
音符長の範囲の先頭位置を音符区間の終了位置とする音
符データを生成し、後半に含まれるなら、その最小音符
長の範囲のつぎの最小音符長の範囲の先頭位置を音符区
間の終了位置とする音符データを生成する。
Next, the note data generating means determines that the end position of the valid sounding section determined as described above is the minimum note including the end position on the time axis in units of a predetermined minimum note length. If it is included in the first half of the length range, generate note data with the start position of the minimum note length range as the end position of the note section, and if it is included in the second half, the next minimum note following the minimum note length range Note data is generated with the start position of the length range being the end position of the note section.

【0018】[0018]

【作用】音符データ生成手段は、まず、予めRAMなど
に記憶された例えばメロディ音の演奏内容を示すデータ
に基づき、音符化するために有効な発音区間及びその有
効な発音区間以外の消音区間を所定の動作アルゴリズム
により順次決定する。
The note data generating means firstly generates a sound-producing section effective for converting into a note and a silence section other than the valid sound-producing section based on data indicating the performance contents of, for example, a melody sound stored in a RAM or the like in advance. They are sequentially determined by a predetermined operation algorithm.

【0019】ここで、まず、最小計測単位時間を単位と
する時間軸上で発音開始位置と発音終了位置が順次決定
される。そして、各発音開始位置とそれに対応する発音
終了位置の間に他の発音開始位置が存在する場合であっ
て、各発音開始位置からそれに対応する発音終了位置ま
での第1の時間長と他の発音開始位置からそれに対応す
る発音終了位置までの第2の時間長が共に所定の最小音
符長の1/2より長い場合には、各発音開始位置から他
の発音開始位置までを各発音開始位置に対応する発音区
間として順次決定する。この結果、レガート演奏のよう
に短時間ではあるが2つのメロディ音が重なる場合で
も、2つのメロディ音を2つの発音区間に適切に分離す
ることができる。
First, a sounding start position and a sounding ending position are sequentially determined on a time axis in units of the minimum measurement unit time. Then, when there is another sounding start position between each sounding start position and the corresponding sounding end position, the first time length from each sounding start position to the corresponding sounding end position and another sounding start position If the second time length from the sounding start position to the corresponding sounding ending position is longer than 所 定 of the predetermined minimum note length, each sounding start position from each sounding start position to another sounding start position is used. Are sequentially determined as sounding sections corresponding to. As a result, even when the two melody sounds overlap for a short time as in legato performance, the two melody sounds can be appropriately separated into two sounding sections.

【0020】また、上述の第1の時間長と第2の時間長
のうち何れか一方が所定の最小音符長の1/2より短い
場合には、各発音開始位置から他の発音開始位置に対応
する発音終了位置までを各発音開始位置に対応する発音
区間として順次決定されると共に、所定の最小音符長の
1/2より短い時間長に対応する音高データが他方の時
間長に対応する音高データの内容により書き換えられ
る。このように、2つのメロディ音が重なっている場合
で一方のメロディ音の発音時間が短い場合には、その区
間を発音時間が長い方のメロディ音に吸収させることに
より、不自然な音符データが生成されてしまうことを防
ぐことができる。
If one of the first time length and the second time length is shorter than 1/2 of the predetermined minimum note length, the sound generation start position is changed to another sound generation start position. Up to the corresponding sounding end position is sequentially determined as a sounding section corresponding to each sounding start position, and pitch data corresponding to a time length shorter than 1/2 of a predetermined minimum note length corresponds to the other time length. Rewritten according to the contents of the pitch data. As described above, when two melody sounds are overlapped and one melody sound has a short sounding time, unnatural note data can be generated by absorbing the section to the longer melody sound. It can be prevented from being generated.

【0021】次に、音符データ生成手段は、上述のよう
に順次決定される発音区間の時間長を所定の最小音符長
の1/2の時間長より長い場合にその発音区間を有効な
発音区間として決定する。このように有効な発音区間の
判別を行うことにより、発音区間の時間長が所定の最小
音符長より極端に短く音符化できないような場合を予め
除くことができる。
Next, the note data generating means, if the time length of the sequentially determined sounding section is longer than a half of the predetermined minimum note length, converts the sounding section into an effective sounding section. To be determined. By determining an effective sounding section in this way, it is possible to remove in advance a case where the time length of the sounding section is extremely shorter than a predetermined minimum note length and cannot be converted into a note.

【0022】更に、音符データ生成手段は、上述のよう
にして、有効な発音区間と消音区間をとりあえず決定し
た後に、それぞれの有効な発音区間に対応した音長で、
かつ、音高データに基づいた音高の音符を表す音符デー
タと、それぞれの消音区間に対応した音長の休符を表す
休符データを、所定の動作アルゴリズムに従って順次生
成する。この場合、それぞれの音符又は休符が所定の最
小音符長を単位として構成されるように、それぞれの有
効な発音区間又は消音区間から各音符データ又は休符デ
ータへの対応付けが、時間的な補正がなされながら行わ
れる。この結果、最小計測単位時間を単位とする時間軸
に沿って演奏されたメロディ音を、音符又は休符へ適切
に対応付けることができる。
Further, the note data generating means determines the valid sounding section and the mute section for the time being as described above, and then determines the sound duration corresponding to each valid sounding section.
Further, note data representing a note of a pitch based on the pitch data and rest data representing a rest of a pitch corresponding to each silence section are sequentially generated according to a predetermined operation algorithm. In this case, the correspondence from each effective sounding section or mute section to each note data or rest data is time-wise so that each note or rest is configured in units of a predetermined minimum note length. This is performed while the correction is being made. As a result, the melody sound played along the time axis having the minimum measurement unit time as a unit can be appropriately associated with a note or a rest.

【0023】[0023]

【実施例】以下、図面を参照しながら本発明の1実施例
について説明する。採譜装置の実施例の構成 図1は、本発明による採譜装置の実施例の構成を示すブ
ロック図である。
An embodiment of the present invention will be described below with reference to the drawings. Diagram 1 of an embodiment of music transcription apparatus is a block diagram showing a configuration of an embodiment of a music transcription apparatus according to the present invention.

【0024】ユーザが、スイッチ部11において、特に
は図示しないメロディデータの生成の開始を指示するた
めのスタートスイッチを押すと、次のような処理が実行
される。
When the user presses a start switch for instructing the start of melody data generation (not shown) in the switch section 11, the following processing is executed.

【0025】まず、ユーザによって特には図示しないオ
ーディオ再生装置などから入力されるオーディオ信号に
ついて、アンチエイリアシングフィルタ1によって、周
波数帯域がサンプリング周波数の1/2の帯域に制限さ
れた後、A/D変換器2によってデジタル信号に変換さ
れる。
First, the frequency band of an audio signal input by a user from an audio reproducing device (not shown) is limited by the anti-aliasing filter 1 to a band of サ ン プ リ ン グ of the sampling frequency, and then A / D converted. The signal is converted into a digital signal by the device 2.

【0026】次に、DSP(デジタル信号処理装置)3
とCPU(中央演算処理装置)6によって、デジタル化
されたオーディオ信号の音高(ピッチ)がリアルタイム
で検出され、その音高に基づいてメロディを構成する各
メロディ音の発音開始を示すノートオンや発音終了を示
すノートオフなどのイベントの情報とそのメロディ音の
音高を表わすノートナンバーが生成され、各イベントの
入力タイミングを示す時間データとともにメロディデー
タとしてRAM7に記憶される。ここで、フィルタ係数
用ROM4には、DSP3において実行されるデジタル
フィルタリング演算用のフィルタ係数が記憶され、ワー
クエリアRAM5には、デジタルフィルタリング演算に
おいて使用される各種変数などが記憶される。
Next, a DSP (Digital Signal Processor) 3
And a CPU (Central Processing Unit) 6 detects a pitch (pitch) of the digitized audio signal in real time, and based on the pitch, performs a note-on or a note-on, which indicates the start of each melody sound constituting the melody. Event information such as note-off indicating the end of sound generation and a note number indicating the pitch of the melody sound are generated, and are stored in the RAM 7 as melody data together with time data indicating the input timing of each event. Here, the filter coefficient ROM 4 stores filter coefficients for digital filtering operation executed in the DSP 3, and the work area RAM 5 stores various variables used in the digital filtering operation.

【0027】最後に、ユーザは、スイッチ部11におい
て、特には図示しないメロディデータの生成の終了を指
示するためのストップスイッチを押すと、上述のメロデ
ィデータの生成処理が終了する。
Finally, when the user presses a stop switch for instructing the end of melody data generation (not shown) in the switch section 11, the melody data generation processing described above is completed.

【0028】その後、ユーザが、スイッチ部11におい
て、特には図示しない音符データの生成を指示するため
のスタートスイッチを押すと、CPU6は、上述のRA
M7に記憶されたメロディデータを、楽譜として表現可
能な音符データに変換する処理を実行し、生成した音符
データをRAM7に記憶する。
Thereafter, when the user presses a start switch for instructing the generation of note data (not shown) in the switch section 11, the CPU 6 executes the above-mentioned RA.
A process of converting the melody data stored in M7 into note data that can be expressed as a musical score is executed, and the generated note data is stored in the RAM 7.

【0029】このようにRAM7に記憶された音符デー
タは、特には図示しない表示装置などに楽譜として表示
される。楽音発生回路8は、CPU6による上述のメロ
ディ音のイベントデータの生成に応じて、そのイベント
データに対応するメロディ音の楽音信号を発生する。発
生された楽音信号は、アンプ9を介してスピーカ10か
ら楽音として放音される。
The musical note data stored in the RAM 7 is displayed as a musical score on a display device (not shown). In response to the generation of the melody sound event data by the CPU 6, the tone generation circuit 8 generates a melody tone signal corresponding to the event data. The generated tone signal is emitted as a tone from the speaker 10 via the amplifier 9.

【0030】上述の構成を有する本実施例の動作につい
て以下に順次説明する。本実施例における音高検出の原理 本実施例では、DSP3が、デジタル化されたオーディ
オ信号に対して、それぞれ所定の周波数付近の成分のみ
を通過させるN種類のバンドパスフィルタリング処理を
時分割で実行する。更に、DSP3は、上述のN種類の
バンドパスフィルタリング処理の結果得られるN種類の
出力信号からそれぞれエンベロープ信号を抽出する信号
処理を時分割で実行し、この結果得られるN種類のエン
ベロープ信号をCPU6に出力する。ここで、N種類の
バンドパスフィルタリング処理の各伝達関数は、N個の
音高に対応する各所定の周波数付近の成分のみを通過さ
せるような特性に設定される。
The operation of this embodiment having the above-described configuration will be sequentially described below. Principle of Pitch Detection in the Present Embodiment In the present embodiment, the DSP 3 executes N types of bandpass filtering processes on a digitized audio signal by passing only components near a predetermined frequency in a time-division manner. I do. Further, the DSP 3 executes signal processing for extracting an envelope signal from each of the N types of output signals obtained as a result of the above-mentioned N types of band-pass filtering processing in a time-division manner, and converts the resulting N types of envelope signals into the CPU 6. Output to Here, each transfer function of the N kinds of bandpass filtering processes is set to have a characteristic such that only components near predetermined frequencies corresponding to N pitches are passed.

【0031】この結果、CPU6が、上記N種類のエン
ベロープ信号のなかから振幅レベルが所定の閾値を越え
るものを検出することにより、その検出されたエンベロ
ープ信号に対応する音高として、オーディオ信号の音高
すなわちノートナンバーを決定することができる。DSPにおけるフィルタリング処理 DSP3によるフィルタリング処理について以下に説明
する。
As a result, when the CPU 6 detects one of the N types of envelope signals whose amplitude level exceeds a predetermined threshold value, the CPU 6 determines the pitch corresponding to the detected envelope signal as the pitch of the audio signal. The high or note number can be determined. The filtering process by the DSP 3 will be described below.

【0032】本実施例では、DSP3は、上述したN種
類のバンドパスフィルタリング処理を、固定した1種類
の特性のハイパスフィルタリング処理と、それぞれ所定
の周波数でピークを有するレゾナンスが付加されたN種
類のローパスフィルタリング処理とを時分割のカスケー
ド処理として順次実行する信号処理として実現する。ま
た、DSP3は、上述したエンベロープ信号を抽出する
ための信号処理を、各エンベロープ信号に対応する上記
各ローパスフィルタリング処理における各カットオフ周
波数より十分に低いカットオフ周波数を有するN種類の
ローパスフィルタリング処理として実現する。
In the present embodiment, the DSP 3 performs the above-described N kinds of band-pass filtering processing, a high-pass filtering processing of one fixed characteristic, and N kinds of resonance-added resonances each having a peak at a predetermined frequency. The low-pass filtering processing is realized as signal processing sequentially executed as time-division cascade processing. The DSP 3 performs the signal processing for extracting the envelope signal as N types of low-pass filtering processes having cutoff frequencies sufficiently lower than the cutoff frequencies in the lowpass filtering processes corresponding to the envelope signals. Realize.

【0033】なお、以下に説明するフィルタリングアル
ゴリズムは、本出願人が既に出願した特願平 −
の特許出願で開示した実施例に沿ったものであ
るため、以下の説明では概略処理についてのみ説明す
る。
It should be noted that the filtering algorithm described below is based on Japanese Patent Application No.
In the following description, only the outline processing will be described, since it is in accordance with the embodiment disclosed in the above-mentioned patent application.

【0034】まず、ユーザが、スイッチ部11におい
て、特には図示しないメロディデータの生成の開始を指
示するためのスタートスイッチを押すと、CPU6から
DSP3に音高検出処理の開始命令が出力され、その結
果、DSP3がフィルタリング処理のための図2の動作
フローチャートで示される処理を開始する。なお、この
動作フローチャートは、DSP3が、特には図示しない
ROM内に記憶されているマイクロプログラムを実行す
る動作として実現される。
First, when the user presses a start switch for instructing the start of generation of melody data (not shown) in the switch section 11, a start instruction of a pitch detection process is output from the CPU 6 to the DSP 3, and As a result, the DSP 3 starts the processing shown in the operation flowchart of FIG. 2 for the filtering processing. Note that this operation flowchart is realized as an operation in which the DSP 3 executes a microprogram stored in a ROM (not shown).

【0035】始めに、ワークエリアRAM5などの全て
の内容が初期化される(ステップS201)。次に、ス
テップS202において、A/D変換器2において1サ
ンプル分のA/D変換処理が終了するのが待たれ、A/
D変換処理が終了すると、ステップS203において、
デジタルデータに変換された1サンプル分のオーディオ
信号がワークエリアRAM5に取り込まれる。
First, all contents such as the work area RAM 5 are initialized (step S201). Next, in step S202, it is waited for the A / D converter 2 to complete the A / D conversion process for one sample,
When the D conversion processing ends, in step S203,
One sample of the audio signal converted into digital data is taken into the work area RAM 5.

【0036】続いて、ステップS204において、上述
のA/D変換されたオーディオ信号に基づき、固定の伝
達特性を有するハイパスフィルタリング処理が実行され
る。このフィルタリング処理に用いられる各フィルタ係
数は、フィルタ係数用ROM4から読み出される。そし
て、このフィルタリング処理の結果得られた出力は、ワ
ークエリアRAM5に格納される。
Subsequently, in step S204, a high-pass filtering process having a fixed transfer characteristic is executed based on the A / D converted audio signal. Each filter coefficient used for this filtering process is read from the filter coefficient ROM 4. Then, an output obtained as a result of the filtering process is stored in the work area RAM 5.

【0037】以上のハイパスフィルタリング処理は、各
帯域で共通な処理であるため、オーディオ信号の1サン
プルの入力に対して1回のみ実行される。次に、各音高
に対応して、バンドパスフィルタリング処理を実現する
ためのIIRローパスフィルタリング処理と、エンベロ
ープ抽出のためのローパスフィルタリング処理が続けて
実行される。
The above-described high-pass filtering is a process common to each band, and thus is executed only once for one sample of the audio signal. Next, an IIR low-pass filtering process for implementing a band-pass filtering process and a low-pass filtering process for extracting an envelope are successively executed for each pitch.

【0038】ここで、DSP3内に、N音高分の時分割
処理を行うための繰り返し制御用のレジスタtが設けら
れ、ステップS205でレジスタtの値が1に初期設定
される。そして、ステップS206とS207で1音高
分のバンドパスフィルタリング処理を実現するためのI
IRローパスフィルタリング処理とエンベロープ抽出の
ためのローパスフィルタリング処理が終了する毎に、ス
テップS209でレジスタtの内容がNに達したか否か
が判定され、達していなければ、ステップS210にお
いてレジスタtの内容がインクリメントされ、ステップ
S206とS207の処理が繰り返される。
Here, a register t for repetition control for performing time division processing for N pitches is provided in the DSP 3, and the value of the register t is initialized to 1 in step S205. Then, in steps S206 and S207, I for realizing the band-pass filtering process for one pitch.
Each time the IR low-pass filtering process and the low-pass filtering process for envelope extraction are completed, it is determined in step S209 whether or not the content of the register t has reached N. If not, the content of the register t is determined in step S210 Is incremented, and the processing of steps S206 and S207 is repeated.

【0039】この場合、各音高に対応して、バンドパス
フィルタリング処理を実現するためのIIRローパスフ
ィルタリング処理とエンベロープ抽出のためのローパス
フィルタリング処理が実行される毎に、フィルタ係数用
ROM4から、それぞれのフィルタリング処理の伝達関
数に対応したフィルタ係数群が読み出され、それらのフ
ィルタ係数群を使用して各フィルタリング演算が実行さ
れる。
In this case, each time the IIR low-pass filtering process for realizing the band-pass filtering process and the low-pass filtering process for extracting the envelope corresponding to each pitch are performed, the filter coefficient ROM 4 A filter coefficient group corresponding to the transfer function of the filtering process is read out, and each filtering operation is executed using the filter coefficient group.

【0040】上述のステップS206〜S209の処理
の繰り返しとして、バンドパスフィルタリング処理を実
現するためのIIRローパスフィルタリング処理部とエ
ンベロープ抽出のためのローパスフィルタリング処理が
N音高分実行され、この結果、現在のオーディオ信号の
サンプルに対応するN音高分のエンベロープ信号が得ら
れ、ステップS211において各音高番号(1〜N)と
共にCPU6に転送される。
As a repetition of the above-described steps S206 to S209, an IIR low-pass filtering section for realizing band-pass filtering processing and a low-pass filtering processing for envelope extraction are executed for N pitches. An envelope signal of N pitches corresponding to the sample of the audio signal is obtained, and is transferred to the CPU 6 together with each pitch number (1 to N) in step S211.

【0041】以上のステップS203〜S211の処理
は、前述したステップS202において、A/D変換器
2でA/D変換が終了したと判別される毎に繰り返され
る。従って、A/D変換のサンプリング周期毎にN音高
分のエンベロープ信号が得られることになる。メロディデータの書込み処理 次に、CPU6が、入力されるオーディオ信号によって
表現されるメロディに対応するメロディデータを、DS
P3から出力される上述のエンベロープ信号に基づいて
生成し、それをRAM7に書き込むときの動作について
説明する。
The above steps S203 to S211 are repeated every time the A / D converter 2 determines that the A / D conversion has been completed in the above-mentioned step S202. Therefore, an envelope signal for N pitches is obtained every sampling cycle of A / D conversion. Writing process of melody data Next, CPU 6 is, the melody data corresponding to the melody represented by the audio signal input, DS
An operation of generating the envelope signal based on the above-described envelope signal output from P3 and writing the generated envelope signal to the RAM 7 will be described.

【0042】まず、図3は、メロディデータがRAM7
に書き込まれるときのデータフォーマットを示す図であ
る。まず、図3の(a) に示されるように、RAM7に
は、各イベント(メロディ音のノートオン又はノートオ
フ)毎に、LEN[i]とCD[i]とからなる2バイ
ト構成のメロディデータが順次記憶される(i=1、
2、・・・)。ここで、LEN[i](i=1、2、・
・・)は、前回のイベントから今回のイベントまでの経
過時間を表わす。また、CD[i]は、コマンドを表わ
し、通常は、ノートオン又はノートオフのイベントを表
わすフラグとそのイベントのノートナンバーからなり、
メロディ再生の終了時及び後述するタイムオーバー時に
は、それぞれの状態を示すコードからなる。
First, FIG. 3 shows that the melody data is stored in the RAM 7.
FIG. 6 is a diagram showing a data format when data is written to a. First, as shown in FIG. 3A, a 2-byte melody composed of LEN [i] and CD [i] is stored in the RAM 7 for each event (note on or note off of the melody sound). Data is sequentially stored (i = 1,
2, ...). Here, LEN [i] (i = 1, 2,...)
..) represents the elapsed time from the previous event to the current event. CD [i] indicates a command, and usually includes a flag indicating a note-on or note-off event and a note number of the event.
At the end of the melody reproduction and at the time of time-out described later, it is composed of codes indicating respective states.

【0043】図3(b) は、ノートオン又はノートオフの
イベントが発生した時のCD[i]の内容を示す図であ
る。同図のように、下位5ビットには、鍵盤1の32種
類のキーのうちのいずれかを示すノートナンバーが格納
される。6ビット目には、無条件に“0”が格納され
る。また、7ビット目には、メロディ入力装置の番号
(種類)が格納される。通常は、メロディはオーディオ
信号を介して入力され、その信号から音高(ピッチ)が
検出されることによってメロディが検出されるため、こ
の値は“1”である。8ビット目の“0”又は“1”
は、それぞれノートオン又はノートオフを表すフラグで
ある。
FIG. 3B is a diagram showing the contents of CD [i] when a note-on or note-off event occurs. As shown in the figure, the lower five bits store a note number indicating one of the 32 types of keys of the keyboard 1. In the sixth bit, “0” is stored unconditionally. The seventh bit stores the number (type) of the melody input device. Normally, a melody is input via an audio signal, and a melody is detected by detecting a pitch (pitch) from the signal, so that this value is “1”. 8th bit "0" or "1"
Are flags indicating note-on or note-off, respectively.

【0044】図3(c) は、メロディ再生の終了時にRA
M7に書き込まれるCD[i](ENDコマンド)の内
容を表わし、“FF”(16進値)が書き込まれる。図
3(d) は、前回のメロディデータの書込み以後、次のメ
ロディデータが書き込まれるまでの間にタイムオーバー
が発生した場合にRAM7に書き込まれるCD[i]
(TIME OVERコマンド)の内容を表わし、“F
E”(16進値)が書き込まれる。タイムオーバーコマ
ンドについては後述する。
FIG. 3 (c) shows the RA at the end of the melody reproduction.
Represents the contents of CD [i] (END command) written to M7, and "FF" (hexadecimal value) is written. FIG. 3D shows a CD [i] written to the RAM 7 when a time-over occurs between the writing of the previous melody data and the writing of the next melody data.
(TIME OVER command).
E "(hexadecimal value) is written. The time-over command will be described later.

【0045】上述したデータフォーマットを有するメロ
ディデータがRAM7に書き込まれる場合のCPU6の
動作を、図4の動作フローチャートに基づいて説明す
る。このフローは、CPU6が特には図示しないROM
などに記憶された制御プログラムを実行する動作として
実現される。
The operation of the CPU 6 when the melody data having the above-described data format is written into the RAM 7 will be described with reference to the operation flowchart of FIG. This flow is executed by the CPU 6 in a ROM (not shown).
It is realized as an operation of executing a control program stored in the storage device.

【0046】まず、ステップS401において、初期化
処理として、RAM7のメロディデータの格納領域の内
容と、検出されたメロディ音の音長(ノートオンからノ
ートオフまでの時間)をカウントするためにCPU6内
に設けられるレジスタであるカウンタLENGTH、及
びRAM7のメロディデータの格納位置を示すポインタ
iが値“0”にクリアされる。
First, in step S401, as initialization processing, the contents of the storage area of the melody data in the RAM 7 and the duration of the detected melody sound (the time from note-on to note-off) are counted in the CPU 6. The counter LENGTH, which is a register provided in, and the pointer i indicating the storage position of the melody data in the RAM 7 are cleared to the value “0”.

【0047】次に、ステップS402〜S404の繰り
返し処理は、メロディ音の書き込みを所定の単位時間を
基準として行うためのタイミングをとるための繰り返し
処理である。
Next, the repetition processing of steps S402 to S404 is a repetition processing for setting a timing for writing the melody sound with reference to a predetermined unit time.

【0048】すなわち、ステップS402では、DSP
3から出力されるN音高分のエンベロープ信号に基づい
て、何れかの音高を有するメロディ音のノートオン(O
N)又はノートオフ(OFF)が発生したか否かが検出
される。ここでは、例えば次のようなアルゴリズムによ
ってノートオン又はノートオフが検出される。
That is, in step S402, the DSP
3, the note-on (O) of the melody sound having any pitch based on the envelope signal of N pitches output from N.
It is detected whether N) or note-off (OFF) has occurred. Here, for example, note-on or note-off is detected by the following algorithm.

【0049】まず、DSP3から出力されるN音高分の
エンベロープ信号のうち、その振幅値(絶対値)の大き
い順に2つのエンベロープ信号が取り出される。次に、
それらのエンベロープ信号のうち振幅値が所定の条件を
満たしているエンベロープ信号に対応する音高に等しい
ノートナンバーが、メロディ音の発音が開始されるノー
トナンバーとして記憶される。そして、その記憶された
ノートナンバーと現在ノートオン中のノートナンバーと
が比較されることによって、ノートオン又はノートオフ
の発生が検出される。すなわち、新たに記憶されたノー
トナンバーが現在ノートオン中でなければ、新たなノー
トオンの発生が検出される。また、新たに記憶されたノ
ートナンバーのなかに現在ノートオン中のノートナンバ
ーが存在しなければ、新たなノートオフの発生が検出さ
れる。
First, of the envelope signals for N pitches output from the DSP 3, two envelope signals are extracted in the order of increasing amplitude value (absolute value). next,
A note number equal to the pitch corresponding to the envelope signal whose amplitude value satisfies a predetermined condition among the envelope signals is stored as the note number at which the sound of the melody sound is started. Then, the occurrence of note-on or note-off is detected by comparing the stored note number with the note number of the current note-on. That is, if the newly stored note number is not currently note-on, occurrence of a new note-on is detected. If the currently stored note number does not include the currently note-on note number, the occurrence of a new note-off is detected.

【0050】以上のようなノートオン又はノートオフの
検出処理の後、ステップS403では、ユーザによって
スイッチ部11においてメロディデータの記録を停止す
るための特には図示しないSTOPキーが押されたか否
かが判定される。この判定がNOならステップS404
が実行される。なお、この判定がYESとなる場合のス
テップS418とS419の各処理については後述す
る。
After the above note-on or note-off detection processing, in step S403, it is determined whether or not a STOP key (not shown) for stopping the recording of the melody data in the switch section 11 has been pressed by the user. Is determined. If this determination is NO, step S404
Is executed. The processing in steps S418 and S419 when this determination is YES will be described later.

【0051】ステップS404では、特には図示しない
ハードタイマにおいて最小計測単位時間が経過したか否
かが判定され、この判定がNOならステップS402に
戻る。今、最小計測単位時間とは、例えば全音符の1/
96に相当する時間であり、前回にメロディ音の書込み
に関する制御処理が行われてから上記最小計測単位時間
が経過するまでは、次の制御処理は行われない。すなわ
ち、メロディ音の書込みに関する制御処理は、必ず上記
最小計測単位時間を単位として行われることになる。な
お、この最小計測単位時間は、上述したように例えば全
音符の1/96に相当する相対的な時間であり、ユーザ
が特には図示しないハードタイマにおけるテンポを調整
すればこの時間長も異なってくる。
In step S404, a hardware timer (not shown) determines whether the minimum measurement unit time has elapsed. If the determination is NO, the process returns to step S402. Now, the minimum measurement unit time is, for example, 1 / one of a whole note.
This is a time corresponding to 96, and the next control processing is not performed until the above-described minimum measurement unit time has elapsed since the last control processing related to the writing of the melody sound. That is, the control process for writing the melody sound is always performed in units of the minimum measurement unit time. Note that the minimum measurement unit time is a relative time corresponding to, for example, 1/96 of a whole note, as described above. If the user adjusts the tempo in a hard timer (not shown), the time length may be different. come.

【0052】ステップS404の判定がYESとなる
と、つぎのステップS405で、前述したステップS4
02でのノートオン又はノートオフの検出結果に基づい
て、新たなノートオン(ON)又はノートオフ(OF
F)が発生したか否かが判定される。
If the determination in step S404 is YES, in the next step S405, the aforementioned step S4
02, a new note-on (ON) or a new note-off (OF)
It is determined whether or not F) has occurred.

【0053】新たなノートオン又はノートオフがなくス
テップS405の判定がNOである場合は、ステップS
413を介して(後述する)、ステップS414におい
てカウンタLENGTHの内容がインクリメントされ、
その後、前述したステップS402に戻る。ここで、カ
ウンタLENGTHの内容は、新たなノートオン又はノ
ートオフのイベントが発生してその情報がRAM7に書
き込まれる毎に、後述するステップS411においてク
リアされる。従って、カウンタLENGTHの内容は、
前回のイベントが発生してからの最小計測単位時間を単
位とする経過時間を表わしていることになる。
If there is no new note-on or note-off and the determination in step S405 is NO, step S405
413 (described later), the content of the counter LENGTH is incremented in step S414,
Thereafter, the process returns to step S402 described above. Here, the content of the counter LENGTH is cleared in step S411 described later every time a new note-on or note-off event occurs and the information is written to the RAM 7. Therefore, the content of the counter LENGTH is
This represents the elapsed time in units of the minimum measurement unit time since the last event occurred.

【0054】そして、新たなノートオン又はノートオフ
のイベントが検出されステップS405の判定がYES
となると、ステップS406で、前回のイベントからの
経過時間を表わしている上記カウンタLENGTHの値
が、ポインタiにより指示されているメロディデータ格
納領域における最新のメロディデータの1バイト目の時
間データLEN[i](図3(a) 参照)として、RAM
7に書き込まれる。
Then, a new note-on or note-off event is detected, and the determination in step S405 is YES.
In step S406, the value of the counter LENGTH representing the elapsed time from the previous event is set to the time data LEN [of the first byte of the latest melody data in the melody data storage area indicated by the pointer i. i] (see FIG. 3A)
7 is written.

【0055】次に、上記時間データLEN[i]と組で
記憶されるべきコマンドCD[i](図3(a) 参照)と
して、次のような各データがRAM7に書き込まれる。
すなわち、まず、ステップS407において、現在検出
されているイベントがノートオンであるかノートオフで
あるかが判定され、その判定結果に応じて、ステップS
408又はS409において、コマンドCD[i]の8
ビット目に、ノートオフを示すフラグOFF=“1”又
はノートオンを示すフラグON=“0”の何れかが書き
込まれる。続いて、ステップS410で、コマンドCD
[i]の下位5ビットに、現在検出されているイベント
(ノートオン又はノートオフ)のノートナンバーが書き
込まれる。
Next, the following data are written in the RAM 7 as a command CD [i] (see FIG. 3A) to be stored in combination with the time data LEN [i].
That is, first, in step S407, it is determined whether the currently detected event is note-on or note-off, and according to the determination result, step S407 is performed.
In 408 or S409, 8 of the command CD [i]
Either flag OFF = “1” indicating note-off or flag ON = “0” indicating note-on is written in the bit. Subsequently, in step S410, the command CD
In the lower 5 bits of [i], the note number of the currently detected event (note on or note off) is written.

【0056】その後、ステップS411においてカウン
タLENGTHの内容が値“0”にクリアされ、ステッ
プS412においてポインタiの値がインクリメントさ
れた後、ステップS402に戻る。
Thereafter, the content of the counter LENGTH is cleared to "0" in step S411, the value of the pointer i is incremented in step S412, and the process returns to step S402.

【0057】ここで、時間データLEN[i]は、1バ
イトのデータであるため、最大で255時間単位までの
値しか表現できない。そこで、上述のメロディデータの
書込み動作中に、ステップS413においてカウンタL
ENGTHの値が“255”に達したと判定された場合
は、イベントに対する時間計測をいったん区切るため
に、メロディデータ格納領域にタイムオーバーコマンド
が書き込まれる。
Here, since the time data LEN [i] is 1-byte data, it can express only a value up to a unit of 255 hours. Therefore, during the above-mentioned melody data write operation, the counter L is set in step S413.
If it is determined that the value of ENGTH has reached “255”, a time-over command is written in the melody data storage area to temporarily stop the time measurement for the event.

【0058】すなわち、まずステップS415におい
て、時間単位の最大値“255”が、ポインタiによっ
て指示されているメロディデータ格納領域における最新
のメロディデータの1バイト目の時間データLEN
[i]として、RAM7に書き込まれる。
That is, first, in step S415, the maximum value “255” in the time unit is set to the time data LEN of the first byte of the latest melody data in the melody data storage area pointed to by the pointer i.
It is written to the RAM 7 as [i].

【0059】次に、ステップS416において、上記時
間データLEN[i]と組で記憶されるべきコマンドC
D[i]として、タイムオーバーを示すコード“FE”
(図3(d) 参照)が書き込まれる。
Next, in step S416, the command C to be stored in combination with the time data LEN [i]
A code “FE” indicating time over is set as D [i].
(See FIG. 3D) is written.

【0060】その後、ステップS417においてカウン
タLENGTHの内容が値“0”にクリアされ、ステッ
プS412においてポインタiの値がインクリメントさ
れた後、ステップS402に戻る。
Thereafter, the content of the counter LENGTH is cleared to "0" in step S417, the value of the pointer i is incremented in step S412, and the process returns to step S402.

【0061】以上の処理が繰り返し行われることによっ
て、メロディ音のノートオン又はノートオフ毎に、メロ
ディデータが順次RAM7に書き込まれる。ユーザによ
って特には図示しないメロディデータの記録を停止する
ためのSTOPキーが押されると、ステップS403の
判定がYESとなる。
By repeating the above processing, the melody data is sequentially written into the RAM 7 every time the melody sound is turned on or off. When the user presses a STOP key for stopping recording of melody data (not shown), the determination in step S403 becomes YES.

【0062】この場合、ステップS418において、カ
ウンタLENGTHの値が、ポインタiによって指示さ
れているメロディデータ格納領域における最後のメロデ
ィデータの1バイト目の時間データLEN[i]として
RAM7に書き込まれた後、続くステップS419にお
いて、上記時間データLEN[i]と組で記憶されるべ
きコマンドCD[i]として、書込み動作の終了を示す
コード“FF”(図3(c) 参照)が書き込まれる。音符化アルゴリズム 次に、上述の動作によってRAM7のメロディデータ格
納領域に記憶されたメロディデータを、楽譜として表現
可能な音符データに変換する処理動作のアルゴリズムに
ついて説明する。
In this case, after the value of the counter LENGTH is written to the RAM 7 as time data LEN [i] of the first byte of the last melody data in the melody data storage area pointed by the pointer i in step S418. In the subsequent step S419, a code "FF" (see FIG. 3C) indicating the end of the write operation is written as the command CD [i] to be stored in combination with the time data LEN [i]. Note algorithm then melody data stored in the melody data storage area of RAM7 by the above-described operation, the algorithm of the processing operation of converting the musical note data can be represented as a score will be described.

【0063】上述したように、メロディ音のノートオン
又はノートオフは、例えば全音符の1/96の最小計測
単位時間の精度で、メロディデータに変換されてRAM
7に記憶される。これにより、メロディ音の再生を、十
分な時間精度でリアルタイムに記録できる。このような
メロディデータに基づいて楽譜として表現可能な音符デ
ータを生成するために、音符データの生成処理が実行さ
れる。
As described above, the note-on or note-off of the melody sound is converted into melody data with an accuracy of, for example, a minimum measurement unit time of 1/96 of a whole note, and the RAM
7 is stored. Thereby, the reproduction of the melody sound can be recorded in real time with sufficient time accuracy. In order to generate note data that can be expressed as a musical score based on such melody data, a note data generation process is performed.

【0064】この処理では、RAM7内に例えば全音符
の1/96の最小計測単位時間の精度で記録されてい
る、時間データLEN[i]とコマンドCD[i](図
3(a)参照)とからなるメロディデータが、例えば全音
符の1/16すなわち16分音符の時間単位(以下、こ
れを「最小音符単位」と呼ぶ)の精度を有する音符デー
タに変換されて、RAM7内の音符データの格納領域に
記憶し直される。
In this process, the time data LEN [i] and the command CD [i] recorded in the RAM 7 with an accuracy of, for example, a minimum measurement unit time of 1/96 of a whole note (see FIG. 3A) Is converted to note data having an accuracy of, for example, 1/16 of a whole note, that is, a 1 / 16th note time unit (hereinafter, referred to as a "minimum note unit"), and the note data in the RAM 7 is stored in the RAM 7. Is stored again in the storage area.

【0065】1組の音符データは、16分音符を時間単
位とする音符長を示す音符長データと、各音符のノート
ナンバー又は休符であることを示すコードとで構成され
る。このような音符データは、5線譜上に容易に楽譜化
することが可能となる。
One set of note data is composed of note length data indicating a note length in 16th note time units, and a code indicating a note number or a rest of each note. Such note data can be easily converted into a score on a five-line staff.

【0066】ここで、メロディデータには、その時間デ
ータLEN[i]の時間長が最小音符長に達しないもの
もあるし、各メロディ音の発音タイミングが僅かに重な
っている場合もある。また、各メロディ音の開始や終了
位置は、16分音符の時間単位には同期していない。
Here, among the melody data, there is a case where the time length of the time data LEN [i] does not reach the minimum note length, and a case where the sounding timing of each melody sound slightly overlaps. Also, the start and end positions of each melody sound are not synchronized with each other in time units of sixteenth notes.

【0067】そのため、音符データの生成処理において
は、各時間データLEN[i]を適切に音符長データに
変換するための音符化アルゴリズムが必要となる。そこ
で、まず、この音符化アルゴリズムについて、図5〜図
10の説明図を用いて説明する。
Therefore, in the process of generating note data, a note conversion algorithm for properly converting each time data LEN [i] to note length data is required. Therefore, first, the note conversion algorithm will be described with reference to the explanatory diagrams of FIGS.

【0068】図5は、図6〜図10に示される各音符化
アルゴリズムの説明図の見方を示した図である。図5
(a) には、音符データの時間単位が示されている。長い
目盛間の間隔が最小音符長であり、短い目盛は各最小音
符長の1/2を表わす。
FIG. 5 is a diagram showing how to explain the respective note conversion algorithms shown in FIGS. 6 to 10. FIG.
(a) shows the time unit of the note data. The interval between long ticks is the minimum note length, and the short ticks represent 1/2 of each minimum note length.

【0069】図5(b) には、検出されたメロディデータ
に基づいて生成され得るメロディ音の音長(線分の長
さ)と、その開始位置(以下、これを「補正前開始位
置」と呼ぶ)及び終了位置(以下、これを「補正前終了
位置と呼ぶ」)が示される。これらのタイミングは、R
AM7から順次読み出される時間データLEN[i]
(i=1、2、・・・)により決定される。
FIG. 5B shows the sound length (length of a line segment) of a melody sound that can be generated based on the detected melody data, and its start position (hereinafter referred to as “before correction start position”). ) And an end position (hereinafter, referred to as “pre-correction end position”). These timings are R
Time data LEN [i] sequentially read from AM7
(I = 1, 2,...).

【0070】図5(c) には、図5(b) の生成タイミング
を有するメロディデータを変換して得られる音符データ
に基づいて生成され得るメロディ音の音符長(線分の長
さ)と、その開始位置(以下、これを「補正後開始位
置」と呼ぶ)及び終了位置(以下、これを「補正後終了
位置と呼ぶ」)が示される。これらのタイミングは、音
符化アルゴリズムによって生成される音符長データによ
り決定される。
FIG. 5 (c) shows the note length (length of a line segment) of a melody sound which can be generated based on the note data obtained by converting the melody data having the generation timing of FIG. 5 (b). , The start position thereof (hereinafter referred to as “post-correction start position”) and the end position thereof (hereinafter referred to as “post-correction end position”). These timings are determined by the note length data generated by the note conversion algorithm.

【0071】図6は、第1の音符化アルゴリズムを示し
た説明図である。すなわち、補正前開始位置が、図6の
Aに示されるように、それが含まれる最小音符長範囲の
前半の1/2の範囲にある場合には、補正後開始位置
は、図6のA′に示されるように、上記補正前開始位置
が含まれる最小音符長範囲の左端位置となる。
FIG. 6 is an explanatory diagram showing the first musical note conversion algorithm. That is, as shown in FIG. 6A, if the pre-correction start position is in the first half of the minimum note length range that includes the correction start position, the post-correction start position is set to A in FIG. ′, It is the left end position of the minimum note length range including the before-correction start position.

【0072】また、補正前開始位置が、図6のB又はC
に示されるように、それが含まれる最小音符長範囲の後
半の1/2の範囲にある場合は、補正後開始位置は、図
6のB′又はC′に示されるように、上記補正前開始位
置が含まれる最小音符長範囲の右端位置となる。
Further, the start position before correction is set to B or C in FIG.
As shown in FIG. 6, when it is in the latter half of the minimum note length range in which it is included, the corrected start position is, as shown in B ′ or C ′ in FIG. It is the right end position of the minimum note length range including the start position.

【0073】一方、補正前終了位置が、図6のA又はC
に示されるように、それが含まれる最小音符長範囲の後
半の1/2の範囲にある場合は、補正後終了位置は、図
6のA′又はC′に示されるように、上記補正前終了位
置が含まれる最小音符長範囲の右端位置となる。
On the other hand, if the pre-correction end position corresponds to A or C in FIG.
As shown in FIG. 6, when it is in the latter half range of the minimum note length range in which it is included, the post-correction end position is, as shown in A ′ or C ′ in FIG. This is the right end position of the minimum note length range including the end position.

【0074】また、補正前終了位置が、図6のBに示さ
れるように、それが含まれる最小音符長範囲の前半の1
/2の範囲にある場合は、補正後終了位置は、図6の
B′に示されるように、上記補正前終了位置が含まれる
最小音符長範囲の左端位置となる。
As shown in FIG. 6B, the end position before correction is the first half of the minimum note length range including the end position.
In the case of the range of / 2, the post-correction end position is the left end position of the minimum note length range including the pre-correction end position as shown in B 'of FIG.

【0075】従って、図6のAのタイミングを有するメ
ロディデータは、図6のA′のタイミングを有する音符
長が2(16分音符2個分で8分音符に対応する)の音
符データに変換され、図6のB及びCの各タイミングを
有する各メロディデータは、図6のB′及びC′の各タ
イミングを有する音符長が1(16分音符に対応する)
の各音符データに変換される。
Therefore, the melody data having the timing of A in FIG. 6 is converted into note data having a timing of A 'in FIG. 6 and having a note length of 2 (two 16th notes corresponding to eighth notes). The melody data having the timings B and C in FIG. 6 has a note length of 1 (corresponding to the sixteenth note) having the timings B 'and C' in FIG.
Is converted to each note data.

【0076】また、図6のB′及びC′の各タイミング
を有する各音符データ間には、音符長が1の休符の音符
データが挿入される。図7は、第2の音符化アルゴリズ
ムを示した説明図である。
Further, rest note data having a note length of 1 is inserted between the note data having the timings B 'and C' in FIG. FIG. 7 is an explanatory diagram showing the second musical note conversion algorithm.

【0077】メロディ音をレガート奏法で再生されたよ
うな場合、1つのメロディ音の発音終了直前すなわち離
鍵の直前に、つぎのメロディ音の発音が開始される場合
が多い。この場合、2つのメロディ音のタイミングが、
図7のA、B又はCのように、極く短時間だけ重なるこ
とになる。
When a melody sound is reproduced by the legato playing technique, the sound of the next melody sound is often started immediately before the end of the sound of one melody sound, that is, immediately before the key is released. In this case, the timing of the two melody sounds is
As shown in FIG. 7A, B or C, they overlap for a very short time.

【0078】このような場合において、図7の例のよう
に、各メロディデータによって定まるA、B、Cなどの
タイミングの各音長が最小音符長の1/2より長い場合
には、Aのタイミングを有するメロディデータの補正前
終了位置が、Bのタイミングを有するメロディデータの
補正前開始位置と同じ位置にシフトされる。同様に、B
のタイミングを有するメロディデータの補正前終了位置
が、Cのタイミングを有するメロディデータの補正前開
始位置と同じ位置にシフトされる。また、A、B及びC
の各タイミングを有する各メロディデータの補正前開始
位置は、それぞれ自身の補正前開始位置のままとされ
る。
In such a case, as shown in the example of FIG. 7, when each note length of timing such as A, B, C determined by each melody data is longer than 最小 of the minimum note length, A The pre-correction end position of the melody data having the timing is shifted to the same position as the pre-correction start position of the melody data having the timing B. Similarly, B
Is shifted to the same position as the pre-correction start position of the melody data having the timing of C. A, B and C
, The pre-correction start position of each melody data having the respective timings is maintained as its own pre-correction start position.

【0079】このような置き換えが行われた後に、前述
した図6の第1の音符化アルゴリズムが実行される。こ
の結果、A、B及びCの各タイミングを有する各メロデ
ィデータは、A′、B′及びC′の各タイミングを有す
る各音符データに変換される。
After such replacement is performed, the above-described first note conversion algorithm of FIG. 6 is executed. As a result, each melody data having each timing of A, B and C is converted into each note data having each timing of A ', B' and C '.

【0080】図8は、第3の音符化アルゴリズムを示し
た説明図である。図7の例の場合と同様、2つのメロデ
ィ音のタイミングが、図8のA、B又はC、Dのように
重なっている場合において、B又はCのように、音長が
最小音符長の1/2より短い区間が存在する場合には、
その区間がもう一方のA又はDなどの区間に吸収(マー
ジ)された上で、前述した図6の第1の音符化アルゴリ
ズムが実行される。その結果、図8において、A及びB
のタイミングを有するメロディデータは、音符長が2
(8分音符に対応する)で、ノートナンバーがAのタイ
ミングを有するメロディデータのノートナンバーと同じ
A′のタイミングを有する音符データに変換される。同
様に、C及びDのタイミングを有するメロディデータ
は、音符長が2で、ノートナンバーがDのタイミングを
有するメロディデータのノートナンバーと同じD′のタ
イミングを有する音符データに変換される。
FIG. 8 is an explanatory diagram showing a third musical note conversion algorithm. As in the case of the example of FIG. 7, when the timings of the two melody sounds overlap as in A, B or C, D in FIG. If there is a section shorter than 1/2,
After the section is absorbed (merged) into the other section such as A or D, the above-described first note conversion algorithm in FIG. 6 is executed. As a result, in FIG.
The melody data having the timing of
(Corresponding to the eighth note), the note number is converted to note data having the same A 'timing as the note number of the melody data having the timing of A. Similarly, the melody data having the timings C and D is converted to note data having a note length of 2 and the same D 'timing as the note number of the melody data having the note number D timing.

【0081】図9は、第4の音符化アルゴリズムを示し
た説明図である。図9のAのように、メロディデータに
よって定まる音長が最小音符長の1/2より短く、他の
タイミングを有するメロディデータと重なっていない場
合、そのメロディデータは、音符データには変換されず
に無視される。
FIG. 9 is an explanatory diagram showing a fourth musical note conversion algorithm. As shown in FIG. 9A, when the note length determined by the melody data is shorter than 最小 of the minimum note length and does not overlap with melody data having another timing, the melody data is not converted to note data. Ignored.

【0082】図10は、第5の音符化アルゴリズムを示
した説明図である。例えば図10のBのように、メロデ
ィデータによって定まる音長が最小音符長の1/2にち
ょうど等しい場合、その補正前開始位置がそれが含まれ
る最小音符長範囲の前半の1/2の範囲にある場合に
は、Bのタイミングを有するメロディデータは、B′の
ようなタイミングを有する音符長1(最小音符長)の音
符データに変換される。一方、図10のAのように、や
はりメロディデータによって定まる音長が最小音符長の
1/2にちょうど等しい場合であって、その補正前開始
位置がそれが含まれる最小音符長範囲の後半の1/2の
範囲にある場合には、前述した図9の第4の音符化アル
ゴリズムと同様、そのメロディデータは、音符データに
は変換されずに無視される。音符データの生成処理 上述の音符化アルゴリズムに従って、RAM7のメロデ
ィデータ格納領域に記憶されたメロディデータを、楽譜
として表現可能な音符データに変換してRAM7に記憶
する音符データ生成処理の具体的動作について以下に説
明する。
FIG. 10 is an explanatory diagram showing a fifth note conversion algorithm. For example, as shown in FIG. 10B, when the note length determined by the melody data is exactly equal to 最小 of the minimum note length, the start position before correction is within the range of 前 of the first half of the minimum note length range in which it is included. , The melody data having the timing of B is converted to note data having a note length of 1 (minimum note length) having a timing of B '. On the other hand, as shown in FIG. 10A, a case where the note length also determined by the melody data is exactly equal to 最小 of the minimum note length, and the uncorrected start position corresponds to the latter half of the minimum note length range in which it is included. If it is in the range of 1/2, the melody data is ignored without being converted to note data, similarly to the above-described fourth note conversion algorithm in FIG. According note algorithm generation process described above for note data, the melody data stored in the melody data storage area of the RAM 7, the specific operation of the note data generating process to be stored in the RAM 7 and converts the note data that can be represented as a score This will be described below.

【0083】図11〜図14は、音符データ生成処理の
動作フローチャート、図15は、音符データ生成処理に
おいて実行される音符長の暫定的判定処理の動作フロー
チャートである。これらのフローは、CPU6が特には
図示しないROMなどに記憶された制御プログラムを実
行する動作として実現される。
FIGS. 11 to 14 are operation flowcharts of note data generation processing, and FIG. 15 is an operation flowchart of note length provisional determination processing executed in the note data generation processing. These flows are realized as an operation in which the CPU 6 executes a control program stored in a ROM (not shown) or the like.

【0084】まず、ステップS1101において、初期
化の処理として、RAM7内のワーク領域と、音符デー
タ格納領域がクリアされる。次に、ステップS1102
において、ポインタiの内容が“1”に初期設定され、
また、フラグOFF_FLAGが“0”に初期設定され
る。これらのフラグとポインタは、図1のCPU6内の
レジスタとして設けられる。
First, in step S1101, a work area in the RAM 7 and a note data storage area are cleared as initialization processing. Next, step S1102
, The content of the pointer i is initialized to “1”,
Further, the flag OFF_FLAG is initialized to “0”. These flags and pointers are provided as registers in the CPU 6 of FIG.

【0085】続いて、ステップS1103において、メ
ロディを構成している各メロディ音の音長を格納するレ
ジスタN_LEN、メロディ音の休止時間すなわちメロ
ディ音が発音されていない状態の時間を格納するレジス
タR_LEN、時間軸上の現在位置を格納するレジスタ
D_P、メロディ音の開始位置を格納するレジスタN_
P、メロディ音の休止開始位置を格納するレジスタR_
Pのそれぞれの内容が“0”に初期化される。
Subsequently, in step S1103, a register N_LEN for storing the length of each melody sound constituting the melody, a register R_LEN for storing a pause time of the melody sound, that is, a time in which the melody sound is not sounded, Register D_P for storing the current position on the time axis, register N_ for storing the start position of the melody sound
P, a register R_ for storing the pause start position of the melody sound
Each content of P is initialized to "0".

【0086】上述の動作の後、ステップS1104にお
いて、RAM7のメロディデータ格納領域から、ポイン
タiで指示される格納位置のメロディデータである時間
データLEN[i]とコマンドCD[i]が読み出され
る(図3(a) 参照)。
After the above operation, in step S1104, the time data LEN [i] and the command CD [i], which are the melody data at the storage position indicated by the pointer i, are read from the melody data storage area of the RAM 7 (step S1104). See FIG. 3 (a)).

【0087】次に、ステップS1105で、レジスタD
_Pに、時間データLEN[i]が加算されることによ
り、現在の時間軸上の位置が移動される。そして、ステ
ップS1106において、読み込まれたCD[i]の内
容が判定されることにより、検出されたイベントの種類
が判定される(図3(b),(c),(d)参照)。
Next, in step S1105, the register D
By adding the time data LEN [i] to _P, the current position on the time axis is moved. In step S1106, the type of the detected event is determined by determining the content of the read CD [i] (see FIGS. 3B, 3C, and 3D).

【0088】この判定において、イベントがメロディの
終了(END、図3(c) 参照)を示していれば、ステッ
プS1109で、最後の小節線までの休符を示す音符デ
ータがRAM7の音符データ格納領域に書き込まれ、処
理が終了する。
In this determination, if the event indicates the end of the melody (END, see FIG. 3C), note data indicating a rest up to the last bar is stored in the note data in the RAM 7 in step S1109. The data is written to the area, and the process ends.

【0089】ステップS1106の判定において、イベ
ントがノートオフ(OFF、図3(b) 参照)又はタイム
オーバー(TIME OVER、図3(c) 参照)を示し
ている場合には、ステップS1107において、メロデ
ィ音の休止時間を示すレジスタR_LENに、前回のイ
ベントからの経過時間LEN[i]が加算される。
If it is determined in step S1106 that the event indicates note-off (OFF, see FIG. 3B) or time-out (TIME OVER, see FIG. 3C), the melody sound is output in step S1107. , The elapsed time LEN [i] from the previous event is added to the register R_LEN indicating the pause time.

【0090】そして、ステップS1108において、ポ
インタiがインクリメントされて、ステップS1104
に戻り、つぎのメロディデータが読み出される。上述の
ステップS1104〜S1108の処理は、読み出され
るメロディデータがノートオン(ON)のイベントを示
すまで繰り返し行われる。そして、ノートオンイベント
が読み出されると、ステップS1106の後にS111
0が実行される。このようにして、1つのメロディデー
タに対応する補正前開始位置(図5参照)が確定する。
Then, in step S1108, the pointer i is incremented, and in step S1104
And the next melody data is read. The processes in steps S1104 to S1108 described above are repeatedly performed until the melody data to be read indicates a note-on (ON) event. When the note-on event is read, after step S1106, S111
0 is executed. In this way, the pre-correction start position (see FIG. 5) corresponding to one piece of melody data is determined.

【0091】ステップS1110では、ノートオンのコ
マンドCD[i]に含まれるノートナンバー(図3(b)
参照)が、CPU6内に設けられている第1音高レジス
タPITCH1と、同じくCPU6内に設けられている
最新音高レジスタEND_PITCHにそれぞれ格納さ
れる。
In step S1110, the note number included in the note-on command CD [i] (FIG. 3B)
) Is stored in a first pitch register PITCH1 provided in the CPU 6 and a latest pitch register END_PITCH also provided in the CPU 6.

【0092】次のステップS1111とS1112につ
いては後述するが、最初はOFF_FLAGは“1”で
ステップS1111の判定はYESとなる。従って、ス
テップS1112において、メロディデータ格納領域の
先頭に記憶されている時間データLEN[i]=LEN
[0]が、メロディ音の休止時間を示すレジスタR_L
ENに足し込まれる。このレジスタR_LENの内容
は、メロディの書込みを開始してから最初のメロディ音
の再生が開始されるまでの休符に相当する。この休符
は、後のステップS1144の判定処理によって有効な
休符長を有すると判定されれば、実際に音符データとし
てRAM7内の音符データ格納領域に格納される。
The following steps S1111 and S1112 will be described later, but initially OFF_FLAG is "1" and the determination in step S1111 is YES. Therefore, in step S1112, the time data LEN [i] = LEN stored at the head of the melody data storage area.
[0] is a register R_L indicating the pause time of the melody sound
Added to EN. The content of the register R_LEN corresponds to a rest from the start of writing of the melody to the start of reproduction of the first melody sound. This rest is actually stored as note data in the note data storage area in the RAM 7 if it is determined that the rest has a valid rest length by the determination processing in step S1144.

【0093】その後、ステップS1113において、ポ
インタjに、ポインタiの内容を+1した値が格納され
る。また、メロディ音の音長を格納するレジスタN_L
ENの内容がクリアされる。
Thereafter, in step S1113, a value obtained by adding +1 to the content of the pointer i is stored in the pointer j. Also, a register N_L for storing the length of the melody sound
The contents of EN are cleared.

【0094】次に、ステップS1114において、メロ
ディ音の開始位置を格納するレジスタN_Pに、レジス
タD_Pに格納された現在のメロディデータに対応する
補正前開始位置(ステップS1105参照)が格納され
る。
Next, in step S1114, the uncorrected start position (see step S1105) corresponding to the current melody data stored in the register D_P is stored in the register N_P storing the start position of the melody sound.

【0095】続いて、ステップS1116において、R
AM7のメロディデータ格納領域から、ポインタjで指
示される格納位置のメロディデータである時間データL
EN[j]とコマンドCD[j]が読み出される。この
データは、ステップS1105で読み出されたメロディ
データ(LEN[i]とCD[i])のつぎのデータで
ある(ステップS1113参照)。
Subsequently, at step S1116, R
From the melody data storage area of AM7, the time data L which is the melody data at the storage position indicated by the pointer j
EN [j] and command CD [j] are read. This data is the next data of the melody data (LEN [i] and CD [i]) read in step S1105 (see step S1113).

【0096】そして、ステップS1117で、レジスタ
D_Pに、時間データLEN[j]が加算されることに
より、上述の読み出されたLEN[j]の時間分だけ時
間軸上の現在位置が移動される。
In step S1117, the time data LEN [j] is added to the register D_P, so that the current position on the time axis is moved by the time of the read LEN [j]. .

【0097】更に、ステップS1118において、メロ
ディ音の音長を格納するレジスタN_LENの内容にも
上記時間データLEN[j]が加算される。次に、ステ
ップS1119で、コマンドCD[j]が示すイベント
が、メロディの終了を示すENDコマンド(図3(c) 参
照)であるか否かが判定される。
Further, in step S1118, the time data LEN [j] is also added to the contents of the register N_LEN for storing the length of the melody sound. Next, in step S1119, it is determined whether or not the event indicated by the command CD [j] is an END command (see FIG. 3C) indicating the end of the melody.

【0098】この判定がYESなら、後述するステップ
S1143の音符長の暫定的判定処理が実行される。ス
テップS1119の判定がNOなら、ステップS112
0で、コマンドCD[j]が示すイベントが、ノートオ
ンであるか否かが判定される。
If this determination is YES, provisional determination processing of the note length in step S1143 described later is executed. If the determination in step S1119 is NO, step S112
At 0, it is determined whether or not the event indicated by the command CD [j] is note-on.

【0099】この判定がノートオンでないなら、ステッ
プS1121において、コマンドCD[j]によって示
されるノートオフイベントのノートナンバーが、音高レ
ジスタEND_PITCHに格納されているステップS
1104で読み出された1イベント前のノートオンイベ
ントのノートナンバー(S1110参照)と同じである
か否かが判定される。
If this determination is not note-on, in step S1121, the note number of the note-off event indicated by the command CD [j] is stored in the pitch register END_PITCH.
It is determined whether or not it is the same as the note number of the note-on event immediately before the event read out in 1104 (see S1110).

【0100】1イベント前のノートオンイベントのノー
トナンバーと同じノートナンバーのメロディ音がノート
オフされ、ステップS1121の判定がYESとなった
場合には、ステップS1122において、フラグOFF
_FLAGが“1”にされる。また、ポインタiの内容
が、ポインタjの内容を+1した値にされる。
The melody sound having the same note number as the note number of the note-on event one event before is note-off, and if the judgment in step S1121 is YES, the flag OFF is set in step S1122.
_FLAG is set to “1”. Further, the content of the pointer i is set to a value obtained by adding +1 to the content of the pointer j.

【0101】この状態が発生する動作例を図16に示
す。ONはノートオンイベントを表わし、OFFはノー
トオフイベントを表わす。同図から理解されるように、
この状態は、図6の第1の音符化アルゴリズムが適用さ
れる状態で代表されるように、メロディ音が重なってい
ない状態である。このようにして、メロディ音が重なっ
ていない状態の補正前開始位置(N_Pの値)と、補正
前終了位置(D_Pの値)と、メロディ音の音長(N_
LENの値)からなる1組が確定する。そして、このよ
うな状態がフラグOFF_FLGが“1”の状態とな
る。
FIG. 16 shows an operation example in which this state occurs. ON indicates a note-on event, and OFF indicates a note-off event. As understood from the figure,
This state is a state in which the melody sounds do not overlap, as represented by the state in which the first note conversion algorithm in FIG. 6 is applied. In this way, the pre-correction start position (N_P value), the pre-correction end position (D_P value), and the melody sound length (N_P) in a state where the melody sounds do not overlap.
LEN) is determined. Then, such a state is a state where the flag OFF_FLG is “1”.

【0102】以上のようにして、補正前開始位置と補正
前終了位置とメロディ音の音長とからなる1組が決定さ
れたら、後述するステップS1143の音符長の暫定的
判定処理で、前述した第1の音符化アルゴリズム(図6
参照)に基づく処理が実行される。
As described above, when one set of the pre-correction start position, the pre-correction end position, and the melody sound length is determined, the above-mentioned provisional determination processing of the note length in step S1143 will be described later. First note conversion algorithm (FIG. 6)
) Is performed.

【0103】一方、コマンドCD[j]が示すイベント
がノートオンであり、ステップS1120の判定がYE
Sとなると、ステップS1123に進む。この状態が発
生する動作例を図17に示す。この状態は、図7の第2
の音符化アルゴリズム又は図8の第3の音符化アルゴリ
ズムが適用される状態で代表されるように、ステップS
1106でノートオンが検出された第1番目のメロディ
音がノートオフされる前に別の第2番目のメロディ音が
ノートオンされた状態、すなわちメロディ音が重なって
いる状態である。
On the other hand, the event indicated by command CD [j] is note-on, and the determination in step S1120 is YE
When S is reached, the process proceeds to step S1123. FIG. 17 shows an operation example in which this state occurs. This state corresponds to the second state in FIG.
As shown in the state where the note conversion algorithm of FIG. 8 or the third note conversion algorithm of FIG.
This is a state in which another second melody sound is turned on before the first melody sound in which note-on is detected in 1106 is turned off, that is, a state in which melody sounds overlap.

【0104】このような場合には、図12のステップS
1123が実行された後に、まず、図13のステップS
1124〜ステップS1138の処理により、第1番目
のメロディ音の音長と第2番目のメロディ音の音長とが
検出され、続く図14のステップS1139〜S114
2で、図7の第2の音符化アルゴリズム又は図8の第3
の音符化アルゴリズムの各前半の処理が実行される。
In such a case, step S in FIG.
After the execution of step 1123, first, step S in FIG.
By the processing of 1124 to step S1138, the sound length of the first melody sound and the sound length of the second melody sound are detected, and subsequent steps S1139 to S114 in FIG.
2, the second note conversion algorithm of FIG. 7 or the third
Are executed in the first half of the note conversion algorithm.

【0105】まず、ステップS1123で、OFF_F
LAGがクリアされ、ポインタのiの内容がポインタj
の内容と等しくされる。この結果、図13のステップS
1124〜図14のステップS1140の処理によっ
て、図7の第2の音符化アルゴリズム又は図8の第3の
音符化アルゴリズムの各前半の処理が実行された後は、
ポインタjの値に等しいポインタのiで指示されるイベ
ントから処理が続行されることになる。
First, in step S1123, OFF_F
The LAG is cleared and the contents of pointer i are replaced with pointer j
Is equal to the contents of As a result, step S in FIG.
After the processing of step S1140 in FIGS. 1124 to 14 is performed, the first half of the processing of the second note conversion algorithm in FIG. 7 or the third note conversion algorithm in FIG.
The process is continued from the event indicated by the pointer i equal to the value of the pointer j.

【0106】次に、ステップS1124では、第1番目
のメロディ音の音長を格納するためのCPU6内に設け
られる第1音長レジスタN_LEN1にメロディ音の音
長を格納するレジスタN_LENの内容が格納される。
この結果、第1音長レジスタN_LEN1の内容は、始
めは図17に示されるように、第1番目のメロディ音の
補正前開始位置から第2番目のメロディ音の補正前開始
位置までの時間を示す時間データLEN[j]の内容に
設定される。同時に、第2番目のメロディ音の音長を格
納するためのCPU6内に設けられる第2音長レジスタ
N_LEN2の内容がクリアされる。
Next, in step S1124, the contents of the register N_LEN for storing the duration of the melody tone are stored in the first duration register N_LEN1 provided in the CPU 6 for storing the duration of the first melody tone. Is done.
As a result, the content of the first tone length register N_LEN1 initially indicates the time from the pre-correction start position of the first melody sound to the pre-correction start position of the second melody sound, as shown in FIG. It is set to the content of the indicated time data LEN [j]. At the same time, the contents of the second tone length register N_LEN2 provided in the CPU 6 for storing the tone length of the second melody tone are cleared.

【0107】続いて、ステップS1125では、第2番
目のメロディ音に対応するノートオンのコマンドCD
[j]に含まれるノートナンバーが、CPU6内に設け
られている第2音高レジスタPITCH2に格納され
る。これと共に、ポインタkの内容が、ポインタjの内
容を+1した値にされる。
Subsequently, in step S1125, note-on command CD corresponding to the second melody sound
The note number included in [j] is stored in the second pitch register PITCH2 provided in the CPU 6. At the same time, the content of the pointer k is set to a value obtained by adding +1 to the content of the pointer j.

【0108】次に、ステップS1126で、RAM7の
メロディデータ格納領域から、ポインタkで指示される
格納位置のメロディデータである時間データLEN
[k]とコマンドCD[k]が読み出される。
Next, in step S1126, the time data LEN, which is the melody data at the storage position indicated by the pointer k, is read from the melody data storage area of the RAM 7.
[K] and the command CD [k] are read.

【0109】そして、ステップS1127及びS112
8において、第1音長レジスタN_LEN1及び第2音
長レジスタN_LEN2の各内容に、上記時間データL
EN[k]が加算される。
Then, steps S1127 and S112
8, the contents of the first tone length register N_LEN1 and the second tone length register N_LEN2 include the time data L
EN [k] is added.

【0110】ステップS1129では、コマンドCD
[k]が示すイベントが、メロディの終了を示すEND
コマンド(図3(c) 参照)であるか否かが判定される。
この判定がYESなら、図11のステップS1115か
らS1116に戻り、ステップS1116〜図12のス
テップS1118を経た後、ステップS1119の判定
がYESとなって後述するステップS1143の音符長
の暫定的判定処理が実行される。
At step S1129, the command CD
The event indicated by [k] is END indicating the end of the melody.
It is determined whether the command is a command (see FIG. 3C).
If this determination is YES, the process returns to step S1116 from step S1115 in FIG. 11, and after step S1118 in step S1116 to step S1118 in FIG. Be executed.

【0111】ステップS1129の判定がNOなら、ス
テップS1130で、コマンドCD[k]に含まれるノ
ートナンバーが第1番目のメロディ音の音高である第1
音高レジスタPITCH1の内容に等しく、かつ、コマ
ンドCD[k]がノートオフイベントであるか否かが判
定される。すなわちここでは、コマンドCD[k]が第
1番目のメロディ音のノートオフを示しているか否かが
判定される。
If the determination in step S1129 is NO, in step S1130, the note number included in the command CD [k] is the first melody tone whose pitch is the first melody tone.
It is determined whether or not the content is equal to the content of the pitch register PITCH1 and the command CD [k] is a note-off event. That is, here, it is determined whether or not the command CD [k] indicates the note-off of the first melody sound.

【0112】ステップS1130の判定がNOならステ
ップS1137に進み、ここでコマンドCD[k]に含
まれるノートナンバーが第2番目のメロディ音の音高で
ある第2音高レジスタPITCH2の内容に等しく、か
つ、コマンドCD[k]がノートオフイベントであるか
否かが判定される。
If the determination in step S1130 is NO, the flow advances to step S1137, where the note number included in the command CD [k] is equal to the content of the second pitch register PITCH2 which is the pitch of the second melody tone. Further, it is determined whether or not the command CD [k] is a note-off event.

【0113】ステップS1137の判定がYESとなる
場合は、第1番目のメロディ音がノートオフする前に、
第2番目のメロディ音が発音を終了してしまう場合であ
る。このような場合には、第2番目のメロディ音は無視
され、図11のステップS1115からS1116に戻
って、第1番目のメロディ音のノートオフを探索する処
理に戻る。
If the determination in step S1137 is YES, before the first melody sound is turned off,
This is a case where the second melody sound ends sounding. In such a case, the second melody sound is ignored, and the process returns from step S1115 to S1116 in FIG. 11 to return to the process of searching for the note-off of the first melody sound.

【0114】ステップS1137の判定がNOとなる場
合は、コマンドCD[k]は、第1番目及び第2番目の
どちらのメロディ音にも関係しないため、ステップS1
138でポインタkの内容が更に+1された後に、ステ
ップS1126以降の処理が繰り返される。
If the determination in step S1137 is NO, the command CD [k] has nothing to do with either the first or second melody sound, so that step S1
After the content of the pointer k is further incremented by 1 at 138, the processing from step S1126 is repeated.

【0115】そして、ステップS1130の判定がYE
Sとなった時点で、図17に示されるように、第1音長
レジスタN_LEN1に、第1番目のメロディ音の音長
が格納されたことになる。この場合、第2番目のメロデ
ィ音のノートオフの時点を検出すべく、以下の一連の処
理が実行される。
Then, the determination in step S1130 is YE
At the point of time S, as shown in FIG. 17, the length of the first melody tone is stored in the first tone length register N_LEN1. In this case, a series of processes described below are executed to detect the note-off point of the second melody sound.

【0116】まず、ステップS1131で、CPU6内
に設けられるポインタnの内容が、ポインタkの内容を
+1した値にされる。次に、ステップS1132で、R
AM7のメロディデータ格納領域から、ポインタnで指
示される格納位置のメロディデータである時間データL
EN[n]とコマンドCD[n]が読み出される。
First, in step S1131, the content of the pointer n provided in the CPU 6 is set to a value obtained by adding +1 to the content of the pointer k. Next, in step S1132, R
From the melody data storage area of AM7, the time data L which is the melody data at the storage position indicated by the pointer n
EN [n] and command CD [n] are read.

【0117】そして、ステップS1133において、第
2音長レジスタN_LEN2の内容に、上記時間データ
LEN[n]が加算される。続いて、ステップS113
4では、コマンドCD[n]が示すイベントが、メロデ
ィの終了を示すENDコマンド(図3(c) 参照)である
か否かが判定される。
In step S1133, the time data LEN [n] is added to the contents of the second tone length register N_LEN2. Subsequently, step S113
In step 4, it is determined whether or not the event indicated by the command CD [n] is an END command (see FIG. 3C) indicating the end of the melody.

【0118】この判定がNOなら、ステップS1135
で、コマンドCD[n]に含まれるノートナンバーが、
第2番目のメロディ音の音高である第2音高レジスタP
ITCH2の内容に等しく、かつ、コマンドCD[n]
がノートオフイベントであるか否かが判定される。すな
わちここでは、コマンドCD[n]が第2番目のメロデ
ィ音のノートオフを示しているか否かが判定される。
If this determination is NO, step S1135
And the note number contained in the command CD [n] is
Second pitch register P which is the pitch of the second melody tone
Command CD [n] equal to the content of ITCH2
Is a note-off event. That is, here, it is determined whether or not the command CD [n] indicates the note-off of the second melody sound.

【0119】ステップS1135の判定がNOとなる場
合は、ステップS1136でポインタnの内容が更に+
1された後に、ステップS1132以降の処理が繰り返
される。
If the determination in step S1135 is NO, in step S1136 the content of pointer n is further increased by +
After that, the processing from step S1132 is repeated.

【0120】そして、ステップS1135の判定がYE
Sとなった時点で、図17の例で示されるように、第2
音長レジスタN_LEN2に、第2番目のメロディ音の
音長が格納されたことになる。
Then, the determination in step S1135 is YE
At the time point when S is reached, as shown in the example of FIG.
This means that the tone length of the second melody tone has been stored in the tone length register N_LEN2.

【0121】なお、ステップS1134の判定がNOと
なり、コマンドCD[n]が示すイベントが、メロディ
の終了を示すENDコマンドであると判定された場合
も、その時点が第2番目のメロディ音の終了時点とされ
る。
If the determination in step S1134 is NO, and the event indicated by the command CD [n] is determined to be an END command indicating the end of the melody, that point in time is also the end of the second melody sound. It is time.

【0122】以上の一連の処理によって、第1番目及び
第2番目の各メロディ音の音長が第1音調レジスタN_
LEN1及び第2音調レジスタN_LEN2にそれぞれ
得られると、続く図14のステップS1139〜S11
42で、図7の第2の音符化アルゴリズム又は図8の第
3の音符化アルゴリズムの各前半の処理が実行される。
By the above series of processing, the tone length of each of the first and second melody sounds is set to the first tone register N_
After being obtained in LEN1 and the second tone register N_LEN2, respectively, the subsequent steps S1139 to S11 in FIG.
At 42, the first half processing of the second note conversion algorithm of FIG. 7 or the third note conversion algorithm of FIG. 8 is executed.

【0123】まず、ステップS1139で、第1音調レ
ジスタN_LEN1に格納されている第1番目のメロデ
ィ音の音長が、RAM7内の変数comp_len の値の1/
2より小さいか否かが判定される。この変数には、最小
計測単位時間を単位とする時間長として示される最小音
符長が格納される。いま、前述したメロディ音の書込み
の基準となった最小計測単位時間は、例えば全音符の1
/96の時間長を有する。一方、音符データの生成の基
準となる最小音符長は、例えば全音符の1/16の時間
長を有する。従って、変数comp_len には、最小音符長
として例えば値(=6)が格納され、ステップS1139で
は、第1音調レジスタN_LEN1の値が値3より小さ
いか否かが判定される。
First, in step S1139, the tone length of the first melody tone stored in the first tone register N_LEN1 is set to 1 / the value of the variable comp_len in the RAM 7.
It is determined whether it is smaller than two. This variable stores a minimum note length indicated as a time length in units of the minimum measurement unit time. Now, the minimum measurement unit time serving as a reference for writing the melody sound is, for example, one whole note.
Has a time length of / 96. On the other hand, the minimum note length serving as a reference for generating note data has, for example, a time length of 1/16 of a whole note. Therefore, for example, a value (= 6) is stored as the minimum note length in the variable comp_len. In step S1139, it is determined whether the value of the first tone register N_LEN1 is smaller than the value 3.

【0124】ステップS1139で、第1音調レジスタ
N_LEN1に格納されている第1番目のメロディ音の
音長が最小音符長の1/2以上であると判定された場合
は、更に、ステップS1140で、第2音調レジスタN
_LEN2に格納されている第2番目のメロディ音の音
長が、RAM7内の変数comp_len の値の1/2、すな
わち最小音符長の1/2より小さいか否かが判定され
る。
If it is determined in step S1139 that the length of the first melody tone stored in the first tone register N_LEN1 is equal to or longer than 1 / of the minimum note length, then in step S1140, 2nd tone register N
It is determined whether or not the length of the second melody tone stored in _LEN2 is smaller than の of the value of the variable comp_len in the RAM 7, that is, 1 / of the minimum note length.

【0125】ステップS1140で、第2音調レジスタ
N_LEN2に格納されている第2番目のメロディ音の
音長も最小音符長の1/2以上であると判定されると、
この時点で、メロディ音の音長を格納するレジスタN_
LENには、図17に示されるように、第1番目のメロ
ディ音のノートオンの時点から第2番目のメロディ音の
ノートオンの時点までの時間長が格納されていることに
なる。すなわち、第1番目のメロディ音に関する補正前
終了位置が、第2番目のメロディ音に関する補正前開始
位置と同じ位置にシフトされたことになり、前述した第
2の音符化アルゴリズム(図7参照)の前半の処理が実
行されたことになる。
In step S1140, if it is determined that the length of the second melody tone stored in the second tone register N_LEN2 is also equal to or longer than 1/2 of the minimum note length,
At this point, a register N_ that stores the duration of the melody tone
As shown in FIG. 17, LEN stores the time length from the note-on time of the first melody sound to the note-on time of the second melody sound. That is, the pre-correction end position of the first melody sound is shifted to the same position as the pre-correction start position of the second melody sound, and the second note conversion algorithm described above (see FIG. 7). Has been executed.

【0126】その後、ステップS1143に進み、後述
するように、上記メロディ音の音長を格納するレジスタ
N_LENの内容に対して音符長の暫定的判定処理が実
行されることにより、前述した第1の音符化アルゴリズ
ム(図6参照)と同様の処理である、第2の音符化アル
ゴリズムの後半の処理が実行される。
Thereafter, the process proceeds to step S1143, and as will be described later, the provisional determination processing of the note length is performed on the contents of the register N_LEN for storing the note length of the melody sound, so that the first note described above is executed. The second half of the second note conversion algorithm, which is the same process as the note conversion algorithm (see FIG. 6), is executed.

【0127】一方、ステップS1139で、第1音調レ
ジスタN_LEN1に格納されている第1番目のメロデ
ィ音の音長が最小音符長の1/2より小さいと判定され
た場合は、ステップS1141に進み、ここで第1音高
レジスタPITCH1に第2音高レジスタPITCH2
の内容が格納され、続くステップS1142で、最新音
高レジスタEND_PITCHにも第2音高レジスタP
ITCH2の内容が格納される。以上の処理の後、図1
1のステップS1115に戻り、ポインタjの値が更新
されながらステップS1115〜S1121の処理が繰
り返される。そして、第2番目のメロディ音のノートオ
フを示すコマンドCD[j]が読み出され、ステップS
1121の判定がYESとなった時点で、メロディ音の
音長を格納するレジスタN_LENに第1番目のメロデ
ィ音のノートオンから第2番目のメロディ音のノートオ
フまでの時間長が格納され、また、第1音高レジスタP
ITCH1に第2番目のメロディ音の音高が格納されて
いることになる。この第1音高レジスタPITCH1の
内容は、後述する音符データの書込み処理において音符
データのノートナンバーとして使用される。このように
して、第1番目のメロディ音の区間が第2番目のメロデ
ィ音の区間に吸収(マージ)される。
On the other hand, if it is determined in step S1139 that the length of the first melody tone stored in the first tone register N_LEN1 is smaller than half the minimum note length, the flow advances to step S1141. Here, the first pitch register PITCH1 is added to the second pitch register PITCH2.
In the following step S1142, the second pitch register P is also stored in the latest pitch register END_PITCH.
The contents of ITCH2 are stored. After the above processing, FIG.
1, the process of steps S1115 to S1121 is repeated while the value of the pointer j is updated. Then, the command CD [j] indicating the note-off of the second melody sound is read out, and step S is executed.
When the determination at 1121 is YES, the time length from the note-on of the first melody sound to the note-off of the second melody sound is stored in the register N_LEN for storing the length of the melody sound, and , First pitch register P
The pitch of the second melody tone is stored in ITCH1. The content of the first pitch register PITCH1 is used as a note number of the note data in a note data writing process described later. In this manner, the section of the first melody sound is absorbed (merged) into the section of the second melody sound.

【0128】次に、ステップS1139で、第1音調レ
ジスタN_LEN1に格納されている第1番目のメロデ
ィ音の音長が最小音符長の1/2以上であると判定され
た後、ステップS1140で、第2音調レジスタN_L
EN2に格納されている第2番目のメロディ音の音長が
最小音符長の1/2より小さいと判定された場合は、ス
テップS1142に進み、ここで最新音高レジスタEN
D_PITCHに第2音高レジスタPITCH2の内容
が格納される。以上の処理の後、図11のステップS1
115に戻り、ポインタjの値が更新されながらステッ
プS1115〜S1121の処理が繰り返される。そし
て、第2番目のメロディ音のノートオフを示すコマンド
CD[j]が読み出され、ステップS1121の判定が
YESとなった時点で、メロディ音の音長を格納するレ
ジスタN_LENに第1番目のメロディ音のノートオン
から第2番目のメロディ音のノートオフまでの時間長が
格納され、また、第1音高レジスタPITCH1に第1
番目のメロディ音の音高が格納されていることになる。
このようにして、第2番目のメロディ音の区間が第1番
目のメロディ音の区間に吸収(マージ)される。
Next, in step S1139, after it is determined that the length of the first melody tone stored in the first tone register N_LEN1 is not less than half the minimum note length, in step S1140 Second tone register N_L
If it is determined that the length of the second melody tone stored in EN2 is smaller than 1/2 of the minimum note length, the process proceeds to step S1142, where the latest pitch register EN
The contents of the second pitch register PITCH2 are stored in D_PITCH. After the above processing, step S1 in FIG.
Returning to 115, the processing of steps S1115 to S1121 is repeated while the value of the pointer j is updated. Then, the command CD [j] indicating the note-off of the second melody tone is read out, and when the determination in step S1121 is YES, the first CD-NEN register stores the length of the melody tone. The time length from the note-on of the melody sound to the note-off of the second melody sound is stored, and the first pitch register PITCH1 stores the first time.
The pitch of the melody sound is stored.
In this way, the section of the second melody sound is absorbed (merged) into the section of the first melody sound.

【0129】以上のようにして前述した第3の音符化ア
ルゴリズム(図8参照)の前半の処理が実行されたこと
になる。その後、ステップS1143に進み、後述する
ように、上記メロディ音の音長を格納するレジスタN_
LENの内容に対して音符長の暫定的判定処理が実行さ
れることにより、前述した第1の音符化アルゴリズム
(図6参照)と同様の処理である、第3の音符化アルゴ
リズムの後半の処理が実行される。
As described above, the first half of the above-described third note-forming algorithm (see FIG. 8) is executed. Thereafter, the process proceeds to step S1143, and as described later, a register N_ for storing the length of the melody sound is provided.
The provisional determination processing of the note length is performed on the content of LEN, so that the second half of the third note conversion algorithm, which is the same processing as the above-described first note conversion algorithm (see FIG. 6). Is executed.

【0130】以上のようにして、レジスタN_P及びN
_LENの各内容として補正前開始位置とメロディ音の
音長とからなる1組のデータが決定されたら、次にステ
ップS1143において、音符長の暫定的判定処理が実
行される。ここでは、前述したように第1の音符化アル
ゴリズム(図6参照)、それと共通の処理である第2、
第3の音符化アルゴリズム(図7、図8参照)の各後半
の処理、図9の第4の音符化アルゴリズムの処理及び図
10の第5の音符化アルゴリズムの処理が実行される。
As described above, the registers N_P and N_P
When a set of data including the pre-correction start position and the melody sound length is determined as the contents of _LEN, a temporary note length determination process is executed in step S1143. Here, as described above, the first note conversion algorithm (see FIG. 6) and the second and
The second half of the processing of the third note conversion algorithm (see FIGS. 7 and 8), the processing of the fourth note conversion algorithm of FIG. 9, and the processing of the fifth note conversion algorithm of FIG. 10 are executed.

【0131】図15に、図14のステップS1143の
音符長の暫定的判定処理の動作フローチャートを示す。
この動作について、図18の動作例を用いて説明する。
なお、以下の説明の括弧内に示される数字は、図18に
対応する値で、上述のメロディデータの最小計測単位時
間(全音符の1/96に相当する)を単位とする時間長
を示している。
FIG. 15 is a flowchart showing the operation of the tentative note length determination process in step S1143 of FIG.
This operation will be described with reference to the operation example of FIG.
The numbers in parentheses in the following description are values corresponding to FIG. 18 and indicate the time length in units of the minimum measurement unit time of the melody data (corresponding to 1/96 of a whole note). ing.

【0132】始めに、図15のフローに対応するプログ
ラムの起動時に、変数comp_len が定義される。この変
数には、前述したように、最小計測単位時間を単位とす
る時間長として示される最小音符長が格納され、例えば
値(=6)が格納される。
First, a variable comp_len is defined when a program corresponding to the flow of FIG. 15 is started. As described above, this variable stores the minimum note length indicated as a time length in units of the minimum measurement unit time, for example, a value (= 6).

【0133】また、図14のフローに対応するプログラ
ムから、変数 start_point と mel_len が引き渡され
る。変数 start_point には、レジスタN_Pに格納さ
れている補正前開始位置を最小音符長が格納される変数
comp_len の値で除算して得られる剰余値が格納され
る。図18の例では、変数 start_point には値(=4)が
格納される。
The variables start_point and mel_len are delivered from the program corresponding to the flow of FIG. The variable start_point is a variable in which the minimum note length is stored as the pre-correction start position stored in the register N_P.
The remainder value obtained by dividing by the value of comp_len is stored. In the example of FIG. 18, a value (= 4) is stored in the variable start_point.

【0134】変数 mel_len には、レジスタN_LEN
に格納されたメロディ音の音長がそのまま格納される。
図18の例では変数 mel_len には値(=6)が格納され
る。上述の動作の後、図15のフローに対応する処理が
開始される。
The variable mel_len contains the register N_LEN
Is stored as it is.
In the example of FIG. 18, a value (= 6) is stored in the variable mel_len. After the above operation, processing corresponding to the flow in FIG. 15 is started.

【0135】まず、ステップS1501で、レジスタno
te_lengthがクリアされる。このレジスタには、最終的
にRAM7の音符データ格納領域に格納される各音符の
音符長データが格納される。
First, in step S1501, the register no
te_length is cleared. In this register, note length data of each note finally stored in the note data storage area of the RAM 7 is stored.

【0136】次に、ステップS1502で、レジスタbu
f1に変数 start_point の値(=4)が書き込まれる。続い
て、ステップS1503で、レジスタbuf2に、変数comp
_len に格納された最小音符長(=6)から変数 start_po
int の値(=4)が減算された値(=2)が格納される。この値
は、補正前開始位置が含まれる最小音符長の範囲に含ま
れるメロディ音の先頭部分の音長に対応する。
Next, in step S1502, the register bu
The value (= 4) of the variable start_point is written to f1. Subsequently, in step S1503, the variable comp is stored in the register buf2.
The variable start_po from the minimum note length (= 6) stored in _len
The value (= 2) obtained by subtracting the value of int (= 4) is stored. This value corresponds to the length of the head of the melody sound included in the range of the minimum note length including the pre-correction start position.

【0137】また、ステップS1504で、レジスタbu
f3に、変数 mel_len に格納されているメロディ音の音
長(=6)が格納される。上述の各格納処理の後、まず、ス
テップS1505で、レジスタbuf3に書き込まれたメロ
ディ音の音長(=6)が、変数comp_len に格納された最小
音符長(=6)の1/2の値(=3)に対し、大きいか、等しい
か、又は小さいかが判定される。
In step S1504, the register bu
In f3, the length (= 6) of the melody sound stored in the variable mel_len is stored. After each of the storing processes described above, first, in step S1505, the duration (= 6) of the melody tone written in the register buf3 is set to a value that is a half of the minimum note duration (= 6) stored in the variable comp_len. It is determined whether (= 3) is larger, equal, or smaller.

【0138】図18の例のように、buf3>comp_len/2
と判定された場合、ステップS1508で、レジスタbu
f1に格納された変数 start_point の値(=4)が、変数co
mp_len に格納された最小音符長(=6)の1/2の値(=3)
より大きいか否かが判定される。
As shown in FIG. 18, buf3> comp_len / 2
If it is determined in step S1508 that the register bu
The value (= 4) of the variable start_point stored in f1 is
1/2 value (= 3) of the minimum note length (= 6) stored in mp_len
It is determined whether it is greater than.

【0139】図18の例のように、この判定がYESな
ら、ステップS1509は実行されずにステップS15
10が実行される。これは、補正前開始位置が、それが
含まれる最小音符長の第1番目の範囲の後半部分に位置
することを意味し、その場合には、上記最小音符長の第
1番目の範囲の分の音符長はカウントされないことにな
る。
As in the example of FIG. 18, if this determination is YES, step S1509 is not executed and step S15 is executed.
10 is executed. This means that the pre-correction start position is located in the latter half of the first range of the minimum note length that includes the correction position. Will not be counted.

【0140】一方、図18の破線で示されるように例え
ば補正前開始位置が値(=2)で、ステップS1508の判
定がNOとなる場合は、補正前開始位置が、それが含ま
れる最小音符長の第1番目の範囲の前半部分に位置する
ことを意味する。この場合には、ステップ1309で、
レジスタnote_lengthの内容がインクリメントされ、上
記最小音符長の第1番目の範囲の分の音符長がカウント
される。
On the other hand, as shown by the broken line in FIG. 18, for example, when the pre-correction start position is a value (= 2) and the determination in step S1508 is NO, the pre-correction start position is the minimum note It means that it is located in the first half of the first range of the length. In this case, in step 1309,
The contents of the register note_length are incremented, and note lengths in the first range of the minimum note length are counted.

【0141】次に、ステップS1510で、レジスタbu
f3に格納されたメロディ音の音長(=6)が、レジスタbuf2
に格納された補正前開始位置が含まれる最小音符長の第
1番目の範囲に含まれるメロディ音の先頭部分の音長(=
2)の値以上であるか否かが判定される。
Next, in step S1510, the register bu
The length (= 6) of the melody sound stored in f3 is stored in register buf2.
The length (==) of the first part of the melody sound included in the first range of the minimum note length including the uncorrected start position stored in
It is determined whether the value is equal to or greater than the value of 2).

【0142】図18の例のように、この判定がYESな
ら、メロディ音が、最小音符長の第2番目の範囲以降に
も存在することを意味する。この場合には、最小音符長
の第2番目の範囲内での音符としての有効/無効を判定
するために、各変数の値が更新される。
As in the example shown in FIG. 18, if this determination is YES, it means that the melody tone is present after the second range of the minimum note length. In this case, the value of each variable is updated in order to determine the validity / invalidity of the note within the second range of the minimum note length.

【0143】すなわち、ステップS1511において、
レジスタbuf3に格納されたメロディ音の音長(=6)から、
レジスタbuf2に格納された補正前開始位置が含まれる最
小音符長の第1番目の範囲に含まれるメロディ音の先頭
部分の音長(=2)の分が減算されて、新たなレジスタbuf3
の内容(=4)とされる。
That is, in step S1511,
From the melody sound length (= 6) stored in register buf3,
The note length (= 2) of the first part of the melody sound included in the first range of the minimum note length including the uncorrected start position stored in the register buf2 is subtracted, and a new register buf3 is added.
(= 4).

【0144】次に、ステップS1512で、レジスタbu
f2に、変数comp_len に格納された最小音符長(=6)が格
納される。また、ステップS1513で、レジスタbuf1
の内容がクリアされる。
Next, in step S1512, the register bu
The minimum note length (= 6) stored in the variable comp_len is stored in f2. Also, in step S1513, the register buf1
Is cleared.

【0145】上述の動作の後、ステップS1505で、
再びレジスタbuf3に格納された最小音符長の第2番目の
範囲にあるメロディ音の音長(=4)が、変数comp_len に
格納された最小音符長(=6)の1/2の値(=3)に対し、大
きいか、等しいか、あるいは小さいかが判定される。
After the above operation, in step S1505,
Again, the note length (= 4) of the melody note in the second range of the minimum note length stored in the register buf3 is 1 / (= 6) of the minimum note length (= 6) stored in the variable comp_len. For 3), it is determined whether it is large, equal, or small.

【0146】図18の例のように、再びbuf3>comp_le
n/2 と判定された場合は、メロディ音が、最小音符長の
第2番目の範囲の後半以降にも存在することを意味す
る。この場合は、ステップS1508で、レジスタbuf1
の値(=0)が、変数comp_len に格納された最小音符長(=
6)の1/2の値(=3)より大きいか否かが判定される。
As shown in the example of FIG. 18, buf3> comp_le again
If it is determined to be n / 2, it means that the melody sound exists also in the second half of the second range of the minimum note length and thereafter. In this case, in step S1508, the register buf1
Value (= 0) is the minimum note length (=
It is determined whether or not the value is greater than 1/2 (= 3) of (6).

【0147】図18の例のように、一度でもステップS
1513が実行された後は、必ずステップS1508の
判定がYESとなって、ステップS1509でレジスタ
note_length(=0)の内容がインクリメントされ(=1)、上
記最小音符長の第2番目の範囲の分の音符長がカウント
される。
As shown in the example of FIG.
After the execution of step 1513, the determination in step S1508 is always YES, and in step S1509, the register
The content of note_length (= 0) is incremented (= 1), and note lengths in the second range of the minimum note length are counted.

【0148】次に、ステップS1510で、レジスタbu
f3に格納された最小音符長の第2番目の範囲にあるメロ
ディ音の音長(=4)が、レジスタbuf2に格納された最小音
符長(=6)以上であるか否かが判定される。
Next, in step S1510, the register bu
It is determined whether or not the melody note length (= 4) in the second range of the minimum note length stored in f3 is equal to or longer than the minimum note length (= 6) stored in the register buf2. .

【0149】図18の例のように、この判定がNOの場
合は、メロディ音が最小音符長の第3番目の範囲以降に
は存在しないことを意味する。この場合には、そのまま
図12のステップS1123の音符長の暫定的判定処理
を終了する。このようにして、図18の例では、レジス
タnote_lengthに最終的に得られる音符長は(=1)とな
る。
As in the example of FIG. 18, if this determination is NO, it means that the melody tone does not exist after the third range of the minimum note length. In this case, the provisional determination process of the note length in step S1123 of FIG. 12 is terminated. Thus, in the example of FIG. 18, the note length finally obtained in the register note_length is (= 1).

【0150】一方、メロディ音が、最小音符長の第3番
目の範囲以降にも存在する場合には、ステップS151
1以降の処理が再び実行されて、同様の動作が繰り返さ
れる。
On the other hand, if the melody sound exists after the third range of the minimum note length, step S151.
The processes after 1 are executed again, and the same operation is repeated.

【0151】また、上述の繰り返し動作中、ステップS
1505で、buf3=comp_len/2 と判定された場合は、
補正前終了位置が、現在注目されている最小音符長の範
囲のちょうど中間の位置に存在することを意味する。こ
の場合には、ステップS1506の判定がNOとなった
後(ステップS1513でレジスタbuf1の値は必ず0に
されているから)、ステップS1507で、レジスタno
te_lengthの内容がインクリメントされ、補正前終了位
置が含まれる最小音符長の範囲の分の音符長がカウント
された後に、図14のステップS1143の音符長の暫
定的判定処理を終了する。
During the above-described repetitive operation, step S
If it is determined in 1505 that buf3 = comp_len / 2,
This means that the pre-correction end position is located exactly in the middle of the currently noted minimum note length range. In this case, after the determination in step S1506 is NO (since the value of register buf1 is always set to 0 in step S1513), in step S1507, register no
After the content of te_length is incremented and the note length of the minimum note length range including the end position before correction is counted, the tentative determination process of the note length in step S1143 in FIG. 14 ends.

【0152】更に、上述の繰り返し動作中、ステップS
1505で、buf3<comp_len/2 と判定された場合は、
補正前終了位置が、現在注目されている最小音符長の範
囲の前半に存在することを意味する。この場合には、補
正前終了位置が含まれる最小音符長の範囲の分の音符長
はカウントされずに、そのまま図14のステップS11
43の音符長の暫定的判定処理を終了する。
Further, during the above-described repetitive operation, step S
If it is determined at 1505 that buf3 <comp_len / 2,
This means that the pre-correction end position exists in the first half of the range of the minimum note length that is currently focused on. In this case, note lengths in the range of the minimum note length including the pre-correction end position are not counted, and are not counted, and are directly stored in step S11 in FIG.
The provisional determination process of the note length of 43 is completed.

【0153】ここまでの図15の音符長の暫定的判定処
理によって、前述したの第1の音符化アルゴリズム(図
6参照)に対応する処理が実現される。なお、前述した
ように、第2、第3の音符化アルゴリズム(図7、図8
参照)の各後半の処理も同じである。
The processing corresponding to the above-described first note conversion algorithm (see FIG. 6) is realized by the provisional determination processing of the note length in FIG. 15 described above. As described above, the second and third note conversion algorithms (FIGS. 7 and 8)
The same applies to the processing in the latter half of the above (see).

【0154】次に、図15の音符長の暫定的判定処理に
おいて、最初にステップS1505の判定処理が実行さ
れた時点で、buf3<comp_len/2 と判定された場合は、
レジスタbuf3に格納されたメロディ音の音長が、変数co
mp_len に格納された最小音符長の1/2の値より短く
なる場合である。この場合、レジスタnote_lengthの値
が0のまま図14のステップS1143の音符長の暫定
的判定処理を終了する。
Next, in the provisional determination process of the note length in FIG. 15, when it is determined that buf3 <comp_len / 2 at the time when the determination process in step S1505 is first performed,
The length of the melody sound stored in register buf3 is
This is the case where the value is shorter than 1/2 the minimum note length stored in mp_len. In this case, the provisional determination process of the note length in step S1143 in FIG. 14 is terminated while the value of the register note_length is 0.

【0155】すなわち、この場合は、前述した第4の音
符化アルゴリズム(図9)が適用されるべき場合であ
る。この場合には、図14のステップS1143の処理
の後、ステップS1144〜S1146の処理がスキッ
プされ、現在のメロディデータは無視されることにな
る。
That is, this case is a case where the above-described fourth note conversion algorithm (FIG. 9) is to be applied. In this case, after the processing in step S1143 in FIG. 14, the processing in steps S1144 to S1146 is skipped, and the current melody data is ignored.

【0156】更に、図15の音符長の暫定的判定処理に
おいて、最初にステップS1505の判定処理が実行さ
れた時点で、buf3=comp_len/2 と判定された場合は、
レジスタbuf3に格納されたメロディ音の音長が、変数co
mp_len に格納された最小音符長の1/2にちょうど等
しい場合である。この場合は、前述した第5の音符化ア
ルゴリズム(図10参照)が適用されるべき場合であ
る。
Further, in the provisional determination process of the note length in FIG. 15, when it is determined that buf3 = comp_len / 2 at the time when the determination process of step S1505 is first performed,
The length of the melody sound stored in register buf3 is
This is the case when it is exactly equal to half of the minimum note length stored in mp_len. In this case, the above-described fifth note conversion algorithm (see FIG. 10) is to be applied.

【0157】この場合まず、ステップS1506で、レ
ジスタbuf1に格納された変数 start_point の値が、変
数comp_len に格納された最小音符長の1/2の値より
大きいか否かが判定される。
In this case, first, in step S1506, it is determined whether or not the value of the variable start_point stored in the register buf1 is larger than half the minimum note length stored in the variable comp_len.

【0158】この判定がNOとなる場合は、補正前開始
位置が、それが含まれる最小音符長の範囲の前半部分に
位置することを意味する。この場合には、ステップS1
507で、レジスタnote_lengthの内容がインクリメン
トされて値1にされた後、図14のステップS1143
の音符長の暫定的判定処理を終了する。
If this determination is NO, it means that the pre-correction start position is located in the first half of the range of the minimum note length that includes it. In this case, step S1
In step 507, after the content of the register note_length is incremented to have the value 1, the value of the register note_length is increased to 1 in step S1143 of FIG.
The provisional determination processing of the note length of is ended.

【0159】一方、ステップS1506の判定がYES
なら、レジスタnote_lengthの値が0のまま図14のス
テップS1143の音符長の暫定的判定処理を終了す
る。これは、補正前開始位置が、それが含まれる最小音
符長の範囲の後半部分に位置することを意味し、その場
合には、上記最小音符長の範囲の分の音符長はカウント
されないことになる。そして、この場合には、図14の
ステップS1143の処理の後、ステップS1144〜
S1146の処理がスキップされ、現在のメロディデー
タは無視されることになる。
On the other hand, the determination in step S1506 is YES
If it is, the value of the register note_length is set to 0, and the tentative determination processing of the note length in step S1143 in FIG. 14 ends. This means that the pre-correction start position is located in the latter half of the minimum note length range that includes it, in which case note lengths in the minimum note length range are not counted. Become. Then, in this case, after the processing of step S1143 in FIG.
The process of S1146 is skipped, and the current melody data is ignored.

【0160】以上のようにして、図14のステップS1
143の音符長の暫定的判定処理が実行された結果、音
符長note_lengthの値として0より大きい有効な値が得
られた場合には、後述するステップS1144以降の音
符データ等の書込みの処理が実行される。
As described above, step S1 in FIG.
As a result of the execution of the provisional determination process of the note length of 143, if a valid value greater than 0 is obtained as the value of the note length note_length, a process of writing note data and the like after step S1144 described later is executed. Is done.

【0161】これに対して、図14のステップS114
3の音符長の暫定的判定処理が実行された結果、音符長
note_lengthの値として0が返された場合は、ステップ
S1144〜S1146の処理がスキップされ、現在の
メロディデータは無視されることになる。この結果、前
述した第4の音符化アルゴリズム(図9)及び第5の音
符化アルゴリズム(図10)の後半の処理が実現され
る。
On the other hand, step S114 in FIG.
As a result of the provisional determination processing of the note length of No. 3, the note length
If 0 is returned as the value of note_length, the processing of steps S1144 to S1146 is skipped, and the current melody data is ignored. As a result, the latter half of the processing of the fourth note-forming algorithm (FIG. 9) and the fifth note-writing algorithm (FIG. 10) is realized.

【0162】以上、図6〜図10の第1〜第5の音符化
アルゴリズムに対応する図14のステップS1143の
音符長の暫定的判定処理により、レジスタnote_length
に有効な音符長データが得られると、図14の後述する
ステップS1144及びS1145の処理によって休符
データがRAM7の音符データ格納領域に書き込まれた
後に、ステップS1146が実行される。
As described above, by the provisional determination processing of the note length in step S1143 in FIG. 14 corresponding to the first to fifth note conversion algorithms in FIGS.
When the effective note length data is obtained, the rest data is written to the note data storage area of the RAM 7 by the processing of steps S1144 and S1145 described later in FIG. 14, and then step S1146 is executed.

【0163】ここでは、現在音符化されるべきメロディ
データについて、第1音高レジスタPITCH1に格納
されているノートナンバーとレジスタnote_lengthに得
られている音符長データとが、音符データとしてRAM
7の音符データ格納領域に書き込まれる。
Here, as for the melody data to be currently converted to a note, the note number stored in the first pitch register PITCH1 and the note length data obtained in the register note_length are stored in the RAM as note data.
7 is written to the note data storage area.

【0164】最後に、休符データの書込みの動作につい
て説明する。図6、図9又は図10に例示したように、
音符データの存在しないタイミングには休符データが挿
入される必要がある。この休符データは、メロディ音の
休止開始位置を格納するレジスタR_Pの内容と、メロ
ディ音が発音されていない休止時間を格納するレジスタ
R_LENの内容とに基づいて作成される。
Finally, the operation of writing rest data will be described. As exemplified in FIG. 6, FIG. 9 or FIG.
Rest data needs to be inserted at a timing when there is no note data. The rest data is created based on the contents of the register R_P storing the melody sound pause start position and the contents of the register R_LEN storing the pause time during which the melody sound is not sounded.

【0165】メロディ音の休止開始位置を格納するレジ
スタR_Pのセットと、メロディ音の休止時間を格納す
るレジスタR_LENの内容の初期設定は、図14のス
テップS1146の処理が実行された後に実行される図
14のステップS1147〜S1153の処理によって
セットされる。
The setting of the register R_P for storing the pause start position of the melody sound and the initial setting of the contents of the register R_LEN for storing the pause time of the melody sound are executed after the processing of step S1146 in FIG. 14 is executed. It is set by the processing of steps S1147 to S1153 in FIG.

【0166】まず、ステップS1147で、レジスタbu
f3の値が変数comp_len に格納されている最小音符長の
1/2より小さいか否かが判定される。このレジスタbu
f3には、ステップS1143の音符長の暫定的判定処理
(図15)が実行された後、補正前終了位置が含まれる
最小音符長の範囲の先頭から当該補正前終了位置までの
時間長が保持されている。
First, in step S1147, the register bu
It is determined whether the value of f3 is smaller than half the minimum note length stored in the variable comp_len. This register bu
f3 holds the time length from the beginning of the minimum note length range including the pre-correction end position to the pre-correction end position after the tentative note length determination process (FIG. 15) in step S1143 is performed. Have been.

【0167】従って、ステップS1147の判定がYE
Sとなって、レジスタbuf3の値が変数comp_len に格納
されている最小音符長の1/2より小さいと判定される
場合は、補正前終了位置が、それが含まれる最小音符長
の範囲の前半に位置することを意味する。そして、この
場合には、ステップS1143の音符長の暫定的判定処
理(図15)において図6に示した第1の音符化アルゴ
リズムが実行されることにより、補正前終了位置に対応
する補正後終了位置は、図6のB′に例示されるよう
に、上記補正前終了位置が含まれる最小音符長範囲の左
端位置に補正されている。
Therefore, the determination in step S1147 is YE
If it is determined that the value of the register buf3 is smaller than 1/2 of the minimum note length stored in the variable comp_len, the pre-correction end position is set to the first half of the range of the minimum note length that includes it. Means to be located at In this case, the first note conversion algorithm shown in FIG. 6 is executed in the tentative note length determination process (FIG. 15) in step S1143, so that the post-correction end corresponding to the pre-correction end position is performed. The position is corrected to the left end position of the minimum note length range including the pre-correction end position, as exemplified by B 'in FIG.

【0168】この結果、レジスタbuf3に保持されている
補正前終了位置が含まれる最小音符長の範囲の先頭から
当該補正前終了位置までの時間長の分は、メロディ音が
発音されない状態となる。
As a result, the melody sound is not generated for the time length from the beginning of the minimum note length range including the end position before correction held in the register buf3 to the end position before correction.

【0169】そこで、ステップS1147の判定がYE
Sとなった場合には、ステップS1150において、メ
ロディ音の休止時間を格納するレジスタR_LENに、
上述のレジスタbuf3に保持されている時間の分が加算さ
れる。
Therefore, the determination in step S1147 is YE
If it becomes S, in step S1150, the register R_LEN storing the pause time of the melody sound is
The time held in the register buf3 is added.

【0170】また、ステップS1151において、メロ
ディ音の休止開始位置を格納するレジスタR_Pには、
レジスタD_Pの内容からレジスタbuf3の内容を減算し
た値が格納される。今、レジスタD_Pには、ステップ
S1117において、補正前終了位置が格納されている
(例えば図16参照)。また、レジスタbuf3には、補正
前終了位置が含まれる最小音符長の範囲の先頭から当該
補正前終了位置までの時間長が保持されている。従っ
て、レジスタR_Pには、上記補正前終了位置が含まれ
る最小音符長範囲の左端位置である補正後終了位置が格
納される。すなわち、この位置から休符が始まることに
なる。
In step S1151, the register R_P for storing the melody sound pause start position contains:
A value obtained by subtracting the content of the register buf3 from the content of the register D_P is stored. Now, the end position before correction is stored in the register D_P in step S1117 (for example, see FIG. 16). Further, the register buf3 holds the time length from the head of the range of the minimum note length including the end position before correction to the end position before correction. Therefore, the register R_P stores the post-correction end position which is the left end position of the minimum note length range including the pre-correction end position. That is, the rest starts from this position.

【0171】続いて、ステップS1152で、フラグO
FF_FLAGの値が1か否かが判定される。この判定
がNOの場合は、前述したステップS1120の判定が
YESとなった場合、すなわち、既に図17に示したよ
うに、ステップS1106でノートオンが検出されたメ
ロディ音がノートオフされる前に別のメロディ音がノー
トオンされた状態、すなわちメロディ音が重なっている
場合である。
Subsequently, in step S1152, the flag O
It is determined whether the value of FF_FLAG is 1 or not. If this determination is NO, the above-described determination in step S1120 is YES, that is, before the melody sound for which note-on is detected in step S1106 is note-off, as shown in FIG. This is a state in which another melody sound is note-on, that is, a case where melody sounds overlap.

【0172】このような場合には、ステップS1153
で、レジスタD_Pに格納されている時間軸上の現在位
置が、時間データLEN[j](図17参照)の分だけ
戻された後に、図11のステップS1104に戻り、R
AM7のメロディデータ格納領域からつぎのメロディデ
ータLEN[i]とCD[i]が読み出される。ここ
で、前述したステップS1123でポインタiの値はポ
インタjの値と等しくされているため、ステップS11
04に戻って読み出されるメロディデータは、ステップ
S1120でノートオンのイベントとして判定されたデ
ータとおなじデータとなる(図17参照)。
In such a case, step S1153
After the current position on the time axis stored in the register D_P is returned by the time data LEN [j] (see FIG. 17), the process returns to step S1104 in FIG.
The next melody data LEN [i] and CD [i] are read from the melody data storage area of AM7. Here, since the value of the pointer i is equal to the value of the pointer j in step S1123 described above, step S11
The melody data read back to 04 is the same as the data determined as the note-on event in step S1120 (see FIG. 17).

【0173】一方、ステップS1152の判定がYES
の場合は、前述したステップS1120の判定がNOと
なりステップS1121の判定がYESとなった場合、
すなわち、既に図16に示したように、メロディ音が重
なっていない場合である。
On the other hand, the determination in step S1152 is YES
In the case of, when the determination in step S1120 described above is NO and the determination in step S1121 is YES,
That is, as shown in FIG. 16, the melody sounds do not overlap.

【0174】このような場合には、即座に図11のステ
ップS1104に戻り、RAM7のメロディデータ格納
領域からつぎのメロディデータLEN[i]とCD
[i]が読み出される。
In such a case, the process immediately returns to step S1104 in FIG. 11, and the next melody data LEN [i] and CD
[I] is read.

【0175】一方、前述したステップS1147の判定
がNOとなって、レジスタbuf3の値が変数comp_len に
格納されている最小音符長の1/2以上であると判定さ
れる場合は、補正前終了位置が、それが含まれる最小音
符長の範囲の後半に位置することを意味する。そして、
この場合には、ステップS1143の音符長の暫定的判
定処理(図15)において図6に示した第1の音符化ア
ルゴリズムが実行されることによって、補正前終了位置
に対応する補正後終了位置は、図6のA′又はC′に例
示されるように、上記補正前終了位置が含まれる最小音
符長範囲の右端位置に補正されている。
On the other hand, if the determination in step S1147 is NO and it is determined that the value of the register buf3 is equal to or more than の of the minimum note length stored in the variable comp_len, the pre-correction end position is determined. Means that it is located in the latter half of the range of the minimum note length that includes it. And
In this case, the first note conversion algorithm shown in FIG. 6 is executed in the tentative note length determination process (FIG. 15) in step S1143, so that the post-correction end position corresponding to the pre-correction end position becomes As shown in FIG. 6A 'or C', the correction is made to the right end position of the minimum note length range including the end position before correction.

【0176】このような場合には、上記補正動作によっ
て、メロディ音が発音されない状態となる余りの時間は
発生しない。そこで、ステップS1147の判定がNO
となった場合には、ステップS1148において、メロ
ディ音の休止開始位置を格納するレジスタR_Pに、メ
ロディ音の現在の最終位置であるレジスタD_Pの内容
が格納される(例えば図16を参照)。
In such a case, the correction operation does not generate any extra time during which the melody sound is not generated. Therefore, the determination in step S1147 is NO
In step S1148, the contents of the register D_P, which is the current final position of the melody sound, is stored in the register R_P for storing the pause start position of the melody sound (step S1148).

【0177】また、ステップS1149において、メロ
ディ音の休止時間を格納するレジスタR_LENに値0
が代入される。その後、前述したステップS1152又
はS1153の処理が実行された後に、図11のステッ
プS1104に戻り、RAM7のメロディデータ格納領
域からつぎのメロディデータLEN[i]とCD[i]
が読み出される。
In step S1149, a value 0 is set in the register R_LEN for storing the melody sound pause time.
Is substituted. Thereafter, after the above-described processing in step S1152 or S1153 is executed, the process returns to step S1104 in FIG. 11, and the next melody data LEN [i] and CD [i] are stored in the melody data storage area of the RAM 7.
Is read.

【0178】以上説明したステップS1147〜S11
53の処理によって、メロディ音の休止開始位置を格納
するレジスタR_Pのセットと、メロディ音の休止時間
を格納するレジスタR_LENの内容の初期設定が行わ
れる。
Steps S1147 to S11 described above
By the process of 53, the setting of the register R_P for storing the pause start position of the melody sound and the initial setting of the contents of the register R_LEN for storing the pause time of the melody sound are performed.

【0179】次に、メロディ音の休止時間を格納するレ
ジスタR_LENの更新は、前述した図11のステップ
S1107及びS1112で行われる。ステップS11
07は、RAM7のメロディデータ格納領域からメロデ
ィデータが順次読み出される場合に、ノートオフ又はタ
イムオーバーのイベントを示すメロディデータが読み出
された場合に、ステップS1106を介して実行され
る。すなわち、次にノートオンが発生するまでの各時間
データLEN[i]が、メロディ音の休止時間を示す時
間としてレジスタR_LENに累算されることになる。
Next, updating of the register R_LEN for storing the pause time of the melody sound is performed in steps S1107 and S1112 in FIG. 11 described above. Step S11
Step 07 is executed via step S1106 when the melody data is sequentially read from the melody data storage area of the RAM 7, and when the melody data indicating the note-off or time-over event is read. That is, each time data LEN [i] until the next note-on occurs is accumulated in the register R_LEN as a time indicating the pause time of the melody sound.

【0180】また、ステップS1112は、ステップS
1111でフラグOFF_FLAGの値が1であると判
別された場合に実行される。この場合は、前回の音符化
の処理において、前述したステップS1120の判定が
NOとなりステップS1121の判定がYESとなった
場合、すなわち、既に図16に示したように、メロディ
音が重なっていない場合である。この場合には、前回の
メロディ音の補正前終了位置(ノートオフの位置)から
今回のメロディ音の補正前開始位置(ノートオンの位
置)までは、メロディ音が存在しない時間となる。従っ
て、この時間を表わす時間データLEN[i]が、メロ
ディ音の休止時間を示す時間としてレジスタR_LEN
に累算されることになる。
Step S1112 is identical to step S11.
This is executed when it is determined in step 1111 that the value of the flag OFF_FLAG is 1. In this case, in the previous note conversion process, when the above-described determination in step S1120 is NO and the determination in step S1121 is YES, that is, when the melody sounds do not overlap as shown in FIG. It is. In this case, there is no melody sound from the previous melody sound pre-correction end position (note-off position) to the current melody sound pre-correction start position (note-on position). Therefore, the time data LEN [i] representing this time is stored in the register R_LEN as the time indicating the pause time of the melody sound.
Will be accumulated.

【0181】以上に示される動作によって、メロディ音
の休止開始位置を格納するレジスタR_Pと、メロディ
音の休止時間を格納するレジスタR_LENの内容が確
定しする。
By the operation described above, the contents of the register R_P for storing the pause start position of the melody sound and the register R_LEN for storing the pause time of the melody sound are determined.

【0182】そして、このように確定した各レジスタの
内容に基づいて、図14のステップS1144の休符長
の判定処理が実行され休符データが作成される。ステッ
プS1144の休符長の判定処理は、前述したステップ
S1143の処理として実行される図15の音符長の暫
定的判定処理と全く同じである。
Then, based on the contents of each register determined in this way, the rest length determination processing of step S1144 in FIG. 14 is executed, and rest data is created. The rest length determination processing in step S1144 is exactly the same as the note length provisional determination processing in FIG. 15 executed as the above-described step S1143 processing.

【0183】すなわち、図15において、図14のフロ
ーに対応するプログラムから、変数start_pointとmel
_lenが引き渡される。変数start_pointには、レジス
タR_Pに格納されているメロディ音の休止開始位置を
最小音符長が格納される変数comp_len の値で除算して
得られる剰余値が格納される。
That is, in FIG. 15, the variables start_point and mel are read from the program corresponding to the flow of FIG.
_Len is passed. The variable start_point stores the remainder value obtained by dividing the pause start position of the melody sound stored in the register R_P by the value of the variable comp_len storing the minimum note length.

【0184】変数 mel_len には、レジスタR_LEN
に格納されたメロディ音の休止時間がそのまま格納され
る。上述の動作の後、図15のフローに対応する処理が
実行され、その結果、レジスタnote_lengthに、最小音
符長を単位とする休符長データが得られることになる。
The variable mel_len contains the register R_LEN
The pause time of the melody sound stored in is stored as it is. After the above-described operation, processing corresponding to the flow of FIG. 15 is executed, and as a result, rest length data in units of the minimum note length is obtained in the register note_length.

【0185】ステップS1144の休符長の判定処理の
結果、レジスタnote_lengthに有効な休符長データが得
られると、ステップS1145で、その休符長データが
音符データの一部としてRAM7の音符データ格納領域
に書き込まれる。
As a result of the rest length determination processing in step S1144, when effective rest length data is obtained in the register note_length, the rest length data is stored in the RAM 7 as a part of the note data in step S1145. Written to the area.

【0186】[0186]

【発明の効果】本発明によれば、所定の最小計測単位時
間を単位とする時間軸に沿って実時間で記録されたメロ
ディ音の再生データを順次読み出して音符化することに
より、メロディ音の各発音区間を補正しながら音符又は
休符へ適切に対応付けることが可能となる。
According to the present invention, the reproduction data of a melody sound recorded in real time along a time axis having a predetermined minimum measurement unit time as a unit is sequentially read out and converted into a musical note, thereby obtaining a melody sound. It is possible to appropriately associate notes or rests while correcting each sounding section.

【0187】特に本発明では、レガート奏法のように短
時間ではあるが2つのメロディ音が重なる場合で、2つ
のメロディ音の発音時間が共に所定の最小音符長の1/
2より長い場合には、各発音開始位置から他の発音開始
位置までを各発音開始位置に対応する発音区間として順
次決定することにより、レガート演奏のように短時間で
はあるが2つのメロディ音が重なる場合でも、2つのメ
ロディ音を2つの発音区間に適切に分離することができ
る。
In particular, according to the present invention, when two melody sounds overlap with each other for a short time like the legato playing method, the sounding times of the two melody sounds are both 1 / the predetermined minimum note length.
If the length is longer than 2, two melody sounds are generated in a short time, such as legato performance, by sequentially determining the sound generation section corresponding to each sound generation start position from each sound generation start position to another sound generation start position. Even in the case of overlapping, two melody sounds can be appropriately separated into two sounding sections.

【0188】一方、何れか一方の発音時間が所定の最小
音符長の1/2より短い場合には、各発音開始位置から
他の発音開始位置に対応する発音終了位置までを各発音
開始位置に対応する発音区間として順次決定すると共
に、所定の最小音符長の1/2より短い時間長に対応す
る音高データを他方の時間長に対応する音高データの内
容で書き換えることにより、その区間を発音時間が長い
方のメロディ音に吸収させることができる。この結果、
不自然な音符データが生成されてしまうことを防ぐこと
ができる。
On the other hand, if any one of the tone generation times is shorter than 1/2 of the predetermined minimum note length, the interval from each tone generation start position to the tone generation end position corresponding to another tone generation start position is set as each tone generation start position. The corresponding sounding sections are sequentially determined, and the pitch data corresponding to a time length shorter than 1/2 of the predetermined minimum note length is rewritten with the content of the pitch data corresponding to the other time length, thereby to change the section. Longer melody sounds can be absorbed. As a result,
Unnatural note data can be prevented from being generated.

【0189】上述の音符化の処理によって得られる音符
データは、所定の最小音符長を単位とする音符又は休符
を表わしているため、それらの音符又は休符を五線譜上
に容易に表現することが可能となる。
Since the note data obtained by the above-described note conversion process represents notes or rests in units of a predetermined minimum note length, it is easy to express those notes or rests on a staff notation. Becomes possible.

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

【図1】本発明による採譜装置の実施例の構成図であ
る。
FIG. 1 is a configuration diagram of an embodiment of a music transcription device according to the present invention.

【図2】DSPによるフィルタリング処理の動作フロー
チャートである。
FIG. 2 is an operation flowchart of a filtering process performed by a DSP.

【図3】RAM7に書き込まれるメロディデータのフォ
ーマットを示す図である。
FIG. 3 is a diagram showing a format of melody data written to a RAM 7;

【図4】メロディデータの書込み時の動作フローチャー
トである。
FIG. 4 is an operation flowchart at the time of writing melody data.

【図5】音符化アルゴリズムの説明図(その1)であ
る。
FIG. 5 is an explanatory diagram (part 1) of a musical note conversion algorithm.

【図6】音符化アルゴリズムの説明図(その2)であ
る。
FIG. 6 is an explanatory diagram (part 2) of a musical note conversion algorithm.

【図7】音符化アルゴリズムの説明図(その3)であ
る。
FIG. 7 is an explanatory diagram (part 3) of a musical note conversion algorithm.

【図8】音符化アルゴリズムの説明図(その4)であ
る。
FIG. 8 is an explanatory diagram (No. 4) of the note conversion algorithm.

【図9】音符化アルゴリズムの説明図(その5)であ
る。
FIG. 9 is an explanatory diagram (No. 5) of the note conversion algorithm.

【図10】音符化アルゴリズムの説明図(その6)であ
る。
FIG. 10 is an explanatory diagram (part 6) of the musical note conversion algorithm.

【図11】音符データ生成処理の動作フローチャート
(その1)である。
FIG. 11 is an operation flowchart (part 1) of a note data generation process.

【図12】音符データ生成処理の動作フローチャート
(その2)である。
FIG. 12 is an operation flowchart (part 2) of a note data generation process.

【図13】音符データ生成処理の動作フローチャート
(その3)である。
FIG. 13 is an operation flowchart (part 3) of a note data generation process.

【図14】音符データ生成処理の動作フローチャート
(その4)である。
FIG. 14 is an operation flowchart (part 4) of a note data generation process.

【図15】音符長の暫定的判定処理の動作フローチャー
トである。
FIG. 15 is an operation flowchart of a musical note length provisional determination process.

【図16】音符データ生成処理の動作例を示した図(そ
の1)である。
FIG. 16 is a diagram (part 1) illustrating an operation example of note data generation processing;

【図17】音符データ生成処理の動作例を示した図(そ
の2)である。
FIG. 17 is a diagram (part 2) illustrating an operation example of note data generation processing;

【図18】音符データ生成処理の動作例を示した図(そ
の3)である。
FIG. 18 is a diagram (part 3) illustrating an operation example of note data generation processing;

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

1 アンチエイリアシングフィルタ 2 A/D変換器 3 DSP 4 フィルタ係数用ROM 5 ワークエリアRAM 6 CPU 7 RAM 8 楽音発生回路 9 アンプ 10 スピーカ 11 スイッチ部 DESCRIPTION OF SYMBOLS 1 Anti-aliasing filter 2 A / D converter 3 DSP 4 ROM for filter coefficient 5 Work area RAM 6 CPU 7 RAM 8 Musical sound generation circuit 9 Amplifier 10 Speaker 11 Switch part

フロントページの続き (56)参考文献 特開 平5−108062(JP,A) 特開 平4−347892(JP,A) 特開 昭58−123589(JP,A) 特開 昭58−7695(JP,A) 特開 昭62−30300(JP,A) 特開 平1−219636(JP,A) 特開 平1−219625(JP,A) 特開 平1−321484(JP,A) 実開 昭60−169695(JP,U) 特公 平4−1357(JP,B2) 特公 昭64−10079(JP,B2) 特公 平1−48557(JP,B2) (58)調査した分野(Int.Cl.7,DB名) G10G 3/04 G10H 1/00 G10H 1/00 101 G10H 1/00 102 Continuation of the front page (56) References JP-A-5-108062 (JP, A) JP-A-4-347892 (JP, A) JP-A-58-123589 (JP, A) JP-A-58-7695 (JP, A) JP-A-62-30300 (JP, A) JP-A-1-219636 (JP, A) JP-A-1-219625 (JP, A) JP-A-1-321484 (JP, A) 60-169695 (JP, U) JP-B 4-1357 (JP, B2) JP-B 64-10079 (JP, B2) JP-B 1-48557 (JP, B2) (58) Fields surveyed (Int. Cl. 7, DB name) G10G 3/04 G10H 1/00 G10H 1/00 101 G10H 1/00 102

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 順次入力される楽音の発音開始又は発音
終了のイベントの発生を示すイベントデータ、順次入力
される前記楽音の音高を示す音高データ、及び順次入力
される前記イベントデータの発生タイミングの間を所定
の最小計測単位時間を単位とした経過時間によって示す
時間データに基づいて、有効な発音区間及び該有効な発
音区間以外の消音区間を前記最小計測単位時間を単位と
する時間軸上で順次決定した後、前記有効な発音区間に
対応した音長で、かつ、前記音高データに基づいた音高
の音符を表す音符データと、前記消音区間に対応した音
長の休符を表す休符データとを順次生成する音符データ
生成手段を有する採譜装置において、 前記音符データ生成手段は、 前記順次入力されるイベントデータ、音高データ及び時
間データの各組に基づいて、前記最小計測単位時間を単
位とする時間軸上で発音開始位置と発音終了位置を順次
決定し、 前記各発音開始位置とそれに対応する発音終了位置の間
に他の発音開始位置が存在する場合であって、前記各発
音開始位置からそれに対応する発音終了位置までの第1
の時間長と前記他の発音開始位置からそれに対応する発
音終了位置までの第2の時間長が共に所定の最小音符長
の1/2より長い場合には、前記各発音開始位置から前
記他の発音開始位置までを前記各発音開始位置に対応す
る発音区間として順次決定し、 前記第1の時間長と前記第2の時間長のうち何れか一方
が前記所定の最小音符長の1/2より短い場合には、前
記各発音開始位置から前記他の発音開始位置に対応する
発音終了位置までを前記各発音開始位置に対応する発音
区間として順次決定すると共に、前記所定の最小音符長
の1/2より短い時間長に対応する音高データを他方の
時間長に対応する音高データの内容によって書き換え、 該順次決定される発音区間の時間長が前記所定の最小音
符長の1/2より長い場合に該発音区間を有効な発音区
間として決定し、 該有効な発音区間の発音開始位置が、前記所定の最小音
符長を単位とする時間軸上で該発音開始位置が含まれる
最小音符長の範囲の前半に含まれるなら、該最小音符長
の範囲の先頭位置を音符区間の発音開始位置とする音符
データを生成し、後半に含まれるなら、該最小音符長の
範囲のつぎの最小音符長の範囲の先頭位置を音符区間の
発音開始位置とする音符データを生成し、 該有効な発音区間の終了位置が、前記所定の最小音符長
を単位とする時間軸上で該終了位置が含まれる最小音符
長の範囲の前半に含まれるなら、該最小音符長の範囲の
先頭位置を音符区間の終了位置とする音符データを生成
し、後半に含まれるなら、該最小音符長の範囲のつぎの
最小音符長の範囲の先頭位置を音符区間の終了位置とす
る音符データを生成する、 ことを特徴とする採譜装置。
1. Event data indicating the occurrence of an event to start or end sounding of a musical tone that is sequentially input, pitch data indicating the pitch of the musical tone that is sequentially input, and generation of the event data that is sequentially input Based on the time data indicated by the elapsed time in units of a predetermined minimum measurement unit time between timings, a time axis in which a valid sound generation section and a mute section other than the valid sound generation section are set in the minimum measurement unit time After sequentially determining above, note data representing a note of a pitch based on the pitch data with a pitch corresponding to the valid sounding section, and a rest of a note length corresponding to the silence section, And a note data generating means for sequentially generating rest data representing the note data, wherein the note data generating means comprises: the sequentially input event data, pitch data, and time data. Based on each set, the sound start position and the sound end position are sequentially determined on a time axis in units of the minimum measurement unit time, and another sound is generated between each sound start position and the corresponding sound end position. A first position from each sounding start position to a corresponding sounding end position when there is a start position;
If both the time length of the sound generation and the second time length from the other sound generation start position to the corresponding sound generation end position are longer than 所 定 of the predetermined minimum note length, the respective sound generation start positions are replaced with the other sound generation start positions. Up to the sounding start position is sequentially determined as a sounding section corresponding to each sounding start position, and one of the first time length and the second time length is set to be smaller than 1 / of the predetermined minimum note length. In the case of a short sounding start time, a portion from each sounding start position to a sounding end position corresponding to the other sounding start position is sequentially determined as a sounding section corresponding to each sounding start position, and 1 / の of the predetermined minimum note length is determined. The pitch data corresponding to the time length shorter than 2 is rewritten by the content of the pitch data corresponding to the other time length, and the time length of the sequentially determined sounding section is longer than 1/2 of the predetermined minimum note length. If the pronunciation interval It is determined as a valid sounding section, and the sounding start position of the valid sounding section is included in the first half of the minimum note length range including the sounding start position on the time axis in units of the predetermined minimum note length. If this is the case, generate note data with the start position of the range of the minimum note length as the start position of the note interval, and if included in the latter half, set the start position of the range of the minimum note length next to the range of the minimum note length. Generate note data as a sounding start position of a note section, and set an end position of the effective sounding section to a range of a minimum note length including the end position on a time axis in units of the predetermined minimum note length. If it is included in the first half, it generates note data with the start position of the minimum note length range as the end position of the note section, and if it is included in the second half, it generates the next minimum note length range The start position is the end position of the note section Generating a note data that, music transcription apparatus characterized by.
JP03336685A 1991-12-19 1991-12-19 Transcription device Expired - Fee Related JP3104350B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP03336685A JP3104350B2 (en) 1991-12-19 1991-12-19 Transcription device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP03336685A JP3104350B2 (en) 1991-12-19 1991-12-19 Transcription device

Publications (2)

Publication Number Publication Date
JPH05165464A JPH05165464A (en) 1993-07-02
JP3104350B2 true JP3104350B2 (en) 2000-10-30

Family

ID=18301748

Family Applications (1)

Application Number Title Priority Date Filing Date
JP03336685A Expired - Fee Related JP3104350B2 (en) 1991-12-19 1991-12-19 Transcription device

Country Status (1)

Country Link
JP (1) JP3104350B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09240649A (en) * 1996-03-08 1997-09-16 Fuiide:Kk Liquid vessel

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3888372B2 (en) * 1996-11-20 2007-02-28 ヤマハ株式会社 Sound signal analyzing apparatus and method
JP4024440B2 (en) * 1999-11-30 2007-12-19 アルパイン株式会社 Data input device for song search system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09240649A (en) * 1996-03-08 1997-09-16 Fuiide:Kk Liquid vessel

Also Published As

Publication number Publication date
JPH05165464A (en) 1993-07-02

Similar Documents

Publication Publication Date Title
JP3104350B2 (en) Transcription device
CN108573689B (en) Electronic musical instrument, musical sound generating method, and recording medium
JP4170524B2 (en) Waveform playback device
JP2001255876A (en) Method for expanding and compressing musical sound waveform signal in time base direction
JP2020126176A (en) Music generation device and program
US6314403B1 (en) Apparatus and method for generating a special effect on a digital signal
JP3723973B2 (en) Sound generator
JP3635361B2 (en) Electronic musical instrument sound material processing equipment
JP3134407B2 (en) Transcription device
JP2705063B2 (en) Music signal generator
JP3137043B2 (en) Waveform memory tone generator and tone generator
JP4236570B2 (en) Waveform playback device and waveform playback program
JP3148803B2 (en) Sound source device
JP3052875B2 (en) Sequence data editing method and sequencer
JP5846288B2 (en) Phrase data search device and program
JP3038086B2 (en) Performance information playback device
JP3827820B2 (en) Recording / playback device
JP3404818B2 (en) Automatic performance device
JPH1165559A (en) Music display conversion method
JP5678343B2 (en) Phrase data search device and program
JP4097785B2 (en) Waveform playback device
JPH1031486A (en) Method and device for performance data storage and reproducing
JP2897377B2 (en) Waveform signal forming device
JP2847000B2 (en) Performance information storage device
JP3758041B2 (en) Musical sound control data generator

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

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

Free format text: PAYMENT UNTIL: 20090901

Year of fee payment: 9

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

Free format text: PAYMENT UNTIL: 20100901

Year of fee payment: 10

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

Free format text: PAYMENT UNTIL: 20110901

Year of fee payment: 11

LAPS Cancellation because of no payment of annual fees