JPH10312189A - Musical sound generation method - Google Patents

Musical sound generation method

Info

Publication number
JPH10312189A
JPH10312189A JP10075037A JP7503798A JPH10312189A JP H10312189 A JPH10312189 A JP H10312189A JP 10075037 A JP10075037 A JP 10075037A JP 7503798 A JP7503798 A JP 7503798A JP H10312189 A JPH10312189 A JP H10312189A
Authority
JP
Japan
Prior art keywords
data
waveform
memory
buffer
generating
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP10075037A
Other languages
Japanese (ja)
Other versions
JP3405181B2 (en
Inventor
Genichi Tamura
元一 田邑
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)

Abstract

PROBLEM TO BE SOLVED: To provide a musical sound generation method capable of decentralizing and reducing a processing load by hourly averaging the processing load for generating the waveform data form the music data. SOLUTION: The music data includes the performance event data and durative information. The processing A of S1 developes the music data to sound source parameters to write them in a P buffer. This S1 is executed when an unused area exists in the P buffer. The processing B of S2 inputs the sound source parameters added with time information of a time frame (F) in a time frame (F-1) whenever reproduction of one time frame (e.g. F-2) is ended to write them in a W buffer. A DMAC(direct memory access controller) controlled by a CODEC driver reads out the waveform data stored in the W buffer one sample each at every sampling period to output a waveform through a sound system.

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, the present invention can be applied to a software sound source that plays back while receiving a MIDI data stream via a network.

【0002】[0002]

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

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

【0004】コンピュータでは、曲データを受信するた
め、ウエブブラウザ等のソフトウエアが実行される。ウ
エブブラウザとしては、ネットスケープ(Netsca
peCommunications Corporat
ion、商標)やインターネットエクスプローラ(Mi
crosoft Corporation、商標)が一
般的である。ウエブブラウザでは、上述した手法により
曲データのファイルを、サーバからロードする機能を有
する。
In a computer, software such as a web browser is executed to receive music data. Netscape (Netsca)
peCommunications Corporation
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-described method.

