JP5510814B2 - Music generator - Google Patents

Music generator Download PDF

Info

Publication number
JP5510814B2
JP5510814B2 JP2010066570A JP2010066570A JP5510814B2 JP 5510814 B2 JP5510814 B2 JP 5510814B2 JP 2010066570 A JP2010066570 A JP 2010066570A JP 2010066570 A JP2010066570 A JP 2010066570A JP 5510814 B2 JP5510814 B2 JP 5510814B2
Authority
JP
Japan
Prior art keywords
page
address
waveform
data
transfer
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.)
Active
Application number
JP2010066570A
Other languages
Japanese (ja)
Other versions
JP2011197551A (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 JP2010066570A priority Critical patent/JP5510814B2/en
Priority to US13/052,919 priority patent/US8183452B2/en
Priority to EP11159392A priority patent/EP2369581B1/en
Priority to CN201110076001.0A priority patent/CN102237126B/en
Publication of JP2011197551A publication Critical patent/JP2011197551A/en
Application granted granted Critical
Publication of JP5510814B2 publication Critical patent/JP5510814B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、波形メモリ方式の楽音生成装置に関し、特に、NAND型フラッシュメモリ等に波形データを格納しておき、そこから波形データをバッファ経由で波形メモリに読出しつつ再生を行う楽音生成装置に関する。   The present invention relates to a waveform memory type musical sound generation device, and more particularly to a musical sound generation device that stores waveform data in a NAND flash memory or the like, and reproduces the waveform data while reading the waveform data into a waveform memory via a buffer.

従来より、ハードディスク(HD)に波形データを格納しておき、該HDからバッファに波形データを読出しつつ、該バッファから波形データを波形メモリに読出して、再生する楽音生成装置が知られている(例えば、特許文献1,2)。このような楽音生成装置では、発音指示があってからHD上の波形データをバッファ経由で波形メモリに読出して再生するのでは発音開始に遅れがでてしまうので、装置の電源オン時に、予め各波形データの先頭部を波形メモリ上に読込むようにしている。そして、発音指示があったとき、直ちに波形メモリ上の当該先頭部のデータの再生を開始し、その先頭部の再生を行っている間に、引き続く波形データをHDからバッファ経由で波形メモリに読出す。先頭部の再生が終わった後は、前記波形メモリに読出してある波形データの再生を行いつつ、その再生の間に、次にさらに引き続く波形データをHDからバッファ経由で波形メモリに読出す。このような処理を繰り返して、再生を続ける。これにより、発音指示があったときに遅れなく発音開始することができる。   2. Description of the Related Art Conventionally, a musical tone generating apparatus is known that stores waveform data in a hard disk (HD), reads waveform data from the HD to a buffer, reads waveform data from the buffer to a waveform memory, and plays back the waveform data ( For example, Patent Documents 1 and 2). In such a musical sound generating device, if the waveform data on the HD is read into the waveform memory via the buffer and played back after a sounding instruction is issued, the sounding start is delayed. The beginning of the waveform data is read into the waveform memory. When a sound generation instruction is issued, the reproduction of the head data on the waveform memory is started immediately, and the subsequent waveform data is read from the HD to the waveform memory via the buffer while the head data is being reproduced. put out. After the reproduction of the head portion is finished, the waveform data read out to the waveform memory is reproduced, and during the reproduction, the next subsequent waveform data is read out from the HD to the waveform memory via the buffer. Such processing is repeated to continue reproduction. Thereby, it is possible to start sound generation without delay when a sound generation instruction is given.

上記の方式では、バッファに読込まれた1クラスタ分の波形データ(サンプルデータ)が波形メモリに読出されるごとに(すなわち、バッファが空になると)、CPUに対して転送要求割込みが発生する。該転送要求割込みに応じて、CPUは、次に読出すべきHD上の1クラスタを特定して、そのクラスタのHDからバッファへの転送を転送部に指示する。従って、CPUの割り込み処理は必須である。   In the above method, every time the waveform data (sample data) for one cluster read into the buffer is read into the waveform memory (that is, when the buffer becomes empty), a transfer request interrupt is generated for the CPU. In response to the transfer request interrupt, the CPU specifies one cluster on the HD to be read next, and instructs the transfer unit to transfer the HD from the cluster to the buffer. Therefore, CPU interrupt processing is essential.

また、バースト転送を利用した波形メモリ音源として、下記特許文献3に記載の技術がある。これは、波形メモリから読出した波形サンプルを一旦バッファメモリに記憶し、バッファメモリから必要な波形サンプルを選択的に読出して楽音生成するものである。波形メモリからバッファメモリへの波形サンプルの読出しは、複数サンプル単位でバースト転送する。バースト転送することにより、アクセス時間を短縮することができる。   As a waveform memory sound source using burst transfer, there is a technique described in Patent Document 3 below. In this method, waveform samples read from the waveform memory are temporarily stored in a buffer memory, and necessary waveform samples are selectively read from the buffer memory to generate musical sounds. Reading waveform samples from the waveform memory to the buffer memory is performed by burst transfer in units of a plurality of samples. By performing burst transfer, the access time can be shortened.

一方、近年ではNAND型フラッシュメモリの大容量化およびコスト低下が進み、種々の装置で、大容量のデータ格納手段として、HDとともにNAND型フラッシュメモリを使用する試みが為されている。NAND型フラッシュメモリは、ページ(HDのクラスタに相当する)の頭出しに時間がかかるが、読出しが始まった後のデータ転送速度は速い。また、エラー訂正コードによるエラー訂正が必須である。   On the other hand, in recent years, the capacity and cost of NAND flash memories have increased, and attempts have been made to use NAND flash memories together with HD as a large capacity data storage means in various devices. In the NAND flash memory, it takes time to find a page (corresponding to a cluster of HD), but the data transfer rate after reading starts is high. In addition, error correction using an error correction code is essential.

特許第2671747号公報Japanese Patent No. 2671747 特許第4089687号公報Japanese Patent No. 4089687 特許第3163984号公報Japanese Patent No. 3163984

上述のHDを利用した楽音生成装置では、HDのアクセス速度がボトルネックとなり、同時に再生できるch数が制限されるという問題がある。楽音生成装置では、できる限り同時発音ch数を増やすことが望まれる。そこで、HDを利用する代わりにNAND型フラッシュメモリを使用することが考えられる。NAND型フラッシュメモリは、HDと比べてデータの転送速度が格段に速いため、読出しの単位であるクラスタ(ページ)のサイズを大幅に小さくする(10分の1以下)ことができる。しかしながら、その場合、CPUに対する転送要求の割込みの頻度が大幅に増加してしまう(10倍以上)。すなわち、音源で使用する波形データを格納するメモリとしてNAND型フラッシュメモリを使用する場合は、音源を制御するCPUによる制御が必要とされる頻度が高くなり、CPUにかかる負荷が大きく増加するという問題がある。そのため、従来のHDを利用した楽音生成装置ではCPUが処理プログラムに従って行っていた制御を、NAND型フラッシュメモリを利用した楽音生成装置では音源のハードウェアに実行させ、CPU負荷を下げることが望まれる。   In the above-described tone generation apparatus using HD, there is a problem that the access speed of HD becomes a bottleneck and the number of channels that can be reproduced simultaneously is limited. In a musical sound generating device, it is desired to increase the number of simultaneous sounding channels as much as possible. Therefore, it is conceivable to use a NAND flash memory instead of using HD. Since the NAND flash memory has a data transfer speed that is significantly higher than that of HD, the size of a cluster (page) that is a unit of reading can be significantly reduced (1/10 or less). In this case, however, the frequency of transfer request interruptions to the CPU increases significantly (10 times or more). That is, when a NAND flash memory is used as a memory for storing waveform data used by a sound source, the frequency with which control by the CPU that controls the sound source is required increases, and the load on the CPU increases greatly. There is. For this reason, it is desired to reduce the CPU load by causing the tone generator hardware to execute the control performed by the CPU in accordance with the processing program in the conventional tone generator using HD and the tone generator hardware using the NAND flash memory. .

また、NAND型フラッシュメモリでは、他のメモリと比べて読出されるデータにエラーが含まれる可能性が高く、そのためデータを記憶する際には、ページ毎に適宜エラー訂正コードを付与して記憶することが必須である。HDにも同様のデータエラーの問題があったが、従来のHDを利用した楽音生成装置では、HD装置内のプロセッサのファームウェア処理としてデータ訂正が自動的に行われていた。そのため、その介在するプロセッサのためにアドレスを供給してからデータが得られるまでの時間遅れを生じていた。NAND型フラッシュメモリを利用した楽音生成装置では、アクセスの高速化のため、NAND型フラッシュメモリのLSIと楽音生成装置のLSIとの間にプロセッサを介在させないことが望まれる。その場合、NAND型フラッシュメモリ自身ではデータ訂正を行うことができない。   In addition, in NAND flash memory, there is a high possibility that an error is included in data read compared to other memories. Therefore, when data is stored, an error correction code is appropriately added and stored for each page. It is essential. The HD has the same data error problem. However, in a conventional tone generator that uses HD, data correction is automatically performed as firmware processing of the processor in the HD device. For this reason, there is a time delay from when the address is supplied to the intervening processor until data is obtained. In a musical tone generation apparatus using a NAND flash memory, it is desirable not to interpose a processor between the LSI of the NAND flash memory and the LSI of the musical sound generation apparatus in order to speed up access. In that case, the NAND flash memory itself cannot perform data correction.

現在、市場には、NAND型フラッシュメモリに波形データを記憶した音源(楽音発生装置)があるが、その音源では、音源の楽音生成動作に先立って、CPUが、予めNAND型フラッシュメモリから必要とされる波形データを全て読出し、エラー訂正して、RAMで構成される波形メモリに記憶するようになっている。この場合、波形データのサイズは、RAMで構成される波形メモリのサイズにより制限されてしまうという問題がある。   Currently, there is a sound source (musical sound generation device) in which waveform data is stored in a NAND flash memory in the market. However, prior to the sound generation operation of the sound source, the CPU requires a CPU from the NAND flash memory in advance. All the waveform data to be read is read out, error-corrected, and stored in a waveform memory composed of RAM. In this case, there is a problem that the size of the waveform data is limited by the size of the waveform memory constituted by the RAM.

本発明は、NAND型フラッシュメモリ等に波形データを格納しておき、そこから波形データをバッファ経由で波形メモリに読出しつつ再生を行う楽音生成装置において、CPUにかかる負荷を軽減することを目的とする。また、本発明は、NAND型フラッシュメモリ等から読出したデータについてのエラー検出と訂正を、CPUやフラッシュメモリ内のプロセッサを利用することなく、楽音生成部内のハードウェアを利用して実現できるようにするとともに、エラーが発生したページを新たなページに代替させることができるようにすることを目的とする。   An object of the present invention is to reduce a load on a CPU in a musical sound generating apparatus that stores waveform data in a NAND flash memory or the like and reproduces the waveform data from the waveform data read out to the waveform memory via a buffer. To do. Further, the present invention can realize error detection and correction for data read from a NAND flash memory or the like by using hardware in the tone generation unit without using a CPU or a processor in the flash memory. At the same time, it is an object to be able to replace a page in which an error has occurred with a new page.

上記目的を達成するため、請求項1に係る発明は、制御部(CPU)への割り込み無しで、NAND型フラッシュメモリ等に格納した波形データのページ単位での読出しを行い、波形メモリのバッファにサンプル補充ができるようにしたことを特徴とする。まず、外部メモリ(NAND型フラッシュメモリ等)に、複数の各波形データの一連のサンプルデータを、仮想アドレス空間で連続する複数のページに記憶しておく。また、仮想アドレス空間上のページを特定する仮想ページアドレス(VPアドレス)を実ページアドレスに変換するためのアドレス変換テーブルを用意しておく。制御部が発音開始を指示する際には、制御レジスタに、発音する楽音の音高に応じた速度情報、発音に使用する波形データの波形メモリの先頭波形領域を指す先頭波形アドレス、発音に使用する波形データの外部メモリ中の位置を示す波形位置情報、および発音する楽音の振幅を規定する振幅制御情報を設定する。発音開始時には、予め波形データの先頭ページのサンプルデータを記憶した先頭波形領域からサンプルデータを読出し、その先頭ページの読出しが終了する前に、次に読出すべきページをバッファに読込んでおく。次に読出すべきページの実ページアドレスは、次ページアドレス設定部が、前記外部メモリから仮想アドレス空間上で次に読出すべきページを示す仮想ページアドレスを生成し、前記アドレス変換テーブルを参照して該仮想ページアドレスを実ページアドレスに変換し、該実ページアドレスを次ページアドレス記憶部に設定する。転送部は、この次ページアドレス記憶部の実ページアドレスで、次に読出すべきページのデータを読出すことができる。以後は、同様にして1ページ分の読出しが終了するごとに次のページのサンプルをバッファに読込みつつ再生を続ける。   In order to achieve the above object, the invention according to claim 1 reads out the waveform data stored in the NAND flash memory or the like in units of pages without interrupting the control unit (CPU), and stores it in the buffer of the waveform memory. It is characterized by enabling sample replenishment. First, a series of sample data of a plurality of waveform data is stored in a plurality of continuous pages in a virtual address space in an external memory (NAND flash memory or the like). In addition, an address conversion table for converting a virtual page address (VP address) for specifying a page in the virtual address space into a real page address is prepared. When the control unit instructs the start of sound generation, the control register uses speed information corresponding to the pitch of the musical sound to be generated, the top waveform address that points to the top waveform area of the waveform memory of the waveform data used for sound generation, and is used for sound generation Waveform position information indicating the position of the waveform data to be recorded in the external memory, and amplitude control information defining the amplitude of the tone to be generated are set. At the start of sound generation, the sample data is read from the first waveform area in which the sample data of the first page of waveform data is stored in advance, and the page to be read next is read into the buffer before the reading of the first page is completed. For the real page address of the next page to be read, the next page address setting unit generates a virtual page address indicating the next page to be read in the virtual address space from the external memory, and refers to the address conversion table. The virtual page address is converted into a real page address, and the real page address is set in the next page address storage unit. The transfer unit can read the data of the next page to be read with the real page address of the next page address storage unit. Thereafter, the reproduction is continued while reading the sample of the next page into the buffer every time reading of one page is completed in the same manner.

請求項2に係る発明は、請求項1において、アドレス変換テーブルを外部メモリに記憶しておき、装置の起動時に、外部メモリから読出してアドレス変換テーブル記憶部に格納することを特徴とする。   The invention according to claim 2 is characterized in that, in claim 1, the address conversion table is stored in an external memory, and is read out from the external memory and stored in the address conversion table storage unit when the apparatus is activated.

請求項3に係る発明は、請求項1または2において、アドレス変換テーブル記憶部を波形メモリ内に設けることを特徴とする。   According to a third aspect of the present invention, in the first or second aspect, the address conversion table storage unit is provided in the waveform memory.

請求項4に係る発明は、請求項1〜3において、楽音生成部は、転送部により外部メモリから読出したページのデータに対して、エラー訂正コードを利用して該ページのサンプルデータのエラーの検出を行い、エラーの有無およびエラーが有った場合にはエラー訂正の可否を決定すると共に、検出されたエラーが訂正可である場合はその訂正を実行する、エラー訂正部と、エラー訂正部により訂正可なエラーが検出されたとき、その旨およびエラーが発生した外部メモリ上のページを特定する情報を含むエラー通知を制御部に送るエラー検出部とを備え、制御部は、(1)前記訂正可のエラーが発生した当該ページを特定する情報を代替待ちページとして記録し、(2)前記代替待ちページとして記録されているページがあるとき、自動的に起動されたバックグラウンド処理で、または、ユーザの指示により起動された処理で、前記外部メモリ上に代替ページを確保し、前記代替待ちページとして記録されているページのデータを読出し、該読出しでエラーが発生した場合はエラー訂正を行って適正なデータを求め、該適正なデータを前記代替ページに格納して、エラーが発生したページを置き換え、(3)前記代替待ちページの仮想ページアドレスの実ページアドレスへの変換において、前記代替ページの実ページアドレスが取得できるように、前記アドレス変換テーブルを修正することを特徴とする。   According to a fourth aspect of the present invention, in any one of the first to third aspects, the musical tone generating unit uses an error correction code for the page data read from the external memory by the transfer unit to detect an error in the sample data of the page. An error correction unit and an error correction unit that perform detection and determine whether or not an error exists and whether or not there is an error, determine whether or not to correct the error, and execute correction when the detected error is correctable. And an error detection unit that sends an error notification including information specifying the page on the external memory in which the error has occurred to the control unit when a correctable error is detected by the control unit. Information specifying the page on which the correctable error has occurred is recorded as a substitute waiting page, and (2) automatically when there is a page recorded as the substitute waiting page In an activated background process or a process activated by a user instruction, a substitute page is secured on the external memory, and the page data recorded as the substitute waiting page is read, and an error occurs in the read. If the error occurs, error correction is performed to obtain appropriate data, the appropriate data is stored in the substitute page, the page in which the error has occurred is replaced, and (3) the actual virtual page address of the substitute waiting page is In the conversion to the page address, the address conversion table is modified so that the real page address of the substitute page can be acquired.

請求項5に係る発明は、請求項1〜4において、前記外部メモリは、独立した集積回路で構成されるNAND型フラッシュメモリであることを特徴とする。   According to a fifth aspect of the present invention, in the first to fourth aspects, the external memory is a NAND flash memory configured by an independent integrated circuit.

本発明によれば、次ページアドレス設定部が、アドレス変換テーブルを参照して、次に読出すべきページの仮想アドレスを実アドレスに変換して次ページアドレスを取得し、転送部は、転送待ちキューからの指示に応じて、該次ページアドレスで外部メモリからページを読出して波形メモリに転送している。従って、制御部(CPU)に対する割り込みを行うことなしに、ハードウエアにより自動的に転送が行われ、制御部の負荷は軽減できる。アドレス変換テーブルは、外部メモリに記憶しておき、起動時に読出してアドレス変換テーブル記憶部に格納することで、容易に楽音生成部に取り込める。   According to the present invention, the next page address setting unit refers to the address conversion table, converts the virtual address of the page to be read next to a real address, acquires the next page address, and the transfer unit waits for transfer. In response to an instruction from the queue, the page is read from the external memory at the next page address and transferred to the waveform memory. Accordingly, the transfer is automatically performed by hardware without interrupting the control unit (CPU), and the load on the control unit can be reduced. The address conversion table is stored in the external memory, read at the time of activation, and stored in the address conversion table storage unit, so that it can be easily taken into the musical tone generation unit.

また、エラー訂正部やエラー検出部を設けることで、波形データの読出しエラーの検出と訂正可であった場合の訂正が自動で行われるので、そのようなエラーがあった場合でも楽音生成を継続することができる。また、訂正可のエラーが発生した場合、該エラーがあったページの記録をとっておき、後の適宜のタイミングでエラーページの代替を行うことができる。この場合、仮想ページと実ページとの対応は、アドレス変換テーブルにより規定されるようにしているので、エラーページの代替ページへの置き換えは容易に行うことができる。   In addition, by providing an error correction unit and error detection unit, detection of waveform data read errors and corrections when corrections are possible are automatically performed, so music generation continues even when such errors occur. can do. Further, when a correctable error occurs, the page having the error can be recorded, and the error page can be replaced at a later appropriate timing. In this case, the correspondence between the virtual page and the real page is defined by the address conversion table, so that the error page can be easily replaced with the substitute page.

本発明の実施の形態に係る楽音信号生成システムの全体構成図1 is an overall configuration diagram of a musical tone signal generation system according to an embodiment of the present invention. NAND型フラッシュメモリのメモリマップを示す図The figure which shows the memory map of NAND type flash memory 波形メモリのメモリマップを示す図Figure showing the memory map of the waveform memory 波形データの転送のタイミングを説明するためのタイムチャート図Time chart for explaining the timing of waveform data transfer 音源部と転送制御部に関する詳細図Detailed view of the tone generator and transfer controller 発音開始以降の各種アドレスの時間変化(1ch分)を示す図The figure which shows the time change (for 1ch) of various addresses after the start of pronunciation メイン処理およびノートオンイベント処理のフローチャートFlow chart of main processing and note-on event processing 転送指示発生氏のVPアドレス発生部の処理およびB→M転送部の処理のフローチャートFlowchart of processing of VP address generation unit and processing of B → M transfer unit of Mr. transfer instruction generation 代替待ちページの登録がある場合の処理のフローチャートFlowchart of processing when there is registration of a waiting page for substitution

以下、図面を用いて本発明の実施の形態を説明する。   Hereinafter, embodiments of the present invention will be described with reference to the drawings.

図1は、本発明の実施の形態に係る楽音生成装置の全体構成を示す。この楽音生成装置は、楽器用LSI(Large Scale Integrated circuit)100にメモリ等の所定の周辺機器を接続して構成される。   FIG. 1 shows the overall configuration of a musical tone generation apparatus according to an embodiment of the present invention. This musical tone generating apparatus is configured by connecting a predetermined peripheral device such as a memory to a musical instrument LSI (Large Scale Integrated circuit) 100.

CPU101は、装置全体の動作を制御する処理装置である。メモリI/F(インターフェース)102は、本LSI100にNOR型フラッシュメモリ121を接続するためのインターフェースである。NOR型フラッシュメモリ121は、CPU101が実行するプログラムや音色データなどの各種のデータを格納した書き替え可能な不揮発性メモリである。ランダムアクセスメモリ(RAM)103は、各種ワーク領域に使用する揮発性メモリである。表示器I/F104、パラレルI/F105、およびシリアルI/F106は、それぞれ、表示器122、操作子123、およびMIDI I/O124を接続するためのインターフェースである。表示器122は、各種の情報を表示するためのディスプレイである。操作子123は、外部パネル等に設けられた各種のスイッチなどの操作子である。MIDI I/O124は、各種のMIDI機器と接続しMIDI信号を入出力するインターフェースである。   The CPU 101 is a processing device that controls the operation of the entire apparatus. A memory I / F (interface) 102 is an interface for connecting a NOR flash memory 121 to the LSI 100. The NOR flash memory 121 is a rewritable nonvolatile memory that stores various data such as a program executed by the CPU 101 and tone color data. A random access memory (RAM) 103 is a volatile memory used for various work areas. The display I / F 104, the parallel I / F 105, and the serial I / F 106 are interfaces for connecting the display 122, the operator 123, and the MIDI I / O 124, respectively. The display device 122 is a display for displaying various types of information. The operation element 123 is an operation element such as various switches provided on an external panel or the like. The MIDI I / O 124 is an interface for connecting to various MIDI devices and inputting / outputting MIDI signals.

メモリI/F107は、NAND型フラッシュメモリ125にアクセスするためのインターフェースである。NAND型フラッシュメモリ125は、複数の波形データ等を格納した書き替え可能な不揮発性メモリであり、ページ単位でデータが読み書きされる。1ページのページデータの容量は2112バイトである。ページ単位のデータ読出しは、バースト転送で高速に行うことができる。NAND型フラッシュメモリ125のメモリマップは、図2で詳しく説明する。転送バッファ109は、NAND型フラッシュメモリ125から波形メモリ126への波形データ転送用のバッファメモリであり、同時読み書きが可能なデュアルポート(2−port)の半導体メモリにより構成されている。その容量は、1ページ分2112バイトである。転送バッファ109は、スタティックRAM(SRAM)で構成されている。波形メモリ126は、シンクロナスダイナミックRAM(SDRAM)で構成されている。波形メモリ126のメモリマップは、図3で詳しく説明する。メモリI/F112は、波形メモリ126にアクセスするためのインターフェースである。なお、転送バッファ109と波形メモリ126とは、ランダムアクセス(個別にアドレスを指定して行う読出しまたは書込み)を、フラッシュメモリ125に比較して、極めて高速に行うことができる。さらに、連続したアドレスへのアクセスは、バーストモードを用いて高速化することができる。   The memory I / F 107 is an interface for accessing the NAND flash memory 125. The NAND flash memory 125 is a rewritable nonvolatile memory storing a plurality of waveform data and the like, and data is read and written in page units. The page data capacity of one page is 2112 bytes. Reading data in units of pages can be performed at high speed by burst transfer. A memory map of the NAND flash memory 125 will be described in detail with reference to FIG. The transfer buffer 109 is a buffer memory for transferring waveform data from the NAND flash memory 125 to the waveform memory 126, and is configured by a dual-port (2-port) semiconductor memory capable of simultaneous reading and writing. The capacity is 2112 bytes for one page. The transfer buffer 109 is composed of a static RAM (SRAM). The waveform memory 126 is composed of a synchronous dynamic RAM (SDRAM). The memory map of the waveform memory 126 will be described in detail with reference to FIG. The memory I / F 112 is an interface for accessing the waveform memory 126. The transfer buffer 109 and the waveform memory 126 can perform random access (reading or writing performed by individually specifying an address) at an extremely high speed as compared with the flash memory 125. Furthermore, access to consecutive addresses can be accelerated using the burst mode.

F→B転送部108は、NAND型フラッシュメモリ125から転送バッファ109にページデータをページ単位で転送する処理を行う。B→M転送部110は、転送バッファ109から波形メモリ126に波形データを(1ページ分を所定回数に分けて)転送する処理を行う。エラー訂正部111は、フラッシュメモリ125から読出したデータに対するエラー検出や訂正等の処理を行う。これらの転送部108,110およびエラー訂正部111は、転送制御部113による制御の元で動作する。転送の動作のタイミングについては、図4などで詳しく説明する。転送制御部113は、フラッシュメモリ125から転送バッファ109への転送と転送バッファ109から波形メモリ126への転送とを制御する。複数の転送要求が生じた場合は、(1度に1ページしか転送できないので)先着順に1ページずつ転送するよう制御する。なお、現在入手できるNAND型フラッシュメモリのデータ幅は8ビットに限定される。そのため、F→B転送部108は、NAND型フラッシュメモリ125の連続する2アドレスから読出した2データをつなげて16ビットのデータに変換し、データ幅が16ビットである転送バッファ109に書込む。また、波形メモリ126のデータ幅も16ビットであり、各アドレスに16ビットのデータが記憶される。従って、B→M転送部110は、上記F→B転送部108で行っているような変換を行わなくてよい。   The F → B transfer unit 108 performs a process of transferring page data from the NAND flash memory 125 to the transfer buffer 109 in units of pages. The B → M transfer unit 110 performs a process of transferring the waveform data from the transfer buffer 109 to the waveform memory 126 (dividing one page into a predetermined number of times). The error correction unit 111 performs processing such as error detection and correction on the data read from the flash memory 125. The transfer units 108 and 110 and the error correction unit 111 operate under the control of the transfer control unit 113. The timing of the transfer operation will be described in detail with reference to FIG. The transfer control unit 113 controls the transfer from the flash memory 125 to the transfer buffer 109 and the transfer from the transfer buffer 109 to the waveform memory 126. When a plurality of transfer requests are generated, control is performed so that pages are transferred one by one in the order of arrival (since only one page can be transferred at a time). Note that the data width of the currently available NAND flash memory is limited to 8 bits. Therefore, the F → B transfer unit 108 connects two data read from two consecutive addresses of the NAND flash memory 125, converts the data into 16-bit data, and writes the data into the transfer buffer 109 having a data width of 16 bits. The data width of the waveform memory 126 is 16 bits, and 16 bits of data are stored at each address. Therefore, the B → M transfer unit 110 does not have to perform the conversion as performed by the F → B transfer unit 108.

音源114は、複数の発音ch(ここでは128chとする)を備えており、各発音ch毎に読出しアドレスを生成して波形メモリ126から波形データ(波形サンプルデータ)を読出し、読出された波形データに対してエンベロープ付与を行い、各発音ch毎の楽音信号を生成する。さらに、音源114は、生成された複数chの楽音信号を混合し、混合された楽音信号に対してリバーブなどの効果を付与する。音源114から出力された楽音信号は、DAC(ディジタルアナログ変換器)127によりアナログ音響信号に変換され、サウンドシステム128により放音される。115は各部を相互に接続するバスラインであり、コントロールバス、データバス、およびアドレスバスを総称したものである。   The sound source 114 includes a plurality of sound generation channels (here, 128 channels), generates a read address for each sound generation channel, reads waveform data (waveform sample data) from the waveform memory 126, and reads the read waveform data. Envelopes are added to the sound signal to generate a tone signal for each tone generation channel. Furthermore, the sound source 114 mixes the generated music signals of a plurality of channels and gives an effect such as reverb to the mixed music signal. The musical sound signal output from the sound source 114 is converted into an analog sound signal by a DAC (digital-analog converter) 127 and emitted by the sound system 128. Reference numeral 115 denotes a bus line that interconnects the components, and is a generic term for a control bus, a data bus, and an address bus.

図2を参照して、NAND型フラッシュメモリ125のメモリマップを説明する。NAND型フラッシュメモリは、マスクROMよりもコストが安く、ページの頭出し(ここで言う「頭出し」とは、フラッシュメモリにリードコマンドとリードアドレスが与えられてからデータ読出しが開始されるまでの時間区間あるいはそこで行われる処理を指すものとする)に時間が掛かるが、読出しが始まった後のデータ転送速度は速い(バースト転送)という特徴を有する。NAND型フラッシュメモリ125の読出しと書込みはページ単位で行われる。   A memory map of the NAND flash memory 125 will be described with reference to FIG. The NAND flash memory is less expensive than the mask ROM, and the beginning of a page (here, “cueing” refers to the period from when a read command and a read address are given to the flash memory until data reading starts. Although it takes time for the time interval or the processing performed there), the data transfer rate after the start of reading is high (burst transfer). Reading and writing of the NAND flash memory 125 are performed in units of pages.

フラッシュメモリ125上の1ページのページデータ2112バイトは、2048バイトをデータエリアに、64バイトを付加情報に、それぞれ利用する。付加情報はエラー訂正コードを含む。データエリアに2048バイトのデータを書込む際には、その書込みデータから所定の演算によりエラー訂正コードを生成し、付加情報内に書込む。ページデータの読出し時には、付加情報内のエラー訂正コードにより、データエリアから読出した2048バイトのデータにエラーが無いかチェックすることができ、さらにエラーがある場合には(エラーのビット数が所定数以下であれば)訂正処理を行うことができる。なお、エラー訂正コードの生成には、ハミング符号法やBCH法等の周知の方法に基づく生成演算式を用いればよい。一般的に、各生成演算式毎に、エラーが生じた場合のエラーの状態(何ビットのエラーか、訂正できるか)を算出するエラー検出演算式、および、訂正できる場合の訂正すべきビット位置を算出するエラー訂正演算式が決まっている。演算式毎に、βビットのエラー訂正コードにより、データエリア内のαバイトのデータのうちの最大何ビットのエラーまで訂正できるかが決まっている。   One page data 2112 bytes on the flash memory 125 uses 2048 bytes as a data area and 64 bytes as additional information. The additional information includes an error correction code. When writing 2048 bytes of data in the data area, an error correction code is generated from the write data by a predetermined operation and written in the additional information. When reading the page data, it is possible to check whether there is an error in the 2048-byte data read from the data area by using the error correction code in the additional information, and if there is an error (the number of error bits is a predetermined number). Correction processing can be performed (if In addition, what is necessary is just to use the production | generation arithmetic expression based on well-known methods, such as a Hamming code method and a BCH method, for the production | generation of an error correction code. In general, an error detection arithmetic expression for calculating an error state (how many bits of error can be corrected) for each generation arithmetic expression, and a bit position to be corrected when correction is possible An error correction formula for calculating is determined. For each arithmetic expression, it is determined by the β-bit error correction code how many bits of error can be corrected in the α-byte data in the data area.

図2(a)は、フラッシュメモリ125の全体のメモリマップを示す。フラッシュメモリ125は、実ページアドレスでアクセスできる複数の実ページを備え、それらのページにデータを格納する。フラッシュメモリ125には、予めアドレス変換テーブル(A変換TBL)201と波形データ(広義)202を格納しておく。アドレス変換テーブル201と波形データ202とはページを分けて格納するものとする。   FIG. 2A shows an entire memory map of the flash memory 125. The flash memory 125 includes a plurality of real pages that can be accessed with real page addresses, and stores data in these pages. The flash memory 125 stores an address conversion table (A conversion TBL) 201 and waveform data (broadly defined) 202 in advance. Assume that the address conversion table 201 and the waveform data 202 are stored separately in pages.

図2(a)の波形データ(広義)202の実ページアドレス空間に対し、実ページアドレスと仮想ページアドレスが1対1に対応するように仮想ページアドレス空間を設定する。ここでは実ページアドレス空間と仮想ページアドレス空間は、何れも20ビットのページアドレスでアクセスできる範囲を想定するものとする。   The virtual page address space is set so that the real page address and the virtual page address have a one-to-one correspondence with the real page address space of the waveform data (broadly defined) 202 in FIG. Here, both the real page address space and the virtual page address space are assumed to be accessible within a 20-bit page address.

図2(b)は、波形データの仮想アドレス空間上でのデータ構造を示す。波形データ202の領域には、複数の波形データWave1,Wave2,…が格納されている。各波形データは、例えば図中のWave2に示すように、仮想ページアドレスで連続する複数のページW2(0)+Inf,W2(1)+Inf,…に順に格納されている。各波形データWavex(xは1,2,…)の仮想ページアドレスで連続する各ページのデータエリア、あるいは該データエリアに記憶する波形サンプルデータ(1024ワード)を、Wx(0),Wx(1),…と表記する。1ページデータは、そのようなデータエリアの波形サンプルデータに付加情報Inf(64バイト)を付加したものであるので、各データエリアの記号に「+Inf」を付けて表記した。上述したとおり、付加情報Infはエラー訂正コードを含む。各波形データWavexは仮想ページアドレスで連続する複数のページに格納されているので、例えばWave2を読出す場合、先頭のページW2(0)+Infの仮想ページアドレスPが与えられれば、引き続く各ページW2(1)+Inf,W2(2)+Inf,…は、それぞれ仮想ページアドレスP+1,P+2,…で読出せる。なお、図2(b)では、各波形データWave1,Wave2,…の間に空きページが無いかのように図示したが、空きページがあってもよい。1つの波形データが仮想ページアドレス上で連続していればよい。図2(b)中、WAは、波形データの第2仮想ページWx(1)+Infの仮想ページアドレスを設定する制御レジスタの1つである(後に詳しく説明する)。   FIG. 2B shows the data structure of the waveform data on the virtual address space. In the waveform data 202 area, a plurality of waveform data Wave1, Wave2,... Are stored. Each waveform data is sequentially stored in a plurality of pages W2 (0) + Inf, W2 (1) + Inf,... That are consecutive at the virtual page address, for example, as indicated by Wave2 in the figure. The data area of each page continuous with the virtual page address of each waveform data Wavex (x is 1, 2,...) Or the waveform sample data (1024 words) stored in the data area is Wx (0), Wx (1 ), ... Since one-page data is obtained by adding additional information Inf (64 bytes) to the waveform sample data in such a data area, “+ Inf” is added to the symbol of each data area. As described above, the additional information Inf includes an error correction code. Since each waveform data Wavex is stored in a plurality of consecutive pages with virtual page addresses, for example, when reading Wave2, if the virtual page address P of the first page W2 (0) + Inf is given, each subsequent page W2 (1) + Inf, W2 (2) + Inf,... Can be read by virtual page addresses P + 1, P + 2,. In FIG. 2 (b), the waveform data Wave1, Wave2,... Are shown as if there is no empty page, but there may be empty pages. It is only necessary that one waveform data is continuous on the virtual page address. In FIG. 2B, WA is one of the control registers for setting the virtual page address of the second virtual page Wx (1) + Inf of the waveform data (described in detail later).

上記では「仮想ページアドレスで各ページを読出せる」と説明したが、実際には、与えられた仮想ページアドレスを実ページアドレスに変換して、フラッシュメモリ125からページを読出す必要がある。本実施形態のLSI100では、仮想ページアドレスと実ページアドレスとの変換方式として、モード1と2の2方式のうちの何れかを指定できる。   In the above description, “each page can be read with a virtual page address” has been described, but actually, it is necessary to convert a given virtual page address into a real page address and read the page from the flash memory 125. In the LSI 100 of the present embodiment, one of the two modes 1 and 2 can be designated as a conversion method between the virtual page address and the real page address.

モード1について説明する。モード1では、図2(c)に示すように、連続する16ページを1ブロックとするブロックの概念を導入する。図2(a)の波形データ202の領域は、ブロック単位に分けて使用するものとし、1ブロック内では実ページアドレスの昇順に波形データを連続して格納する。例えば、1つの波形データWave2をフラッシュメモリ125に格納する際には、該波形データを格納するのに必要な数のブロックをフラッシュメモリ125内に確保し、第1のブロックに先頭ページW2(0)+InfからW2(15)+Infを順に格納し、次のブロックにW2(16)+InfからW2(31)+Infを格納し、…というように格納すればよい。別の波形データ(例えば、Wave1とWave2)は異なるブロックに格納するものとする。なお、ブロックは、ブロック同士の境界が16ページ単位でバウンダリ調整されるように設定する。   Mode 1 will be described. In mode 1, as shown in FIG. 2C, the concept of a block having 16 consecutive pages as one block is introduced. The area of the waveform data 202 in FIG. 2 (a) is used by being divided into block units, and the waveform data is continuously stored in ascending order of the real page address in one block. For example, when one waveform data Wave2 is stored in the flash memory 125, the necessary number of blocks for storing the waveform data is secured in the flash memory 125, and the first page W2 (0 ) + Inf to W2 (15) + Inf are stored in order, W2 (16) + Inf to W2 (31) + Inf are stored in the next block, and so on. It is assumed that different waveform data (for example, Wave1 and Wave2) are stored in different blocks. The blocks are set so that the boundary between the blocks is boundary-adjusted in units of 16 pages.

図2(d)に、モード1における仮想ページアドレスから実ページアドレスへの変換の具体的な手法を示す。20ビットの仮想ページアドレス(ページ番号)221が与えられたとする。該アドレス221の上位16ビットはブロックを特定するための仮想ブロック番号であり、下位4ビットはそのブロック内の16ページの中から1つのページを特定するデータである。上位16ビットの仮想ブロック番号は、アドレス変換テーブル222を用いて、実ページアドレス223の上位16ビットに変換される。仮想ページアドレス221の下位4ビットは、ブロック内の16ページの中から1つのページを特定するデータとして、そのまま実ページアドレス223の下位4ビットとされる。以上のようにして得た実ページアドレス223によりフラッシュメモリ125をアクセスして、当該仮想ページアドレス221のページデータを読出す。   FIG. 2D shows a specific method of conversion from the virtual page address to the real page address in mode 1. Assume that a 20-bit virtual page address (page number) 221 is given. The upper 16 bits of the address 221 are a virtual block number for specifying a block, and the lower 4 bits are data for specifying one page among the 16 pages in the block. The upper 16-bit virtual block number is converted into the upper 16 bits of the real page address 223 using the address conversion table 222. The lower 4 bits of the virtual page address 221 are used as the lower 4 bits of the actual page address 223 as data for specifying one page out of 16 pages in the block. The flash memory 125 is accessed by the real page address 223 obtained as described above, and the page data of the virtual page address 221 is read.

アドレス変換テーブル222は、システム立ち上げ時にフラッシュメモリ125の領域201から読出して波形メモリ126に設定し、利用する。図2(a)では単に「アドレス変換テーブル201」と表記したが、実際には、この領域201の複数ページのデータエリア内のデータを合せることにより有意なアドレス変換テーブルが得られる。領域201の複数ページのデータエリアには、予めフラッシュメモリ125に波形データを格納したときに、仮想ブロック番号と実ブロック番号との対応関係を全て登録しておく。領域201を構成する複数ページの実ページアドレスは予め決めておく。なお、図2(b)の付加情報Inf中の「次ページへのポインタNP」は、次のモード2において利用するデータであり、モード1では不要である。   The address conversion table 222 is read from the area 201 of the flash memory 125 when the system is started up, set in the waveform memory 126, and used. In FIG. 2A, it is simply indicated as “address conversion table 201”, but in practice, a significant address conversion table can be obtained by combining data in a data area of a plurality of pages in this area 201. In the data area of a plurality of pages in the area 201, all the correspondences between virtual block numbers and real block numbers are registered when waveform data is stored in the flash memory 125 in advance. Real page addresses of a plurality of pages constituting the area 201 are determined in advance. Note that “pointer NP to the next page” in the additional information Inf in FIG. 2B is data used in the next mode 2 and is not required in mode 1.

モード2について説明する。モード2の場合は、波形データをフラッシュメモリ125に格納する際に、図2(b)に示すように、各ページデータの付加情報Inf内に3バイトの「次ページへのポインタNP」を設定する。この「次ページへのポインタNP」には、波形データの進行順で次ページ(当該ページの次の波形サンプルが格納されているページ)の実ページアドレスを設定しておく。図2(e)に、Wave2のモード2における実アドレス上のページのデータ構造例を示す。仮想ページの先頭ページであるW2(0)+Infの実ページアドレスが与えられれば、該ページデータ中の「次ページへのポインタNP」を参照して次の仮想ページW2(1)+Infにアクセスでき、以下同様にしてページを辿ることができ、波形データを順に読出すことができる。   Mode 2 will be described. In the case of mode 2, when storing the waveform data in the flash memory 125, as shown in FIG. 2B, the 3-byte “pointer NP to the next page” is set in the additional information Inf of each page data. To do. In this “next page pointer NP”, an actual page address of the next page (a page in which the next waveform sample of the page is stored) is set in the progression order of the waveform data. FIG. 2E shows an example of the data structure of a page on a real address in Wave2 mode 2. If the real page address of W2 (0) + Inf that is the first page of the virtual page is given, the next virtual page W2 (1) + Inf can be accessed with reference to the “pointer NP to the next page” in the page data. Thereafter, the page can be traced in the same manner, and the waveform data can be read in order.

なお、詳しくは後述するが、モード1,2の何れの場合も各波形データWave1,2,…の全ての先頭ページWx(0)がシステム立上げ時に波形メモリ126のプリロード領域に設定されているので、モード2の場合、第2仮想ページWx(1)+Infの仮想ページアドレスWAから開始して次ページへのポインタNPによりページを辿ることになる。最初に与えられた第2仮想ページアドレスWAから実ページアドレスへの変換は、波形メモリ126上に読出されているアドレス変換テーブルを利用して行う。逆に言えば、アドレス変換テーブルには、各波形データWave1,Wave2,…の第2仮想ページアドレスと、その第2仮想ページアドレスを変換した実ページアドレスとを対応付けて格納しておけばよい。図2(d)で説明したモード1の場合のアドレス変換テーブルは、アドレスとして16ビットの仮想ブロック番号を与えると、そのアドレスに記憶されている16ビットの実ブロック番号を出力するテーブルであるが、モード2の場合は、各波形データWave1,Wave2,…の20ビットの第2仮想ページアドレスを与えると、アドレス変換テーブルに記憶されている第2仮想ページアドレス中から一致する第2仮想ページアドレスをサーチして、一致する第2仮想ページアドレスが見つかれば、その第2仮想ページアドレスに対応付けられ記憶されている20ビットの実ページアドレスを出力するテーブルである。図2(a)の領域201には、予めフラッシュメモリ125に波形データを格納したときに、上記第2仮想ページアドレスと実ページアドレスとの対応関係を全て登録しておく。   As will be described in detail later, in both modes 1 and 2, all the first pages Wx (0) of each waveform data Wave 1, 2,... Therefore, in the case of mode 2, the page is traced with the pointer NP to the next page starting from the virtual page address WA of the second virtual page Wx (1) + Inf. The conversion from the second virtual page address WA given first to the real page address is performed using an address conversion table read on the waveform memory 126. Conversely, in the address conversion table, the second virtual page address of each waveform data Wave1, Wave2,. . The address conversion table in the case of mode 1 described with reference to FIG. 2D is a table that outputs a 16-bit real block number stored in the address when a 16-bit virtual block number is given as the address. In the case of mode 2, when a 20-bit second virtual page address of each waveform data Wave1, Wave2,... Is given, a second virtual page address that matches from the second virtual page addresses stored in the address conversion table. If a matching second virtual page address is found, a 20-bit real page address stored in association with the second virtual page address is output. In the area 201 of FIG. 2A, when the waveform data is stored in the flash memory 125 in advance, all the correspondences between the second virtual page address and the real page address are registered.

上記モード1および2では、何れも1つの波形が仮想アドレス上で連続した複数のページに記憶されているので、どのページを読出すかページ毎に指示しなくてもよく、ch毎に読出し開始時に読出し対象の波形データの最初の仮想ページアドレスを指示するだけで済む。なお、NAND型フラッシュメモリ125は、8ビット幅でデータを読み書きするものとする。   In each of the modes 1 and 2, since one waveform is stored in a plurality of continuous pages on the virtual address, there is no need to instruct which page is to be read for each page. It is only necessary to indicate the first virtual page address of the waveform data to be read. Note that the NAND flash memory 125 reads and writes data with an 8-bit width.

図3は、波形メモリ126のメモリマップを示す。波形メモリ126には、アドレス変換テーブル領域301、プリロード領域302、バッファ領域303、および次ページアドレス領域(NPA)304が設けられている。アドレス変換テーブル領域301には、システム立ち上げ時に、図2(a)のフラッシュメモリ125の所定領域201から読出したアドレス変換テーブルを設定する。プリロード領域302は、図2(b)に示したNAND型フラッシュメモリ125に記憶されている波形データWave1,2,…の数分の各先頭ページの波形データW1(0),W2(0),W3(0),…を記憶する領域である。プリロード領域302への各先頭ページの波形データの記憶は、システム立ち上げ時に行われる。バッファ領域303には、発音ch数×2のバッファ、すなわち各発音ch毎の2つのバッファ(1つのバッファの大きさは1ページ=1024ワードである)が設けられている。発音chi(iは1,2,…,128)に対応する領域をBia,Bibで表す。Bia,Bibは、波形メモリ126のアドレス空間内に連続して配置される。   FIG. 3 shows a memory map of the waveform memory 126. The waveform memory 126 includes an address conversion table area 301, a preload area 302, a buffer area 303, and a next page address area (NPA) 304. In the address conversion table area 301, the address conversion table read from the predetermined area 201 of the flash memory 125 of FIG. The preload area 302 includes waveform data W1 (0), W2 (0), W2 (0), W1 (0), W2 (0), each of the first page corresponding to the number of waveform data Wave1, Wave2, ... stored in the NAND flash memory 125 shown in FIG. This is an area for storing W3 (0),. The waveform data of each first page is stored in the preload area 302 when the system is started up. The buffer area 303 is provided with a buffer of the number of sound generation channels × 2, that is, two buffers for each sound generation channel (the size of one buffer is 1024 words per page). Areas corresponding to pronunciation chi (i is 1, 2,..., 128) are represented by Bia and Bib. Bia and Bib are continuously arranged in the address space of the waveform memory 126.

なお、「ページ」および「ページデータ」の語は、フラッシュメモリ125および転送バッファ109上では、付加情報Infを含む2112バイトのページおよび該ページ中のデータを示すものであるが、波形メモリ126上では、付加情報Infを含まない1024ワードのデータエリアおよび該データエリア中の波形サンプルデータを示すものとする。要するに、フラッシュメモリ125や転送バッファ109上の「ページ」は読出しや書込みを行うときの単位に注目しており、フラッシュメモリ125から読出されエラー訂正され波形メモリ126に設定されたときには1ページが1024ワードの波形サンプルデータとしてとらえているものである。   The words “page” and “page data” indicate a 2112-byte page including additional information Inf and data in the page on the flash memory 125 and the transfer buffer 109. Now, a 1024-word data area not including the additional information Inf and waveform sample data in the data area are shown. In short, “page” on the flash memory 125 and the transfer buffer 109 pays attention to a unit for reading and writing. When the page is read from the flash memory 125, corrected for error, and set in the waveform memory 126, one page is 1024. It is taken as waveform sample data of a word.

システム立ち上げ時に実行する、波形メモリ126のアドレス変換テーブル領域301へのアドレス変換テーブルの設定、および、各波形データの先頭ページWx(0)のプリロード領域302への設定は、主として転送制御部113の初期設定処理により実行される。このプリロード領域302の初期設定処理を簡易に行うために、各波形データWave1,2,…のそれぞれの先頭ページをフラッシュメモリ125の実ページアドレスで連続する所定領域にまとめて記憶するようにしてもよい。   The setting of the address conversion table in the address conversion table area 301 of the waveform memory 126 and the setting of the first page Wx (0) of each waveform data in the preload area 302, which are executed when the system is started up, are mainly performed by the transfer control unit 113. The initial setting process is executed. In order to easily perform the initial setting process of the preload area 302, the first pages of the waveform data Waves 1, 2,... May be stored together in a predetermined area continuous with the actual page address of the flash memory 125. Good.

図3(a)中、PAは、音源114が波形メモリ126から波形サンプルを読出す際、最初に読出すべきプリロード領域302中の先頭ページの読出しアドレスを設定する制御レジスタの1つである。この図では第2chで波形データWave3の再生が指定されたケースを示しており、PAで波形メモリ126上のその先頭ページの波形データW3(0)が指定されている。矢印311は、音源114が当該先頭ページの波形サンプルを読出す際の読出しアドレス(ピッチカウンタ)の進行方向を示す。BAは、前記プリロード領域302の先頭ページを読み終えた後、バッファ領域303中のどのバッファから波形サンプルを読出すかを示す読出しアドレスを設定する制御レジスタの1つである。この図では第2chでの再生が指定されているので、ページW3(0)を読み終えた時点の初期値として、BAには、第2chが使用するバッファB2a,B2bの先頭アドレスが設定される。矢印312は、読出しアドレス(ピッチカウンタ)の進行方向を示す。矢印312のようにバッファB2aとB2bを読出した後、引き続きバッファの先頭に戻って矢印313,314のように読出しを続ける。このような波形メモリの読出しを行うためには、プリロード領域W3(0)の読出しを行っている間に、次に読出すべき波形サンプルデータをバッファB2aに格納し、さらにバッファB2aを読出している間にバッファB2bに波形サンプルデータを格納し、次にバッファB2bを読出している間にバッファB2aに波形サンプルデータを格納し、…というようにバッファB2aとB2bとを交互に使用して再生を続ける。なお、各chのバッファ数は3以上であってもよい。また、波形メモリ126は、16ビット幅でデータを読み書きするものとする。   In FIG. 3A, PA is one of the control registers for setting the read address of the first page in the preload area 302 to be read first when the sound source 114 reads the waveform sample from the waveform memory 126. This figure shows a case where the reproduction of the waveform data Wave3 is designated by the second channel, and the waveform data W3 (0) of the first page on the waveform memory 126 is designated by PA. An arrow 311 indicates the traveling direction of the read address (pitch counter) when the sound source 114 reads the waveform sample of the first page. BA is one of control registers for setting a read address indicating from which buffer in the buffer area 303 the waveform sample is read after the first page of the preload area 302 has been read. Since reproduction in the second channel is designated in this figure, as the initial value at the time when the page W3 (0) has been read, the head addresses of the buffers B2a and B2b used by the second channel are set in BA. . An arrow 312 indicates the traveling direction of the read address (pitch counter). After reading the buffers B2a and B2b as indicated by the arrow 312, the operation continues to return to the head of the buffer and continues to read as indicated by the arrows 313 and 314. In order to read out such a waveform memory, the waveform sample data to be read out next is stored in the buffer B2a while the preload area W3 (0) is being read out, and the buffer B2a is further read out. The waveform sample data is stored in the buffer B2b in the meantime, the waveform sample data is then stored in the buffer B2a while the buffer B2b is being read, and the reproduction is continued using the buffers B2a and B2b alternately. . Note that the number of buffers in each channel may be three or more. The waveform memory 126 reads and writes data with a 16-bit width.

次ページアドレス領域(NPA)304には、各発音chの次ページアドレスを格納する。図3(b)にNPA304のマップを示す。NPAiが、第ichの次ページアドレスを示す。次ページアドレスNPAiとは、第ichについて、次にフラッシュメモリ125から波形メモリ126のバッファ領域に読出すべきページの、フラッシュメモリ125上の実ページアドレスである。次ページアドレスNPAiの設定のタイミングや設定データの詳細については後に詳しく説明する。   The next page address area (NPA) 304 stores the next page address of each sounding channel. FIG. 3B shows a map of the NPA 304. NPAi indicates the next page address of the ith. The next page address NPAi is an actual page address on the flash memory 125 of the page to be read next from the flash memory 125 to the buffer area of the waveform memory 126 for the ith. The timing for setting the next page address NPAi and details of the setting data will be described in detail later.

図4は、転送制御部113の制御の元で転送部108,110が実行する波形データの転送のタイミングを説明するためのタイムチャートである。矢印tの向きに時間が進むものとする。複数の縦線401はサンプリングクロックの発生タイミングを示し、隣り合う縦線401の間の区間が1サンプリング周期(以下、1DACという)を示している。本実施形態では、1DACは22.67n秒である。「NAND型フラッシュ→転送バッファ」と記載したタイムチャートは、F→B転送部108によりNAND型フラッシュメモリ125から転送バッファ109に1ページ分の波形サンプルと付加情報を転送する処理のタイムチャートである。「転送バッファ→波形メモリ」と記載したタイムチャートは、B→M転送部110により転送バッファ109から波形メモリ126のバッファ領域303(その中の指定したchに対応するバッファ)に、1ページ分の波形サンプルを転送する処理、および、音源114が波形メモリ126から波形サンプルを読出す処理のタイムチャートである。   FIG. 4 is a time chart for explaining the timing of waveform data transfer performed by the transfer units 108 and 110 under the control of the transfer control unit 113. It is assumed that time advances in the direction of the arrow t. A plurality of vertical lines 401 indicate sampling clock generation timings, and a section between adjacent vertical lines 401 indicates one sampling period (hereinafter referred to as 1 DAC). In this embodiment, 1 DAC is 22.67 nsec. The time chart described as “NAND type flash → transfer buffer” is a time chart of processing for transferring one page of waveform samples and additional information from the NAND type flash memory 125 to the transfer buffer 109 by the F → B transfer unit 108. . In the time chart described as “transfer buffer → waveform memory”, the B → M transfer unit 110 transfers from the transfer buffer 109 to the buffer area 303 of the waveform memory 126 (the buffer corresponding to the designated channel therein) for one page. 5 is a time chart of processing for transferring waveform samples and processing for a sound source 114 to read waveform samples from the waveform memory 126.

411は、NAND型フラッシュメモリ125に実ページアドレスを供給し始めてから、同メモリ125内にてその実ページアドレスが示すページのデータの出力準備が完了するまでの、ページ頭出しを行っている期間を示す。頭出し411の後、412,413に示すように、1ページ分のデータ(データエリアの2048バイトおよび付加情報Infの64バイト)がページ読出し(バースト転送)される。本実施形態では、411〜413に示すように、4DACでNAND型フラッシュメモリ125から1ページのデータおよび付加情報を読出して転送バッファ109に書込むことができる。この4DACという転送時間は、NAND型フラッシュメモリ125のページ読出し(バースト転送)に関する仕様に基づいて決まるものである。   Reference numeral 411 denotes a period during which page cueing is performed from the start of supplying a real page address to the NAND flash memory 125 until the output of the page data indicated by the real page address is completed in the memory 125. Show. After cueing 411, as shown in 412 and 413, data for one page (2048 bytes in the data area and 64 bytes in the additional information Inf) is page read (burst transfer). In the present embodiment, as shown at 411 to 413, one page of data and additional information can be read from the NAND flash memory 125 and written to the transfer buffer 109 by 4DAC. The transfer time of 4DAC is determined based on the specifications related to page reading (burst transfer) of the NAND flash memory 125.

421は、音源114が楽音生成のために波形メモリ126から128ch分の波形サンプルを読出す期間である。422は、転送バッファ109上のデータエリアの1ページ分の波形サンプルを波形メモリ126の対応するchのバッファに転送する期間を示す。この転送は、LSI100の内部レジスタからDRAMへのデータ転送であり、バーストモードによる高速なデータ転送を行うものとする。423は、波形メモリ126のリフレッシュを行う期間である。リフレッシュ423の区間の時間長さは、波形メモリ126の仕様により決まる。1DACからリフレッシュ423の区間を除いた区間を、波形サンプル読出し区間421とバースト転送区間422とで分けあう。   Reference numeral 421 denotes a period during which the sound source 114 reads out waveform samples for 128 channels from the waveform memory 126 to generate a musical sound. Reference numeral 422 denotes a period during which one page of waveform samples in the data area on the transfer buffer 109 is transferred to the corresponding channel buffer of the waveform memory 126. This transfer is data transfer from the internal register of the LSI 100 to the DRAM, and high-speed data transfer in burst mode is performed. Reference numeral 423 denotes a period during which the waveform memory 126 is refreshed. The time length of the refresh 423 interval is determined by the specification of the waveform memory 126. A section obtained by excluding the refresh 423 from 1 DAC is divided into a waveform sample reading section 421 and a burst transfer section 422.

1DAC中の波形サンプル読出し区間421の時間長さは、本装置で何chの楽音生成を行うか、および、各chで何点補間を行うかという要求仕様、並びに、音源114が時分割で各chの波形サンプルを波形メモリ126から読出すときにどれ程の時間分解能で1DAC中に何サンプル読出し可能かという仕様に基づいて、設計者が決める。1DAC中のバースト転送422の区間の時間長さは、この区間で何サンプルの転送を行う必要があるかという要求仕様、および、転送バッファ109から波形メモリ126へのバースト転送に関する速度の仕様に基づいて、設計者が決める。ただし、転送バッファ109は読出しと書込みが同時に実行可能なメモリで、その大きさは1ページ分の波形データ+付加情報分であるから、フラッシュメモリ125から転送バッファ109へ読出した1ページ分の波形サンプル(2048バイト)は、基本的にフラッシュメモリ125から転送バッファ109へのページ読出しにかかるDAC数と同じDAC数で、転送バッファ109から波形メモリ126に転送する必要がある。従って、1回のバースト転送422の区間では、1ページデータのサンプル数を前記DAC数で割ったサンプル数(小数点以下切上げ)の転送を行う必要がある。本実施形態では、フラッシュメモリ125の1ページ分のデータエリアのデータ2048バイト=1024サンプルを転送バッファ109に読出すのに4DACかかるので、転送バッファ109に読出された1ページ分の波形サンプルを波形メモリ126に転送するのも4DACに分けて行う。従って、1回のバースト転送区間422では、1ページ分のデータ2048バイト=1024サンプルの4分の1に当たる256サンプルを転送する。   The time length of the waveform sample readout section 421 in 1 DAC is determined according to the required specifications of how many channels of musical sound are generated by this apparatus and how many points are interpolated in each channel, and the sound source 114 is time-divided. The designer determines based on the specifications of how many samples can be read in one DAC at a time resolution when reading the waveform samples of ch from the waveform memory 126. The time length of the section of the burst transfer 422 in 1 DAC is based on the required specification of how many samples need to be transferred in this section and the speed specification regarding the burst transfer from the transfer buffer 109 to the waveform memory 126. The designer decides. However, since the transfer buffer 109 is a memory that can be read and written simultaneously, and its size is one page of waveform data + additional information, the waveform of one page read from the flash memory 125 to the transfer buffer 109. It is necessary to transfer the samples (2048 bytes) from the transfer buffer 109 to the waveform memory 126 with the same number of DACs as the number of DACs required for page reading from the flash memory 125 to the transfer buffer 109. Therefore, it is necessary to perform transfer of the number of samples (rounded up after the decimal point) obtained by dividing the number of samples of one page data by the number of DACs in the section of one burst transfer 422. In this embodiment, since it takes 4 DAC to read 2048 bytes = 1024 samples in the data area for one page of the flash memory 125 to the transfer buffer 109, the waveform samples for one page read to the transfer buffer 109 are waveformd. Transfer to the memory 126 is also divided into 4 DACs. Therefore, in one burst transfer section 422, 256 samples corresponding to a quarter of 2048 bytes of data for one page = 1024 samples are transferred.

本実施形態では、各chは2点補間を行い、全部で128chの楽音生成を行うことを前提とし、その処理を可能にするために必要な波形サンプル読出し区間421の時間長さが確保されているものとする。また、1DACから波形サンプル読出し区間421とリフレッシュ423を除いた区間422で、256サンプル(ワード)のバースト転送が可能なハードウェアを用いているものとする。   In the present embodiment, it is assumed that each channel performs two-point interpolation and a total of 128-channel musical sounds are generated, and the time length of the waveform sample reading section 421 necessary for enabling the processing is secured. It shall be. It is assumed that hardware capable of burst transfer of 256 samples (words) is used in a section 422 excluding the waveform sample reading section 421 and the refresh 423 from 1 DAC.

ここで、エラー訂正部111によるエラー訂正処理について説明する。区間412,413のフラッシュメモリ125から転送バッファ109へのデータ転送は、F→B転送部108により行われるが、該転送中に、エラー訂正部111は、その転送データを解析してエラー訂正演算処理を行う。431は該エラー訂正演算処理を行う時間区間を示す。エラー訂正演算処理は、転送しているデータに所定の演算を施すことによりエラー訂正コードを算出し、付加情報Infに記録されているエラー訂正コードと比較することにより、転送データ中のエラーを検出し、検出されたエラーが訂正可能か否かを判定し、訂正可能である場合は該エラーが検出されたビット位置を特定する処理である。エラー検出処理は、区間412のフラッシュメモリ125から転送バッファ109へのデータ転送が開始された直後から順次行うことができるので、区間412のデータ転送の開始タイミングの直後からエラー訂正演算処理431を開始している。エラー訂正部111は、データ転送412の進行とともにエラー訂正演算処理431の区間でエラー検出の処理を実行してエラー訂正コードを算出し、付加情報Infの転送413が終了すると、該算出されたエラー訂正コードと該付加情報Infに含まれるエラー訂正コードとに基づいて所定のエラー判定演算を行い、最終的にエラーの有無とエラーがあった場合のエラー訂正の可否とエラー訂正が可の場合のエラー訂正箇所を確定する。一方、エラーの有無にかかわらず、B→M転送部110は、転送バッファ109上の1024サンプルを4回の区間422で波形メモリ126に書込む。エラー訂正部111は、エラー訂正演算処理431の結果に基づいて、エラーが検出され該エラーの訂正箇所が取得されている場合は、区間425で波形メモリ126上の当該波形データに対してエラー訂正を施す。なお、エラー訂正する対象は、モード1の場合はデータエリアの2048バイトのデータ、モード2の場合はデータエリアの2048バイトと次ページへのポインタNPを合わせたデータである。すなわち、モード2の場合は、データエリアと次ページへのポインタNPを合わせたデータに対するエラー訂正コードが各ページに格納されているものとする。   Here, the error correction processing by the error correction unit 111 will be described. Data transfer from the flash memory 125 to the transfer buffer 109 in the sections 412 and 413 is performed by the F → B transfer unit 108. During the transfer, the error correction unit 111 analyzes the transfer data and performs error correction calculation. Process. Reference numeral 431 denotes a time interval in which the error correction calculation process is performed. Error correction calculation processing calculates an error correction code by performing a predetermined calculation on the data being transferred, and detects an error in the transfer data by comparing it with the error correction code recorded in the additional information Inf. Then, it is determined whether or not the detected error can be corrected, and if correction is possible, the bit position where the error is detected is specified. Since the error detection process can be performed sequentially immediately after the data transfer from the flash memory 125 in the section 412 to the transfer buffer 109 is started, the error correction calculation process 431 is started immediately after the data transfer start timing in the section 412. doing. The error correction unit 111 calculates an error correction code by executing an error detection process in the section of the error correction calculation process 431 as the data transfer 412 proceeds, and when the transfer 413 of the additional information Inf ends, the calculated error A predetermined error determination operation is performed based on the correction code and the error correction code included in the additional information Inf. Finally, the presence / absence of an error, whether error correction is possible and whether error correction is possible Determine the error correction location. On the other hand, regardless of the presence or absence of an error, the B → M transfer unit 110 writes the 1024 samples on the transfer buffer 109 into the waveform memory 126 in four sections 422. Based on the result of the error correction calculation processing 431, the error correction unit 111 corrects the error in the waveform data on the waveform memory 126 in the interval 425 when an error is detected and the error correction location is acquired. Apply. The target of error correction is 2048 bytes of data in the data area in the case of mode 1, and data obtained by combining the 2048 bytes of the data area and the pointer NP to the next page in the case of mode 2. In other words, in the case of mode 2, it is assumed that an error correction code for data including the data area and the next page pointer NP is stored in each page.

また、転送バッファ→波形メモリのバースト転送は、NAND型フラッシュ→転送バッファの転送が開始されたタイミングから2DAC遅れたDAC周期から開始する。これは、付番412に示した2048バイト=1024サンプルの1ページデータを付番422に示したバースト転送で256サンプルずつ4回に分けて転送することが可能となるように(要するに4回のバースト転送422のそれぞれについて、そのバースト転送が開始するまでに、そのバースト転送で転送する256サンプルのデータがNAND型フラッシュメモリ125から転送バッファ109に転送し終えているように)、2DAC遅れさせているものである。従って、転送バッファ109は、2−portでなくとも良く、例えば2個のRAMで読出しと書込みを交互に切り替えるものでも良いが、ここでは書込みと読出しを安全に行うために2−portのRAMを用いた。   The burst transfer from the transfer buffer to the waveform memory starts from a DAC cycle delayed by 2 DAC from the timing at which the transfer from the NAND flash to the transfer buffer is started. This is so that one page data of 2048 bytes = 1024 samples shown in the number 412 can be divided into 256 samples and transferred by the burst transfer shown in the number 422 (in short, four times). Each burst transfer 422 is delayed by 2 DAC so that 256 samples of data transferred in the burst transfer have been transferred from the NAND flash memory 125 to the transfer buffer 109 by the time the burst transfer starts. It is what. Therefore, the transfer buffer 109 does not have to be 2-port. For example, two RAMs may alternately switch between reading and writing. However, in order to perform writing and reading safely, a 2-port RAM is used. Using.

図5は、音源部114と転送制御部113に関する詳細図である。本図では、主としてアドレスの入出力を表す矢印は普通の矢印で、アドレス以外のデータの入出力を表す矢印は先頭部を塗りつぶした三角形とした矢印で、それぞれ表している。   FIG. 5 is a detailed diagram regarding the sound source unit 114 and the transfer control unit 113. In this figure, the arrows representing input / output of addresses are mainly represented by ordinary arrows, and the arrows representing input / output of data other than addresses are represented by triangles with a solid top portion.

音源部114は、モードレジスタ501を備える。該レジスタ501は、仮想ページアドレスから実ページアドレスへの変換方式を規定するモード1または2の何れかを指定するモード情報Mをセットするレジスタである。予め本LSI100をモード1と2のどちらで動作させるかは設計者により決められている。また、そのモードに応じたデータ構造でフラッシュメモリ125にアドレス変換テーブルと波形データが格納されている。システム立ち上げ時に、レジスタ501にそのモード情報が設定される。   The sound source unit 114 includes a mode register 501. The register 501 is a register for setting mode information M for designating either mode 1 or 2 that defines a conversion method from a virtual page address to a real page address. The designer determines in advance whether the LSI 100 is operated in mode 1 or 2. In addition, an address conversion table and waveform data are stored in the flash memory 125 with a data structure corresponding to the mode. The mode information is set in the register 501 when the system is started up.

音源部114は、制御レジスタ(音源レジスタ)502を備える。制御レジスタ502は、各ch毎のパラメータおよびノートオンNONを記憶するレジスタである。CPU101は、例えばMIDI I/O124経由で楽音発生指示を受けたとき、楽音生成するchを割り当て、そのchに対応する制御レジスタ502に、その演奏情報に基づくパラメータを設定してノートオンを書込む。これにより、音源114は、そのchでの楽音生成処理を開始する。各レジスタの詳細を以下に示す。   The sound source unit 114 includes a control register (sound source register) 502. The control register 502 is a register that stores parameters and note-on NON for each channel. For example, when the CPU 101 receives a musical sound generation instruction via the MIDI I / O 124, the CPU 101 assigns a channel for generating a musical sound, sets a parameter based on the performance information in the control register 502 corresponding to the channel, and writes a note-on. . As a result, the sound source 114 starts the tone generation process for that channel. Details of each register are shown below.

(1)WA:図2(b)で説明したNAND型フラッシュメモリ125中の当該chで読出す波形データWavexの第2ページWx(1)+Infの仮想ページアドレスをセットする。
(2)PA:図3(a)で説明した波形メモリ126のプリロード領域302中の当該chで読出す波形データWavexの先頭ページWx(0)のアドレスをセットする。システム立ち上げ時に、NAND型フラッシュメモリ125の全波形データWave1,2,…の先頭ページW1(0),W2(0),…が、プリロード領域302に格納される。
(3)BA:図3(a)で説明した波形メモリ126のバッファ領域303中の当該chに対応する1組のダブルバッファBna,Bnbのアドレスをセットする。
(4)F:Fナンバをセットする。Fナンバは、整数部と小数部とを有し、読出される波形データのピッチをシフトするパラメータであり、その値は発生させたい楽音のピッチ(音高)に応じて決定される。すなわち、Fナンバの値は、波形データのピッチからシフトしなくてよい場合は「1」とされ、ピッチアップしたいときは「1」より大きな値とされ、ピッチダウンしたいときは「1」より小さな値とされる。
(5)IL,HT,1DR,1DL,2DR,2DL,RR:楽音のエンベロープを制御するためのパラメータをセットするレジスタである。ILはイニシャルレベル、HTはホールドタイムを示す。これらは、楽音発生開始からホールドタイムHTの時間区間は、エンベロープ波形として、イニシャルレベルILを固定的に出し続けることを指示するパラメータである。NAND型フラッシュメモリ125に用意してある波形データは、何れも、その立ち上がり部分については元のサンプリング波形における音量変化をそのまま利用する方がリアルな楽音が得られるような波形データとしてある。そこで、その立ち上がり部分のホールドタイムHTだけの時間区間ではイニシャルレベルILをエンベロープ波形としている。1DRは1stディケイレート、1DLは1stディケイレベルである。ホールドタイムHTの後、1stディケイレート1DRの変化率で目標値1stディケイレベル1DLに至るエンベロープ波形を出力するためのパラメータである。2ndディケイレート2DRと2ndディケイレベル2DLも同様であり、1stディケイの後、2ndディケイレート2DRの変化率で目標値2ndディケイレベル2DLに至るエンベロープ波形を出力するためのパラメータである。2ndディケイの後、ノートオフが来たら、リリースレートRRの変化率で徐々に音量レベルを減少させていく。音量レベルが所定レベル以下になったら消音する。
(6)NON:楽音の発生開始を指示するノートオンをセットするレジスタである。
(1) WA: The virtual page address of the second page Wx (1) + Inf of the waveform data Wavex to be read by the corresponding channel in the NAND flash memory 125 described with reference to FIG. 2B is set.
(2) PA: The address of the first page Wx (0) of the waveform data Wavex to be read by the channel in the preload area 302 of the waveform memory 126 described with reference to FIG. When the system is started up, the first pages W1 (0), W2 (0),... Of all waveform data Wave1, Wave2,... In the NAND flash memory 125 are stored in the preload area 302.
(3) BA: Addresses of a pair of double buffers Bna and Bnb corresponding to the ch in the buffer area 303 of the waveform memory 126 described with reference to FIG.
(4) F: Set the F number. The F number has an integer part and a decimal part, and is a parameter for shifting the pitch of the waveform data to be read. The value is determined according to the pitch (pitch) of the musical sound to be generated. That is, the value of the F number is set to “1” when it is not necessary to shift from the pitch of the waveform data, is set to a value larger than “1” when it is desired to increase the pitch, and is smaller than “1” when it is desired to decrease the pitch. Value.
(5) IL, HT, 1DR, 1DL, 2DR, 2DL, RR: registers for setting parameters for controlling the envelope of a musical sound. IL indicates an initial level, and HT indicates a hold time. These are parameters for instructing to continuously output the initial level IL as an envelope waveform in the time interval from the start of musical sound generation to the hold time HT. The waveform data prepared in the NAND flash memory 125 is waveform data that can produce a realistic musical sound by using the volume change in the original sampling waveform as it is for the rising portion. In view of this, the initial level IL is used as an envelope waveform in the time period corresponding to the hold time HT at the rising edge. 1DR is the 1st decay rate, and 1DL is the 1st decay level. This is a parameter for outputting an envelope waveform that reaches the target value 1st decay level 1DL at the rate of change of the 1st decay rate 1DR after the hold time HT. The same applies to the 2nd decay rate 2DR and the 2nd decay level 2DL, which are parameters for outputting an envelope waveform that reaches the target value 2nd decay level 2DL at the rate of change of the 2nd decay rate 2DR after the 1st decay. When note-off comes after 2nd decay, the volume level is gradually reduced at the rate of change of the release rate RR. Mute the sound when the volume level is below the specified level.
(6) NON: A register for setting note-on instructing the start of generation of musical sound.

CPU101が、あるchに対応する制御レジスタ502にノートオンNONも含めて上記パラメータをセットすると、音源部114は当該chにおける楽音発生の処理を開始する。なお、図5の音源部114内に示されている各種パラメータは、それぞれ、その時点で処理中のchのパラメータを示している。すなわち、処理するchが変われば、それに応じてパラメータの値も変化する。   When the CPU 101 sets the above parameters including the note-on NON in the control register 502 corresponding to a certain channel, the sound source unit 114 starts processing for generating a musical sound in that channel. Note that the various parameters shown in the sound source unit 114 in FIG. 5 indicate the parameters of the channel being processed at that time. That is, if the ch to be processed changes, the parameter value changes accordingly.

以下、音源部114等の各ブロックにおける1ch分の処理を説明する。同様の処理が、各DAC毎に、時分割で全128chに対して行われ、複数の楽音が並行して生成される。   Hereinafter, processing for one channel in each block such as the sound source unit 114 will be described. A similar process is performed on all 128 channels in a time division manner for each DAC, and a plurality of musical sounds are generated in parallel.

ピッチカウンタ504には、ノートオンNONおよびFナンバが入力する。ピッチカウンタ504は、ノートオン時点でゼロリセットされ、その後、1DAC毎にFナンバを累算する。この累算値は、整数部アドレスと小数部アドレスとして出力される。累算値の整数部の下位10ビットを除いたデータ(「整数部上位ビット」と呼ぶ)は、VPアドレス発生部505およびPBアドレス発生部506に入力する。累算値の整数部の下位10ビット(「整数部下位10ビット」と呼ぶ)は読出部507に入力する。累算値の小数部は、補間部508に入力する。ピッチカウンタ504は、所定のタイミングで転送指示信号をVPアドレス発生部505および転送待ちキュー521に出力する。上述の整数部や小数部の時間変化や転送指示のタイミング等については図6で詳しく説明する。ピッチカウンタ504は、ノートオフ後も累算を続けるが、そのchの楽音生成処理が停止されると累算を停止する。   Note-on NON and F number are input to the pitch counter 504. The pitch counter 504 is reset to zero at the time of note-on, and thereafter accumulates the F number every 1 DAC. This accumulated value is output as an integer part address and a decimal part address. Data excluding the lower 10 bits of the integer part of the accumulated value (referred to as “integer part upper bits”) is input to the VP address generator 505 and the PB address generator 506. The lower 10 bits of the integer part of the accumulated value (referred to as “integer part lower 10 bits”) are input to the reading unit 507. The decimal part of the accumulated value is input to the interpolation unit 508. The pitch counter 504 outputs a transfer instruction signal to the VP address generation unit 505 and the transfer queue 521 at a predetermined timing. The time change of the integer part and the decimal part, the timing of the transfer instruction, and the like will be described in detail with reference to FIG. The pitch counter 504 continues to accumulate after note-off, but stops accumulating when the tone generation processing for that channel is stopped.

PBアドレス発生部506は、上記制御レジスタの(2)と(3)で説明したアドレスPA(発音開始直後に読出すべき波形メモリ126のプリロード領域302の先頭ページのアドレス(図3(a)))とBA(波形メモリ126の当該chに対応するバッファアドレス(図3(a)))を入力し、PBアドレスを読出部507に出力する。PBアドレスは、波形メモリ126中の読出すべき領域の先頭を指定するための上位アドレスである(実際にはPBアドレスは上位部分のみであるので、このPBアドレスの下位に10ビット分の0を付けたアドレスが波形メモリ126中の読出すべき領域の先頭を指定する絶対アドレスになる)。具体的には、PBアドレス発生部506は、発音開始直後はPAをPBアドレスとして出力し、該PAで指定された波形メモリ126のプリロード領域302の先頭ページの波形サンプルデータを読み終えたら、BAをPBアドレスとして出力し、該BAで指定された波形メモリ126のバッファ領域303の当該chに対応するバッファBia(iはch番号)の波形サンプルデータを読み終えたら、BA+1をPBアドレスとして出力し(上述したようにBAは下位10ビット以下を除いた上位部分であるので、BA+1はバッファBibを指すことになる)、該BA+1で指定された波形メモリ126のバッファ領域303の当該chに対応するバッファBibの波形サンプルデータを読み終えたら、再びBAをPBアドレスとして出力し、以後、バッファBiaとBibを交互に読出すようにBAとBA+1を交互にPBアドレスとして出力する。このようなPBアドレスの下位に、ピッチカウンタ504から出力される整数部下位10ビットを付加し、読出しアドレス(絶対アドレス)が生成される。読出部507は、メモリI/F112を介して波形メモリ126から、該読出しアドレスで当該chの波形サンプルデータを読出す。ここでは該読出しアドレスの波形サンプルとその次の波形サンプルの2サンプルを読出すものとする。なお、波形メモリ126のデータ長は1ワードであり、各アドレスには1サンプルの波形データが記憶されている。   The PB address generation unit 506 reads the address PA described in (2) and (3) of the control register (the address of the first page of the preload area 302 of the waveform memory 126 to be read immediately after the start of sound generation (FIG. 3A) ) And BA (buffer address corresponding to the channel of the waveform memory 126 (FIG. 3A)) are input, and the PB address is output to the reading unit 507. The PB address is an upper address for designating the head of the area to be read in the waveform memory 126 (in reality, since the PB address is only the upper part, 0 for 10 bits is set below the PB address. The assigned address becomes an absolute address designating the head of the area to be read in the waveform memory 126). Specifically, the PB address generator 506 outputs PA as the PB address immediately after the start of sound generation, and after reading the waveform sample data of the first page of the preload area 302 of the waveform memory 126 designated by the PA, Is output as the PB address, and after reading the waveform sample data of the buffer Bia (i is the ch number) corresponding to the channel in the buffer area 303 of the waveform memory 126 designated by the BA, BA + 1 is output as the PB address. (As described above, since BA is an upper part excluding the lower 10 bits or less, BA + 1 indicates the buffer Bib), and corresponds to the corresponding channel of the buffer area 303 of the waveform memory 126 designated by BA + 1. After reading the waveform sample data in the buffer Bib, BA is output as the PB address again. And, thereafter, it is output as PB address alternately BA and BA + 1 as read alternately buffer Bia and Bib. The lower 10 bits of the integer part output from the pitch counter 504 are added to the lower order of such a PB address to generate a read address (absolute address). The reading unit 507 reads the waveform sample data of the channel at the read address from the waveform memory 126 via the memory I / F 112. Here, it is assumed that two samples of the waveform sample at the read address and the next waveform sample are read out. The data length of the waveform memory 126 is one word, and one sample of waveform data is stored at each address.

補間部508は、1DAC毎に、読出された2サンプルの間を小数部アドレス(ピッチカウンタ504から出力されたもの)に応じて2点補間(直線補間)して、1つの補間サンプルを算出する。楽音生成処理が停止されたchについては、補間サンプル「0」を出力する。   The interpolation unit 508 calculates one interpolation sample by performing two-point interpolation (linear interpolation) between two read samples for each DAC according to the decimal part address (output from the pitch counter 504). . For the channel for which the tone generation process has been stopped, the interpolation sample “0” is output.

振幅エンベロープジェネレータ(EG)503は、当該chのエンベロープ波形生成用のパラメータに基づいて、振幅エンベロープ(AE)波形を生成し、音量制御部509に出力する。音量制御部509は、1DAC毎に、補間サンプルの振幅をAE波形の値に基づいて制御し、当該chの楽音サンプルとして出力する。累算部510は、1DAC毎に、全chの各楽音サンプルを累算し、全chを混合した結果の楽音サンプルとして出力する。なお、不図示の効果付与部でリバーブその他の効果を付与して出力しても良い。   The amplitude envelope generator (EG) 503 generates an amplitude envelope (AE) waveform based on the parameters for generating the envelope waveform of the channel and outputs the amplitude envelope (AE) waveform to the volume control unit 509. For each DAC, the volume control unit 509 controls the amplitude of the interpolation sample based on the value of the AE waveform and outputs it as a musical sound sample of the channel. The accumulating unit 510 accumulates each tone sample for all channels for each DAC and outputs the tone sample as a result of mixing all channels. It should be noted that reverberation and other effects may be imparted and output by an effect imparting unit (not shown).

ピッチカウンタ504から出力された整数部上位ビットは、VPアドレス発生部505およびPBアドレス発生部506に入力する。VPアドレス発生部505には、NAND型フラッシュメモリ125中の当該chで読出している波形データの第2仮想ページアドレスWAが入力する(図2(b))。VPアドレス発生部505は、入力したデータに基づいてVPアドレスを生成する。VPアドレスは、NAND型フラッシュメモリ125の波形データの当該chで次に読出すべきページを特定する仮想ページアドレスである。ノートオン直後で音源114が波形メモリ126のプリロード領域302のアドレスPAで特定されるページから波形サンプルを読出している間にフラッシュメモリ125から読出すべきページはアドレスWAで特定されるフラッシュメモリ125上のページであるから、このときのVPアドレスはWAである。図2で説明したように、波形データは仮想ページアドレス空間で連続したページに格納されているから、これ以降、VPアドレスは、WA+1,WA+2,WA+3,…と推移していく。VPアドレスの変化については、図6で詳しく説明する。   The integer part upper bits output from the pitch counter 504 are input to the VP address generator 505 and the PB address generator 506. The VP address generation unit 505 receives the second virtual page address WA of the waveform data read by the channel in the NAND flash memory 125 (FIG. 2B). The VP address generation unit 505 generates a VP address based on the input data. The VP address is a virtual page address that specifies the next page to be read in the channel of the waveform data of the NAND flash memory 125. The page to be read from the flash memory 125 is on the flash memory 125 specified by the address WA while the sound source 114 is reading the waveform sample from the page specified by the address PA of the preload area 302 of the waveform memory 126 immediately after the note-on. VP address at this time is WA. As described with reference to FIG. 2, since the waveform data is stored in continuous pages in the virtual page address space, the VP address subsequently changes as WA + 1, WA + 2, WA + 3,. The change of the VP address will be described in detail with reference to FIG.

また、モード1の場合、VPアドレス発生部505は、転送指示が入力される毎に、メモリI/F112を介して波形メモリ126のアドレス変換テーブル301にアクセスし、その時点でのVPアドレスに対応する実ページアドレスを求め、該実ページアドレスを波形メモリ126上の当該chのNPAiに書込む。従って、モード1の場合は、VPアドレス発生部505が「次ページアドレス設定部」として機能する。モード2の場合、VPアドレス発生部505は、第1回目のVPアドレス(その値がWAのときが第1回目であり、初回の転送指示のときである)に対しては、上記モード1と同様にアドレス変換テーブル301を参照し、該VPアドレスに対応する実ページアドレスを求め、該実ページアドレスを波形メモリ126上の当該chのNPAiに書込む。モード2の場合は、それ以降、VPアドレスがWA+1,WA+2,WA+3,…と推移した場合の当該chのNPAiの設定は、B→M転送部110で行うので、VPアドレス発生部505では行わない。従って、モード2の場合、(第1回目を除き、)B→M転送部110が「次ページアドレス設定部」として機能する。波形メモリ126のNPAに設定するアドレスの変化については、図6などで詳しく説明する。   In mode 1, the VP address generation unit 505 accesses the address conversion table 301 of the waveform memory 126 via the memory I / F 112 every time a transfer instruction is input, and corresponds to the VP address at that time. The real page address to be obtained is obtained, and the real page address is written in the NPAi of the channel on the waveform memory 126. Therefore, in mode 1, the VP address generation unit 505 functions as a “next page address setting unit”. In the case of mode 2, the VP address generation unit 505 performs the above-described mode 1 for the first VP address (when the value is WA, the first time is the first transfer instruction). Similarly, referring to the address conversion table 301, a real page address corresponding to the VP address is obtained, and the real page address is written in the NPAi of the channel on the waveform memory 126. In the case of mode 2, the setting of the NPAi of the corresponding channel when the VP address changes as WA + 1, WA + 2, WA + 3,... Is performed by the B → M transfer unit 110 and is not performed by the VP address generation unit 505. . Therefore, in the case of mode 2, the B → M transfer unit 110 functions as a “next page address setting unit” (except for the first time). The change of the address set in the NPA of the waveform memory 126 will be described in detail with reference to FIG.

転送待ちキュー521は、先入れ先出しのキューである。ピッチカウンタ504から転送指示が出力されたとき、転送待ちキュー521は、VPアドレス発生部505から出力されるch番号を取り込んでキューに登録する。そのタイミングについては、図6で詳しく説明する。転送待ちキュー521に登録されたch番号は、要するに、当該ch番号のchについて、その時点で波形メモリ126から読出し再生しているページデータの読出しが終わるまでに、波形メモリ126の当該chのNPAiに設定されている実ページアドレスのページデータをNAND型フラッシュメモリ125から転送バッファ109経由で波形メモリ126に転送しておく必要がある、ということを意味している。図4で説明した、F→B転送部108による転送とB→M転送部110による転送とは、転送待ちキュー521から順次出力されるch番号をトリガとして実行される。複数のch番号が登録されている場合、転送待ちキュー521からは、先に登録されたch番号から順番にch番号が出力され、それに応じて、F→B転送部108とB→M転送部110とは、それぞれ、該出力されたch番号に応じた転送を実行する。   The transfer waiting queue 521 is a first-in first-out queue. When a transfer instruction is output from the pitch counter 504, the transfer queue 521 takes in the channel number output from the VP address generator 505 and registers it in the queue. The timing will be described in detail with reference to FIG. In short, the channel number registered in the transfer queue 521 is the NPAi of the channel in the waveform memory 126 until the page data read from the waveform memory 126 at that time is read for the channel of the channel number. This means that it is necessary to transfer the page data at the actual page address set to “1” from the NAND flash memory 125 to the waveform memory 126 via the transfer buffer 109. The transfer performed by the F → B transfer unit 108 and the transfer performed by the B → M transfer unit 110 described with reference to FIG. When a plurality of channel numbers are registered, the transfer queue 521 outputs the channel numbers in order from the previously registered channel number, and accordingly, the F → B transfer unit 108 and the B → M transfer unit. 110 performs transfer according to the output channel number.

F→B転送指示部522は、NAND型フラッシュメモリ125から転送バッファ109へのページデータの転送が行われていないとき、転送待ちキュー521からch番号iを取り出し、F→B転送部108にそのch番号iを送って、NAND型フラッシュメモリ125中の次に読出すべきページデータを転送バッファ109へ転送する指示を出す。この指示に応じて、F→B転送部108は、メモリI/F112経由で波形メモリ126の当該ch番号iの次ページアドレスNPAiを読出し、フラッシュメモリ125にその次ページアドレスNPAiを指定した読出し命令を出力する。該読出し命令に応じて、フラッシュメモリ125から1ページデータ(2112バイト)がバースト転送されるので、F→B転送部108は、その転送データを転送バッファ109へ書込む。これにより、図4の「NAND型フラッシュ→転送バッファ」のタイムチャートで説明した1ページデータの転送(付番411〜413)が行われる。   When page data is not transferred from the NAND flash memory 125 to the transfer buffer 109, the F → B transfer instruction unit 522 extracts the channel number i from the transfer waiting queue 521 and sends it to the F → B transfer unit 108. The channel number i is sent, and an instruction to transfer the page data to be read next in the NAND flash memory 125 to the transfer buffer 109 is issued. In response to this instruction, the F → B transfer unit 108 reads out the next page address NPAi of the channel number i in the waveform memory 126 via the memory I / F 112, and a read instruction designating the next page address NPAi in the flash memory 125. Is output. In response to the read command, one page data (2112 bytes) is burst transferred from the flash memory 125, so the F → B transfer unit 108 writes the transfer data into the transfer buffer 109. As a result, the one-page data transfer (numbered 411 to 413) described in the time chart of “NAND flash → transfer buffer” in FIG. 4 is performed.

また、F→B転送指示部522は、F→B転送部108に転送指示を出したとき、B→M転送指示部523に対して該転送指示とch番号を伝える。B→M転送指示部523は、この転送指示を受けて、B→M転送部110に当該ch番号と転送指示を出力し、B→M転送部110が転送バッファ109のページデータ(データエリアの2048バイト)を波形メモリ126の当該chに対応するバッファにバースト転送するように制御する。B→M転送部110は、B→M転送指示部523からch番号と転送指示を受けると、その転送指示のタイミングから2DAC周期後の1DAC周期の区間で、音源114による波形メモリ126のアクセス期間(図4の421)の後に、転送バッファ109にページデータのアドレスを指定した読出し命令を出力する。これにより、転送バッファ109から当該ページデータのうちの先頭の256ワードがバースト転送されてくるので、その転送データを波形メモリ126の当該chのバッファ領域へ図4の422に示したように書込む。さらに、引き続く256ワード×3ブロックのデータについても、B→M転送部110の制御の元で、引き続く3DACの区間を利用して、バースト転送により波形メモリ126の当該chのバッファ領域へ書込む。以上により、図4の「転送バッファ→波形メモリ」のタイムチャートで説明した転送バッファ109から波形メモリ126のバッファ領域へのバースト転送(付番422)が行われる。また、モード2の場合、B→M転送部110は、転送バッファ中のデータの「次ページへのポインタNP」を、波形メモリ126の当該chiのNPAiに書込む処理を行う。このNPAiへの書込み処理は、図4の区間425のタイミング(ただし、エラー訂正書込みが行われる前とする)で行う。   Further, when the F → B transfer instruction unit 522 issues a transfer instruction to the F → B transfer unit 108, the F → B transfer instruction unit 522 transmits the transfer instruction and the ch number to the B → M transfer instruction unit 523. Upon receiving this transfer instruction, the B → M transfer instruction unit 523 outputs the channel number and the transfer instruction to the B → M transfer unit 110, and the B → M transfer unit 110 outputs the page data (data area of the data area). 2048 bytes) is controlled to be burst transferred to the buffer corresponding to the channel of the waveform memory 126. When the B → M transfer unit 110 receives the channel number and the transfer instruction from the B → M transfer instruction unit 523, the access period of the waveform memory 126 by the sound source 114 in a period of 1 DAC cycle after 2 DAC cycles from the timing of the transfer instruction. After (421 in FIG. 4), a read command specifying the address of the page data is output to the transfer buffer 109. As a result, the first 256 words of the page data are burst-transferred from the transfer buffer 109, and the transfer data is written to the buffer area of the channel of the waveform memory 126 as shown at 422 in FIG. . Further, the subsequent 256 word × 3 block data is also written into the buffer area of the corresponding channel in the waveform memory 126 by burst transfer using the subsequent 3DAC section under the control of the B → M transfer unit 110. As described above, burst transfer (numbered 422) from the transfer buffer 109 to the buffer area of the waveform memory 126 described in the time chart of “transfer buffer → waveform memory” in FIG. 4 is performed. In the case of mode 2, the B → M transfer unit 110 performs a process of writing the “next page pointer NP” of the data in the transfer buffer to the NPAi of the chi in the waveform memory 126. This writing process to NPAi is performed at the timing of section 425 in FIG. 4 (but before error correction writing is performed).

なお、転送バッファ→波形メモリのバースト転送で、256ワードを当該chの波形メモリ126のバッファ領域に転送する際、当該chのバッファはBia,Bibの2つあり、どちらに転送するかを決めておく必要がある。本実施形態のシステムでは、その時点で、当該chについて波形メモリ126のプリロード領域302またはバッファBia,Bibの何れかから波形サンプルの音源114による読出しが行われているはずであるから、プリロード領域302またはバッファBiaから読出しが行われているならバッファBibをバースト転送先とし、バッファBibから読出しが行われているならバッファBiaをバースト転送先としている。   Note that when 256 words are transferred to the buffer area of the waveform memory 126 of the corresponding channel by burst transfer from the transfer buffer to the waveform memory, there are two buffers of the corresponding channel, Bia and Bib. It is necessary to keep. In the system of the present embodiment, at that time, the waveform sample should be read from the preload area 302 of the waveform memory 126 or one of the buffers Bia and Bib by the sound source 114 for the corresponding channel. Alternatively, if reading from the buffer Bia is performed, the buffer Bib is set as the burst transfer destination, and if reading is performed from the buffer Bib, the buffer Bia is set as the burst transfer destination.

エラー訂正部111は、上述のNAND型フラッシュ→転送バッファの転送が行われているとき、その転送データを解析し、図4の431に示したエラー訂正演算処理を実行する。付加情報INFの転送413まで終了したら、エラー訂正部111は、該転送データに関する、エラー発生の有無と、エラーが有った場合のエラー訂正の可否と、エラー訂正が可の場合のエラー訂正箇所とを確定する。エラーが有りそのエラーが訂正可でその訂正箇所が算出された場合、エラー訂正部111は、図4の区間425で、メモリI/F112経由で波形メモリ126の当該訂正箇所の訂正命令を発行しエラー訂正を実行する。モード2の場合は、NPAiもエラー訂正の対象になるので、このエラー訂正でNPAiが訂正されることがある。   The error correction unit 111 analyzes the transfer data when the NAND flash → transfer buffer transfer is performed, and executes the error correction calculation process indicated by 431 in FIG. 4. When the transfer to the additional information INF transfer 413 is completed, the error correction unit 111 determines whether or not an error has occurred with respect to the transfer data, whether or not there is an error, and whether or not the error correction is possible. And confirm. If there is an error and the error can be corrected and the correction location is calculated, the error correction unit 111 issues a correction instruction for the correction location in the waveform memory 126 via the memory I / F 112 in the section 425 of FIG. Perform error correction. In the case of mode 2, since NPAi is also subject to error correction, NPAi may be corrected by this error correction.

エラー訂正部111は、訂正可のエラーが発生した旨を示すエラー訂正情報をエラー検出部524に出力する(点線541)。同様に、エラーが有りそのエラーが訂正不可である場合、エラー訂正部111は、訂正不可のエラーが発生した旨を示すエラー訂正情報をエラー検出部524に出力する(点線541)。なお、訂正が可/不可いずれの場合も、エラー訂正情報には、エラーが発生したフラッシュメモリ125上の実ページアドレスを含めるものとする。   The error correction unit 111 outputs error correction information indicating that a correctable error has occurred to the error detection unit 524 (dotted line 541). Similarly, when there is an error and the error cannot be corrected, the error correction unit 111 outputs error correction information indicating that an uncorrectable error has occurred to the error detection unit 524 (dotted line 541). In both cases where correction is possible / impossible, the error correction information includes the actual page address on the flash memory 125 where the error has occurred.

エラー検出部524は、エラー訂正部111からのエラー訂正情報を入力する。訂正可のエラー訂正情報が入力した場合、エラー検出部524は、該エラー訂正情報をCPU101に通知する(点線542)。訂正不可のエラー訂正情報が入力した場合、エラー検出部524は、振幅EG503に対して当該chのフォースダンプを指示して当該chの楽音を急速減衰させる(点線545)とともに、該エラー訂正情報をCPU101に通知する(点線542)。   The error detection unit 524 inputs the error correction information from the error correction unit 111. When correctable error correction information is input, the error detection unit 524 notifies the CPU 101 of the error correction information (dotted line 542). When error correction information that cannot be corrected is input, the error detection unit 524 instructs the amplitude EG 503 to perform a force dump of the channel to rapidly attenuate the tone of the channel (dotted line 545), and also outputs the error correction information. The CPU 101 is notified (dotted line 542).

エラー検出部524には、読出部507から、現在音源114が読出しを実行している波形メモリ126上のバッファ領域を特定するアドレスであるPBアドレス(これを「読出PBアドレス」と呼ぶ)が入力する(点線544)。また、エラー検出部524には、B→M転送部110から、現在転送バッファ109からの転送の転送先となっている波形メモリ126上のバッファ領域を特定するアドレス(これを「転送中PBアドレス」と呼ぶ)と該転送が終了したときその旨を示す転送済み信号が入力する(点線543)。あるchについて、波形メモリ126上のバッファBiaとBibを用いた転送と読出しが正常に行われている場合、いま読出PBアドレスがBiaである状態とすると、次に転送中PBアドレスがBibとなって転送が始まり、その転送が終了して転送済み信号が入力し、次に読出PBアドレスがBibとなってBibからの読出しが開始し、次に転送中PBアドレスがBiaとなって転送が始まり、その転送が終了して転送済み信号が入力し、次に読出PBアドレスがBiaとなってBiaからの読出しが開始し、…というように処理が進むはずである。もし何らかの理由で転送が間に合わないと、転送中PBアドレスがBibの状態からその転送済み信号が発生する前に読出PBアドレスがBibとなる、または、転送中PBアドレスがBiaの状態からその転送済み信号が発生する前に読出PBアドレスがBiaとなってしまう。エラー検出部524は、このような転送エラーのチェックを行い、転送エラーが発生したときには、点線545に示すように、振幅EG503に対して当該chの強制的なダンプ(フォースダンプ)を指示して当該chの楽音を急速減衰させる。また、エラー検出部524は、上記転送エラーが発生した旨をそのch番号とともにCPU101に通知する(点線542)。   The error detection unit 524 receives from the reading unit 507 a PB address (referred to as a “read PB address”) that is an address for specifying the buffer area on the waveform memory 126 that the sound source 114 is currently reading. (Dotted line 544). Further, the error detection unit 524 sends an address for identifying the buffer area on the waveform memory 126 that is the transfer destination of the transfer from the transfer buffer 109 from the B → M transfer unit 110 (this is referred to as the “PB address being transferred”). When the transfer is completed, a transferred signal indicating that is input (dotted line 543). If transfer and reading using the buffers Bia and Bib on the waveform memory 126 are normally performed for a certain channel, assuming that the read PB address is now Bia, the PB address being transferred next becomes Bib. The transfer starts, the transfer ends, and a transfer completed signal is input. Next, the read PB address becomes Bib and reading from the Bib starts. Next, the transfer PB address becomes Bia and the transfer starts. Then, the transfer is completed and a transferred signal is input. Next, the read PB address becomes Bia, reading from Bia starts, and so on. If the transfer cannot be made in time for some reason, the read PB address becomes Bib before the transfer complete signal is generated from the transfer PB address is Bib, or the transfer PB address is transferred from the Bia state. The read PB address becomes Bia before the signal is generated. The error detection unit 524 checks such a transfer error. When a transfer error occurs, the error detection unit 524 instructs the amplitude EG 503 to forcibly dump (force dump) the channel, as indicated by a dotted line 545. Quickly attenuates the tone of the channel. In addition, the error detection unit 524 notifies the CPU 101 that the transfer error has occurred along with the channel number (dotted line 542).

図6は、発音開始以降の各種アドレスの時間変化(1ch分)を示す。図中、「整数部下位10bits&小数部」は、図5のピッチカウンタ504で当該chのFナンバを累算した累算結果の整数部下位10ビットおよび小数部の時間変化を示す。Fナンバの累算に応じて値が増加していき、整数部下位10ビットが1023を越えたとき桁上がりが生じ、0に戻って(厳密には小数部の値が残っているので1以下の値である)再び増加する。これにより、図のような鋸歯状の変化を示す。「整数部上位bits」は、ピッチカウンタ504の整数部上位ビット(累算結果から整数部の下位10ビットおよび小数部を除いた上位部分)の時間変化を示す。発音開始直後は0であり、以後、「整数部下位10bits&小数部」の桁上がりが生じる毎に、1ずつ増加していく。   FIG. 6 shows temporal changes (for 1 ch) of various addresses after the start of sound generation. In the figure, “integer part lower 10 bits & fraction part” indicates the time change of the integer part lower 10 bits and the fraction part of the accumulation result obtained by accumulating the F number of the channel by the pitch counter 504 in FIG. The value increases as the F number accumulates, and when the lower 10 bits of the integer part exceed 1023, a carry occurs and returns to 0 (strictly, the fractional part value remains, so it is 1 or less. Increase again). As a result, a sawtooth change as shown in the figure is shown. “Integer part upper bits” indicates the time change of the integer part upper bits of the pitch counter 504 (the higher part excluding the lower 10 bits and the decimal part of the integer part from the accumulated result). Immediately after the start of sounding, it is 0, and thereafter, every time a carry of “the lower part of the integer part 10 bits & the decimal part” occurs, it increases by one.

「転送指示」は、図5のピッチカウンタ504から転送待ちキュー521に出力される転送指示信号を示す。発音開始時に付番601のように出力され、以後、当該chの「整数部下位10bits&小数部」の桁上がりが生じる毎に付番602,603のように出力される。「PBアドレス」は、図5のPBアドレス発生部506から出力される当該chのPBアドレスの時間変化を示す。発音開始直後はPBアドレスとしてPA(波形メモリ126のプリロード領域302の先頭ページを指すアドレス(図3(a)))が出力され、以後は、「整数部上位bits」がカウントアップされる毎にBAとBA+1(BAは当該chに対応するバッファBiaのアドレス、BA+1は当該chに対応するバッファBibのアドレス)が交互にPBアドレスとして出力される。   “Transfer instruction” indicates a transfer instruction signal output from the pitch counter 504 of FIG. 5 to the transfer queue 521. At the start of sound generation, it is output as numbered 601 and thereafter is output as numbered 602 and 603 every time a carry of the “integer part lower 10 bits & decimal part” occurs for that channel. “PB address” indicates a time change of the PB address of the channel output from the PB address generation unit 506 in FIG. Immediately after the start of sound generation, PA (address indicating the first page of the preload area 302 of the waveform memory 126 (FIG. 3 (a))) is output as the PB address, and thereafter every time "integer part upper bits" is counted up. BA and BA + 1 (BA is the address of the buffer Bia corresponding to the channel, and BA + 1 is the address of the buffer Bib corresponding to the channel) are alternately output as the PB address.

「VPアドレス」は、図5のVPアドレス発生部505が内部的に生成する当該chのVPアドレスの時間変化を示す。発音開始直後は、次に波形メモリ126に読出しておくべきページは、当該波形データの第2ページアドレスWAで指されるページであるから(図2(b))、VPアドレスとしてWAが出力され、以後は、「整数部上位bits」がカウントアップされる毎に1ずつ増加していく。VPアドレス発生部505は、当該chの転送指示が来る毎に、当該chのWAに当該chの「整数部上位bits」の値を加算して当該chのVPアドレスを生成する。なお、波形データは仮想ページアドレスで連続するページに順に格納されているので、VPアドレスは、転送指示が来る毎にWAからインクリメントして生成してもよい。図2(b)の例で言えば、WAで第2ページW2(1)+Infを指し、WA+1で第3ページW2(2)+Infを指し、…という対応となる。   “VP address” indicates the time change of the VP address of the channel, which is internally generated by the VP address generation unit 505 in FIG. Immediately after the start of sound generation, the next page to be read into the waveform memory 126 is the page pointed to by the second page address WA of the waveform data (FIG. 2B), so WA is output as the VP address. Thereafter, each time “integer part upper bits” is counted up, it is incremented by one. Each time a transfer instruction for the channel is received, the VP address generation unit 505 adds the value of the “integer part upper bits” of the channel to the WA of the channel to generate a VP address of the channel. Since the waveform data is sequentially stored in successive pages with virtual page addresses, the VP address may be generated by incrementing from WA each time a transfer instruction is received. In the example of FIG. 2B, WA indicates the second page W2 (1) + Inf, WA + 1 indicates the third page W2 (2) + Inf, and so on.

「P1アドレス(モード1)」は、モード1の場合に、VPアドレス発生部505が各時間区間で生成する仮想ページアドレスである当該chのVPアドレスに対応する実ページアドレスを示す。モード1の場合、仮想ページアドレスに対応する実ページアドレスはアドレス変換テーブル301を参照して求めるのが基本的な処理である。PBアドレス=PAで当該chの先頭ページWx(0)の波形サンプルを音源114が読出している間は、次にフラッシュメモリ125から読出すべきページの仮想ページアドレスであるVPアドレスはWAで与えられているから、VPアドレス発生部505は、アドレス変換テーブル301を参照してWAに対応する実ページアドレスT(WA)を求め、該実ページアドレスを波形メモリ126の当該chのNPAiに書込む。なお、T(*)はアドレス変換テーブル301により求めた仮想ページアドレス*に対応する実ページアドレスを示す。同様にして、VPアドレス発生部505は、転送指示がある毎に、VPアドレスWA+1,WA+2,…に対応する実ページアドレスを求めて、波形メモリ126のNPAiに設定する。   “P1 address (mode 1)” indicates a real page address corresponding to the VP address of the channel, which is a virtual page address generated by the VP address generation unit 505 in each time interval in the case of mode 1. In the case of mode 1, the basic process is to obtain the real page address corresponding to the virtual page address with reference to the address conversion table 301. While the sound source 114 is reading the waveform sample of the first page Wx (0) of the ch with PB address = PA, the VP address that is the virtual page address of the page to be read next from the flash memory 125 is given by WA. Therefore, the VP address generation unit 505 obtains the real page address T (WA) corresponding to WA with reference to the address conversion table 301 and writes the real page address in the NPAi of the corresponding channel in the waveform memory 126. T (*) indicates a real page address corresponding to the virtual page address * obtained from the address conversion table 301. Similarly, every time there is a transfer instruction, the VP address generation unit 505 obtains real page addresses corresponding to the VP addresses WA + 1, WA + 2,... And sets them in the NPAi of the waveform memory 126.

「P2アドレス(モード2)」は、モード2の場合に、VPアドレス発生部505が各時間区間で生成する当該chのVPアドレスに対応する実ページアドレスを示す。モード2の場合、フラッシュメモリ125から読出したページの付加情報Inf内の「次ページへのポインタNP」を辿って次に読出すべき実ページアドレスを取得するのが基本的な処理である。PBアドレス=PAで当該chの先頭ページWx(0)の波形サンプルを音源114が読出している間は、次にフラッシュメモリ125から読出すべきページの仮想ページアドレスであるVPアドレスはWAで与えられているから、VPアドレス発生部505は、アドレス変換テーブル301を参照してWAに対応する実ページアドレスT(WA)を求め、該実ページアドレスを波形メモリ126の当該chのNPAiに書込む。後述する転送実行タイミング611で当該実ページアドレスNPAiのページデータがフラッシュメモリ125から読出されて波形メモリ126のバッファに格納されるが、このときB→M転送部110は、転送バッファ109に読出されたページデータの付加情報Inf中の「次ページへのポインタNP」を波形メモリ126の当該chのNPAiに設定する。このNPAiに設定された「次ページへのポインタNP」が、次のVPアドレス=WA+1に対応する実ページアドレスとなる。次の転送指示602でVPアドレス=WA+1と更新されたときには、既に当該chのNPAiの設定は済んでいることになる。以下同様にして、各転送実行タイミング612,613,…で実行される転送において、「次ページへのポインタNP」が波形メモリ126のNPAiに設定され、これにより実質的に各VPアドレスに対応する実ページアドレスがNPAiに設定されるようにしている。   “P2 address (mode 2)” indicates a real page address corresponding to the VP address of the channel that the VP address generation unit 505 generates in each time interval in the case of mode 2. In the case of mode 2, the basic process is to acquire the actual page address to be read next by following the “pointer NP to the next page” in the page additional information Inf read from the flash memory 125. While the sound source 114 is reading the waveform sample of the first page Wx (0) of the ch with PB address = PA, the VP address that is the virtual page address of the page to be read next from the flash memory 125 is given by WA. Therefore, the VP address generation unit 505 obtains the real page address T (WA) corresponding to WA with reference to the address conversion table 301 and writes the real page address in the NPAi of the corresponding channel in the waveform memory 126. The page data of the actual page address NPAi is read from the flash memory 125 and stored in the buffer of the waveform memory 126 at a transfer execution timing 611 described later. At this time, the B → M transfer unit 110 is read to the transfer buffer 109. “Pointer NP to next page” in the additional information Inf of the page data is set to the NPAi of the channel in the waveform memory 126. The “next page pointer NP” set in this NPAi becomes the actual page address corresponding to the next VP address = WA + 1. When VP address = WA + 1 is updated in the next transfer instruction 602, the NPAi of the channel has already been set. In the same manner, in the transfer executed at each transfer execution timing 612, 613,..., The “next page pointer NP” is set in the NPAi of the waveform memory 126, thereby substantially corresponding to each VP address. The real page address is set to NPAi.

「転送実行タイミング」は、当該chに関して、図5のF→B転送指示部522およびB→M転送指示部523からの指示に応じて、F→B転送部108及びB→M転送部110が、図4で説明した転送を実際に実行するタイミングを示す。先述したように、F→B転送部およびB→M転送部による転送は、転送待ちキュー521にch番号が登録された順に実行されるので、転送指示601が出力され、転送待ちキュー521に当該chのch番号が登録されたとしても、その時点で他のchのch番号が転送待ちキュー521に登録されていれば、登録されているch番号に応じた転送が全て実行された後に、少し遅れた付番611のタイミングで当該chのch番号が転送待ちキュー521から出力され、対応する転送が行われる。同様に、転送指示602で転送待ちキュー521に登録されたch番号の転送は付番612で、転送指示603で転送待ちキュー521に登録されたch番号の転送は付番613で、…というように、転送指示から少し遅れて転送が実行される。その遅れは、他のchで実行されている転送の混み具合によるので、一定ではない。もちろん、転送指示601で転送待ちキュー521に登録した転送は転送指示602が来る前に実行し、転送指示602で転送待ちキュー521に登録した転送は転送指示603が来る前に実行し、…というように、次の転送指示が来る前に実行する必要はある。   The “transfer execution timing” is determined by the F → B transfer unit 108 and the B → M transfer unit 110 in accordance with instructions from the F → B transfer instruction unit 522 and the B → M transfer instruction unit 523 in FIG. FIG. 4 shows the timing for actually executing the transfer described in FIG. As described above, since the transfer by the F → B transfer unit and the B → M transfer unit is executed in the order in which the channel numbers are registered in the transfer waiting queue 521, the transfer instruction 601 is output and the transfer waiting queue 521 Even if the channel number of the channel is registered, if the channel number of another channel is registered in the transfer waiting queue 521 at that time, a little after the transfer according to the registered channel number is executed. At the timing of the delayed number 611, the channel number of the channel is output from the transfer queue 521, and the corresponding transfer is performed. Similarly, the transfer of the channel number registered in the transfer queue 521 by the transfer instruction 602 is assigned number 612, the transfer of the channel number registered in the transfer queue 521 by the transfer instruction 603 is assigned number 613, and so on. In addition, the transfer is executed with a slight delay from the transfer instruction. The delay is not constant because it depends on how busy the transfer is performed in other channels. Of course, the transfer registered in the transfer queue 521 by the transfer instruction 601 is executed before the transfer instruction 602 arrives, the transfer registered in the transfer queue 521 by the transfer instruction 602 is executed before the transfer instruction 603 arrives, and so on. Thus, it is necessary to execute before the next transfer instruction comes.

次に、波形メモリ126のアクセスに関するタイミング設計について説明する。   Next, timing design regarding access to the waveform memory 126 will be described.

本実施形態のシステムでは、1単位アクセス(フラッシュメモリ125からの1ページデータの読出し)で転送バッファ109に転送された1024サンプルを、4DACに分けて256サンプル(512バイト)ずつ転送バッファ109から波形メモリ126のバッファへバースト転送している(図4)。4DACに分けて256サンプルずつバースト転送するのは、1単位アクセスに4DACかかることに合わせたものである。1DAC周期からこのバースト転送の期間と波形メモリ126のリフレッシュの期間を除いた期間が、音源114が各発音chの楽音生成のために波形サンプルを読出す期間になる。従って、バースト転送の期間を大きく取らなければならないようなケースでは、発音chのための読出し期間を減らさないといけないので、それに応じて発音可能ch数を減らすように設計する必要がある。逆に、バースト転送の期間をもっと減らすことができれば、それに応じて発音可能ch数を増加することができる。   In the system of this embodiment, 1024 samples transferred to the transfer buffer 109 by one unit access (reading of one page data from the flash memory 125) are divided into 4 DACs, and 256 samples (512 bytes) are waveformd from the transfer buffer 109. Burst transfer is performed to the buffer of the memory 126 (FIG. 4). The burst transfer of 256 samples divided into 4 DACs is in line with the fact that 4 DACs are required for one unit access. A period obtained by excluding the burst transfer period and the refresh period of the waveform memory 126 from one DAC period is a period in which the sound source 114 reads waveform samples to generate musical sounds of each sounding channel. Therefore, in a case where a large burst transfer period must be taken, the readout period for the sounding channel must be reduced, and therefore the number of soundable channels needs to be designed accordingly. Conversely, if the burst transfer period can be further reduced, the number of soundable channels can be increased accordingly.

ここで、「帯域幅」と「全帯域幅」について説明しておく。「全帯域幅」とは、基本再生期間(1ページ分のサンプルデータをサンプリング周期ごとに1サンプルの速度で再生した場合の再生時間)にフラッシュメモリ125から読出し可能な最大ページ数(言い替えると、基本再生期間に転送指示を出すことができる回数の上限値)である。本実施形態では、基本再生期間が1024DACで、フラッシュメモリ125から1ページ読出しするのに4DACかかるので、全帯域幅は256である。「帯域幅」とは、ある1つのchで、基本再生期間に、フラッシュメモリ125から読出す最大ページ数(当該chが転送指示を出す最大回数)である。例えば、あるchにおいて、Fナンバ=1で楽音生成するなら、基本再生期間1024DACの間に1回だけ転送指示を出せば、その1回の転送で波形メモリに書込まれた1024サンプルで基本再生期間内におけるFナンバ=1の再生がまかなえるので、当該chの帯域幅は1である。もしFナンバ=2なら帯域幅は2である。もしFナンバ=1.1なら、基本再生期間の10期間分で11回の転送指示(11ページ分の転送)が必要だから、前記10期間のうちのどこかで2回の転送指示を出さなければならず、当該chの帯域幅は2となる。従って、Fナンバの小数部を切り上げた値が、そのchの帯域幅となる。また、全chの帯域幅の和が全帯域幅を越えることがないようにすることが必要である。越えてしまうと、何れかのchで発生した転送要求が処理できなくなるからである。   Here, “bandwidth” and “total bandwidth” will be described. “Total bandwidth” means the maximum number of pages that can be read from the flash memory 125 (in other words, the playback time when one page of sample data is played back at the rate of one sample for each sampling period) The upper limit of the number of times that a transfer instruction can be issued during the basic playback period). In this embodiment, the basic playback period is 1024 DAC, and it takes 4 DAC to read one page from the flash memory 125, so the total bandwidth is 256. “Bandwidth” is the maximum number of pages read from the flash memory 125 in a certain channel during the basic playback period (the maximum number of times that channel issues a transfer instruction). For example, if a tone is generated with F number = 1 in a certain channel, if a transfer instruction is issued only once during the basic playback period 1024DAC, the basic playback is performed with 1024 samples written in the waveform memory by the single transfer. Since the reproduction of F number = 1 within the period can be covered, the bandwidth of the channel is 1. If the F number = 2, the bandwidth is 2. If F number = 1.1, 11 transfer instructions (transfer of 11 pages) are required for 10 basic playback periods, so you must issue two transfer instructions somewhere in the 10 periods. The bandwidth of the channel is 2. Therefore, the value obtained by rounding up the fractional part of the F number is the bandwidth of the channel. Also, it is necessary that the sum of the bandwidths of all channels does not exceed the total bandwidth. This is because the transfer request generated in any one of the channels cannot be processed.

