JP2016142962A - Program and waveform generation device - Google Patents

Program and waveform generation device Download PDF

Info

Publication number
JP2016142962A
JP2016142962A JP2015019912A JP2015019912A JP2016142962A JP 2016142962 A JP2016142962 A JP 2016142962A JP 2015019912 A JP2015019912 A JP 2015019912A JP 2015019912 A JP2015019912 A JP 2015019912A JP 2016142962 A JP2016142962 A JP 2016142962A
Authority
JP
Japan
Prior art keywords
phase information
modulation
waveform
phase
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2015019912A
Other languages
Japanese (ja)
Other versions
JP6428326B2 (en
Inventor
光 加瀬
Hikaru Kase
光 加瀬
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 JP2015019912A priority Critical patent/JP6428326B2/en
Publication of JP2016142962A publication Critical patent/JP2016142962A/en
Application granted granted Critical
Publication of JP6428326B2 publication Critical patent/JP6428326B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Electrophonic Musical Instruments (AREA)

Abstract

PROBLEM TO BE SOLVED: To suppress unintended variation in pitch of output waveform data even when the output waveform data is generated based upon phase information having been subjected to modulation processing whose processing contents dynamically change.SOLUTION: A waveform generation device inputs second phase information to a waveform information acquisition part 204, the second phase information being obtained by correction using a correction value Adj for correcting a deviation in varying period of first phase information, caused by modulation using a modulation value Mod, on the first phase information and modulation using the modulation value Mod when the waveform generation device is provided with a waveform information acquisition part 204 which generates, as waveform information, a sample value corresponding to input phase information based upon the input phase information, a phase counter 201 which generates the first phase information based upon supplied frequency information, and an addition part 203 which modulates the first phase information using the modulation value Mod calculated by a modulation value arithmetic part 205 based upon the waveform information generated by the waveform information acquisition part 204.SELECTED DRAWING: Figure 3

Description

この発明は、コンピュータに波形情報を生成する機能を実現させるためのプログラム及び、波形情報を生成する機能を備える波形生成装置に関する。   The present invention relates to a program for realizing a function of generating waveform information in a computer, and a waveform generation apparatus having a function of generating waveform information.

従来から、指定されたピッチに従ってサンプル期間毎の位相情報を生成し、その位相情報と対応する正弦波テーブルの値を読み出し、サンプル期間毎の波形データとして出力することにより、指定されたピッチの楽音に係る波形データを出力する技術が知られている。   Conventionally, by generating phase information for each sample period according to the specified pitch, reading the value of the sine wave table corresponding to the phase information and outputting it as waveform data for each sample period, the musical sound of the specified pitch A technique for outputting waveform data according to the above is known.

この技術において、特許文献1に記載のように、生成した位相情報に、正弦波テーブルから読み出した波形データを帰還させて位相情報を変調するようにすることが知られている。このような変調を行った位相情報と対応する正弦波テーブルの値を読み出すことにより、複雑な波形の波形データを出力することができる。   In this technique, as described in Patent Document 1, it is known to modulate phase information by feeding back waveform data read from a sine wave table to generated phase information. By reading the values of the sine wave table corresponding to the phase information subjected to such modulation, it is possible to output waveform data of a complicated waveform.

特開2001−175264号公報JP 2001-175264 A

しかしながら、特許文献1に記載のような変調を行う場合、変調に必要な処理、例えば読み出した波形データに基づき変調量を算出する処理、に要する時間に起因して、変調前の位相情報の変化周期と、変調後の位相情報の変化周期とにずれが生じてしまう。このずれは、例えば図4に示すものであり、実線が、変調前の位相情報の変化周期を示し、点線が、変調前の位相情報の変化周期を示す。   However, when the modulation described in Patent Document 1 is performed, the change in the phase information before the modulation is caused by the time required for the process necessary for the modulation, for example, the process for calculating the modulation amount based on the read waveform data. There is a difference between the period and the change period of the phase information after modulation. This deviation is shown in FIG. 4, for example. The solid line indicates the change period of the phase information before modulation, and the dotted line indicates the change period of the phase information before modulation.

このようなずれが生じると、変調後の位相情報を用いて出力波形データを取得した場合のその出力波形データの位相が、変調前の位相情報を用いて出力波形データを取得したとした場合のその出力波形データの位相からずれてしまうことになる。
特許文献1に記載のような従来の装置においては、変調処理の内容が一定であったし、さほど大きな位相ずれが生じるような変調処理も行っていなかったため、この点はあまり問題となっていなかった。
When such a deviation occurs, the phase of the output waveform data when the output waveform data is acquired using the phase information after modulation is the case where the output waveform data is acquired using the phase information before modulation. The output waveform data will be out of phase.
In the conventional apparatus as described in Patent Document 1, the content of the modulation process is constant, and the modulation process that causes a large phase shift is not performed. It was.

しかし、この位相ずれの大きさは、変調処理の内容が変化すれば、それに応じて変化することになる。このため、変調処理の内容をダイナミックに変化させようとした場合、その変化に応じて出力波形データの位相も変化してしまうこととなり、位相変化に伴うドップラー効果により、出力波形データのピッチも意図せず変化してしまうという問題が生じる。
また、位相情報に基づく出力波形データの取得に正弦波テーブル以外のテーブルを用いる場合でも、また、テーブル以外の手段を用いる場合でも、これと同様な問題が生じ得る。
However, the magnitude of this phase shift will change accordingly if the content of the modulation process changes. For this reason, when the contents of the modulation process are changed dynamically, the phase of the output waveform data also changes in accordance with the change, and the pitch of the output waveform data is also intended due to the Doppler effect accompanying the phase change. The problem of changing without causing arises.
Further, even when a table other than the sine wave table is used for acquiring the output waveform data based on the phase information, or when a means other than the table is used, the same problem can occur.

この発明は、このような事情に鑑みてなされたものであり、処理内容がダイナミックに変化する変調処理を施された位相情報に基づき出力波形データを生成する場合でも、出力波形データにおける意図しないピッチの変化を抑えられるようにすることを目的とする。   The present invention has been made in view of such circumstances, and an unintended pitch in output waveform data even when generating output waveform data based on phase information subjected to modulation processing whose processing contents change dynamically. The purpose is to be able to suppress changes in

この発明は、上記の目的を達成するため、コンピュータを、入力する位相情報に基づきその位相情報と対応するサンプル値を波形情報として生成する波形生成手段と、供給された周波数情報に基づき第1位相情報を生成する位相情報生成手段と、上記第1位相情報を、上記波形生成手段が生成した波形情報を用いて変調する変調手段と、上記変調手段による変調により生じる位相情報の変動周期のずれを補正する補正手段と、上記波形生成手段に対し、上記第1位相情報に対し上記変調手段による変調と上記補正手段による補正とを加えた第2位相情報を入力する入力手段として機能させるためのプログラムを提供する。   In order to achieve the above object, according to the present invention, a computer generates a first phase based on the supplied frequency information, waveform generating means for generating, as waveform information, sample values corresponding to the phase information based on the input phase information. A phase information generating means for generating information; a modulating means for modulating the first phase information using the waveform information generated by the waveform generating means; and a shift in a fluctuation cycle of the phase information caused by the modulation by the modulating means. Correction program for correcting and program for causing the waveform generation means to function as input means for inputting second phase information obtained by adding modulation by the modulation means and correction by the correction means to the first phase information I will provide a.

このようなプログラムにおいて、上記補正手段が、上記変調手段による変調後の位相情報が所定の値となった時点における、変調前後の位相情報の差分を上記変動周期のずれ量として検出し、その差分だけ、上記変調手段による変調前の位相情報を補正するようにするとよい。
あるいは、上記補正手段が、上記第2位相情報が所定の値となった時点における、上記第1位相情報と上記第2位相情報の差分を検出し、その差分だけ位相情報の補正量を調整し、その調整後の補正量だけ位相情報を補正するようにするとよい。
In such a program, the correction means detects the difference between the phase information before and after the modulation when the phase information after the modulation by the modulation means reaches a predetermined value, and detects the difference between the fluctuation periods. Therefore, it is preferable to correct the phase information before modulation by the modulation means.
Alternatively, the correction means detects a difference between the first phase information and the second phase information when the second phase information reaches a predetermined value, and adjusts the correction amount of the phase information by the difference. The phase information is preferably corrected by the correction amount after the adjustment.

さらに、上記補正手段に、上記補正に係る補正量の時間変化を、検出した上記変動周期のずれ量の時間変化よりも緩慢にする手段を設けるとよい。
また、この発明は、上記のようにプログラムとして実施する他、装置、システム、方法、記録媒体等、任意の態様で実施することができる。
Furthermore, the correction means may be provided with means for making the time change of the correction amount related to the correction slower than the time change of the detected shift amount of the fluctuation period.
Further, the present invention can be implemented in any mode such as an apparatus, a system, a method, a recording medium, etc., in addition to being implemented as a program as described above.

以上のような構成によれば、処理内容がダイナミックに変化する変調処理を施された位相情報に基づき出力波形データを生成する場合でも、出力波形データにおける意図しないピッチの変化を抑えることができる。   According to the above configuration, even when output waveform data is generated based on phase information that has been subjected to modulation processing whose processing contents change dynamically, an unintended pitch change in the output waveform data can be suppressed.

この発明の一実施形態である波形生成装置のハードウェア構成を示す図である。It is a figure which shows the hardware constitutions of the waveform generation apparatus which is one Embodiment of this invention. 図1に示した波形生成装置における波形データの生成及び出力に係る機能の構成を示す図である。It is a figure which shows the structure of the function which concerns on the production | generation and output of the waveform data in the waveform generation apparatus shown in FIG. 図2に示した波形生成部の機能構成をより詳細に示す図である。It is a figure which shows the function structure of the waveform generation part shown in FIG. 2 in detail. 加算部202による補正を行わない状態での、第1位相情報と、第1位相情報を変調して得られる第2位相情報の経時変化の例を示す図である。It is a figure which shows the example of a time-dependent change of 1st phase information in the state which does not correct | amend by the addition part 202, and 2nd phase information obtained by modulating 1st phase information. 位相カウンタ201が出力する位相値と、加算部202による補正後の第1位相情報と、その補正後の第1位相情報を加算部203で変調して得られる第2位相情報との経時変化の例を示す図である。Changes in the temporal value of the phase value output by the phase counter 201, the first phase information corrected by the adding unit 202, and the second phase information obtained by modulating the corrected first phase information by the adding unit 203 It is a figure which shows an example. 図3に示した波形生成部131の機能と対応する処理を示すフローチャートである。It is a flowchart which shows the process corresponding to the function of the waveform generation part 131 shown in FIG. この発明の実施形態の変形例における波形生成部131の機能構成を示す、図3と対応する図である。It is a figure corresponding to FIG. 3 which shows the function structure of the waveform generation part 131 in the modification of embodiment of this invention.

以下、この発明を実施するための形態を図面に基づいて具体的に説明する。
まず、図1に、この発明の一実施形態である波形生成装置のハードウェア構成を示す。
図1に示すように、波形生成装置10は、CPU11、ROM12、RAM13、HDD(ハードディスクドライブ)14、DMA(ダイレクトメモリアクセス)制御部15、DAC(デジタルアナログ変換器)16、外部機器I/F(インタフェース)17、表示回路18、検出回路19、通信I/F20を備え、これらがシステムバス21により接続されている。
Hereinafter, embodiments for carrying out the present invention will be specifically described with reference to the drawings.
First, FIG. 1 shows a hardware configuration of a waveform generation apparatus according to an embodiment of the present invention.
As shown in FIG. 1, the waveform generation device 10 includes a CPU 11, a ROM 12, a RAM 13, an HDD (hard disk drive) 14, a DMA (direct memory access) control unit 15, a DAC (digital / analog converter) 16, and an external device I / F. (Interface) 17, display circuit 18, detection circuit 19, and communication I / F 20 are provided, and these are connected by a system bus 21.

このうち、CPU11は、波形生成装置10の動作を統括制御する制御手段であり、ROM12あるいはHDD14に記憶された所要の制御プログラムを実行して波形生成装置10の各部を制御することにより、後述する波形生成機能をはじめとする種々の機能を実現する。
ROM12及びHDD14は、CPU11が実行する制御プログラムをはじめ、電源を切っても残しておくべきデータを記憶する書き換え可能な不揮発性記憶手段である。
RAM13は、CPU11のワークメモリとして使用する記憶手段である。
Among these, the CPU 11 is a control unit that performs overall control of the operation of the waveform generation apparatus 10 and executes a necessary control program stored in the ROM 12 or the HDD 14 to control each unit of the waveform generation apparatus 10 to be described later. Various functions including a waveform generation function are realized.
The ROM 12 and the HDD 14 are rewritable nonvolatile storage means for storing a control program executed by the CPU 11 and data that should remain even after the power is turned off.
The RAM 13 is storage means used as a work memory for the CPU 11.

DMA制御部15は、RAM13に記憶されたデータにアクセスする機能を備える。例えば、DMA制御部15は、CPU11が実行するシーケンサアプリケーション(以下「アプリケーション」を「アプリ」と略称する)110及びソフトウェアシンセサイザプラグイン120の機能により生成されRAM13上に記憶されたデジタル波形データ(オーディオデータ)を、DAC16から出力して発音に用いる場合に、時間経過に従ってRAM13からDAC16への波形データの転送を行う。
DAC16は、デジタル波形データをアナログ音響信号に変換して、スピーカ等の外部のサウンドシステム(発音手段)へ出力する機能を備える。
The DMA control unit 15 has a function of accessing data stored in the RAM 13. For example, the DMA control unit 15 generates digital waveform data (audio) generated by the functions of a sequencer application (hereinafter referred to as “application”) 110 and software synthesizer plug-in 120 executed by the CPU 11 and stored in the RAM 13. (Data) is output from the DAC 16 and used for sound generation, the waveform data is transferred from the RAM 13 to the DAC 16 over time.
The DAC 16 has a function of converting digital waveform data into an analog sound signal and outputting the analog sound signal to an external sound system (sound generation means) such as a speaker.

外部機器I/F17は、外部機器を波形生成装置10に接続するためのインタフェースであり、例えばUSB(Universal Serial Bus)規格のインタフェースを採用可能である。外部機器I/F17には、MIDI(Musical Instrument Digital Interface:登録商標)データを生成するMIDI機器を接続してここからMIDIデータを入力することが考えられる。また、外部機器I/F17にオーディオ機器を接続し、CPU11が生成した波形データを、上述のDAC16からの出力に代えて、外部機器I/F17からそのオーディオ機器に出力して発音を行わせることも考えられる。   The external device I / F 17 is an interface for connecting an external device to the waveform generation device 10, and for example, an USB (Universal Serial Bus) standard interface can be adopted. It is conceivable that a MIDI device that generates MIDI (Musical Instrument Digital Interface: registered trademark) data is connected to the external device I / F 17 and MIDI data is input from here. Also, an audio device is connected to the external device I / F 17, and the waveform data generated by the CPU 11 is output from the external device I / F 17 to the audio device in place of the output from the DAC 16 to generate sound. Is also possible.

表示回路18は、ディスプレイ等の表示手段を接続し、CPU11からの制御によりその表示手段に表示を行わせるためのインタフェースである。
検出回路19は、キーボートやマウス等、ユーザからの操作を受け付けるための操作手段を接続し、その操作手段が受け付けた操作を検出してCPU11に供給するためのインタフェースである。
The display circuit 18 is an interface for connecting display means such as a display and causing the display means to perform display under the control of the CPU 11.
The detection circuit 19 is an interface for connecting an operation means for receiving an operation from a user such as a keyboard or a mouse, detecting an operation received by the operation means and supplying the operation to the CPU 11.

通信I/F20は、LAN(ローカルエリアネットワーク)等のネットワークを介して外部装置と通信するためのインタフェースである。
以上の波形生成装置10は、ハードウェアとしては汎用のPC(パーソナルコンピュータ)を用いて構成することもできる。
The communication I / F 20 is an interface for communicating with an external device via a network such as a LAN (local area network).
The above waveform generation device 10 can also be configured using a general-purpose PC (personal computer) as hardware.

以上の波形生成装置10において特徴的な点は、指定された周波数情報に基づき波形データ(以下単に「波形データ」と言った場合にはデジタル波形データを指す)を生成する機能である。以下、この点について説明する。
まず、図2に、波形生成装置10における波形データの生成及び出力に係る機能の構成を示す。
A characteristic feature of the waveform generation apparatus 10 described above is a function of generating waveform data (hereinafter simply referred to as “waveform data” when referring to digital waveform data) based on designated frequency information. Hereinafter, this point will be described.
First, FIG. 2 shows a configuration of functions related to generation and output of waveform data in the waveform generation apparatus 10.

図2に示すように、波形生成装置10は、波形データの生成及び出力に関与する機能として、MIDIドライバ101、オーディオドライバ102、シーケンサアプリ110、ソフトウェアシンセサイザプラグイン120を備える。
このうち、MIDIドライバ101は、外部機器I/F17に接続される外部機器から送信されるMIDIイベントを取得して、OS(オペレーティングシステム)上で動作する各種アプリに渡す機能を備える。オーディオドライバ102は、各種アプリが生成した波形データを、DAC16あるいは外部機器I/F17を介して外部に出力する機能を備える。これらのMIDIドライバ101及びオーディオドライバ102は、OSにより提供される機能である。
As shown in FIG. 2, the waveform generation apparatus 10 includes a MIDI driver 101, an audio driver 102, a sequencer application 110, and a software synthesizer plug-in 120 as functions related to generation and output of waveform data.
Among these, the MIDI driver 101 has a function of acquiring a MIDI event transmitted from an external device connected to the external device I / F 17 and passing it to various applications operating on the OS (Operating System). The audio driver 102 has a function of outputting waveform data generated by various applications to the outside via the DAC 16 or the external device I / F 17. These MIDI driver 101 and audio driver 102 are functions provided by the OS.

シーケンサアプリ110は、MIDIイベントと対応する波形データを、ソフトウェアシンセサイザプラグイン120を用いて生成して出力する機能を備える。
より具体的には、シーケンサアプリ110は、受け取ったMIDIイベントをソフトウェアシンセサイザプラグイン120に渡し、波形データの生成を開始させ、それに応じてソフトウェアシンセサイザプラグイン120が生成し出力する波形データを受け取って、オーディオドライバ102へ出力する。このとき、シーケンサアプリ110は、オーディオドライバ102が切れ目なく波形データを出力できる程度の頻度とサンプル数で(例えば5ミリ秒毎に300サンプル程度ずつ)ソフトウェアシンセサイザプラグイン120に波形データのサンプルを要求する。ソフトウェアシンセサイザプラグイン120はこの要求に応じて波形データを生成し、シーケンサアプリ110に渡す。
The sequencer application 110 has a function of generating and outputting waveform data corresponding to a MIDI event using the software synthesizer plug-in 120.
More specifically, the sequencer application 110 passes the received MIDI event to the software synthesizer plug-in 120, starts generating waveform data, and receives the waveform data generated and output by the software synthesizer plug-in 120 accordingly. To the audio driver 102. At this time, the sequencer application 110 requests waveform data samples from the software synthesizer plug-in 120 at such a frequency and number of samples that the audio driver 102 can output waveform data without interruption (for example, about 300 samples every 5 milliseconds). To do. The software synthesizer plug-in 120 generates waveform data in response to this request and passes it to the sequencer application 110.

なお、シーケンサアプリ110がソフトウェアシンセサイザプラグイン120に渡すMIDIイベントには、例えば、発音開始を指示するノートオンイベントや発音停止を指示するノートオフイベントがある。また、波形を規定する波形パラメータの値の変更を指示するイベントもある。   Note that the MIDI events that the sequencer application 110 passes to the software synthesizer plug-in 120 include, for example, a note-on event that instructs the start of sound generation and a note-off event that instructs the sound generation to stop. There is also an event for instructing a change in the value of a waveform parameter that defines the waveform.

このようなMIDIイベントは、シーケンサアプリ110がタイマ制御のもとSMF(Standard MIDI File)形式の演奏データを再生して生成することができるし、外部MIDI機器から波形生成装置10に入力されたMIDIイベントをMIDIドライバ101から取得することもできる。
以上のようなシーケンサアプリ110の機能は、例えばシーケンサ機能を備えるDAW(Digital Audio Workstation)アプリにより提供可能である。
Such a MIDI event can be generated by the sequencer application 110 playing back performance data in the SMF (Standard MIDI File) format under timer control, and the MIDI event input from the external MIDI device to the waveform generator 10. Events can also be acquired from the MIDI driver 101.
The functions of the sequencer application 110 as described above can be provided by, for example, a DAW (Digital Audio Workstation) application having a sequencer function.

ソフトウェアシンセサイザプラグイン120は、シーケンサアプリ110が使用するダイナミックリンクライブラリにより提供される機能であり、他のプロセスから渡されるMIDIイベントに従い波形データを生成して要求元のプロセスへ返す機能を備える。
より具体的には、ソフトウェアシンセサイザプラグイン120は、イベントハンドラ121、ピッチ生成部122、エンベロープ信号生成部123、オペレータ124、および出力部125の機能を備える。
The software synthesizer plug-in 120 is a function provided by a dynamic link library used by the sequencer application 110, and has a function of generating waveform data in accordance with a MIDI event passed from another process and returning it to the requesting process.
More specifically, the software synthesizer plug-in 120 includes functions of an event handler 121, a pitch generation unit 122, an envelope signal generation unit 123, an operator 124, and an output unit 125.

このうちイベントハンドラ121は、シーケンサアプリ110等の、ソフトウェアシンセサイザプラグイン120を使用するアプリからMIDIイベントが送られたことを検知し、イベントを受け取り、そのイベントに応じた処理を、ソフトウェアシンセサイザプラグイン120内の各部に指示する機能を備える。   Of these, the event handler 121 detects that a MIDI event has been sent from an application using the software synthesizer plug-in 120 such as the sequencer application 110, receives the event, and performs processing corresponding to the event to the software synthesizer plug-in. The function to instruct each part in 120 is provided.

例えば、イベントハンドラ121は、ノートオンイベントを検知した場合、そこに含まれる、発音すべき音高を表すノート番号をピッチ生成部122に伝えて周波数情報の生成開始を指示すると共に、押鍵(発音)操作速度を表すベロシティをエンベロープ信号生成部123に伝えてエンベロープ信号の生成開始を指示させる。これらの指示の後、ピッチ生成部122、エンベロープ信号生成部123及びオペレータ124は、1サンプルずつ時系列的に波形データを生成する。   For example, when the event handler 121 detects a note-on event, it notifies the pitch generator 122 of the note number that represents the pitch to be generated and instructs the pitch generator 122 to start generating frequency information. Pronunciation) Velocity representing the operation speed is transmitted to the envelope signal generator 123 to instruct the start of envelope signal generation. After these instructions, the pitch generator 122, the envelope signal generator 123, and the operator 124 generate waveform data in time series for each sample.

