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
JP3405181B2 - Musical tone generation method - Google Patents
[go: Go Back, main page]

JP3405181B2 - Musical tone generation method - Google Patents

Musical tone generation method

Info

Publication number
JP3405181B2
JP3405181B2 JP07503798A JP7503798A JP3405181B2 JP 3405181 B2 JP3405181 B2 JP 3405181B2 JP 07503798 A JP07503798 A JP 07503798A JP 7503798 A JP7503798 A JP 7503798A JP 3405181 B2 JP3405181 B2 JP 3405181B2
Authority
JP
Japan
Prior art keywords
data
waveform
performance
buffer
parameter
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
JP07503798A
Other languages
Japanese (ja)
Other versions
JPH10312189A (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.)
Yamaha Corp
Original Assignee
Yamaha Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Yamaha Corp filed Critical Yamaha Corp
Priority to JP07503798A priority Critical patent/JP3405181B2/en
Publication of JPH10312189A publication Critical patent/JPH10312189A/en
Application granted granted Critical
Publication of JP3405181B2 publication Critical patent/JP3405181B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Electrophonic Musical Instruments (AREA)

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、MIDIデータな
どの曲データの供給を受けて楽音を発生する楽音発生方
法に関するものである。例えば、ネットワークを経由し
てMIDIデータストリームを受信しながら再生するソ
フト音源に適用することができるものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a musical tone generating method for generating musical tones by receiving music data such as MIDI data. For example, it can be applied to a soft sound source that reproduces a MIDI data stream while receiving it via a network.

【0002】[0002]

【従来の技術】特別なハードウエアを用いずにソフトウ
エアにより音源を実現するソフト音源が知られている。
このようなソフト音源を用いて、あらかじめ用意された
曲データを再生する場合があるが、最近では、ネットワ
ークから曲データをロードして再生する場合もある。
2. Description of the Related Art A software sound source is known which realizes a sound source by software without using special hardware.
There are cases in which music data prepared in advance is played back using such a soft sound source, but recently, there is also a case in which music data is loaded from a network and played back.

【0003】コンピュータから、インターネット等のネ
ットワークを通じて曲データを要求する命令をサーバに
送り、サーバは、この命令に応答して曲データをコンピ
ュータに向けて配送する。具体的な例としては、ワール
ドワイドウエブ(WWW)のホームページにハイパーテ
キスト言語(HTML)に基づくタグとして埋め込まれ
た曲データを、コンピュータが、このホームページのロ
ード時に要求する場合や、コンピュータからファイル転
送プロトコル(FTP)に基づくFTPサーバ上に用意
されたMIDIファイルを、画面上の特定部分をクリッ
クすることにより要求する場合等がある。曲データとし
ては、スタンダードMIDIファイル(SMF)、およ
び、このSMFに画像データや歌詞データを組み合わせ
たカラオケファイルなどのマルチメディアファイルがあ
る。
A computer sends a command for requesting music data to a server through a network such as the Internet, and the server delivers the music data to the computer in response to the command. As a specific example, when a computer requests song data embedded in a World Wide Web (WWW) home page as a tag based on Hypertext Language (HTML), or when a file is transferred from the computer. There is a case where a MIDI file prepared on the FTP server based on the protocol (FTP) is requested by clicking a specific portion on the screen. The music data includes a standard MIDI file (SMF), and a multimedia file such as a karaoke file in which the SMF is combined with image data and lyrics data.