本実施形態のシステムでは、CPU101が各chに割り当てた帯域幅を管理する。予め各種設計条件に基づいて全帯域幅Tbwを決定しておく。また、割り当て済みの総帯域幅を示す内部変数Abwと第ichに割り当てた帯域幅を示す内部変数Cbw(i)を設けておき、CPU101は、初期設定時にこれらの内部変数を全て0に初期設定する。CPU101は、発音のためにchを割り当てるときには、該chの帯域幅bwと、全帯域幅Tbwから割り当て済み総帯域幅Abwを減算した値(空きの帯域幅を示している)とを比較し、前者が後者以下であることを確認する(前者が後者より大きければ、当該chの帯域幅を割り当てることができない)。前者が後者以下なら、割り当てる帯域幅があるということだから、割り当て済み総帯域幅Abwに該chの帯域幅bwを加算し、Cbw(i)にbwを記憶しておく。該chが消音して開放されたときには、AbwからCbw(i)を減算し、Cbw(i)を0にリセットする。このようにして、常に、割り当て済み帯域幅Abwと割り当て可能な帯域幅Tbw−Abwを管理する。本実施形態の方式では、Fナンバ上限値を制限せず、基本再生期間において全chについての単位アクセスの回数(帯域幅)の合計は上限である全帯域幅に抑えるようにしている。要するに、基本再生期間において、ピッチアップしたchについては多くの回数の単位アクセスが必要になるが、逆にピッチダウンしたchについては単位アクセスの数は減らせるので、全体として基本再生期間における単位アクセスの上限の数(全帯域幅)に抑えるようにしている。   In the system of this embodiment, the CPU 101 manages the bandwidth allocated to each channel. The total bandwidth Tbw is determined in advance based on various design conditions. Also, an internal variable Abw indicating the allocated total bandwidth and an internal variable Cbw (i) indicating the bandwidth allocated to the i th ch are provided, and the CPU 101 initially sets all these internal variables to 0 at the time of initial setting. To do. When allocating a channel for sound generation, the CPU 101 compares the bandwidth bw of the channel with a value obtained by subtracting the allocated total bandwidth Abw from the total bandwidth Tbw (indicating an available bandwidth). Confirm that the former is less than or equal to the latter (if the former is larger than the latter, the bandwidth of the channel cannot be allocated). If the former is less than or equal to the latter, it means that there is a bandwidth to be allocated. Therefore, the bandwidth bw of the channel is added to the allocated total bandwidth Abw, and bw is stored in Cbw (i). When the channel is muted and released, Cbw (i) is subtracted from Abw, and Cbw (i) is reset to zero. In this way, the allocated bandwidth Abw and the assignable bandwidth Tbw-Abw are always managed. In the system of this embodiment, the F number upper limit value is not limited, and the total number of unit accesses (bandwidth) for all channels in the basic playback period is limited to the upper limit of the entire bandwidth. In short, in the basic playback period, a large number of unit accesses are required for the pitch-up ch, but conversely, the number of unit accesses can be reduced for the pitch-down ch. To the upper limit (total bandwidth).

