JP3626863B2 - Electronic musical instruments - Google Patents

Electronic musical instruments Download PDF

Info

Publication number
JP3626863B2
JP3626863B2 JP34556898A JP34556898A JP3626863B2 JP 3626863 B2 JP3626863 B2 JP 3626863B2 JP 34556898 A JP34556898 A JP 34556898A JP 34556898 A JP34556898 A JP 34556898A JP 3626863 B2 JP3626863 B2 JP 3626863B2
Authority
JP
Japan
Prior art keywords
key
state
detection means
detection
code
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
JP34556898A
Other languages
Japanese (ja)
Other versions
JP2000172268A (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.)
Kawai Musical Instrument Manufacturing Co Ltd
Original Assignee
Kawai Musical Instrument Manufacturing 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 Kawai Musical Instrument Manufacturing Co Ltd filed Critical Kawai Musical Instrument Manufacturing Co Ltd
Priority to JP34556898A priority Critical patent/JP3626863B2/en
Publication of JP2000172268A publication Critical patent/JP2000172268A/en
Application granted granted Critical
Publication of JP3626863B2 publication Critical patent/JP3626863B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Electrophonic Musical Instruments (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、押鍵状態にある鍵の組み合わせに基づいて、演奏者が意図するコードを検出して、そのコードに係る楽音を発生させるように構成された電子楽器に関する。
【0002】
【従来の技術】
従来から、例えば電子ピアノのように、押鍵速度に応じた強さで演奏音を発生させる電子楽器が知られている。この種の電子楽器は、通常、各鍵に対応する2つ1組のセンサを備えている。この2つのセンサは、押鍵速度に応じた時間差をおいて押鍵操作を検知するもので、電子楽器は、上記2つのセンサで検出した時間差に応じて、時間差が大きい場合には弱い音を発生させ、時間差が小さい場合には強い音を発生させるように構成されている。
【0003】
また、この種の電子楽器において、さらに、自動伴奏機能やAOC(Auto Orchestra Chord)機能を備えたものもある。これらの機能は、いずれも押鍵状態にある鍵に対応した音のみを単に発生させるのではなく、押鍵状態にある鍵の組み合わせに基づいて、演奏者が意図するコードを検出して、そのコードに係る楽音を様々な形態にアレンジして自動的に発生させる機能である。例えば、自動伴奏機能を利用する場合であれば、スイッチ操作等により事前に伴奏音の旋律等を指定しておけば、左手でコードの指定を行う程度のことしかできない初心者であっても、比較的手軽に複雑な伴奏を行うことができる。
【0004】
ところで、上記のような自動伴奏機能やAOC機能を備えている電子楽器において、演奏者は複数の鍵を同時に操作しているつもりではあるが、この操作を検出するセンサは、通常、ごく僅かな時間差をも検出できる能力を有するので、各鍵の操作タイミングは僅かにずれて検出されるケースがほとんどである。そのため、ある鍵に対応するセンサが押鍵操作を検知した時点で、直ちに演奏者が意図したコードを検出していたのでは、現実には、演奏者の意図するコードを検出したことにはならない可能性が高い。
【0005】
そこで、従来は、ある鍵に対応するセンサが押鍵を検知してから、所定の待機時間が経過するまで待機し、その待機時間中に新たに別の鍵に対応するセンサが押鍵を検知した場合には、これらの各鍵すべてが同時に押されたものとして扱い、上記待機時間経過後にコードの検出を行うようにしていた。
【0006】
【発明が解決しようとする課題】
しかし、上記のような待機時間を設けると、どうしても実際の押鍵操作開始時点から演奏音発生時点までに、相応のタイムラグが生じることになるため、その反応の鈍さに演奏者が違和感を覚えるという問題があった。特に、演奏開始時には、無音状態から発音状態に切り替わるため、何らかの演奏音が継続的に発生している演奏中に比べ、上記タイムラグが非常に気になるという問題があった。
【0007】
もちろん、上記待機時間を短くすれば、上記タイムラグは相応に短縮される。しかし、単にそのような対策をとるだけでは、結局、待機時間を設けない場合に生ずる問題、すなわち、演奏者の意図するコードとは異なるコードを検出してしまうという問題が発生することになるだけであり、有効な対策とはならなかった。
【0008】
本発明は、上記問題を解決するためになされたものであり、その目的は、押鍵状態にある鍵の組み合わせに基づいて、演奏者が意図するコードを検出して、そのコードに係る楽音を発生させる電子楽器において、操作開始時点から演奏音発生時点までのタイムラグを従来よりも短縮しながら、演奏者が意図するコードをより的確に検出可能とすることにある。
【0009】
【課題を解決するための手段、および発明の効果】
上述の目的を達成するためになされた本発明は、請求項1に記載の通り、
演奏者に操作されて押鍵状態または離鍵状態となる複数の鍵と、前記押鍵状態/離鍵状態のいずれか一方から他方への状態変化時に、前記鍵の動作速度に応じた時間差を検知可能であり、鍵の状態検知を保持する第1,第2検知手段と、前記押鍵状態にある鍵の組み合わせを検知して、対応するコードを検出するコード検出手段と、該コード検出手段により検出されたコードに係る楽音を発生させる楽音発生手段とを備えた電子楽器において、
前記押鍵状態にある鍵の組み合わせを検知する際の各鍵の押鍵状態の検知は、前記第1,第2検知手段の、検知順序において後で状態変化を検知した検知手段の検知時に、先に状態変化を検知した検知手段による状態の検知結果に基づいて為され、
該押鍵状態検知結果に基づいた鍵の組み合わせに対応するコードを検出する
ことを特徴とする。
【0010】
この電子楽器において、上記複数の鍵は、鍵盤楽器が備える演奏用の操作子である。最も一般的には、手で操作を行う白鍵および黒鍵からなるものを考え得るが、この他、足で操作する鍵(いわゆるペダルキー)や、白鍵および黒鍵という形態ではないものなどでもよい。
【0011】
また、上記第1,第2検知手段は、例えば、従来から電子ピアノ等において様々なものが採用されており、それらを任意に利用できる。具体的には、例えば、押圧されているか否かによりオン/オフの状態が切り替わる2つの接触型スイッチを、押鍵時に鍵によって時間差をおいて押圧される位置に配設してなるものを利用できる。あるいは、光路が遮られるか否かによりオン/オフの状態が切り替わる2つのフォトインタラプタと、鍵に取り付けられて押鍵/離鍵に伴って上記2つのフォトインタラプタの光路上に時間差をおいて出没する段付シャッタとで構成されたものなども利用できる。もちろん、これら以外の各種接触型センサないし非接触型センサを採用してもよい。これらのスイッチないしセンサは、押鍵時にオンで離鍵時にオフとなるものか、押鍵時にオフで離鍵時にオンとなるものであれば、どちらでもよい。また、常時はオフになっていて、押鍵状態/離鍵状態のいずれか一方から他方への状態変化が発生する瞬間にだけオンとなるもの(すなわち、パルス信号を発するようなもの)であってもよい。この場合は、例えば、パルス信号の発生に伴って割込処理を実行する等、適当な方法でパルス信号を監視すれば状態変化を検出できる。
【0012】
このような第1,第2検知手段は、上記のように鍵に直接取り付けられていてもよいが、これに限らず、鍵に連動して鍵の動きを間接的に把握できるような動作をする部材(以下、鍵連動部材という)に取り付けられていても構わない。このような鍵連動部材としては、例えば一部の電子ピアノにおいてタッチ感の改善のために採用されているような、ピアノの模擬アクション機構の構成部材(例えば、ハンマーに相当する部材など)を挙げることができる。この他、上記第1,第2検知手段を設けるために、専用の鍵連動部材を設けてもよい。
【0013】
また、上記コード検出手段は、押鍵状態にある鍵の組み合わせに対応するコードを検出する点は従来と同様であるが、この押鍵状態にある鍵の組み合わせを判別するに当たり、第1,第2検知手段が、一方の検知手段、他方の検知手段の順序で状態変化を検知する際、他方の検知手段によって状態変化を検知したら、一方の検知手段による状態変化の検知結果に基づいて、押鍵状態にある鍵の組み合わせを判別するという点に、従来とは異なる特徴がある。すなわち、押鍵状態にある鍵の組み合わせを検知する際の各鍵の押鍵状態の検知は、第1,第2検知手段の、検知順序において「後で状態変化を検知した検知手段」の検知時に、「先に状態変化を検知した検知手段」による状態の検知結果に基づいて為され、該押鍵状態検知結果に基づいた鍵の組み合わせに対応するコードを検出する点に特徴がある。
【0014】
このような手法で鍵の組み合わせを判別すれば、まず、他方の検知手段で状態変化が検知されたことを契機として押鍵状態にある鍵の組み合わせの判別(以下、単にコード検出という)を開始するので、一方の検知手段で状態変化が検知されたことを契機としてコード検出を開始するものに比べ、意図的に押鍵された時にコード検出を行う可能性が高くなる。
【0015】
しかも、他方の検知手段で状態変化が検知された場合に行うコード検出自体は、一方の検知手段による状態変化の検知結果に基づいて行われるので、他方の検知手段による状態変化の検知結果に基づいてコード検出を行うものに比べ、コード検出の開始時期を早めることができる。すなわち、他方の検知手段による最初の状態変化の検知直後は、他方の検知手段で検知した状態変化がまだ暫定的なものに過ぎず、さらに別の鍵について押鍵操作/離鍵操作がなされる可能性もある。そのため、他方の検知手段で確実なコード検出を行うのであれば、さらにいくらかの待機時間が経過するのを待たざるを得ない。しかし、本発明において、一方の検知手段は、他方の検知手段よりも先行して状態変化を検知し、他方の検知手段によって状態変化を検知した時点では、既にいくらか時間が経過している。したがって、一方の検知手段による状態変化の検知結果に基づいてコード検出を行えば、上記のような待機時間が経過するのを待たずに、あるいは、より短い待機時間の経過を待つだけで、他方の検知手段においても検知されることになる押鍵状態を検知できる。しかも、鍵に対する操作が迅速になされるほど、他方の検知手段による状態変化の検知タイミングも早まるので、操作速度とは無関係に、操作速度が遅い場合を想定して一律に設定された待機時間が経過するのを待つ場合に比べ、コード検出の開始時期は早くなる。これらの結果、本発明においては、従来よりもコード検出を速やかに完了することができるのである。
【0016】
このような手法で押鍵状態にある鍵の組み合わせが確定すれば、後は、従来と同様の手法でコードを検出すればよい。例えば、押鍵/離鍵を1/0に対応させたビットパターンデータで、押鍵状態にある鍵の組み合わせをメモリに記憶し、別途メモリに記憶されているコードとビットパターンデータとの対応表を参照して、押鍵により指定されたコードを検出するといったもの等を考え得る。
【0017】
さらに、上記楽音発生手段は、コード検出手段により検出されたコードに係る楽音を発生させるものである。但し、ここでいう楽音発生手段は、特に上記コードに係る楽音を発生させることのみに特化したものを専用に設ける必要はなく、通常の演奏音を発生させるために電子楽器が備えている楽音発生手段が、上記コードに係る楽音を発生させる際にも機能するように構成されていればよい。「検出されたコードに係る楽音」とは、単にそのコードを構成する複数の音高の楽音であってもよいし、あるいは、そのコードに応じた自動伴奏音、自動演奏音であってもよい。例えば、ロック、ワルツなどの伴奏パターンを、代表的なコード(例えば「C Major」等)で自動伴奏データとしてあらかじめ記憶しておき、この自動伴奏データに基づく伴奏音を、検出されたコードに移調して再生するようにすればよい。
【0018】
以上のように構成された電子楽器によれば、演奏者がいくつかの鍵を操作してコードを指定するだけで、そのコードに係る楽音が発生するので、例えば初心者であっても簡単な操作で複雑な伴奏音を発生させることができる。
また特に、押鍵状態にある鍵の組み合わせを検知する際の各鍵の押鍵状態の検知は、第1,第2検知手段の、検知順序において「後で状態変化を検知した検知手段」の検知時に、「先に状態変化を検知した検知手段」による状態の検知結果に基づいて為され、該押鍵状態検知結果に基づいた鍵の組み合わせに対応するコードを検出するので、一方の検知手段で状態変化を検知した時に一方の検知手段での検知結果からコード検出を行うものに比べ、演奏者の意図がより的確に反映された楽音を発生させることができる。また、他方の検知手段で状態変化を検知した時に他方の検知手段での検知結果からコード検出を行うものに比べ、より迅速に楽音を発生させることができる。さらに、一定の待機時間の経過を待ってからコード検出を行うものに比べ、押鍵操作/離鍵操作の開始時点から演奏音発生時点までのタイムラグは、素早い鍵操作がなされるほど短縮されるので、演奏者にとって違和感がない。
【0019】
したがって、この電子楽器によれば、押鍵操作/離鍵操作後の反応がよくなり、演奏者が、演奏音発生の遅れに違和感を覚えることはない。また、演奏者の意図しないコードに係る楽音が発生してしまう確率は低くなり、演奏者が気持ちよく思い通りの演奏を行うことができる。
【0020】
なお、上記本発明の構成は、押鍵操作時/離鍵操作時のいずれか一方について採用してもよく、両方について採用してもよい。
より具体的には、押鍵操作時について上記構成を採用した電子楽器は、請求項2に記載の通り、
前記第1,第2検知手段が、第1検知手段、第2検知手段の順序で、離鍵状態から押鍵状態への状態変化を検知する際、前記コード検出手段が、前記第2検知手段によって前記状態変化を検知したら、前記第1検知手段による前記状態変化の検知結果に基づいて、前記押鍵状態にある鍵の組み合わせに対応するコードを検出する
ことを特徴とするものとなる。
【0021】
この電子楽器によれば、特に、押鍵操作を伴って演奏者の指定するコードが変化した場合に良好な反応を示すので、演奏開始時はもちろんのこと、コードの変更時に新たな鍵が押される場合には、所期の効果が発揮される。
また、離鍵操作時について上記構成を採用した電子楽器は、請求項3に記載の通り、
前記第1,第2検知手段が、第2検知手段、第1検知手段の順序で、押鍵状態から離鍵状態への状態変化を検知する際、前記コード検出手段が、前記第1検知手段によって前記状態変化を検知したら、前記第2検知手段による前記状態変化の検知結果に基づいて、前記押鍵状態にある鍵の組み合わせに対応するコードを検出する
ことを特徴とするものとなる。
【0022】
この電子楽器によれば、特に、離鍵操作を伴って演奏者の指定するコードが変化した場合に良好な反応を示すので、既にいくつかの鍵が押されて何らかのコードが指定されている状態において、いくつかの押鍵状態にある鍵が離鍵状態とされることでコードが変更される場合に、所期の効果が発揮される。
【0023】
ところで、上述した本発明の電子楽器の場合、押鍵操作/離鍵操作の開始時点から演奏音発生時点までのタイムラグは、素早い鍵操作がなされるほど短縮される。それ故、特に、素早い鍵操作が多い場合、無音状態から発音状態に変わる場合(例えば、演奏開始時など)、他の演奏音(例えば、主旋律となる演奏音)との同期をとって伴奏を開始したい場合などに、その効果は絶大である。
【0024】
しかし、ゆっくりとした鍵操作しか行われない場合、発音状態が継続したままコードが変わる場合、伴奏をあらかじめ開始させておいて後から他の演奏音を加える場合などは、上記タイムラグがあまり気にならないこともある。その場合、多少のタイムラグを許容することで、より確実なコード検出を行うことができるのであれば、それなりに利点があると考えられる。
【0025】
そこで、請求項4または請求項5に記載の電子楽器では、次のような構成を採用した。
すなわち、請求項4に記載の電子楽器は、
前記第1,第2検知手段が、一方の検知手段、他方の検知手段の順序で前記状態変化を検知した際、当該状態変化前に押鍵状態にある鍵が存在していた場合には、前記コード検出手段が、前記他方の検知手段によって前記状態変化を検知したら、前記他方の検知手段による前記状態変化の検知結果に基づいて、前記押鍵状態にある鍵の組み合わせに対応するコードを検出する
ことを特徴とする。
【0026】
このように構成された電子楽器は、他方の検知手段による状態変化の検知前後で、押鍵状態にある鍵の数が、0から1以上に変化した場合に限り、先行して状態変化を検知する一方の検知手段での検知結果に基づいてコード検出を行う。一方、それ以外の場合には、後から状態変化を検知する他方の検知手段での検知結果に基づいてコード検出を行う。
【0027】
このような電子楽器であれば、例えば演奏開始時、演奏休止後の演奏再開時のように、押鍵状態にある鍵が存在しない状態から最初の押鍵操作がなされる際には、従来よりも迅速にコードが検出されるので、タイムラグを伴わずにコードに係る楽音が発生する。しかも、演奏が開始された後、演奏音が継続したままコードが変わってゆくような場合には、誤操作等が一方の検知手段に検知されたとしても、他方の検知手段に検知されない程度の操作であれば、偶然にコード検出のタイミングが重なっていたとしても、そのような誤操作がコード検出に悪影響を及ぼすことはない。
【0028】
したがって、この電子楽器によれば、演奏開始時については発音のレスポンスが改善され、しかも、演奏開始後については演奏者の意図したコードに係る楽音が発生する可能性がより一層高くなる、という効果がある。
また、請求項5に記載の電子楽器は、
さらに、押鍵操作の開始と同時に前記楽音発生手段による楽音の発生を開始するシンクロスタートモードで演奏するか否かを設定可能なモード設定手段を備え、
前記第1,第2検知手段が、一方の検知手段、他方の検知手段の順序で前記状態変化を検知した際、前記モード設定手段によってシンクロスタートモードで演奏する旨の設定がなされていない場合には、前記コード検出手段が、前記他方の検知手段によって前記状態変化を検知したら、前記他方の検知手段による前記状態変化の検知結果に基づいて、前記押鍵状態にある鍵の組み合わせに対応するコードを検出する
ことを特徴とする。
【0029】
このように構成された電子楽器は、モード設定手段によってシンクロスタートモードで演奏する旨の設定がなされていた場合に限り、先行して状態変化を検知する一方の検知手段での検知結果に基づいてコード検出を行う。一方、それ以外の場合には、後から状態変化を検知する他方の検知手段での検知結果に基づいてコード検出を行う。
【0030】
このような電子楽器であれば、シンクロスタートモードで演奏する場合のように、演奏開始時における発音の同期が特に気になる状況下では、従来よりも迅速にコードが検出されるので、タイムラグを伴わずにコードに係る楽音が発生するので、演奏者にとって違和感がない、という効果がある。
【0031】
なお、シンクロスタートモードで演奏しない場合は、多少タイムラグは大きくなるが、誤操作等が一方の検知手段に検知されたとしても、他方の検知手段に検知されない程度の操作であれば、偶然にコード検出のタイミングが重なっていたとしても、そのような誤操作がコード検出に悪影響を及ぼすことはないので、演奏者の意図したコードに係る楽音が発生する可能性がより一層高くなる、という効果がある。
【0032】
【発明の実施の形態】
次に、本発明の実施形態について一例を挙げて説明する。
図1は、本発明の一実施形態である電子楽器の電気的構成を示すブロック図である。
【0033】
図1に示すように、この電子楽器は、CPU2、ROM4、RAM6、オートカウンタ8、パネル10、キーボード12、楽音発生回路14、サウンドシステム16、およびこれら各部を結ぶバス21等から構成されている。
パネル10には、液晶表示板、LED等の表示装置、本電子楽器に各種の情報、指令を入力するための操作子等が設けられている。この操作子としては、例えば、本電子楽器をAOCモードにするAOCスイッチ、AUTOモード(自動伴奏モード)にするAUTOスイッチ、本電子楽器がAUTOモードとされたときに自動伴奏を開始/停止させるSTART/STOPスイッチ、押鍵操作と同時に自動伴奏を開始するモード(シンクロスタートモード)にするSYNCスイッチ等が設けられている。
【0034】
キーボード12は、複数の鍵(本実施形態では88鍵)を備えている。複数の鍵にはそれぞれ番号(キーコード)が付与されていて、ある鍵を押下した場合、その鍵に対応するキーコードがCPU2等に転送され、そのキーコードに対応する音高の楽音を発生させる処理が行われる。また、各鍵に対応して、その鍵の押鍵/離鍵を検出するための鍵スイッチが設けられている。この鍵スイッチは、2つの接点(第1接点、第2接点)を備えている。これら2つの接点は、押鍵操作時に第1接点、第2接点の順序でオンになり、一方、離鍵操作時に第2接点、第1接点の順序でオフとなるように配置されている。これら2つの接点がオンまたはオフにされた旨の情報は、キーボード12の内部に設けられたスキャン回路(図示略)によって検出される。このスキャン回路は、各鍵スイッチを一定時間毎に走査して、押鍵/離鍵操作がなされた鍵のキーコードおよび接点のオン/オフに関する情報を検出するものであり、スキャン回路によって検出された情報は、キーイベント情報としてCPU2に転送される。なお、上記2つの接点が本発明の第1,第2検知手段に相当する。
【0035】
楽音発生回路14は、時分割多重処理によって、複数チャネル(本実施形態では32チャネル)の独立したデジタル楽音信号を発生させるものである。この楽音発生回路14には、アサイメントメモリ14aが内蔵されており、アサイメントメモリ14aには、デジタル楽音信号を各チャネルから発音する際に必要となる各種データ(キーコード、音色データ等)が、各チャネル毎に格納されている。楽音発生回路14がデジタル楽音信号を発生させる際には、アサイメントメモリ14aにセットされた各種データに基づいてデジタル楽音信号を生成する。なお、楽音発生回路14は、本発明の楽音発生手段を構成するものである。
【0036】
サウンドシステム16は、D/A変換器、アンプ、およびスピーカ等から構成される。楽音発生回路14から出力されるデジタル楽音信号は、サウンドシステム16のD/A変換器によってアナログ楽音信号に変換され、そのアナログ楽音信号がアンプによって増幅され、スピーカから放音される。なお、サウンドシステム16も、本発明の楽音発生手段を構成するものである。
【0037】
オートカウンタ8は、押鍵の強さを検出するためのカウンタである。複数の鍵の内の1つが押下された場合、その鍵に設けられた鍵スイッチの第1接点がオンにされると、オートカウンタ8が、クリアされて新たなカウント(計数)を開始する。そのため、その鍵の第2接点がオンにされた時点におけるオートカウンタ8の値は、第1接点がオンにされてから第2接点がオンにされるまでの経過時間(すなわち、第1接点と第2接点とのオンタイミングの時間差)を示すことになる。したがって、この時間差が小さいほど押鍵速度が速い、すなわち、強い押鍵がなされたことになるので、これに基づいてタッチデータ(押鍵の強さを示すデータ)を作成することができる。
【0038】
CPU2は、ROM4に格納されたプログラムに従って各種処理を実行する周知のものである。CPU2が実行する代表的な処理としては、例えば、パネル10上の各種スイッチの操作に伴う各種の情報を読み取る処理、キーボードスキャン回路にキーボード12のスキャンを行わせ、キーイベント情報を読み取る処理、楽音発生回路14においてデジタル楽音信号を発生させるのに使用する楽音発生チャネル(チャネル)を割り当ててチャネルに対する発音制御を行う処理などがあり、これらの各処理をこの順序で実行することによって楽音を発生させている。また、CPU2にはタイマ2aが内蔵されており、CPU2は一定時間が経過するたびに、後述するタイマ割込処理等を行うように構成されている。
【0039】
ROM4は、各種プログラムおよびデータを記憶したもので、楽音発生のためのプログラム、自動伴奏データ、後述する和音表などは、ROM4に格納されている。
また、RAM6は、CPU2が各種データ処理を行う際にデータを一時的に格納するためのもので、キースキャン回路によりスキャンされた各鍵の第1接点、第2接点のオン/オフ状態をそれぞれ記憶する領域(後述するSW1ビットマップSW1BMP、SW2ビットマップSW2BMP等)、レジスタ(後述するコードタイプレジスタCDTYPE、コードルートレジスタCDROOT等)、バッファ、カウンタ(後述する第1接点カウンタLS1C等)、フラグ(後述するAOCフラグ、AUTOフラグ、S/Sフラグ、SYNCフラグ等)等の各種記憶領域が確保されている。
【0040】
RAM6に確保される記憶領域の内、コードタイプレジスタCDTYPEは、検出したコード(和音)の型を示す番号を格納するためのレジスタである。コードには、周知のように、“Major”、“m(minor)”、“7(7th)”など、いくつもの型があるが、本電子楽器では、各型に対してこれらの型を一意に特定できるような番号(例えば、「00h」、「01h」、「02h」、…など;但し、「h」は16進数表記であることを示す。以下同じ。)があらかじめ付与されている。後述する処理の中で、押鍵操作がなされている鍵の組み合わせに基づいてコードを検出した際には、その検出したコードの型に対応する番号が、上記コードタイプレジスタCDTYPEに格納される。なお、検出したコードの型が不定である(対応するものがない)場合、あるいは、コード未検出となっている場合には、その旨を示す番号(例えば「FFh」)がコードタイプレジスタCDTYPEにセットされる。
【0041】
コードルートレジスタCDROOTは、検出したコードの根音を示す番号を格納するためのレジスタである。コードの根音には、“C”、“C#”、“D”、…、“A#”、“B”の12種があり、本電子楽器では、各根音に対してこれらの根音を一意に特定できるような番号(例えば、「00h」、「01h」、…、「0Ch」など)があらかじめ付与されている。後述する処理の中で、押鍵操作がなされている鍵の組み合わせに基づいてコードを検出した際には、その検出したコードの根音に対応する番号が、上記コードルートレジスタCDROOTに格納される。なお、検出したコードの根音が不定である(対応するものがない)場合、あるいは、コード未検出となっている場合には、その旨を示す番号(例えば「FFh」)がコードルートレジスタCDROOTにセットされる。
【0042】
SW1ビットマップSW1BMPは、コード検出の対象となる鍵の第1接点がオンの時に「1」、オフの時に「0」とされる12ビットのビットマップデータ領域で、各ビットには、1オクターブの範囲内に含まれる“C”、“C#”、“D”、…、“A#”、“B”の12鍵のそれぞれが対応づけられている。上記コード検出の対象となる鍵は、通常、複数オクターブの鍵域にわたって存在するので、1オクターブ毎に同じ階名に対応する鍵が存在するが、それら同じ階名に対応する複数の鍵は、すべて同一ビットに対応づけられている。具体的には、それら同じ階名に対応する複数の鍵の内、少なくとも1鍵がオンとなっていれば、対応するビットは「1」とされ、すべての鍵がオフとなっている場合に限り、対応するビットが「0」とされる。SW2ビットマップSW2BMPは、SW1ビットマップSW1BMPと同様な12ビットのビットマップデータ領域で、コード検出の対象となる鍵の第2接点がオンの時に「1」、オフの時に「0」とされる点だけが、SW1ビットマップSW1BMPとは相違する。
【0043】
タイマレジスタTIMERは、押鍵後、コード検出を行うのを待機する押鍵待機時間ΔTon、あるいは、離鍵後、コード検出を行うのを待機する離鍵待機時間ΔToffを計時するために使用されるレジスタである。
第1接点カウンタLS1Cは、後述するように、ロアーキーの第1接点LwSW1の内、オン状態にあるものの数を計数するためのレジスタである。
【0044】
AOCフラグは、本電子楽器がAOC機能を作動させる動作モード(AOCモード)である場合に「1」、それ以外の場合に「0」となるフラグである。AUTOフラグは、本電子楽器が自動伴奏機能を作動させる動作モード(AUTOモード)にある場合に「1」、それ以外の場合に「0」となるフラグである。S/Sフラグは、自動伴奏を開始・停止を決定するためのフラグであり、「1」である時は、自動伴奏の内の少なくともリズム伴奏が行われ、「0」である時は、リズム伴奏を含めすべての自動伴奏を停止される。SYNCフラグは、押鍵操作と同時に自動伴奏を開始するシンクロスタートモードが選択された場合に「1」、それ以外の場合に「0」となるフラグである。
【0045】
次に、以上のように構成された電子楽器においてCPU2が実行する処理を、図3〜図5に基づいて説明する。この電子楽器の電源が投入されると、CPU2は、図3に示すメインルーチンに従った処理を実行する。
メインルーチンの実行を開始すると、CPU2は、まず、初期化処理を行う(S10)。より具体的には、初期化処理として、RAM6や楽音発生回路14のアサイメントメモリ14aをクリアする処理、コードタイプレジスタCDTYPEおよびコードルートレジスタCDROOTに「FFh」(この場合は、未検出という意味になる)を格納する処理、タイマレジスタTIMERをリセット(「0」をセット)する処理、AOCフラグ、AUTOフラグ、S/Sフラグ、SYNCフラグ等の各種フラグをリセット(「0」をセット)する処理などを実行する。
【0046】
続いて、CPU2は、パネル処理を行う(S15)。具体的には、まず、パネル10をスキャンすることにより、各スイッチのオン/オフ操作(オンイベント/オフイベント)を検出し、その検出結果に応じて各種フラグの設定値等を変更する。例えば、AUTOスイッチのオンイベントを検出した場合には、AUTOフラグに「1」をセットし、AOCスイッチのオンイベントを検出した場合には、AOCフラグに「1」をセットする。また、S/Sスイッチのオンイベントを検出した場合には、S/Sフラグに「1」をセットし、SYNCスイッチのオンイベントを検出した場合には、SYNCフラグに「1」をセットする。
【0047】
次に、CPU2は、通常演奏処理を行う(S20)。通常演奏処理は、スプリットポイントより高音側での押鍵/離鍵操作に対する発音/消音を行う処理である。ここで、スプリットポイントとは、キーボード12の鍵域を高音側および低音側の2領域に分割する境界のことであり、本電子楽器では、キーボード12上にキーによってスプリットポイントを事前に設定しておくことができる。すなわち、本電子楽器では、スプリットポイントを設定するモードで、キーボード12上にある1つのキーを選定すると、選定されたキーを含めてそのキーよりも低温側にあるキー群(以下、ロアーキーという)と、上記選定されたキーよりも高音側にあるキー群(以下、アッパーキーという)の2領域が設定される。スプリットポイントの設定後は、演奏処理の内容により、上記2領域のどちらを処理対象とするかが変わる。上記S20の通常演奏処理は、上記2領域の内、アッパーキー側での押鍵/離鍵操作を対象とする処理となる。
【0048】
この通常演奏処理は、詳しくは図3に示すような処理である。通常演奏処理を開始すると、CPU2は、図3に示すように、まず、複数あるアッパーキーの第1接点UpSW1のいずれかにおいてオンイベントが発生したかどうかを判断する(S110)。ここで、オンイベントの発生した第1接点UpSW1があれば(S110:YES)、その鍵に対してオートカウンタ8の1つを割り当てて(S120)、通常演奏処理を終了する。S120の処理において、特定の鍵に割り当てられたオートカウンタ8は、初期化された上でカウントを開始し、そのカウンタ値が時間経過とともに増えてゆく。
【0049】
一方、上記S110の処理時点で、オンイベントの発生した第1接点UpSW1がなければ(S110:NO)、複数あるアッパーキーの第2接点UpSW2のいずれかにおいてオンイベントが発生したかどうかを判断する(S130)。ここで、オンイベントの発生した第2接点UpSW2があれば(S130:YES)、タッチデータを作成する(S140)。このタッチデータは、オンイベントが発生した第2接点UpSW2と対を成す第1接点UpSW1がオンとなった時にカウントを開始したオートカウンタ8の値に基づいて作成される。
【0050】
続いて、CPU2は、発音処理を行う(S150)。この発音処理は、押下された鍵のキーコードおよびタッチデータに基づいて楽音発生回路14を制御して、サウンドシステム16から楽音を発生させる処理である。なお、発音処理を終えたら、通常演奏処理を終了する。
【0051】
一方、上記S130の処理時点で、オンイベントの発生した第2接点UpSW2がなければ(S130:NO)、複数あるアッパーキーの第1接点UpSW1のいずれかにおいてオフイベントが発生したかどうかを判断する(S160)。ここで、オフイベントの発生した第1接点UpSW1がなければ(S160:NO)、通常演奏処理を終了する。一方、このS160の処理時点で、オフイベントの発生した第1接点UpSW1があれば(S160:YES)、消音処理を行う(S170)。この消音処理は、オフイベントの発生した第1接点UpSW1を有する鍵に対応する楽音信号が、楽音発生チャネルから発生するのを停止させる処理であり、CPU2は、楽音信号の発生を停止させる旨の情報を楽音発生回路14に転送する。なお、消音処理を終えたら、通常演奏処理を終了する。
【0052】
このようにして図3に示した通常演奏処理を終えると、図2におけるS20の処理を終えたことになり、引き続いて、CPU2は、AOCフラグが「1」であるか否かを調べる(S25)。AOCフラグ=「1」であると判断した場合には(S25:YES)、第1和音演奏処理を行う。
【0053】
この第1和音演奏処理は、AOC機能を実現するための処理であり、詳しくは図4に示すような処理となる。
図4に示す第1和音演奏処理を開始すると、CPU2は、まず、複数あるロアーキーの第1接点LwSW1のいずれかにおいてオンイベントが発生したかどうかを判断する(S210)。ここで、オンイベントの発生した第1接点LwSW1があれば(S210:YES)、第1接点カウンタLS1Cの値を「1」増加させて(S212)、第1接点カウンタLS1Cが「4」以上であるかどうかを判断する(S214)。このとき、第1接点カウンタLS1Cが「4」以上であれば(S214:YES)、タイマレジスタTIMERに所定の値(例えば「1」)をセットする(S216)。ここでタイマレジスタTIMERに設定される値は、押鍵待機時間ΔTonを計時するための初期値である。
【0054】
一方、S214の処理において、第1接点カウンタLS1Cが「4」より小さいと判断されれば(S214:NO)、タイマレジスタTIMERに「ONDLY」を設定する(S218)。この「ONDLY」も、押鍵待機時間ΔTonを計時するためにタイマレジスタTIMERに設定される初期値であり、本実施形態では「ONDLY」=「6」としている。
【0055】
こうして、S216またはS218のいずれかの処理を終えると、CPU2は、オンイベントの発生した第1接点LwSW1を有する鍵に対し、オートカウンタ8の1つを割り当てて(S220)、第1和音演奏処理を終了する。S220の処理において、特定の鍵に割り当てられたオートカウンタ8は、初期化された上でカウントを開始し、そのカウンタ値が時間経過とともに増えてゆく。
【0056】
さて、上記S210の処理時点で、オンイベントの発生した第1接点LwSW1がなければ(S210:NO)、複数あるロアーキーの第2接点LwSW2のいずれかにおいてオンイベントが発生したかどうかを判断する(S222)。ここで、オンイベントの発生した第2接点LwSW2があれば(S222:YES)、タッチデータを作成する(S224)。このタッチデータは、上記S140の処理と同様、オートカウンタ8の値に基づいて作成される。
【0057】
続いて、最初の第2接点LwSW2のオンイベントであるかどうかを判断する(S226)。これは、今回オンイベントがあった第2接点LwSW2の他に、オンにされた状態の第2接点LwSW2があるか否かを調べることによって判断できる。ここで、最初の第2接点LwSW2のオンイベントでなければ(S226:NO)、第1和音演奏処理を速やかに終了する。
一方、最初の第2接点LwSW2のオンイベントであれば(S226:YES)、コードタイプレジスタCDTYPEの値が「FFh」であるか否かを調べる(S228)。ここで、コードタイプレジスタCDTYPEの値が「FFh」でなければ(S228:NO)、そのままS232の処理へと進む。その一方、コードタイプレジスタCDTYPEの値が「FFh」であれば(S228:YES)、コードタイプレジスタCDTYPEの値が「不定」または「未検出」なので、SW1ビットマップSW1BMPに基づいて、新たにコードタイプレジスタCDTYPEおよびコードルートレジスタCDROOTに格納すべき値を決定する(S230)。このS230の処理の結果、押鍵待機時間ΔTonの経過を待つことなく、速やかにコードタイプレジスタCDTYPEおよびコードルートレジスタCDROOTの値が確定することになる。このS230の処理は、第2接点LwSW2(第2検知手段)によって状態変化を検知したら、第1接点LwSW1(第1検知手段)による状態変化の検知結果に基づいて、押鍵状態にある鍵の組み合わせに対応するコードを検出する処理であり、本発明の主要部に該当する処理である。
【0058】
そして、S230の処理を終えたら、タイマレジスタTIMERに「0」を設定し(S231)、コードタイプレジスタCDTYPEおよびコードルートレジスタCDROOTに格納された値に基づいて、新規和音を作成する(S232)。より詳しく説明すると、本電子楽器には、図7に示すような和音表が記憶されている。この和音表は、特定の根音(例えば“C”)に対応する和音の構成要素を示すキーコードを、コードタイプレジスタCDTYPEに格納されるコードタイプ別に記憶させた対応表である。
【0059】
CPU2は、まず、この和音表からコードタイプレジスタCDTYPEに格納されたコードタイプを探索する。そして、コードタイプが和音表内から見つかれば、そのコードタイプに対応するキーコードを読み出して和音の構成要素を特定する。そして、その特定された和音の構成要素を、コードルートレジスタCDROOTに格納された値に基づいて移調させることにより、新規和音を構成するキーコードを導出する。
【0060】
例えば、コードタイプレジスタCDTYPEの値が「01h」であり、かつコードルートレジスタCDROOTの値が「04h」である場合を例にとって、新規和音を構成するキーコードの導出手順について説明すると、次の通りである。
まずコードタイプレジスタCDTYPEの値(ここでは「01h」)に基づいて和音表を参照し、そのコードタイプに対応するキーコードとして、「00h」、「03h」、「07h」を読み出す。ここで、キーコードとして「FFh」が格納されている場合、そのキーコードは使用しない。そして、和音表から読み出されたいくつかのキーコード(ここでは3つ)に対し、コードルートレジスタCDROOTの値を加算して当該キーコードを移調させることにより、新規和音を構成するキーコード「04h」、「07h」、「0Bh」を導出する。
【0061】
こうしてS232の処理を終えたら、続いて、CPU2は、サウンドシステム16に新規和音を発音させて(S234)、第1和音演奏処理を終了する。なお、S234の処理において、新規和音を発音させる際には、S224にて作成されたロアーキーに対する最新のタッチデータに基づいて楽音発生回路14を制御する。
【0062】
さて一方、上記S222の処理時点で、オンイベントの発生した第2接点LwSW2がなければ(S222:NO)、複数あるロアーキーの第2接点LwSW2のいずれかにおいてオフイベントが発生したかどうかを判断する(S236)。ここで、オフイベントの発生した第2接点LwSW2があれば(S236:YES)、タイマレジスタTIMERに「OFFDLY」を設定した後(S238)、第1和音演奏処理を終了する。この「OFFDLY」は、離鍵待機時間ΔToffを計時するためにタイマレジスタTIMERに格納される値であり、本実施形態では「OFFDLY」=「10」としている。
【0063】
一方、S236の処理時点で、オフイベントの発生した第2接点LwSW2がなければ(S236:NO)、複数あるロアーキーの第1接点LwSW1のいずれかにおいてオフイベントが発生したかどうかを判断する(S240)。ここで、オフイベントの発生した第1接点LwSW1がなければ(S240:NO)、直ちに第1和音演奏処理を終了する。一方、オフイベントの発生した第1接点LwSW1があれば(S240:YES)、第1接点カウンタLS1Cを「1」減らした後(S242)、第1和音演奏処理を終了する。
【0064】
このようにして図4に示した第1和音演奏処理を終えると、図2におけるS30の処理を終えたことになり、この後は、再びS15の処理へと戻って本処理を繰り返すことになる。
さて一方、上記S25の処理において、AOCフラグが「1」でないと判断した場合は(S25:NO)、AUTOフラグが「1」であるか否かを調べる(S35)。ここで、AUTOフラグが「1」でないと判断した場合は(S35:NO)、そのまま再びS15の処理へと戻って本処理を繰り返すことになるが、AUTOフラグ=「1」であると判断した場合は(S35:YES)、第2和音演奏処理を行う。
【0065】
この第2和音演奏処理は、自動伴奏機能を実現するための処理であり、詳しくは図5に示すような処理となる。
図5に示す第2和音演奏処理を開始すると、CPU2は、まず、複数あるロアーキーの第1接点LwSW1のいずれかにおいてオンイベントが発生したかどうかを判断する(S250)。ここで、オンイベントの発生した第1接点LwSW1があれば(S250:YES)、S253〜S260の処理を行う。これらS253〜S260の処理は、図4におけるS212〜S220の処理と同様の処理なので詳細な説明については省略する。S260の処理を終了したら、後述するS280の処理へと進む。
【0066】
一方、上記S250の処理時点で、オンイベントの発生した第1接点LwSW1がなければ(S250:NO)、複数あるロアーキーの第2接点LwSW2のいずれかにおいてオンイベントが発生したかどうかを判断する(S262)。ここで、オンイベントの発生した第2接点LwSW2があれば(S262:YES)、タッチデータを作成する(S264)。このタッチデータは、オンイベントが発生した第2接点LwSW2と対を成す第1接点LwSW1がオンとなった時にカウントを開始したオートカウンタ8の値に基づいて作成される。
【0067】
続いて、最初の第2接点LwSW2のオンイベントであるかどうかを判断する(S265)。判断手法は、上記S226と同様である。ここで、最初の第2接点LwSW2のオンイベントでなければ(S265:NO)、後述するS280の処理へ直ちに進む。
【0068】
一方、最初の第2接点LwSW2のオンイベントであれば(S265:YES)、コードタイプレジスタCDTYPEの値が「FFh」であるか否かを調べる(S266)。ここで、コードタイプレジスタCDTYPEの値が「FFh」でなければ(S266:NO)、そのままS269の処理へと進む。その一方、コードタイプレジスタCDTYPEの値が「FFh」であれば(S266:YES)、SW1ビットマップSW1BMPに基づいて、新たにコードタイプレジスタCDTYPEおよびコードルートレジスタCDROOTに格納すべき値を決定する(S267)。このS267の処理の結果、押鍵待機時間ΔTonの経過を待つことなく、速やかにコードタイプレジスタCDTYPEおよびコードルートレジスタCDROOTの値が確定することになる。このS267の処理も、先に説明したS230の処理と同様に、第2接点LwSW2(第2検知手段)によって状態変化を検知したら、第1接点LwSW1(第1検知手段)による状態変化の検知結果に基づいて、押鍵状態にある鍵の組み合わせに対応するコードを検出する処理であり、本発明の主要部に該当する処理である。
【0069】
そして、S267の処理を終えたら、タイマレジスタTIMERに「0」を設定し(S268)、AUTOフラグが「1」であるかどうかを調べる(S269)。ここで、AUTOフラグが「1」であれば(S269:YES)、S/Sフラグに「1」をセットして(S270)、その後で後述するS280の処理へと進み、一方、AUTOフラグが「1」でなければ(S269:NO)、後述するS280の処理へ直ちに進む。
【0070】
さて一方、S262の処理時点で、ロアーキーの第2接点LwSW2のいずれのオンイベントも発生しなかったと判断した場合は(S262:NO)、S272〜S278の処理を行う。S272〜S278の処理は、図4におけるS236〜S242の処理と同様の処理なので詳細な説明は省略する。S236〜S242の処理中にあるS274またはS278の処理を終了した後は、後述するS280の処理へと進む。
【0071】
さて、以上説明したS250〜S278に含まれる処理を終えると、続いて、CPU2は、AUTOフラグ=「1」かつS/Sフラグ=「1」であるか否かを判断する(S280)。ここで、AUTOフラグおよびS/Sフラグの内、少なくとも一方が「1」でなければ(S280:NO)、速やかに第2和音処理を終了する。一方、AUTOフラグ=「1」かつS/Sフラグ=「1」であれば(S280:YES)、コードタイプレジスタCDTYPE=「FFh」であるかどうかを判断する(S282)。ここで、コードタイプレジスタCDTYPE=「FFh」であれば(S282:YES)、速やかに第2和音演奏処理を終了する。一方、コードタイプレジスタCDTYPE=「FFh」でなければ(S282:NO)、コードタイプレジスタCDTYPEの値、およびコードルートレジスタCDROOTの値に基づいた自動伴奏処理を行う(S286)。なお、このS286の自動伴奏処理は、本発明でいうコードに係る楽音を発生する処理である。
【0072】
さて、この自動伴奏処理は、詳しくは図6に示すような処理である。自動伴奏処理を開始すると、CPU2は、図6に示すように、まず、自動伴奏データの読み込みを行う(S310)。ROM4には複数種の自動伴奏データが記憶されているが、その中の1つのデータがS310の処理において読み込まれる。続いて、発音タイミングであるか否かを調べる(S312)。これは、図示しないタイムカウンタでカウントアップされているタイム値と、S310で取り出した自動伴奏データに含まれるステップタイムとを比較することにより行われる。なお、タイムカウンタは、AUTOフラグ=「1」かつS/Sフラグ=「1」となるとタイム値のカウントを開始するように構成されている。
【0073】
ここで、発音タイミングでないと判断した場合には(S312:NO)、S318の処理へと進み、一方、発音タイミングであると判断した場合には(S312:YES)、コード展開処理を行う(S314)。コード展開処理は、予めコードパターンとして例えばROM4に記憶されているデータを、自動伴奏データに含まれるキーコード、コードタイプレジスタCDTYPEの値、コードルートレジスタCDROOTの値に基づいて変更を加える処理である。このコード展開処理により、伴奏音として発音すべき楽音が決定される。なお、この種のコード展開処理は、周知技術であり、例えば特開平4−30197号公報に示されているので、ここでは詳細な説明を省略する。
【0074】
さて、コード展開処理により発音すべき伴奏音を決定したら、その伴奏音のデータを楽音発生回路14に送出して、伴奏音の発音処理を行う(S316)。これにより、音源18で楽音信号が生成され、サウンドシステム16を介して伴奏音が発生されることになる。
【0075】
続いて、消音タイミングであるか否かを判断する(S318)。具体的には、発音中の楽音の発音時間が、当該発音を指示した自動伴奏データ中のゲートタイムで指示された時間を過ぎたかどうかを調べる。ここで、消音タイミングでないと判断した場合には(S318:NO)、速やかに自動伴奏処理を終了する。一方、消音タイミングであると判断した場合には(S318:YES)、消音タイミングに達した楽音の消音処理を行う(S320)。これは、その楽音を消音すべき旨の情報を楽音発生回路14に送出することによって行われる。その結果、楽音発生回路14では、消音すべき楽音に対応するアサイメントメモリ14aがクリアされ、その楽音(すなわち伴奏音)の発生が停止される。なお、消音処理を終えたら、自動伴奏処理を終了する。
【0076】
このようにして図6に示した自動伴奏処理を終えると、図5におけるS286の処理を終えたことになり、図5に示した第2和音演奏処理を終了する。そして、この第2和音演奏処理を終えると、図2におけるS40の処理を終えたことになり、この後は、再びS15の処理へと戻って本処理を繰り返すことになる。
【0077】
次に、一定時間毎に実行される第1タイマ割込処理、第2タイマ割込処理について説明する。これらの割込処理は、タイマ2aにより一定時間(本実施形態では1msec)毎に割込信号が発生されると、CPU2によって実行される処理である。第1タイマ割込処理は、AOCフラグ=「1」の場合に、タイマ2aから割込信号が入力されると起動される処理であり、第2タイマ割込処理は、AOCフラグ≠「1」かつAUTOフラグ=「1」の場合に、タイマ2aから割込信号が入力されると起動される処理である。
【0078】
まず、第1タイマ割込処理について説明する。
第1タイマ割込処理を開始すると、CPU2は、まず、タイマレジスタTIMERが「0」であるかどうかを判断し(S405)、タイマレジスタTIMERが「0」であれば(S405:YES)、直ちに第1タイマ割込処理を終了する。一方、タイマレジスタTIMERが「0」でなければ(S405:NO)、タイマレジスタTIMERの値を「1」減らし(S410)、その結果、タイマレジスタTIMERの値が「0」となったか否かを判断する(S420)。なお、タイマレジスタTIMERの値が「0」とは、コード検出を行うべきタイミングであることを意味している。
【0079】
タイマレジスタTIMERの値が「0」でなければ(S420:NO)、直ちに第1タイマ割込処理を終了する。一方、タイマレジスタTIMERの値が「0」であれば(S420:YES)、複数あるロアーキーの第1接点LwSW1が、すべてオフ状態であるかどうかを判断する(S430)。
【0080】
ここで、複数あるロアーキーの第1接点LwSW1の内、いずれかがオンであれば(S430:NO)、第1接点LwSW1がオン状態である鍵について、その鍵のキーコードに基づいてコードタイプおよびコードルートを決定する(S440)。ここで決定したコードタイプおよびコードルートは、それぞれコードタイプレジスタCDTYPE、コードルートレジスタCDROOTに格納される。なお、このようなキーコードに基づくコード検出は、例えば特公昭56−51630、特開平4−311000号公報等に記載された周知技術であるので、ここでは詳細な説明を省略する。
【0081】
続いて、複数あるロアーキーの第2接点LwSW2が、すべてオフ状態であるか否かを判断する(S445)。ここで、第2接点LwSW2がすべてオフ状態であれば(S445:YES)、速やかに第1タイマ割込処理を終了する。一方、複数ある第2接点LwSW2の内、いずれかがオンであれば(S445:NO)、コードタイプレジスタCDTYPEおよびコードルートレジスタCDROOTに格納された値に基づいて、新規和音を作成する(S450)。具体的な処理手順は、既に説明したS232の処理と同様なので、ここでは詳細な説明を省略する。
【0082】
続いて、既に和音を発音中の状態にあるか否かを判断する(S460)。ここで発音中の状態にあると判断されるのは、S450の処理以前に既にコードタイプレジスタCDTYPEおよびコードルートレジスタCDROOTの値に基づいて和音(以下、これを旧和音)が作成され、その旧和音を、サウンドシステム16が発音している場合である。旧和音を発音していない状態であれば(S460:NO)、CPU2は、サウンドシステム16に新規和音を発音させて(S465)、第1タイマ割込処理を終了する。なお、S465の処理において、新規和音を発音させる際には、S264にて作成されたロアーキーに対する最新のタッチデータに基づいて楽音発生回路14を制御する。
【0083】
一方、旧和音を発音している状態であれば(S460:YES)、楽音発生回路14を制御して、現在発音中である旧和音の構成音の内、新規和音に含まれない構成音を消音させる(S470)。そして、新規和音を構成する楽音の内、現在発音中の旧和音に含まれないものを、サウンドシステム16から発音させて(S480)、第1タイマ割込処理を終了する。
【0084】
さて一方、上記S430の処理時点で、ロアーキーの第1接点LwSW1がすべてオフ状態であった場合は(S430:YES)、コードタイプレジスタCDTYPEおよびコードルートレジスタCDROOTにそれぞれ「FFh」を格納する(S490)。
【0085】
そして、既に和音を発音中の状態にあるか否かを判断し(S500)、和音が発音されていない場合には(S500:NO)、直ちにタイマ割込処理を終了する。一方、和音が発音されている場合には(S500:YES)、楽音発生回路14を制御して発音中の和音を消音させ(S510)、第1タイマ割込処理を終了する。
【0086】
次に、第2タイマ割込処理について説明する。
第2タイマ割込処理を開始すると、CPU2は、まず、タイマレジスタTIMERの値を「1」減らし(S610)、その結果、タイマレジスタTIMERの値が「0」となったか否かを判断する(S620)。
【0087】
タイマレジスタTIMERの値が「0」でなければ(S620:NO)、直ちに第2タイマ割込処理を終了する。一方、タイマレジスタTIMERの値が「0」であれば(S620:YES)、複数あるロアーキーの第1接点LwSW1が、すべてオフ状態であるかどうかを判断する(S630)。
【0088】
ここで、複数あるロアーキーの第1接点LwSW1の内、いずれかがオンであれば(S630:NO)、第1接点LwSW1がオン状態である鍵について、その鍵のキーコードに基づいてコードタイプおよびコードルートを決定する(S640)。S640の具体的な処理内容は、既に説明した第1タイマ割込処理におけるS440の処理と同様なので、その詳細な説明は省略する。
【0089】
続いて、複数あるロアーキーの第2接点LwSW2が、すべてオフ状態であるか否かを判断する(S645)。ここで、第2接点LwSW2がすべてオフ状態であれば(S645:YES)、速やかに第2タイマ割込処理を終了する。一方、複数ある第2接点LwSW2の内、いずれかがオンであれば(S645:NO)、ROM4の自動伴奏データの中から、現在、発音タイミングにあるものをコード展開する(S650)。このコード展開処理は、既に説明したS314の処理と同様なので、ここでは詳細な説明を省略する。
【0090】
続いて、既に自動伴奏音(以下、これを旧伴奏音という)を発音中の状態にあるか否かを調べる(S660)。旧伴奏音を発音中でなければ(S660:NO)、S650のコード展開処理で決定された新規伴奏音をサウンドシステム16から発音させて(S665)、第2タイマ割込処理を終了する。
【0091】
一方、旧伴奏音を発音中であれば(S660:YES)、楽音発生回路14を制御して、現在発音中である旧伴奏音の構成音の内、新規伴奏音に含まれない構成音を消音させる(S670)。そして、新規伴奏音を構成する楽音の内、現在発音中の旧伴奏音に含まれないものを、サウンドシステム16から発音させて(S680)、第2タイマ割込処理を終了する。
【0092】
さて一方、上記S630の処理時点で、ロアーキーの第1接点LwSW1がすべてオフ状態であった場合には(S630:YES)、コードタイプレジスタCDTYPEおよびコードルートレジスタCDROOTにそれぞれ「FFh」を格納する(S690)。
【0093】
そして、既に自動伴奏音を発音中の状態にあるか否かを判断し(S700)、自動伴奏音が発音されていない場合には(S700:NO)、直ちに第2タイマ割込処理を終了する。一方、自動伴奏音が発音されている場合には(S700:YES)、楽音発生回路14を制御して発音中の自動伴奏音を消音させ(S510)、第2タイマ割込処理を終了する。なお、S690〜S710の処理により、伴奏音は発音されなくなるが、S/Sフラグ=「1」のままであるので、リズム伴奏は継続される。
【0094】
以上説明したような処理により、本電子楽器からは、図10のタイミングチャートに示すようなタイミングで和音が発生する。なお、図10は、本電子楽器がAOCモードにある場合のタイミングチャートである。以下の説明において、必要な箇所には、図4または図8のフローチャート中の各処理ステップに付した符号を併記する。
【0095】
図10(a)は、3つのロアーキー(押下された順に、「1stキー」、「2ndキー」、「3rdキー」と記す)の第1接点LwSW1および第2接点LwSW2のオン/オフ状態を示している。
まず1stキーが押下され、その第1接点LwSW1がオンにされると(S210:YES)、押鍵待機時間ΔTonの計時が開始される。その後、2ndキーが押下されてその第1接点LwSW1がオンにされると(S210:YES)、1stキーの第1接点LwSW1がオンにされてから押鍵待機時間ΔTonが経過する前であっても、その計時は中断され、新たに、押鍵待機時間ΔTonの計時が最初から始められる(S220)。2ndキーの第1接点LwSW1がオンにされた後、さらに3rdキーが押下されてその第1接点LwSW1がオンにされると(S210:YES)、2ndキーの第1接点LwSW1がオンにされてから押鍵待機時間ΔTonが経過する前であっても、その計時は中断され、押鍵待機時間ΔTonの計時が最初から始められる(S220)。
【0096】
3rdキーの第1接点LwSW1がオンにされた後(S210:YES)、1stキーの第2接点LwSW2がオンにされると(S222:YES)、これが最初の第2接点LwSW2におけるオンイベントなので(S226:YES)、その時点(時刻t1)では、先に計時を始めた押鍵待機時間ΔTonが経過する時刻t2には至っていないにもかかわらず、直ちにコード検出が行われ(S230)、タイマレジスタTIMERがリセットされ(S231)、新規和音の作成(S232)、新規和音の発音が行われる(S234)。
【0097】
なお、この後、2ndキー、3rdキーの第2接点LwSW2が、順にオンにされるが(S222:YES)、この時は、最初の第2接点LwSW2におけるオンイベントではなく(S226:NO)、タイマレジスタTIMERがリセット済みなので(S405:YES)、既に発音されている和音が継続して発音されるだけである。
【0098】
このようにして新規和音の発音を行えば、押鍵待機時間ΔTonの経過を待たなくてもよいので、押鍵待機時間ΔTonの経過を待つものに比べ、迅速に発音を行うことができる。しかも、第1接点LwSW1のオン状態に基づいて和音を決定しているので、第2接点LwSW2では押鍵状態とされるか否かが不確定であるにもかかわらず、的確に演奏者の意図を反映した和音を発生できる可能性が高い。
【0099】
さて、上記のように1stキー〜3rdキーまでが押された状態になった後、2ndキー、3rdキーが、この順序で離された場合は、まず2ndキーの第2接点LwSW2がオフにされると(S236:YES)、離鍵待機時間ΔToffの計時が開始される(S238)。その後、3rdキーが離されてその第2接点LwSW2がオフにされると(S236:YES)、2ndキーの第2接点LwSW2がオフにされてから離鍵待機時間ΔToffが経過する前であっても、その計時は中断され、新たに、離鍵待機時間ΔToffの計時が最初から開始される(S238)。
【0100】
3rdキーの第2接点LwSW2がオフにされた後(S236:YES)、ロアーキーの押鍵操作・離鍵操作のいずれもなく、離鍵待機時間ΔToffの計時が中断されずに完了すると(時刻t3)、コード検出が行われる(S440)。この場合には、1stキーのみに基づいてコードの検出が行われる。そして、新規和音が作成され(S450)、さらに、旧和音を発音中であるので(S460:YES)、新規和音を構成しない楽音が消音され(S470)、新規和音を構成する音高の楽音が発音される(S480)。
【0101】
以上説明したように、本実施形態の電子楽器においては、演奏者がいくつかのロアーキーを操作してコードを指定するだけで、そのコードに係る楽音(和音、自動伴奏音)が発生するので、例えば初心者であっても簡単な操作で複雑な伴奏音を発生させることができる。
【0102】
特に、押鍵操作がなされた際には、第2接点LwSW2によって押鍵状態への状態変化を検知したら、第1接点LwSW1による状態変化の検知結果に基づいて、押鍵状態にある鍵の組み合わせを判別するので、押鍵待機時間ΔTonの経過を待ってからコード検出を行うものに比べ、押鍵操作の開始時点から演奏音発生時点までのタイムラグは短縮される。しかも、第2接点LwSW2で確実な状態変化を検知した上でコード検出を行うので、第1接点LwSW1で状態変化を検知したことを契機としてコード検出を行うようなものに比べ、演奏者の意図がより的確に反映された楽音を発生させることができる。
【0103】
したがって、本実施形態の電子楽器によれば、押鍵操作後の反応がよくなり、演奏者が、演奏音発生の遅れに違和感を覚えることはない。また、演奏者の意図しないコードに係る楽音が発生してしまう確率は低くなり、演奏者が気持ちよく思い通りの演奏を行うことができる。
【0104】
また、本実施形態の電子楽器においては、最初の第2接点LwSW2のオンイベントについてだけ、直ちに新規和音の作成を行っているので、後から第2接点LwSW2のオンイベントが発生しても、いたずらに新規和音の作成が繰り返されることはなく、楽音発生手段にかかる処理負担を抑制することができる。
【0105】
なお、以上説明した電子楽器は、上記請求項1、請求項2に記載の構成を採用したものに相当する。
以上、本発明の実施形態について説明したが、本発明の実施形態については上記のもの以外にも種々の具体的形態が考えられる。以下、有用な変形例について説明する。
【0106】
まず、第1変形例について説明する。
上記実施形態の電子楽器では、図4に示した第1和音演奏処理を採用していたが、これに代えて、図11に示すような第1和音演奏処理を採用してもよい。図11の処理は、図4の処理中にあるS226,S228,S230,S231の処理の代わりに、S225,S227,S229の処理を採用したものである。なお、以下、図11の処理について説明するが、図4、図11に示した2つの処理には重複する部分が多いので、以下の説明では、S225,S227,S229の処理についてのみ詳述し、他の処理ステップについては、両フローチャート中に同じ符号を付すこととして、その説明を省略する。
【0107】
図11に示す第1和音演奏処理を開始した後、CPU2は、複数あるロアーキーの第2接点LwSW2のいずれかにおいてオンイベントが発生したら(S222:YES)、タッチデータを作成する(S224)。
続いて、SW1ビットマップSW1BMPに基づいて、新たにコードタイプレジスタCDTYPEおよびコードルートレジスタCDROOTに格納すべき値を決定する(S225)。このS225の処理の結果、押鍵待機時間ΔTonの経過を待つことなく、速やかにコードタイプレジスタCDTYPEおよびコードルートレジスタCDROOTの値が確定することになる。このS225の処理は、第2接点LwSW2(第2検知手段)によって状態変化を検知したら、第1接点LwSW1(第1検知手段)による状態変化の検知結果に基づいて、押鍵状態にある鍵の組み合わせに対応するコードを検出する処理であり、本発明の主要部に該当する処理である。
【0108】
そして、S225の処理を終えたら、タイマレジスタTIMERに「0」を設定し(S227)、コードタイプレジスタCDTYPEおよびコードルートレジスタCDROOTに変更があったか否かを判断する(S229)。具体的には、上記S225の処理において決定した新たな値を、コードタイプレジスタCDTYPEおよびコードルートレジスタCDROOTに格納する前に、その時点でコードタイプレジスタCDTYPEおよびコードルートレジスタCDROOTに格納されている値を、適当なメモリ領域に保存しておき、新旧2つの値を比較すればよい。
【0109】
ここで、コードタイプレジスタCDTYPEおよびコードルートレジスタCDROOTが双方とも変更されていなければ(S229:NO)、第1和音演奏処理を速やかに終了する。
一方、コードタイプレジスタCDTYPEおよびコードルートレジスタCDROOTの内、少なくとも一方が変更されていれば(S229:YES)、コードタイプレジスタCDTYPEおよびコードルートレジスタCDROOTに格納された値に基づいて、新規和音を作成する(S232)。
【0110】
S232に引き続く処理、および、その他説明しなかった処理は、図4に示した処理と同じである。
以上のような第1和音演奏処理を採用すると、図4の第1和音演奏処理とは異なり、第2接点LwSW2のオンイベントがあるたびに、新規和音を作成すべきか否かの再確認が行われるので(S229)、演奏者の意図した和音を的確に発生できる可能性がより一層高くなる。
【0111】
次に、第2変形例について説明する。
上記実施形態の電子楽器では、図5に示した第2和音演奏処理、および図9に示した第2タイマ割込処理を採用していたが、これに代えて、図12に示すような第2和音演奏処理、および図13に示すような第2タイマ割込処理を採用してもよい。図12の処理は、図5の処理中にあるS266,S267,S268の処理を削除し、その代わりに、S290,S292,S294,S296の処理を採用したものである。また、図13の処理は、図9の処理中にあるS640の処理を削除し、その代わりに、S605,S641の処理を採用したものである。なお、以下の説明においても、代替採用した処理について詳述し、他の処理ステップについては、先に示したフローチャート中の符号と同じ符号を付すこととして、その説明を省略する。
【0112】
図12に示す第2和音演奏処理を開始した後、CPU2は、複数あるロアーキーの第2接点LwSW2のいずれかにおいてオンイベントが発生したら(S262:YES)、タッチデータを作成し(S264)、最初の第2接点LwSW2のオンイベントであるかどうかを判断する(S265)。
【0113】
ここで、最初の第2接点LwSW2のオンイベントであれば(S265:YES)、S/Sフラグが「0」であるかどうかを調べ(S290)、S/Sフラグが「1」であれば(S290:YES)、AUTOフラグが「1」であるかどうかを調べる(S269)。AUTOフラグが「1」であれば(S269:YES)、S/Sフラグに「1」をセットして(S270)、SW1ビットマップSW1BMPに基づいて、新たにコードタイプレジスタCDTYPEおよびコードルートレジスタCDROOTに格納すべき値を決定する(S292)。このS292の処理の結果、押鍵待機時間ΔTonの経過を待つことなく、速やかにコードタイプレジスタCDTYPEおよびコードルートレジスタCDROOTの値が確定することになる。このS292の処理は、第2接点LwSW2(第2検知手段)によって状態変化を検知したら、第1接点LwSW1(第1検知手段)による状態変化の検知結果に基づいて、押鍵状態にある鍵の組み合わせに対応するコードを検出する処理であり、本発明の主要部に該当する処理である。なお、S292の処理を終えたら、S296の処理へと進む。
【0114】
さて一方、上記S265の処理において、最初の第2接点LwSW2のオンイベントでないと判断した場合(S265:NO)、あるいは、上記S290の処理時に、S/Sフラグが「1」でなかった場合(S290:NO)、あるいは、上記S269の処理時に、AUTOフラグが「1」でなかった場合(S269:NO)のいずれかであれば、SW2ビットマップSW2BMPに基づいて、新たにコードタイプレジスタCDTYPEおよびコードルートレジスタCDROOTに格納すべき値を決定する(S294)。このS294の処理は、第2接点LwSW2(第2検知手段)によって状態変化を検知したら、第2接点LwSW2(第2検知手段)による状態変化の検知結果に基づいて、押鍵状態にある鍵の組み合わせに対応するコードを検出する処理であり、上記請求項4に記載の構成に相当する処理である。なお、S292の処理を終えたら、S296の処理へと進む。
【0115】
こうして、S292またはS294の処理を終えたら、タイマレジスタTIMERに「0」を設定し(S296)、S280の処理へと進む。以下、S280に引き続く処理、および、その他説明しなかった処理は、図5に示した処理と同じである。
【0116】
さて一方、図13に示す第2タイマ割込処理では、まず、タイマレジスタTIMERの値が「0」であるか否かを判断し(S605)、「0」でない場合に限り(S605:NO)、S610以降の処理へと進み、「0」である場合は(S605:YES)、直ちに第2タイマ割込処理を終える。このような処理を加えることにより、図12に示した第2和音演奏処理内でタイマレジスタTIMERに「0」を設定された場合は、第2タイマ割込処理を速やかに終えることができる。
【0117】
また、図13に示す第2タイマ割込処理において、複数あるロアーキーの第1接点LwSW1の内、いずれかがオンであれば(S630:NO)、第2接点LwSW2がオン状態である鍵について、その鍵のキーコードに基づいてコードタイプおよびコードルートを決定する(S641)。S641の処理に続くS645以降の処理は、図9に示した処理と同じである。
【0118】
以上のような第2和音演奏処理および第2タイマ割込処理を採用すると、図5の第2和音演奏処理および図9の第2タイマ割込処理を採用した場合とは異なり、無音状態からの最初の押鍵で(S265)、且つ未だ自動伴奏中ではなく(S269)、且つ自動伴奏を行う旨の設定がなされている(S292)という状態である場合に、第1接点LwSW1による状態変化の検知結果に基づいて、押鍵状態にある鍵の組み合わせを判別する。そのため、押鍵待機時間ΔTonの経過を待ってからコード検出を行うものに比べ、押鍵操作/離鍵操作の開始時点から演奏音発生時点までのタイムラグは短縮される。一方、既に押鍵がなされている場合、あるいは、既に自動伴奏中である場合、あるいは、自動伴奏を行う旨の設定がなされていない場合などは、第2接点LwSW2で確実な状態変化を検知した上でコード検出を行う。そのため、第1接点LwSW1で状態変化を検知したことを契機としてコード検出を行うようなものに比べ、演奏者の意図がより的確に反映された楽音を発生させることができる。
【0119】
したがって、本実施形態の電子楽器によれば、自動伴奏を開始するときにおける押鍵操作/離鍵操作後の反応がよくなり、演奏者が、伴奏音発生の遅れに違和感を覚えることはない。また、自動伴奏中や、自動伴奏以外の演奏音を発生させる場合は、演奏者の意図しないコードに係る楽音が発生してしまう確率は低くなる。
【0120】
次に、第3変形例について説明する。
第3変形例として説明する電子楽器は、上記第2変形例として説明した電子楽器に対し、第1接点LwSW1に基づくコード検出を行う場合の条件を、さらに制限したものである。
【0121】
すなわち、第2変形例のものは、無音状態からの最初の押鍵で(S265)、且つ未だ自動伴奏中ではなく(S269)、且つ自動伴奏を行う旨の設定がなされている(S292)という状態であることを条件に、第1接点LwSW1による状態変化の検知結果に基づいてコード検出を行ったが、第3変形例の電子楽器は、さらに、SYNCフラグに「1」が設定されていることを、上記条件に加える。
【0122】
SYNCフラグは、SYNCスイッチがオンにされて、シンクロスタートモードでの演奏を行う旨の設定がなされた場合に、「1」が設定される。
したがって、このように構成された電子楽器によれば、シンクロスタートモードで自動伴奏を開始するときにおける押鍵操作/離鍵操作後の反応がよくなり、演奏者が、伴奏音発生の遅れに違和感を覚えることはない。また、シンクロスタートモードでの自動伴奏を行わない場合、シンクロスタートモードであっても既に自動伴奏中である場合、自動伴奏以外の演奏音を発生させる場合などは、演奏者の意図しないコードに係る楽音が発生してしまう確率は低くなる。
【0123】
なお、この第3変形例に記載の電子楽器は、上記請求項5に記載の構成を採用したものに相当する。
次に、第4変形例について説明する。
本発明の実施形態として説明した上記各電子楽器は、いずれも押鍵操作時のタイムラグの解消を図ったものであったが、本発明の要部は、一方の検知手段に引き続いて他方の検知手段が状態変化を検知したら、一方の検知手段による状態変化の検知結果に基づいてコード検出を行う点にあり、これは離鍵操作時についても適用可能である。
【0124】
すなわち、上記実施形態の電子楽器において、離鍵操作時には、第2接点LwSW2がオフになり、引き続いて第1接点LwSW1がオフになるので、後からオフになる第1接点LwSW1が新たに1つオフになったら、オン状態のまま残っている第2接点LwSW2からコード検出を行うように構成する。
【0125】
このように構成された電子楽器によれば、離鍵操作がなされた際には、第1接点LwSW1によって離鍵状態への状態変化を検知したら、第2接点LwSW2による状態変化の検知結果に基づいて、押鍵状態にある鍵の組み合わせを判別する。そのため、離鍵待機時間ΔToffの経過を待ってからコード検出を行うものに比べ、離鍵操作の開始時点から新たなコードに係る演奏音発生時点までのタイムラグは短縮される。具体的には、図10に併記したように、待機時間ΔToffの経過を待ってからコード検出を行うと時刻t3で和音検出が行われていたが、第4変形例の電子楽器であれば、時刻t3よりも早い時刻t4において和音検出を行うことができる。
【0126】
しかも、第1接点LwSW1で確実な離鍵状態への変化を検知した上でコード検出を行うので、第2接点LwSW2で状態変化を検知したことを契機としてコード検出を行うようなものに比べ、演奏者の意図がより的確に反映された楽音を発生させることができる。
したがって、本実施形態の電子楽器によれば、離鍵操作後の反応がよくなり、演奏者が、演奏音発生の遅れに違和感を覚えることはない。また、演奏者の意図しないコードに係る楽音が発生してしまう確率は低くなり、演奏者が気持ちよく思い通りの演奏を行うことができる。
【0127】
なお、この第4変形例に記載の電子楽器は、上記請求項3に記載の構成を採用したものに相当する。
【図面の簡単な説明】
【図1】本発明の一実施形態としての電子楽器の構成図である。
【図2】メインルーチンのフローチャートである。
【図3】通常演奏処理を示すフローチャートである。
【図4】第1和音演奏処理を示すフローチャートである。
【図5】第2和音演奏処理を示すフローチャートである。
【図6】自動演奏処理を示すフローチャートである。
【図7】コードに係る楽音を求める際に使用する和音表を示す図である。
【図8】第1タイマ割込処理を示すフローチャートである。
【図9】第2タイマ割込処理を示すフローチャートである。
【図10】鍵盤操作に伴う処理のタイミングの具体例を示すタイムチャートである。
【図11】図4とは別の第1和音演奏処理を示すフローチャートである。
【図12】図5とは別の第2和音演奏処理を示すフローチャートである。
【図13】図9とは別の第2タイマ割込処理を示すフローチャートである。
【符号の説明】
2・・・CPU、2a・・・タイマ、4・・・ROM、6・・・RAM、8・・・オートカウンタ、10・・・パネル、12・・・キーボード、14・・・楽音発生回路、14a・・・アサイメントメモリ、16・・・サウンドシステム、18・・・音源、21・・・バス。
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an electronic musical instrument configured to detect a chord intended by a player based on a combination of keys in a depressed state and generate a musical sound related to the chord.
[0002]
[Prior art]
2. Description of the Related Art Conventionally, an electronic musical instrument that generates a performance sound with a strength corresponding to a key pressing speed, such as an electronic piano, is known. This type of electronic musical instrument usually includes a pair of sensors corresponding to each key. These two sensors detect a key pressing operation with a time difference corresponding to the key pressing speed, and the electronic musical instrument emits a weak sound when the time difference is large according to the time difference detected by the two sensors. When the time difference is small, a strong sound is generated.
[0003]
Some electronic musical instruments of this type are further provided with an automatic accompaniment function and an AOC (Auto Orchestra Chord) function. Each of these functions does not simply generate a sound corresponding to a key in a depressed state, but detects a chord intended by the performer based on a combination of keys in a depressed state. This is a function that automatically generates musical sounds related to chords in various forms. For example, if you are using the automatic accompaniment function, even if you are a beginner who can only specify chords with the left hand if you specify the melody of the accompaniment sound beforehand by switch operation etc. You can easily perform complicated accompaniment.
[0004]
By the way, in the electronic musical instrument having the automatic accompaniment function and the AOC function as described above, the performer intends to operate a plurality of keys at the same time, but there are usually very few sensors for detecting this operation. Since it has the ability to detect a time difference, the operation timing of each key is detected with a slight shift in most cases. Therefore, if the chord intended by the performer is detected immediately when the sensor corresponding to a certain key detects the key pressing operation, the chord intended by the performer is not actually detected. Probability is high.
[0005]
Therefore, conventionally, a sensor corresponding to a key detects a key press and then waits until a predetermined waiting time elapses, and a sensor corresponding to another key detects a key press during that waiting time. In such a case, all of these keys are treated as being pressed at the same time, and the code is detected after the waiting time has elapsed.
[0006]
[Problems to be solved by the invention]
However, if the waiting time as described above is provided, a corresponding time lag occurs from the time when the actual key pressing operation is started to the time when the performance sound is generated, so the player feels uncomfortable due to the lack of response. There was a problem. In particular, when the performance is started, the silent state is switched to the sounding state, so that there is a problem that the time lag is much more noticeable than during a performance in which some kind of performance sound is continuously generated.
[0007]
Of course, if the waiting time is shortened, the time lag is correspondingly shortened. However, simply taking such a measure will eventually cause a problem that occurs when no waiting time is provided, that is, a problem that a chord different from the chord intended by the performer is detected. It was not an effective measure.
[0008]
The present invention has been made in order to solve the above-described problem, and an object of the present invention is to detect a chord intended by the performer based on a combination of keys in a depressed state and to play a musical sound related to the chord. In the electronic musical instrument to be generated, the chord intended by the performer can be detected more accurately while shortening the time lag from the operation start time to the performance sound generation time as compared with the prior art.
[0009]
[Means for Solving the Problems and Effects of the Invention]
The present invention made to achieve the above-mentioned object is as described in claim 1.
A plurality of keys that are operated by the performer to be in a key-pressed state or a key-released state, and a state change from one of the key-pressed state / key-released state to the otherSometimes, Time difference according to the operating speed of the keyInspectKnownAnd hold key status detectionA combination of the first and second detection means and the key in the depressed stateIs detected,In an electronic musical instrument comprising: code detecting means for detecting a corresponding chord; and a musical sound generating means for generating a musical sound related to the chord detected by the chord detecting means,
The detection of the key pressing state of each key when detecting the combination of keys in the key pressing state is performed by the first and second detecting means when detecting the detecting means that detects the state change later in the detection order. Based on the detection result of the state by the detection means that detected the state change first,
Based on the key depression detection resultDetect the code corresponding to the key combination
It is characterized by that.
[0010]
In this electronic musical instrument, the plurality of keys are performance operators provided on the keyboard musical instrument. Most commonly, you can think of white keys and black keys that are operated by hand, but you can also use keys that operate with your feet (so-called pedal keys), and those that are not in the form of white keys and black keys. Good.
[0011]
In addition, as the first and second detection means, for example, various electronic pianos and the like have been conventionally used, and these can be arbitrarily used. Specifically, for example, two contact-type switches whose on / off state is switched depending on whether they are pressed or not are arranged at positions where they are pressed with a time difference when a key is pressed. it can. Alternatively, two photointerrupters that are switched on / off depending on whether or not the optical path is blocked, and a time difference on the optical path of the two photointerrupters attached to the key and being depressed / released. It is also possible to use a configuration including a stepped shutter. Of course, various contact sensors or non-contact sensors other than these may be employed. These switches or sensors may be either those that are turned on when the key is pressed and turned off when the key is released, or those that are turned off when the key is pressed and turned on when the key is released. In addition, it is normally off, and is turned on only at the moment when a state change from one of the key-pressed state and the key-released state to the other occurs (that is, something that emits a pulse signal). May be. In this case, for example, the state change can be detected by monitoring the pulse signal by an appropriate method such as executing an interrupt process in association with the generation of the pulse signal.
[0012]
Such first and second detection means may be directly attached to the key as described above. However, the first and second detection means are not limited to this, and operate such that the movement of the key can be indirectly grasped in conjunction with the key. It may be attached to a member (hereinafter referred to as a key interlocking member). As such a key interlocking member, for example, a constituent member (for example, a member corresponding to a hammer) of a simulated action mechanism of a piano, which is employed for improving touch feeling in some electronic pianos, is cited. be able to. In addition, in order to provide the first and second detection means, a dedicated key interlocking member may be provided.
[0013]
In addition, the code detecting means detects the code corresponding to the key combination in the key-pressed state in the same manner as in the prior art, but in determining the key combination in the key-pressed state, 2 When the detection means detects a change in state in the order of one detection means and the other detection means, if the detection change is detected by the other detection means, the detection is performed based on the detection result of the change in state by the one detection means. There is a feature different from the conventional one in that a combination of keys in a key state is determined.That is, the detection of the key pressing state of each key when detecting the key combination in the key pressing state is performed by the detection of the “detecting means that detected the state change later” in the detection order of the first and second detecting means. There is a feature in that a code corresponding to a key combination based on the detection result of the key pressing state is detected based on the detection result of the state by the “detection means that detected the state change first”.
[0014]
If the key combination is determined by such a method, first, determination of the key combination in the key-pressed state (hereinafter simply referred to as code detection) is started when the state change is detected by the other detection means. Therefore, it is more likely that the code detection is performed when the key is intentionally depressed than in the case where the code detection is started when the state change is detected by one of the detection means.
[0015]
Moreover, since the code detection itself performed when the state change is detected by the other detection unit is performed based on the detection result of the state change by one detection unit, the code detection itself is performed based on the detection result of the state change by the other detection unit. Thus, the code detection start time can be advanced compared to the code detection. That is, immediately after detection of the first state change by the other detection means, the state change detected by the other detection means is still only temporary, and a key pressing / releasing operation is performed for another key. There is a possibility. Therefore, if reliable code detection is performed by the other detection means, it is necessary to wait for some waiting time to elapse. However, in the present invention, one detection means detects a state change ahead of the other detection means, and when the state change is detected by the other detection means, some time has already passed. Therefore, if code detection is performed based on the detection result of the state change by one of the detection means, it is not necessary to wait for the above-described waiting time to elapse, or just to wait for a shorter waiting time to elapse. It is possible to detect the key-pressing state that is also detected by the detecting means. In addition, the more quickly the key is operated, the earlier the detection timing of the state change by the other detection means. Therefore, regardless of the operation speed, the standby time that is uniformly set assuming that the operation speed is slow. The code detection start time is earlier than when waiting for elapse. As a result, in the present invention, code detection can be completed more quickly than in the past.
[0016]
If the combination of keys in the key-pressed state is determined by such a method, the code can be detected by the same method as before. For example, with bit pattern data in which key depression / release is associated with 1/0, a combination of keys in a key depression state is stored in a memory, and a correspondence table between codes and bit pattern data separately stored in the memory Referring to the above, it can be considered that the code designated by the key depression is detected.
[0017]
Further, the musical sound generating means generates a musical sound related to the chord detected by the chord detecting means. However, the musical tone generating means here does not need to be specially provided only for generating the musical tone related to the chord, and the musical tone provided for the electronic musical instrument to generate a normal performance sound. The generation means only needs to be configured to function when generating a musical sound related to the chord. The “musical tone related to the detected chord” may simply be a musical tone having a plurality of pitches constituting the chord, or may be an automatic accompaniment sound or an automatic performance sound corresponding to the chord. . For example, accompaniment patterns such as rock and waltz are stored in advance as automatic accompaniment data with typical chords (for example, “C Major” etc.), and accompaniment sounds based on the automatic accompaniment data are transposed to the detected chords. And then play it back.
[0018]
According to the electronic musical instrument configured as described above, a musical tone related to a chord is generated just by the player specifying a chord by operating several keys. Can generate complicated accompaniment sounds.
In particular,The detection of the key pressing state of each key when detecting the key combination in the key pressing state is performed by the first and second detecting means when detecting “the detecting means that has detected a state change later” in the detection order. The code corresponding to the key combination based on the detection result of the key pressing state is detected based on the detection result of the state by the “detection means that detected the state change first”.Therefore, it is possible to generate a musical sound in which the intention of the performer is reflected more accurately than when the chord detection is performed from the detection result of one detection means when the state change is detected by one detection means. In addition, when a change in state is detected by the other detection means, it is possible to generate a musical tone more quickly than in the case where the chord detection is performed from the detection result of the other detection means. Furthermore, the time lag from the start of the key pressing / key release operation to the point of time when the performance sound is generated is shortened as quick key operation is performed, compared to the case where chord detection is performed after a certain waiting time has elapsed. So there is no sense of incongruity for the performers.
[0019]
Therefore, according to this electronic musical instrument, the response after the key pressing / releasing operation is improved, and the performer does not feel uncomfortable with the delay in the generation of the performance sound. In addition, the probability that a musical sound related to a chord that is not intended by the performer will be reduced, and the performer can perform comfortably as expected.
[0020]
The configuration of the present invention may be employed for either one of the key pressing operation and the key releasing operation, or may be employed for both.
More specifically, an electronic musical instrument that employs the above configuration at the time of a key press operation is as described in claim 2.
When the first and second detection means detect a change in state from the key release state to the key depression state in the order of the first detection means and the second detection means, the code detection means When the state change is detected, the code corresponding to the key combination in the key pressing state is detected based on the detection result of the state change by the first detection means.
It is characterized by that.
[0021]
This electronic musical instrument shows a good response especially when the chord specified by the player changes due to a key pressing operation, so that a new key is pressed not only when the performance starts but also when the chord is changed. The desired effect will be achieved.
An electronic musical instrument that employs the above-described configuration during a key release operation is as described in claim 3.
When the first and second detection means detect a change in state from the key-pressed state to the key-released state in the order of the second detection means and the first detection means, the code detection means is the first detection means When the state change is detected, the code corresponding to the key combination in the key pressing state is detected based on the detection result of the state change by the second detection means.
It is characterized by that.
[0022]
According to this electronic musical instrument, particularly when the chord specified by the performer changes with a key release operation, a good response is shown, so that some chords have already been pressed and some chords have been designated. The desired effect is exhibited when the code is changed by releasing a key in several key depression states.
[0023]
By the way, in the case of the electronic musical instrument of the present invention described above, the time lag from the start time of the key pressing operation / key release operation to the time when the performance sound is generated is shortened as quick key operation is performed. Therefore, especially when there are many quick key operations, when changing from a silent state to a sounding state (for example, at the start of a performance), the accompaniment is performed in synchronization with other performance sounds (for example, the performance sound that becomes the main melody). When you want to start, the effect is tremendous.
[0024]
However, when only slow key operations are performed, the chord changes while the sounding state continues, the accompaniment is started in advance, and other performance sounds are added later, etc. Sometimes it doesn't happen. In that case, if a more reliable code detection can be performed by allowing a slight time lag, it is considered that there is a certain advantage.
[0025]
Therefore, the electronic musical instrument according to claim 4 or 5 employs the following configuration.
That is, the electronic musical instrument according to claim 4 is:
When the first and second detection means detect the state change in the order of one detection means and the other detection means, and there is a key in a key depression state before the state change, When the code detection means detects the state change by the other detection means, a code corresponding to the key combination in the key depression state is detected based on the detection result of the state change by the other detection means. Do
It is characterized by that.
[0026]
The electronic musical instrument configured in this way detects the state change in advance only when the number of keys in the depressed state changes from 0 to 1 or more before and after the state change is detected by the other detection means. The code is detected based on the detection result of one of the detecting means. On the other hand, in other cases, code detection is performed based on the detection result of the other detection means that detects the state change later.
[0027]
In the case of such an electronic musical instrument, for example, when the first key pressing operation is performed from a state where there is no key in the key pressing state, for example, at the start of performance or at the time of resuming the performance after the performance pause, Since a chord is detected quickly, a musical tone related to the chord is generated without a time lag. Moreover, if the chord changes while the performance sound continues after the performance is started, even if an erroneous operation or the like is detected by one detection means, an operation that is not detected by the other detection means Then, even if the timings of code detection coincide with each other, such an erroneous operation does not adversely affect code detection.
[0028]
Therefore, according to this electronic musical instrument, the response of the pronunciation is improved at the start of the performance, and the possibility that the musical sound related to the chord intended by the performer is further increased after the start of the performance. There is.
The electronic musical instrument according to claim 5 is:
Furthermore, it comprises mode setting means capable of setting whether or not to perform in the synchro start mode in which generation of musical sounds by the musical sound generating means is started simultaneously with the start of a key pressing operation,
When the first and second detection means detect the change in state in the order of one detection means and the other detection means, and the mode setting means is not set to perform in the synchro start mode. If the code detection means detects the state change by the other detection means, the code corresponding to the key combination in the key depression state based on the detection result of the state change by the other detection means Detect
It is characterized by that.
[0029]
The electronic musical instrument configured as described above is based on the detection result of one of the detection means that detects the state change in advance only when the mode setting means is set to perform in the synchro start mode. Perform code detection. On the other hand, in other cases, code detection is performed based on the detection result of the other detection means that detects the state change later.
[0030]
In such an electronic musical instrument, chords are detected more quickly than in conventional cases, such as when playing in the synchro start mode, where synchronization of pronunciation at the start of the performance is particularly worrisome. Since the musical sound related to the chord is generated without being accompanied, there is an effect that there is no sense of incongruity for the performer.
[0031]
If you don't play in the synchro start mode, the time lag will be slightly larger, but even if an erroneous operation is detected by one of the detectors, if the operation is not detected by the other detector, the chord is detected by chance. Even if the timings are overlapped, such an erroneous operation does not adversely affect the chord detection, so that the possibility that a musical tone related to the chord intended by the performer is generated is further increased.
[0032]
DETAILED DESCRIPTION OF THE INVENTION
Next, an embodiment of the present invention will be described with an example.
FIG. 1 is a block diagram showing an electrical configuration of an electronic musical instrument which is an embodiment of the present invention.
[0033]
As shown in FIG. 1, the electronic musical instrument includes a CPU 2, a ROM 4, a RAM 6, an auto counter 8, a panel 10, a keyboard 12, a musical sound generating circuit 14, a sound system 16, and a bus 21 connecting these parts. .
The panel 10 is provided with a liquid crystal display panel, a display device such as an LED, and an operator for inputting various information and commands to the electronic musical instrument. Examples of the controls include an AOC switch for setting the electronic musical instrument in the AOC mode, an AUTO switch for setting the AUTO mode (automatic accompaniment mode), and START for starting / stopping automatic accompaniment when the electronic musical instrument is set to the AUTO mode. A / STOP switch, a SYNC switch for setting a mode (synchronized start mode) for starting automatic accompaniment simultaneously with a key pressing operation, and the like are provided.
[0034]
The keyboard 12 includes a plurality of keys (88 keys in the present embodiment). Each key is assigned a number (key code). When a key is pressed, the key code corresponding to the key is transferred to the CPU 2 or the like, and a musical tone having a pitch corresponding to the key code is generated. Processing is performed. In addition, a key switch for detecting key press / release is provided for each key. This key switch has two contacts (a first contact and a second contact). These two contacts are arranged so that they are turned on in the order of the first contact and the second contact during the key pressing operation, and are turned off in the order of the second contact and the first contact during the key release operation. Information that these two contacts are turned on or off is detected by a scan circuit (not shown) provided in the keyboard 12. This scan circuit scans each key switch at regular intervals to detect information on the key code of the key that has been pressed / released and the on / off state of the contact, and is detected by the scan circuit. The information is transferred to the CPU 2 as key event information. The two contact points correspond to the first and second detection means of the present invention.
[0035]
The musical tone generation circuit 14 generates independent digital musical tone signals of a plurality of channels (32 channels in this embodiment) by time division multiplexing processing. The musical tone generation circuit 14 includes an assignment memory 14a. Various data (key code, timbre data, etc.) necessary for generating a digital musical tone signal from each channel are stored in the assignment memory 14a. , Stored for each channel. When the musical tone generation circuit 14 generates a digital musical tone signal, the digital musical tone signal is generated based on various data set in the assignment memory 14a. The tone generation circuit 14 constitutes a tone generation means of the present invention.
[0036]
The sound system 16 includes a D / A converter, an amplifier, a speaker, and the like. The digital musical tone signal output from the musical tone generating circuit 14 is converted into an analog musical tone signal by a D / A converter of the sound system 16, and the analog musical tone signal is amplified by an amplifier and emitted from a speaker. The sound system 16 also constitutes a musical sound generating means of the present invention.
[0037]
The auto counter 8 is a counter for detecting the strength of key depression. When one of a plurality of keys is pressed, when the first contact of a key switch provided on the key is turned on, the auto counter 8 is cleared and starts a new count. Therefore, the value of the auto counter 8 at the time when the second contact of the key is turned on is the elapsed time from when the first contact is turned on until the second contact is turned on (that is, the first contact and The time difference of the on timing with the second contact). Accordingly, the smaller the time difference is, the faster the key pressing speed is, that is, the stronger key pressing is performed. Based on this, touch data (data indicating the key pressing strength) can be created.
[0038]
The CPU 2 is a well-known CPU that executes various processes in accordance with programs stored in the ROM 4. Typical processing executed by the CPU 2 includes, for example, processing for reading various information associated with operation of various switches on the panel 10, processing for scanning the keyboard 12 by the keyboard scanning circuit, and processing for reading key event information, and musical sound. There is a process of assigning a musical sound generation channel (channel) used for generating a digital musical sound signal in the generation circuit 14 and performing sound generation control on the channel, etc., and generating a musical sound by executing these processes in this order. ing. The CPU 2 has a built-in timer 2a, and the CPU 2 is configured to perform a timer interrupt process, which will be described later, every time a predetermined time elapses.
[0039]
The ROM 4 stores various programs and data. A program for generating musical sounds, automatic accompaniment data, a chord table to be described later, and the like are stored in the ROM 4.
The RAM 6 is for temporarily storing data when the CPU 2 performs various data processing, and indicates the on / off states of the first contact and the second contact of each key scanned by the key scan circuit. Storage areas (SW1 bitmap SW1BMP, SW2 bitmap SW2BMP, etc., which will be described later), registers (code type register CDTYPE, code route register CDROOT, etc., which will be described later), buffers, counters (first contact counter LS1C, which will be described later), flags ( Various storage areas such as an AOC flag, AUTO flag, S / S flag, and SYNC flag (to be described later) are secured.
[0040]
Of the storage area secured in the RAM 6, the code type register CDTYPE is a register for storing a number indicating the type of the detected chord (chord). As is well known, there are several types of codes such as “Major”, “m (minor)”, “7 (7th)”, etc., but in this electronic musical instrument, these types are unique for each type. (For example, “00h”, “01h”, “02h”,..., Etc .; where “h” indicates hexadecimal notation, the same applies hereinafter). When a code is detected based on a combination of keys for which a key pressing operation has been performed in the process described later, a number corresponding to the detected code type is stored in the code type register CDTYPE. When the type of the detected code is indefinite (there is no corresponding one), or when no code is detected, a number indicating that fact (for example, “FFh”) is stored in the code type register CDTYPE. Set.
[0041]
The chord root register CDROOT is a register for storing a number indicating the root of the detected chord. There are 12 types of chord roots: “C”, “C #”, “D”,..., “A #”, “B”. A number (for example, “00h”, “01h”,..., “0Ch”, etc.) that can uniquely specify a sound is assigned in advance. When a chord is detected based on a combination of keys for which a key pressing operation is performed in the processing described later, a number corresponding to the detected root of the chord is stored in the chord root register CDROOT. . If the root of the detected chord is indefinite (there is no corresponding one), or if no chord is detected, a number indicating that fact (for example, “FFh”) is the chord root register CDROOT. Set to
[0042]
The SW1 bitmap SW1BMP is a 12-bit bitmap data area that is set to “1” when the first contact of the key for code detection is on and “0” when it is off, and each bit has one octave. Each of the 12 keys “C”, “C #”, “D”,..., “A #”, “B” included in the range is associated with each other. Since the key to be subjected to the code detection usually exists in a key range of a plurality of octaves, there is a key corresponding to the same floor name for each octave, but a plurality of keys corresponding to the same floor name are All are associated with the same bit. Specifically, if at least one key among the plurality of keys corresponding to the same floor name is on, the corresponding bit is “1”, and all the keys are off. As long as the corresponding bit is “0”. The SW2 bitmap SW2BMP is a 12-bit bitmap data area similar to the SW1 bitmap SW1BMP. The SW2 bitmap SW2BMP is “1” when the second contact point of the key to be code-detected is on and “0” when it is off. Only the point is different from the SW1 bitmap SW1BMP.
[0043]
The timer register TIMER is used to measure the key press waiting time ΔTon for waiting for the code detection after the key is pressed or the key release waiting time ΔToff for waiting for the code detection after the key release. It is a register.
As will be described later, the first contact counter LS1C is a register for counting the number of the first contacts LwSW1 of the lower key that are in the ON state.
[0044]
The AOC flag is “1” when the electronic musical instrument is in an operation mode (AOC mode) in which the AOC function is activated, and is “0” otherwise. The AUTO flag is “1” when the electronic musical instrument is in an operation mode (AUTO mode) in which the automatic accompaniment function is activated, and is “0” in other cases. The S / S flag is a flag for deciding whether to start or stop the automatic accompaniment. When it is “1”, at least rhythm accompaniment is performed, and when it is “0”, the rhythm is All automatic accompaniment including accompaniment is stopped. The SYNC flag is a flag that is “1” when the synchro start mode for starting automatic accompaniment at the same time as the key depression operation is selected, and “0” in other cases.
[0045]
Next, processing executed by the CPU 2 in the electronic musical instrument configured as described above will be described with reference to FIGS. When the power of the electronic musical instrument is turned on, the CPU 2 executes processing according to the main routine shown in FIG.
When the execution of the main routine is started, the CPU 2 first performs an initialization process (S10). More specifically, as initialization processing, processing for clearing the RAM 6 and the assignment memory 14a of the musical tone generation circuit 14, “FFh” in the code type register CDTYPE and the code root register CDROOT (in this case, meaning “not detected”) Stored), processing for resetting the timer register TIMER (setting “0”), processing for resetting various flags such as AOC flag, AUTO flag, S / S flag, SYNC flag (setting “0”) And so on.
[0046]
Subsequently, the CPU 2 performs a panel process (S15). Specifically, first, the panel 10 is scanned to detect an on / off operation (on event / off event) of each switch, and the setting values of various flags are changed according to the detection result. For example, when an AUTO switch on event is detected, the AUTO flag is set to “1”, and when an AOC switch on event is detected, the AOC flag is set to “1”. When an S / S switch on event is detected, “1” is set in the S / S flag, and when a SYNC switch on event is detected, “1” is set in the SYNC flag.
[0047]
Next, the CPU 2 performs normal performance processing (S20). The normal performance process is a process of sounding / mute in response to a key depression / key release operation at a higher pitch than the split point. Here, the split point is a boundary that divides the key range of the keyboard 12 into two regions, the high sound side and the low sound side, and in this electronic musical instrument, the split point is set in advance on the keyboard 12 with keys. I can leave. That is, in this electronic musical instrument, when one key on the keyboard 12 is selected in the mode for setting the split point, a group of keys including the selected key on the lower temperature side (hereinafter referred to as a lower key). Then, two areas of a key group (hereinafter referred to as an upper key) located higher than the selected key are set. After the split point is set, which of the two areas is to be processed changes depending on the performance processing content. The normal performance process in S20 is a process for the key pressing / key release operation on the upper key side in the two areas.
[0048]
The normal performance process is a process as shown in detail in FIG. When the normal performance process is started, as shown in FIG. 3, the CPU 2 first determines whether an on-event has occurred at any one of the plurality of upper key first contacts UpSW1 (S110). Here, if there is the first contact UpSW1 in which the on-event has occurred (S110: YES), one of the auto counters 8 is assigned to that key (S120), and the normal performance process is terminated. In the process of S120, the auto counter 8 assigned to a specific key is initialized and then starts counting, and the counter value increases with time.
[0049]
On the other hand, if there is no first contact UpSW1 in which an on-event has occurred at the time of the processing of S110 (S110: NO), it is determined whether an on-event has occurred in any of the plurality of second key UpContacts 2 of the upper key. (S130). Here, if there is the second contact point UpSW2 in which the on-event has occurred (S130: YES), touch data is created (S140). This touch data is created based on the value of the auto counter 8 that starts counting when the first contact UpSW1 that forms a pair with the second contact UpSW2 in which the ON event has occurred.
[0050]
Subsequently, the CPU 2 performs a sound generation process (S150). This sound generation process is a process for generating a musical sound from the sound system 16 by controlling the musical sound generation circuit 14 based on the key code of the pressed key and the touch data. When the sound generation process is finished, the normal performance process is finished.
[0051]
On the other hand, if there is no second contact UpSW2 in which an on event has occurred at the time of the processing of S130 (S130: NO), it is determined whether or not an off event has occurred in any one of the plurality of first contacts UpSW1 of the upper key. (S160). Here, if there is no first contact UpSW1 in which an off event has occurred (S160: NO), the normal performance process is terminated. On the other hand, if there is a first contact UpSW1 in which an off event has occurred at the time of the processing of S160 (S160: YES), a mute process is performed (S170). This silencing process is a process for stopping the generation of the musical tone signal corresponding to the key having the first contact UpSW1 in which the off-event has occurred from the musical tone generation channel, and the CPU 2 indicates that the generation of the musical tone signal is stopped. The information is transferred to the tone generation circuit 14. When the mute process is finished, the normal performance process is finished.
[0052]
When the normal performance process shown in FIG. 3 is completed in this way, the process of S20 in FIG. 2 is completed. Subsequently, the CPU 2 checks whether or not the AOC flag is “1” (S25). ). If it is determined that the AOC flag = “1” (S25: YES), the first chord performance process is performed.
[0053]
This first chord performance process is a process for realizing the AOC function, and more specifically, a process as shown in FIG.
When the first chord performance process shown in FIG. 4 is started, the CPU 2 first determines whether or not an on event has occurred at any one of the plurality of lower key first contacts LwSW1 (S210). Here, if there is the first contact LwSW1 in which the ON event has occurred (S210: YES), the value of the first contact counter LS1C is incremented by “1” (S212), and the first contact counter LS1C is “4” or more. It is determined whether or not there is (S214). At this time, if the first contact counter LS1C is “4” or more (S214: YES), a predetermined value (for example, “1”) is set in the timer register TIMER (S216). Here, the value set in the timer register TIMER is an initial value for measuring the key press waiting time ΔTon.
[0054]
On the other hand, if it is determined in the process of S214 that the first contact counter LS1C is smaller than “4” (S214: NO), “ONDLY” is set in the timer register TIMER (S218). This “ONDLY” is also an initial value set in the timer register TIMER to measure the key press waiting time ΔTon, and in this embodiment, “ONDLY” = “6”.
[0055]
Thus, when the process of either S216 or S218 is completed, the CPU 2 assigns one of the auto counters 8 to the key having the first contact LwSW1 in which the on event has occurred (S220), and the first chord performance process Exit. In the process of S220, the auto counter 8 assigned to the specific key is initialized and starts counting, and the counter value increases as time elapses.
[0056]
If there is no first contact LwSW1 in which an on-event has occurred at the time of the processing of S210 (S210: NO), it is determined whether an on-event has occurred in any of a plurality of second key contacts LwSW2 of the lower key ( S222). Here, if there is the second contact LwSW2 in which the on-event has occurred (S222: YES), touch data is created (S224). This touch data is created based on the value of the auto counter 8 as in the process of S140.
[0057]
Subsequently, it is determined whether or not it is an on event of the first second contact LwSW2 (S226). This can be determined by examining whether or not there is the second contact LwSW2 in the on state in addition to the second contact LwSW2 in which the current on-event has occurred. Here, if it is not the first on-event of the second contact LwSW2 (S226: NO), the first chord performance process is immediately terminated.
On the other hand, if it is the first on-event of the second contact LwSW2 (S226: YES), it is checked whether or not the value of the code type register CDTYPE is “FFh” (S228). If the value of the code type register CDTYPE is not “FFh” (S228: NO), the process proceeds to S232 as it is. On the other hand, if the value of the code type register CDTYPE is “FFh” (S228: YES), the value of the code type register CDTYPE is “undefined” or “undetected”, so that a new code is generated based on the SW1 bitmap SW1BMP. The values to be stored in the type register CDTYPE and the code root register CDROOT are determined (S230). As a result of the process of S230, the values of the code type register CDTYPE and the code root register CDROOT are promptly determined without waiting for the key press waiting time ΔTon to elapse. In the process of S230, when a state change is detected by the second contact LwSW2 (second detection means), the key in the key depression state is detected based on the detection result of the state change by the first contact LwSW1 (first detection means). This is a process for detecting a code corresponding to a combination, and is a process corresponding to the main part of the present invention.
[0058]
When the processing of S230 is completed, “0” is set in the timer register TIMER (S231), and a new chord is created based on the values stored in the code type register CDTYPE and the code root register CDROOT (S232). More specifically, the electronic musical instrument stores a chord table as shown in FIG. This chord table is a correspondence table in which key codes indicating components of a chord corresponding to a specific root note (for example, “C”) are stored for each chord type stored in the chord type register CDTYPE.
[0059]
First, the CPU 2 searches the chord table for the chord type stored in the chord type register CDTYPE. If the chord type is found in the chord table, the key code corresponding to the chord type is read to identify the chord component. Then, the specified chord component is transposed based on the value stored in the chord root register CDROOT to derive a key code constituting the new chord.
[0060]
For example, taking the case where the value of the chord type register CDTYPE is “01h” and the chord root register CDROOT is “04h” as an example, the derivation procedure of the key code constituting the new chord will be described as follows. It is.
First, the chord table is referred to based on the value of the code type register CDTYPE (here, “01h”), and “00h”, “03h”, and “07h” are read as key codes corresponding to the code type. Here, when “FFh” is stored as the key code, the key code is not used. Then, by adding the value of the chord root register CDROOT to some key codes (three in this case) read from the chord table and transposing the key code, the key code “ 04h "," 07h ", and" 0Bh "are derived.
[0061]
When the process of S232 is completed in this way, the CPU 2 then causes the sound system 16 to generate a new chord (S234) and ends the first chord performance process. In the process of S234, when generating a new chord, the tone generation circuit 14 is controlled based on the latest touch data for the lower key created in S224.
[0062]
On the other hand, if there is no second contact LwSW2 in which an on-event has occurred at the time of the processing in S222 (S222: NO), it is determined whether an off-event has occurred in any one of the plurality of second key contacts LwSW2 in the lower key. (S236). Here, if there is the second contact LwSW2 in which the off event has occurred (S236: YES), “OFFDLY” is set in the timer register TIMER (S238), and then the first chord performance process is terminated. This “OFFDLY” is a value stored in the timer register TIMER to measure the key release waiting time ΔToff. In this embodiment, “OFFDLY” = “10”.
[0063]
On the other hand, if there is no second contact LwSW2 in which an off event has occurred at the time of the processing in S236 (S236: NO), it is determined whether an off event has occurred in any of the plurality of first contacts LwSW1 of the lower key (S240). ). If there is no first contact LwSW1 in which an off event has occurred (S240: NO), the first chord performance process is immediately terminated. On the other hand, if there is a first contact LwSW1 in which an off event has occurred (S240: YES), the first contact counter LS1C is decremented by “1” (S242), and then the first chord performance process is terminated.
[0064]
When the first chord performance process shown in FIG. 4 is completed in this way, the process of S30 in FIG. 2 is completed, and thereafter, the process returns to S15 again and this process is repeated. .
On the other hand, if it is determined in the process of S25 that the AOC flag is not “1” (S25: NO), it is checked whether the AUTO flag is “1” (S35). If it is determined that the AUTO flag is not “1” (S35: NO), the process returns to S15 again to repeat the present process, but it is determined that the AUTO flag is “1”. In this case (S35: YES), the second chord performance process is performed.
[0065]
This second chord performance process is a process for realizing the automatic accompaniment function, and is a process as shown in detail in FIG.
When the second chord performance process shown in FIG. 5 is started, the CPU 2 first determines whether or not an on event has occurred at any one of the plurality of first contacts LwSW1 of the lower key (S250). Here, if there is the first contact LwSW1 in which the ON event has occurred (S250: YES), the processing of S253 to S260 is performed. Since the processing of S253 to S260 is the same as the processing of S212 to S220 in FIG. 4, detailed description thereof is omitted. When the process of S260 is completed, the process proceeds to S280 described later.
[0066]
On the other hand, if there is no first contact LwSW1 in which an on-event has occurred at the time of the processing of S250 (S250: NO), it is determined whether an on-event has occurred in any one of the plurality of second key contacts LwSW2 of the lower key ( S262). Here, if there is the second contact LwSW2 in which the ON event has occurred (S262: YES), touch data is created (S264). This touch data is created based on the value of the autocounter 8 that starts counting when the first contact LwSW1 paired with the second contact LwSW2 in which the on event has occurred is turned on.
[0067]
Subsequently, it is determined whether or not it is an on event of the first second contact LwSW2 (S265). The determination method is the same as S226 described above. If it is not the first on-event of the second contact LwSW2 (S265: NO), the process immediately proceeds to the process of S280 described later.
[0068]
On the other hand, if it is the first on-event of the second contact LwSW2 (S265: YES), it is checked whether or not the value of the code type register CDTYPE is “FFh” (S266). If the value of the code type register CDTYPE is not “FFh” (S266: NO), the process proceeds to S269 as it is. On the other hand, if the value of the code type register CDTYPE is “FFh” (S266: YES), values to be newly stored in the code type register CDTYPE and the code root register CDROOT are determined based on the SW1 bitmap SW1BMP ( S267). As a result of the process of S267, the values of the code type register CDTYPE and the code root register CDROOT are determined promptly without waiting for the key press waiting time ΔTon to elapse. Similarly to the process of S230 described above, when the state change is detected by the second contact LwSW2 (second detection means), the process of S267 is also the detection result of the state change by the first contact LwSW1 (first detection means). Is a process for detecting a code corresponding to a key combination in a key-pressed state, and is a process corresponding to the main part of the present invention.
[0069]
When the processing of S267 is completed, “0” is set in the timer register TIMER (S268), and it is checked whether the AUTO flag is “1” (S269). If the AUTO flag is “1” (S269: YES), “1” is set in the S / S flag (S270), and then the process proceeds to S280 described later, while the AUTO flag is set. If it is not “1” (S269: NO), the process immediately proceeds to the process of S280 described later.
[0070]
On the other hand, if it is determined that no on-event of the lower key second contact LwSW2 has occurred at the time of the processing of S262 (S262: NO), the processing of S272 to S278 is performed. Since the processing of S272 to S278 is the same as the processing of S236 to S242 in FIG. 4, detailed description thereof is omitted. After finishing the process of S274 or S278 in the process of S236-S242, it progresses to the process of S280 mentioned later.
[0071]
Now, when the processes included in S250 to S278 described above are finished, the CPU 2 subsequently determines whether or not the AUTO flag = “1” and the S / S flag = “1” (S280). If at least one of the AUTO flag and the S / S flag is not “1” (S280: NO), the second chord process is immediately terminated. On the other hand, if the AUTO flag = “1” and the S / S flag = “1” (S280: YES), it is determined whether or not the code type register CDTYPE = “FFh” (S282). Here, if the chord type register CDTYPE = “FFh” (S282: YES), the second chord performance process is immediately terminated. On the other hand, if the chord type register CDTYPE is not “FFh” (S282: NO), automatic accompaniment processing based on the value of the chord type register CDTYPE and the chord root register CDROOT is performed (S286). The automatic accompaniment process in S286 is a process for generating a musical tone related to the chord in the present invention.
[0072]
The automatic accompaniment process is a process as shown in detail in FIG. When the automatic accompaniment process is started, the CPU 2 first reads automatic accompaniment data as shown in FIG. 6 (S310). The ROM 4 stores a plurality of types of automatic accompaniment data, and one of the data is read in the process of S310. Subsequently, it is checked whether or not the sound generation timing is reached (S312). This is performed by comparing the time value counted up by a time counter (not shown) with the step time included in the automatic accompaniment data extracted in S310. The time counter is configured to start counting the time value when the AUTO flag = “1” and the S / S flag = “1”.
[0073]
If it is determined that it is not the sounding timing (S312: NO), the process proceeds to S318. On the other hand, if it is determined that it is the sounding timing (S312: YES), a chord expansion process is performed (S314). ). The chord expansion process is a process of changing data stored in advance in, for example, the ROM 4 as a chord pattern based on the key code included in the automatic accompaniment data, the value of the chord type register CDTYPE, and the chord root register CDROOT. . By this chord expansion process, a musical sound to be generated as an accompaniment sound is determined. Note that this type of code expansion processing is a well-known technique, and is described in, for example, Japanese Patent Laid-Open No. 4-30197, and thus detailed description thereof is omitted here.
[0074]
Now, when the accompaniment sound to be generated is determined by the chord development process, the accompaniment sound data is sent to the musical tone generation circuit 14 to perform the accompaniment sound generation process (S316). As a result, a tone signal is generated by the sound source 18 and an accompaniment sound is generated via the sound system 16.
[0075]
Subsequently, it is determined whether or not it is a mute timing (S318). Specifically, it is checked whether or not the sounding time of the musical sound being sounded has passed the time designated by the gate time in the automatic accompaniment data instructing the sounding. If it is determined that it is not the mute timing (S318: NO), the automatic accompaniment process is immediately terminated. On the other hand, when it is determined that it is the mute timing (S318: YES), the mute processing of the musical sound that has reached the mute timing is performed (S320). This is done by sending information to the tone generation circuit 14 that the tone should be muted. As a result, in the musical tone generation circuit 14, the assignment memory 14a corresponding to the musical tone to be muted is cleared, and the generation of the musical tone (ie accompaniment tone) is stopped. When the mute process is finished, the automatic accompaniment process is finished.
[0076]
When the automatic accompaniment process shown in FIG. 6 is finished in this way, the process of S286 in FIG. 5 is finished, and the second chord performance process shown in FIG. 5 is finished. When the second chord performance process is finished, the process of S40 in FIG. 2 is finished, and thereafter, the process returns to S15 again and this process is repeated.
[0077]
Next, the first timer interrupt process and the second timer interrupt process executed at regular intervals will be described. These interrupt processes are processes executed by the CPU 2 when an interrupt signal is generated every predetermined time (1 msec in the present embodiment) by the timer 2a. The first timer interrupt processing is started when an interrupt signal is input from the timer 2a when the AOC flag = “1”, and the second timer interrupt processing is AOC flag ≠ “1”. In addition, when the AUTO flag = “1”, the process is started when an interrupt signal is input from the timer 2a.
[0078]
First, the first timer interrupt process will be described.
When the first timer interrupt process is started, the CPU 2 first determines whether or not the timer register TIMER is “0” (S405). If the timer register TIMER is “0” (S405: YES), the CPU 2 immediately determines. The first timer interrupt process is terminated. On the other hand, if the timer register TIMER is not “0” (S405: NO), the value of the timer register TIMER is decreased by “1” (S410), and as a result, it is determined whether or not the value of the timer register TIMER has become “0”. Judgment is made (S420). Note that the value of the timer register TIMER being “0” means that it is the timing at which code detection should be performed.
[0079]
If the value of the timer register TIMER is not “0” (S420: NO), the first timer interrupt process is immediately terminated. On the other hand, if the value of the timer register TIMER is “0” (S420: YES), it is determined whether or not all of the plurality of lower key first contacts LwSW1 are in an off state (S430).
[0080]
Here, if any of the plurality of first contacts LwSW1 of the lower key is on (S430: NO), the code type and the key of the key for which the first contact LwSW1 is on are determined based on the key code of the key. A code route is determined (S440). The code type and code route determined here are stored in the code type register CDTYPE and the code route register CDROOT, respectively. The code detection based on such a key code is a well-known technique described in, for example, Japanese Patent Publication No. 56-51630, Japanese Patent Laid-Open No. 4-311000, and the like, and thus detailed description thereof is omitted here.
[0081]
Subsequently, it is determined whether or not all of the plurality of lower key second contacts LwSW2 are in the OFF state (S445). Here, if all the second contacts LwSW2 are in the off state (S445: YES), the first timer interrupt process is immediately terminated. On the other hand, if any one of the plurality of second contacts LwSW2 is on (S445: NO), a new chord is created based on the values stored in the code type register CDTYPE and the code root register CDROOT (S450). . Since the specific processing procedure is the same as the processing of S232 already described, detailed description thereof is omitted here.
[0082]
Subsequently, it is determined whether or not a chord is already being generated (S460). Here, it is determined that the sound is being generated because a chord (hereinafter referred to as an old chord) has already been created based on the values of the chord type register CDTYPE and chord root register CDROOT before the processing of S450. This is a case where the sound system 16 produces a chord. If the old chord is not sounded (S460: NO), the CPU 2 causes the sound system 16 to sound a new chord (S465) and ends the first timer interrupt process. In the process of S465, when a new chord is sounded, the tone generation circuit 14 is controlled based on the latest touch data for the lower key created in S264.
[0083]
On the other hand, if the old chord is being pronounced (S460: YES), the musical tone generation circuit 14 is controlled so that the constituent sounds that are not included in the new chord among the constituents of the old chord currently being pronounced are controlled. The sound is muted (S470). Then, of the musical tones that constitute the new chord, those that are not included in the old chord that is currently sounding are caused to sound from the sound system 16 (S480), and the first timer interruption process is terminated.
[0084]
On the other hand, if all of the first contacts LwSW1 of the lower key are in the OFF state at the time of the processing of S430 (S430: YES), “FFh” is stored in the code type register CDTYPE and the code root register CDROOT (S490). ).
[0085]
Then, it is determined whether or not the chord is already sounding (S500). If the chord is not sounded (S500: NO), the timer interruption process is immediately terminated. On the other hand, if a chord is being sounded (S500: YES), the musical tone generating circuit 14 is controlled to mute the sounding chord (S510), and the first timer interrupt process is terminated.
[0086]
Next, the second timer interrupt process will be described.
When the second timer interrupt process is started, the CPU 2 first decreases the value of the timer register TIMER by “1” (S610), and as a result, determines whether or not the value of the timer register TIMER has become “0” ( S620).
[0087]
If the value of the timer register TIMER is not “0” (S620: NO), the second timer interrupt process is immediately terminated. On the other hand, if the value of the timer register TIMER is “0” (S620: YES), it is determined whether or not all of the plurality of lower key first contacts LwSW1 are in the off state (S630).
[0088]
Here, if one of the plurality of first contacts LwSW1 of the lower key is on (S630: NO), the code type and the key of the key for which the first contact LwSW1 is on are determined based on the key code of the key. A code route is determined (S640). Since the specific processing content of S640 is the same as the processing of S440 in the first timer interrupt processing already described, its detailed description is omitted.
[0089]
Subsequently, it is determined whether or not all of the plurality of lower key second contacts LwSW2 are in an off state (S645). If all the second contacts LwSW2 are off (S645: YES), the second timer interrupt process is immediately terminated. On the other hand, if any one of the plurality of second contacts LwSW2 is on (S645: NO), the chord development of the automatic accompaniment data in the ROM 4 that is currently at the sounding timing is developed (S650). Since this code expansion processing is the same as the processing of S314 already described, detailed description thereof is omitted here.
[0090]
Subsequently, it is checked whether or not an automatic accompaniment sound (hereinafter referred to as an old accompaniment sound) is already being generated (S660). If the old accompaniment sound is not being generated (S660: NO), the new accompaniment sound determined in the chord expansion process of S650 is generated from the sound system 16 (S665), and the second timer interrupt process is terminated.
[0091]
On the other hand, if the old accompaniment sound is being pronounced (S660: YES), the musical sound generating circuit 14 is controlled to select constituent sounds that are not included in the new accompaniment sound among the constituent sounds of the old accompaniment sound that is currently sounding. The sound is muted (S670). Then, among the musical sounds constituting the new accompaniment sound, those not included in the old accompaniment sound that is currently sounding are sounded from the sound system 16 (S680), and the second timer interruption process is ended.
[0092]
On the other hand, if all of the first contacts LwSW1 of the lower key are in the OFF state at the time of the processing of S630 (S630: YES), “FFh” is stored in the code type register CDTYPE and the code root register CDROOT respectively ( S690).
[0093]
Then, it is determined whether or not the automatic accompaniment sound is already being generated (S700). If the automatic accompaniment sound is not generated (S700: NO), the second timer interruption process is immediately terminated. . On the other hand, when the automatic accompaniment sound is being generated (S700: YES), the musical sound generating circuit 14 is controlled to mute the automatic accompaniment sound being generated (S510), and the second timer interruption process is terminated. The accompaniment sound is not generated by the processing of S690 to S710, but the rhythm accompaniment is continued because the S / S flag remains “1”.
[0094]
Through the processing described above, chords are generated from the electronic musical instrument at the timing shown in the timing chart of FIG. FIG. 10 is a timing chart when the electronic musical instrument is in the AOC mode. In the following description, where necessary, the reference numerals attached to the respective processing steps in the flowchart of FIG. 4 or FIG.
[0095]
FIG. 10A shows the on / off states of the first contact LwSW1 and the second contact LwSW2 of the three lower keys (in the order of pressing, “1st key”, “2nd key”, and “3rd key”). ing.
First, when the 1st key is pressed and the first contact LwSW1 is turned on (S210: YES), counting of the key press waiting time ΔTon is started. After that, when the 2nd key is pressed and the first contact LwSW1 is turned on (S210: YES), the first key contact LwSW1 of the 1st key is turned on and before the key pressing waiting time ΔTon elapses. However, the timing is interrupted, and the timing of the key pressing waiting time ΔTon is newly started from the beginning (S220). After the first contact LwSW1 of the 2nd key is turned on, when the 3rd key is further pressed to turn on the first contact LwSW1 (S210: YES), the first contact LwSW1 of the 2nd key is turned on. Even before the key press waiting time ΔTon elapses, the timing is interrupted, and the key press waiting time ΔTon is started from the beginning (S220).
[0096]
After the first contact LwSW1 of the 3rd key is turned on (S210: YES), when the second contact LwSW2 of the 1st key is turned on (S222: YES), this is an on event at the first second contact LwSW2 ( S226: YES), at that time (time t1), code detection is immediately performed (S230), even though the time t2 at which the key press waiting time ΔTon that started time measurement has not elapsed has been reached (S230). TIMER is reset (S231), a new chord is created (S232), and a new chord is generated (S234).
[0097]
After this, the second contact LwSW2 of the 2nd key and the 3rd key is sequentially turned on (S222: YES), but at this time, it is not an on event at the first second contact LwSW2 (S226: NO), Since the timer register TIMER has already been reset (S405: YES), only the chord that has already been sounded is continuously sounded.
[0098]
If a new chord is sounded in this way, it is not necessary to wait for the key press waiting time ΔTon to elapse, so that it is possible to generate a sound more quickly than the one waiting for the key press waiting time ΔTon to elapse. In addition, since the chord is determined based on the ON state of the first contact LwSW1, the player's intention is accurately determined even though it is uncertain whether or not the second contact LwSW2 is in the key depression state. There is a high possibility of generating chords that reflect this.
[0099]
Now, when the 2nd key and 3rd key are released in this order after the 1st key to 3rd key are pressed as described above, the second contact LwSW2 of the 2nd key is first turned off. Then (S236: YES), the timing of the key release waiting time ΔToff is started (S238). After that, when the 3rd key is released and the second contact LwSW2 is turned off (S236: YES), before the key release waiting time ΔToff elapses after the second contact LwSW2 of the 2nd key is turned off. However, the timing is interrupted, and the timing of the key release waiting time ΔToff is newly started from the beginning (S238).
[0100]
After the second contact LwSW2 of the 3rd key is turned off (S236: YES), when the key release waiting time ΔToff is completed without being interrupted without any key pressing / releasing operation of the lower key (time t3) ), Code detection is performed (S440). In this case, the code is detected based only on the 1st key. Then, a new chord is created (S450), and since the old chord is being pronounced (S460: YES), the musical tone that does not constitute the new chord is muted (S470), and the musical tone of the pitch that constitutes the new chord is obtained. A pronunciation is generated (S480).
[0101]
As described above, in the electronic musical instrument of the present embodiment, the musician (chord, automatic accompaniment sound) related to the chord is generated just by the player specifying the chord by operating several lower keys. For example, even a beginner can generate a complicated accompaniment sound with a simple operation.
[0102]
In particular, when a key pressing operation is performed, if a state change to the key pressing state is detected by the second contact LwSW2, a combination of keys in the key pressing state based on the detection result of the state change by the first contact LwSW1. Therefore, the time lag from the start of the key pressing operation to the time when the performance sound is generated is shortened as compared with the case where the chord detection is performed after the key pressing waiting time ΔTon has elapsed. In addition, since the chord detection is performed after the reliable state change is detected at the second contact LwSW2, the player's intention is compared to the case where the chord detection is performed when the state change is detected at the first contact LwSW1. Can generate a musical sound that is more accurately reflected.
[0103]
Therefore, according to the electronic musical instrument of this embodiment, the response after the key pressing operation is improved, and the performer does not feel uncomfortable with the delay in the generation of the performance sound. In addition, the probability that a musical sound related to a chord that is not intended by the performer will be reduced, and the performer can perform comfortably as expected.
[0104]
Further, in the electronic musical instrument of the present embodiment, a new chord is created immediately only for the first on-event of the second contact LwSW2, so even if the on-event of the second contact LwSW2 occurs later, Thus, the creation of new chords is not repeated, and the processing burden on the musical tone generating means can be suppressed.
[0105]
Note that the electronic musical instrument described above corresponds to one that employs the configuration according to the first and second aspects.
As mentioned above, although embodiment of this invention was described, various specific forms other than the above can be considered about embodiment of this invention. Hereinafter, useful modifications will be described.
[0106]
First, the first modification will be described.
In the electronic musical instrument of the above embodiment, the first chord performance process shown in FIG. 4 is adopted, but instead, a first chord performance process as shown in FIG. 11 may be adopted. The process of FIG. 11 employs the processes of S225, S227, and S229 instead of the processes of S226, S228, S230, and S231 during the process of FIG. In the following, the process of FIG. 11 will be described. However, since there are many overlapping parts in the two processes shown in FIGS. 4 and 11, only the processes of S225, S227, and S229 will be described in detail below. The other processing steps are denoted by the same reference numerals in both flowcharts, and the description thereof is omitted.
[0107]
After the first chord performance process shown in FIG. 11 is started, the CPU 2 creates touch data when an on event occurs in any one of the plurality of second key contacts LwSW2 of the lower key (S222: YES) (S224).
Subsequently, based on the SW1 bitmap SW1BMP, values to be newly stored in the code type register CDTYPE and the code route register CDROOT are determined (S225). As a result of the processing in S225, the values of the code type register CDTYPE and the code route register CDROOT are quickly determined without waiting for the key pressing waiting time ΔTon to elapse. In the process of S225, when a state change is detected by the second contact LwSW2 (second detection means), a key in a key-pressed state is detected based on the detection result of the state change by the first contact LwSW1 (first detection means). This is a process for detecting a code corresponding to a combination, and is a process corresponding to the main part of the present invention.
[0108]
When the processing in S225 is completed, “0” is set in the timer register TIMER (S227), and it is determined whether or not the code type register CDTYPE and the code root register CDROOT have been changed (S229). Specifically, before the new value determined in the process of S225 is stored in the code type register CDTYPE and the code root register CDROOT, the values stored in the code type register CDTYPE and the code root register CDROOT at that time. Is stored in an appropriate memory area, and the old and new values are compared.
[0109]
Here, if both the chord type register CDTYPE and the chord root register CDROOT have not been changed (S229: NO), the first chord performance process is immediately terminated.
On the other hand, if at least one of the code type register CDTYPE and the chord root register CDROOT is changed (S229: YES), a new chord is created based on the values stored in the chord type register CDTYPE and the chord root register CDROOT. (S232).
[0110]
The processing subsequent to S232 and other processing that has not been described are the same as the processing shown in FIG.
When the first chord performance process as described above is adopted, different from the first chord performance process of FIG. 4, every time there is an on event of the second contact LwSW2, it is reconfirmed whether or not a new chord should be created. (S229), the possibility that the chord intended by the performer can be accurately generated is further increased.
[0111]
Next, a second modification will be described.
In the electronic musical instrument of the above embodiment, the second chord performance process shown in FIG. 5 and the second timer interrupt process shown in FIG. 9 are employed. Instead, the second chord performance process shown in FIG. You may employ | adopt a 2nd chord performance process and a 2nd timer interruption process as shown in FIG. In the process of FIG. 12, the processes of S266, S267, and S268 in the process of FIG. 5 are deleted, and instead, the processes of S290, S292, S294, and S296 are adopted. In the process of FIG. 13, the process of S640 in the process of FIG. 9 is deleted, and the process of S605 and S641 is adopted instead. Also in the following description, the processing adopted as an alternative will be described in detail, and the other processing steps will be denoted by the same reference numerals as those in the flowchart shown above, and the description thereof will be omitted.
[0112]
After the second chord performance process shown in FIG. 12 is started, the CPU 2 creates touch data (S264) when an on event occurs in any one of the plurality of second key contacts LwSW2 of the lower key (S262: YES). It is determined whether or not the second contact LwSW2 is an on-event (S265).
[0113]
Here, if it is the first on-event of the second contact LwSW2 (S265: YES), it is checked whether or not the S / S flag is “0” (S290), and if the S / S flag is “1”. (S290: YES), it is checked whether or not the AUTO flag is “1” (S269). If the AUTO flag is “1” (S269: YES), the S / S flag is set to “1” (S270), and based on the SW1 bitmap SW1BMP, a new code type register CDTYPE and code root register CDROOT are set. The value to be stored in is determined (S292). As a result of the process of S292, the values of the code type register CDTYPE and the code root register CDROOT are quickly determined without waiting for the key pressing waiting time ΔTon to elapse. In the process of S292, when a state change is detected by the second contact LwSW2 (second detection means), a key in a key-pressed state is detected based on the detection result of the state change by the first contact LwSW1 (first detection means). This is a process for detecting a code corresponding to a combination, and is a process corresponding to the main part of the present invention. When the process of S292 is completed, the process proceeds to S296.
[0114]
On the other hand, when it is determined in the process of S265 that it is not the first on-event of the second contact LwSW2 (S265: NO), or when the S / S flag is not “1” during the process of S290 ( S290: NO), or if the AUTO flag is not “1” during the process of S269 (S269: NO), a new code type register CDTYPE and a new code type register CDTYPE are generated based on the SW2 bitmap SW2BMP. A value to be stored in the code root register CDROOT is determined (S294). In the process of S294, when the state change is detected by the second contact LwSW2 (second detection means), the key in the key depression state is detected based on the detection result of the state change by the second contact LwSW2 (second detection means). This is processing for detecting a code corresponding to the combination, and is processing corresponding to the configuration according to claim 4. When the process of S292 is completed, the process proceeds to S296.
[0115]
Thus, when the processing of S292 or S294 is completed, “0” is set in the timer register TIMER (S296), and the process proceeds to S280. Hereinafter, the processing subsequent to S280 and other processing not described are the same as the processing shown in FIG.
[0116]
On the other hand, in the second timer interrupt process shown in FIG. 13, it is first determined whether or not the value of the timer register TIMER is “0” (S605), and only when it is not “0” (S605: NO). Then, the process proceeds to the processes after S610, and if it is “0” (S605: YES), the second timer interrupt process is immediately finished. By adding such processing, when the timer register TIMER is set to “0” in the second chord performance processing shown in FIG. 12, the second timer interrupt processing can be completed promptly.
[0117]
In the second timer interrupt process shown in FIG. 13, if any one of the plurality of first contacts LwSW1 of the lower key is on (S630: NO), the key for which the second contact LwSW2 is on Based on the key code of the key, a code type and a code route are determined (S641). The processing after S645 following the processing of S641 is the same as the processing shown in FIG.
[0118]
When the second chord performance process and the second timer interrupt process as described above are employed, unlike the case where the second chord performance process of FIG. 5 and the second timer interrupt process of FIG. When the first key depression (S265) is not yet in the state of automatic accompaniment (S269) and automatic accompaniment is set (S292), the state of the first contact LwSW1 is changed. Based on the detection result, the key combination in the key-pressed state is determined. Therefore, the time lag from the start time of the key pressing / key release operation to the time when the performance sound is generated is shortened as compared with the case where the chord detection is performed after the key pressing waiting time ΔTon has elapsed. On the other hand, when the key has already been pressed, or when the automatic accompaniment is already being performed, or when the automatic accompaniment is not set, a certain state change is detected at the second contact LwSW2. Perform code detection above. Therefore, it is possible to generate a musical sound in which the intention of the performer is reflected more accurately than in the case where chord detection is performed when the state change is detected at the first contact LwSW1.
[0119]
Therefore, according to the electronic musical instrument of the present embodiment, the response after the key pressing / releasing operation is improved when automatic accompaniment is started, and the player does not feel uncomfortable with the delay of the accompaniment sound generation. In addition, when a performance sound other than the automatic accompaniment is generated during automatic accompaniment, the probability that a musical sound related to a chord that is not intended by the performer is reduced.
[0120]
Next, a third modification will be described.
The electronic musical instrument described as the third modified example further restricts the conditions for performing chord detection based on the first contact LwSW1 with respect to the electronic musical instrument described as the second modified example.
[0121]
That is, in the second modification, the first key depression from the silent state (S265) is not yet in automatic accompaniment (S269), and automatic accompaniment is set (S292). The code is detected based on the detection result of the state change by the first contact LwSW1 on the condition that it is in the state, but the electronic musical instrument of the third modified example further has “1” set in the SYNC flag. To the above conditions.
[0122]
The SYNC flag is set to “1” when the SYNC switch is turned on and the performance in the synchro start mode is set.
Therefore, according to the electronic musical instrument configured in this way, the response after the key pressing / releasing operation is improved when the automatic accompaniment is started in the synchro start mode, and the performer feels uncomfortable with the delay of the accompaniment sound generation. Never remember. In addition, when automatic accompaniment is not performed in the synchro start mode, automatic accompaniment is already performed even in the synchro start mode, or a performance sound other than automatic accompaniment is generated, etc. The probability that a musical sound will occur is low.
[0123]
Note that the electronic musical instrument described in the third modification corresponds to one that employs the configuration described in claim 5 above.
Next, a fourth modification will be described.
Each of the electronic musical instruments described as the embodiment of the present invention is intended to eliminate the time lag at the time of the key pressing operation. However, the main part of the present invention is to detect one of the detection means following the one of the detection means. If the means detects a state change, the code is detected based on the detection result of the state change by one of the detecting means, and this is also applicable to the key release operation.
[0124]
That is, in the electronic musical instrument of the above embodiment, when the key release operation is performed, the second contact LwSW2 is turned off, and the first contact LwSW1 is subsequently turned off. When turned off, code detection is performed from the second contact LwSW2 that remains in the on state.
[0125]
According to the thus configured electronic musical instrument, when a key release operation is performed, if a state change to the key release state is detected by the first contact LwSW1, the state change detection result by the second contact LwSW2 is used. To determine the combination of keys in the key-pressed state. Therefore, the time lag from the time when the key release operation is started to the time when the performance sound is generated according to the new chord is shortened, compared to the case where the chord detection is performed after the key release waiting time ΔToff has elapsed. Specifically, as shown in FIG. 10, when chord detection is performed after waiting for the elapse of the waiting time ΔToff, chord detection is performed at time t3. Chord detection can be performed at time t4 earlier than time t3.
[0126]
Moreover, since the code detection is performed after the change to the reliable key release state is detected at the first contact LwSW1, compared to the case where the code detection is triggered when the state change is detected at the second contact LwSW2. A musical sound that more accurately reflects the intention of the performer can be generated.
Therefore, according to the electronic musical instrument of the present embodiment, the response after the key release operation is improved, and the performer does not feel uncomfortable with the delay in the performance sound generation. In addition, the probability that a musical sound related to a chord that is not intended by the performer will be reduced, and the performer can perform comfortably as expected.
[0127]
Note that the electronic musical instrument described in the fourth modification corresponds to one that employs the configuration described in claim 3 above.
[Brief description of the drawings]
FIG. 1 is a configuration diagram of an electronic musical instrument as an embodiment of the present invention.
FIG. 2 is a flowchart of a main routine.
FIG. 3 is a flowchart showing a normal performance process.
FIG. 4 is a flowchart showing a first chord performance process.
FIG. 5 is a flowchart showing a second chord performance process.
FIG. 6 is a flowchart showing an automatic performance process.
FIG. 7 is a diagram showing a chord table used when obtaining a tone related to a chord.
FIG. 8 is a flowchart showing a first timer interrupt process.
FIG. 9 is a flowchart showing a second timer interrupt process.
FIG. 10 is a time chart showing a specific example of processing timing associated with a keyboard operation.
FIG. 11 is a flowchart showing a first chord performance process different from FIG.
FIG. 12 is a flowchart showing a second chord performance process different from FIG.
FIG. 13 is a flowchart showing a second timer interrupt process different from FIG. 9;
[Explanation of symbols]
2 ... CPU, 2a ... timer, 4 ... ROM, 6 ... RAM, 8 ... auto counter, 10 ... panel, 12 ... keyboard, 14 ... musical sound generating circuit 14a ... Assignment memory, 16 ... Sound system, 18 ... Sound source, 21 ... Bus.

