JP2005141246A - Electronic keyboard musical instrument - Google Patents

Electronic keyboard musical instrument Download PDF

Info

Publication number
JP2005141246A
JP2005141246A JP2005009656A JP2005009656A JP2005141246A JP 2005141246 A JP2005141246 A JP 2005141246A JP 2005009656 A JP2005009656 A JP 2005009656A JP 2005009656 A JP2005009656 A JP 2005009656A JP 2005141246 A JP2005141246 A JP 2005141246A
Authority
JP
Japan
Prior art keywords
key
event
automatic performance
driving
time
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2005009656A
Other languages
Japanese (ja)
Other versions
JP3966328B2 (en
Inventor
Takamichi Masubuchi
孝道 増渕
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Yamaha Corp
Original Assignee
Yamaha Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Yamaha Corp filed Critical Yamaha Corp
Priority to JP2005009656A priority Critical patent/JP3966328B2/en
Publication of JP2005141246A publication Critical patent/JP2005141246A/en
Application granted granted Critical
Publication of JP3966328B2 publication Critical patent/JP3966328B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To generate musical sound during an automatic playing as well as to drive corresponding keys in a synchronous manner with generated musical sound in an electronic keyboard musical instrument. <P>SOLUTION: A CPU10 reproduces automatic playing events from a RAM12 and transmits driving instructions to a keyboard driving circuit 2. A key pressing detecting circuit 3 generates playing events by detecting the operations of a keyboard 1. The playing events include events corresponding to the keyboard playing of a player and invalidated events corresponding to automatic playing events and the CPU10 instructs a sound source circuit 7 on process electronic musical sound forming for the playing events other than the invalidated events. Moreover, the CPU10 premeasures the reaction time between the time when a driving instruction is given and the time when a playing event is generated. When an automatic playing is to be conducted, the CPU10 outputs a driving instruction to the key driving circuit 2 at the time, which is advanced earlier by the reaction time than the time of instructing a musical sound forming process corresponding to the automatic playing event. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

この発明は自動演奏機能を備えた電子鍵盤楽器に関する。   The present invention relates to an electronic keyboard instrument having an automatic performance function.

自動的に演奏を行う楽器として、いわゆる自動演奏ピアノのように鍵盤の鍵を演奏データに従って駆動することによりピアノの打弦機構を動作させて音を出すタイプのものと、電子的な音源により演奏データに従って楽音信号を形成する演奏機能付き電子楽器とがある。   Musical instruments that perform automatically, such as the so-called automatic performance piano, which uses a keyboard key according to the performance data to operate the piano's stringing mechanism to produce sound, and an electronic sound source There are electronic musical instruments with performance functions that form musical tone signals according to data.

ところで、上述のもののうち自動演奏ピアノは自動演奏の際に鍵が動くので演奏を聴くだけでなく見て楽しむことができるという利点がある。しかしながら、自動演奏ピアノの場合、ピアノの音しか発音させることができず、また、高価でもある。一方、演奏機能付き電子楽器は、電子的な音源により多彩な楽音を発生させることができ、自動ピアノに比べれば安価ではあるが、自動演奏時に楽音しか発生されないため、演奏を見て楽しむということができない。   By the way, among the above-mentioned ones, the automatic performance piano has an advantage that it can be enjoyed not only by listening to the performance because the key moves during the automatic performance. However, in the case of an auto-playing piano, only the sound of the piano can be pronounced, and it is also expensive. On the other hand, an electronic musical instrument with a performance function can generate a variety of musical sounds with an electronic sound source, and it is less expensive than an automatic piano, but only musical sounds are generated during automatic performance, so you can see and enjoy your performance. I can't.

この発明は、このような背景の下でなされたものであり、自動演奏の際に楽音が発生されるのみならず、これと同期して該当する鍵が駆動され、演奏を聴くだけでなく見て楽しむことができる電子鍵盤楽器を提供することを目的としている。   The present invention has been made under such a background, and not only a musical tone is generated during automatic performance, but also the corresponding key is driven in synchronization with this to not only listen to the performance but also watch it. The purpose is to provide an electronic keyboard instrument that can be enjoyed in the future.

請求項1に係る発明は、自動演奏イベントを発生する手段と、自動演奏イベントに基づく駆動指示に従って鍵盤を駆動する鍵駆動手段と、前記鍵盤の動作を検出することにより演奏イベントを発生する検出手段と、前記鍵駆動手段に対して前記駆動指示が与えられてから前記検出手段により演奏イベントが発生されるまでの反応時間を測定し、自動演奏の際には、前記自動演奏イベントに対応した楽音形成処理を楽音形成手段へ指示するとともに、この指示のタイミングよりも前記反応時間分だけ先行して該自動演奏イベントに対応した駆動指示を前記鍵駆動手段へ出力する制御手段とを具備することを特徴とする電子鍵盤楽器を要旨とする。   The invention according to claim 1 includes means for generating an automatic performance event, key driving means for driving a keyboard in accordance with a driving instruction based on the automatic performance event, and detection means for generating a performance event by detecting the operation of the keyboard. And a response time from when the driving instruction is given to the key driving means until a performance event is generated by the detection means, and in the case of automatic performance, a musical tone corresponding to the automatic performance event is measured. And a control means for instructing the musical tone formation means to perform a formation process and outputting a drive instruction corresponding to the automatic performance event to the key drive means prior to the timing of the instruction by the reaction time. The main feature is the electronic keyboard instrument.

請求項2に係る発明は、前記制御手段は、自動演奏に先立って前記反応時間を測定することを特徴とする請求項1記載の電子鍵盤楽器を要旨とする。   The gist of the electronic keyboard instrument according to claim 1 is that the control means measures the reaction time prior to automatic performance.

請求項3に係る発明は、前記制御手段は、自動演奏時に前記駆動指示を出力する際に前記反応時間を測定することを特徴とする請求項1記載の電子鍵盤楽器を要旨とする。   The invention according to claim 3 is summarized in the electronic keyboard instrument according to claim 1, wherein the control means measures the reaction time when outputting the driving instruction during automatic performance.

請求項4に係る発明は、前記制御手段は、前記自動演奏イベントの指定に従って複数種類の駆動強度に対応した駆動指示を前記鍵駆動手段へ出力するものであり、これらの複数種類の駆動強度について前記反応時間の測定を行うことを特徴とする請求項1記載の電子鍵盤楽器を要旨とする。   According to a fourth aspect of the present invention, the control means outputs a drive instruction corresponding to a plurality of types of driving intensities to the key driving means in accordance with the designation of the automatic performance event. The gist of the electronic keyboard instrument according to claim 1, wherein the reaction time is measured.

上記請求項1〜4に係る発明によれば、鍵の反応時間が測定され、この反応時間を考慮したタイミングで自動演奏イベントに対応した駆動指示が行われる。従って、自動演奏イベントに対応した楽音形成処理と鍵駆動とを同期化させることができる。   According to the first to fourth aspects of the present invention, the key reaction time is measured, and a drive instruction corresponding to the automatic performance event is given at a timing that takes this reaction time into consideration. Therefore, it is possible to synchronize the tone generation processing corresponding to the automatic performance event and the key drive.

請求項5に係る発明は、発音強度データを含む自動演奏イベントを発生する手段と、自動演奏イベントに基づく駆動指示に従って鍵盤を駆動する鍵駆動手段と、前記自動演奏イベントに対応した楽音形成処理を電子的な音源に指示して発音強度データに応じた強度の楽音を形成するとともに、該自動演奏イベントに含まれる発音強度データを該発音強度データの分解能よりも粗い閾値により量子化することにより鍵駆動強度を求め、この鍵駆動強度に従って鍵盤を駆動すべき旨の駆動指示を前記鍵駆動手段に供給する制御手段とを具備することを特徴とする電子鍵盤楽器を要旨とする。   The invention according to claim 5 includes means for generating an automatic performance event including pronunciation intensity data, key driving means for driving a keyboard in accordance with a drive instruction based on the automatic performance event, and musical tone formation processing corresponding to the automatic performance event. A key is generated by instructing an electronic sound source to form a musical tone having an intensity corresponding to the pronunciation intensity data, and quantizing the pronunciation intensity data included in the automatic performance event with a threshold coarser than the resolution of the pronunciation intensity data. The gist of the present invention is an electronic keyboard instrument characterized by comprising control means for obtaining drive strength and supplying a drive instruction to the key drive means to drive the keyboard in accordance with the key drive strength.

上記請求項5に係る発明によれば、自動演奏の際のベロシティよりは粗い精度ではあるが、このベロシティを鍵盤の押離鍵の速度に反映される。本発明において、自動演奏イベントに基づいて行われる押離鍵は楽音形成を目的としたものではなく、使用者が見て楽しむためのものであるが、押離鍵にある程度の強弱があった方が実際の演奏を見るのと同様な楽しみを与えることができる。本発明によれば、このような要求に応えることができる。   According to the fifth aspect of the present invention, although the accuracy is coarser than the velocity at the time of automatic performance, this velocity is reflected in the speed of the key pressed / released on the keyboard. In the present invention, the key pressed / released based on the automatic performance event is not intended for musical tone formation, but for the user to see and enjoy. Can give the same fun as watching an actual performance. According to the present invention, such a request can be met.

請求項6に係る発明は、自動演奏イベントを発生する手段と、自動演奏イベントに基づく駆動指示に従って鍵盤を駆動する鍵駆動手段と、前記鍵盤の動作を検出することにより演奏イベントを発生する検出手段と、前記検出手段により既に動作が検出されている鍵盤に対応する自動演奏イベントが発生した場合、該自動演奏イベントによる鍵盤駆動を中止するか、あるいは押鍵駆動後、即座に離鍵駆動を行う制御手段とを具備することを特徴とする電子鍵盤楽器を要旨とする。   The invention according to claim 6 is a means for generating an automatic performance event, a key driving means for driving a keyboard in accordance with a driving instruction based on the automatic performance event, and a detection means for generating a performance event by detecting the operation of the keyboard. When an automatic performance event corresponding to a keyboard whose operation has already been detected by the detecting means occurs, the keyboard driving by the automatic performance event is stopped, or the key release driving is performed immediately after the key pressing driving An electronic keyboard instrument characterized by comprising a control means.

上記請求項6に係る発明によれば、演奏者によって押鍵がされた後に自動演奏イベントが発生され、その自動演奏イベントによって鍵が押鍵駆動されている状態において該鍵に対する離鍵操作が演奏者によって行われた場合に、演奏者によって離鍵されたにも拘わらず鍵が戻らないといった不都合を防止することができる。   According to the sixth aspect of the present invention, an automatic performance event is generated after a key is pressed by the performer, and a key release operation is performed when the key is driven by the automatic performance event. When performed by the performer, it is possible to prevent the inconvenience that the key does not return despite being released by the performer.

本発明に係る電子鍵盤楽器によれば、自動演奏の際に楽音が発生されるのみならず、これと同期して該当する鍵が駆動されるため、演奏を聴くだけでなく見て楽しむことができるという効果がある。   According to the electronic keyboard instrument of the present invention, not only the musical sound is generated during automatic performance, but also the corresponding key is driven in synchronization with this, so that not only listening to the performance but also enjoying watching it. There is an effect that can be done.

以下、本発明を更に理解しやすくするため、実施例について説明する。かかる実施例は、本発明の一態様を示すものであり、この発明を限定するものではなく、本発明の範囲で任意に変更可能である。   Hereinafter, examples will be described for easier understanding of the present invention. These examples show one aspect of the present invention, and do not limit the present invention, and can be arbitrarily changed within the scope of the present invention.

<第1実施例>
A.本実施例の構成
図1は本実施例による電子鍵盤楽器の構成を示すブロック図である。以下、この図を参照し、本実施例の構成について説明する。
<First embodiment>
A. 1 is a block diagram showing the configuration of an electronic keyboard instrument according to this embodiment. Hereinafter, the configuration of the present embodiment will be described with reference to FIG.

(1)鍵盤、鍵駆動手段および検出手段
図1において、1は多数の鍵が配備されてなる鍵盤、2は自動演奏の際に鍵盤1を構成する各鍵を駆動するための鍵駆動回路である。また、3は押鍵検出回路であり、この押鍵検出回路3を介して鍵盤1の各鍵の押鍵、離鍵が検出され、キーイベント(演奏イベント)が発生される。このキーイベントは押離鍵された鍵の番号を表すキーコードと押離鍵の速度を表すベロシティを含んでいる。
(1) Keyboard, key driving means and detection means In FIG. 1, 1 is a keyboard on which a large number of keys are arranged, and 2 is a key driving circuit for driving each key constituting the keyboard 1 during automatic performance. is there. Reference numeral 3 denotes a key depression detection circuit. Through the key depression detection circuit 3, key depression and key release of each key of the keyboard 1 are detected, and a key event (performance event) is generated. This key event includes a key code that represents the number of the key that has been pressed and released, and a velocity that represents the speed of the key that has been pressed and released.

図2は、鍵盤1における各鍵の取り付け構造を示すものであり、同図において101が鍵である。この図に示すように、鍵101は、支点102を中心に回動自在に支持されている。図2において鍵101の右端の部分が演奏者と対面する前端部であり、この部分はバネ103によって上方へ持上げられている。一方、鍵101の後端部の下方には駆動機構104が設けられている。この駆動機構104は鍵駆動のための手段としてソレノイド(図示略)を内蔵している。例えば押鍵駆動が行われる場合には、このソレノイドへの通電によって磁界が発生され、この磁界により鍵101の後端部下方に設けられた被駆動部104が上方へ突き上げ駆動され(矢印m)、この突き上げ駆動により、鍵101の前端部がバネ103の反発力に抗して降下される(矢印M)。駆動機構104による突き上げ駆動がされていないときには、演奏者が行う押鍵、離鍵操作は、何の妨げも受けない。各鍵を押鍵駆動あるいは離鍵駆動するためには各鍵に対応した駆動機構104のソレノイドに対する通電制御を行う必要があるが、この通電制御は図1における鍵盤駆動回路2を介して行われる。   FIG. 2 shows a structure for attaching each key in the keyboard 1, in which 101 is a key. As shown in this figure, the key 101 is supported so as to be rotatable about a fulcrum 102. In FIG. 2, the right end portion of the key 101 is a front end portion facing the performer, and this portion is lifted upward by a spring 103. On the other hand, a drive mechanism 104 is provided below the rear end of the key 101. The drive mechanism 104 incorporates a solenoid (not shown) as a key driving means. For example, when key-pressing is performed, a magnetic field is generated by energizing the solenoid, and the driven part 104 provided below the rear end of the key 101 is driven upward by this magnetic field (arrow m). By this push-up drive, the front end portion of the key 101 is lowered against the repulsive force of the spring 103 (arrow M). When the drive mechanism 104 is not driven to push up, the player's key pressing and key release operations are not hindered. In order to drive each key by pressing or releasing keys, it is necessary to perform energization control to the solenoid of the drive mechanism 104 corresponding to each key. This energization control is performed via the keyboard drive circuit 2 in FIG. .

(2)操作および表示のための手段
4はこの電子鍵盤楽器の操作パネル面に配備された各種スイッチ類、5はこれらの各スイッチのオン/オフ状態を検知するためのスイッチ検出回路、6は操作パネル面上のディスプレイ(図示略)に演奏者に対する各種メッセージの表示を行わせるための表示回路である。
(2) Means for operation and display 4 are various switches provided on the operation panel surface of the electronic keyboard instrument, 5 is a switch detection circuit for detecting the on / off state of each switch, and 6 is This is a display circuit for causing a display (not shown) on the operation panel surface to display various messages for the performer.

(3)楽音形成手段
7は電子的な構成により楽音信号を形成する音源回路である。この音源回路7によって形成された楽音信号は、効果回路8によって各種の音響的効果が付与され、サウンドシステムSSから楽音として発音される。これらの音源回路7、効果回路8およびサウンドシステムSSが本実施例における楽音形成手段を構成している。すなわち、本実施例は、上述のように鍵101を駆動するための鍵盤駆動回路2等を備えてはいるものの、これらによって行われる鍵駆動により打弦機構等を動作せしめて発音を行うものではなく、専らこの電子的な楽音形成手段によって楽音を出力するものである。
(3) Musical tone forming means 7 is a sound source circuit that forms a musical tone signal with an electronic configuration. The musical sound signal formed by the sound source circuit 7 is given various acoustic effects by the effect circuit 8 and is generated as a musical sound from the sound system SS. The tone generator circuit 7, the effect circuit 8 and the sound system SS constitute the musical tone forming means in this embodiment. In other words, the present embodiment includes the keyboard drive circuit 2 for driving the key 101 as described above, but does not perform sound generation by operating the string-striking mechanism or the like by the key drive performed by these. Rather, the electronic musical tone forming means outputs the musical tone exclusively.

(4)制御手段
図1において、CPU10、ROM11、RAM12およびタイマ13は、この電子鍵盤楽器の制御手段を構成している。すなわち、CPU10は、バスを介して図1に示される各部を制御することにより、この電子鍵盤楽器の所期の機能を提供するものである。ROM11はCPU10によって実行される制御プログラムを予め記憶している。RAM12はCPU10が制御を行う際に必要な各種制御情報の一時記憶等に使用される。また、自動演奏が行われる際にはイベントおよびデルタデータ(後述)からなる演奏データが演奏に先立ってこのRAM12に記憶される。タイマ13はCPU10が各種制御を行うタイミングを得るために設けられた手段であり、予め設定された時間間隔で定期的にタイマ割込み信号をCPU10に供給する。このタイマ割込み信号には、常に一定時間間隔で出力されるタイマ割込み信号のほか、自動演奏の設定テンポに応じた時間間隔で発生される自動演奏用タイマ割込み信号がある。通常、一定時間間隔のタイマ割込み信号は、自動演奏用タイマ割込み信号の発生周期よりも十分に短い周期(本実施例では1ms)で発生される。
(4) Control Means In FIG. 1, CPU 10, ROM 11, RAM 12 and timer 13 constitute control means for this electronic keyboard instrument. In other words, the CPU 10 provides the desired functions of the electronic keyboard instrument by controlling each unit shown in FIG. 1 via the bus. The ROM 11 stores a control program executed by the CPU 10 in advance. The RAM 12 is used for temporarily storing various control information necessary for the CPU 10 to perform control. When automatic performance is performed, performance data including event and delta data (described later) is stored in the RAM 12 prior to performance. The timer 13 is a means provided for obtaining a timing at which the CPU 10 performs various controls, and periodically supplies a timer interrupt signal to the CPU 10 at a preset time interval. In addition to the timer interrupt signal that is always output at a constant time interval, the timer interrupt signal includes an automatic performance timer interrupt signal that is generated at a time interval corresponding to the set tempo of automatic performance. Normally, the timer interrupt signal at regular time intervals is generated with a period (1 ms in this embodiment) sufficiently shorter than the generation period of the automatic performance timer interrupt signal.

本実施例においてCPU10が行う制御のうち主なものを挙げると次の通りである。   Among the controls performed by the CPU 10 in this embodiment, main ones are as follows.

a.通常の鍵盤演奏のための制御
この制御は、基本的には通常の電子鍵盤楽器において行われるものと同様である。すなわち、CPU10は、押鍵検出回路3を介してキーオンイベントおよびキーオフイベント(演奏イベント)を検出し、これらのキーイベントに応答して、音源回路7による発音および消音の制御を行う。ただし、本実施例においては、自動演奏時においても演奏者による鍵盤演奏を認めているため、押鍵検出回路3から検出される演奏イベントには自動演奏に対応したものと演奏者の鍵盤演奏に対応したものとが混在することとなり、その取り扱いが問題となる。なお、この取り扱いについては後述する。
a. Control for normal keyboard performance This control is basically the same as that performed in a normal electronic keyboard instrument. That is, the CPU 10 detects a key-on event and a key-off event (performance event) via the key-press detection circuit 3, and controls sound generation and mute by the sound source circuit 7 in response to these key events. However, in this embodiment, since the player is allowed to perform the keyboard even during the automatic performance, the performance event detected from the key depression detection circuit 3 corresponds to the automatic performance and the player's keyboard performance. Corresponding items are mixed, and the handling becomes a problem. This handling will be described later.

b.自動演奏のための制御
本実施例では、自動演奏に先立ち、演奏データがFDD15等から供給され、図3に例示するような態様でRAM12に記憶される。この図に示すように、演奏データはイベントとデルタタイムからなる一連のデータであり、RAM12内の連続した各アドレスにデルタタイム、イベント、デルタタイム、…という具合に順次交互に記憶されている。ここで、デルタタイムは、その直後にあるイベントをRAM12から読み出すまでの待機時間を指定する情報である。イベントは、楽音信号の形成に関連した指示を行う情報であり、キーイベント(自動演奏イベント)の他、音色設定等の制御情報も含まれる。キーイベントには、発音を指示するキーオンイベントと消音を指示するキーオフイベントがある。また、キーイベントには発音または消音の対象となる音高(すなわち、電子鍵盤楽器においては鍵の番号)を指定するキーコード、発音の強度を指定するベロシティが含まれている。自動演奏開始の指示が与えられた場合、CPU10は、これらの演奏データをRAM12から逐次読み出し、この演奏データに従って音源回路7の楽音信号形成処理を制御し、自動演奏を行う。
b. Control for Automatic Performance In this embodiment, prior to automatic performance, performance data is supplied from the FDD 15 or the like and stored in the RAM 12 in the manner illustrated in FIG. As shown in this figure, the performance data is a series of data composed of events and delta times, and is sequentially stored alternately at successive addresses in the RAM 12, such as delta time, event, delta time,. Here, the delta time is information for designating a waiting time until an event immediately after that is read from the RAM 12. The event is information for giving an instruction related to the formation of a musical tone signal, and includes control information such as tone color setting in addition to a key event (automatic performance event). The key event includes a key-on event for instructing sound generation and a key-off event for instructing mute. The key event includes a key code for designating a pitch to be sounded or muted (that is, a key number for an electronic keyboard instrument) and a velocity for designating the strength of sounding. When an instruction to start automatic performance is given, the CPU 10 sequentially reads out the performance data from the RAM 12, controls the musical tone signal forming process of the tone generator circuit 7 according to the performance data, and performs automatic performance.

また、本実施例における自動演奏は、音による演出のみならず、これに合わせて鍵の動きによる演出を行うものである。すなわち、CPU10は、キーイベントをRAM12から読み出した場合、これに応答した楽音形成の制御を行うのみならず、このキーイベントに対応した鍵を押鍵駆動あるいは離鍵駆動すべく、鍵盤駆動回路2に対して必要な指令を行う。   In addition, the automatic performance in this embodiment is not only an effect by sound but also an effect by key movement in accordance with this. In other words, when the CPU 10 reads a key event from the RAM 12, it performs not only the tone generation control in response to it, but also the keyboard driving circuit 2 to drive the key corresponding to this key event to be pressed or released. The necessary instructions are given to.

以上の自動演奏のための制御は、タイマ13から供給されるタイマ割込み信号に同期して行われる。   The above control for automatic performance is performed in synchronization with the timer interrupt signal supplied from the timer 13.

さて、本実施例は、自動演奏と演奏者によるマニュアル演奏を同時に行い得るように構成されており、自動演奏中において鍵盤1の各鍵は演奏データに従って駆動されると共に演奏者によっても押離鍵が行われる。このため、マニュアル演奏の結果生じたキーイベント(演奏イベント)と演奏データ中のキーイベント(自動演奏イベント)に従って押離鍵駆動が行われた結果生じたキーイベントの両方が押鍵検出回路3を介して検出される。これらの各キーイベントのうち前者のものは音源回路7へ送って発音処理あるいは消音処理を行わせるべきものであるが、後者のものは無効イベントであり、音源回路7へは送らず無視しなければならない。無視しないで音源回路7へ送ると、同一の演奏データに対応した発音処理または消音処理が重複して行われてしまうからである。   In this embodiment, the automatic performance and the manual performance by the performer can be performed at the same time. During the automatic performance, each key of the keyboard 1 is driven according to the performance data and is also released by the performer. Is done. For this reason, both the key event generated as a result of manual performance (performance event) and the key event generated as a result of the key release driving in accordance with the key event (automatic performance event) in the performance data cause the key depression detection circuit 3 to operate. Detected through. Of these key events, the former ones should be sent to the tone generator circuit 7 for sound generation processing or mute processing, but the latter ones are invalid events and should not be sent to the tone generator circuit 7 and ignored. I must. This is because if the sound is sent to the tone generator circuit 7 without being ignored, the sound generation process or the mute process corresponding to the same performance data is repeated.

そこで、本実施例においては、RAM12内の所定の記憶エリアに図4に示す第1〜第3のバッファを設定し、CPU10がこれらの各バッファを用いることによりキーイベントの時系列的な管理を行い、上記の重複した発音処理あるいは消音処理が行われないように制御を行っている。なお、これらのバッファを使用した制御については、本実施例の動作説明の際に詳述する。   Therefore, in this embodiment, the first to third buffers shown in FIG. 4 are set in a predetermined storage area in the RAM 12, and the CPU 10 uses these buffers to manage key events in time series. Control is performed so that the above-described overlapping sound generation processing or mute processing is not performed. The control using these buffers will be described in detail when the operation of this embodiment is described.

c.鍵駆動タイミングの最適化のための制御
上述したように、本実施例においては、音源回路7によって発音を行わせる際にその楽音に対応した鍵を押離鍵させる。ここで、鍵駆動回路2によって鍵の駆動を開始してから実際に押鍵または離鍵が行われるまでに遅延が生じる。従って、音源回路7によって発音を行うのと同時に鍵駆動回路2による鍵の駆動を行ったのでは、押鍵および離鍵の動きが発音タイミングおよび消音タイミングよりも遅れてしまう。
c. Control for Optimizing Key Drive Timing As described above, in this embodiment, when the tone generator circuit 7 generates a sound, the key corresponding to the musical sound is pressed and released. Here, there is a delay between when the key driving circuit 2 starts driving the key and when the key is actually pressed or released. Therefore, if the key drive circuit 2 drives the key simultaneously with the sound generation by the tone generator circuit 7, the key pressing and key release movements are delayed from the sound generation timing and the mute timing.

そこで、本実施例においては、自動演奏中、再生すべきキーイベントが発生した場合、図5に示す態様で鍵駆動およびキーイベントに対応した発音・消音のタイミング制御を行う。すなわち、
i)キーイベント発生時点から所定の待機時間Tだけ待機した後のタイミングで当該キーイベントを音源回路7に送り、キーイベントに対応した発音または消音を行わせる。
ii)音源回路7にキーイベントを送るタイミングよりも所定の先行時間dTだけ前のタイミングにおいて、当該キーイベントに対応した押鍵または離鍵の指示を鍵駆動回路2に与える。先行時間dTとしては、押鍵または離鍵の指示を鍵駆動回路2に与えてから、押鍵または離鍵が実際に行われるまでの反応時間を使用する。
Therefore, in this embodiment, when a key event to be reproduced occurs during automatic performance, timing control of sound generation / mute corresponding to the key drive and key event is performed in the manner shown in FIG. That is,
i) The key event is sent to the sound source circuit 7 at a timing after waiting for a predetermined waiting time T from the time of occurrence of the key event, and sounding or muting corresponding to the key event is performed.
ii) The key drive circuit 2 is instructed to press or release a key corresponding to the key event at a timing preceding the timing at which the key event is sent to the tone generator circuit 7 by a predetermined preceding time dT. As the preceding time dT, a reaction time from when a key depression or key release instruction is given to the key driving circuit 2 until the key depression or key release is actually performed is used.

