Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP5609281B2 - Method and apparatus for creating differential code data - Google Patents
[go: Go Back, main page]

JP5609281B2 - Method and apparatus for creating differential code data - Google Patents

Method and apparatus for creating differential code data Download PDF

Info

Publication number
JP5609281B2
JP5609281B2 JP2010130680A JP2010130680A JP5609281B2 JP 5609281 B2 JP5609281 B2 JP 5609281B2 JP 2010130680 A JP2010130680 A JP 2010130680A JP 2010130680 A JP2010130680 A JP 2010130680A JP 5609281 B2 JP5609281 B2 JP 5609281B2
Authority
JP
Japan
Prior art keywords
code data
section
note
data
event
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
JP2010130680A
Other languages
Japanese (ja)
Other versions
JP2011257512A (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.)
Dai Nippon Printing Co Ltd
Original Assignee
Dai Nippon Printing 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 Dai Nippon Printing Co Ltd filed Critical Dai Nippon Printing Co Ltd
Priority to JP2010130680A priority Critical patent/JP5609281B2/en
Publication of JP2011257512A publication Critical patent/JP2011257512A/en
Application granted granted Critical
Publication of JP5609281B2 publication Critical patent/JP5609281B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Description

本発明は、音響信号を符号化して得られるMIDI形式等の符号データの作成に関し、特に、2つの音響信号を比較する用途に好適な差分符号データの作成技術に関する。   The present invention relates to creation of code data such as a MIDI format obtained by encoding an acoustic signal, and more particularly to a technique for creating differential code data suitable for use in comparing two acoustic signals.

従来、楽曲や音声を記録した音響信号をMIDI等の形式に符号化したり、音響信号に電子透かし埋め込みを行ったりという加工を行った場合には、原音との比較評価が行われている。音響信号の場合、画像のように複数を同時に提示したり、重ねて提示したりすることが困難であるため、時間差を置いた比較評価が行われる。時間差を置いた比較評価の場合、人間は、直前に聞いた音脈を記憶してしまうため、提示する順序に依存して評価結果が変わってしまい、同時刻で同一環境条件で評価することが難しかった。   Conventionally, when processing such as encoding an acoustic signal recording music or voice into a format such as MIDI or embedding a digital watermark in the acoustic signal, comparative evaluation with the original sound has been performed. In the case of an acoustic signal, it is difficult to present a plurality of images at the same time or to present them in a superimposed manner, and therefore, comparative evaluation with a time difference is performed. In the case of comparative evaluation with a time difference, humans memorize the sound paths heard immediately before, so the evaluation result changes depending on the order of presentation, and it is possible to evaluate at the same time and under the same environmental conditions was difficult.

そこで、2つの波形形式の音響信号の差分波形を作成して波形的に両者の相違を評価する手法が考えられる。また、出願人は、MIDI符号化された復号信号と原音との比較を定量化するため、積算スペクトルデータとエンベロープデータを作成して比較する技術を提案している(特許文献1参照)。   In view of this, it is conceivable to create a differential waveform between two waveform forms of an acoustic signal and evaluate the difference between the two in terms of waveform. In addition, the applicant has proposed a technique for creating and comparing integrated spectrum data and envelope data in order to quantify the comparison between a MIDI-encoded decoded signal and the original sound (see Patent Document 1).

特開2002−372968号公報JP 2002-372968 A

しかしながら、差分波形を作成する手法では、互いに位相が変化してしまうと、本来実質的に差がないのに、非常に振幅の大きい差分波形になってしまう。例えば、2つの波形が本来同一波形であっても、位相が互いに180度反転している場合、差分波形は原信号の2倍の振幅になってしまう。逆に、高周波領域の信号成分が大きく異なっている場合、差分波形上は顕著な差が発生しないことがあり、差分波形上の視覚上の差と各々を再生して比較する聴覚上の差との間に矛盾が生じることがある。また、特許文献1に記載の技術では、視覚的に提示することだけを目的としているため、聴覚的に評価することは困難である。 However, in the method of creating a differential waveform, if the phases change, a differential waveform with a very large amplitude is obtained although there is essentially no substantial difference. For example, even if two waveforms are originally the same waveform, if the phases are inverted by 180 degrees, the difference waveform has an amplitude twice that of the original signal. Conversely, if the signal components in the high-frequency region are significantly different, there may be no significant difference on the differential waveform, and the visual difference on the differential waveform and the auditory difference on which each is reproduced and compared. Inconsistencies may occur between the two. Moreover, since the technique described in Patent Document 1 is intended only for visual presentation, it is difficult to make an auditory evaluation.

そこで、本発明は、符号化された2種の音響信号を視覚的かつ聴覚的に評価することができる差分符号データを得ることが可能な差分符号データの作成方法および装置を提供することを課題とする。 SUMMARY OF THE INVENTION It is an object of the present invention to provide a differential code data creation method and apparatus capable of obtaining differential code data that can visually and audibly evaluate two types of encoded acoustic signals. And

上記課題を解決するため、本発明第1の態様では、音響信号を符号化して得られた2つの独立した符号データに対して両者の差分を表す1つの差分符号データを作成するにあたり、前記符号データは時系列に配置されたイベントデータで構成され、各イベントデータには、発音開始または発音終了のイベントの識別、当該イベントの時刻、音の高さ、チャンネル番号、音の強さの属性情報を備え、前記2つの符号データの各イベントデータに対して互いに異なるチャンネル番号を付与しながら、前記時刻が早い順にソートして、2つのチャンネル番号を有する1つの時系列な符号データに統合し、2チャンネル符号データを作成し、発音開始のイベントデータ、当該イベントデータと同一の音の高さをもつ発音終了のイベントデータとの2つのイベントデータの対で構成される区間を発音区間としたとき、前記2チャンネル符号データの中で、一方のチャンネルの発音区間が、同一の音の高さをもつ他方のチャンネルの発音区間と時間的に全てまたは一部が重複する場合に、両発音区間が重複する区間を、両発音区間の音の強さの差分値を新たな音の強さとする新たな発音区間を重複区間として生成し、前記重複する両発音区間のうち、一方のチャンネルにのみノートオン区間が存在する区間については、当該一方のチャンネルの音の強さを有する発音区間を生成し、前記更新された発音区間の各々の発音開始のイベントデータと発音終了のイベントデータを時系列にソートし、所定の形式で符号化するようにしたことを特徴とする。
In order to solve the above-described problem, in the first aspect of the present invention, when creating one differential code data representing a difference between two independent code data obtained by encoding an acoustic signal, the code The data consists of event data arranged in chronological order, and each event data includes identification information of the event at the start or end of pronunciation , time of the event , pitch, channel number, and sound intensity attribute information. the provided, while applying different channel numbers for each event data of the two code data, the time is sorted in ascending order, into one time-series code data with two channel numbers, create a 2-channel code data, the start of sounding of the event data, two pronounced end of event data having the height of the event data and the same sound When a section composed of a pair of event data is defined as a sound generation section, the sound generation section of one channel in the two-channel code data is temporally different from the sound generation section of the other channel having the same pitch. When all or a part of the sounding part overlaps, a section where both sounding sections overlap is generated as a new sounding section with a new sound intensity as the difference between the sound strengths of both sounding sections, Among the overlapping sound generation sections, for a section where a note-on section exists only in one channel, a sound generation section having the sound intensity of the one channel is generated, and each of the updated sound generation sections is generated. The event data at the start of pronunciation and the event data at the end of pronunciation are sorted in time series and encoded in a predetermined format.

本発明第1の態様によれば、2つの符号データを1つの2チャンネル符号データに統合し、2つのチャンネルで発音時間が重複する同一ノートナンバーの発音区間を重複区間と非重複区間に分割し、重複区間のベロシティを差分値に更新し、各発音区間を特定するノートオンのイベントデータとノートオフのイベントデータを時系列にソートし、差分符号データとして符号化するようにしたので、符号化された2種の音響信号を視覚的かつ聴覚的に評価することができる差分符号データを得ることが可能となる。   According to the first aspect of the present invention, two code data are integrated into one two-channel code data, and a sounding section of the same note number where sounding times overlap in two channels is divided into an overlapping section and a non-overlapping section. Since the velocity of the overlapping section is updated to a differential value, the note-on event data and note-off event data that specify each sounding section are sorted in time series and encoded as differential code data. It is possible to obtain differential code data that can visually and audibly evaluate the two types of acoustic signals.

また、本発明第2の態様では、本発明第1の態様において、前記重複発音区間の差分演算をする際、前記重複区間の音の強さが0の場合、前記音の強さを0以外の1〜127の範囲で小さな値に変更することを特徴とする。   Further, in the second aspect of the present invention, in the first aspect of the present invention, when calculating the difference between the overlapping pronunciation sections, if the sound intensity of the overlapping section is 0, the sound intensity is set to other than 0. In the range of 1 to 127, the value is changed to a small value.

また、本発明第3の態様では、本発明第1の態様において、前記重複発音区間の差分演算をする際、前記重複区間の音の強さが0の場合、前記重複区間を符号化対象から削除することを特徴とする。   Further, in the third aspect of the present invention, in the first aspect of the present invention, when calculating the difference between the overlapping pronunciation sections, if the sound intensity of the overlapping section is 0, the overlapping section is detected from the encoding target. It is characterized by deleting.

本発明第2、第3の態様によれば、音の強さとして最終的に0が与えられることがなくなり、差分演算前から0であった区間と区別することが可能となる。   According to the second and third aspects of the present invention, 0 is not finally given as the sound intensity, and it becomes possible to distinguish from the section that was 0 before the difference calculation.

また、本発明第4の態様では、本発明第1から第3のいずれかの態様において、 前記符号データの統合は、前記2つの符号データのいずれか一方の全ての発音開始、発音終了のイベントデータの時刻に対して複数通りのオフセット値を一律に加えるようにし、前記複数通りのオフセット値に基づいて、前記差分符号データ符号化段階までを複数回実行して複数通りの差分符号データを符号化するようにし、前記差分符号データの符号化にて符号化された複数通りの各差分符号データに対して、発音開始のイベントデータとそれに対応する同一の音の高さをもつ発音終了の2つのイベントデータの対で構成される発音区間を抽出し、前記抽出された全ての発音区間の音の強さと発音区間の時間間隔(発音終了のイベントデータの時刻と発音開始のイベントデータの時刻との差)との積の総和値を算出し、前記総和値が最小となる差分符号データを選別するようにしたことを特徴とする。   Also, in the fourth aspect of the present invention, in any one of the first to third aspects of the present invention, the integration of the code data is an event of sounding start and sounding end of all one of the two code data. A plurality of offset values are uniformly added to the time of data, and based on the plurality of offset values, the steps up to the differential code data encoding step are performed a plurality of times to encode a plurality of differential code data. For each of the plurality of differential code data encoded by the encoding of the differential code data, the sounding start event data and the corresponding sound end 2 having the same pitch A sounding interval composed of a pair of event data is extracted, and the sound intensity and time interval of the sounding intervals of all the extracted sounding intervals (time and event start time of sounding end event data) are extracted. And of calculating the product sum of the difference) between the time of the event data, wherein the total value was made to sort the encoded difference data is minimal.

本発明第4の態様によれば、オフセット値を変化させて発音開始、発音終了のイベントデータの時刻に追加し、オフセット値の変化に応じて複数通りの差分符号データを作成し、発音区間の音の強さと発音区間の時間間隔との積の総和値が最小となる差分符号データを選別するようにしたので、位相を考慮し、時間軸方向の位置ずれを補正した差分符号データの作成が可能となる。   According to the fourth aspect of the present invention, the offset value is changed and added to the time of the sounding start and sounding end event data, and a plurality of types of differential code data are created according to the change of the offset value, Since the differential code data that minimizes the sum of the products of the sound intensity and the time interval of the sounding section is selected, the differential code data that corrects the positional deviation in the time axis direction can be created in consideration of the phase. It becomes possible.