また、イベントハンドラ121は、波形パラメータの値の変更を指示するイベントを検出した場合に、そこに含まれる情報に従い、各オペレータ124の波形生成部131が波形情報の生成に使用する波形パラメータの値を変更する。この波形パラメータには、例えば、図3に示す変調値演算部205における変調値の演算内容を規定するパラメータが含まれる。   Further, when the event handler 121 detects an event instructing the change of the value of the waveform parameter, the value of the waveform parameter used by the waveform generation unit 131 of each operator 124 to generate the waveform information according to the information included therein. To change. The waveform parameter includes, for example, a parameter that defines the calculation content of the modulation value in the modulation value calculation unit 205 shown in FIG.

次に、ピッチ生成部122は、ノート番号で指定された音高の基本周波数で発音する際に1サンプル期間で図3の位相カウンタ201において位相を進める量を示す周波数情報を生成し、オペレータ124の波形生成部131に供給する機能を備える。
エンベロープ信号生成部123は、発音開始から1サンプルずつ処理が進むに従って時間的に変化する信号であって、ベロシティに応じた音量を示す制御信号を生成し、オペレータ124の音量制御部132に供給する機能を備える。
Next, the pitch generator 122 generates frequency information indicating the amount of phase advance in the phase counter 201 of FIG. 3 in one sample period when sounding at the fundamental frequency of the pitch designated by the note number, and the operator 124. The function of supplying to the waveform generation unit 131 is provided.
The envelope signal generation unit 123 generates a control signal indicating a volume corresponding to the velocity, which changes with time as the processing progresses by one sample from the start of sound generation, and supplies the control signal to the volume control unit 132 of the operator 124. It has a function.