【0005】その具体例として、「MIDIPLUG」
(ヤマハ株式会社、商標)「Crescendo」(L
ive Up Date Corporation、商
標)、「歌楽」(ヤマハ株式会社、商標)などがある。
「MIDIPLUG」は、XG規格の主要音色を備え、
MIDIデータを完全に受信し終わると再生を開始する
ソフト音源である。「Crescendo」は、MID
Iデータを受信しながら、受信データがある程度たまる
とローカルのハードまたはソフトによる外部MIDI音
源にMIDI出力を行うプレーヤである。これらは、ワ
ールドワイドウエブ(WWW)のホームページを閲覧す
るウエブブラウザに組み込まれるプラグインソフトであ
り、別ソフトウエアによるウエブブラウザへの付加機能
となっているが、将来的には、ウエブブラウザ自身の標
準機能となる可能性もある。「歌楽」は、歌詞と演奏と
を同期させて表示する通信カラオケ用ソフトウエアパッ
ケージである。
[0005] As a specific example, "MIDIPLUG"
(Yamaha Corporation, trademark) "Crescendo" (L
live Up Date Corporation (trademark) and "Karaku" (Yamaha Corporation, trademark).
"MIDIPLUG" has the main tone of XG standard,
This is a software sound source that starts playing when MIDI data is completely received. "Crescendo" is the MID
While receiving the I data, the player performs MIDI output to an external MIDI sound source by local hardware or software when the received data accumulates to some extent. These are plug-in software incorporated in the web browser for browsing the World Wide Web (WWW) homepage, and are additional functions to the web browser by other software. It may be a standard feature. "Koraku" is a communication karaoke software package 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 a conventional tone generation method. In the figure, reference numeral 121 denotes MIDI data input timing, reference numeral 12 denotes a sound source parameter creation period, and reference numeral 14 denotes 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
IDI data is input, sound source parameters are generated in a sound source parameter creation period 12, and in a waveform data generation period 14 in a period of the next time frame (F-1),
Waveform data including the newly generated sound source parameters is generated. This waveform data is stored in the next time frame (F).
Will be played back. Generation of sound source parameters is performed by MID
Each time I data is input, generation of waveform data is interrupted.

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

【0008】[0008]

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

【0009】[0009]

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

【0010】したがって、曲データから波形データを生
成する処理を、波形データの再生の進行に応じて処理を
する部分と、これとは独立して実行することのできるパ
ラメータ変換処理とに分けることができたため、パラメ
ータ変換処理を、この処理のためのバッファ用である第
1のメモリの記憶容量の範囲で先行して実行することが
でき、曲データから波形データを再生する処理の負荷が
時間的に平均化され、実質的な処理負担が小さくなる。
Therefore, the process of generating waveform data from music data can be divided into a portion that processes according to the progress of the reproduction of the waveform data and a parameter conversion process that can be executed independently of this. Because of this, the parameter conversion process can be executed earlier in 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 time-consuming. And the substantial processing load is 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 present invention, in the musical sound generating method, a first step of receiving music data supplied through a communication channel and writing the music data in a first memory;
A second step of converting the music data stored in the memory into parameters and writing the converted data into a second memory; generating waveform data based on the parameters stored in the second memory and writing the generated waveform data into a third memory; A third step of releasing, in a second memory, an area in which the parameters used for generating the waveform data have been written, and reproducing the waveform data stored in the third memory to generate a musical tone. A fourth step of generating the waveform data in accordance with the progress of the reproduction of the waveform data in the fourth step; and a second step of storing an unused area in the second memory. Exists, and when there is music data that has not yet been converted into a parameter in the first memory, the conversion to the parameter is executed.

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

【0013】請求項3に記載の発明においては、楽音発
生方法において、曲データを供給する供給ステップと、
供給された前記曲データから、演奏イベントの演奏デー
タおよび演奏タイミングを取り出し、前記演奏データを
音源パラメータに変換し前記演奏タイミングとともにメ
モリに書き込むパラメータ変換ステップと、所定時間間
隔ごとに起動され、音源レジスタに記憶された前記音源
パラメータに基づいて楽音波形を生成するステップであ
り、前記メモリに前記音源パラメータとともに記憶され
た前記演奏タイミングが、前記楽音波形を生成しようと
する時刻に一致する時点で、前記演奏タイミングに対応
する前記音源パラメータにより前記音源レジスタの内容
を更新しつつ、前記音源レジスタに記憶された前記音源
パラメータに基づいて前記楽音波形の生成を実行する楽
音波形生成ステップと、生成された前記楽音波形を前記
演奏タイミングに対応させて再生する楽音発生ステップ
と、を備えており、前記パラメータ変換ステップは、処
理の優先順位が前記楽音波形生成ステップよりも低く設
定され、かつ、前記楽音波形生成ステップとは独立して
先行して実行できるようにしたものである。
According to the third aspect of the present invention, in the musical sound generating method, a supplying step of supplying music data;
A parameter conversion step of extracting performance data and performance timing of a performance event from the supplied music data, converting the performance data into tone generator parameters, and writing the performance data together with the performance timing in a memory; Generating a musical tone waveform based on the sound source parameters stored in the memory, wherein the performance timing stored with the sound source parameters in the memory coincides with a time at which the musical tone waveform is to be generated, A tone waveform generation step of executing the tone waveform generation based on the tone generator parameters stored in the tone generator register while updating the content of the tone generator register with the tone generator parameter corresponding to the performance timing; and Musical sound waveform to the above performance timing A musical tone generating step of reproducing the musical tone in response to the tone waveform generating step, wherein the parameter conversion step has a processing priority set lower than that of the musical tone waveform generating step, and is preceded independently of the musical tone waveform generating step. It can be executed.

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

【0015】請求項4に記載の発明においては、請求項
3記載の楽音発生方法において、前記パラメータ変換ス
テップが実行されていない前記演奏イベントの前記演奏
タイミングが、前記楽音波形生成ステップが前記楽音波
形を生成しようとする前記所定時間間隔の範囲内にある
ときには、前記楽音波形生成ステップが前記楽音波形を
生成する前に、前記演奏イベントに対して前記パラメー
タ変換ステップを実行するものである。
According to a fourth aspect of the present invention, in the musical tone generating method according to the third aspect, the performance timing of the performance event for which the parameter conversion step has not been executed is determined by the musical tone waveform generating step. When the musical tone waveform is within the range of the predetermined time interval, the musical tone waveform generating step executes the parameter conversion step for the performance event before the musical tone waveform is generated.

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

【0017】[0017]

【発明の実施の形態】図1は、本発明の第1の実施の形
態の楽音発生方法の処理の流れを表わす説明図である。
図2は、本発明の第1の実施の形態の楽音発生方法のタ
イミング図である。図中、図14と同様な部分には同じ
符号を付して説明を省略する。11は曲データ、13は
演奏タイミングである。この実施の形態は、ローカルに
あらかじめ用意された自動演奏用の曲ファイルの曲デー
タを再生するものである。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS 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.
FIG. 2 is a timing chart of the musical sound generation method according to the first embodiment of the present invention. In the figure, the same parts as those in FIG. 14 are denoted by the same reference numerals, and 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 in advance is reproduced.

【0018】図2に示す曲データ11は、データ領域に
記憶されている。この曲データ11には、1つの演奏イ
ベントにつき、この演奏イベントを表すデータとこの演
奏イベントの演奏タイミングのデータが含まれている。
演奏タイミングのデータは、曲の先頭などからの絶対時
間を表す時刻情報でもよいし、直前の演奏イベントから
今回の演奏イベントまでの相対な時間間隔を表すデュレ
ーション情報でもよい。異なるシーケンサ間で演奏デー
タをやりとりするための標準ファイルとして、SMF
(スタンダードMIDIファイル)が知られている。こ
のSMFでは、デュレーション情報を用いて演奏タイミ
ングを表している。以下、デュレーション情報を用いて
演奏タイミングを表わす場合について説明する。
The music 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 data on the performance timing of the performance event.
The performance timing data may be time information indicating an absolute time from the beginning of the song or the like, 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, the performance timing is represented using duration information. Hereinafter, a case where the performance timing is represented using the 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, music data 11 (MIDI) is sequentially read from the data area, developed into sound source parameters (PARM), and written into a P buffer (parameter buffer). However, S1 is executed when there is an unused area (empty) 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 diagram 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 the PCM tone generator, there are a start address and an end address of the waveform memory corresponding to the selected timbre data, an envelope parameter, and the like. The above-mentioned duration information is converted into time information data indicating the performance timing 13 shown in FIG. 2, and a sound source parameter to which the time information is added is written in the P buffer. However, the sound source parameters may be written by adding some time interval information (or the duration information itself included in the music data 11). In any case, sound source parameters are written with time information indicating performance timing, such as time information or time interval information, and are used to know the performance timing when generating a waveform.

【0021】S2の処理Bは、1つの時間フレームの波
形再生完了に合わせて実行され、図2に示すような時間
フレームの開始時点ごとに起動がかけられる。この実施
例では、1つの時間フレーム(例えば、F−2)の再生
が終了する毎に、次に再生する時間フレームのさらにそ
の次の時間フレーム(F)で再生すべき波形データを生
成するようになっている。音源パラメータに付与された
時刻情報がその波形データを生成する時間フレームの範
囲に入っていれば、この音源パラメータは、波形データ
の生成の途中で音源レジスタに書き込まなければいけな
い。つまり、その波形データを再生する時間フレーム
(F)の1つ前の時間フレーム(F−1)において、そ
の時間フレーム(F)の時刻情報が付与された音源パラ
メータが音源レジスタに入力され、楽音生成に使用され
る。
The process B of S2 is executed in accordance with the completion of the waveform reproduction of one time frame, and is started at each start time 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, waveform data to be reproduced in the next time frame (F) after the time frame to be reproduced next is generated. 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, the sound source parameter must be written to 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 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 parameters of the sound source register, and the W buffer (waveform buffer) is generated.
Write to. By executing this step S2, the used sound source parameters do not need to be stored in the P buffer, the area in which the used sound source parameters are stored is released, and the unused area (empty) is stored in the P buffer. Can be.

【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 reproduction device performs processing. The playback device includes a CODEC, a CODEC driver, a sound system, and the like. CO here
The DEC is an LSI for a voice interface, and is a semiconductor chip having an A / D converter, a D / A converter, a sampling cycle generator, a waveform compression / expansion circuit, a DMAC (Direct Access Memory Controller) and the like inside. Yes, although it has functions such as A / D conversion and D / A conversion,
It cannot record or play back waveform data. CO
The DEC driver is software that controls or uses the above-described CODEC under other software such as a software sound source to record an input waveform on the RAM and reproduce waveform data on the RAM. . CODE
The C driver may use 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 transmits the waveform data to the CODEC driver.
It entrusts a waveform reproduction process using EC, that is, a process of transferring waveform data to the D / A converter one sample at a time in each sampling period. The DMAC controlled by the CODEC driver reads out the waveform data stored in the W buffer one sample at a time in each sampling cycle, 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 a DMDEC.
2 buffer memories for one frame as A buffer
We have prepared. While the CODEC driver is reproducing the waveform data stored in one of the buffer memories, the waveform data for one frame stored in the W buffer is written to the other buffer memory. When the reproduction of the waveform data from one buffer memory is completed, the CODEC driver continues to reproduce the other buffer memory, and in the meantime, writes the waveform data stored in the W buffer to one buffer memory. By repeating this, C
ODEC continuously reproduces waveform data. Note that C
The ODEC driver uses 2 buffer memories for one frame.
Instead of preparing two W buffers as described above, the waveform data stored in the two W buffers are alternately reproduced.
While the waveform data on the buffer is being reproduced, the waveform data to be reproduced next may be generated on the other buffer.

【0026】また、S1のステップにおいて、発音割当
をすることができる。この段階で発音割当を行う場合に
は、CPUは、ノートオン時に何チャネルが使用されて
発音されているかという発音状況を認識しておく必要が
ある。ノートオフ時には、ノートオフの音高データに対
応する発音中のチャネル番号を見つけ、このチャネルの
番号の音源レジスタにノートオフを書込むだけでよい。
Further, in the step S1, a sound generation can be assigned. In the case where sound assignment is performed at this stage, it is necessary for the CPU to recognize how many channels are used and sound is being generated at the time of note-on. At the time of note-off, it is only necessary to find the number of the sounding channel corresponding to the pitch data of note-off, and write the note-off into 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 in accordance with the progress of the reproduction of the waveform data, and a process which can be executed independently of the process B A. Specifically, the cooperation between the processing A and the processing B is realized by adding time information to sound source parameters using time data called duration information included in the music data. Since the processing A and the processing B can be divided, the processing A can be executed earlier in the range of the storage capacity of the P buffer, and the load of the processing of reproducing the waveform data from the music data is temporally averaged. Be transformed into

【0028】上述したPバッファの記憶容量は、必要以
上に大きくしなくてもよい。Pバッファの記憶容量は、
CPUの処理能力等に応じて最適容量が決まるため、使
用されているCPUの種類を検出して自動的にPバッフ
ァに割り当てる記憶容量を設定するようにしてもよい。
あるいは、ユーザが割り当てる記憶容量を任意に設定す
るようにしてもよい。
The storage capacity of the P-buffer described above does not need to 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 and the like, the type of CPU used may be detected to automatically set the storage capacity to be allocated to the P buffer.
Alternatively, the storage capacity allocated 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 in accordance with the flow of the processing. However, as the operation actually executed, the reproduction process of the waveform data by the CODEC is “main”. And is prioritized,
In accordance with the reproduction process of the waveform data, the generation of the waveform data of the process B is executed in a “sub” manner.

【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,
A removable disk such as a CD-ROM or MO; 24, a display such as a CRT or LCD; 25, a keyboard and mouse; 26, a CODEC; 27, 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 a 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 for controlling the basic operation of the computer. Then, a soft sound source can be executed. The program for executing the software sound source is, for example, the hard disk 22
And loaded into the RAM 32 and executed. The music data is stored in advance in the removable disk 23 or 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 the W buffer shown in FIG.
It is provided on the RAM 32. The CODEC 26 fetches data from the RAM 32 by using a DMAC (Direct Memory Access Controller) installed inside or separately. A MIDI interface 28 is required when connecting to an external MIDI device, and a network interface 33 is required when connecting to an external server. Although the CPU 30 is a single CPU, a multi-CPU
It 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 generation method according to the first embodiment of the present invention. This flow is started when the MIDI file name of a desired music piece is selected on the display device by clicking or the like, and the software sound source program is started. In S41, the tone generator registers for all tone generation channels are set to a toneless state. In addition, in order to play back a soft sound source, a playback device C
Initialize the ODEC driver, CODEC 26 and sound system 27, and start the waveform playback software. S42
In, the activation factor check is performed. In S43, if there is no activation factor, the process returns to S42, and if there is an activation factor, the process proceeds to 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 (free space) equal to or more than a predetermined amount is created in the P buffer, the process proceeds to processing A in S45, in which MIDI data to be processed next is extracted from the music data, and is set in the sound source parameter (PARM). Converted,
Write to P buffer. When the reproduction of the waveform of one time frame is completed, the process proceeds to processing B of S46, where the waveform of the next time frame is generated based on the sound source parameters with performance timing information stored in the P buffer, and W
Write to buffer. When there is another request such as a tone color selection operation or an algorithm selection operation, the process proceeds to S47 to set the sound source operation according to the request. If there is a request for terminating the software sound source, the process proceeds to S48, and the program for the software sound source is terminated. C shown in FIG.
The PU 30 constantly checks these activation factors, determines the activation factors in S44, and starts specific processing.

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

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

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

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

【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 that has already been read from the song data with a pointer,
Take out the following: The performance data is MIDI data. The performance timing is duration information included in the MIDI data or time information obtained from the duration information.

【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 into the E buffer (envelope buffer). The E buffer is completely different from the P buffer and the W buffer shown in FIG. The conventional hardware tone generator has a function of reading an envelope, and assigns a sounding channel by checking the envelope level of each sounding channel. If the processing routine is used as it is for a software sound source, an envelope must first be generated. Even when a performance event is not occurring, the level of the envelope 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 interpolation processing.

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

【0042】なお、S52を削除し、音源パラメータ発
生時にエンベロープの作成をしないようにすることも可
能である。この場合、音源パラメータ作成の段階では、
発音チャネル割り当てをせずに未定にしておき、後述す
る処理Bの波形生成時に発音チャネル割り当てを行う。
ただし、この場合、演奏イベントが重なると処理が重く
なるため、音源パラメータ作成の段階で発音チャネル割
当を行う方が望ましい。あるいは、音源パラメータ作成
の段階で発音チャネル割当を行うものの、エンベロープ
レベルを用いずに、例えば、後着優先で発音割り当てを
する、すなわち、後から入力された発音を優先して行う
ようにすることも可能である。
It is also possible to omit S52 so as not to create an envelope when generating sound source parameters. In this case, at the stage of sound source parameter creation,
A sounding channel is not assigned but is undecided, and a sounding channel is assigned at the time of generating a waveform in processing B described later.
However, in this case, if the performance events overlap, the processing becomes heavy. Therefore, it is desirable to assign the sounding channel at the stage of generating the sound source parameters. Alternatively, although sound channel assignment is performed at the stage of sound source parameter creation, sound assignment is performed without using an envelope level, for example, with late arrival priority, that is, sound input later is preferentially performed. 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 a waveform is generated. In S61, the waveform generation amount is determined. FIG.
As shown in (1), when an interrupt occurs every time frame, the waveform generation amount is fixed to one frame. In the case of the modification of the activation factor in 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 range for generating the waveform. This determination is made by checking a pointer indicating a performance event that has already been read from the music data and for which the process A has been executed, and determines whether or not the performance timing of the next performance event is later than the range in which the waveform is to be generated. Do with. Normally, the performance events occur at intervals of several ms to several tens of ms for a time frame. Therefore, the performance events within the range in which the waveform is to be generated should have finished the processing A in advance. . However, in the music data, there is a possibility that a performance event that has not finished the processing A remains in the range for generating the waveform.

【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 in the case where there is an unprocessed event in the range for generating a waveform. In the figure, the same parts as those in FIGS. 14 and 2 are denoted by the same reference numerals, and 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 the performance event whose waveform needs to be reproduced in the time frame (F-1), the process proceeds to S63 in FIG. This is executed in the sound source parameter creation period 12 of F-1), and the process returns to S62. S
If it is determined in 62 that there is no unprocessed performance event in the range in which the waveform is to be generated, the process proceeds to S64.
S63 may be repeatedly executed.

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