このような制御により、鍵の動きと音源回路7の発音および消音タイミングとの同期化が行われる。   By such control, the key movement and the sound generation and mute timing of the tone generator circuit 7 are synchronized.

ところで、鍵駆動装置105は、発熱により、その特性が変動する。そして、この特定変動が生じた場合、上記反応時間も変動することとなる。また、鍵駆動装置105の特性には各鍵間でばらつきがある。従って、すべての鍵について、鍵の動きを正確に発音または消音タイミングと同期させるためには、上記時間dTとして各鍵毎に最適値を設定する必要がある。   By the way, the characteristics of the key driving device 105 fluctuate due to heat generation. And when this specific fluctuation | variation arises, the said reaction time will also fluctuate. Further, the characteristics of the key driving device 105 vary among the keys. Therefore, in order to accurately synchronize the key movement with the sounding or muting timing for all the keys, it is necessary to set an optimum value for each key as the time dT.

そこで、本実施例においてCPU10は、上記反応時間を各鍵毎に測定し、この測定結果に基づいて各鍵毎に最適な先行時間dTを求め、以後はこの先行時間dTに従った鍵駆動のタイミング制御を行う。   Therefore, in the present embodiment, the CPU 10 measures the reaction time for each key, obtains an optimum preceding time dT for each key based on the measurement result, and thereafter performs key driving according to the preceding time dT. Perform timing control.