図7(a)は、本実施形態のシステムの電源オン時あるいはリセット時にCPU101が実行するメイン処理のフローチャートである。ステップ701で初期設定を行い、ステップ702で転送制御部113に指示してアドレス変換テーブルと各波形データの先頭ページの波形メモリ126への転送を行う。また、モード1またはモード2を示すモード情報Mをモードレジスタ501に初期設定する。図2に関連して説明したように、ここで転送されるアドレス変換テーブルは、設定されるモード情報Mに応じて異なる。すなわち、モード1の場合は、16ビット入力16ビット出力のテーブルが転送され、モード2の場合は、20ビット入力20ビット出力のテーブルが転送される。以上の初期設定処理の後、ステップ703でイベントを検出し、イベントがあるときはステップ705でそのイベント処理を実行する処理を繰り返す。   FIG. 7A is a flowchart of main processing executed by the CPU 101 when the system of the present embodiment is turned on or reset. In step 701, initialization is performed, and in step 702, the transfer control unit 113 is instructed to transfer the address conversion table and each waveform data to the waveform memory 126 on the first page. Also, mode information M indicating mode 1 or mode 2 is initialized in the mode register 501. As described with reference to FIG. 2, the address conversion table transferred here differs depending on the mode information M to be set. That is, in mode 1, a 16-bit input 16-bit output table is transferred, and in mode 2, a 20-bit input 20-bit output table is transferred. After the above initial setting process, an event is detected at step 703, and when there is an event, the process of executing the event process at step 705 is repeated.