Claims (5)

演奏者に操作されて押鍵状態または離鍵状態となる複数の鍵と、前記押鍵状態/離鍵状態のいずれか一方から他方への状態変化時に、前記鍵の動作速度に応じた時間差を検知可能であり、鍵の状態検知を保持する第1,第2検知手段と、前記押鍵状態にある鍵の組み合わせを検知して、対応するコードを検出するコード検出手段と、該コード検出手段により検出されたコードに係る楽音を発生させる楽音発生手段とを備えた電子楽器において、
前記押鍵状態にある鍵の組み合わせを検知する際の各鍵の押鍵状態の検知は、前記第1,第2検知手段の、検知順序において後で状態変化を検知した検知手段の検知時に、先に状態変化を検知した検知手段による状態の検知結果に基づいて為され、
該押鍵状態検知結果に基づいた鍵の組み合わせに対応するコードを検出する
ことを特徴とする電子楽器。
A plurality of keys to be depressed state or the released state is operated in the player, at the state change from one of the pressed key state / key-off state to the other, the time difference corresponding to the operation speed of the key a possible detection knowledge, the first holding state detection key, the second detecting means, detects a combination of keys on the key depression, a code detecting means for detecting the corresponding code, the code detection In an electronic musical instrument comprising a musical sound generating means for generating a musical sound related to a chord detected by the means,
The detection of the key pressing state of each key when detecting the combination of keys in the key pressing state is performed by the first and second detecting means when detecting the detecting means that detects the state change later in the detection order. Based on the detection result of the state by the detection means that detected the state change first,
An electronic musical instrument characterized by detecting a chord corresponding to a key combination based on the key depression state detection result .
前記第1,第2検知手段が、第1検知手段、第2検知手段の順序で、離鍵状態から押鍵状態への状態変化を検知する際、前記コード検出手段が、前記第2検知手段によって前記状態変化を検知したら、前記第1検知手段による前記状態変化の検知結果に基づいて、前記押鍵状態にある鍵の組み合わせに対応するコードを検出する
ことを特徴とする請求項1に記載の電子楽器。
When the first and second detection means detect a change in state from the key release state to the key depression state in the order of the first detection means and the second detection means, the code detection means is configured to detect the second detection means. The code corresponding to the key combination in the key pressing state is detected based on a detection result of the state change by the first detection unit when the state change is detected by the first detection unit. Electronic musical instruments.
前記第1,第2検知手段が、第2検知手段、第1検知手段の順序で、押鍵状態から離鍵状態への状態変化を検知する際、前記コード検出手段が、前記第1検知手段によって前記状態変化を検知したら、前記第2検知手段による前記状態変化の検知結果に基づいて、前記押鍵状態にある鍵の組み合わせに対応するコードを検出する
ことを特徴とする請求項1または請求項2のいずれかに記載の電子楽器。
When the first and second detection means detect a change in state from the key-pressed state to the key-released state in the order of the second detection means and the first detection means, the code detection means is the first detection means 2. The code according to claim 1 or 2, wherein the code corresponding to the key combination in the key pressing state is detected based on the detection result of the state change by the second detection means. Item 3. The electronic musical instrument according to any one of Items 2 to 3.
前記第1,第2検知手段が、一方の検知手段、他方の検知手段の順序で前記状態変化を検知した際、当該状態変化前に押鍵状態にある鍵が存在していた場合には、前記コード検出手段が、前記他方の検知手段によって前記状態変化を検知したら、前記他方の検知手段による前記状態変化の検知結果に基づいて、前記押鍵状態にある鍵の組み合わせに対応するコードを検出する
ことを特徴とする請求項1〜請求項3のいずれかに記載の電子楽器。
When the first and second detection means detect the state change in the order of one detection means and the other detection means, and there is a key in a key depression state before the state change, When the code detection means detects the state change by the other detection means, a code corresponding to the key combination in the key depression state is detected based on the detection result of the state change by the other detection means. The electronic musical instrument according to any one of claims 1 to 3, wherein:
さらに、押鍵操作の開始と同時に前記楽音発生手段による楽音の発生を開始するシンクロスタートモードで演奏するか否かを設定可能なモード設定手段を備え、
前記第1,第2検知手段が、一方の検知手段、他方の検知手段の順序で前記状態変化を検知した際、前記モード設定手段によってシンクロスタートモードで演奏する旨の設定がなされていない場合には、前記コード検出手段が、前記他方の検知手段によって前記状態変化を検知したら、前記他方の検知手段による前記状態変化の検知結果に基づいて、前記押鍵状態にある鍵の組み合わせに対応するコードを検出する
ことを特徴とする請求項1〜請求項4のいずれかに記載の電子楽器。
Furthermore, it comprises mode setting means capable of setting whether or not to perform in the synchro start mode in which generation of musical sounds by the musical sound generating means is started simultaneously with the start of a key pressing operation,
When the first and second detection means detect the change in state in the order of one detection means and the other detection means, and the mode setting means is not set to perform in the synchro start mode. When the code detection means detects the state change by the other detection means, the code corresponding to the key combination in the key-pressed state based on the detection result of the state change by the other detection means The electronic musical instrument according to claim 1, wherein the electronic musical instrument is detected.
JP34556898A 1998-12-04 1998-12-04 Electronic musical instruments Expired - Fee Related JP3626863B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP34556898A JP3626863B2 (en) 1998-12-04 1998-12-04 Electronic musical instruments

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP34556898A JP3626863B2 (en) 1998-12-04 1998-12-04 Electronic musical instruments