(5)自動演奏のための情報を授受あるいは記憶するための手段
14は外部との間でMIDI情報の送受信を行うためのMIDIインタフェース、15は演奏データを記憶するためのFD(フレキシブルディスク)の駆動を行うFDD(フレキシブルディスク駆動装置)である。これらは、この電子鍵盤楽器において自動演奏を行うのに必要な演奏データを得るため、あるいは電子鍵盤楽器の演奏により生じた演奏データを記録または外部に出力するために設けられた手段である。
(5) Means 14 for transferring or storing information for automatic performance 14 is a MIDI interface for transmitting / receiving MIDI information to / from the outside, and 15 is an FD (flexible disk) for storing performance data. This is an FDD (flexible disk drive) that performs driving. These are means provided for obtaining performance data necessary for performing an automatic performance in the electronic keyboard instrument, or for recording performance data generated by the performance of the electronic keyboard instrument or outputting the performance data to the outside.

B.本実施例の動作
図6〜図12はCPU10によって実行される制御の内容を示すフローチャートである。以下、これらの図を参照し、本実施例の動作を説明する。
B. Operation of the present embodiment FIGS. 6 to 12 are flowcharts showing the contents of control executed by the CPU 10. The operation of this embodiment will be described below with reference to these drawings.

(1)全体フロー
この電子鍵盤楽器の電源が投入されると、CPU10は図6にフローを示すメインルーチンを実行する。すなわち、最初に初期化処理(ステップS1)を実行し、以後は、キースキャン処理(ステップS2)、自動演奏処理(ステップS3)、発音・鍵駆動処理(ステップS4)および操作パネル面上の各種スイッチ類の状態検出等のその他の処理(ステップS5)を繰返し実行する。図9はステップS1において実行される初期化処理ルーチンのフローを示している。また、図10〜図12はステップS2〜S4において実行されるキースキャン処理ルーチン、自動演奏処理ルーチンおよび発音・鍵駆動処理ルーチンの各フローを示している。
(1) Overall Flow When this electronic keyboard instrument is powered on, the CPU 10 executes a main routine whose flow is shown in FIG. That is, initialization processing (step S1) is first executed, and thereafter, key scanning processing (step S2), automatic performance processing (step S3), sound generation / key driving processing (step S4), and various operations on the operation panel surface. Other processing (step S5) such as switch state detection is repeatedly executed. FIG. 9 shows the flow of the initialization process routine executed in step S1. 10 to 12 show the flow of the key scan processing routine, automatic performance processing routine, and sound generation / key driving processing routine executed in steps S2 to S4.

一方、タイマ13からCPU10に対し、自動演奏の設定テンポに応じた時間間隔で自動演奏用タイマ割込み信号が供給される。この結果、CPU10は、その時点で実行中の処理を中断し、図7にフローを示す自動演奏用タイマ割込み処理ルーチンを実行することにより、自動演奏フラグAPに"1"をセットする(ステップS101)。そして、この処理の終了後、中断していた処理を再開する。また、上記自動演奏用タイマ割込み信号とは別に、タイマ13からCPU10に対し、一定時間間隔(例えば1ms間隔)でタイマ割込み信号が供給される。この結果、CPU10は、実行中の処理を中断して図8にフローを示す一定時間毎タイマ割込み処理ルーチンを実行する。すなわち、キーフラグKEYに"1"をセットし(ステップS201)、発音・鍵駆動フラグTG_KDにも"1"をセットする(ステップS202)。そして、この処理の終了により、中断していた処理を再開する。   On the other hand, a timer interrupt signal for automatic performance is supplied from the timer 13 to the CPU 10 at time intervals corresponding to the set tempo of automatic performance. As a result, the CPU 10 interrupts the process being executed at that time, and executes the automatic performance timer interrupt processing routine shown in the flow of FIG. 7, thereby setting the automatic performance flag AP to “1” (step S101). ). Then, after the end of this process, the interrupted process is resumed. In addition to the timer interrupt signal for automatic performance, a timer interrupt signal is supplied from the timer 13 to the CPU 10 at regular time intervals (for example, 1 ms intervals). As a result, the CPU 10 interrupts the processing being executed and executes a timer interruption processing routine at regular intervals, the flow of which is shown in FIG. That is, “1” is set to the key flag KEY (step S201), and “1” is also set to the sound generation / key drive flag TG_KD (step S202). Then, the interrupted process is resumed by the end of this process.

(2)初期化処理
本実施例においては、電源投入直後の初期化処理(図6に示すメインルーチンのステップS1)において、上述した鍵駆動タイミングの最適化のための処理を行う。ここで、図9を参照し、この初期化処理の詳細について説明する。まず、ステップS301に進み、鍵番号レジスタKNに初期値「1」を設定する。次いでステップS302に進むと、鍵駆動回路2に対し鍵番号レジスタKNの内容に対応した鍵(すなわち、この場合は第1番目の鍵)についての押鍵駆動指示およびこの押鍵駆動の強度を指定する押鍵信号Fを供給するとともに、計時を開始する。この結果、鍵駆動回路2により、上記押鍵駆動指示のなされた鍵に対応した駆動機構104のソレノイドに押鍵信号Fに対応した電流が通電され、押鍵信号Fに対応した強度での押鍵駆動が行われる。
(2) Initialization Process In this embodiment, the above-described process for optimizing the key drive timing is performed in the initialization process immediately after power-on (step S1 of the main routine shown in FIG. 6). Here, the details of the initialization process will be described with reference to FIG. First, in step S301, an initial value “1” is set in the key number register KN. Next, in step S302, the key drive circuit 2 is designated with respect to the key drive instruction for the key corresponding to the contents of the key number register KN (that is, the first key in this case) and the strength of this key press drive. The key pressing signal F to be supplied is supplied and the timing is started. As a result, the current corresponding to the key pressing signal F is energized by the key driving circuit 2 to the solenoid of the driving mechanism 104 corresponding to the key for which the key pressing driving instruction is issued, and the key pressing circuit F has a strength corresponding to the key pressing signal F. Key driving is performed.

次にステップS303に進み、上記押鍵駆動指示に対応したキーオンイベントが押鍵検出回路3を介して検出されるまで待機する。そして、該当するキーオンイベントが検出された場合にはステップS304に進んで計時を終了する。そして、この計時により得られた押鍵駆動指示からキーオンイベント発生までの反応時間を示す情報を、鍵番号KNおよび押鍵強度Fに対応した押鍵用先行時間レジスタdT_on(KN,F)に格納する。次にステップS305に進み、上記待機時間Tから押鍵用先行時間レジスタdT_on(KN,F)の内容を減算する。そして、この減算結果を鍵番号KNおよび押鍵強度Fに対応した押鍵用待機時間レジスタDT_on(KN,F)に格納する。   In step S303, the process waits until a key-on event corresponding to the key depression drive instruction is detected via the key depression detection circuit 3. If a corresponding key-on event is detected, the process proceeds to step S304 and the time measurement is terminated. Then, the information indicating the reaction time from the key pressing drive instruction to the key-on event occurrence obtained by this timing is stored in the key pressing preceding time register dT_on (KN, F) corresponding to the key number KN and the key pressing strength F. To do. Next, in step S305, the contents of the key pressing preceding time register dT_on (KN, F) are subtracted from the waiting time T. Then, this subtraction result is stored in the key press waiting time register DT_on (KN, F) corresponding to the key number KN and the key press strength F.

以上説明したステップS302〜S305に相当する処理を離鍵駆動についても実施することにより(ステップS306〜S309)、離鍵駆動指示からキーオフイベント発生までの反応時間を測定し、この測定結果に従って鍵番号KNおよび離鍵強度Fに対応した離鍵用待機時間を求め、離鍵用待機時間レジスタDT_off(KN,F)に格納する。   By performing the process corresponding to steps S302 to S305 described above for the key release drive (steps S306 to S309), the reaction time from the key release drive instruction to the occurrence of the key-off event is measured, and the key number is determined according to the measurement result. The key release waiting time corresponding to KN and key release strength F is obtained and stored in the key release waiting time register DT_off (KN, F).

そして、ステップS310に進み、鍵番号レジスタKNの内容が最大値(例えば「88」)と等しいか否かを判断する。そして、この判断結果が「NO」の場合は、鍵番号レジスタKNの内容を1だけ増加させ(ステップS311)、ステップS302〜S310)を実行する。   In step S310, it is determined whether or not the content of the key number register KN is equal to the maximum value (eg, “88”). If the determination result is “NO”, the contents of the key number register KN are incremented by 1 (step S311), and steps S302 to S310) are executed.

鍵盤1を構成するすべての鍵について、上記ステップS301〜S310が実行されると、ステップS310の判断結果が「YES」となり、この初期化処理を終了する。 以上のように、鍵盤上の全鍵について、キーイベントが発生してから押鍵または離鍵の駆動指示の送出まで待機せねばならない時間が求められ、押鍵用待機時間レジスタDT_on(KN,F)および離鍵用待機時間レジスタDT_off(KN,F)内に格納される。   When the above steps S301 to S310 are executed for all the keys constituting the keyboard 1, the determination result in step S310 is “YES”, and the initialization process is terminated. As described above, for all the keys on the keyboard, the time that must be waited from the occurrence of a key event to the sending of a key press or key release drive instruction is obtained, and the key press wait time register DT_on (KN, F ) And the key release waiting time register DT_off (KN, F).

(3)自動演奏
操作パネル上に設けられた自動演奏の指示のためのスイッチがオン状態とされると、この操作がメインルーチンのステップS5において検知され、ランフラグRUNに"1"がセットされる。この結果、以下のように自動演奏のための制御が行われる。
(3) Automatic performance When the switch for instructing automatic performance provided on the operation panel is turned on, this operation is detected in step S5 of the main routine, and "1" is set in the run flag RUN. . As a result, control for automatic performance is performed as follows.

まず、メインルーチンのステップS3から図11に示す自動演奏処理ルーチンへ進むと、そのステップS501においてランフラグRUNの内容が"1"か否かを判断する。この場合、ランフラグRUNに"1"がセットされていることにより、ステップS501の判断結果が「YES」となってステップS502へ進む。なお、自動演奏の指示がなされておらず、ランフラグRUNが"0"となっている場合にはステップS501の結果が「NO」となり、そのままメインルーチンに戻る。すなわち、この自動演奏処理ルーチンの実質的な処理は自動演奏の指示がなされてときのみ実行される。   First, when proceeding from step S3 of the main routine to the automatic performance processing routine shown in FIG. 11, it is determined in step S501 whether or not the content of the run flag RUN is "1". In this case, since “1” is set in the run flag RUN, the determination result in step S501 is “YES”, and the process proceeds to step S502. If no instruction for automatic performance is given and the run flag RUN is “0”, the result of step S501 is “NO”, and the process returns to the main routine. That is, the substantial processing of this automatic performance processing routine is executed only when an instruction for automatic performance is given.

次にステップS502に進むと、自動演奏フラグAPの内容が"1"か否かを判断する。前述した自動演奏用タイマ割込み信号がタイマ13から供給され、これに伴って図7に示す自動演奏用タイマ割込み処理ルーチンが実行された直後においては、自動演奏フラグAPに"1"がセットされているため、ステップS502の判断結果が「YES」となってステップS503に進む。一方、ステップS502の判断結果が「NO」の場合はメインルーチンに戻る。   Next, in step S502, it is determined whether or not the content of the automatic performance flag AP is “1”. Immediately after the automatic performance timer interrupt signal is supplied from the timer 13 and the automatic performance timer interrupt processing routine shown in FIG. 7 is executed, the automatic performance flag AP is set to “1”. Therefore, the determination result in step S502 is “YES”, and the flow proceeds to step S503. On the other hand, if the determination result of step S502 is “NO”, the process returns to the main routine.

次にステップS503に進むと、自動演奏フラグAPに"0"を書込む。次にステップS504に進み、残り時間レジスタTIMEの内容が「0」となっているか否かを判断する。この残り時間レジスタTIMEは、RAM12から演奏データを読み出す時刻までの残り時間を示す情報を記憶するレジスタである。残り時間レジスタTIMEの内容が「0」よりも大きい場合、すなわち、未だ演奏データを読み出す時刻に至っていない場合には、ステップS504の判断結果が「NO」となり、ステップS599へ進んで残り時間レジスタTIMEの内容を1だけ減少させ、メインルーチンに戻る。   In step S503, "0" is written in the automatic performance flag AP. In step S504, it is determined whether or not the content of the remaining time register TIME is “0”. The remaining time register TIME is a register that stores information indicating the remaining time until the time when the performance data is read from the RAM 12. When the content of the remaining time register TIME is larger than “0”, that is, when the time for reading the performance data has not yet been reached, the determination result in step S504 is “NO”, and the process proceeds to step S599 to proceed to the remaining time register TIME. Is decreased by 1, and the process returns to the main routine.

再びメインルーチンのステップS3において自動演奏処理ルーチンが実行される際、ステップS502まで進むこととなるが、自動演奏用タイマ割込み信号が発生され、自動演奏フラグAPが"1"にセットされるまでの間は、ステップS502の判断結果が「NO」となるため、ステップS503以降の処理は一切実行されない。そして、自動演奏フラグAPの内容が"1"となった後、自動演奏処理ルーチンが最初に実行される場合に限り、ステップS503以降の処理が実行される。すなわち、自動演奏処理ルーチンにおけるステップS503以降の処理は、自動演奏用タイマ割込み信号の発生タイミングに同期して実行されるものであり、また、1回の自動演奏用タイマ割込み信号の発生に対して1回限り実行される。従って、残り時間レジスタTIMEの内容も、自動演奏用タイマ割込み信号が発生される毎に1ずつ減少してゆくこととなる(ステップS599)。   When the automatic performance processing routine is executed again in step S3 of the main routine, the process proceeds to step S502. However, until the automatic performance timer interrupt signal is generated and the automatic performance flag AP is set to "1". During this time, the determination result in step S502 is “NO”, and therefore, the processing after step S503 is not executed at all. Then, only after the automatic performance processing routine is executed for the first time after the content of the automatic performance flag AP becomes “1”, the processing after step S503 is executed. That is, the processing after step S503 in the automatic performance processing routine is executed in synchronization with the generation timing of the automatic performance timer interrupt signal. It is executed only once. Accordingly, the content of the remaining time register TIME is also decreased by 1 every time the automatic performance timer interrupt signal is generated (step S599).

そして、残り時間レジスタTIMEの内容が「0」になると、ステップS504からステップS505へ進み、RAM12の読み出しアドレスを進めて演奏データを読み出す。次にステップS506に進み、読み出した演奏データがデルタタイムであるか否かを判断する。   When the content of the remaining time register TIME becomes “0”, the process proceeds from step S504 to step S505, and the performance data is read by advancing the read address of the RAM 12. In step S506, it is determined whether or not the read performance data is delta time.

演奏データがキーイベント等、デルタタイム以外のデータである場合には、ステップS506の判断結果が「NO」となり、ステップS507に進む。そして、読み出した演奏データがキーオンまたはキーオフのキーイベントであるか否かを判断する。この判断結果が「NO」の場合はそのデータに対応した制御(ステップS508)を行ってステップS505へ戻る。一方、ステップS507の判断結果が「YES」の場合はステップS509へ進み、ステップS505において読み出したキーイベントを第1バッファに書込むと共にこのキーイベントに対応した発音または消音を行うまでの待機時間の初期値として所定の待機時間Tを第1バッファに書込む(図4参照)。次にステップS510へ進み、上記キーイベントおよびこのキーイベントの鍵番号に対応した待機時間の第2バッファへの書込みを行う。すなわち、読み出したキーイベントがキーオンイベントである場合には、その鍵番号KNに対応した押鍵用待機時間レジスタDT_on(KN、F)から押鍵用待機時間を読み出し、キーオンイベントと共に第2バッファへ書込む。また、キーイベントがキーオフイベントである場合には、その鍵番号KNに対応した離鍵用待機時間レジスタDT_off(KN、F)から離鍵用待機時間を読み出し、キーオフイベントと共に第2バッファへ書込む。   If the performance data is data other than delta time, such as a key event, the determination result in step S506 is “NO”, and the flow proceeds to step S507. Then, it is determined whether or not the read performance data is a key-on or key-off key event. If the determination result is “NO”, control corresponding to the data (step S508) is performed, and the process returns to step S505. On the other hand, if the determination result in step S507 is “YES”, the process proceeds to step S509, where the key event read in step S505 is written into the first buffer and the waiting time until sounding or muting corresponding to this key event is performed. A predetermined waiting time T is written in the first buffer as an initial value (see FIG. 4). In step S510, the key event and the waiting time corresponding to the key number of this key event are written to the second buffer. That is, when the read key event is a key-on event, the key-pressing waiting time is read from the key-pressing waiting time register DT_on (KN, F) corresponding to the key number KN, and the key-on event is sent to the second buffer. Write. If the key event is a key-off event, the key-release waiting time is read from the key-release waiting time register DT_off (KN, F) corresponding to the key number KN, and written to the second buffer together with the key-off event. .

ステップS510が終了すると、ステップS505へ戻り、読み出しアドレスを進めて新たな演奏データを読み出し、その演奏データがキーイベント等のデルタタイム以外のデータである場合はステップS506からステップS507へ進み、上述と同様な処理を実行する。   When step S510 is completed, the process returns to step S505 to read out new performance data by advancing the read address. If the performance data is data other than delta time such as a key event, the process proceeds from step S506 to step S507. A similar process is executed.

ステップS505においてデルタタイムを読み出した場合はステップS506の判断結果が「YES」となってステップS511へ進む。そして、読み出したデルタタイムを残り時間レジスタTIMEに書込む。このようにして次に演奏データを読み出すまでに待機しなければならない残り時間が設定される訳である。次いでステップS512へ進み、残り時間レジスタTIMEの内容が「0」か否かを判断し、この判断結果が「YES」の場合はステップS505へ戻る。一方、ステップS512の判断結果が「NO」の場合は残り時間レジスタTIMEの内容を1だけ減少させ(ステップS599)、メインルーチンに戻る。   When the delta time is read in step S505, the determination result in step S506 is “YES”, and the process proceeds to step S511. Then, the read delta time is written into the remaining time register TIME. In this way, the remaining time that must be waited until the next performance data is read is set. Next, the process proceeds to step S512, and it is determined whether or not the content of the remaining time register TIME is “0”. If the determination result is “YES”, the process returns to step S505. On the other hand, if the determination result in step S512 is “NO”, the content of the remaining time register TIME is decreased by 1 (step S599), and the process returns to the main routine.

以上のように、自動演奏用タイマ割込み信号の発生に同期したタイミングで、RAM12からキーイベントが逐次読み出され、所定の待機時間Tを示す情報と共に第1バッファに書込まれ、さらに当該キーイベントの鍵番号に対応した待機時間情報と共に第2バッファに書込まれる。   As described above, the key events are sequentially read out from the RAM 12 at the timing synchronized with the generation of the automatic performance timer interrupt signal, written together with the information indicating the predetermined waiting time T, and then the key event. Is written in the second buffer together with the waiting time information corresponding to the key number.

このようにしてバッファに書込まれたキーイベントは、メインルーチンのステップS4において図12に示す発音・鍵駆動処理ルーチンが実行されることにより、楽音形成処理および鍵駆動処理に使用される。   The key event written in the buffer in this way is used for the tone generation process and the key drive process by executing the tone generation / key drive process routine shown in FIG. 12 in step S4 of the main routine.

まず、ステップS601に進むと、発音・鍵駆動フラグTG_KDの内容が"1"か否かを判断する。そして、この判断結果が「YES」の場合は発音・鍵駆動フラグTG_KDに“0”を書込んで(ステップS602)、ステップS603以降の処理へ進み、「NO」の場合は何等処理を行うことなくメインルーチンに戻る。この発音・鍵駆動フラグTG_KDは、一定時間間隔でタイマ割込み信号が発生され、図8に示す一定時間毎タイマ割込み処理が実行されることにより“1”がセットされる。従って、発音・鍵駆動処理ルーチンにおけるステップS602以降の処理は、一定時間間隔でタイマ割込み信号が発生される毎に実行されることとなる。   First, in step S601, it is determined whether or not the content of the sound generation / key drive flag TG_KD is “1”. If the determination result is “YES”, “0” is written in the sound generation / key drive flag TG_KD (step S602), and the process proceeds to step S603 and subsequent steps. If the determination result is “NO”, any process is performed. Return to the main routine. The tone generation / key driving flag TG_KD is set to “1” by generating a timer interrupt signal at regular time intervals and executing the timer interrupt processing at regular time intervals shown in FIG. Accordingly, the processing after step S602 in the sound generation / key driving processing routine is executed every time a timer interrupt signal is generated at a constant time interval.

次にステップS603へ進むと、第1バッファ内に発音または消音までの待機時間が0となっているキーイベントがあるか否かを判断する。該当するキーイベントがない場合はステップS604およびS605を飛ばしてステップS606へ進み、第1バッファ内に発音または消音までの待機時間がαとなっているキーイベントがあるか否かを判断する。該当するキーイベントがない場合はステップS607を飛ばしてステップS608へ進み、第1バッファ内の各キーイベントに対応した各待機時間を一律に1だけ減少させる。   Next, in step S603, it is determined whether or not there is a key event in the first buffer whose waiting time until sound generation or muting is 0. If there is no corresponding key event, Steps S604 and S605 are skipped, and the process proceeds to Step S606, where it is determined whether or not there is a key event in the first buffer whose waiting time until sound generation or muting is α. If there is no corresponding key event, step S607 is skipped and the process proceeds to step S608, where each waiting time corresponding to each key event in the first buffer is uniformly reduced by one.

次にステップS609に進み、第2バッファ内に押鍵駆動または離鍵駆動までの待機時間が0となっているキーイベントがあるか否かを判断する。該当するキーイベントがない場合はステップS610およびS611を飛ばしてステップS612へ進み、第2バッファ内の各キーイベントに対応した各待機時間を一律に1だけ減少させる。   Next, the process proceeds to step S609, and it is determined whether or not there is a key event in the second buffer in which the waiting time until the key press drive or key release drive is zero. If there is no corresponding key event, steps S610 and S611 are skipped, and the process proceeds to step S612, where each waiting time corresponding to each key event in the second buffer is uniformly reduced by one.

次にステップS613に進み、第3バッファ内に待機時間が0であるキーイベントがあるか否かを判断し、該当するキーイベントがない場合は第3バッファ内の各キーイベントに対応した待機時間を一律に1だけ減少させ(ステップS615)、メインルーチンに戻る。なお、第3バッファ内のキーイベントおよび待機時間については後述する。   In step S613, it is determined whether there is a key event whose waiting time is 0 in the third buffer. If there is no corresponding key event, the waiting time corresponding to each key event in the third buffer. Is uniformly reduced by 1 (step S615), and the process returns to the main routine. The key event and the waiting time in the third buffer will be described later.

以上のように、一定時間間隔でタイマ割込み信号が発生される毎に、第1〜第3の各バッファ内のキーイベントに対応した各待機時間についての判定が行われると共に各待機時間を1だけ減少させる処理が行われ、各待機時間は次第に減少してゆくこととなる。   As described above, each time a timer interrupt signal is generated at regular time intervals, each standby time corresponding to the key event in each of the first to third buffers is determined and each standby time is set to 1. The process of decreasing is performed, and each waiting time is gradually decreased.

さて、前述した自動演奏処理ルーチンが実行された結果、あるキーオンイベントがRAM12から読み出されたとすると、このキーオンイベントおよび所定の待機時間Tが第1バッファに書込まれ(図11におけるステップS509)、このキーオンイベントおよびその鍵番号KNに対応した押鍵用待機時間DT_on(KN,F)が第2バッファに書込まれる。   Assuming that a key-on event is read from the RAM 12 as a result of the execution of the automatic performance processing routine described above, this key-on event and a predetermined waiting time T are written to the first buffer (step S509 in FIG. 11). The key-on event and the key press waiting time DT_on (KN, F) corresponding to the key number KN are written in the second buffer.

そして、この発音・鍵駆動処理ルーチンが実行される毎に、第1バッファ内の待機時間は初期値Tから、第2バッファ内の押鍵用待機時間は初期値DT_on(KN,F)から、順次1ずつデクリメントされてゆく。   Each time this tone generation / key drive processing routine is executed, the waiting time in the first buffer is from the initial value T, and the key pressing waiting time in the second buffer is from the initial value DT_on (KN, F). It will be decremented one by one.

ここで、時間T、DT_on(KN,F)、αは、図5に示す関係を有している(ただし、図5においてDT_on(KN,F)は単にDTと表されている)。このため、キーオンイベントの読み出し時刻から押鍵用待機時間DT_on(KN,F)だけ経過した時点において、最初に第2バッファ内の押鍵用待機時間が0となる。   Here, the times T, DT_on (KN, F), and α have the relationship shown in FIG. 5 (however, DT_on (KN, F) is simply expressed as DT in FIG. 5). For this reason, when the key pressing standby time DT_on (KN, F) has elapsed from the read time of the key-on event, the key pressing standby time in the second buffer first becomes zero.

この結果、ステップS609の判断結果が「YES」となり、ステップS610へ進むこととなる。そして、ステップS610へ進むと、待機時間が0となった第2バッファ内のキーオンイベントが読み出され、このキーオンイベントに対応した押鍵駆動の指示および押鍵強度を指定する押鍵信号Fが鍵駆動回路2へ送られる。   As a result, the determination result in step S609 is “YES”, and the flow proceeds to step S610. In step S610, the key-on event in the second buffer in which the waiting time has become zero is read out, and a key-pressing signal F designating the key-press driving instruction and key-press strength corresponding to this key-on event is received. It is sent to the key drive circuit 2.

次にキーオンイベントの読み出し時刻から時間T−αだけ経過した時点において、第1バッファ内の当該キーオンイベントに対応した待機時間がαとなる。この結果、ステップS606の判断結果が「YES」となり、ステップS607へ進むこととなる。そして、ステップS607へ進むと、当該キーオンイベントおよびこのキーオンイベントに対応した待機時間の初期値2αが第3バッファに書込まれる。このようにして書込まれた第3バッファ内の待機時間が前述したステップS613〜S615の各処理の処理対象となる訳である。第3バッファ内の待機時間が0より大きい間はステップS613の判断結果が「NO」となるため、待機時間のデクリメント(ステップS615)のみが行われる。   Next, when the time T-α has elapsed from the read time of the key-on event, the waiting time corresponding to the key-on event in the first buffer becomes α. As a result, the determination result in step S606 is “YES”, and the process proceeds to step S607. In step S607, the key-on event and the initial value 2α of the waiting time corresponding to the key-on event are written in the third buffer. This is the reason why the waiting time in the third buffer written in this way is the processing target of each processing in steps S613 to S615 described above. While the waiting time in the third buffer is greater than 0, the determination result in step S613 is “NO”, so only the waiting time is decremented (step S615).

次にキーオンイベントの読み出し時刻から時間Tだけ経過すると、第1バッファ内の当該キーオンイベントに対応した待機時間が0となる。この結果、ステップS603の判断結果が「YES」となり、ステップS604へ進み、当該キーオンイベントが音源回路7へ送られ、発音が行われる。次いでステップS605へ進み、発音を行ったキーオンイベントが第1バッファから消去される。   Next, when the time T elapses from the read time of the key-on event, the standby time corresponding to the key-on event in the first buffer becomes zero. As a result, the determination result in step S603 becomes “YES”, the process proceeds to step S604, the key-on event is sent to the sound source circuit 7, and sound generation is performed. Next, the process proceeds to step S605, and the key-on event that produced the sound is deleted from the first buffer.

以上のようにして、キーオンイベントの読み出し時刻から押鍵用待機時間DT_on(KN,F)だけ経過した時点において押鍵駆動の指示が行われ、読み出し時刻から所定の待機時間Tだけ経過した時点において当該キーオンイベントに対応した発音が行われる。ここで、押鍵用待機時間DT_on(KN,F)は、押鍵駆動指示が発音タイミングよりも反応時間dT_on(KN,F)だけ先行して行われるように設定されているため、キーオンイベントに対応した発音が行われるとと同時に当該キーオンイベントに対応した押鍵動作が行われる(図5参照)。   As described above, when the key pressing standby time DT_on (KN, F) has elapsed from the read time of the key-on event, the key pressing drive is instructed, and when the predetermined standby time T has elapsed from the read time. Pronunciation corresponding to the key-on event is performed. Here, the key pressing standby time DT_on (KN, F) is set so that the key pressing driving instruction is performed prior to the sound generation timing by the reaction time dT_on (KN, F). At the same time as the corresponding sounding is performed, a key pressing operation corresponding to the key-on event is performed (see FIG. 5).

その後、キーオンイベントの読み出し時刻から時間T+αだけ経過すると(すなわち、上記ステップS607において第3バッファにキーオンイベントおよび待機時間の初期値2αを書き込んだ時点から時間2αが経過すると)、第3バッファ内の当該キーオンイベントに対応した待機時間が0となる。この結果、ステップS613の判断結果が「YES」となり、ステップS614へ進み、第3バッファから当該キーオンイベントが消去される。   Thereafter, when the time T + α has elapsed from the read time of the key-on event (that is, when the time 2α has elapsed since the initial value 2α of the key-on event and the standby time was written in the third buffer in step S607), The waiting time corresponding to the key-on event becomes 0. As a result, the determination result in step S613 is “YES”, the process proceeds to step S614, and the key-on event is deleted from the third buffer.

すなわち、本実施例においてはキーオンイベントの読み出し時刻から時間Tだけ経過した時点において当該キーオンイベントに対応した発音が行われるが、この発音時刻を中心に±αの範囲の期間、当該キーオンイベントが第3バッファ内に保存される。   That is, in the present embodiment, sound generation corresponding to the key-on event is performed when the time T has elapsed from the read-out time of the key-on event, and the key-on event is generated for a period of ± α around the sounding time. Stored in 3 buffers.

以上、RAM12から読み出されたキーオンイベントの取り扱いを例に説明を行ったが、キーオフイベントについても全く同様な処理が行われる。   The handling of the key-on event read from the RAM 12 has been described above as an example, but the same processing is performed for the key-off event.

(4)演奏者による鍵盤演奏
本実施例においては、上述の自動演奏が行われていない場合および自動演奏が行われている場合のいずれにおいても、演奏者が鍵盤1を操作して演奏を行うことができる。自動演奏中に演奏者による鍵盤演奏が行われると、演奏者による押離鍵操作に対応したキーイベント(演奏イベント)と、RAM12から読み出されたキーイベント(自動演奏イベント)に従って鍵駆動がなされることによって生じるキーイベントの両方が、押鍵検出回路3を介して検出される。これらのキーイベントは、メインルーチンのステップS2を介して実行されるキースキャン処理ルーチン(図10)の処理対象となる。
(4) Keyboard performance by the performer In this embodiment, the performer performs the performance by operating the keyboard 1 in both cases where the automatic performance is not performed and the automatic performance is performed. be able to. When a keyboard performance is performed by the performer during the automatic performance, the key is driven in accordance with a key event (performance event) corresponding to the key pressing / release operation by the performer and a key event (automatic performance event) read from the RAM 12. Both of the key events generated by the detection are detected via the key pressing detection circuit 3. These key events are processed by the key scan processing routine (FIG. 10) executed through step S2 of the main routine.

まず、ステップS401に進み、キーフラグKEYの内容が"1"か否かを判断する。そして、この判断結果が「YES」の場合はキーフラグKEYに"0"を書込んで(ステップS402)、ステップS403以降の処理へ進み、「NO」の場合は何等処理を行うことなくメインルーチンに戻る。このキーフラグKEYも、上述した発音・鍵駆動フラグTG_KDと同様、一定時間間隔でタイマ割込み信号が発生されることにより"1"がセットされる。従って、キースキャン処理ルーチンにおけるステップS402以降の処理も、一定時間間隔でタイマ割込み信号が発生される毎に実行される。   First, in step S401, it is determined whether the content of the key flag KEY is “1”. If the determination result is “YES”, “0” is written in the key flag KEY (step S402), and the process proceeds to step S403 and the subsequent steps. Return. This key flag KEY is also set to “1” when a timer interrupt signal is generated at regular time intervals, like the sound generation / key drive flag TG_KD described above. Accordingly, the processing after step S402 in the key scan processing routine is also executed every time a timer interrupt signal is generated at a constant time interval.

次にステップS403へ進むと、押鍵検出回路3を介して鍵盤1のスキャンを行う。次いでステップS404へ進み、押鍵検出回路3を介してキーオンイベントまたはキーオフイベントが検出されたか否かを判断し、この判断結果が「NO」の場合はメインルーチンへ戻り、「YES」の場合はステップS405へ進む。   In step S403, the keyboard 1 is scanned via the key depression detection circuit 3. Next, the process proceeds to step S404, where it is determined whether a key-on event or a key-off event has been detected via the key press detection circuit 3. If this determination result is "NO", the process returns to the main routine. If "YES", Proceed to step S405.

次にステップS405に進むと、ステップS403において検出されたキーオンイベントまたはキーオフイベントと同一のキーコードを含むキーイベントが第3バッファ内にないか否かを判断する。この判断結果が「YES」の場合はステップS406に進み、ステップS403において検出されたキーオンイベントまたはキーオフイベントを音源回路7へ送り、これに対応した発音または消音を行わせる。そして、メインルーチンに戻る。   Next, in step S405, it is determined whether or not there is a key event including the same key code as the key-on event or key-off event detected in step S403 in the third buffer. If the determination result is “YES”, the process proceeds to step S406, and the key-on event or key-off event detected in step S403 is sent to the sound source circuit 7 to generate sound or mute corresponding to this. Then, the process returns to the main routine.

一方、ステップS405の判断結果が「NO」の場合はステップS406を実行することなくメインルーチンに戻る。このような制御が行われるため、本実施例においては、RAM12から読み出されたキーイベント(自動演奏イベント)について発音処理または消音処理が重複して行われることはない。   On the other hand, if the determination result in step S405 is “NO”, the process returns to the main routine without executing step S406. Since such control is performed, in this embodiment, the sound generation process or the mute process is not performed repeatedly for the key event (automatic performance event) read from the RAM 12.

何故ならば、前述した通り、RAM12からキーイベント(自動演奏イベント)が読み出された場合には、このキーイベントに対応した発音または消音が行われる時刻から±αの範囲内の期間、当該キーイベントが第3バッファ内に保存されている。また、本実施例においては、RAM12からキーイベント(自動演奏イベント)が読み出された場合には、そのキーイベントに対応した発音または消音と同時に、そのキーイベントに対応した鍵駆動が行われ、この鍵駆動に対応したキーイベントが検出される。従って、かかる鍵駆動に対応したキーイベント(無効イベント)に関しては、上記ステップS405の判断結果は必ず「NO」となり、重複した発音処理または消音処理が行われることはないのである。なお、ステップS404において複数のキーイベントが同時に検出された場合はステップS405(およびS406)の処理を複数の各イベントについて行うものとする。   This is because, as described above, when a key event (automatic performance event) is read out from the RAM 12, the key is generated for a period within a range of ± α from the time at which sounding or muting corresponding to this key event is performed. Events are stored in the third buffer. Further, in this embodiment, when a key event (automatic performance event) is read from the RAM 12, key driving corresponding to the key event is performed simultaneously with sounding or muting corresponding to the key event, A key event corresponding to this key drive is detected. Therefore, for the key event (invalid event) corresponding to the key drive, the determination result in step S405 is always “NO”, and the duplicate sound generation process or mute process is not performed. When a plurality of key events are detected at the same time in step S404, the process of step S405 (and S406) is performed for each of the plurality of events.

<第2実施例>
上記第1実施例ではRAM12から読み出されたキーイベントに対応した鍵駆動を行う際に一定の押鍵信号または離鍵信号Fを鍵駆動回路2に与えたが、本実施例においては、信号Fの大きさを図13に示すようにキーイベントのベロシティに応じて段階的に変化させる。ただし、鍵駆動回路2による鍵の駆動強度の制御に関して、あまりに厳しい要求をしたのでは楽器が高価になってしまうので、本実施例ではベロシティの分解能よりは粗い閾値を用いてベロシティを量子化し、信号Fを決定する。このようにベロシティを量子化しても、発音される音には全く影響がなく、駆動強度を細かく制御しなくても何ら問題はない。
<Second embodiment>
In the first embodiment, when a key drive corresponding to the key event read from the RAM 12 is performed, a fixed key pressing signal or a key release signal F is given to the key driving circuit 2. The magnitude of F is changed stepwise according to the velocity of the key event as shown in FIG. However, since the instrument becomes expensive if a too strict request is made with respect to the control of the driving strength of the key by the key driving circuit 2, in this embodiment, the velocity is quantized using a threshold that is coarser than the resolution of the velocity, The signal F is determined. Even if the velocity is quantized in this way, there is no influence on the sound to be generated, and there is no problem even if the driving intensity is not finely controlled.

このように鍵の駆動速度を可変とした場合、鍵の反応時間も鍵の駆動速度により変化する。このため、押鍵用待機時間または離鍵用待機時間として固定の値を使用したのでは、鍵の駆動速度によっては発音タイミングと鍵駆動タイミングとの間にずれが生じてしまう。   In this way, when the key driving speed is variable, the key reaction time also changes depending on the key driving speed. For this reason, if a fixed value is used as the key pressing waiting time or the key releasing waiting time, a deviation occurs between the sound generation timing and the key driving timing depending on the key driving speed.

そこで、本実施例においては、上記第1実施例における各処理を以下のように変更する。   Therefore, in the present embodiment, each process in the first embodiment is changed as follows.

まず、初期化処理ルーチン(図9)は、図14に示すフローに従って実行する。すなわち、信号Fの大きさを「1」に初期設定し(ステップS701)、次いで図9に示す初期化処理ルーチンを実行する(ステップS702)。そして、信号Fの大きさを最大値と比較し(ステップS703)、最大値に達するまで「1」ずつインクリメントしながら(ステップS704)、ステップS702を繰返し実行する。この結果、鍵盤1の各鍵の鍵番号KNと信号Fの各組合せに対応した押鍵用待機時間DT_on(KN,F)および離鍵用待機時間DT_off(KN,F)が得られる。   First, the initialization process routine (FIG. 9) is executed according to the flow shown in FIG. That is, the magnitude of the signal F is initialized to “1” (step S701), and then the initialization process routine shown in FIG. 9 is executed (step S702). Then, the magnitude of the signal F is compared with the maximum value (step S703), and incremented by “1” (step S704) until the maximum value is reached (step S704), and step S702 is repeatedly executed. As a result, the key press waiting time DT_on (KN, F) and the key release waiting time DT_off (KN, F) corresponding to each combination of the key number KN of each key of the keyboard 1 and the signal F are obtained.

また、自動演奏処理ルーチン(図11)の実行時においては、RAM12から読み出したキーイベントのベロシティを参照し、このベロシティに対応した信号Fを求め、この信号Fに対応した押鍵用待機時間DT_on(KN,F)または離鍵用待機時間DT_off(KN,F)を第2バッファへ書き込む(ステップS510)。   Further, when executing the automatic performance processing routine (FIG. 11), the velocity of the key event read from the RAM 12 is referred to obtain a signal F corresponding to this velocity, and a key pressing waiting time DT_on corresponding to this signal F. (KN, F) or key release waiting time DT_off (KN, F) is written to the second buffer (step S510).

また、発音・鍵駆動処理ルーチン(図12)の実行時においては、第2バッファから読み出されたキーイベント中のベロシティに従って押鍵信号または離鍵信号Fの出力を行う(ステップS610)。このようにすることで、鍵速度が変っても発音タイミングと一致したタイミングで押離鍵を行わせることができる。   Further, at the time of execution of the tone generation / key drive processing routine (FIG. 12), the key pressing signal or the key release signal F is output according to the velocity in the key event read from the second buffer (step S610). By doing in this way, even if the key speed changes, it is possible to perform the key press / release at the timing coincident with the sound generation timing.

また、キースキャン処理ルーチン(図10)を実行する際には、同ルーチンのステップS405およびS406に代えて、図15に示す一致判定処理ルーチンを実行する。   When executing the key scan processing routine (FIG. 10), a matching determination processing routine shown in FIG. 15 is executed instead of steps S405 and S406 of the routine.

すなわち、押鍵検出回路3を介してキーオンイベントまたはキーオフイベントが検出された場合、このキーオンイベントまたはキーオフイベントと同一のキーコードを含むキーイベントが第3バッファ内にないか否かを判断し(ステップS801)、この判断結果が「YES」の場合は当該キーオンイベントまたはキーオフイベントを音源回路7へ送って発音または消音を行わせる(ステップS802)。   That is, when a key-on event or key-off event is detected via the key-press detection circuit 3, it is determined whether or not there is a key event including the same key code as the key-on event or key-off event in the third buffer ( In step S801), if the determination result is "YES", the key-on event or key-off event is sent to the tone generator circuit 7 to sound or mute (step S802).

しかし、ステップS801の判断結果が「NO」である場合には、当該キーオンイベント等のベロシティと第3バッファ内のこれに対応したキーイベントのベロシティを比較し(ステップS803)、両者が近い場合に限って当該キーオンイベント等を無視し、両者が近い値でない場合には無視することなく音源回路7へ送る(ステップS802)。すなわち、2つのキーイベントが非常にタイミングが接近しており、かつ、同一の鍵に関するものであっても、ベロシティが異なれば全く別のキーイベントとして取り扱うものである。このような制御が行われる結果、演奏者が自動演奏による鍵駆動と非常に近いタイミングで、しかも、全く同一の鍵について押鍵または離鍵を行った場合であっても、押鍵強度が異なれば、この演奏者による押離鍵も無視されることなく楽音形成に使用される。   However, if the determination result in step S801 is “NO”, the velocity of the key-on event or the like is compared with the velocity of the corresponding key event in the third buffer (step S803), and the two are close to each other. For example, the key-on event or the like is ignored, and if both are not close values, the key-on event is sent to the tone generator circuit 7 without being ignored (step S802). That is, even if two key events are very close in timing and related to the same key, they are handled as completely different key events if their velocities are different. As a result of such control, even if the performer performs key pressing or key release at the timing very close to the key driving by automatic performance, and the same key is pressed, the key pressing strength can be different. For example, the key pressed / released by the performer is used for musical tone formation without being ignored.

<第3実施例>
上記第1実施例では電源投入直後の初期化処理ルーチンにより、各鍵の反応時間を測定し、各鍵についての押鍵用待機時間DT_on(KN,F)および離鍵用待機時間DT_off(KN,F)の設定を行った。
<Third embodiment>
In the first embodiment, the response time of each key is measured by the initialization process routine immediately after power-on, and the key press waiting time DT_on (KN, F) and the key release waiting time DT_off (KN, F) was set.

しかしながら、電子鍵盤楽器が長時間使用され、鍵駆動回路2によるソレノイドへの通電が何回も繰返されると、各鍵の駆動機構104の特性が発熱によって変化し、鍵の反応時間も変化することとなる。   However, if the electronic keyboard instrument is used for a long time and the energization of the solenoid by the key drive circuit 2 is repeated many times, the characteristics of the drive mechanism 104 of each key change due to heat generation, and the reaction time of the key also changes. It becomes.

そこで、本実施例においては、各鍵の反応時間の測定および押鍵用待機時間DT_on(KN,F)等の設定を逐次行う。具体的には次の通りである。まず、RAM12内に、上記第1〜第3のバッファに加えて、図16に示す第4バッファを設定する。   Therefore, in this embodiment, the measurement of the reaction time of each key and the setting of the key pressing standby time DT_on (KN, F) and the like are sequentially performed. Specifically, it is as follows. First, in addition to the first to third buffers, a fourth buffer shown in FIG. 16 is set in the RAM 12.

また、キースキャン処理ルーチン(図10)のステップS405およびS406を図17に示す一致判定処理ルーチンに置き換える。さらに発音・鍵駆動ルーチン(図12)のステップS610を図18に示す駆動信号出力処理ルーチンに置き換え、同ルーチンのステップS615の後に図19に示す計時処理ルーチンを追加する。   Also, steps S405 and S406 of the key scan processing routine (FIG. 10) are replaced with a match determination processing routine shown in FIG. Further, step S610 of the sound generation / key drive routine (FIG. 12) is replaced with a drive signal output process routine shown in FIG. 18, and a time measurement process routine shown in FIG. 19 is added after step S615 of the routine.

かかる変更のなされた本実施例によれば、以下の動作が得られる。まず、一定時間間隔のタイマ割込み信号に同期して発音・鍵駆動処理ルーチン(図12)が駆動され、そのステップS609の判断結果が「YES」となった場合には、第2バッファ内のキーイベントに対応した鍵駆動の指示およびその駆動強度を指定する押鍵信号または離鍵信号Fを鍵駆動回路2へ送る(図18のステップS1001)。次いでこの鍵駆動の指示を行ったキーイベントを時間情報の初期値「0」と共に第4バッファに書き込む。そして、発音・鍵駆動処理ルーチンを終える際には、この第4バッファ内のキーイベントに対応した時間情報をインクリメント(図19のステップS1101)してからメインルーチンに戻る。以後、この第4バッファ内の時間情報はタイマ割込み信号が発生される毎に1ずつインクリメントされてゆく。   According to this embodiment with such a change, the following operation can be obtained. First, the sound generation / key drive processing routine (FIG. 12) is driven in synchronization with a timer interrupt signal at a fixed time interval. If the result of determination in step S609 is “YES”, the key in the second buffer is used. A key drive instruction corresponding to the event and a key press signal or key release signal F designating the drive strength are sent to the key drive circuit 2 (step S1001 in FIG. 18). Next, the key event instructing the key drive is written to the fourth buffer together with the initial value “0” of the time information. When the tone generation / key drive processing routine is completed, the time information corresponding to the key event in the fourth buffer is incremented (step S1101 in FIG. 19), and the process returns to the main routine. Thereafter, the time information in the fourth buffer is incremented by 1 each time a timer interrupt signal is generated.

そして、キースキャン処理ルーチン(図10)の実行時、そのステップS403およびS404において押鍵検出回路3を介してキーオンイベント等が検出された場合、このキーオンイベント等と同一のキーコードを含むキーイベントが第3バッファ内にないか否かを判断し(図17のステップS901)、この判断結果が「YES」の場合は当該キーオンイベント等を音源回路7へ送って発音等を行わせる(図17のステップS902)。   When a key-on event or the like is detected through the key-press detection circuit 3 in steps S403 and S404 during execution of the key scan processing routine (FIG. 10), a key event including the same key code as the key-on event or the like is detected. Is not in the third buffer (step S901 in FIG. 17). If the result of this determination is “YES”, the key-on event or the like is sent to the tone generator circuit 7 for sound generation (FIG. 17). Step S902).

一方、ステップS901の判断結果が「NO」である場合には、ステップS903に進む。本実施例においては、上述の通り、鍵駆動の指示の行われたキーイベントはすべて第4バッファ内に格納される。ステップS903では、この第4バッファ内のキーイベントの中から押鍵検出回路3を介して検出したキーオンイベント等と同一のキーイベントを探し、このキーイベントに対応した時間情報を第4バッファから読み出す。この時間情報は、第4バッファ内のキーイベントについての鍵駆動の指示がなされてから現在までの経過時間、すなわち、その鍵駆動の指示が行われてから実際に鍵駆動が行われ、今回、押鍵検出回路3からキーオンイベント等が検出されるまでに要した鍵の反応時間に他ならない。そこで、ステップS903では、この第4バッファから読み出した時間情報により、押鍵用先行時間レジスタdT_on(KN,F)または離鍵用先行時間レジスタdT_off(KN,F)の内容を更新する。次にステップS904に進み、この更新結果に従って、押鍵用待機時間レジスタDT_on(KN,F)または離鍵用待機時間レジスタDT_off(KN,F)の内容を更新する。そして、ステップS903において探し出したキーイベントを第4バッファから消去し(ステップS905)、メインルーチンに戻る。   On the other hand, if the determination result of step S901 is “NO”, the process proceeds to step S903. In the present embodiment, as described above, all key events for which a key driving instruction has been issued are stored in the fourth buffer. In step S903, the key event in the fourth buffer is searched for a key event that is the same as the key-on event detected via the key press detection circuit 3, and time information corresponding to the key event is read from the fourth buffer. . This time information is the elapsed time from when the key driving instruction for the key event in the fourth buffer is made to the present time, that is, the key driving is actually performed after the key driving instruction is performed. This is the key reaction time required until a key-on event or the like is detected from the key press detection circuit 3. Therefore, in step S903, the contents of the key pressing preceding time register dT_on (KN, F) or the key releasing preceding time register dT_off (KN, F) are updated with the time information read from the fourth buffer. In step S904, the contents of the key press standby time register DT_on (KN, F) or the key release standby time register DT_off (KN, F) are updated according to the update result. Then, the key event found in step S903 is deleted from the fourth buffer (step S905), and the process returns to the main routine.

このように本実施例によれば、RAM12から読み出したキーイベントに従って鍵駆動が行われ、この鍵駆動によって生じたキーイベントが検出される毎に、その鍵に対応した押鍵用待機時間レジスタDT_on(KN,F)または離鍵用待機時間レジスタDT_off(KN,F)の内容が更新される。   As described above, according to the present embodiment, key driving is performed according to the key event read from the RAM 12, and each time a key event generated by the key driving is detected, the key pressing waiting time register DT_on corresponding to the key is detected. The contents of (KN, F) or the key release waiting time register DT_off (KN, F) are updated.

<変形例>
以上、本発明の各実施例を説明したが、本発明にはさらに以下のような変形が考えられる。
(1)内部的に発生した演奏データに基づいて鍵盤を駆動するものに限らず、外部装置(電子鍵盤楽器や自動演奏装置等)から供給された演奏データに基づいて鍵盤を駆動するようにしても良い。すなわち、本発明にいう「自動演奏」とは、本電子鍵盤楽器の鍵を演奏者が操作することにより得られる演奏以外のすべてを含むものである。このとき、反応時間dTを最初に求めるときは、外部装置に対して各キーのオン/オフイベントを出力するように要求してイベントを受信し、外部装置と本電子鍵盤楽器との間の信号伝送に要する遅延を含めた反応時間dTを求めるようにしてもよい。
<Modification>
As mentioned above, although each Example of this invention was described, the following modifications can be considered to this invention.
(1) The keyboard is driven based on performance data supplied from an external device (such as an electronic keyboard instrument or an automatic performance device), not limited to driving the keyboard based on internally generated performance data. Also good. That is, the “automatic performance” referred to in the present invention includes all but the performance obtained by the player operating the keys of the electronic keyboard instrument. At this time, when the reaction time dT is first obtained, the external device is requested to output an ON / OFF event of each key, the event is received, and a signal between the external device and the electronic keyboard instrument is received. You may make it obtain | require reaction time dT including the delay which transmission requires.

(2)鍵盤の駆動方式はどのようなものであってもよい。
(3)上記第3実施例では、反応時間dT_onおよびdT_offを逐次変更する際、時間の経過に従って同じキーに関して得られた複数のdT_on等を平均化するようにしてもよい。
(2) Any keyboard driving method may be used.
(3) In the third embodiment, when the reaction times dT_on and dT_off are sequentially changed, a plurality of dT_on and the like obtained for the same key may be averaged over time.

(4)上記第2実施例では、演奏者の操作により発生したキーイベントの内、駆動により発生したキーイベントとキーコードが一致し、かつ、タイミングがほぼ一致するが、ベロシティの異なるなるものについては発音させるようにしたが、この時、駆動信号の元となった演奏データによる発音を無効とするようにしてもよい。また、無効とするか否かを選択できるようにしてもよい。 (4) In the second embodiment, among the key events generated by the player's operation, the key event generated by driving and the key code match and the timing is approximately the same, but the velocity is different. However, at this time, the sound generation by the performance data that is the source of the drive signal may be invalidated. Further, it may be possible to select whether or not to invalidate.

(5)上記第1実施例では反応時間を測定する際に鍵を1個ずつ駆動するようにしたが、複数個ずつまとめて、あるいは全鍵同時に駆動し、駆動した鍵についての反応時間を測定するようにしてもよい。
(6)反応時間の測定をする際、鍵が駆動されるが、この鍵の駆動により楽音を発音させてもよいし、発音させないようにしてもよい。また、発音させるか発音させないかを演奏者が選択し得るようにしてもよい。
(5) In the first embodiment, the keys are driven one by one when measuring the reaction time. However, the keys are driven one by one, or all keys are driven simultaneously, and the reaction time for the driven key is measured. You may make it do.
(6) When the reaction time is measured, a key is driven, and a musical tone may be generated or not generated by driving the key. Further, the player may be able to select whether or not to pronounce.

(7)演奏者の指によって押鍵がされている(マニュアル押鍵)間に、該鍵に対応した自動演奏イベントが発生した場合、この自動演奏イベントに対応した押鍵駆動を中止するか、あるいは押鍵駆動後、即座に離鍵駆動信号を送るように制御手段を設計してもよい。このようにすることにより、マニュアル押鍵後に発生した自動演奏イベントにより鍵が押鍵駆動されている状態でマニュアル離鍵された時に鍵が戻らないといった不都合を防止することができる。 (7) When an automatic performance event corresponding to the key occurs while the key is pressed by the performer's finger (manual key pressing), the key pressing drive corresponding to the automatic performance event is stopped, Alternatively, the control means may be designed to send a key release drive signal immediately after the key press drive. By doing this, it is possible to prevent the inconvenience that the key does not return when the key is manually released in a state where the key is driven to be depressed by an automatic performance event that occurs after the manual key depression.

この発明の第1実施例による電子鍵盤楽器の構成を示すブロック図である。It is a block diagram which shows the structure of the electronic keyboard musical instrument by 1st Example of this invention. 同実施例における鍵の取り付け構造を示す図である。It is a figure which shows the attachment structure of the key in the Example. 同実施例における演奏データを示す図である。It is a figure which shows the performance data in the Example. 同実施例における第1〜第3のバッファを示す図である。It is a figure which shows the 1st-3rd buffer in the Example. 同実施例におけるキーイベント発生タイミング、鍵駆動指示タイミングおよびキーイベントに対応した発音タイミングの関係を示す図である。It is a figure which shows the relationship between the key event generation timing in the same Example, a key drive instruction | indication timing, and the sound generation timing corresponding to a key event. 同実施例の動作を示すフローチャートである。It is a flowchart which shows operation | movement of the Example. 同実施例の動作を示すフローチャートである。It is a flowchart which shows operation | movement of the Example. 同実施例の動作を示すフローチャートである。It is a flowchart which shows operation | movement of the Example. 同実施例の動作を示すフローチャートである。It is a flowchart which shows operation | movement of the Example. 同実施例の動作を示すフローチャートである。It is a flowchart which shows operation | movement of the Example. 同実施例の動作を示すフローチャートである。It is a flowchart which shows operation | movement of the Example. 同実施例の動作を示すフローチャートである。It is a flowchart which shows operation | movement of the Example. この発明の第2実施例における駆動信号Fとベロシテイの関係を示す図である。It is a figure which shows the relationship between the drive signal F and velocity in 2nd Example of this invention. 同実施例の動作を示すフローチャートである。It is a flowchart which shows operation | movement of the Example. 同実施例の動作を示すフローチャートである。It is a flowchart which shows operation | movement of the Example. この発明の第3実施例において使用する第4バッファを示す図である。It is a figure which shows the 4th buffer used in 3rd Example of this invention. 同実施例の動作を示すフローチャートである。It is a flowchart which shows operation | movement of the Example. 同実施例の動作を示すフローチャートである。It is a flowchart which shows operation | movement of the Example. 同実施例の動作を示すフローチャートである。It is a flowchart which shows operation | movement of the Example.

符号の説明Explanation of symbols

1・・・鍵盤、2・・・鍵盤駆動回路、3・・・押鍵検出回路、7・・・音源回路、10・・・CPU、11・・・ROM、12・・・RAM、13・・・タイマ。 DESCRIPTION OF SYMBOLS 1 ... Keyboard, 2 ... Keyboard drive circuit, 3 ... Key press detection circuit, 7 ... Sound source circuit, 10 ... CPU, 11 ... ROM, 12 ... RAM, 13. ..Timer.

Claims (6)

自動演奏イベントを発生する手段と、
自動演奏イベントに基づく駆動指示に従って鍵盤を駆動する鍵駆動手段と、
前記鍵盤の動作を検出することにより演奏イベントを発生する検出手段と、
前記鍵駆動手段に対して前記駆動指示が与えられてから前記検出手段により演奏イベントが発生されるまでの反応時間を測定し、自動演奏の際には、前記自動演奏イベントに対応した楽音形成処理を楽音形成手段へ指示するとともに、この指示のタイミングよりも前記反応時間分だけ先行して該自動演奏イベントに対応した駆動指示を前記鍵駆動手段へ出力する制御手段と
を具備することを特徴とする電子鍵盤楽器。
Means for generating automatic performance events;
Key driving means for driving the keyboard according to a driving instruction based on an automatic performance event;
Detecting means for generating a performance event by detecting the operation of the keyboard;
The reaction time from when the driving instruction is given to the key driving means until the performance event is generated by the detecting means is measured, and in the case of automatic performance, musical tone formation processing corresponding to the automatic performance event Control means for outputting a driving instruction corresponding to the automatic performance event to the key driving means preceding the timing of the instruction by the reaction time. Electronic keyboard instrument to play.
前記制御手段は、自動演奏に先立って前記反応時間を測定することを特徴とする請求項1記載の電子鍵盤楽器。   The electronic keyboard instrument according to claim 1, wherein the control means measures the reaction time prior to automatic performance. 前記制御手段は、自動演奏時に前記駆動指示を出力する際に前記反応時間を測定することを特徴とする請求項1記載の電子鍵盤楽器。   2. The electronic keyboard instrument according to claim 1, wherein the control means measures the reaction time when outputting the driving instruction during automatic performance. 前記制御手段は、前記自動演奏イベントの指定に従って複数種類の駆動強度に対応した駆動指示を前記鍵駆動手段へ出力するものであり、これらの複数種類の駆動強度について前記反応時間の測定を行うことを特徴とする請求項1記載の電子鍵盤楽器。   The control means outputs a driving instruction corresponding to a plurality of types of driving intensities to the key driving means in accordance with the designation of the automatic performance event, and measures the reaction time for the plurality of types of driving intensities. The electronic keyboard instrument according to claim 1. 発音強度データを含む自動演奏イベントを発生する手段と、
自動演奏イベントに基づく駆動指示に従って鍵盤を駆動する鍵駆動手段と、
前記自動演奏イベントに対応した楽音形成処理を電子的な音源に指示して発音強度データに応じた強度の楽音を形成するとともに、該自動演奏イベントに含まれる発音強度データを該発音強度データの分解能よりも粗い閾値により量子化することにより鍵駆動強度を求め、この鍵駆動強度に従って鍵盤を駆動すべき旨の駆動指示を前記鍵駆動手段に供給する制御手段と
を具備することを特徴とする電子鍵盤楽器。
Means for generating an automatic performance event including pronunciation intensity data;
Key driving means for driving the keyboard according to a driving instruction based on an automatic performance event;
A musical tone generation process corresponding to the automatic performance event is instructed to an electronic sound source to form a musical tone with an intensity corresponding to the pronunciation intensity data, and the pronunciation intensity data included in the automatic performance event is converted to the resolution of the pronunciation intensity data. Control means for obtaining a key driving strength by quantizing with a rougher threshold value and supplying a driving instruction to the key driving means to drive the keyboard according to the key driving strength. Keyboard instrument.
自動演奏イベントを発生する手段と、
自動演奏イベントに基づく駆動指示に従って鍵盤を駆動する鍵駆動手段と、
前記鍵盤の動作を検出することにより演奏イベントを発生する検出手段と、
前記検出手段により既に動作が検出されている鍵盤に対応する自動演奏イベントが発生した場合、該自動演奏イベントによる鍵盤駆動を中止するか、あるいは押鍵駆動後、即座に離鍵駆動を行う制御手段とを具備すること
を特徴とする電子鍵盤楽器。
Means for generating automatic performance events;
Key driving means for driving the keyboard according to a driving instruction based on an automatic performance event;
Detecting means for generating a performance event by detecting the operation of the keyboard;
When an automatic performance event corresponding to a keyboard whose operation has already been detected by the detection means has occurred, the control means for canceling the keyboard drive by the automatic performance event or performing the key release drive immediately after the key depression drive An electronic keyboard instrument characterized by comprising:
JP2005009656A 2005-01-17 2005-01-17 Electronic keyboard instrument Expired - Fee Related JP3966328B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005009656A JP3966328B2 (en) 2005-01-17 2005-01-17 Electronic keyboard instrument

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005009656A JP3966328B2 (en) 2005-01-17 2005-01-17 Electronic keyboard instrument

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP14375195A Division JP3704747B2 (en) 1995-06-09 1995-06-09 Electronic keyboard instrument

Related Child Applications (1)

Application Number Title Priority Date Filing Date
JP2007027150A Division JP4232829B2 (en) 2007-02-06 2007-02-06 Electronic keyboard instrument

Publications (2)

Publication Number Publication Date
JP2005141246A true JP2005141246A (en) 2005-06-02
JP3966328B2 JP3966328B2 (en) 2007-08-29

Family

ID=34698199

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005009656A Expired - Fee Related JP3966328B2 (en) 2005-01-17 2005-01-17 Electronic keyboard instrument

Country Status (1)

Country Link
JP (1) JP3966328B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2043088A1 (en) * 2007-09-28 2009-04-01 Yamaha Corporation Music performance system for music session and component musical instruments
JP2009116325A (en) * 2007-10-19 2009-05-28 Yamaha Corp Music performance system

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2043088A1 (en) * 2007-09-28 2009-04-01 Yamaha Corporation Music performance system for music session and component musical instruments
US7820902B2 (en) 2007-09-28 2010-10-26 Yamaha Corporation Music performance system for music session and component musical instruments
JP2009116325A (en) * 2007-10-19 2009-05-28 Yamaha Corp Music performance system
EP2051238A3 (en) * 2007-10-19 2015-01-28 Yamaha Corporation Music performance system for music session and component musical instruments

Also Published As

Publication number Publication date
JP3966328B2 (en) 2007-08-29

Similar Documents

Publication Publication Date Title
EP1130571A2 (en) Musical instrument equipped with synchronizer for plural parts of music
JP2007256360A (en) Keyboard instrument
JP2005114752A (en) Music player
JP3887978B2 (en) Performance support device, performance support method, and recording medium recording performance support program
JP5652415B2 (en) Touch detection device, touch detection method, and electronic musical instrument
JP4232829B2 (en) Electronic keyboard instrument
JP2005234155A (en) Automatic playing apparatus
US7314993B2 (en) Automatic performance apparatus and automatic performance program
JP3966328B2 (en) Electronic keyboard instrument
JP3704747B2 (en) Electronic keyboard instrument
JP4259606B2 (en) Electronic keyboard instrument
US20100139474A1 (en) Musical tone generating apparatus and musical tone generating program
JP6744522B2 (en) Performance system and control method
JP2002358080A (en) Playing control method, playing controller and musical tone generator
JP2001166773A (en) Electronic musical instrument
JP4056902B2 (en) Automatic performance apparatus and automatic performance method
JP3319043B2 (en) Automatic performance device
JP2001195065A (en) Unit and method for control
JP5657868B2 (en) Musical sound control method and musical sound control device
JP4692287B2 (en) Keyboard instrument and mute unit
JP4572980B2 (en) Automatic performance device and program
JP2007178890A (en) Automatic playing musical device
JP4170549B2 (en) Electronic musical instruments
JP2001195061A (en) Method and device for synchronous control
CN117437898A (en) Sound output system

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20061218

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20061226

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070206

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20070521

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20100608

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20110608

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20120608

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20120608

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20130608

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20140608

Year of fee payment: 7

LAPS Cancellation because of no payment of annual fees