オペレータ124は、ピッチ生成部122から供給される周波数情報と、エンベロープ信号生成部123から供給される制御信号と、イベントハンドラ121により設定される波形パラメータとに基づき、波形生成部131及び音量制御部132により波形データを生成して出力部125に供給する機能を備える。このうち波形生成部131は、周波数情報と波形パラメータとに基づき波形情報を生成する機能を備える。音量制御部132は、波形生成部131が生成した波形情報の振幅を、制御信号に従って調整することにより、出力すべき波形データを生成する機能を備える。   Based on the frequency information supplied from the pitch generator 122, the control signal supplied from the envelope signal generator 123, and the waveform parameters set by the event handler 121, the operator 124 uses the waveform generator 131 and the volume controller. A function of generating waveform data by 132 and supplying the waveform data to the output unit 125 is provided. Of these, the waveform generation unit 131 has a function of generating waveform information based on frequency information and waveform parameters. The volume control unit 132 has a function of generating waveform data to be output by adjusting the amplitude of the waveform information generated by the waveform generation unit 131 according to the control signal.

このオペレータ124は、複数設けることもできる。この場合、イベントハンドラ121、ピッチ生成部122及びエンベロープ信号生成部123は、発音に用いるオペレータ124のそれぞれに、波形パラメータ、周波数情報及び制御信号を供給する。また、あるオペレータ124が出力する波形データを、出力部125に出力することに加え、又はこれに代えて、他のオペレータ124の波形生成部131の動作を変調するために用いることもできる。変調値演算部205における変調値の演算内容を、他のオペレータ124が出力した波形データに基づき調整する等である。   A plurality of operators 124 may be provided. In this case, the event handler 121, the pitch generation unit 122, and the envelope signal generation unit 123 supply waveform parameters, frequency information, and control signals to the operators 124 used for sound generation. Further, in addition to or instead of outputting the waveform data output by a certain operator 124 to the output unit 125, it can also be used to modulate the operation of the waveform generation unit 131 of another operator 124. For example, the calculation value of the modulation value in the modulation value calculation unit 205 is adjusted based on the waveform data output by another operator 124.

出力部125は、各オペレータ124が生成した波形データのサンプルをバッファし、アプリからの要求に応じて、要求されたサンプル数のデータをそのアプリに渡す機能を備える。
なお、ピッチ生成部122、エンベロープ信号生成部123及びオペレータ124の処理は、出力波形データのサンプル単位よりも細かいオーバーサンプリングされた単位で波形データの生成処理を行ってもよい。その場合、1サンプルの波形データを出力部125に出力するために、複数周期の処理をし、その結果を出力する。
The output unit 125 has a function of buffering waveform data samples generated by each operator 124 and passing data of the requested number of samples to the application in response to a request from the application.
Note that the processing of the pitch generation unit 122, the envelope signal generation unit 123, and the operator 124 may perform waveform data generation processing in an oversampled unit finer than the sample unit of the output waveform data. In that case, in order to output the waveform data of one sample to the output unit 125, a plurality of cycles are processed, and the result is output.

次に、図3に、波形生成部131の機能構成をより詳細に示す。
図3に示すように、波形生成部131は、位相カウンタ201、加算部202,203、波形情報取得部204、変調値演算部205、タイミング検知部206、差分算出部207、切替部208、補正値保持部209、およびLPF(ローパスフィルタ)210を備える。
Next, FIG. 3 shows the functional configuration of the waveform generation unit 131 in more detail.
As shown in FIG. 3, the waveform generation unit 131 includes a phase counter 201, addition units 202 and 203, a waveform information acquisition unit 204, a modulation value calculation unit 205, a timing detection unit 206, a difference calculation unit 207, a switching unit 208, and a correction. A value holding unit 209 and an LPF (low pass filter) 210 are provided.

これらのうち、位相カウンタ201は、ピッチ生成部122から供給された周波数情報に基づき第1位相情報を生成する位相情報生成手段の機能を備える。この例では、位相カウンタ201は、1サンプル処理する毎に周波数情報が示す値を現在の値に加算する。そして、カウント値が1を超えた場合、加算結果から1を減じる。このことにより、図4に実線で示すように、時間の経過に従って0から1まで徐々に増加し、1に達すると0に戻る鋸波状の第1位相情報を生成する。なお、各タイミングにおけるカウント値を位相値と呼ぶことにし、位相値が0から1まで変化するのに要する期間が、波形の1周期に対応する。   Among these, the phase counter 201 includes a function of a phase information generation unit that generates first phase information based on the frequency information supplied from the pitch generation unit 122. In this example, the phase counter 201 adds the value indicated by the frequency information to the current value every time one sample is processed. When the count value exceeds 1, 1 is subtracted from the addition result. As a result, as shown by a solid line in FIG. 4, sawtooth-shaped first phase information is generated that gradually increases from 0 to 1 as time passes and returns to 0 when 1 is reached. Note that the count value at each timing is called a phase value, and the period required for the phase value to change from 0 to 1 corresponds to one cycle of the waveform.

加算部202は、位相カウンタ201が出力する第1位相情報を、LPF210から供給される後述する補正値Adjを加算して補正する機能を備える。
加算部203は、加算部202における補正後の第1位相情報を、変調値演算部205から供給される後述する変調値Modを加算して変調し、第2位相情報を生成する機能を備える。
なお、加算部202,203はそれぞれ、加算結果が0から1の範囲に収まらない場合に、加算結果に対し1を減算又は加算して、0から1の範囲に収めるようにする。
The adding unit 202 has a function of correcting the first phase information output from the phase counter 201 by adding a correction value Adj described later supplied from the LPF 210.
The adding unit 203 has a function of modulating the first phase information corrected by the adding unit 202 by adding a modulation value Mod (described later) supplied from the modulation value calculating unit 205 to generate second phase information.
Each of the addition units 202 and 203 subtracts or adds 1 to the addition result so that the addition result falls within the range of 0 to 1 when the addition result does not fall within the range of 0 to 1.

波形情報取得部204は、第2位相情報を入力し、その第2位相情報に基づき該第2位相情報と対応するサンプル値を波形情報として生成する波形生成手段の機能を備える。この例では、波形情報取得部204は、各位相値と対応する正弦波のサンプル値を格納した正弦波テーブルを備え、第2位相情報が示す各サンプルの位相値と対応する正弦波のサンプル値を、必要に応じて補間処理を行って正弦波テーブルから読み出し、そのサンプルの波形情報として出力する。例えば、位相値0が正弦波の位相0に対応し、位相値1が正弦波の位相2πに対応する等である。位相値0が正弦波の位相−πに対応し、位相値1が正弦波の位相πに対応する等でもよい。正弦波の位相を弧度法でなく度数法で表現しても構わない。   The waveform information acquisition unit 204 has a function of a waveform generation unit that receives the second phase information and generates a sample value corresponding to the second phase information as waveform information based on the second phase information. In this example, the waveform information acquisition unit 204 includes a sine wave table storing sine wave sample values corresponding to each phase value, and the sine wave sample values corresponding to the phase values of each sample indicated by the second phase information. Are read out from the sine wave table by performing an interpolation process if necessary, and output as waveform information of the sample. For example, phase value 0 corresponds to phase 0 of a sine wave, phase value 1 corresponds to phase 2π of a sine wave, and so on. The phase value 0 may correspond to the phase -π of the sine wave, the phase value 1 may correspond to the phase π of the sine wave, and so on. The phase of the sine wave may be expressed not by the arc method but by the frequency method.

また、テーブルに他の波形のサンプル値を格納したり、位相値を数式に代入して演算することにより波形情報を生成したりすることも考えられる。
いずれにせよ、波形情報取得部204は、生成した波形情報を、後段の音量制御部132に供給すると共に、変調値演算部205にも供給する。
It is also conceivable that sample values of other waveforms are stored in the table, or waveform information is generated by substituting the phase value into a mathematical formula and calculating.
In any case, the waveform information acquisition unit 204 supplies the generated waveform information to the volume control unit 132 at the subsequent stage and also supplies it to the modulation value calculation unit 205.

変調値演算部205は、第1位相情報を、波形情報取得部204が生成した波形情報を用いてフィードバック変調するための変調値Modを生成する機能を有する。そして、加算部203と合わせて変調手段の機能を実現する。
変調値演算部205が行う変調値Modの生成のための演算等の処理の内容は、イベントハンドラから供給される波形パラメータ(及び他のオペレータ124が出力する波形データ)に基づき、動的に変更される。この変更は、例えばディレイ処理における遅延サンプル数のようにパラメータの調整に留まる場合もあれば、フィルタ処理を追加あるいは削除したり、絶対値変換処理と二乗演算処理を切り替えたり、といった、処理アルゴリズム自体の変更を伴う場合もある。
The modulation value calculation unit 205 has a function of generating a modulation value Mod for performing feedback modulation on the first phase information using the waveform information generated by the waveform information acquisition unit 204. Then, the function of the modulation means is realized together with the adding unit 203.
The contents of processing such as the calculation for generating the modulation value Mod performed by the modulation value calculation unit 205 are dynamically changed based on the waveform parameters supplied from the event handler (and the waveform data output by other operators 124). Is done. This change may be limited to parameter adjustment, for example, the number of delay samples in the delay processing, or the processing algorithm itself, such as adding or deleting filter processing, switching between absolute value conversion processing and square calculation processing, etc. May be accompanied by changes.

