JP4035715B2 - Accompaniment generation apparatus and accompaniment generation program - Google Patents

Accompaniment generation apparatus and accompaniment generation program Download PDF

Info

Publication number
JP4035715B2
JP4035715B2 JP2002227899A JP2002227899A JP4035715B2 JP 4035715 B2 JP4035715 B2 JP 4035715B2 JP 2002227899 A JP2002227899 A JP 2002227899A JP 2002227899 A JP2002227899 A JP 2002227899A JP 4035715 B2 JP4035715 B2 JP 4035715B2
Authority
JP
Japan
Prior art keywords
pitch
chord
data
accompaniment
read
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
JP2002227899A
Other languages
Japanese (ja)
Other versions
JP2004069936A (en
JP2004069936A5 (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.)
Casio Computer Co Ltd
Original Assignee
Casio Computer Co Ltd
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 Casio Computer Co Ltd filed Critical Casio Computer Co Ltd
Priority to JP2002227899A priority Critical patent/JP4035715B2/en
Publication of JP2004069936A publication Critical patent/JP2004069936A/en
Publication of JP2004069936A5 publication Critical patent/JP2004069936A5/ja
Application granted granted Critical
Publication of JP4035715B2 publication Critical patent/JP4035715B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は、自動伴奏装置に用いて好適な伴奏生成装置および伴奏生成プログラムに関する。
【0002】
【従来の技術】
自動伴奏装置は、入力されるコードに応じて伴奏パターンを構成する各音の音高を変換する伴奏生成装置を具備することが知られている。伴奏生成装置は、通常、基準となるコード(例えばCメジャー)やキー(例えばC)に対応付けて記述された伴奏パターンの各音を、入力コードのルート(根音)とタイプ(和音種類)とに応じて音高変換する第1の従来技術、あるいはキー(調)と入力コードの機能(ルートをキーで評価したもの)とタイプとに応じて音高変換する第2の従来技術を用いる場合が多い。
【0003】
【発明が解決しようとする課題】
ところで、上述した第1の従来技術は、入力コードのタイプと伴奏パターンの音高とで定まる音高補正値に入力コードのルートを加算した結果に基づき、伴奏パターンの音高をシフトさせるようになっており、一方、第2の従来技術は、入力コードの機能とタイプと伴奏パターンの音高とで定まる音高補正値にキーを加算した結果に基づき、伴奏パターンの音高をシフトさせるようになっている。この為、第1の従来技術ではルートの変化がそのまま伴奏音の音高変化になり、一方、第2の従来技術ではキーの変化がそのまま伴奏音の音高変化になる結果、いずれも入力コードの切り替りやそれに伴う転調で伴奏音の音高が急激に変化して不自然な伴奏音を発生する虞がある。
そこで本発明の第1の目的は、入力コードの切り替りで不自然な伴奏音の発生を防ぐことができる伴奏生成装置および伴奏生成方法を提供することにある。
【0006】
【課題を解決するための手段】
上記目的を達成するため、請求項1記載の発明では、発音タイミング及び音高を有する複数の音符データから構成される伴奏パターンデータ及び入力タイミング、ルート及びタイプから構成される複数のコードデータからなるコード進行データを記憶する記憶手段と、初期状態において値がクリアされる累算カウンタと、この記憶手段から前記伴奏パターンデータを構成する音符データを対応する発音タイミングに応じて読み出すとともに、前記記憶手段から前記コード進行データを構成するコードデータを対応する入力タイミングに応じて読み出す読み出し手段と、この読み出し手段により音符データが読み出される毎に、当該読み出された音符データの音高とこの時点で読み出されているコードデータのルートとの音程を算出する音程差算出手段と、前記音高差算出手段により算出された音程と、前記読み出されているコードのタイプとに基づき、前記読み出された音符データの音高を当該音高に近接する前記読み出されたコードデータのコード構成音あるいはコードスケール音とするための音高補正値を出力する音高補正値出力手段と、この音高補正値出力手段から出力された音高補正値及び前記累算カウンタに記憶された値に基づいて前記読み出された伴奏パターンの音高をシフトするシフト手段と、このシフト手段による音高のシフトの後、当該出力された音高補正値を前記累算カウンタに記憶された値に加算することにより、前記累算カウンタの値を更新する累算手段と、を具備することを特徴とする。
【0012】
請求項に記載の発明では、発音タイミング及び音高を有する複数の音符データから構成される伴奏パターンデータ及び入力タイミング、ルート及びタイプから構成される複数のコードデータからなるコード進行データを記憶する記憶手段と、入力される音程とコードのタイプとに基づき音高補正値を出力するテーブル手段と、初期状態において値がクリアされる累算カウンタと、を有する装置に適用される伴奏生成プログラムであって、この記憶手段から前記伴奏パターンデータを構成する音符データを対応する発音タイミングに応じて読み出すとともに、前記記憶手段から前記コード進行データを構成するコードデータを対応する入力タイミングに応じて読み出す読み出し機能と、この音符データが読み出される毎に、当該読み出された音符データの音高とこの時点で読み出されているコードデータのルートとの音程を算出する音程差算出機能と、この算出された音程と、前記読み出されているコードのタイプとに基づき、前記読み出された音符データの音高を当該音高に近接する前記読み出されたコードデータのコード構成音あるいはコードスケール音とするための音高補正値を前記テーブル手段から出力させる音高補正値出力機能と、この出力された音高補正値及び前記累算カウンタに記憶された値に基づいて前記読み出された伴奏パターンの音高をシフトするシフト機能と、この音高のシフトの後、当該出力された音高補正値を前記累算カウンタに記憶された値に加算することにより、前記累算カウンタの値を更新する累算機能と、をコンピュータに実現させることを特徴とする。
【0014】
本発明では、伴奏パターンの各伴奏音に対応するコードを検出し、伴奏音の音高に近接する検出コードの構成音あるいはコードスケール音の音高になるよう伴奏音の音高を変換する、または、伴奏音の音名と検出コードのルートとの音程および検出コードのタイプに応じた音高補正値を発生し、この音高補正値に基づいて伴奏音の音高をシフトさせて変換するので、従来のように、ルートやキーの変化がそのまま伴奏音の音高変化にならず、入力コードの切り替りやそれに伴う転調で不自然な伴奏音の発生を防ぐことが可能になる。
【0017】
【発明の実施の形態】
以下、本発明の実施の一形態による伴奏生成装置を実施例とし、これについて図面を参照して説明する。
A.第1実施例
(1)構成
図1は、本発明による第1実施例の構成を示すブロック図である。この図において、1は伴奏パターンやコード進行パターンを選択する選択スイッチ、伴奏生成(後述する)の開始を指示する伴奏生成スイッチあるいは自動伴奏の開始・停止を指示するスタート/ストップスイッチ等、装置パネルに配設される各種スイッチから構成されるパネルスイッチであり、操作されたスイッチに対応したスイッチイベントを発生する。2は後述するCPU3から供給される表示制御信号に応じて、装置各部の設定状態や動作状態を表示する表示部である。
【0018】
3は装置各部を制御するCPUであり、その特徴的な動作については後述する。4は上記CPU3にロードされる各種制御プログラムを記憶するROMである。5は複数種の伴奏パターンデータAPD、コード進行データCPDおよびピッチチェンジテーブルPCTを記憶するデータROMである。
伴奏パターンデータAPDは、Cメジャーに対応した所定小節分の伴奏音を表す音符データから構成される。図2にその一例を図示する。図2に示すように、各音符データmelody[0]〜[44]は、それぞれ前イベント(音符)からの経過時間で表される発音タイミング、音高、音量および音長から形成される。なお、伴奏パターンデータAPDの終わりにはパターン終端を表す終端コード(FFFFh)が設けられている。
【0019】
コード進行データCPDは、コードデータchordをコード進行順に記憶したものである。図3に図示する一例のように、各コードデータchord[0]〜[10]は、それぞれ前コード入力時点からの経過時間で表される入力(発音)タイミング、ルートおよびタイプから形成され、その終わりには終端コード(FFFFh)が設けられている。
【0020】
ピッチチェンジテーブルPCTは、コード進行データCPDから読み出される入力コードのタイプctypeに応じて、その入力コードに対応する伴奏パターン中の音高pitchと当該入力コードのルートcrootとの差(半音数)により定まるピッチ補正値pctabを読み出すテーブルであり、その一例を図4に図示する。
図4に図示するピッチチェンジテーブルPCTでは、例えばタイプがメジャーMAJであれば、伴奏パターン中の音高pitchとルートcrootとの差(絶対値)の12剰余値に応じて、当該音高pitchを半音数「0(根音)」、半音数「4(長3度)」および半音数「7(完全5度)」のコード構成音に集約させるピッチ補正値pctabが登録されている。こうしたピッチチェンジテーブルPCTから読み出されるピッチ補正値pctabによって、伴奏パターンデータAPDの各音符データの音高がシフトされる。
【0021】
次に、再び図1を参照して実施例の構成について説明を進める。図1において、6は各種レジスタ・フラグデータを一時記憶するワークエリアの他、データエリアを備えるRAMである。RAM6のデータエリアには、上述したピッチチェンジテーブルPCTを用いて音高変換された伴奏パターンデータAPDが格納される。7は周知の波形メモリ読み出し方式により構成される音源であり、CPU3の指示の下、RAM6のデータエリアに格納された伴奏パターンデータAPDに応じた伴奏音を発生する。8は音源7が発生するされる伴奏音をアナログ形式の楽音信号にD/A変換した後、それを増幅してスピーカより放音させるサウンドシステムである。
【0022】
(2)動作
次に、図5〜図8を参照して上記構成による第1実施例の動作について説明する。以下では、最初に概略動作として「メインルーチンの動作」について述べ、続いて本発明の要旨に係わる「伴奏生成処理」および「コード検出処理」の各動作について述べて行くものとする。
【0023】
▲1▼メインルーチンの動作(概略動作)
本実施例に電源が投入されると、CPU3はROM4から所定の制御プログラムをロードし、図5に示すメインルーチンを実行してステップSA1に処理を進める。ステップSA1では、RAM6に設けられる各種レジスタやフラグ類をリセットしたり、音源7に対して各種レジスタ・フラグを初期化するよう指示するイニシャライズを実行する。イニシャライズ完了後、CPU3は次のステップSA2に処理を進め、スイッチ操作の有無を判断すべく、パネルスイッチ1を走査する。そして、ステップSA3〜SA8では、スイッチ走査により検出したスイッチイベント種類に応じた処理を実行する。以下、「入力指示イベント」、「生成指示イベント」および「再生指示イベント」を検出した場合に分けて動作説明を進める。
【0024】
(イ)入力指示イベントの場合
選択スイッチの操作に応じて入力指示イベントが検出されると、ステップSA3の判断結果が「YES」となり、ステップSA6に進み、選択された伴奏パターンデータAPDをデータROM5からRAM6のデータエリアに転送したり、選択されたコード進行データCPDの読み出しアドレスをレジスタセットする等の入力処理を実行する。
【0025】
(ロ)生成指示イベントの場合
伴奏生成スイッチの操作に応じて生成指示イベントが検出されると、ステップSA4の判断結果が「YES」となり、ステップSA7に進み、伴奏生成処理を実行する。この伴奏生成処理では、上記入力指示イベントにて選択されたコード進行データCPDと、前述のピッチチェンジテーブルPCTとに応じて、上記入力指示イベントにて選択された伴奏パターンデータAPD中の各音符データの音高をシフトさせ、これによりコード進行データCPDにマッチした伴奏音、すなわちコードの切り替りで不自然な伴奏音を生じないようにした新たな伴奏パターンデータAPDを生成するようになっており、その詳細については後述する。
【0026】
(ハ)再生指示イベントの場合
スタート/ストップスイッチの操作に応じて、自動伴奏開始を表す再生指示イベントが検出されると、ステップSA5の判断結果が「YES」となり、ステップSA8に進み、上記伴奏生成処理にて生成された新たな伴奏パターンデータAPDに従った伴奏音を再生する伴奏再生処理を実行する。
なお、パネルスイッチ1が操作されず、上述の各イベントがいずれも発生しない場合には、ステップSA3〜SA5の各判断結果は「NO」となり、ステップSA2に処理に戻し、以後、いずれかのイベントが発生するまでステップSA2〜SA5を繰り返す。
【0027】
▲2▼伴奏生成処理の動作
次に、図6を参照して伴奏生成処理の動作について説明する。上述したステップSA7(図5参照)を介して伴奏生成処理が実行されると、CPU3は図6のステップSB1に処理を進め、ポインタnptrおよびカウンタntimeをそれぞれゼロリセットする。ここで、ポインタnptrは、前述の入力指示イベントにて選択される伴奏パターンデータAPD(図2参照)の読み出しアドレスを一時記憶する。カウンタntimeは、伴奏パターンデータAPDの音符データに含まれる発音タイミングを累算し、伴奏開始時点からの経過時間(以下、伴奏進行時間と称す)を発生する。
【0028】
ポインタnptrおよびカウンタntimeをゼロリセットした後、CPU3はステップSB2に進み、ポインタnptrの一つ先のアドレス(nptr+1)に応じて伴奏パターンデータAPDから読み出される内容melody[nptr+1]が終端コードであるか、つまりパターン終端に達したどうかを判断する。パターン終端であれば、判断結果は「YES」となり、本処理を完了させるが、パターン終端に達していなければ、判断結果が「NO」となり、次のステップSB3に進む。
ステップSB3では、伴奏パターンデータAPDから読み出される音符データ中の音高(melody[nptr+1])をレジスタpitchにストアする。以下、レジスタpitchの内容を音高pitchと記す。
【0029】
次いで、ステップSB4では、コード検出処理を実行し、図7に示すステップSB4−1に処理を進める。ステップSB4−1では、ポインタcptrおよびカウンタctimeをそれぞれゼロリセットする。ここで、ポインタcptrは、前述の入力指示イベントにて選択されるコード進行データCPD(図3参照)の読み出しアドレスを一時記憶する。カウンタctimeは、コード進行データCPDの発音タイミングを累算し、コード進行開始時点からの経過時間(以下、コード進行時間と称す)を発生する。そして、ステップSB4−2では、ポインタcptrの一つ先のアドレス(cptr+1)に応じてコード進行データCPDから読み出されるコードデータchord[cptr+1]が終端コードであるか、つまりデータ終端に達したどうかを判断する。
【0030】
データ終端に達していなければ、判断結果は「NO」となり、次のステップSB4−3に進む。ステップSB4−3では、ポインタcptrに応じてコード進行データCPDから読み出されるコードデータchord[cptr]、すなわち前コード入力時点からの経過時間で表される発音タイミングをカウンタctimeに累算してコード進行時間を算出する。
次いで、ステップSB4−4では、算出したコード進行時間が、カウンタntimeに格納される伴奏進行時間を超えたかどうかを判断する。コード進行時間が伴奏進行時間を超えていなければ、判断結果は「NO」となり、ステップSB4−5に進む。ステップSB4−5では、次のコードデータchordを読み出すべくポインタcptrに「3」を加算してポインタcptrを進めた後、再び上記ステップSB4−2に処理を戻す。
【0031】
このように、ステップSB4−2〜SB4−5では、伴奏進行時間を超えたコード進行時間を検索し、その条件を満たすコードデータchordが見つかると、ステップSB4−4の判断結果が「YES」となり、ステップSB4−6に進み、その検索したコードデータchordの一つ前のコードデータchord中のルートchord[cptr−2]およびタイプchord[cptr−1]を抽出してそれぞれレジスタcroot,ctypeにストアする。
なお、伴奏進行時間を超えたコード進行時間を検索する過程でコード進行データCPDのデータ終端に達した場合には、ステップSB4−2の判断結果が「YES」となり、ステップSB4−6に進み、データ終端の一つ前のコードデータchord中のルートchord[cptr−2]をレジスタcrootに、タイプchord[cptr−1]をレジスタctypeにそれぞれストアする。以下、レジスタcroot,ctypeの内容をそれぞれルートcroot、タイプctypeと記す。
【0032】
さて、こうして伴奏パターンデータAPDから読み出した音符データに対応したコードのルートcrootおよびタイプctypeが検出されると、CPU3は図6のステップSB5に処理を進める。ステップSB5では、検出したルートcrootおよびタイプctypeに基づき前述のピッチチェンジテーブルPCT(図4参照)から対応するピッチ補正値pctabを読み出すためのテーブル引数index(ctype,|pitch−croot|mod 12)を求める。ここで、ctypeは検出したタイプ、|pitch−croot|mod 12は、伴奏パターンデータAPDから読み出した音符データの音高pitchとルートcrootとの差(絶対値)の12剰余値である。
【0033】
そして、ステップSB6では、このテーブル引数indexに応じてピッチチェンジテーブルPCTから読み出されるピッチ補正値pctab[index]を音高pitchに加算して音高変換する。次いで、ステップSB7では、ポインタnptrに応じて伴奏パターンデータAPDから読み出される発音タイミングmelody[nptr]をRAM6のデータエリアnew[nptr]に格納し、音高変換された音高pitchをRAM6のデータエリアnew[nptr+1]に格納する。さらに、ポインタnptrの二つ先のアドレス(nptr+2)に応じて伴奏パターンデータAPDから読み出される音量melody[nptr+2]をRAM6のデータエリアnew[nptr+2]に格納し、ポインタnptrの三つ先のアドレス(nptr+3)に応じて伴奏パターンデータAPDから読み出される音長melody[nptr+3]をRAM6のデータエリアnew[nptr+3]に格納する。
【0034】
以上のようにして、音高変換された音符データが、新たな伴奏パターンデータAPDとしてRAM6のデータエリアに格納されると、CPU3はステップSB8に処理を進め、次の音符データについて音高変換を施すべく、ポインタnptrに「4」を加算してポインタ更新を行い、続くステップSB9では、更新されたポインタnptrに応じて伴奏パターンデータAPDから読み出される発音タイミングmelody[nptr]をカウンタntimeに累算して伴奏開始時点からの経過時間を表す伴奏進行時間を更新する。
そして、前述のステップSB2に処理を戻し、以後、伴奏パターンデータAPDのパターン終端に達するまでステップSB2〜SB9を繰り返して伴奏パターンデータAPD中の各音符データの音高pitchを、コード進行に対応させて音高変換してなる新たな伴奏パターンデータAPDをRAM6のデータエリアに登録して行き、パターン終端に達した時点でステップSB2の判断結果が「YES」となり、本処理を完了させる。
【0035】
したがって、図8(a)の楽譜で表されるように、図2に図示した伴奏パターンデータAPDを、図3に図示するコード進行データCPDに従って伴奏生成処理を施すと、同図(b)の楽譜で表現される伴奏パターンに音高変換される。
つまり、本実施例によれば、コード進行データCPDに従って入力されるコードchordのタイプctypeに対応して、そのコードchordのルートcrootを根音とするコード構成音のうちで伴奏パターンのオリジナル音高pitchに近接する音高になるよう伴奏パターン中の各音符データの音高pitchをシフトさせるので、入力コードの切り替りで不自然な伴奏音の発生を防ぐことが可能になる。
【0036】
なお、本実施例では、入力コードのタイプctypeに対応して、その入力コードのルートcrootを根音とするコード構成音のうちで伴奏パターンのオリジナル音高pitchに近接する音高になるよう伴奏パターン中の各音符データの音高pitchをシフトさせるピッチ補正値pctabを読み出すピッチチェンジテーブルPCTを使用するようにしたが、これに限らず、図9に図示するテーブル内容のピッチチェンジテーブルPCT2を使用する形態としても構わない。
ピッチチェンジテーブルPCT2を用いた場合には、伴奏パターン中の各音符データの音高pitchを、入力コードのルートcrootを根音とするコード構成音以外の非和声音(例えばテンション・ノート)も含むコードスケール音のいずれかにも音高変換し得る為、より好ましい伴奏音を生成することが可能になる。
【0037】
(3)変形例
上述した実施例では、入力コードの切り替りで不自然な伴奏音が生成される虞を皆無にしたが、伴奏パターンデータAPDの内容によっては、同じ音高が重なったり続いたりしてコードの性格が確定しない伴奏ラインになる場合も起こり得る。そこで、変形例では、そうした弊害を回避する伴奏生成処理について図10を参照して説明する。
上述の実施例と同様、図5に図示したメインルーチンのステップSA7を介して変形例による伴奏生成処理が実行されると、CPU3は図10のステップSC1に処理を進め、ポインタnptr、カウンタntime、カウンタotimeおよびレジスタdevをそれぞれゼロリセットして初期化する。
【0038】
ここで、ポインタnptrは、前述の入力指示にて選択される伴奏パターンデータAPD(図2参照)の読み出しアドレスを一時記憶する。カウンタntimeは、伴奏パターンデータAPDの音符データに含まれる発音タイミングを累算し、伴奏開始時点からの経過時間(以下、伴奏進行時間と称す)を発生する。カウンタotimeは、1小節毎の経過タイミングを検出するのに用いる。レジスタdevには、1小節毎のピッチ補正値pctabを累算したピッチ補正累算値が一時記憶される。
【0039】
ポインタおよびカウンタを初期化し終えると、CPU3はステップSC2に進み、ポインタnptrの一つ先のアドレスに応じて伴奏パターンデータAPDから読み出される内容melody[nptr+1]が終端コードであるか、つまりパターン終端に達したどうかを判断する。
パターン終端であれば、判断結果は「YES」となり、本処理を完了させるが、パターン終端に達していなければ、判断結果が「NO」となり、次のステップSC3に進む。ステップSC3では、ntime/960>otime/960であるか、つまり、1小節分経過したかどうかを判断する。1小節分経過していなければ、判断結果は「NO」となり、後述するステップSC5に処理を進めるが、1小節分経過した場合には判断結果が「YES」となり、ステップSC4に進み、カウンタntimeの内容をカウンタotimeにストアする一方、レジスタdevをゼロリセットする。
【0040】
次いで、ステップSC5では、ポインタnptrの一つ先のアドレス(nptr+1)に応じて伴奏パターンデータAPDから読み出される音符データ中の音高melody[nptr+1]をレジスタpitchにストアする。以下、レジスタpitchの内容を音高pitchと記す。そして、ステップSC6では、前述した実施例と同様、図7に図示するコード検出処理を実行し、伴奏パターンデータAPDから読み出した音符データに対応したコードのルートcrootおよびタイプctypeを検出する。
続いて、ステップSC7では、検出したルートcrootおよびタイプctypeに基づき前述のピッチチェンジテーブルPCT(図4参照)から対応するピッチ補正値pctabを読み出すためのテーブル引数indexとして、(ctype,|pitch−croot|mod 12)を求める。ここで、ctypeは検出したタイプ、|pitch−croot|mod 12は、伴奏パターンデータAPDから読み出した音符データの音高pitchとルートcrootとの差(絶対値)の12剰余値である。
【0041】
次に、ステップSC8では、上記テーブル引数indexに応じてピッチチェンジテーブルPCTから読み出されるピッチ補正値pctab[index]と、レジスタdevの値(以下、ピッチ補正累算値と称す)とを音高pitchに加算して音高変換する。次いで、ステップSC9では、ピッチ補正値pctab[index]を累算してピッチ補正累算値devを発生する。
【0042】
そして、ステップSC10に進み、ポインタnptrに応じて伴奏パターンデータAPDから読み出される発音タイミングmelody[nptr]をRAM6のデータエリアnew[nptr]に格納し、音高変換された音高pitchをRAM6のデータエリアnew[nptr+1]に格納する。さらに、ポインタnptrの二つ先のアドレス(nptr+2)に応じて伴奏パターンデータAPDから読み出される音量melody[nptr+2]をRAM6のデータエリアnew[nptr+2]に格納し、ポインタnptrの三つ先のアドレス(nptr+3)に応じて伴奏パターンデータAPDから読み出される音長melody[nptr+3]をRAM6のデータエリアnew[nptr+3]に格納する。
【0043】
こうして、音高変換された音符データが、新たな伴奏パターンデータAPDとしてRAM6のデータエリアに格納されると、CPU3はステップSC11に処理を進め、次の音符データについて音高変換を施すべく、ポインタnptrに「4」を加算してポインタ更新を行い、続くステップSC12では、更新されたポインタnptrに応じて伴奏パターンデータAPDから読み出される発音タイミングmelody[nptr]をカウンタntimeに累算して伴奏開始時点からの経過時間を表す伴奏進行時間を更新する。以後、前述のステップSC2に処理を戻し、伴奏パターンデータAPDのパターン終端に達するまでステップSC2〜SC12を繰り返す。
【0044】
このように、変形例によれば、入力コードのタイプctypeおよびルートcrootに応じてピッチチェンジテーブルPCTから読み出される現ピッチ補正値pctab[index]と、1小節毎にゼロリセットされ、前ピッチ補正値pctab[index]までを累算してなるピッチ補正累算値devとを音高pitchに加算して音高変換するようにしたので、同じ音高が重なったり続いたりしてコードの性格が確定しない伴奏ライン(伴奏パターン)になることを防止することができる。
【0045】
B.第2実施例
前述した第1実施例では入力コードの切り替りで不自然な伴奏音の発生を防ぐようにしたが、第2実施例では伴奏パターンデータAPDを構成する各音の発音タイミングが正規のタイミングより進んだり遅れたりするものであっても不自然な伴奏音にならないよう音高変換したり、コード進行データCPDに分数コードが含まれていても、その分数コードに相応しい伴奏音となるよう音高変換するものである。以下、こうした第2実施例の構成および動作について説明する。
【0046】
(1)構成
第2実施例の全体構成は、前述の第1実施例と同一なので、その説明については省略する。第2実施例が前述の第1実施例と相違する点は、伴奏パターンデータAPDおよびコード進行データCPDの内容が異なることにある。
すなわち、第2実施例による伴奏パターンデータAPDは、第1実施例と同様、Cメジャーに対応した所定小節分の伴奏音を表す音符データから構成されるベースパートおよびコードパートを備える。伴奏パターンデータAPDを構成する各音符データは、前イベント(音符)からの経過時間で表される発音タイミング、音高、音量および音長から形成されるが、図11に図示する一例のように、第2小節先頭の音符以降が正規の発音タイミングから僅かに(3クロック分)先行したものとなっている。
【0047】
第2実施例によるコード進行データCPDは、第1実施例と同様、コードデータchordをコード進行順に記憶したものであるが、図12に図示する一例のように、各コードデータchordには、それぞれ前コード入力時点からの経過時間で表される入力タイミング、ルートおよびタイプの他、コードベース(ベースノート)が設けられる。ここで、コードベースがコードのルートと異なる場合には、分数コード(オンベースコード)と見做されるようになっている。
【0048】
(2)動作
次に、伴奏パターンデータAPDを構成する各音の発音タイミングが前後にずれる揺らぎを有していても不自然な伴奏音にならないよう音高変換したり、コード進行データCPDに分数コードが含まれていても、その分数コードに相応しい伴奏音となるよう音高変換する第2実施例の動作について図13〜図17を参照して説明する。
【0049】
▲1▼メインルーチンの動作
まず最初に、第2実施例の概略動作として、図13を参照してメインルーチンの動作について説明する。装置電源が投入されると、CPU3はROM4から所定の制御プログラムをロードし、図13に示すメインルーチンを実行してステップSD1に処理を進め、RAM6に設けられる各種レジスタやフラグ類をリセットしたり、音源7に対して各種レジスタ・フラグを初期化するよう指示するイニシャライズを実行する。
イニシャライズ完了後、CPU3はステップSD2に処理を進め、スイッチ操作の有無を判断すべく、パネルスイッチ1を走査する。そして、ステップSD3〜SD10では、スイッチ走査により検出したイベント種類に応じた処理を実行する。以下、「入力指示イベント」、「生成指示イベント」、「再生指示イベント」および「補正値変更指示イベント」を検出した場合に分けて動作説明を進める。
【0050】
(イ)入力指示イベントの場合
すなわち、選択スイッチの操作に応じて、伴奏パターンデータAPDおよびコード進行データCPDを選択する入力指示イベントが検出されると、ステップSD3の判断結果が「YES」となり、ステップSD7に進み、選択された伴奏パターンデータAPDをデータROM5からRAM6のデータエリアに転送したり、選択されたコード進行データCPDの読み出しアドレスをレジスタセットする等の入力処理を実行する。
【0051】
(ロ)生成指示イベントの場合
伴奏生成スイッチの操作に応じて生成指示イベントが検出されると、ステップSD4の判断結果が「YES」となり、ステップSD8に進み、伴奏生成処理を実行する。この伴奏生成処理では、上記入力指示イベントにて選択されたコード進行データCPDと、前述のピッチチェンジテーブルPCTとに応じて、上記入力指示イベントにて選択された伴奏パターンデータAPD中の各音符データの音高をシフトさせ、これによりコード進行データCPDにマッチした新たな伴奏パターンデータAPDを生成するようになっており、その詳細については後述する。
【0052】
(ハ)再生指示イベントの場合
スタート/ストップスイッチの操作に応じて再生指示イベントが検出されると、ステップSD5の判断結果が「YES」となり、ステップSD9に進み、上記伴奏生成処理にて生成された新たな伴奏パターンデータAPDに従った伴奏音を再生する伴奏再生処理を実行する。
【0053】
(ニ)補正値変更指示イベントの場合
ここでは、最初に補正値変更指示が行われる背景について説明した後、その動作について述べる。
人が演奏した曲データを記録したものを伴奏パターンデータAPDとして使用する場合、例えば図11に図示した一例のように、第2小節先頭の音符以降が正規の発音タイミングから僅かに(3クロック分)先行する伴奏パターンデータAPDを用いて伴奏生成すると、入力コードとの対応にずれが生じてしまい、適正な音高変換がなされず不自然な伴奏音を発生させてしまう。
この点を具体的に説明すると、図11に図示した伴奏パターンデータAPDを楽譜として表示すると、図14(a)で表され、これを第1実施例によるコード進行データCPD(図3参照)に基づき第1実施例と同様に伴奏生成処理を施すと、図14(b)に図示する伴奏パターンデータに音高変換される。この図から明らかなように、第3小節および第4小節の先頭の音符は、それぞれ前小節区間の入力コードに基づいて異なる音高に変換されてしまい、特に第4小節では、同じ音高(F4音)が重なり2和音になってしまい、適正な音高変換がなされていないことが判る。
【0054】
そこで、人が演奏した曲データなど、発音タイミングが正規のタイミングより進んだり遅れたりする伴奏パターンデータAPDを用いる際には、補正値変更スイッチの操作により補正値変更指示イベントを与える。そうすると、ステップSD6の判断結果が「YES」となり、ステップSD10に進み、補正値変更処理を実行する。
この補正値変更処理では、例えば伴奏パターンデータAPDを構成する各音符データを読み出して表示部2に表示しておき、ユーザのマニュアル操作によって最適な補正値coffsetを設定し、各音符データの発音タイミングを適正タイミングに補正する。あるいは周知のクオンタイズ処理にて補正値coffsetを自動的に求め、それによって伴奏パターンデータAPDを構成する各音符データの発音タイミングを補正することも可能である。
【0055】
▲2▼伴奏生成処理の動作
次に、図15を参照して第2実施例による伴奏生成処理の動作について説明する。上述のステップSD8(図13参照)を介して本処理が実行されると、CPU3は図15のステップSE1に処理を進め、ポインタnptrおよびカウンタntimeをそれぞれゼロリセットする。なお、ポインタnptrは、前述の入力指示にて選択される伴奏パターンデータAPD(図2参照)の読み出しアドレスを一時記憶するものである。カウンタntimeは、伴奏パターンデータAPDの音符データに含まれる発音タイミングを累算し、伴奏開始時点からの経過時間(以下、伴奏進行時間と称す)を発生する。
【0056】
ポインタnptrおよびカウンタntimeをゼロリセットすると、CPU3はステップSE2に進み、ポインタnptrの一つ先のアドレスに応じて伴奏パターンデータAPDから読み出される内容melody[nptr+1]が終端コードであるか、つまりパターン終端に達したどうかを判断する。
パターン終端であれば、判断結果は「YES」となり、本処理を完了させるが、パターン終端に達していなければ、判断結果が「NO」となり、次のステップSE3に進む。ステップSE3では、伴奏パターンデータAPDから読み出される音符データ中の音高をレジスタpitchにストアする。以下、レジスタpitchの内容を音高pitchと記す。
【0057】
次いで、ステップSE4では、音高変換すべく伴奏パターンデータAPDから読み出された音符データに対応するコードデータchordをコード進行データCPD(図12参照)から検出し、該当するコードデータchordのルートcrootおよびタイプctypeを抽出するコード検出処理を実行する。なお、この第2実施例によるコード検出処理の詳細については追って述べる。そして、ステップSE5では、検出したルートcrootおよびタイプctypeに応じて音高pitchを音高変換する音高変換処理(後述する)を実行する。
【0058】
続いて、ステップSE6では、ポインタnptrに応じて伴奏パターンデータAPDから読み出される発音タイミングmelody[nptr]をRAM6のデータエリアnew[nptr]に格納し、音高変換された音高pitchをRAM6のデータエリアnew[nptr+1]に格納する。さらに、ポインタnptrの二つ先のアドレス(nptr+2)に応じて伴奏パターンデータAPDから読み出される音量melody[nptr+2]をRAM6のデータエリアnew[nptr+2]に格納し、ポインタnptrの三つ先のアドレス(nptr+3)に応じて伴奏パターンデータAPDから読み出される音長melody[nptr+3]をRAM6のデータエリアnew[nptr+3]に格納する。
【0059】
こうして、音高変換された音符データが、新たな伴奏パターンデータAPDとしてRAM6のデータエリアに格納されると、CPU3はステップSE7に処理を進め、次の音符データについて音高変換を施すべく、ポインタnptrに「4」を加算してポインタ更新を行い、続くステップSE8では、更新されたポインタnptrに応じて伴奏パターンデータAPDから読み出される発音タイミングmelody[nptr]をカウンタntimeに累算して伴奏開始時点からの経過時間を表す伴奏進行時間を更新する。
以後、前述のステップSE2に処理を戻し、伴奏パターンデータAPDのパターン終端に達するまでステップSE2〜SE8を繰り返して伴奏パターンデータAPD中の各音符データの音高pitchを、コード進行に対応させて音高変換してなる新たな伴奏パターンデータAPDをRAM6のデータエリアに登録して行き、パターン終端に達した時点でステップSE2の判断結果が「YES」となり、本処理を完了させる。
【0060】
▲3▼コード検出処理の動作
次に、図16を参照して第2実施例によるコード検出処理の動作について説明する。上述のステップSE4(図15参照)を介して本処理が実行されると、CPU3は図16に示すステップSF1に処理を進める。ステップSF1では、ポインタcptrおよびカウンタctimeをそれぞれゼロリセットする。ここで、ポインタcptrは、前述の入力指示イベントにて選択されるコード進行データCPD(図12参照)の読み出しアドレスを一時記憶する。カウンタctimeは、コード進行データCPDの発音タイミングを累算し、コード進行開始時点からの経過時間(以下、コード進行時間と称す)を発生する。
そして、ステップSF2では、ポインタcptrの一つ先のアドレスに応じてコード進行データCPDから読み出されるコードデータchord[cptr+1]が終端コードであるか、つまりデータ終端に達したどうかを判断する。
【0061】
データ終端に達していなければ、判断結果は「NO」となり、次のステップSF3に進む。ステップSF3では、ポインタcptrに応じてコード進行データCPDから読み出されるコードデータchord[cptr]、すなわち前コード入力時点からの経過時間で表される入力タイミングをカウンタctimeに累算してコード進行時間を算出する。
次いで、ステップSF4では、算出したコード進行時間が、カウンタntimeに格納される伴奏進行時間と補正値coffsetとの加算値を超えたかどうかを判断する。コード進行時間が上記加算値を超えていなければ、判断結果は「NO」となり、ステップSF5に進む。ステップSF5では、次のコードデータchordを読み出すべくポインタcptrに「4」を加算してポインタcptrを進めた後、再び上記ステップSF2に処理を戻す。
【0062】
このように、ステップSF2〜SF5では、伴奏進行時間と補正値coffsetとの加算値を超えたコード進行時間を検索し、その条件を満たすコードデータchordが見つかると、ステップSF4の判断結果が「YES」となり、ステップSF6に進み、その検索したコードデータchordの一つ前のコードデータchord中のルートchord[cptr−3]、タイプchord[cptr−2]およびコードベースchord[cptr−1]を抽出してそれぞれレジスタcroot,ctypeおよびcbassにストアする。
【0063】
なお、伴奏進行時間と補正値coffsetとの加算値を超えたコード進行時間を検索する過程でコード進行データCPDのデータ終端に達した場合には、ステップSF2の判断結果が「YES」となり、ステップSF6に進み、データ終端の一つ前のコードデータchord中のルートchord[cptr−3]をレジスタcrootに、タイプchord[cptr−2]をレジスタctypeに、コードベースchord[cptr−1]をレジスタcbassにそれぞれストアする。以下、レジスタcroot,ctype,cbassの内容をそれぞれルートcroot、タイプctype、コードベースcbassと記す。
【0064】
▲4▼音高変換処理の動作
次に、図17を参照して第2実施例による音高変換処理の動作について説明する。前述のステップSE5(図15参照)を介して本処理が実行されると、CPU3は図17のステップSG1に進み、伴奏パターンデータAPDから現在読み出されている音高pitchがベースパートであるか否かを判断する。以下、コードパートの場合とベースパートの場合とに分けて動作説明を進める。
【0065】
(イ)コードパートの場合
伴奏パターンデータAPDから現在読み出されている音高pitchがコードパートであると、ステップSG1の判断結果は「NO」となり、ステップSG2に処理を進める。ステップSG2では、前述のステップSE4にて検出したルートcrootおよびタイプctypeに基づきピッチチェンジテーブルPCT(図4参照)から対応するピッチ補正値pctabを読み出すためのテーブル引数index(ctype,|pitch−croot|mod 12)を求める。ここで、ctypeは検出したタイプ、|pitch−croot|mod 12は、伴奏パターンデータAPDから読み出した音符データの音高pitchとルートcrootとの差(絶対値)の12剰余値である。
【0066】
そして、求めたテーブル引数indexに応じてピッチチェンジテーブルPCTから読み出されるピッチ補正値pctab[index]を音高pitchに加算して音高変換する。
この場合、前述した第1実施例と同様、入力コードのタイプctypeに対応して、その入力コードのルートcrootを根音とするコード構成音のうちで伴奏パターンのオリジナル音高pitchに近接する音高になるよう伴奏パターン中の各音符データの音高pitchをシフトさせる為、伴奏パターンは入力コードに相応しい音高に変換され、しかも入力コードの切り替りで不自然な伴奏音が生成される虞もない。
【0067】
(ロ)ベースパートの場合
伴奏パターンデータAPDから現在読み出されている音高pitchがベースパートであると、ステップSG1の判断結果が「YES」となり、ステップSG3に進み、分数コードであるか否か、すなわち、前述のステップSE4にて検出したルートcrootとコードベースcbassとが異なるかどうかを判断する。
ルートcrootとコードベースcbassとが一致する通常のコードの場合には、判断結果が「NO」となり、ステップSG4に進み、検出されたルートcrootと伴奏パターンデータAPDから読み出した音符データの音高pitchとに基づきピッチチェンジテーブルPCTから対応するピッチ補正値pctabを読み出すためのテーブル引数index(ctype,pitch mod12)を求める。ここで、ctypeは検出したタイプ、pitch mod12は、伴奏パターンデータAPDから読み出した音符データの音高pitchの12剰余値(音名に相当)である。
【0068】
そして、求めたテーブル引数indexに応じてピッチチェンジテーブルPCTから読み出されるピッチ補正値pctab[index]にルートcrootを加算し、その値の12剰余値を音高pitchに加算して音高変換する。つまり、前述した第1の従来技術と同様、入力コードのタイプctypeと伴奏パターンの音高pitchとで定まるピッチ補正値pctab[index]に入力コードのルートcrootを加算した結果に基づき、伴奏パターンの音高pitchをシフトさせるようにしている。この場合、コードが切り替わる時のルートの変化がそのままベース音の音高変化につながるが、ベースパートの音域を逸脱するような音高変化が生じるケースでは、後述するステップSG6以降で音域補正するようになっている。
【0069】
一方、ルートcrootとコードベースcbassとが異なる分数コードの場合には、上記ステップSG3の判断結果が「YES」となり、ステップSG5に処理を進める。ステップSG5では、検出されたコードベースcbassから音高pitchの音名(pitch mod 12)を差し引いた値を、音高pitchに加算して音高変換する。
【0070】
さて、このようにして、伴奏パターンデータAPDのベースパート音が通常コードあるいは分数コードに応じて音高変換されると、CPU3はステップSG6に進み、音域補正するか否かを判断する。ユーザ操作によって音域補正しないようスイッチ設定されていると、判断結果は「NO」となり、なにも処理せずに本処理を完了させるが、音域補正するようスイッチ設定されていれば、判断結果が「YES」となり、ステップSG7〜SG10を介して音高pitchの音域を補正する。
【0071】
すなわち、音高変換された音高pitchが予め設定される上限を超える場合には、ステップSG7,SG8において、音高pitchが上限を下回るまで1オクターブずつ下げ、一方、音高変換された音高pitchが予め設定される下限を超える場合には、ステップSG9,SG10において、音高pitchが下限を上回るまで1オクターブずつ上げるようになっている。そして、音高pitchが予め設定される上限から下限の範囲に収まるように音域補正されると、ステップSG9の判断結果が「NO」となり、本処理を完了させる。
【0072】
以上説明したように、第2実施例によれば、人が演奏した曲データなど、発音タイミングが正規のタイミングより進んだり遅れたりする伴奏パターンデータAPDにおいて、正規のタイミングに合わせるように発音タイミングをオフセットさせるので、パターン構成音の発音タイミングが正規のタイミングより進んだり遅れたりする伴奏パターンを使用した場合でも不自然な伴奏音の発生を防止することが可能になっている。
また、第2実施例によれば、伴奏パターン中のベースパートを音高変換する際に分数コードが入力されると、その分数コードのコードベースcbassからベースパートの音高pitchの音名(pitch mod 12)を差し引いた値を、音高pitchに加算して音高変換するようにしたので、入力される分数コードに相応しい伴奏音を発生することが可能になっている。
【0073】
【発明の効果】
請求項1,に記載の発明によれば、伴奏パターンの各伴奏音に対応するコードを検出し、伴奏音の音高に近接する検出コードの構成音あるいはコードスケール音の音高になるよう伴奏音の音高を変換し、さらには伴奏パターンの各伴奏音に対応するコードを検出し、伴奏音の音名と検出コードのルートとの音程および検出コードのタイプに応じた音高補正値を発生し、この音高補正値に基づいて伴奏音の音高をシフトさせて変換するので、従来のように、ルートやキーの変化がそのまま伴奏音の音高変化にならず、入力コードの切り替りで不自然な伴奏音の発生を防ぐことができる。
【図面の簡単な説明】
【図1】本発明による第1実施例の構成を示すブロック図である。
【図2】伴奏パターンデータAPDの一構成例を示す図である。
【図3】コード進行データCPDの一構成例を示す図である。
【図4】ピッチチェンジテーブルPCTの一例を示す図である。
【図5】第1実施例によるメインルーチンの動作を示すフローチャートである。
【図6】第1実施例による伴奏生成処理の動作を示すフローチャートである。
【図7】第1実施例によるコード検出処理の動作を示すフローチャートである。
【図8】第1実施例の具体的な動作例を示す図である。
【図9】ピッチチェンジテーブルPCT2の一例を示す図である。
【図10】第1実施例の変形例による伴奏生成処理の動作を示すフローチャートである。
【図11】第2実施例による伴奏パターンデータAPDの一構成例を示す図である。
【図12】第2実施例によるコード進行データCPDの一構成例を示す図である。
【図13】第2実施例によるメインルーチンの動作を示すフローチャートである。
【図14】伴奏パターンと入力コードとの対応にずれが生じて適正な音高変換がなされず不自然な伴奏音を発生させてしまう一例を示す図である。
【図15】第2実施例による伴奏生成処理の動作を示すフローチャートである。
【図16】第2実施例によるコード検出処理の動作を示すフローチャートである。
【図17】第2実施例による音高変換処理の動作を示すフローチャートである。
【符号の説明】
1 パネルスイッチ
2 表示部
3 CPU
4 ROM
5 データROM
6 RAM
7 音源
8 サウンドシステム
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an accompaniment generating apparatus and an accompaniment generating program suitable for use in an automatic accompaniment apparatus.
[0002]
[Prior art]
It is known that an automatic accompaniment apparatus includes an accompaniment generation apparatus that converts the pitch of each sound constituting an accompaniment pattern according to an input chord. The accompaniment generation apparatus normally uses each chord of an accompaniment pattern described in association with a reference chord (for example, C major) or a key (for example, C) as the root (root tone) and type (chord type) of the input chord. The first conventional technique for converting the pitch according to the above or the second conventional technique for converting the pitch according to the function of the key (key) and the input code (evaluating the route with the key) and the type is used. There are many cases.
[0003]
[Problems to be solved by the invention]
By the way, the first prior art described above shifts the pitch of the accompaniment pattern based on the result of adding the root of the input chord to the pitch correction value determined by the type of the input chord and the pitch of the accompaniment pattern. On the other hand, the second prior art shifts the pitch of the accompaniment pattern based on the result of adding the key to the pitch correction value determined by the function and type of the input code and the pitch of the accompaniment pattern. It has become. For this reason, in the first prior art, the change in the route directly changes the pitch of the accompaniment sound, while in the second conventional technique, the change in the key directly changes the pitch of the accompaniment sound. There is a possibility that the pitch of the accompaniment sound changes suddenly due to the change of the sound and the accompanying modulation, and an unnatural accompaniment sound is generated.
Accordingly, a first object of the present invention is to provide an accompaniment generation apparatus and an accompaniment generation method capable of preventing the generation of an unnatural accompaniment sound by switching input codes.
[0006]
[Means for Solving the Problems]
In order to achieve the above object, the invention according to claim 1 provides: Storage means for storing accompaniment pattern data composed of a plurality of note data having pronunciation timing and pitch, and chord progression data composed of a plurality of chord data composed of input timing, route and type, and a value in an initial state The accumulated counter to be cleared and the note data constituting the accompaniment pattern data are read from the storage means in accordance with the corresponding sounding timing, and the chord data constituting the chord progression data is read from the storage means. And a pitch for calculating the pitch between the pitch of the read note data and the root of the chord data read at this time each time the note data is read by the reading means. Difference calculation means and sound calculated by the pitch difference calculation means And based on the type of the chord being read, the pitch of the read note data is set to the chord constituent sound or chord scale sound of the read chord data close to the pitch. A pitch correction value output means for outputting the pitch correction value of the sound, and the read accompaniment based on the pitch correction value output from the pitch correction value output means and the value stored in the accumulation counter. A shift means for shifting the pitch of the pattern; and after the pitch is shifted by the shift means, the output pitch correction value is added to the value stored in the accumulation counter, whereby the accumulation counter An accumulation means for updating the value of It is characterized by comprising.
[0012]
Claim 2 In the invention described in Storage means for storing accompaniment pattern data composed of a plurality of note data having pronunciation timing and pitch, and chord progression data composed of a plurality of chord data composed of input timing, route and type, and input pitch An accompaniment generating program applied to a device having table means for outputting a pitch correction value based on a chord type and an accumulating counter whose value is cleared in an initial state. The note data constituting the pattern data is read according to the corresponding sounding timing, and the reading function for reading out the chord data constituting the chord progression data from the storage means according to the corresponding input timing, and the note data is read out Every time, the pitch of the read note data and this point Based on the pitch difference calculation function for calculating the pitch of the read chord data root, the calculated pitch, and the type of the chord read, the sound of the read note data A pitch correction value output function for outputting a pitch correction value from the table means for setting the pitch to be a chord constituent sound or chord scale sound of the read chord data close to the pitch, and this output A shift function for shifting the pitch of the read accompaniment pattern based on the pitch correction value and the value stored in the accumulation counter When, After this pitch shift, the computer implements an accumulation function that updates the value of the accumulated counter by adding the output pitch correction value to the value stored in the accumulated counter. Make It is characterized by that.
[0014]
In the present invention, the chord corresponding to each accompaniment sound of the accompaniment pattern is detected, and the pitch of the accompaniment sound is adjusted so as to be the pitch of the detection chord or chord scale sound close to the pitch of the accompaniment sound. Convert, Alternatively, a pitch correction value corresponding to the pitch of the accompaniment sound name and the root of the detection code and the type of the detection code is generated, and the pitch of the accompaniment sound is shifted based on this pitch correction value. Because it converts As in the prior art, changes in the root and keys do not change the pitch of the accompaniment sound as it is, and it is possible to prevent the occurrence of an unnatural accompaniment sound due to switching of the input chord and the accompanying modulation.
[0017]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, an accompaniment generating device according to an embodiment of the present invention will be described as an example, and this will be described with reference to the drawings.
A. First embodiment
(1) Configuration
FIG. 1 is a block diagram showing the configuration of the first embodiment according to the present invention. In this figure, 1 is a device panel such as a selection switch for selecting an accompaniment pattern or chord progression pattern, an accompaniment generation switch for instructing start of accompaniment generation (described later), or a start / stop switch for instructing start / stop of automatic accompaniment. And a switch event corresponding to the operated switch. Reference numeral 2 denotes a display unit that displays a setting state and an operation state of each unit of the apparatus in accordance with a display control signal supplied from a CPU 3 to be described later.
[0018]
A CPU 3 controls each part of the apparatus, and its characteristic operation will be described later. A ROM 4 stores various control programs loaded on the CPU 3. A data ROM 5 stores a plurality of types of accompaniment pattern data APD, chord progression data CPD, and a pitch change table PCT.
The accompaniment pattern data APD is composed of note data representing accompaniment sounds for a predetermined measure corresponding to C major. An example is shown in FIG. As shown in FIG. 2, each piece of note data melody [0] to [44] is formed from a sounding timing, a pitch, a volume, and a tone length each represented by an elapsed time from the previous event (note). An end code (FFFFh) indicating the end of the pattern is provided at the end of the accompaniment pattern data APD.
[0019]
The chord progression data CPD is obtained by storing chord data chord in the chord progression order. As shown in the example shown in FIG. 3, each of the chord data chords [0] to [10] is formed from an input (sound generation) timing, a route, and a type expressed by an elapsed time from the previous chord input time point. A termination code (FFFFh) is provided at the end.
[0020]
The pitch change table PCT is based on the difference (number of semitones) between the pitch pitch in the accompaniment pattern corresponding to the input chord and the root root of the input chord according to the input chord type ctype read from the chord progression data CPD. FIG. 4 shows a table for reading a fixed pitch correction value pctab, an example of which is shown in FIG.
In the pitch change table PCT shown in FIG. 4, for example, if the type is major MAJ, the pitch pitch is set according to the 12 remainder value of the difference (absolute value) between the pitch pitch and the root root in the accompaniment pattern. A pitch correction value pctab to be collected into chord constituent sounds having a semitone number “0 (root tone)”, a semitone number “4 (long 3 °)”, and a semitone number “7 (completely 5 °)” is registered. The pitch of each note data of the accompaniment pattern data APD is shifted by the pitch correction value pctab read from the pitch change table PCT.
[0021]
Next, the configuration of the embodiment will be described with reference to FIG. 1 again. In FIG. 1, reference numeral 6 denotes a RAM having a data area in addition to a work area for temporarily storing various register / flag data. The data area of the RAM 6 stores accompaniment pattern data APD that has been pitch-converted using the pitch change table PCT described above. Reference numeral 7 denotes a sound source configured by a well-known waveform memory reading method, and generates an accompaniment sound corresponding to the accompaniment pattern data APD stored in the data area of the RAM 6 under the instruction of the CPU 3. Reference numeral 8 denotes a sound system in which an accompaniment sound generated by the sound source 7 is D / A converted into an analog musical tone signal and then amplified and emitted from a speaker.
[0022]
(2) Operation
Next, the operation of the first embodiment having the above configuration will be described with reference to FIGS. In the following, the “main routine operation” will be described first as an outline operation, and then each of the “accompaniment generation processing” and “chord detection processing” related to the gist of the present invention will be described.
[0023]
(1) Main routine operation (schematic operation)
When the power is turned on in this embodiment, the CPU 3 loads a predetermined control program from the ROM 4, executes the main routine shown in FIG. 5, and advances the process to step SA1. In step SA1, various registers and flags provided in the RAM 6 are reset, and initialization for instructing the sound source 7 to initialize various registers and flags is executed. After the initialization is completed, the CPU 3 advances the processing to the next step SA2, and scans the panel switch 1 in order to determine whether or not the switch is operated. In steps SA3 to SA8, processing corresponding to the switch event type detected by switch scanning is executed. In the following, the operation will be described separately when “input instruction event”, “generation instruction event”, and “reproduction instruction event” are detected.
[0024]
(B) For input instruction events
When an input instruction event is detected in response to the operation of the selection switch, the determination result in step SA3 is “YES”, the process proceeds to step SA6, and the selected accompaniment pattern data APD is transferred from the data ROM 5 to the data area of the RAM 6. Or input processing such as register setting the read address of the selected chord progression data CPD.
[0025]
(B) For generation instruction events
When a generation instruction event is detected in accordance with the operation of the accompaniment generation switch, the determination result in step SA4 is “YES”, and the flow proceeds to step SA7, where accompaniment generation processing is executed. In this accompaniment generation process, each note data in the accompaniment pattern data APD selected in the input instruction event according to the chord progression data CPD selected in the input instruction event and the pitch change table PCT described above. As a result, the accompaniment sound matched with the chord progression data CPD, that is, the new accompaniment pattern data APD is generated so that an unnatural accompaniment sound is not generated by the chord change. The details will be described later.
[0026]
(C) For a playback instruction event
When a playback instruction event indicating the start of automatic accompaniment is detected in response to the operation of the start / stop switch, the determination result in step SA5 becomes “YES”, and the process proceeds to step SA8, where a new one generated in the accompaniment generation process is performed. Accompaniment reproduction processing for reproducing accompaniment sounds according to the accompaniment pattern data APD is executed.
If the panel switch 1 is not operated and none of the above-described events occurs, the determination results in steps SA3 to SA5 are “NO”, the process returns to step SA2, and any event is performed thereafter. Steps SA2 to SA5 are repeated until.
[0027]
(2) Accompaniment generation process
Next, the operation of the accompaniment generation process will be described with reference to FIG. When the accompaniment generation process is executed through step SA7 (see FIG. 5) described above, the CPU 3 advances the process to step SB1 in FIG. 6, and resets the pointer nptr and the counter ntime to zero. Here, the pointer nptr temporarily stores a read address of accompaniment pattern data APD (see FIG. 2) selected by the above-described input instruction event. The counter ntime accumulates the sound generation timings included in the note data of the accompaniment pattern data APD, and generates an elapsed time from the accompaniment start time (hereinafter referred to as accompaniment progression time).
[0028]
After resetting the pointer nptr and the counter ntime to zero, the CPU 3 proceeds to step SB2, and whether the content melody [nptr + 1] read from the accompaniment pattern data APD according to the address (nptr + 1) one ahead of the pointer nptr is the termination code That is, it is determined whether the end of the pattern has been reached. If it is the pattern end, the determination result is “YES”, and this process is completed. If the pattern end is not reached, the determination result is “NO”, and the process proceeds to the next step SB3.
In step SB3, the pitch (melody [nptr + 1]) in the note data read from the accompaniment pattern data APD is stored in the register pitch. Hereinafter, the content of the register pitch is referred to as a pitch pitch.
[0029]
Next, in step SB4, a code detection process is executed, and the process proceeds to step SB4-1 shown in FIG. In step SB4-1, the pointer cptr and the counter ctime are each reset to zero. Here, the pointer cptr temporarily stores the read address of the chord progression data CPD (see FIG. 3) selected by the above-described input instruction event. The counter ctime accumulates the sounding timing of the chord progression data CPD and generates an elapsed time from the chord progression start time (hereinafter referred to as chord progression time). In step SB4-2, it is determined whether or not the code data chord [cptr + 1] read from the chord progression data CPD according to the address (cptr + 1) one ahead of the pointer cptr is a termination code, that is, whether the data end has been reached. to decide.
[0030]
If the end of data has not been reached, the determination result is “NO”, and the flow advances to the next Step SB4-3. In step SB4-3, chord progression is performed by accumulating the chord data chord [cptr] read from the chord progression data CPD according to the pointer cptr, that is, the sounding timing represented by the elapsed time from the previous chord input time to the counter ctime. Calculate time.
Next, in step SB4-4, it is determined whether or not the calculated chord progression time has exceeded the accompaniment progression time stored in the counter ntime. If the chord progression time does not exceed the accompaniment progression time, the determination result is “NO”, and the flow proceeds to step SB4-5. In step SB4-5, "3" is added to the pointer cptr to advance the pointer cptr so as to read the next code data chord, and then the process returns to step SB4-2 again.
[0031]
As described above, in steps SB4-2 to SB4-5, the chord progression time exceeding the accompaniment progression time is searched, and if chord data chord satisfying the condition is found, the determination result in step SB4-4 becomes “YES”. In step SB4-6, the route chord [cptr-2] and the type chord [cptr-1] in the code data chord immediately before the retrieved code data chord are extracted and stored in the registers root and ctype, respectively. To do.
If the end of the chord progression data CPD is reached in the process of searching for the chord progression time exceeding the accompaniment progression time, the determination result in step SB4-2 is “YES”, and the flow proceeds to step SB4-6. The root chord [cptr-2] in the code data chord immediately before the data end is stored in the register root, and the type chord [cptr-1] is stored in the register ctype. Hereinafter, the contents of the registers “croot” and “ctype” will be referred to as “root root” and “type ctype”, respectively.
[0032]
When the root route and the type ctype of the chord corresponding to the note data read from the accompaniment pattern data APD are detected in this way, the CPU 3 advances the process to step SB5 in FIG. In step SB5, a table argument index (ctype, | pitch-croat | mod 12) for reading out the corresponding pitch correction value pctab from the above-described pitch change table PCT (see FIG. 4) based on the detected route root and type ctype. Ask. Here, ctype is the detected type, and | pitch-croat | mod 12 is the 12 remainder value of the difference (absolute value) between the pitch pitch of the note data read from the accompaniment pattern data APD and the root root.
[0033]
In step SB6, the pitch correction value pctab [index] read from the pitch change table PCT according to the table argument index is added to the pitch pitch to convert the pitch. Next, in step SB7, the sound generation timing melody [nptr] read from the accompaniment pattern data APD in accordance with the pointer nptr is stored in the data area new [nptr] of the RAM 6, and the pitch pitch converted into the pitch is stored in the data area of the RAM 6. stored in new [nptr + 1]. Further, the volume melodies [nptr + 2] read from the accompaniment pattern data APD in accordance with the address (nptr + 2) two ahead of the pointer nptr is stored in the data area new [nptr + 2] of the RAM 6, and the three ahead addresses (nptr + 2) of the pointer nptr ( The tone length melody [nptr + 3] read from the accompaniment pattern data APD according to nptr + 3) is stored in the data area new [nptr + 3] of the RAM 6.
[0034]
When the note data whose pitch has been converted as described above is stored in the data area of the RAM 6 as new accompaniment pattern data APD, the CPU 3 advances the process to step SB8 and performs pitch conversion on the next note data. In order to perform this, the pointer is updated by adding “4” to the pointer nptr, and in the subsequent step SB9, the sound generation timing melody [nptr] read from the accompaniment pattern data APD is accumulated in the counter ntime in accordance with the updated pointer nptr. Then, the accompaniment progression time representing the elapsed time from the accompaniment start time is updated.
Then, the processing is returned to the above-described step SB2, and thereafter, steps SB2 to SB9 are repeated until the pattern end of the accompaniment pattern data APD is reached, and the pitch pitch of each note data in the accompaniment pattern data APD is made to correspond to the chord progression. The new accompaniment pattern data APD obtained by converting the pitch is registered in the data area of the RAM 6, and when the end of the pattern is reached, the determination result in step SB2 is “YES”, and this processing is completed.
[0035]
Therefore, as shown in the score of FIG. 8A, when the accompaniment pattern data APD shown in FIG. 2 is subjected to accompaniment generation processing in accordance with the chord progression data CPD shown in FIG. The pitch is converted into an accompaniment pattern expressed in the score.
That is, according to the present embodiment, the original pitch of the accompaniment pattern among the chord constituent sounds having the root root of the chord chord as the root note corresponding to the chord chord type ctype input according to the chord progression data CPD. Since the pitch pitch of each note data in the accompaniment pattern is shifted so that the pitch is close to the pitch, it becomes possible to prevent the occurrence of an unnatural accompaniment sound by switching the input chord.
[0036]
In the present embodiment, in accordance with the input chord type ctype, the accompaniment is made so that the pitch is close to the original pitch pitch of the accompaniment pattern among the chord constituent sounds rooted in the root root of the input chord. The pitch change table PCT for reading the pitch correction value pctab for shifting the pitch pitch of each note data in the pattern is used. However, the present invention is not limited to this, and the pitch change table PCT2 having the table contents shown in FIG. 9 is used. It does not matter as a form to do.
When the pitch change table PCT2 is used, the pitch pitch of each note data in the accompaniment pattern includes a non-harmonic sound (for example, a tension note) other than a chord constituent sound whose root is the root root of the input chord. Since the pitch can be converted to any chord scale sound, a more preferable accompaniment sound can be generated.
[0037]
(3) Modification
In the above-described embodiment, there is no possibility that an unnatural accompaniment sound is generated by switching the input chord. However, depending on the contents of the accompaniment pattern data APD, the same pitch may overlap or continue and the character of the chord It may happen that the accompaniment line becomes undefined. Therefore, in the modification, accompaniment generation processing for avoiding such harmful effects will be described with reference to FIG.
Similar to the above-described embodiment, when the accompaniment generation process according to the modified example is executed via step SA7 of the main routine illustrated in FIG. 5, the CPU 3 advances the process to step SC1 in FIG. 10, and performs the pointer nptr, the counter ntime, The counter otime and the register dev are each reset to zero and initialized.
[0038]
Here, the pointer nptr temporarily stores a read address of accompaniment pattern data APD (see FIG. 2) selected by the input instruction described above. The counter ntime accumulates the sound generation timings included in the note data of the accompaniment pattern data APD, and generates an elapsed time from the accompaniment start time (hereinafter referred to as accompaniment progression time). The counter otime is used to detect the elapsed timing for each measure. The register dev temporarily stores a pitch correction accumulated value obtained by accumulating the pitch correction value pctab for each measure.
[0039]
When the initialization of the pointer and counter is completed, the CPU 3 proceeds to step SC2, where the content melody [nptr + 1] read from the accompaniment pattern data APD according to the address one ahead of the pointer nptr is the termination code, that is, at the end of the pattern. Determine if it has been reached.
If it is the pattern end, the determination result is “YES”, and this process is completed. If the pattern end is not reached, the determination result is “NO”, and the process proceeds to the next step SC3. In step SC3, it is determined whether ntime / 960> otime / 960, that is, whether one bar has elapsed. If one bar has not elapsed, the determination result is “NO”, and the process proceeds to step SC5, which will be described later. However, if one bar has elapsed, the determination result is “YES”, the process proceeds to step SC4, and the counter ntime Is stored in the counter otime, while the register dev is reset to zero.
[0040]
Next, in step SC5, pitch melody [nptr + 1] in the note data read from the accompaniment pattern data APD is stored in the register pitch in accordance with the address (nptr + 1) one ahead of the pointer nptr. Hereinafter, the content of the register pitch is referred to as a pitch pitch. In step SC6, the chord detection process shown in FIG. 7 is executed in the same manner as in the above-described embodiment, and the root route and type ctype of the chord corresponding to the note data read from the accompaniment pattern data APD are detected.
Subsequently, in step SC7, as a table argument index for reading out the corresponding pitch correction value pctab from the above-described pitch change table PCT (see FIG. 4) based on the detected route root and type ctype, (ctype, | pitch-root | Mod 12) is obtained. Here, ctype is the detected type, and | pitch-croat | mod 12 is the 12 remainder value of the difference (absolute value) between the pitch pitch of the note data read from the accompaniment pattern data APD and the root root.
[0041]
Next, at step SC8, the pitch correction value pctab [index] read from the pitch change table PCT according to the table argument index and the value of the register dev (hereinafter referred to as the pitch correction accumulated value) are used as the pitch pitch. Is added to to convert the pitch. Next, at step SC9, the pitch correction accumulated value dev is generated by accumulating the pitch correction value pctab [index].
[0042]
Then, the process proceeds to step SC10, where the sound generation timing melody [nptr] read from the accompaniment pattern data APD according to the pointer nptr is stored in the data area new [nptr] of the RAM 6, and the pitch pitch converted into the pitch is stored in the RAM 6 data. Store in area new [nptr + 1]. Further, the volume melodies [nptr + 2] read from the accompaniment pattern data APD in accordance with the address (nptr + 2) two ahead of the pointer nptr is stored in the data area new [nptr + 2] of the RAM 6, and the three ahead addresses (nptr + 2) of the pointer nptr ( The tone length melody [nptr + 3] read from the accompaniment pattern data APD according to nptr + 3) is stored in the data area new [nptr + 3] of the RAM 6.
[0043]
When the note data thus converted in pitch is stored in the data area of the RAM 6 as new accompaniment pattern data APD, the CPU 3 advances the process to step SC11, and performs pointer conversion to perform pitch conversion on the next note data. In step SC12, “4” is added to nptr to update the pointer, and in step SC12, the sound generation timing melody [nptr] read from the accompaniment pattern data APD is accumulated in the counter ntime in accordance with the updated pointer nptr. The accompaniment progress time indicating the elapsed time from the time is updated. Thereafter, the process returns to the above-described step SC2, and steps SC2 to SC12 are repeated until the pattern end of the accompaniment pattern data APD is reached.
[0044]
Thus, according to the modification, the current pitch correction value pctab [index] read from the pitch change table PCT according to the input code type ctype and route root, and zero reset for each measure, and the previous pitch correction value The pitch correction accumulated value dev that is accumulated up to pctab [index] is added to the pitch pitch to convert the pitch, so the same pitch overlaps and continues and the character of the chord is determined It is possible to prevent the accompaniment line (accompaniment pattern) from becoming unaccompanied.
[0045]
B. Second embodiment
In the first embodiment described above, the occurrence of an unnatural accompaniment sound is prevented by switching the input code. In the second embodiment, the sound generation timing of each sound constituting the accompaniment pattern data APD is advanced from the normal timing. Even if it is delayed or delayed, the pitch is converted so that it does not become an unnatural accompaniment sound, or even if the chord progression data CPD contains a fractional chord, the pitch is transformed so that the accompaniment sound is suitable for that fraction chord To do. Hereinafter, the configuration and operation of the second embodiment will be described.
[0046]
(1) Configuration
Since the overall configuration of the second embodiment is the same as that of the first embodiment, the description thereof will be omitted. The second embodiment differs from the first embodiment in that the contents of accompaniment pattern data APD and chord progression data CPD are different.
That is, the accompaniment pattern data APD according to the second embodiment includes a base part and a chord part composed of note data representing accompaniment sounds for a predetermined measure corresponding to the C major, as in the first embodiment. Each piece of note data constituting the accompaniment pattern data APD is formed from a sounding timing, a pitch, a volume, and a tone length represented by an elapsed time from the previous event (note), as in the example shown in FIG. The notes after the first note of the second measure are slightly ahead of the normal sounding timing (for 3 clocks).
[0047]
The chord progression data CPD according to the second embodiment is obtained by storing the chord data chord in the chord progression order as in the first embodiment, but each chord data chord as shown in the example shown in FIG. A chord base (base note) is provided in addition to the input timing, route, and type represented by the elapsed time from the previous chord input time. Here, when the code base is different from the root of the code, it is regarded as a fraction code (on-base code).
[0048]
(2) Operation
Next, even if the sound generation timing of the sounds constituting the accompaniment pattern data APD has fluctuations that fluctuate back and forth, the pitch is converted so that an unnatural accompaniment sound is not generated, or the chord progression data CPD includes a fractional chord. Even in this case, the operation of the second embodiment for converting the pitch to be an accompaniment sound suitable for the fraction code will be described with reference to FIGS.
[0049]
(1) Main routine operation
First, the operation of the main routine will be described with reference to FIG. 13 as the schematic operation of the second embodiment. When the apparatus power is turned on, the CPU 3 loads a predetermined control program from the ROM 4, executes the main routine shown in FIG. 13 and proceeds to step SD 1 to reset various registers and flags provided in the RAM 6. Then, initialization for instructing the sound source 7 to initialize various registers and flags is executed.
After the initialization is completed, the CPU 3 advances the process to step SD2, and scans the panel switch 1 to determine whether or not a switch operation is performed. In steps SD3 to SD10, processing corresponding to the event type detected by switch scanning is executed. Hereinafter, the operation description will be divided into cases where “input instruction event”, “generation instruction event”, “reproduction instruction event”, and “correction value change instruction event” are detected.
[0050]
(B) For input instruction events
That is, when an input instruction event for selecting the accompaniment pattern data APD and chord progression data CPD is detected according to the operation of the selection switch, the determination result in step SD3 is “YES”, and the process proceeds to step SD7. Input processing such as transferring accompaniment pattern data APD from the data ROM 5 to the data area of the RAM 6 and registering the read address of the selected chord progression data CPD is executed.
[0051]
(B) For generation instruction events
When a generation instruction event is detected in accordance with the operation of the accompaniment generation switch, the determination result in step SD4 is “YES”, and the process proceeds to step SD8 to execute accompaniment generation processing. In this accompaniment generation process, each note data in the accompaniment pattern data APD selected in the input instruction event according to the chord progression data CPD selected in the input instruction event and the pitch change table PCT described above. Thus, new accompaniment pattern data APD matching the chord progression data CPD is generated, and details thereof will be described later.
[0052]
(C) For a playback instruction event
When a playback instruction event is detected in response to the operation of the start / stop switch, the determination result in step SD5 is “YES”, the process proceeds to step SD9, and the new accompaniment pattern data APD generated in the accompaniment generation process is added. Accompaniment reproduction processing for reproducing the accompaniment sound is executed.
[0053]
(D) Correction value change instruction event
Here, after first explaining the background of the correction value change instruction, the operation will be described.
When the recorded musical piece data is used as accompaniment pattern data APD, for example, as shown in the example of FIG. 11, the notes after the first note of the second measure are slightly (for 3 clocks) from the normal sounding timing. When the accompaniment is generated using the preceding accompaniment pattern data APD, the correspondence with the input code is deviated and proper pitch conversion is not performed and an unnatural accompaniment sound is generated.
This point will be described in detail. When the accompaniment pattern data APD shown in FIG. 11 is displayed as a score, it is represented by FIG. 14A, and this is shown as chord progression data CPD (see FIG. 3) according to the first embodiment. When the accompaniment generation process is performed in the same manner as in the first embodiment, the pitch is converted into accompaniment pattern data shown in FIG. As is clear from this figure, the first note of the third measure and the fourth measure are converted to different pitches based on the input chords of the previous measure section, respectively. In particular, in the fourth measure, the same pitch ( F4 sound) overlaps to form a two chord, and it can be seen that proper pitch conversion has not been performed.
[0054]
Therefore, when using accompaniment pattern data APD such as music data performed by a person whose sound generation timing is advanced or delayed from the normal timing, a correction value change instruction event is given by operating the correction value change switch. If it does so, the judgment result of step SD6 will become "YES", and it progresses to step SD10, and performs a correction value change process.
In this correction value changing process, for example, each note data constituting the accompaniment pattern data APD is read and displayed on the display unit 2, an optimum correction value offset is set by a user's manual operation, and the sound generation timing of each note data is set. Is corrected at the appropriate timing. Alternatively, it is also possible to automatically obtain a correction value offset by a known quantization process, and thereby correct the sound generation timing of each note data constituting the accompaniment pattern data APD.
[0055]
(2) Accompaniment generation process
Next, the operation of accompaniment generation processing according to the second embodiment will be described with reference to FIG. When this process is executed through the above-described step SD8 (see FIG. 13), the CPU 3 advances the process to step SE1 in FIG. 15, and resets the pointer nptr and the counter ntime to zero. The pointer nptr temporarily stores a read address of accompaniment pattern data APD (see FIG. 2) selected by the input instruction described above. The counter ntime accumulates the sound generation timings included in the note data of the accompaniment pattern data APD, and generates an elapsed time from the accompaniment start time (hereinafter referred to as accompaniment progression time).
[0056]
When the pointer nptr and the counter ntime are reset to zero, the CPU 3 proceeds to step SE2 to check whether the content melody [nptr + 1] read from the accompaniment pattern data APD according to the address ahead of the pointer nptr is a termination code, that is, the pattern termination. Determine if you have reached.
If it is the pattern end, the determination result is “YES”, and this process is completed. If the pattern end is not reached, the determination result is “NO”, and the process proceeds to the next step SE3. In step SE3, the pitch in the note data read from the accompaniment pattern data APD is stored in the register pitch. Hereinafter, the content of the register pitch is referred to as a pitch pitch.
[0057]
Next, in step SE4, chord data chord corresponding to the note data read from the accompaniment pattern data APD for pitch conversion is detected from chord progression data CPD (see FIG. 12), and the root code of the corresponding chord data chord is detected. And a code detection process for extracting the type ctype. The details of the code detection process according to the second embodiment will be described later. In step SE5, a pitch conversion process (described later) for converting the pitch of the pitch pitch according to the detected route root and type ctype is executed.
[0058]
Subsequently, in step SE6, the sound generation timing melody [nptr] read from the accompaniment pattern data APD in accordance with the pointer nptr is stored in the data area new [nptr] of the RAM 6, and the pitch pitch converted into the pitch is stored in the RAM 6 data. Store in area new [nptr + 1]. Further, the volume melodies [nptr + 2] read from the accompaniment pattern data APD in accordance with the address (nptr + 2) two ahead of the pointer nptr is stored in the data area new [nptr + 2] of the RAM 6, and the three ahead addresses (nptr + 2) of the pointer nptr ( The tone length melody [nptr + 3] read from the accompaniment pattern data APD according to nptr + 3) is stored in the data area new [nptr + 3] of the RAM 6.
[0059]
When the note data thus converted in pitch is stored in the data area of the RAM 6 as new accompaniment pattern data APD, the CPU 3 advances the process to step SE7, and performs pointer conversion to perform pitch conversion on the next note data. The pointer is updated by adding “4” to nptr. In the next step SE8, the sounding timing melody [nptr] read from the accompaniment pattern data APD is accumulated in the counter ntime in accordance with the updated pointer nptr, and the accompaniment is started. The accompaniment progress time indicating the elapsed time from the time is updated.
Thereafter, the processing is returned to the above-mentioned step SE2, and steps SE2 to SE8 are repeated until the pattern end of the accompaniment pattern data APD is reached, and the pitch pitch of each note data in the accompaniment pattern data APD is made to correspond to the chord progression. New accompaniment pattern data APD obtained by high conversion is registered in the data area of the RAM 6, and when the end of the pattern is reached, the determination result in step SE2 is “YES”, and this processing is completed.
[0060]
(3) Code detection processing operation
Next, the operation of the code detection process according to the second embodiment will be described with reference to FIG. When this process is executed through the above-described step SE4 (see FIG. 15), the CPU 3 advances the process to step SF1 shown in FIG. In step SF1, the pointer cptr and the counter ctime are each reset to zero. Here, the pointer cptr temporarily stores the read address of the chord progression data CPD (see FIG. 12) selected by the above input instruction event. The counter ctime accumulates the sounding timing of the chord progression data CPD and generates an elapsed time from the chord progression start time (hereinafter referred to as chord progression time).
In step SF2, it is determined whether the code data chord [cptr + 1] read from the chord progression data CPD according to the address one ahead of the pointer cptr is an end code, that is, whether the end of data has been reached.
[0061]
If the end of data has not been reached, the determination result is “NO”, and the flow advances to the next Step SF3. In step SF3, the chord progression time is obtained by accumulating the chord data chord [cptr] read from the chord progression data CPD according to the pointer cptr, that is, the input timing represented by the elapsed time from the previous chord input time to the counter ctime. calculate.
Next, in step SF4, it is determined whether or not the calculated chord progression time exceeds the sum of the accompaniment progression time stored in the counter ntime and the correction value offset. If the chord progression time does not exceed the added value, the determination result is “NO”, and the flow proceeds to step SF5. In step SF5, "4" is added to the pointer cptr to advance the pointer cptr so as to read the next code data chord, and then the process returns to step SF2 again.
[0062]
As described above, in steps SF2 to SF5, the chord progression time exceeding the added value of the accompaniment progression time and the correction value offset is searched, and when the chord data chord satisfying the condition is found, the determination result in step SF4 is “YES”. The process proceeds to step SF6, and the root chord [cptr-3], type chord [cptr-2], and code base chord [cptr-1] are extracted from the code data chord immediately before the retrieved code data chord. Are stored in registers root, ctype, and cbass, respectively.
[0063]
If the end of chord progression data CPD is reached in the process of searching for the chord progression time exceeding the added value of the accompaniment progression time and the correction value offset, the determination result in step SF2 is “YES”, and the step Proceeding to SF6, the route chord [cptr-3] in the code data chord immediately before the end of the data is registered in the register root, the type chord [cptr-2] is registered in the register ctype, and the code base chord [cptr-1] is registered in the register ctype. Store each in cbass. Hereinafter, the contents of registers root, ctype, and cbass are referred to as root root, type ctype, and codebase cbass, respectively.
[0064]
(4) Pitch conversion processing operation
Next, the operation of the pitch conversion process according to the second embodiment will be described with reference to FIG. When this process is executed through the above-described step SE5 (see FIG. 15), the CPU 3 proceeds to step SG1 in FIG. 17 and determines whether the pitch pitch currently read from the accompaniment pattern data APD is the base part. Judge whether or not. In the following, the operation will be described separately for the code part and the base part.
[0065]
(B) For code parts
If the pitch pitch currently read from the accompaniment pattern data APD is a chord part, the determination result in step SG1 is “NO”, and the process proceeds to step SG2. In step SG2, a table argument index (ctype, | pitch-croat |) for reading out the corresponding pitch correction value pctab from the pitch change table PCT (see FIG. 4) based on the route root and type ctype detected in step SE4. mod 12). Here, ctype is the detected type, and | pitch-croat | mod 12 is the 12 remainder value of the difference (absolute value) between the pitch pitch of the note data read from the accompaniment pattern data APD and the root root.
[0066]
Then, the pitch correction value pctab [index] read from the pitch change table PCT is added to the pitch pitch according to the obtained table argument index to convert the pitch.
In this case, as in the first embodiment described above, the sound that is close to the original pitch pitch of the accompaniment pattern among the chord constituent sounds that have the root code of the input code as the root, corresponding to the type ctype of the input code. Since the pitch pitch of each note data in the accompaniment pattern is shifted so as to be high, the accompaniment pattern is converted to a pitch suitable for the input chord, and an unnatural accompaniment sound may be generated by switching the input chord. Nor.
[0067]
(B) For base part
If the pitch pitch currently read from the accompaniment pattern data APD is a base part, the determination result in step SG1 is “YES”, the process proceeds to step SG3, whether or not it is a fraction code, that is, the aforementioned step. It is determined whether or not the root root detected at SE4 is different from the code base cbass.
In the case of a normal chord in which the root root and the chord base cbass match, the determination result is “NO”, the process proceeds to step SG4, and the pitch pitch of the note data read from the detected root root and the accompaniment pattern data APD is obtained. Then, a table argument index (ctype, pitch mod 12) for reading the corresponding pitch correction value pctab from the pitch change table PCT is obtained. Here, ctype is the detected type, and pitch mod 12 is the 12 remainder value (corresponding to the pitch name) of the pitch pitch of the note data read from the accompaniment pattern data APD.
[0068]
Then, the root root is added to the pitch correction value pctab [index] read from the pitch change table PCT according to the obtained table argument index, and the 12 remainder value of the value is added to the pitch pitch to convert the pitch. That is, as in the first prior art described above, based on the result of adding the root code of the input code to the pitch correction value pctab [index] determined by the input code type ctype and the pitch pitch of the accompaniment pattern, The pitch pitch is shifted. In this case, the change of the route when the chord is switched leads to the pitch change of the bass sound as it is. However, in the case where the pitch change deviates from the bass part, the pitch correction is performed in step SG6 and later described. It has become.
[0069]
On the other hand, if the root code and the code base cbass are different fractional codes, the determination result in step SG3 is “YES”, and the process proceeds to step SG5. In step SG5, a value obtained by subtracting the pitch name (pitch mod 12) of the pitch pitch from the detected chord base cbass is added to the pitch pitch to perform pitch conversion.
[0070]
When the bass part sound of the accompaniment pattern data APD is thus converted in pitch according to the normal chord or the fraction chord, the CPU 3 proceeds to step SG6 and determines whether or not the range is to be corrected. If the switch is set not to correct the range by the user operation, the determination result is “NO”, and this process is completed without performing any processing. However, if the switch is set to correct the range, the determination result is "YES" is set, and the pitch range of the pitch is corrected through steps SG7 to SG10.
[0071]
That is, if the pitch pitch converted pitch exceeds the preset upper limit, in steps SG7 and SG8, the pitch is lowered by one octave until the pitch pitch falls below the upper limit, while the pitch converted pitch is set. If the pitch exceeds a preset lower limit, in steps SG9 and SG10, the pitch is increased by one octave until the pitch pitch exceeds the lower limit. Then, if the pitch range is corrected so that the pitch pitch falls within the range from the preset upper limit to the lower limit, the determination result in step SG9 becomes “NO”, and this processing is completed.
[0072]
As described above, according to the second embodiment, in the accompaniment pattern data APD in which the sound generation timing is advanced or delayed from the normal timing, such as music data performed by a person, the sound generation timing is adjusted to match the normal timing. Since the offset is used, it is possible to prevent the occurrence of an unnatural accompaniment sound even when using an accompaniment pattern in which the sounding timing of the pattern constituent sound is advanced or delayed from the normal timing.
Further, according to the second embodiment, when a pitch code is input when converting the pitch of the bass part in the accompaniment pattern, the pitch name (pitch) of the pitch pitch of the bass part is obtained from the code base cbass of the fraction code. Since the value obtained by subtracting mod 12) is added to the pitch pitch to convert the pitch, it is possible to generate an accompaniment sound suitable for the input fractional code.
[0073]
【The invention's effect】
Claim 1, 2 According to the invention described in the above, the pitch of the accompaniment sound is detected such that the chord corresponding to each accompaniment sound of the accompaniment pattern is detected and the pitch of the detection chord or the chord scale sound is close to the pitch of the accompaniment sound. Convert Moreover A chord corresponding to each accompaniment sound of the accompaniment pattern is detected, and a pitch correction value is generated according to the pitch of the pitch of the accompaniment sound and the root of the detection code and the type of the detection chord, and based on this pitch correction value Since the accompaniment sound is shifted and converted, the change in root or key does not change the accompaniment sound as it was in the past, and an unnatural accompaniment sound is generated by switching the input chord. Can be prevented.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a configuration of a first embodiment according to the present invention.
FIG. 2 is a diagram illustrating a configuration example of accompaniment pattern data APD.
FIG. 3 is a diagram illustrating a configuration example of chord progression data CPD.
FIG. 4 is a diagram showing an example of a pitch change table PCT.
FIG. 5 is a flowchart showing an operation of a main routine according to the first embodiment.
FIG. 6 is a flowchart showing the operation of accompaniment generation processing according to the first embodiment.
FIG. 7 is a flowchart showing an operation of a code detection process according to the first embodiment.
FIG. 8 is a diagram illustrating a specific operation example of the first embodiment.
FIG. 9 is a diagram illustrating an example of a pitch change table PCT2.
FIG. 10 is a flowchart showing the operation of accompaniment generation processing according to a modification of the first embodiment.
FIG. 11 is a diagram showing a configuration example of accompaniment pattern data APD according to the second embodiment.
FIG. 12 is a diagram showing a configuration example of chord progression data CPD according to the second embodiment.
FIG. 13 is a flowchart showing an operation of a main routine according to the second embodiment.
FIG. 14 is a diagram showing an example in which an unaccompanied accompaniment sound is generated without a proper pitch conversion due to a shift in correspondence between an accompaniment pattern and an input code.
FIG. 15 is a flowchart showing the operation of accompaniment generation processing according to the second embodiment.
FIG. 16 is a flowchart showing an operation of code detection processing according to the second embodiment;
FIG. 17 is a flowchart showing the operation of a pitch conversion process according to the second embodiment.
[Explanation of symbols]
1 Panel switch
2 display section
3 CPU
4 ROM
5 Data ROM
6 RAM
7 Sound source
8 Sound system