【0047】波形生成に際しては、図5に示した処理A
のS52においてEバッファに書き込んだエンベロープ
も使用する。図5に示した処理AのS52においてエン
ベロープを作らない場合には、ここでエンベロープを作
成しつつ波形生成を行う。S62において波形データを
生成する範囲に未処理の演奏イベントなしと判断された
にもかかわらず、波形データを生成する時間フレームに
含まれた演奏イベントのエンベロープが、Eバッファに
まだ作られていない場合がある。すなわち、処理Aは、
波形データを生成する時間フレームに含まれる演奏イベ
ントまで完了しているが、その次の演奏イベントの処理
Aは未処理である場合、つまり、波形データ生成に必要
なエンベロープ波形のうちで、処理済みの最終イベント
の所までは処理Aでエンベロープが作成済みであるが、
その後の部分が未作成であるという場合である。補間処
理では、この時間フレームに含まれる演奏イベントのエ
ンベロープを作ることができない。このような場合、こ
のS64のステップで、波形データを生成する時間フレ
ームについて、エンベロープを作成する必要がある。S
65においては、生成してWバッファに書き込んだ1フ
レーム分の波形データをCODECドライバに渡す。
When generating a waveform, the processing A shown in FIG.
The envelope written in the E buffer in S52 is also used. When no envelope is created in S52 of the process A shown in FIG. 5, the waveform is generated while creating the envelope here. When the envelope of the performance event included in the time frame for generating the waveform data has not yet been created in the E buffer even though it is determined in S62 that there is no unprocessed performance event in the range for generating the waveform data. There is. That is, process A is
When 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 has not been processed, that is, the processed waveform among the envelope waveforms required for generating the waveform data has been processed. The envelope has already been created in process A until the final event of
This is the case when the subsequent part has not been created. In the interpolation processing, an envelope of the performance event included in this time frame cannot be created. In such a case, in step S64, it is necessary to create an envelope for the time frame for generating the waveform data. 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, process A determines whether at least one performance event after the time frame for which a waveform is to be generated has been processed, and if the process has not been completed, step S63.
The processing proceeds to at least one
The process proceeds to 64. In this way, the envelope is created by the process A up to the performance event 13 after the time frame for which the waveform is to be generated.
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 in the case where there is an unprocessed event in the range for generating a waveform. In the figure, the same parts as those in FIGS. 14 and 2 are denoted by the same reference numerals, and description thereof will be omitted. As shown in FIG. 8, the time frame (F-
When it is determined in 1) that the unprocessed performance event that has not been converted to the sound source parameter is to generate 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, in which the music data of the unprocessed performance event is converted into sound source parameters, and then the process B is executed. In this manner, 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 the CODEC shown in FIG. 3. In S71, in response to a sample request interrupt (hardware interrupt) in which CODEC occurs in the sampling cycle, CODEC
DMA buffer (DMAB), which is a waveform buffer of
The waveform data is sent to the CODEC one sample at a time. S
In 72, the value of the transfer sample number p is increased 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 number p of transfer samples is represented by, for example, 8 bits. CODEC counts the number of transfer samples p,
Each time half the number of samples of the size of the DMA buffer is transferred, ie, the number of transferred samples p = 127 and p
= 255, it is determined that the waveform reproduction of one frame has been completed, and a hardware interrupt is executed. 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 generation processing of the processing B, samples for one frame corresponding to half of the DMA buffer are collectively generated on the W buffer, and the waveform data of the W buffer is transferred to the DMA buffer. The size of the above-mentioned DMA buffer is for 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 a processing flow of a musical sound generating method according to the second embodiment of the present invention. This shows the case of stream reproduction. In S81,
The multimedia data (MMD) is received from the network, and is written in the reception buffer on the RAM 32 shown in FIG. The reception buffer area is secured to have a size in which, for example, one piece of multimedia data can be written. In addition, multimedia data is
In addition to the MIDI data, the data includes lyrics data and image data synchronized with the MIDI data.

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

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

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