ここで、変調値演算部205が行う変調値Modの生成のための演算処理アルゴリズムの一例を述べると、まず絶対値変換部により波形情報取得部204が生成した波形情報に係るサンプル値の絶対値を求め、その後、その絶対値をローパスフィルタに入力し、フィルタの出力値を遅延部で所定サンプル分遅延させる処理が考えられる。この処理を行うと、あるサンプリング期間で変調値演算部205に入力したサンプル値が加算部203に供給される変調値Modに反映されるまでには、ある程度の遅延が生じることになる。   Here, an example of a calculation processing algorithm for generating the modulation value Mod performed by the modulation value calculation unit 205 will be described. First, the absolute value of the sample value related to the waveform information generated by the waveform information acquisition unit 204 by the absolute value conversion unit After that, the absolute value is input to the low-pass filter, and the output value of the filter is delayed by a predetermined sample by the delay unit. When this process is performed, a certain amount of delay occurs until the sample value input to the modulation value calculation unit 205 in a certain sampling period is reflected in the modulation value Mod supplied to the addition unit 203.

いずれにせよ、変調値Modを、加算部203において、(加算部202における補正後の)第1位相情報に加算することにより、第1位相情報を変調して第2位相情報を生成することができる。なお、この加算において、位相値が0〜1の範囲から外れる場合には、加算結果から1を減じるか又は加算結果に1を加えて、加算後の位相値が0〜1の範囲に収まるようにする。   In any case, by adding the modulation value Mod to the first phase information (after correction in the addition unit 202) in the addition unit 203, the first phase information is modulated to generate second phase information. it can. In this addition, when the phase value is out of the range of 0 to 1 in this addition, 1 is subtracted from the addition result or 1 is added to the addition result so that the phase value after addition falls within the range of 0 to 1. To.

ここで、図4に、加算部202による補正を行わない状態での、第1位相情報(実線)と、第1位相情報を変調して得られる第2位相情報(点線)の経時変化の例を示す。縦軸は各サンプル期間の位相情報が示す位相値、横軸はサンプル数単位で示した時間である。
この図からわかるように、波形情報取得部204が生成した波形情報を反映した変調値Modを用いて第1位相情報の変調を行うと、その変調後の第2位相情報の変動周期(例えば0から1までの変動を1周期とする)は、元の第1位相情報の変動周期とずれることになる。この「ずれ」は、位相情報の変動の様子を波形に見立てると、波形の位相がずれ量Dだけずれていることに該当する。
そして、この「ずれ」の大きさは、変調値演算部205における演算内容によって変動することが、発明者らのシミュレーションによってわかっている。
Here, FIG. 4 shows an example of the temporal change of the first phase information (solid line) and the second phase information (dotted line) obtained by modulating the first phase information in a state where the correction by the adding unit 202 is not performed. Indicates. The vertical axis represents the phase value indicated by the phase information in each sample period, and the horizontal axis represents the time expressed in units of the number of samples.
As can be seen from this figure, when the first phase information is modulated using the modulation value Mod reflecting the waveform information generated by the waveform information acquisition unit 204, the fluctuation period (for example, 0) of the second phase information after the modulation is performed. 1 to 1) is shifted from the fluctuation cycle of the original first phase information. This “deviation” corresponds to the fact that the phase of the waveform is shifted by the shift amount D when the state of fluctuation of the phase information is regarded as a waveform.
It has been found by the inventors' simulation that the magnitude of this “deviation” varies depending on the calculation contents in the modulation value calculation unit 205.

次に、タイミング検知部206は、加算部203での加算時に位相値が1を超えたタイミング(このときに位相値から1を減じる処理を行うため図4のグラフでは1付近の値から0付近への値の変動が起きるタイミング)を検知する機能を備える。また、その検知したタイミング前後の第2位相情報の位相値を差分算出部207に供給する機能を備える。さらに、その検知したタイミングで、切替部208を接続状態(1→0)に切り替え、差分算出部207が算出した差分値を、補正準備値Adjpとして補正値保持部209に保持させる機能も備える。なお、タイミング検知部206は、位相値が1を超えたタイミング以外では、切替部208を離間状態(otherwise)に切り替え、補正値保持部209に、一旦保持した補正準備値Adjpをそのまま保持させる。   Next, the timing detection unit 206 is a timing when the phase value exceeds 1 at the time of addition by the addition unit 203 (in order to perform a process of subtracting 1 from the phase value at this time, in the graph of FIG. The function of detecting the timing at which fluctuations in value occur). In addition, a function of supplying the phase value of the second phase information before and after the detected timing to the difference calculation unit 207 is provided. Further, at the detected timing, the switching unit 208 is switched to the connected state (1 → 0), and the difference value calculated by the difference calculation unit 207 is stored in the correction value holding unit 209 as the correction preparation value Adjp. The timing detection unit 206 switches the switching unit 208 to an otherwise separated state (otherwise) except for the timing when the phase value exceeds 1, and causes the correction value holding unit 209 to hold the correction preparation value Adjp once held as it is.

差分算出部207は、タイミング検知部206から第2位相情報の位相値が供給された場合に、その位相値と、加算部203による変調前の第1位相情報の位相値とに基づき、第2位相情報の位相値が「0」になった時点での、第2位相情報の位相値と第1位相情報の位相値との差分を算出する。位相値があるサンプリング期間にちょうど「0」になることは希であるので、通常は、「1」を超えたタイミング前後の位相値を用いて補間を行って求める。   When the phase value of the second phase information is supplied from the timing detection unit 206, the difference calculation unit 207 receives the second value based on the phase value and the phase value of the first phase information before modulation by the addition unit 203. The difference between the phase value of the second phase information and the phase value of the first phase information when the phase value of the phase information becomes “0” is calculated. Since it is rare that the phase value becomes exactly “0” in a certain sampling period, it is usually obtained by performing interpolation using phase values before and after the timing exceeding “1”.

この求めた差分は、変調手段による変調後の位相情報が所定の値となった時点における、変調前後の位相情報の差分に該当し、第1位相情報と第2位相情報の変動周期のずれ量Dを反映した値となる。したがって、基本的にはこの差分値だけ第1位相情報を補正すればよいのであるが、この例では、補正量の時間変化を、差分値の時間変化より緩慢にする手段として、補正値保持部209及びLPF210を設け、これらを介して補正を行うようにしている。   The obtained difference corresponds to the difference between the phase information before and after the modulation when the phase information after the modulation by the modulation means becomes a predetermined value, and the shift amount of the fluctuation period of the first phase information and the second phase information. The value reflects D. Therefore, it is basically only necessary to correct the first phase information by this difference value, but in this example, the correction value holding unit is used as a means for making the time change of the correction amount slower than the time change of the difference value. 209 and LPF 210 are provided, and correction is performed through these.

切替部208は、タイミング検知部206によって接続状態と離間状態を切り替えられ、接続状態となった場合に、差分算出部207が算出した差分値を補正値保持部209に供給する機能を備える。
補正値保持部209は、切替部208を介して差分算出部207から差分値が供給された場合に、次に差分値が供給されるまで、その差分値を補正準備値Adjpとして保持し、サンプリング期間毎にLPF210に供給する機能を備える。
The switching unit 208 has a function of supplying the difference value calculated by the difference calculation unit 207 to the correction value holding unit 209 when the connection state and the separation state are switched by the timing detection unit 206 and the connection state is established.
When the difference value is supplied from the difference calculation unit 207 via the switching unit 208, the correction value holding unit 209 holds the difference value as the correction preparation value Adjp until the next time the difference value is supplied. A function of supplying to the LPF 210 every period is provided.

LPF210は、補正値保持部209から供給される各サンプリング期間の補正準備値Adjpに基づき、その高周波成分を除去し、時間変化を緩慢にした各サンプリング期間の補正値Adjを生成して、加算部202に供給する機能を備える。
加算部202は、上述のように、第1位相情報の位相値にこの補正値Adjを加算して補正する。
以上のタイミング検知部206、差分算出部207、切替部208、補正値保持部209、LPF210及び加算部202が、補正手段を構成する。
Based on the correction preparation value Adjp for each sampling period supplied from the correction value holding unit 209, the LPF 210 generates a correction value Adj for each sampling period by removing the high frequency component and slowing the time change, and adding the addition unit The function to supply to 202 is provided.
As described above, the adding unit 202 adds the correction value Adj to the phase value of the first phase information and corrects it.
The timing detection unit 206, the difference calculation unit 207, the switching unit 208, the correction value holding unit 209, the LPF 210, and the addition unit 202 constitute a correction unit.