【0004】コンピュータでは、曲データを受信するた
め、ウエブブラウザ等のソフトウエアが実行される。ウ
エブブラウザとしては、ネットスケープ(Netsca
peCommunications Corporat
ion、商標)やインターネットエクスプローラ(Mi
crosoft Corporation、商標)が一
般的である。ウエブブラウザでは、上述した手法により
曲データのファイルを、サーバからロードする機能を有
する。
In the computer, software such as a web browser is executed to receive the music data. As a web browser, Netscape
peCommunications Corporate
Ion, trademark) and Internet Explorer (Mi
Microsoft Corporation (trademark) is common. The web browser has a function of loading a music data file from the server by the above-mentioned method.

【0005】その具体例として、「MIDIPLUG」
(ヤマハ株式会社、商標)「Crescendo」(L
ive Up Date Corporation、商
標)、「歌楽」(ヤマハ株式会社、商標)などがある。
「MIDIPLUG」は、XG規格の主要音色を備え、
MIDIデータを完全に受信し終わると再生を開始する
ソフト音源である。「Crescendo」は、MID
Iデータを受信しながら、受信データがある程度たまる
とローカルのハードまたはソフトによる外部MIDI音
源にMIDI出力を行うプレーヤである。これらは、ワ
ールドワイドウエブ(WWW)のホームページを閲覧す
るウエブブラウザに組み込まれるプラグインソフトであ
り、別ソフトウエアによるウエブブラウザへの付加機能
となっているが、将来的には、ウエブブラウザ自身の標
準機能となる可能性もある。「歌楽」は、歌詞と演奏と
を同期させて表示する通信カラオケ用ソフトウエアパッ
ケージである。
As a concrete example, "MIDIPLUG"
(Yamaha Corporation, trademark) "Crescendo" (L
"Ive Up Date Corporation, trademark", "Kagaru" (Yamaha Corporation, trademark), and the like.
"MIDIPLUG" is equipped with the main tone of the XG standard,
It is a soft sound source that starts playing when MIDI data is completely received. "Crescendo" is the MID
While receiving I data, when a certain amount of received data is accumulated, the player outputs MIDI to an external MIDI sound source by local hardware or software. These are plug-in software installed in the web browser that browses the World Wide Web (WWW) home page, and it is an additional function to the web browser by another software, but in the future, the web browser itself It may become a standard function. "Katagaku" is a software package for online karaoke that displays lyrics and performance in synchronization.

【0006】図14は、従来の楽音発生方法の動作説明
図である。図中、121はMIDIデータの入力タイミ
ング、12は音源パラメータ作成期間、14は波形デー
タ生成期間である。従来のソフト音源を用いた楽音発生
方法において、音源ドライバは、時間フレーム(F−
2)の期間のMIDIデータ入力タイミング121でM
IDIデータを入力し、音源パラメータ作成期間12に
おいて音源パラメータの生成を行い、次の時間フレーム
(F−1)の期間の波形データ生成期間14において、
新たに生成された音源パラメータを含めた波形データを
生成する。この波形データは、次の時間フレーム(F)
において再生される。音源パラメータの生成は、MID
Iデータが入力されるごとに、波形データの生成を中断
して行われる。
FIG. 14 is a diagram for explaining the operation of the conventional tone generation method. In the figure, 121 is a MIDI data input timing, 12 is a sound source parameter creation period, and 14 is a waveform data generation period. In the conventional tone generation method using a soft sound source, the sound source driver uses a time frame (F-
At the MIDI data input timing 121 in the period 2), M
Input the IDI data, generate the sound source parameter in the sound source parameter creation period 12, and in the waveform data generation period 14 of the next time frame (F-1),
Waveform data including the newly generated sound source parameter is generated. This waveform data is the next time frame (F)
Played in. Sound source parameter generation is MID
The generation of waveform data is interrupted each time I data is input.

【0007】そのため、ノートオン,ノートオフ,ピッ
チベンド等の演奏イベントが特定の時間フレーム、例え
ば、時間フレーム(F−2)に集中した場合、この時間
フレームでCPUの負荷が極端に増大し、音源計算に影
響を与え、同時発音数の減少など波形の生成が完全に行
えなくなるという問題があった。
Therefore, when performance events such as note-on, note-off, pitch bend, etc. concentrate on a specific time frame, for example, the time frame (F-2), the load on the CPU increases extremely at this time frame, and the sound source is generated. There was a problem that it affected the calculation and could not completely generate the waveform, such as the decrease in the number of polyphony.

【0008】[0008]

【発明が解決しようとする課題】本発明は、上述した問
題点を解決するためになされたもので、曲データから波
形データを生成する処理の負荷を時間的に平均化するこ
とにより実質的な処理負担が小さくなる楽音発生方法を
提供することを目的とするものである。また、ネットワ
ークから曲データをロードして波形データを再生する場
合に、曲データの全部のロードが完了するのを待つこと
なく、曲の再生を開始することができる楽音発生方法を
提供することを目的とするものである。
SUMMARY OF THE INVENTION The present invention has been made in order to solve the above-mentioned problems, and it is substantially realized by temporally averaging the load of processing for generating waveform data from music data. It is an object of the present invention to provide a musical tone generating method that reduces the processing load. In addition, when the song data is loaded from the network and the waveform data is played back, it is possible to provide a tone generation method that can start playing the song without waiting for the loading of all the song data to be completed. It is intended.

【0009】[0009]

【課題を解決するための手段】請求項1に記載の発明に
おいては、楽音発生方法において、供給された曲データ
を順次パラメータに変換し第1のメモリに書き込む第1
のステップと、第1のメモリに記憶された前記パラメー
タに基づいて波形データを生成し第2のメモリに書き込
むとともに、前記波形データの生成に使用した前記パラ
メータが書き込まれていた領域を第1のメモリにおいて
解放する第2のステップと、第2のメモリに記憶された
前記波形データを再生して楽音を発生する第3のステッ
プを有し、第2のステップは、第3のステップの前記波
形データの再生の進行に応じて前記波形データを生成
し、第1のステップは、第1のメモリに未使用領域が存
在する場合に前記パラメータへの変換を実行するもので
ある。
According to a first aspect of the present invention, in the musical tone generating method, the supplied musical piece data is sequentially converted into parameters and written into the first memory.
And a step of generating waveform data based on the parameters stored in the first memory and writing the waveform data in the second memory, and a region in which the parameters used to generate the waveform data are written in the first area. It has a second step of releasing in the memory, and a third step of reproducing the waveform data stored in the second memory to generate a musical sound, and the second step includes the waveform of the third step. The waveform data is generated according to the progress of data reproduction, and the first step is to perform conversion to the parameter when an unused area exists in the first memory.

【0010】したがって、曲データから波形データを生
成する処理を、波形データの再生の進行に応じて処理を
する部分と、これとは独立して実行することのできるパ
ラメータ変換処理とに分けることができたため、パラメ
ータ変換処理を、この処理のためのバッファ用である第
1のメモリの記憶容量の範囲で先行して実行することが
でき、曲データから波形データを再生する処理の負荷が
時間的に平均化され、実質的な処理負担が小さくなる。
Therefore, the process of generating the waveform data from the music data can be divided into a part for processing according to the progress of the reproduction of the waveform data and a parameter conversion process which can be executed independently of this. Therefore, the parameter conversion process can be executed in advance within the range of the storage capacity of the first memory for the buffer for this process, and the load of the process of reproducing the waveform data from the music data is temporal. And the processing load is substantially reduced.

【0011】請求項2に記載の発明においては、楽音発
生方法において、通信路を通じて供給された曲データを
受信し第1のメモリに書き込む第1のステップと、第1
のメモリに記憶された前記曲データをパラメータに変換
し第2のメモリに書き込む第2のステップと、第2のメ
モリに記憶された前記パラメータに基づき波形データを
生成し第3のメモリに書き込むとともに、前記波形デー
タの生成に使用した前記パラメータが書き込まれていた
領域を第2のメモリにおいて解放する第3のステップ
と、第3のメモリに記憶された前記波形データを再生し
て楽音を発生する第4のステップを有し、第3のステッ
プは、第4のステップの前記波形データの再生の進行に
応じて前記波形データを生成し、第2のステップは、第
2のメモリに未使用領域が存在し、かつ、第1のメモリ
に未だパラメータに変換されていない曲データが存在す
る場合に前記パラメータへの変換を実行するものであ
る。
According to a second aspect of the invention, in the musical tone generating method, the first step of receiving the music piece data supplied through the communication path and writing the music piece data in the first memory;
Second step of converting the song data stored in the memory of the above into a parameter and writing into the second memory, and generating waveform data based on the above parameter stored in the second memory and writing into the third memory , A third step of releasing in the second memory the area in which the parameter used to generate the waveform data is written, and reproducing the waveform data stored in the third memory to generate a musical sound A fourth step, the third step generates the waveform data according to the progress of the reproduction of the waveform data in the fourth step, and the second step, the unused area in the second memory. Exists, and there is song data that has not been converted into a parameter in the first memory, conversion to the parameter is executed.

【0012】したがって、請求項1に記載の発明と同様
な作用を奏するとともに、第1のメモリに未だパラメー
タに変換されていない曲データが存在する場合に、パラ
メータ変換処理を行うことができるため、曲データの全
部のロードが完了するのを待つことなく、曲の再生を開
始することができる。
Therefore, the same operation as that of the first aspect of the present invention can be achieved, and the parameter conversion process can be performed when the first memory has the music data which has not been converted into the parameters. It is possible to start playing the song without waiting for the loading of all of the song data to be completed.

【0013】請求項3に記載の発明においては、楽音発
生方法において、複数の演奏イベントからなる曲データ
を供給する供給ステップと、供給された前記曲データか
ら、演奏イベントの演奏データおよび演奏タイミング
順次取り出すとともに取り出された各演奏イベント
演奏データを音源パラメータに変換し、該演奏データ
に対応する前記演奏タイミングとともにバッファに書き
込むパラメータ変換ステップと、所定時間間隔ごとに起
動され、生成している楽音波形の時刻が、前記バッファ
に前記音源パラメータとともに記憶された前記対応する
演奏タイミングに一致する時点で、当該演奏タイミング
に対応する、前記バッファに記憶された前記音源パラメ
ータにより、楽音波形を生成するための音源レジスタ
記憶された前記音源パラメータを更新しつつ、音源レ
ジスタに記憶された前記音源パラメータに基づいて前記
楽音波形の生成を実行する楽音波形生成ステップと、生
成された前記楽音波形を前記時刻に対応させて再生する
楽音発生ステップと、を備えており、前記パラメータ変
換ステップは、処理の優先順位が前記楽音波形生成ステ
ップの処理の優先順位よりも低く設定されているもので
ある。
According to a third aspect of the present invention, in the musical tone generating method, a supplying step of supplying music data composed of a plurality of performance events , and the performance data and performance timing of each performance event from the supplied music data. with to sequentially eject the, each performance event that has been removed
It converted, the performance data of the performance data to the sound source parameters of
A parameter conversion step of writing into the buffer with the performance timing corresponding to, is started every predetermined time interval, the time of production to that tone waveform, the corresponding stored together with the sound source parameter in the buffer <br/> when the matching <br/> playing timing, corresponding to the performance timing, by the sound source parameters stored in the buffer, the sound source register for generating a tone waveform
While updating the stored the sound source parameters are useful to a tone waveform generation step of performing the generation of the musical tone waveform on the basis of the sound source parameters stored in the tone generator register, the generated the musical sound waveform to the time and and a tone generation step of reproducing Te, the parameter conversion step are those which are set lower than the priority of the processing priority is the tone waveform generation step of processing.

【0014】したがって、曲データから波形データを生
成する処理を、波形データの再生の進行に応じて処理を
する部分と、これとは独立して実行することのできるパ
ラメータ変換処理とに分けることができたため、パラメ
ータ変換処理を、先行して実行することができ、曲デー
タから波形データを再生する処理の負荷が時間的に平均
化され、実質的な処理負担が小さくなる。
Therefore, the process of generating the waveform data from the music data can be divided into a part which is processed according to the progress of the reproduction of the waveform data and a parameter conversion process which can be executed independently of this part. As a result, the parameter conversion process can be executed in advance, the load of the process of reproducing the waveform data from the music data is averaged over time, and the substantial processing load is reduced.

【0015】請求項4に記載の発明においては、請求項
3記載の楽音発生方法において、前記楽音波形生成ステ
ップは、前記供給された曲データの前記複数の演奏イベ
ントの中から、前記パラメータ変換ステップが実行され
ていない演奏イベントであって、かつ、該演奏イベント
の前記演奏タイミングが、前記楽音波形を生成すべき
前記所定時間間隔を有する前記楽音波形の時刻の範囲内
にあるという条件を満たす演奏イベントを検出する第1
のステップと、該第1のステップが、前記条件を満たす
演奏イベントを検出したときは、前記楽音波形を生成す
る前に、前記条件を満たす演奏イベントの前記演奏デー
タを前記音源パラメータに変換し、該演奏データに対応
する前記演奏タイミングとともに前記バッファに書き込
む第2のステップ、を含むものである。
According to a fourth aspect of the present invention, in the tone generating method according to the third aspect, the tone waveform generating step is performed.
Is the performance data of the supplied song data.
From the cement, a performance event said parameter conversion step is not executed, and the performance timing of the performance event is generated should do a pre SL tone waveform,
Detecting a performance event satisfying a condition that the musical sound waveform is within a time range having the predetermined time interval ;
And the first step satisfy the above condition
When it detects a performance event, before generating the pre SL tone waveform, the performance data of the satisfying performance event
Data to the above-mentioned sound source parameters and correspond to the performance data
Write to the buffer with the performance timing
The second step is included .

【0016】したがって、楽音波形を生成すべき、前記
所定時間間隔を有する前記楽音波形の時刻の範囲内にパ
ラメータ変換ステップがまだ実行されていない演奏イベ
ントがある場合には、パラメータ変換ステップを実行し
てから楽音波形生成ステップを実行することができる。
Therefore, if there is a performance event in which the parameter converting step has not been executed yet within the time range of the musical sound waveform having the predetermined time interval for which the musical tone waveform is to be generated, the parameter converting step is executed. Then, the musical sound waveform generation step can be executed.

【0017】[0017]

【発明の実施の形態】図1は、本発明の第1の実施の形
態の楽音発生方法の処理の流れを表わす説明図である。
図2は、本発明の第1の実施の形態の楽音発生方法のタ
イミング図である。図中、図14と同様な部分には同じ
符号を付して説明を省略する。11は曲データ、13は
演奏タイミングである。この実施の形態は、ローカルに
あらかじめ用意された自動演奏用の曲ファイルの曲デー
タを再生するものである。
DESCRIPTION OF THE PREFERRED EMBODIMENTS FIG. 1 is an explanatory diagram showing the flow of processing of a musical tone generating method according to a first embodiment of the present invention.
FIG. 2 is a timing chart of the musical tone generating method according to the first embodiment of this invention. 14, those parts that are the same as those corresponding parts in FIG. 14 are designated by the same reference numerals, and a description thereof will be omitted. 11 is music data, and 13 is performance timing. In this embodiment, music data of a music file for automatic performance prepared locally beforehand is reproduced.

【0018】図2に示す曲データ11は、データ領域に
記憶されている。この曲データ11には、1つの演奏イ
ベントにつき、この演奏イベントを表すデータとこの演
奏イベントの演奏タイミングのデータが含まれている。
演奏タイミングのデータは、曲の先頭などからの絶対時
間を表す時刻情報でもよいし、直前の演奏イベントから
今回の演奏イベントまでの相対な時間間隔を表すデュレ
ーション情報でもよい。異なるシーケンサ間で演奏デー
タをやりとりするための標準ファイルとして、SMF
(スタンダードMIDIファイル)が知られている。こ
のSMFでは、デュレーション情報を用いて演奏タイミ
ングを表している。以下、デュレーション情報を用いて
演奏タイミングを表わす場合について説明する。
The song data 11 shown in FIG. 2 is stored in the data area. The music data 11 includes, for each performance event, data representing the performance event and performance timing data of the performance event.
The performance timing data may be time information indicating an absolute time from the beginning of a song, or duration information indicating a relative time interval from the immediately preceding performance event to the current performance event. As a standard file for exchanging performance data between different sequencers, SMF
(Standard MIDI file) is known. In this SMF, duration information is used to represent performance timing. Hereinafter, a case where performance timing is represented using duration information will be described.

【0019】S1の処理Aにおいては、データ領域から
曲データ11(MIDI)を順次読み出し、これを音源
パラメータ(PARM)に展開しPバッファ(パラメー
タバッファ)に書き込む。ただし、S1は、Pバッファ
に未使用領域(空き)がある場合に実行し、あらかじめ
音源パラメータ(PARM)をPバッファに書き込んで
おく。この実行は、通常、図2に示すように実際の演奏
タイミング13よりも前になされている。なお、図2で
は、演奏タイミング13は、図14に示した従来の楽音
発生方法の動作説明図に合わせて、実際に波形データが
再生される時間フレームの2フレーム前に図示してい
る。
In the process A of S1, the music data 11 (MIDI) is sequentially read from the data area, developed into a sound source parameter (PARM), and written in the P buffer (parameter buffer). However, S1 is executed when there is an unused area (free space) in the P buffer, and the sound source parameter (PARM) is written in the P buffer in advance. This execution is usually performed before the actual performance timing 13 as shown in FIG. In FIG. 2, the performance timing 13 is shown two frames before the time frame in which the waveform data is actually reproduced, in accordance with the operation explanatory view of the conventional tone generation method shown in FIG.

【0020】パラメータの1例としては、PCM音源の
場合、選択された音色データに対応した波形メモリのス
タートアドレスやエンドアドレス、エンベロープのパラ
メータなどがある。上述したデュレーション情報は、図
2に示した演奏タイミング13を示す時刻情報データに
変換され、Pバッファには、この時刻情報を付加した音
源パラメータが書き込まれる。しかし、何らかの時間間
隔情報(曲データ11中に含まれたデュレーション情報
そのものでもよい)を付加して音源パラメータを書き込
むようにしてもよい。いずれにせよ、時刻情報または時
間間隔情報といった演奏タイミングを示す時間情報付き
で音源パラメータが書き込まれ、波形生成の際に演奏タ
イミングを知るのに用いられる。
As an example of the parameters, in the case of a PCM sound source, there are a start address and an end address of a waveform memory corresponding to the selected tone color data, envelope parameters, and the like. The duration information described above is converted into time information data indicating the performance timing 13 shown in FIG. 2, and the sound source parameter added with this time information is written in the P buffer. However, the sound source parameter may be written by adding some time interval information (may be the duration information itself included in the song data 11). In any case, the sound source parameter is written with time information such as time information or time interval information indicating the performance timing, and is used to know the performance timing at the time of waveform generation.

【0021】S2の処理Bは、1つの時間フレームの波
形再生完了に合わせて実行され、図2に示すような時間
フレームの開始時点ごとに起動がかけられる。この実施
例では、1つの時間フレーム(例えば、F−2)の再生
が終了する毎に、次に再生する時間フレームのさらにそ
の次の時間フレーム(F)で再生すべき波形データを生
成するようになっている。音源パラメータに付与された
時刻情報がその波形データを生成する時間フレームの範
囲に入っていれば、この音源パラメータは、波形データ
の生成の途中で音源レジスタに書き込まなければいけな
い。つまり、その波形データを再生する時間フレーム
(F)の1つ前の時間フレーム(F−1)において、そ
の時間フレーム(F)の時刻情報が付与された音源パラ
メータが音源レジスタに入力され、楽音生成に使用され
る。
The process B of S2 is executed in synchronization with the completion of waveform reproduction of one time frame, and is activated at each start time point of the time frame as shown in FIG. In this embodiment, every time the reproduction of one time frame (for example, F-2) is completed, the waveform data to be reproduced is generated in the time frame (F) next to the time frame to be reproduced next. It has become. If the time information given to the sound source parameter falls within the range of the time frame for generating the waveform data, this sound source parameter must be written in the sound source register during the generation of the waveform data. That is, in the time frame (F-1) immediately before the time frame (F) for reproducing the waveform data, the sound source parameter to which the time information of the time frame (F) is added is input to the sound source register, and the musical sound is generated. Used for generation.

【0022】そして、この時間フレーム(Fー1)にお
いて、音源レジスタの音源パラメータを用いて波形デー
タ(WAVE)を生成し、Wバッファ(波形バッファ)
に書き込む。このステップS2の実行により、使用され
た音源パラメータは、Pバッファに記憶しておく必要が
なくなり、使用された音源パラメータが記憶されていた
領域を解放し、Pバッファには未使用領域(空き)がで
きる。
Then, in this time frame (F-1), waveform data (WAVE) is generated using the sound source parameter of the sound source register, and the W buffer (waveform buffer) is generated.
Write in. By executing this step S2, the used sound source parameter does not need to be stored in the P buffer, the area in which the used sound source parameter was stored is released, and the unused area (empty) in the P buffer. You can

【0023】S3においては、再生デバイスが処理を行
う。再生デバイスは、CODEC、CODECドライ
バ、サウンドシステム等で構成される。ここでいうCO
DECとは、音声インタフェース用のLSIであり、内
部にA/D変換器、D/A変換器、サンプリング周期発
生器、波形圧縮伸張回路、DMAC(ダイレクトアクセ
スメモリコントローラ)等を備えた半導体チップであ
り、A/D変換やD/A変換等の機能は有するものの、
それだけでは波形データの録音や再生はできない。CO
DECドライバは、ソフト音源等の他のソフトウエアの
下で、上述したCODECを制御あるいは利用して、入
力波形をRAM上に録音したり、RAM上の波形データ
を再生したりするソフトウエアである。なお、CODE
Cドライバが、CODECのLSIの外部に用意された
DMACを利用する場合もある。その場合は、このDM
ACも再生デバイスに含まれる。
In S3, the playback device performs processing. The playback device is composed of a CODEC, a CODEC driver, a sound system, and the like. CO here
DEC is an LSI for voice interface, and is a semiconductor chip equipped with an A / D converter, a D / A converter, a sampling cycle generator, a waveform compression / expansion circuit, a DMAC (Direct Access Memory Controller), etc. Yes, although it has functions such as A / D conversion and D / A conversion,
The waveform data cannot be recorded or played back by itself. CO
The DEC driver is software that controls or utilizes the above-mentioned CODEC under other software such as a software sound source to record the input waveform on the RAM or reproduce the waveform data on the RAM. . In addition, CODE
In some cases, the C driver uses a DMAC prepared outside the CODEC LSI. In that case, this DM
AC is also included in the playback device.

【0024】波形データを生成するプログラムは、波形
データをCODECドライバに渡すことにより、COD
ECを使用した波形再生処理、すなわち、波形データを
サンプリング周期毎に1サンプルずつD/A変換器に転
送する処理を委託する。CODECドライバに制御され
たDMACが、Wバッファに記憶された波形データをサ
ンプリング周期毎に1サンプルずつ読み出し、サウンド
システムを通して波形を出力する。
The program for generating the waveform data passes the waveform data to the CODEC driver to
A waveform reproduction process using EC, that is, a process of transferring the waveform data to the D / A converter one sample at each sampling period is entrusted. The DMAC controlled by the CODEC driver reads the waveform data stored in the W buffer one sample at a sampling period and outputs the waveform through the sound system.

【0025】一例として、CODECドライバは、DM
Aバッファとして、1フレーム分のバッファメモリを2
個用意している。CODECドライバがこのバッファメ
モリの一方に記憶された波形データを再生中に、Wバッ
ファに記憶された1フレーム分の波形データが他方のバ
ッファメモリに書き込まれる。一方のバッファメモリか
ら波形データの再生が終了すると、CODECドライバ
は、他方のバッファメモリの再生を引き続き行い、その
間に、Wバッファに記憶された波形データを一方のバッ
ファメモリに書き込む。これを繰り返すことにより、C
ODECで継続的に波形データが再生される。なお、C
ODECドライバが1フレーム分のバッファメモリを2
個用意する代わりに、上述したWバッファを2個用意し
て、2つのWバッファに記憶されている波形データを交
互に再生し、処理Bは、CODECドライバが1つのW
バッファ上の波形データを再生している間に、他方のバ
ッファ上にその次に再生すべき波形データを生成するよ
うにしてもよい。
As an example, the CODEC driver is DM
2 buffer memories for 1 frame as A buffer
I have one. While the CODEC driver is reproducing the waveform data stored in one of the buffer memories, one frame of waveform data stored in the W buffer is written in the other buffer memory. When the reproduction of the waveform data from one buffer memory is completed, the CODEC driver continues the reproduction of the other buffer memory, during which the waveform data stored in the W buffer is written in the one buffer memory. By repeating this, C
Waveform data is continuously reproduced by ODEC. Note that C
The ODEC driver has two buffer memories for one frame.
Instead of preparing two pieces, the above-mentioned two W buffers are prepared and the waveform data stored in the two W buffers are alternately reproduced. In process B, the CODEC driver uses one W buffer.
While reproducing the waveform data in the buffer, the waveform data to be reproduced next may be generated in the other buffer.

【0026】また、S1のステップにおいて、発音割当
をすることができる。この段階で発音割当を行う場合に
は、CPUは、ノートオン時に何チャネルが使用されて
発音されているかという発音状況を認識しておく必要が
ある。ノートオフ時には、ノートオフの音高データに対
応する発音中のチャネル番号を見つけ、このチャネルの
番号の音源レジスタにノートオフを書込むだけでよい。
Further, in step S1, it is possible to assign pronunciation. When assigning pronunciations at this stage, the CPU needs to recognize the pronunciation status of how many channels are used and sounded at the time of note-on. At the time of note-off, it suffices to find the channel number being sounded corresponding to the note-off pitch data and write the note-off in the tone generator register of this channel number.

【0027】この実施の形態においては、曲データから
波形データを生成する処理を、前記波形データの再生の
進行に応じて処理をする処理Bと、これとは独立して実
行することのできる処理Aとに分けている。そして、処
理Aと処理Bとの連携は、具体的には、曲データに含ま
れたデュレーション情報という時間データを用いて、音
源パラメータにも時間情報を付加しておくことにより実
現している。処理Aと処理Bとに分けることができたた
め、処理Aを、Pバッファの記憶容量の範囲で先行して
実行することができ、曲データから波形データを再生す
る処理の負荷が時間的に平均化される。
In this embodiment, a process B for generating waveform data from music data and a process B for performing the process according to the progress of reproduction of the waveform data and a process that can be executed independently of the process B. It is divided into A. The cooperation between the process A and the process B is specifically realized by adding time information to the sound source parameter by using time data called duration information included in the music data. Since the process A and the process B can be divided, the process A can be executed in advance within the storage capacity of the P buffer, and the load of the process of reproducing the waveform data from the music data is averaged over time. Be converted.

【0028】上述したPバッファの記憶容量は、必要以
上に大きくしなくてもよい。Pバッファの記憶容量は、
CPUの処理能力等に応じて最適容量が決まるため、使
用されているCPUの種類を検出して自動的にPバッフ
ァに割り当てる記憶容量を設定するようにしてもよい。
あるいは、ユーザが割り当てる記憶容量を任意に設定す
るようにしてもよい。
The storage capacity of the P buffer described above need not be increased more than necessary. The storage capacity of the P buffer is
Since the optimum capacity is determined according to the processing capacity of the CPU, etc., the type of the CPU being used may be detected and the storage capacity automatically allocated to the P buffer may be set.
Alternatively, the storage capacity assigned by the user may be set arbitrarily.

【0029】上述した説明では、曲データの読み出しか
ら波形データの再生までを、処理の流れに沿って説明し
たが、実際に実行される動作としては、CODECによ
る波形データの再生処理が「主」であり優先処理され、
波形データの再生処理に応じて、処理Bの波形データ生
成が「従」で実行される。
In the above description, the process from the reading of the music data to the reproduction of the waveform data has been described according to the flow of processing, but as the operation actually executed, the reproduction process of the waveform data by CODEC is “main”. And is prioritized,
In accordance with the reproduction processing of the waveform data, the waveform data generation of the process B is “subordinate”.

【0030】図3は、楽音発生機能を有するパーソナル
コンピュータのハードウエア構成の概要図である。21
はCPUバス、22はハードディスク、23はFDD,
CD−ROM,MOなどのリムーバルディスク、24は
CRT,LCDなどの表示器、25はキーボードおよび
マウス、26はCODEC、27はサウンドシステム、
28はMIDIインタフェース、29はタイマ、30は
CPU、31はROM、32はRAM、33はネットワ
ークインタフェースである。図1,図2に示した第1の
実施の形態および図10等を参照して後述する第2の実
施の形態に共通して用いることのできる構成を示す。
FIG. 3 is a schematic diagram of a hardware configuration of a personal computer having a tone generating function. 21
Is a CPU bus, 22 is a hard disk, 23 is an FDD,
Removable disks such as CD-ROM and MO, 24 is a display such as CRT and LCD, 25 is a keyboard and mouse, 26 is a CODEC, 27 is a sound system,
28 is a MIDI interface, 29 is a timer, 30 is a CPU, 31 is a ROM, 32 is a RAM, and 33 is a network interface. A configuration that can be used in common with the first embodiment shown in FIGS. 1 and 2 and the second embodiment described later with reference to FIG. 10 and the like is shown.

【0031】通常のパーソナルコンピュータの基本構成
にCODEC26、サウンドシステム27が取り付けら
れたコンピュータであって、さらに、そのコンピュータ
の基本動作を制御するオペレーティングシステムに、波
形再生機能を有するCODECドライバが組み込まれて
いればソフト音源を実行することができる。ソフト音源
を実行するプログラムは、例えば、ハードディスク22
に格納されており、RAM32にロードされ実行され
る。曲データは、例えば、リムーバルディスク23にあ
らかじめ記憶されるか、ネットワークインターフェース
33を介して外部サーバなどから供給されてハードディ
スク22にあらかじめ記憶される。
A computer in which a CODEC 26 and a sound system 27 are attached to the basic configuration of an ordinary personal computer, and a CODEC driver having a waveform reproducing function is incorporated in an operating system which controls the basic operation of the computer. If so, the soft sound source can be executed. The program for executing the soft sound source is, for example, the hard disk 22.
Stored in the RAM 32 and loaded into the RAM 32 and executed. The song data is stored in the removable disk 23 in advance, or is supplied from an external server or the like via the network interface 33 and stored in the hard disk 22 in advance.

【0032】図1に示したPバッファ,Wバッファは、
RAM32上に設けられる。CODEC26は、この中
または別に取り付けられたDMAC(ダイレクトメモリ
アクセスコントローラ)により、RAM32からデータ
を取り出す。外付けのMIDI機器に接続する場合には
MIDIインタフェース28が、外部サーバに接続する
場合にはネットワークインタフェース33が必要であ
る。CPU30は単一のCPUであるが、マルチCPU
であってもよい。
The P buffer and W buffer shown in FIG.
It is provided on the RAM 32. The CODEC 26 takes out data from the RAM 32 by a DMAC (Direct Memory Access Controller) attached in this or separately. The MIDI interface 28 is required when connecting to an external MIDI device, and the network interface 33 is required when connecting to an external server. CPU30 is a single CPU, but multiple CPU
May be

【0033】図4は、本発明の第1の実施の形態の楽音
発生方法のメインフローチャートである。このフロー
は、表示器上で所望の楽曲のMIDIファイル名をクリ
ックするなどして選択すると、ソフト音源プログラムが
起動して開始される。S41においては、全ての発音チ
ャネルのための音源レジスタを無発音状態にする。ま
た、ソフト音源の再生のために、再生デバイスであるC
ODECドライバ、CODEC26、サウンドシステム
27を初期設定し、波形再生ソフトを起動する。S42
においては、起動要因チェックが行われ、S43におい
て、起動要因がない場合にはS42に処理を戻し、起動
要因がある場合には、S44に処理を進め、起動要因の
分析が行われる。
FIG. 4 is a main flowchart of the musical sound generating method according to the first embodiment of the present invention. This flow is started by activating a software tone generator program when the MIDI file name of a desired music piece is clicked on the display to select it. In S41, the sound source registers for all the sound generation channels are set to the non-sound generation state. Also, in order to play back the software sound source, the playback device C
Initialize the ODEC driver, CODEC 26, and sound system 27, and start the waveform reproduction software. S42
In step S43, the activation factor is checked. If there is no activation factor in step S43, the process returns to step S42. If there is an activation factor, the process proceeds to step S44 to analyze the activation factor.

【0034】S44においては、Pバッファに所定量
以上の未使用領域(空き)ができたときには、S45の
処理Aに進み、曲データから次に処理すべきMIDIデ
ータを取り出し音源パラメータ(PARM)に変換し、
Pバッファに書き込む。1つの時間フレームの波形再
生が完了したときには、S46の処理Bに進み、Pバッ
ファに記憶された演奏タイミング情報付きの音源パラメ
ータに基づいて、次の時間フレームの波形を生成し、W
バッファに書き込む。音色選択操作、アルゴリズム選
択操作等のその他の要求があるときには、S47に処理
を進め要求に応じた音源動作の設定を行う。ソフト音
源の終了要求があるときには、S48に処理を進めソフ
ト音源のプログラムの終了処理をする。図3に示したC
PU30は、これらの起動要因を絶えずチェックしてお
り、S44において起動要因を判定して具体的な処理を
開始する。
In S44, when an unused area (vacant space) of a predetermined amount or more is formed in the P buffer, the process proceeds to S45, where the MIDI data to be processed next is extracted from the music data and is set as the sound source parameter (PARM). Converted,
Write to P buffer. When the waveform reproduction of one time frame is completed, the process proceeds to S46, where the waveform of the next time frame is generated based on the sound source parameter with the performance timing information stored in the P buffer, and W
Write to the buffer. When there is another request such as a tone color selecting operation or an algorithm selecting operation, the process proceeds to S47 to set the sound source operation according to the request. If there is a request for ending the software tone generator, the process proceeds to S48 to end the software tone generator program. C shown in FIG.
The PU 30 constantly checks these activation factors, determines the activation factor in S44, and starts specific processing.

【0035】これらの処理の中で最も重要なものは、波
形生成をする処理Bである。また、音色の途中変更等
は、聴感上処理の遅れがさほど問題にならない。これら
の点を考慮して、マルチタスク処理において処理を優先
する順位は、>>>とする。なお、Pバッフ
ァ,Wバッファとも、各バッファに記憶されたデータの
内、処理の終わった使用済みのデータが記憶されていた
領域は、未使用領域として開放される。
The most important of these processes is the process B for waveform generation. In addition, when the tone color is changed on the way, the delay of the process is not a serious problem in hearing. Considering these points, the order of prioritizing processing in multitask processing is >>>. In both the P buffer and the W buffer, of the data stored in each buffer, the area in which used data that has been processed is stored is released as an unused area.

【0036】ここで、上述した処理Bの起動要因の変
形例について説明する。上述した説明では、1つの時間
フレームの波形再生が完了したときを起動要因とした。
その代わりに、CODECドライバが読むCODECの
バッファ領域があるが、この領域がある程度空いて所定
量以上の未使用領域ができたときを処理Bの起動要因
とすることもできる。
Here, a modified example of the activation factor of the process B described above will be described. In the above description, when the waveform reproduction of one time frame is completed, the activation factor is used.
Instead, there is a CODEC buffer area read by the CODEC driver, but when this area is free to some extent and an unused area of a predetermined amount or more is created, it is possible to set the activation factor of the process B as a factor.

【0037】あるいは、1つの時間フレーム以下の時間
間隔で中程度のレベルの割り込みをかける波形生成トリ
ガを頻繁に出しておき、うまく割り込みがかかったとき
を処理Bの起動要因とし、先に生成できなかった波形
があっても波形生成の遅れを回復できるようにする。割
り込みのかかり方に変動が多い環境でも音源を安定して
動作させることができる。
Alternatively, a waveform generation trigger for interrupting a medium level at a time interval of one time frame or less is frequently issued, and when the interrupt is successfully generated, it can be generated first as the activation factor of the process B. Even if there is a missing waveform, it is possible to recover the delay of waveform generation. The sound source can be operated stably even in an environment where there are many fluctuations in how interrupts are applied.

【0038】なお、CODECのバッファは、通常2フ
レーム分のバッファである場合が多いが、バッファサイ
ズはこれ以上にしてもよい。いずれの変形例でも、起動
要因で起動される処理Bでは、その時点でのCODE
Cのバッファの未使用領域の大きさに応じた所定量の波
形を生成すればよい。上述した起動要因の変形例におい
て、Wバッファは必ずしも必要としない。
The CODEC buffer is usually a buffer for two frames in many cases, but the buffer size may be larger than this. In any of the modified examples, in the process B activated by the activation factor, the CODE at that point is
A predetermined amount of waveform may be generated according to the size of the unused area of the C buffer. In the modification of the activation factor described above, the W buffer is not always necessary.

【0039】図5は、図4に示した処理Aのフローチャ
ートである。S51においては、曲データから、次の演
奏イベントの演奏データおよび演奏タイミングを取り出
す。具体的には、曲データから既に読み終わった演奏イ
ベントをポインタで示すようにしておくことによって、
次のものを取り出す。演奏データはMIDIデータであ
る。演奏タイミングは、MIDIデータに含まれている
デュレーション情報または、これから求めた時刻情報で
ある。
FIG. 5 is a flowchart of the process A shown in FIG. In S51, the performance data and performance timing of the next performance event are extracted from the music data. Specifically, by indicating the performance event already read from the song data with the pointer,
Take out the next one. The performance data is MIDI data. The performance timing is duration information included in the MIDI data or time information obtained from this.

【0040】S52においては、各チャネル(ch)の
エンベロープを、この演奏タイミングまで計算し、Eバ
ッファ(エンベロープバッファ)に書き込んでおく。こ
のEバッファは、図1に示したPバッファ,Wバッファ
とは全く別のものである。従来のハードウエア音源で
は、エンベロープの読み出し機能を有しており、各発音
チャネルのエンベロープのレベルを見て発音チャネルの
割当を行っていた。その処理ルーチンをそのままソフト
音源に流用する場合には、まずエンベロープを生成しな
ければならない。演奏イベントが発生していないときで
も、発音中はエンベロープのレベルが必要であるから、
例えば、1つの時間フレームごとに1個のエンベロープ
のレベルを作成してEバッファに入れておき、その時間
フレーム内のエンベロープのレベルは、補間処理によっ
て生成するようにする。
In S52, the envelope of each channel (ch) is calculated up to the performance timing and written in the E buffer (envelope buffer). This E buffer is completely different from the P buffer and W buffer shown in FIG. A conventional hardware sound source has a function of reading out envelopes, and assigns sounding channels by looking at the envelope level of each sounding channel. When the processing routine is used as it is for a soft sound source, an envelope must be generated first. Even when there is no performance event, the envelope level is required during sounding,
For example, one envelope level is created for each time frame and stored in the E buffer, and the envelope level in the time frame is generated by the interpolation process.

【0041】S53においては、演奏データを音源パラ
メータに変換するとともに、新規発音の場合には、上述
したエンベロープのレベルに基づいてここで発音割当て
をする。S54においては、この音源パラメータを、上
述した演奏タイミングとともにPバッファに書き込む。
In S53, the performance data is converted into sound source parameters, and in the case of a new pronunciation, the pronunciation is assigned based on the envelope level described above. In S54, this sound source parameter is written in the P buffer together with the above-mentioned performance timing.

【0042】なお、S52を削除し、音源パラメータ発
生時にエンベロープの作成をしないようにすることも可
能である。この場合、音源パラメータ作成の段階では、
発音チャネル割り当てをせずに未定にしておき、後述す
る処理Bの波形生成時に発音チャネル割り当てを行う。
ただし、この場合、演奏イベントが重なると処理が重く
なるため、音源パラメータ作成の段階で発音チャネル割
当を行う方が望ましい。あるいは、音源パラメータ作成
の段階で発音チャネル割当を行うものの、エンベロープ
レベルを用いずに、例えば、後着優先で発音割り当てを
する、すなわち、後から入力された発音を優先して行う
ようにすることも可能である。
It is also possible to delete S52 so that the envelope is not created when the sound source parameter is generated. In this case, at the stage of sound source parameter creation,
The tone generation channels are not assigned and are undetermined, and the tone generation channels are assigned when the waveform is generated in the process B described later.
However, in this case, since the processing becomes heavy when the performance events overlap, it is preferable to assign the sound generation channels at the stage of creating the sound source parameters. Alternatively, although the sound generation channel is allocated at the stage of creating the sound source parameter, for example, the sound allocation is performed with the latter arrival priority without using the envelope level, that is, the sound input later is given priority. Is also possible.

【0043】図6は、図4に示した処理Bのフローチャ
ートである。処理Bは波形を生成するときに起動され
る。S61においては、波形生成量が決定される。図2
に示したように、1つの時間フレームごとに割り込みが
入るときには、この波形生成量は1フレームに固定され
る。先に説明した図4の起動要因の変形例の場合に
は、CODECのバッファの未使用領域の大きさに応じ
て波形生成量が決定される。
FIG. 6 is a flowchart of the process B shown in FIG. Process B is started when generating a waveform. In S61, the waveform generation amount is determined. Figure 2
As shown in, when the interrupt occurs every one time frame, this waveform generation amount is fixed to one frame. In the case of the modification of the activation factor of FIG. 4 described above, the waveform generation amount is determined according to the size of the unused area of the CODEC buffer.

【0044】S62において、波形生成する範囲に未処
理の演奏イベントがあるかどうかを判定する。この判定
は、曲データから既に読み終わって処理Aが実行された
演奏イベントを示すポインタを調べ、その次の演奏イベ
ントの演奏タイミングが、波形生成しようとしている範
囲よりも後の時刻であるかどうかで行う。普通は、演奏
イベントが発生する間隔が数ms〜数十msの時間フレ
ームに対して長いため、波形生成しようとしている範囲
内にある演奏イベントは、先行して処理Aを終えている
はずである。しかし、曲データ中には、この波形生成す
る範囲内に、まだ処理Aを終えていない演奏イベントが
残っている可能性がある。
In S62, it is determined whether or not there is an unprocessed performance event in the waveform generation range. This determination is made by checking the pointer indicating the performance event for which processing A has been executed after the song data has been read, and whether the performance timing of the next performance event is later than the range in which the waveform is to be generated. Done in. Normally, the intervals at which performance events occur are long with respect to the time frame of several ms to tens of ms, so that the performance events within the range for which the waveform is to be generated should have completed the process A in advance. . However, in the music data, there is a possibility that a performance event for which processing A has not been completed remains within the range where the waveform is generated.

【0045】図7は、波形生成する範囲に未処理のイベ
ントがある場合の第1の例のタイミング図である。図
中、図14,図2と同様な部分には同じ符号を付して説
明を省略する。図7に示すように、時間フレーム(F)
で波形再生する必要のある演奏イベントが残っていたこ
とを、時間フレーム(F−1)において判定したときに
は、図6のS63に処理を進め、未処理の演奏イベント
の処理Aを、時間フレーム(F−1)の音源パラメータ
作成期間12において実行し、S62に処理を戻す。S
62において、波形生成する範囲に未処理の演奏イベン
トがないと判定したときには、S64に処理を進める。
S63は繰り返し実行される場合がある。
FIG. 7 is a timing chart of the first example when there are unprocessed events in the waveform generation range. 14, those parts that are the same as those corresponding parts in FIGS. 14 and 2 are designated by the same reference numerals, and a description thereof will be omitted. As shown in FIG. 7, the time frame (F)
When it is determined in the time frame (F-1) that there is a performance event that needs to be waveform-reproduced in step S6, the process proceeds to S63 in FIG. It is executed in the sound source parameter creation period 12 of F-1) and the process is returned to S62. S
If it is determined in 62 that there is no unprocessed performance event in the waveform generation range, the process proceeds to S64.
S63 may be repeatedly executed.

【0046】S64においては、波形生成すべき時間フ
レーム内に、Pバッファに記憶された音源パラメータの
演奏タイミングが入る場合には、1フレーム分の波形デ
ータの生成の途中で、生成位置がこの演奏タイミングに
一致する時点でPバッファに記憶された音源パラメータ
で音源レジスタを更新しつつ、この音源レジスタに記憶
された音源パラメータに基づいて波形データを生成す
る。例えば、ノートオンの場合には、発音に必要な音源
パラメータを音源レジスタの1つのチャネルに転送する
とともに、ノートオン/ノートオフを示すレジスタをオ
ンにして発音状態にし、ノートオフの場合には、単にノ
ートオン/ノートオフを示すレジスタをオフに書き換え
る。これとともに、音源レジスタに記憶された音源パラ
メータに基づいて、生成量分、例えば、1フレーム分の
波形を生成し、Wバッファに書き込む。
In S64, if the performance timing of the sound source parameter stored in the P buffer falls within the time frame in which the waveform is to be generated, the generation position is set to the performance position during the generation of one frame of waveform data. The sound source register is updated with the sound source parameter stored in the P buffer at the time when the timing matches, and the waveform data is generated based on the sound source parameter stored in the sound source register. For example, in the case of note-on, the sound source parameter necessary for sounding is transferred to one channel of the sound source register, and the register indicating the note-on / note-off is turned on to make the sounding state, and in the case of note-off, Simply rewrite the register indicating note-on / note-off to off. At the same time, based on the sound source parameter stored in the sound source register, a waveform of the generated amount, for example, one frame is generated and written in the W buffer.

【0047】波形生成に際しては、図5に示した処理A
のS52においてEバッファに書き込んだエンベロープ
も使用する。図5に示した処理AのS52においてエン
ベロープを作らない場合には、ここでエンベロープを作
成しつつ波形生成を行う。S62において波形データを
生成する範囲に未処理の演奏イベントなしと判断された
にもかかわらず、波形データを生成する時間フレームに
含まれた演奏イベントのエンベロープが、Eバッファに
まだ作られていない場合がある。すなわち、処理Aは、
波形データを生成する時間フレームに含まれる演奏イベ
ントまで完了しているが、その次の演奏イベントの処理
Aは未処理である場合、つまり、波形データ生成に必要
なエンベロープ波形のうちで、処理済みの最終イベント
の所までは処理Aでエンベロープが作成済みであるが、
その後の部分が未作成であるという場合である。補間処
理では、この時間フレームに含まれる演奏イベントのエ
ンベロープを作ることができない。このような場合、こ
のS64のステップで、波形データを生成する時間フレ
ームについて、エンベロープを作成する必要がある。S
65においては、生成してWバッファに書き込んだ1フ
レーム分の波形データをCODECドライバに渡す。
At the time of waveform generation, the process A shown in FIG.
The envelope written in the E buffer in S52 is also used. If the envelope is not created in S52 of the process A shown in FIG. 5, the waveform is created while creating the envelope here. Even though it is determined in S62 that there is no unprocessed performance event in the waveform data generation range, the performance event envelope included in the waveform data generation time frame is not yet created in the E buffer. There is. That is, the process A is
The performance event included in the time frame for generating the waveform data has been completed, but the processing A of the next performance event is unprocessed, that is, it has been processed in the envelope waveform required for generating the waveform data. Up to the final event of, the envelope has been created in process A,
This is the case where the subsequent part is not created. The interpolation process cannot create the envelope of the performance event included in this time frame. In such a case, it is necessary to create an envelope for the time frame for generating the waveform data in step S64. S
At 65, the waveform data for one frame generated and written in the W buffer is passed to the CODEC driver.

【0048】ここで、S62の変更例を説明する。S6
2において、処理Aが、波形生成すべき時間フレームよ
りも後の演奏イベントを少なくとも1つは処理済みであ
るかどうかを判定し、処理を終えていない場合はS63
に処理を進め、少なくとも1つの処理が終わってからS
64に処理を進める。このようにすれば、処理Aによ
り、波形生成すべき時間フレームよりも後の演奏イベン
ト13の所までエンベロープが作成されるので、S64
の波形生成ではエンベロープの作成をしなくてもよい。
Here, a modified example of S62 will be described. S6
In step 2, the process A determines whether or not at least one performance event after the time frame in which the waveform is to be generated has been processed. If the process has not been completed, S63.
S, after at least one process is completed
The process proceeds to 64. By doing so, the envelope is created up to the performance event 13 after the time frame in which the waveform is to be generated by the process A.
It is not necessary to create an envelope in the waveform generation of.

【0049】図8は、波形生成する範囲に未処理のイベ
ントがある場合の第2の例のタイミング図である。図
中、図14,図2と同様な部分には同じ符号を付して説
明を省略する。図8に示すように、時間フレーム(F−
1)において音源パラメータに変換されていない未処理
の演奏イベントが、例えば、波形生成する時間フレーム
(F)の範囲よりも以後の時間フレーム(F+2)で波
形生成するものであると判定したときには、図6に示し
たS62では、S64に処理を進める。これに対して、
S62の変更例では、S63に処理を進めて、この未処
理の演奏イベントの曲データを音源パラメータに変換し
た上で、処理Bを実行する。このようにして、波形生成
する範囲よりも後の演奏タイミングの演奏イベントの処
理Aが必ず実行された後に波形処理を行うようにするこ
とができる。
FIG. 8 is a timing chart of the second example when there are unprocessed events in the waveform generation range. 14, those parts that are the same as those corresponding parts in FIGS. 14 and 2 are designated by the same reference numerals, and a description thereof will be omitted. As shown in FIG. 8, the time frame (F-
When it is determined in 1) that an unprocessed performance event that has not been converted into a sound source parameter is one that generates a waveform in a time frame (F + 2) subsequent to the range of the time frame (F) in which the waveform is generated, In S62 shown in FIG. 6, the process proceeds to S64. On the contrary,
In the modified example of S62, the process proceeds to S63, the music data of the unprocessed performance event is converted into the sound source parameter, and then the process B is executed. In this way, the waveform processing can be performed after the processing A of the performance event at the performance timing after the waveform generation range is always executed.

【0050】図9は、DMACのフローチャートであ
る。図3に示したCODECによる波形再生プログラム
の処理の流れを示すものである。S71においては、サ
ンプリング周期でCODECが発生するサンプル要求割
り込み(ハードウエア割り込み)に応じて、CODEC
の波形バッファであるDMAバッファ(DMAB)は、
波形データを1サンプルずつCODECに送出する。S
72においては、転送サンプル数pの値を1だけ増加さ
せてS71の処理を繰り返し実行させる。
FIG. 9 is a flowchart of the DMAC. 4 shows a flow of processing of a waveform reproduction program by CODEC shown in FIG. 3. In S71, the CODEC is sent in response to the sample request interrupt (hardware interrupt) generated by the CODEC in the sampling cycle.
The DMA buffer (DMAB), which is the waveform buffer of
The waveform data is sent to the CODEC one sample at a time. S
At 72, the value of the transfer sample number p is incremented by 1, and the process of S71 is repeatedly executed.

【0051】転送サンプル数pを、例えば8ビットで表
わし、225までカウントすれば次に0に戻るようにす
る。CODECは、転送サンプル数pをカウントして、
DMAバッファのサイズの半分の数のサンプルが転送さ
れる毎、すなわち、転送サンプル数p=127およびp
=255のときに、1フレームの波形再生が完了したと
してハードウエア割り込みを実行する。このハードウエ
ア割り込みが、処理Bの開始トリガ、すなわち、図4に
示したS44におけるの起動要因となっている。
The transfer sample number p is represented by, for example, 8 bits, and is returned to 0 after counting up to 225. CODEC counts the number of transferred samples p,
Every time half the number of samples of the size of the DMA buffer is transferred, that is, the number of transferred samples p = 127 and p
= 255, the hardware interrupt is executed assuming that the waveform reproduction of one frame is completed. This hardware interrupt is the start trigger of the process B, that is, the activation factor in S44 shown in FIG.

【0052】処理Bの波形生成処理では、DMAバッフ
ァの半分に相当する1フレーム分のサンプルを、Wバッ
ファ上にまとめて一気に生成し、Wバッファの波形デー
タはDMAバッファに転送される。上述したDMAバッ
ファのサイズは、2つの時間フレーム分であるが、この
サイズは、DMAコントローラ(DMAC)のアドレス
設定を変えることで任意に変更可能である。
In the waveform generating process of the process B, samples for one frame corresponding to half of the DMA buffer are collectively generated on the W buffer and generated at once, and the waveform data of the W buffer is transferred to the DMA buffer. The size of the above-mentioned DMA buffer is two time frames, but this size can be arbitrarily changed by changing the address setting of the DMA controller (DMAC).

【0053】図10は、本発明の第2の実施の形態の楽
音発生方法の処理の流れを表わす説明図である。ストリ
ーム再生の場合を示すものである。S81においては、
ネットワークからマルチメディアデータ(MMD)を受
信し、これを図3に示したRAM32上の受信バッファ
に書き込む。この受信バッファの領域は、例えば1曲分
のマルチメディアデータを書き込むことができる大きさ
が確保されている。なお、マルチメディアデータとは、
MIDIデータのほかに、これと同期する歌詞データや
画像データ等を含むデータである。
FIG. 10 is an explanatory diagram showing the flow of processing of the musical tone generating method according to the second embodiment of the present invention. It shows a case of stream reproduction. In S81,
The multimedia data (MMD) is received from the network and written in the receiving buffer on the RAM 32 shown in FIG. The area of the reception buffer is secured to have a size capable of writing, for example, one piece of multimedia data. What is multimedia data?
In addition to MIDI data, it is data including lyrics data, image data, and the like synchronized with the MIDI data.

【0054】S82においては、受信バッファから読み
出したマルチメディアデータ(MMD)からMIDIデ
ータからなる曲データ(MIDI)を抽出し、Mバッフ
ァ(MIDIバッファ)に書き込む。抽出されたMID
Iデータにも、図1を参照して説明した曲データと同様
に、演奏イベントの時間間隔を表わすデュレーション情
報が含まれている。このデュレーション情報から演奏タ
イミングを示す時刻情報データへの変換を行ない、演奏
イベントのMIDIデータに付け加え、Mバッファに曲
データ(MIDI)が記憶される。ただし、S82は、
Mバッファに未使用領域(空き)があり、かつ、受信バ
ッファに未処理のマルチメディアデータ(MMD)があ
れば実行する。
At S82, music data (MIDI) composed of MIDI data is extracted from the multimedia data (MMD) read from the reception buffer and written in the M buffer (MIDI buffer). Extracted MID
The I data also includes duration information indicating the time interval of the performance event, like the music data described with reference to FIG. The duration information is converted into time information data indicating the performance timing, and the music data (MIDI) is stored in the M buffer in addition to the MIDI data of the performance event. However, S82
If there is an unused area (empty space) in the M buffer and there is unprocessed multimedia data (MMD) in the reception buffer, it is executed.

【0055】S83以降については、図1に示した曲フ
ァイル再生の処理の流れの場合のS1〜S3とほぼ同様
であるが、若干異なる部分もある。S83の処理Aにお
いては、Pバッファに未使用領域があり、かつ、Mバッ
ファに曲データ(MIDI)があれば実行する。また、
このステップの実行により、使用された曲データは、M
バッファに記憶しておく必要がなくなり、使用された音
源パラメータが記憶されていた領域を解放するため、M
バッファに未使用領域(空き)ができる。S84につい
ては、図13を参照して後述するように、波形生成する
範囲に未処理の演奏イベントがある場合の処理が異な
る。図1に示したS1で作成される音源パラメータと同
様に、S83において作成される音源パラメータも演奏
タイミングを示す時間情報付きの音源パラメータであ
る。
The steps after S83 are almost the same as the steps S1 to S3 in the flow of the music file reproducing process shown in FIG. 1, but there are some differences. In the process A of S83, if there is an unused area in the P buffer and the music data (MIDI) exists in the M buffer, it is executed. Also,
By executing this step, the music data used is M
Since it is not necessary to store it in the buffer and the area where the used sound source parameter was stored is released, M
There is an unused area (free) in the buffer. As for S84, as will be described later with reference to FIG. 13, the processing when the unprocessed performance event is in the waveform generation range is different. Similar to the sound source parameter created in S1 shown in FIG. 1, the sound source parameter created in S83 is a sound source parameter with time information indicating performance timing.

【0056】この実施の形態においては、受信データか
ら波形データを生成する処理を、波形データの再生の進
行に応じて処理をする処理Bと、これとは独立して実行
することのできる処理Aおよび曲データ抽出処理とに分
けている。そして、これらの処理間の連携は、具体的に
は、受信されたマルチメディアデータ(MMD)中の曲
データ(MIDI)に含まれたデュレーション情報とい
う時間データを用いて、曲データ(MIDI),音源パ
ラメータ(PARM)にも時間情報を付加しておくこと
により実現している。
In this embodiment, the process B for generating the waveform data from the received data and the process A for executing the process in accordance with the progress of the reproduction of the waveform data and the process A which can be executed independently of this process. And music data extraction processing. Then, the cooperation between these processes is specifically performed by using time data called duration information included in the music data (MIDI) in the received multimedia data (MMD). This is realized by adding time information to the sound source parameter (PARM).

【0057】処理Bを曲データ抽出処理および処理Aか
ら分けることができたため、曲データ抽出処理およびパ
ラメータ変換処理を、Mバッファ,Pバッファの記憶容
量の範囲で先行して実行することができ、受信データか
ら波形データを再生する処理の負荷が時間的に平均化さ
れる。
Since the process B can be separated from the music data extracting process and the process A, the music data extracting process and the parameter converting process can be executed in advance within the storage capacity of the M buffer and the P buffer. The load of processing for reproducing waveform data from received data is averaged over time.

【0058】さらに、Mバッファに曲データが存在する
場合にパラメータに変換する処理を行うことができるた
め、曲データの全部のロードが完了するのを待つことな
く、曲の再生を開始することができる。なお、受信バッ
ファをある程度大きな容量にして、上述したように、例
えば1曲分のマルチメディアデータを書き込むことがで
きる大きさを確保しておき、受信したマルチメディアデ
ータを書き換えずに残しておくようにした場合には、受
信バッファ上に残されたデータを再び再生することがで
きる。あるいは、この受信バッファを書き込みバッファ
として、受信したマルチメディアデータをそのまま図3
に示したハードディスク22やリムーバルディスク23
に書き込むようにしてもよい。また、受信バッファでは
なくMバッファをある程度大きな容量にして、曲データ
を書き換えず残しておくようにした場合には、曲データ
のみを再び再生することができる。
Further, since the processing of converting the music data into the parameters when the music data exists in the M buffer can be started, the music reproduction can be started without waiting for the completion of loading all the music data. it can. It is to be noted that the reception buffer should have a relatively large capacity so that, for example, the multimedia data for one song can be written as described above, and the received multimedia data can be retained without being rewritten. In the case of, the data left on the reception buffer can be reproduced again. Alternatively, by using this reception buffer as a write buffer, the received multimedia data can be directly used as shown in FIG.
Hard disk 22 and removable disk 23 shown in
You may write in. Further, when the M buffer, rather than the receiving buffer, is made to have a large capacity to some extent and the music data is left without being rewritten, only the music data can be reproduced again.

【0059】図11は、本発明の第2の実施の形態の楽
音発生方法のメインフローチャートである。このフロー
を実現するプログラムは、例えば、ウエブブラウザに組
み込まれるプラグインソフトとして実現される。スタン
ダードMIDIファイル(SMF)のような曲データ、
または、このような曲データを含むマルチメディアデー
タ(MMD)がサーバに記憶されている位置を示す「タ
グ」データがホームページに埋め込まれていて、この
「タグ」データに応じてダウンロードが指示されたとき
に、本プログラムが起動され、ダウンロードするだけで
なくマルチメディアデータの再生まで行う。
FIG. 11 is a main flowchart of the musical sound generating method according to the second embodiment of the present invention. A program for realizing this flow is realized as, for example, plug-in software incorporated in a web browser. Song data such as standard MIDI files (SMF),
Alternatively, "tag" data indicating the position where the multimedia data (MMD) including such song data is stored in the server is embedded in the home page, and the download is instructed according to the "tag" data. At this time, this program is started and not only download but also play multimedia data.

【0060】S91においては、全ての発音チャネルの
ための音源レジスタを無発音状態にし、また、CODE
Cを初期設定し波形再生ソフトを起動する。S92にお
いては、起動要因チェックが行われ、S93において
は、起動要因がない場合にS92に処理を戻し、起動要
因がある場合には、S94に進み起動要因の分析が行わ
れる。
In S91, the tone generator registers for all tone generation channels are set to the non-tone generation state, and the CODE
Initialize C and start the waveform playback software. In S92, a start factor check is performed. In S93, if there is no start factor, the process returns to S92, and if there is a start factor, the process proceeds to S94 to analyze the start factor.

【0061】S94においては、ネットワークからマ
ルチメディアデータ(MMD)の受信があるときには、
S95に処理を進め、受信処理を行い、マルチメディア
データ(MMD)を受信バッファに書き込む。Mバッ
ファに未使用領域(空き)があり、かつ、受信バッファ
にマルチメディアデータ(MMD)があるときには、S
96に処理を進め、受信バッファからマルチメディアデ
ータ(MMD)を読み出し、曲データ(MIDI)抽出
処理を行う。Pバッファに未使用領域があり、かつ、
Mバッファに曲データ(MIDI)があるときには、S
97の処理Aに進み、Mバッファから次に処理すべき曲
データ(MIDI)を取り出し、音源パラメータ(PA
RM)に変換しPバッファに書き込む。
At S94, when the multimedia data (MMD) is received from the network,
The process proceeds to S95, the receiving process is performed, and the multimedia data (MMD) is written in the receiving buffer. If the M buffer has an unused area (empty space) and the receive buffer has multimedia data (MMD), S
The process proceeds to 96, the multimedia data (MMD) is read from the reception buffer, and the music data (MIDI) extraction process is performed. There is an unused area in the P buffer, and
If there is song data (MIDI) in the M buffer, S
The process proceeds to the process A of 97, the music data (MIDI) to be processed next is taken out from the M buffer, and the sound source parameter (PA
RM) and write to P buffer.

【0062】1つの時間フレームの波形再生が完了し
たときには、S98の処理Bに進み、Pバッファから読
み出した演奏タイミング情報付きの音源パラメータに基
づいて、次の時間フレームの波形を生成する。音色選
択などのスイッチング操作、歌詞,画像の表示の差し替
えやスクロールといったマルチメディア処理等、その他
の要求があるときには、S99に処理を進め、これらの
要求に応じた各種の設定を行う。音源ソフトの終了要
求があるときには、S100に処理を進めソフト音源の
プログラムの終了処理をする。図3に示したCPU30
は、これらの起動要因を絶えずチェックしており、S9
4において起動要因を判定して具体的な処理を開始す
る。
When the waveform reproduction of one time frame is completed, the process proceeds to the processing B of S98, and the waveform of the next time frame is generated based on the sound source parameter with the performance timing information read from the P buffer. When there are other requests such as switching operations such as tone color selection, multimedia processing such as replacement of lyrics and image display, scrolling, etc., the process proceeds to S99, and various settings corresponding to these requests are performed. When there is a request for ending the sound source software, the process proceeds to S100 to end the program of the software sound source. CPU 30 shown in FIG.
Is constantly checking these activation factors, and S9
In step 4, the activation factor is determined and specific processing is started.

【0063】ダウンロードの開始時は、最初に、の受
信処理との曲データ抽出処理とをスタートさせ、所定
量または所定時間分の曲データがMバッファにたまった
後に、はじめての処理Aとの処理Bというソフト音
源の波形生成処理を開始するようにする。あるいは、所
定量または所定時間分のマルチメディアデータが受信バ
ッファにたまった後に、上述した波形生成処理を開始す
るようにしてもよい。さらにまた、の処理Aもの受
信処理やの曲データ抽出処理と同時に、の処理Bよ
りも先にスタートさせ、所定量または所定時間分の音源
パラメータがPバッファにたまった後にの処理Bを開
始するようにしてもよい。このようにして、各バッファ
にある程度データがたまってから波形生成を開始するの
で、再生開始直後の動作を安定して行うことができる。
なお、上述した所定量または所定時間は、ネットワーク
の転送レート、回線品質等によって必要量が異なるか
ら、ユーザが任意に設定可能にしておく。処理の優先順
位は、>>のマルチメディア処理>>>の
スイッチング操作>という優先順位でマルチタスク処
理を行う。なお、Mバッファ,Pバッファ,Wバッファ
とも、各バッファに記憶されたデータの内、処理の終わ
った使用済みのデータが記憶されていた領域は、未使用
領域として開放される。
At the start of the download, first, the reception process and the music data extraction process are started, and after the music data for a predetermined amount or for a predetermined time is accumulated in the M buffer, the first process A is performed. The waveform generation process of the soft sound source B is started. Alternatively, the waveform generation process described above may be started after a predetermined amount or a predetermined amount of multimedia data has accumulated in the reception buffer. Furthermore, at the same time as the receiving process of the process A and the music data extracting process of the process A, the process A is started before the process B, and the process B is started after the sound source parameter for a predetermined amount or for a predetermined time is accumulated in the P buffer. You may do it. In this way, the waveform generation is started after data is accumulated in each buffer to some extent, so that the operation immediately after the start of reproduction can be stably performed.
Note that the above-mentioned predetermined amount or predetermined time period can be arbitrarily set by the user because the required amount differs depending on the transfer rate of the network, the line quality, and the like. As for the priority of processing, multi-task processing is performed in the order of >>> multimedia processing >>>> switching operation>. In the M buffer, the P buffer, and the W buffer, among the data stored in the respective buffers, the area in which used data that has been processed is stored is released as an unused area.

【0064】図12は、図11に示した曲データ抽出処
理のフローチャートである。S111においては、受信
バッファから次の1組のマルチメディアデータ(MM
D)を取り出し、S112においては、マルチメディア
データ(MMD)の種類を判定し、曲データ(MID
I)であれば、S113に処理を進め、その他のマルチ
メディアデータであれば、S114に処理を進める。S
113においては、この1組の曲データをMバッファに
書込み、S114においては、この1組のマルチメディ
アデータを、その種類に対応したバッファ、例えば、画
像データならGバッファ、歌詞データならKバッファ
等、に書き込み、記憶されたデータは、それぞれ、それ
らのデータの再生タイミングにおいて、図11に示した
S99のその他の処理において、その表示のための処理
が行われる。
FIG. 12 is a flowchart of the music piece data extraction process shown in FIG. In S111, the next set of multimedia data (MM
D) is taken out, and in S112, the type of multimedia data (MMD) is determined, and the song data (MID)
If it is I), the process proceeds to S113, and if it is other multimedia data, the process proceeds to S114. S
In 113, this set of music data is written in the M buffer, and in S114, this set of multimedia data is stored in a buffer corresponding to the type, for example, G buffer for image data, K buffer for lyrics data, etc. The data written and stored in, are subjected to the display processing in the other processing of S99 shown in FIG. 11 at the reproduction timing of the data.