【0058】さらに、Mバッファに曲データが存在する
場合にパラメータに変換する処理を行うことができるた
め、曲データの全部のロードが完了するのを待つことな
く、曲の再生を開始することができる。なお、受信バッ
ファをある程度大きな容量にして、上述したように、例
えば1曲分のマルチメディアデータを書き込むことがで
きる大きさを確保しておき、受信したマルチメディアデ
ータを書き換えずに残しておくようにした場合には、受
信バッファ上に残されたデータを再び再生することがで
きる。あるいは、この受信バッファを書き込みバッファ
として、受信したマルチメディアデータをそのまま図3
に示したハードディスク22やリムーバルディスク23
に書き込むようにしてもよい。また、受信バッファでは
なくMバッファをある程度大きな容量にして、曲データ
を書き換えず残しておくようにした場合には、曲データ
のみを再び再生することができる。
Further, when music data exists in the M buffer, a process of converting the data into parameters can be performed, so that the reproduction of the music can be started without waiting for the completion of the loading of all the music data. it can. It is to be noted that the receiving buffer is set to have a relatively large capacity so that, as described above, for example, a size for writing multimedia data for one song is secured, and the received multimedia data is left without being rewritten. In this case, the data remaining on the reception buffer can be reproduced again. Alternatively, using the reception buffer as a write buffer, the received multimedia data is used as is in FIG.
Hard disk 22 and removable disk 23 shown in
May be written. When the M buffer, instead of the reception buffer, is set to have a certain capacity 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 that implements this flow is implemented, for example, as plug-in software incorporated in a web browser. Song data like standard MIDI file (SMF)
Alternatively, "tag" data indicating the location where multimedia data (MMD) including such music data is stored in the server is embedded in the homepage, and download is instructed according to the "tag" data. At this time, this program is activated and performs not only downloading but also reproduction of multimedia data.

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

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