図7(b)は、ノートオンイベント処理のフローチャートである。この処理は、CPU101が、例えばMIDI I/O124からMIDIノートオンイベントを入力したときに、ステップ705で実行する処理である。ステップ711では、入力したMIDIノートオンイベントの演奏情報に基づいて、ノートナンバとベロシティをレジスタnn,velにセットする。ステップ712では、フラッシュメモリ125中の現在選択されている音色に対応する複数の波形データの中から、nn,velに応じた1つの波形データを決定(選択)する。図1のNOR型フラッシュメモリ121には、各音色の音色データが用意されており、その音色データ中にはnn,velに応じた波形データを選択するための波形選択情報が含まれている。ステップ713では、発音chの割当てを行い、割り当てたch番号をレジスタaにセットする。   FIG. 7B is a flowchart of the note-on event process. This process is executed in step 705 when the CPU 101 inputs a MIDI note-on event from, for example, the MIDI I / O 124. In step 711, the note number and velocity are set in the registers nn and vel based on the performance information of the input MIDI note-on event. In step 712, one waveform data corresponding to nn and vel is determined (selected) from a plurality of waveform data corresponding to the currently selected tone color in the flash memory 125. In the NOR type flash memory 121 of FIG. 1, tone color data of each tone color is prepared, and the tone color data includes waveform selection information for selecting waveform data corresponding to nn and vel. In step 713, a sounding channel is assigned and the assigned channel number is set in the register a.