【0065】マルチメディアデータに含まれる歌詞デー
タや画像データは、歌詞や画像データをディスプレイに
表示する時刻を示すタイムスタンプ,タイムコードのよ
うな時刻情報を含み、この時刻情報が付いた状態でそれ
ぞれに対応したバッファに書き込まれ、表示の際には、
この時刻情報と、ソフト音源で生成される波形データの
再生タイミング、すなわち、演奏イベントの演奏タイミ
ングを示す時刻情報とを用いて、波形データの再生と歌
詞データ,画像データの表示とを正確に同期させること
が容易に行える。また、演奏イベントの演奏タイミング
を時間間隔情報のままで音源パラメータに付けてパラメ
ータバッファに記憶しておく場合にも、この時間間隔情
報を加算して常に時刻情報を得ていれば同様にして同期
させることができる。
The lyrics data and the image data included in the multimedia data include time information such as a time stamp and a time code indicating the time at which the lyrics and the image data are displayed on the display. Is written in the buffer corresponding to, and when displaying,
Using this time information and the reproduction timing of the waveform data generated by the software tone generator, that is, the time information indicating the performance timing of the performance event, the waveform data is accurately synchronized with the lyrics data and the image data display. It can be done easily. Also, when the performance timing of a performance event is added to the sound source parameter and stored in the parameter buffer without changing the time interval information, if time information is always obtained by adding this time interval information, synchronization is performed in the same manner. Can be made.

