JP3695405B2 - Sound generator - Google Patents

Sound generator Download PDF

Info

Publication number
JP3695405B2
JP3695405B2 JP2002042750A JP2002042750A JP3695405B2 JP 3695405 B2 JP3695405 B2 JP 3695405B2 JP 2002042750 A JP2002042750 A JP 2002042750A JP 2002042750 A JP2002042750 A JP 2002042750A JP 3695405 B2 JP3695405 B2 JP 3695405B2
Authority
JP
Japan
Prior art keywords
waveform
data
waveform data
read
cpu
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
JP2002042750A
Other languages
Japanese (ja)
Other versions
JP2003241755A (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 JP2002042750A priority Critical patent/JP3695405B2/en
Publication of JP2003241755A publication Critical patent/JP2003241755A/en
Application granted granted Critical
Publication of JP3695405B2 publication Critical patent/JP3695405B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Electrophonic Musical Instruments (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、波形メモリへ制御手段がアクセスすることのできる音源装置に関するものである。
【0002】
【従来の技術】
従来より、発音しようとするピッチに応じて波形メモリから読み出した波形データに基づいて楽音を生成するようにした波形メモリ音源が知られている。このような波形メモリ音源を内蔵する従来の楽音生成装置における音源部の構成例を図9に示す。
図9において、波形メモリ121は読み書き可能なSDRAM(Synchronous DRAM)により構成されており、複数の短期間のサンプリング波形が記憶されている。音源部120では、波形メモリ121から読み出された波形データに基づいて楽音を生成している。楽音を生成する際に、楽音生成装置における図示しないCPU(Central Processing Unit)は音源制御レジスタ130に各種音源パラメータ情報を供給すると共に、発音の開始指示を出す。この音源パラメータ情報はCPUからデータバス(DATA102)を介して音源制御レジスタ130に供給され、音源制御レジスタ130においてCPUからアドレスバス(AD102)を介して与えられるアドレスで示されるレジスタに格納される。
【0003】
音源パラメータ情報は、割り当てチャンネル、波形メモリ読み出しピッチ(周波数ナンバ)、波形メモリ読み出し区間、エンベロープパラメータ、ミキサ133に対する設定情報、およびエフェクト用係数などがある。この内の波形メモリ読み出し区間パラメータは、読み出す波形データの開始アドレスASおよびそのデータ長LPAとされる。音源制御レジスタ130および読出書込回路131は、処理A、処理B、取り込み処理、補間処理、およびXアクセス処理の5つの処理を行なうことにより各チャンネルの楽音を生成している。各処理の概要は次の通りである。処理Aは、音源制御レジスタ130から供給される波形データの開始アドレスASおよびそのデータ長LPAやピッチPITCH等の情報に基づいて、楽音生成のために時分割チャンネルタイミングにしたがって各チャンネルの波形データ読出アドレスを作成する処理である。各チャンネルの波形データ読出アドレスは相対アドレスであり、読出書込回路131内の図示しないレジスタに保持される。処理Bは、読出書込回路131において実行される処理であり、時分割チャンネルタイミングとは異なるチャンネルのタイミングで、波形メモリ121に対応する絶対アドレスの波形データ読出アドレスに変換して、この波形データ読出アドレスをアドレスバス(AD101)を介して波形メモリ121に供給する処理である。
【0004】
また、取り込み処理は、読出書込回路131により実行される処理であり、処理Bにより波形メモリ121に供給された波形データ読出アドレスにしたがって読み出された波形データをデータバス(DATA101)を介して取り込み、各チャンネル別に内蔵する波形バッファに書き込む処理である。補間処理は、読出書込回路131における図示しない補間回路により実行される処理であり、時分割チャンネルタイミングにしたがって、波形バッファから各チャンネルの波形サンプルを読み出し、補間を行なって各チャンネルの波形データを生成して時分割で出力する処理である。補間された波形データは、読出書込回路131からEG付与回路132に供給される。
【0005】
Xアクセス処理は、音源制御レジスタ130に内蔵されているXアクセス回路140の制御の基で実行される処理であり、前述した処理Bや取り込み処理において処理を行うタイムスロットが空いた際に、そのタイムスロットで、CPUが波形メモリ121から波形データを読出/書込する処理、および、ミキサ133から出力されたミキシングされた波形データを波形メモリ121へ書き込む処理である。CPUが波形メモリ121から波形データを読み出すXアクセス処理の際には、CPUはXアクセス回路140に内蔵されたXAレジスタ142を指定するアドレスをアドレスバス(AD102)へ出力して、XAレジスタ142にデータバス(DATA102)へ出力した波形データ読出アドレスを書き込む。読出書込回路131は、処理Bや取り込み処理において空いたタイムスロットを使用して、波形メモリ121にXAレジスタ142に書き込まれた波形データ読出アドレスをアドレスバス(AD101)を介して供給する。この際に、読出書込回路131は、リードイネーブル信号も波形メモリ121に供給する。
【0006】
これにより波形メモリ121から供給されたアドレスに従ってデータバス(DATA101)上に波形データが読み出される。この波形データは、読出書込回路131を介してXアクセス回路140に内蔵されているFIFO(First In First Out)141に書き込まれる。FIFO141は先入れ先出し方式のバッファメモリである。CPUは読み出された波形データがFIFO141に所定量書き込まれた際に、CPUの動作タイミングでFIFO141を指定するアドレスをアドレスバス(AD102)へ出力して、FIFO141からその波形データをデータバス(DATA102)を介して読み出す。
【0007】
また、CPUはXアクセス回路140へ読み出す波形データの開始アドレスとデータ長の情報を供給し、Xアクセス回路140は波形メモリ121からデータを読み出す毎に開始アドレスからデータ長に対応するまで順次アドレスをインクリメントして連続する波形データ読出アドレスを発生する。この波形データ読出アドレスは内蔵するXAレジスタ142に書き込まれ、最終的に波形メモリ121に供給される。これにより、連続するアドレス位置に書き込まれている所定サンプル数の波形データを順次読み出してFIFO141に順次格納することができるようになる。FIFO141に格納された波形データは書き込まれるタイミングと異なるCPUの動作タイミングで、CPUによりFIFO141から順次読み出される。
【0008】
また、ミキサ133から出力される波形データを波形メモリ121へ書き込むXアクセス処理の際には、ミキサ133から出力される波形データがFIFO141に書き込まれる。CPUはXアクセス回路140に内蔵されたXAレジスタ142に波形データ書込アドレス(先頭アドレス)を書き込む。読出書込回路131は、処理Bや取り込み処理において空いたタイムスロットを使用して、アドレスバス(AD101)を介して波形メモリ121にXAレジスタ142に書き込まれた波形データ書込アドレスを供給する。同時にFIFO141から読み出された波形データが読出書込回路131を介してデータバス(DATA101)に出力されて、波形メモリ121に供給される。さらに、読出書込回路131から波形メモリ121へライトイネーブル信号が供給される。これにより、波形メモリ121へ波形データが書き込まれるようになる。
【0009】
なお、CPUはXアクセス回路140へ書込アドレスの開始アドレスと波形データのデータ長の情報を供給し、Xアクセス回路140は波形データを書き込む毎に開始アドレスからデータ長に対応するまで順次アドレスをインクリメントして連続する波形データ書込アドレスを発生する。この波形データ書込アドレスは内蔵するXAレジスタ142に書き込まれ、最終的に波形メモリ121に供給される。これにより、ミキサ133からFIFO141に書き込まれた所定サンプル数の波形データを波形メモリ121の連続するアドレス位置に書き込むことができるようになる。この場合、FIFO141には、その空き状態に関わらず、ミキサ133からサンプリング周期ごとに1サンプルずつ順次波形データが書き込まれる。FIFO141から波形メモリ121への書き込み速度は、最悪でもサンプリング周期ごとに1サンプル以上とされているので、FIFOが満杯になることはない。一方、CPUから波形データを波形メモリ121へ書き込むXアクセス処理の際には、CPUはFIFO141の空き状態を確認し、空きがある場合のみFIFO141へ波形データを書き込むようになっている。
【0010】
読出書込回路131から時分割で出力される各チャンネルの波形データは、EG付与回路132においてエンベロープが付与される。付与されるエンベロープは、CPUから与えられて音源制御レジスタ130に格納されている各チャンネルのエンベロープパラメータに基づいて決定される。
エンベロープが付与された、例えば32チャンネル分の波形データはミキサ133に供給される。さらに、ミキサ133には信号処理回路(DSP)134から出力されるエフェクト処理等がされた、例えば8チャンネル分の波形データ、および外部回路122からフィルタ処理やエフェクト処理等がされた、例えば8チャンネル分の波形データが供給されている。ミキサ133は、これらの供給された各チャンネルの波形データにそれぞれ係数値を乗算してミキシングする。
【0011】
係数値はCPUから音源制御レジスタ130に音源パラメータとして与えられて、内蔵するレジスタに格納されている。ミキサ133においてミキシングされた波形データは、8チャンネル分がDSP134に、8チャンネル分が外部回路122に、1チャンネル分が音源制御レジスタ130内のXアクセス回路140に、音源部120の最終的な出力となる2チャンネル(LおよびR出力)分がDAC123に、それぞれ出力されるようになされている。このように、ミキサ133はCPUから指定されたチャンネルの波形データに指定された係数値を乗算してミキシングし、そのミキシング結果をCPUの指定に基づく出力部へ指定されたチャンネルで送出するようにしている。
【0012】
【発明が解決しようとする課題】
ところで、音源部120においてCPU側から波形データを扱うために、音源部120にコーデック機能を持たせることが考えられる。この場合、音源部はDACにおけるDAC周期を基準として動作しているが、CPUはDAC周期とは直接関係しない動作タイミングで動作していることから、コーデック機能を持たせるためにはバッファを増設しなければならないという問題点があった。
【0013】
そこで本発明は、もともとCPUによる波形メモリアクセス用に用意されていた回路を活用して、少ない回路の増設によりコーデック機能を有させることのできる音源装置を提供することを目的としている。
【0014】
【課題を解決するための手段】
上記目的を達成するため、本発明にかかる第1の音源装置は、波形データが読み書き可能な波形メモリと、該波形メモリから波形データを読み出し、読み出した波形データに基づいて周期がサンプリング周期とされている楽音波形データを生成する楽音生成手段と、前記楽音生成手段の生成した楽音波形データを含む波形データが入力され、ミキシング処理を行って、周期がサンプリング周期とされている混合された波形データを出力するミキシング手段と、前記楽音生成手段および前記ミキシング手段の動作を制御する制御手段と、前記楽音生成手段が前記波形メモリをアクセスしていない時間において、前記制御手段の制御の基で、前記波形メモリの波形データの連続的な読み出しあるいは書き込みのアクセスを行うとともに、前記ミキシング手段からサンプリング周期ごとに入力する波形データを前記制御手段へ受け渡しするアクセス手段と、該アクセス手段に内蔵されている記憶手段とを備え、前記アクセス手段は、前記記憶手段の第1領域を、前記制御手段の制御の基で行われる前記波形メモリの読み出し時に読み出された波形データを前記制御手段に受け渡しするために一時的に記憶するバッファ、および、書き込み時の波形データを前記波形メモリに受け渡しするために一時的に記憶するバッファとして使用するとともに、前記記憶手段の第2領域を、前記ミキシング手段から入力する波形データを前記制御手段に受け渡しするために一時的に記憶するバッファとして使用可能とされている。
【0015】
次に、上記目的を達成することのできる本発明にかかる第2の音源装置は、波形データが読み書き可能な波形メモリと、
該波形メモリから波形データを読み出し、読み出した波形データに基づいて周期がサンプリング周期とされている楽音波形データを生成する楽音生成手段と、前記楽音生成手段の生成した楽音波形データを含む波形データが入力され、ミキシング処理を行って、周期がサンプリング周期とされている混合された波形データを出力するミキシング手段と、前記楽音生成手段および前記ミキシング手段の動作を制御する制御手段と、前記楽音生成手段が前記波形メモリをアクセスしていない時間において、前記制御手段の制御の基で、前記波形メモリの波形データの連続的な読み出しあるいは書き込みのアクセスを行うとともに、前記制御手段から順次入力される波形データをサンプリング周期ごとに前記ミキシング手段へ出力するアクセス手段と、該アクセス手段に内蔵されている記憶手段とを備え、前記アクセス手段は、前記記憶手段の第1領域を、前記制御手段の制御の基で行われる前記波形メモリの読み出し時に読み出された波形データを前記制御手段に受け渡しするために一時的に記憶するバッファ、および、書き込み時の波形データを前記波形メモリに受け渡しするために一時的に記憶するバッファとして使用するとともに、該記憶手段の第2領域を、前記制御手段から前記ミキシング手段に入力される波形データを一時的に記憶するバッファとして使用可能とされている。
【0016】
また、上記本発明の第1および第2の音源装置において、前記記憶手段における前記第1領域のサイズと前記第2領域のサイズとを、ユーザの指示あるいは動作状況に応じてそれぞれ変更可能とされていてもよい。
また、上記本発明の第1および第2の音源装置において、さらに、前記第1領域および前記第2領域であるバッファにおける波形データの状態を検出し、前記制御手段に対してデータ受取あるいはデータ供給の要求を発生する検出手段と、該検出手段における検出条件を変更する条件変更手段とを有し、前記制御手段は、該データ受取あるいはデータ供給の要求に応じて、該要求に対応する領域であるバッファからのデータ受取あるいは該バッファへのデータ供給を実行するようにしてもよい。
【0021】
このような本発明によれば、制御手段の制御の基で、波形メモリへのアクセスを行うアクセス手段に内蔵された記憶手段が、波形メモリへの波形データの書き込みや、波形メモリからの波形データの読み出しを行う際に波形データを一次記憶するバッファと、制御手段が波形データを扱うために一次記憶するコーデック用のバッファとに分割されている。これにより、バッファを増設することなくコーデック機能を音源装置に有させることができるようになる。この場合、分割されて構成された各バッファにおいては制御手段への割込条件やデータ要求発生条件を変更できるようにされているので、記憶手段を分割してバッファを構成するようにしても、効率よく各バッファを使用することができるようになる。
【0022】
【発明の実施の形態】
本発明の実施の形態にかかる波形メモリを備えている音源装置を有する楽音生成装置の構成例を示すブロック図を図1に示す。
図1に示す楽音生成装置1おいて、CPU10は各種プログラムを実行することにより楽音生成装置1における楽音生成の動作を制御する中央処理装置(Central Processing Unit)であり、タイマ11は動作時の経過時間を示したり、特定の間隔でタイマ割込を発生するタイマであり、自動演奏の時間管理等に使用される。ROM12は、CPU10が実行する楽音生成処理のプログラムや、各種データが格納されているROM(Read Only Memory)である。RAM13は楽音生成装置1におけるメインメモリであり、CPU10のワークエリア等が設定されるRAM(Random Access Memory)である。
【0023】
また、ディスク14はハードディスク、フロッピーディスク、リムーバブルディスク等の記録媒体であり、波形メモリ21にロードする波形データなどが格納されている。ドライブ15はセットされたディスク14の読出/書込を行うディスクドライブである。MIDIインタフェース16は、楽音生成装置1内部で作成したMIDIメッセージを外部へ送出したり、外部からのMIDIメッセージを受信するMIDIインターフェースである。ネットワークインタフェース17は、LAN(Local Area Network )やインターネット、電話回線等の通信ネットワークを介してサーバコンピュータに接続するためのネットワークインターフェースである。パネルスイッチ(パネルSW)18は、楽音生成装置1のパネルに設けられている各種スイッチであり、これを操作することにより楽音生成装置1に各種指示を与えることができる。パネル表示器19は、楽音生成時に各種情報が表示されるディスプレイである。
【0024】
音源部20は、CPU10からの発音開始指示に基づいて、波形メモリ21から波形データ(波形サンプル)を読み出し、補間、エンベロープ付与、チャンネル累算(ミキシング)、および効果(エフェクト)付与などの処理を行って、楽音波形データとして出力している。音源部20から出力された楽音波形データは、DAC23によりアナログ信号に変換され、サウンドシステム24により放音される。波形メモリ21は、SDRAM等の高速のメモリにより構成されており、所定のレートでサンプリングされた多数の波形サンプルデータが格納されている。1ワードの波形サンプルは、例えば16ビットあるいは32ビットで表され、アドレスは波形サンプル単位に付けられている。すなわち、1アクセスで1つの波形サンプルを読み出すようにしている。波形メモリ21には、楽音の生成に先立ってディスク14等から読み出された波形データが格納されている。
【0025】
外部回路22は、外部から音声や楽音等のオーディオデータを取り込むためのアナログ・ディジタル変換器(ADC)、効果(エフェクト)付与処理を行なう外部DSP、あるいはディジタルフィルタなどで構成される。音源部20から外部回路22へ供給された波形データには、外部回路22においてエフェクト付与処理やディジタルフィルタ処理が施されて、音源部20へ戻される。音源部20においては、戻された波形データが他のチャンネルの波形データにミキシングされて出力されるようになる。なお、外部回路22は楽音生成装置1に内蔵してもよいし、楽音生成装置1の外部に設けてもよい。ディジタル・アナログ変換器(DAC)23は、音源部20から最終的に出力されるステレオの楽音データをディジタルの楽音信号に変換してサウンドシステムから放音している。また、バス25はアドレスバス、コントロールバス、データバスの各バスを備える前記した各部を相互接続しているCPUバスである。
【0026】
次に、本発明の実施の形態にかかる波形メモリを備えている音源装置である音源部20の詳細構成を図2に示し、図3に音源部20における動作タイミングを示す。この音源部20において発音チャンネル数が128チャンネルとされている場合は、音源部20は時分割128チャンネルで動作する。このため、音源部20内の各部には、時分割を行なうための基準信号となる制御クロック信号やチャンネルカウント値などの制御信号が供給されている。
図2において、波形メモリ21は読み書き可能な、例えばSDRAM(Synchronous DRAM)により構成されており、音源部20において楽音を生成する際には予めディスク14等から読み出した複数の比較的短期間のサンプリング波形が記憶されている。音源部20では、この波形メモリ21からチャンネル毎に時分割で読み出された波形データに基づいて各チャンネルの楽音を生成している。
【0027】
ノートオンに応じて楽音を発生する際に、楽音生成装置1におけるCPU10は、前記128チャンネルから該ノートオンに応じた楽音生成に使用するチャンネル(割り当てチャンネル)を選択し、音源制御レジスタ30の割り当てチャンネルに対応する記憶領域に各種音源パラメータを設定し、選択されたチャンネルの発音の開始指示を出す。この音源制御レジスタ30にはCPU10からアドレスバス(AD4)を介してアドレスが供給されると共に、データバス(DATA4)を介して各種データのやりとりが行われる。図2においては、データバス(DATA4)が複数本示されているが、説明の便宜上複数本として示しているだけであり、実際には1本のバスとされている。上記した音源パラメータ情報はCPU10からデータバス(DATA4)を介して音源制御レジスタ30に供給され、音源制御レジスタ30においてCPU10からアドレスバス(AD4)を介して与えられるレジスタアドレスで示されるレジスタに格納される。
【0028】
発音開始指示と共に音源制御レジスタ30に供給される音源パラメータ情報は、波形メモリ読み出し速度(楽音ピッチに対応)、波形メモリ読み出し区間、エンベロープパラメータ、ミキサ33に対する設定情報、およびエフェクト用係数等とされる。この内の波形メモリ読み出し区間パラメータは、読み出す波形データの開始アドレスASおよびそのデータ長LPAとされる。この場合、アドレスバス(AD4)上のレジスタアドレスで示される音源制御レジスタ30内の特定のレジスタに、データバス(DATA4)を介して供給される音源パラメータが格納される。これにより、複数のそれぞれのレジスタに対応する音源パラメータがそれぞれ格納されていくようになる。
【0029】
音源制御レジスタ30および読出書込回路31は、処理A、処理B、取り込み処理、および補間処理、Xアクセス処理、およびコーデック入出力処理の6つの処理を行なう。各処理の概要および処理タイミングは次の通りである。処理Aは、音源制御レジスタ30から供給される波形データの開始アドレスASおよびそのデータ長LPAやピッチPITCH等の情報に基づいて、楽音生成のために時分割チャンネルタイミングにしたがって各発音チャンネルの波形データ読出アドレスを作成する処理である。各チャンネルのアドレスは、読出書込回路31内の図示しないレジスタに保持される。発音チャンネル数が128チャンネルとされている場合は、処理AはDAC23における1DAC周期内において128チャンネル分の波形データ読出アドレスを作成する。なお、後述するように、本発明にかかる楽音生成装置1では、ミキサ33から出力される波形データを波形メモリ21に書き込むための書込チャンネルとして、この128チャンネルのうちの最後の16チャンネルを転用することが可能である。
【0030】
この場合、図3に示すように1DAC周期は前半と後半とに2分割されて、前半の期間では1ch〜64chの波形データ読出アドレスが作成され(処理A前半ch)、後半の期間では65ch〜128chの波形データ読出アドレスが作成される(処理A後半ch)。処理Aでは、全チャンネルについて読出アドレスの生成を行ない、かつ、各チャンネルの読出アドレスの整数部の進行量に応じて波形データを読み出すべきチャンネルを決定し、決定されたチャンネルのチャンネル番号とそのチャンネルでの読み出すべきサンプル数(前記進行量に対応)を制御RAMに格納する。なお、補間処理における4点補間では連続する4サンプルの波形データが必要になるが、そのうちの過去に波形メモリ21から読み出された波形データは波形バッファに既に保存されている。なお、1ch〜128chの各チャンネルの処理を行うタイムスロットは1DAC周期を等分割して与えられる。すなわち、処理Aにおける各チャネルに割り当てられるタイムスロットは1DAC周期をTとするとT/128とされ、このタイムスロットにおいて図示するようにチャンネル順に処理される。
【0031】
処理Bは、読出書込回路31において処理Aよりほぼ1/2DAC周期だけ遅れて実行される処理であり、後述するタイミングで処理Aが終了したチャンネルについて行われる。処理Bは、制御RAMに読み出すべきチャンネルとして記憶されているチャンネルについて、当該チャンネルの読出アドレスに基づいて制御RAMに記憶されているアクセス回数だけ波形メモリをアクセスし、該回数分の波形サンプルを読み出している。この場合、図3に示すように1DAC周期の前半の期間では1ch〜64chについての波形メモリ21からの読み出しが実行され(処理B前半ch)、後半の期間では65ch〜128chについての波形メモリ21からの読み出しが実行される(処理B後半ch)。この場合、処理Aにおいて、波形データを読み出すべきチャンネルとしてチャンネル番号が制御RAMに格納されなかったチャンネルについては、処理Bの処理は行われない。処理Bが行われるタイムスロットは処理Aの1タイムスロットの1/4とされ、1DAC周期をTとするとT/512とされる。1DAC周期ごとに512回ということは、音源の1チャンネル当たり4サンプルの波形データを読み出すことができることを意味している。
【0032】
そして、処理Aにおいて記憶されたアクセス回数が複数であったチャンネル(すなわち、読出アドレスの整数部が複数進行したチャンネル)については、それぞれの波形データ読出アドレスに対する処理Bが該アクセス回数に対応したタイムスロット数ずつ順次実行されるようになる。例えば、図3の処理Bに示すように1chについては処理Bが1タイムスロットで行われ、2chについては処理Bは行われず、3chについては処理Bが3タイムスロットで行われ、4chについては処理Bは行われず、5chについては処理Bが1タイムスロットで行われ、6chについては処理Bは行われず、7chについては処理Bが2タイムスロットで行われ、発音されていない8ch〜64chについては処理Bは行われないようになる。なお、書込チャンネルとして設定されたチャンネルについては、処理Bにおいて、波形データ書込アドレスが生成される。この書込チャンネルのアクセス回数は、それぞれ、常に1回とされる。
【0033】
このように、処理Bが行われないチャンネルがあることから処理Bの前半期間においては7chの処理が終了してから後半期間が始まるまでのタイムスロットが空くようになると共に、後半期間においても後には次の前半期間が始まるまでにタイムスロットに空きが生じるようになる。そこで、この空いたタイムスロットを使用してXアクセス回路40によるXアクセス処理が行われるようになる。なお、処理Bにおいてタイムスロットが空くまでは読出書込回路31がセレクタ制御信号(CONT1)をセレクタ35に与えて、セレクタ35を読出書込回路31側へ切り換える。これにより、読出書込回路31からアドレスバス(AD2)を介して波形データ読出アドレスを波形メモリ21へ供給することができるようになる。また、処理Bにおいてタイムスロットに空きが生じるようになると、読出書込回路31がセレクタ制御信号(CONT1)によりセレクタ35をXアクセス回路40側へ切り換える。さらに、読出書込回路31はセレクタ制御信号(CONT2)をXアクセス回路40へ与えて後述するXアクセス処理を実行できるようにする。
【0034】
また、取り込み処理は、読出書込回路31により実行される処理であり、処理Bにより波形メモリ21に供給された波形データ読出アドレスにしたがって読み出された波形データをデータバス(DATA1)を介して取り込み、各チャンネル別に内蔵する波形バッファに書き込む処理である。この波形バッファは、サンプル間補間用の波形データを記憶するバッファであり、各チャンネルごとに波形メモリ21から読み出された最新の波形データを4サンプル分記憶する。処理Bにおいて波形データ読出アドレスが波形メモリ21に供給されると、波形メモリ21から直ちに波形データが読み出されることから、取り込み処理は、図3に示すように処理Bからわずか遅れて開始されるようになる。この場合、1つの波形データ読出アドレスで1つの波形サンプルが読み出されることから、図3の取り込み処理に示すように1chについては波形データが1サンプル分取り込まれ、2chについては波形データは取り込まれず、3chについては波形データが3サンプル分取り込まれ、4chについては波形データは取り込まれず、5chについては波形データが1サンプル分取り込まれ、6chについては波形データは取り込まれず、7chについて波形データが2サンプル分取り込まれ、8ch〜64chについては波形データは取り込まれないようになる。なお、書込チャンネルとして設定されたチャンネルについては、この取り込み処理の代わりに、前記波形メモリ書込アドレスに対し、ミキサ33から1DAC周期ごとに1サンプルずつ供給される波形データを書き込む書込処理が行われる。
【0035】
このように、波形データが取り込まれないチャンネルがあることから取り込み処理の前半期間においては7chの処理が終了してから後半期間が始まるまでのタイムスロットが空くようになると共に、後半期間においても後には次の前半期間が始まるまでのタイムスロットに空きが生じるようになる。そこで、この空いたタイムスロットを後述するXアクセス処理を行うXアクセス回路40が波形メモリ21にアクセスする際のタイムスロットとして割り当てるようにする。なお、取り込み処理における1タイムスロットは処理Bの1タイムスロットと同様とされ、1DAC周期をTとするとT/512とされる。なお、取り込み処理においてタイムスロットが空くまでは読出書込回路31がセレクタ制御信号(CONT1)をセレクタ35に与えて、セレクタ35を読出書込回路31側へ切り換える。これにより、波形メモリ21から読み出した波形データをデータバス(DATA1)、セレクタ35およびデータバス(DATA2)を介して読出書込回路31の波形バッファに取り込むことができるようになる。また、取り込み処理においてタイムスロットに空きが生じるようになると、読出書込回路31がセレクタ制御信号(CONT1)によりセレクタ35をXアクセス回路40側へ切り換える。さらに、読出書込回路31はセレクタ制御信号(CONT2)をXアクセス回路40へ与えて後述するXアクセス処理を実行できるようにする。
【0036】
補間処理は、読出書込回路31における図示しない補間回路により実行される処理であり、時分割チャンネルタイミングにしたがって、波形バッファから各チャンネルの必要とする波形サンプルを読み出し、2点補間や4点補間を行なった波形データを出力する処理である。この場合、波形バッファには取り込み処理により取り込まれた波形データが格納されていることから、補間処理は取り込み処理より若干遅れて開始されるようになる。補間された波形データは、読出書込回路31からEG付与回路32に供給される。この場合、図3に示すように1DAC周期の前半の期間では1ch〜64chの補間処理が行われ(補間前半ch)、後半の期間では65ch〜128chの補間処理が行われる(補間後半ch)。なお、1ch〜128chの各チャンネルの補間処理時間は1DAC周期を等分割して与えられる。すなわち、補間処理における各チャネルに割り当てられるタイムスロットは1DAC周期をTとするとT/128とされ、このタイムスロットにおいて図示するようにチャンネル順に処理される。
【0037】
Xアクセス処理は、音源制御レジスタ30内に設けられているXアクセス回路40の制御の基で実行される処理である。このXアクセス処理は、前述した処理Bや取り込み処理において処理を行うタイムスロットが空いた際に、そのタイムスロットで、CPU10が波形メモリ21から波形データを読出/書込する処理である。この際には、読出書込回路31から制御信号(CONT2)がXアクセス回路40に供給されることにより上記したタイムスロットにおいて実行可能となる。さらに、セレクタ35が制御信号(CONT1)によりXアクセス回路40側へ切り換えられて、アドレスバス(AD3)とデータバス(DATA3)が波形メモリ21へ接続されるようになる。
【0038】
CPU10が波形メモリ21から波形データを読み出すXアクセス処理を実行する際には、CPU10はXアクセス回路40に内蔵されたXAレジスタ42を指定するアドレスをアドレスバス(AD4)へ出力して、XAレジスタ42にデータバス(DATA4)へ出力した波形データ読出アドレスの先頭アドレスを書き込むとともに、図示しないデータ長レジスタにデータ長を書き込む。読出書込回路31は、処理Bや取り込み処理においてタイムスロットが空くと、制御信号(CONT1)をセレクタ35に供給して切り換え、波形メモリ21にXAレジスタ42に書き込まれた波形データ読出アドレスをアドレスバス(AD3)、セレクタ35およびアドレスバス(AD1)を介して供給する。この際に、読出書込回路31は、リードイネーブル信号も波形メモリ21に供給する。
【0039】
これにより、供給されたアドレスに従ってデータバス(DATA1)上に波形メモリ21から波形データが読み出される。この波形データは、セレクタ35およびデータバス(DATA3)を介してXアクセス回路40に内蔵されているFIFO41のCPUアクセス用領域41aに書き込まれる。後述するようにFIFO41には3つの領域が設定されるが、それぞれ、先入れ先出し方式のバッファメモリとして使用され、3つの領域の記憶容量の合計は512ワードとされている。波形メモリ21から読み出された波形データがFIFO41のCPUアクセス領域41aに書き込まれた後、CPU10は、DAC周期とは独立した独自のタイミングでFIFO41を指定するアドレスをアドレスバス(AD4)へ出力して、FIFO41のCPUアクセス領域41aからデータバス(DATA4)を介して波形データを読み出す。
【0040】
また、CPU10はXアクセス回路40へ読み出す波形データの先頭アドレスとデータ長の情報を供給し、Xアクセス回路40は波形メモリ21からデータを読み出す毎に先頭アドレスからデータ長に対応するまで順次アドレスをインクリメントして連続する波形データ読出アドレスを発生する。この波形データ読出アドレスは内蔵するXAレジスタ42に書き込まれ、最終的に波形メモリ21に供給される。これにより、連続するアドレス位置に書き込まれている所定サンプル数の波形データを順次読み出してFIFO41に順次格納することができるようになる。FIFO41に格納された波形データは書き込まれるタイミングと異なるCPU10の動作タイミングにより読み出されてCPU10に取り込まれる。
【0041】
また、波形メモリ21へ波形データを書き込むXアクセス処理の際には、CPU10はXアクセス回路40に内蔵されたXAレジスタ42を指定するアドレスをアドレスバス(AD4)へ出力して、XAレジスタ42にデータバス(DATA4)へ出力した波形データ書込アドレスの先頭アドレスを書き込む。さらに、CPU10はXアクセス回路40に内蔵されたFIFO41のCPUアクセス領域41aを指定するアドレスをアドレスバス(AD4)へ出力して、波形メモリ21へ書き込まれる波形データをFIFO41のCPUアクセス領域41aに所定量だけ書き込むとともに、図示しないデータ長レジスタにデータ長を書き込む。読出書込回路31は、処理Bや取り込み処理においてタイムスロットが空くと、制御信号(CONT1)をセレクタ35に供給して切り換え、波形メモリ21にXAレジスタ42に書き込まれた波形データ書込アドレスをアドレスバス(AD3)、セレクタ35およびアドレスバス(AD1)を介して供給する。同時に、FIFO41から波形データを読み出してデータバス(DATA3)、セレクタ35およびデータバス(DATA1)を介して波形メモリ21に供給する。この際に、読出書込回路31は、ライトイネーブル信号も波形メモリ21に供給する。これにより、供給された書込アドレスにしたがって、波形メモリ21へ供給された波形データが書き込まれるようになる。
【0042】
なお、CPU10はXアクセス回路40へ書込アドレスの先頭アドレスと波形データのデータ長の情報を供給し、Xアクセス回路40は波形データを書き込む毎に開始アドレスからデータ長に対応するまで順次アドレスをインクリメントして連続する波形データ書込アドレスを発生する。この波形データ書込アドレスは内蔵するXAレジスタ42に書き込まれ、最終的に波形メモリ21に供給される。これにより、FIFO41のCPUアクセス領域41aに所定量ずつ書き込まれた所定サンプル数の波形データを波形メモリ21の連続するアドレス位置に書き込むことができるようになる。この場合、FIFO41のCPUアクセス領域41aにおける空き状態に応じてCPU10に割込要求が発生し、FIFO41のCPUアクセス領域41aにCPU10から順次波形データが書き込まれるようになる。
【0043】
なお、Xアクセス処理においてXAレジスタ42は2個のレジスタを備え、それぞれのレジスタに2系統のアドレスを格納することができる。この2系統のアドレスはステレオのLチャンネル用とRチャンネル用とされ、その先頭アドレスはCPU10から供給される。例えば、Xアクセス処理により波形メモリ21からステレオの波形データをCPU10が取り込む場合は、XAレジスタ42に格納されたLチャンネル用のアドレスとRチャンネル用のアドレスとが時分割されて交互に波形メモリ21に供給される。これにより、波形メモリ21からステレオのLデータとRデータとが交互に読み出されるようになる。このLデータとRデータとが、FIFO41にインターリーブされて交互に書き込まれるようになる。CPU10はFIFO41に書き込まれたインターリーブされて格納されているLデータとRデータとを読み出して取り込めばよい。Xアクセス処理によりCPU10が波形メモリ21からステレオの波形データを読み込む際、Xアクセス回路40によって波形メモリ21から波形メモリ21の個別の領域に記録されたLチャンネルの波形データとRチャンネルの波形データが自動的にインターリーブされる。また、Xアクセス処理によりCPU10がステレオの波形データを波形メモリ21に書き込む際も同様に、XAレジスタ42に格納されたLチャンネル用のアドレスとRチャンネル用のアドレスが交互に波形メモリ21に供給され、CPU10からのインターリーブされた波形データがLチャンネルの波形データとRチャンネルの波形データに分離されて波形メモリ21の異なる領域に書き込まれる。このように、CPU10がステレオ波形データのインターリーブやその解除を行う必要がなく、CPU10の負荷が軽減される。
【0044】
ここで、ミキサ31から出力される波形データを、読出書込回路31により波形メモリ21へ書き込む処理について説明する。CPU10は、読出書込回路31の最後の16チャンネルから書き込みに使用するチャンネルを選択し、音源制御レジスタ30にそのチャンネルを書込チャンネルとするための設定を行うとともに、ミキサ31でミキシングした波形データから1つの波形データを選択し、当該書込チャンネルに供給するための設定を行う。さらに、CPU10は、音源制御レジスタ30の該チャンネルの開始アドレスASに波形データ書込アドレス(先頭アドレス)、データ長LPAに書き込むデータ長をそれぞれ設定し、書き込み処理の開始を指示する。
【0045】
読出書込回路31は、処理Bの書込チャンネルに対応したタイムスロットで、アドレスバス(AD2)、セレクタ35およびアドレスバス(AD1)を介して波形メモリ21に当該書込チャンネルのアドレスカウンタに格納されている波形データ書込アドレスを供給する。同時にミキサ33から当該書込チャンネルに供給されている波形データを、データバス(DATA2)、セレクタ35およびデータバス(DATA1)を介して波形メモリ21に供給する。さらに、読出書込回路31から波形メモリ21へライトイネーブル信号が供給される。これにより、波形メモリ21へ波形データが書き込まれるようになる。
ところで、書込チャンネルのアドレスカウンタには、書き込み開始時に先頭アドレスASに設定された先頭アドレスがロードされる。該アドレスカウンタのカウント値は、当該書込チャンネルの書き込みが行われる毎にデータ長LPAに設定されたデータ長に対応するまで順次アドレスがインクリメントされ、連続する波形データ書込アドレスとなる。この波形データ書込アドレスが波形メモリ21に供給され、波形メモリ21の当該アドレスの示す記憶位置にミキサ33から供給される波形データが書き込まれるようになる。
【0046】
次に、読出書込回路31から時分割で出力される各チャンネルの補間された波形データは、EG付与回路32においてエンベロープが付与される。付与されるエンベロープは、CPU10から与えられて音源制御レジスタ30のレジスタに格納されている各チャンネルのエンベロープパラメータに基づいて決定される。エンベロープが付与された、例えば128チャンネル分の波形データはミキサ33に供給される。さらに、ミキサ33には信号処理回路(DSP)34から出力されるエフェクト処理等がされた、例えば8チャンネル分の波形データ、および外部回路22からフィルタ処理やエフェクト処理等がされた、例えば8チャンネル分の波形データが供給されている。ミキサ33は、これらの供給された各チャンネルの波形データにそれぞれ係数値を乗算してミキシングする。係数値はCPU10から音源制御レジスタ30に与えられて、内蔵するレジスタに格納されている。ミキサ33においてミキシングされた波形データは、8チャンネル分がDSP34に、8チャンネル分が外部回路22に、音源部20の最終的な出力となる2チャンネル(LおよびR出力)分がDAC23に、それぞれ出力されるようになされている。そして、DAC23によりアナログ信号に変換された楽音信号はサウンドシステム24から放音されるようになる。このように、ミキサ33はCPU10から指定されたチャンネルの波形データに指定された係数値を乗算してミキシングし、そのミキシング結果をCPU10の指定に基づく出力部へ指定されたチャンネルで送出するようにしている。
【0047】
次に、コーデック入出力処理を説明するが、ここでいうコーデックとは、CPU10が、音源部20に対しDAC周期で波形データを供給したり、音源部20からDAC周期で出力される波形データを受け取ったりするためのコーデック入出力機能を意味している。このコーデック入出力機能により、CPU10から直接に波形データを入出力することができるようになる。コーデック入出力処理においては、DAC周期を基準として動作する音源部20と、これとは異なる動作タイミングで動作しているCPU10との間で波形データの受け渡しが行われるため、波形バッファが必要になる。この波形バッファとしてFIFO41を用いるため、FIFO41は図6(c)に示すように3分割されている。例えば、FIFO41の約1/2が前述したXアクセス処理を行う際の波形バッファとして割り当てられ、この領域をCPUアクセス用領域41aというものとする。そして、残る領域の内の約1/2(全体の約1/4)ずつを出力コーデック用領域41cと入力コーデック用領域41bとして割り当てる。
【0048】
コーデック入出力処理では、例えば、外部回路22としてAD変換器を接続し、該AD変換器で入力波形をディジタルの波形データに変換してミキサ33に入力されている場合、入力コーデック機能によりその波形データ(ストリームデータ)をCPU10が取り込んで録音することができる。この場合、1DAC周期毎に、AD変換器から入力される波形データが、ミキサ33を介して音源制御レジスタ30に内蔵されているFIFO41の入力コーデック領域41bに書き込まれる。FIFO41の入力コーデック用領域41bに所定量の波形データが書き込まれると、CPU10にデータ読出要求が通知されCPU10はFIFO41の入力コーデック用領域41bから波形データを読み出して、RAM13に書き込むようにする。これにより、外部回路22から入力されたオーディオ信号をCPU10が取り込んで録音できるようになる。なお、CPU10の代わりにDMA(Direct Memory Access)コントローラがFIFO41の入力コーデック用領域41bから波形データを読み出して、RAM13に直接書き込むようにしてもよい。この場合は、CPU10に余り負担をかけずに、波形データの転送を行うことができる。
【0049】
また、コーデック入出力処理では、RAM13に格納されている波形データ(ストリームデータ)を、CPU10が取り出して再生すること(出力コーデック)ができる。この処理は、RAM13から読み出された波形データが音源制御レジスタ30に内蔵されているFIFO41の出力コーデック用領域41cに、該領域41cからデータがあふれないようにCPU10のタイミングで波形データを書き込む。FIFO41の出力コーデック用領域41cに書き込まれた波形データは、1DAC周期ごとに1サンプルずつ、順次ミキサ33にミキサ入力として入力される。例えば、ミキサ33において該波形データをDSP34に供給するよう設定されている場合には、DSP34において該波形データに対してエフェクト処理を施すことができる。
【0050】
この波形データはミキサ33において生成された楽音データにミキシングされて、DAC23に供給され楽音信号と共に放音されるようになる。この場合、FIFO41の出力コーデック用領域41cに書き込まれた波形データが所定量以下となった場合は、CPU10にデータ書込要求が通知されて、CPU10はRAM13から出力コーデック領域41cの空き容量に対応する量の波形データを読み出して、FIFO41の出力コーデック用領域41cに書き込むようにする。これにより、RAM13に格納されている波形データをCPU10が取り出して再生することができるようになる。なお、CPU10の代わりにDMA(Direct Memory Access)コントローラがRAM13からストリームデータを読み出して、FIFO41の出力コーデック用領域41cに直接書き込むようにしてもよい。この場合は、CPU10に余り負担をかけずに、波形データの転送を行うことができる。
【0051】
ところで、図2に示す音源部20におけるFIFO41は図6(c)に示すように分割して使用しなければならないものではない。すなわち、図6(a)に示すようにFIFO41の全体をCPUアクセス用領域41aとして割り当てるようにしても良いし、図6(b)に示すようにFIFO41の3/4をCPUアクセス用領域41aとして割り当て、残る1/4を出力コーデック用領域41cとして割り当てるようにしても良い。後述するように、各領域の位置およびサイズはFIFO制御レジスタ44の分割データにより制御されている。この設定は、ユーザからの指示や楽音生成装置1の動作状況に応じて随時変更すると良い。例えば、入出力コーデック機能を全く使用していないときは図6(a)のように設定する。また、Xアクセス機能と出力コーデック機能を使用しているときは図6(b)のように設定すればよいし、さらに出力コーデック領域を増やして出力コーデックの安定度を高めたければ、図6(b)においてCPUアクセス領域41aの容量を減らして、出力コーデック領域41cを増やすこともできる。
【0052】
このように分割して使用可能なFIFO41の各領域においては図6(a)(b)(c)に示すように、データを書き込むアドレス位置がライトポインタWPで示されており、読み出すアドレス位置がリードポインタRPで示されている。ライトポインタWPとリードポインタRPは、書込/読出が行われる毎に1アドレスずつ矢印で図示する上方向の上位アドレスに移行していく。そして、最上位アドレスからは最下位アドレスに折り返すようになる。例えば、CPUアクセス用領域41aではライトポインタWP1とRP1で示されており、この領域41aにおいてライトポインタWP1とリードポインタRP1の間にデータが書き込まれていることになる。また、FIFO41のCPUアクセス領域41aに波形データを書き込む場合は、ライトポインタWP1を1つ進めるとともにライトポインタWP1の示す記憶位置に波形データを書き込む。CPUアクセス領域41aから波形データを読み出す場合は、リードポインタRP1を1つ進めるとともにリードポインタRP1の示す記憶位置から波形データを読み出す。さらに、出力コーデック用領域41cではライトポインタWP2とリードポインタRP2で示されており、この領域41cにおいてライトポインタWP2とリードポインタRP2の間にデータが書き込まれていることになる。さらに、入力コーデック用領域41bではライトポインタWP3とリードポインタRP3で示されており、この領域41bにおいてライトポインタWP3とリードポインタRP3の間にデータが書き込まれていることになる。なお、ライトポインタWPとリードポインタRPの進行はXアクセス回路40が管理しており、CPU10がそれらを制御する必要はない。
【0053】
これらの6つのポインタは図2に示すXアクセス回路40に内蔵されているポインタレジスタ43に格納されている。ポインタレジスタ43における各ポインタには、アドレスカウンタでカウントしたカウント値が格納されているが、この場合、1つのアドレスカウンタを時分割使用してそれぞれのポインタ値を得るようにしている。すなわち、アドレスカウンタは各領域のデータの書込/読出に応じてインクリメントしたカウント値がそれぞれ格納されるようになる。なお、リードポインタRPがライトポインタWPを追い越さないようにFIFO41における各領域の書込/読み出しが制御される。これらの情報をCPU10がFIFO制御レジスタ44に設定しようとする際には、CPU10は、該情報をデータバス(DATA4)に供給するとともに、音源制御レジスタ30のFIFO制御レジスタ44を示すアドレスをアドレスバス(AD4)に供給して通常の書き込み動作を行う。
【0054】
このように分割して使用可能なFIFO41はFIFO制御レジスタ44により制御されている。FIFO制御レジスタ44には、CPU10からデータバス(DATA4)を介してFIFO41がどの位置で分割されて何の領域に割り当てられているかを示す分割データ、FIFO41における各領域における書込データや読出データの残存データ量が所定量以下となった際に発生するCPU割込やデータ要求の発生条件を示す通知制御情報、FIFO41における各領域に格納されるデータがステレオであるか否かを示すステレオ指示情報、FIFO41における各領域をクリアするクリア情報、FIFO41における各領域に格納されるデータが16ビットであるか32ビットであるかを示すビット数情報が供給されている。これらの情報がCPU10からデータバス(DATA4)に供給される際には、CPU10から音源制御レジスタ30にFIFO制御レジスタ44を示すレジスタアドレスがアドレスバス(AD4)を介して供給されて、FIFO制御レジスタ44に格納される。
【0055】
そして、FIFO制御レジスタ44にFIFO41を分割する分割データが供給されると、FIFO制御レジスタ44はFIFO41を分割データに従って分割し、分割数に対応するポインタをポインタレジスタ43に設定するようにする。これにより、FIFO41を分割して使用することができるようになる。そして、FIFO制御レジスタ44に通知制御情報が供給されると、FIFO制御レジスタ44はFIFO41に設定されている各領域における残存データ量の閾値が通知制御情報に従って定められるようになる。残存データ量がこの閾値以下となった際にCPU10にCPU割込やDMAコントローラにデータ要求が発生して、データの書込/読出が通知されるようになる。この通知制御ではFIFO41を3分割しても対応できるように最大3系統の通知制御情報とされている。
【0056】
この通知制御情報により設定される閾値を、図7に示すCPUアクセス用領域にCPU10が書き込む際の例を説明する。図7(b)に示すようにわずかデータが読み出された際に書込を要求するCPU割込やデータ要求を通知する閾値aとすると、その領域のサイズが小さい場合に好適であるが通知回数が多くなってしまうようになる。図7(c)に示すように領域のほぼ半分データが読み出された際に書込を要求するCPU割込やデータ要求を通知する閾値bとすると、その領域のサイズが中くらいの場合に好適となり、通知回数をある程度抑制することができるようになる。図7(d)に示すように領域の数分の一になるまでデータが読み出された際に書込を要求するCPU割込やデータ要求を通知する閾値cとすると、その領域のサイズが大きい場合に好適となり、通知回数を抑制することができるようになる。図7(e)に示すように領域の全てのデータが読み出された際に書込を要求するCPU割込やデータ要求を通知する閾値dとすると、リアルタイム性が必要とされないデータの場合に好適となり、通知回数をわずかな回数とすることができる。
【0057】
次に、図8に示すCPUアクセス用領域からCPU10が読み出す際の例を説明する。図8(b)に示すようにわずかデータが書き込まれた際に読出を要求するCPU割込やデータ要求を通知する閾値eとすると、その領域のサイズが小さい場合に好適であるが通知回数が多くなってしまうようになる。図8(c)に示すように領域のほぼ半分データが書き込まれた際に読出を要求するCPU割込やデータ要求を通知する閾値fとすると、その領域のサイズが中くらいの場合に好適となり、通知回数をある程度抑制することができるようになる。図8(d)に示すように領域の数分の一を残してデータが書き込まれた際に読出を要求するCPU割込やデータ要求を通知する閾値gとすると、その領域のサイズが大きい場合に好適となり、通知回数を抑制することができるようになる。図8(e)に示すように領域のほとんどにデータが書き込まれた際に読出を要求するCPU割込やデータ要求を通知する閾値hとすると、リアルタイム性が必要とされないデータの場合に好適となり、通知回数をわずかな回数とすることができる。
【0058】
また、FIFO制御レジスタ44にステレオ指示情報が供給されると、FIFO制御レジスタ44はLデータとRデータとをFIFO41に交互に書き込むインターリーブ処理を行って波形データを書き込むように制御する。このステレオ指示情報はFIFO41を3分割した際に、それぞれの領域でステレオ指示できるように最大3系統のステレオ指示情報とされている。
さらに、FIFO制御レジスタ44にクリア情報が供給されると、FIFO制御レジスタ44はFIFO41をクリアする。このクリア情報はFIFO41を3分割した際に、それぞれの領域でクリアできるように3系統のクリア情報とされている。
さらにまた、FIFO制御レジスタ44にビット数情報が供給されると、FIFO制御レジスタ44は波形データを16ビットあるいは32ビットとして扱う。FIFO41は512ワード×16ビットとされているので、指示されたビット数に応じてFIFO41を制御するようにする。すなわち、ビット数情報により32ビットと指示されると、FIFO制御レジスタ44は1つの波形データを読出/書込する際に2ワードをFIFO41から読出/書込するように制御する。このビット数情報はFIFO41を3分割した際に、それぞれの領域でビット数を指示できるように最大3系統のビット数情報とされている。
【0059】
次に、図2に示す構成の音源部20におけるデータ流れ図を図4に、その動作タイミングを図5に、FIFO41の分割形態を図6に示し、これらの図を参照しながら、Xアクセス処理およびコーデック入出力処理におけるデータの流れを説明する。
図4において、制御手段5はCPU10とシステムRAM(図1に示すRAM13)とDMAコントローラからなり、波形メモリ21における波形データの書込/読出の制御や波形データの転送制御を行っている。FIFO41は、CPUアクセス用FIFO41a、入力コーデック用FIFO41bおよび出力コーデック用FIFO41cに3分割されている。
【0060】
また、書込手段52は読出書込回路31の一機能であり、楽音生成用のチャンネルの内の特定のチャンネルを使用して波形メモリ21へ波形データを書き込む手段である。音源手段51は、読出書込回路31により読み出された波形データに基づいて楽音データを生成する音源手段である。この楽音データは最大128チャンネルからなっている。ミキサ手段53は、ミキサ33とDSP34の機能を備え時分割で生成された各チャンネルの楽音データをミキシングして最終的な楽音データを作成してDAC23に供給したり、外部回路22に波形データを供給してエフェクト処理された波形データを受け取ってミキシングしたりしている。外部回路22,DAC23,音源手段51,書込手段52,ミキサ手段53は、1DAC周期を基準とするサンプリング周波数Fsに同期して動作している。これに対して、ミキサ手段53から入力コーデック用FIFO41bにはサンプリング周波数Fsに同期してデータが書き込まれるが、制御手段5における独自の動作タイミングで読み出される。同様に出力コーデック用FIFO41cには、制御手段5から独自の動作タイミングでデータが書き込まれるが、サンプリング周波数Fsに同期してデータが読み出されてミキサ手段53に供給されるようになる。
【0061】
ここで、書込手段52により実行される書込処理は、図5(a)に示す期間cにおいて実行されるようになる。図5(a)には前述した処理Bの処理期間a、b、dとして示されており、期間cは後半DAC周期における処理Bが実行される期間bの直後とされている。これは、楽音データ生成用のチャンネルが128チャンネルとされている場合に、書込手段52が最後の16チャンネルを利用して波形メモリ21に波形データを書き込めるようにしていることに基づいている。なお、図5(a)に示す動作タイミングはXアクセス処理が実行されず、CPU10によるアクセスがない場合の動作タイミングとされている。
【0062】
また、Xアクセス処理が実行される場合は、制御手段5(CPU10ないしDMAコントローラ)はCPUアクセス用FIFO41aをバッファメモリとして使用して、波形メモリ21へ波形データを書き込んだり、波形メモリ21から波形データを読み出したりするようになる。Xアクセス処理で波形メモリ21にデータを書き込む場合の動作タイミングの例を図5(b)に示す。CPU10あるいはDMAコントローラがCPUアクセス用FIFO41aに書き込むタイミングはCPU書込として示す期間hであり、Xアクセス回路40がCPUアクセス用FIFO41aに書き込まれている波形データを波形メモリ21に書き込むタイミングは期間e、f、gとされる。このように、書き込むデータ量が1DAC期間で転送できるデータ量より多い場合は、期間e、f、gのように複数の期間にわたりXアクセス回路40が波形メモリ21に書き込みを行う。また、書き込むデータ量がCPUアクセス用FIFO41aの容量より大きい場合は、CPU10あるいはDMAコントローラからCPUアクセス用FIFO41aへの書き込みも連続する1つの期間ではなく複数の期間に分けて行われる。その場合の2回目以降の期間は、前述したCPU割込やデータ要求の通知に応じて開始される。Xアクセス処理で波形メモリ21からデータを読み出す場合も同様であり、Xアクセス処理で波形メモリ21からCPUアクセス用FIFO41aに読み込むデータ量が1DAC期間で転送できるデータ量より多い場合は複数期間にわたる転送が行われ、また、そのデータ量がFIFO41aの容量より大きい場合はCPU10あるいはDMAコントローラは、CPUアクセス用FIFO41aからのデータの読み出しを複数期間に分けて実行する。なお、波形メモリ21から読み出した波形データをCPUアクセス用FIFO41aに記憶し、当該波形データを読み出したアドレスとはオフセットされたアドレスを書込アドレスとして発生するようにし、CPUアクセス用FIFO41aから読み出した波形データを波形メモリ21へ書き込むことにより、波形データのコピーを行うことができる。
【0063】
さらにまた、コーデック入出力処理が実行される場合には、入力コーデック用FIFO41bには、ミキサ手段53からDAC周期ごとに入力される波形データ、例えば外部回路22においてディジタル信号に変換されたオーディオ信号が格納され、制御手段5により入力コーデック用FIFO41bから読み出されて制御手段5へ取り込まれるようになる。そして、出力コーデック用FIFO41cには、制御手段5から転送された波形データが格納され、DAC周期ごとに出力コーデック用FIFO41cから読み出されてミキサ手段53に供給され、楽音データにミキシングされてDAC23に出力されるようになる。なお、入力コーデック用FIFO41bおよび出力コーデック用FIFO41cには、1/2ダウンサンプリングした波形データを入出力することができ、このようにダウンサンプリングするとそれぞれのコーデック用FIFO41b,41cへのアクセス回数を低減することができる。波形データをダウンサンプリングした際には、DSP34によりLPF処理を行うことにより折り返しノイズの発生を防止するのが好適である。さらに、入力コーデック用FIFO41bおよび出力コーデック用FIFO41cでは、ビット列の最上位ビットが左側に位置するビッグエンディアンと、ビット列の最下位ビットが左側に位置するリトルエンディアンとの設定ができるようにされている。
【0064】
なお、上記の説明では音源部20における処理を図3に示すように1DAC周期を前半と後半に分割した区間で実行するようにしているが、本発明はこれに限るものではなく、1DAC周期を1/3,1/4,・・・に分割し、それらの区間を単位にして各処理を行なうようにしてもよい。また、1DAC周期を分割することなく各処理を行うようにしてもよく、1DAC周期を分割する場合は区間の期間長は等分割に分割しなくてもよい。さらに言えば、1DAC周期がどのように分割されているかは問題ではなく、とにかく、読出書込回路31による波形メモリアクセスとXアクセス回路による波形メモリアクセスとが時分割化できていればよい。
【0065】
【発明の効果】
本発明は以上説明したように、制御手段の制御の基で、波形メモリへのアクセスを行うアクセス手段に内蔵された記憶手段が、波形メモリへの波形データの書き込みや、波形メモリからの波形データの読み出しを行う際に波形データを一次記憶するバッファと、制御手段が波形データを扱うために一次記憶するコーデック用のバッファとに分割されている。これにより、バッファを増設することなくコーデック機能を音源装置に有させることができるようになる。この場合、分割されて構成された各バッファにおいては制御手段への割込条件やデータ要求発生条件を変更できるようにされているので、記憶手段を分割してバッファを構成するようにしても、効率よく各バッファを使用することができるようになる。
また、コーデック機能により、所定のサンプリング周期に同期して動作する音源装置のミキサ手段と、サンプリング周期とは独立したタイミングで動作する制御手段(CPU)の間で、波形データのやりとりをすることができる。特に、コーデック機能の出力先/入力元がミキサ手段であるため、ミキサの設定により次のような動作が可能となる。
(1)楽音生成手段の生成した波形データに、効果付与手段で効果を付与して制御手段に渡す(レコーディング)ことができる。
(2)制御手段が供給する波形データ(ソフト音源等)に、効果付与手段で効果を付与することができる。
(3)楽音生成手段の生成した波形データを制御手段に渡し、制御手段で効果を付与して(ソフトエフェクト)ミキサ手段に戻すことができる。
【図面の簡単な説明】
【図1】 本発明の実施の形態にかかる波形メモリを備えている音源装置を有する楽音生成装置の構成例を示すブロック図である。
【図2】 本発明の実施の形態にかかる波形メモリを備えている音源装置である音源部の詳細構成を示す図である。
【図3】 本発明の実施の形態にかかる波形メモリを備えている音源装置の動作タイミングを示す図である。
【図4】 本発明の実施の形態にかかる音源装置のデータの流れを説明するための機能ブロック図である。
【図5】 本発明の実施の形態にかかる音源装置におけるCPUアクセスのタイミングを示す図である。
【図6】 本発明の実施の形態にかかる音源装置におけるFIFOの分割形態を示す図である。
【図7】 本発明の実施の形態にかかる音源装置におけるFIFOからの読出時における割込やデータ要求の閾値の態様を示す図である。
【図8】 本発明の実施の形態にかかる音源装置におけるFIFOからの書込時における割込やデータ要求の閾値の態様を示す図である。
【図9】 従来の波形メモリ音源の構成を示すブロック図である。
【符号の説明】
1 楽音生成装置、5 制御手段、10 CPU、11 タイマ、12 ROM、13 RAM、14 ディスク、15 ドライブ、16 MIDIインタフェース、17 ネットワークインタフェース、18 パネルSW、19 パネル表示器、20 音源部、21 波形メモリ、22 外部回路、23 DAC、24サウンドシステム、25 バス、30 音源制御レジスタ、31 読出書込回路、32 EG付与回路、33 ミキサ、35 セレクタ、40 Xアクセス回路、41a CPUアクセス用領域、41b 入力コーデック用領域、41c 出力コーデック用領域、42 XAレジスタ、43 ポインタレジスタ、44 FIFO制御レジスタ、51 音源手段、52 書込手段、52 書込手段、53 ミキサ手段、120 音源部、121 波形メモリ、122 外部回路、130 音源制御レジスタ、131 読出書込回路、132 EG付与回路、133 ミキサ、134 DSP、140 Xアクセス回路、141 FIFO、142 XAレジスタ
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a sound source device that allows control means to access a waveform memory.
[0002]
[Prior art]
2. Description of the Related Art Conventionally, a waveform memory sound source is known in which a musical tone is generated based on waveform data read from a waveform memory in accordance with a pitch to be generated. FIG. 9 shows an example of the configuration of a sound source unit in a conventional musical tone generating apparatus incorporating such a waveform memory sound source.
In FIG. 9, the waveform memory 121 is constituted by a readable / writable SDRAM (Synchronous DRAM), and stores a plurality of short-term sampling waveforms. The tone generator 120 generates musical sounds based on the waveform data read from the waveform memory 121. When generating a musical sound, a CPU (Central Processing Unit) (not shown) in the musical sound generating apparatus supplies various sound source parameter information to the sound source control register 130 and issues a sound generation start instruction. The sound source parameter information is supplied from the CPU to the sound source control register 130 via the data bus (DATA102), and is stored in the register indicated by the address given from the CPU via the address bus (AD102) in the sound source control register 130.
[0003]
The sound source parameter information includes an assigned channel, a waveform memory read pitch (frequency number), a waveform memory read section, an envelope parameter, setting information for the mixer 133, and an effect coefficient. Of these, the waveform memory read section parameter is the start address AS of the waveform data to be read and its data length LPA. The tone generator control register 130 and the read / write circuit 131 generate musical tones for each channel by performing five processes of process A, process B, capture process, interpolation process, and X access process. The outline of each process is as follows. The process A reads out the waveform data of each channel according to the time division channel timing for generating a musical tone based on the waveform data start address AS supplied from the sound source control register 130 and information such as the data length LPA and pitch PITCH. This is a process for creating an address. The waveform data read address of each channel is a relative address and is held in a register (not shown) in the read / write circuit 131. The process B is a process executed in the read / write circuit 131, and is converted into a waveform data read address of an absolute address corresponding to the waveform memory 121 at a channel timing different from the time division channel timing. This is a process of supplying the read address to the waveform memory 121 via the address bus (AD101).
[0004]
The capturing process is a process executed by the read / write circuit 131. The waveform data read in accordance with the waveform data read address supplied to the waveform memory 121 by the process B is sent via the data bus (DATA101). This is the process of capturing and writing to the built-in waveform buffer for each channel. The interpolation process is a process executed by an interpolation circuit (not shown) in the read / write circuit 131. According to the time division channel timing, the waveform sample of each channel is read from the waveform buffer, and the waveform data of each channel is obtained by interpolation. This is a process of generating and outputting in time division. The interpolated waveform data is supplied from the read / write circuit 131 to the EG applying circuit 132.
[0005]
The X access process is a process executed under the control of the X access circuit 140 built in the sound source control register 130, and when the time slot for performing the process in the process B or the capture process described above becomes available, In the time slot, the CPU reads / writes waveform data from the waveform memory 121 and writes the mixed waveform data output from the mixer 133 to the waveform memory 121. In the X access processing in which the CPU reads waveform data from the waveform memory 121, the CPU outputs an address designating the XA register 142 built in the X access circuit 140 to the address bus (AD 102) and sends it to the XA register 142. Write the output waveform data read address to the data bus (DATA102). The read / write circuit 131 supplies the waveform data read address written in the XA register 142 to the waveform memory 121 via the address bus (AD101) using the time slot which is free in the process B or the capture process. At this time, the read / write circuit 131 also supplies a read enable signal to the waveform memory 121.
[0006]
As a result, the waveform data is read onto the data bus (DATA 101) according to the address supplied from the waveform memory 121. This waveform data is written to a FIFO (First In First Out) 141 built in the X access circuit 140 via the read / write circuit 131. The FIFO 141 is a first-in first-out buffer memory. When a predetermined amount of the read waveform data is written in the FIFO 141, the CPU outputs an address designating the FIFO 141 to the address bus (AD102) at the operation timing of the CPU, and the waveform data is output from the FIFO 141 to the data bus (DATA102). ) To read through.
[0007]
Further, the CPU supplies the start address and data length information of the waveform data to be read to the X access circuit 140, and the X access circuit 140 sequentially assigns addresses from the start address to the data length every time data is read from the waveform memory 121. Incremental waveform data read addresses are generated. This waveform data read address is written in the built-in XA register 142 and finally supplied to the waveform memory 121. As a result, waveform data of a predetermined number of samples written at consecutive address positions can be sequentially read out and stored in the FIFO 141 sequentially. The waveform data stored in the FIFO 141 is sequentially read out from the FIFO 141 by the CPU at a different operation timing of the CPU from the timing of writing.
[0008]
In the X access process for writing the waveform data output from the mixer 133 to the waveform memory 121, the waveform data output from the mixer 133 is written into the FIFO 141. The CPU writes the waveform data write address (first address) in the XA register 142 built in the X access circuit 140. The read / write circuit 131 supplies the waveform data write address written in the XA register 142 to the waveform memory 121 via the address bus (AD101) using the time slot which is vacant in the process B and the capture process. At the same time, the waveform data read from the FIFO 141 is output to the data bus (DATA 101) via the read / write circuit 131 and supplied to the waveform memory 121. Further, a write enable signal is supplied from the read / write circuit 131 to the waveform memory 121. As a result, the waveform data is written to the waveform memory 121.
[0009]
The CPU supplies the X access circuit 140 with information on the start address of the write address and the data length of the waveform data. The X access circuit 140 sequentially assigns addresses from the start address to the data length each time waveform data is written. Incrementing generates successive waveform data write addresses. This waveform data write address is written in the built-in XA register 142 and finally supplied to the waveform memory 121. As a result, the waveform data of a predetermined number of samples written from the mixer 133 to the FIFO 141 can be written to consecutive address positions in the waveform memory 121. In this case, waveform data is sequentially written into the FIFO 141 by one sample from the mixer 133 for each sampling period regardless of the empty state. Since the write speed from the FIFO 141 to the waveform memory 121 is at least one sample per sampling period, the FIFO does not become full. On the other hand, during the X access process of writing waveform data from the CPU to the waveform memory 121, the CPU checks the empty state of the FIFO 141, and writes the waveform data to the FIFO 141 only when there is an empty space.
[0010]
The waveform data of each channel output in a time-sharing manner from the read / write circuit 131 is provided with an envelope by the EG applying circuit 132. The given envelope is determined based on the envelope parameter of each channel given from the CPU and stored in the sound source control register 130.
For example, the waveform data for 32 channels to which the envelope has been added is supplied to the mixer 133. Further, the mixer 133 is subjected to effect processing output from the signal processing circuit (DSP) 134, for example, waveform data for 8 channels, and the external circuit 122 is subjected to filter processing, effect processing, etc., for example, 8 channels. Minute waveform data is supplied. The mixer 133 multiplies the supplied waveform data of each channel by a coefficient value for mixing.
[0011]
The coefficient value is given as a sound source parameter from the CPU to the sound source control register 130 and stored in a built-in register. As for the waveform data mixed in the mixer 133, the final output of the tone generator 120 is output to the DSP 134 for eight channels, to the external circuit 122 for eight channels, and to the X access circuit 140 in the tone generator control register 130 for one channel. The two channels (L and R outputs) are output to the DAC 123. As described above, the mixer 133 multiplies the waveform data of the channel designated by the CPU by the designated coefficient value and mixes the result, and sends the mixing result to the output unit based on the designation of the CPU through the designated channel. ing.
[0012]
[Problems to be solved by the invention]
By the way, in order to handle waveform data from the CPU side in the sound source unit 120, it is conceivable that the sound source unit 120 has a codec function. In this case, the sound source unit operates on the basis of the DAC cycle in the DAC, but the CPU operates at an operation timing not directly related to the DAC cycle, so an additional buffer is added to provide a codec function. There was a problem of having to.
[0013]
Accordingly, an object of the present invention is to provide a sound source device that can provide a codec function by adding a small number of circuits by utilizing a circuit originally prepared for accessing a waveform memory by a CPU.
[0014]
[Means for Solving the Problems]
In order to achieve the above object, a first sound generator according to the present invention includes a waveform memory in which waveform data can be read and written, waveform data read from the waveform memory, and based on the read waveform data. Cycle is Sampling period It is said Musical tone generating means for generating musical tone waveform data, and waveform data including the musical tone waveform data generated by the musical tone generating means are input, and mixing processing is performed. Cycle is Sampling period It is said Mixing means for outputting mixed waveform data, control means for controlling the operation of the musical tone generation means and the mixing means, and control of the control means during a time when the musical tone generation means is not accessing the waveform memory Based on the above, access to continuously read or write the waveform data in the waveform memory, and to access the waveform data input from the mixing means for each sampling period to the control means, and to the access means Built-in storage means, and the access means performs the first area of the storage means under the control of the control means. Said When reading waveform memory A buffer for temporarily storing the waveform data read to the control means, and Waveform data at the time of writing To pass to the waveform memory In addition to being used as a buffer for temporarily storing, the second area of the storage means can be used as a buffer for temporarily storing the waveform data input from the mixing means for delivery to the control means. .
[0015]
Next, a second sound source device according to the present invention capable of achieving the above object includes a waveform memory capable of reading and writing waveform data,
Read waveform data from the waveform memory, based on the read waveform data Cycle is Sampling period It is said Musical tone generating means for generating musical tone waveform data, and waveform data including the musical tone waveform data generated by the musical tone generating means are input, and mixing processing is performed. Cycle is Sampling period It is said Mixing means for outputting mixed waveform data, control means for controlling the operation of the musical tone generation means and the mixing means, and control of the control means during a time when the musical tone generation means is not accessing the waveform memory The access means for continuously reading or writing the waveform data in the waveform memory, and outputting the waveform data sequentially input from the control means to the mixing means at every sampling period, and the access Storage means incorporated in the means, and the access means is configured to perform the first area of the storage means under the control of the control means. Said When reading waveform memory A buffer for temporarily storing the waveform data read to the control means, and Waveform data at the time of writing To pass to the waveform memory While being used as a buffer for temporarily storing, the second area of the storage means can be used as a buffer for temporarily storing waveform data input from the control means to the mixing means.
[0016]
Further, in the first and second sound source devices of the present invention, the size of the first area and the size of the second area in the storage means can be changed according to a user instruction or an operating situation, respectively. It may be.
Further, in the first and second sound source devices of the present invention, the state of waveform data in the buffer which is the first area and the second area is further detected, and data reception or data supply to the control means. Detecting means for generating a request for the data, and a condition changing means for changing the detection condition in the detecting means, wherein the control means is configured to respond to the request for data reception or data supply in an area corresponding to the request. Data reception from a certain buffer or data supply to the buffer may be executed.
[0021]
According to the present invention, the storage means built in the access means for accessing the waveform memory under the control of the control means allows the waveform data to be written to the waveform memory or the waveform data from the waveform memory. Are read out, and a buffer for temporarily storing waveform data when the data is read out and a buffer for codec that is temporarily stored by the control means for handling the waveform data. As a result, the sound source device can be provided with the codec function without adding a buffer. In this case, in each buffer constituted by being divided, the interrupt condition to the control means and the data request generation condition can be changed. Therefore, even if the storage means is divided to constitute the buffer, Each buffer can be used efficiently.
[0022]
DETAILED DESCRIPTION OF THE INVENTION
FIG. 1 is a block diagram showing a configuration example of a musical sound generating apparatus having a sound source device including a waveform memory according to an embodiment of the present invention.
In the musical sound generating device 1 shown in FIG. 1, the CPU 10 is a central processing unit (Central Processing Unit) that controls the operation of musical sound generation in the musical sound generating device 1 by executing various programs. It is a timer that indicates time or generates a timer interrupt at specific intervals, and is used for time management of automatic performance. The ROM 12 is a ROM (Read Only Memory) in which a program for musical tone generation processing executed by the CPU 10 and various data are stored. A RAM 13 is a main memory in the musical sound generating apparatus 1 and is a RAM (Random Access Memory) in which a work area of the CPU 10 is set.
[0023]
The disk 14 is a recording medium such as a hard disk, floppy disk, or removable disk, and stores waveform data to be loaded into the waveform memory 21. The drive 15 is a disk drive for reading / writing the set disk 14. The MIDI interface 16 is a MIDI interface that sends out a MIDI message created in the musical sound generating device 1 to the outside and receives a MIDI message from the outside. The network interface 17 is a network interface for connecting to a server computer via a communication network such as a LAN (Local Area Network), the Internet, or a telephone line. The panel switch (panel SW) 18 is a variety of switches provided on the panel of the musical tone generation device 1, and various instructions can be given to the musical tone generation device 1 by operating this switch. The panel display 19 is a display on which various information is displayed when a musical sound is generated.
[0024]
The sound source unit 20 reads waveform data (waveform sample) from the waveform memory 21 based on a sound generation start instruction from the CPU 10, and performs processing such as interpolation, envelope application, channel accumulation (mixing), and effect (effect) application. And output as musical sound waveform data. The musical sound waveform data output from the sound source unit 20 is converted into an analog signal by the DAC 23 and emitted by the sound system 24. The waveform memory 21 is constituted by a high-speed memory such as SDRAM, and stores a large number of waveform sample data sampled at a predetermined rate. One word waveform sample is represented by 16 bits or 32 bits, for example, and an address is assigned to each waveform sample unit. That is, one waveform sample is read out by one access. The waveform memory 21 stores waveform data read from the disk 14 or the like prior to the generation of musical sounds.
[0025]
The external circuit 22 includes an analog / digital converter (ADC) for taking in audio data such as voice and musical sound from the outside, an external DSP for performing an effect applying process, or a digital filter. The waveform data supplied from the sound source unit 20 to the external circuit 22 is subjected to effect applying processing and digital filter processing in the external circuit 22 and returned to the sound source unit 20. In the sound source unit 20, the returned waveform data is mixed with the waveform data of other channels and output. Note that the external circuit 22 may be built in the musical sound generating device 1 or provided outside the musical sound generating device 1. The digital / analog converter (DAC) 23 converts the stereo musical sound data finally output from the sound source unit 20 into a digital musical sound signal and emits it from the sound system. The bus 25 is a CPU bus that interconnects the above-described units including an address bus, a control bus, and a data bus.
[0026]
Next, FIG. 2 shows a detailed configuration of the sound source unit 20 that is a sound source device including the waveform memory according to the embodiment of the present invention, and FIG. When the number of sound generation channels is 128 in the sound source unit 20, the sound source unit 20 operates in a time-division 128 channel. For this reason, control signals such as a control clock signal and a channel count value, which are reference signals for time division, are supplied to each unit in the sound source unit 20.
In FIG. 2, the waveform memory 21 is constituted by a readable / writable SDRAM (Synchronous DRAM), for example, and a plurality of relatively short-term samplings read from the disk 14 or the like in advance when the tone generator 20 generates musical sounds. The waveform is stored. The tone generator 20 generates musical sounds for each channel based on the waveform data read from the waveform memory 21 by time division for each channel.
[0027]
When generating a musical sound in response to a note-on, the CPU 10 in the musical sound generating device 1 selects a channel (allocated channel) to be used for generating a musical sound in accordance with the note-on from the 128 channels, and assigns the sound source control register 30 to it. Various sound source parameters are set in the storage area corresponding to the channel, and a sound generation start instruction for the selected channel is issued. The sound source control register 30 is supplied with an address from the CPU 10 via the address bus (AD4) and exchanges various data via the data bus (DATA4). In FIG. 2, a plurality of data buses (DATA4) are shown, but are shown as a plurality of data buses for convenience of explanation, and are actually a single bus. The tone generator parameter information is supplied from the CPU 10 to the tone generator control register 30 via the data bus (DATA4), and is stored in the register indicated by the register address given from the CPU 10 via the address bus (AD4) in the tone generator control register 30. The
[0028]
The sound source parameter information supplied to the sound source control register 30 together with the sound generation start instruction is a waveform memory reading speed (corresponding to a musical tone pitch), a waveform memory reading section, an envelope parameter, setting information for the mixer 33, an effect coefficient, and the like. . Of these, the waveform memory read section parameter is the start address AS of the waveform data to be read and its data length LPA. In this case, the sound source parameter supplied via the data bus (DATA4) is stored in a specific register in the sound source control register 30 indicated by the register address on the address bus (AD4). As a result, the sound source parameters corresponding to the plurality of registers are respectively stored.
[0029]
The tone generator control register 30 and the read / write circuit 31 perform six processes: process A, process B, capture process, interpolation process, X access process, and codec input / output process. The outline and timing of each process are as follows. The process A is based on the waveform data start address AS supplied from the sound source control register 30 and the information such as the data length LPA and pitch PITCH, and the waveform data of each tone generation channel according to the time-division channel timing for generating a musical tone. This is a process for creating a read address. The address of each channel is held in a register (not shown) in the read / write circuit 31. If the number of sound generation channels is 128, the process A creates waveform data read addresses for 128 channels within one DAC period in the DAC 23. As will be described later, in the musical sound generating apparatus 1 according to the present invention, the last 16 channels out of the 128 channels are diverted as write channels for writing the waveform data output from the mixer 33 to the waveform memory 21. Is possible.
[0030]
In this case, as shown in FIG. 3, the 1DAC cycle is divided into the first half and the second half, and waveform data read addresses of 1ch to 64ch are created in the first half period (Processing A first half ch), and 65ch ~ in the second half period. A 128ch waveform data read address is created (second half of process A). In process A, read addresses are generated for all channels, and the channel from which waveform data is to be read is determined in accordance with the progress of the integer part of the read address of each channel. The channel number of the determined channel and its channel are determined. The number of samples to be read out in (corresponding to the progress amount) is stored in the control RAM. It should be noted that four-point interpolation in the interpolation process requires four consecutive sample waveform data, of which waveform data read from the waveform memory 21 in the past is already stored in the waveform buffer. A time slot for processing each channel of 1ch to 128ch is given by equally dividing one DAC cycle. That is, the time slot assigned to each channel in process A is T / 128, where 1 DAC period is T, and the time slots are processed in the order of channels as shown in the figure.
[0031]
Process B is executed in the read / write circuit 31 with a delay of approximately ½ DAC period from process A, and is performed on a channel for which process A has been completed at a later-described timing. Process B accesses the waveform memory as many times as the number of accesses stored in the control RAM based on the read address of the channel stored as a channel to be read out in the control RAM, and reads out waveform samples for that number of times. ing. In this case, as shown in FIG. 3, reading from the waveform memory 21 for 1ch to 64ch is executed in the first half period of the 1DAC cycle (processing B first half ch), and from the waveform memory 21 for 65ch to 128ch in the second half period. Is read (Process B second half ch). In this case, in the process A, the process B is not performed for a channel whose channel number is not stored in the control RAM as a channel from which waveform data is to be read. The time slot in which the process B is performed is ¼ of one time slot of the process A, and if the period of one DAC is T, the time slot is T / 512. The 512 times per 1 DAC period means that 4 samples of waveform data can be read out per channel of the sound source.
[0032]
For a channel in which the number of accesses stored in the process A is plural (that is, a channel in which a plurality of integer parts of the read address have progressed), the process B for each waveform data read address corresponds to the time corresponding to the number of accesses. Each slot is sequentially executed. For example, as shown in process B of FIG. 3, process B is performed in 1 time slot for 1ch, process B is not performed for 2ch, process B is performed in 3 time slots for 3ch, and process is performed for 4ch. B is not performed, processing B is performed in 1 time slot for 5ch, processing B is not performed for 6ch, processing B is performed in 2 time slots for 7ch, and processing is performed for 8ch to 64ch that are not sounded B will not be performed. For the channel set as the write channel, a waveform data write address is generated in process B. The number of accesses to the write channel is always once.
[0033]
As described above, since there is a channel where the process B is not performed, in the first half period of the process B, a time slot from the end of the 7ch process to the start of the second half period becomes vacant and also in the latter half period. Will be vacant in the time slot before the next first period begins. Therefore, the X access processing by the X access circuit 40 is performed using this vacant time slot. In the process B, until the time slot becomes empty, the read / write circuit 31 gives the selector control signal (CONT1) to the selector 35 and switches the selector 35 to the read / write circuit 31 side. As a result, the waveform data read address can be supplied from the read / write circuit 31 to the waveform memory 21 via the address bus (AD2). When the time slot becomes empty in the process B, the read / write circuit 31 switches the selector 35 to the X access circuit 40 side by the selector control signal (CONT1). Further, the read / write circuit 31 gives a selector control signal (CONT2) to the X access circuit 40 so that an X access process described later can be executed.
[0034]
The capturing process is a process executed by the read / write circuit 31. The waveform data read in accordance with the waveform data read address supplied to the waveform memory 21 by the process B is sent via the data bus (DATA1). This is the process of capturing and writing to the built-in waveform buffer for each channel. This waveform buffer is a buffer for storing waveform data for inter-sample interpolation, and stores the latest waveform data read from the waveform memory 21 for each sample for four channels. When the waveform data read address is supplied to the waveform memory 21 in the process B, the waveform data is immediately read out from the waveform memory 21, so that the capturing process is started with a slight delay from the process B as shown in FIG. become. In this case, since one waveform sample is read at one waveform data read address, one sample of waveform data is acquired for one channel as shown in the acquisition process of FIG. 3, and no waveform data is acquired for two channels. For 3ch, waveform data is captured for 3 samples, for 4ch, waveform data is not captured, for 5ch, waveform data is captured for 1 sample, for 6ch, waveform data is not captured, and for 7ch, waveform data is 2 samples. Waveform data is not captured for channels 8 to 64. For the channel set as the write channel, instead of this capture process, a write process for writing waveform data supplied by the mixer 33 for each DAC period to the waveform memory write address is performed. Done.
[0035]
As described above, since there is a channel from which waveform data is not captured, a time slot from the end of the 7ch process to the start of the second half period becomes vacant in the first half period of the capture process, and later in the second half period. Becomes empty in the time slot until the next first half period begins. Therefore, the vacant time slot is assigned as a time slot when the X access circuit 40 that performs the X access process described later accesses the waveform memory 21. Note that one time slot in the capturing process is the same as one time slot of process B, and T / 512 is T / 512. Note that the read / write circuit 31 supplies a selector control signal (CONT1) to the selector 35 and switches the selector 35 to the read / write circuit 31 side until the time slot becomes empty in the capture process. As a result, the waveform data read from the waveform memory 21 can be taken into the waveform buffer of the read / write circuit 31 via the data bus (DATA1), the selector 35 and the data bus (DATA2). When the time slot becomes empty in the capture process, the read / write circuit 31 switches the selector 35 to the X access circuit 40 side by the selector control signal (CONT1). Further, the read / write circuit 31 gives a selector control signal (CONT2) to the X access circuit 40 so that an X access process described later can be executed.
[0036]
The interpolation process is a process executed by an interpolation circuit (not shown) in the read / write circuit 31. The waveform sample required for each channel is read from the waveform buffer according to the time division channel timing, and 2-point interpolation or 4-point interpolation is performed. This is a process of outputting the waveform data subjected to the above. In this case, since the waveform data stored by the capturing process is stored in the waveform buffer, the interpolation process starts slightly later than the capturing process. The interpolated waveform data is supplied from the read / write circuit 31 to the EG applying circuit 32. In this case, as shown in FIG. 3, 1ch to 64ch interpolation processing is performed in the first half period of the 1DAC cycle (first interpolation channel), and 65ch to 128ch interpolation processing is performed in the second half period (interpolation second half channel). The interpolation processing time for each channel of 1ch to 128ch is given by equally dividing one DAC cycle. That is, the time slot assigned to each channel in the interpolation processing is T / 128, where 1 DAC period is T, and the time slots are processed in the order of channels as shown in the figure.
[0037]
The X access process is a process executed under the control of the X access circuit 40 provided in the sound source control register 30. This X access process is a process in which the CPU 10 reads / writes the waveform data from the waveform memory 21 in the time slot when the time slot for performing the process B or the capture process is vacant. At this time, the control signal (CONT2) is supplied from the read / write circuit 31 to the X access circuit 40, so that it can be executed in the time slot described above. Further, the selector 35 is switched to the X access circuit 40 side by the control signal (CONT1), and the address bus (AD3) and the data bus (DATA3) are connected to the waveform memory 21.
[0038]
When the CPU 10 executes an X access process for reading waveform data from the waveform memory 21, the CPU 10 outputs an address for designating the XA register 42 built in the X access circuit 40 to the address bus (AD4), and the XA register The head address of the waveform data read address output to the data bus (DATA4) is written to 42, and the data length is written to a data length register (not shown). The read / write circuit 31 supplies and switches the control signal (CONT1) to the selector 35 when the time slot becomes empty in the process B or the capture process, and addresses the waveform data read address written in the XA register 42 in the waveform memory 21. It is supplied via the bus (AD3), the selector 35 and the address bus (AD1). At this time, the read / write circuit 31 also supplies a read enable signal to the waveform memory 21.
[0039]
As a result, the waveform data is read from the waveform memory 21 onto the data bus (DATA1) according to the supplied address. This waveform data is written into the CPU access area 41a of the FIFO 41 built in the X access circuit 40 via the selector 35 and the data bus (DATA3). As will be described later, three areas are set in the FIFO 41, each of which is used as a first-in first-out buffer memory, and the total storage capacity of the three areas is 512 words. After the waveform data read from the waveform memory 21 is written to the CPU access area 41a of the FIFO 41, the CPU 10 outputs an address for designating the FIFO 41 to the address bus (AD4) at a unique timing independent of the DAC cycle. Thus, the waveform data is read from the CPU access area 41a of the FIFO 41 via the data bus (DATA4).
[0040]
In addition, the CPU 10 supplies the head address and data length information of the waveform data to be read to the X access circuit 40, and the X access circuit 40 sequentially assigns addresses from the head address to the data length every time data is read from the waveform memory 21. Incremental waveform data read addresses are generated. This waveform data read address is written in the built-in XA register 42 and finally supplied to the waveform memory 21. As a result, waveform data of a predetermined number of samples written at successive address positions can be sequentially read out and stored in the FIFO 41 sequentially. The waveform data stored in the FIFO 41 is read out and taken into the CPU 10 at an operation timing of the CPU 10 different from the writing timing.
[0041]
In the X access process for writing the waveform data to the waveform memory 21, the CPU 10 outputs an address designating the XA register 42 built in the X access circuit 40 to the address bus (AD 4), and sends it to the XA register 42. Write the start address of the waveform data write address output to the data bus (DATA4). Further, the CPU 10 outputs an address designating the CPU access area 41a of the FIFO 41 built in the X access circuit 40 to the address bus (AD4), and the waveform data written to the waveform memory 21 is stored in the CPU access area 41a of the FIFO 41. In addition to writing only a fixed amount, the data length is written in a data length register (not shown). The read / write circuit 31 supplies and switches the control signal (CONT1) to the selector 35 when the time slot becomes empty in the process B or the capture process, and the waveform data write address written in the XA register 42 is stored in the waveform memory 21. It is supplied via the address bus (AD3), the selector 35 and the address bus (AD1). At the same time, the waveform data is read from the FIFO 41 and supplied to the waveform memory 21 via the data bus (DATA3), the selector 35 and the data bus (DATA1). At this time, the read / write circuit 31 also supplies a write enable signal to the waveform memory 21. As a result, the waveform data supplied to the waveform memory 21 is written according to the supplied write address.
[0042]
The CPU 10 supplies the X access circuit 40 with information on the start address of the write address and the data length of the waveform data. The X access circuit 40 sequentially assigns addresses from the start address to the data length each time waveform data is written. Incrementing generates successive waveform data write addresses. This waveform data write address is written in the built-in XA register 42 and finally supplied to the waveform memory 21. As a result, waveform data of a predetermined number of samples written by a predetermined amount in the CPU access area 41a of the FIFO 41 can be written to successive address positions of the waveform memory 21. In this case, an interrupt request is generated in the CPU 10 according to the empty state in the CPU access area 41a of the FIFO 41, and waveform data is sequentially written from the CPU 10 into the CPU access area 41a of the FIFO 41.
[0043]
In the X access processing, the XA register 42 includes two registers, and two systems of addresses can be stored in each register. These two addresses are for stereo L channel and R channel, and the head address is supplied from the CPU 10. For example, when the CPU 10 captures stereo waveform data from the waveform memory 21 by the X access processing, the L channel address and the R channel address stored in the XA register 42 are time-divisionally divided alternately. To be supplied. As a result, stereo L data and R data are alternately read from the waveform memory 21. The L data and R data are interleaved in the FIFO 41 and written alternately. The CPU 10 only has to read out and capture the L data and R data stored in the FIFO 41 and interleaved. When the CPU 10 reads stereo waveform data from the waveform memory 21 by the X access processing, the L channel waveform data and the R channel waveform data recorded in the individual areas of the waveform memory 21 from the waveform memory 21 by the X access circuit 40 are stored. Automatically interleaved. Similarly, when the CPU 10 writes stereo waveform data to the waveform memory 21 by the X access processing, the L channel address and the R channel address stored in the XA register 42 are alternately supplied to the waveform memory 21. The interleaved waveform data from the CPU 10 is separated into L-channel waveform data and R-channel waveform data and written into different areas of the waveform memory 21. In this way, the CPU 10 does not have to perform interleaving and cancellation of stereo waveform data, and the load on the CPU 10 is reduced.
[0044]
Here, a process of writing the waveform data output from the mixer 31 to the waveform memory 21 by the read / write circuit 31 will be described. The CPU 10 selects a channel to be used for writing from the last 16 channels of the read / write circuit 31 and sets the sound source control register 30 to set the channel as a write channel, and the waveform data mixed by the mixer 31. One waveform data is selected from the above and settings are made to supply it to the write channel. Further, the CPU 10 sets the waveform data write address (start address) and the data length to be written to the data length LPA as the start address AS of the channel of the sound source control register 30, and instructs the start of the writing process.
[0045]
The read / write circuit 31 stores in the address counter of the write channel in the waveform memory 21 via the address bus (AD2), the selector 35 and the address bus (AD1) in the time slot corresponding to the write channel of the process B. Provided waveform data write address. At the same time, the waveform data supplied from the mixer 33 to the write channel is supplied to the waveform memory 21 via the data bus (DATA2), the selector 35 and the data bus (DATA1). Further, a write enable signal is supplied from the read / write circuit 31 to the waveform memory 21. As a result, the waveform data is written to the waveform memory 21.
By the way, the address counter of the write channel is loaded with the start address set as the start address AS at the start of writing. The count value of the address counter is sequentially incremented until it corresponds to the data length set in the data length LPA every time the write channel is written, and becomes a continuous waveform data write address. This waveform data write address is supplied to the waveform memory 21, and the waveform data supplied from the mixer 33 is written at the storage position indicated by the address in the waveform memory 21.
[0046]
Next, the interpolated waveform data of each channel output in a time division manner from the read / write circuit 31 is given an envelope in the EG giving circuit 32. The given envelope is determined based on the envelope parameter of each channel given from the CPU 10 and stored in the register of the sound source control register 30. Waveform data for 128 channels, for example, with an envelope is supplied to the mixer 33. Further, the mixer 33 is subjected to effect processing and the like output from the signal processing circuit (DSP) 34, for example, waveform data for 8 channels, and the external circuit 22 is subjected to filter processing and effect processing, for example, 8 channels. Minute waveform data is supplied. The mixer 33 multiplies the supplied waveform data of each channel by a coefficient value for mixing. The coefficient value is given from the CPU 10 to the sound source control register 30 and stored in a built-in register. Waveform data mixed in the mixer 33 includes 8 channels for the DSP 34, 8 channels for the external circuit 22, and 2 channels (L and R outputs) for the final output of the sound source unit 20 for the DAC 23. It is made to output. The musical tone signal converted into an analog signal by the DAC 23 is emitted from the sound system 24. As described above, the mixer 33 multiplies the waveform data of the channel designated by the CPU 10 by the designated coefficient value, mixes the result, and sends the mixing result to the output unit based on the designation of the CPU 10 through the designated channel. ing.
[0047]
Next, the codec input / output process will be described. The codec here refers to the CPU 10 supplying waveform data to the sound source unit 20 in the DAC cycle, or waveform data output from the sound source unit 20 in the DAC cycle. It means the codec input / output function for receiving. With this codec input / output function, waveform data can be directly input / output from the CPU 10. In the codec input / output processing, waveform data is exchanged between the sound source unit 20 that operates on the basis of the DAC cycle and the CPU 10 that operates at a different operation timing, and thus a waveform buffer is required. . Since the FIFO 41 is used as the waveform buffer, the FIFO 41 is divided into three as shown in FIG. For example, about 1/2 of the FIFO 41 is allocated as a waveform buffer when performing the above-described X access processing, and this area is referred to as a CPU access area 41a. Then, about 1/2 of the remaining area (about 1/4 of the entire area) is allocated as the output codec area 41c and the input codec area 41b.
[0048]
In the codec input / output processing, for example, when an AD converter is connected as the external circuit 22 and the input waveform is converted into digital waveform data by the AD converter and input to the mixer 33, the waveform is input by the input codec function. Data (stream data) can be captured and recorded by the CPU 10. In this case, the waveform data input from the AD converter is written to the input codec area 41 b of the FIFO 41 built in the sound source control register 30 via the mixer 33 for each DAC period. When a predetermined amount of waveform data is written in the input codec area 41 b of the FIFO 41, the CPU 10 is notified of a data read request, and the CPU 10 reads out the waveform data from the input codec area 41 b of the FIFO 41 and writes it in the RAM 13. As a result, the CPU 10 can capture and record the audio signal input from the external circuit 22. Instead of the CPU 10, a DMA (Direct Memory Access) controller may read the waveform data from the input codec area 41 b of the FIFO 41 and write it directly to the RAM 13. In this case, waveform data can be transferred without imposing a heavy burden on the CPU 10.
[0049]
In the codec input / output processing, the waveform data (stream data) stored in the RAM 13 can be retrieved and reproduced by the CPU 10 (output codec). In this process, the waveform data read from the RAM 13 is written into the output codec area 41c of the FIFO 41 built in the sound source control register 30 at the timing of the CPU 10 so that the data does not overflow from the area 41c. The waveform data written in the output codec area 41c of the FIFO 41 is sequentially input to the mixer 33 as a mixer input, one sample at each DAC period. For example, when the mixer 33 is set to supply the waveform data to the DSP 34, the DSP 34 can perform effect processing on the waveform data.
[0050]
This waveform data is mixed with the musical tone data generated in the mixer 33, supplied to the DAC 23, and emitted together with the musical tone signal. In this case, when the waveform data written in the output codec area 41c of the FIFO 41 becomes less than a predetermined amount, a data write request is notified to the CPU 10, and the CPU 10 responds to the free capacity of the output codec area 41c from the RAM 13. Is read out and written to the output codec area 41 c of the FIFO 41. As a result, the waveform data stored in the RAM 13 can be retrieved and reproduced by the CPU 10. Instead of the CPU 10, a DMA (Direct Memory Access) controller may read the stream data from the RAM 13 and directly write it in the output codec area 41c of the FIFO 41. In this case, waveform data can be transferred without imposing a heavy burden on the CPU 10.
[0051]
By the way, the FIFO 41 in the sound source unit 20 shown in FIG. 2 does not have to be divided and used as shown in FIG. That is, the entire FIFO 41 may be allocated as the CPU access area 41a as shown in FIG. 6A, or 3/4 of the FIFO 41 as the CPU access area 41a as shown in FIG. 6B. Allocation and the remaining 1/4 may be allocated as the output codec area 41c. As will be described later, the position and size of each area are controlled by the divided data in the FIFO control register 44. This setting may be changed at any time according to an instruction from the user or the operation status of the musical sound generating device 1. For example, when the input / output codec function is not used at all, the setting is made as shown in FIG. Further, when the X access function and the output codec function are used, the setting may be made as shown in FIG. 6B. If the output codec area is further increased to increase the stability of the output codec, FIG. In b), the capacity of the CPU access area 41a can be reduced to increase the output codec area 41c.
[0052]
In each area of the FIFO 41 that can be divided and used as described above, as shown in FIGS. 6A, 6B, and 6C, the address position to write data is indicated by the write pointer WP, and the address position to read is shown. It is indicated by a read pointer RP. Each time writing / reading is performed, the write pointer WP and the read pointer RP shift to an upper address in the upward direction indicated by an arrow by one address. Then, the highest address returns to the lowest address. For example, the CPU access area 41a is indicated by the write pointers WP1 and RP1, and data is written between the write pointer WP1 and the read pointer RP1 in this area 41a. When writing waveform data in the CPU access area 41a of the FIFO 41, the write pointer WP1 is advanced by one and the waveform data is written at the storage position indicated by the write pointer WP1. When reading the waveform data from the CPU access area 41a, the read pointer RP1 is advanced by one and the waveform data is read from the storage position indicated by the read pointer RP1. Further, the output codec area 41c is indicated by the write pointer WP2 and the read pointer RP2, and data is written between the write pointer WP2 and the read pointer RP2 in this area 41c. Further, the input codec area 41b is indicated by a write pointer WP3 and a read pointer RP3, and data is written between the write pointer WP3 and the read pointer RP3 in this area 41b. The progress of the write pointer WP and the read pointer RP is managed by the X access circuit 40, and the CPU 10 does not need to control them.
[0053]
These six pointers are stored in the pointer register 43 built in the X access circuit 40 shown in FIG. Each pointer in the pointer register 43 stores a count value counted by an address counter. In this case, each pointer value is obtained by using one address counter in a time-sharing manner. That is, the address counter stores the count value incremented according to the writing / reading of the data in each area. Note that writing / reading of each area in the FIFO 41 is controlled so that the read pointer RP does not overtake the write pointer WP. When the CPU 10 intends to set these pieces of information in the FIFO control register 44, the CPU 10 supplies the information to the data bus (DATA4) and sets an address indicating the FIFO control register 44 of the sound source control register 30 to the address bus. (AD4) to perform normal write operation.
[0054]
The FIFO 41 that can be divided and used in this way is controlled by the FIFO control register 44. The FIFO control register 44 stores divided data indicating where the FIFO 41 is divided and assigned to which area from the CPU 10 via the data bus (DATA4), and write data and read data in each area of the FIFO 41. Notification control information indicating a CPU interrupt or data request generation condition when the remaining data amount is equal to or less than a predetermined amount, and stereo instruction information indicating whether or not the data stored in each area in the FIFO 41 is stereo. Clear information for clearing each area in the FIFO 41 and bit number information indicating whether the data stored in each area in the FIFO 41 is 16 bits or 32 bits are supplied. When these pieces of information are supplied from the CPU 10 to the data bus (DATA4), the register address indicating the FIFO control register 44 is supplied from the CPU 10 to the sound source control register 30 via the address bus (AD4). 44.
[0055]
When the divided data for dividing the FIFO 41 is supplied to the FIFO control register 44, the FIFO control register 44 divides the FIFO 41 according to the divided data and sets a pointer corresponding to the number of divisions in the pointer register 43. As a result, the FIFO 41 can be divided and used. When the notification control information is supplied to the FIFO control register 44, the FIFO control register 44 determines the threshold of the remaining data amount in each area set in the FIFO 41 according to the notification control information. When the remaining data amount is less than or equal to this threshold, a CPU interrupt is issued to the CPU 10 or a data request is issued to the DMA controller, and data write / read is notified. In this notification control, up to three systems of notification control information are used so that the FIFO 41 can be divided into three.
[0056]
An example when the CPU 10 writes the threshold set by the notification control information in the CPU access area shown in FIG. 7 will be described. As shown in FIG. 7B, when a threshold value a for notifying a CPU interrupt requesting writing or a data request when a small amount of data is read is suitable, the notification is suitable when the size of the area is small. The number of times will increase. As shown in FIG. 7C, when almost half of the data in the area is read, if the CPU interrupt requesting writing or the threshold value b notifying the data request is used, the size of the area is medium. As a result, the number of notifications can be suppressed to some extent. As shown in FIG. 7D, when the data is read out until it becomes a fraction of the area, the CPU interrupt that requests writing and the threshold c that notifies the data request are used. This is suitable for a large size, and the number of notifications can be suppressed. As shown in FIG. 7 (e), when all the data in the area is read out, the CPU interrupt that requests writing or the threshold d that notifies the data request is used for data that does not require real-time performance. This is suitable, and the number of notifications can be set to a small number.
[0057]
Next, an example in which the CPU 10 reads from the CPU access area shown in FIG. 8 will be described. As shown in FIG. 8B, when a threshold value e for notifying a CPU interrupt requesting reading or a data request when a small amount of data is written is suitable, the number of notifications is suitable. It will increase. As shown in FIG. 8 (c), when the CPU interrupt that requests reading when almost half of the data in the area is written and the threshold f that notifies the data request are suitable, the area is suitable for a medium size. The number of notifications can be suppressed to some extent. As shown in FIG. 8 (d), when the size of the area is large when the CPU interrupt requesting reading when the data is written with a fraction of the area and the threshold value g notifying the data request are written. And the number of notifications can be suppressed. As shown in FIG. 8E, if the CPU interrupt that requests reading when data is written in most of the area and the threshold value h that notifies a data request are suitable for data that does not require real-time characteristics. The number of notifications can be set to a small number.
[0058]
Further, when the stereo instruction information is supplied to the FIFO control register 44, the FIFO control register 44 performs an interleaving process in which L data and R data are alternately written in the FIFO 41 to control to write waveform data. This stereo instruction information is stereo instruction information of a maximum of three systems so that when the FIFO 41 is divided into three, stereo instructions can be given in each area.
Further, when clear information is supplied to the FIFO control register 44, the FIFO control register 44 clears the FIFO 41. This clear information is made into three systems of clear information so that when the FIFO 41 is divided into three, it can be cleared in each area.
Furthermore, when the bit number information is supplied to the FIFO control register 44, the FIFO control register 44 handles the waveform data as 16 bits or 32 bits. Since the FIFO 41 is 512 words × 16 bits, the FIFO 41 is controlled in accordance with the designated number of bits. That is, when 32 bits are instructed by the bit number information, the FIFO control register 44 controls to read / write two words from the FIFO 41 when reading / writing one waveform data. The number-of-bits information is the number-of-three-system number-of-bits information so that when the FIFO 41 is divided into three, the number of bits can be indicated in each area.
[0059]
Next, FIG. 4 shows a data flow diagram in the sound source unit 20 having the configuration shown in FIG. 2, FIG. 5 shows its operation timing, and FIG. 6 shows a division form of the FIFO 41. With reference to these figures, the X access processing and A data flow in codec input / output processing will be described.
In FIG. 4, the control means 5 comprises a CPU 10, a system RAM (RAM 13 shown in FIG. 1), and a DMA controller, and controls the writing / reading of waveform data in the waveform memory 21 and the transfer control of waveform data. The FIFO 41 is divided into three parts: a CPU access FIFO 41a, an input codec FIFO 41b, and an output codec FIFO 41c.
[0060]
The writing means 52 is a function of the reading / writing circuit 31 and is means for writing waveform data into the waveform memory 21 using a specific channel among the channels for generating musical sounds. The tone generator 51 is a tone generator that generates musical tone data based on the waveform data read by the read / write circuit 31. This musical tone data consists of a maximum of 128 channels. The mixer means 53 has the functions of the mixer 33 and the DSP 34 and mixes the tone data of each channel generated by time division to create final tone data and supply it to the DAC 23, or the waveform data to the external circuit 22. Receives and effects-processed waveform data is received and mixed. The external circuit 22, the DAC 23, the sound source means 51, the writing means 52, and the mixer means 53 operate in synchronization with the sampling frequency Fs with 1 DAC period as a reference. On the other hand, data is written from the mixer unit 53 to the input codec FIFO 41b in synchronization with the sampling frequency Fs, but is read at a unique operation timing in the control unit 5. Similarly, data is written to the output codec FIFO 41 c from the control means 5 at a unique operation timing, but the data is read out in synchronization with the sampling frequency Fs and supplied to the mixer means 53.
[0061]
Here, the writing process executed by the writing means 52 is executed in the period c shown in FIG. FIG. 5A shows the processing periods a, b, and d of the process B described above, and the period c is immediately after the period b in which the process B is executed in the second half DAC cycle. This is based on the fact that the writing means 52 can write waveform data into the waveform memory 21 using the last 16 channels when the tone data generation channel is 128 channels. The operation timing shown in FIG. 5A is the operation timing when the X access process is not executed and the CPU 10 does not access.
[0062]
When X access processing is executed, the control means 5 (CPU 10 or DMA controller) uses the CPU access FIFO 41a as a buffer memory to write waveform data to the waveform memory 21 or from the waveform memory 21 to the waveform data. Read out. FIG. 5B shows an example of operation timing when data is written to the waveform memory 21 in the X access process. The timing at which the CPU 10 or DMA controller writes to the CPU access FIFO 41a is a period h indicated as CPU writing, and the timing at which the X access circuit 40 writes the waveform data written to the CPU access FIFO 41a to the waveform memory 21 is the period e, f and g. Thus, when the amount of data to be written is larger than the amount of data that can be transferred in one DAC period, the X access circuit 40 writes to the waveform memory 21 over a plurality of periods such as periods e, f, and g. If the amount of data to be written is larger than the capacity of the CPU access FIFO 41a, writing from the CPU 10 or DMA controller to the CPU access FIFO 41a is performed in a plurality of periods instead of one continuous period. In this case, the second and subsequent periods are started in response to the aforementioned CPU interrupt and data request notification. The same applies to the case where data is read from the waveform memory 21 in the X access processing. If the amount of data read from the waveform memory 21 to the CPU access FIFO 41a in the X access processing is larger than the data amount that can be transferred in one DAC period, transfer over a plurality of periods is possible. If the amount of data is larger than the capacity of the FIFO 41a, the CPU 10 or the DMA controller executes data reading from the CPU access FIFO 41a in a plurality of periods. The waveform data read from the waveform memory 21 is stored in the CPU access FIFO 41a, and an address offset from the address from which the waveform data is read is generated as a write address, and the waveform read from the CPU access FIFO 41a is generated. By writing the data to the waveform memory 21, the waveform data can be copied.
[0063]
Furthermore, when codec input / output processing is executed, waveform data input from the mixer means 53 for each DAC cycle, for example, an audio signal converted into a digital signal in the external circuit 22, is input to the input codec FIFO 41b. The data is stored, read from the input codec FIFO 41 b by the control means 5, and taken into the control means 5. The waveform data transferred from the control means 5 is stored in the output codec FIFO 41c, read out from the output codec FIFO 41c at every DAC period, supplied to the mixer means 53, mixed with the musical sound data, and sent to the DAC 23. Will be output. The input codec FIFO 41b and the output codec FIFO 41c can input and output 1/2 downsampled waveform data, and downsampling in this way reduces the number of accesses to the respective codec FIFOs 41b and 41c. be able to. When the waveform data is down-sampled, it is preferable to prevent the occurrence of aliasing noise by performing LPF processing by the DSP 34. Further, in the input codec FIFO 41b and the output codec FIFO 41c, the big endian in which the most significant bit of the bit string is located on the left side and the little endian in which the least significant bit of the bit string is located on the left side can be set.
[0064]
In the above description, the processing in the sound source unit 20 is executed in a section obtained by dividing the 1DAC cycle into the first half and the second half as shown in FIG. 3, but the present invention is not limited to this, and the 1DAC cycle is not limited to this. It may be divided into 1/3, 1/4,... And each process may be performed in units of those sections. In addition, each process may be performed without dividing one DAC period, and when dividing one DAC period, the period length of the section may not be divided into equal parts. Furthermore, it does not matter how the 1DAC cycle is divided. Anyway, it is sufficient that the waveform memory access by the read / write circuit 31 and the waveform memory access by the X access circuit can be divided in time.
[0065]
【The invention's effect】
As described above, in the present invention, the storage means built in the access means for accessing the waveform memory under the control of the control means allows the waveform data to be written to the waveform memory or the waveform data from the waveform memory. Are read out, and a buffer for temporarily storing waveform data when the data is read out and a buffer for codec that is temporarily stored by the control means for handling the waveform data. As a result, the sound source device can be provided with the codec function without adding a buffer. In this case, in each buffer constituted by being divided, the interrupt condition to the control means and the data request generation condition can be changed. Therefore, even if the storage means is divided to constitute the buffer, Each buffer can be used efficiently.
In addition, the codec function allows waveform data to be exchanged between the mixer unit of the sound source device that operates in synchronization with a predetermined sampling period and the control unit (CPU) that operates at a timing independent of the sampling period. it can. In particular, since the output destination / input source of the codec function is the mixer means, the following operation is possible by setting the mixer.
(1) It is possible to apply an effect to the waveform data generated by the musical sound generating means by the effect applying means and pass it to the control means (recording).
(2) The effect can be applied to the waveform data (software sound source or the like) supplied by the control unit.
(3) The waveform data generated by the musical tone generation means can be transferred to the control means, and an effect can be given by the control means (soft effect) and returned to the mixer means.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a configuration example of a musical sound generating apparatus having a sound source device including a waveform memory according to an embodiment of the present invention.
FIG. 2 is a diagram illustrating a detailed configuration of a sound source unit that is a sound source device including the waveform memory according to the embodiment of the present invention.
FIG. 3 is a diagram illustrating an operation timing of the sound source device including the waveform memory according to the embodiment of the present invention.
FIG. 4 is a functional block diagram for explaining a data flow of the sound source device according to the embodiment of the present invention.
FIG. 5 is a diagram showing CPU access timing in the sound generator device according to the embodiment of the present invention;
FIG. 6 is a diagram showing a FIFO division form in the sound source device according to the embodiment of the present invention;
FIG. 7 is a diagram showing an aspect of an interrupt and a data request threshold when reading from the FIFO in the sound source device according to the embodiment of the present invention;
FIG. 8 is a diagram showing an aspect of an interrupt and a data request threshold at the time of writing from the FIFO in the tone generator according to the embodiment of the present invention;
FIG. 9 is a block diagram showing a configuration of a conventional waveform memory sound source.
[Explanation of symbols]
1 musical tone generator, 5 control means, 10 CPU, 11 timer, 12 ROM, 13 RAM, 14 disk, 15 drive, 16 MIDI interface, 17 network interface, 18 panel SW, 19 panel display, 20 tone generator, 21 waveform Memory, 22 External circuit, 23 DAC, 24 sound system, 25 bus, 30 Sound source control register, 31 Read / write circuit, 32 EG assigning circuit, 33 Mixer, 35 Selector, 40 X access circuit, 41a CPU access area, 41b Input codec area, 41c Output codec area, 42 XA register, 43 pointer register, 44 FIFO control register, 51 sound source means, 52 writing means, 52 writing means, 53 mixer means, 120 sound source section, 121 waveform memory, 122 External circuit 130 tone generator control register, 131 read-write circuit, 132 EG applying circuit, 133 a mixer, 134 DSP, 140 X access circuit, 141 FIFO, 142 XA register