【0062】1つの時間フレームの波形再生が完了し
たときには、S98の処理Bに進み、Pバッファから読
み出した演奏タイミング情報付きの音源パラメータに基
づいて、次の時間フレームの波形を生成する。音色選
択などのスイッチング操作、歌詞,画像の表示の差し替
えやスクロールといったマルチメディア処理等、その他
の要求があるときには、S99に処理を進め、これらの
要求に応じた各種の設定を行う。音源ソフトの終了要
求があるときには、S100に処理を進めソフト音源の
プログラムの終了処理をする。図3に示したCPU30
は、これらの起動要因を絶えずチェックしており、S9
4において起動要因を判定して具体的な処理を開始す
る。
When the reproduction of the waveform 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 parameters with performance timing information read from the P buffer. When there are other requests such as switching operation such as tone color selection, multimedia processing such as replacement of lyrics and image display and scrolling, the process proceeds to S99 to perform various settings according to these requests. If there is a request for terminating the sound source software, the process proceeds to S100 to terminate the program of the software sound source. CPU 30 shown in FIG.
Constantly checks these activation factors.
In 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 downloading, first, the reception processing and the music data extraction processing are started, and after the music data for a predetermined amount or the predetermined time has accumulated in the M buffer, the processing with the first processing A is started. The waveform generation processing of the software sound source B is started. Alternatively, the above-described waveform generation processing may be started after a predetermined amount or a predetermined amount of multimedia data has accumulated in the reception buffer. Furthermore, the processing A is started before the processing B at the same time as the reception processing and the music data extraction processing, and the processing B is started after the sound source parameters for a predetermined amount or a predetermined time have accumulated in the P buffer. You may do so. In this way, the waveform generation is started after a certain amount of data is accumulated in each buffer, so that the operation immediately after the start of reproduction can be performed stably.
Since the required amount or the predetermined time varies depending on the transfer rate of the network, line quality, and the like, the user can arbitrarily set the predetermined amount or the predetermined time. As for the processing priority, the multimedia task processing is performed in the priority order of >>> multimedia processing >>>>> switching operation >>. In the M buffer, the P buffer, and the W buffer, among the data stored in each buffer, an area in which used data that has been processed and 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 data extraction processing shown in FIG. In S111, the next set of multimedia data (MM
D), and in step S112, the type of the multimedia data (MMD) is determined, and the music data (MID) is determined.
If it is I), the process proceeds to S113, and if it is other multimedia data, the process proceeds to S114. S
At 113, the set of music data is written into an M buffer. At S114, the set of multimedia data is stored in a buffer corresponding to the type, for example, a G buffer for image data, a K buffer for lyrics data, etc. , And the stored data are subjected to display processing in the other processing of S99 shown in FIG. 11 at the reproduction timing of the data.

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