【0066】図13は、図11に示した処理Bのフロー
チャートである。S121においては、波形生成量を決
定し、S122においては、波形生成する範囲に未処理
の演奏イベントが有るかどうかを判定する。この判定
は、曲データから既に読み終わって処理Aが実行された
演奏イベントを示すポインタを調べ、その次の演奏イベ
ントの演奏タイミングが、波形生成しようとしている範
囲よりも後の時刻であるかどうかで行う。未処理の演奏
イベントがない場合には、S123に処理を進め、有る
場合にはS124に処理を進める。
FIG. 13 is a flowchart of the process B shown in FIG. In S121, the waveform generation amount is determined, and in S122, it is determined whether or not there is an unprocessed performance event in the waveform generation range. This determination is made by checking the pointer indicating the performance event for which processing A has been executed after the song data has been read, and whether the performance timing of the next performance event is later than the range in which the waveform is to be generated. Done in. If there is no unprocessed performance event, the process proceeds to S123, and if there is, the process proceeds to S124.

【0067】S123においては、波形生成すべき時間
フレーム内に、Pバッファに記憶された音源パラメータ
の演奏タイミングが入る場合には、1フレーム分の波形
データの生成の途中で、生成位置がこの演奏タイミング
に一致する時点でPバッファに記憶された音源パラメー
タで音源レジスタを更新しつつ、この音源レジスタに記
憶された音源パラメータに基づいて波形データを生成す
る。そして、生成量分、例えば、1フレーム分の波形を
Wバッファに書き込み、S125においては、生成して
Wバッファに書き込んだ1フレーム分の波形データをC
ODECドライバに渡す。
In S123, if the performance timing of the tone generator parameter stored in the P buffer falls within the time frame in which the waveform is to be generated, the generation position is set to the performance position during the generation of one frame of waveform data. The sound source register is updated with the sound source parameter stored in the P buffer at the time when the timing matches, and the waveform data is generated based on the sound source parameter stored in the sound source register. Then, the generated amount, for example, the waveform for one frame is written in the W buffer, and in S125, the waveform data for one frame generated and written in the W buffer is C.
Pass it to the ODEC driver.