Claims (4)

波形データが読み書き可能な波形メモリと、
該波形メモリから波形データを読み出し、読み出した波形データに基づいて周期がサンプリング周期とされている楽音波形データを生成する楽音生成手段と、
前記楽音生成手段の生成した楽音波形データを含む波形データが入力され、ミキシング処理を行って、周期がサンプリング周期とされている混合された波形データを出力するミキシング手段と、
前記楽音生成手段および前記ミキシング手段の動作を制御する制御手段と、
前記楽音生成手段が前記波形メモリをアクセスしていない時間において、前記制御手段の制御の基で、前記波形メモリの波形データの連続的な読み出しあるいは書き込みのアクセスを行うとともに、前記ミキシング手段からサンプリング周期ごとに入力する波形データを前記制御手段へ受け渡しするアクセス手段と、
該アクセス手段に内蔵されている記憶手段とを備え、
前記アクセス手段は、前記記憶手段の第1領域を、前記制御手段の制御の基で行われる前記波形メモリの読み出し時に読み出された波形データを前記制御手段に受け渡しするために一時的に記憶するバッファ、および、書き込み時の波形データを前記波形メモリに受け渡しするために一時的に記憶するバッファとして使用するとともに、前記記憶手段の第2領域を、前記ミキシング手段から入力する波形データを前記制御手段に受け渡しするために一時的に記憶するバッファとして使用可能とされていることを特徴とする音源装置。
Waveform memory that can read and write waveform data,
It reads waveform data from the waveform memory, a tone generation means for periodically based on the read waveform data to generate tone waveform data which is the sampling period,
The waveform data including the generated tone waveform data of the tone generating means is input, and mixing means for performing mixing processing, period and outputs the waveform data mixed there is a sampling period,
Control means for controlling the operation of the tone generation means and the mixing means;
During the time when the musical sound generating means is not accessing the waveform memory, the waveform data in the waveform memory is accessed for continuous reading or writing under the control of the control means, and the sampling period from the mixing means Access means for transferring waveform data to be input every time to the control means;
Storage means built in the access means,
Said access means, wherein a first region of the storage means, the control means temporarily stored in order to pass to the control means the waveform data read out during the reading the waveform memory is carried out by the control of the And a buffer for temporarily storing waveform data at the time of writing to the waveform memory, and the second area of the storage means is used to control the waveform data input from the mixing means. A sound source device characterized in that it can be used as a buffer for temporary storage for delivery to a means.
波形データが読み書き可能な波形メモリと、
該波形メモリから波形データを読み出し、読み出した波形データに基づいて周期がサンプリング周期とされている楽音波形データを生成する楽音生成手段と、
前記楽音生成手段の生成した楽音波形データを含む波形データが入力され、ミキシング処理を行って、周期がサンプリング周期とされている混合された波形データを出力するミキシング手段と、
前記楽音生成手段および前記ミキシング手段の動作を制御する制御手段と、
前記楽音生成手段が前記波形メモリをアクセスしていない時間において、前記制御手段の制御の基で、前記波形メモリの波形データの連続的な読み出しあるいは書き込みのアクセスを行うとともに、前記制御手段から順次入力される波形データをサンプリング周期ごとに前記ミキシング手段へ出力するアクセス手段と、
該アクセス手段に内蔵されている記憶手段とを備え、
前記アクセス手段は、前記記憶手段の第1領域を、前記制御手段の制御の基で行われる前記波形メモリの読み出し時に読み出された波形データを前記制御手段に受け渡しするために一時的に記憶するバッファ、および、書き込み時の波形データを前記波形メモリに受け渡しするために一時的に記憶するバッファとして使用するとともに、該記憶手段の第2領域を、前記制御手段から前記ミキシング手段に入力される波形データを一時的に記憶するバッファとして使用可能とされていることを特徴とする音源装置。
Waveform memory that can read and write waveform data,
It reads waveform data from the waveform memory, a tone generation means for periodically based on the read waveform data to generate tone waveform data which is the sampling period,
The waveform data including the generated tone waveform data of the tone generating means is input, and mixing means for performing mixing processing, period and outputs the waveform data mixed there is a sampling period,
Control means for controlling the operation of the tone generation means and the mixing means;
During the time when the tone generation means is not accessing the waveform memory, the waveform data in the waveform memory is accessed for continuous reading or writing under the control of the control means, and sequentially input from the control means. Access means for outputting the waveform data to be mixed to the mixing means for each sampling period;
Storage means built in the access means,
Said access means, wherein a first region of the storage means, the control means temporarily stored in order to pass to the control means the waveform data read out during the reading the waveform memory is carried out by the control of the And a buffer for temporarily storing waveform data at the time of writing to the waveform memory , and a second area of the storage means is input from the control means to the mixing means A sound source device that can be used as a buffer for temporarily storing waveform data.
前記記憶手段における前記第1領域のサイズと前記第2領域のサイズとを、ユーザの指示あるいは動作状況に応じてそれぞれ変更可能とされていることを特徴とする請求項1あるいは2記載の音源装置。  3. The sound source device according to claim 1, wherein the size of the first area and the size of the second area in the storage unit can be changed according to a user instruction or an operation state, respectively. . さらに、前記第1領域および前記第2領域であるバッファにおける波形データの状態を検出し、前記制御手段に対してデータ受取あるいはデータ供給の要求を発生する検出手段と、
該検出手段における検出条件を変更する条件変更手段とを有し、
前記制御手段は、該データ受取あるいはデータ供給の要求に応じて、該要求に対応する領域であるバッファからのデータ受取あるいは該バッファへのデータ供給を実行するようにしたことを特徴とする請求項1ないし2記載の音源装置。
Furthermore, detecting means for detecting a state of waveform data in the buffer which is the first area and the second area, and generating a request for data reception or data supply to the control means,
Condition changing means for changing detection conditions in the detecting means;
The control means executes data reception from a buffer which is an area corresponding to the request or data supply to the buffer in response to the data reception or data supply request. The sound source device according to 1 or 2.
JP2002042750A 2002-02-20 2002-02-20 Sound generator Expired - Fee Related JP3695405B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002042750A JP3695405B2 (en) 2002-02-20 2002-02-20 Sound generator

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002042750A JP3695405B2 (en) 2002-02-20 2002-02-20 Sound generator

Related Child Applications (1)

Application Number Title Priority Date Filing Date
JP2005085577A Division JP3922289B2 (en) 2005-03-24 2005-03-24 Sound generator

Publications (2)

Publication Number Publication Date
JP2003241755A JP2003241755A (en) 2003-08-29
JP3695405B2 true JP3695405B2 (en) 2005-09-14

Family

ID=27782755

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002042750A Expired - Fee Related JP3695405B2 (en) 2002-02-20 2002-02-20 Sound generator

Country Status (1)

Country Link
JP (1) JP3695405B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6904141B2 (en) 2017-07-28 2021-07-14 カシオ計算機株式会社 Music generators, methods, programs, and electronic musical instruments
JP6922614B2 (en) 2017-09-27 2021-08-18 カシオ計算機株式会社 Electronic musical instruments, musical tone generation methods, and programs

Also Published As

Publication number Publication date
JP2003241755A (en) 2003-08-29

Similar Documents

Publication Publication Date Title
US6665409B1 (en) Methods for surround sound simulation and circuits and systems using the same
JP5534388B2 (en) Music generator
JPH05143070A (en) Automatic performance device
EP1580729B1 (en) Sound waveform synthesizer
JP5614420B2 (en) Musical sound generating apparatus, electronic musical instrument, program, and musical sound generating method
JP2012215861A (en) Audio data input device and output device
JP3672159B2 (en) Sound source system
JP3163984B2 (en) Music generator
JP3695405B2 (en) Sound generator
JP2679540B2 (en) Memory controller
JP3744440B2 (en) Mixing device, musical tone generator, and large-scale integrated circuit for mixing
JP3922289B2 (en) Sound generator
JP5915420B2 (en) Musical sound generating device, musical sound generating method, electronic musical instrument and program
US6477177B1 (en) Multiple device access to serial data stream
JP3695404B2 (en) Waveform processing device
JP3815353B2 (en) Multitrack playback device, multitrack recording device and multitrack recording / playback device
JP3791162B2 (en) Signal processing device
JP3781171B2 (en) Music generation method
WO1998005027A1 (en) Vertical wavetable cache architecture
JP3723973B2 (en) Sound generator
JP4254677B2 (en) Musical sound generator and musical sound generation processing program
JP5510813B2 (en) Music generator
JP3852634B2 (en) Musical sound generating device, musical sound generating method, and storage medium storing a program related to the method
JP5360474B2 (en) Music generator
JPH0419874A (en) Digital multitrack recorder

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20050114

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20050125

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050324

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20050607

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20050620

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20090708

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20100708

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20100708

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20110708

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20110708

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20120708

Year of fee payment: 7

LAPS Cancellation because of no payment of annual fees