次に、図4及び図5を用いて、補正手段による位相情報の補正の意義について説明する。
図4は上述した通りであり、図5は、位相カウンタ201が出力する位相値(補正前の第1位相情報:実線)と、加算部202による補正後の第1位相情報(二点鎖線)と、その補正後の第1位相情報を加算部203で変調して得られる第2位相情報(点線)との経時変化を、図4と同じ軸上に示したものである。
ここで、加算部202による補正の趣旨は、図4に示したずれ量Dをなくし、波形情報取得部に入力される第2位相情報の変動周期を、位相カウンタ201が出力する第1位相情報の変動周期に合わせるものである。ここで、位相カウンタ201の出力自体は、位相情報の変調や補正を行っても変化するものではない。
Next, the significance of correcting the phase information by the correcting means will be described with reference to FIGS.
4 is as described above, and FIG. 5 is a diagram illustrating the phase value output from the phase counter 201 (first phase information before correction: solid line) and the first phase information after correction by the adding unit 202 (two-dot chain line). The change over time with the second phase information (dotted line) obtained by modulating the corrected first phase information with the adder 203 is shown on the same axis as FIG.
Here, the purpose of the correction by the addition unit 202 is to eliminate the shift amount D shown in FIG. 4 and to output the fluctuation phase of the second phase information input to the waveform information acquisition unit from the first phase information output by the phase counter 201. This is in accordance with the fluctuation period. Here, the output of the phase counter 201 does not change even when the phase information is modulated or corrected.

そして、図3の構成においては、差分算出部207において、第2位相情報の位相値が「0」になった時点での、第2位相情報の位相値と第1位相情報の位相値との差分(図5では、説明を簡単にするため、この差分そのものが補正値Adjであるとする)を求め、各サンプル期間の第1位相情報の位相値にその差分Adjを加えている。このことにより、もとの第1位相情報よりも、ずれ量Dだけ「位相」が早い位相情報を得ることができる。   In the configuration of FIG. 3, the difference calculation unit 207 calculates the difference between the phase value of the second phase information and the phase value of the first phase information when the phase value of the second phase information becomes “0”. A difference (in FIG. 5, for the sake of simplicity, the difference itself is assumed to be a correction value Adj) is obtained, and the difference Adj is added to the phase value of the first phase information in each sample period. As a result, phase information whose “phase” is earlier than the original first phase information by the shift amount D can be obtained.

そして、この補正後の位相情報に対し変調量Modを加算して変調することにより、もとの第1位相情報に加算した場合よりもずれ量Dだけ「位相」が早い第2位相情報を得ることができる。そして、このことにより、図5に示すように、第2位相情報の変動周期は、第1位相情報の変動周期と重なることになる。   Then, by modulating the phase information after correction by adding the modulation amount Mod, the second phase information whose “phase” is earlier by the shift amount D than the case of adding to the original first phase information is obtained. be able to. As a result, as shown in FIG. 5, the fluctuation period of the second phase information overlaps with the fluctuation period of the first phase information.

なお、図3の例では、補正量Adjを、補正後の第1位相情報(図5の二点鎖線)と、その補正後の第1位相情報を変調して得た第2位相情報(図5の点線)との差分として求めている。しかし、図4と図5の対比からわかるように、これらのグラフは、位相カウンタが出力する第1位相情報(図4の実線)及び、補正しない第1位相情報を変調して得た第2位相情報(図4の点線)のグラフを、時間を早める方向へずれ量Dだけ平行移動したものとなる。このため、図3の手法でも、補正の影響を受けることなく(実際にはLPF210を通すため若干影響はあるが特に問題とならずに)、ずれ量Dと対応する補正量Adjを求めることができる。   In the example of FIG. 3, the correction amount Adj is obtained by correcting the first phase information after correction (two-dot chain line in FIG. 5) and the second phase information (FIG. 5) obtained by modulating the first phase information after correction. 5 as a difference). However, as can be seen from the comparison between FIG. 4 and FIG. 5, these graphs show the second phase obtained by modulating the first phase information output by the phase counter (solid line in FIG. 4) and the first phase information that is not corrected. The graph of the phase information (dotted line in FIG. 4) is translated by a shift amount D in the direction of increasing the time. Therefore, even in the method of FIG. 3, the correction amount Adj corresponding to the shift amount D can be obtained without being influenced by the correction (actually there is no particular problem because it passes through the LPF 210). it can.

以上の補正を行うことにより、変調値演算部205で行う処理の内容によらず、波形情報取得部204に入力する第2位相情報の変動周期を一定に保つことができるため、処理内容がダイナミックに変化する変調処理を施された位相情報に基づき出力波形データを生成する場合でも、出力波形データにおける意図しないピッチの変化を抑えることができる。   By performing the above correction, the fluctuation period of the second phase information input to the waveform information acquisition unit 204 can be kept constant regardless of the content of the processing performed by the modulation value calculation unit 205, so that the processing content is dynamic. Even when the output waveform data is generated based on the phase information that has been subjected to the modulation processing that changes to an unintended pitch change in the output waveform data can be suppressed.

なお、図3に示した波形生成部131の機能と対応する処理は、例えば図6のフローチャートに示すものとすることができる。
CPU11は、ソフトウェアシンセサイザプラグインのプログラムを実行することにより、サンプル期間毎に図6の処理を開始する。なお、波形データを出力に間に合うように用意できるのであれば、図6の処理の実行間隔は、必ずしも再生時のサンプリング周期と一致していなくてもよい。
Note that the processing corresponding to the function of the waveform generation unit 131 shown in FIG. 3 can be the one shown in the flowchart of FIG.
The CPU 11 starts the process of FIG. 6 for each sample period by executing a software synthesizer plug-in program. Note that if the waveform data can be prepared in time for output, the execution interval of the processing of FIG. 6 does not necessarily match the sampling period at the time of reproduction.

図6の処理において、CPU11はまず、ピッチ生成部122から供給された周波数情報に基づき位相カウンタ201のカウント値(第1位相情報)を加算する(S11)。このときカウント値が0〜1に収まるように調整することは上述の通りである。
次に、CPU11は、ステップS11での加算後の第1位相情報に前回の処理で設定した補正値Adjを加算する(S12)。そしてさらに、その加算結果に対し、前回の処理で設定した変調値Modを加算して、第2位相情報を生成する(S13)。これらのステップでもカウント値が0〜1に収まるように調整することは上述の通りである。
In the process of FIG. 6, the CPU 11 first adds the count value (first phase information) of the phase counter 201 based on the frequency information supplied from the pitch generator 122 (S11). At this time, the adjustment is made so that the count value falls within the range of 0 to 1, as described above.
Next, the CPU 11 adds the correction value Adj set in the previous process to the first phase information after the addition in step S11 (S12). Further, the modulation value Mod set in the previous process is added to the addition result to generate second phase information (S13). As described above, the adjustment is performed so that the count value falls within the range of 0 to 1 even in these steps.

次に、CPU11は、波形情報取得部204の機能と対応する処理により、第2位相情報と対応する波形情報のサンプル値を取得し(S14)、これを音量制御部132へ出力する(S15)。また、ステップS14で取得したサンプル値を、変調値演算部205の機能と対応する変調値生成ルーチンに入力する(S16)。そして、CPU11は、このサンプル期間における変調値生成ルーチンの出力を変調値Modとする(S17)。   Next, the CPU 11 acquires a sample value of the waveform information corresponding to the second phase information by processing corresponding to the function of the waveform information acquisition unit 204 (S14), and outputs this to the volume control unit 132 (S15). . In addition, the sample value acquired in step S14 is input to a modulation value generation routine corresponding to the function of the modulation value calculation unit 205 (S16). Then, the CPU 11 sets the output of the modulation value generation routine in this sample period as the modulation value Mod (S17).

また、CPU11は、ステップS13での変調値Modの加算の際に、第2位相情報がオーバーフローした(加算結果が1を超えたため1を減算した)か否か判断する(S18)。ここでYesであれば、CPU11は、補間により、第2位相情報が0になった時点の第1位相情報+補正値Adjの値を算出し、補正準備値Adjpとする(S19)。ステップS18でNoであれば、ステップS19はスキップする。
いずれの場合も、CPU11は、この時点の補正準備値Adjpを、LPF210の機能と対応するLPF処理ルーチンに入力する(S20)。そして、CPU11は、このサンプル期間におけるLPF処理ルーチンの出力を補正値Adjとして(S21)、処理を終了する。
Further, the CPU 11 determines whether or not the second phase information has overflowed when adding the modulation value Mod in step S13 (S1 is subtracted because the addition result exceeds 1) (S18). If Yes here, the CPU 11 calculates the value of the first phase information + correction value Adj when the second phase information becomes 0 by interpolation, and sets it as the correction preparation value Adjp (S19). If No in step S18, step S19 is skipped.
In any case, the CPU 11 inputs the correction preparation value Adjp at this time to the LPF processing routine corresponding to the function of the LPF 210 (S20). Then, the CPU 11 sets the output of the LPF processing routine in this sample period as the correction value Adj (S21), and ends the processing.