【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 a pointer indicating a performance event that has already been read from the music data and for which the process A has been executed, and determines whether or not the performance timing of the next performance event is later than the range in which the waveform is to be generated. Do with. 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 sound source parameter stored in the P buffer is included in the time frame in which the waveform is to be generated, the generation position is changed during the generation of the waveform data for one frame. At the time when the timing matches, the tone generator register is updated with the tone generator parameters stored in the P buffer, and the waveform data is generated based on the tone generator parameters stored in the tone generator register. Then, the generated amount, for example, the waveform of one frame is written to the W buffer. In S125, the generated and written waveform data of one frame is written to the W buffer.
Pass it to the ODEC driver.

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

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

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

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

【0072】この変更例であれば、図6に示した曲デー
タ再生の場合の処理BにおけるS64の波形生成の場合
と同様に、今回波形生成する時間フレームについて、処
理Aの中でエンベロープ生成が終わっていることが保証
できるので、S123において、エンベロープを作成す
る必要がない。逆に、S122を変更しない場合には、
S123において、エンベロープを作成する必要のある
場合がある。
In this modified example, the envelope generation is performed in the processing A for the time frame in which the current waveform is generated, as in the case of the waveform generation in S64 in the processing B for the music data reproduction shown in FIG. Since it can be guaranteed that the process has been completed, there is no need to create an envelope in S123. Conversely, if 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 where data is received from a network, and for example, the case where multimedia data is transferred from an external storage medium. The present invention can also be applied to the case where the reproduction is performed while performing the reproduction, or the case where the reproduction is performed while receiving the 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, an error is minimized in the musical sound generation processing.
2. A flow of returning to the process A in the process B is provided as in S63. However, when using in an environment in which an exceptional situation is unlikely to occur, such as when the CPU power is large, it is possible to omit the flow of returning such processing. S122, S124, S126,
S127 and S128 are also flows returning the same processing.
Further, in the reproduction of the music file described with reference to FIGS. 1 to 9, no error processing flow is provided, but in the case of the stream reproduction described with reference to FIGS. 10 to 13, S129 of FIG. The flow can be changed so as to perform error processing such as

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