また、本発明第5の態様では、本発明第1から第4のいずれかの態様において、前記差分符号データの符号化は、前記重複発音区間の差分処理により得られた発音区間として、発音開始と発音終了の時刻が同一のものがある場合に、当該発音区間を構成するイベントデータを削除する処理をさらに行うことを特徴とする。   Further, in the fifth aspect of the present invention, in any one of the first to fourth aspects of the present invention, the encoding of the differential code data is started as a sounding section obtained by the difference processing of the overlapping sounding sections. And when the sound generation end time is the same, a process for deleting event data constituting the sound generation section is further performed.

本発明第5の態様によれば、重複発音区間の差分処理後に、発音開始と発音終了の時刻が同一のものがある場合に、発音区間を構成するイベントデータを削除するようにしたので、誤作動を生ずるようなイベントの発生を防ぐことが可能となる。   According to the fifth aspect of the present invention, after the difference between the overlapping sound generation intervals, the event data constituting the sound generation interval is deleted when there is the same sound generation start time and sound end time. It is possible to prevent the occurrence of an event that causes an operation.

また、本発明第6の態様では、本発明第1から第5のいずれかの態様において、前記差分符号データの符号化により得られた差分符号データを表示手段に画面表示、および/または前記差分符号データを音響再生手段により音響再生することを特徴とする。   Further, in a sixth aspect of the present invention, in any one of the first to fifth aspects of the present invention, the differential code data obtained by encoding the differential code data is displayed on a screen and / or the difference is displayed. The code data is acoustically reproduced by an acoustic reproduction means.

本発明第6の態様によれば、差分符号データを表示手段に画面表示、および/または差分符号データを音響再生手段により音響再生するようにしたので、2種の音響信号を視覚的かつ聴覚的に評価することが可能となる。   According to the sixth aspect of the present invention, since the differential code data is displayed on the screen of the display means and / or the differential code data is acoustically reproduced by the acoustic reproduction means, the two kinds of acoustic signals are visually and audibly heard. It becomes possible to evaluate.

本発明によれば、符号化された2種の音響信号を視覚的かつ聴覚的に評価することができる差分符号データを得ることが可能となるという効果を有する。   According to the present invention, it is possible to obtain differential code data that can visually and audibly evaluate two types of encoded acoustic signals.

本発明に係る差分符号データ作成装置の一実施形態を示す機能ブロック図である。It is a functional block diagram which shows one Embodiment of the difference code data production apparatus which concerns on this invention. 本実施形態に係る差分符号データの作成方法の概要を示すフローチャートである。It is a flowchart which shows the outline | summary of the production method of the difference code data which concerns on this embodiment. MIDIデータ統合処理の詳細を示すフローチャートである。It is a flowchart which shows the detail of a MIDI data integration process. 重複ノートオン区間差分処理の概要を説明するための図である。It is a figure for demonstrating the outline | summary of an overlapping note-on area difference process. 重複ノートオン区間差分処理の詳細を示すフローチャートである。It is a flowchart which shows the detail of an overlap note-on area difference process. チャンネル0に対する重複ノートオン区間差分処理の詳細を示すフローチャートである。It is a flowchart which shows the detail of the overlap note-on area difference process with respect to the channel 0. FIG. 0デュレーションイベント削除処理の詳細を示すフローチャートである。It is a flowchart which shows the detail of a 0 duration event deletion process. 差分処理時の位相ずれの様子を示す図である。It is a figure which shows the mode of the phase shift at the time of a difference process.

<装置構成>
以下、本発明の好適な実施形態について、図面を参照して詳細に説明する。図1は、本発明に係る差分符号データ作成装置の一実施形態を示す機能ブロック図である。本実施形態における差分符号データ作成装置は、図1に示すように、データ入力部11、演算処理部12、表示部13、音響出力部14、データ出力部15を有すると共に、図示しないハードディスク等の記憶装置、指示入力を行うキーボード、マウス等の入力機器等を有しており、入出力機器が接続された汎用のコンピュータに専用のプログラムを組み込むことにより実現される。
<Device configuration>
DESCRIPTION OF EMBODIMENTS Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the drawings. FIG. 1 is a functional block diagram showing an embodiment of a differential code data creation device according to the present invention. As shown in FIG. 1, the differential code data creation device according to the present embodiment includes a data input unit 11, an arithmetic processing unit 12, a display unit 13, an acoustic output unit 14, and a data output unit 15, and a hard disk or the like (not shown). It has a storage device, a keyboard for inputting instructions, an input device such as a mouse, and the like, and is realized by incorporating a dedicated program into a general-purpose computer to which an input / output device is connected.

図1において、データ入力部11は、MIDIデータ等の符号データを入力するためのものである。演算処理部12は、CPU、メモリを有し、記憶装置から専用のプログラムをメモリ上に読み込んで実行し、本発明の差分符号データ作成装置の主要な機能を実現するものである。表示部13は、液晶ディスプレイ等の表示装置により実現され、演算処理部12により作成された差分符号データを表示する。音響出力部14は、アンプおよびスピーカにより実現され、演算処理部12により作成された差分符号データを音響出力する。データ出力部15は、MIDIデータ等の符号データをデータ形式で出力するためのものである。   In FIG. 1, a data input unit 11 is for inputting code data such as MIDI data. The arithmetic processing unit 12 has a CPU and a memory, reads a dedicated program from the storage device into the memory and executes it, and realizes the main functions of the differential code data creation device of the present invention. The display unit 13 is realized by a display device such as a liquid crystal display, and displays the differential code data created by the arithmetic processing unit 12. The acoustic output unit 14 is realized by an amplifier and a speaker, and acoustically outputs the difference code data created by the arithmetic processing unit 12. The data output unit 15 is for outputting code data such as MIDI data in a data format.

<処理概要>
図2は、本実施形態に係る差分符号データの作成方法の概要を示すフローチャートである。本実施形態に係る差分符号データの作成方法は、図2に示した各ステップ(各段階)の詳細な手順を記録したプログラムを、図1に示した差分符号データ作成装置が実行することにより行われる。
<Process overview>
FIG. 2 is a flowchart showing an outline of a method for creating differential code data according to the present embodiment. The differential code data creation method according to the present embodiment is performed by the differential code data creation apparatus shown in FIG. 1 executing a program that records the detailed procedure of each step (each stage) shown in FIG. Is called.

本発明で用いる符号データとしては、各音を、その音の強度、高さ、時間情報で表現した形式のものであれば、どのようなものであっても良い。時間情報に関しては、開始時刻と終了時刻で特定する形式であっても、開始時刻と発音時間で特定する形式であっても、何らかの手法により開始時刻、終了時刻、発音時間が特定できるものであれば良い。本実施形態では、符号データとして、発音開始時にノートオン、発音終了時にノートオフのイベントデータを設定し、音の強さとしてベロシティ、音の高さとしてノートナンバーを設定したMIDIを採用している。したがって、以下においても、MIDIデータを例にとって説明していく。   As the code data used in the present invention, any data may be used as long as each sound is in a format expressing the sound intensity, pitch and time information. Regarding time information, it is possible to specify the start time, end time, and pronunciation time by some method, whether it is specified by the start time and end time or the format specified by the start time and pronunciation time. It ’s fine. In this embodiment, as the code data, MIDI is used in which note-on event data is set at the start of sound generation, note-off event data is set at the end of sound generation, velocity is set as the sound intensity, and note number is set as the pitch. . Therefore, the following description will be made taking MIDI data as an example.

差分符号データの作成方法としては、まず、コンピュータ本体である演算処理部12が、2つのMIDIデータをデータ入力部11から読み込む。ここでは、2つのMIDIデータM1、M2を読み込むものとする。2つのMIDIデータM1、M2を読み込んだら、演算処理部12は、読み込んだ2つのMIDIデータM1、M2を、1つの時系列な2チャンネルMIDIデータに統合する(S1)。   As a method of creating differential code data, first, the arithmetic processing unit 12 which is a computer main body reads two MIDI data from the data input unit 11. Here, it is assumed that two MIDI data M1 and M2 are read. When the two MIDI data M1 and M2 are read, the arithmetic processing unit 12 integrates the two read MIDI data M1 and M2 into one time-series two-channel MIDI data (S1).

統合に際して、演算処理部12は、読み込んだ2つのMIDIデータM1、M2それぞれのMIDIイベント配列を、Event1[]、Event2[]とする。2つのMIDIイベント配列の総ノートイベント数は各々Ne1、Ne2とし、各イベント配列には属性として[time,channnel,note−number,velocity]の4つの値をもつものとする。timeにはノートイベントの絶対値を与え、デルタタイムという相対時刻で指示される値を先頭時刻からの累積値に変換する。絶対時刻の単位は、デルタタイムと同様にユーザ指定の整数値である。channnelはMIDI規格上0〜15の値をとり得るが、Event1[]は0、Event2[]は1とする。note−numberとvelocityは0〜127の値をとり、ノートオンの場合は、velocityとして1以上の値を与え、ノートオフの場合は、velocityとして0を与える。   At the time of integration, the arithmetic processing unit 12 sets Event1 [] and Event2 [] as the MIDI event arrays of the two read MIDI data M1 and M2. The total number of note events of the two MIDI event arrays is Ne1 and Ne2, and each event array has four values [time, channel, note-number, velocity] as attributes. An absolute value of a note event is given to time, and a value indicated by a relative time called delta time is converted into a cumulative value from the start time. The unit of the absolute time is a user-specified integer value like the delta time. The channel can take a value of 0 to 15 according to the MIDI standard, but Event1 [] is 0 and Event2 [] is 1. “note-number” and “velocity” take a value of 0 to 127. When the note is on, a value of 1 or more is given as velocity, and when the note is off, 0 is given as velocity.

そして、統合先とする配列EventW[]を用意する。さらに、Event1[]、Event2[]、EventW[]へのポインタをp1、p2、pwとし、初期状態ではp1=p2=pw=0と設定する。EventW[]の総ノートイベント数をNwとすると、Nw=Ne1+Ne2となる。また、位相合わせのため、Event1[]、Event2[]のtimeにoffset1[h]、offset2[h]を加え、hの初期値を0とする。例えば前記2つのMIDIデータが2つの音響信号に対して最小フレーム間隔が64(64/1536sec)で周波数解析が行われ各々MIDIデータに変換されている場合、H=12通りで、−512/1536〜+512/1536secの範囲で位相ずれ補正を行うとして、offset1[h]={0,0,0,0,0,0,0,64,128,384,448,512}、offset2[h] ={0,64,128,384,448,512,0,0,0,0,0,0}が用意される。なお、後述するように、本発明では、位相補正を行わないようにすることも可能であるが、その場合は、H=1、offset1[h]=0、offset2[h] =0にセットする。   Then, an array EventW [] as an integration destination is prepared. Further, the pointers to Event1 [], Event2 [], and EventW [] are p1, p2, and pw, and p1 = p2 = pw = 0 is set in the initial state. When the total number of note events of EventW [] is Nw, Nw = Ne1 + Ne2. For phase alignment, offset1 [h] and offset2 [h] are added to the time of Event1 [] and Event2 [], and the initial value of h is set to zero. For example, when the two MIDI data are subjected to frequency analysis with a minimum frame interval of 64 (64/1536 sec) for two acoustic signals and converted to MIDI data, respectively, H = 12, and −512/1536. Suppose that phase shift correction is performed in a range of ˜ + 512/1536 sec, and offset1 [h] = {0,0,0,0,0,0,0,64,128,384,448,512}, offset2 [h] = {0, 64, 128, 384, 448, 512, 0, 0, 0, 0, 0, 0} are prepared. As will be described later, in the present invention, it is possible not to perform phase correction. In this case, H = 1, offset1 [h] = 0, and offset2 [h] = 0 are set. .