なお、ステップ713では、上述した帯域幅の確保を行う。すなわち、bw≦Tbw−Abwであることを確認し、Cbw(a)←bw、Abw←Abw+bwとする。bw>Tbw−Abwのとき、すなわち割り当て可能な帯域幅に割り当てるべき帯域幅が無かったときは、発音中のchから消音するchを決定し、該chの楽音を急速減衰させて該chを開放し、Abwからそのchの帯域幅を減算し、そのchのCbwを0としてから、再度、帯域幅の確保を行う。割り当てるべき空きchが無かったときは、何れかの発音中のchを消音して解放し、割り当てることができるようにする。   In step 713, the above-described bandwidth is secured. That is, it is confirmed that bw ≦ Tbw−Abw, and Cbw (a) ← bw and Abw ← Abw + bw are set. When bw> Tbw-Abw, that is, when there is no bandwidth to be allocated to the allocatable bandwidth, the channel to be silenced is determined from the currently sounding channel, and the tone of the channel is rapidly attenuated to release the channel. Then, the bandwidth of the channel is subtracted from Abw, the Cbw of the channel is set to 0, and then the bandwidth is secured again. When there is no empty channel to be assigned, any of the sounding channels is muted and released so that it can be assigned.

ステップ714では、音源114の制御レジスタ502のa chの領域に各種パラメータを設定する。ピッチシフトを制御するFナンバは、決定された波形データをピッチシフトしない場合のピッチ(セント)と、ノートナンバnnの示すピッチ(セント)との音高差(セント)から決めることができる。上述したWA,PAやエンベロープ関連のパラメータは音色データに含まれている。BAは、割り当てられたch番号から決めることができる。最後に、ステップ715で、ノートオンNONにa chの発音開始指示を書込み、処理を終了する。   In step 714, various parameters are set in the ach area of the control register 502 of the sound source 114. The F number for controlling the pitch shift can be determined from the pitch difference (cent) when the determined waveform data is not pitch-shifted and the pitch (cent) indicated by the note number nn. The above-described parameters related to WA, PA and envelope are included in the timbre data. The BA can be determined from the assigned channel number. Finally, in step 715, an ach sounding start instruction is written in note-on NON, and the process ends.

以上により、a chについてノートオンNONを含む音源レジスタにデータが設定されたので、これ以後は図1〜図6で説明した動作によりa chでの発音が行われる。この発音処理は、図1のNAND型フラッシュメモリ125から音源114に至るハードウェアで実行され、CPU101に割込みがかかることはない。   As described above, since data is set in the sound source register including note-on NON for ach, sound generation at ach is performed by the operation described with reference to FIGS. This sound generation process is executed by hardware from the NAND flash memory 125 to the sound source 114 in FIG. 1, and the CPU 101 is not interrupted.

図8(a)は、あるchの転送指示を受けたときのVPアドレス発生部505の処理を示す。この処理は、ハードウェアにより実行される処理である。ステップ801で、図6で説明したように、WAに「整数部上位bits」の値を加算してVPアドレスを生成する。ステップ802でモード1のとき、または、モード2でかつステップ803で1回目の処理のときは、ステップ804に進む。ステップ803で1回目でないときは、ステップ806に進む。ステップ804では、アドレス変換テーブル(図3(a)の301)を参照して、VPアドレスに対応する実ページアドレス(Pアドレス)を取得する。このPアドレスは、図6に示したモード1の場合のP1アドレスまたはモード2の場合の初回のP2アドレスに相当する。ステップ805では、NPAの当該ch領域NPAiに、該Pアドレスを書込む。ステップ806では、ch番号を転送待ちキュー521に出力する。   FIG. 8A shows the processing of the VP address generation unit 505 when a transfer instruction for a certain channel is received. This process is a process executed by hardware. In step 801, as described in FIG. 6, the value of “integer part upper bits” is added to WA to generate a VP address. When the mode is step 1 in step 802, or in the case of mode 2 and the first processing in step 803, the process proceeds to step 804. If it is not the first time in step 803, the process proceeds to step 806. In step 804, the real page address (P address) corresponding to the VP address is acquired with reference to the address conversion table (301 in FIG. 3A). This P address corresponds to the P1 address in the case of mode 1 or the first P2 address in the case of mode 2 shown in FIG. In step 805, the P address is written into the ch area NPAi of the NPA. In step 806, the channel number is output to the transfer queue 521.

図8(b)は、B→M転送指示部523からの転送指示を受けたときのB→M転送部110の処理(ただしエラー検出部524へ転送中PBアドレス等を出力する処理などは除く)を示す。この処理は、ハードウェアにより実行される処理である。ステップ811で、B→M転送指示部523から渡されるch番号を取得する。ステップ812で、転送バッファ109上の1ページ分の波形データ1024ワードを、256ワードずつ4回に分けて波形メモリ126の当該chのバッファ領域へ転送する。転送のタイミングは図4の422で説明したように制御する。次に、ステップ813でモード2の場合、ステップ814で、転送バッファ109上の「次ページへのポインタNP」を、波形メモリ126の当該chのNPAiに書込む。   FIG. 8B shows the processing of the B → M transfer unit 110 when it receives a transfer instruction from the B → M transfer instruction unit 523 (except for the process of outputting the PB address being transferred to the error detection unit 524, etc.). ). This process is a process executed by hardware. In step 811, the channel number passed from the B → M transfer instruction unit 523 is acquired. In step 812, 1024 words of waveform data for one page on the transfer buffer 109 are transferred to the buffer area of the channel in the waveform memory 126 in 256 words divided into four times. The transfer timing is controlled as described with reference to 422 in FIG. Next, in the case of mode 2 in step 813, in step 814, “pointer NP to next page” on the transfer buffer 109 is written to the NPAi of the channel in the waveform memory 126.

次に、エラーが発生した場合のCPU101の処理について説明する。図5のエラー訂正部111およびエラー検出部524で説明したように、本システムでは、(1)フラッシュメモリ125から読出したデータに訂正可のエラーが発生して該エラーを訂正した場合のエラー訂正情報、(2)フラッシュメモリ125から読出したデータに訂正不可のエラーが発生した旨を示すエラー訂正情報、(3)転送エラーが発生した旨を示すエラー訂正情報を、CPU101に通知する。該エラー訂正情報は、そのエラーが発生したchおよびフラッシュメモリ125の実ページアドレスを含んでいる。   Next, the processing of the CPU 101 when an error occurs will be described. As described with reference to the error correction unit 111 and the error detection unit 524 in FIG. 5, in this system, (1) error correction when a correctable error occurs in the data read from the flash memory 125 and the error is corrected. The CPU 101 is notified of information, (2) error correction information indicating that an uncorrectable error has occurred in the data read from the flash memory 125, and (3) error correction information indicating that a transfer error has occurred. The error correction information includes the channel where the error has occurred and the actual page address of the flash memory 125.

まず、上記(1)の訂正可のエラーの場合について説明する。この場合、当該chでの楽音生成は、訂正された波形データで継続される。このエラー通知を受けたCPU101は、割込処理で、当該エラーが生じた実ページアドレスをNOR型フラッシュ121に「代替待ちページ」として登録する。訂正された波形データで楽音生成は継続されるので、訂正可のエラーが発生した旨を、即時にメッセージ表示や所定音の出力などでユーザに通知することはしない。ただし、楽音生成処理が終了した後に、そのような通知を行う。通知を受けたユーザは、フラッシュメモリ125へのアクセスが無いときに、所定の操作で(あるいはバックグラウンドで自動的に)図9の「代替待ちページ」の登録が有る場合の処理を起動する。   First, the case of the correctable error (1) will be described. In this case, the tone generation at that channel is continued with the corrected waveform data. Upon receiving this error notification, the CPU 101 registers the actual page address in which the error has occurred in the NOR flash 121 as the “substitution waiting page” in the interrupt process. Since tone generation is continued with the corrected waveform data, the user is not immediately notified of the occurrence of a correctable error by displaying a message or outputting a predetermined sound. However, such notification is performed after the musical tone generation process is completed. The user who has received the notification activates processing when there is registration of the “waiting page for substitution” in FIG. 9 by a predetermined operation (or automatically in the background) when there is no access to the flash memory 125.

図9(a)は、モード1の場合のCPU101の処理である。ステップ901で、「代替待ちページ」に登録されているエラーページを含む1ブロックをフラッシュメモリ125からメモリI/F107経由で読出し、RAM103上で該ブロック内の該エラーページのデータ訂正を行う。訂正したデータにエラー訂正コードを付して、適正な1ページデータ(2112バイト)を得る。なお、エラーページだけでなく、当該ブロックの他のページについてもエラー訂正コードを用いてエラーチェックおよび訂正を行ってもよい。当該ブロック全体の適正なデータが得られたら、ステップ902で、フラッシュメモリ125上の未使用の実ブロックを1つ選択する。ステップ903で、前記訂正した1ブロック分のデータを、メモリI/F107経由で、前記選択した未使用ブロック(代替ブロックと呼ぶ)に書込む。ステップ904で、フラッシュメモリ125上のアドレス変換テーブルの前記エラーページを含む1ブロックの仮想ブロックアドレスが指す実ブロックアドレスを、前記代替ブロックの実ブロックアドレスに、変更する。以上により、エラーページを含む1ブロックを、代替ブロックで代替させることができる。   FIG. 9A shows the processing of the CPU 101 in mode 1. In step 901, one block including the error page registered in the “substitution waiting page” is read from the flash memory 125 via the memory I / F 107, and data correction of the error page in the block is performed on the RAM 103. Appropriate page data (2112 bytes) is obtained by attaching an error correction code to the corrected data. Note that not only an error page but also other pages of the block may be subjected to error check and correction using an error correction code. When appropriate data of the entire block is obtained, one unused real block on the flash memory 125 is selected in step 902. In step 903, the corrected one block of data is written into the selected unused block (referred to as a substitute block) via the memory I / F 107. In step 904, the real block address indicated by the virtual block address of one block including the error page in the address translation table on the flash memory 125 is changed to the real block address of the substitute block. As described above, one block including an error page can be replaced with a replacement block.

モード1の場合、予め、NOR型フラッシュ121(あるいはRAM103上でもよい)に、NAND型フラッシュ125内のアドレス変換テーブルと同じデータおよび未使用の実ブロックの所在を管理するための管理データを格納しておく。CPU101は、これらのデータを用いて、NAND型フラッシュ125の波形データの各ページの使用状況を常に管理している。   In the case of mode 1, the same data as the address conversion table in the NAND flash 125 and management data for managing the location of unused real blocks are stored in advance in the NOR flash 121 (or on the RAM 103). Keep it. The CPU 101 always manages the usage status of each page of the waveform data of the NAND flash 125 using these data.

図9(b)は、モード2の場合のCPU101の処理である。ステップ911で、「代替待ちページ」に登録されているエラーページをフラッシュメモリ125からメモリI/F107経由で読出し、RAM103上で該エラーページのデータ訂正を行う。訂正したデータにエラー訂正コードを付して、適正な1ページデータ(2112バイト)を得る。ステップ912で、フラッシュメモリ125上の未使用ページを1つ選択する。ステップ913で、前記訂正後のページデータを前記未使用ページ(代替ページと呼ぶ)に書込み、かつ、当該ページの前ページの「次ページへのポインタNP」が前記代替ページを指すように更新する。なお、当該エラーページがその波形データの先頭ページの場合は、前ページの「次ページへのポインタNP」を更新する代わりに、フラッシュメモリ125上のアドレス変換テーブルの前記エラーページの仮想ページアドレスが指す実ページアドレスを、前記代替ページの実ページアドレスに、変更する。以上により、エラーページを代替ページで代替させることができる。   FIG. 9B shows the processing of the CPU 101 in mode 2. In step 911, the error page registered in the “substitution waiting page” is read from the flash memory 125 via the memory I / F 107, and data correction of the error page is performed on the RAM 103. Appropriate page data (2112 bytes) is obtained by attaching an error correction code to the corrected data. In step 912, one unused page on the flash memory 125 is selected. In step 913, the corrected page data is written into the unused page (referred to as a substitute page), and the “next page pointer NP” of the previous page of the page is updated to indicate the substitute page. . If the error page is the first page of the waveform data, the virtual page address of the error page in the address conversion table on the flash memory 125 is replaced with the previous page “pointer NP to the next page” instead of updating the previous page. The real page address to be pointed is changed to the real page address of the substitute page. As described above, the error page can be replaced with the replacement page.

モード2の場合、予め、NOR型フラッシュ121(あるいはRAM103上でもよい)に、NAND型フラッシュ125内のアドレス変換テーブルと同じデータおよび未使用の実ページの所在を管理するための管理データを格納しておく。CPU101は、NOR型フラッシュ121内のアドレス変換テーブルを参照して、エラーページを含む波形データの先頭ページの実アドレスを取得でき、その先頭ページから「次ページへのポインタNP」を辿ってエラーページの前ページを特定することができる。なお、NOR型フラッシュ121に、各波形データにおける実ページの順序(ページ間のリンクの状況)を管理する管理データを設けておき、これによりエラーページの前ページを求めるようにしてもよい。また、付加情報Infに「次ページへのポインタNP」だけでなく「前ページへのポインタ」も含めるようにすれば、エラーページの前ページの実アドレスが直ぐに分かるので容易に前ページにアクセスできる。   In the case of mode 2, the same data as the address conversion table in the NAND flash 125 and management data for managing the location of unused real pages are stored in advance in the NOR flash 121 (or on the RAM 103). Keep it. The CPU 101 can obtain the actual address of the first page of the waveform data including the error page by referring to the address conversion table in the NOR flash 121, and traces the error page by following the “pointer NP to the next page” from the first page. Can specify the previous page. It should be noted that the NOR type flash 121 may be provided with management data for managing the order of actual pages (the status of links between pages) in each waveform data, thereby obtaining the previous page of the error page. If the additional information Inf includes not only the “pointer to the next page NP” but also the “pointer to the previous page”, the real address of the previous page of the error page can be immediately known, so that the previous page can be easily accessed. .

なお、NAND型フラッシュメモリは、1動作では上書きを行うことができず、書込みたいページを含む連続する複数ページ(例えば32ページや64ページ)のブロック(図2(c)で説明したブロックと区別するためここでは「メモリブロック」と呼ぶものとする)を消去した後に書込みを行う必要がある。従って、上記ステップ903,904,913でのNAND型フラッシュメモリ125への書込みは、書込みたいページを含むメモリブロックのデータをRAM103上に一旦読出した後、該メモリブロックを消去し、RAM103上で読出したデータ中の必要な部分を変更し、変更後のデータを該消去済みのメモリブロックに書き戻す手順で実行する。   The NAND flash memory cannot be overwritten in one operation, and is distinguished from a block of a plurality of continuous pages (for example, 32 pages and 64 pages) including a page to be written (blocks described in FIG. 2C). Therefore, it is necessary to perform writing after erasing the memory block). Therefore, in writing to the NAND flash memory 125 in the above steps 903, 904, and 913, the data of the memory block including the page to be written is once read on the RAM 103, and then the memory block is erased and read on the RAM 103. A necessary part of the data is changed, and the changed data is written back to the erased memory block.

次に、上記(2)の訂正不可のエラーの場合について説明する。この場合、上述したように当該chで生成中の楽音は、(CPU101からの指示なしに)自動的にフォースダンプされる。このエラー通知を受けたCPU101は、割込処理で、当該chを開放chとして発音割り当てできるようにし、また当該chに割り当てた帯域幅を割り当て可能な帯域幅に戻すとともに、その旨をメッセージ表示や所定音の出力などでユーザに通知する。この通知は、即時に行う代わりに、楽音生成処理が終了した後に行ってもよい。通知を受けたユーザは、(訂正不可のエラーが発生した場合はフラッシュメモリ125が不良であると思われるので、)メーカに修理を依頼する。   Next, the case of the error (2) that cannot be corrected will be described. In this case, as described above, the musical sound being generated by the channel is automatically force dumped (without an instruction from the CPU 101). Upon receiving this error notification, the CPU 101 enables the sound allocation of the channel as an open channel by interrupt processing, returns the bandwidth allocated to the channel to an allocatable bandwidth, and displays a message to that effect. The user is notified by outputting a predetermined sound. This notification may be performed after the musical tone generation process is completed, instead of immediately. The user who has received the notification requests the manufacturer to repair (the flash memory 125 seems to be defective when an uncorrectable error occurs).

なお、フラッシュメモリ125の1つのページに着目すると、エラー無しで正常に読出せている状態から訂正不可のエラーが突然発生する確率は極めて低く、まず訂正可能なエラーが何回か発生し、その後、訂正不可のエラーが発生するのが通常である。従って、訂正可能なエラーが発生したときに、該エラーを起こしたページを代替ページ(あるいは代替ブロック)に置き換えることで、訂正不可なエラーの発生を抑えることができる。   When attention is focused on one page of the flash memory 125, the probability that an uncorrectable error suddenly occurs from a normal reading state without an error is extremely low. First, a correctable error occurs several times. Usually, an uncorrectable error occurs. Therefore, when a correctable error occurs, the occurrence of an uncorrectable error can be suppressed by replacing the page in which the error has occurred with a substitute page (or substitute block).

次に、上記(3)の転送エラーの場合について説明する。この場合、上述したように当該chで生成中の楽音はフォースダンプされる。このエラー通知を受けたCPU101は、割込処理で、当該chを開放chとして発音割り当てできるようにし、当該chに割り当てた帯域を割り当て可能な帯域幅に戻す。また、全帯域幅Tbwの値を所定数だけ下げて、帯域の制限をきつくし、転送エラーが起きにくくなるようにする。   Next, the case of the transfer error (3) will be described. In this case, as described above, the musical sound being generated by the channel is force dumped. Receiving this error notification, the CPU 101 enables the sound allocation of the channel as an open channel by the interruption process, and returns the bandwidth allocated to the channel to an allocatable bandwidth. In addition, the value of the total bandwidth Tbw is lowered by a predetermined number so as to limit the bandwidth so that transfer errors are less likely to occur.

なお、上記実施形態における各種の値は、それぞれ適宜変更することができる。フラッシュメモリ125のページのサイズは2112バイトに限らず任意のサイズであってよい例えば、データエリアを1024バイトや4096バイトとし、付加情報Infも任意のサイズとしてよい(フラッシュメモリ125の仕様による)。また、データ幅も8ビットには限らず、4ビット、16ビット等でもよい。図2(c)で説明したモード1の場合の1ブロックの大きさも16ページとは限らず、32ページや64ページ(2の累乗)などでもよい。また、1ブロックを1ページとしてもよい(この場合は結果としてブロックの概念が無いということになる)。基本再生期間における単位アクセス回数は256に限らず、300、450、512等、任意の数であってよい(フラッシュメモリ125の仕様による)。波形メモリ126からの読出しサンプルデータ数は256(1ch当たり2サンプルで128ch分)に限らず、310、460、512等、任意の数であってよい(音源114が波形メモリ126から波形サンプルを読出す際、どれほどの分解能のタイムスロットで1サンプル読出し可能かの仕様による)。発音可能ch数も128chに限らず、(上述のボトルネックとなる種々の条件のもとで)64、80、160等、任意の数で設計することが可能である。1サンプルのビット数も、16ビットに限らず、12ビット、14ビット等であってもよい。   In addition, the various values in the said embodiment can each be changed suitably. The page size of the flash memory 125 is not limited to 2112 bytes, and may be any size. For example, the data area may be 1024 bytes or 4096 bytes, and the additional information Inf may be any size (depending on the specifications of the flash memory 125). The data width is not limited to 8 bits, and may be 4 bits, 16 bits, or the like. The size of one block in the mode 1 described with reference to FIG. 2C is not limited to 16 pages, and may be 32 pages, 64 pages (power of 2), or the like. One block may be one page (in this case, there is no concept of a block as a result). The number of unit accesses in the basic playback period is not limited to 256, but may be any number such as 300, 450, 512 (depending on the specifications of the flash memory 125). The number of sample data read from the waveform memory 126 is not limited to 256 (2 samples per channel for 128 channels), but may be any number such as 310, 460, 512 (the sound source 114 reads waveform samples from the waveform memory 126). (It depends on the specification of how many resolution time slots can be used to read one sample.) The number of soundable channels is not limited to 128, and any number such as 64, 80, 160, etc. can be designed (under the above-described various bottleneck conditions). The number of bits of one sample is not limited to 16 bits, and may be 12 bits, 14 bits, or the like.

図2(b)の例では、2048バイトの波形データの後にエラー訂正コードを設けるフォーマットとしたが、エラー訂正コードは任意の位置に配置してよいし分割して配置してもよい。例えば、エラー訂正演算を行う単位が256バイトであれば、256バイトの波形データの後に該256バイトのエラー訂正コードを配置してもよい。   In the example of FIG. 2B, the error correction code is provided after the 2048-byte waveform data, but the error correction code may be arranged at an arbitrary position or divided. For example, if the unit for performing the error correction calculation is 256 bytes, the 256-byte error correction code may be arranged after the 256-byte waveform data.

また、上記実施形態において、補間部508による補間処理は2点補間であったが、3点補間、4点補間等、任意数の点間の補間であってよい。ただし、例えば4点補間を行う場合は、各chで波形メモリ126から波形サンプルを読出すときに、1回の読出しで連続する4サンプルを読出すことになるので、発音可能ch数を減らさなければならない場合はある。波形メモリ126から複数サンプルを読出す場合、バーストモードにより高速に読出すようにしてもよい。補間部508を、サンプルバッファを備えた補間部としてもよい。   In the above embodiment, the interpolation processing by the interpolation unit 508 is two-point interpolation, but may be interpolation between any number of points such as three-point interpolation and four-point interpolation. However, when performing four-point interpolation, for example, when reading waveform samples from the waveform memory 126 for each channel, four consecutive samples are read in one reading, so the number of soundable channels must be reduced. There are cases where it is necessary. When reading a plurality of samples from the waveform memory 126, they may be read at a high speed in a burst mode. The interpolation unit 508 may be an interpolation unit including a sample buffer.

また、上記実施形態において、読出部507は、各DACの期間に、波形メモリ126を1chあたり2回アクセスして、そのchの補間処理に必要な2サンプルを波形メモリ126から読み出すようになっていたが、特許2882464に開示されているように、読出部507の内部に、過去に読み出したサンプルのうちの最新のn個(nは補間処理に必要な数)を記憶する補間バッファ(先願のサンプルRAM1205に相当)を設けて、1chあたりの波形メモリ126のアクセス回数を減らすようにしてもよい。この場合、1chあたりの波形メモリ126のアクセス回数は、ピッチカウンタ504が出力する各chの整数部アドレスの進行数となる。例えば、各chのFナンバを「1」以下に制限すれば、上記実施形態と同じく1DACあたり256回のアクセスによって、256ch分のサンプルを読み出すことができるので、この音源LSI100は、最大発音可能ch数を256として設計される。Fナンバを制限しない場合は、各chに設定されるFナンバの小数部を切り上げた数の和の最大値に応じて、最大発音可能ch数が動的に変化する。何れで設計する場合であっても、フラッシュメモリ125の「帯域幅」(実施形態では256)と波形メモリのアクセス回数(実施形態では256回)とが、一致するよう設計するのが最適である。   In the above embodiment, the reading unit 507 accesses the waveform memory 126 twice per channel during each DAC period, and reads out two samples necessary for the interpolation processing of the channel from the waveform memory 126. However, as disclosed in Japanese Patent No. 2888264, an interpolation buffer (prior application) that stores the latest n (n is the number necessary for the interpolation process) of the samples read in the past in the reading unit 507. May be provided to reduce the number of accesses to the waveform memory 126 per channel. In this case, the number of accesses to the waveform memory 126 per channel is the progression of the integer part address of each channel output by the pitch counter 504. For example, if the F number of each channel is limited to “1” or less, samples of 256 channels can be read out by 256 accesses per DAC as in the above embodiment, and therefore the tone generator LSI 100 can generate the maximum sound generation channel. The number is designed as 256. When the F number is not limited, the maximum number of soundable channels changes dynamically according to the maximum value of the sum of the rounded numbers of the F number set for each channel. In any case, it is optimal that the “bandwidth” of the flash memory 125 (256 in the embodiment) and the number of accesses to the waveform memory (256 in the embodiment) are matched. .

上記実施形態では、モード2の場合、フラッシュメモリ125から最初に転送するページの仮想アドレスから実アドレスへの変換(図6におけるP2アドレスのT(WA)の取得)は、CPU101によらずVPアドレス発生部505により自動的に行うようにしていたが(図8(a)の803,804の処理)、この初回のアドレス変換は、CPU101で行ってもよい。そのためには、CPU101側で各波形データの仮想アドレスWAに対応する実アドレス(T(WA)に相当するデータ)を保持しておき、例えば発音開始指示の際に制御レジスタ502経由で波形メモリ126のNPAiに該実アドレスを設定するようにすればよい。モード1の場合に同様にしてもよい。第2ページ以降を転送する際に、CPU101に割り込みがかからないことが重要であり、第1ページについては、多少の処理が増えても余り影響がない。割り込みでは、CPU101のレジスタの退避等が必要なため、負荷が大きい。   In the above embodiment, in the mode 2, the conversion from the virtual address of the first page transferred from the flash memory 125 to the real address (acquisition of T (WA) of the P2 address in FIG. 6) is performed regardless of the CPU 101. Although the generation unit 505 automatically performs the processing (processing of 803 and 804 in FIG. 8A), the first address conversion may be performed by the CPU 101. For this purpose, the CPU 101 stores a real address (data corresponding to T (WA)) corresponding to the virtual address WA of each waveform data, and, for example, the waveform memory 126 via the control register 502 when a sounding start instruction is issued. The real address may be set in the NPAi. The same may be done for mode 1. When transferring the second and subsequent pages, it is important that the CPU 101 is not interrupted, and there is not much influence on the first page even if some processing is increased. An interrupt requires a large load because the CPU 101 needs to save a register.

また上記実施形態では、NAND型フラッシュメモリに波形データを記憶するようになっていたが、記憶媒体はNAND型フラッシュメモリに限らない。本発明は、ページ単位のアクセスを高速に行うことができ、かつ、データ訂正を必要とする程度のデータエラーを生じる各種の半導体メモリに波形データを記憶する場合に広く適用することができる。   In the above embodiment, the waveform data is stored in the NAND flash memory. However, the storage medium is not limited to the NAND flash memory. The present invention can be widely applied to the case where waveform data is stored in various semiconductor memories that can perform page-by-page access at a high speed and cause data errors that require data correction.

上記実施形態では、1ワードが1サンプルのリニアな波形データを例として説明したが、波形データは任意の形式で圧縮したものでもよい。その場合、1ページ1024ワードのサンプル数が区々になるので上述の帯域幅を正確に算出することが難しくなるが、予め各波形データの1ページの平均的なサンプル数を求めておき、それを用いて帯域幅を計算するようにすればよい。   In the above embodiment, linear waveform data in which one word is one sample has been described as an example, but the waveform data may be compressed in an arbitrary format. In that case, since the number of samples per page of 1024 words varies, it is difficult to calculate the above-mentioned bandwidth accurately. The bandwidth may be calculated using

上記実施形態では、波形メモリ内にアドレス変換テーブルを配置しているが、波形メモリ内ではなく、LSI100の内部にアドレス変換テーブルを記憶するための記憶部を設けてもよい。また、音源LSI100の内部にCPU101を内蔵する構成としたが、CPU101を内蔵する代わりにCPUとのインターフェースを行うCPU_I/F部を内蔵し、該CPU_I/F部を介して外部のCPU101’から制御される構成としてもよい。さらに、メモリI/F部102、RAM103、表示器I/F部104、パラレルI/F部105、シリアルI/F部106のうちの任意の1ないし複数を、音源LSI100に内蔵しない構成としてもよい。逆に、波形メモリ126は、スタティックメモリ型に変更して音源LSI100の内部に取り込んでもよい。   In the above embodiment, the address conversion table is arranged in the waveform memory, but a storage unit for storing the address conversion table may be provided in the LSI 100 instead of in the waveform memory. Further, although the CPU 101 is built in the tone generator LSI 100, a CPU_I / F unit for interfacing with the CPU is incorporated instead of the CPU 101, and control is performed from the external CPU 101 ′ via the CPU_I / F unit. It is good also as a structure to be made. Further, the tone generator LSI 100 may not include any one or more of the memory I / F unit 102, the RAM 103, the display I / F unit 104, the parallel I / F unit 105, and the serial I / F unit 106. Good. Conversely, the waveform memory 126 may be changed to a static memory type and taken into the sound source LSI 100.

101…CPU、103…RAM、103…RAM、104…表示器I/F、105…パラレルI/F、106…シリアルI/F、107…メモリI/F、108…F→B転送部、109…転送バッファ、110…B→M転送部、111…エラー訂正部、112…メモリI/F、113…転送制御部、114…音源、121…NOR型フラッシュメモリ、122…表示器、123…操作子、124…MIDI I/O、125…NAND型フラッシュメモリ、126…波形メモリ、127…DAC、128…サウンドシステム。   101 ... CPU, 103 ... RAM, 103 ... RAM, 104 ... Display I / F, 105 ... Parallel I / F, 106 ... Serial I / F, 107 ... Memory I / F, 108 ... F → B transfer unit, 109 ... Transfer buffer, 110 ... B → M transfer unit, 111 ... Error correction unit, 112 ... Memory I / F, 113 ... Transfer control unit, 114 ... Sound source, 121 ... NOR flash memory, 122 ... Display unit, 123 ... Operation Child 124 ... MIDI I / O 125 ... NAND flash memory 126 ... Waveform memory 127 ... DAC 128 ... Sound system

Claims (5)

複数のチャンネルを備え、それらの各チャンネルでそれぞれ楽音を生成する楽音生成装置であって、
複数の各波形データの一連のサンプルデータを、仮想アドレス空間で連続する複数のページに記憶した外部メモリと、楽音波形を生成する楽音生成部と、入力された演奏情報に応じて前記楽音生成部を制御する制御部とを備え、
前記楽音生成部は、
各波形データの先頭ページのサンプルデータを記憶した先頭波形領域と、各チャンネルのバッファ領域とを有する波形メモリと、
前記仮想アドレス空間上のページを特定する仮想ページアドレス(VPアドレス)を実ページアドレスに変換するためのアドレス変換テーブルを記憶するアドレス変換テーブル記憶部と、
前記制御部が発音開始を指示する際にパラメータを設定する制御レジスタであって、各チャンネルごとの領域に、少なくとも、発音する楽音の音高に応じた速度情報、発音に使用する波形データの前記波形メモリの先頭波形領域を指す先頭波形アドレス、発音に使用する波形データの前記外部メモリ中の位置を示す波形位置情報、および発音する楽音の振幅を規定する振幅制御情報が設定される、制御レジスタと、
各チャンネルごとに、発音開始の指示に応じて前記速度情報の示す速度で増加するカウント値を生成するとともに、該カウント値が1ページ分進行するごとに転送指示を発生する、ピッチカウンタと、
各チャンネルごとに、前記カウント値に応じて、前記波形メモリから、まず、前記先頭波形アドレスの示す波形データの先頭ページのサンプルデータを読出し、その後、当該チャンネルのバッファ領域からサンプルデータを繰り返し読出す、読出部と、
各チャンネルごとに、前記波形位置情報に基づいて、前記外部メモリから仮想アドレス空間上で次に読出すべきページを示す仮想ページアドレスを生成し、前記アドレス変換テーブルを参照して該仮想ページアドレスを実ページアドレスに変換し、該実ページアドレスを次ページアドレス記憶部に設定する、次ページアドレス設定部と、
各チャンネルの、前記発音開始の指示と前記転送指示とに応じて、当該チャンネルのチャンネル番号を取り込む、転送待ちキューと、
前記転送待ちキューから、前記取り込まれたチャンネル番号を先入れ先出しの態様で順次取り出し、前記次ページアドレス記憶部に設定されている当該チャンネルの次ページアドレス情報が示すページのサンプルデータを、前記外部メモリからバースト読出して、前記波形メモリの該チャンネル番号の示すチャンネルのバッファ領域に書込む、転送部と、
各チャンネルごとに、前記振幅制御情報に応じて、前記読出部が読出したサンプルデータの振幅を制御し、楽音波形のサンプルデータを形成する、振幅制御部と
を備え、
前記制御部は、
入力された新たな楽音の音高と発音開始を示す演奏情報に応じて、前記複数のチャンネルの1つを割り当て、前記制御レジスタの該チャンネルの領域に、該音高に応じた前記速度情報、前記先頭波形アドレス、前記波形位置情報、および前記振幅制御情報を設定し、さらに、該チャンネルの前記発音開始を指示する
ことを特徴とする楽音生成装置。
A musical sound generating device that has a plurality of channels and generates musical sounds on each of those channels,
An external memory storing a series of sample data of a plurality of waveform data in a plurality of continuous pages in a virtual address space, a musical sound generating unit for generating a musical sound waveform, and the musical sound generating unit according to input performance information And a control unit for controlling
The musical sound generator is
A waveform memory having a first waveform area storing sample data of the first page of each waveform data, and a buffer area for each channel;
An address conversion table storage unit for storing an address conversion table for converting a virtual page address (VP address) for specifying a page in the virtual address space into a real page address;
A control register for setting a parameter when the control unit instructs the start of sound generation, wherein at least speed information corresponding to a pitch of a musical sound to be generated and waveform data used for sound generation are set in each channel region; A control register in which a top waveform address indicating the top waveform area of the waveform memory, waveform position information indicating the position of the waveform data used for sound generation in the external memory, and amplitude control information defining the amplitude of the tone to be generated are set When,
A pitch counter that generates a count value that increases at a speed indicated by the speed information in response to a sound generation start instruction for each channel, and generates a transfer instruction every time the count value advances by one page;
For each channel, according to the count value, first, sample data on the first page of the waveform data indicated by the first waveform address is read from the waveform memory, and then sample data is repeatedly read from the buffer area of the channel. A reading unit;
For each channel, a virtual page address indicating a page to be read next in the virtual address space is generated from the external memory based on the waveform position information, and the virtual page address is referred to the address conversion table. A next page address setting unit that converts the real page address and sets the real page address in the next page address storage unit;
In response to the sound generation start instruction and the transfer instruction for each channel, a transfer waiting queue that captures the channel number of the channel,
The fetched channel number is sequentially extracted from the transfer queue in a first-in first-out manner, and sample data of the page indicated by the next page address information of the channel set in the next page address storage unit is read from the external memory. A transfer unit that performs burst reading and writes the buffer area of the channel indicated by the channel number of the waveform memory;
An amplitude control unit for controlling the amplitude of the sample data read by the reading unit according to the amplitude control information for each channel and forming sample data of a musical sound waveform;
The controller is
One of the plurality of channels is allocated according to the pitch of a new musical tone and performance information indicating the start of sound generation, and the speed information corresponding to the pitch is assigned to the channel area of the control register. The musical tone generating apparatus, wherein the head waveform address, the waveform position information, and the amplitude control information are set, and the sound generation start of the channel is instructed.
請求項1に記載の楽音生成装置において、
前記アドレス変換テーブルは、前記外部メモリに記憶されており、
装置の起動時に、前記外部メモリから前記アドレス変換テーブルを読出して、前記アドレス変換テーブル記憶部に格納する
ことを特徴とする楽音生成装置。
In the musical sound generating apparatus according to claim 1,
The address conversion table is stored in the external memory,
A musical tone generating apparatus, wherein the address conversion table is read from the external memory and stored in the address conversion table storage unit when the apparatus is activated.
請求項1または2に記載の楽音生成装置において、
前記アドレス変換テーブル記憶部は、前記波形メモリ内に設けられていることを特徴とする楽音生成装置。
In the musical sound generating device according to claim 1 or 2,
The musical tone generating apparatus, wherein the address conversion table storage unit is provided in the waveform memory.
請求項1から3の何れか1つに記載の楽音生成装置において、
前記楽音生成部は、
前記転送部により前記外部メモリから読出したページのデータに対して、エラー訂正コードを利用して該ページのサンプルデータのエラーの検出を行い、エラーの有無およびエラーが有った場合にはエラー訂正の可否を決定すると共に、検出されたエラーが訂正可である場合はその訂正を実行する、エラー訂正部と、
前記エラー訂正部により訂正可なエラーが検出されたとき、その旨およびエラーが発生した前記外部メモリ上のページを特定する情報を含むエラー通知を前記制御部に送るエラー検出部と
を備え、
前記制御部は、
(1)前記訂正可のエラーが発生した当該ページを特定する情報を代替待ちページとして記録し、
(2)前記代替待ちページとして記録されているページがあるとき、自動的に起動されたバックグラウンド処理で、または、ユーザの指示により起動された処理で、前記外部メモリ上に代替ページを確保し、前記代替待ちページとして記録されているページのデータを読出し、該読出しでエラーが発生した場合はエラー訂正を行って適正なデータを求め、該適正なデータを前記代替ページに格納して、エラーが発生したページを置き換え、
(3)前記代替待ちページの仮想ページアドレスの実ページアドレスへの変換において、前記代替ページの実ページアドレスが取得できるように、前記アドレス変換テーブルを修正する
ことを特徴とする楽音生成装置。
In the musical sound generating device according to any one of claims 1 to 3,
The musical sound generator is
For the page data read from the external memory by the transfer unit, an error correction code is used to detect an error in the sample data of the page, and if there is an error and there is an error, the error is corrected. An error correction unit that executes the correction when the detected error is correctable, and
An error detection unit that, when a correctable error is detected by the error correction unit, sends an error notification to the control unit to that effect and information specifying the page on the external memory where the error has occurred, and
The controller is
(1) Record information specifying the page on which the correctable error has occurred as an alternative waiting page,
(2) When there is a page recorded as the substitute waiting page, a substitute page is secured in the external memory by a background process automatically started or by a process started by a user instruction. The page data recorded as the substitution waiting page is read, and if an error occurs in the reading, error correction is performed to obtain appropriate data, the appropriate data is stored in the substitution page, and an error is detected. Replace the page where the
(3) In the conversion of the virtual page address of the substitute waiting page into the real page address, the address conversion table is modified so that the real page address of the substitute page can be acquired.
請求項1から4の何れか1つに記載の楽音生成装置において、
前記外部メモリは、独立した集積回路で構成されるNAND型フラッシュメモリであることを特徴とする楽音生成装置。
In the musical sound generating apparatus according to any one of claims 1 to 4,
2. A musical sound generating apparatus according to claim 1, wherein the external memory is a NAND flash memory composed of an independent integrated circuit.
JP2010066570A 2010-03-23 2010-03-23 Music generator Active JP5510814B2 (en)

Priority Applications (4)

Application Number Priority Date Filing Date Title
JP2010066570A JP5510814B2 (en) 2010-03-23 2010-03-23 Music generator
US13/052,919 US8183452B2 (en) 2010-03-23 2011-03-21 Tone generation apparatus
EP11159392A EP2369581B1 (en) 2010-03-23 2011-03-23 Tone generation apparatus
CN201110076001.0A CN102237126B (en) 2010-03-23 2011-03-23 Tone generation apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010066570A JP5510814B2 (en) 2010-03-23 2010-03-23 Music generator

Publications (2)

Publication Number Publication Date
JP2011197551A JP2011197551A (en) 2011-10-06
JP5510814B2 true JP5510814B2 (en) 2014-06-04

Family

ID=44875795

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010066570A Active JP5510814B2 (en) 2010-03-23 2010-03-23 Music generator

Country Status (1)

Country Link
JP (1) JP5510814B2 (en)

Also Published As

Publication number Publication date
JP2011197551A (en) 2011-10-06

Similar Documents

Publication Publication Date Title
US8183452B2 (en) Tone generation apparatus
JP5534388B2 (en) Music generator
JP4655812B2 (en) Musical sound generator and program
US5689080A (en) Computer system and method for performing wavetable music synthesis which stores wavetable data in system memory which minimizes audio infidelity due to wavetable data access latency
US5717154A (en) Computer system and method for performing wavetable music synthesis which stores wavetable data in system memory employing a high priority I/O bus request mechanism for improved audio fidelity
US10373595B2 (en) Musical sound generation device
JP2013186368A (en) Musical sound generating device, program and musical sound generating method
US8263849B2 (en) Flash memory based stored sample electronic music synthesizer
JP4998046B2 (en) Music generator
US20180277074A1 (en) Musical sound generation device
US5763801A (en) Computer system and method for performing wavetable music synthesis which stores wavetable data in system memory
JPH11282743A (en) Memory management method, computer system and sound source system
US10474387B2 (en) Musical sound generation device, musical sound generation method, storage medium, and electronic musical instrument
US5809342A (en) Computer system and method for generating delay-based audio effects in a wavetable music synthesizer which stores wavetable data in system memory
JP3163984B2 (en) Music generator
JP5510813B2 (en) Music generator
JP5510814B2 (en) Music generator
JP5510815B2 (en) Music generator
JP5534389B2 (en) Music generator
JP5360474B2 (en) Music generator
JP3003559B2 (en) Music generation method
JP3873160B2 (en) Music recording device and recording medium recording program for generating musical sound
JP4254677B2 (en) Musical sound generator and musical sound generation processing program
US20100217922A1 (en) Access module, storage module, musical sound generating system and data writing module
JP3695404B2 (en) Waveform processing device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20130121

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20140313

R150 Certificate of patent or registration of utility model

Ref document number: 5510814

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150