【0076】[0076]

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

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

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

【図2】 本発明の第1の実施の形態の楽音発生方法の
タイミング図である。
FIG. 2 is a timing chart of the musical sound generation method according to the first embodiment of the present 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 generation method according to the first embodiment of the present invention.

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

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

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

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

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

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

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

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

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

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

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

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

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】 供給された曲データを順次パラメータに
変換し第1のメモリに書き込む第1のステップと、第1
のメモリに記憶された前記パラメータに基づいて波形デ
ータを生成し第2のメモリに書き込むとともに、前記波
形データの生成に使用した前記パラメータが書き込まれ
ていた領域を第1のメモリにおいて解放する第2のステ
ップと、第2のメモリに記憶された前記波形データを再
生して楽音を発生する第3のステップを有し、第2のス
テップは、第3のステップの前記波形データの再生の進
行に応じて前記波形データを生成し、第1のステップ
は、第1のメモリに未使用領域が存在する場合に前記パ
ラメータへの変換を実行することを特徴とする楽音発生
方法。
A first step of sequentially converting supplied music data into parameters and writing the parameters to a first memory;
Generating waveform data based on the parameters stored in the memory and writing the generated data to the second memory, and releasing, in the first memory, the area in which the parameters used for generating the waveform data have been written in the first memory And a third step of reproducing the waveform data stored in the second memory to generate a musical tone. The second step includes a step of reproducing the waveform data in the third step. And generating the waveform data in response to the conversion of the parameter when the 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 channel and writing the song data into a first memory, and converting the song data stored in the first memory into parameters and writing the parameters into a second memory. A second step of generating waveform data based on the parameters stored in the second memory and writing the generated waveform data to a third memory, and setting an area in which the parameters used for generating the waveform data have been written to a second memory; A third step of freeing in the memory of
A fourth step of reproducing the waveform data stored in the third memory to generate a musical tone; and the third step includes the step of reproducing the waveform data in accordance with the progress of the reproduction of the waveform data in the fourth step. Generating data, the second step comprising:
Wherein the unused memory area exists in the memory and music data which has not yet been converted to the parameter exists in the first memory, the conversion to the parameter is executed.
【請求項3】 曲データを供給する供給ステップと、供
給された前記曲データから、演奏イベントの演奏データ
および演奏タイミングを取り出し、前記演奏データを音
源パラメータに変換し前記演奏タイミングとともにメモ
リに書き込むパラメータ変換ステップと、所定時間間隔
ごとに起動され、音源レジスタに記憶された前記音源パ
ラメータに基づいて楽音波形を生成するステップであ
り、前記メモリに前記音源パラメータとともに記憶され
た前記演奏タイミングが、前記楽音波形を生成しようと
する時刻に一致する時点で、前記演奏タイミングに対応
する前記音源パラメータにより前記音源レジスタの内容
を更新しつつ、前記音源レジスタに記憶された前記音源
パラメータに基づいて前記楽音波形の生成を実行する楽
音波形生成ステップと、生成された前記楽音波形を前記
演奏タイミングに対応させて再生する楽音発生ステップ
と、を備えており、前記パラメータ変換ステップは、処
理の優先順位が前記楽音波形生成ステップよりも低く設
定され、かつ、前記楽音波形生成ステップとは独立して
先行して実行できるようにしたことを特徴とする楽音発
生方法。
3. A supply step of supplying music data, and from the supplied music data, performance data and performance timing of a performance event are extracted, and the performance data is converted into tone generator parameters and written into a memory together with the performance timing. A conversion step and a step of generating a musical tone waveform based on the sound source parameters stored in a sound source register, which is activated at predetermined time intervals, and wherein the performance timing stored in the memory together with the sound source parameters corresponds to the musical tone. At the point in time when the waveform is to be generated, the content of the tone generator register is updated with the tone generator parameter corresponding to the performance timing, and the tone waveform of the musical tone waveform is updated based on the tone generator parameter stored in the tone generator register. A musical tone waveform generating step for performing the generation; A tone generation step of reproducing the generated musical tone waveform in accordance with the performance timing, wherein the parameter conversion step is such that processing priority is set lower than the musical tone waveform generating step, and A tone generation method characterized in that it can be executed prior to the tone waveform generating step.
【請求項4】 前記パラメータ変換ステップが実行され
ていない前記演奏イベントの前記演奏タイミングが、前
記楽音波形生成ステップが前記楽音波形を生成しようと
する前記所定時間間隔の範囲内にあるときには、前記楽
音波形生成ステップが前記楽音波形を生成する前に、前
記演奏イベントに対して前記パラメータ変換ステップを
実行することを特徴とする請求項3に記載の楽音発生方
法。
4. When the performance timing of the performance event for which the parameter conversion step has not been performed is within the range of the predetermined time interval in which the musical tone waveform generating step attempts to generate the musical tone waveform, 4. The musical sound generating method according to claim 3, wherein the parameter converting step is performed on the performance event before the waveform generating step generates the musical sound waveform.
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
JP7284597 1997-03-11
JP9-72845 1997-03-11
JP07503798A JP3405181B2 (en) 1997-03-11 1998-03-10 Musical tone generation method

Publications (2)

Publication Number Publication Date
JPH10312189A true JPH10312189A (en) 1998-11-24
JP3405181B2 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)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100424231B1 (en) * 1999-03-08 2004-03-25 파이쓰, 인크. Data reproducing device, data reproducing method, and information terminal
JP2010522361A (en) * 2007-03-22 2010-07-01 クゥアルコム・インコーポレイテッド Shared buffer management for processing audio files
CN103220567A (en) * 2013-03-21 2013-07-24 青岛海信信芯科技有限公司 Method, system and television for playing television starting music

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100424231B1 (en) * 1999-03-08 2004-03-25 파이쓰, 인크. Data reproducing device, data reproducing method, and information terminal
US6979769B1 (en) 1999-03-08 2005-12-27 Faith, Inc. Data reproducing device, data reproducing method, and information terminal
JP2010522361A (en) * 2007-03-22 2010-07-01 クゥアルコム・インコーポレイテッド 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
JP3405181B2 (en) 2003-05-12

Similar Documents

Publication Publication Date Title
US6140566A (en) Music tone generating method by waveform synthesis with advance parameter computation
US5895877A (en) Tone generating method and device
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
US5770812A (en) Software sound source with advance synthesis of waveform
US7279628B2 (en) Editing apparatus of setting information for electronic music apparatuses
EP0752697B1 (en) Tone waveform generating method and apparatus based on software
US6754351B1 (en) Music apparatus with dynamic change of effects
JP3405181B2 (en) Musical tone generation method
KR100302626B1 (en) Sound generating device and method
JP3152198B2 (en) Music sound generation method and music sound generation device
JPH07121181A (en) Sound information processor
JP3572847B2 (en) Sound source system and method using computer software
JP3637577B2 (en) Music generation method
JP3781171B2 (en) Music generation method
JP4096952B2 (en) Music generator
JP3003559B2 (en) Music generation method
JP7159583B2 (en) Musical sound generating device, musical sound generating method, musical sound generating program, and electronic musical instrument
JP3632744B2 (en) Sound generation method
JP3278857B2 (en) Musical tone generator
JP4102931B2 (en) Sound waveform synthesizer
JP2005049497A (en) Control program of sound source circuit and controller for the circuit
JP4102930B2 (en) Sound waveform synthesizer
JP3627590B2 (en) Sound generation method

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