Claims (2)

発音タイミング及び音高を有する複数の音符データから構成される伴奏パターンデータ及び入力タイミング、ルート及びタイプから構成される複数のコードデータからなるコード進行データを記憶する記憶手段と、
初期状態において値がクリアされる累算カウンタと、
この記憶手段から前記伴奏パターンデータを構成する音符データを対応する発音タイミングに応じて読み出すとともに、前記記憶手段から前記コード進行データを構成するコードデータを対応する入力タイミングに応じて読み出す読み出し手段と、
この読み出し手段により音符データが読み出される毎に、当該読み出された音符データの音高とこの時点で読み出されているコードデータのルートとの音程を算出する音程差算出手段と、
前記音高差算出手段により算出された音程と、前記読み出されているコードのタイプとに基づき、前記読み出された音符データの音高を当該音高に近接する前記読み出されたコードデータのコード構成音あるいはコードスケール音とするための音高補正値を出力する音高補正値出力手段と、
この音高補正値出力手段から出力された音高補正値及び前記累算カウンタに記憶された値に基づいて前記読み出された伴奏パターンの音高をシフトするシフト手段と、
このシフト手段による音高のシフトの後、当該出力された音高補正値を前記累算カウンタに記憶された値に加算することにより、前記累算カウンタの値を更新する累算手段と、
を具備することを特徴とする伴奏生成装置。
Storage means for storing accompaniment pattern data composed of a plurality of note data having pronunciation timing and pitch, and chord progression data composed of a plurality of chord data composed of input timing, route and type;
An accumulation counter whose value is cleared in the initial state;
Reading means for reading out the note data constituting the accompaniment pattern data from the storage means in accordance with the corresponding sounding timing, and reading out the chord data making up the chord progression data from the storage means in accordance with the corresponding input timing;
Each time the note data is read by the reading means, a pitch difference calculating means for calculating a pitch between the pitch of the read note data and the root of the chord data read at this point;
The read chord data in which the pitch of the read note data is close to the pitch based on the pitch calculated by the pitch difference calculating means and the type of the read chord. A pitch correction value output means for outputting a pitch correction value for making a chord constituent sound or a chord scale sound;
Shift means for shifting the pitch of the read accompaniment pattern based on the pitch correction value output from the pitch correction value output means and the value stored in the accumulation counter ;
After the pitch is shifted by the shift means, an accumulation means for updating the value of the accumulation counter by adding the output pitch correction value to the value stored in the accumulation counter;
An accompaniment generating device comprising:
発音タイミング及び音高を有する複数の音符データから構成される伴奏パターンデータ及び入力タイミング、ルート及びタイプから構成される複数のコードデータからなるコード進行データを記憶する記憶手段と、入力される音程とコードのタイプとに基づき音高補正値を出力するテーブル手段と、初期状態において値がクリアされる累算カウンタと、を有する装置に適用される伴奏生成プログラムであって、
この記憶手段から前記伴奏パターンデータを構成する音符データを対応する発音タイミングに応じて読み出すとともに、前記記憶手段から前記コード進行データを構成するコードデータを対応する入力タイミングに応じて読み出す読み出し機能と、
この音符データが読み出される毎に、当該読み出された音符データの音高とこの時点で読み出されているコードデータのルートとの音程を算出する音程差算出機能と、
この算出された音程と、前記読み出されているコードのタイプとに基づき、前記読み出された音符データの音高を当該音高に近接する前記読み出されたコードデータのコード構成音あるいはコードスケール音とするための音高補正値を前記テーブル手段から出力させる音高補正値出力機能と、
この出力された音高補正値及び前記累算カウンタに記憶された値に基づいて前記読み出された伴奏パターンの音高をシフトするシフト機能と、
この音高のシフトの後、当該出力された音高補正値を前記累算カウンタに記憶された値に加算することにより、前記累算カウンタの値を更新する累算機能と、
をコンピュータに実現させるための伴奏生成プログラム。
Storage means for storing accompaniment pattern data composed of a plurality of note data having pronunciation timing and pitch, and chord progression data composed of a plurality of chord data composed of input timing, route and type, and input pitch An accompaniment generation program applied to a device having table means for outputting a pitch correction value based on a chord type, and an accumulation counter whose value is cleared in an initial state,
A reading function for reading out the note data constituting the accompaniment pattern data from the storage means according to the corresponding sounding timing, and reading out the chord data constituting the chord progression data from the storage means according to the corresponding input timing;
A pitch difference calculation function for calculating a pitch between the pitch of the read note data and the root of the chord data read at this time each time the note data is read;
Based on the calculated pitch and the type of the chord that has been read, the pitch of the read note data is the chord constituent sound or chord of the read chord data that is close to the pitch. A pitch correction value output function for outputting a pitch correction value for a scale sound from the table means;
A shift function for shifting the pitch of the read accompaniment pattern based on the output pitch correction value and the value stored in the accumulation counter ;
After this pitch shift, an accumulation function that updates the value of the accumulation counter by adding the output pitch correction value to the value stored in the accumulation counter;
Accompaniment generation program for realizing on a computer.
JP2002227899A 2002-08-05 2002-08-05 Accompaniment generation apparatus and accompaniment generation program Expired - Fee Related JP4035715B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002227899A JP4035715B2 (en) 2002-08-05 2002-08-05 Accompaniment generation apparatus and accompaniment generation program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002227899A JP4035715B2 (en) 2002-08-05 2002-08-05 Accompaniment generation apparatus and accompaniment generation program