【0068】S124は、波形生成に必要な音源パラメ
ータが用意できていないときの処理であり、波形生成す
る範囲に未処理の曲データが有るかどうかを判定する。
受信データから既に読み終わって曲データが抽出された
演奏イベントを示すポインタを調べ、このポインタの次
の演奏イベントの演奏タイミングが波形生成しようとし
ている範囲よりも後の時刻であるかどうかで行う。未処
理の曲データがない場合にはS126に処理を進め、有
る場合には、S127に処理を進める。S126におい
ては、未処理の演奏イベントの処理Aを実行し、S12
2に処理を戻す。
S124 is a process when the sound source parameters necessary for waveform generation are not prepared, and it is determined whether or not there is unprocessed music data in the waveform generation range.
The pointer indicating the performance event from which the music data has been extracted after the reading of the received data is checked, and the performance timing of the performance event next to this pointer is determined whether or not the time is later than the range in which the waveform is to be generated. If there is no unprocessed music data, the process proceeds to S126, and if there is, the process proceeds to S127. In S126, processing A of the unprocessed performance event is executed, and S12
Return the process to 2.

【0069】S127は、曲データが用意できていない
ときの処理であり、受信バッファに未処理の受信データ
が有るかどうかを、曲データ抽出処理を行った最後の受
信データが最新の受信データであるかどうかを調べて判
定し、未処理の受信データが有る場合には、S128に
処理を進め、ない場合には、S129に処理を進める。
S128においては、曲データ抽出処理を実行し、S1
24に処理を戻す。
Step S127 is a process when the music data is not prepared, and it is determined whether or not there is unprocessed reception data in the reception buffer, and the last reception data after the music data extraction process is the latest reception data. It is determined whether or not there is any, and if there is unprocessed received data, the process proceeds to S128, and if not, the process proceeds to S129.
In S128, music piece data extraction processing is executed, and S1
The process is returned to 24.

