JP3723973B2 - Sound generator - Google Patents

Sound generator

Info

Publication number
JP3723973B2
JP3723973B2 JP2000346173A JP2000346173A JP3723973B2 JP 3723973 B2 JP3723973 B2 JP 3723973B2 JP 2000346173 A JP2000346173 A JP 2000346173A JP 2000346173 A JP2000346173 A JP 2000346173A JP 3723973 B2 JP3723973 B2 JP 3723973B2
Authority
JP
Japan
Prior art keywords
waveform
processing
read
channel
circuit
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
JP2000346173A
Other languages
Japanese (ja)
Other versions
JP2001166777A (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 JP2000346173A priority Critical patent/JP3723973B2/en
Publication of JP2001166777A publication Critical patent/JP2001166777A/en
Application granted granted Critical
Publication of JP3723973B2 publication Critical patent/JP3723973B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Electrophonic Musical Instruments (AREA)

Description

【0001】
【発明の属する技術分野】
この発明は、ディジタル楽音波形データを生成出力する音源装置に関し、詳しくは、1つのDSPを用いて録音用波形処理と再生用波形処理の両方を並列に実行可能にした音源装置に関する。
【0002】
【従来の技術】
従来より、各種の方式の音源装置が知られている。このような音源装置で生成された楽音は、DSP(ディジタル・シグナル・プロセッサ)によりエフェクト
(効果)付与などを施して放音される。
【0003】
【発明が解決しようとする課題】
一方、このような音源装置では、外部の楽音をサンプリングして波形メモリに格納(録音)し楽音生成に用いるようにしたものも知られている。楽音のサンプリングのためには、通常、音源装置に外部の楽音を取り込むためのサンプリング用の回路を設ける。
【0004】
ところで、近年、音源装置の機能に対する要求は高度化し、装置の構成は複雑にすることなく音源装置の機能を向上化させたいという要求がある。しかし、装置の構成を複雑にすることなく、発音中にサンプリングしたり、一旦サンプリングして波形メモリに書き込んだ波形データを読み出して効果付与などを施した後に再度波形メモリに書き込むリサンプリングなどを行なうことはできなかった。すなわち、装置の構成を複雑にすることなく、録音用波形処理と再生用波形処理を共に行なうことができなかった。
【0005】
この発明は、各種の方式の音源装置において、装置構成をそれ程複雑にすることなく、録音用波形処理と再生用波形処理を共に実行できるようにすることを目的とする。
【0006】
【課題を解決するための手段】
この目的を達成するため、請求項1の発明に係る音源装置は、楽音波形を録音するための記憶手段と、前記記憶手段に楽音波形を書き込むとともに、前記記憶手段に記憶された楽音波形を読み出す読み書き手段と、ロードされたプログラムに応じて信号処理を実行するプログラマブル信号処理手段と、前記読み書き手段、前記プログラマブル信号処理手段、外部回路、及びサウンドシステムに接続されたミキサと、録音動作または再生動作を指示する指示手段と、(i)前記指示手段により録音動作が指示されていたときは、前記プログラマブル信号処理手段に所定の第1のプログラムをロードするとともに、前記外部回路から供給される楽音波形が前記ミキサを介して前記プログラマブル信号処理手段に供給され、かつ、前記プログラマブル信号処理手段の出力信号が前記ミキサを介して前記読み書き手段に供給されるよう前記ミキサを設定して、前記外部回路からの楽音波形が、前記プログラマブル信号処理手段で前記第1のプログラムに従う録音用の信号処理を施されて、前記読み書き手段により前記記憶手段に記憶されるよう制御し、(ii)前記指示手段により再生動作が指示されていたときは、前記プログラマブル信号処理手段に所定の第2のプログラムをロードするとともに、前記読み書き手段により前記記憶手段から読み出された楽音波形が前記ミキサを介してプログラマブル信号処理手段に供給され、かつ、前記プログラマブル信号処理手段の出力信号が前記ミキサを介して前記外部のサウンドシステムに供給されるよう前記ミキサを設定して、前記読み書き手段が読み出した当該楽音波形が、前記プログラマブル信号処理手段で前記第2のプログラムに従う再生用の信号処理を施されて、前記サウンドシステムで再生されるように制御する制御手段と、を備えたことを特徴とする。
【0009】
請求項の発明に係る音源装置は、請求項1において、前記プログラマブル信号処理手段をディジタル・シグナル・プロセッサとしたものである。
【0010】
【発明の実施の形態】
以下、図面を用いてこの発明の実施の形態を説明する。
【0011】
図1は、この発明に係る音源装置を適用した電子楽器の全体のブロック構成を示す。図2は、図1の音源部の詳細なブロック構成を示す。なお、以下で説明する各図面において、同一の番号は同一のものを示すものとする。
【0012】
図1を参照して、この電子楽器の全体構成を説明する。この電子楽器は、鍵盤101、表示部102、スイッチ群(SW)103、中央処理装置(CPU)104、リードオンリメモリ(ROM)105、ランダムアクセスメモリ(RAM)106、外部記憶装置107、音源部108、波形メモリ109、外部回路110、遅延メモリ111、ディジタルアナログ変換器(DAC)112、サウンドシステム(SS)113、およびバスライン114を備えている。鍵盤101、表示部102、スイッチ群103、CPU104、ROM105、RAM106、外部記憶装置107、および音源部108は、バスライン114により相互に接続されている。
【0013】
鍵盤101は、ユーザが演奏操作するための複数の鍵を備えた鍵盤である。表示部102は、電子楽器のパネル上に設けられており、各種の情報を表示する。スイッチ群103は、パネル上に設けられており、ユーザはこれを操作することにより電子楽器に対して各種の指示を与えることができる。CPU104は、この電子楽器全体の動作を制御する。特に、通常の演奏時には、鍵盤101の操作を検出し、その操作に応じて音源部108に発音の指示を出す。ROM105は、CPUが実行するプログラム(音源部108を制御するための音源コントロールプログラムなど)や各種の定数データなどを格納する。RAM106は、ワークレジスタなどに用いる。外部記憶装置107には、後述するDRAM構成の波形メモリ109にロードする波形データなどが格納されている。
【0014】
音源部108は、CPU104の指示に応じて、波形メモリ109から波形データ(波形サンプル)を読み出し、補間、エンベロープ付与(音量変化制御)、チャンネル累算(ミキシング)、および効果(エフェクト)付与などの加工を施して、楽音波形データとして出力する。音源部108から出力された楽音波形データは、DAC112によりアナログ信号に変換され、サウンドシステム113により放音される。
【0015】
波形メモリ109は、DRAM(ダイナミックRAM)により構成されている。波形メモリ109には、所定のレートでサンプリングされた波形サンプルデータが格納されている。1つの波形サンプルは16ビット非圧縮形式であり、アドレスは波形サンプル単位に付けられている。すなわち、1アクセスで1つの波形サンプルが読み出せる。波形サンプルは、楽音の発音に先立って外部記憶装置107から読み出して波形メモリ109に格納してもよいが、特にこの実施の形態の音源では、複数チャンネル分の楽音発生の動作を行なう際に使用されなかった空きタイムスロットを別の用途に用いることができるようになっているので、楽音発生の動作中にその空きタイムスロットを用いて波形データを外部記憶装置107から読み出して波形メモリ109に格納してもよい。
【0016】
外部回路110については、後に詳しく説明する。遅延メモリ111は、音源部108内にある信号処理回路(DSP)で用いる遅延用のメモリである。楽音波形に効果付与などの処理を施す際に、例えばあるタイミングであるデータを遅延メモリ111に書き込み、所定のクロックの後に読み出して演算に用いるというようにして、遅延したデータを得るのに遅延メモリ111を用いる。
【0017】
図2を参照して、音源部108について詳しく説明する。図2において、音源部108は、制御レジスタ201、読み書き回路202、音量変化制御回路203、ミキサ204、信号処理回路205、およびインターフェース206を備えている。この音源部108は時分割32チャンネルで動作する。音源部108内の各部には、時分割動作を行なうための基準信号となる制御クロック信号や0〜31を繰り返しカウントするチャンネルカウント値などの制御信号が供給されている。
【0018】
図2において、制御レジスタ201は、CPU104から送出された各種の指定情報(音源部108に対する命令やパラメータ情報)を格納するための制御レジスタである。制御レジスタ201内にはXアクセス処理を制御するXアクセス回路304が設けられているが、これについては後に詳述する。CPU104は、制御レジスタ201に所定の指定情報をセットして発音の開始指示を出す。セットする指定情報としては、割り当てチャンネル、波形メモリ読み出しピッチ(周波数ナンバ)、波形メモリ読み出し区間、エンベロープパラメータ、ミキサ204に対する設定情報、およびエフェクト用係数などがある。
【0019】
あるチャンネルにおける発音開始指示を受けると、音源部108は楽音波形の発生の動作を開始する。まず、読み書き回路202は、波形メモリ109の読み出しアドレスを順次発生する。読み出しアドレスは、指定された読み出し区間の先頭から、指定された読み出しピッチを順次累算した値である。特に、この音源部108では、読み書き回路202中に波形サンプルをバッファリングする波形バッファ(後述する図3の327)を備え、波形メモリ109からはチャンネルごとに必要な数の波形サンプル(波形データ)のみを読み出すようになっており、各チャンネルにおける波形メモリアクセス回数は可変できるようになっている。そこで、読み書き回路202は、各チャンネルにおいて必要なアクセス回数に応じた波形サンプルの読み出しアドレスを、時分割チャンネルタイミングとは異なるタイミングで、順次連続して出力するようになっている。読み書き回路202で発生した読み出しアドレスは、波形メモリ109に入力し、これにより時分割チャンネルタイミングとは異なるタイミングで波形サンプルが波形メモリ109から読み出される。読み書き回路202は、この波形サンプルを受け取り、内部の波形バッファに記憶し、補間処理を行なって楽音波形データとして出力する。
【0020】
読み書き回路202において、上述したように波形サンプルをバッファリングする波形バッファを備え、波形メモリ109からはチャンネルごとに必要な数の波形サンプルのみを読み出すようになっていることにより、空きタイムスロットが得られる。読み書き回路202は、この空きタイムスロットにおいて、後述するXアクセス処理、すなわちCPU104からの波形メモリ109へのアクセス、またはミキサ204からXアクセス回路304経由で戻ってくる楽音波形データの波形メモリ109への書き込みなどができるように動作する。
【0021】
音量変化制御回路203は、読み書き回路202から時分割で出力される各チャンネルの楽音波形データにエンベロープを付与して出力する。どのようなエンベロープを付与するかは、制御レジスタ201を介してCPU104から与えられたエンベロープパラメータに基づいて決定される。図2の音量変化制御回路203の出力ライン211に「32」と付してあるのは、音量変化制御回路203の出力が時分割32チャンネル分あることを示している。他の各部の入出力ラインに付してある数値も、同様にチャンネル数を示すものとする。
【0022】
ミキサ204には、音量変化制御回路203から出力される32チャンネル分の楽音波形データ、後述する信号処理回路205から出力される8チャンネル分の楽音波形データ、および後述する外部回路110から(インターフェース206を介して)出力される8チャンネル分の楽音波形データが、入力ライン211,212,213を介して入力する。ミキサ204は、これらの各入力ラインから入力した各チャンネルの楽音波形データにそれぞれ適宜係数(係数値はCPU104が制御レジスタ201を介して与える)を乗算してミキシングする。ミキサ204の出力は、8チャンネル分が信号処理回路205に、8チャンネル分が(インターフェース206を介して)外部回路110に、1チャンネル分が制御レジスタ201内のXアクセス回路304に、音源部108の最終的な出力となる2チャンネル(LおよびR出力)分がDAC112に、それぞれ出力ライン221,222,223,224を介して、出力されるようになっている。ミキサ204は、任意の入力ラインから入力した任意のチャンネルの楽音波形データに指定された係数を乗算してミキシングし、そのミキシング結果を任意の出力ラインの任意のチャンネルに送出できる。どの入力ラインのどのチャンネルの入力にどのような係数を乗算し、乗算結果をどのようにミキシングし、ミキシング結果をどの出力ラインに出力するかは、CPU104の指定に基づいて決定される。
【0023】
信号処理回路205は、内部のマイクロプログラムメモリにロードされたマイクロプログラムにしたがって動作するDSPであり、ミキサ204からの楽音波形データに対してチャンネルごとに独立に信号処理を行ない処理結果を再びミキサ204に戻す。信号処理回路205は、信号処理を行なう際に、必要に応じて遅延メモリ111を用いて遅延したデータを得る。信号処理回路205が実行するマイクロプログラムはCPU104が適宜ロードする。信号処理回路205の機能はロードするマイクロプログラムにより規定されるが、簡単に言うと、サンプリングやリサンプリングの際の波形処理、あるいは効果付与などの信号処理を行なうものである。このマイクロプログラムの具体的な設定については、図10および図11を参照して後述する。
【0024】
外部回路110は、例えば、外部から音声や楽音を取り込むためのアナログ/ディジタル変換器(ADC)、効果(エフェクト)付与処理を行なう外部DSP、あるいはディジタルフィルタなどである。ミキサ204から外部回路110への出力は8チャンネル分、外部回路110からミキサ204への入力は8チャンネル分であり、これらは当然独立に使用できるチャンネルであるので、複数の外部回路(当然、異なる処理を行なうものでもよい)110を任意の入出力ラインの任意のチャンネルに(インターフェース206を介して)接続可能である。なお、「外部」というのは音源部108から見て「外部」であるということであり、外部回路110は図1の電子楽器中に設けてもよいし、図1の電子楽器の外部に設けてもよい。
【0025】
上述したように、ミキサ204は任意の入力ライン211〜213から入力した任意のチャンネルの楽音波形データに指定された係数を乗算してミキシングし、そのミキシング結果を任意の出力ライン221〜224の任意のチャンネルに送出できるようになっているから、例えば、以下の▲1▼〜▲4▼のような処理を行なうことができることになる。
【0026】
▲1▼外部回路110としてADCを用いて、マイクロフォンなどから入力したアナログ信号をディジタル信号に変換してミキサ204に入力させる。ミキサ204では、この外部からの楽音信号を、音源部108内部で波形メモリ109から波形データを読み出して発生した楽音とミキシングして、DAC112への出力ライン224に出力する。必要に応じてミキサ204の出力を、DAC112に出力する代わりに一旦信号処理回路205や他の外部回路110に入力し、信号処理回路205や他の外部回路110を用いて効果付与処理などの波形処理を行なった後にDAC112に出力するようにしてもよい。
【0027】
▲2▼外部の楽音のサンプリングを行なうことができる。すなわち、外部回路110としてADCを用いて、マイクロフォンなどから入力したアナログ信号をディジタル信号に変換してミキサ204に入力させる。ミキサ204では、この外部からの楽音信号を、例えば音源部108内部で波形メモリ109から波形データを読み出して発生した楽音とミキシングして、Xアクセス回路304への出力ライン223に出力し、読み書き回路202経由で波形メモリ109に書き込むようにする。必要に応じてミキサ204の出力を、Xアクセス回路304への出力ライン223に出力する代わりに信号処理回路205や外部回路110に入力し、信号処理回路205や外部回路110を用いて効果付与処理などの波形処理を行なった後にXアクセス回路304に出力するようにしてもよい。
【0028】
▲3▼リサンプリング(サンプリングなどにより波形メモリ109上に用意されている波形に、加工を施して再び波形メモリ109に書き込む処理)を行なうことができる。すなわち、サンプリングなどにより波形メモリ109に記憶してある波形データを、読み書き回路202の所定の発音チャンネルを利用して読み出して、ミキサ204に入力させる。2つ以上の波形を混合して再書き込みするリサンプリングの場合もあるので、ここで読み出す波形データは1ないし複数の波形データである。ミキサ204では、この楽音信号を信号処理回路205や外部回路110に流し、必要に応じて種々の波形処理を行なわせ、その結果を得る。波形処理が施された楽音信号を受けたミキサ204は、その楽音信号をXアクセス回路304への出力ライン223に出力し、読み書き回路202経由で波形メモリ109に書き込む。なお、ミキサ204における最初のミキシング結果を、信号処理回路205や外部回路110に流さずに、そのままXアクセス回路304へ供給するようにしてもよい。
【0029】
▲4▼外部回路110としてDSPやディジタルフィルタを用いて、あるいは信号処理回路205を用いて、ミキサ204から取り出した楽音波形に効果付与処理やフィルタリング処理を行ない、処理結果をミキサ204に戻す。ミキサ204では、処理された楽音波形を、音源部108内部で発生した楽音とミキシングしてDAC112への出力ライン224やXアクセス回路304への出力ライン223に出力する。
【0030】
なお、上記▲1▼〜▲4▼は本実施形態において実現できる処理例を示したものであり、音源部108内の時分割処理の処理時間が確保でき、必要なマイクロプログラムが信号処理回路205にロードできるならば、上記▲1▼〜▲4▼を含め外部回路110と信号処理回路205の各種機能を任意に組み合わせて楽音波形に対する処理を行ない、DAC112に出力したり、Xアクセス回路304経由で読み書き回路202に戻して波形メモリ109に書き込むようにできる。
【0031】
図3は、音源部108内の制御レジスタ201および読み書き回路202の詳細なブロック構成を示す。なお、図3に示されている回路のうち、制御レジスタ201は、制御レジスタのすべてを示したものでなく、その一部分を示したものである。制御レジスタ201には、図3に示したもの以外に、エンベロープパラメータ、ミキサの設定、およびエフェクト用係数などの他の制御データも記憶されている。
【0032】
制御レジスタ201は、レジスタ301、レジスタ302、優先フラグ303、および、Xアクセス回路304を備えている。レジスタ301,302は、CPU104から楽音生成を指示する際に送出される各種指示情報を格納する。具体的には、レジスタ301は、例えば波形読み出しのための読み出しアドレス(相対アドレス)の初期値AS、波形データのループ部のデータ長LPA、ピッチPITCHなどを格納する。レジスタ302は、読み出すべき波形データのループ部の先頭を示す絶対アドレスWAを格納する。なお、読み出しアドレスの初期値ASは、波形データのループ部の先頭位置(すなわちアタック部の末尾)を基準とした相対アドレスであるので、負の値に設定されている。波形データの読み出しは、絶対アドレスWAより初期値ASで示される分だけ前の位置からスタートする。波形データのループ部のデータ長LPAは、ループ部末尾位置の相対アドレス(正値)である。
【0033】
Xアクセス回路304は、XAレジスタ311、セレクタ312、FIFO(First In First Out(先入れ先出し)の8段のレジスタ)313、Xフラグ314、およびサンプル数レジスタ315を備えている。Xアクセス回路304は、後述するXアクセス処理(CPU104からの波形メモリ109のアクセス、およびミキサ204から出力ライン223を介して送出された楽音波形データの波形メモリ109への書き込み)を、楽音発生のための波形メモリ読み出しと並行して実行するための制御を行なう回路である。優先フラグ303は、Xアクセス処理を優先的に行ないたい場合にオンされるフラグである。Xアクセス回路304の動作および機能、並びに、Xアクセス処理および優先フラグ303の使い方については後述する。
【0034】
読み書き回路202は、処理A演算回路321、アドレスRAM(ARAM)322、アキュムレータ(ACC)323、制御RAM324、処理B演算回路325、補間回路326、波形バッファ327、取り込み回路328、およびセレクタ(SEL)329,330を備えている。
【0035】
図3の制御レジスタ201および読み書き回路202では、大きくは、処理A、処理B、取り込み処理、補間処理、およびXアクセス処理の5つの処理を行なう。各処理の概要は以下の通りである。処理Aは、主として処理A演算回路321により実行される処理であり、具体的には、楽音生成のために時分割チャンネルタイミングにしたがって各チャンネルのアドレス(波形サンプル読み出しアドレス(相対アドレス))を作成する処理である。各チャンネルのアドレスは、ARAM322に保持される。処理Bは、主として処理B演算回路325により実行される処理であり、具体的には、楽音生成のために、時分割チャンネルタイミングとは異なるタイミングで、アドレスWMA(波形サンプル読み出しアドレス(絶対アドレス))をセレクタ329を介して波形メモリ109に向けて送り出す処理である。取り込み処理は、主として取り込み回路328により実行される処理であり、具体的には、処理Bにより波形メモリ109に送り出されたアドレスにしたがって読み出された波形サンプルをセレクタ330を介して取り込み、各チャンネル別に波形バッファ327に書き込む処理である。処理Bと取り込み処理が行なわれるときは、セレクタ329と330は、処理B演算回路325から出力されるアドレスWMAが波形メモリ109のアドレス端子に入力して、波形メモリ109から読み出された波形サンプルが取り込み回路328に取り込まれるように、選択制御される。補間処理は、補間回路326により実行される処理であり、具体的には、時分割チャンネルタイミングにしたがって、波形バッファ327から各チャンネルの波形サンプルを読み出し、補間を行なって補間済みサンプル(楽音波形データ)を生成出力する処理である。補間回路326から出力された楽音波形データは、図2の音量変化制御回路203に入力する。Xアクセス処理は、主としてXアクセス回路304の制御のもとで実行される処理であり、具体的には、上記処理Bおよび取り込み処理で波形メモリ109をアクセスするタイムスロット以外のタイムスロットで、CPU104からの波形メモリ109のアクセスおよびミキサ204から出力ライン223を介して送出された楽音波形データの波形メモリ109への書き込みを行なう処理である。Xアクセス処理の際には、セレクタ329と330は、XAレジスタ311に格納されているアドレスが波形メモリ109のアドレス端子に入力し、波形メモリ109のデータラインがFIFO313に接続するように、選択制御される。以上の5つの処理の詳細については後述する。
【0036】
図4は、図3の制御RAM324の構成を示す。詳しくは後述するが、処理Aでは、各チャンネルのアドレス作成と並行して、各チャンネルについて読み出すべき必要サンプル数を求めて制御RAM324に格納する処理を行なう。そのため、制御RAM324は、チャンネル番号(CH番号)とそのチャンネルにおいて読み出すべきサンプル数を格納する領域が複数用意されて構成される。読み書き回路202内には書き込みポインタおよび読み出しポインタが備えられており、各チャンネルにおいて読み出すべき必要サンプル数を制御RAM324に書き込むとき(処理A)は書き込みポインタをすすめ、制御RAM324からチャンネル番号とサンプル数を読み出して当該チャンネルに関する読み出しアドレスを送出するとき(処理B)は読み出しポインタを進める。制御RAM324は、リング状に使用するようになっており、書き込みまたは読み出しポインタが制御RAM324の一方の端に至った場合、その次のポインタの位置は制御RAM324の他方の端になる。また、読み出しポインタの指す位置が書き込みポインタの指す位置を追いかけるように書き込みおよび読み出しが行なわれるが、書き込みポインタが読み出しポインタを追い越さない程度の領域の大きさが確保されているものとする。書き込みポインタおよび読み出しポインタは、アキュムレータ323と同様に、それぞれ、前半処理用のものと後半処理用のものとが別々に設けられている。単に、書き込みポインタおよび読み出しポインタと呼ぶときは、前半処理では前半処理用のもの、後半処理では後半処理用のものを指すものとする。前半処理は第0〜第15チャンネルの処理、後半処理は第16〜第31チャンネルの処理である(図8,9で後述する)。なお、図4のような構成のほか、各チャンネルに1つずつアドレスを対応させ、そこに必要サンプル数を書き込むようにしてもよい。
【0037】
図5は、図3のARAM322のメモリマップを示す。ARAM322は、処理Aにおいて各チャンネルのアドレスを作成するのに用いる領域である。ARAM322は、32チャンネル分(第0〜第31チャンネル)の各チャンネルごとの領域からなり、これらの領域に各チャンネルの現在のアドレス値を記憶する。各チャンネルの領域はアドレス上位ADH、およびアドレス下位ADLからなる。ADHおよびADLの領域の大きさはそれぞれ16ビットである。アドレス上位ADHとアドレス下位ADLとを合わせた32ビットのアドレス値は、アドレス整数部とアドレス小数部とに分けられる。アドレス整数部は23ビット、アドレス小数部は9ビットである。アドレス整数部は、波形メモリ109のアドレスと対応している。すなわち、アドレス整数部の1つの値に対応して、波形メモリ109の波形サンプルが1つ存在する。アドレス小数部は、それよりも細かい単位を示し、何点かの波形サンプルを用いた補間処理で用いる情報である。
【0038】
図6は、図3の波形バッファ(サンプルRAM)327の構成を示す。波形バッファ327は、各チャンネルごとの4つの再生サンプル格納領域からなる。4つの再生サンプル格納領域はリング状に使用する。すなわち、各チャンネルごとにポインタを設け、波形サンプルを書き込むときは、そのポインタで指す位置に書き込み、ポインタを1つ進める。ポインタは、例えば図6の第iチャンネルなら、再生サンプル1→2→3→4→1→2→…というように進める。
【0039】
次に、図3の制御レジスタ201および読み書き回路202で実行する上記5つの処理について詳しく説明する。始めにこれらの処理を実行するタイミングについて説明し、その後、各処理それぞれの詳細を説明する。
【0040】
図3、図8、および図9を参照して、読み書き回路202の要部の処理のタイミングの概要について説明する。図8において、「処理A」は、図3の主として処理A演算回路321により実行される処理Aを行なう区間を示す。「処理BおよびXアクセス処理」は、図3の主として処理B演算回路325により実行される処理B、およびXアクセス回路304の制御のもとで実行されるXアクセス処理を行なう区間を示す。「取り込み処理およびXアクセス処理」は、図3の主として取り込み回路328により実行される取り込み処理、およびXアクセス回路304の制御のもとで実行されるXアクセス処理を行なう区間を示す。「補間処理」は、図3の補間回路326により補間処理を行なう区間を示す。
【0041】
「処理A」および「補間処理」の処理区間は、1サンプリング周期を前半区間と後半区間に分け、前半区間で第0〜第15チャンネルの処理を行ない、後半区間で第16〜第31チャンネルの処理を行なうようになっている。すなわち、前半区間(処理A前半区間)801で第0〜第15チャンネルに関する処理Aを、後半区間(処理A後半区間)811で第16〜第31チャンネルに関する処理Aを、前半区間(補間前半区間)806で第0〜第15チャンネルに関する補間処理を、後半区間(補間後半区間)816で第16〜第31チャンネルに関する補間処理を、それぞれ実行する。「処理BおよびXアクセス処理」の処理区間では、1サンプリング周期を前半区間と後半区間に分けたそれぞれの区間の前側区間802,812で処理Bを行ない、後側区間803,813でXアクセス処理を行なう。第0〜第15チャンネルの処理Bを行なう処理B前半区間802は、当該チャンネルの処理Aを行なう処理A前半区間801が終了した直後から開始され、必要な処理Bが行なわれた後の空き時間の区間803でXアクセス処理が行なわれる。同様に、第16〜第31チャンネルの処理Bを行なう処理B後半区間812は、当該チャンネルの処理Aを行なう処理A後半区間811が終了した直後から開始され、必要な処理Bが行なわれた後の空き時間の区間813でXアクセス処理が行なわれる。取り込み処理は、処理Bのアドレス送り出しのタイミングにしたがって行なわれるから、取り込み処理についても同様に、1サンプリング周期を前半区間と後半区間に分けたそれぞれの区間の前側区間804,814で取り込み処理を行ない、後側区間805,815でXアクセス処理を行なう。取り込み処理の後、各チャンネルの波形サンプルが波形バッファ327に揃うことが保証されるタイミングで開始される区間806,816で時分割チャンネルタイミングにしたがって各チャンネルの補間処理を行なう。
【0042】
図9は、図8の前半処理の各処理中のチャンネルの様子を示す。図9の「処理A前半ch」は、図8の区間801におけるチャンネルの様子を示す。図9の「処理B前半chおよびXアクセス処理」は、図8の区間802,803におけるチャンネルの様子を示す。図9の「取り込み前半chおよびXアクセス処理」は、図8の区間804,805におけるチャンネルの様子を示す。図9の「補間前半ch」は、図8の区間806におけるチャンネルの様子を示す。後半処理も同様である。なお、図9では各チャンネルタイミングを縦に並べて揃えて記載しているが、実際には各処理のタイミングは図8に示すようにずれている。
【0043】
この実施の形態では、図9からも分かるように、処理A演算回路321によるアドレス作成の処理Aと補間回路326による補間処理は、それぞれ、1サンプリング周期を等分割した時分割チャンネルタイミングにしたがって順番にチャンネルごとの処理が行なわれる。一方、処理B演算回路325からのアドレス送り出しの処理Bと取り込み回路328による波形データの取り込みの処理は、時分割チャンネルタイミングとは独立したタイミングで動作する。
【0044】
例えば、図8および図9において、処理A前半区間801では、処理A演算回路321により、第0〜第15チャンネルについて時分割チャンネルタイミングにしたがって順番に各チャンネルのアドレスを作成している。処理B前半区間802では、処理B演算回路325により、時分割チャンネルタイミングとは異なるタイミングで、第0チャンネルのアドレスを1つ、第2チャンネルのアドレスを3つ、第5チャンネルのアドレスを1つ、…というように、第0〜第15チャンネルのアドレスの送り出しを行なっている。1アドレス送り出しを行なう区間の時間幅は、時分割チャンネルタイミングで1チャンネル分の処理を行なう区間の時間幅の1/4である。したがって、1チャンネル分の処理を行なう時間幅で波形メモリを4アクセスできる。各チャンネルで送り出すアドレスの個数が区々であるのは、波形バッファ(サンプルRAM)327に過去の波形データ(再生サンプル)が保持されており各チャンネルごとに必要な個数の波形データのみ読み出せば充分なため、あるいは発音する必要がなくアドレスの送り出しが不要なチャンネルがあるためである。ここ(図9)では、それぞれ、第0チャンネルは1アクセス、第2チャンネルは3アクセス、第5チャンネルは1アクセス、第7チャンネルは2アクセス分の波形メモリからの読み出しが必要な場合を示している。その他のチャンネルは、発音していないか、既に読み出して波形バッファ327に記憶されたサンプルのみで楽音が生成できるチャンネルである。なお、発音していないチャンネルとは、音量変化制御回路203などで音量レベルの下げられたチャンネルであり、そのチャンネルに関しては処理Bにおける波形メモリのアクセスタイミングを使用しないように、制御がなされている。
【0045】
取り込み前半区間804では、処理B前半区間802のアドレス送り出しのタイミングにしたがって波形メモリ109から読み出された波形データを取り込んでいる。補間回路326は、補間前半区間806で時分割チャンネルタイミングにしたがって、波形バッファ327のデータを用いて第0〜第15チャンネルに関する補間処理を行なう。あるチャンネルについて補間を行なう時点で、補間を行なうために必要な当該チャンネルの波形データは波形バッファ327に用意されているようになっている。
【0046】
以上のようなタイミングで、第0〜第15チャンネルの楽音波形データが生成される。後半の区間を用いて処理される第16〜第31チャンネルについても同様である。
【0047】
処理B演算回路325におけるアドレス送り出しの処理Bおよび取り込み回路328における波形データ取り込みの処理が必要なアクセス数だけ時分割チャンネルタイミングとは異なるタイミングで行なわれることにより、空きタイムスロットが出現する。図9の「処理B前半chおよびXアクセス処理」および「取り込み前半chおよびXアクセス処理」の区間中、「−ch」は何れのチャンネルのサンプル読み出しにも使用されていない空きタイムスロットを示す。この空きタイムスロットの区間803,805は、任意に使用可能である。そこで、処理B演算回路325は、この空きタイムスロットの区間でセレクタ329,330を切り替え、Xアクセス処理(Xアクセス回路304の制御のもとで行なわれるCPU104による波形メモリ109へのアクセス処理、およびミキサ204から出力ライン223を介して戻ってくる楽音波形データの波形メモリ109への書き込み処理)が行なわれるようにする。
【0048】
なお、処理A演算回路321や処理B演算回路325を始めとして図3の制御レジスタ201および読み書き回路220の各部には、不図示のクロック発生部からの制御クロックが入力している。このクロックを基準として各部が動作することにより、図8,9に示すようなタイミングで各処理が実行される。
【0049】
次に、図3の制御レジスタ201および読み書き回路202による5つの処理について、以下の(1)〜(5)で詳細に説明する。
【0050】
(1)処理A演算回路321で実行する処理Aについて詳しく説明する。あるチャンネルで楽音の発音開始が指示されると、当該チャンネルに関する処理Aが処理A演算回路321で実行開始される。処理Aは、図8,9で説明したように時分割チャンネルタイミングで実行される。まず、1番始めの当該チャンネルのタイムスロット(ノートオン立上がり直後)で、処理A演算回路321は、当該チャンネルに対応するARAM322(図5)のアドレス格納領域(ADHとADL)を初期化する。初期値は、読み出すべき波形データの先頭アドレスAS(波形データのループ部の先頭位置を基準とした相対アドレスであるので負値)であり、CPU104が図3のレジスタ301を介して指定する。次回以降の当該チャンネルのタイムスロットで、処理A演算回路321は、当該チャンネルに対応するARAM322のアドレス格納領域の現アドレス値に、当該チャンネルにおけるアドレスの進み値(周波数ナンバ)であるピッチPITCHを加算する。加算結果は、元のARAM322のアドレス格納領域に格納される。ピッチPITCHは、CPU104が図3のレジスタ301を介して指定する。
【0051】
この加算は、具体的には、当該チャンネルの現アドレス値のアドレス小数部にピッチPITCHを加算し、加算結果のうちアドレス小数部のビット数より上位に溢れた値を現アドレス値のアドレス整数部に加算することにより行なう。この溢れ値は、新たに読み出すべき波形サンプルの数になっている。読み書き回路202では波形バッファ327にそれまでに読み出した波形サンプルが保持されており、上記溢れ値が波形メモリ上での読み出しアドレスの進み量になっているからである。先述した図9は、溢れ値が、第0チャンネルで1、第2チャンネルで3、第5チャンネルで1、第7チャンネルで2の場合である。なお、その他のチャンネルは、発音していない、または、溢れ値が0のチャンネルである。
【0052】
なお、波形メモリ109上の波形データはアタック部とそれに引き続くループ部とから構成され、波形データのループ部の先頭位置(すなわちアタック部の末尾)を基準として、読み出しアドレスの初期値AS(負値)およびループ部末尾位置の相対アドレスLPA(正値)が設定されている。波形サンプルのアクセスはアタック部の先頭から開始され(すなわち現アドレスが、負の相対アドレスASからスタートして徐々に増加する)、アタック部の読み出しが終わると現アドレス値が正の値になりループ部に入る。以後は必要に応じてループ部の波形サンプルを繰り返し読み出す。そのため、現アドレス値がループ部末尾位置(=相対アドレスLPA)を越えたときは、現アドレス値から値LPAを減算し、減算結果を新たな現アドレス値として設定する処理を行なう。現アドレス値には、後に波形データのループ部の先頭を示す絶対アドレスWAを加算する。処理A演算回路321は、上述のアドレスを作成する処理中で、このようなアドレスをループ部先頭付近に戻す処理も行なっている。
【0053】
以上のように、当該チャンネルのタイムスロットで、ARAM322上の現アドレスにピッチ(周波数ナンバ)を累算していき、当該チャンネルに関する順次アドレスをARAM322上に生成する。
【0054】
処理Aでは、上述した各チャンネルのアドレスを作成する処理の他、制御RAM324(図4)内の書き込み位置を指す書き込みポインタを1つ進め、各チャンネルごとの必要サンプル数を、制御RAM324の書き込みポインタで指す位置に格納する処理を行なう。各チャンネルごとの必要サンプル数は、上述の現アドレス値のアドレス小数部にピッチPITCHを加算した加算結果のうちアドレス小数部のビット数より上位に溢れた値に一致しているから、この溢れ値を得てチャンネル番号とともに制御RAM324に格納する。
【0055】
さらに、処理Aでは、上述の各チャンネルのアドレス作成、および各チャンネルに関する必要サンプル数の格納の処理の他、所定の複数のチャンネルごとに必要な波形メモリアクセス数(この実施の形態ではサンプル数とアクセス数とは一致する)を累算する処理をも行なう。具体的には、処理A演算回路321で、第0〜第15チャンネルのアドレス作成(前半処理)と並行してこれらのチャンネルについて読み出すべき必要なサンプル数を累算し、さらに第16〜第31チャンネルのアドレス作成(後半処理)と並行してこれらのチャンネルについて読み出すべき必要なサンプル数を累算する。
【0056】
アキュムレータ(ACC)323は、この累算を行なうためのアキュムレータである。読み書き回路202では、前半処理と後半処理に分けて累算を行なうため、アキュムレータ323は実際には前半アキュムレータと後半アキュムレータとの2つのアキュムレータからなる。単に、アキュムレータ323というときは、前半処理では前半アキュムレータ、後半処理では後半アキュムレータのことを指すものとする。
【0057】
具体的に累算の処理は、以下のように行なう。まず、前半処理および後半処理の開始時点でアキュムレータ323を初期設定(ゼロクリア)する。以後は、前半処理および後半処理の最後のチャンネルまで、必要なサンプル数(すなわち、アクセス数)をアキュムレータ323に累算していく。各チャンネルについて読み出すべき必要なサンプル数は、上記制御RAM324に書き込む際に分かる。
【0058】
さらに処理Aでは、上記のように累算した結果であるアクセス回数累算値が、実際にアクセスを実行する処理Bの前半区間または後半区間における最大アクセス可能数(アクセスの制限回数)を超えていないか判定し、その結果に応じて各チャンネルごとのアクセス回数および補間次数を決定する。以下、これについて説明する。まず前半処理の区間に着目して説明する。前半処理の区間は1サンプリング周期の半分の時間区間であり、その区間で第0〜第15チャンネルに関する処理B(および多少の遅れ時間の後に実行される取り込み処理)を行なう。また、処理Bで1アドレス送り出しを行なう区間の時間幅は時分割チャンネルタイミングで1チャンネル分の処理を行なう区間の時間幅の1/4である。したがって、もしXアクセス処理を当該区間内で行なわないなら(すなわち図8,9の区間803,805がない場合)、前半区間では64アクセスが可能である。この実施の形態では、各チャンネルで4点補間を行なうので、前半区間で処理する16チャンネルのすべてで4点の波形サンプルを読み出す必要がある場合でも、4点×16ch=64アクセスであるから、Xアクセス処理を行なわずに前半区間のすべてを処理Bおよび取り込み処理に使用すれば、すべてのチャンネルで4点補間を行なうことができる。ただし、優先フラグ(次の処理Bの説明で詳述する)303がオンされているときは前半区間のXアクセス処理で所定回(この実施の形態では1回)のアクセスを優先的に実行しなければならないため、前半区間の処理Bおよび取り込み処理による最大アクセス可能数は64から上記Xアクセス処理のアクセス数を減算した値となる。したがって、上述したようにアキュムレータ323で累算したアクセス回数累算値が前半区間における最大アクセス可能数を超えることが考えられる。この場合は、制御RAM324に書き込んだ各チャンネルのサンプル数をすべてアクセスすることはできないので、アクセス回数の多い(例えば3回あるいは4回)チャンネルの中の何れかのチャンネルのアクセス回数を削減し補間次数を落とす。補間次数を落とすというのは、例えば、4点補間の処理を3点補間あるいは2点補間(直線補間)に変更する、ということである。アクセス回数を削減するチャンネルの決定方法としては、例えば下記の▲1▼および▲2▼のような方法がある。
【0059】
▲1▼チャンネル順に片端からアクセス回数を削減する。
▲2▼その時点で音量レベルの小さいチャンネルからアクセス回数を削減する。このようにすると楽音への影響が小さい。各チャンネルの音量レベルは、エンベロープ値から分かる。
【0060】
なお、この実施の形態では前半区間で64アクセス可能で補間は4点補間であり、実際には第0〜第15のすべてのチャンネルで4点の読み出しを行なう場合はきわめて稀であると考えられるから、アクセス回数を累算して最大アクセス可能数と比較した結果から各チャンネルのアクセス回数と補間次数を決定する機能は設けなくとも実用上はほとんど問題がない。ただし、4点補間でなく例えば各チャンネルで6点補間を行なう場合や、優先フラグ303がオンのときにXアクセス処理に優先的に確保するアクセス数が多い場合などでは、有効な機能である。以上、前半区間に着目して説明したが後半区間でも同様である。
【0061】
(2)次に、処理B演算回路325で実行する処理Bについて詳しく説明する。処理B演算回路325は、時分割チャンネルタイミングとは異なるタイミングで、処理B、すなわちアドレスを波形メモリ109に向けて送り出す処理を行なう。図9で説明したように、時分割チャンネルタイミングの1チャンネル当りの時間内で4アクセス(4サンプルの読み出し)が可能である。処理Bの波形メモリアクセス処理は、処理Aの時分割チャンネルタイミングにしたがった処理とは関係がなく、読み出しが必要な各チャンネルについて順次連続して行なわれる。読み出しが必要なチャンネルとサンプル数は、上述の処理Aで決定され、制御RAM324にセットされている。また、図8,9で説明したように、あるチャンネルについて処理Bを行なうときには既に当該チャンネルに関する処理Aは実行済みであり、当該チャンネルのアドレス値がARAM322にセットされている。
【0062】
アドレス送り出しの処理を説明する。まず、図4に示す制御RAM324内の読み出し位置を指す読み出しポインタの値が、当該チャンネルに関する処理A前半または後半処理の終了時点の書き込みポインタの値と一致しているか否か判定する。例えば、当該チャンネルの処理Bが図8の処理B前半区間802内の処理である場合は、読み出しポインタの値を、処理A前半区間801の終了時点の書き込みポインタの値と比較するということである。これが一致すれば、その処理Bの区間で読み出すべきサンプルはもう無いということだから、当該区間の処理Bは終えて、残った空きスロットで後述するXアクセス処理を行なうように制御する。
【0063】
読み出しポインタの値が上記書き込みポインタの値に一致していないときは、読み出しポインタを1つ進めて、読み出しポインタが指すチャンネル番号とサンプル数を制御RAM324から読み出す。そして、そのサンプル数分の当該チャンネル番号に関するアドレスを波形メモリ109に送り出す。具体的には、ARAM322から当該チャンネルの現アドレス整数部を読み出し、必要なサンプル数のサンプルを順次アクセスするための複数のオフセットを加算し、さらに波形データのループ部の先頭を示す絶対アドレスWAを加算して(処理Aで作成したアドレスは相対アドレスであるので、絶対アドレスに変換するためWAを加算する)、最終的な読み出しアドレスWMAを求め、セレクタ329がこのアドレスWMAを選択出力するように制御する。これにより1アドレスが波形メモリ109に送り出される。加算するオフセットは、例えば図9の例では、第0チャンネルでは0、第2チャンネルの1回目が−2、2回目が−1、3回目が0、第5チャンネルの1回目が−1、2回目が0などとなる。以上のようにして、図8,9で説明したアドレス送り出しのタイミングで、読み出しポインタを進めながらアドレスを連続的に送り出していく。
【0064】
図8,9でも説明したように、上記アドレス送り出しの処理は必要な回数だけ時分割チャンネルタイミングとは異なるタイミングで行なわれるので、アクセス余り時間としての空きタイムスロットが出現する。そこで、アドレス送り出しの処理の後、処理B演算回路325はXAレジスタ311からのアドレスが選択出力されるようにセレクタ329を切り替え(さらに、波形メモリ109のデータラインがFIFO313に接続するようにセレクタ330を切り替える)、Xアクセス回路304の制御のもとでこの余り時間を利用してXアクセス処理が行なわれるようにする。
【0065】
優先フラグ303は、CPU104が適宜オン/オフする。優先フラグ303がオンされているとき、処理B演算回路325は楽音発生のための各チャンネルの波形データ読み出しの状態にかかわらず、Xアクセス処理に最低1回(複数回でもよい。確保するスロット数は任意に指定できる。)のアクセススロットを確保する(すなわち、図8、9において、前半処理では区間803,805を、後半処理では区間813,815を、それぞれ最低限1アクセス分だけは確保する)。これにより、CPU104からの波形メモリ109へのアクセス処理、またはミキサ204から出力ライン223を介して戻ってくる楽音波形データの波形メモリ109への書き込み処理を、1アクセスだけ必ず入れることができる。
【0066】
(3)次に、取り込み回路328で実行する取り込み処理について説明する。取り込み回路328は、処理B演算回路325から送り出されたアドレスWMAにより読み出された波形サンプルを取り込み、波形バッファ327に書き込む。このときセレクタ330は、処理B演算回路325の制御のもとで、波形メモリ109のデータラインを取り込み回路328に接続する。波形サンプル取り込みの結果、波形バッファ327には、基本的に各チャンネル4サンプルが用意されることになる。ただし、処理Aで補間次数を落としたチャンネルがある場合は、当該チャンネルについては、次数を落とした補間で必要なサンプルが波形バッファ327に用意される。なお、波形メモリ109に格納されている波形サンプルが圧縮されている場合は、取り込み回路328でデコードを行なうようにする。
【0067】
取り込み処理は処理Bによるアドレス送り出しと同期して行なわれるので、処理Bで説明したように、アクセス余り時間としての空きタイムスロットが出現する。そこで、取り込み処理の後、処理B演算回路325は波形メモリ109のデータラインとFIFO313とが接続されるようにセレクタ330を切り替え、Xアクセス回路304の制御のもとでこの余り時間を利用してXアクセス処理が行なわれるようにする。
【0068】
(4)次に、補間回路326で実行する補間処理について詳しく説明する。補間回路326は、時分割チャンネルタイミングにしたがって、チャンネルごとに順に補間処理を行なう。1つのチャンネルに関する補間処理は、以下のとおりである。まず、波形バッファ327から当該チャンネルの4つの波形サンプルを順次読み出す。そして、各サンプルに所定の補間係数を乗算して累算する。各サンプルに乗算する補間係数は、当該チャンネルのアドレス小数部FRACに基づいて決定する。アドレス小数部FRACは、ARAM322から処理B演算回路325経由で入力する。以上により、補間済みの楽音波形データが生成出力される。なお、上述した波形メモリのアクセス回数削減により補間次数を落としたチャンネルについては、落とした次数での補間を行ない補間済みの楽音波形データを得る。
【0069】
(5)次に、Xアクセス処理について詳しく説明する。上述したように、処理Bおよび取り込み処理で必要な各チャンネルについて順次連続してアドレス送り出しを行ない波形サンプルを波形バッファ327に読み出した後、空きタイムスロットがあるときには、処理B演算回路325は、その空きタイムスロットの区間でXアクセス処理を行なうようにセレクタ329と330を切り替える。具体的には、図8,9の区間803,813においてXAレジスタ311が波形メモリ109のアドレスラインに接続されるようにセレクタ329を切り替え、区間805,815においてFIFO313が波形メモリ109のデータラインに接続されるようにセレクタ330を切り替える。処理B演算回路325は、このようにセレクタ329,330を切り替えるとともに、Xアクセス処理が可能になった旨をXアクセス回路304に伝える。これにより、Xアクセス回路304は(CPU104から指示されていた場合)Xアクセス処理を開始する。また、処理B演算回路325は、Xアクセス処理終了時(1サンプリング周期の半分の時間幅である前半区間および後半区間の終了時)に再びセレクタ329,330を切り替えて、次の処理Bおよび取り込み処理が可能になるようにする。なお、波形メモリ109へのアドレスの入力と当該アドレスのデータアクセスとは若干のタイミングのずれがある(例えば図8の取り込み前半区間804は処理B前半区間802から若干遅れている)ので、セレクタ329の切り替えのタイミングとセレクタ330の切り替えのタイミングとは若干ずれることになるが、その切り替えの制御は処理B演算回路325により適正に行なわれるようになっている。
【0070】
Xアクセス処理は、具体的には、CPU104から波形メモリ109に波形データを書き込む処理、CPU104により波形メモリ109から波形データを読み出す処理、およびミキサ204から出力ライン223を介して戻ってくる波形データの波形メモリ109への書き込み処理の3つがある。以下、それぞれについて説明する。
【0071】
CPU104から波形メモリ109にデータを書き込む場合、まずCPU104はセレクタ312を切り替えて、CPU104が接続されているデータバスとFIFO313とが接続されるようにする。そして、CPU104は、XAレジスタ311に書き込みアドレス(先頭アドレス)をセットし、書き込むべき波形サンプルデータの数をサンプル数レジスタ315にセットし、書き込むべき波形サンプルデータの始めの8サンプルをセレクタ312を介して8段のFIFO313に順にセットして、Xアクセス回路304に書き込みスタートを指示する。以後、CPU104は、適宜Xフラグ314を参照し、Xフラグ314がオンされているときは、FIFO313に、書き込むべき波形サンプルデータの残りを順次書き込む。Xフラグ314はFIFO313の空きの状態を示すフラグであり、CPU104からのデータ書き込みの際には、FIFO313に空きがあるとき自動的にオンとなり、FIFO313に空きがないとき自動的にオフとなる。したがって、CPU104はXフラグ314がオフとなるまでFIFO313に書き込みデータを送ってよい。
【0072】
図7(a)は、CPU104からFIFO313にデータを書き込む際のFIFOの使用方法を示す。矩形701,702はFIFO313を示し、斜線部分はデータが書き込まれている部分、白抜き部分は空きの部分を示す。701ではFIFO313の8段の領域すべてにデータが書き込まれておりXフラグがオフされている。このときCPU104はデータをFIFO313に書き込むことができない。Xアクセス処理でFIFO313のデータが読み出され波形メモリ109に書き込まれると、702に示すようにFIFO313に空きができXフラグがオンされる。このときCPU104は、Xフラグのオンを検出して次の書き込みデータをFIFO313に書き込むことができる。
【0073】
書き込むべき波形サンプルデータをすべてFIFO313に送ったら、CPU104から見ると書き込み終了である。そこで、CPU104は、Xアクセス回路304にCPU書き込みストップ処理を指示して書き込み処理を終了する。
【0074】
一方、CPU104からの書き込みスタート指示を受けたXアクセス回路304は、処理B演算回路325から空きタイムスロットである旨の指示がある区間(区間803,813,805,815)の各タイムスロットで、FIFO313内の波形サンプルデータを波形メモリ109に書き込む処理を行なう。1つのタイムスロットで行なう処理は、以下の通りである。まずXAレジスタ311に格納されているアドレスを波形メモリ109に送出する。次に、FIFO313から波形サンプルデータを1つ取り出し、波形メモリ109に送出して上記アドレス位置に書き込む。その後、XAレジスタ311のアドレスをインクリメントする。Xアクセス回路304内には、書き込みスタート指示でゼロクリアされ、波形サンプルデータを1つ波形メモリ109に書き込むとカウントアップされるカウンタが備えられており、Xアクセス回路304は書き込みの度にこのカウンタの値とサンプル数レジスタ315のサンプル数を比較する。カウンタの値がサンプル数レジスタ315のサンプル数に至ったら、指示されたデータをすべて書き込んだということであるから、書き込み処理を終了する。また、CPU104からCPU書き込みストップ処理の指示があったときは、FIFO313に残っているデータをすべて波形メモリ109に書き込んで、処理を終了する。なお、サンプル数レジスタ315を設けることなく、Xアクセス回路304では、CPU104からのCPU書き込みストップ処理の指示があるまでFIFO313にデータがあれば波形メモリ109に書き込むこととしてもよい。
【0075】
波形メモリ109からCPU104にデータを読み出す場合、まずCPU104はセレクタ312を切り替えて、CPU104が接続されているデータバスとFIFO313とが接続されるようにする。そして、CPU104は、XAレジスタ311に読み出しアドレス(先頭アドレス)をセットし、読み出すべき波形サンプルデータの数をサンプル数レジスタ315にセットして、Xアクセス回路304に読み出しスタートを指示する。以後、CPU104は、適宜Xフラグ314を参照し、Xフラグ314がオンされているときは、FIFO313から波形サンプルデータを順次読み出す。Xフラグ314はFIFO313の空きの状態を示すフラグであり、CPU104によるデータ読み出しの際には、FIFO313に波形メモリ109からの読み出しデータがあるとき自動的にオンとなり、FIFO313に読み出しデータがないとき自動的にオフとなる。
【0076】
図7(b)は、CPU104によりFIFO313からデータを読み出す際のFIFOの使用方法を示す。矩形703,704はFIFO313を示し、斜線部分は読み出したデータを格納した部分、白抜き部分は空きの部分を示す。703ではFIFO313の8段の領域はすべて空きでありXフラグがオフされている。このときFIFO313には読み出しデータが未だないからCPU104はデータを読み出すことができない。Xアクセス処理で波形メモリ109からデータが読み出されFIFO313に書き込まれると、704に示すようにXフラグがオンされる。このときCPU104は、Xフラグのオンを検出してFIFO313から読み出しデータを読み出すことができる。
【0077】
Xフラグ314はFIFO313に読み出しデータがあるか否かを示すとともに、Xフラグ314がオフのときはサンプル数レジスタ315で指定された数だけの波形サンプルを読み出したか否かを判別できるようになっている。そこで、CPU104は、Xフラグ314がオフのとき、サンプル数レジスタ315で指定した数だけの波形サンプルデータを読み出したか否かを判別し、読み出していたらXアクセス回路304にCPU読み出しストップ処理を指示して読み出し処理を終了する。
【0078】
一方、CPU104からの読み出しスタート指示を受けたXアクセス回路304は、処理B演算回路325から空きタイムスロットである旨の指示がある区間(区間803,813,805,815)の各タイムスロットで、波形メモリ109から波形サンプルデータを読み出してFIFO313に書き込む処理を行なう。1つのタイムスロットで行なう処理は、以下の通りである。まずXAレジスタ311に格納されているアドレスを波形メモリ109に送出する。次に、当該アドレスの波形サンプルデータを波形メモリ109から1つ読み出し、FIFO313に書き込む。その後、XAレジスタ311のアドレスをインクリメントする。Xアクセス回路304内には、読み出しスタート指示でゼロクリアされ、波形サンプルデータを1つ波形メモリ109からFIFO313に読み出すとカウントアップされるカウンタが備えられており、Xアクセス回路304は読み出しの度にこのカウンタの値とサンプル数レジスタ315のサンプル数を比較する。カウンタの値がサンプル数レジスタ315のサンプル数に至ったら、指示された数のデータを読み出したということであるから、読み出し処理を終了する。また、CPU104からCPU読み出しストップ処理の指示があったときは、処理を終了する。なお、サンプル数レジスタ315を設けることなく、Xアクセス回路304では、CPU104からのCPU読み出しストップ処理の指示があるまで波形メモリ109からFIFO313へのデータ読み出しを続けることとしてもよい。
【0079】
ミキサ204から出力ライン223を介して戻ってくる波形データを波形メモリ109に書き込む場合、まずCPU104はセレクタ312を切り替えて、ミキサ204からの出力ライン223とFIFO313とが接続されるようにする。そして、CPU104は、XAレジスタ311に書き込みアドレス(先頭アドレス)をセットし、書き込むべき波形サンプルデータの数をサンプル数レジスタ315にセットして、Xアクセス回路304に書き込みスタートを指示する。以後、サンプリング周期ごとにミキサ204から出力ライン223を介して波形サンプルデータが送出されてくるので、Xアクセス回路304は、その送られてきたデータをFIFO313に書き込む。なお、ミキサ204から戻ってくるデータの書き込みの場合、上述のCPU104からのデータ書き込みの場合のようにXフラグ314がオンのときデータをFIFO313に書き込むというようなことができず、ミキサ204から送られてくるデータはサンプリング周期ごとに送られてくるので、送られてきたデータはすぐにFIFO313に書き込まなければならない。その時点でFIFO313に空きがないときは、ミキサ204から送られてきたデータは捨てられる。ただし、既に述べたように、1サンプリング周期の間にXアクセス処理のスロットが1つも取れないほど楽音発生のための波形メモリアクセスが混むという事態はほとんど無いと考えられるので、上記の場合にミキサ204から送られてきたデータを捨てることにしても実用上はほとんど問題はない。また、優先フラグ303をオンしておけば、1サンプリング周期の間にXアクセス処理のスロットを少なくとも1回は確保できるので、ミキサ204から送られてきたデータは必ず波形メモリ109に書き込めることになる。
【0080】
一方、CPU104からの書き込みスタート指示を受けたXアクセス回路304は、処理B演算回路325から空きタイムスロットである旨の指示がある区間(区間803,813,805,815)の各タイムスロットで、FIFO313内の波形サンプルデータを波形メモリ109に書き込む処理を行なうが、この処理は上記CPU104からの波形データ書き込みで説明したのと同じであるので、説明を省略する。
【0081】
以上で図3の制御レジスタ201および読み書き回路202による5つの処理の詳細な説明を終わる。
【0082】
図10および図11は、図2の信号処理回路(DSP)205およびミキサ204の設定の具体例を示す。
【0083】
図10(a)は、サンプリングを行なう際の設定の例を示す。ブロック1001,1005は、図2のミキサ204によるミキシング処理(以下、単にMIXとする)を示す。ブロック1002,1003,1004は、図2の信号処理回路205で実行する処理(信号処理回路205に設定されたマイクロプログラムに対応する)を示す。矢印は信号の流れを示し、FIFO1006は図3のXアクセス回路304内のFIFO313に相当する。MIX1001への「ADC入力」は、図2の外部回路(ADC)110からインタフェース206および入力ライン213を介して入力する外部からの楽音信号である。このADC入力は、ミキサ204への入力の8チャンネルの内の一つを用いる。
【0084】
MIX1001の出力は、図2のミキサ204から出力ライン221を介して信号処理回路205に出力される8チャンネルの内の一つである。信号処理回路205では図10(a)のブロック1002〜1004に示す処理を行なう。すなわち、MIX1001からの出力に対し、エンベロープ抽出処理1003によってエンベロープを抽出し、エンベロープの立ち上がりでゲート1002を開くようにする。ゲート1002が開かれると、サンプリング周期毎にMIX1001の出力すなわち外部から入力した楽音波形が波形処理1004へと送出される。波形処理1004では、入力した楽音波形に対して各種の波形処理を施す。例えば、直流分をカットするDCカット処理、入力レベルが小のときにミュートをかけるノイズミュート処理、エンベロープのレベルがある所定値以上の場合にゲインを下げるコンプレッサ処理、入力波形のレベルが小さい場合によりそのレベルを小さくするエキスパンダ処理、および高いサンプリング周波数で外部から入力した楽音波形を低いサンプリング周波数に落としたり逆にサンプリング周波数を上げたりすためのFs(サンプリング周波数)変換処理などである。
【0085】
波形処理1004の出力は再びMIX1005に戻る。これは、図2の信号処理回路205の処理結果を入力ライン212のうちの1チャンネルを使ってミキサ204に戻す部分に相当する。そして、MIX1005からFIFO1006に楽音波形を出力し波形メモリ1009に書き込む。これは、ミキサ204から出力ライン223を介して制御レジスタ201内のFIFO313に波形データを書き込む部分を示す。FIFO313に書き込まれたデータは既に説明したように波形メモリ109に書き込まれる。
【0086】
図10(b)は、リサンプリング用のマイクロプログラムおよびミキサの設定の例(その1)を示す。図10(a)と同様に、MIX1011,1014は図2のミキサ204に対応し、FIFO1015は図3のFIFO313に対応する。ブロック1012,1013は、図2の信号処理回路205に設定するマイクロプログラムに対応する。MIX1011への「ch出力」は、図2の音量変化制御回路203から入力ライン211を介して入力する楽音信号であり、サンプリングなどによりあらかじめ波形メモリ109上に用意されている波形データを読み出して生成した楽音波形である。この「ch出力」は、32チャンネルのうちの一つでもよいし、複数チャンネルでもよい。すなわち、複数の発音チャンネルで複数の波形データを読み出し、読み出された複数の波形データをMIX1011でミキシングするようにしてもよい。
【0087】
MIX1011の出力は、図2のミキサ204から出力ライン221を介して信号処理回路205に出力される8チャンネルの内の一つである。信号処理回路205ではブロック1012,1013に示す処理を行なう。すなわち、MIX1001からの出力に対し、分離フィルタ1012による成分分離を施し周期成分と非周期成分とを取り出す。インターリーブ1013は、この周期成分と非周期成分とを交互にMIX1014に出力しFIFO1015に書き込むようにする。これにより、サンプリングなどによりあらかじめ波形メモリ上に用意されている楽音波形に対し成分分離を施して再び波形メモリに戻すリサンプリングが行なわれる。なお、分離フィルタ1012から出力される周期成分については例えばLPC圧縮などを施してもよい。
【0088】
図10(c)は、リサンプリング用のマイクロプログラムおよびミキサの設定の例(その2)を示す。図10(a)と同様に、MIX1021,1023は図2のミキサ204に対応し、FIFO1024は図3のFIFO313に対応する。ブロック1022は、図2の信号処理回路205に設定するマイクロプログラムに対応する。MIX1021への「ch出力」は、図2の音量変化制御回路203から入力ライン211を介して入力する楽音信号であり、サンプリングなどによりあらかじめ波形メモリ109上に用意されている波形データを読み出して生成した楽音波形である。この「ch出力」は、32チャンネルのうちの一つでもよいし、複数チャンネルでもよい。すなわち、複数の発音チャンネルで複数の波形データを読み出し、読み出された複数の波形データをMIX1021でミキシングするようにしてもよい。
【0089】
MIX1021の出力は、図2のミキサ204から出力ライン221を介して信号処理回路205に出力される8チャンネルの内の一つである。信号処理回路205ではブロック1022に示す波形処理を行なう。この波形処理1022としては、例えば、イコライザ、モジュレーション(変調)、波形圧縮、Fs変換、物理モデル音源、およびリバーブ付与の処理などがある。物理モデル音源というのは、ミキサ1021からの出力を駆動信号として物理モデル音源を働かせてその結果の波形を出力するということである。波形処理1022の結果は、MIX1023を介してFIFO1024に書き込まれ、再び波形メモリ109に録音される。これにより、サンプリングなどにより波形メモリ上に存在する楽音波形に対し各種の波形処理を施して再び波形メモリに戻すリサンプリングが行なわれる。
【0090】
図11(a)は、楽音発生用のマイクロプログラムおよびミキサの設定の例(その1)を示す。また、図11(b)は、楽音発生用のマイクロプログラムおよびミキサの設定の例(その2)を示す。図10(a)と同様に、MIX1101,1103,1111〜1113,1117は図2のミキサ204に対応する。DAC1104,1118は図1のDAC112に対応する。図11(a)ではブロック1102が、図11(b)ではブロック1114〜1116が、それぞれ、図2の信号処理回路205に設定するマイクロプログラムに対応する。各MIX1101,1111〜1113へ入力している「ch出力」は、それぞれ、図2の音量変化制御回路203から入力ライン211を介して入力する楽音信号(32チャンネルのうちの一つでもよいし、複数チャンネルでもよい)である。各MIX1101,1111〜1113の出力は、それぞれ、図2のミキサ204から出力ライン221を介して信号処理回路205に出力される8チャンネルの内の一つである。
【0091】
図11(a)の場合、信号処理回路205ではMIX1101の出力に対してリバーブ処理1102を施し、MIX1103を介してDAC1104に出力し放音する。図11(b)の場合、信号処理回路205ではMIX1111〜1113のの出力に対してそれぞれコーラス処理1114、リバーブ処理1115、およびバリエーション1116を施し、その処理結果をMIX1117でミキシングしてDAC1104に出力し放音する。
【0092】
なお、図10および図11の各設定例において、MIXのブロックには図示した入力以外の他の楽音波形を入力させてミキシングを行なうようにしてもよい。また、これらのマイクロプログラムの設定例は、信号処理回路205のマイクロプログラムメモリの容量に応じて適宜並行して実行するように設定することもできる。例えば、図10(a)のサンプリング用のマイクロプログラムと図11(a)の楽音発生用のマイクロプログラムとを同時に実行するようなことも可能である。また、MIX1103,1117のミキシング結果を、DAC1104,1118に出力するとともに、ライン223を通じてFIFO313に出力し、波形メモリ109へ書き込むようにしてもよい。これは、演奏された波形データをそのまま録音する、フレーズ録音である。
【0093】
次に、フローチャートを用いて、上述の電子楽器のCPU104の処理手順を説明する。
【0094】
図12(a)は、CPU104の制御プログラムのうちメインルーチンの処理手順を示す。この電子楽器の電源がオンされると、まずステップ1201で、各種の初期設定を行なう。次にステップ1202で何らかの起動要因があるか否かチェックし、ステップ1203で起動要因があればステップ1204に進む。起動要因がなければ再び1202に戻る。ステップ1204では発生している起動要因の種類を判別しそれぞれの処理に分岐する。起動要因が鍵盤101の鍵操作イベントであるとき(外部からのMIDIイベントを受け付けることができるようになっている場合は、MIDIイベント発生も同等である)は、ステップ1205の鍵盤処理を行ない、その後再びステップ1202に戻る。起動要因がパネルスイッチ103の操作イベントであるときは、ステップ1206のパネルスイッチ処理を行ない、ステップ1202に戻る。起動要因がXフラグ314に関するイベントであるときは、ステップ1207でフラグ処理を行ない、ステップ1202に戻る。起動要因がその他の要因(例えば後述するソフト音源の波形生成トリガーなど)であるときは、ステップ1208でその他の処理を行ない、ステップ1202に戻る。起動要因が電源スイッチの操作イベントであるときは、ステップ1204で終了処理を行なった後、処理を終了する。
【0095】
図12(b)は、図12(a)のステップ1205の鍵盤処理のうち鍵盤101のキーオンイベントがあったときに実行されるキーオンイベント処理の手順を示す。まずステップ1211で、キーオンされた鍵のノートナンバをレジスタNNに、キーオン時のベロシティをレジスタVDに、それぞれ設定する。次に、ステップ1212で、発音チャンネル(第0〜第31チャンネル)の割り当てを行ない、割り当てたチャンネルナンバをレジスタiに設定する。ステップ1213で、現在設定されている音色のノートナンバNNに対応する波形データのアドレスなどの情報を制御レジスタ(具体的には図3のレジスタ301や302)201に設定する。ステップ1214では、現在設定されている音色のエンベロープパラメータやミキサの混合比などの設定をやはり制御レジスタ201に対して行なう。その後、ステップ1215で第iチャンネルに対しノートオン(音源108に対する発音指示)を送出し、既に説明したような音源部108の楽音発生の動作を開始させる。
【0096】
図13(a)は、図12(a)のステップ1206のパネルスイッチ処理のうちサンプリングスイッチ(SW)がオンされたときに実行されるサンプリングSWイベント処理の手順を示す。ユーザは、あらかじめ外部回路110として外部音を入力してA/D変換するADCを接続しておき、サンプリングを行なうときサンプリングSWをオンする。サンプリングSWがオンされると、まずステップ1301で、CPU104は、ROM105、RAM106、または外部記憶装置107などから入力波形処理用マイクロプログラムを読み出し、信号処理回路205内のマイクロプログラムメモリにロードする。ここでロードするマイクロプログラムは、例えば図10(a)のブロック1002〜1004で説明したような処理を行なうマイクロプログラムである。次に、ステップ1302で、ADC(外部回路110)の動作の設定およびミキサ204の混合比などの設定を行なう。ステップ1303では、波形メモリ109内の書き込み領域のアドレスおよびサンプル数を設定する。これは、図3のXAレジスタ311に書き込み領域のアドレスを設定し、サンプル数レジスタ315に書き込むべきサンプルの数を設定することに相当する。ステップ1304では、信号処理回路205の書き込み処理をスタートさせ、さらにADCをスタートさせる。これにより、図10(a)で説明したようなサンプリングの処理が実行される。
【0097】
図13(b)は、図12(a)のステップ1206のパネルスイッチ処理のうちリサンプリングSWがオンされたときに実行されるリサンプリングSWイベント処理の手順を示す。ユーザによりリサンプリングSWがオンされると、まずステップ1311で、CPU104は、ROM105、RAM106、または外部記憶装置107などからリサンプリング用マイクロプログラムを読み出し、信号処理回路205内のマイクロプログラムメモリにロードする。ここでロードするマイクロプログラムは、例えば図10(b)および(c)で説明したブロック1012,1013またはブロック1022のような処理を行なうマイクロプログラムである。次に、ステップ1312で、発音チャンネルの割り当てを行ない割り当てたチャンネルナンバをレジスタiに設定する。次に、ステップ1313で読み出し波形のアドレスを設定し、ステップ1314でエンベロープパラメータやミキサ204の混合比などを設定する。これは制御レジスタ201の各種の情報を設定することに相当する。ステップ1315では、リサンプリングした結果の波形データを書き込むべき波形メモリ109内のアドレスおよびサンプル数を設定する。これは制御レジスタ201のXAレジスタ311およびサンプル数レジスタ315を設定することに相当する。その後、ステップ1316で信号処理回路205の書き込みをスタートし、ノートオンを送出して処理を終了する。ノートオンを送出するのは、ステップ1313で設定したアドレスから波形データを読み出す処理を開始するためである。以上により、図10(b)または図10(c)に示したような信号の流れでリサンプリングが実行される。
【0098】
なお、ステップ1312で複数チャンネルを割り当て、それらのチャンネルで読み出した楽音波形をミキシングして所定の処理の後に波形メモリに書き込んでもよいし(図10(b)や(c)でMIX1011,1021に複数チャンネル出力が入力する場合)、各チャンネルごとに所定の処理を行なった後にミキシングして波形メモリに書き込んでもよい(図10(b)で複数チャンネルの各チャンネルそれぞれで1011〜1013の処理を行ないそれらの複数系列をMIX1014でミキシングする場合、あるいは図10(c)で複数チャンネルの各チャンネルそれぞれで1021〜1022の処理を行ないそれらの複数系列をMIX1023でミキシングする場合)。複数チャンネルをミキシングする場合は、各チャンネルで波形のスタート位置をずらしてミキシングすることもできる。その場合は、ステップ1316で、各チャンネルの波形のスタート位置のずらし方に応じてノートオンを複数回送出する必要がある。ただし、FIFOの書き込みスタートは1番最初のノートオンからである。
【0099】
図14(a)は、図12(a)のステップ1206のパネルスイッチ処理のうち波形読み出しSW(または波形書き込みSW)がオンされたときに実行される波形読み出し(書き込み)SWイベント処理の手順を示す。なお、波形読み出しSWイベント処理と波形書き込みSWイベント処理とは「読み出し」と「書き込み」とを入れ替えるだけでほとんど同様の処理であるので、同じ図14(a)を用いて説明する。始めに波形読み出しSWイベント処理について説明し、次に波形書き込みSWイベント処理について説明する。
【0100】
波形読み出しSWイベント処理では、まずステップ1401で、波形メモリ109内の読み出し領域のアドレスおよび読み出すサンプル数をXAレジスタ311およびサンプル数レジスタ315に設定する。次にステップ1402で、波形メモリ109から読み出したデータを書き込むべきRAM106内の書き込み領域のアドレスを設定する。次にステップ1403で、CPU104は、図3のXアクセス回路304に読み出しスタートを指示して(ステップ1404は波形書き込みSWイベント処理のときのみ使用)、処理を終了する。以上により、先述したXアクセス処理が開始され、楽音波形の生成と平行して波形メモリ109からの波形データが図3のFIFO313に順次読み出されてくるので、CPU104は後述するXフラグ読み出しイベント処理(図14(b))によりFIFO313のデータを取り出す。このような波形データの読み出し処理は、サンプリングやリサンプリングで波形メモリに書き込んだ波形データを読み出して外部記憶装置に格納(リアルタイム・ハードディスク・レコーディング)したり、読み出した波形にCPUで加工を施して再び波形メモリに書き込む場合などに用いる。
【0101】
波形書き込みSWイベント処理では、まずステップ1401で、波形メモリ109内の書き込み領域のアドレスおよび書き込むサンプル数をXAレジスタ311およびサンプル数レジスタ315に設定する。次にステップ1402で、波形メモリ109に書き込むべき波形データが用意されているRAM106内の読み出し領域のアドレスを設定する。次にステップ1403で、CPU104は、図3のXアクセス回路304に書き込みスタートを指示する。またステップ1404で、前準備としてRAM106内の読み出し領域の最初の8サンプルを読み出してFIFO313に書き込んで、処理を終了する。以上により、先述したXアクセス処理が開始され、楽音波形の生成と平行して図3のFIFO313の波形データが波形メモリ109の書き込み領域に書き込まれるので、CPU104は後述するXフラグ書き込みイベント処理(図14(c))によりFIFO313に波形データを書き込む。このような波形データの書き込みは、外部記憶装置の波形データを波形メモリに書き込んだり、読み出した波形にCPUで加工を施して再び波形メモリに書き込む場合などに用いる。また、後述するソフト音源における波形書き込みでも用いる。さらに、波形メモリ上にバッファ領域を設け、発音チャンネルによる該バッファ領域の波形データのループ再生をしつつ、該領域に外部記憶装置の波形データを順次供給すれば、外部記憶装置に記憶された長時間波形データのダイレクト再生も可能である。
【0102】
図14(b)は、図12(a)のステップ1207のフラグ処理のうちXフラグ読み出しイベント処理の手順を示す。これは、CPU104による波形メモリ109からの読み出し処理がスタートしていた場合(図14(a)の波形読み出しSWイベント処理が実行されていた場合)においてXフラグがオンである(すなわち波形メモリ109から読み出したデータがFIFO313に存在する)ときに実行される処理である。まずステップ1411で、FIFO313にセットされている波形データを読み出して、RAM106の書き込み領域に書き込む。次にステップ1412で、サンプル数レジスタ315のサンプル数と実際に波形メモリ109から読み出してRAM106に書き込んだ波形サンプルの数とを比較することにより読み出しが終了かどうかを判定する。読み出し終了に至ったときは、ステップ1413で、CPU104は読み出しストップ処理を行ない処理を終了する。ステップ1412で未だ終了に至っていないときは処理を継続する。ステップ1412の読み出しストップ処理は、図14(a)の波形読み出しSWイベント処理で設定された読み出し処理の状態を解除する処理である。
【0103】
図14(c)は、図12(a)のステップ1207のフラグ処理のうちXフラグ書き込みイベント処理の手順を示す。これは、CPU104による波形メモリ109への書き込み処理がスタートしていた場合(図14(a)の波形書き込みSWイベント処理が実行されていた場合)においてXフラグがオンである(すなわちFIFO313に空きがある)ときに実行される処理である。まずステップ1421で、RAM106の読み出し領域から次に書き込むべき波形データを読み出してFIFO313の空き領域に書き込む。次にステップ1422で、サンプル数レジスタ315のサンプル数と実際にRAM106からFIFO313に書き込んだ波形サンプルのサンプル数とを比較し、書き込むべきサンプル数をすべて書き込んだか否かを判定する。すべてのデータを書き込んだときは終了ということであるから、ステップ1423で、CPU104は書き込みストップ処理を行ない処理を終了する。ステップ1422で未だ終了条件が満たされていないときは処理を継続する。ステップ1423の書き込みストップ処理により、FIFO313に残っているデータが波形メモリ109へ書き込まれる。
【0104】
以上説明したこの実施の形態の電子楽器によれば、サンプルバッファを備えているため、チャンネル発音に使用されない余り時間が生じるので、該余り時間のタイムスロットを用いて、チャンネル発音以外の目的で波形メモリアクセス(例えば、CPUアクセスやミキサから戻ってくる波形データの書き込みなど)を発音中に行なうことができる。特に、波形メモリ109のアクセス状況を検出する機能を持つXアクセス回路304が備えられているので、CPU104は、Xフラグ314を参照してそれがオンのときはどんどんデータの読み書きができ発音中であっても高速なアクセスが可能になる。さらに、Xアクセス処理のバッファとしてFIFO313が備えられているので、アクセスは非常に高速で行なえる。なお、CPU104からXフラグ314を参照してそれがオンのときにデータを読み書きする処理は、上記実施の形態では割り込みを用いずにCPU104のループ処理中で行なっているが、割り込みを用いて実行するようにしてもよい。すなわち、FIFO313に空きがある(CPUからの書き込み時)、またはFIFO313に読み出しデータがある(CPUによる読み出し時)とき、割り込みでそれをCPU104に知らせ、それに応じてCPU104がFIFO313にアクセスに行くようにしてもよい。
【0105】
また、この実施の形態の電子楽器によれば、波形メモリアクセスをチャンネルタイミングと独立にしているので、アクセス回数に制限を加えるときに下記のような利点がある。すなわち、発音数が少なければ、該制限による影響は無く、発音しているチャンネルはすべて高次の補間(上記の例では4点補間)を実行できる。発音数が多くなり、アクセス回数が制限に引っ掛かるようになると、全発音数のうちの一部のチャンネルの補間次数を落として、補間次数は落ちるものの発音数を減らさずに済ませることができる。
【0106】
さらに、この実施の形態の電子楽器では、波形メモリのアクセス回数を合計値で管理しているので、例えば、Xアクセスの要求として、全アクセス時間の1/3使用したい、あるいは1/4使用したい、というような場合に、アクセス制御が非常に簡単に行なえる。
【0107】
この実施の形態の電子楽器によれば、DSPをサンプリングやリサンプリングの処理に兼用するようにしているので、装置構成をそれ程複雑にすることなく、外部から入力した楽音のサンプリングや既に波形メモリに格納されている波形データを読み出してエフェクト付与などの処理を施した後に再度波形メモリに書き込むリサンプリングを行なうことができる。DSPでは効果付与などの再生用の波形処理とサンプリングやリサンプリングなどの録音用の波形処理とを並列に行なうことができるので、再生と録音とを並行して実施できる。
【0108】
なお、上記波形メモリのアクセス動作(処理Bおよび取り込み処理)を、各時分割チャンネルのタイミング(固定)の中で行なうようにしてもよい。この場合、すべての発音チャンネルについて、1チャンネル当たり4つのアクセススロットがあるので、その中で各発音チャンネルは0回〜4回のサンプル読み出しと、残りのスロットで4回〜0回のXアクセスを行なうようにする。
【0109】
また、前半区間および後半区間の各64アクセスを、処理B(ないし取り込み処理)とXアクセス処理でどのように分配したら良いかに関しては、上記の例では、優先フラグ303で、1回のXアクセスを優先するようにしている。しかし、2アクセス以上優先させたい場合もある。例えば、外部記憶手段から波形メモリに波形データを転送したり、逆に波形メモリの波形データを外部記憶手段に転送するときは、該外部記憶手段のデータ転送速度に応じて転送を行なうのが効率が良い。その速度を達成するために必要なXアクセスの回数を優先にするのがよい。その他の場合でも、波形データをやり取りする相手の要求速度や最適速度に合わせて、Xアクセスの優先回数を任意に設定できるようにすればよい。
【0110】
次に、この実施の形態の電子楽器において、CPU104によりソフトウェア音源(以下、ソフト音源と呼ぶ)を実現する例について説明する。ソフト音源とは、CPU104で所定のソフトウェアを実行して楽音波形を生成するものである。CPU104で生成した楽音波形は、音源部108の所定のチャンネルを用いて放音する。
【0111】
なお、ソフト音源はCPU104がROM105の楽音生成ソフトウェアを実行することにより実現されるが、該ソフト音源を利用する側から見ると、楽音生成ソフトウェアをドライバとして登録しておき、該ドライバを起動した後、所定のソフト音源に係るAPI(Application Program Interface)に各種演奏入力を表わすMIDI(Musical Instruments digital Interface)イベントメッセージを出力して楽音生成に関する各種の処理をソフト音源に行なせる、という手順になる。CPU104は汎用の演算処理装置であり、該APIに対して演奏入力を与える処理、すなわちMIDIイベントを該APIに出力する処理など、ソフト音源とは別の処理も行なっている。CPU104が該APIに対して演奏入力を与える処理とは、例えば、鍵盤101の操作に応じてリアルタイムで発生する演奏入力を該APIに出力したり、外部MIDI機器からリアルタイムで入力したMIDIイベントに応じた演奏入力を該APIに出力したり、RAM106上にMIDIイベントのシーケンスを用意しておき(外部記憶装置107上にあるデータを用いてもよい)これを順次演奏入力として該APIに出力したり、といった処理である。
【0112】
図16を参照して、ソフト音源の楽音生成原理を説明する。図16において、S1〜S4の各区間は、所定のサンプル数(例えば、128サンプル)分の再生を行なう単位となる時間フレームを示す。「演奏入力」のライン上に記載してある下向き矢印は、その時刻で演奏入力があったことを示す。演奏入力とは、ソフト音源に係るAPI(Application Program Interface)に、ノートオン、ノートオフ、アフタタッチ、プログラムチェンジなどの各種のMIDIイベントが入力されることである。図16の例では、フレームS1で3つ、S2で2つ、S3で1つの演奏入力がそれぞれあったということである。ソフト音源は、複数チャンネル分の複数楽音を同時生成可能であり、RAM106上に用意される複数チャンネル分のソフト音源レジスタで各楽音を制御するようになっている。ソフト音源は、演奏入力としてノートオンイベント(例えば鍵盤101の鍵のノートオン)を入力したときは、ソフト音源レジスタに関して発音割り当てを行ない、割り当てたチャンネルに対応するソフト音源レジスタに該チャンネルの発音を制御する各種のデータとノートオンを書き込む。演奏入力としてノートオフイベントを入力したときは、該当するチャンネルに対応するソフト音源レジスタにノートオフを書き込む。ノートオンやノートオフ以外の演奏入力(例えばアフタタッチの変更など)についても同様に、該当するチャンネルに対応するソフト音源レジスタに演奏入力に応じたデータを書き込む。ある時間フレームでソフト音源レジスタに書込まれたデータは、データの種類にかかわりなく、必ず次の時間フレームから波形生成演算に使用される。
【0113】
図16の「CPUによる波形生成」の矩形1601〜1604は、CPU104により波形生成演算を実行する区間を示す。この波形生成演算では、ソフト音源レジスタに設定された複数チャンネル分のデータに基づいて複数チャンネル分の楽音波形生成を行なう。演奏入力に応じてソフト音源レジスタが書き換えられ、一方、演奏入力のない期間は、ソフト音源レジスタは過去に書込まれたデータを保持している。したがって、各波形生成の区間1601〜1604では、直前あるいはさらに前のフレームで検出した演奏入力に応じた波形生成演算を実行することになる。フレームが切り替わるタイミングでフレーム割り込みが発生するので、各フレームでの波形生成演算はこのフレーム割り込みを契機として(後述の図15(b))実行される。
【0114】
例えば、フレームS1で検出された3つの演奏入力に対しては、次のフレームS2の先頭のフレーム割り込みを契機として区間1602で波形生成演算を行なう。CPU104は、この波形生成演算により、RAM106上に波形データを生成する。生成した波形データは、当該フレームの残りの時間区間を用いて波形メモリ109上に用意されているバッファ領域に書き込む。このバッファ領域としては、連続したアドレスに用意された同じ大きさの2つのバッファ領域PB0とPB1(2つをまとめてダブルバッファと呼ぶ)を用いる。バッファ領域への書き込みは、上述したXアクセス処理(特にCPU104から波形メモリ109への書き込み処理)によって行なう。また、フレーム毎にバッファPB0とPB1とを交互に用いるようにする。例えば、フレームS1の区間1601で生成した波形データは次のフレームの開示時点までにRAM106から波形メモリ109上のバッファ領域PB0に書き込み、フレームS2の区間1602で生成した波形データはバッファ領域PB1に書き込み、フレームS3の区間1603で生成した波形データはバッファ領域PB0に書き込み、フレームS4の区間1604で生成した波形データはバッファ領域PB1に書き込み、…というように、交互にPB0とPB1に波形データを書き込む。
【0115】
バッファPB0およびPB1に書き込んだ波形データの読み出し再生は、図16の「読み出し再生」に示すように、フレーム割り込みを契機として、波形生成したフレームの次のフレームの区間で行なう。すなわち、フレームS1で生成しPB0に書き込んだ波形データは次のフレームS2で、フレームS2で生成しPB1に書き込んだ波形データは次のフレームS3で、フレームS3で生成しPB0に書き込んだ波形データは次のフレームS4で、…というように、PB0とPB1の波形データを交互に読み出し再生していく。
【0116】
図15(a)は、図12(a)のステップ1206のパネルスイッチ処理のうちソフト音源スタートSWがオンされたときに実行されるソフト音源スタートSWイベント処理の手順を示す。ユーザによりソフト音源スタートSWがオンされると、まずステップ1501で、ソフト音源で生成した楽音波形を発音するために用いる発音チャンネル(第0〜第31チャンネル)の割り当てを行ない、割り当てたチャンネルナンバをレジスタiに設定する。次に、ステップ1502で、音源部108に対して、当該チャンネルiによりダブルバッファ領域PB0,PB1のループ読み出し再生を行なうように設定する。これは、図16の「読み出し再生」で示したように、フレーム割り込みごとにバッファPB0とPB1とを交互に読み出し再生するように、音源部108に指示情報を送出して設定する処理である。具体的には、ダブルバッファ領域PB0,PB1は連続したアドレスに用意された同じサイズのバッファ領域であるので、領域PB0の先頭アドレスをループのスタートアドレス(絶対アドレスWA)として設定し、さらに(領域PB1の末尾アドレス)から(領域PB0の先頭アドレス)を引き算した値をループサイズ(相対アドレスLPA)として設定し、相対アドレスASを0に設定すれば、ループ読み出しによりPB0〜PB1の領域が繰り返し読み出される。ステップ1503では、エンベロープパラメータやミキサの混合比などの設定を行なう。なお、ここで設定されるエンベロープパラメータは、単にループ読み出しのフェードイン/フェードアウトをするのに使うだけで、発生する楽音のエンベロープ(楽音音量の時間的変化)を制御するのではない。ミキサの混合比も、1楽音の混合比ではなく、ソフト音源で生成した複数楽音の混合波形の出力先を制御する混合比である。
【0117】
次に、ステップ1504で、CPU104で生成した楽音波形を始めに書き込む書き込み領域を波形メモリ109内のバッファPB0とするため、図3のXAレジスタ311に初期値としてバッファPB0の先頭アドレスを設定し、サンプル数レジスタ315にサンプル数としてバッファPB0の容量(上記ループサイズLPAの1/2)を設定する。ステップ1505で、CPU104は、波形メモリ109への書き込み処理(Xアクセス処理)の前準備を行ない、ダブルバッファPB0,PB1をゼロクリアする。ステップ1506で、当該チャンネルiにノートオンを送出し、図16で説明した所定時間間隔のフレーム割り込みを開始させ、処理を終了する。なお、フレーム割り込みは、バッファPB0およびPB1をループ読み出しする際のリターン発生時(すなわちPB1の再生終了時)と、ループ読み出しの中間点(LPA/2)通過時(すなわちPB0の再生終了時)に発生する。図示していないが、フレーム割り込みを発生する割り込み発生回路が音源108の内部に設けられている。割り込みの代わりに、CPUが「読み出し再生」用に設定した発音チャンネルのアドレス現在値をチェックしてフレームの変わるタイミングを検出するようにしてもよい。
【0118】
図15(b)は、図16で説明した所定時間の時間フレームごとに発生するフレーム割り込みで実行するフレーム割り込み処理の手順を示す。フレーム割り込みが発生すると、まずステップ1511で、現在ソフト音源レジスタに設定されている演奏入力に対応する楽音波形をRAM106上に生成する。これは、図16において各フレーム割り込みごとに実行する波形生成演算1601〜1604に相当する。次に、ステップ1512で該生成した楽音波形を書き込むべき波形メモリ109内の書き込み領域のアドレス(PB0またはPB1の先頭アドレス)および書き込むサンプル数(ループサイズLPAの1/2)をXAレジスタ311およびサンプル数レジスタ315に設定する。図16で説明したように、この書き込み領域としてはバッファ領域PB0とPB1とを交互に用いる。次にステップ1513で、CPU104は、図3のXアクセス回路304に書き込みスタートを指示する。またステップ1514で、前準備として楽音波形の最初の8サンプルをFIFO313に書き込んで、処理を終了する。この後、Xアクセス処理によりFIFO313のデータが波形メモリに書き込まれる毎に(Xフラグが1になって)、図14(c)の処理と同じような処理により、残りの楽音波形サンプルが順次FIFOに供給される。
【0119】
以上により、先述したXアクセス処理が開始され、ステップ1511で生成した楽音波形が波形メモリ109のバッファ領域PB0またはPB1に書き込まれる。一方、図15(a)の処理により、図16の「読み出し再生」に示したようにダブルバッファPB0とPB1とを交互に読出し再生する処理が開始しているので、後は図15(b)のようにフレーム割り込みごとに楽音波形を生成してダブルバッファに書き込めば、その楽音波形が第iチャンネルで発音される。このソフト音源で発生した楽音は第iチャンネルでミキサ204に入力するので、上述したように、この楽音に対して信号処理回路205や外部回路110で効果付与などの信号処理を施してDAC112に出力したり再び波形メモリ109に書き込むようにもできる。
【0120】
また、この第iチャンネルにおけるダブルバッファPB0とPB1の読み出し処理のFナンバ(図3の処理Aで用いたピッチPITCH)を調整することにより、再生ピッチを調整することができ、いわゆるオーバサンプリングを行なうこともできる。例えば、ソフト音源で生成した楽音波形を出力する音源部108の第iチャンネルは48kHzのサンプリング周波数で動作するようにし、CPU104はサンプリング周波数24kHzで楽音波形を生成する場合、第iチャンネルのFナンバを0.5に設定すればよい。この場合は、補間回路326で48kHzのサンプリング周波数でも折り返しノイズが発生しないように高調波部分をカットして補間が行なわれる。
【0121】
従来のソフト音源では、図16に示したような読み出し再生のためにサンプリング周期ごとにCPUに割り込みをかけて、その割り込みごとにCPUが生成した楽音波形を音源部にDMA転送するというようなことを行なっていたので、CPUに対して割り込みが頻繁にかかっていた。この実施の形態のソフト音源では、CPU104はフレーム割り込みごとの処理を行なえば、あとはXアクセス処理で自動的に波形メモリ109に書き込んで再生してくれるので、CPUに対する割り込み処理が削減できるという効果がある。
【0122】
なお、ソフト音源の機能を用いる場合は、図16で説明したように所定のフレームの区間における演奏入力を保持しておく必要があるので、キーオンイベント処理は、図12(b)の代わりに、発生したキーオンイベントを記憶しておく処理を行なうようにする。
【0123】
図17は、図3のXアクセス回路304の変形例を示す。図3のXAレジスタ311をXA1レジスタ1701、XA2レジスタ1702、およびセレクタ1703に置き換え、図3のセレクタ312およびFIFO313をFIFO1704、ラッチ1705、およびセレクタ1706に置き換えるものである。他の部分は上述の実施の形態のままとする。
【0124】
XA1レジスタ1701およびFIFO1704は、Xアクセス処理でCPU104から波形メモリ109をアクセスする際の、アクセスアドレスを設定するレジスタおよびアクセスデータを設定するFIFOである。XA2レジスタ1702およびラッチ1705は、Xアクセス処理でミキサ204から出力ライン223を介して波形メモリ109に書き込みを行なう際の、アクセスアドレスを設定するレジスタおよびミキサ204からのデータを記憶するラッチである。この構成で、セレクタ1703,1706をXアクセス処理の区間で時分割で切り替えるようにして、ミキサ204から戻ってくる波形データの波形メモリ109への書き込みと、CPU104からの波形メモリ109のアクセスとを、並行して行なうことができるようにする。
【0125】
特に、ミキサ204からはサンプリング周期ごとに波形データが戻ってくるが、その波形データは捨てる訳にはいかないので、必ずラッチ1705に記憶することとする。そして、サンプリング周期ごとのXアクセス処理の区間で必ず1回は、セレクタ1703でXA2レジスタ1702を選択しセレクタ1706でラッチ1705を選択するようにして、ラッチ1705の波形データをXA2レジスタ1702で指示されたアドレスに書き込む。Xアクセス処理のその他の区間では、セレクタ1703でXA1レジスタ1701を選択しセレクタ1706でFIFO1704を選択するようにして、CPU104による波形メモリ109のアクセスを実行する。XA1レジスタ1701およびXA2レジスタ1702のアドレスを順次インクリメントする機能は、図3で説明したのと同じである。なお、Xアクセス処理の区間では、ラッチ1705の波形データの書き込みを優先して必ず1回は行なうようにする必要があるが、Xアクセス処理の区間そのものが確保できない場合も考えられるので、上述の優先フラグ303をオンしてXアクセス処理で必ず何回かのアクセスができるようにするとよい。
【0126】
このような構成により、例えば、サンプリングやリサンプリングした波形をミキサ204からラッチ1705経由で波形メモリ109に書き込み、波形メモリ109上にある程度溜まったところでCPU104により当該波形データを読み出して、外部記憶装置(ハードディスクなど)に送れば、リアルタイム・ハードディスク・レコーディングを行なうことができる。1サンプリング周期で1回書き込まれるラッチ1705経由の波形データの処理速度に比較すると、CPU104による読み出し処理の処理速度は速い。特に、FIFOを用いているので読み出し速度はさらに高速になる。そこで、波形メモリ109上に溜まったデータを一気にCPU104で読み出して、ハードディスクなどに書き込むようにできる。
【0127】
なお、上記形態では、図3の読み書き回路202において処理A演算回路321と処理B演算回路325とを独立した構成としたが、処理A演算回路321と処理B演算回路325とをひとまとめにして、1つの演算回路を時分割で共用することにより処理Aと処理Bとを行なうようにしてもよい。
【0128】
上記形態では、波形メモリの波形サンプルを16ビット非圧縮の形式としたが、他の形式でもよい。例えば、1アクセスで16ビットを読み出せることはそのままにして、8ビット非圧縮または8ビット圧縮形式にしてもよい。ただし、この場合、サンプル数とアクセス数とが異なるので、その調整が必要である。また、圧縮形式の場合は、連続してサンプルを読み出していかないと再生できなくなるため、飛ばし読みの際に対処が必要である。
【0129】
波形メモリとしてDRAMを用いた場合は、必ずリフレッシュが必要であるので、Xアクセス処理の区間でリフレッシュを行なうようにしてもよい。また、CPUからの波形メモリの読み出し/書き込みは、その緊急度に応じて対応するとよい。例えば、CPUからの波形メモリアクセスの緊急度が低いときは、音源チャンネルで使用されなかった空きタイムスロットを用いてアクセスを行なう。また、緊急度が高いときは、始めにCPUからの波形メモリアクセスの分を確保し、残りを音源チャンネルで使用する。
【0130】
また、上記形態では、図8,9に示したように処理Bおよび取り込みを行なう前半および後半の区間の前側のスロットで連続した波形メモリのアクセスを行なっているが、前側でなくてもよい。例えば、前半/後半区間内の前側のスロットでXアクセス処理を行ない、後側のスロットで各チャンネルについての連続した波形メモリのアクセスを行なうようにしてもよい。ただしその場合、例えば図8の取り込み前半区間804の処理が終了して、波形バッファに補間に必要な全サンプルが用意された後に、補間前半区間806の補間処理が始まるようにする必要がある(後半処理も同様)。そのため、補間を行なう区間をずらす必要がある(取り込み前半処理が終了した後に補間前半処理を開始し、取り込み後半処理が終了した後に補間後半処理を開始すれば十分)。さらに、Xアクセス処理のタイムスロットを前半区間あるいは後半区間中で分散させてもよい。
【0131】
さらに、上記形態では、図8,9に示したように各処理を1サンプリング周期を前半と後半に分割した区間で実行するようにしているが、区間の分け方はこれに限らない。例えば、1サンプリング周期を1/3,1/4,…に分割し、それらの区間を単位にして各処理を行なうようにしてもよい。また、等分割でなく、変則的な区間の分割を行なってもよい。さらに、区間を分けずに、1サンプリング周期を単位としてもよい。ただし、処理Bでアドレス送り出しを行なって波形メモリをアクセスする前に、処理AによるARAMの書き換えが行なわれることがないことを、保証する必要がある。そのためには、例えば区間を分けない場合は、ARAMを2セット用意し、処理Aによるアドレスの書き換えと処理Bによるアドレスの送り出しとで、2セットのアドレスRAMを交互に使用するなどの方法を採る必要がある。なお、1サンプリング周期を前半と後半に分けて処理する方式によれば、1セットのARAMで処理Aと処理Bとを交互に行なうことができるので、回路構成が簡易にでき合理的といえる。
【0132】
【発明の効果】
以上説明したように、本発明によれば、1つのプログラマブル信号処理手段を、録音用波形処理と再生用波形処理との両方に共用することができる。また、1つのプログラマブル信号処理手段で、録音用波形処理と再生用波形処理との両方を並列に実行することができる。したがって、簡単な構成で録音用波形処理と再生用波形処理とを行なうことができる。任意の処理アルゴリズム(指示手段により指示されたもの)で処理した波形を録音することができる。プログラマブル信号処理手段としてはDSPを用いることができるので、装置構成はそれ程複雑にしなくて済む。
【図面の簡単な説明】
【図1】この発明に係る波形メモリ音源装置を適用した電子楽器の全体のブロック構成図
【図2】この発明に係る波形メモリ音源装置を適用した音源部のブロック構成図
【図3】制御レジスタおよび読み書き回路の詳細図
【図4】制御RAMの構成図
【図5】アドレスRAMのメモリマップを示す図
【図6】波形バッファの構成図
【図7】FIFOの使用方法を示す図
【図8】読み書き回路の要部のタイミング図
【図9】図8の各処理中のチャンネルの様子を示す図
【図10】マイクロプログラムおよびミキサ設定の励(その1)を示す図
【図11】マイクロプログラムおよびミキサ設定の励(その2)を示す図
【図12】メインルーチンおよびキーオンイベント処理ルーチンのフローチャート図
【図13】サンプリングSWイベント処理ルーチンおよびリサンプリングSWイベント処理ルーチンのフローチャート図
【図14】波形読み出し(書き込み)SWイベント処理ルーチン、Xフラグ(読み出し)イベント処理ルーチン、およびXフラグ(書き込み)イベント処理ルーチンのフローチャート図
【図15】ソフト音源スタートSWイベント処理ルーチンおよびソフト音源フレーム割り込み処理ルーチンのフローチャート図
【図16】ソフト音源の楽音生成原理を説明するための図
【図17】Xアクセス回路の変形例を示す図
【符号の説明】
101…鍵盤、102…表示部、103…スイッチ群(SW)、104…中央処理装置(CPU)、105…リードオンリメモリ(ROM)、106…ランダムアクセスメモリ(RAM)、107…外部記憶装置、108…音源部、109…波形メモリ、110…外部回路、111…遅延メモリ、112…ディジタルアナログ変換器(DAC)、113…サウンドシステム(SS)、114…バスライン114、201…制御レジスタ、202…読み書き回路、203…音量変化制御回路、204…ミキサ、205…信号処理回路、206…インターフェース、301,302…レジスタ、303…優先フラグ、304…Xアクセス回路、311…XAレジスタ、312…セレクタ、313…FIFO(First In First Out(先入れ先出し)の8段のレジスタ)、314…Xフラグ、315…サンプル数レジスタ、321…処理A演算回路、322…アドレスRAM(ARAM)、323…アキュムレータ(ACC)、324…制御RAM、325…処理B演算回路、326…補間回路、327…波形バッファ、328…取り込み回路、329,330…セレクタ(SEL)。
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a sound source device that generates and outputs digital musical sound waveform data, and more particularly to a sound source device that can execute both recording waveform processing and reproduction waveform processing in parallel using a single DSP.
[0002]
[Prior art]
Conventionally, various types of sound source devices are known. The musical sound generated by such a sound source device is converted into an effect by a DSP (digital signal processor).
(Effect) The sound is given and given.
[0003]
[Problems to be solved by the invention]
On the other hand, such a sound source device is also known in which an external musical sound is sampled and stored (recorded) in a waveform memory for use in musical sound generation. In order to sample musical sounds, a sampling circuit for capturing external musical sounds is usually provided in the sound source device.
[0004]
By the way, in recent years, the demand for the function of the sound source device has been advanced, and there is a demand for improving the function of the sound source device without complicating the configuration of the device. However, without complicating the configuration of the device, sampling is performed during sound generation, or the waveform data once sampled and written to the waveform memory is read, and after applying effects, resampling is performed to write the waveform data again. I couldn't. That is, neither the recording waveform processing nor the reproduction waveform processing can be performed without complicating the configuration of the apparatus.
[0005]
SUMMARY OF THE INVENTION An object of the present invention is to make it possible to execute both recording waveform processing and reproduction waveform processing in a sound source device of various types without complicating the device configuration.
[0006]
[Means for Solving the Problems]
In order to achieve this object, a sound source device according to the invention of claim 1 includes storage means for recording a musical sound waveform, A writing / reading unit that writes a musical sound waveform to the storage unit and reads a musical sound waveform stored in the storage unit; Programmable signal processing means for performing signal processing according to the loaded program; A mixer connected to the read / write means, the programmable signal processing means, an external circuit, and a sound system; An instruction means for instructing a recording operation or a reproduction operation; and (i) when a recording operation is instructed by the instruction means, a predetermined first program is loaded into the programmable signal processing means In addition, a musical sound waveform supplied from the external circuit is supplied to the programmable signal processing means via the mixer, and an output signal of the programmable signal processing means is supplied to the read / write means via the mixer. By setting the mixer, the musical sound waveform from the external circuit is subjected to signal processing for recording according to the first program by the programmable signal processing means and stored in the storage means by the read / write means Control and (ii) When a reproduction operation is instructed by the instruction means, a predetermined second program is loaded into the programmable signal processing means The musical sound waveform read from the storage means by the read / write means is supplied to the programmable signal processing means via the mixer, and the output signal of the programmable signal processing means is supplied to the external signal via the mixer. The sound wave waveform read out by the read / write means after setting the mixer to be supplied to the sound system is subjected to signal processing for reproduction according to the second program by the programmable signal processing means, and the sound system Control to play in And a control means.
[0009]
Claim 2 The sound source device according to the invention of claim 1 The programmable signal processing means is a digital signal processor.
[0010]
DETAILED DESCRIPTION OF THE INVENTION
Embodiments of the present invention will be described below with reference to the drawings.
[0011]
FIG. 1 shows an overall block configuration of an electronic musical instrument to which a sound source device according to the present invention is applied. FIG. 2 shows a detailed block configuration of the sound source unit of FIG. In the drawings described below, the same number indicates the same item.
[0012]
The overall configuration of this electronic musical instrument will be described with reference to FIG. The electronic musical instrument includes a keyboard 101, a display unit 102, a switch group (SW) 103, a central processing unit (CPU) 104, a read only memory (ROM) 105, a random access memory (RAM) 106, an external storage device 107, and a sound source unit. 108, a waveform memory 109, an external circuit 110, a delay memory 111, a digital-analog converter (DAC) 112, a sound system (SS) 113, and a bus line 114. The keyboard 101, the display unit 102, the switch group 103, the CPU 104, the ROM 105, the RAM 106, the external storage device 107, and the sound source unit 108 are connected to each other by a bus line 114.
[0013]
The keyboard 101 is a keyboard provided with a plurality of keys for a user to perform a performance operation. The display unit 102 is provided on the panel of the electronic musical instrument and displays various types of information. The switch group 103 is provided on the panel, and the user can give various instructions to the electronic musical instrument by operating the switch group 103. The CPU 104 controls the operation of the entire electronic musical instrument. In particular, during normal performance, the operation of the keyboard 101 is detected, and a sound generation instruction is issued to the sound source unit 108 according to the operation. The ROM 105 stores a program (such as a sound source control program for controlling the sound source unit 108) executed by the CPU, various constant data, and the like. The RAM 106 is used as a work register. The external storage device 107 stores waveform data to be loaded into a waveform memory 109 having a DRAM configuration which will be described later.
[0014]
The sound source unit 108 reads out waveform data (waveform samples) from the waveform memory 109 in response to an instruction from the CPU 104, and performs interpolation, envelope application (volume change control), channel accumulation (mixing), and effect (effect) application. Processed and output as musical sound waveform data. The musical sound waveform data output from the sound source unit 108 is converted into an analog signal by the DAC 112 and emitted by the sound system 113.
[0015]
The waveform memory 109 is constituted by a DRAM (dynamic RAM). The waveform memory 109 stores waveform sample data sampled at a predetermined rate. One waveform sample is in a 16-bit uncompressed format, and an address is attached to each waveform sample. That is, one waveform sample can be read out with one access. The waveform sample may be read from the external storage device 107 and stored in the waveform memory 109 prior to the sound generation, but the sound source of this embodiment is used particularly when performing the operation of generating sound for a plurality of channels. Since the unused time slot that has not been used can be used for another purpose, the waveform data is read out from the external storage device 107 and stored in the waveform memory 109 using the empty time slot during the operation of musical tone generation. May be.
[0016]
The external circuit 110 will be described in detail later. The delay memory 111 is a delay memory used in a signal processing circuit (DSP) in the sound source unit 108. When performing processing such as applying an effect to a musical sound waveform, for example, data at a certain timing is written into the delay memory 111, read out after a predetermined clock, and used for computation, so that the delay memory is used to obtain delayed data. 111 is used.
[0017]
The sound source unit 108 will be described in detail with reference to FIG. In FIG. 2, the sound source unit 108 includes a control register 201, a read / write circuit 202, a volume change control circuit 203, a mixer 204, a signal processing circuit 205, and an interface 206. The sound source unit 108 operates in a time-division 32 channel. Each unit in the sound source unit 108 is supplied with a control signal such as a control clock signal serving as a reference signal for performing a time division operation and a channel count value for repeatedly counting 0 to 31.
[0018]
In FIG. 2, a control register 201 is a control register for storing various types of designation information (commands and parameter information for the sound source unit 108) sent from the CPU 104. An X access circuit 304 for controlling X access processing is provided in the control register 201, which will be described in detail later. The CPU 104 sets predetermined designation information in the control register 201 and issues a sound generation start instruction. The designation information to be set includes an allocated channel, a waveform memory read pitch (frequency number), a waveform memory read section, an envelope parameter, setting information for the mixer 204, and an effect coefficient.
[0019]
When receiving a sound generation start instruction in a certain channel, the sound source unit 108 starts an operation of generating a musical sound waveform. First, the read / write circuit 202 sequentially generates read addresses for the waveform memory 109. The read address is a value obtained by sequentially accumulating the designated read pitch from the beginning of the designated read section. In particular, the sound source unit 108 includes a waveform buffer (327 in FIG. 3 to be described later) for buffering waveform samples in the read / write circuit 202, and a necessary number of waveform samples (waveform data) for each channel from the waveform memory 109. Only the waveform memory access frequency in each channel can be varied. Therefore, the read / write circuit 202 sequentially outputs the waveform sample read addresses corresponding to the required number of accesses in each channel at a timing different from the time division channel timing. The read address generated by the read / write circuit 202 is input to the waveform memory 109, whereby the waveform sample is read from the waveform memory 109 at a timing different from the time division channel timing. The read / write circuit 202 receives this waveform sample, stores it in an internal waveform buffer, performs interpolation processing, and outputs it as musical sound waveform data.
[0020]
As described above, the read / write circuit 202 includes the waveform buffer for buffering the waveform samples, and only the necessary number of waveform samples are read from the waveform memory 109 for each channel, so that an empty time slot is obtained. It is done. In this vacant time slot, the read / write circuit 202 accesses the waveform memory 109 of musical sound waveform data returned from the mixer 204 to the waveform memory 109 or the waveform memory 109 returned from the mixer 204 via the X access circuit 304 described later. Operates so that you can write to it.
[0021]
The volume change control circuit 203 adds an envelope to the musical tone waveform data of each channel output in a time-sharing manner from the read / write circuit 202 and outputs it. The type of envelope to be assigned is determined based on the envelope parameter given from the CPU 104 via the control register 201. The addition of “32” to the output line 211 of the volume change control circuit 203 in FIG. 2 indicates that the output of the volume change control circuit 203 is for 32 time-division channels. The numerical values attached to the input / output lines of other parts also indicate the number of channels.
[0022]
The mixer 204 receives musical sound waveform data for 32 channels output from the volume change control circuit 203, musical sound waveform data for 8 channels output from the signal processing circuit 205 described later, and an external circuit 110 described later (interface 206). Musical sound waveform data for 8 channels to be output are input via input lines 211, 212, and 213. The mixer 204 multiplies the sound waveform data of each channel input from each of these input lines by an appropriate coefficient (the coefficient value is given by the CPU 104 via the control register 201) and mixes the data. As for the output of the mixer 204, 8 channels are sent to the signal processing circuit 205, 8 channels are sent to the external circuit 110 (via the interface 206), and 1 channel is sent to the X access circuit 304 in the control register 201. Are output to the DAC 112 via output lines 221, 222, 223, and 224, respectively. The mixer 204 can multiply the musical sound waveform data of an arbitrary channel input from an arbitrary input line by a specified coefficient and mix the result, and can send the mixing result to an arbitrary channel of an arbitrary output line. Which input line and which channel input are multiplied by which coefficient, how the result of mixing is mixed, and which output line the mixing result is output to are determined based on the designation of the CPU 104.
[0023]
The signal processing circuit 205 is a DSP that operates in accordance with a microprogram loaded in an internal microprogram memory. The signal processing circuit 205 performs signal processing independently on the sound waveform data from the mixer 204 for each channel, and the processing result is again output to the mixer 204. Return to. The signal processing circuit 205 obtains delayed data using the delay memory 111 as necessary when performing signal processing. The micro program executed by the signal processing circuit 205 is appropriately loaded by the CPU 104. The function of the signal processing circuit 205 is defined by the microprogram to be loaded, but simply speaking, it performs signal processing such as waveform processing at the time of sampling and resampling, or effect addition. Specific setting of this microprogram will be described later with reference to FIGS.
[0024]
The external circuit 110 is, for example, an analog / digital converter (ADC) for capturing voice or musical sound from the outside, an external DSP for effect (effect) applying processing, or a digital filter. The output from the mixer 204 to the external circuit 110 is for 8 channels, and the input from the external circuit 110 to the mixer 204 is for 8 channels. Since these are channels that can be used independently, a plurality of external circuits (of course different from each other). 110 may be connected (via interface 206) to any channel of any input / output line. Note that “external” means “external” when viewed from the sound source unit 108, and the external circuit 110 may be provided in the electronic musical instrument of FIG. 1 or provided outside the electronic musical instrument of FIG. May be.
[0025]
As described above, the mixer 204 multiplies the sound waveform data of an arbitrary channel input from an arbitrary input line 211 to 213 by a specified coefficient and mixes the result, and the mixing result is arbitrarily set to an arbitrary output line 221 to 224. Therefore, for example, the following processes (1) to (4) can be performed.
[0026]
(1) Using an ADC as the external circuit 110, an analog signal input from a microphone or the like is converted into a digital signal and input to the mixer 204. The mixer 204 mixes the external musical sound signal with the musical sound generated by reading the waveform data from the waveform memory 109 inside the sound source unit 108 and outputs it to the output line 224 to the DAC 112. If necessary, the output of the mixer 204 is temporarily input to the signal processing circuit 205 or other external circuit 110 instead of being output to the DAC 112, and a waveform such as an effect applying process using the signal processing circuit 205 or other external circuit 110 is used. You may make it output to DAC112, after processing.
[0027]
(2) External musical sounds can be sampled. That is, using an ADC as the external circuit 110, an analog signal input from a microphone or the like is converted into a digital signal and input to the mixer 204. The mixer 204 mixes the external musical sound signal with, for example, the musical sound generated by reading the waveform data from the waveform memory 109 inside the sound source unit 108, and outputs it to the output line 223 to the X access circuit 304. The data is written into the waveform memory 109 via 202. If necessary, the output of the mixer 204 is input to the signal processing circuit 205 or the external circuit 110 instead of being output to the output line 223 to the X access circuit 304, and the effect applying process is performed using the signal processing circuit 205 or the external circuit 110. The waveform may be output to the X access circuit 304 after waveform processing such as the above is performed.
[0028]
{Circle around (3)} Resampling (processing for processing the waveform prepared on the waveform memory 109 by sampling or the like and writing it again in the waveform memory 109) can be performed. That is, the waveform data stored in the waveform memory 109 by sampling or the like is read using a predetermined tone generation channel of the read / write circuit 202 and input to the mixer 204. Since there is a case of resampling in which two or more waveforms are mixed and rewritten, the waveform data read here is one or a plurality of waveform data. In the mixer 204, this musical sound signal is sent to the signal processing circuit 205 and the external circuit 110, and various waveform processing is performed as necessary, and the result is obtained. The mixer 204 that has received the musical tone signal subjected to the waveform processing outputs the musical tone signal to the output line 223 to the X access circuit 304 and writes it into the waveform memory 109 via the read / write circuit 202. Note that the first mixing result in the mixer 204 may be supplied to the X access circuit 304 as it is without being sent to the signal processing circuit 205 or the external circuit 110.
[0029]
{Circle around (4)} Using the DSP or digital filter as the external circuit 110 or using the signal processing circuit 205, effect processing and filtering processing are performed on the musical sound waveform extracted from the mixer 204, and the processing result is returned to the mixer 204. The mixer 204 mixes the processed musical sound waveform with the musical sound generated inside the sound source unit 108 and outputs it to the output line 224 to the DAC 112 and the output line 223 to the X access circuit 304.
[0030]
The above (1) to (4) are examples of processing that can be realized in the present embodiment. The processing time of the time division processing in the sound source unit 108 can be secured, and a necessary microprogram is stored in the signal processing circuit 205. Can be loaded to the DAC 112, and the various functions of the external circuit 110 and the signal processing circuit 205 including the above (1) to (4) are arbitrarily combined to output to the DAC 112 or via the X access circuit 304 Thus, the data can be returned to the read / write circuit 202 and written into the waveform memory 109.
[0031]
FIG. 3 shows a detailed block configuration of the control register 201 and the read / write circuit 202 in the sound source unit 108. In the circuit shown in FIG. 3, the control register 201 does not show all of the control registers, but shows a part thereof. The control register 201 stores other control data such as envelope parameters, mixer settings, and effect coefficients in addition to those shown in FIG.
[0032]
The control register 201 includes a register 301, a register 302, a priority flag 303, and an X access circuit 304. The registers 301 and 302 store various instruction information transmitted from the CPU 104 when instructing generation of musical sounds. Specifically, the register 301 stores, for example, an initial value AS of a read address (relative address) for waveform reading, a data length LPA of a loop portion of waveform data, a pitch PITCH, and the like. The register 302 stores an absolute address WA indicating the head of the loop portion of the waveform data to be read. Note that the initial value AS of the read address is a negative address because it is a relative address based on the start position of the loop portion of the waveform data (that is, the end of the attack portion). Reading of the waveform data starts from a position before the absolute address WA by the amount indicated by the initial value AS. The data length LPA of the loop portion of the waveform data is a relative address (positive value) of the loop portion end position.
[0033]
The X access circuit 304 includes an XA register 311, a selector 312, a FIFO (first-in first-out 8-stage register) 313, an X flag 314, and a sample number register 315. The X access circuit 304 performs X access processing (access to the waveform memory 109 from the CPU 104 and writing of the musical sound waveform data sent from the mixer 204 via the output line 223 to the waveform memory 109) to generate a musical sound. This is a circuit that performs control to be executed in parallel with the waveform memory read-out. The priority flag 303 is a flag that is turned on when it is desired to perform X access processing preferentially. The operation and function of the X access circuit 304 and the usage of the X access processing and priority flag 303 will be described later.
[0034]
The read / write circuit 202 includes a processing A arithmetic circuit 321, an address RAM (ARAM) 322, an accumulator (ACC) 323, a control RAM 324, a processing B arithmetic circuit 325, an interpolation circuit 326, a waveform buffer 327, a capture circuit 328, and a selector (SEL). 329 and 330 are provided.
[0035]
In the control register 201 and the read / write circuit 202 of FIG. 3, roughly five processes of process A, process B, capture process, interpolation process, and X access process are performed. The outline of each process is as follows. The process A is a process mainly executed by the process A arithmetic circuit 321. Specifically, an address of each channel (waveform sample read address (relative address)) is generated according to time-division channel timing to generate a musical sound. It is processing to do. The address of each channel is held in the ARAM 322. The process B is a process that is mainly executed by the process B arithmetic circuit 325. Specifically, in order to generate a musical tone, the address WMA (waveform sample read address (absolute address)) is different from the time division channel timing. ) To the waveform memory 109 via the selector 329. The acquisition process is a process mainly executed by the acquisition circuit 328. Specifically, the waveform sample read according to the address sent to the waveform memory 109 by the process B is acquired via the selector 330, and each channel is read. This is a process of writing to the waveform buffer 327 separately. When the process B and the capture process are performed, the selectors 329 and 330 input the address WMA output from the process B arithmetic circuit 325 to the address terminal of the waveform memory 109 and read the waveform sample read from the waveform memory 109. Is controlled so as to be captured by the capture circuit 328. The interpolation process is a process executed by the interpolation circuit 326. Specifically, the waveform sample of each channel is read from the waveform buffer 327 in accordance with the time division channel timing, and the interpolated sample (musical waveform data) is interpolated. ) Is generated and output. The musical sound waveform data output from the interpolation circuit 326 is input to the volume change control circuit 203 in FIG. The X access process is a process that is mainly executed under the control of the X access circuit 304. Specifically, the CPU 104 uses a time slot other than the time slot for accessing the waveform memory 109 by the process B and the capture process. Is a process for accessing the waveform memory 109 and writing the musical tone waveform data sent from the mixer 204 via the output line 223 to the waveform memory 109. During the X access processing, the selectors 329 and 330 perform selection control so that the address stored in the XA register 311 is input to the address terminal of the waveform memory 109 and the data line of the waveform memory 109 is connected to the FIFO 313. Is done. Details of the above five processes will be described later.
[0036]
FIG. 4 shows the configuration of the control RAM 324 in FIG. Although details will be described later, in the process A, in parallel with the address creation for each channel, the necessary number of samples to be read for each channel is obtained and stored in the control RAM 324. Therefore, the control RAM 324 is configured with a plurality of areas for storing a channel number (CH number) and the number of samples to be read in the channel. The read / write circuit 202 includes a write pointer and a read pointer. When the required number of samples to be read in each channel is written to the control RAM 324 (Process A), the write pointer is recommended, and the channel number and the number of samples are obtained from the control RAM 324. When reading and sending out the read address for the channel (process B), the read pointer is advanced. The control RAM 324 is used in a ring shape. When the write or read pointer reaches one end of the control RAM 324, the position of the next pointer is the other end of the control RAM 324. Further, writing and reading are performed so that the position pointed to by the read pointer follows the position pointed to by the write pointer, but it is assumed that the size of the area is secured so that the write pointer does not pass the read pointer. As with the accumulator 323, the write pointer and the read pointer are provided separately for the first half process and the second half process, respectively. When simply referred to as a write pointer and a read pointer, the first half process refers to the first half process, and the second half process refers to the second half process. The first half process is the process of the 0th to 15th channels, and the second half process is the process of the 16th to 31st channels (described later in FIGS. 8 and 9). In addition to the configuration shown in FIG. 4, one channel may be associated with each channel, and the required number of samples may be written therein.
[0037]
FIG. 5 shows a memory map of the ARAM 322 of FIG. The ARAM 322 is an area used for creating an address of each channel in the process A. The ARAM 322 includes areas for each channel of 32 channels (0th to 31st channels), and stores the current address value of each channel in these areas. Each channel area is composed of an address upper ADH and an address lower ADL. The sizes of the ADH and ADL areas are 16 bits each. A 32-bit address value combining the address upper ADH and the address lower ADL is divided into an address integer part and an address decimal part. The address integer part is 23 bits and the address fraction part is 9 bits. The address integer part corresponds to the address of the waveform memory 109. That is, there is one waveform sample in the waveform memory 109 corresponding to one value of the address integer part. The address decimal part indicates information smaller than that and is information used in interpolation processing using several waveform samples.
[0038]
FIG. 6 shows the configuration of the waveform buffer (sample RAM) 327 of FIG. The waveform buffer 327 includes four reproduction sample storage areas for each channel. The four reproduction sample storage areas are used in a ring shape. That is, a pointer is provided for each channel, and when a waveform sample is written, the pointer is advanced by one at the position indicated by the pointer. For example, in the case of the i-th channel in FIG. 6, the pointer advances in the order of reproduction sample 1 → 2 → 3 → 4 → 1 → 2 →.
[0039]
Next, the five processes executed by the control register 201 and the read / write circuit 202 of FIG. 3 will be described in detail. The timing for executing these processes will be described first, and then the details of each process will be described.
[0040]
With reference to FIG. 3, FIG. 8, and FIG. 9, an outline of the processing timing of the main part of the read / write circuit 202 will be described. In FIG. 8, “Process A” indicates a section in which the process A executed mainly by the process A arithmetic circuit 321 in FIG. 3 is performed. “Process B and X access process” indicates a section in which the process B executed mainly by the process B arithmetic circuit 325 and the X access process executed under the control of the X access circuit 304 in FIG. The “capture process and X access process” indicates a section in which the capture process executed mainly by the capture circuit 328 and the X access process performed under the control of the X access circuit 304 in FIG. “Interpolation processing” indicates a section in which interpolation processing is performed by the interpolation circuit 326 of FIG.
[0041]
In the processing section of “Processing A” and “Interpolation processing”, one sampling period is divided into a first half section and a second half section, the processing of the 0th to 15th channels is performed in the first half section, and the 16th to 31st channels are processed in the second half section. Processing is to be performed. That is, in the first half section (process A first half section) 801, the process A related to the 0th to 15th channels is performed, and in the second half section (process A second half section) 811 the process A related to the 16th to 31st channels is performed. ) In 806, the interpolation processing for the 0th to 15th channels is executed, and in the latter half (interpolation latter half) 816, the interpolation processing for the 16th to 31st channels is executed. In the processing section of “Process B and X access processing”, processing B is performed in the front sections 802 and 812 of each section in which one sampling period is divided into the first half section and the second half section, and X access processing is performed in the rear sections 803 and 813. To do. The process B first half section 802 for performing the process B of the 0th to the 15th channels is started immediately after the process A first half section 801 for performing the process A of the channel is finished, and the free time after the necessary process B is performed. The X access processing is performed in the section 803. Similarly, the process B latter half section 812 for performing the process B of the sixteenth to thirty-first channels is started immediately after the process A latter half section 811 for performing the process A of the channel is completed, and after the necessary process B is performed. The X access process is performed in the idle time section 813 of. Since the capturing process is performed in accordance with the address sending timing of process B, the capturing process is similarly performed in the front sections 804 and 814 of each section in which one sampling period is divided into the first half section and the second half section. The X access processing is performed in the rear sections 805 and 815. After the capturing process, interpolation processing for each channel is performed according to the time division channel timing in sections 806 and 816 starting at a timing at which it is guaranteed that the waveform samples of each channel are aligned in the waveform buffer 327.
[0042]
FIG. 9 shows the state of the channel during each process of the first half process of FIG. “Processing A first half ch” in FIG. 9 indicates a channel state in the section 801 in FIG. “Process B first half ch and X access process” in FIG. 9 shows the state of channels in sections 802 and 803 in FIG. “The first half ch and X access processing” in FIG. 9 shows the state of the channels in the sections 804 and 805 in FIG. “Interpolation first half ch” in FIG. 9 indicates a channel state in the section 806 in FIG. The same applies to the latter half of the processing. In FIG. 9, the timings of the respective channels are described as being aligned vertically, but the timing of each process is actually shifted as shown in FIG.
[0043]
In this embodiment, as can be seen from FIG. 9, the address generation process A by the process A arithmetic circuit 321 and the interpolation process by the interpolation circuit 326 are performed in order according to time-division channel timings in which one sampling period is equally divided. The processing for each channel is performed. On the other hand, the processing B of address sending from the processing B arithmetic circuit 325 and the processing of capturing waveform data by the capturing circuit 328 operate at a timing independent of the time division channel timing.
[0044]
For example, in FIG. 8 and FIG. 9, in the first half section 801 of processing A, the processing A arithmetic circuit 321 creates addresses for each channel in order according to the time division channel timing for the 0th to 15th channels. In the first half of the process B 802, the process B arithmetic circuit 325 has one address for the 0th channel, three addresses for the second channel, and one address for the fifth channel at a timing different from the time division channel timing. In this manner, the addresses of the 0th to 15th channels are sent out. The time width of the section in which one address is sent out is 1/4 of the time width of the section in which processing for one channel is performed at the time division channel timing. Therefore, four waveform memories can be accessed with a time width for processing for one channel. The number of addresses sent out in each channel is different. The past waveform data (reproduced sample) is held in the waveform buffer (sample RAM) 327, and only the necessary number of waveform data is read out for each channel. This is because there are enough channels or there is a channel that does not need to be sounded and does not require sending out addresses. Here (FIG. 9), the 0th channel requires 1 access, the 2nd channel requires 3 accesses, the 5th channel requires 1 access, and the 7th channel requires reading from the waveform memory for 2 accesses. Yes. The other channels are channels that are not sounded or that can generate a musical tone only from samples that have already been read and stored in the waveform buffer 327. The channel that does not generate sound is a channel whose volume level is lowered by the volume change control circuit 203 or the like, and the channel is controlled so as not to use the waveform memory access timing in the process B. .
[0045]
In the first half section 804, the waveform data read from the waveform memory 109 is fetched according to the address sending timing in the first half section 802 of the process B. The interpolation circuit 326 performs interpolation processing on the 0th to 15th channels using the data of the waveform buffer 327 in accordance with the time division channel timing in the first half interval 806. When the interpolation is performed for a certain channel, the waveform data of the channel necessary for the interpolation is prepared in the waveform buffer 327.
[0046]
Musical sound waveform data of the 0th to 15th channels are generated at the timing as described above. The same applies to the 16th to 31st channels processed using the latter half.
[0047]
An empty time slot appears when the address sending process B in the process B arithmetic circuit 325 and the waveform data fetch process in the fetch circuit 328 are performed at a timing different from the time division channel timing by the required number of accesses. In the section of “Processing B first half ch and X access processing” and “Capture first half ch and X access processing” in FIG. 9, “-ch” indicates an empty time slot that is not used for sample reading of any channel. The empty time slot sections 803 and 805 can be arbitrarily used. Therefore, the processing B arithmetic circuit 325 switches the selectors 329 and 330 in the interval of this empty time slot, and performs the X access processing (the access processing to the waveform memory 109 by the CPU 104 performed under the control of the X access circuit 304, and The musical tone waveform data returned from the mixer 204 via the output line 223 is written into the waveform memory 109).
[0048]
A control clock from a clock generator (not shown) is input to each part of the control register 201 and the read / write circuit 220 in FIG. 3 including the process A arithmetic circuit 321 and the process B arithmetic circuit 325. Each part operates on the basis of this clock, whereby each process is executed at a timing as shown in FIGS.
[0049]
Next, five processes by the control register 201 and the read / write circuit 202 of FIG. 3 will be described in detail in the following (1) to (5).
[0050]
(1) Process A The process A executed by the arithmetic circuit 321 will be described in detail. When a tone generation start instruction is given for a channel, processing A calculation circuit 321 starts processing A for the channel. Process A is executed at time-division channel timing as described in FIGS. First, the processing A arithmetic circuit 321 initializes the address storage area (ADH and ADL) of the ARAM 322 (FIG. 5) corresponding to the channel at the first time slot of the channel concerned (immediately after the note-on rise). The initial value is the leading address AS of the waveform data to be read (a negative value because it is a relative address based on the leading position of the loop portion of the waveform data), and is specified by the CPU 104 via the register 301 in FIG. In the time slot of the channel after the next time, the processing A arithmetic circuit 321 adds the pitch PITCH which is an advance value (frequency number) of the address in the channel to the current address value in the address storage area of the ARAM 322 corresponding to the channel. To do. The addition result is stored in the address storage area of the original ARAM 322. The pitch PITCH is designated by the CPU 104 via the register 301 in FIG.
[0051]
Specifically, this addition is performed by adding the pitch PITCH to the address decimal part of the current address value of the channel, and adding the value overflowing from the bit number of the address decimal part of the addition result to the address integer part of the current address value. This is done by adding to. This overflow value is the number of waveform samples to be newly read out. This is because the waveform buffer 327 holds the waveform sample read so far in the read / write circuit 202, and the overflow value is the advance amount of the read address on the waveform memory. FIG. 9 described above is a case where the overflow value is 1 for the 0th channel, 3 for the 2nd channel, 1 for the 5th channel, and 2 for the 7th channel. The other channels are channels that do not sound or have an overflow value of 0.
[0052]
The waveform data on the waveform memory 109 is composed of an attack part and a loop part that follows the attack part, and the initial value AS (negative value) of the read address with reference to the start position of the loop part of the waveform data (that is, the end of the attack part). ) And the relative address LPA (positive value) of the loop end position. Waveform sample access starts from the beginning of the attack part (that is, the current address starts from the negative relative address AS and gradually increases). When the attack part is read, the current address value becomes a positive value and loops. Enter the department. Thereafter, the waveform sample in the loop portion is repeatedly read out as necessary. Therefore, when the current address value exceeds the loop end position (= relative address LPA), the value LPA is subtracted from the current address value, and the subtraction result is set as a new current address value. An absolute address WA indicating the beginning of the loop portion of the waveform data is added to the current address value later. The process A arithmetic circuit 321 also performs a process of returning such an address to the vicinity of the head of the loop part during the process of creating the address.
[0053]
As described above, the pitch (frequency number) is accumulated in the current address on the ARAM 322 in the time slot of the channel, and the sequential addresses related to the channel are generated on the ARAM 322.
[0054]
In the process A, in addition to the process of creating the address of each channel described above, the write pointer indicating the write position in the control RAM 324 (FIG. 4) is advanced by one, and the required number of samples for each channel is set to the write pointer of the control RAM 324. The process of storing in the position indicated by is performed. Since the required number of samples for each channel matches the value overflowing higher than the number of bits in the address decimal part of the addition result obtained by adding the pitch PITCH to the address decimal part of the current address value, this overflow value Is stored in the control RAM 324 together with the channel number.
[0055]
Further, in the process A, in addition to the above-described address creation and storage of the required number of samples for each channel, the number of waveform memory accesses required for each of a plurality of predetermined channels (in this embodiment, the number of samples and (According to the number of accesses) is also accumulated. Specifically, the processing A arithmetic circuit 321 accumulates the necessary number of samples to be read for these channels in parallel with the address creation (first half processing) of the 0th to 15th channels, and further the 16th to 31st. In parallel with the channel address generation (second half processing), the necessary number of samples to be read for these channels is accumulated.
[0056]
An accumulator (ACC) 323 is an accumulator for performing this accumulation. Since the read / write circuit 202 performs accumulation in the first half process and the second half process, the accumulator 323 actually comprises two accumulators, a first half accumulator and a second half accumulator. The term “accumulator 323” simply refers to the first half accumulator in the first half processing and the second half accumulator in the second half processing.
[0057]
Specifically, the accumulation process is performed as follows. First, the accumulator 323 is initialized (zero cleared) at the start of the first half process and the second half process. Thereafter, the necessary number of samples (that is, the number of accesses) is accumulated in the accumulator 323 until the last channel of the first half process and the second half process. The required number of samples to be read for each channel is known when writing to the control RAM 324.
[0058]
Further, in the process A, the access count accumulated value as a result of the accumulation as described above exceeds the maximum accessible number (access limit count) in the first half or the second half of the process B that actually executes the access. The number of accesses and the interpolation order for each channel are determined according to the result. This will be described below. First, a description will be given focusing on the first-half process section. The first half processing section is a time section that is half of one sampling period, and processing B related to the 0th to 15th channels (and the capturing process executed after some delay time) is performed in this section. Further, the time width of the section where one address is sent out in the process B is ¼ of the time width of the section where processing for one channel is performed at the time division channel timing. Therefore, if the X access process is not performed in the section (that is, when there are no sections 803 and 805 in FIGS. 8 and 9), 64 accesses are possible in the first half section. In this embodiment, since 4-point interpolation is performed for each channel, even if it is necessary to read out waveform samples of 4 points in all 16 channels processed in the first half section, 4 points × 16 ch = 64 accesses. If all of the first half section is used for the process B and the capture process without performing the X access process, four-point interpolation can be performed for all channels. However, when the priority flag (detailed in the description of the next process B) 303 is turned on, a predetermined number of accesses (one time in this embodiment) are preferentially executed in the X access process of the first half section. Therefore, the maximum accessible number by the process B and the capture process in the first half section is a value obtained by subtracting the access number of the X access process from 64. Therefore, as described above, it is conceivable that the accumulated number of accesses accumulated by the accumulator 323 exceeds the maximum accessible number in the first half section. In this case, since it is not possible to access the number of samples of each channel written in the control RAM 324, the number of access times of any of the channels with a large number of accesses (for example, 3 times or 4 times) is reduced to perform interpolation. Drop the order. Decreasing the interpolation order means, for example, changing the four-point interpolation processing to three-point interpolation or two-point interpolation (linear interpolation). As a method for determining a channel for reducing the number of times of access, for example, the following methods (1) and (2) are available.
[0059]
(1) The number of accesses is reduced from one end to the channel order.
(2) The number of accesses is reduced from the channel whose volume level is low at that time. In this way, the influence on the musical sound is small. The volume level of each channel is known from the envelope value.
[0060]
In this embodiment, 64 accesses are possible in the first half section, and the interpolation is four-point interpolation. Actually, it is extremely rare to read out four points on all the 0th to 15th channels. From the result of accumulating the access count and comparing it with the maximum accessible count, there is practically no problem even if a function for determining the access count and interpolation order of each channel is not provided. However, this is an effective function when, for example, 6-point interpolation is performed for each channel instead of 4-point interpolation, or when the number of accesses to be preferentially secured for the X access processing when the priority flag 303 is on is large. The above description has been focused on the first half section, but the same applies to the second half section.
[0061]
(2) Next, the process B executed by the process B arithmetic circuit 325 will be described in detail. The processing B arithmetic circuit 325 performs processing B, that is, processing for sending an address to the waveform memory 109 at a timing different from the time division channel timing. As described with reference to FIG. 9, 4 accesses (reading of 4 samples) are possible within the time per channel of the time division channel timing. The waveform memory access process of the process B has no relation to the process according to the time division channel timing of the process A, and is sequentially performed for each channel that needs to be read. The channel and the number of samples that need to be read are determined by the above-described processing A and set in the control RAM 324. As described with reference to FIGS. 8 and 9, when the process B is performed for a certain channel, the process A for the channel has already been executed, and the address value of the channel is set in the ARAM 322.
[0062]
The address sending process will be described. First, it is determined whether or not the value of the read pointer indicating the read position in the control RAM 324 shown in FIG. 4 matches the value of the write pointer at the end of the first half or second half of the process A related to the channel. For example, when the process B of the channel is a process in the first half section 802 of FIG. 8, the value of the read pointer is compared with the value of the write pointer at the end of the first half section 801 of the process A. . If they match, it means that there are no more samples to be read in the section of the process B. Therefore, the process B in the section is finished, and control is performed so that the X access process described later is performed in the remaining empty slot.
[0063]
When the value of the read pointer does not match the value of the write pointer, the read pointer is advanced by one, and the channel number and the number of samples pointed to by the read pointer are read from the control RAM 324. Then, the addresses related to the channel numbers corresponding to the number of samples are sent to the waveform memory 109. Specifically, the current address integer part of the channel is read from the ARAM 322, a plurality of offsets for sequentially accessing samples of the required number of samples are added, and an absolute address WA indicating the head of the loop part of the waveform data is further added. Addition (the address created in process A is a relative address, so WA is added to convert it to an absolute address) to obtain the final read address WMA, and the selector 329 selects and outputs this address WMA. Control. As a result, one address is sent to the waveform memory 109. For example, in the example of FIG. 9, the offset to be added is 0 for the 0th channel, -2 for the first time of the second channel, -1 for the second time, 0 for the third time, and -1,2 for the first time of the fifth channel. The number of times is 0. As described above, the addresses are continuously sent out while the read pointer is advanced at the address sending timing described with reference to FIGS.
[0064]
As described with reference to FIGS. 8 and 9, since the address sending process is performed at a timing different from the time division channel timing as many times as necessary, an empty time slot appears as an access surplus time. Therefore, after the address sending process, the processing B arithmetic circuit 325 switches the selector 329 so that the address from the XA register 311 is selectively output (and the selector 330 so that the data line of the waveform memory 109 is connected to the FIFO 313). The X access process is performed using the remaining time under the control of the X access circuit 304.
[0065]
The priority flag 303 is appropriately turned on / off by the CPU 104. When the priority flag 303 is turned on, the processing B arithmetic circuit 325 performs at least one X access processing (a plurality of slots may be secured, regardless of the waveform data reading state of each channel for generating musical sound). Can be specified arbitrarily) (that is, in FIGS. 8 and 9, sections 803 and 805 are reserved in the first half process, and sections 813 and 815 are reserved in the second half process for at least one access each. ). As a result, the access processing to the waveform memory 109 from the CPU 104 or the writing processing of the musical sound waveform data returned from the mixer 204 via the output line 223 to the waveform memory 109 can be surely performed only one access.
[0066]
(3) Next, the capturing process executed by the capturing circuit 328 will be described. The capturing circuit 328 captures the waveform sample read by the address WMA sent from the processing B arithmetic circuit 325 and writes it in the waveform buffer 327. At this time, the selector 330 connects the data line of the waveform memory 109 to the fetch circuit 328 under the control of the processing B arithmetic circuit 325. As a result of waveform sample capturing, the waveform buffer 327 basically has 4 samples for each channel. However, if there is a channel whose interpolation order is reduced in process A, samples necessary for interpolation with the reduced order are prepared in the waveform buffer 327 for that channel. When the waveform sample stored in the waveform memory 109 is compressed, the acquisition circuit 328 performs decoding.
[0067]
Since the fetch process is performed in synchronization with the address sending by process B, as described in process B, an empty time slot appears as an access surplus time. Therefore, after the capturing process, the processing B arithmetic circuit 325 switches the selector 330 so that the data line of the waveform memory 109 and the FIFO 313 are connected, and uses this extra time under the control of the X access circuit 304. X access processing is performed.
[0068]
(4) Next, the interpolation processing executed by the interpolation circuit 326 will be described in detail. The interpolation circuit 326 performs interpolation processing for each channel in order according to the time division channel timing. Interpolation processing for one channel is as follows. First, four waveform samples of the channel are sequentially read from the waveform buffer 327. Each sample is multiplied by a predetermined interpolation coefficient and accumulated. The interpolation coefficient to be multiplied to each sample is determined based on the address fraction part FRAC of the channel. The address decimal part FRAC is input from the ARAM 322 via the processing B arithmetic circuit 325. As described above, the interpolated musical sound waveform data is generated and output. Note that, for channels whose interpolation order has been reduced by reducing the number of accesses to the waveform memory described above, interpolation with the reduced order is performed to obtain interpolated musical sound waveform data.
[0069]
(5) Next, the X access process will be described in detail. As described above, when there is an empty time slot after the address sample is sequentially sent out for each channel necessary for the process B and the capture process and the waveform sample is read to the waveform buffer 327, the process B arithmetic circuit 325 The selectors 329 and 330 are switched so that the X access processing is performed in the empty time slot section. Specifically, the selector 329 is switched so that the XA register 311 is connected to the address line of the waveform memory 109 in the sections 803 and 813 of FIGS. 8 and 9, and the FIFO 313 is used as the data line of the waveform memory 109 in the sections 805 and 815. The selector 330 is switched so as to be connected. The processing B arithmetic circuit 325 switches the selectors 329 and 330 in this manner and notifies the X access circuit 304 that the X access processing is possible. As a result, the X access circuit 304 starts the X access process (when instructed by the CPU 104). Further, the process B arithmetic circuit 325 switches the selectors 329 and 330 again at the end of the X access process (at the end of the first half and the second half, which is half the width of one sampling period), and performs the next process B and capture. Enable processing. Note that there is a slight timing difference between the input of the address to the waveform memory 109 and the data access of the address (for example, the first half interval 804 in FIG. 8 is slightly delayed from the first half interval 802 of the process B). The switching timing of the selector 330 and the switching timing of the selector 330 are slightly different from each other, but the switching control is appropriately performed by the processing B arithmetic circuit 325.
[0070]
Specifically, the X access processing includes processing for writing waveform data from the CPU 104 to the waveform memory 109, processing for reading waveform data from the waveform memory 109 by the CPU 104, and waveform data returned from the mixer 204 via the output line 223. There are three types of write processing to the waveform memory 109. Each will be described below.
[0071]
When data is written from the CPU 104 to the waveform memory 109, the CPU 104 first switches the selector 312 so that the data bus to which the CPU 104 is connected and the FIFO 313 are connected. Then, the CPU 104 sets a write address (first address) in the XA register 311, sets the number of waveform sample data to be written in the sample number register 315, and sets the first 8 samples of the waveform sample data to be written via the selector 312. Are sequentially set in the 8-stage FIFO 313 to instruct the X access circuit 304 to start writing. Thereafter, the CPU 104 refers to the X flag 314 as appropriate, and sequentially writes the remainder of the waveform sample data to be written into the FIFO 313 when the X flag 314 is on. The X flag 314 is a flag indicating the empty state of the FIFO 313. When data is written from the CPU 104, the X flag 314 is automatically turned on when the FIFO 313 is empty, and is automatically turned off when the FIFO 313 is empty. Therefore, the CPU 104 may send write data to the FIFO 313 until the X flag 314 is turned off.
[0072]
FIG. 7A shows how to use the FIFO when writing data from the CPU 104 to the FIFO 313. The rectangles 701 and 702 indicate the FIFO 313. The hatched portion indicates a portion where data is written and the white portion indicates an empty portion. In 701, data is written in all the eight stages of the FIFO 313 and the X flag is turned off. At this time, the CPU 104 cannot write data into the FIFO 313. When the data in the FIFO 313 is read and written into the waveform memory 109 in the X access process, the FIFO 313 is vacant as shown at 702, and the X flag is turned on. At this time, the CPU 104 can detect the ON state of the X flag and write the next write data into the FIFO 313.
[0073]
When all the waveform sample data to be written is sent to the FIFO 313, when viewed from the CPU 104, the writing is completed. Therefore, the CPU 104 instructs the X access circuit 304 to perform a CPU write stop process and ends the write process.
[0074]
On the other hand, the X access circuit 304 that has received the write start instruction from the CPU 104 is in each time slot of the sections (sections 803, 813, 805, and 815) where the processing B arithmetic circuit 325 indicates that it is an empty time slot. Processing to write the waveform sample data in the FIFO 313 to the waveform memory 109 is performed. The processing performed in one time slot is as follows. First, the address stored in the XA register 311 is sent to the waveform memory 109. Next, one waveform sample data is taken out from the FIFO 313, sent to the waveform memory 109, and written in the address position. Thereafter, the address of the XA register 311 is incremented. The X access circuit 304 is provided with a counter that is cleared to zero by a write start instruction and is counted up when one waveform sample data is written to the waveform memory 109. The value and the number of samples in the sample number register 315 are compared. When the value of the counter reaches the number of samples in the sample number register 315, it means that all the instructed data has been written, so the writing process is terminated. When the CPU 104 instructs the CPU write stop process, all data remaining in the FIFO 313 is written into the waveform memory 109, and the process ends. Note that without providing the sample number register 315, the X access circuit 304 may write data in the waveform memory 109 if there is data in the FIFO 313 until the CPU 104 instructs the CPU to stop writing.
[0075]
When data is read from the waveform memory 109 to the CPU 104, the CPU 104 first switches the selector 312 so that the data bus to which the CPU 104 is connected and the FIFO 313 are connected. The CPU 104 sets a read address (first address) in the XA register 311, sets the number of waveform sample data to be read in the sample number register 315, and instructs the X access circuit 304 to start reading. Thereafter, the CPU 104 refers to the X flag 314 as appropriate, and sequentially reads the waveform sample data from the FIFO 313 when the X flag 314 is on. The X flag 314 is a flag indicating the empty state of the FIFO 313. When data is read by the CPU 104, it is automatically turned on when there is read data from the waveform memory 109 in the FIFO 313, and automatically when there is no read data in the FIFO 313. Is turned off.
[0076]
FIG. 7B shows how to use the FIFO when the CPU 104 reads data from the FIFO 313. Rectangles 703 and 704 indicate the FIFO 313, the hatched portion indicates the portion storing the read data, and the white portion indicates the empty portion. In 703, all the eight stages of the FIFO 313 are empty and the X flag is turned off. At this time, since there is no read data in the FIFO 313, the CPU 104 cannot read the data. When data is read from the waveform memory 109 and written to the FIFO 313 in the X access process, the X flag is turned on as indicated by 704. At this time, the CPU 104 can detect the ON state of the X flag and read the read data from the FIFO 313.
[0077]
The X flag 314 indicates whether or not there is read data in the FIFO 313. When the X flag 314 is off, it is possible to determine whether or not the number of waveform samples specified by the sample number register 315 have been read. Yes. Therefore, when the X flag 314 is off, the CPU 104 determines whether or not the waveform sample data of the number specified by the sample number register 315 has been read. If it has been read, the CPU 104 instructs the X access circuit 304 to perform CPU read stop processing. To complete the reading process.
[0078]
On the other hand, the X access circuit 304 that has received the read start instruction from the CPU 104 is in each time slot in the section (sections 803, 813, 805, and 815) where the processing B arithmetic circuit 325 indicates that it is an empty time slot. Processing for reading out waveform sample data from the waveform memory 109 and writing it into the FIFO 313 is performed. The processing performed in one time slot is as follows. First, the address stored in the XA register 311 is sent to the waveform memory 109. Next, one waveform sample data at the address is read from the waveform memory 109 and written into the FIFO 313. Thereafter, the address of the XA register 311 is incremented. The X access circuit 304 is provided with a counter that is cleared to zero by a read start instruction and is counted up when one waveform sample data is read from the waveform memory 109 to the FIFO 313. The X access circuit 304 The counter value is compared with the number of samples in the sample number register 315. When the value of the counter reaches the number of samples in the sample number register 315, it means that the instructed number of data has been read, and the reading process is terminated. When the CPU 104 instructs the CPU read stop process, the process ends. Instead of providing the sample number register 315, the X access circuit 304 may continue reading data from the waveform memory 109 to the FIFO 313 until the CPU 104 instructs to stop the CPU reading.
[0079]
When the waveform data returned from the mixer 204 via the output line 223 is written into the waveform memory 109, the CPU 104 first switches the selector 312 so that the output line 223 from the mixer 204 and the FIFO 313 are connected. Then, the CPU 104 sets a write address (first address) in the XA register 311, sets the number of waveform sample data to be written in the sample number register 315, and instructs the X access circuit 304 to start writing. Thereafter, since the waveform sample data is sent from the mixer 204 via the output line 223 every sampling period, the X access circuit 304 writes the sent data in the FIFO 313. In the case of writing data returned from the mixer 204, data cannot be written to the FIFO 313 when the X flag 314 is on as in the case of data writing from the CPU 104 described above. Since the received data is sent every sampling period, the sent data must be immediately written to the FIFO 313. If there is no empty FIFO 313 at that time, the data sent from the mixer 204 is discarded. However, as already described, it is considered that there is almost no situation where waveform memory accesses for generating musical sounds are so crowded that no single slot for X access processing can be taken during one sampling period. Even if the data sent from 204 is discarded, there is almost no problem in practical use. If the priority flag 303 is turned on, the slot for the X access process can be secured at least once during one sampling period, so that data sent from the mixer 204 can be written to the waveform memory 109 without fail. .
[0080]
On the other hand, the X access circuit 304 that has received the write start instruction from the CPU 104 is in each time slot of the sections (sections 803, 813, 805, and 815) where the processing B arithmetic circuit 325 indicates that it is an empty time slot. A process for writing the waveform sample data in the FIFO 313 to the waveform memory 109 is performed. Since this process is the same as that described for writing the waveform data from the CPU 104, a description thereof will be omitted.
[0081]
The detailed description of the five processes by the control register 201 and the read / write circuit 202 in FIG.
[0082]
10 and 11 show specific examples of setting of the signal processing circuit (DSP) 205 and the mixer 204 of FIG.
[0083]
FIG. 10A shows an example of settings when sampling is performed. Blocks 1001 and 1005 indicate mixing processing (hereinafter simply referred to as MIX) by the mixer 204 of FIG. Blocks 1002, 1003, and 1004 indicate processing (corresponding to the microprogram set in the signal processing circuit 205) to be executed by the signal processing circuit 205 in FIG. The arrows indicate the flow of signals, and the FIFO 1006 corresponds to the FIFO 313 in the X access circuit 304 of FIG. “ADC input” to the MIX 1001 is an external tone signal input from the external circuit (ADC) 110 of FIG. 2 via the interface 206 and the input line 213. This ADC input uses one of the eight channels input to the mixer 204.
[0084]
The output of the MIX 1001 is one of 8 channels output from the mixer 204 of FIG. 2 to the signal processing circuit 205 via the output line 221. The signal processing circuit 205 performs processing shown in blocks 1002 to 1004 in FIG. That is, the envelope is extracted from the output from the MIX 1001 by the envelope extraction processing 1003, and the gate 1002 is opened at the rising edge of the envelope. When the gate 1002 is opened, the output of the MIX 1001, that is, the musical sound waveform input from the outside, is sent to the waveform processing 1004 at every sampling period. In the waveform processing 1004, various waveform processing is performed on the input musical sound waveform. For example, DC cut processing that cuts the DC component, noise mute processing that mutes when the input level is low, compressor processing that lowers the gain when the envelope level is above a certain value, and when the input waveform level is low Expander processing for reducing the level, and Fs (sampling frequency) conversion processing for dropping a musical sound waveform input from the outside at a high sampling frequency to a low sampling frequency or conversely increasing the sampling frequency.
[0085]
The output of the waveform processing 1004 returns to the MIX 1005 again. This corresponds to a portion where the processing result of the signal processing circuit 205 in FIG. 2 is returned to the mixer 204 using one channel of the input line 212. Then, a musical sound waveform is output from the MIX 1005 to the FIFO 1006 and written to the waveform memory 1009. This indicates a part for writing waveform data from the mixer 204 to the FIFO 313 in the control register 201 via the output line 223. The data written in the FIFO 313 is written in the waveform memory 109 as already described.
[0086]
FIG. 10B shows an example (part 1) of setting of the microprogram for resampling and the mixer. Similarly to FIG. 10A, MIXs 1011 and 1014 correspond to the mixer 204 in FIG. 2, and the FIFO 1015 corresponds to the FIFO 313 in FIG. Blocks 1012 and 1013 correspond to a microprogram set in the signal processing circuit 205 of FIG. The “ch output” to the MIX 1011 is a tone signal input from the volume change control circuit 203 of FIG. 2 via the input line 211, and is generated by reading out waveform data prepared in advance on the waveform memory 109 by sampling or the like. It is a musical sound waveform. This “ch output” may be one of 32 channels or a plurality of channels. That is, a plurality of waveform data may be read using a plurality of sound generation channels, and the plurality of read waveform data may be mixed by the MIX 1011.
[0087]
The output of the MIX 1011 is one of eight channels output from the mixer 204 of FIG. 2 to the signal processing circuit 205 via the output line 221. The signal processing circuit 205 performs processing shown in blocks 1012 and 1013. That is, the output from the MIX 1001 is subjected to component separation by the separation filter 1012 to extract a periodic component and an aperiodic component. The interleave 1013 alternately outputs the periodic component and the non-periodic component to the MIX 1014 and writes it to the FIFO 1015. As a result, resampling is performed by separating the musical sound waveform prepared in advance in the waveform memory by sampling or the like and returning it to the waveform memory again. Note that the periodic component output from the separation filter 1012 may be subjected to LPC compression, for example.
[0088]
FIG. 10C shows an example (part 2) of setting of the microprogram for resampling and the mixer. Similar to FIG. 10A, the MIXs 1021 and 1023 correspond to the mixer 204 in FIG. 2, and the FIFO 1024 corresponds to the FIFO 313 in FIG. A block 1022 corresponds to a microprogram set in the signal processing circuit 205 in FIG. The “ch output” to the MIX 1021 is a tone signal input from the volume change control circuit 203 of FIG. 2 via the input line 211, and is generated by reading out waveform data prepared in advance on the waveform memory 109 by sampling or the like. It is a musical sound waveform. This “ch output” may be one of 32 channels or a plurality of channels. That is, a plurality of waveform data may be read using a plurality of sound generation channels, and the plurality of read waveform data may be mixed by the MIX 1021.
[0089]
The output of the MIX 1021 is one of eight channels output from the mixer 204 of FIG. 2 to the signal processing circuit 205 via the output line 221. The signal processing circuit 205 performs the waveform processing shown in block 1022. Examples of the waveform processing 1022 include an equalizer, modulation (modulation), waveform compression, Fs conversion, physical model sound source, and reverberation processing. The physical model sound source means that the physical model sound source is operated using the output from the mixer 1021 as a drive signal and the resulting waveform is output. The result of the waveform processing 1022 is written into the FIFO 1024 via the MIX 1023 and recorded again in the waveform memory 109. Thereby, resampling is performed by performing various waveform processing on the musical sound waveform existing on the waveform memory by sampling or the like and returning it to the waveform memory again.
[0090]
FIG. 11A shows an example (part 1) of setting a microprogram for generating musical sounds and a mixer. FIG. 11B shows an example (part 2) of setting a microprogram for generating musical sounds and a mixer. As in FIG. 10A, MIXs 1101, 1103, 1111 to 1113, and 1117 correspond to the mixer 204 in FIG. The DACs 1104 and 1118 correspond to the DAC 112 in FIG. In FIG. 11A, the block 1102 corresponds to the microprogram set in the signal processing circuit 205 in FIG. 2, and the blocks 1114 to 1116 in FIG. The “ch output” input to each of the MIXs 1101, 1111 to 1113 may be a tone signal (one of 32 channels) input from the volume change control circuit 203 of FIG. 2 via the input line 211. It may be multiple channels). The outputs of the MIXs 1101, 1111 to 1113 are each one of 8 channels output from the mixer 204 of FIG. 2 to the signal processing circuit 205 via the output line 221.
[0091]
In the case of FIG. 11A, the signal processing circuit 205 performs reverberation processing 1102 on the output of the MIX 1101, and outputs it to the DAC 1104 via the MIX 1103 to emit sound. In the case of FIG. 11B, the signal processing circuit 205 performs chorus processing 1114, reverberation processing 1115, and variation 1116 on the outputs of the MIXs 1111 to 1113, and the processing results are mixed by the MIX 1117 and output to the DAC 1104. Sound is emitted.
[0092]
In each setting example of FIGS. 10 and 11, mixing may be performed by inputting a musical sound waveform other than the illustrated input to the MIX block. These microprogram setting examples can also be set so as to be executed in parallel as appropriate according to the capacity of the microprogram memory of the signal processing circuit 205. For example, the sampling microprogram of FIG. 10A and the musical sound generating microprogram of FIG. 11A can be executed simultaneously. Further, the mixing result of the MIXs 1103 and 1117 may be output to the DACs 1104 and 1118, output to the FIFO 313 through the line 223, and written to the waveform memory 109. This is phrase recording in which the waveform data that has been played is recorded as it is.
[0093]
Next, a processing procedure of the CPU 104 of the electronic musical instrument will be described using a flowchart.
[0094]
FIG. 12A shows the processing procedure of the main routine in the control program of the CPU 104. When the electronic musical instrument is turned on, first, in step 1201, various initial settings are made. Next, in step 1202, it is checked whether there is any activation factor. If there is an activation factor in step 1203, the process proceeds to step 1204. If there is no activation factor, the process returns to 1202 again. In step 1204, the type of the activation factor that has occurred is determined, and the process branches to each process. When the activation factor is a key operation event of the keyboard 101 (when an external MIDI event can be accepted, the MIDI event is also generated), the keyboard processing in step 1205 is performed, and thereafter Returning to step 1202 again. If the activation factor is an operation event of the panel switch 103, the panel switch process in step 1206 is performed, and the process returns to step 1202. If the activation factor is an event related to the X flag 314, flag processing is performed in step 1207, and the process returns to step 1202. When the activation factor is another factor (for example, a soft sound source waveform generation trigger described later), other processing is performed in step 1208 and the process returns to step 1202. If the activation factor is a power switch operation event, an end process is performed in step 1204, and then the process ends.
[0095]
FIG. 12B shows a procedure of key-on event processing that is executed when there is a key-on event of the keyboard 101 in the keyboard processing in step 1205 of FIG. In step 1211, the note number of the key-on key is set in the register NN, and the velocity at the time of key-on is set in the register VD. Next, in step 1212, sound generation channels (0th to 31st channels) are assigned, and the assigned channel numbers are set in the register i. In step 1213, information such as the address of the waveform data corresponding to the note number NN of the currently set tone color is set in the control register 201 (specifically, registers 301 and 302 in FIG. 3). In step 1214, settings such as the envelope parameter of the timbre currently set and the mixing ratio of the mixer are also made in the control register 201. Thereafter, in step 1215, note-on (sound generation instruction to the sound source 108) is sent to the i-th channel, and the operation of generating the musical tone of the sound source unit 108 as described above is started.
[0096]
FIG. 13A shows the procedure of the sampling SW event process executed when the sampling switch (SW) is turned on in the panel switch process of step 1206 of FIG. The user connects in advance an ADC that inputs an external sound and performs A / D conversion as the external circuit 110, and turns on the sampling SW when performing sampling. When the sampling SW is turned on, first in step 1301, the CPU 104 reads the input waveform processing microprogram from the ROM 105, RAM 106, external storage device 107, etc., and loads it into the microprogram memory in the signal processing circuit 205. The microprogram to be loaded here is a microprogram that performs processing as described in blocks 1002 to 1004 in FIG. Next, in step 1302, the operation setting of the ADC (external circuit 110) and the mixing ratio of the mixer 204 are set. In step 1303, the address of the writing area in the waveform memory 109 and the number of samples are set. This corresponds to setting the address of the write area in the XA register 311 in FIG. 3 and setting the number of samples to be written in the sample number register 315. In step 1304, the writing process of the signal processing circuit 205 is started, and further the ADC is started. Thereby, the sampling process as described with reference to FIG.
[0097]
FIG. 13B shows the procedure of the resampling SW event process executed when the resampling SW is turned on in the panel switch process of step 1206 of FIG. When the resampling SW is turned on by the user, first, in step 1311, the CPU 104 reads the resampling microprogram from the ROM 105, RAM 106, external storage device 107, etc., and loads it into the microprogram memory in the signal processing circuit 205. . The microprogram to be loaded here is a microprogram that performs processing such as block 1012, 1013 or block 1022 described with reference to FIGS. 10B and 10C. Next, in step 1312, the sound channel is assigned and the assigned channel number is set in the register i. Next, in step 1313, an address of the read waveform is set, and in step 1314, an envelope parameter, a mixing ratio of the mixer 204, and the like are set. This corresponds to setting various information in the control register 201. In step 1315, the address and the number of samples in the waveform memory 109 to which the waveform data resulting from the re-sampling are to be written are set. This corresponds to setting the XA register 311 and the sample number register 315 of the control register 201. Thereafter, in step 1316, the writing of the signal processing circuit 205 is started, note-on is transmitted, and the processing is ended. The reason for sending note-on is to start the process of reading waveform data from the address set in step 1313. As described above, resampling is executed with the signal flow as shown in FIG. 10B or 10C.
[0098]
Note that a plurality of channels may be assigned in step 1312, and the musical sound waveforms read out by these channels may be mixed and written to the waveform memory after predetermined processing (a plurality of MIXs 1011 and 1021 in FIGS. 10B and 10C). When the channel output is input), after performing predetermined processing for each channel, it may be mixed and written in the waveform memory (the processing of 1011 to 1013 is performed for each of a plurality of channels in FIG. 10B). In the case of mixing a plurality of sequences with MIX 1014, or in the case where the processing of 1021 to 1022 is performed for each of the plurality of channels in FIG. 10C and the plurality of sequences are mixed with MIX1023). When mixing multiple channels, the waveform start position can be shifted for each channel. In that case, in step 1316, note-on needs to be sent out a plurality of times in accordance with how to shift the start position of the waveform of each channel. However, the FIFO write starts from the first note-on.
[0099]
FIG. 14A shows the procedure of the waveform read (write) SW event process executed when the waveform read SW (or waveform write SW) is turned on in the panel switch process of step 1206 of FIG. 12A. Show. The waveform reading SW event processing and the waveform writing SW event processing are almost the same processing only by replacing “reading” and “writing”, and will be described with reference to FIG. First, the waveform read SW event process will be described, and then the waveform write SW event process will be described.
[0100]
In the waveform read SW event process, first, in step 1401, the address of the read area in the waveform memory 109 and the number of samples to be read are set in the XA register 311 and the sample number register 315. Next, in step 1402, the address of the write area in the RAM 106 where the data read from the waveform memory 109 is to be written is set. Next, in step 1403, the CPU 104 instructs the X access circuit 304 of FIG. 3 to start reading (step 1404 is used only during the waveform write SW event process), and the process is terminated. As described above, the X access process described above is started, and the waveform data from the waveform memory 109 is sequentially read out to the FIFO 313 in FIG. 3 in parallel with the generation of the musical sound waveform. The data of the FIFO 313 is taken out by (FIG. 14B). In such waveform data reading processing, waveform data written to the waveform memory by sampling or resampling is read and stored in an external storage device (real-time hard disk recording), or the read waveform is processed by the CPU. Used when writing to the waveform memory again.
[0101]
In the waveform write SW event process, first, in step 1401, the address of the write area in the waveform memory 109 and the number of samples to be written are set in the XA register 311 and the sample number register 315. In step 1402, the address of the read area in the RAM 106 where the waveform data to be written to the waveform memory 109 is prepared is set. In step 1403, the CPU 104 instructs the X access circuit 304 in FIG. 3 to start writing. In step 1404, the first 8 samples in the read area in the RAM 106 are read and written in the FIFO 313 as a preparation, and the process ends. As described above, the X access process described above is started, and the waveform data of the FIFO 313 in FIG. 3 is written into the write area of the waveform memory 109 in parallel with the generation of the musical sound waveform. Therefore, the CPU 104 performs the X flag write event process (see FIG. 14 (c)) to write the waveform data into the FIFO 313. Such waveform data writing is used when the waveform data of the external storage device is written into the waveform memory, or when the read waveform is processed by the CPU and written into the waveform memory again. It is also used for waveform writing in a soft sound source to be described later. In addition, if a buffer area is provided on the waveform memory and waveform data in the buffer area is loop-reproduced by the sound generation channel and waveform data of the external storage device is sequentially supplied to the area, the length stored in the external storage device can be obtained. Direct playback of time waveform data is also possible.
[0102]
FIG. 14B shows the procedure of the X flag read event process in the flag process in step 1207 of FIG. This is because the X flag is on when the reading process from the waveform memory 109 by the CPU 104 has started (when the waveform reading SW event process of FIG. 14A is executed) (that is, from the waveform memory 109). This process is executed when the read data exists in the FIFO 313). First, in step 1411, the waveform data set in the FIFO 313 is read and written in the write area of the RAM 106. Next, in step 1412, it is determined whether or not the reading is completed by comparing the number of samples in the sample number register 315 with the number of waveform samples actually read from the waveform memory 109 and written in the RAM 106. When the reading is finished, in step 1413, the CPU 104 performs a reading stop process and ends the process. If the processing has not yet been completed in step 1412, the processing is continued. The read stop process in step 1412 is a process for canceling the state of the read process set in the waveform read SW event process of FIG.
[0103]
FIG. 14C shows the procedure of the X flag write event process in the flag process in step 1207 of FIG. This is because the X flag is on (that is, the FIFO 313 has an empty space) when the writing process to the waveform memory 109 by the CPU 104 has started (when the waveform writing SW event process of FIG. 14A has been executed). It is a process executed when First, in step 1421, the waveform data to be written next is read from the read area of the RAM 106 and written in the empty area of the FIFO 313. Next, in step 1422, the number of samples in the sample number register 315 is compared with the number of waveform samples actually written from the RAM 106 to the FIFO 313, and it is determined whether or not all the samples to be written have been written. Since all data has been written, the process is finished. In step 1423, the CPU 104 performs a write stop process and finishes the process. If the termination condition is not yet satisfied in step 1422, the processing is continued. Data remaining in the FIFO 313 is written to the waveform memory 109 by the write stop process in step 1423.
[0104]
According to the electronic musical instrument of this embodiment described above, since a sample buffer is provided, a surplus time that is not used for channel sounding is generated. Therefore, a waveform for the purpose other than channel sounding is generated using the time slot of the surplus time. Memory access (for example, CPU access and writing of waveform data returned from the mixer, etc.) can be performed during sound generation. In particular, an X access circuit 304 having a function of detecting the access status of the waveform memory 109 is provided. so, The CPU 104 refers to the X flag 314, and when it is on, the data can be read and written more quickly and high speed access is possible even during sounding. Further, since the FIFO 313 is provided as a buffer for X access processing, access can be performed at a very high speed. Note that the CPU 104 refers to the X flag 314 and reads / writes data when it is on. In the above embodiment, the CPU 104 performs loop processing without using interrupts. You may make it do. That is, when the FIFO 313 is empty (when writing from the CPU) or when there is read data in the FIFO 313 (when reading by the CPU), this is notified to the CPU 104 by an interrupt, and the CPU 104 accesses the FIFO 313 accordingly. May be.
[0105]
Further, according to the electronic musical instrument of this embodiment, waveform memory access is made independent of channel timing, so there are the following advantages when limiting the number of accesses. That is, if the number of sound generations is small, there is no influence by the restriction, and all the channels that are sounding can execute high-order interpolation (four-point interpolation in the above example). When the number of pronunciations increases and the number of accesses becomes limited, it is possible to reduce the interpolation order of some channels out of the total number of pronunciations and reduce the number of pronunciations although the interpolation order falls.
[0106]
Furthermore, in the electronic musical instrument of this embodiment, the number of accesses to the waveform memory is managed as a total value. For example, it is desired to use 1/3 or 1/4 of the total access time as a request for X access. In such a case, access control can be performed very easily.
[0107]
According to the electronic musical instrument of this embodiment, since the DSP is also used for sampling and resampling processing, it is possible to sample externally input musical sounds or to already store the waveform memory without complicating the apparatus configuration. Resampling can be performed by reading the stored waveform data and performing processing such as applying an effect and then writing it again to the waveform memory. Since the DSP can perform waveform processing for reproduction such as effect addition and waveform processing for recording such as sampling and resampling in parallel, reproduction and recording can be performed in parallel.
[0108]
The waveform memory access operation (process B and capture process) may be performed within the timing (fixed) of each time-division channel. In this case, since there are four access slots per channel for all sound channels, each sound channel performs 0 to 4 times of sample reading and 4 to 0 times of X access in the remaining slots. Do it.
[0109]
In the above example, the priority flag 303 is used for one X access as to how 64 accesses in the first half section and the second half section should be distributed in the process B (or capture process) and the X access process. Has a priority. However, there are cases where it is desired to give priority to two or more accesses. For example, when transferring the waveform data from the external storage means to the waveform memory, or conversely, transferring the waveform data of the waveform memory to the external storage means, it is efficient to perform the transfer according to the data transfer speed of the external storage means Is good. Priority should be given to the number of X accesses necessary to achieve that speed. Even in other cases, the number of priority times of X access may be arbitrarily set in accordance with the requested speed and the optimum speed of the other party that exchanges waveform data.
[0110]
Next, an example in which a software sound source (hereinafter referred to as a software sound source) is realized by the CPU 104 in the electronic musical instrument of this embodiment will be described. The software sound source is one that generates predetermined sound waveforms by executing predetermined software in the CPU 104. The musical sound waveform generated by the CPU 104 is emitted using a predetermined channel of the sound source unit 108.
[0111]
Note that the software tone generator is realized by the CPU 104 executing the tone generation software in the ROM 105. From the viewpoint of using the software tone generator, the tone generator software is registered as a driver and the driver is activated. The procedure is such that a MIDI (Musical Instruments digital Interface) event message representing various performance inputs is output to an API (Application Program Interface) related to a predetermined software sound source, and various processes relating to musical tone generation are performed on the software sound source. . The CPU 104 is a general-purpose arithmetic processing unit, and performs processing different from the software sound source, such as processing for giving performance input to the API, that is, processing for outputting a MIDI event to the API. The process of giving performance input to the API by the CPU 104 is, for example, outputting performance input generated in real time in response to an operation of the keyboard 101 to the API or in response to a MIDI event input in real time from an external MIDI device. A performance event input is output to the API, or a sequence of MIDI events is prepared on the RAM 106 (data on the external storage device 107 may be used), and this is sequentially output to the API as a performance input. , And so on.
[0112]
With reference to FIG. 16, the tone generation principle of the soft sound source will be described. In FIG. 16, each section of S1 to S4 indicates a time frame as a unit for performing reproduction for a predetermined number of samples (for example, 128 samples). A downward arrow written on the “performance input” line indicates that there was a performance input at that time. The performance input means that various MIDI events such as note-on, note-off, aftertouch, and program change are input to an API (Application Program Interface) related to the software sound source. In the example of FIG. 16, there are three performance inputs for frame S1, two for S2, and one for S3. The software sound source can simultaneously generate a plurality of musical sounds for a plurality of channels, and each musical sound is controlled by a software sound source register for a plurality of channels prepared on the RAM 106. When a sound source inputs a note-on event (for example, note-on of a key on the keyboard 101) as a performance input, the software tone generator assigns sound generation to the software sound source register, and the software sound source register corresponding to the assigned channel plays the sound of the channel. Write various data to be controlled and note-on. When a note-off event is input as a performance input, note-off is written in the soft tone generator register corresponding to the corresponding channel. Similarly, for performance inputs other than note-on and note-off (for example, after-touch change), data corresponding to the performance input is written in the software tone generator register corresponding to the corresponding channel. Data written to the soft tone generator register in a certain time frame is always used for waveform generation calculation from the next time frame regardless of the type of data.
[0113]
In FIG. 16, rectangles 1601 to 1604 of “waveform generation by the CPU” indicate sections in which the CPU 104 executes the waveform generation calculation. In this waveform generation calculation, musical sound waveform generation for a plurality of channels is performed based on data for a plurality of channels set in the software sound source register. The soft tone generator register is rewritten in accordance with the performance input. On the other hand, during the period when there is no performance input, the soft tone generator register holds data written in the past. Therefore, in each of the waveform generation sections 1601 to 1604, the waveform generation calculation corresponding to the performance input detected in the immediately preceding or previous frame is executed. Since a frame interrupt occurs at the timing when the frame is switched, the waveform generation calculation in each frame is executed with this frame interrupt as a trigger (FIG. 15B described later).
[0114]
For example, for the three performance inputs detected in the frame S1, the waveform generation calculation is performed in the section 1602 with the start frame interrupt of the next frame S2. The CPU 104 generates waveform data on the RAM 106 by this waveform generation calculation. The generated waveform data is written into a buffer area prepared on the waveform memory 109 using the remaining time interval of the frame. As this buffer area, two buffer areas PB0 and PB1 of the same size prepared at consecutive addresses (the two are collectively referred to as a double buffer) are used. Writing to the buffer area is performed by the above-described X access processing (particularly, writing processing from the CPU 104 to the waveform memory 109). Further, the buffers PB0 and PB1 are alternately used for each frame. For example, the waveform data generated in the section 1601 of the frame S1 is written from the RAM 106 to the buffer area PB0 on the waveform memory 109 until the next frame is disclosed, and the waveform data generated in the section 1602 of the frame S2 is written to the buffer area PB1. The waveform data generated in the section 1603 of the frame S3 is written in the buffer area PB0, the waveform data generated in the section 1604 of the frame S4 is written in the buffer area PB1, and the waveform data is alternately written in PB0 and PB1. .
[0115]
The waveform data written to the buffers PB0 and PB1 is read and reproduced in the section of the next frame after the waveform generation frame, triggered by a frame interrupt, as shown in “Reading and reproducing” in FIG. That is, the waveform data generated in frame S1 and written to PB0 is the next frame S2, the waveform data generated in frame S2 and written to PB1 is the next frame S3, and the waveform data generated in frame S3 and written to PB0 is In the next frame S4, the waveform data of PB0 and PB1 are alternately read and reproduced as follows.
[0116]
FIG. 15A shows the procedure of the soft sound source start SW event process executed when the soft sound source start SW is turned on in the panel switch process in step 1206 of FIG. When the software sound source start SW is turned on by the user, first, in step 1501, the sound generation channels (0th to 31st channels) used for sounding the tone waveform generated by the software sound source are assigned, and the assigned channel number is assigned. Set to register i. Next, in step 1502, the sound source unit 108 is set to perform loop read reproduction of the double buffer areas PB0 and PB1 through the channel i. This is a process of sending and setting instruction information to the sound source unit 108 so as to alternately read and reproduce the buffers PB0 and PB1 for each frame interrupt, as shown in “Reading / reproducing” in FIG. Specifically, since the double buffer areas PB0 and PB1 are buffer areas of the same size prepared at consecutive addresses, the start address of the area PB0 is set as a loop start address (absolute address WA), and (area If the value obtained by subtracting (start address of area PB0) from (end address of PB1) is set as the loop size (relative address LPA) and the relative address AS is set to 0, the areas of PB0 to PB1 are repeatedly read out by loop reading. It is. In step 1503, settings such as an envelope parameter and a mixing ratio of the mixer are performed. Note that the envelope parameter set here is merely used for fading in / out of loop reading, and does not control the envelope of the generated musical sound (temporal change in musical sound volume). The mixing ratio of the mixer is not a mixing ratio of one musical sound but a mixing ratio for controlling an output destination of a mixed waveform of a plurality of musical sounds generated by a soft sound source.
[0117]
Next, in step 1504, in order to set the writing area to which the musical sound waveform generated by the CPU 104 is first written as the buffer PB0 in the waveform memory 109, the head address of the buffer PB0 is set as an initial value in the XA register 311 in FIG. In the sample number register 315, the capacity of the buffer PB0 (1/2 of the loop size LPA) is set as the number of samples. In step 1505, the CPU 104 prepares for the writing process (X access process) to the waveform memory 109 and clears the double buffers PB0 and PB1 to zero. In step 1506, note-on is transmitted to the channel i, frame interruption at a predetermined time interval described with reference to FIG. 16 is started, and the process is terminated. Note that a frame interrupt occurs when a return occurs when loop reading out the buffers PB0 and PB1 (that is, when playback of PB1 ends) and when the loop read intermediate point (LPA / 2) passes (that is, when playback of PB0 ends). appear. Although not shown, an interrupt generation circuit for generating a frame interrupt is provided inside the sound source 108. Instead of interruption, the CPU may check the address current value of the tone generation channel set for “reading reproduction” to detect the frame change timing.
[0118]
FIG. 15B shows a procedure of frame interrupt processing executed by a frame interrupt that occurs every time frame of the predetermined time described in FIG. When a frame interrupt occurs, first, in step 1511, a musical sound waveform corresponding to the performance input currently set in the soft tone generator register is generated on the RAM 106. This corresponds to the waveform generation operations 1601 to 1604 executed for each frame interrupt in FIG. Next, in step 1512, the address of the writing area in the waveform memory 109 to which the generated musical sound waveform is to be written (the start address of PB0 or PB1) and the number of samples to be written (1/2 of the loop size LPA) are stored in the XA register 311 and the samples. Set in the number register 315. As described in FIG. 16, the buffer areas PB0 and PB1 are alternately used as the writing area. In step 1513, the CPU 104 instructs the X access circuit 304 in FIG. 3 to start writing. In step 1514, the first eight samples of the musical tone waveform are written in the FIFO 313 as preparation, and the process is terminated. Thereafter, every time the data of the FIFO 313 is written into the waveform memory by the X access process (X flag is set to 1), the remaining musical sound waveform samples are sequentially converted into the FIFO by the process similar to the process of FIG. To be supplied.
[0119]
As described above, the X access process described above is started, and the musical sound waveform generated in step 1511 is written into the buffer area PB0 or PB1 of the waveform memory 109. On the other hand, the processing of alternately reading and reproducing the double buffers PB0 and PB1 as shown in “Reading and reproducing” of FIG. 16 is started by the processing of FIG. 15A. If a musical sound waveform is generated for each frame interruption and written in the double buffer as shown in FIG. 9, the musical sound waveform is generated on the i-th channel. Since the musical sound generated by the soft sound source is input to the mixer 204 through the i-th channel, as described above, the musical sound is subjected to signal processing such as applying an effect by the signal processing circuit 205 or the external circuit 110 and output to the DAC 112. It can also be written in the waveform memory 109 again.
[0120]
In addition, the reproduction pitch can be adjusted by adjusting the F number (pitch PITCH used in process A in FIG. 3) of the read processing of the double buffers PB0 and PB1 in the i-th channel, and so-called oversampling is performed. You can also. For example, the i-th channel of the sound source unit 108 that outputs a musical sound waveform generated by a soft sound source operates at a sampling frequency of 48 kHz, and when the CPU 104 generates a musical sound waveform at a sampling frequency of 24 kHz, the F-number of the i-th channel is set. What is necessary is just to set to 0.5. In this case, the interpolation circuit 326 performs interpolation by cutting off the harmonic part so that aliasing noise does not occur even at a sampling frequency of 48 kHz.
[0121]
In the conventional software sound source, the CPU is interrupted every sampling period for reading and reproducing as shown in FIG. 16, and the musical sound waveform generated by the CPU is DMA-transferred to the sound source unit at each interrupt. The CPU was interrupted frequently. In the software sound source of this embodiment, if the CPU 104 performs processing for each frame interrupt, the X access processing automatically writes to the waveform memory 109 and plays back, so that the interrupt processing for the CPU can be reduced. There is.
[0122]
When using the function of the software sound source, it is necessary to hold the performance input in a predetermined frame section as described with reference to FIG. 16, so the key-on event processing is performed in place of FIG. A process for storing the generated key-on event is performed.
[0123]
FIG. 17 shows a modification of the X access circuit 304 of FIG. The XA register 311 in FIG. 3 is replaced with an XA1 register 1701, an XA2 register 1702, and a selector 1703, and the selector 312 and the FIFO 313 in FIG. 3 are replaced with a FIFO 1704, a latch 1705, and a selector 1706. Other parts are the same as those in the above-described embodiment.
[0124]
The XA1 register 1701 and the FIFO 1704 are a register for setting an access address and a FIFO for setting access data when the waveform memory 109 is accessed from the CPU 104 in the X access process. The XA2 register 1702 and the latch 1705 are a register for setting an access address and a latch for storing data from the mixer 204 when writing from the mixer 204 to the waveform memory 109 via the output line 223 in the X access processing. With this configuration, the selectors 1703 and 1706 are switched in a time-sharing manner during the X access processing interval, and the waveform data returned from the mixer 204 is written to the waveform memory 109 and the waveform memory 109 is accessed from the CPU 104. To be able to do it in parallel.
[0125]
In particular, the waveform data is returned from the mixer 204 every sampling period, but the waveform data cannot be discarded, so it is always stored in the latch 1705. In addition, the XA2 register 1702 is selected by the selector 1703 and the latch 1705 is selected by the selector 1706, and the waveform data of the latch 1705 is instructed by the XA2 register 1702 at least once in the section of the X access processing for each sampling cycle. Write to the specified address. In other sections of the X access process, the selector 1703 selects the XA1 register 1701 and the selector 1706 selects the FIFO 1704, and the CPU 104 accesses the waveform memory 109. The function of sequentially incrementing the addresses of the XA1 register 1701 and the XA2 register 1702 is the same as that described with reference to FIG. In the X access processing section, it is necessary to preferentially write the waveform data in the latch 1705 to be performed once. However, there is a case where the X access processing section itself cannot be secured. It is preferable to turn on the priority flag 303 so that the access can be made several times by the X access processing.
[0126]
With such a configuration, for example, a sampled or resampled waveform is written to the waveform memory 109 from the mixer 204 via the latch 1705, and when the waveform memory 109 has accumulated to some extent, the waveform data is read by the CPU 104, and the external storage device ( Real-time hard disk recording. Compared with the processing speed of the waveform data via the latch 1705 written once in one sampling period, the processing speed of the reading process by the CPU 104 is faster. In particular, since the FIFO is used, the reading speed is further increased. Therefore, the data accumulated on the waveform memory 109 can be read at once by the CPU 104 and written to a hard disk or the like.
[0127]
In the above embodiment, the processing A arithmetic circuit 321 and the processing B arithmetic circuit 325 are independent from each other in the read / write circuit 202 of FIG. 3, but the processing A arithmetic circuit 321 and the processing B arithmetic circuit 325 are grouped together. Processing A and processing B may be performed by sharing one arithmetic circuit in a time-sharing manner.
[0128]
In the above embodiment, the waveform memory waveform samples are in a 16-bit uncompressed format, but other formats may be used. For example, an 8-bit uncompressed or 8-bit compressed format may be used without changing that 16 bits can be read in one access. However, in this case, since the number of samples and the number of accesses are different, adjustment is necessary. In the case of the compressed format, it is impossible to reproduce the sample unless the sample is read continuously.
[0129]
When DRAM is used as the waveform memory, refreshing is always necessary, so refreshing may be performed during the X access processing interval. Further, reading / writing of the waveform memory from the CPU may be performed according to the degree of urgency. For example, when the urgency of waveform memory access from the CPU is low, access is performed using empty time slots that are not used in the sound source channel. When the degree of urgency is high, first, the amount of waveform memory access from the CPU is secured, and the rest is used for the sound source channel.
[0130]
Further, in the above embodiment, as shown in FIGS. 8 and 9, continuous waveform memory access is performed in the front slot of the first half and the latter half of the process B and fetching, but it does not have to be on the front side. For example, X access processing may be performed in the front slot in the first half / second half section, and continuous waveform memory access for each channel may be performed in the rear slot. However, in this case, for example, after the processing in the first half interval 804 in FIG. 8 is completed and all samples necessary for interpolation are prepared in the waveform buffer, the interpolation processing in the first half interval 806 needs to start ( The same applies to the second half processing). For this reason, it is necessary to shift the interval in which interpolation is performed (it is sufficient to start the first half of interpolation processing after the first half of the capture processing is completed and start the second half interpolation processing after the second half of the processing is completed). Furthermore, the time slots for X access processing may be distributed in the first half section or the second half section.
[0131]
Further, in the above embodiment, as shown in FIGS. 8 and 9, each process is executed in a section in which one sampling period is divided into the first half and the second half, but the way of dividing the section is not limited to this. For example, one sampling period may be divided into 1/3, 1/4,... And each process may be performed in units of those sections. Further, irregular division may be performed instead of equal division. Furthermore, one sampling period may be used as a unit without dividing the section. However, it is necessary to ensure that the ARAM is not rewritten by the process A before the address is sent out in the process B to access the waveform memory. For this purpose, for example, when the sections are not divided, two sets of ARAM are prepared, and two sets of address RAMs are used alternately by rewriting addresses by processing A and sending addresses by processing B. There is a need. In addition, according to the method in which one sampling period is divided into the first half and the second half, processing A and processing B can be performed alternately with one set of ARAM, so that it can be said that the circuit configuration can be simplified and rational.
[0132]
【The invention's effect】
As described above, according to the present invention, one programmable signal processing means can be shared for both recording waveform processing and reproduction waveform processing. Further, both the recording waveform processing and the reproduction waveform processing can be executed in parallel by one programmable signal processing means. Therefore, recording waveform processing and playback waveform processing can be performed with a simple configuration. A waveform processed by an arbitrary processing algorithm (instructed by the instruction means) can be recorded. Since a DSP can be used as the programmable signal processing means, the apparatus configuration does not have to be so complicated.
[Brief description of the drawings]
FIG. 1 is an overall block diagram of an electronic musical instrument to which a waveform memory tone generator according to the present invention is applied.
FIG. 2 is a block diagram of a sound source unit to which the waveform memory sound source device according to the present invention is applied.
FIG. 3 is a detailed diagram of a control register and a read / write circuit.
FIG. 4 is a configuration diagram of a control RAM.
FIG. 5 is a diagram showing a memory map of an address RAM.
FIG. 6 is a configuration diagram of a waveform buffer.
FIG. 7 is a diagram showing how to use the FIFO.
FIG. 8 is a timing diagram of the main part of the read / write circuit.
FIG. 9 is a diagram showing the state of the channel being processed in FIG. 8;
FIG. 10 is a diagram showing excitation (part 1) for microprograms and mixer settings;
FIG. 11 is a diagram showing excitation (part 2) of the microprogram and mixer setting.
FIG. 12 is a flowchart of a main routine and a key-on event processing routine.
FIG. 13 is a flowchart of a sampling SW event processing routine and a resampling SW event processing routine.
FIG. 14 is a flowchart of a waveform read (write) SW event processing routine, an X flag (read) event processing routine, and an X flag (write) event processing routine.
FIG. 15 is a flowchart of a soft sound source start SW event processing routine and a soft sound source frame interrupt processing routine.
FIG. 16 is a diagram for explaining the tone generation principle of a soft sound source
FIG. 17 is a diagram showing a modification of the X access circuit
[Explanation of symbols]
DESCRIPTION OF SYMBOLS 101 ... Keyboard, 102 ... Display part, 103 ... Switch group (SW), 104 ... Central processing unit (CPU), 105 ... Read-only memory (ROM), 106 ... Random access memory (RAM), 107 ... External storage device, DESCRIPTION OF SYMBOLS 108 ... Sound source part, 109 ... Waveform memory, 110 ... External circuit, 111 ... Delay memory, 112 ... Digital-analog converter (DAC), 113 ... Sound system (SS), 114 ... Bus line 114, 201 ... Control register, 202 ... Read / write circuit, 203 ... Volume change control circuit, 204 ... Mixer, 205 ... Signal processing circuit, 206 ... Interface, 301,302 ... Register, 303 ... Priority flag, 304 ... X access circuit, 311 ... XA register, 312 ... Selector 313 ... FIFO (First In First Out ( (First-in-first-out) 8-stage register), 314 ... X flag, 315 ... sample number register, 321 ... processing A arithmetic circuit, 322 ... address RAM (ARAM), 323 ... accumulator (ACC), 324 ... control RAM, 325 ... Processing B arithmetic circuit, 326... Interpolation circuit, 327... Waveform buffer, 328... Capture circuit, 329, 330.

Claims (2)

楽音波形を録音するための記憶手段と、
前記記憶手段に楽音波形を書き込むとともに、前記記憶手段に記憶された楽音波形を読み出す読み書き手段と、
ロードされたプログラムに応じて信号処理を実行するプログラマブル信号処理手段と、
前記読み書き手段、前記プログラマブル信号処理手段、外部回路、及びサウンドシステムに接続されたミキサと、
録音動作または再生動作を指示する指示手段と、
(i)前記指示手段により録音動作が指示されていたときは、前記プログラマブル信号処理手段に所定の第1のプログラムをロードするとともに、前記外部回路から供給される楽音波形が前記ミキサを介して前記プログラマブル信号処理手段に供給され、かつ、前記プログラマブル信号処理手段の出力信号が前記ミキサを介して前記読み書き手段に供給されるよう前記ミキサを設定して、前記外部回路からの楽音波形が、前記プログラマブル信号処理手段で前記第1のプログラムに従う録音用の信号処理を施されて、前記読み書き手段により前記記憶手段に記憶されるよう制御し、
(ii)前記指示手段により再生動作が指示されていたときは、前記プログラマブル信号処理手段に所定の第2のプログラムをロードするとともに、前記読み書き手段により前記記憶手段から読み出された楽音波形が前記ミキサを介してプログラマブル信号処理手段に供給され、かつ、前記プログラマブル信号処理手段の出力信号が前記ミキサを介して前記外部のサウンドシステムに供給されるよう前記ミキサを設定して、前記読み書き手段が読み出した当該楽音波形が、前記プログラマブル信号処理手段で前記第2のプログラムに従う再生用の信号処理を施されて、前記サウンドシステムで再生されるように制御する
制御手段と、
を備えたことを特徴とする音源装置。
Storage means for recording musical sound waveform;
A writing / reading unit that writes a musical sound waveform to the storage unit and reads a musical sound waveform stored in the storage unit;
Programmable signal processing means for performing signal processing according to the loaded program;
A mixer connected to the read / write means, the programmable signal processing means, an external circuit, and a sound system;
An instruction means for instructing a recording operation or a reproduction operation;
(i) When a recording operation is instructed by the instructing unit, a predetermined first program is loaded into the programmable signal processing unit, and a musical sound waveform supplied from the external circuit is transmitted through the mixer. The mixer is set to be supplied to the programmable signal processing means and the output signal of the programmable signal processing means is supplied to the read / write means via the mixer, and the musical sound waveform from the external circuit is set to the programmable The signal processing means is subjected to recording signal processing according to the first program, and is controlled to be stored in the storage means by the read / write means,
(ii) When a reproduction operation is instructed by the instruction means, a predetermined second program is loaded into the programmable signal processing means, and the musical sound waveform read from the storage means by the read / write means is The mixer is set to be supplied to the programmable signal processing means via the mixer, and the output signal of the programmable signal processing means is supplied to the external sound system via the mixer, and the read / write means reads Control means for controlling the musical sound waveform to be reproduced by the sound system after being subjected to signal processing for reproduction according to the second program by the programmable signal processing means ;
A sound source device comprising:
前記プログラマブル信号処理手段が、ディジタル・シグナル・プロセッサである請求項1に記載の音源装置。2. The sound source device according to claim 1, wherein the programmable signal processing means is a digital signal processor.
JP2000346173A 2000-11-14 2000-11-14 Sound generator Expired - Fee Related JP3723973B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2000346173A JP3723973B2 (en) 2000-11-14 2000-11-14 Sound generator

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2000346173A JP3723973B2 (en) 2000-11-14 2000-11-14 Sound generator

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP22062096A Division JP3148803B2 (en) 1996-08-02 1996-08-02 Sound source device

Publications (2)

Publication Number Publication Date
JP2001166777A JP2001166777A (en) 2001-06-22
JP3723973B2 true JP3723973B2 (en) 2005-12-07

Family

ID=18820090

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2000346173A Expired - Fee Related JP3723973B2 (en) 2000-11-14 2000-11-14 Sound generator

Country Status (1)

Country Link
JP (1) JP3723973B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5534389B2 (en) * 2009-03-31 2014-06-25 ヤマハ株式会社 Music generator
JP7218313B2 (en) * 2020-03-03 2023-02-06 株式会社東芝 Communication device, communication system, and communication method

Also Published As

Publication number Publication date
JP2001166777A (en) 2001-06-22

Similar Documents

Publication Publication Date Title
JP2671747B2 (en) Musical tone forming device
JPH11327560A (en) Method for synthesizing musical sound method for processing musical sound, recording medium, and musical sound synthesizer
US6326537B1 (en) Method and apparatus for generating musical tone waveforms by user input of sample waveform frequency
JP3163984B2 (en) Music generator
JP3723973B2 (en) Sound generator
JPH0566777A (en) Sound source device for electronic musical instrument
JP3137043B2 (en) Waveform memory tone generator and tone generator
JP4036233B2 (en) Musical sound generating device, musical sound generating method, and storage medium storing a program related to the method
JP2002169564A (en) Sound source system
US6535772B1 (en) Waveform data generation method and apparatus capable of switching between real-time generation and non-real-time generation
JPH07121181A (en) Sound information processor
JP2001255876A (en) Method for expanding and compressing musical sound waveform signal in time base direction
JP3148803B2 (en) Sound source device
JPH08160961A (en) Sound source device
JP3019755B2 (en) Music sound generation method and music sound generation device
JPH11288285A (en) Method and device for generating musical sound
JP3164096B2 (en) Musical sound generating method and apparatus
JP3832383B2 (en) Musical sound generating apparatus and program
JP3740717B2 (en) Tone generator and musical sound generation method
JP2709965B2 (en) Music transmission / reproduction system used for BGM reproduction
JP3832382B2 (en) Musical sound generating apparatus and program
JP2956550B2 (en) Music sound generating apparatus and music sound generating method
JPH09134177A (en) Sound source device for electronic instrument
JP2956552B2 (en) Musical sound generating method and apparatus
JP4120979B2 (en) Waveform playback device

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20050526

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20050603

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050802

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20050911

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

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20100930

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20100930

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20110930

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20120930

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20130930

Year of fee payment: 8

LAPS Cancellation because of no payment of annual fees