Publications (3)

Publication Number Publication Date
JP2004069936A JP2004069936A (en) 2004-03-04
JP2004069936A5 JP2004069936A5 (en) 2005-08-25
JP4035715B2 true JP4035715B2 (en) 2008-01-23

Family

ID=32014788

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002227899A Expired - Fee Related JP4035715B2 (en) 2002-08-05 2002-08-05 Accompaniment generation apparatus and accompaniment generation program

Country Status (1)

Country Link
JP (1) JP4035715B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5104415B2 (en) * 2008-03-07 2012-12-19 ヤマハ株式会社 Automatic performance device and program

Also Published As

Publication number Publication date
JP2004069936A (en) 2004-03-04

Similar Documents

Publication Publication Date Title
JP2591121B2 (en) Chord setting device and electronic wind instrument
JP4035715B2 (en) Accompaniment generation apparatus and accompaniment generation program
JP4225362B2 (en) Code determination apparatus and code determination processing program
JP2007140000A (en) Song grading device and program for processing song grading
JP5029770B2 (en) Performance support information generation apparatus and performance support information generation program
JP4816930B2 (en) Performance support information generation apparatus and performance support information generation program
JP4217978B2 (en) Code determination apparatus and code determination processing program
JP4998565B2 (en) Singing scoring device and singing scoring program
JP2531424B2 (en) Automatic accompaniment device
JP2640992B2 (en) Pronunciation instruction device and pronunciation instruction method for electronic musical instrument
JPH06149241A (en) Electronic musical instrument
JP4696808B2 (en) Temporary symbol display device and temporary symbol display program
JP4239937B2 (en) Composition support apparatus and program
JP2000259154A (en) Code judging device
JPH05204297A (en) Syllable name generator
JP3744667B2 (en) Automatic accompaniment device and automatic accompaniment method
JP2596303B2 (en) Electronic musical instrument
JP3543158B2 (en) Automatic accompaniment device
JP2722880B2 (en) Electronic musical instrument
JP5099146B2 (en) Singing scoring device and singing scoring program
JP4547719B2 (en) Music score display device and music score display program
JP2007316666A (en) Musical score display device and musical score display program
JP2012252073A (en) Musical tone data correcting device and program
JPH11194774A (en) Automatic playing device
JP2001209383A (en) Device and method for automatic accompaniment

Legal Events

Date Code Title Description
A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050218

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050218

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20070111

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070308

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070323

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20071016

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20101109

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20101109

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20111109

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20111109

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20121109

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20131109

Year of fee payment: 6

LAPS Cancellation because of no payment of annual fees