JP2024046785A - Effect imparting device, method, and program - Google Patents
Effect imparting device, method, and program Download PDFInfo
- Publication number
- JP2024046785A JP2024046785A JP2022152069A JP2022152069A JP2024046785A JP 2024046785 A JP2024046785 A JP 2024046785A JP 2022152069 A JP2022152069 A JP 2022152069A JP 2022152069 A JP2022152069 A JP 2022152069A JP 2024046785 A JP2024046785 A JP 2024046785A
- Authority
- JP
- Japan
- Prior art keywords
- block
- data
- calculation
- processing unit
- calculation processing
- 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.)
- Pending
Links
- 230000000694 effects Effects 0.000 title claims abstract description 144
- 238000000034 method Methods 0.000 title claims abstract description 88
- 230000015654 memory Effects 0.000 abstract description 23
- 238000010586 diagram Methods 0.000 description 20
- 230000004044 response Effects 0.000 description 19
- 238000005070 sampling Methods 0.000 description 9
- 238000001514 detection method Methods 0.000 description 5
- 230000000873 masking effect Effects 0.000 description 4
- 230000005236 sound signal Effects 0.000 description 3
- 238000009825 accumulation Methods 0.000 description 2
- 230000001934 delay Effects 0.000 description 2
- 230000007423 decrease Effects 0.000 description 1
- 230000004043 responsiveness Effects 0.000 description 1
Images
Landscapes
- Electrophonic Musical Instruments (AREA)
Abstract
【課題】音源で生成される楽音データに所定数のサンプルで構成されるブロック単位に基づく単位で音響効果を付与する効果付与技術に関し、楽音データにブロック単位で音響効果を付与する演算処理において、メモリの利用効率を向上させる。【解決手段】ブロック単位で割込み起動されるブロック割込み処理内で実行されるブロック判定処理(ブロック判定処理部)において、楽音データがブロック単位で演算処理条件に合致したか否か、例えばオール0の値であるか否かを示すブロック管理情報に基づいてブロック単位で効果付与を行う演算処理部での演算処理を、例えば通常演算処理と単純なオール0値の出力処理等とで調整する。【選択図】図10[Problem] This relates to an effect imparting technology that imparts sound effects to musical sound data generated by a sound source in units based on block units consisting of a predetermined number of samples, and improves memory utilization efficiency in the computational process that imparts sound effects to musical sound data in units of blocks. [Solution] In a block judgment process (block judgment processing unit) executed within a block interrupt process that is started by interrupt on a block basis, the computation process in the computation processing unit that imparts effects in units of blocks based on block management information that indicates whether musical sound data matches computational processing conditions in units of blocks, for example whether the data is all 0, is adjusted, for example, between normal computation and simple output processing of all 0 values. [Selected Figure] Figure 10
Description
本発明は、音源で生成される楽音データに所定数のサンプルで構成されるブロック単位に基づく単位で音響効果を付与する効果付与装置、方法、及びプログラムに関する。 The present invention relates to an effect imparting device, method, and program that imparts sound effects to musical sound data generated by a sound source in units based on block units consisting of a predetermined number of samples.
楽音信号に対してインパルス応答を畳み込むことにより残響や共鳴効果等の音響効果を付与する効果付与装置において、その畳込み手段として、周波数領域で畳み込みを行なうFFT/iFFT(Fast Fourier Transform/inverse Fast Fourier Transform:高速フーリエ変換/逆高速フーリエ変換)を用いる技術(例えば特許文献1)が知られている。
この場合、インパルス応答の係数データ、楽音信号ともに、各FFTフレームは複数回用いられることになる。
In an effect imparting device that imparts sound effects such as reverberation and resonance effects by convolving an impulse response with a musical sound signal, a technique is known that uses FFT/iFFT (Fast Fourier Transform/inverse Fast Fourier Transform) that performs convolution in the frequency domain (e.g., Patent Document 1).
In this case, each FFT frame is used multiple times for both the coefficient data of the impulse response and the tone signal.
電子楽器ではCPU(中央演算処理装置)、音源LSI(LSI:大規模集積回路)、及びDSP(デジタルシグナルプロセッサ)などがメモリをシェアした構成をとることが多いため、1つの処理のメモリ占有率が高い場合に、電子楽器全体でのパフォーマンスが低下してしまうという課題があった。 Electronic musical instruments often have a configuration in which the CPU (Central Processing Unit), sound source LSI (Large Scale Integrated Circuit), and DSP (Digital Signal Processor) share memory, so if one process occupies a large amount of memory, there is a problem that the performance of the entire electronic musical instrument decreases.
そこで、本発明は、楽音データにブロック単位で音響効果を付与する演算処理において、メモリの利用効率を向上させることを目的とする。 The present invention aims to improve memory usage efficiency in the computational process of adding sound effects to musical sound data on a block-by-block basis.
態様の一例の効果付与装置は、音源で生成される楽音データにブロック単位で音響効果を付与する演算処理を実行する演算処理部と、前記楽音データが前記ブロック単位で演算処理条件を満たしたか否かを示すブロック管理情報に基づいて前記演算処理部での前記演算処理を調整する演算制御処理部と、を備える。
を備える
An example of an effect imparting device includes a calculation processing unit that executes calculation processing to impart sound effects on a block-by-block basis to musical sound data generated by a sound source, and a calculation control processing unit that adjusts the calculation processing in the calculation processing unit based on block management information indicating whether the musical sound data satisfies calculation processing conditions on a block-by-block basis.
Equipped
本発明によれば、楽音データにブロック単位で音響効果を付与する演算処理において、メモリの利用効率を向上させることが可能となる。 The present invention makes it possible to improve memory utilization efficiency in computational processing that applies sound effects to musical sound data on a block-by-block basis.
以下、本発明を実施するための形態について図面を参照しながら詳細に説明する。本実施形態の電子楽器の効果付与部に用いられるフィルタ演算処理装置は、フィルタ次数を柔軟に変更可能なFIRフィルタ演算処理を実行することができ、また、フィルタ次数やインパルス応答特性が異なる複数のFIRフィルタ演算処理を、それらの組合せを柔軟に変更しながら同時に実行することが可能である。本実施形態における効果付与部は、このようなFIRフィルタ演算処理による時間域畳込み処理と、FFT演算を用いた周波数域畳込み処理とが組み合わされて実装される。この場合、周波数域畳込み処理におけるFFT点数と共にFIRのフィルタ次数を柔軟に決定することが可能となるため、電子楽器の楽音に、応答性を犠牲にすることなく、再現性の高い残響、共鳴効果を付与することが可能となる。 The embodiment of the present invention will be described in detail below with reference to the drawings. The filter calculation processing device used in the effect imparting section of the electronic musical instrument of this embodiment can execute FIR filter calculation processing that allows the filter order to be flexibly changed, and can simultaneously execute multiple FIR filter calculation processing with different filter orders and impulse response characteristics while flexibly changing the combinations of these. The effect imparting section in this embodiment is implemented by combining time domain convolution processing using such FIR filter calculation processing and frequency domain convolution processing using FFT calculation. In this case, it is possible to flexibly determine the FIR filter order along with the number of FFT points in the frequency domain convolution processing, so that it is possible to impart highly reproducible reverberation and resonance effects to the musical sounds of the electronic musical instrument without sacrificing responsiveness.
図1は、電子楽器100の実施形態の例を示すブロック図である。電子楽器100は、少なくとも1つのCPU(中央演算処理装置)101と、ROM(リードオンリーメモリ)102と、RAM(ランダムアクセスメモリ)103と、音源(TG:Tone Generator)104と、DSP(Digital Signal Processor)である効果付与部105と、鍵盤106と、ペダル107と、操作子108が、システムバス109に接続された構成を有する。また、音源(TG)104の出力は、サウンドシステム110に接続される。効果付与部105は、後述する効果装置211を備えている。
Figure 1 is a block diagram showing an example of an embodiment of an electronic
CPU101は、ROM102からRAM103にロードされた制御プログラムを実行することにより、鍵盤106や操作子108からの演奏操作情報に基づいて、音源104に発音指示を出す。
The
音源(TG)104は、上記発音指示に従って、ROM102又はRAM103から波形データを読み出すことにより、楽音データを生成する。この楽音データは、効果付与部105を介して、サウンドシステム110に出力される。ここで、例えば操作者によってペダル107が踏まれると、効果付与部105が、楽音データにリバーブなどの残響音付与やピアノの弦の共鳴音付与などの効果付与を実行する。この結果、効果付与部105から出力された楽音データは、サウンドシステム110において、デジタル-アナログ変換器によってアナログ楽音信号に変換され、アナログアンプで増幅され、スピーカから放音される。
The tone generator (TG) 104 generates musical tone data by reading waveform data from the
図2は、図1の構成を有する電子楽器における楽音データの流れの例を示す図である。音源(TG)104は、CH1~CHnのnチャネルの発音チャネルの楽音データを生成する楽音生成部201(CH1)~201(CHn)を備え、それぞれ、操作者による鍵盤106での押鍵に基づいて発生する図1のCPU101からの発音指示に従い、押鍵毎に独立した楽音データを生成する。発音チャネルCHiに対応する楽音生成部201(CHi)(1≦i≦n)は、波形データを生成する波形生成部WG.CHi、生成された波形データの音色を加工するフィルタ処理部TVF.CHi、及び生成された波形データの振幅エンベロープを加工するアンプエンベロープ処理部TVA.CHiを備える。
Figure 2 is a diagram showing an example of the flow of musical tone data in an electronic musical instrument having the configuration of Figure 1. The tone generator (TG) 104 includes musical tone generators 201 (CH1) to 201 (CHn) that generate musical tone data for n tone generation channels CH1 to CHn, and generate independent musical tone data for each key pressed according to tone generation instructions from the
ミキシング部202内の4つのミキサ203、204、205、及び206はそれぞれ、各楽音生成部201(CHi)(1≦i≦n)が出力する各楽音データに所定のレベルを乗算した後に累算することにより得られる、Lch(左チャネル)直接音出力データ207、Rch(右チャネル)直接音出力データ208、Lch効果音入力データ209、及びRch効果音入力データ210をそれぞれ、効果付与部105に出力する。なお、図2において、各ミキサ203、204、205、及び206内の記号「*、Σ」は、入力したデータに対して所定のレベルを乗算後に累算して出力することを示している。
The four mixers 203, 204, 205, and 206 in the mixing unit 202 output Lch (left channel) direct sound output data 207, Rch (right channel) direct sound output data 208, Lch sound effect input data 209, and Rch sound effect input data 210, which are obtained by multiplying each musical sound data output by each musical sound generating unit 201 (CHi) (1≦i≦n) by a predetermined level and then accumulating the data, to the
Lch効果音入力データ209及びRch効果音入力データ210はそれぞれ、効果付与部105内の効果装置211において残響や共鳴などの効果が付与されたLch効果音出力データ212及びRch効果音出力データ213として出力される。効果付与部105内で、Lch効果音出力データ212は、Lch直接音出力データ207と加算され、Lch楽音出力データ214として、図1のサウンドシステム110に出力される。同様に、Rch効果音出力データ213は、Rch直接音出力データ208と加算され、Rch楽音出力データ215として、サウンドシステム110に出力される。サウンドシステム110では、デジタルデータであるLch楽音出力データ214及びRch楽音出力データ215はそれぞれ、Lchアナログ楽音信号及びRchアナログ楽音信号に変換されて、それぞれアナログアンプにより増幅されて、Lch及びRchの各スピーカから放音される。
The Lch sound effect input data 209 and the Rch sound effect input data 210 are output as Lch sound effect output data 212 and Rch sound effect output data 213, respectively, to which effects such as reverberation and resonance have been applied by the effect device 211 in the
図3は、図2の効果付与部105内の効果装置211のブロック図である。効果装置211は、効果装置211(Lch)と効果装置211(Rch)とを有する。効果装置211(Lch)は、入力されたLch効果音入力データ209にLchの残響・共鳴効果を付与したLch効果音出力データ212を出力する。効果装置211(Rch)は、入力されたRch効果音入力データ210にRchの残響・共鳴効果を付与したRch効果音出力データ213を出力する。両者とも同じ構成であるため、以下、特に言及しない場合は、Lch及びRchの区別なく説明する。効果装置211(Lch)(効果装置211(Rch))は、FIRフィルタ演算処理部303及びCONV演算処理部304を備えている。
Figure 3 is a block diagram of the effect device 211 in the
効果装置211に入力するLch効果音入力データ209又はRch効果音入力データ210は、FIRフィルタ演算処理部303とCONV演算処理部304とに並列に入力する。FIRフィルタ演算処理部303は、残響・共鳴音のインパルス応答データの前半データ部分をサンプリング周期単位の時間域処理により、Lch効果音入力データ209又はRch効果音入力データ210(原音)に畳み込む時間域畳込み部である。演算処理部であるCONV演算処理部304は、上記インパルス応答データの後半データ部分を、所定数のサンプルで構成されるブロック単位のFFT演算を用いた周波数域処理により、Lch効果音入力データ209又はRch効果音入力データ210(原音)に畳み込む周波数域畳込み部である。FIRフィルタ演算処理部303とCONV演算処理部304は、図2の効果付与部105であるDSP内に実装されているRAM306を共通領域として使用しながら、演算処理を実行する。
The Lch sound effect input data 209 or Rch sound effect input data 210 input to the effect device 211 is input in parallel to the FIR filter calculation processing unit 303 and the CONV calculation processing unit 304. The FIR filter calculation processing unit 303 is a time domain convolution unit that convolves the first half of the data portion of the impulse response data of the reverberation and resonance sound into the Lch sound effect input data 209 or the Rch sound effect input data 210 (original sound) by time domain processing in sampling period units. The CONV calculation processing unit 304, which is a calculation processing unit, is a frequency domain convolution unit that convolves the second half of the data portion of the impulse response data into the Lch sound effect input data 209 or the Rch sound effect input data 210 (original sound) by frequency domain processing using FFT calculation in block units consisting of a predetermined number of samples. The FIR filter calculation processing unit 303 and the CONV calculation processing unit 304 perform calculation processing while using the RAM 306 implemented in the DSP, which is the
FIRフィルタ演算処理部303とCONV演算処理部304の各出力は加算部305で加算されて、Lch効果音出力データ212又はRch効果音出力データ213として出力される。 The outputs of the FIR filter calculation processing unit 303 and the CONV calculation processing unit 304 are added in the addition unit 305 and output as the Lch sound effect output data 212 or the Rch sound effect output data 213.
図4から図7は、図3のCONV演算処理部304の動作説明図である。まず、図4は、ブロックサイズがN点の畳込み例を示している。FFT演算を用いた畳込みはそのままでは巡回畳込みとなるため、本実施形態では、インパルス応答データ(coef)と、Lch効果音入力データ209又はRch効果音入力データ210(以下、LchとRchを区別せずにこれらをまとめて効果音入力データ(sig)と呼ぶ)とを2N点でそれぞれFFT演算する際に、各ブロックの線状畳込みが得られるようにする。 Figures 4 to 7 are diagrams explaining the operation of the CONV calculation processing unit 304 in Figure 3. First, Figure 4 shows an example of convolution with a block size of N points. Convolution using FFT calculations will result in circular convolution if left as is, so in this embodiment, when performing FFT calculations at 2N points on the impulse response data (coef) and the Lch sound effect input data 209 or the Rch sound effect input data 210 (hereinafter, these will be collectively referred to as sound effect input data (sig) without distinguishing between Lch and Rch), a linear convolution of each block is obtained.
ここでは、2N点の各FFT演算403、404に先だって、401として示されるように、N点のインパルス応答データ(coef)(太枠部分)にN点のゼロデータ(細枠部分)が付加されて2N点のデータとされる。また、402として示されるように、効果音入力データ(sig)がブロックサイズN点分シフトされながらオーバーラップされて(太枠部分→破線太枠部分)2N点のデータとされる。そして、インパルス応答データ(coef)から生成された上記2N点のデータ401と効果音入力データ(sig)から生成された上記2N点のデータ402とに対して、それぞれ403及び404として示されるようにFFT演算が実行される結果、周波数領域の2N点のデータ405及び406が得られる。
Here, prior to each of the 2N-
続いて、407として示されるように、周波数領域の2N点のデータ405及び406が各周波数点毎に複素乗算されることにより、2N点の複素乗算結果データ408が得られる。
Next, as shown by 407, the 2N points of
更に、409として示されるように、2N点の複素乗算結果データ408に対してiFFT(逆高速フーリエ変換)演算が実行される結果、畳込みが行われた2N点の時間域データ410が得られる。
Furthermore, as shown at 409, an iFFT (inverse fast Fourier transform) operation is performed on the 2N points of complex
そして、2N点の時間域データ410のうちの前半のN点のデータ(太枠部分)が、ブロックサイズがN点の重畳保留法での線状畳込み結果となり、このようにして生成されるブロックサイズN点ずつのデータが図3のLch効果音出力データ212又はRch効果音出力データ213として出力される。
Then, the first N points of data (thick framed portion) of the 2N points of
図5は、インパルス応答データ(coef)側もブロックサイズN点ずつ分割される場合の、ブロックサイズがN点の畳込み例を示している。この例では、各N点毎の畳込み結果が足し合わせられることで、長い時間のインパルス応答もN点ずつの小さなブロックに分割して畳込み演算を実行することができる。 Figure 5 shows an example of convolution with a block size of N points when the impulse response data (coef) is also divided into blocks of N points. In this example, the convolution results for each N point are added together, so that even long-time impulse responses can be divided into small blocks of N points to perform convolution operations.
図5において、501として示されるように、インパルス応答データ(coef)が、それぞれのブロックサイズがNずつの例えば分割データN1、N2、N3、N4に分割される。また、502として示されるように、効果音入力データ(sig)も、それぞれのブロックサイズがNずつの例えば分割データN1、N2、N3、N4に分割される。 In FIG. 5, as shown by 501, impulse response data (coef) is divided into, for example, divided data N1, N2, N3, and N4, each having a block size of N. Also, as shown by 502, sound effect input data (sig) is also divided into, for example, divided data N1, N2, N3, and N4, each having a block size of N.
その後は、図4の場合と同様にして、2N点の各FFT演算505、506に先だって、503として示されるように、インパルス応答データ(coef)中の上述のように分割されたN点の分割データ(太枠部分)にN点のゼロデータが付加されて2N点のデータとされる。また、504として示されるように、効果音入力データ(sig)が上述のように分割されて得られるブロックサイズN点分ずつシフトされながらオーバーラップされて(太枠部分→破線太枠部分)2N点のデータとされる。そして、インパルス応答データ(coef)を分割したN点のデータから生成された上記2N点のデータ503と効果音入力データ(sig)から生成された上記2N点のデータ504とに対して、それぞれ505及び506として示されるようにFFT演算が実行される結果、周波数領域の2N点のデータ507及び508が、509及び510のように順次2N点ずつ得られる。ここで、インパルス応答データ(coef)の分割データN1、N2、N3、N4(図5の501)から生成される2N点ずつの周波数データ群509(N1、N2、N3、N4)は、インパルス応答データ(coef)に変化がない限り、FFT演算により演算しメモリにプリセットしておくことができる。また、効果音入力データ(sig)から生成される2N点ずつの周波数データ群510は、インパルス応答データ(coef)に対応する周波数データ群509(N1、N2、N3、N4)と同じ分割データ数分だけ、t(N)、t(N-1)、t(N-2)、t(N-3)というようにリングバッファ形式で順次メモリに記憶されてよい。
After that, as in the case of FIG. 4, prior to each of the 2N-
続いて、511として示されるように、周波数データ群509(N1、N2、N3、N4)と周波数データ群510(t(N)、t(N-1)、t(N-2)、t(N-3))とが、2N点ずつ各周波数点毎に複素乗算されることにより、それぞれ2N点の複素乗算結果データN1*t(N)、N2*t(N-1)、N3*t(N-2)、N4*t(N-3)が得られ、更にこれらに対してiFFT演算が実行される結果、畳込みが行われた2N点ずつの時間域データ513が得られる。
Next, as shown by 511, frequency data group 509 (N1, N2, N3, N4) and frequency data group 510 (t(N), t(N-1), t(N-2), t(N-3)) are complex multiplied for each 2N frequency point to obtain 2N complex multiplication result data N1*t(N), N2*t(N-1), N3*t(N-2), N4*t(N-3), which are then subjected to an iFFT operation to obtain convolved
そして、2N点ずつの時間域データ513のうちのそれぞれ前半のN点ずつのデータ(太枠部分)が、図3のLch効果音出力データ212又はRch効果音出力データ213として出力される。
Then, the first N points of data (thick framed parts) of each of the 2N points of
図6は、図3のCONV演算処理部304の動作を説明するための簡単な計算例を示した図である。 Figure 6 shows a simple calculation example to explain the operation of the CONV calculation processing unit 304 in Figure 3.
例えば、
conv(coef=[2 3 4 5 6 7 8 9]
sig=[1 2 3 4 5 6 7 8 9 10]
をブロックサイズN=2で計算した場合、畳込み結果の9番目と10番目は、200と244になるが、これを求めるためには、
ifft(fft([0 0 2 3])*fft([7 8 9 10]))
ifft(fft([0 0 4 5])*fft([5 6 7 8]))
ifft(fft([0 0 6 7])*fft([3 4 5 6]))
ifft(fft([0 0 8 9])*fft([1 2 3 4]))
の各計算結果の前半部分を足し合わせればよい。
なお、「fft()」及び「ifft()」はそれぞれ、括弧内のデータ群に対するFFT演算及びiFFT(逆FFT)演算を示す。
for example,
conv(coef = [2 3 4 5 6 7 8 9]
sig = [1 2 3 4 5 6 7 8 9 10]
When calculating with block size N=2, the 9th and 10th convolution results are 200 and 244.
ifft(fft([0 0 2 3])*fft([7 8 9 10]))
ifft(fft([0 0 4 5]) * fft([5 6 7 8]))
ifft(fft([0 0 6 7])*fft([3 4 5 6]))
ifft(fft([0 0 8 9])*fft([1 2 3 4]))
Simply add up the first half of each calculation result.
Note that "fft()" and "ifft()" respectively indicate an FFT operation and an iFFT (inverse FFT) operation on the data group within the parentheses.
上記演算例により、FFT演算を使った線状畳込みを実現できるが、FFT演算はブロック単位で計算が実行されるため、ブロックの頭で遅延が生じてしまう。図7は、FFT演算を用いた周波数域畳込み処理における処理遅延の説明図である。 The above calculation example allows linear convolution using FFT calculations to be realized, but because FFT calculations are performed on a block-by-block basis, delays occur at the beginning of the blocks. Figure 7 is an explanatory diagram of processing delays in frequency domain convolution processing using FFT calculations.
例えば、ブロック区間T1では、N1ブロックのデータが入力され、また後述する特定処理に分岐するための条件判定が行われる。次のブロック区間T2の先頭でブロック単位の割込みが発生すると、N2ブロックのデータの入力、及び後述する特定処理に分岐するための条件判定が行われると共に、N1ブロックのデータの畳込み処理(FFT演算、複素乗算、及びiFFT演算)が実行される。更に続くブロック区間T3の先頭でブロック単位の割込みが発生すると、N3ブロックの入力、及び後述する特定処理に分岐するための条件判定が行われると共に、N2ブロックのデータの畳込み処理と、N1ブロックのデータの出力処理が実行される。更に、ブロック区間T4の先頭でブロック単位の割込みが発生すると、N4ブロックの入力、及び後述する特定処理に分岐するための条件判定が行われると共に、とN3ブロックのデータの畳込み処理と、N2ブロックのデータの出力処理が実行される。続いて、ブロック区間T5の先頭でブロック単位の割込みが発生すると、N5ブロックの入力、及び後述する特定処理に分岐するための条件判定が行われると共に、とN4ブロックのデータの畳込み処理と、N3ブロックのデータの出力処理が実行される。 For example, in block section T1, N1 block data is input, and a condition determination is made to branch to specific processing described later. When a block-based interrupt occurs at the beginning of the next block section T2, N2 block data is input, and a condition determination is made to branch to specific processing described later, and convolution processing (FFT operation, complex multiplication, and iFFT operation) is performed on the N1 block data. When a block-based interrupt occurs at the beginning of the next block section T3, N3 block data is input, and a condition determination is made to branch to specific processing described later, and convolution processing of N2 block data and output processing of N1 block data are performed. When a block-based interrupt occurs at the beginning of block section T4, N4 block data is input, and a condition determination is made to branch to specific processing described later, and convolution processing of N3 block data and output processing of N2 block data are performed. Next, when a block-based interrupt occurs at the beginning of block section T5, the N5 block is input and a condition determination is made to branch to the specific processing described below, and convolution processing of the data in the N4 block and output processing of the data in the N3 block are performed.
図7に示されるタイミング関係からわかるように、FFT演算を使った線状畳込み処理では、701として示されるように、ブロックサイズNに対して2Nの処理遅延が発生する。そこで、図3の効果装置211では、CONV演算処理部304で発生する上記2Nの処理遅延をカバーするために、フィルタ次数=2NのFIRフィルタ演算処理部303が実装される。 As can be seen from the timing relationship shown in Figure 7, in linear convolution processing using FFT calculations, a processing delay of 2N occurs for block size N, as shown as 701. Therefore, in the effect device 211 of Figure 3, an FIR filter calculation processing unit 303 with a filter order of 2N is implemented to cover the above-mentioned 2N processing delay that occurs in the CONV calculation processing unit 304.
FIRフィルタ演算処理部303は、夫々が乗算処理部、累算処理部、及び遅延処理部とで構成されるフィルタ演算部がフィルタ次数に対応する個数縦属接続された構成を有する。 The FIR filter calculation processing unit 303 has a configuration in which filter calculation units, each of which is composed of a multiplication processing unit, an accumulation processing unit, and a delay processing unit, are connected in tandem in a number corresponding to the filter order.
また、効果音入力データの信号入力は、図2の音源(TG)104内のミキシング部202内のミキサ205又は206から、サンプリング周期単位で行われる。 In addition, the signal input of the sound effect input data is performed in sampling cycle units from the mixer 205 or 206 in the mixing section 202 in the sound source (TG) 104 in FIG. 2.
各次のフィルタ演算部は、サンプリング周期内で、その周期を細分化した周期を有するクロックに同期して実行され、全次数でのFIR演算処理及び最終段の累算処理部からの畳込み結果データの出力は、そのサンプリング周期内で完了する。これにより、図3のFIRフィルタ演算処理部303での畳込み処理では、遅延が生じない。 Each order of filter calculation unit is executed within the sampling period in synchronization with a clock having a period that is a subdivision of the sampling period, and the FIR calculation processing at all orders and the output of the convolution result data from the accumulation processing unit at the final stage are completed within that sampling period. As a result, no delay occurs in the convolution processing in the FIR filter calculation processing unit 303 in Figure 3.
図8は、FIRフィルタ演算処理部303とCONV演算処理部304の処理関係を示す説明図である。この図から理解されるように、FIRフィルタ演算処理部303のフィルタ次数がCONV演算処理部304のFFTサイズ(ブロックサイズNの2倍)に等しければ、CONV演算処理部304での処理遅延の影響は無視できる。
即ち、効果音入力データの最初の2NサンプルがFIRフィルタ演算処理部303に入力されると同時に、効果音入力データが、Nサンプルずつシフトされながら2NサンプルずつCONV演算処理部304に入力されるようにする。そして、図8に示されるように、まず、FIRフィルタ演算処理部303で、効果音入力データの最初の2Nサンプルに対して、サンプリング周期毎に効果音(例えば残響音又は共鳴音)のインパルス応答データの最初の2Nサンプルを畳込み演算して得られる、2Nサンプル分の畳込み結果データが、サンプリング周期毎に遅延なく出力される。また、CONV演算処理部304で、効果音入力データをNサンプルずつオーバーラップさせながら入力した2Nサンプル分ずつに対して、効果音のインパルス応答データの2N+1サンプル以降のNサンプル+値0のNサンプル=2Nサンプル分ずつを周波数域で畳込み演算して得られる、Nサンプル分ずつの畳込み結果データが、2Nサンプル分ずつ遅延して順次出力される。従って、図3の加算部305から、FIRフィルタ演算処理部303からの最初の2Nサンプル分の畳込み結果データを出力させるのに続き、CONV演算処理部304から順次出力されるNサンプル毎の畳込み結果データをサンプリング周期毎に順次出力させることにより、効果音入力データの全体に対してインパルス応答データを畳込み演算した効果音出力データ(Lch効果音出力データ212又はRch効果音出力データ213)を、図3の効果装置211から遅延なく出力することが可能となる。
8 is an explanatory diagram showing the processing relationship between the FIR filter calculation processing unit 303 and the CONV calculation processing unit 304. As can be seen from this diagram, if the filter order of the FIR filter calculation processing unit 303 is equal to the FFT size (twice the block size N) of the CONV calculation processing unit 304, the effect of processing delay in the CONV calculation processing unit 304 can be ignored.
That is, when the first 2N samples of the sound effect input data are input to the FIR filter calculation processing unit 303, the sound effect input data is shifted by N samples and input to the CONV calculation processing unit 304 by 2N samples. Then, as shown in Fig. 8, the FIR filter calculation processing unit 303 first performs a convolution operation on the first 2N samples of the sound effect input data with the first 2N samples of the impulse response data of the sound effect (e.g., reverberation or resonance) for each sampling period, and outputs 2N samples of convolution result data without delay for each sampling period. Also, the CONV calculation processing unit 304 performs a convolution operation on the 2N samples of the sound effect input data inputted while overlapping by N samples with the N samples of the impulse response data of the sound effect after 2N+1 samples + N samples of
図9は、図2の効果装置211を実現するために図1のCPU101が実行するメイン処理動作の制御処理例を示すフローチャートである。この制御処理は、CPU101がROM102からRAM103にロードさせた制御処理プログラムを実行する動作である。
Figure 9 is a flowchart showing an example of a control process for a main processing operation executed by the
図1の電子楽器100において、操作子108の電源スイッチがオンされた後、CPU101は、図9のメインフローチャートで示される制御処理の実行を開始する。CPU101はまず、初期化処理を実行する(ステップS901)。図10(a)は、図9のステップS901の初期化処理の詳細処理例を示すフローチャートである。
After the power switch of the
初期化処理において、CPU101は、図1のRAM103の記憶内容、音源(TG)104の状態、電子楽器100の状態等の初期化を行う(図10(a)のステップS1001)。
In the initialization process, the
次に、CPU101は、データの状態を示すフラグF2、F1を初期化する(図10(a)のステップS1002)。F2は、F1の1つ前の割込みタイミングでのデータの状態を示すフラグである。これらのフラグF1、F2が値1の場合、対応する割込みタイミングにおける入力データ列(図2のLch効果音入力データ209又はRch効果音入力データ210)の値が0であることを示し、値0の場合、上記入力データ列に0以外の値があることを示している。
Next, the
続いて、CPU101は、ブロック単位の割込み(図7参照)を許可する(図10(a)のステップS1003)。
Next, the
図9のフローチャートの説明に戻り、ステップS901での上述した初期化処理の後、CPU101は、電源スイッチがオフされるまで或いは操作者による演奏が終了すると判定するまで、ステップS902からS907の一連の処理を繰り返し実行する。
Returning to the explanation of the flowchart in FIG. 9, after the initialization process described above in step S901, the
上記繰返し処理において、CPU101はまず、スイッチ処理を実行する(ステップS902)。ここでは、CPU101は、図1の操作子108の操作状態を検出する。
In the above-mentioned repeated process, the
次に、CPU101は、操作者による押鍵を検出する押鍵検出処理を実行する(ステップS903)。ここでは、CPU101は、図1の鍵盤106の押鍵状態を検出する。
Next, the
次に、CPU101は、操作者によるペダル操作を検出するペダル検出処理を実行する(ステップS904)。ここでは、CPU101は、図1のペダル107の操作状態を検出する。
Next, the
次に、CPU101は、効果処理を実行する(ステップS905)。ここでは、CPU101は、ステップS902での例えば残響や共鳴効果を付与するための操作子108の操作状態の検出結果と、ステップS904でのペダル107の操作状態の検出結果とに基づいて、効果付与部105に、音源(TG)104が生成する図2のLch効果音入力データ209及びRch効果音入力データ210に対して、図3の効果装置211(Lch)及び効果装置211(Rch)による音響効果の付与処理を実行させる。
Next, the
次に、CPU101は、その他の処理を実行する(ステップS906)。ここでは、CPU101は、例えば楽音エンベロープの制御処理等を実行する。
Next, the
そして、CPU101は、発音処理を実行する(ステップS907)。ここでは、CPU101は、ステップS903での押鍵検出処理での鍵盤106の押鍵又は離鍵の状態に基づいて、音源(TG)104に対して発音又は消音の指示を行う。
Then, the
本実施形態では、図1の効果付与部105における効果装置211内のCONV演算処理部304での演算処理は、図1のCPU101からNサンプルのサンプリング時間毎に発生するブロック単位の割込み(図7参照)に基づいて実行される。このように、CPU101は、内部のクロックと与えられた楽音のテンポ等に基づいて、図1及び図2の音源(TG)104から夫々NサンプルのLch直接音出力データ207及びRch直接音出力データ208が出力される毎に、ブロック割込みを発生させる。CPU101は、このブロック割込みが発生すると、図9のメイン処理の動作を中断して、ブロック割込み処理を実行する。
In this embodiment, the calculation process in the CONV calculation processing unit 304 in the effect device 211 in the
図10(b)は、CPU101がブロック割込み発生時に実行するブロック割込み処理の詳細処理例を示すフローチャートである。このブロック割込み処理において、まずCPU101は、ブロック判定処理を実行する(図10(b)のステップS1010)。
Figure 10(b) is a flowchart showing a detailed example of block interrupt processing executed by the
図4から図7の説明で前述したように、図3のCONV演算処理部304での処理では、音源(TG)104から効果付与部105に入力される楽音データであるLch効果音入力データ209及びRch効果音入力データ210は、Nサンプルというブロック単位で更新され、そのブロック単位の2倍の単位である2Nという演算フレームサンプル長で、FFTを含む演算処理が実行されることにより、音響効果が付与される。この場合に、CPU101は、ブロック判定処理部として動作する図10のステップS1010のブロック判定処理において、データ209又はデータ210が、ブロック=Nサンプル単位で演算処理条件を満たしたか否か、より具体的には、ブロック内の全てのデータサンプル値が0であるという条件に合致したか否かを判定し、その判定の結果をブロック管理情報として保持する。ブロック管理情報は例えば、1つ前及び現在のブロックの各判定の結果を、値1(演算処理条件に合致する場合)又は値0(演算処理条件に合致しない場合)として、例えば図1のRAM上の各変数データであるフラグF2及びフラグF1に保持した情報である。
4 to 7, in the processing in the CONV calculation processing unit 304 in FIG. 3, the Lch sound effect input data 209 and the Rch sound effect input data 210, which are musical sound data input from the sound source (TG) 104 to the
図11は、図10(b)のステップS1010のブロック判定処理の詳細処理例を示すフローチャートである。図11のフローチャートの処理において、CPU101はまず、CPU101のレジスタRJ1の値と、図1のRAM103上の変数データである変数iの値を、それぞれ0にリセットする(図11のステップS1101)。
Figure 11 is a flowchart showing a detailed example of the block determination process in step S1010 in Figure 10(b). In the process of the flowchart in Figure 11, the
次に、CPU101は、レジスタRJ1と、図3のCONV演算処理部304に入力すべきLch効果音入力データ209又はRch効果音入力データ210であるRAM103に一時記憶されるNサンプル分のブロック単位の各サンプルのデータ[i](0≦i≦N-1)とで、演算「(RJ1|データ[i])」として各データの対応するビット毎のOR(論理和)演算を実行し、各ビットのOR演算の結果を、レジスタRJ1に格納し直す(図11のステップS1102)。
Next, the
その後、CPU101は、RAM103上の変数iの値を+1インクリメントする(ズ11のステップS1103)。
After that, the
そして、CPU101は、変数iの値がNより小さいか否かを判定する(図11のステップS1104)。
Then, the
ステップS1104の判定がYESならば、CPU101は、ステップS1102の処理に戻って判定処理を続行する。
If the determination in step S1104 is YES, the
やがて、処理したサンプルがブロックサイズNのサンプル数を超えてステップS1104の判定がNOとなったら、CPU101は、レジスタRJ1の値が0であるか(全ビットが0であるか)否かを判定する(図11のステップS1105)。
When the number of processed samples exceeds the number of samples in block size N and the determination in step S1104 becomes NO,
ステップS1105の判定がNOならば、CPU101は、RAM103上のフラグF1に値0を格納してフラグをoffする(図11のステップS1106)。
If the determination in step S1105 is NO, the
ステップS1105の判定がYESならば、CPU101は、RAM103上のフラグF1に値1を格納してフラグをonする(図11のステップS1107)。
If the determination in step S1105 is YES, the
図10(b)のブロック割込み処理の説明に戻り、CPU101は、図11で説明したステップS1010のブロック判定処理に続いて、フレーム演算処理を調整し、実行する(図10(b)のステップS1011)。
Returning to the explanation of the block interrupt process in FIG. 10(b), following the block determination process in step S1010 described in FIG. 11, the
図12(a)は、演算制御処理部として動作する図10のステップS1011のフレーム演算処理の詳細処理例を示すフローチャートである。図12(a)のフローチャートの処理において、CPU101はまず、図11のフローチャートで示される図10のステップS1010のブロック判定処理においてRAM103上のフラグF1の値が1、即ち、現在のブロックのデータが演算処理条件に合致しており(値がオール0であり)、かつ、RAM103上のフラグF2の値も1,即ち、1つ前のブロックのデータが演算処理条件に合致している(値がオール0である)か否かを判定する(図12(a)のステップS1201)。
Fig. 12(a) is a flowchart showing a detailed example of the frame calculation process of step S1011 in Fig. 10 which operates as a calculation control processing unit. In the process of the flowchart in Fig. 12(a), the
ステップS1201の判定がNOならば、CPU101は、現在のブロックと1つ前のブロックとからなる2Nサンプル分のFFTフレームが、値がオール0ではないことを示す非特定フレームの情報を、RAM103上の変数FLに格納する(図12(a)のステップS1202)。
If the determination in step S1201 is NO, the
一方、ステップS1201の判定がYESならば、CPU101は、現在のブロックと1つ前のブロックとからなる2Nサンプル分のFFTフレームが値がオール0であることを示す特定フレームの情報を、変数FLに格納する(図12(a)のステップS1203)。
On the other hand, if the determination in step S1201 is YES, the
その後、CPU101は、図1の効果付与部105内の図2の効果装置211内の図3のCONV演算処理部304に対して、上記変数FLの内容に応じた調整された演算処理を実行させる(図12(a)のステップS1204)。
Then, the
図12(b)は、図12(a)のステップS1204の演算処理の詳細処理例を示すフローチャートである。まずCPU101は、RAM103上の変数FLに特定フレームを示す情報が格納されているか否かを判定する(図12(b)のステップS1210)。
Figure 12(b) is a flowchart showing an example of detailed processing of the calculation process of step S1204 in Figure 12(a). First, the
ステップS1210の判定がNOならば、CPU101は、図1の効果付与部105内の図2の効果装置211内の図3のCONV演算処理部304に対して、図4から図6の説明で前述した通常の畳み込み演算処理を実行させる通常演算の実行を指示する(図12(b)のステップS1211)。
If the determination in step S1210 is NO, the
一方、ステップS1210の判定がYESならば、CPU101は、CONV演算処理部304に対して、上記通常の畳み込み演算処理とは異なる演算処理、例えば、所定のサンプル値、より具体的にはオール0の値を有する2Nサンプル分のFFTフレームデータを出力させる特定フレーム処理の実行を指示する(図12(b)のステップS1212)。このように、CPU101は、通常演算を実行するか、通常の畳み込み演算処理とは異なる演算処理を実行するかを調整する。
On the other hand, if the determination in step S1210 is YES, the
図13は、上述の特定フレーム処理を含むCONV演算処理部304の動作説明図である。前述した図6の動作説明図は、そのような特定フレーム処理は含まずに全て通常演算が実行される場合の例であった。これに対して、図13の動作説明図において、図6の場合と同様にブロックサイズN=2で計算した場合を考え、データとして、例えば、
conv(coef=[2 3 4 5 6 7 8 9]
sig=[1 2 0 0 0 0 0 0 9 10])
が入力した場合を考える。括弧内の数値は模式的に振幅値を表している。このように、楽音データsigには、特定処理に対応する状態として、3サンプル目から8サンプル目まで値0が入力されている。
13 is an explanatory diagram of the operation of the CONV calculation processing unit 304 including the above-mentioned specific frame processing. The explanatory diagram of the operation in FIG. 6 described above was an example of a case where all normal calculations are performed without including such specific frame processing. In contrast, in the explanatory diagram of the operation in FIG. 13, a case where calculation is performed with block size N=2 as in the case of FIG. 6, for example, the following data is used:
conv(coef = [2 3 4 5 6 7 8 9]
sig = [1 2 0 0 0 0 0 0 9 10]
In this way, the
この場合に例えば、図13(a)のブロック割込みのタイミングにおいて、図3のLch効果音入力データ209又はRch効果音入力データ210に対応する入力データdataとして2NサンプルからなるFFTフレーム[0 0 1 2]が演算対象とされた場合、現在のブロックデータ[1 2]は入力データdataの先頭で1つ前のブロックデータは存在せず便宜的にオール0=[0 0]が挿入されるため、図10(a)のステップS1002の初期化処理により、フラグF2=1と初期設定されたままとなる。
一方、現在のブロックの入力データdata=[1 2]はオール0の値ではないため、図11のブロック判定処理のステップS1101→ステップS1102~ステップS1104のN=2回の繰返し処理→ステップS1105→ステップS1106により、フラグF1=0に設定される。従って、図13(a)のブロック割込みタイミングでの2N=4サンプルの入力データdata=[0 0 1 2]によって表される1番目のFFTフレームは、フラグ(F2,F1)=(0,1)となって、図12(a)のステップS1201→S1202により非特定フレームとなる。この結果、係数coef=[0 0 2 3]と入力データdata=[0 0 1 2]との間では、図12(b)のステップS1210→S1211により通常演算処理が指示される。
この通常演算処理では、CPU101は、CONV演算処理部304に対して、図4から図6を用いて前述した通常の畳み込み演算処理の実行を指示する。
In this case, for example, at the timing of the block interrupt in FIG. 13(a), if an FFT frame [0 0 1 2] consisting of 2N samples is to be calculated as input data (data) corresponding to the Lch sound effect input data 209 or the Rch sound effect input data 210 in FIG. 3, the current block data [1 2] is at the beginning of the input data (data), and since there is no previous block data at the beginning, all 0's = [0 0] are inserted for the sake of convenience, and therefore flag F2 remains initialized as 1 by the initialization process in step S1002 in FIG. 10(a).
On the other hand, since the input data data=[1 2] of the current block is not all 0, the flag F1 is set to 0 by step S1101 of the block determination process in Fig. 11, N=2 repetitions of steps S1102 to S1104, step S1105, and step S1106. Therefore, the first FFT frame represented by the input data data=[0 0 1 2] of 2N=4 samples at the block interrupt timing in Fig. 13(a) has flag (F2, F1)=(0, 1), and becomes a non-specific frame by step S1201→S1202 in Fig. 12(a). As a result, between the coefficient coef=[0 0 2 3] and the input data data=[0 0 1 2], normal calculation processing is instructed by step S1210→S1211 in Fig. 12(b).
In this normal calculation process, the
次に例えば、図13(b)のブロック割込みのタイミングにおいて、図13(a)のブロック割込みのタイミングの入力データdataがN=2サンプルシフトして、入力データdataとして2NサンプルからなるFFTフレーム[1 2 0 0]が演算対象とされたとき、1つ前のブロックデータ[1 2]は値がオール0ではなくそのフラグF2には、図13(a)のブロック割込みタイミングにおいて図12(a)のフレーム演算処理のステップS1205によりフラグF1からコピーされた値0がセットされている。
また、現在のブロックの入力データdata=[0 0]は値がオール0であるため、図11のブロック判定処理のステップS1101→ステップS1102~ステップS1104のN=2回の繰返し処理→ステップS1105→ステップS1107により、フラグF1=1に設定される。従って、図13(b)のブロック割込みタイミングでの2N=4サンプルの入力データdata=[1 2 0 0]によって表される2番目のFFTフレームは、フラグ(F2,F1)=(1,0)となって、図12(a)のステップS1201→S1202により非特定フレームとなる。この結果、係数coef=[0 0 2 3]と入力データdata=[1 2 0 0]との間では、図12(b)のステップS1210→S1211により前述した通常演算が指示される。
この通常演算処理では、図13(a)のブロック割込みタイミングの場合と同様に、CPU101は、CONV演算処理部304に対して、図4から図6を用いて前述した通常の畳み込み演算処理の実行を指示する。
Next, for example, at the block interrupt timing of FIG. 13(b), when the input data DATA at the block interrupt timing of FIG. 13(a) is shifted by N=2 samples and an FFT frame [1 2 0 0] consisting of 2N samples is used as the input data DATA for calculation, the value of the previous block data [1 2] is not all 0, and its flag F2 is set to the
Also, since the input data data=[0 0] of the current block has a value of all 0, the flag F1 is set to 1 by step S1101 of the block determination process in Fig. 11, N=2 repetitions of steps S1102 to S1104, step S1105, and step S1107. Therefore, the second FFT frame represented by the input data data=[1 2 0 0] of 2N=4 samples at the block interrupt timing in Fig. 13(b) has flag (F2, F1)=(1, 0), and becomes a non-specific frame by step S1201→S1202 in Fig. 12(a). As a result, between the coefficient coef=[0 0 2 3] and the input data data=[1 2 0 0], the normal calculation described above is instructed by step S1210→S1211 in Fig. 12(b).
In this normal calculation process, similarly to the case of the block interrupt timing of FIG. 13A, the
続いて例えば、図13(c)のブロック割込みのタイミングにおいて、図13(b)のブロック割込みのタイミングの入力データdataがN=2サンプルシフトして、入力データdataとして2NサンプルからなるFFTフレーム[0 0 0 0]が演算対象とされた場合、1つ前のブロックデータ[0 0]は値がオール0でそのフラグF2には、図13(b)のブロック割込みタイミングにおいて図12(a)のフレーム演算処理のステップS1205によりフラグF1からコピーされた値1がセットされている。
また、現在のブロックの入力データdata=[0 0]は値がオール0であるため、図11のブロック判定処理のステップS1101→ステップS1102~ステップS1104のN=2回の繰返し処理→ステップS1105→ステップS1107により、フラグF1=1に設定される。従って、図13(b)のブロック割込みタイミングでの2N=4サンプルの入力データdata=[0 0 0 0]によって表される3番目のFFTフレームは、フラグ(F2,F1)=(0,0)となって、図12(a)のステップS1201→S1203により、特定フレームとなる。この結果、係数coef=[0 0 2 3]と入力データdata=[0 0 0 0]との間では、図12(b)のステップS1210→S1212により特定フレーム処理が実行される。
この特定フレーム処理では、CPU101は、CONV演算処理部304に対して、オール0の値を有する2Nサンプル分のFFTフレームデータを出力させる。従って、この3番目のFFTフレームの処理においては、乗算のために必要であったメモリが解放され、他の処理がその空きスロットを利用できるようになり、効果付与部105におけるメモリの利用効率を向上させることが可能となる。
Next, for example, at the block interrupt timing of FIG. 13(c), if the input data 'data' at the block interrupt timing of FIG. 13(b) is shifted by N=2 samples and an FFT frame [0 0 0 0] consisting of 2N samples is used as the input data 'data' for calculation, the previous block data [0 0] has a value of all 0 and its flag F2 is set to the
Also, since the input data data=[0 0] of the current block has a value of all 0, the flag F1 is set to 1 by step S1101 of the block determination process in Fig. 11, N=2 repetitions of steps S1102 to S1104, step S1105, and step S1107. Therefore, the third FFT frame represented by the input data data=[0 0 0 0] of 2N=4 samples at the block interrupt timing in Fig. 13(b) has flag (F2, F1)=(0, 0), and becomes a specific frame by step S1201→S1203 in Fig. 12(a). As a result, between the coefficient coef=[0 0 2 3] and the input data data=[0 0 0 0], specific frame processing is executed by step S1210→S1212 in Fig. 12(b).
In processing this particular frame, the
更に続いて例えば、図13(d)のブロック割込みのタイミングにおいて、図13(c)のブロック割込みのタイミングの入力データdataがN=2サンプルシフトして、入力データdataとして2NサンプルからなるFFTフレーム[0 0 0 0]が演算対象とされた場合、1つ前のブロックデータ[0 0]は値がオール0でそのフラグF2には、図13(c)のブロック割込みタイミングにおいて図12(a)のフレーム演算処理のステップS1205によりフラグF1からコピーされた値1がセットされている。
また、現在のブロックの入力データdata=[0 0]は値がオール0であるため、図11のブロック判定処理のステップS1101→ステップS1102~ステップS1104のN=2回の繰返し処理→ステップS1105→ステップS1107により、フラグF1=1に設定される。従って、図13(b)のブロック割込みタイミングでの2N=4サンプルの入力データdata=[0 0 0 0]によって表される4番目のFFTフレームは、フラグ(F2,F1)=(0,0)となって、図12(a)のステップS1201→S1203により、特定フレームとなる。この結果、係数coef=[0 0 2 3]と入力データdata=[0 0 0 0]との間では、図12(b)のステップS1210→S1212により特定フレーム処理が指示される。
図13(d)のブロック割込みタイミングにおいて実行される特定フレーム処理では、図13(c)のブロック割込みタイミングにおいて実行された特定フレーム処理の場合と同様に、CPU101は、CONV演算処理部304に対して、オール0の値を有する2Nサンプル分のFFTフレームデータを出力させる。従って、この4番目のFFTフレームの処理においても、3番目のFFTフレームの処理の場合と同様に、乗算のために必要であったメモリが解放され、他の処理がその空きスロットを利用できるようになり、効果付与部105におけるメモリの利用効率を向上させることが可能となる。
12A in step S1205 of the frame calculation process in FIG. 12A. Furthermore, for example, at the block interrupt timing of FIG. 13D, if the input data 'data' at the block interrupt timing of FIG. 13C is shifted by N=2 samples and an FFT frame [0 0 0 0] consisting of 2N samples is subjected to calculation as the input data 'data', the previous block data [0 0] has a value of all 0 and its flag F2 is set to the
Also, since the input data data=[0 0] of the current block has a value of all 0, the flag F1 is set to 1 by step S1101 of the block determination process in Fig. 11, N=2 repetitions of steps S1102 to S1104, step S1105, and step S1107. Therefore, the fourth FFT frame represented by the input data data=[0 0 0 0] of 2N=4 samples at the block interrupt timing in Fig. 13(b) has flag (F2, F1)=(0, 0), and becomes a specific frame by step S1201→S1203 in Fig. 12(a). As a result, between the coefficient coef=[0 0 2 3] and the input data data=[0 0 0 0], specific frame processing is instructed by step S1210→S1212 in Fig. 12(b).
In the specific frame processing executed at the block interrupt timing of Fig. 13(d), similarly to the specific frame processing executed at the block interrupt timing of Fig. 13(c), the
以下同様に、図13の動作説明図において、(e)、(f)、(g)、(h)、(k)、(l)、(m)、(n)、(q)、(r)、(s)、(t)、(w)、及び(x)のブロック割込みタイミングにおいては、CPU101は、CONV演算処理部304に対して、図4から図6を用いて前述した通常の畳み込み演算処理の実行を指示する。
一方、図13の動作説明図において、(i)、(j)、(o)、(p)、(u)、及び(v)のブロック割込みタイミングにおいては、CPU101は、CONV演算処理部304に対して、特定フレーム処理を指示し、オール0の値を有する2Nサンプル分のFFTフレームデータを出力させる。従って、これらのFFTフレームの処理においては、乗算のために必要であったメモリが解放され、他の処理がその空きスロットを利用できるようになり、効果付与部105におけるメモリの利用効率を向上させることが可能となる。
Similarly, in the operation explanatory diagram of FIG. 13, at the block interrupt timings of (e), (f), (g), (h), (k), (l), (m), (n), (q), (r), (s), (t), (w), and (x), the
13, at the block interrupt timings of (i), (j), (o), (p), (u), and (v), the
図14は、図10のブロック割込み処理におけるステップS1010のブロック判定処理の他の詳細処理例を示すフローチャートである。図14において、図11の場合と同じ処理を実行する処理には、同じステップ番号を付してある。 Figure 14 is a flowchart showing another detailed example of the block determination process of step S1010 in the block interrupt process of Figure 10. In Figure 14, the same step numbers are assigned to processes that execute the same processes as in Figure 11.
前述した図11のブロック判定処理の詳細処理例では、図11のステップS1102において、CPU101は、レジスタRJ1と、Nサンプル分のブロック単位の各サンプルのデータ[i](0≦i≦N-1)とで、演算「(Rj1|データ[i])」として各データの対応するビット毎のOR(論理和)演算を実行し、各ビットのOR演算の結果を、レジスタRJ1に格納し直す処理を繰り返すことにより、Nサンプル分のブロック単位の全てのサンプルのデータ[i](0≦i≦N-1)がオール0の値であることを検出し、特定フレームを検出した。
In the detailed processing example of the block determination process in FIG. 11 described above, in step S1102 in FIG. 11, the
これに対して図14のブロック判定処理の他の詳細処理例では、CPU101はまず、図14のステップS1401において、レジスタRJ1と、Nサンプル分のブロック単位の各サンプルのデータ[i](0≦i≦N-1)の模式的な振幅値の絶対値を演算した結果とで、演算「(Rj1|abs(データ[i]))」として各データの対応するビット毎のOR(論理和)演算を実行し、各ビットのOR演算の結果を、レジスタRJ1に格納し直す処理を繰り返す。ここで、「abs()」は、括弧内の数値の絶対値を演算する処理を表している。
In contrast to this, in another detailed processing example of the block determination process in FIG. 14, the
次に、CPU101は、ステップS1401→S1103→S1104→S1401のブロック全体のNサンプル分の繰返し処理によりレジスタRJ1に得られた値と、特定の閾値以下の値に対応するビットが0で、その閾値よりも大きい値に対応するビットが1であるマスキングデータThとで、「(RJ1&Th)」で示されるビット毎のAND(論理積)演算を実行し、各ビットのAND演算の結果を、レジスタRJ1に格納し直す処理を実行する(図14のステップS1402)。
Next,
そして、CPU101は、図11のステップS1105からステップS1107の場合と同様にして、ステップS1402により得られたレジスタRJ1の値が0(全ビットが0)であれば、RAM103上のフラグF1に値1を格納してフラグをonし(図14のステップS1105の判定がYES→S1107)、そうでなければ、フラグF1に値0を格納してフラグをoffする(図14のステップS1105の判定がNO→S1106)。
Then, similarly to steps S1105 to S1107 in FIG. 11, if the value of register RJ1 obtained in step S1402 is 0 (all bits are 0),
上述の図14のブロック判定処理の他の詳細処理例では、Nサンプル分のブロック単位のデータ[i](0≦i≦N-1)の値が、オール0ではなく小さな値を有している程度であれば、「(RJ1&Th)」で示されるビット毎のAND(論理積)演算により、レジスタRJ1に得られた小さな値の累積値が、マスキングデータThの上位ビット=1、下位ビット=0のマスキングデータの0値の下位ビットによってマスキングされて、その結果が0となり、レジスタRJ1に再設定されて、ステップS1105の判定がYESとなって、フラグF1=1、即ち特定フレームと判定される。 In another detailed processing example of the block determination process of FIG. 14 described above, if the values of block-based data [i] (0≦i≦N-1) for N samples are not all 0 but are small values, then the accumulated value of small values obtained in register RJ1 is masked by the lower bits of the masking data Th, which has upper bits = 1 and lower bits = 0, by a bit-wise AND (logical product) operation shown as "(RJ1 & Th)", and the result becomes 0, which is reset in register RJ1, the determination in step S1105 becomes YES, and flag F1 = 1, i.e., it is determined to be a specific frame.
一方、Nサンプル分のブロック単位のデータ[i](0≦i≦N-1)の値の何れかが大きな値を有していれば、「(RJ1&Th)」で示されるビット毎のAND(論理積)演算により、レジスタRJ1に得られた大きな値の累積値が、マスキングデータThの上位ビット=1とのAND演算によりマスキングされきれずに値として残ってしまい、その値がレジスタRJ1に再設定される結果、ステップS1105の判定がNOとなって、フラグF1=0、即ち非特定フレームと判定される。 On the other hand, if any of the values of the block-unit data [i] (0≦i≦N-1) for N samples has a large value, the bitwise AND (logical product) operation indicated by "(RJ1 & Th)" causes the accumulated value of the large value obtained in register RJ1 to be unable to be completely masked by the AND operation with the upper bit of the masking data Th = 1 and remain as a value, and this value is reset in register RJ1. As a result, the determination in step S1105 becomes NO, and flag F1 = 0, i.e., it is determined to be a non-specific frame.
以上のようにして、図14のブロック判定処理の他の詳細処理例では、ブロック単位のデータ[i](0≦i≦N-1)が微小な値を有している程度であれば、特定フレームと判定することにより、CONV演算処理部304における演算処理をより削減することが可能となり、効果付与部105全体の利用効率を向上させることが可能となる。
As described above, in another detailed processing example of the block determination process in FIG. 14, if the block-unit data [i] (0≦i≦N-1) has a very small value, it is determined to be a specific frame, making it possible to further reduce the calculation processing in the CONV calculation processing unit 304 and improve the utilization efficiency of the
特には図示しないが、更に別の変形例として、ブロックがマスキングデータThで規定される閾値を跨いだ場合を検出して、閾値を跨ぐ場合は、入力するブロック単位のデータに対してエンベロープに相当するレベル操作を行ってから、特定フレーム処理を行うようにしてもよい。 Although not specifically shown, as yet another modified example, it is possible to detect when a block crosses a threshold defined by the masking data Th, and if the block crosses the threshold, perform a level operation equivalent to an envelope on the input block-based data before performing specific frame processing.
同様の意図で、入力の前段にノイズゲート処理を追加する形も考えられる。 With a similar intention, it is also possible to add noise gate processing before the input.
更に、ここまで説明した実施形態では、図2のLch効果音入力データ209又はRch効果音入力データ210を音源(TG)104から効果付与部105に受け渡す時にブロック判定を行っているが、音源(TG)104での楽音生成時にフラグ情報F1を生成して受け渡す形式としてもよい。
Furthermore, in the embodiment described so far, block determination is performed when the Lch sound effect input data 209 or the Rch sound effect input data 210 in FIG. 2 is transferred from the sound source (TG) 104 to the
また、上述の実施形態では、ブロック単位の演算処理としてFFTを使用した畳込み演算処理を例示したが、効果処理を行う場合でも、ブロック単位で所定条件の判定を行い、通常の演算か、特定フレーム処理を行うかを調整するようにしてもよい。同一ブロックを並列処理する場合などでも有効である。 In addition, in the above embodiment, convolution calculation processing using FFT was exemplified as block-based calculation processing, but even when performing effect processing, it is possible to determine a predetermined condition on a block-by-block basis and adjust whether to perform normal calculation or specific frame processing. This is also effective when processing the same block in parallel.
以上説明したようにして、本実施形態によれば、音源、CPU、効果付与部等でメモリを共有するような場合に、ブロック単位又はそれに基づくフレーム等の単位で楽音データが演算処理条件に合致したか否かを判定し、その判定の結果をブロック管理情報として保持し、そのブロック管理情報に基づいて音響効果を付与する演算処理を間引く等することにより、メモリアクセスを減少させるようにした。この結果、メモリスロットに空きができるので、他の処理が空いたスロットを使うことができ、効果付与装置全体の処理効率を向上させることが可能となる。
同一処理内容を行う場合はメモリアクセスが減るため、メモリが外部高速メモリなどの場合では電気的にも有利になる。
また、以上の説明では、本発明の音声出力音出力制御に係るプログラムをROM102に格納していることを示したが、これに限らず、コンピュータ読み取り可能な媒体としてフラッシュメモリなどの不揮発性メモリなどを適用してもよく、その他のコンピュータ読み取り可能な媒体として、MRAMなどの他の不揮発性メモリ、HDD(Hard Disk Drive)や、CD-ROM、DVDディスクなどの可搬型記録媒体を適用することが可能である。また、本発明に係るプログラムのデータを通信回線を介して提供する媒体として、キャリアウェーブ(搬送波)も本発明に適用される。
その他、上記実施の形態で示した具体的な構成、処理動作の内容及び手順などは、本発明の趣旨を逸脱しない範囲において適宜変更可能である。本発明の範囲は、特許請求の範囲に記載した発明の範囲とその均等の範囲を含む。
As described above, according to this embodiment, when memory is shared by the sound source, CPU, effect imparting section, etc., it is judged whether the musical sound data matches the calculation processing conditions in units of blocks or in units of frames based thereon, and the result of the judgment is stored as block management information, and memory access is reduced by thinning out the calculation processing for imparting sound effects based on the block management information. As a result, memory slots become available, and other processing can use the vacant slots, making it possible to improve the processing efficiency of the entire effect imparting device.
Since the number of memory accesses is reduced when performing the same processing content, this is also advantageous electrically when the memory is an external high-speed memory.
In the above description, the program relating to the audio output sound output control of the present invention is stored in
In addition, the specific configurations, contents and procedures of the processing operations, etc. shown in the above embodiments can be modified as appropriate without departing from the spirit of the present invention. The scope of the present invention includes the scope of the invention described in the claims and its equivalents.
100 電子楽器
101 CPU
102 ROM
103、306 RAM
104 音源(TG)
105 効果付与部
106 鍵盤
107 ペダル
108 操作子
109 システムバス
110 サウンドシステム
201 楽音生成部
202 ミキシング部
203、204、205、206 ミキサ
207 Lch直接音出力データ
208 Rch直接音出力データ
209 Lch効果音入力データ
210 Rch効果音入力データ
212 Lch効果音出力データ
213 Rch効果音出力データ
214 Lch楽音出力データ
215 Rch楽音出力データ
303 FIRフィルタ演算処理部
304 CONV演算処理部
305 加算部
100 Electronic
102 ROM
103, 306 RAM
104 Sound source (TG)
REFERENCE SIGNS
Claims (9)
前記楽音データが前記ブロック単位で演算処理条件を満たしたか否かを示すブロック管理情報に基づいて前記演算処理部での前記演算処理を調整する演算制御処理部と、
を備える効果付与装置。 A calculation processing unit that executes calculation processing for adding sound effects to musical sound data generated by a sound source in units of blocks;
an arithmetic control processing unit that adjusts the arithmetic processing in the arithmetic processing unit based on block management information that indicates whether or not the musical sound data satisfies an arithmetic processing condition in block units;
An effect imparting device comprising:
夫々の演算フレームにおいて、前記演算フレームに含まれる前記ブロック管理情報が前記演算処理条件に合致したことを示している場合に、前記演算制御処理部は前記演算処理部に対して、前記音響効果を付与する演算処理の代わりに、特定のサンプル値を有するデータを出力する処理を指示する、請求項2に記載の効果付与装置。 The arithmetic processing includes a fast Fourier transform calculation of a predetermined calculation frame sample length,
3. The effect imparting device of claim 2, wherein, in each calculation frame, when the block management information contained in the calculation frame indicates that the calculation processing conditions are met, the calculation control processing unit instructs the calculation processing unit to perform a process of outputting data having a specific sample value instead of a calculation process that imparts the sound effect.
前記楽音データが前記ブロック単位で演算処理条件に合致したか否かを示すブロック管理情報に基づいて前記演算処理を調整する演算制御処理と、
を実行する効果付与方法。 A computation process for adding sound effects to the musical sound data generated by the sound source in units of blocks;
a calculation control process for adjusting the calculation process based on block management information indicating whether the musical sound data matches a calculation processing condition on a block basis;
A method of applying the effect.
前記楽音データが前記ブロック単位で演算処理条件を満たしたか否かを示すブロック管理情報に基づいて前記演算処理を調整する演算制御処理と、
をコンピュータに実行させるためのプログラム。
A computation process for adding sound effects to the musical sound data generated by the sound source in units of blocks;
a calculation control process for adjusting the calculation process based on block management information indicating whether the musical sound data satisfies a calculation processing condition on a block-by-block basis;
A program for causing a computer to execute the following.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2022152069A JP2024046785A (en) | 2022-09-26 | 2022-09-26 | Effect imparting device, method, and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2022152069A JP2024046785A (en) | 2022-09-26 | 2022-09-26 | Effect imparting device, method, and program |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2024046785A true JP2024046785A (en) | 2024-04-05 |
Family
ID=90527132
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2022152069A Pending JP2024046785A (en) | 2022-09-26 | 2022-09-26 | Effect imparting device, method, and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2024046785A (en) |
-
2022
- 2022-09-26 JP JP2022152069A patent/JP2024046785A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4726875B2 (en) | Audio signal processing method and apparatus | |
US7612281B2 (en) | Reverberation effect adding device | |
US10204610B2 (en) | Musical note generation device, electronic musical instrument, method, and storage medium | |
CN108242232B (en) | Musical sound generation device, electronic musical instrument, musical sound generation method, and storage medium | |
CN108630189B (en) | Filter operation processing device, filter operation method, and effect providing device | |
CN104704855A (en) | System and method for reducing latency in transposer-based virtual bass systems | |
JP2565073B2 (en) | Digital signal processor | |
JP2024046785A (en) | Effect imparting device, method, and program | |
JP7147814B2 (en) | SOUND PROCESSING APPARATUS, METHOD AND PROGRAM | |
TW200903447A (en) | Efficient identification of sets of audio parameters | |
JP7147804B2 (en) | Effect imparting device, method and program | |
US6031916A (en) | Sound effect adding device using DSP | |
JP5169584B2 (en) | Impulse response processing device, reverberation imparting device and program | |
JP3120483B2 (en) | Effect adding device | |
WO2023092368A1 (en) | Audio separation method and apparatus, and device, storage medium and program product | |
JP3991475B2 (en) | Audio data processing apparatus and computer system | |
WO2020195041A1 (en) | Filter effect imparting device, electronic musical instrument, and control method for electronic musical instrument | |
JP2024046786A (en) | AUDIO SIGNAL PROCESSING APPARATUS, METHOD, AND PROGRAM | |
JP3036417B2 (en) | Signal processing device | |
JP2005148210A (en) | Generating system, reproducing apparatus, generating method, reproducing method, and program | |
JP3027832B2 (en) | Musical sound wave generator | |
JP2015079131A (en) | Acoustic signal processing device and acoustic signal processing program | |
JPH04104200A (en) | Device and method for voice speed conversion | |
JP4106739B2 (en) | Digital signal processing method and digital signal processing apparatus | |
JPH07175477A (en) | Signal processor |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
RD03 | Notification of appointment of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7423 Effective date: 20231011 |