【0070】S129は、必要な受信データが未到着の
ときのエラー処理である。エラー処理では、音源レジス
タの現在値のみに基づいて波形を生成し、S125に処
理を進めることにより、既に鳴っている音を継続するよ
うに処理する。あるいは、既に鳴っている音を徐々に減
衰するように制御してもよい。
S129 is an error process when the necessary received data has not arrived. In the error processing, a waveform is generated based only on the current value of the sound source register, and the processing proceeds to S125 so that the sound that is already sounding is continued. Alternatively, the sound that is already sounding may be controlled to be gradually attenuated.

【0071】なお、S122の処理としては、図6に示
した曲データ再生の場合の処理Bにおける、S62の変
更例と同様な処理をすることもできる。すなわち、波形
生成する範囲よりも後の時刻の演奏イベントの少なくと
も1つについて、処理Aが必ず実行された後に、波形デ
ータ生成処理を行うようにすることができる。同様な考
えで、S124においても、波形生成する範囲よりも後
の演奏タイミングの演奏イベントの少なくとも1つにつ
いて、曲データ抽出処理が必ず実行された後に、パラメ
ータ変換および波形データ生成処理を行うように変更す
ることができる。
As the processing of S122, the same processing as the modification of S62 in the processing B in the case of reproducing the music data shown in FIG. 6 can be performed. That is, the waveform data generation process can be performed after the process A is necessarily executed for at least one performance event at a time later than the waveform generation range. Based on the same idea, in S124, the parameter conversion and the waveform data generation process are performed after the music data extraction process is surely executed for at least one performance event at the performance timing after the waveform generation range. Can be changed.

【0072】この変更例であれば、図6に示した曲デー
タ再生の場合の処理BにおけるS64の波形生成の場合
と同様に、今回波形生成する時間フレームについて、処
理Aの中でエンベロープ生成が終わっていることが保証
できるので、S123において、エンベロープを作成す
る必要がない。逆に、S122を変更しない場合には、
S123において、エンベロープを作成する必要のある
場合がある。
In this modified example, as in the case of the waveform generation of S64 in the process B in the case of reproducing the music data shown in FIG. 6, the envelope generation in the process A is performed for the time frame in which the waveform is generated this time. Since it can be guaranteed that the process is completed, it is not necessary to create an envelope in S123. On the contrary, when S122 is not changed,
In S123, it may be necessary to create an envelope.

【0073】図10ないし図13を参照して説明した第
2の実施の形態は、ネットワークからデータを受信する
場合に限らず、例えば、外部記憶媒体からマルチメディ
アデータを転送する場合に、転送をしつつ再生を行う場
合や、無線伝送や光伝送でデータを受信しながら再生を
行う場合にも適用することができる。
The second embodiment described with reference to FIGS. 10 to 13 is not limited to the case of receiving data from a network, but may be performed, for example, when multimedia data is transferred from an external storage medium. The present invention can also be applied to the case of performing reproduction while performing the reproduction, or the case of performing reproduction while receiving data by wireless transmission or optical transmission.

【0074】上述した説明では、楽音発生処理に極力エ
ラーが生じないようにしたため、例えば、図6のS6
2,S63のように、処理Bの中で処理Aに戻るフロー
を設けた。しかし、CPUパワーが大きい場合など、例
外的な状況が発生するおそれが少ない環境で使用する場
合には、このような処理を戻すフローを省略することも
可能である。図13のS122,S124,S126,
S127,S128も同様な処理を戻すフローである。
また、図1ないし図9を参照して説明した曲ファイルの
再生においては、エラー処理のフローを設けなかった
が、図10ないし図13を参照して説明したストリーム
再生の場合の図13のS129のようなエラー処理を行
うようにフローを変更することもできる。
In the above description, since the error is prevented from occurring in the musical tone generation processing as much as possible, for example, S6 in FIG.
2, a flow for returning to the process A in the process B is provided as in S63. However, when used in an environment in which an exceptional situation is unlikely to occur, such as when the CPU power is high, the flow for returning such processing can be omitted. S122, S124, S126 of FIG.
S127 and S128 are also flows for returning similar processing.
Although no error processing flow is provided in the reproduction of the music file described with reference to FIGS. 1 to 9, S129 of FIG. 13 in the case of the stream reproduction described with reference to FIGS. 10 to 13. It is possible to change the flow to perform error handling such as.

【0075】上述した説明では、曲データに含ませる演
奏タイミングのデータとしてデュレーション情報を用い
た場合について説明したが、その代わりに、曲の先頭な
どからの絶対時間を表す時刻情報を用いてもよい。この
場合、デュレーション情報を時刻情報データに変換する
ことなく、Pバッファには、この時刻情報を付加した音
源パラメータが書き込まれる。また、汎用のパーソナル
コンピュータを前提にして説明したが、音源専用のコン
ピュータを用いても実現することができる。ソフト音源
に適用した例について説明したが、音源用のハードウエ
アを用いたものに適用することも可能である。楽音は、
楽器音に限らず音声、擬音等の広い意味での可聴音を意
味する。電子楽器の音源だけでなく、ゲームやカラオケ
など娯楽装置、テレビジョンなどの各種家電機器の楽音
発生方法として用いることができる。
In the above description, the case where the duration information is used as the performance timing data included in the music data has been described, but instead, time information indicating the absolute time from the beginning of the music may be used. . In this case, the sound source parameter added with the time information is written in the P buffer without converting the duration information into the time information data. Further, although the description has been made on the premise of a general-purpose personal computer, it can be realized by using a computer dedicated to a sound source. Although the example applied to the soft sound source has been described, it is also possible to apply to the one using the sound source hardware. Music sounds
Not only musical instrument sounds but also audible sounds in a broad sense such as voices and onomatopoeia. It can be used not only as a sound source of an electronic musical instrument but also as a musical sound generating method for entertainment devices such as games and karaoke, and various home appliances such as televisions.

【0076】[0076]

【発明の効果】上述した説明から明らかなように、負荷
が分散され実質的な処理負担が小さくなる楽音発生方法
を実現できるという効果がある。波形データを再生デバ
イスの再生タイミングに先行して生成する場合に比べ
て、バッファサイズを小さくできるので、使用するRA
Mの容量を抑えることができるという効果がある。ま
た、ネットワークから曲データをロードして波形データ
を再生する場合に、曲データの全部のロードが完了する
のを待つことなく、曲の再生を開始できるという効果が
ある。
As is apparent from the above description, there is an effect that it is possible to realize a musical tone generating method in which the load is dispersed and the substantial processing load is reduced. Compared to the case where waveform data is generated prior to the playback timing of the playback device, the buffer size can be made smaller, so the RA used
There is an effect that the capacity of M can be suppressed. Further, when the music data is loaded from the network and the waveform data is reproduced, there is an effect that the reproduction of the music can be started without waiting for the loading of all the music data to be completed.

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

【図1】 本発明の第1の実施の形態の楽音発生方法の
処理の流れを表わす説明図である。
FIG. 1 is an explanatory diagram showing a flow of processing of a musical sound generating method according to a first embodiment of the present invention.

【図2】 本発明の第1の実施の形態の楽音発生方法の
タイミング図である。
FIG. 2 is a timing chart of the musical sound generating method according to the first embodiment of this invention.

【図3】 楽音発生機能を有するパーソナルコンピュー
タのハードウエア構成の概要図である。
FIG. 3 is a schematic diagram of a hardware configuration of a personal computer having a tone generation function.

【図4】 本発明の第1の実施の形態の楽音発生方法の
メインフローチャートである。
FIG. 4 is a main flowchart of a musical sound generating method according to the first embodiment of the present invention.

【図5】 図4に示した処理Aのフローチャートであ
る。
FIG. 5 is a flowchart of process A shown in FIG.

【図6】 図4に示した処理Bのフローチャートであ
る。
6 is a flowchart of a process B shown in FIG.

【図7】 波形生成する範囲に未処理のイベントがある
場合の第1の例のタイミング図である。
FIG. 7 is a timing diagram of the first example when there is an unprocessed event in the waveform generation range.

【図8】 波形生成する範囲に未処理のイベントがある
場合の第2の例のタイミング図である。
FIG. 8 is a timing chart of a second example when there is an unprocessed event in the waveform generation range.

【図9】 DMACのフローチャートである。FIG. 9 is a flowchart of DMAC.

【図10】 本発明の第2の実施の形態の楽音発生方法
の処理の流れを表わす説明図である。
FIG. 10 is an explanatory diagram showing a flow of processing of a musical sound generating method according to a second embodiment of the present invention.

【図11】 本発明の第2の実施の形態の楽音発生方法
のメインフローチャートである。
FIG. 11 is a main flowchart of a musical sound generating method according to a second embodiment of the present invention.

【図12】 図11に示した曲データ抽出処理のフロー
チャートである。
12 is a flowchart of the music piece data extraction process shown in FIG.

【図13】 図11に示した処理Bのフローチャートで
ある。
FIG. 13 is a flowchart of process B shown in FIG.

【図14】 従来の楽音発生方法の動作説明図である。FIG. 14 is an operation explanatory diagram of a conventional tone generation method.

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

11…曲データ、12…音源パラメータ作成期間、13
…演奏タイミング、14…波形データ生成期間、121
…MIDIデータの入力タイミング
11 ... song data, 12 ... sound source parameter creation period, 13
... Performance timing, 14 ... Waveform data generation period, 121
… MIDI data input timing

───────────────────────────────────────────────────── フロントページの続き (58)調査した分野(Int.Cl.7,DB名) G10H 1/00 - 7/00 ─────────────────────────────────────────────────── ─── Continuation of the front page (58) Fields surveyed (Int.Cl. 7 , DB name) G10H 1/00-7/00

Claims (4)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 供給された曲データを順次パラメータに
変換し第1のメモリに書き込む第1のステップと、第1
のメモリに記憶された前記パラメータに基づいて波形デ
ータを生成し第2のメモリに書き込むとともに、前記波
形データの生成に使用した前記パラメータが書き込まれ
ていた領域を第1のメモリにおいて解放する第2のステ
ップと、第2のメモリに記憶された前記波形データを再
生して楽音を発生する第3のステップを有し、第2のス
テップは、第3のステップの前記波形データの再生の進
行に応じて前記波形データを生成し、第1のステップ
は、第1のメモリに未使用領域が存在する場合に前記パ
ラメータへの変換を実行することを特徴とする楽音発生
方法。
1. A first step of sequentially converting supplied song data into a parameter and writing the same into a first memory;
Waveform data is generated based on the parameter stored in the memory of the second memory and written to the second memory, and the area in which the parameter used to generate the waveform data is written is released in the first memory. And a third step of reproducing the waveform data stored in the second memory to generate a musical sound, and the second step is for the progress of the reproduction of the waveform data of the third step. According to the method, the waveform data is generated according to the first step, and in the first step, conversion to the parameter is executed when an unused area exists in the first memory.
【請求項2】 通信路を通じて供給された曲データを受
信し第1のメモリに書き込む第1のステップと、第1の
メモリに記憶された前記曲データをパラメータに変換し
第2のメモリに書き込む第2のステップと、第2のメモ
リに記憶された前記パラメータに基づき波形データを生
成し第3のメモリに書き込むとともに、前記波形データ
の生成に使用した前記パラメータが書き込まれていた領
域を第2のメモリにおいて解放する第3のステップと、
第3のメモリに記憶された前記波形データを再生して楽
音を発生する第4のステップを有し、第3のステップ
は、第4のステップの前記波形データの再生の進行に応
じて前記波形データを生成し、第2のステップは、第2
のメモリに未使用領域が存在し、かつ、第1のメモリに
未だパラメータに変換されていない曲データが存在する
場合に前記パラメータへの変換を実行することを特徴と
する楽音発生方法。
2. A first step of receiving song data supplied through a communication path and writing the song data into a first memory, and converting the song data stored in the first memory into a parameter and writing the parameter into a second memory. In the second step, the waveform data is generated based on the parameters stored in the second memory and written in the third memory, and the area in which the parameters used for generating the waveform data are written is changed to the second area. The third step of releasing in the memory of
There is a fourth step of reproducing the waveform data stored in a third memory to generate a musical sound, and the third step includes the waveform in accordance with the progress of reproduction of the waveform data of the fourth step. Generate data, the second step is the second step
If there is an unused area in the memory and the music data that has not been converted into the parameter exists in the first memory, the conversion to the parameter is executed.
【請求項3】 複数の演奏イベントからなる曲データを
供給する供給ステップと、 供給された前記曲データから、演奏イベントの演奏デ
ータおよび演奏タイミングを順次取り出すとともに
り出された各演奏イベントの演奏データを音源パラメー
タに変換し、該演奏データに対応する前記演奏タイミン
グとともにバッファに書き込むパラメータ変換ステップ
と、 所定時間間隔ごとに起動され、生成している楽音波形の
時刻が、前記バッファに前記音源パラメータとともに記
憶された前記対応する演奏タイミングに一致する時点
で、当該演奏タイミングに対応する、前記バッファに記
憶された前記音源パラメータにより、楽音波形を生成す
るための音源レジスタに記憶された前記音源パラメータ
を更新しつつ、音源レジスタに記憶された前記音源パ
ラメータに基づいて前記楽音波形の生成を実行する楽音
波形生成ステップと、 生成された前記楽音波形を前記時刻に対応させて再生す
る楽音発生ステップと、を備えており、 前記パラメータ変換ステップは、処理の優先順位が前記
楽音波形生成ステップの処理の優先順位よりも低く設定
されている、 ことを特徴とする楽音発生方法。
3. A supply step of supplying music data including a plurality of performance event, from the supplied said music data, sequentially together to eject the performance data and the performance timing of each performance event, collected
A parameter conversion step of converting the performance data of each performance event that is output to a sound source parameter and writing it in a buffer together with the performance timing corresponding to the performance data, and a musical sound waveform that is activated and generated at predetermined time intervals .
Time, at the time that matches the play timing of said corresponding stored together with the sound source parameter in the buffer, corresponding to the performance timing, the serial to the buffer
A musical tone waveform is generated from the stored sound source parameters .
While updating the tone generator parameters <br/> stored in the sound source register of order, the tone waveform generation step of performing the generation of the musical tone waveform on the basis of the sound source parameters stored in the tone generator register is generated wherein comprises a musical tone generating step of reproducing with tone waveform to correspond to the time, was the parameter conversion step, is set priority processing is lower than the priority of processing of the tone waveform generation step are, tone generation method characterized by.
【請求項4】 前記楽音波形生成ステップは、前記供給
された曲データの前記複数の演奏イベントの中から、
記パラメータ変換ステップが実行されていない演奏イベ
ントであって、かつ、該演奏イベントの前記演奏タイミ
ングが、前記楽音波形を生成すべき、前記所定時間間隔
を有する前記楽音波形の時刻の範囲内にあるという条件
を満たす演奏イベントを検出する第1のステップと、 該第1のステップが、前記条件を満たす演奏イベントを
検出したときは、前 記楽音波形を生成する前に、前記条
件を満たす演奏イベントの前記演奏データを前記音源パ
ラメータに変換し、該演奏データに対応する前記演奏タ
イミングとともに前記バッファに書き込む第2のステッ
を含む ことを特徴とする請求項3に記載の楽音発生方
法。
4. The step of generating the musical tone waveform comprises the step of supplying the musical tone waveform.
From among the plurality of performance event of the song data, playing event that the parameter conversion step is not performed
A cement, and the performance timing of the performance event is pre SL tone waveform generation should do, the predetermined time interval
Condition that is within the range of time of the tone waveform having
A first step of detecting a performance event that satisfies the condition, and the first step
When detecting, before generating the pre SL tone waveform, the strip
The performance data of the performance event satisfying the above conditions is transferred to the sound source pattern.
The performance parameter corresponding to the performance data
Tone generation method according to claim 3, characterized in that it comprises a second step <br/> flop, to be written into the buffer with timing.
JP07503798A 1997-03-11 1998-03-10 Musical tone generation method Expired - Fee Related JP3405181B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP07503798A JP3405181B2 (en) 1997-03-11 1998-03-10 Musical tone generation method

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP9-72845 1997-03-11
JP7284597 1997-03-11
JP07503798A JP3405181B2 (en) 1997-03-11 1998-03-10 Musical tone generation method

Publications (2)

Publication Number Publication Date
JPH10312189A JPH10312189A (en) 1998-11-24
JP3405181B2 true JP3405181B2 (en) 2003-05-12

Family

ID=26413981

Family Applications (1)

Application Number Title Priority Date Filing Date
JP07503798A Expired - Fee Related JP3405181B2 (en) 1997-03-11 1998-03-10 Musical tone generation method

Country Status (1)

Country Link
JP (1) JP3405181B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1175393C (en) * 1999-03-08 2004-11-10 株式会社飞驰 Data reproducing device, data reproducing method, and information terminal equipment
US7723601B2 (en) * 2007-03-22 2010-05-25 Qualcomm Incorporated Shared buffer management for processing audio files
CN103220567A (en) * 2013-03-21 2013-07-24 青岛海信信芯科技有限公司 Method, system and television for playing television starting music

Also Published As

Publication number Publication date
JPH10312189A (en) 1998-11-24

Similar Documents

Publication Publication Date Title
US6140566A (en) Music tone generating method by waveform synthesis with advance parameter computation
JPH1173182A (en) System for forming, distributing, storing and executing music work file and method therefor
JP3293434B2 (en) Tone generation method
JP3637578B2 (en) Music generation method
US6326537B1 (en) Method and apparatus for generating musical tone waveforms by user input of sample waveform frequency
US7279628B2 (en) Editing apparatus of setting information for electronic music apparatuses
US5770812A (en) Software sound source with advance synthesis of waveform
JP3405181B2 (en) Musical tone generation method
US7642447B2 (en) Electronic musical instrument system and method emulating a removable media drive
US6754351B1 (en) Music apparatus with dynamic change of effects
JP3572847B2 (en) Sound source system and method using computer software
JP3637577B2 (en) Music generation method
JP3003559B2 (en) Music generation method
JP4103706B2 (en) Sound source circuit control program and sound source circuit control device
JP3141789B2 (en) Sound source system using computer software
JP3781171B2 (en) Music generation method
JP4096952B2 (en) Music generator
JP3460524B2 (en) Music data processing method, processed music data reproduction method, and storage medium
JP3632744B2 (en) Sound generation method
JP3278857B2 (en) Musical tone generator
JP2562261B2 (en) Electronic musical instrument assigner
JP3705203B2 (en) Music generation method
JP3627590B2 (en) Sound generation method
JP4218417B2 (en) Data storage method, data processing apparatus, and program
JP3758267B2 (en) Sound source circuit setting method, karaoke apparatus provided with sound source circuit set by the method, and recording medium

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

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313532

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

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

Free format text: PAYMENT UNTIL: 20090307

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20090307

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20100307

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20110307

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20110307

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20120307

Year of fee payment: 9

LAPS Cancellation because of no payment of annual fees