次に、上述した実施形態の変形例について説明する。この変形例は、波形生成部131の構成が上述した実施形態と異なるのみである。
図7に、変形例における波形生成部131の機能構成を示す。この図において、図3に示したものと対応する構成要素には、図3と同じ符号を付した。
Next, a modification of the above-described embodiment will be described. This modification is different from the above-described embodiment only in the configuration of the waveform generation unit 131.
FIG. 7 shows a functional configuration of the waveform generation unit 131 in the modification. In this figure, components corresponding to those shown in FIG. 3 are assigned the same reference numerals as in FIG.

図7に示す変形例においては、差分算出部207が、位相カウンタ201が出力する位相値(補正前の第1位相情報である)と、加算部211にて補正値Adj及び変調値Modを加算後の位相値(第2位相情報である)との差分を求める。すなわち、補正値Adjと変調値Modの合計値の符号を反転した値を求める。第2位相情報の位相値が「0」になった時点での差分を算出する点は、図3の場合と同様である。   In the modification shown in FIG. 7, the difference calculation unit 207 adds the phase value output from the phase counter 201 (first phase information before correction), and the addition unit 211 adds the correction value Adj and the modulation value Mod. The difference from the later phase value (second phase information) is obtained. That is, a value obtained by inverting the sign of the total value of the correction value Adj and the modulation value Mod is obtained. The point of calculating the difference when the phase value of the second phase information becomes “0” is the same as in the case of FIG.

なお、加算部211は、図3の加算部202と加算部203の機能を合わせたものであり、位相カウンタ201が出力する位相値に、補正値Adj及び変調値Modを加算して、波形情報取得部204に入力する第2位相情報を生成する。加算の順序は、補正値Adj及び変調値Modのどちらが先でもよい。
また、加算部212を設け、切替部208が接続状態になった場合に、補正値保持部209が現在保持している補正準備値Adjpに、差分算出部207が検出した差分を加算した値を、新たな補正準備値Adjpとして補正値保持部209に供給して保持させる。
タイミング検知部206、切替部208、およびLPF210を含め、その他の各部の機能は図3の例と同じである。
The addition unit 211 is a combination of the functions of the addition unit 202 and the addition unit 203 in FIG. 3, and adds the correction value Adj and the modulation value Mod to the phase value output from the phase counter 201 to obtain waveform information. Second phase information to be input to the acquisition unit 204 is generated. The order of addition may be either the correction value Adj or the modulation value Mod first.
In addition, when the addition unit 212 is provided and the switching unit 208 is connected, a value obtained by adding the difference detected by the difference calculation unit 207 to the correction preparation value Adjp currently held by the correction value holding unit 209 is obtained. Then, the new correction preparation value Adjp is supplied to the correction value holding unit 209 and held.
The functions of other units including the timing detection unit 206, the switching unit 208, and the LPF 210 are the same as those in the example of FIG.

以上の波形生成部131によれば、図5に点線で示す変調後位相情報が1から0に変化するタイミングの、実線で示す位相カウンタ201の出力に基づき、補正値Adjを調整することができる。従って、変調後位相情報と、位相カウンタ201の出力とで「位相」がずれ、1から0に変化するタイミングが異なる場合、それを打ち消す方向へ補正値Adjの値を変更することができる。このため、図3の構成の場合と同様、変調後位相情報と位相カウンタ201の出力の「位相」を一致させることができる。   According to the waveform generation unit 131 described above, the correction value Adj can be adjusted based on the output of the phase counter 201 indicated by the solid line at the timing when the modulated phase information indicated by the dotted line in FIG. 5 changes from 1 to 0. . Therefore, if the phase information after modulation is different from the output of the phase counter 201 and the timing of changing from 1 to 0 is different, the value of the correction value Adj can be changed in a direction to cancel it. Therefore, as in the case of the configuration of FIG. 3, the post-modulation phase information and the “phase” of the output of the phase counter 201 can be matched.

以上で実施形態の説明を終了するが、装置及び機能の構成、具体的な処理の手順などが、上述の実施形態で説明したものに限られないことはもちろんである。
例えば、差分算出部207が差分を算出し補正値保持部209に供給するタイミングを、第2位相情報あるいは第1位相情報がオーバーフローする(変動領域の端部の値を基準とした)タイミングではなく、位相値0.5を超えた時点など、変動領域の途中の値を基準としたタイミングとしてもよい。
Although the description of the embodiment is finished as described above, it goes without saying that the configuration of the apparatus and functions, the specific processing procedure, and the like are not limited to those described in the above-described embodiment.
For example, the timing at which the difference calculation unit 207 calculates the difference and supplies it to the correction value holding unit 209 is not the timing at which the second phase information or the first phase information overflows (based on the value at the end of the fluctuation region) The timing may be based on a value in the middle of the fluctuation region, such as when the phase value exceeds 0.5.

また、位相値の変動範囲は0から1には限られない。さらに、この変動範囲が波形の1周期と対応していることも必須ではない。例えば、位相値の0が正弦波の位相0に、位相値の1が正弦波の位相4πにそれぞれ対応する、というように、位相値の変動範囲が波形の複数周期と対応していてもよい。
また、図2及び図3等に示した波形データの生成及び出力に係る機能を、ソフトウェアではなく、専用のハードウェアにより、あるいは、ソフトウェアとハードウェアの組み合わせにより実現してもよい。
Further, the variation range of the phase value is not limited to 0 to 1. Furthermore, it is not essential that this fluctuation range corresponds to one period of the waveform. For example, the phase value variation range may correspond to a plurality of periods of the waveform, such that the phase value 0 corresponds to the phase 0 of the sine wave and the phase value 1 corresponds to the phase 4π of the sine wave. .
Further, the functions related to the generation and output of the waveform data shown in FIGS. 2 and 3 may be realized not by software but by dedicated hardware or a combination of software and hardware.

また、この発明は、マルチトラックレコーダや電子楽器、音源装置等、図2及び図3に示した機能により波形データの生成及び出力以外の機能を合わせ持つ任意の音響信号処理装置、あるいはコンピュータにそのような音響信号処理装置の機能を実現させるためのプログラムに適用可能であることはもちろんである。
この場合において、音響信号処理装置が、図1において波形生成装置10の外部に示したサウンドシステム、ディスプレイ等を備えていてよいことはもちろんである。
Further, the present invention can be applied to an arbitrary acoustic signal processing apparatus or a computer having a function other than the generation and output of waveform data by the functions shown in FIGS. 2 and 3, such as a multitrack recorder, an electronic musical instrument, and a sound source device. Of course, the present invention can be applied to a program for realizing the functions of such an acoustic signal processing device.
In this case, it goes without saying that the acoustic signal processing apparatus may include the sound system, display, etc. shown outside the waveform generating apparatus 10 in FIG.

また、上記の音響信号処理装置あるいは波形生成装置の機能を実現するためのプログラムは、はじめからコンピュータに備えるROMや他の不揮発性記憶媒体(フラッシュメモリ,EEPROM等)などに格納しておいてもよい。しかし、メモリカード、CD、DVD、ブルーレイディスク等の任意の不揮発性記録媒体に記録して提供することもできる。それらの記録媒体に記録されたプログラムをコンピュータにインストールして実行させることにより、上述した各手順を実行させることができる。   The program for realizing the functions of the above-described acoustic signal processing device or waveform generation device may be stored in a ROM or other nonvolatile storage medium (flash memory, EEPROM, etc.) provided in the computer from the beginning. Good. However, it can also be provided by being recorded on an arbitrary nonvolatile recording medium such as a memory card, CD, DVD, or Blu-ray disc. Each procedure described above can be executed by installing the program recorded in the recording medium in a computer and executing the program.

さらに、ネットワークに接続され、プログラムを記録した記録媒体を備える外部装置あるいはプログラムを記憶手段に記憶した外部装置からダウンロードし、コンピュータにインストールして実行させることも可能である。
また、以上述べてきた構成及び変形例は、矛盾しない範囲で適宜組み合わせて適用することも可能である。
Furthermore, it is also possible to download from an external device that is connected to a network and includes a recording medium that records the program, or an external device that stores the program in a storage unit, and install and execute the program on a computer.
In addition, the configurations and modifications described above can be applied in appropriate combinations within a consistent range.

以上の説明から明らかなように、処理内容がダイナミックに変化する変調処理を施された位相情報に基づき出力波形データを生成する場合でも、出力波形データにおける意図しないピッチの変化を抑えることができる。
従って、この発明を適用することにより、出力波形データの品質を向上させることができる。
As is clear from the above description, even when output waveform data is generated based on phase information subjected to modulation processing whose processing contents dynamically change, an unintended pitch change in the output waveform data can be suppressed.
Therefore, the quality of the output waveform data can be improved by applying the present invention.