Publications (2)

Publication Number Publication Date
JP2000172268A JP2000172268A (en) 2000-06-23
JP3626863B2 true JP3626863B2 (en) 2005-03-09

Family

ID=18377478

Family Applications (1)

Application Number Title Priority Date Filing Date
JP34556898A Expired - Fee Related JP3626863B2 (en) 1998-12-04 1998-12-04 Electronic musical instruments

Country Status (1)

Country Link
JP (1) JP3626863B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014134716A (en) * 2013-01-11 2014-07-24 Yamaha Corp Musical signal generation device, musical signal generation program and musical signal generation method

Also Published As

Publication number Publication date
JP2000172268A (en) 2000-06-23

Similar Documents

Publication Publication Date Title
JP2560372B2 (en) Automatic playing device
US7339105B2 (en) Automatic musical performance device
JP2005043553A (en) Sound generation control program and electronic keyboard musical instrument using the program
US10657941B2 (en) Electronic musical instrument and lesson processing method for electronic musical instrument
JP3626863B2 (en) Electronic musical instruments
JPH06289857A (en) Electronic musical instrument provided with speech input function
JP3728626B2 (en) Code discrimination device
JP2006065186A (en) Device and method for tempo information output, computer program for tempo information output, device and method for touch information output, and computer program for touch information output
JP3192579B2 (en) Automatic performance device and automatic performance method
JP4056902B2 (en) Automatic performance apparatus and automatic performance method
JP4121080B2 (en) Electronic keyboard instrument
JP3319043B2 (en) Automatic performance device
JP5640308B2 (en) Performance device and performance processing program
JP4424310B2 (en) Electronic musical instruments
JP3471480B2 (en) Tempo control device
JP3252914B2 (en) Electronic wind instrument
JP3862988B2 (en) Electronic musical instruments
JP2522906Y2 (en) Electronic musical instrument
JP2513014B2 (en) Electronic musical instrument automatic performance device
JP3682691B2 (en) Electronic music apparatus having musical tone information assigning operator
JP3585722B2 (en) Automatic accompaniment device
JP5449963B2 (en) Automatic melody performance device and program for automatic melody performance function
JP3620321B2 (en) Automatic accompaniment device
JPH0746273B2 (en) Automatic accompaniment device
JP2001051680A (en) Device and method for deciding code and medium recording code deciding method

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20040809

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040824

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20041019

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20041206

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees