JP3705203B2 - Music generation method - Google Patents

Music generation method Download PDF

Info

Publication number
JP3705203B2
JP3705203B2 JP2001393560A JP2001393560A JP3705203B2 JP 3705203 B2 JP3705203 B2 JP 3705203B2 JP 2001393560 A JP2001393560 A JP 2001393560A JP 2001393560 A JP2001393560 A JP 2001393560A JP 3705203 B2 JP3705203 B2 JP 3705203B2
Authority
JP
Japan
Prior art keywords
sound source
software
output
event
midi
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2001393560A
Other languages
Japanese (ja)
Other versions
JP2002196763A (en
Inventor
元一 田邑
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Yamaha Corp
Original Assignee
Yamaha Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Yamaha Corp filed Critical Yamaha Corp
Priority to JP2001393560A priority Critical patent/JP3705203B2/en
Publication of JP2002196763A publication Critical patent/JP2002196763A/en
Application granted granted Critical
Publication of JP3705203B2 publication Critical patent/JP3705203B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Electrophonic Musical Instruments (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、演算処理装置を備える汎用処理装置により楽音を生成できるようにした楽音発生方法に関するものである。
【0002】
【従来の技術】
従来より、楽音発生装置においては、周波数変調方式、波形メモリ方式などの専用の音源回路(ハードウエア音源)およびマイクロプロセッサ(CPU)を用意し、MIDI(Musical Instrument Digital Interface)、鍵盤、あるいはシーケンサ等からの演奏情報に応じて、前記CPUにより前記ハードウエア音源を制御して楽音を発生することが一般的に行われていた。このため、楽音発生装置は楽音を生成するための専用機器となってしまい、楽音を生成する時には専用の楽音発生装置を用意する必要があった。
【0003】
これを解決するために、最近では、前記ハードウエア音源の動作をコンピュータプログラムによる音源処理(ソフトウエア音源)に置き換え、CPUにより演奏処理と音源処理とを実行させるようにした楽音発生方法が提案されている(特願平7−144159号)。ここで、演奏処理とは、入力されたMIDIなどの演奏情報に基づき、生成される楽音を制御するための制御情報を作成する処理であり、音源処理とは、該演奏処理において作成された制御情報に基づき楽音の波形データを生成する処理である。
【0004】
具体的な例としては、CPUは、通常、押鍵検出等の演奏処理を実行しており、該演奏処理に対して各サンプリング周期(デジタル/アナログ変換器の変換タイミング)毎に音源処理を割り込み実行させ、複数チャンネルの楽音の1サンプル分の波形データを演算生成した後、再び演奏処理に復帰するという方式も提案されている。
このような楽音発生方法においては、専用の楽音発生装置を用いることなく、CPUとソフトウエアのほかにはDA変換用のチップを備えるだけで、楽音を発生させることが可能となる。
【0005】
【発明が解決しようとする課題】
上記した従来のソフトウエア音源を備えた楽音発生方法においては、そのソフトウエア音源を専用で使用するようになされており、発生した演奏情報は該ソフトウエア音源に固定的に供給されるようになされていた。
ところで、上記したようにソフトウエア音源はパーソナルコンピュータなどの汎用コンピュータにおいても実行可能なものである。一般に、パーソナルコンピュータなどにおいては、拡張ボードによるハードウエア音源が備えられていることがあるが、ソフトウエア音源を備えた楽音発生方法を拡張ボードによるハードウエア音源を備える汎用コンピュータで実行した場合、拡張ボードによるハードウエア音源を使用することができないという問題点があった。
【0006】
そこで、本発明は、ソフトウエア音源を備えていても、ハードウエア音源を使用することのできる楽音発生方法を提供することを目的としている。
【0007】
【課題を解決するための手段】
上記目的を達成するために、本発明の楽音発生方法は、演算装置において実行される楽音発生方法であって、演奏情報を順次供給するステップと、ハードウエア音源とソフトウエア音源の少なくとも一方を指定するステップと、前記供給される演奏情報を、前記指定に従って、前記ハードウエア音源および/または前記ソフトウエア音源に入力させる入力ステップとを有し、前記入力ステップは、前記演算装置に前記ハードウェア音源が接続されていない場合は、前記演奏情報を前記ソフトウェア音源に入力させるものであり、前記ソフトウェア音源は、所定周期毎に、複数サンプリング周期分の楽音波形サンプルを一括して生成する波形生成演算を行うものとされている。
また、前記入力ステップは、前記ソフトウエア音源が指定された場合には、前記ハードウエア音源が指定された場合と比べて早いタイミングで演奏情報を前記ソフトウエア音源に入力させるようになされているものである。
【0008】
【発明の実施の形態】
本発明の楽音発生方法を実行することができる楽音発生装置の一実施の形態の構成を図1に示す。
この図において、1はアプリケーションプログラム等を実行して楽音波形サンプルの生成等の各種制御を行うマイクロプロセッサ(CPU)、2はプリセット音色データ等が記憶されているリードオンリメモリ(ROM)、3はCPU1のワークメモリエリアや音色データエリア、入力バッファエリア、チャンネルレジスタエリア、出力バッファエリア等の記憶エリアを有するランダムアクセスメモリ(RAM)、4は時刻を指示すると共に、タイマ割り込み処理のタイミングをCPU1に指示するタイマ、5はMIDIイベントが入力されると共に、生成されたMIDIイベントを出力するMIDIインターフェースであり、該MIDIインターフェースには点線で示すように外部音源6を接続することもできる。
【0009】
7は英字、かな、数字、記号などのキーを備えるいわゆるパソコン用のキーボード、8はユーザが楽音発生装置と対話するためのディスプレイ(モニタ)、9は各種アプリケーションプログラムがインストールされていると共に、楽音波形サンプルを生成するために使用する楽音波形データ等が記憶されているハードディスク装置(HDD)、10は前記RAM3内のCPU1により指定されたエリアに記憶されている楽音波形サンプルのデータをCPU1を介することなく直接に受渡を行い、一定のサンプリング周期(例えば、48kHz)毎にデジタル・アナログ変換器(DAC)11に供給するDMA(Direct Memory Access)回路、11は楽音波形サンプルのデータを受け取りアナログ信号に変換するデジタル・アナログ変換器(DAC)、12は拡張ボードの一種であり、前述したハードウエア音源が搭載されているサウンドカードである。13は前記DAC11から出力される楽音信号と前記サウンドカード12から出力される楽音信号とを混合するミキサー回路、14はミキサー回路13から出力されたアナログ信号に変換された楽音信号を放音するサウンドシステムである。
以上の構成はパソコン、ワークステーション等の汎用コンピュータと同等であり、それらの上で本発明の楽音発生方法を実施することができる。
【0010】
図2にこの楽音発生装置のソフトウエアモジュール構成の一例を示す。なお、この図においては、説明を簡略にするため、本発明の楽音発生方法に関係する部分のみが示してある。
この図に示すように、最上位層にはアプリケーションソフトウエアが位置しており、21はMIDIシーケンサ、ゲームソフトあるいはカラオケソフトなどのMIDIの再生を要求するプログラム(以下、単に「シーケンサプログラム」という)である。次の階層はシステムソフトウエア群であり、ここにソフトウエア音源23が位置しており、該ソフトウエア音源23は(ソフト)音源MIDIドライバおよび音源部が含まれている。25は波形(WAVE)入出力ドライバなどのいわゆるマルチメディア機能を実現するためのプログラム群、26は後述するコーデック回路16のためのコーデックドライバ、28は前記サウンドカード12のためのサウンドカードドライバである。なお、このコーデック回路16には波形サンプルデータを入出力するためのA/D変換器およびD/A変換器が含まれており、このD/A変換器は図1におけるDAC11である。
【0011】
また、22はアプリケーションプログラムと前記ソフトウエア音源23とのインターフェースをとるためのソフト音源MIDI出力API(application programming interface)、24はアプリケーションプログラムと前記プログラム群25内に含まれている波形(WAVE)入出力ドライバとのインターフェースをとるための波形出力API、27は前記シーケンサプログラム21などのアプリケーションソフトウエアとサウンドカードドライバ28および外部音源6とのインターフェースをとるためのMIDI出力APIである。各プログラムはこれらAPIを使用してシステムプログラムの提供する各種サービスを利用することができる。
なお、図示していないが、上記システムソフトウエアの階層には、当然、通常の汎用OSに含まれているデバイスドライバ群およびメモリ管理、ファイルシステム、ユーザインターフェースなどのプログラム群が含まれている。
【0012】
このような構成において、シーケンサプログラム21から演奏情報としてMIDIイベントが出力される。本発明においては、この演奏情報の出力先は、図示するように、前記ソフト音源MIDI出力API22およびMIDI出力API27のいずれか一方あるいは両方を選択することができるようになされている。これは、当該MIDIイベントを受け取るべきAPIを指定してシーケンサプログラム21からMIDIイベントを送出することにより実現される。ただし、ハードウエア音源が装着されていないときには、ハードウエア音源を選択することはできないようになされている。
【0013】
シーケンサプログラム21からの演奏情報の出力先としてソフトウエア音源23が選択され、ソフト音源MIDI出力API22にMIDIイベントが出力されたとき、ソフトウエア音源23は、受け取ったMIDIメッセージを波形(WAVE)出力データに変換し、波形出力API24を呼ぶ。これにより発生された楽音に対応する波形データはコーデックドライバ26を介してコーデック回路16に出力され、前述したようにDAC11によりアナログ信号に変換されてサウンドシステム14より発音されることとなる。
【0014】
一方、シーケンサプログラム21からの演奏情報の出力先としてサウンドカード12に搭載されているハードウエア音源が選択され、MIDI出力API27にMIDIイベントが出力されたときは、該MIDIイベントはサウンドカードドライバ28を介してサウンドカード12内のハードウエア音源に出力され、該ハードウエア音源に固有の楽音発生方式に基づいて対応する楽音が生成されることとなる。
また、外部に接続されている外部音源6が演奏情報の出力先として選択されたときもMIDI出力API27にMIDIイベントが出力され、プログラム群25内の外部MIDIドライバおよびMIDIインタフェース5を介して外部音源6に出力される。これにより、外部音源6から対応する楽音が発生される。
【0015】
図3はソフトウエア音源23を用いて行われる楽音発生処理を説明するための図である。この図において、演奏入力と記されているのは、前述したシーケンサプログラム21から出力されるMIDIイベントであり、例えば、時刻ta、tb、tc、tdのように楽譜通りのタイミングで送出される。このMIDIイベントが受信されると最も優先順位の高い割り込みが発生し、該MIDI受信割り込み処理においてそのMIDIイベントは受信時刻データとともに入力バッファに格納される。これによりソフトウエア音源23においてMIDI処理が行われ、各MIDIイベントに対応する発音制御信号が対応する発音チャンネルの音源レジスタに書き込まれる。
【0016】
図の中段に示されているのは、ソフトウエア音源23の音源処理部により実行される波形生成演算のタイミングであり、演算時刻t0、t1,t2、t3と示すように一定周期で起動される。この周期をフレーム周期と呼び、これは一つの出力バッファに格納可能な波形サンプル数に応じた周期である。各フレーム周期において、その前のフレーム周期に受信されたMIDIイベントに応じて前記MIDI処理により各発音チャンネルの音源レジスタに格納されている発音制御信号を用いて、各発音チャンネルの波形生成演算が実行される。このようにして生成された波形データは出力バッファに足し込まれ、図3の下段に示すように、その次のフレーム周期にDMA回路10により各サンプリング周期毎に順次読み出され、DAC11により再生される。これにより、途切れることなく発音が行われる。
【0017】
(ソフトウエア音源処理)
図4はソフトウエア音源23により実行される処理のフローチャートを示す図である。ソフトウエア音源23は起動されると、まず、ステップS10において、各種レジスタのクリアなどの初期設定が行われる。続いてステップS11において、ユーザーに対してこのソフトウエア音源が起動されていることを表示するためのアイコンの表示などの画面の準備処理が行われる。次に、ステップS12に進み、ここで起動要因が存在するか否かのチェックが行われる。起動要因としては、(1)入力バッファに未処理イベントがあること(これはMIDIイベントを受信したときに発生する。)、(2)(演算時刻となって)波形演算要求が発生していること、(3)キーボードやパネルからの音源の動作の制御コマンド入力などのMIDIの処理以外の処理要求が発生していること、(4)終了要求が発生していること、の4通りの要因が存在している。
【0018】
ステップS13において起動要因があるか否かが判定され、NOのときは再びステップS12に戻り、起動要因の発生を待つ。ステップS13の判定結果がYESとなり、起動要因が発生していることが検出されたときにはステップS14に進み、該起動要因が前記(1)〜(4)のうちのいずれであるのかが判定される。
【0019】
(MIDI処理)
この判定により、(1)入力バッファに未処理イベントがあるときには、ステップS15に進み、MIDI処理が行われる。このMIDI処理においては、入力バッファに書き込まれているMIDIイベントを、それに対応する音源(発音チャンネル)に渡すべき制御パラメータに変換する処理が行われる。このステップS15のMIDI処理が終了した後、ステップS16の受信表示処理がおこなわれ、MIDIを受信したことなどが画面に表示される。そして、その後ステップS12に戻り、起動要因の発生を待つ。
【0020】
上記ステップS15のMIDI処理の一例を図5の(a)と(b)に示す。図5の(a)は入力バッファに格納されているMIDIイベントがノートオンイベントであるときに実行されるMIDI処理のフローチャートである。未処理イベントがノートオンイベントであるときには、まず、ステップS31において、当該ノートナンバーがNNとして、ベロシティがVELとして、パート別の音色データがtとして、それぞれレジスタに取り込まれ、さらに、そのノートオンイベントの発生時刻がTMレジスタに取り込まれる。次いで、ステップS32においてレジスタに取り込まれたノートナンバNNの発音割当処理が行われ、割り当てられたチャンネル(ch)の番号がiとしてレジスタに取り込まれる。
【0021】
続いてステップS33において、tに対応する音色データTP(t)がノートナンバNNおよびベロシティVELに応じて加工される。そして、ステップS34において、該加工された音色データ、ノートオンおよび発生時刻データTMをiチャンネルの音源レジスタに書き込み、ノートオンイベント処理を終了する。
【0022】
図5の(b)は未処理イベントがノートオフイベントであるときの処理のフローチャートである。
ノートオフ処理が開始されると、ステップS41において、入力バッファ中のそのノートオフイベントのノートナンバがNNとして、また、パート別音色データがtとして、それぞれレジスタに取り込まれ、さらに、該ノートオフイベントの発生時刻がTMとしてレジスタに取り込まれる。次いで、ステップS42において、ノートナンバNNで発音されている発音チャンネル(ch)がサーチされ、見つかった発音chの番号がiとしてレジスタに取り込まれる。次に、ステップS43においてichの音源レジスタにノートオフと発生時刻TMとを書き込んで、ノートオフイベント処理を終了する。
【0023】
(音源処理)
前記ステップS14において、起動要因が(2)波形演算要求発生であるときは、ステップS17の音源処理が実行される。この処理は波形生成演算を行う処理であり、前記ステップS15のMIDI処理において各チャンネル(ch)に対応する音源レジスタに格納された楽音制御データに基づき波形生成演算が行われる。このステップS17の音源処理が終了した後に、ステップS18において例えば音源処理に要したCPUの負荷量などが表示される。その後、ステップS12に戻り、待ち状態となる。
【0024】
ステップS17の音源処理においては、まず、演算順序の1番目の発音チャンネル(ch)について、LFO、フィルタG、音量EGの波形演算を行い、所定の時間範囲の演算に必要なLFO波形、FEG波形、AEG波形のサンプルを生成する。LFO波形はFナンバ、FEG波形、AEG波形に加算され、各データを変調する。また、消音すべきチャンネルとして指定された発音チャンネルに関しては、音量EGとして前記範囲内で急速に減衰するダンプ用のAEG波形が演算生成される。
次いで、前回の読み出しアドレスを初期値としてFナンバを繰り返し加算し前記時間範囲内の各サンプルの読み出しアドレスを発生し、この読み出しアドレスの整数部に基づいて音色データ内の波形記憶領域より波形サンプルを読み出すと共に、この読み出しアドレスの小数部に基づいて読み出された波形サンプル間の補間を行い、前記時間範囲内の全補間サンプルを算出するようにする。
【0025】
さらに、前記時間範囲内の補間サンプルに対し音色フィルタ処理が行われ、前記FEG波形に基づいて音色制御が行われ、フィルタ処理済の前記時間範囲内のサンプルに対し振幅制御処理が行われ、前記AEGおよび音量データに基づいて楽音波形サンプルの振幅制御が行われると共に、振幅制御処理された前記時間範囲分の楽音波形サンプルがそれぞれ出力バッファの対応するサンプルに足し込まれる累算書込処理が実行される。
このようにして、全発音チャンネルの演算が終了するまで各発音チャンネルの波形サンプル生成処理が行われ、生成された前記所定時間範囲分のサンプルは、出力バッファの対応するサンプルに順次足し込まれる。
【0026】
なお、これらステップS15のMIDI処理およびステップS17の音源処理については、前記特願平7ー144159号に詳細に記載されているので、必要な場合には当該公報を参照されたい。
【0027】
(その他の処理)
また前記ステップS14において、(3)その他の処理要求であると判定されたときは、ステップS19に進み、対応する処理、例えば、この処理要求が音色の設定/変更処理であるときには、設定された音色番号を設定する処理など行い、ステップS20に進んで該設定された音色番号の表示などを行った後、ステップS12に戻り待ち状態となる。
さらに、前記ステップS14において、(4)終了要求であると判定されたときは、ステップS21において終了処理を行い、ステップS22において関連する画面情報を消去して、このソフトウエア音源処理を終了する。
【0028】
(MIDI受信割込み処理)
次に、CPU1により実行されるMIDI受信割込み処理のフローチャートを図6に示す。この処理は、ソフト音源MIDI出力API22が呼ばれて、シーケンサプログラム21などからの演奏情報(MIDIイベント)が受信された際に発生される割り込みにより起動される。この割り込みの優先順位は最も高くされており、このMIDI受信割込み処理は、シーケンサプログラム21やソフトウエア音源23の処理などの他の処理より優先して行われる処理である。このMIDI受信割込み処理が開始されると、ステップS51において受信されたMIDIイベントデータが取り込まれ、ステップS52においてその受信データは受信された時点の時刻データと組にして前述した入力バッファに書き込まれて、割込み発生時の処理へリターンされる。これにより、受信したMIDIデータは、順次、受信時刻と共に入力バッファに書き込まれるようになる。
【0029】
(シーケンサプログラム)
図7にシーケンサプログラム21における処理のフローチャートを示す。シーケンサプログラム21は起動されると、まず、ステップS61において各種レジスタのクリアなどの初期設定が行われ、次に、ステップS62において該プログラムが起動中であることを示すアイコンなどの表示を行うための画面準備処理が行われる。そして、ステップS63に進み、起動要因が発生したか否かのチェックが行われ、ステップS64において起動要因が発生したと判定されると、ステップS65に進む。ステップS65において、発生した起動要因がなにであるのかが判定され、その起動要因に応じて、それぞれ、対応するステップに分岐される。また、起動要因が発生していないときには、ステップS63に戻り、起動要因の発生待ちの状態となる。
【0030】
このシーケンサプログラムの起動要因としては、(1)スタート・ストップ要求の発生、(2)テンポタイマからの割り込みの発生、(3)出力先音源の指定、テンポの変更、パートバランスの変更、曲のエディットあるいは自動演奏の録音処理などその他の要求の発生、(4)プログラムの終了要求の発生などがある。
【0031】
まず、前記ステップS65における要因の判定結果が(3)その他の要求の発生であるときには、ステップS90において、前述したようなそれぞれの要求に対応する処理が行われ、次いでステップS91において対応する表示が行われる。そして、前記ステップS63に戻り待ち状態となる。
【0032】
(出力先指定処理)
演奏情報の出力先指定処理もこのステップS90において処理される処理のうちの一つである。例えば、前記ステップS62において、ディスプレイ8の画面上に表示されている出力音源を切り替えるスイッチを演奏者がマウスでクリックするなどしたときに、前記ステップS65において起動要因として出力音源の指定が検出され、この出力先指定処理が起動される。図8を参照してこの出力先指定処理について説明する。
【0033】
図8の(a)は出力先指定処理の第1の形態を示すフローチャートである。この形態においては、シーケンサプログラム21から出力される全ての演奏情報の出力先音源が一括して選択される。
処理が開始されると、まず、ステップS900において、ユーザーにより指定された出力音源指定データがTGSレジスタに格納される。この形態においては、画面上に表示されている出力音源指定スイッチを演奏者がクリックする毎に、図8の(b)に示す4つの選択状態、すなわち、(イ)いずれの音源にも出力しない、(ロ)ソフトウエア音源に出力する、(ハ)ハードウエア音源に出力する、(ニ)ソフトウエア音源とハードウエア音源の両方に出力する、がサイクリックに変更されるようになされており、このクリックの回数のモジュロ4の値が出力音源指定データとしてTGSレジスタに格納される。
【0034】
次に、ステップS901において、TGSレジスタの内容により指定された音源が、ソフトウエア音源23であるかハードウエア音源12であるかが判定される。そして、ステップS902において、選択された出力音源の規格を示すロゴを表示画面上に表示する。図8の(c)にこの表示の一例を示す。このロゴ表示により演奏者は使用している音源の規格を知ることができる。
【0035】
図8の(d)に出力先指定処理の第2の形態のフローチャートを示す。この形態は、演奏パート別に出力する音源を選択することができるものである。
処理が開始されると、まず、ステップS910において、入力されるパート指定データを変数pとして取り込み、次に、ステップS911において、指定された該パートpの出力音源指定データをTGSpレジスタに格納する。そして、ステップS912において、各パートとそれに対応する出力音源の設定状態を表示する。このように、出力音源指定データを格納するレジスタを各パート対応に設けることにより、各パート毎に出力すべき音源の選択を行うことが可能となる。
【0036】
例えば、ある楽曲についてそのドラムパートをソフトウエア音源(GM)、ベースパートをソフトウエア音源(XG)、ギターパートをハードウエア音源(XG)およびエレクトリックピアノパートをハードウエア音源(FM音源)というように指定することができる。
なお、各パートと出力すべき音源との対応は、演奏者が設定してもよいし、あるいは、各パートの音色データなどがハードウエア音源に備えられている場合には該ハードウエア音源を使用し、そうでないときにはソフトウエア音源を使用するようにしてもよい。
【0037】
さらに、ハードウエア音源とソフトウエア音源とのいずれを使用するかについて、前記サウンドカード12あるいは外部音源6が当該汎用コンピュータに装着されているか否かを自動的に判断して、装着されている場合には自動的にハードウエア音源を選択し、装着されていないときにはソフトウエア音源を選択するようにできる。
これにより、ハードウエア音源の着脱により設定を変更する必要がなくなる。
【0038】
(スタート・ストップ処理)
前記ステップS65における判定の結果、起動要因が(1)スタート・ストップ要求の発生であるときは、ステップ70においてスタート・ストップ処理が行われ、ステップS71においてスタート・ストップ状態の表示が行われた後、前記ステップS63に戻り、起動要因の発生待ちの状態となる。
このステップS70スタート・ストップ処理について、図9の(a)を参照して説明する。このスタート・ストップ要求は、演奏者の操作により行われるものであり、例えば画面上の所定のフィールドをクリックすることにより、スタート・ストップ要求が入力されるようになされている。このスタート・ストップ要求が入力されると、ステップS700において、現在の状態が停止状態であるのか否かがRUNフラグの状態により判定される。RUNフラグは、演奏状態にあるときに「1」にセットされるフラグであり、この判定結果がNOのときは現在演奏状態にあるので、ステップS701に進んでRUNフラグをリセットし、続いてステップS702においてテンポタイマをストップさせ、ステップS703において自動演奏の後処理を行って、演奏を停止する。
【0039】
一方、現在停止状態にありステップS700の判定結果がYESとなったときは、ステップS704に進んでRUNフラグをセットし、ステップS705において自動演奏の準備を行う。この自動演奏の準備においては、指定された曲のデータをハードディスク装置9などからRAM3への転送、読み出しポインタへのスタートアドレスの設定、最初のイベントの準備およびパート別の音量の設定などの各種処理が行われる。続いて、ステップS706においてテンポタイマの設定を行い、ステップS707においてテンポタイマをスタートさせて、演奏を開始させる。
【0040】
(イベント再生処理)
前記ステップS65における起動要因の判定結果が(2)テンポタイマ割り込み有りであるときは、ステップS80においてイベント再生処理が行われ、その後ステップS81においてそのイベントの表示がなされる。そして、ステップS63に戻り、起動要因の待ち状態となる。
このステップS80のイベント再生処理について、図9の(b)を参照して説明する。テンポタイマ割り込みは演奏のテンポを決定するために周期的に発生される割り込みであり、この割り込みにより演奏の時刻が決定されるものである。このテンポタイマ割り込みが発生すると、ステップS800において時刻のカウントが行われる。そして、このカウント結果がイベントを再生すべきイベント時刻を越えているか否かがステップS801において判定され、越えていないときはイベント再生処理S80を終了する。
【0041】
一方、ステップS801の判定結果がYESのときは、ステップS802に進み、イベントの再生、すなわちRAM3からのイベントの取り出しが行われる。そして、ステップS803において、取り出したイベント(再生イベント)の出力処理が行われる。この再生イベント出力処理は、再生イベントを前記出力先指定処理において設定されたTGSレジスタの内容に応じた仲介ルーチン、すなわち、ソフトウエア音源23に出力する場合にはソフト音源MIDI出力API22、ハードウエア音源12に出力する場合にはMIDI出力API27に、出力する処理である。これにより、MIDIイベントが指定された音源に出力される。次にステップS804に進み、取り出した再生イベントのデュレーションデータとイベント時刻とを加算することにより次のイベントの再生時刻を計算して、このイベント再生処理ルーチンを終了する。なお、このステップS803の処理は、前記図8の(a)に示した、演奏情報全体に対してその出力音源を一括して指定する形態に対応するものである。
【0042】
なお、前述したように、このS803の再生イベント出力処理によりイベントが出力されたときに、前記MIDI受信割り込みが発生して、当該MIDIイベントは入力バッファに格納される。そして、この割り込み処理の終了後に上述したイベント再生処理ルーチンに制御が復帰し、前記ステップS804の次イベント時刻計算処理が実行されることとなる。
【0043】
図10の(a)および(b)に、前記再生イベント出力処理ステップS803の変形例を示す。図10の(a)は、前記図8の(b)に示した演奏パート別に出力先音源を指定する形態に対応するものである。まず、ステップS810において、再生イベントのパートが検出され変数pとして取り込まれる。そして、ステップS811においてレジスタTGSpの内容を参照し、該内容に対応する仲介ルーチン(API)に当該再生イベントを出力する。これにより、各パート別に指定された音源に演奏情報が出力される。
【0044】
図10の(b)は、ハードウエア音源に優先的に演奏情報を出力し、発音すべきチャンネル数が該ハードウエア音源の発音可能チャンネル数を超えたときに、その超えた分の演奏情報をソフトウエア音源により発音させる形態である。この変形例においては、まず、ステップS820において、前記ステップS802(図9の(b))において取り出された再生イベントがノートオンイベントであるか否かが判定される。ノートオンイベントではないときは、ステップS821に進み、該イベントに対応するノートオンを前に受け取っている音源にこのイベントを出力してこの処理を終了する。
【0045】
一方、再生イベントがノートオンイベントであり、ステップS820の判定結果がYESのときは、ステップS822において、ハードウエア音源の現在発音数を検出し、ステップS823において当該再生イベントによりハードウエア音源の発音可能チャンネル数を超えるか否かを判定する。この判定結果がNOのときは、ステップS824に進み、この再生イベントをハードウエア音源に出力する。また、ステップS823の判定結果がYESとなったときは、ステップS825に進み、この再生イベントをソフトウエア音源23に出力する。これにより、ハードウエア音源の発音可能チャンネル数(例えば、32ch)を超えた分をソフトウエア音源により発音することが可能となる。
【0046】
また、前記ステップS65の判定結果、起動要因が(4)終了要求であったときには、ステップS100に進んで終了処理を行い、ステップS101において関連する表示部分を消去して、このシーケンサプログラムの処理を終了する。
【0047】
また、サウンドカード12に搭載されているハードウエア音源または外部に接続された外部音源6に演奏情報が出力されたときには、周知の方法で該ハードウエア音源において発音処理が実行される。
ただし、ソフトウエア音源とハードウエア音源との両方に演奏情報を出力する場合には、前述したように、ソフトウエア音源による楽音の発生に所定時間の遅延が発生するため、該遅延時間が大きいときには、ハードウエア音源に対する演奏情報の出力を当該時間だけ遅らせるなどの処理を行うことが必要である。
【0048】
また、前記シーケンサプログラム21が楽音再生と画像表示などその他の処理とが同期して行われるソフトウエアである場合にも、この遅延時間についての考慮が必要となる場合がある。
例えば、カラオケソフトの場合には、曲の演奏とともに歌詞の表示を行うのが一般的である。伴奏曲の進行に応じて歌詞の色を徐々に変更する処理(ワイプ処理)や表示する歌詞を入れ替える処理が行われる。ところで、このような歌詞の表示処理は、伴奏音と同期している必要がある。従って、カラオケソフトで本発明のようにハードウエア音源とソフトウエア音源を選択できるようにした場合、どちらの音源を選択したかに応じて、表示のタイミングを変更することが必要となる。すなわち、ソフトウエア音源が選択された場合には、ハードウエア音源を選択した場合と比較して、遅いタイミングで表示処理を行うようにする。また、歌詞表示の方でタイミングを取る代わりに、各音源に供給する演奏情報のタイミングを調整するようにしても良い。すなわち、ソフトウエア音源を選択した場合には、ハードウエア音源を選択した場合に比べて、早いタイミングで演奏情報を音源に出力するようにするのである。
なお、本発明は、MIDIインターフェースを介して外部のシーケンサなどから入力される演奏情報を音源に渡す場合にも、全く同様に適用することができる。
【0049】
【発明の効果】
ソフトウエア音源とハードウエア音源とを選択して演奏情報を出力することができ、ハードウェア音源が装着されてない場合には自動的にソフトウェア音源を選択するようにした本発明によれば、ハードウェア音源の着脱を行ったときにハードウェア音源とソフトウェア音源のいずれを使用するかの設定を変更する必要をなくすことができる。
【図面の簡単な説明】
【図1】 本発明の楽音発生方法を実行することができる楽音発生装置の一例である。
【図2】 図1の楽音発生装置のソフトウエアモジュール構成である。
【図3】 ソフトウエア音源を用いて行われる楽音発生処理を説明するための図である。
【図4】 ソフトウエア音源処理のフローチャートである。
【図5】 MIDI処理のフローチャートである。
【図6】 MIDI受信割込み処理のフローチャートである。
【図7】 シーケンサの処理のフローチャートである。
【図8】 出力先指定ルーチンを説明するための図である。
【図9】 スタート・ストップ処理およびイベント再生処理のフローチャートである。
【図10】 再生イベント出力処理のフローチャートである。
【符号の説明】
1 CPU、2 ROM、3 RAM、4 タイマ、5 MIDIインターフェース、6 外部音源、7 キーボード、8 ディスプレイ、9 ハードディスク装置、10 DMA回路、11 D/A変換器(DAC)、12 サウンドカード、13 ミキサー、14 サウンドシステム、15 バス、16 Codec、21 シーケンサプログラム、22、24、27 API、23 ソフトウエア音源、25 プログラム群、26 Codecドライバ、28 サウンドカードドライバ
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a musical sound generation method in which a musical sound can be generated by a general-purpose processing device including an arithmetic processing device.
[0002]
[Prior art]
Conventionally, in a musical tone generator, dedicated tone generator circuits (hardware tone generators) such as a frequency modulation method and a waveform memory method and a microprocessor (CPU) are prepared, and a MIDI (Musical Instrument Digital Interface), keyboard, sequencer, etc. In general, the CPU generates the musical sound by controlling the hardware sound source in accordance with the performance information from the CPU. For this reason, the musical sound generator becomes a dedicated device for generating musical sounds, and it is necessary to prepare a dedicated musical sound generator when generating musical sounds.
[0003]
In order to solve this, recently, a musical sound generation method has been proposed in which the operation of the hardware sound source is replaced with sound source processing (software sound source) by a computer program, and the performance processing and sound source processing are executed by the CPU. (Japanese Patent Application No. 7-144159). Here, the performance process is a process for creating control information for controlling a musical tone to be generated based on performance information such as input MIDI, and the sound source process is a control created in the performance process. This is a process for generating musical tone waveform data based on the information.
[0004]
As a specific example, the CPU normally performs performance processing such as key depression detection, and interrupts sound source processing for each sampling cycle (conversion timing of the digital / analog converter) for the performance processing. There has also been proposed a method of executing and generating waveform data for one sample of musical sounds of a plurality of channels and then returning to performance processing again.
In such a musical tone generation method, a musical tone can be generated by using a DA conversion chip in addition to the CPU and software without using a dedicated musical tone generator.
[0005]
[Problems to be solved by the invention]
In the above-described conventional method for generating a musical tone equipped with a software sound source, the software sound source is used exclusively, and the generated performance information is fixedly supplied to the software sound source. It was.
By the way, as described above, the software sound source can be executed by a general-purpose computer such as a personal computer. Generally, a personal computer or the like may be equipped with a hardware sound source using an expansion board, but if a musical sound generation method equipped with a software sound source is executed on a general-purpose computer equipped with a hardware sound source using an expansion board, the expansion There was a problem that the hardware sound source by the board could not be used.
[0006]
Therefore, an object of the present invention is to provide a musical sound generation method that can use a hardware sound source even if it includes a software sound source.
[0007]
[Means for Solving the Problems]
In order to achieve the above object, a musical sound generating method according to the present invention is a musical sound generating method executed in an arithmetic unit, wherein a step of sequentially supplying performance information and at least one of a hardware sound source and a software sound source are specified. And an input step for causing the hardware sound source and / or the software sound source to be input according to the designation, wherein the input step causes the computing device to input the hardware sound source. Is not connected, the performance information is input to the software sound source, the software sound source, Every predetermined period Multiple of Generating musical sound waveform samples for sampling period in a batch Perform waveform generation calculation It is supposed to be.
In the input step, when the software sound source is designated, performance information is input to the software sound source at an earlier timing than when the hardware sound source is designated. It is.
[0008]
DETAILED DESCRIPTION OF THE INVENTION
FIG. 1 shows the configuration of an embodiment of a musical sound generating apparatus capable of executing the musical sound generating method of the present invention.
In this figure, 1 is a microprocessor (CPU) that performs various controls such as generation of musical sound waveform samples by executing an application program and the like, 2 is a read only memory (ROM) in which preset tone color data and the like are stored, 3 A random access memory (RAM) having storage areas such as a work memory area, a tone color data area, an input buffer area, a channel register area, and an output buffer area of the CPU 1, 4 indicates the time, and the timing of timer interrupt processing to the CPU 1 The instructing timer 5 is a MIDI interface that receives a MIDI event and outputs a generated MIDI event, and an external sound source 6 can be connected to the MIDI interface as indicated by a dotted line.
[0009]
7 is a so-called personal computer keyboard having keys such as letters, kana, numbers, symbols, etc. 8 is a display (monitor) for the user to interact with the musical sound generating device, 9 is installed with various application programs and musical sounds. A hard disk drive (HDD) 10 stores musical sound waveform data used for generating waveform samples, and 10 stores data of musical sound waveform samples stored in an area designated by the CPU 1 in the RAM 3 via the CPU 1. A direct memory access (DMA) circuit that delivers data directly to the digital-to-analog converter (DAC) 11 at a constant sampling period (for example, 48 kHz). To digital-to-analog converter (DAC) 12 is a kind of expansion board, a sound card hardware sound source described above is mounted. 13 is a mixer circuit that mixes the tone signal output from the DAC 11 and the tone signal output from the sound card 12, and 14 is a sound that emits the tone signal converted to an analog signal output from the mixer circuit 13. System.
The above configuration is the same as that of a general-purpose computer such as a personal computer or a workstation, and the musical tone generation method of the present invention can be implemented on them.
[0010]
FIG. 2 shows an example of the software module configuration of this musical tone generator. In this figure, only parts related to the musical sound generating method of the present invention are shown for the sake of simplicity.
As shown in this figure, application software is located in the highest layer, and 21 is a program that requests reproduction of MIDI such as a MIDI sequencer, game software, or karaoke software (hereinafter simply referred to as “sequencer program”). It is. The next layer is a system software group, where a software sound source 23 is located, and the software sound source 23 includes a (software) sound source MIDI driver and a sound source unit. Reference numeral 25 is a program group for realizing a so-called multimedia function such as a waveform (WAVE) input / output driver, 26 is a codec driver for a codec circuit 16 described later, and 28 is a sound card driver for the sound card 12. . The codec circuit 16 includes an A / D converter and a D / A converter for inputting and outputting waveform sample data. The D / A converter is the DAC 11 in FIG.
[0011]
Reference numeral 22 denotes a software sound source MIDI output API (application programming interface) for interfacing the application program with the software sound source 23, and reference numeral 24 denotes a waveform (WAVE) input in the application program and the program group 25. A waveform output API 27 for interfacing with the output driver is a MIDI output API 27 for interfacing application software such as the sequencer program 21 with the sound card driver 28 and the external sound source 6. Each program can use various services provided by the system program using these APIs.
Although not shown, the system software hierarchy naturally includes a group of programs such as a device driver group and a memory management, file system, and user interface included in a general general-purpose OS.
[0012]
In such a configuration, a MIDI event is output from the sequencer program 21 as performance information. In the present invention, as the output destination of this performance information, one or both of the soft sound source MIDI output API 22 and the MIDI output API 27 can be selected as shown in the figure. This is realized by designating an API that should receive the MIDI event and sending the MIDI event from the sequencer program 21. However, the hardware sound source cannot be selected when the hardware sound source is not attached.
[0013]
When the software sound source 23 is selected as the output destination of the performance information from the sequencer program 21 and a MIDI event is output to the software sound source MIDI output API 22, the software sound source 23 converts the received MIDI message into waveform (WAVE) output data. And the waveform output API 24 is called. The waveform data corresponding to the generated musical sound is output to the codec circuit 16 via the codec driver 26, converted into an analog signal by the DAC 11 as described above, and is generated by the sound system 14.
[0014]
On the other hand, when a hardware sound source mounted on the sound card 12 is selected as an output destination of performance information from the sequencer program 21, and a MIDI event is output to the MIDI output API 27, the MIDI event is sent to the sound card driver 28. To a hardware sound source in the sound card 12 and corresponding musical sound is generated based on a musical sound generation method specific to the hardware sound source.
Further, when an external sound source 6 connected to the outside is selected as an output destination of performance information, a MIDI event is output to the MIDI output API 27, and the external sound source is connected via the external MIDI driver in the program group 25 and the MIDI interface 5. 6 is output. Thereby, the corresponding musical sound is generated from the external sound source 6.
[0015]
FIG. 3 is a diagram for explaining a musical sound generation process performed using the software sound source 23. In this figure, what is described as performance input is a MIDI event output from the sequencer program 21 described above, and is transmitted at a timing according to the score, for example, at times ta, tb, tc, and td. When this MIDI event is received, an interrupt with the highest priority is generated, and in the MIDI reception interrupt processing, the MIDI event is stored in the input buffer together with the reception time data. Thus, the MIDI processing is performed in the software sound source 23, and the sound generation control signal corresponding to each MIDI event is written in the sound source register of the corresponding sound generation channel.
[0016]
The middle part of the figure shows the timing of the waveform generation calculation executed by the sound source processing unit of the software sound source 23, which is activated at a constant cycle as indicated by calculation times t0, t1, t2, and t3. . This period is called a frame period, which is a period corresponding to the number of waveform samples that can be stored in one output buffer. In each frame period, the waveform generation calculation of each sound channel is executed using the sound generation control signal stored in the sound source register of each sound channel by the MIDI processing according to the MIDI event received in the previous frame period Is done. The waveform data generated in this way is added to the output buffer, and as shown in the lower part of FIG. 3, the DMA circuit 10 sequentially reads out each sampling period in the next frame period and is reproduced by the DAC 11. The As a result, pronunciation is performed without interruption.
[0017]
(Software sound source processing)
FIG. 4 is a diagram showing a flowchart of processing executed by the software sound source 23. When the software sound source 23 is activated, first, in step S10, initialization such as clearing of various registers is performed. Subsequently, in step S11, a screen preparation process such as displaying an icon for displaying that the software sound source is activated to the user is performed. Next, the process proceeds to step S12, where it is checked whether or not there is an activation factor. As activation factors, (1) there is an unprocessed event in the input buffer (this occurs when a MIDI event is received), and (2) a waveform calculation request is generated (as the calculation time). There are four factors: (3) a processing request other than MIDI processing such as input of a sound source operation control command from the keyboard or panel is generated, and (4) an end request is generated. Is present.
[0018]
In step S13, it is determined whether there is an activation factor. If NO, the process returns to step S12 and waits for the activation factor to occur. If the decision result in the step S13 is YES and it is detected that the activation factor is generated, the process proceeds to a step S14 to determine which of the (1) to (4) is the activation factor. .
[0019]
(MIDI processing)
As a result of this determination, (1) when there is an unprocessed event in the input buffer, the process proceeds to step S15 and MIDI processing is performed. In this MIDI processing, processing for converting a MIDI event written in the input buffer into a control parameter to be passed to a sound source (sound generation channel) corresponding to the MIDI event is performed. After the MIDI process in step S15 is completed, a reception display process in step S16 is performed, and the fact that the MIDI has been received is displayed on the screen. Then, the process returns to step S12 and waits for the generation of the activation factor.
[0020]
An example of the MIDI processing in step S15 is shown in FIGS. FIG. 5A is a flowchart of the MIDI processing executed when the MIDI event stored in the input buffer is a note-on event. When the unprocessed event is a note-on event, first, in step S31, the note number is taken as NN, the velocity is set as VEL, and the tone data for each part is taken as t, respectively. Is generated in the TM register. Next, the sound generation assignment process of the note number NN taken into the register in step S32 is performed, and the assigned channel (ch) number is taken into the register as i.
[0021]
Subsequently, in step S33, the timbre data TP (t) corresponding to t is processed according to the note number NN and the velocity VEL. In step S34, the processed tone color data, note-on and generation time data TM are written to the i-channel sound source register, and the note-on event process is terminated.
[0022]
FIG. 5B is a flowchart of processing when the unprocessed event is a note-off event.
When the note-off process is started, in step S41, the note number of the note-off event in the input buffer is taken as NN, and the tone data for each part is taken as t, respectively. Is generated in the register as TM. Next, in step S42, the sound channel (ch) sounded with the note number NN is searched, and the number of the sound sound channel found is taken into the register as i. Next, in step S43, note-off and occurrence time TM are written in the sound source register of ich, and the note-off event process is terminated.
[0023]
(Sound source processing)
In step S14, when the activation factor is (2) generation of a waveform calculation request, the sound source process of step S17 is executed. This process is a process for performing a waveform generation calculation, and the waveform generation calculation is performed based on the musical tone control data stored in the tone generator register corresponding to each channel (ch) in the MIDI process in step S15. After the sound source process in step S17 is completed, for example, the CPU load amount required for the sound source process is displayed in step S18. Thereafter, the process returns to step S12 and enters a waiting state.
[0024]
In the sound source processing in step S17, first, the LFO, filter G, and volume EG waveforms are calculated for the first tone generation channel (ch) in the calculation order, and the LFO waveform and FEG waveform necessary for calculation within a predetermined time range. A sample of the AEG waveform is generated. The LFO waveform is added to the F number, FEG waveform, and AEG waveform to modulate each data. For the sound generation channel designated as the channel to be muted, a dump AEG waveform that rapidly attenuates within the above range is calculated and generated as the volume EG.
Next, the F number is repeatedly added with the previous read address as an initial value to generate a read address for each sample within the time range, and a waveform sample is obtained from the waveform storage area in the timbre data based on the integer part of the read address. At the same time as reading, interpolation is performed between the waveform samples read based on the decimal part of the read address, and all interpolation samples within the time range are calculated.
[0025]
Furthermore, timbre filter processing is performed on the interpolation sample within the time range, timbre control is performed based on the FEG waveform, amplitude control processing is performed on the sample within the time range that has been filtered, Based on the AEG and the volume data, amplitude control of the musical sound waveform samples is performed, and an accumulative writing process is performed in which the musical sound waveform samples of the time range subjected to the amplitude control processing are respectively added to the corresponding samples in the output buffer. Is done.
In this way, the waveform sample generation processing of each sound generation channel is performed until the calculation of all sound generation channels is completed, and the generated samples for the predetermined time range are sequentially added to the corresponding samples in the output buffer.
[0026]
Note that the MIDI processing in step S15 and the sound source processing in step S17 are described in detail in Japanese Patent Application No. 7-144159, so refer to this publication if necessary.
[0027]
(Other processing)
If it is determined in step S14 that (3) it is another processing request, the process proceeds to step S19, and if the corresponding processing, for example, this processing request is a timbre setting / changing process, it is set. After performing processing such as setting a timbre number, the process proceeds to step S20 to display the set timbre number, and then returns to step S12 to enter a waiting state.
Further, if it is determined in step S14 that (4) it is an end request, end processing is performed in step S21, related screen information is erased in step S22, and this software sound source processing is ended.
[0028]
(MIDI reception interrupt processing)
Next, a flowchart of the MIDI reception interrupt process executed by the CPU 1 is shown in FIG. This process is started by an interrupt generated when the software tone generator MIDI output API 22 is called and performance information (MIDI event) is received from the sequencer program 21 or the like. The priority of this interrupt is the highest, and this MIDI reception interrupt process is a process that is performed in preference to other processes such as the sequencer program 21 and the software tone generator 23. When this MIDI reception interrupt process is started, the MIDI event data received in step S51 is fetched. In step S52, the received data is written in the input buffer in combination with the time data at the time of reception. Return to the process when an interrupt occurs. As a result, the received MIDI data is sequentially written to the input buffer together with the reception time.
[0029]
(Sequencer program)
FIG. 7 shows a flowchart of processing in the sequencer program 21. When the sequencer program 21 is activated, first, initial settings such as clearing of various registers are performed in step S61, and then an icon or the like indicating that the program is activated is displayed in step S62. Screen preparation processing is performed. Then, the process proceeds to step S63, where it is checked whether or not an activation factor has occurred. If it is determined in step S64 that an activation factor has occurred, the process proceeds to step S65. In step S65, it is determined what the generated activation factor is, and the process branches to a corresponding step according to the activation factor. If no activation factor has occurred, the process returns to step S63 to wait for the activation factor to occur.
[0030]
The sequencer program activation factors include (1) generation of a start / stop request, (2) generation of an interrupt from the tempo timer, (3) designation of an output destination sound source, change of tempo, change of part balance, Other requests such as editing or automatic performance recording processing are generated, and (4) a program termination request is generated.
[0031]
First, when the determination result of the factor in step S65 is (3) generation of another request, processing corresponding to each request as described above is performed in step S90, and then a corresponding display is displayed in step S91. Done. Then, the process returns to step S63 and waits.
[0032]
(Output destination specification processing)
The performance information output destination designation process is one of the processes processed in step S90. For example, when the player clicks a switch for switching the output sound source displayed on the screen of the display 8 with the mouse in step S62, the designation of the output sound source is detected as an activation factor in step S65. This output destination designation process is activated. The output destination designation process will be described with reference to FIG.
[0033]
FIG. 8A is a flowchart showing a first form of output destination designation processing. In this embodiment, output destination sound sources of all performance information output from the sequencer program 21 are selected at once.
When the process is started, first, in step S900, output sound source designation data designated by the user is stored in the TGS register. In this embodiment, every time the performer clicks the output sound source designation switch displayed on the screen, the four selection states shown in FIG. 8B, that is, (A) do not output to any sound source. (B) Output to software sound source, (c) Output to hardware sound source, (d) Output to both software sound source and hardware sound source are changed cyclically, The value of the modulo 4 of the number of clicks is stored in the TGS register as output sound source designation data.
[0034]
In step S901, it is determined whether the sound source designated by the contents of the TGS register is the software sound source 23 or the hardware sound source 12. In step S902, a logo indicating the standard of the selected output sound source is displayed on the display screen. An example of this display is shown in FIG. This logo display allows the performer to know the standard of the sound source used.
[0035]
FIG. 8D shows a flowchart of the second form of the output destination designation process. In this form, a sound source to be output for each performance part can be selected.
When the process is started, first, in step S910, the input part designation data is fetched as a variable p. Next, in step S911, the output sound source designation data of the designated part p is stored in the TGSp register. In step S912, the setting state of each part and the corresponding output sound source is displayed. Thus, by providing a register for storing output sound source designation data for each part, it becomes possible to select a sound source to be output for each part.
[0036]
For example, for a certain piece of music, the drum part is a software sound source (GM), the base part is a software sound source (XG), the guitar part is a hardware sound source (XG), and the electric piano part is a hardware sound source (FM sound source). Can be specified.
The correspondence between each part and the sound source to be output may be set by the performer, or if the sound data of each part is provided in the hardware sound source, the hardware sound source is used. Otherwise, a software sound source may be used.
[0037]
In addition, when a hardware sound source or a software sound source is used, it is automatically determined whether the sound card 12 or the external sound source 6 is attached to the general-purpose computer. Can automatically select a hardware sound source and select a software sound source when not installed.
Thereby, it is not necessary to change the setting by attaching and detaching the hardware sound source.
[0038]
(Start / stop processing)
As a result of the determination in step S65, if the activation factor is (1) generation of a start / stop request, start / stop processing is performed in step 70, and after the start / stop state is displayed in step S71. Then, the process returns to step S63 and waits for an activation factor to be generated.
The start / stop process in step S70 will be described with reference to FIG. This start / stop request is made by a player's operation. For example, a start / stop request is input by clicking a predetermined field on the screen. When this start / stop request is input, whether or not the current state is the stop state is determined in step S700 based on the state of the RUN flag. The RUN flag is a flag that is set to “1” when in the performance state, and when the determination result is NO, the current state is in the performance state. Therefore, the process proceeds to step S701, and the RUN flag is reset. In step S702, the tempo timer is stopped, and in step S703, post-processing of automatic performance is performed to stop the performance.
[0039]
On the other hand, if it is currently stopped and the determination result in step S700 is YES, the process proceeds to step S704, where the RUN flag is set, and preparation for automatic performance is made in step S705. In preparation for this automatic performance, various processes such as transfer of designated song data from the hard disk device 9 or the like to the RAM 3, setting of the start address to the read pointer, preparation of the first event, and setting of volume for each part, etc. Is done. Subsequently, a tempo timer is set in step S706, and the tempo timer is started in step S707 to start playing.
[0040]
(Event playback processing)
If the determination result of the activation factor in step S65 is (2) tempo timer interrupt is present, event reproduction processing is performed in step S80, and then the event is displayed in step S81. Then, the process returns to step S63 to enter a waiting state for an activation factor.
The event reproduction process in step S80 will be described with reference to FIG. The tempo timer interrupt is an interrupt periodically generated to determine the performance tempo, and the performance time is determined by this interrupt. When this tempo timer interruption occurs, the time is counted in step S800. Then, in step S801, it is determined whether or not the count result exceeds the event time at which the event should be reproduced. If not, the event reproduction process S80 is terminated.
[0041]
On the other hand, if the decision result in the step S801 is YES, the process advances to a step S802 to reproduce the event, that is, take out the event from the RAM 3. In step S803, the extracted event (reproduction event) is output. This reproduction event output process is a mediation routine corresponding to the contents of the TGS register set in the output destination designation process, that is, when outputting the reproduction event to the software sound source 23, the software sound source MIDI output API 22, the hardware sound source 12 is a process of outputting to the MIDI output API 27. As a result, the MIDI event is output to the designated sound source. In step S804, the reproduction time of the next event is calculated by adding the duration data of the retrieved reproduction event and the event time, and the event reproduction processing routine is terminated. Note that the processing in step S803 corresponds to the form shown in FIG. 8A in which the output sound source is collectively designated for the entire performance information.
[0042]
As described above, when an event is output by the reproduction event output process in S803, the MIDI reception interrupt is generated and the MIDI event is stored in the input buffer. Then, after the interruption process is completed, control returns to the event reproduction process routine described above, and the next event time calculation process in step S804 is executed.
[0043]
FIGS. 10A and 10B show a modification of the reproduction event output processing step S803. FIG. 10 (a) corresponds to the form of designating the output destination sound source for each performance part shown in FIG. 8 (b). First, in step S810, the part of the reproduction event is detected and taken as a variable p. In step S811, the contents of the register TGSp are referenced, and the reproduction event is output to a mediation routine (API) corresponding to the contents. Thereby, performance information is output to the sound source designated for each part.
[0044]
FIG. 10B shows that performance information is preferentially output to a hardware sound source, and when the number of channels to be sounded exceeds the number of soundable channels of the hardware sound source, the performance information corresponding to that number is output. This is a form in which sound is generated by a software sound source. In this modified example, first, in step S820, it is determined whether or not the reproduction event extracted in step S802 (FIG. 9B) is a note-on event. If it is not a note-on event, the process proceeds to step S821, where this event is output to a sound source that has previously received a note-on corresponding to the event, and the process ends.
[0045]
On the other hand, if the playback event is a note-on event and the determination result in step S820 is YES, the current sound generation number of the hardware sound source is detected in step S822, and the sound source of the hardware sound source can be generated by the playback event in step S823. Determine whether the number of channels is exceeded. If the determination result is NO, the process proceeds to step S824, and this reproduction event is output to the hardware sound source. If the decision result in the step S823 becomes YES, the process proceeds to a step S825 to output this reproduction event to the software sound source 23. As a result, it is possible to generate a sound that exceeds the number of channels (for example, 32 ch) that can be generated by the hardware sound source using the software sound source.
[0046]
If the activation result is (4) termination request as a result of the determination in step S65, the process proceeds to step S100 to perform termination processing. finish.
[0047]
When performance information is output to a hardware sound source mounted on the sound card 12 or an external sound source 6 connected to the outside, sound generation processing is executed on the hardware sound source by a well-known method.
However, when the performance information is output to both the software sound source and the hardware sound source, as described above, a delay of a predetermined time occurs in the generation of the musical sound by the software sound source. It is necessary to perform processing such as delaying the output of performance information to the hardware sound source by the time.
[0048]
In addition, when the sequencer program 21 is software in which musical tone reproduction and other processing such as image display are performed in synchronization, it may be necessary to consider this delay time.
For example, in the case of karaoke software, it is common to display lyrics along with the performance of a song. A process of gradually changing the color of the lyrics according to the progress of the accompaniment (wipe process) and a process of replacing the displayed lyrics are performed. By the way, such lyrics display processing needs to be synchronized with the accompaniment sound. Therefore, when the hardware sound source and the software sound source can be selected by the karaoke software as in the present invention, it is necessary to change the display timing according to which sound source is selected. That is, when a software sound source is selected, display processing is performed at a later timing than when a hardware sound source is selected. Further, instead of taking the timing when displaying lyrics, the timing of performance information supplied to each sound source may be adjusted. That is, when a software sound source is selected, performance information is output to the sound source at an earlier timing than when a hardware sound source is selected.
Note that the present invention can be applied in exactly the same manner when performance information input from an external sequencer or the like is passed to a sound source via a MIDI interface.
[0049]
【The invention's effect】
According to the present invention, it is possible to select a software sound source and a hardware sound source and output performance information, and when a hardware sound source is not installed, the software sound source is automatically selected. It is possible to eliminate the need to change the setting of whether to use the hardware sound source or the software sound source when the wear sound source is attached or detached.
[Brief description of the drawings]
FIG. 1 is an example of a musical sound generating apparatus capable of executing a musical sound generating method of the present invention.
FIG. 2 is a software module configuration of the musical sound generating device of FIG. 1;
FIG. 3 is a diagram for explaining a musical sound generation process performed using a software sound source;
FIG. 4 is a flowchart of software sound source processing.
FIG. 5 is a flowchart of MIDI processing.
FIG. 6 is a flowchart of a MIDI reception interrupt process.
FIG. 7 is a flowchart of processing performed by a sequencer.
FIG. 8 is a diagram for explaining an output destination designation routine.
FIG. 9 is a flowchart of start / stop processing and event reproduction processing;
FIG. 10 is a flowchart of playback event output processing.
[Explanation of symbols]
1 CPU, 2 ROM, 3 RAM, 4 timer, 5 MIDI interface, 6 external sound source, 7 keyboard, 8 display, 9 hard disk drive, 10 DMA circuit, 11 D / A converter (DAC), 12 sound card, 13 mixer , 14 Sound system, 15 Bus, 16 Codec, 21 Sequencer program, 22, 24, 27 API, 23 Software sound source, 25 Program group, 26 Codec driver, 28 Sound card driver

Claims (2)

演算装置において実行される楽音発生方法であって、
演奏情報を順次供給するステップと、
ハードウエア音源とソフトウエア音源の少なくとも一方を指定するステップと、
前記供給される演奏情報を、前記指定に従って、前記ハードウエア音源および/または前記ソフトウエア音源に入力させる入力ステップとを有し、
前記入力ステップは、前記演算装置に前記ハードウェア音源が接続されていない場合は、前記演奏情報を前記ソフトウェア音源に入力させるものであり、
前記ソフトウェア音源は、所定周期毎に、複数サンプリング周期分の楽音波形サンプルを一括して生成する波形生成演算を行うものである
ことを特徴とする楽音発生方法。
A musical sound generation method executed in an arithmetic device,
Sequentially supplying performance information;
Designating at least one of a hardware sound source and a software sound source;
An input step of causing the hardware sound source and / or the software sound source to be input in accordance with the specification, the supplied performance information,
In the input step, when the hardware sound source is not connected to the arithmetic device, the performance information is input to the software sound source,
The method according to claim 1, wherein the software sound source performs a waveform generation calculation for generating a plurality of musical sound waveform samples for a plurality of sampling periods at a predetermined period .
前記入力ステップは、前記ソフトウエア音源が指定された場合には、前記ハードウエア音源が指定された場合と比べて早いタイミングで演奏情報を前記ソフトウエア音源に入力させるものであることを特徴とする請求項1記載の楽音発生方法。  In the input step, when the software sound source is designated, performance information is input to the software sound source at an earlier timing than when the hardware sound source is designated. The method for generating musical sounds according to claim 1.
JP2001393560A 2001-12-26 2001-12-26 Music generation method Expired - Fee Related JP3705203B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2001393560A JP3705203B2 (en) 2001-12-26 2001-12-26 Music generation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2001393560A JP3705203B2 (en) 2001-12-26 2001-12-26 Music generation method

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP29727295A Division JP3293434B2 (en) 1995-10-23 1995-10-23 Tone generation method

Related Child Applications (1)

Application Number Title Priority Date Filing Date
JP2005119672A Division JP4096952B2 (en) 2005-04-18 2005-04-18 Music generator

Publications (2)

Publication Number Publication Date
JP2002196763A JP2002196763A (en) 2002-07-12
JP3705203B2 true JP3705203B2 (en) 2005-10-12

Family

ID=19188781

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001393560A Expired - Fee Related JP3705203B2 (en) 2001-12-26 2001-12-26 Music generation method

Country Status (1)

Country Link
JP (1) JP3705203B2 (en)

Also Published As

Publication number Publication date
JP2002196763A (en) 2002-07-12

Similar Documents

Publication Publication Date Title
JP3293434B2 (en) Tone generation method
JP2005010461A (en) Arpeggio pattern setting apparatus and program
JP3226011B2 (en) Lyrics display
JP2018116161A (en) Resonance signal generator, electronic music device, resonance signal generation method and program
JP3293474B2 (en) Tone generation method
JP2924745B2 (en) Musical sound generating apparatus and method
JP2019168517A (en) Electronic musical instrument, method, and program
JP4096952B2 (en) Music generator
JP3705203B2 (en) Music generation method
JP3572847B2 (en) Sound source system and method using computer software
JP3019755B2 (en) Music sound generation method and music sound generation device
JP2797142B2 (en) Processing equipment for electronic musical instruments
JP3409642B2 (en) Automatic performance device, automatic performance data processing method, and electronic information storage medium
JP2003015637A (en) Musical note display device
JP7332002B2 (en) Electronic musical instrument, method and program
JPH11126069A (en) Musical sound generating method
JP7124370B2 (en) Electronic musical instrument, method and program
JP4082184B2 (en) Musical sound generator and musical sound generation processing program
JP2972364B2 (en) Musical information processing apparatus and musical information processing method
JPH10124050A (en) Electronic musical instrument
JP3463547B2 (en) Performance data changing device, performance data changing method, and medium recording program
JP3627557B2 (en) Musical sound generating apparatus and method
JP6606839B2 (en) Waveform writing apparatus, method, program, and electronic musical instrument
JP3837994B2 (en) Musical score data conversion apparatus and recording medium
JP2001215973A (en) Method and device for creating musical sound control parameter, and recording medium

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20041021

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20041102

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20041222

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20050215

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050418

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20050718

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313532

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

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

Free format text: PAYMENT UNTIL: 20090805

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20100805

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20100805

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20110805

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20120805

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20130805

Year of fee payment: 8

LAPS Cancellation because of no payment of annual fees