10…波形生成装置、11…CPU、12…ROM、13…RAM、14…HDD、15…DMA制御部、16…DAC、17…外部機器I/F、18…表示回路、19…検出回路、20…通信I/F、21…システムバス、101…MIDIドライバ、102…オーディオドライバ、110…シーケンサアプリ、120…ソフトウェアシンセサイザプラグイン、121…イベントハンドラ、122…ピッチ生成部、123…エンベロープ信号生成部、124…オペレータ、125…出力部、131…波形生成部、132…音量制御部、201…位相カウンタ、202,203,211,212…加算部、204…波形情報取得部、205…変調値演算部、206…タイミング検知部、207…差分算出部、208…切替部、209…補正値保持部、210…LPF DESCRIPTION OF SYMBOLS 10 ... Waveform production | generation apparatus, 11 ... CPU, 12 ... ROM, 13 ... RAM, 14 ... HDD, 15 ... DMA control part, 16 ... DAC, 17 ... External apparatus I / F, 18 ... Display circuit, 19 ... Detection circuit, DESCRIPTION OF SYMBOLS 20 ... Communication I / F, 21 ... System bus, 101 ... MIDI driver, 102 ... Audio driver, 110 ... Sequencer application, 120 ... Software synthesizer plug-in, 121 ... Event handler, 122 ... Pitch generation part, 123 ... Envelope signal generation , 124 ... operator, 125 ... output unit, 131 ... waveform generation unit, 132 ... volume control unit, 201 ... phase counter, 202, 203, 211, 212 ... addition unit, 204 ... waveform information acquisition unit, 205 ... modulation value Calculation unit 206 ... Timing detection unit 207 ... Difference calculation unit 208 ... Switching unit 209 ... Correction value Sandwiching member, 210 ... LPF

Claims (5)

コンピュータを、
入力する位相情報に基づき該位相情報と対応するサンプル値を波形情報として生成する波形生成手段と、
供給された周波数情報に基づき第1位相情報を生成する位相情報生成手段と、
前記第1位相情報を、前記波形生成手段が生成した波形情報を用いて変調する変調手段と、
前記変調手段による変調により生じる位相情報の変動周期のずれを補正する補正手段と、
前記波形生成手段に対し、前記第1位相情報に対し前記変調手段による変調と前記補正手段による補正とを加えた第2位相情報を入力する入力手段として機能させるためのプログラム。
Computer
Waveform generating means for generating, as waveform information, a sample value corresponding to the phase information based on the input phase information;
Phase information generating means for generating first phase information based on the supplied frequency information;
Modulation means for modulating the first phase information using the waveform information generated by the waveform generation means;
Correction means for correcting the shift of the fluctuation cycle of the phase information caused by the modulation by the modulation means;
A program for causing the waveform generation means to function as input means for inputting second phase information obtained by adding modulation by the modulation means and correction by the correction means to the first phase information.
請求項1に記載のプログラムであって、
前記補正手段は、前記変調手段による変調後の位相情報が所定の値となった時点における、変調前後の位相情報の差分を前記変動周期のずれ量として検出し、その差分だけ、前記変調手段による変調前の位相情報を補正することを特徴とするプログラム。
The program according to claim 1,
The correction unit detects a difference in phase information before and after modulation as a shift amount of the fluctuation period when the phase information after modulation by the modulation unit becomes a predetermined value, and only the difference is detected by the modulation unit. A program for correcting phase information before modulation.
請求項1に記載のプログラムであって、
前記補正手段は、前記第2位相情報が所定の値となった時点における、前記第1位相情報と前記第2位相情報の差分を検出し、その差分だけ位相情報の補正量を調整し、その調整後の補正量だけ位相情報を補正することを特徴とするプログラム。
The program according to claim 1,
The correction means detects a difference between the first phase information and the second phase information when the second phase information reaches a predetermined value, adjusts a correction amount of the phase information by the difference, and A program that corrects phase information by an amount after correction.
請求項1乃至3のいずれか一項に記載のプログラムであって、
前記補正手段は、前記補正に係る補正量の時間変化を、検出した前記変動周期のずれ量の時間変化よりも緩慢にする手段を備えることを特徴とするプログラム。
A program according to any one of claims 1 to 3,
The said correction | amendment means is provided with a means to make the time change of the correction amount which concerns on the said correction slower than the time change of the detected deviation | shift amount of the said fluctuation | variation period.
入力する位相情報に基づき該位相情報と対応するサンプル値を波形情報として生成する波形生成手段と、
供給された周波数情報に基づき第1位相情報を生成する位相情報生成手段と、
前記第1位相情報を、前記波形生成手段が生成した波形情報を用いて変調する変調手段と、
前記変調手段による変調により生じる位相情報の変動周期のずれを補正する補正手段と、
前記波形生成手段に対し、前記第1位相情報に対し前記変調手段による変調と前記補正手段による補正とを加えた第2位相情報を入力する入力手段とを備える波形生成装置。
Waveform generating means for generating, as waveform information, a sample value corresponding to the phase information based on the input phase information;
Phase information generating means for generating first phase information based on the supplied frequency information;
Modulation means for modulating the first phase information using the waveform information generated by the waveform generation means;
Correction means for correcting the shift of the fluctuation cycle of the phase information caused by the modulation by the modulation means;
A waveform generation apparatus comprising: input means for inputting second phase information obtained by adding modulation by the modulation means and correction by the correction means to the first phase information.
JP2015019912A 2015-02-04 2015-02-04 Program and waveform generator Active JP6428326B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2015019912A JP6428326B2 (en) 2015-02-04 2015-02-04 Program and waveform generator

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2015019912A JP6428326B2 (en) 2015-02-04 2015-02-04 Program and waveform generator

Publications (2)

Publication Number Publication Date
JP2016142962A true JP2016142962A (en) 2016-08-08
JP6428326B2 JP6428326B2 (en) 2018-11-28

Family

ID=56570406

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2015019912A Active JP6428326B2 (en) 2015-02-04 2015-02-04 Program and waveform generator

Country Status (1)

Country Link
JP (1) JP6428326B2 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06167976A (en) * 1992-11-30 1994-06-14 Casio Comput Co Ltd Modulating signal generating device and effect adding device using the same
JPH1049172A (en) * 1996-04-24 1998-02-20 Yamaha Corp Method and device for synthesizing musical sound signal
JP2001175264A (en) * 1999-12-16 2001-06-29 Yamaha Corp Musical sound signal synthesizer

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06167976A (en) * 1992-11-30 1994-06-14 Casio Comput Co Ltd Modulating signal generating device and effect adding device using the same
JPH1049172A (en) * 1996-04-24 1998-02-20 Yamaha Corp Method and device for synthesizing musical sound signal
JP2001175264A (en) * 1999-12-16 2001-06-29 Yamaha Corp Musical sound signal synthesizer

Also Published As

Publication number Publication date
JP6428326B2 (en) 2018-11-28

Similar Documents

Publication Publication Date Title
JP6176133B2 (en) Resonance sound generation apparatus and resonance sound generation program
US9899016B2 (en) Musical sound signal generation apparatus that generates sound emulating sound emitting from a rotary speaker
US10109265B2 (en) Effect providing apparatus, effect providing method, storage medium and electronic musical instrument
JP6011219B2 (en) Audio file generation program and audio file generation apparatus
US11087732B2 (en) Oscillatory timbres for musical synthesis through synchronous ring modulation
JP6543895B2 (en) Effect adding device, method, and program, electronic musical instrument
US20150040740A1 (en) Sampling device and sampling method
JP6428326B2 (en) Program and waveform generator
JP4736046B2 (en) Waveform data production method, waveform data production apparatus, program, and waveform memory production method
JP7262580B2 (en) Harmonic generation in audio systems
JP3714397B2 (en) Waveform data processing apparatus and waveform data processing method
JP3844214B2 (en) Modulation waveform generator
JP3777923B2 (en) Music signal synthesizer
JP3799896B2 (en) Waveform generating method, recording medium, and waveform generating apparatus
JP2014057208A (en) Sweep signal generation apparatus, sweep signal generation method and program
JP5215925B2 (en) Audio processing apparatus and audio processing method
JP2007034099A (en) Musical sound synthesizer
JPH1049172A (en) Method and device for synthesizing musical sound signal
JPH10198378A (en) Music sound issuing device and method of issuing music sound
JP3925358B2 (en) Performance information editing apparatus and program for realizing performance information editing method
JP2006139158A (en) Sound signal synthesizer and synthesizing/reproducing apparatus
JP2020060680A (en) Electronic music device, reproduction control method, and program
JP2002023750A (en) Audio waveform data reproducing device, time base compression/expansion processor for audio waveform data, and pitch conversion processor for audio waveform data
JP2005274782A (en) Electronic musical sound generator
JP2004309980A (en) Musical sound signal processor

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20171222

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20180907

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20181015

R151 Written notification of patent or utility model registration

Ref document number: 6428326

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151