<MIDIデータ統合>
配列の準備ができたら、演算処理部12はMIDIデータ統合処理を開始する。 S1におけるMIDIデータ統合処理の詳細を図3のフローチャートを用いて説明する。まず、演算処理部12は、ポインタp2が総ノートイベント数Ne2より小さいかどうかを判断する(S101)。後述するように、p2は配列Event2[]内のノートイベントが処理される度に1加算されるため、p2がNe2より小さいことは未処理のノートイベントが配列Event2[]内に残っていることを意味する。すなわち、S101では、配列Event2[]内のノートイベントの処理を終えたかどうかを判断している。
<MIDI data integration>
When the array is ready, the arithmetic processing unit 12 starts the MIDI data integration process. Details of the MIDI data integration process in S1 will be described with reference to the flowchart of FIG. First, the arithmetic processing unit 12 determines whether or not the pointer p2 is smaller than the total number of note events Ne2 (S101). As will be described later, p2 is incremented by 1 every time a note event in the array Event2 [] is processed. Therefore, if p2 is smaller than Ne2, an unprocessed note event remains in the array Event2 []. Means. That is, in S101, it is determined whether or not the processing of the note event in the array Event2 [] has been completed.

ポインタp2が総ノートイベント数Ne2より小さい場合は、Event2[].timeがEvent1[].timeより小さいかどうかを判断する(S102)。これは、ポインタp2で特定されるEvent2[]内のノートイベントの絶対時刻がポインタp1で特定されるEvent1[]内のノートイベントの絶対時刻よりも早いかどうかを判断している。そして、Event2[].timeがEvent1[].timeより小さい場合は、Event2[]についての処理を行い(S103)、Event2[].timeがEvent1[].time以上の場合は、Event1[]についての処理を行う(S105)。なお、S101において、ポインタp2が総ノートイベント数Ne2以上である場合は、配列Event2[]内のノートイベントの処理を全て終えたことを意味するので、この場合にも、S105に進んで、Event1[]についての処理を行う。   If the pointer p2 is smaller than the total number of note events Ne2, Event2 []. time is Event1 []. It is determined whether it is smaller than time (S102). This determines whether the absolute time of the note event in Event2 [] specified by the pointer p2 is earlier than the absolute time of the note event in Event1 [] specified by the pointer p1. And Event2 []. time is Event1 []. If it is smaller than time, the process for Event2 [] is performed (S103), and Event2 []. time is Event1 []. If it is not less than time, the process for Event1 [] is performed (S105). In S101, if the pointer p2 is equal to or greater than the total number of note events Ne2, this means that all the processing of note events in the array Event2 [] has been completed. In this case as well, the process proceeds to S105, where Event1 Process for [].

S103のEvent2[]についての処理では、演算処理部12は、以下の〔数式1〕に従った処理を実行する。   In the process for Event2 [] in S103, the arithmetic processing unit 12 executes a process according to the following [Equation 1].

〔数式1〕
EventW[pw].time←Event2[p2].time+offset2[h]
EventW[pw].channel←1
EventW[pw].note−number←Event2[p2].note−number
EventW[pw].velocity←Event2[p2].velocity
pw←pw+1
p2←p2+1
[Formula 1]
EventW [pw]. time ← Event2 [p2]. time + offset2 [h]
EventW [pw]. channel ← 1
EventW [pw]. note-number ← Event2 [p2]. note-number
EventW [pw]. velocity ← Event2 [p2]. velocity
pw ← pw + 1
p2 ← p2 + 1

上記〔数式1〕の6つの式のうち、第1式、第3式、第4式では、Event2[p2]のノートイベントのtime、note−number、velocityをEventW[pw]のノートイベントのtime、note−number、velocityとして与えている。また、第2式では、EventW[pw]のノートイベントのchannelを1に設定している。この4つの式により、MIDIデータM2に存在していたノートイベントが、統合MIDIデータのチャンネル1のノートイベントとして移行されたことになる。第5式、第6式は、ポインタの加算である。   Of the above six expressions of [Formula 1], in the first expression, the third expression, and the fourth expression, the time, note-number, and velocity of the event event of Event2 [p2] are set to the time of the note event of EventW [pw]. , Note-number, and velocity. In the second equation, the channel of the note event of EventW [pw] is set to 1. According to these four formulas, the note event existing in the MIDI data M2 is transferred as the channel 1 note event of the integrated MIDI data. Expressions 5 and 6 are pointer additions.

S105のEvent1[]についての処理では、演算処理部12は、以下の〔数式2〕に従った処理を実行する。   In the process for Event1 [] in S105, the arithmetic processing unit 12 executes a process according to the following [Equation 2].

〔数式2〕
EventW[pw].time←Event1[p1].time+offset1[h]
EventW[pw].channel←0
EventW[pw].note−number←Event1[p1].note−number
EventW[pw].velocity←Event1[p1].velocity
pw←pw+1
p1←p1+1
[Formula 2]
EventW [pw]. time ← Event1 [p1]. time + offset1 [h]
EventW [pw]. channel ← 0
EventW [pw]. note-number ← Event1 [p1]. note-number
EventW [pw]. velocity ← Event1 [p1]. velocity
pw ← pw + 1
p1 ← p1 + 1

上記〔数式2〕は、上記〔数式1〕におけるp2の代わりにp1が用いられており、channelが0に設定されている。上記〔数式2〕では、第1式〜第4式により、MIDIデータM1に存在していたノートイベントが、統合MIDIデータのチャンネル0のノートイベントとして移行されたことになる。第5式、第6式は、ポインタの加算である。   In the above [Equation 2], p1 is used instead of p2 in [Equation 1], and channel is set to 0. In the above [Expression 2], the note event existing in the MIDI data M1 is transferred as the note event of channel 0 of the integrated MIDI data by the first to fourth expressions. Expressions 5 and 6 are pointer additions.

S105におけるEvent1[]についての処理後は、ポインタp1が総ノートイベント数Ne1より小さいかどうかを判断する(S106)。判断の結果、ポインタp1が総ノートイベント数Ne1より小さい場合は、S101に戻る。逆に、ポインタp1が総ノートイベント数Ne1以上の場合は、配列Event1[]内のノートイベントの処理を全て終えたことを意味するので、S103に進んで、Event2[]についての処理を行う。   After the process for Event1 [] in S105, it is determined whether the pointer p1 is smaller than the total number of note events Ne1 (S106). As a result of the determination, if the pointer p1 is smaller than the total number of note events Ne1, the process returns to S101. On the other hand, if the pointer p1 is equal to or greater than the total number of note events Ne1, this means that the processing of all the note events in the array Event1 [] has been completed, and thus the process proceeds to S103 and the process for Event2 [] is performed.

S103におけるEvent2[]についての処理後は、ポインタp2が総ノートイベント数Ne2より小さいかどうかを判断する(S104)。判断の結果、ポインタp2が総ノートイベント数Ne2より小さい場合は、S103に戻って、Event2[]についての処理を行う。逆に、ポインタp2が総ノートイベント数Ne2以上の場合は、配列Event2[]内のノートイベントの処理を全て終えたことを意味するので、統合処理を終了する。   After the process for Event2 [] in S103, it is determined whether the pointer p2 is smaller than the total number of note events Ne2 (S104). As a result of the determination, if the pointer p2 is smaller than the total number of note events Ne2, the process returns to S103 and the process for Event2 [] is performed. Conversely, if the pointer p2 is equal to or greater than the total number of note events Ne2, this means that all the note event processing in the array Event2 [] has been completed, so the integration processing ends.

<重複ノートオン区間差分処理>
統合処理が終了したら、演算処理部12は、重複ノートオン区間差分処理を実行する(図2のS2)。ノートオン区間(発音区間)とは、ノートオンのイベントデータとそれに対応する同一ノートナンバーをもつノートオフの2つのイベントデータの対で構成される区間である。また、重複ノートオン区間とは、他方のチャンネルのノートオン区間と時間的に全てまたは一部が重複するノートオン区間である。上記S1の統合処理の結果、EventW[]は、2チャンネルのMIDIイベントで構成されることになり、これに対して、単一チャンネルのMIDIイベント配列EventS[]に変換する処理を行う。ただし、EventW[]は、同一時間に同一ノートナンバーのノートオン区間が重複してしまう可能性がある。重複ノートオン区間差分処理では、ノートオン区間が重複する部分について強度値(ベロシティ)の差分演算を行い、1つのチャンネルに統一することにより、単一チャンネルのMIDIイベント配列EventS[]に変換する。
<Duplicate note-on section difference processing>
When the integration process ends, the arithmetic processing unit 12 executes an overlapping note-on section difference process (S2 in FIG. 2). The note-on section (sound generation section) is a section composed of a pair of note-on event data and two note-off event data having the same note number corresponding thereto. Further, the overlapping note-on section is a note-on section that overlaps in part or part with the note-on section of the other channel in time. As a result of the integration process of S1, EventW [] is composed of a 2-channel MIDI event, and a process of converting it into a single-channel MIDI event array EventS [] is performed. However, in the event W [], note-on intervals with the same note number may overlap at the same time. In the overlap note-on interval difference process, the intensity value (velocity) difference calculation is performed for the portion where the note-on interval overlaps, and the result is converted into a single channel MIDI event array EventS [].

ここで、重複ノートオン区間差分処理の概要を図4を用いて説明する。図4(a)は2つのMIDIデータ統合後の1つの2チャンネルMIDIデータを示し、図4(b)は重複ノートオン区間差分処理後の1チャンネルMIDIデータを示している。説明の便宜上、図4においては、1つのノートナンバーについてだけ示している。また、各矩形は、左端がノートオンイベントの時刻、右端がノートオフイベントの時刻であり、左右方向の幅がノートオン区間を示している。また、各矩形の上下方向がベロシティを示している。図4(a)の例では、全てのノートオン区間が他方のチャンネルのノートオン区間と時間的に全てまたは一部が重複しているため、全てが重複ノートオン区間である。また、ノートオン区間02のように、その一部が他方のチャンネルのノートオン区間12と重複している場合は、重複している区間を重複区間、重複していない区間を非重複区間と呼ぶことにする。   Here, an outline of the overlapping note-on section difference processing will be described with reference to FIG. FIG. 4A shows one 2-channel MIDI data after the integration of two MIDI data, and FIG. 4B shows one-channel MIDI data after overlapping note-on section difference processing. For convenience of explanation, FIG. 4 shows only one note number. In each rectangle, the left end is the note-on event time, the right end is the note-off event time, and the horizontal width indicates the note-on interval. Also, the vertical direction of each rectangle indicates the velocity. In the example of FIG. 4A, all the note-on intervals overlap all or part of the note-on interval of the other channel in time, so that all are overlap note-on intervals. Also, when a part of the note-on section 02 overlaps with the note-on section 12 of the other channel as in the note-on section 02, the overlapping section is referred to as an overlapping section, and the non-overlapping section is referred to as a non-overlapping section. I will decide.

図4(a)の例では、チャンネル0(図中、ch:0で示す。)のノートオン区間01とチャンネル1(図中、ch:1で示す。)のノートオン区間11が重複しているため、差分演算処理が行われ、図4(b)に示すように、チャンネル0に新ノートオン区間が得られる。新ノートオン区間のベロシティは、ノートオン区間01のベロシティとノートオン区間11のベロシティの差分となる。ノートオン区間01とノートオン区間11は、ノートオンイベントの時刻、ノートオフイベントの時刻が同一であり、ノートオン区間が完全に重複しているため、差分演算処理後の新ノートオン区間のノートオンイベントの時刻、ノートオフイベントの時刻は、ノートオン区間01、ノートオン区間11と同一となる。   In the example of FIG. 4A, the note-on section 01 of channel 0 (indicated by ch: 0 in the figure) and the note-on section 11 of channel 1 (indicated by ch: 1 in the figure) overlap. Therefore, the difference calculation process is performed, and a new note-on section is obtained for channel 0 as shown in FIG. The velocity of the new note-on section is the difference between the velocity of the note-on section 01 and the velocity of the note-on section 11. The note-on interval 01 and the note-on interval 11 have the same note-on event time and note-off event time, and the note-on interval completely overlaps. The time of the on event and the time of the note off event are the same as the note on section 01 and the note on section 11.

ノートオン区間02とノートオン区間12のように一部が重複している場合、重複している一部についてだけ、差分演算処理が行われる。ノートオン区間02とノートオン区間12のベロシティは同じであるので、ノートオン区間02とノートオン区間12が重複している区間については、ノートオン区間が存在しなくなる。また、ノートオン区間02には、チャンネル1のノートオン区間と重複していない部分があるので、重複していない部分については、チャンネル0に新ノートオン区間が得られる。新ノートオン区間のベロシティは、ノートオン区間02のベロシティがそのまま与えられる。また、新ノートオン区間のノートオン時刻は、ノートオン区間12のノートオフ時刻が与えられ、新ノートオン区間のノートオフ時刻は、ノートオン区間02のノートオフ時刻がそのまま与えられる。   When a part overlaps like the note-on section 02 and the note-on section 12, a difference calculation process is performed only about the part which overlaps. Since the note-on section 02 and the note-on section 12 have the same velocity, no note-on section exists in the section where the note-on section 02 and the note-on section 12 overlap. In addition, since there is a portion that does not overlap with the note-on interval of channel 1 in the note-on interval 02, a new note-on interval is obtained in channel 0 for the portion that does not overlap. The velocity of the new note-on section is the same as the velocity of the note-on section 02. Further, the note-on time of the note-on section 12 is given as the note-on time of the note-on section 12, and the note-off time of the note-on section 02 is given as it is.

重複ノートオン区間差分処理に際して、演算処理部12は、EventW[]、EventS[]の各配列へのポインタをpw、psとし、初期状態ではpw=ps=0に設定する。また、EventS[]のChannel値は全て0に設定する。さらに、演算処理部12は、0〜127のノートナンバーに対応してノートオン時にMIDIイベント配列へのポインタを格納するノートオンテーブルをEventW[]のチャンネル0とチャンネル1に対応してtableW0[]、tableW1[]を定義し、EventS[]に対応してtableS[]を定義する。そして、tableW0[]、tableW1[]、tableS[]の全ての初期値を−1に設定する。また、生成されるMIDIイベント配列EventS[]の総ノートイベント数をNsとする。   In the overlapping note-on section difference process, the arithmetic processing unit 12 sets pw and ps as pointers to the arrays of EventW [] and EventS [], and sets pw = ps = 0 in the initial state. Also, all the Channel values of EventS [] are set to 0. Further, the arithmetic processing unit 12 uses a note-on table that stores a pointer to the MIDI event array at the time of note-on corresponding to the note numbers 0 to 127 as tableW0 [] corresponding to channel 0 and channel 1 of EventW []. , TableW1 [] and tableS [] corresponding to EventS []. Then, all initial values of tableW0 [], tableW1 [], and tableS [] are set to -1. Further, the total number of note events in the generated MIDI event array EventS [] is Ns.

配列の準備ができたら、演算処理部12は、重複ノートオン区間差分処理を開始する。この重複ノートオン区間差分処理の詳細を図5のフローチャートを用いて説明する。まず、演算処理部12は、ポインタpwを特定した後、以下の〔数式3〕に従った処理を実行し、処理対象のノートナンバーnn、ベロシティをvelを決定する。   When the arrangement is ready, the arithmetic processing unit 12 starts overlapping note-on section difference processing. Details of the overlapping note-on section difference processing will be described with reference to the flowchart of FIG. First, after specifying the pointer pw, the arithmetic processing unit 12 executes processing according to the following [Equation 3] to determine the note number nn and the velocity to be processed as vel.

〔数式3〕
nn←EventW[pw].note−number
vel←EventW[pw].velocity
[Formula 3]
nn ← EventW [pw]. note-number
vel ← EventW [pw]. velocity

そして、EventW[pw].channelが0か1かを判断する(S201)。EventW[pw].channelが1の場合、S202〜S207においてチャンネル1についての処理を行い、EventW[pw].channelが0の場合、S208〜S213においてチャンネル0についての処理を行う。   And EventW [pw]. It is determined whether channel is 0 or 1 (S201). EventW [pw]. When channel is 1, processing for channel 1 is performed in S202 to S207, and EventW [pw]. When channel is 0, processing for channel 0 is performed in S208 to S213.

EventW[pw].channelが1の場合、まず、tableW0[nn]が0以上であるかどうかの判断を行う(S202)。すなわち、チャンネル0に同一ノートナンバーのノートオンになっているイベントが存在するかどうかの判断を行う。tableW0[nn]が0以上である場合は、同一ノートナンバーのノートオンイベントが少なくともチャンネル0側に存在していることになるので、時間的に重複する部分が存在する場合は、強制的にノートオフイベントを発行してノートオン区間を中断させる処理を行う(S203)。   EventW [pw]. When channel is 1, it is first determined whether or not tableW0 [nn] is 0 or more (S202). That is, it is determined whether or not there is an event for which note-on with the same note number exists in channel 0. If tableW0 [nn] is greater than or equal to 0, a note-on event with the same note number exists at least on the channel 0 side. A process of interrupting the note-on section by issuing an off event is performed (S203).

具体的には、tableS[nn]が0以上であるかどうかを判断し、tableS[nn]が0以上である場合は、演算処理部12は、以下の〔数式4〕に従った処理を実行する。   Specifically, it is determined whether or not tableS [nn] is equal to or greater than 0. If tableS [nn] is equal to or greater than 0, the arithmetic processing unit 12 executes processing according to the following [Equation 4]. To do.

〔数式4〕
EventS[ps].time←EventW[pw].time
EventS[ps].channel←0
EventS[ps].note−number←nn
EventS[ps].velocity←0
tableS[nn]←−1
ps←ps+1
[Formula 4]
EventS [ps]. time ← EventW [pw]. time
EventS [ps]. channel ← 0
EventS [ps]. note-number ← nn
EventS [ps]. Velocity ← 0
tableS [nn] ← −1
ps ← ps + 1

上記〔数式4〕の6つの式のうち、第1式、第3式では、EventW[pw]のノートイベントのtime、note−numberをEventS[ps]のノートイベントのtime、note−numberとして与えている。第2式では、EventS[ps]のノートイベントのchannelを0に設定している。EventS[]内のノートイベントは1つのチャンネルに納められるため、全てチャンネル0に設定される。第4式では、EventS[ps]のノートイベントのvelocityを0に設定している。これは、ノートオフイベントであることを示すものである。この4つの式により、EventS[]内に強制的にノートオフが設定される。これにより、概念上は、他方のチャンネルの同一ナンバーのノートオン区間が、他方のチャンネルの同一ノートナンバーのノートオンまたはノートオフイベントにより重複区間と非重複区間とに分割されることになる。(この段階では、2つのチャンネルが当該ノートナンバーで時間的にどのように重複するかがわからない)。第5式は、ノートナンバーnnについてのノートオン区間が終了したことを示すための処理である。第6式は、ポインタの加算である。   Of the above six formulas of [Formula 4], in the first and third formulas, eventW [pw] note event time and note-number are given as EventS [ps] note event time and note-number. ing. In the second equation, the channel of the note event of EventS [ps] is set to 0. Since note events in EventS [] are stored in one channel, all are set to channel 0. In the fourth equation, the velocity of the note event of EventS [ps] is set to 0. This indicates a note-off event. By these four expressions, note-off is forcibly set in EventS []. Thus, conceptually, the note-on interval of the same number of the other channel is divided into an overlap interval and a non-overlap interval by a note-on or note-off event of the same note number of the other channel. (At this stage, we don't know how the two channels overlap at that note number in time). The fifth equation is a process for indicating that the note-on interval for the note number nn has ended. The sixth equation is addition of pointers.

〔数式4〕に従った処理を実行したら、演算処理部12は、velが0より大きいかどうかを判断する(S204)。なお、S203において、tableS[nn]が0より小さい場合は、〔数式4〕に従った処理を実行せずにS204に進む。S204において、velが0より大きいと判断された場合には、2つのチャンネルが当該ノートイベントを起点に時間的に重複すると判断され、演算処理部12は、以下の〔数式5〕に従った処理を実行する(S205)。   When the processing according to [Formula 4] is executed, the arithmetic processing unit 12 determines whether or not vel is greater than 0 (S204). If tableS [nn] is smaller than 0 in S203, the process proceeds to S204 without executing the process according to [Equation 4]. If it is determined in S204 that vel is greater than 0, it is determined that the two channels overlap in time starting from the note event, and the arithmetic processing unit 12 performs processing according to the following [Equation 5]. Is executed (S205).

〔数式5〕
vel←|vel−EventW[tableW0[nn]].velocity|
tableW1[nn]←pw
[Formula 5]
vel ← | vel-EventW [tableW0 [nn]]. velocity |
tableW1 [nn] ← pw

上記〔数式5〕の2つの式のうち、第1式では、チャンネル0の同一ノートナンバーのノートイベントとのベロシティの差分を演算し、その差分をvelとしている。この第1式により重複区間の差分演算処理が行われたことになる。なお、この結果である差分velが0の場合は、vel←1とする処理を行う。第2式は、処理したノートナンバーがノートオン区間に入り、何番目のノートイベントでオンになったかを特定する処理である。   Of the two formulas in [Formula 5], in the first formula, the velocity difference from the note event of the same note number of channel 0 is calculated, and the difference is set to vel. The difference calculation process of the overlapping section is performed by the first expression. In addition, when the difference vel as a result is 0, a process of vel ← 1 is performed. The second expression is a process for specifying the note event in which the processed note number enters the note-on section and is turned on.

S204において、vel=0であると判断された場合には、2つのチャンネルで時間的に重複していた区間が終了すると判断され、演算処理部12は、以下の〔数式6〕に従った処理を実行する(S206)。   If it is determined in S204 that vel = 0, it is determined that the section that has been temporally overlapped in the two channels ends, and the arithmetic processing unit 12 performs processing according to the following [Equation 6]. Is executed (S206).

〔数式6〕
vel←EventW[tableW0[nn]].velocity
tableW1[nn]←−1
[Formula 6]
vel ← EventW [tableW0 [nn]]. velocity
tableW1 [nn] ← −1

S204においてvel=0と判断された場合、チャンネル1のノートイベントは、既にノートオン状態になっていて本イベントでノートオフになったと考えられるため、上記〔数式6〕の第1式では、チャンネル0のノートイベントのベロシティをvelに与える。第2式は、チャンネル1におけるノートナンバーnnについてノートオン区間が終了したことを示すための処理である。   If it is determined in step S204 that vel = 0, the note event of channel 1 is already in the note-on state and is considered to be note-off in this event. Give the velocity of the note event of 0 to vel. The second equation is a process for indicating that the note-on interval for the note number nn in channel 1 has ended.

一方、S202において、tableW0[nn]が0より小さい場合は、同一ノートナンバーでチャンネル0側はノートオン状態ではなくチャンネル1側がノートオンになってもノートオフになっても、重複処理を行う必要がないため、tableW1[nn]の処理に進む(S207)。S207では、vel>0でノートオンの場合、演算処理部12は、tableW1[nn]←pwとし、vel=0でノートオフの場合、tableW1[nn]←−1とする処理を実行する。   On the other hand, if tableW0 [nn] is smaller than 0 in S202, it is necessary to perform duplication processing regardless of whether the channel 0 side is in the note-on state and the channel 1 side is in the note-on state or the note-off state with the same note number. Therefore, the process proceeds to tableW1 [nn] (S207). In S207, when vel> 0 and the note is on, the arithmetic processing unit 12 executes a process of setting tableW1 [nn] ← pw, and when vel = 0 and the note is off, tableW1 [nn] ← −1.

上記S202〜S207の処理は、S201においてEventW[pw].channelが1であると判断された場合のチャンネル1に対する処理であるが、上述のように、S201においてEventW[pw].channelが0であると判断された場合は、S208〜S213においてチャンネル0についての処理を行う。ここで、チャンネル0に対する処理のフローチャートを図6に示す。S208〜S213における処理は、処理対象のチャンネルが異なるだけであり、基本的にはS202〜S207における処理と同一である。   The processing of S202 to S207 is performed by EventW [pw]. This is processing for channel 1 when it is determined that channel is 1. However, as described above, EventW [pw]. If it is determined that channel is 0, processing for channel 0 is performed in S208 to S213. Here, a flowchart of the processing for channel 0 is shown in FIG. The processes in S208 to S213 differ only in the channel to be processed, and are basically the same as the processes in S202 to S207.

まず、S208においては、tableW1[nn]が0以上であるかどうかの判断を行う(S202)。すなわち、チャンネル1に同一ノートナンバーのノートがオンになっているかの判断を行う。tableW1[nn]が0以上である場合は、少なくとも同一ノートナンバーでオンになっているノートがチャンネル1側に存在していることになるので、時間的に重複する部分が存在する場合は、その処理を行う(S209)。   First, in S208, it is determined whether tableW1 [nn] is 0 or more (S202). That is, it is determined whether a note having the same note number is turned on in channel 1. If tableW1 [nn] is greater than or equal to 0, there is at least a note that is turned on with the same note number on the channel 1 side, so if there are overlapping parts in time, Processing is performed (S209).

具体的には、tableS[nn]が0以上であるかどうかを判断し、tableS[nn]が0以上である場合は、ノートオン区間になっているため、演算処理部12は、上記〔数式4〕に従った処理を実行しノートオン区間を強制的に終了する。   Specifically, it is determined whether or not tableS [nn] is equal to or greater than 0. If tableS [nn] is equal to or greater than 0, it is in the note-on interval. 4] is executed to forcibly end the note-on section.

〔数式4〕に従った処理を実行したら、演算処理部12は、velが0より大きいかどうかを判断する(S210)。なお、S209において、tableS[nn]が0より小さい場合は、〔数式4〕に従った処理を実行せずにS210に進む。S210において、velが0より大きいと判断された場合には、同一ノートナンバーのノートイベントが重複してノートオンになるため、演算処理部12は、以下の〔数式7〕に従った処理を実行する(S211)。   When the processing according to [Formula 4] is executed, the arithmetic processing unit 12 determines whether or not vel is greater than 0 (S210). If tableS [nn] is smaller than 0 in S209, the process proceeds to S210 without executing the process according to [Equation 4]. If it is determined in S210 that vel is greater than 0, note events with the same note number are overlapped and note-on occurs, so the arithmetic processing unit 12 executes processing according to the following [Equation 7]. (S211).

〔数式7〕
vel←|vel−EventW[tableW1[nn]].velocity|
tableW0[nn]←pw
[Formula 7]
vel ← | vel-EventW [tableW1 [nn]]. velocity |
tableW0 [nn] ← pw

上記〔数式7〕は、上記〔数式5〕におけるtableW1とtableW0が置き換えられたものである。2つの式のうち、第1式では、チャンネル1の同一ノートナンバーのノートイベントとのベロシティの差分を演算し、その差分をvelとしている。この第1式により重複区間の差分演算処理が行われたことになる。なお、この結果である差分velが0の場合は、vel←−1とする処理を行う。以降の処理では、vel=0の場合はノートオフとして扱い、それ以外の場合は、vel=−1のような負値も含めノートオンとして扱う。第2式は、チャンネル0でノートオンになったノートナンバーが何番目のノートイベントであるかを特定する処理である。   The above [Formula 7] is obtained by replacing the tableW1 and the tableW0 in the above [Formula 5]. Of the two equations, in the first equation, the velocity difference from the note event of the same note number of channel 1 is calculated, and the difference is set as vel. The difference calculation process of the overlapping section is performed by the first expression. In addition, when the difference vel as a result is 0, the process of vel ← −1 is performed. In the subsequent processing, if vel = 0, it is treated as note-off, and otherwise, it is treated as note-on including a negative value such as vel = -1. The second equation is a process for specifying the note event of the note number that is turned on in channel 0.

S210において、vel=0であると判断された場合には、演算処理部12は、以下の〔数式8〕に従った処理を実行する(S212)。   If it is determined in S210 that vel = 0, the arithmetic processing unit 12 executes processing according to the following [Equation 8] (S212).

〔数式8〕
vel←EventW[tableW1[nn]].velocity
tableW0[nn]←−1
[Formula 8]
vel ← EventW [tableW1 [nn]]. velocity
tableW0 [nn] ← −1

上記〔数式8〕は、上記〔数式6〕におけるtableW1とtableW0が置き換えられたものである。S210においてvel=0と判断された場合、チャンネル0のノートイベントは、ノートオフイベントであったと考えられるため、上記〔数式8〕の第1式では、チャンネル1のノートイベントのベロシティをそのままvelに与える。第2式は、チャンネル0におけるノートナンバーnnについてノートオン区間が終了したことを示すための処理である。   The above [Equation 8] is obtained by replacing the tableW1 and the tableW0 in the above [Equation 6]. If it is determined in step S210 that vel = 0, the note event of channel 0 is considered to be a note-off event. Therefore, in the first equation of [Equation 8], the velocity of the note event of channel 1 is directly set to vel. give. The second equation is a process for indicating that the note-on interval for the note number nn in channel 0 has ended.

一方、S208において、tableW0[nn]が0より小さい場合は、同一ノートナンバーがチャンネル0側でノートオフになっていることになるので、重複処理を行う必要がないため、tableW0[nn]の処理に進む(S213)。S213では、vel>0の場合、演算処理部12は、tableW0[nn]←pwとし、vel=0の場合、tableW0[nn]←−1とする処理を実行する。   On the other hand, if tableW0 [nn] is smaller than 0 in S208, the same note number is note-off on the channel 0 side, so there is no need to perform duplication processing, so processing of tableW0 [nn] (S213). In S213, when vel> 0, the arithmetic processing unit 12 executes a process of setting tableW0 [nn] ← pw, and when vel = 0, setting tableW0 [nn] ← −1.

チャンネル1に対して、S205、S206、S207のいずれの処理を行った場合でも、チャンネル0に対して、S211、S212、S213のいずれの処理を行った場合でも、処理が終了した場合には、ノートオン/オフ処理を実行する(S214)。S214では、まず、tableS[nn]=−1かつvel>0、またはtableS[nn] >0かつvel=0の場合、以下の〔数式7〕に従った処理を実行し、出力用の配列EventS[]にノートオンイベントまたはノートオフイベントを生成する。ここで、条件となるtableS[nn]=−1かつvel>0は、そのノートナンバーnnがノートオフ状態であって、現在処理中のノートイベントが、ノートオンイベントであることを示している。また、もう一方の条件であるtableS[nn] >0かつvel=0は、既にそのノートナンバーnnがノートオン状態であって、現在処理中のノートイベントが、ノートオフイベントであることを示している。   When any of the processes of S205, S206, and S207 is performed on channel 1 and when any of the processes of S211, S212, and S213 is performed on channel 0, A note on / off process is executed (S214). In S214, first, if tableS [nn] = − 1 and vel> 0, or tableS [nn]> 0 and vel = 0, the processing according to the following [Equation 7] is executed, and the output array EventS Generate note-on event or note-off event in []. Here, the condition tableS [nn] = − 1 and vel> 0 indicates that the note number nn is in the note-off state, and the note event currently being processed is a note-on event. The other condition, tableS [nn]> 0 and vel = 0, indicates that the note number nn is already in a note-on state and the note event currently being processed is a note-off event. Yes.

〔数式9〕
EventS[ps].time←EventW[pw].time
EventS[ps].channel←0
EventS[ps].note−number←nn
EventS[ps].velocity←vel
vel>0の場合tableS[nn]←ps、vel=0の場合tableS[nn]←−1
ps←ps+1
[Formula 9]
EventS [ps]. time ← EventW [pw]. time
EventS [ps]. channel ← 0
EventS [ps]. note-number ← nn
EventS [ps]. velocity ← vel
If vel> 0, tableS [nn] ← ps, if vel = 0, tableS [nn] ← −1.
ps ← ps + 1

上記〔数式9〕の6つの式のうち、第1式、第2式、第3式、第6式は、上記〔数式4〕と同一である。〔数式4〕との違いは、velの値によりノートオフまたはノートオンの双方の場合があるため、第4式において、EventS[ps]のノートイベントのvelocityに現在処理中のベロシティまたは〔数式5〕〜〔数式8〕で補正したベロシティを代入している点である。これは、ノートオンまたはノートオフのいずれの可能性もあり、かつベロシティ値が補正される場合があるためである。第5式では、velの値に応じてtableS[nn]に設定する値が異なっている。vel=0の場合は、〔数式4〕と同様、−1を設定するが、vel>0の場合は、psの値を設定する。   Of the six formulas in [Formula 9], the first formula, the second formula, the third formula, and the sixth formula are the same as [Formula 4]. The difference from [Equation 4] is that there is a case of both note-off or note-on depending on the value of vel. Therefore, in the fourth equation, the velocity currently being processed or the equation 5 ] To [Velocity] corrected by [Equation 8]. This is because there is a possibility of note-on or note-off, and the velocity value may be corrected. In the fifth equation, the value set in tableS [nn] differs depending on the value of vel. When vel = 0, -1 is set as in [Formula 4], but when vel> 0, the value of ps is set.

S214におけるノートオン処理が終わったら、入力側のEventW[]の格納されている全てのノートイベントの処理が終わったかどうかを判断する(S215)。具体的には、pw←pw+1とした後、pw<Nwの場合、全てのノートイベントの処理が終わっていないため、S201に戻って次のノートイベントについての処理を実行する。pw≧Nwの場合、全てのノートイベントの処理が終わったことになるため、Ns←psとして、重複ノートオン区間処理を終了する。   When the note-on process in S214 is completed, it is determined whether or not all the note events stored in the event W [] on the input side have been processed (S215). Specifically, after setting pw ← pw + 1, if pw <Nw, the processing for all the note events is not completed, so the process returns to S201 to execute the processing for the next note event. In the case of pw ≧ Nw, since all the note events have been processed, the overlap note-on section processing is ended as Ns ← ps.

<0デュレーションイベント削除処理>
重複ノートオン区間処理が終了したら、演算処理部12は、0デュレーションイベント削除処理を行う(図2のS3)。重複ノートオン区間についての処理が終了すると、統合された単一チャンネルのMIDIイベント配列EventS[]には、同一ノートナンバーで時間的にノートオン区間が重複するようなノートイベントが存在しなくなる。しかし、EventS[]には、ノートオンとノートオフが同一時刻となる0デュレーションのノートイベントが含まれている可能性がある。そこで、次に、0デュレーションのノートイベントを削除する処理を行う。
<0 duration event deletion process>
When the overlapping note-on section processing ends, the arithmetic processing unit 12 performs 0 duration event deletion processing (S3 in FIG. 2). When the processing for the overlapping note-on period is completed, there is no note event in the integrated single-channel MIDI event array EventS [] that has the same note number and whose note-on period overlaps in time. However, EventS [] may include a 0-duration note event in which note-on and note-off are at the same time. Therefore, next, a process of deleting a note event of 0 duration is performed.

0デュレーションイベント削除処理に際して、演算処理部12は、削除処理後の出力する差分MIDIイベント配列をEventD[h,]として用意し、総ノートイベント数をNd[h]とし、EventS[]、EventD[h,]の各配列へのポインタをps、pdとし、初期状態ではps=pd=0に設定する。また、EventD[h,]のChannel値は全て0に設定する。さらに、コンピュータ(符号化装置)は、0〜127のノートナンバーに対応してノートオン時にMIDIイベント配列へのポインタを格納するノートオンテーブルtableS[]を定義する。そして、tableS[]の全ての初期値を−1に設定する。   In the 0 duration event deletion process, the arithmetic processing unit 12 prepares a differential MIDI event array to be output after the deletion process as EventD [h,], sets the total number of note events as Nd [h], and manages EventS [], EventD [ The pointers to the respective arrays h and] are ps and pd, and ps = pd = 0 is set in the initial state. Also, all the Channel values of EventD [h,] are set to 0. Further, the computer (encoding device) defines a note-on table tableS [] that stores a pointer to a MIDI event array when a note is turned on, corresponding to a note number from 0 to 127. Then, all initial values of tableS [] are set to -1.

配列の準備ができたら、演算処理部12は、0デュレーションイベント削除処理を開始する。この0デュレーションイベント削除処理の詳細を図7のフローチャートを用いて説明する。まず、演算処理部12は、ポインタpsを特定した後、以下の〔数式10〕に従った処理を実行し、処理対象のノートナンバーnn、ベロシティをvelを決定する。   When the arrangement is ready, the arithmetic processing unit 12 starts the 0 duration event deletion process. Details of the 0 duration event deletion processing will be described with reference to the flowchart of FIG. First, after specifying the pointer ps, the arithmetic processing unit 12 executes processing according to the following [Equation 10], and determines the note number nn and the velocity to be processed as vel.

〔数式10〕
nn←EventS[ps].note−number
vel←EventS[ps].velocity
[Formula 10]
nn ← EventS [ps]. note-number
vel <-EventS [ps]. velocity

そして、velが0より大きいか否かを判断する(S301)。velが0より大きいと判断された場合には、以下の〔数式11〕に従った処理を実行する(S302)。   Then, it is determined whether or not vel is greater than 0 (S301). If it is determined that vel is greater than 0, processing according to the following [Equation 11] is executed (S302).

〔数式11〕
tableS[nn]←ps
[Formula 11]
tableS [nn] ← ps

一方、S301において、vel=0であると判断された場合には、まず、EventS[tableS[nn]].timeとEventS[ps].timeが一致するかどうかを判断し、両者が一致する場合に限り、以下の〔数式12〕に従った処理を実行する(S303)。   On the other hand, if it is determined in S301 that vel = 0, first, EventS [tableS [nn]]. time and EventS [ps]. It is determined whether or not time matches, and only when both match, processing according to the following [Formula 12] is executed (S303).

〔数式12〕
EventS[tableS[nn] ].note−number←−1
EventS[ps].note−number←−1
tableS[nn]←−1
[Formula 12]
EventS [tableS [nn]]. note-number ← -1
EventS [ps]. note-number ← -1
tableS [nn] ← −1

EventS[tableS[nn]].timeとEventS[ps].timeが一致する場合は、デュレーションが0であることを意味するので、そのノートイベントを削除する。本実施形態では、上記〔数式12〕の第1式、第2式に示すように、そのノートイベントにノートナンバーとしては無効な負の値(−1)を設定している。S303において、EventS[tableS[nn]].timeとEventS[ps].timeが一致しないと判断された場合には、上記〔数式12〕に従った処理は実行しない。   EventS [tableS [nn]]. time and EventS [ps]. If the time matches, it means that the duration is 0, and the note event is deleted. In this embodiment, as shown in the first and second formulas of [Formula 12], a negative value (−1) that is invalid as a note number is set for the note event. In S303, EventS [tableS [nn]]. time and EventS [ps]. If it is determined that the times do not match, the process according to [Formula 12] is not executed.

また、S301において、vel<0であると判断された場合には、上記〔数式7〕においてvelに“−1”が設定されたことになり、これは、重複区間のベロシティの差分が“0”であったことを意味する。この場合、事前の設定に従って以下の2通りの処理のいずれか一方を実行する。1つ目は、velの値を0以外の1〜127の範囲で小さな値に変更する処理である。本実施形態では、vel←1としている。“0以外の1〜127の範囲で小さな値”としては、必ずしも“1”である必要はなく、MIDIデータに記録された音響信号の特性に応じて適宜設定しておくことが可能である。   If it is determined in S301 that vel <0, it means that “−1” is set to vel in the above [Equation 7]. This is because the velocity difference in the overlapping section is “0”. ”Means it was. In this case, one of the following two processes is executed according to the prior setting. The first is a process of changing the value of vel to a small value in the range of 1 to 127 other than 0. In the present embodiment, vel ← 1. The “small value in the range of 1 to 127 other than 0” does not necessarily have to be “1”, and can be appropriately set according to the characteristics of the acoustic signal recorded in the MIDI data.

2つ目は、重複区間を符号化対象から削除する処理である。具体的には、対応するノートオフイベントを探索し、上記〔数式12〕に従った処理を実行して、無効化する。この無効化により、後の処理において符号化対象から削除されることになる。   The second is a process of deleting the overlapping section from the encoding target. Specifically, the corresponding note-off event is searched, and the processing according to the above [Equation 12] is executed and invalidated. By this invalidation, it is deleted from the encoding target in a later process.

S302、S303のいずれの処理を行った場合でも、次に、エネルギー値の更新処理を実行する(S304)。具体的には、以下の〔数式13〕に従った処理を実行する。   Regardless of whether the processing of S302 or S303 is performed, the energy value update processing is executed (S304). Specifically, the process according to the following [Formula 13] is executed.

〔数式13〕
Energy[h]←Energy[h]+EventS[tableS[nn]].velocity・(EventS[ps].time−EventS[tableS[nn]].time)
ps←ps+1
[Formula 13]
Energy [h] ← Energy [h] + EventS [tableS [nn]]. velocity (EventS [ps] .time-EventS [tableS [nn]]. time)
ps ← ps + 1

上記〔数式13〕の第1式では、ノートオン区間のベロシティにデュレーションを乗じてエネルギー値を算出し、それまでに算出されている総エネルギー値に加算することにより、総エネルギー値Energy[h]を更新している。総エネルギー値Energy[h]を更新したら、上記〔数式13〕の第2式によりpsの値をインクリメントする。そして、ps<Nsであるかどうかを判断する(S305)。ps<Nsである場合は、S301に戻る。一方、ps≧Nsである場合は、全てのノートイベントについて処理したことを意味するので、出力イベント配列の生成に進む。結局、S301〜S305のループにおいては、デュレーションが0のノートイベントを削除し、総エネルギー値を算出する処理を実行していることになる。   In the first equation of [Equation 13], the energy value is calculated by multiplying the velocity of the note-on interval by the duration, and adding it to the total energy value calculated so far, so that the total energy value Energy [h] Has been updated. When the total energy value Energy [h] is updated, the value of ps is incremented according to the second equation of the above [Equation 13]. Then, it is determined whether or not ps <Ns (S305). If ps <Ns, the process returns to S301. On the other hand, if ps ≧ Ns, it means that all note events have been processed, and the process proceeds to generation of an output event array. After all, in the loop of S301 to S305, the note event whose duration is 0 is deleted, and the process of calculating the total energy value is executed.

全てのノートイベントに対する処理を実行し、デュレーション0のノートイベントの削除、総エネルギー値の算出が行われたら、出力イベント配列の生成を行う(S306)。まず、ps=pd=0に設定する。続いて、EventS[ps].note−number≧0であるかどうかを判断する。そして、EventS[ps].note−number≧0である場合は、無効化されていないノートイベントであることを意味するので、以下の〔数式14〕に従った処理を実行し、出力イベント配列EventD[h,pd]に値を出力する。   When processing for all note events is executed, deletion of note events with duration 0 and calculation of the total energy value are performed, an output event array is generated (S306). First, ps = pd = 0 is set. Subsequently, EventS [ps]. It is determined whether or not note-number ≧ 0. EventS [ps]. If note-number ≧ 0, it means a note event that has not been invalidated, so the processing according to the following [Equation 14] is executed, and the value in the output event array EventD [h, pd] Is output.

〔数式14〕
EventD[h,pd].time←EventS[ps].time
EventD[h,pd].channel←0
EventD[h,pd].note−number←EventS[ps].note−number
EventD[h,pd].velocity←EventS[ps].velocity
pd←pd+1
ps←ps+1
[Formula 14]
EventD [h, pd]. time <-EventS [ps]. time
EventD [h, pd]. channel ← 0
EventD [h, pd]. note-number ← EventS [ps]. note-number
EventD [h, pd]. velocity ← EventS [ps]. velocity
pd ← pd + 1
ps ← ps + 1

上記〔数式14〕により、1つのノートイベントについての出力イベント配列EventD[h,pd]への出力が終わったら、ps<Nsであるかどうかを判断する(S307)。ps<Nsである場合は、S306に戻る。一方、ps≧Nsである場合は、位相hに対して全てのノートイベントについて処理したことを意味するので、処理を終了する。   When the output to the output event array EventD [h, pd] for one note event is completed according to the above [Equation 14], it is determined whether or not ps <Ns is satisfied (S307). If ps <Ns, the process returns to S306. On the other hand, if ps ≧ Ns, it means that all note events have been processed for the phase h, and the processing is terminated.

本発明では、位相ずれを考慮しない処理を行うことも可能である。位相ずれを考慮しない場合は、上記図7の終了をもって全て処理を終了とし、図2のS1〜S3の処理により得られた出力イベント配列EventD[]が差分MIDIデータとして得られる。しかし、位相ずれを考慮しない場合、MIDIデータM1とMIDIデータM2の位相ずれ(時間的な位置ずれ)が生じた場合に、両者の差異が実際よりも大きくなるという問題がある。ここで、この差分処理時の位相ずれの様子を図8に示す。   In the present invention, it is also possible to perform processing that does not consider phase shift. When the phase shift is not taken into consideration, the processing is completed at the end of FIG. 7, and the output event array EventD [] obtained by the processing of S1 to S3 of FIG. 2 is obtained as differential MIDI data. However, when the phase shift is not taken into account, there is a problem that when the phase shift (temporal position shift) between the MIDI data M1 and the MIDI data M2 occurs, the difference between the two becomes larger than the actual difference. Here, FIG. 8 shows the phase shift during the difference processing.

図8(a)、(b)、(c)はそれぞれMIDIデータM1、MIDIデータM2、差分MIDIデータを示している。いずれも左右方向は時間軸を示している。上下方向は、音高(ノートナンバー)を示すが、各矩形の上下方向の幅は、音の強さ(ベロシティ)を示している。また、網掛けされた部分はノートオン区間を示している。図8(a)、(b)を比較するとわかるように、MIDIデータM1とM2は、全く同じMIDIデータが、時間軸方向に位置ずれしたものである。   FIGS. 8A, 8B, and 8C show MIDI data M1, MIDI data M2, and differential MIDI data, respectively. In both cases, the horizontal direction indicates the time axis. The vertical direction indicates the pitch (note number), but the vertical width of each rectangle indicates the sound intensity (velocity). A shaded portion indicates a note-on interval. As can be seen from a comparison between FIGS. 8A and 8B, the MIDI data M1 and M2 are the same MIDI data with the position shifted in the time axis direction.

図8(a)に示したMIDIデータM1と図8(b)に示したMIDIデータM2の差分演算を行うと、図8(c)に示すような差分MIDIデータが得られる。図8(c)において網掛けされた部分がベロシティの差分が0とならなかった部分である。このように、本来全く同じMIDIデータであっても、位置ずれが生じていると、図8(c)のような擬似差分が生じることになる。本実施形態では、このような擬似差分をなくすため、MIDIデータM1、M2のいずれか一方を時間軸方向に移動させることにより時間を合わせ、差分を得るようにしている。現実には、時間を完全に合わせることは不可能であるので、移動させる時間を変化させながら差分演算を行い、差分が最小となったときを、時間的な位置が合っているものとみなして、その差分を出力する。   When the difference calculation between the MIDI data M1 shown in FIG. 8A and the MIDI data M2 shown in FIG. 8B is performed, the difference MIDI data as shown in FIG. 8C is obtained. A shaded portion in FIG. 8C is a portion where the velocity difference is not zero. In this way, even if the MIDI data is essentially the same, if there is a positional shift, a pseudo difference as shown in FIG. 8C is generated. In the present embodiment, in order to eliminate such a pseudo difference, the time is adjusted by moving one of the MIDI data M1 and M2 in the time axis direction so as to obtain the difference. In reality, it is impossible to perfectly match the time, so the difference calculation is performed while changing the time to move, and when the difference is minimized, the time position is considered to be correct. , Output the difference.

位相ずれを考慮する場合、図7の0デュレーションイベント削除処理または図2のS3の処理が終了したら、図2でNd[h]←pd、h←h+1とした後、h≧Hであるかどうかを判断する(S4)。すなわち、全ての位相についてS1〜S3の処理を終えたかどうかを判断する。h<Hの場合、未処理の位相が残っているため、繰り返し、S1〜S3の処理を実行する。h≧Hの場合、全ての位相について処理を終えたことになるので、差分MIDIデータの選別を行う(S5)。   When phase shift is taken into account, when the 0 duration event deletion process of FIG. 7 or the process of S3 of FIG. 2 is completed, whether N ≧ [h] ← pd, h ← h + 1 in FIG. Is determined (S4). That is, it is determined whether or not the processing of S1 to S3 has been completed for all phases. In the case of h <H, since the unprocessed phase remains, the processes of S1 to S3 are repeated. If h ≧ H, the processing has been completed for all phases, so differential MIDI data is selected (S5).

具体的には、h=0,・・・,H−1において算出されたノートイベントの総エネルギー値Energy[h]を最小とするhをhmとして、MIDIイベント配列EventD[hm,]を求める差分MIDIデータとして採用し、それをMIDI符号として出力する。   Specifically, the difference for obtaining the MIDI event array EventD [hm,], where h is the minimum energy value Energy [h] of note events calculated at h = 0,..., H−1. It is adopted as MIDI data and is output as a MIDI code.

差分MIDIデータは、様々な形式で出力することができる。表示用のデータに変換して、表示部13に画面出力することも可能であるし、音響信号に変換して音響出力部14に音響出力することも可能であるし、そのまま記憶媒体等のデータ出力部15にデータ出力することも可能である。表示部13に画面出力するに際しては、ノートオンおよびノートオフをノートオン区間に変換して左右幅を決定し、ベロシティに対応する上下方向の幅を決定して矩形を生成し、対応するノートナンバーの位置に配置することにより、表示用データを生成し、表示部13に出力する。すなわち、図8に示したような形式で表示されることになる。表示部13と音響出力部14に同時に出力した場合には、2種の音響信号を視覚的かつ聴覚的に評価することができる。   The differential MIDI data can be output in various formats. It can be converted into display data and output on the screen to the display unit 13, or it can be converted into an acoustic signal and output to the acoustic output unit 14 as it is, or data on a storage medium or the like as it is. It is also possible to output data to the output unit 15. When the screen is output to the display unit 13, note-on and note-off are converted into note-on intervals to determine the left and right widths, the vertical width corresponding to the velocity is determined to generate a rectangle, and the corresponding note numbers are generated. Display data is generated and output to the display unit 13. That is, it is displayed in a format as shown in FIG. In the case of simultaneous output to the display unit 13 and the sound output unit 14, two types of sound signals can be visually and audibly evaluated.

本発明は、各種符号化技術の開発や、電子透かし埋め込み技術の開発など音響信号に対して何らかの改変を加え、その信号劣化度を評価する産業に利用することができる。また、その開発成果は、PCM等により得られた音響信号を、MIDI符号等の符号コードに変換する技術を用い、放送メディア(地上・BSなどによるデジタルラジオ・テレビ放送など)、通信メディア(CS放送、インターネット・ストリーミング放送、携帯電話サービス、携帯音楽配信サービスなど)、パッケージメディア(CD、DVD、BlueRay、メモリICカードなど)向けのオーディオコンテンツ制作産業に利用することができる。   The present invention can be used in an industry in which some modification is made to an acoustic signal such as development of various encoding techniques and development of a digital watermark embedding technique, and the degree of signal degradation is evaluated. In addition, the development results are based on the technology that converts sound signals obtained by PCM into code codes such as MIDI codes, broadcast media (digital radio and television broadcasts such as terrestrial and BS), and communication media (CS Broadcast, Internet streaming broadcast, mobile phone service, mobile music distribution service, etc.) and audio media production industry for package media (CD, DVD, BlueRay, memory IC card, etc.).

11 データ入力部
12 演算処理部
13 表示部
14 音響出力部
15 データ出力部
DESCRIPTION OF SYMBOLS 11 Data input part 12 Arithmetic processing part 13 Display part 14 Sound output part 15 Data output part

Claims (16)

音響信号を符号化して得られた2つの独立した符号データに対して両者の差分を表す1つの差分符号データを作成する方法であって、
前記符号データは時系列に配置されたイベントデータで構成され、各イベントデータには、発音開始または発音終了のイベントの識別、当該イベントの時刻、音の高さ、チャンネル番号、音の強さの属性情報を備え、
前記2つの符号データの各イベントデータに対して互いに異なるチャンネル番号を付与しながら、前記時刻が早い順にソートして、2つのチャンネル番号を有する1つの時系列な符号データに統合し、2チャンネル符号データを作成する符号データ統合段階と、
発音開始のイベントデータと、当該イベントデータと同一の音の高さをもつ発音終了のイベントデータとの2つのイベントデータの対で構成される区間を発音区間としたとき、前記2チャンネル符号データの中で、一方のチャンネルの発音区間が、同一の音の高さをもつ他方のチャンネルの発音区間と時間的に全てまたは一部が重複する場合に、両発音区間が重複する区間を、両発音区間の音の強さの差分値を新たな音の強さとする新たな発音区間を重複区間として生成し、前記重複する両発音区間のうち、一方のチャンネルにのみノートオン区間が存在する区間については、当該一方のチャンネルの音の強さを有する発音区間を生成する重複発音区間差分処理段階と、
前記重複発音区間差分処理段階にて更新された発音区間の各々の発音開始のイベントデータと発音終了のイベントデータを時系列にソートし、
所定の形式で符号化する差分符号データ符号化段階と、
を有することを特徴とする差分符号データの作成方法。
A method of creating one differential code data representing a difference between two independent code data obtained by encoding an acoustic signal,
The code data is composed of event data arranged in chronological order, and each event data includes identification of an event at the start or end of pronunciation , time of the event , pitch, channel number, and sound intensity. With attribute information,
While applying different channel numbers for each event data of the two code data, the time is sorted in ascending order, into one time-series code data with two channel numbers, 2 channel code A code data integration stage for creating data;
When a section composed of two event data pairs of event data at the start of sound generation and event data at the end of sound generation having the same pitch as the event data is defined as the sound generation section, the two-channel code data In the case where the sounding section of one channel overlaps with the sounding section of the other channel that has the same pitch, all or part of the sounding section overlaps in time, For a section in which a note-on section exists only in one of the overlapping sound generation sections, with a new sound generation section having a new sound intensity as a difference value of the sound intensity of the section as a new section. Is an overlapping pronunciation interval difference processing stage for generating a pronunciation interval having the sound intensity of the one channel ;
Sorting the event data of the pronunciation start and the event data of the pronunciation end of each of the pronunciation sections updated in the overlapping pronunciation section difference processing step in time series,
Differential code data encoding stage for encoding in a predetermined format;
A method for creating differential code data, comprising:
請求項1において、
前記重複発音区間差分処理段階は、前記重複区間の音の強さが0の場合、前記音の強さを0以外の1〜127の範囲で小さな値に変更することを特徴とする差分符号データの作成方法。
In claim 1,
The difference pronunciation data characterized in that, in the overlapping pronunciation section difference processing step, when the sound intensity of the overlapping section is 0, the sound intensity is changed to a small value within a range of 1 to 127 other than 0. How to create
請求項1において、
前記重複発音区間差分処理段階は、前記重複区間の音の強さが0の場合、前記重複区間を符号化対象から削除することを特徴とする差分符号データの作成方法。
In claim 1,
The method of creating differential code data, wherein, in the overlapping pronunciation section difference processing step, when the sound intensity of the overlapping section is 0, the overlapping section is deleted from the encoding target.
請求項1から請求項3のいずれかにおいて、
前記符号データ統合段階は、前記2つの符号データのいずれか一方の全ての発音開始、発音終了のイベントデータの時刻に対して複数通りのオフセット値を一律に加えるようにし、
前記複数通りのオフセット値に基づいて、前記差分符号データ符号化段階までを複数回実行して複数通りの差分符号データを符号化するようにし、
前記差分符号データ符号化段階にて符号化された複数通りの各差分符号データに対して、発音開始のイベントデータとそれに対応する同一の音の高さをもつ発音終了の2つのイベントデータの対で構成される発音区間を抽出し、前記抽出された全ての発音区間の音の強さと発音区間の時間間隔(発音終了のイベントデータの時刻と発音開始のイベントデータの時刻との差)との積の総和値を算出し、前記総和値が最小となる差分符号データを選別する差分符号データ選別段階を、前記差分符号データ符号化段階の後に有することを特徴とする差分符号データの作成方法。
In any one of Claims 1-3,
In the code data integration step, a plurality of offset values are uniformly added to the time of the event data of the start and end of sound generation of any one of the two code data,
Based on the plurality of offset values, a plurality of steps until the differential code data encoding step is performed to encode a plurality of types of differential code data,
For each of the plurality of differential code data encoded in the differential code data encoding step, a pair of event data for starting the sound and two event data for the end of the sound having the same pitch as the corresponding sound data. Is extracted, and the sound intensity of all of the extracted sounding intervals and the time interval of the sounding interval (the difference between the time of event data at the end of sounding and the time of event data at the start of sounding) A differential code data creation method comprising: after the differential code data encoding step, a differential code data selection step of calculating a sum value of products and selecting differential code data having a minimum total value.
請求項1から請求項4のいずれかにおいて、
前記差分符号データ符号化段階は、前記重複発音区間差分処理段階により得られた発音区間として、発音開始と発音終了の時刻が同一のものがある場合に、当該発音区間を構成するイベントデータを削除する処理をさらに行うことを特徴とする差分符号データの作成方法。
In any one of Claims 1-4,
The difference code data encoding step deletes event data constituting the sounding section when there is a sounding section obtained by the overlapping sounding section difference processing step having the same sounding start time and sounding end time. A method of creating differential code data, characterized by further performing a process of
請求項1から請求項5のいずれかにおいて、
前記差分符号データ符号化段階により得られた差分符号データを表示手段に画面表示する段階、および/または前記差分符号データを音響再生手段により音響再生する段階をさらに有することを特徴とする差分符号データの作成方法。
In any one of Claims 1-5,
The differential code data further comprising the step of displaying the differential code data obtained in the differential code data encoding step on a screen on a display means, and / or the step of acoustically reproducing the differential code data by an acoustic reproduction means. How to create
請求項1から請求項6のいずれかにおいて、
前記符号データは、MIDIデータであり、前記発音開始の識別はノートオン、前記発音終了の識別はノートオフ、前記時刻はデルタタイム、前記音の高さはノートナンバー、前記音の強さはベロシティ、前記発音区間はノートオン区間で表現されることを特徴とする差分符号データの作成方法。
In any one of Claims 1-6,
The code data is MIDI data, the start of sound identification is note-on, the end of sound generation is note-off, the time is delta time, the pitch is a note number, and the sound intensity is velocity. The method of generating differential code data, wherein the sounding section is expressed as a note-on section.
音響信号を符号化して得られた2つの独立した符号データに対して両者の差分を表す1つの差分符号データを作成する装置であって、
前記符号データは時系列に配置されたイベントデータで構成され、各イベントデータには、発音開始または発音終了のイベントの識別、当該イベントの時刻、音の高さ、チャンネル番号、音の強さの属性情報を備え、
前記2つの符号データの各イベントデータに対して互いに異なるチャンネル番号を付与しながら、前記時刻が早い順にソートして、2つのチャンネル番号を有する1つの時系列な符号データに統合し、2チャンネル符号データを作成する符号データ統合手段と、
発音開始のイベントデータと、当該イベントデータと同一の音の高さをもつ発音終了のイベントデータとの2つのイベントデータの対で構成される区間を発音区間としたとき、前記2チャンネル符号データの中で、一方のチャンネルの発音区間が、同一の音の高さをもつ他方のチャンネルの発音区間と時間的に全てまたは一部が重複する場合に、両発音区間が重複する区間を、両発音区間の音の強さの差分値を新たな音の強さとする新たな発音区間を重複区間として生成し、前記重複する両発音区間のうち、一方のチャンネルにのみノートオン区間が存在する区間については、当該一方のチャンネルの音の強さを有する発音区間を生成する重複発音区間差分処理手段と、
前記重複発音区間差分処理手段にて更新された発音区間の各々の発音開始のイベントデータと発音終了のイベントデータを時系列にソートし、所定の形式で符号化する差分符号データ符号化手段と、
を有することを特徴とする差分符号データの作成装置。
An apparatus for creating one differential code data representing a difference between two independent code data obtained by encoding an acoustic signal,
The code data is composed of event data arranged in chronological order, and each event data includes identification of an event at the start or end of pronunciation , time of the event , pitch, channel number, and sound intensity. With attribute information,
While applying different channel numbers for each event data of the two code data, the time is sorted in ascending order, into one time-series code data with two channel numbers, 2 channel code Code data integration means for creating data;
When a section composed of two event data pairs of event data at the start of sound generation and event data at the end of sound generation having the same pitch as the event data is defined as the sound generation section, the two-channel code data In the case where the sounding section of one channel overlaps with the sounding section of the other channel that has the same pitch, all or part of the sounding section overlaps in time, For a section in which a note-on section exists only in one of the overlapping sound generation sections, with a new sound generation section having a new sound intensity as a difference value of the sound intensity of the section as a new section. Is an overlapping pronunciation interval difference processing means for generating a pronunciation interval having the sound intensity of the one channel ,
Sorting the event data of the pronunciation start and the event data of the pronunciation end of each of the pronunciation intervals updated by the overlapping pronunciation interval difference processing means in time series, and differential code data encoding means for encoding in a predetermined format;
An apparatus for creating differential code data, comprising:
請求項8において、
前記重複発音区間差分処理手段は、前記重複区間の音の強さが0の場合、前記音の強さを0以外の1〜127の範囲で小さな値に変更することを特徴とする差分符号データの作成装置。
In claim 8,
The differential pronunciation section difference processing means changes the sound intensity to a small value within a range of 1 to 127 other than 0 when the sound intensity of the overlap section is 0. Creation device.
請求項8において、
前記重複発音区間差分処理手段は、前記重複区間の音の強さが0の場合、前記重複区間を符号化対象から削除することを特徴とする差分符号データの作成装置。
In claim 8,
The apparatus for creating differential code data, wherein the overlapping pronunciation section difference processing means deletes the overlapping section from the encoding target when the sound intensity of the overlapping section is 0.
請求項8から請求項10のいずれかにおいて、
前記符号データ統合手段は、前記2つの符号データのいずれか一方の全ての発音開始、発音終了のイベントデータの時刻に対して複数通りのオフセット値を一律に加えるようにし、
前記複数通りのオフセット値に基づいて、前記差分符号データ符号化手段までを複数回実行して複数通りの差分符号データを符号化するようにし、
前記差分符号データ符号化手段にて符号化された複数通りの各差分符号データに対して、発音開始のイベントデータとそれに対応する同一の音の高さをもつ発音終了の2つのイベントデータの対で構成される発音区間を抽出し、前記抽出された全ての発音区間の音の強さと発音区間の時間間隔(発音終了のイベントデータの時刻と発音開始のイベントデータの時刻との差)との積の総和値を算出し、前記総和値が最小となる差分符号データを選別する差分符号データ選別手段を、さらに有することを特徴とする差分符号データの作成装置。
In any one of Claims 8 to 10,
The code data integration means uniformly adds a plurality of offset values with respect to the time of the event data of the start and end of sound generation of either one of the two code data,
Based on the plurality of offset values, the differential code data encoding means is executed a plurality of times to encode a plurality of types of differential code data,
For each of a plurality of types of differential code data encoded by the differential code data encoding means, a pair of event data at the start of sound generation and two event data at the end of sound generation having the same pitch corresponding thereto. Is extracted, and the sound intensity of all of the extracted sounding intervals and the time interval of the sounding interval (the difference between the time of event data at the end of sounding and the time of event data at the start of sounding) An apparatus for creating differential code data, further comprising differential code data selection means for calculating a total value of products and selecting differential code data having a minimum total value.
請求項8から請求項11のいずれかにおいて、
前記差分符号データ符号化手段は、前記重複発音区間差分処理手段により得られた発音区間として、発音開始と発音終了の時刻が同一のものがある場合に、当該発音区間を構成するイベントデータを削除する処理をさらに行うことを特徴とする差分符号データの作成装置。
In any one of Claims 8-11,
The difference code data encoding means deletes event data constituting the sounding section when the sounding section obtained by the overlapping sounding section difference processing means has the same sounding start time and sounding end time. An apparatus for creating differential code data, characterized by further performing a process to perform the process.
請求項8から請求項12のいずれかにおいて、
前記差分符号データ符号化手段により得られた差分符号データを画面表示する表示手段、および/または前記差分符号データを音響再生する音響再生手段をさらに有することを特徴とする差分符号データの作成装置。
In any one of Claims 8-12,
An apparatus for creating differential code data, further comprising: display means for displaying differential code data obtained by the differential code data encoding means on a screen; and / or sound reproducing means for acoustically reproducing the differential code data.
請求項8から請求項13のいずれかにおいて、
前記符号データは、MIDIデータであり、前記発音開始の識別はノートオン、前記発音終了の識別はノートオフ、前記時刻はデルタタイム、前記音の高さはノートナンバー、前記音の強さはベロシティ、前記発音区間はノートオン区間で表現されることを特徴とする差分符号データの作成装置。
In any one of Claims 8 to 13,
The code data is MIDI data, the start of sound identification is note-on, the end of sound generation is note-off, the time is delta time, the pitch is a note number, and the sound intensity is velocity. The sound generation section is expressed as a note-on section.
請求項1から請求項7のいずれかに記載の差分符号データの作成方法をコンピュータに実行させるためのプログラム。   A program for causing a computer to execute the differential code data creation method according to any one of claims 1 to 7. 請求項8から請求項14のいずれかに記載の差分符号データの作成装置としてコンピュータを機能させるためのプログラム。   15. A program for causing a computer to function as the differential code data creating apparatus according to claim 8.
JP2010130680A 2010-06-08 2010-06-08 Method and apparatus for creating differential code data Expired - Fee Related JP5609281B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010130680A JP5609281B2 (en) 2010-06-08 2010-06-08 Method and apparatus for creating differential code data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010130680A JP5609281B2 (en) 2010-06-08 2010-06-08 Method and apparatus for creating differential code data

Publications (2)

Publication Number Publication Date
JP2011257512A JP2011257512A (en) 2011-12-22
JP5609281B2 true JP5609281B2 (en) 2014-10-22

Family

ID=45473767

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010130680A Expired - Fee Related JP5609281B2 (en) 2010-06-08 2010-06-08 Method and apparatus for creating differential code data

Country Status (1)

Country Link
JP (1) JP5609281B2 (en)

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4132239B2 (en) * 1998-06-26 2008-08-13 大日本印刷株式会社 Sound editing system
JP3601373B2 (en) * 1999-09-29 2004-12-15 ヤマハ株式会社 Waveform editing method
JP2002372968A (en) * 2001-06-14 2002-12-26 Dainippon Printing Co Ltd Method and apparatus for comparing and evaluating acoustic signals

Also Published As

Publication number Publication date
JP2011257512A (en) 2011-12-22

Similar Documents

Publication Publication Date Title
JP4899416B2 (en) Network connection device
KR20110122631A (en) Stereo playback method and apparatus
JP2003177784A (en) Sound inflection point extraction apparatus and method, sound reproduction apparatus and method, sound reproduction system, sound distribution system, information providing apparatus, sound signal editing apparatus, sound inflection point extraction method program recording medium, sound reproduction method program recording medium, sound Signal editing method program recording medium, acoustic inflection point extraction method program, acoustic reproduction method program, acoustic signal editing method program
JP4867765B2 (en) Information embedding device for sound signal and device for extracting information from sound signal
JP5609281B2 (en) Method and apparatus for creating differential code data
JP5857418B2 (en) Method and apparatus for creating auditory masking data
JP4660275B2 (en) Information embedding apparatus and method for acoustic signal
WO2014142201A1 (en) Device and program for processing separating data
JP4910920B2 (en) Information embedding device for sound signal and device for extracting information from sound signal
JP5552794B2 (en) Method and apparatus for encoding acoustic signal
JP4063048B2 (en) Apparatus and method for synchronous reproduction of audio data and performance data
JP6168649B2 (en) Code detection apparatus and program
JP4152502B2 (en) Sound signal encoding device and code data editing device
JP2007298607A (en) Acoustic signal analysis apparatus, acoustic signal analysis method, and acoustic signal analysis program
WO2024241791A1 (en) Information processing device, information processing method, and program
CN111653255A (en) Sound source library acquisition and generation system
JP2014109603A (en) Musical performance evaluation device and musical performance evaluation method
JP4713181B2 (en) Information embedding device for sound signal, device for extracting information from sound signal, and sound signal reproducing device
JP5310498B2 (en) Information embedding device for acoustic signals
JP4831335B2 (en) Information embedding device for sound signal and device for extracting information from sound signal
US20210286584A1 (en) Reproduction device and reproduction method
JP5104202B2 (en) Real-time information embedding device for acoustic signals
Hyrkas Algorithms for Roughness Control Using Frequency Shifting and Attenuation of Partials in Audio
WO2024034115A1 (en) Audio signal processing device, audio signal processing method, and program
JP2008225234A (en) Audio signal processor

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20130419

RD01 Notification of change of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7421

Effective date: 20130823

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20140520

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140605

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20140805

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20140818

R150 Certificate of patent or registration of utility model

Ref document number: 5609281

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees