JP5444719B2 - Automatic performance electronic piano control device and program for realizing the control method - Google Patents

Automatic performance electronic piano control device and program for realizing the control method Download PDF

Info

Publication number
JP5444719B2
JP5444719B2 JP2009004707A JP2009004707A JP5444719B2 JP 5444719 B2 JP5444719 B2 JP 5444719B2 JP 2009004707 A JP2009004707 A JP 2009004707A JP 2009004707 A JP2009004707 A JP 2009004707A JP 5444719 B2 JP5444719 B2 JP 5444719B2
Authority
JP
Japan
Prior art keywords
key
drive
state
driving
duty ratio
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
JP2009004707A
Other languages
Japanese (ja)
Other versions
JP2010164630A (en
Inventor
元英 清水
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Yamaha Corp
Original Assignee
Yamaha Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Yamaha Corp filed Critical Yamaha Corp
Priority to JP2009004707A priority Critical patent/JP5444719B2/en
Publication of JP2010164630A publication Critical patent/JP2010164630A/en
Application granted granted Critical
Publication of JP5444719B2 publication Critical patent/JP5444719B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、電子ピアノの各鍵を自動演奏に合わせて駆動制御する自動演奏電子ピアノの制御装置およびその制御方法を実現するためのプログラムに関する。 The present invention relates to an automatic performance electronic piano control device that drives and controls each key of an electronic piano in accordance with automatic performance, and a program for realizing the control method .

ピアノの各鍵を自動的に駆動制御する制御装置は、従来から知られている。   2. Description of the Related Art Control devices that automatically drive and control each key of a piano are conventionally known.

このような制御装置をアコースティックピアノに適用して、自動演奏を行わせるようにした、いわゆる自動ピアノと呼ばれるものがある。自動ピアノは、各鍵をソレノイド等のアクチュエータで駆動可能に構成し、予め記録された演奏情報(ピアノロールまたはMIDI(musical instrument digital interface)データ)に基づいて、対応するアクチュエータを制御することで、対応する鍵を駆動する。その結果、当該鍵に連動するハンマが駆動されて打弦され、自動演奏が実現される。このように自動ピアノでは、楽音は、ハンマが実際に弦を叩くことによって発生するので、演奏情報と鍵の動作位置や速度に基づいて、ハンマの駆動制御、つまりアクチュエータの駆動制御をフィードバック制御することが行われる。   There is a so-called automatic piano in which such a control device is applied to an acoustic piano to perform automatic performance. The automatic piano is configured so that each key can be driven by an actuator such as a solenoid, and the corresponding actuator is controlled based on pre-recorded performance information (piano roll or MIDI (musical instrument digital interface) data). Drive the corresponding key. As a result, the hammer linked to the key is driven and struck to achieve automatic performance. As described above, in the automatic piano, the musical sound is generated when the hammer actually strikes the strings, so the hammer drive control, that is, the actuator drive control is feedback-controlled based on the performance information and the key operation position and speed. Is done.

一方、電子ピアノは、電子音源を備え、予め記憶された演奏データ(MIDIデータ)を再生して生成した楽音パラメータを電子音源に供給し、電子音源から楽音を発音させることで、自動演奏を行うようにしている。つまり電子ピアノは、自動ピアノに対して、鍵を駆動しなくても自動演奏できる点が異なっている。しかし昨今、電子ピアノでも、楽器らしさをより表現したいという観点から、電子音源から楽音を発音させると同時に、鍵を自動的に駆動させるようにしたものが商品化されている。この電子ピアノの鍵駆動の制御に上記自動ピアノのフィードバック制御を適用することは、理論的にはもちろん可能であるが、フィードバック制御を適用すると、高性能な駆動装置やキーセンサが必要となったり、演算処理が増加したりして、製造コストが増大したり、CPUへの負荷が増大したりする。したがって、鍵駆動が直接楽音の発音に結び付かない電子ピアノの鍵駆動の制御に上記フィードバック制御を適用することは有効ではない。   On the other hand, an electronic piano is equipped with an electronic sound source, and automatically performs performance by supplying musical sound parameters generated by reproducing pre-stored performance data (MIDI data) to the electronic sound source and generating sound from the electronic sound source. I am doing so. That is, the electronic piano is different from the automatic piano in that it can be automatically played without driving a key. Recently, however, electronic pianos have been commercialized in which musical sounds are generated from an electronic sound source and keys are automatically driven from the viewpoint of expressing a musical instrument. It is theoretically possible to apply the automatic piano feedback control to the electronic piano key drive control. However, when the feedback control is applied, a high-performance drive device or key sensor is required. Calculation processing increases, manufacturing costs increase, and the load on the CPU increases. Therefore, it is not effective to apply the feedback control to the key drive control of an electronic piano where the key drive is not directly linked to the sound of a musical tone.

この製造コストの増大およびCPUへの負荷の増大を解消するために、鍵駆動の制御にフィードフォワード制御を適用した電子ピアノの制御装置も提案されている(たとえば、特許文献1参照)。この電子ピアノの制御装置では、鍵の全ストローク(離鍵から押鍵を経由して再度離鍵に至るストローク)を複数の動作区間に分割し、各動作区間毎に、鍵駆動の制御値を変更して、具体的には、ソレノイドに電力を供給する電力供給部に供給するPWM(pulse width modulation)波形信号のデューティ比を段階的に切換えて、鍵の押鍵および離鍵を表す鍵情報に応じた鍵の押鍵動作および離鍵動作において、各種部材間の衝突による雑音の発生および衝突部分の損傷を抑制するようにしている。   In order to eliminate the increase in the manufacturing cost and the load on the CPU, an electronic piano control device in which feedforward control is applied to the key drive control has also been proposed (for example, see Patent Document 1). In this electronic piano control device, the entire key stroke (stroke from key release to key release through key depression) is divided into a plurality of operation sections, and a key drive control value is set for each operation section. Specifically, key information representing key pressing and key release by stepwise switching the duty ratio of a PWM (pulse width modulation) waveform signal supplied to the power supply unit that supplies power to the solenoid In the key pressing operation and the key releasing operation corresponding to the above, generation of noise due to collision between various members and damage to the collision portion are suppressed.

また、上記従来の電子ピアノの制御装置と同様に、PWM波形信号のデューティ比を切換えることでソレノイドに供給する電力を制御して、鍵の押鍵動作および離鍵動作における各種部材間の衝突による雑音の発生を抑制するものであるが、上記従来の電子ピアノの制御装置と異なり、PWM波形信号のデューティ比の切換えを、鍵の回動に伴ってオン/オフする接点時間差タイプの2メイク式タッチレスポンススイッチの各接点のオン/オフに応じて行うようにした電子ピアノの制御装置もある(たとえば、特許文献2参照)。   Further, similarly to the above-described conventional electronic piano control device, the power supplied to the solenoid is controlled by switching the duty ratio of the PWM waveform signal, and by the collision between various members in the key pressing operation and the key releasing operation. Although it suppresses the generation of noise, unlike the conventional electronic piano control device, the contact time difference type 2-make type that switches the duty ratio of the PWM waveform signal on / off as the key rotates. There is also a control device for an electronic piano that is performed in accordance with ON / OFF of each contact point of the touch response switch (see, for example, Patent Document 2).

特開2008−238828号公報JP 2008-238828 A 特開平10−171447号公報Japanese Patent Laid-Open No. 10-171447

しかし、上記従来の電子ピアノの制御装置のいずれも、離鍵時の再打鍵において安定した鍵駆動が困難であった。   However, any of the above-described conventional electronic piano control devices has been difficult to perform stable key driving in re-keying at the time of key release.

つまり、上記従来の電子ピアノの制御装置のうちの前者では、離鍵から押鍵に至る押鍵ストロークも、押鍵から離鍵に至る離鍵ストロークも、それぞれ複数の動作区間に分割して、各動作区間毎に鍵駆動の制御値を変更するようにし、離鍵時の再打鍵においては、再打鍵が指示されたタイミングが、離鍵ストローク中の複数に分割された動作区間のいずれに含まれるかによって、押鍵ストローク中の複数に分割された動作区間のうち、予め特定されたいずれかの動作区間に戻って合流させ、その動作区間から駆動制御を継続させるようにしている。要するに、離鍵時の再打鍵においても、通常打鍵(の一部)の駆動制御を流用している。しかし、通常打鍵と離鍵時の再打鍵とでは、必要な駆動電流が異なるために、どちらか一方の打鍵の駆動制御だけで両方の打鍵を最適に制御することは難しく、上記前者の駆動装置では、通常打鍵の駆動制御を妥協して離鍵時の再打鍵の駆動制御に合わせているのが実情である。   That is, in the former of the above-mentioned conventional electronic piano control devices, the key stroke from key release to key press and the key release stroke from key press to key release are each divided into a plurality of operation sections, The key-driven control value is changed for each operation section, and in the case of re-keying at the time of key release, the timing at which the re-key is instructed is included in any of the operation sections divided into a plurality of key release strokes. Depending on whether or not, the operation section divided into a plurality of times during the key depression stroke returns to one of the operation sections specified in advance, and the drive control is continued from the operation section. In short, the drive control of the normal keystroke (a part thereof) is also used for the rekeying at the time of key release. However, since the required driving current is different between normal key pressing and re-keying at the time of key release, it is difficult to optimally control both keys by only driving control of one of the keys. Then, the actual situation is that the normal keystroke drive control is compromised to match the keystroke drive control at the time of key release.

一方、上記従来の電子ピアノの制御装置のうちの後者では、離鍵時の再打鍵の駆動制御について、特に言及されていない。   On the other hand, the latter of the above-described conventional electronic piano control devices does not particularly mention re-key drive control at the time of key release.

本発明は、この点に着目してなされたものであり、可及的に簡略な鍵盤および駆動装置構成で、離鍵時の再打鍵において安定した鍵駆動制御を行うことが可能となる自動演奏電子ピアノの制御装置およびその制御方法を実現するためのプログラムを提供することを目的とする。 The present invention has been made paying attention to this point, and an automatic performance that enables stable key drive control in re-keying at the time of key release with the simplest possible keyboard and drive device configuration. An object of the present invention is to provide an electronic piano control device and a program for realizing the control method .

上記目的を達成するため、請求項1に記載の自動演奏電子ピアノの制御装置は、複数の鍵をそれぞれ独立に駆動して、あるいは複数の鍵のそれぞれと連動する部材をそれぞれ独立に駆動して、鍵を押鍵前の初期位置から押鍵位置まで変位させる押鍵動作、および鍵を前記押鍵位置から前記初期位置まで変位させる離鍵動作を含む押離鍵動作を鍵毎に行わせる鍵駆動手段と、時間経過に従って供給される鍵の押鍵および離鍵を表す鍵情報に応じて、駆動信号を前記鍵駆動手段に供給することにより、対応する鍵の押離鍵動作を制御する鍵駆動制御手段と、前記鍵駆動制御手段が前記対応する鍵の押離鍵動作を制御するための駆動信号パターンを複数種類記憶する記憶手段であって、前記複数種類の駆動信号パターンには、当該押離鍵動作を時間経過に従って複数の段階に分割して得られたそれぞれの段階に予め設定された駆動力を発生させる駆動信号を規定した第1の駆動信号パターンと、当該第1の駆動信号パターンの前記段階の少なくとも一部について、当該第1の駆動信号パターンとは異なる分割で、且つ異なる駆動力を発生させる駆動信号を規定した第2の駆動信号パターンが含まれるものを記憶する記憶手段と、各鍵について離鍵動作開始から当該離鍵動作終了までの間に、当該離鍵動作中の鍵に対して再度の押鍵を表す鍵情報が供給されたか否かを判定することにより、各鍵について再打鍵が指示されたか否かを判定する再打鍵判定手段とを有し、前記鍵駆動制御手段は、前記再打鍵判定手段による判定結果、再打鍵の指示がなされなかったときには、前記第1の駆動信号パターンを用いる一方、再打鍵の指示がなされたときには、前記第2の駆動信号パターンを用いて、対応する鍵の押離鍵動作を制御することを特徴とする。 In order to achieve the above object, the automatic performance electronic piano control device according to claim 1 drives each of a plurality of keys independently or drives each member linked to each of a plurality of keys independently. A key that performs a key pressing operation for each key, including a key pressing operation for displacing the key from the initial position before the key pressing to the key pressing position and a key releasing operation for displacing the key from the key pressing position to the initial position A key that controls a key pressing operation of the corresponding key by supplying a driving signal to the key driving unit in accordance with key information representing key pressing and key release supplied over time with the driving unit. Drive control means and storage means for storing a plurality of types of drive signal patterns for the key drive control means to control the key pressing and releasing operation of the corresponding key , wherein the plurality of types of drive signal patterns include Press and release key for time A first drive signal pattern defining a drive signal for generating a preset driving force at each stage obtained by dividing the stage into a plurality of stages, and at least one of the stages of the first drive signal pattern For some keys, a storage means for storing a second drive signal pattern that stipulates a drive signal that generates a different drive force in a different division from the first drive signal pattern, and for each key. By determining whether or not key information representing the key depression again is supplied to the key during the key release operation from the start of the key operation to the end of the key release operation, and a re-keying determining means for determining whether an instruction, the key actuation control means, the result of the determination by re-keying determining means, when the instruction of re-keying is not performed, the first drive While using No. pattern, when the instruction of re-keying is performed, using the second drive signal pattern, and controlling the key depression and key release operation of the corresponding key.

請求項2に記載の自動演奏電子ピアノの制御装置は、請求項1の自動演奏電子ピアノの制御装置において、各鍵について離鍵を表す鍵情報の供給が開始してから、当該鍵の次の押鍵を表す鍵情報が供給されるまでの経過時間を計測する計測手段と、前記計測手段によって計測された経過時間が、対応する鍵の離鍵動作開始から当該離鍵動作終了までの所定時間を分割して得られた複数の部分区間のうちのいずれかに該当するか否かを判定する経過時間判定手段とをさらに有し、前記経過時間判定手段によって、前記経過時間が前記複数の部分区間のいずれかに該当すると判定されたときには、前記鍵駆動制御手段は、前記該当する部分区間に応じて異なる押鍵動作用駆動信号を用いて、対応する鍵の押離鍵動作を制御することを特徴とする。   The control device for an automatic performance electronic piano according to claim 2 is the control device for an automatic performance electronic piano according to claim 1, wherein after the supply of key information representing key release for each key starts, Measuring means for measuring the elapsed time until key information representing key depression is supplied, and the elapsed time measured by the measuring means is a predetermined time from the start of the key release operation of the corresponding key to the end of the key release operation. And an elapsed time determining means for determining whether or not one of the plurality of partial sections obtained by dividing the plurality of partial sections, wherein the elapsed time is determined by the elapsed time determining means. When it is determined that it corresponds to one of the sections, the key drive control means controls a key pressing / release operation of the corresponding key using a key pressing operation drive signal that differs depending on the corresponding partial section. It is characterized by.

請求項3に記載の自動演奏電子ピアノの制御装置は、請求項2の自動演奏電子ピアノの制御装置において、前記第2の駆動信号パターン、押鍵動作用駆動信号パターンであって、押鍵動作領域において段階的に変化する駆動力を発生するように変化する複数の駆動信号によって構成され、前記経過時間判定手段によって、前記経過時間が前記複数の部分区間のいずれかに該当すると判定されたときには、前記鍵駆動制御手段は、前記押鍵動作用駆動信号パターン内の、前記該当する部分区間に応じて異なる段階の駆動信号を用いて、対応する鍵の押離鍵動作を制御することを特徴とする。 The control device of the automatic performance electronic piano according to claim 3, in the control device of the automatic playing electronic piano according to claim 2, wherein the second drive signal pattern is a driving signal pattern press key operation, the key depression It is composed of a plurality of drive signals that change so as to generate a driving force that changes stepwise in the operation region, and the elapsed time determination means determines that the elapsed time corresponds to one of the plurality of partial sections. The key driving control means controls the key pressing operation of the corresponding key by using a driving signal at a different stage depending on the corresponding partial section in the key pressing driving signal pattern. It is characterized by.

請求項4に記載の自動演奏電子ピアノの制御装置は、請求項2の自動演奏電子ピアノの制御装置において、前記第2の駆動信号パターン、前記部分区間の個数に応じた複数の押鍵動作用駆動信号パターンであって、それぞれが独立したものによって構成され、前記経過時間判定手段によって、前記経過時間が前記複数の部分区間のいずれかに該当すると判定されたときには、前記鍵駆動制御手段は、前記複数の押鍵動作用駆動信号パターンから、前記該当する部分区間に応じていずれか1つを選択し、該選択された押鍵動作用駆動信号パターンを用いて、対応する鍵の押離鍵動作を制御することを特徴とする。 A control system for an automatic playing electronic piano according to claim 4, in the control device of the automatic playing electronic piano according to claim 2, wherein the second drive signal pattern, a plurality of key depression corresponding to the number of prior SL subinterval The drive signal patterns for operation, each of which is constituted by an independent one , and when the elapsed time determining means determines that the elapsed time corresponds to one of the plurality of partial sections, the key drive control means Selects one of the plurality of key pressing operation drive signal patterns in accordance with the corresponding partial section, and uses the selected key pressing operation drive signal pattern to press the corresponding key. The key release operation is controlled.

請求項5に記載の自動演奏電子ピアノの制御装置は、請求項1〜4のいずれかの自動演奏電子ピアノの制御装置において、前記押離鍵動作に応じた鍵の変位により、鍵の押下位置が複数の所定位置のいずれかに到達したことを、対応する検出信号を出力して検出する検出手段をさらに有し、前記鍵駆動制御手段は、前記検出手段から出力された検出信号に応じて、前記選択された駆動信号パターン内の段階を切り替え、該切り替えられた段階に対応する駆動信号を前記鍵駆動手段に供給することにより、対応する鍵の押離鍵動作を制御することを特徴とする。
上記目的を達成するため、請求項6に記載のプログラムは、請求項1と同様の技術的思想によって実現できる。
The automatic performance electronic piano control device according to claim 5 is the automatic performance electronic piano control device according to any one of claims 1 to 4, wherein the key pressing position is determined by the key displacement corresponding to the key release / release operation. Further includes detection means for outputting a corresponding detection signal to detect that has reached one of a plurality of predetermined positions, and the key drive control means is responsive to the detection signal output from the detection means. Switching a step in the selected drive signal pattern and supplying a drive signal corresponding to the switched step to the key driving means to control a key pressing operation of the corresponding key. To do.
In order to achieve the above object, the program according to claim 6 can be realized by the same technical idea as that of claim 1.

請求項1または6に記載の発明によれば、再打鍵判定手段による判定結果、再打鍵の指示がなされなかったときには、前記第1の駆動信号パターンを用いる一方、再打鍵の指示がなされたときには、前記第2の駆動信号パターンを用いて、対応する鍵の押離鍵動作が制御されるので、再打鍵判定手段によって再打鍵が指示されたと判定されたときに、再打鍵専用の第2の駆動信号パターンを用いて、対応する鍵の再打鍵時の駆動制御をより安定化させることが可能となる。 According to the first or sixth aspect of the present invention, when a rekeying instruction is not given as a result of the determination by the rekeying determination means , the first driving signal pattern is used while a rekeying instruction is given. sometimes, by using the second drive signal pattern, since the key depression and key release operation of the corresponding key is controlled, when it is determined that the re-keying is instructed by the re-keying determining means re-keying dedicated second using the drive signal pattern, it is possible to stabilize the drive control of the re-keying when the corresponding key.

請求項2に記載の発明によれば、計測手段によって計測された経過時間が、対応する鍵の離鍵動作開始から当該離鍵動作終了までの所定時間を分割して得られた複数の部分区間のうちのいずれかに該当すると判定されたときには、前記該当する部分区間に応じて異なる押鍵動作用駆動信号を用いて、対応する鍵の押離鍵動作が制御されるので、つまり、離鍵動作状態に応じて異なる駆動信号を鍵駆動手段に供給することにより、対応する鍵の押離鍵動作が制御されるので、対応する鍵の再打鍵時の駆動制御をさらに効率化して安定化させることが可能となる。   According to the second aspect of the present invention, the plurality of partial sections obtained by dividing the elapsed time measured by the measuring means by dividing a predetermined time from the start of the key release operation of the corresponding key to the end of the key release operation. When it is determined that any one of the above is satisfied, the key pressing operation of the corresponding key is controlled using a different key pressing operation drive signal according to the corresponding partial section. By supplying different driving signals to the key driving means according to the operating state, the key pressing and releasing operation of the corresponding key is controlled, so that the driving control at the time of re-keying the corresponding key is made more efficient and stabilized. It becomes possible.

請求項3に記載の発明によれば、記憶手段には、再打鍵判定手段によって再打鍵が指示されたと判定されたときに選択される再打鍵専用の第2の駆動信号パターンと、それ以外の通常打鍵用の第1の駆動信号パターンの2種類の駆動信号パターンを記憶しておけばよいので、記憶手段の記憶容量を低減させることができる。 According to the third aspect of the present invention, the storage means has the second drive signal pattern dedicated to rekeying selected when it is determined that rekeying is instructed by the rekeying determination means, Since it is sufficient to store two types of drive signal patterns of the first drive signal pattern for normal keystroke, the storage capacity of the storage means can be reduced.

請求項4に記載の発明によれば、計測手段によって計測された経過時間が、対応する鍵の離鍵動作開始から当該離鍵動作終了までの所定時間を分割して得られた複数の部分区間のうちのいずれかに該当すると判定されたときには、それぞれが独立した複数の押鍵動作用駆動信号パターンから、前記該当する部分区間に応じていずれか1つが選択され、該選択された押鍵動作用駆動信号パターンを用いて、対応する鍵の押離鍵動作が制御されるので、対応する鍵の再打鍵時の駆動制御をさらにきめ細かく行うことが可能となる。   According to the invention described in claim 4, the plurality of partial sections obtained by dividing the elapsed time measured by the measuring means by dividing a predetermined time from the start of the key release operation of the corresponding key to the end of the key release operation. When it is determined that any one of them is selected, one of the plurality of independent key pressing operation drive signal patterns is selected according to the corresponding partial section, and the selected key pressing operation is selected. Since the corresponding key pressing / releasing operation is controlled using the drive signal pattern, the drive control at the time of re-keying the corresponding key can be performed more finely.

請求項5に記載の発明によれば、検出手段から出力された、鍵の特定の押下位置を示す検出信号に応じて、選択された駆動信号パターン内の段階が切り替えられ、該切り替えられた段階に対応する駆動信号を鍵駆動手段に供給することにより、対応する鍵の押離鍵動作が制御されるので、つまり、鍵の特定の押下位置に応じて当該鍵の駆動力が制御されるので、対応する鍵の再打鍵時の駆動制御をさらにきめ細かく行うことが可能となる。   According to the fifth aspect of the present invention, the steps in the selected drive signal pattern are switched in accordance with the detection signal output from the detection means and indicating the specific pressing position of the key. By supplying the driving signal corresponding to the key driving means, the key pressing operation of the corresponding key is controlled, that is, the driving force of the key is controlled according to the specific pressing position of the key. Thus, it becomes possible to perform the drive control more finely when the corresponding key is re-keyed.

本発明の第1の実施の形態に係る制御装置を適用した電子ピアノの概略構成を示すブロック図である。It is a block diagram which shows schematic structure of the electronic piano to which the control apparatus which concerns on the 1st Embodiment of this invention is applied. 図1中の鍵盤装置の各鍵の駆動を制御する制御構成を示すブロック図である。It is a block diagram which shows the control structure which controls the drive of each key of the keyboard apparatus in FIG. 図1中の鍵盤装置の非押鍵状態の断面図である。FIG. 2 is a sectional view of the keyboard device in FIG. 1 in a non-key-pressed state. 図1中の鍵盤装置の押鍵状態の断面図である。It is sectional drawing of the key pressing state of the keyboard apparatus in FIG. 図3中の駆動ユニットの平面図である。FIG. 4 is a plan view of the drive unit in FIG. 3. 鍵駆動用テーブルの構成の一例を示す図である。It is a figure which shows an example of a structure of the table for key drive. 図1中のCPUによって実行される自動演奏処理プログラムの手順を示すフローチャートである。It is a flowchart which shows the procedure of the automatic performance processing program performed by CPU in FIG. 図7中の鍵駆動イベント処理サブルーチンの詳細な手順を示すフローチャートである。It is a flowchart which shows the detailed procedure of the key drive event processing subroutine in FIG. 図8中の鍵駆動オフ処理サブルーチンの詳細な手順を示すフローチャートである。It is a flowchart which shows the detailed procedure of the key drive-off process subroutine in FIG. 図8中の再打鍵処理サブルーチンの詳細な手順を示すフローチャートである。It is a flowchart which shows the detailed procedure of the rekeying process subroutine in FIG. 図10の再打鍵処理サブルーチンの続きの手順を示すフローチャートである。FIG. 11 is a flowchart showing a continuation procedure of the rekeying process subroutine of FIG. 10. FIG. 図1中のCPUによって実行される鍵駆動制御処理プログラムの詳細な手順を示すフローチャートである。It is a flowchart which shows the detailed procedure of the key drive control processing program run by CPU in FIG. 図12の鍵駆動制御処理プログラムの続きの手順を示すフローチャートである。It is a flowchart which shows the procedure of the continuation of the key drive control processing program of FIG. 図13の鍵駆動制御処理プログラムの続きの手順を示すフローチャートである。It is a flowchart which shows the procedure of the continuation of the key drive control processing program of FIG. 図14の鍵駆動制御処理プログラムの続きの手順を示すフローチャートである。It is a flowchart which shows the procedure of the continuation of the key drive control processing program of FIG. 図12中の再打鍵鍵駆動制御処理サブルーチンの詳細な手順を示すフローチャートである。13 is a flowchart showing a detailed procedure of a rekey key drive control processing subroutine in FIG. 12. (基本動作用)デューティ比テーブルの一例((a))および該デューティ比テーブルに対応する再打鍵用デューティ比テーブルの一例((b))を示す図である。It is a figure which shows an example ((b)) of a duty ratio table for re-keying corresponding to an example ((a)) of duty ratio table (for basic operation) and the duty ratio table. 本発明の第2の実施の形態に係る制御装置を適用した電子ピアノのCPUによって実行される再打鍵処理サブルーチンの詳細な手順を示すフローチャートである。It is a flowchart which shows the detailed procedure of the rekeying process subroutine performed by CPU of the electronic piano to which the control apparatus which concerns on the 2nd Embodiment of this invention is applied. 図18の再打鍵処理サブルーチンの続きの手順を示すフローチャートである。FIG. 19 is a flowchart showing a continuation procedure of the rekeying process subroutine of FIG. 18. FIG. 本発明の第2の実施の形態に係る制御装置を適用した電子ピアノのCPUによって実行される再打鍵鍵駆動制御処理サブルーチンの詳細な手順を示すフローチャートである。It is a flowchart which shows the detailed procedure of the rekey key drive control processing subroutine performed by CPU of the electronic piano to which the control apparatus which concerns on the 2nd Embodiment of this invention is applied. 図20中の再打鍵パターンA制御処理サブルーチンの詳細な手順を示すフローチャートである。It is a flowchart which shows the detailed procedure of the rekeying pattern A control processing subroutine in FIG. 図20中の再打鍵パターンB制御処理サブルーチンの詳細な手順を示すフローチャートである。FIG. 21 is a flowchart showing a detailed procedure of a rekeying pattern B control processing subroutine in FIG. 20. FIG. 図20中の再打鍵パターンC制御処理サブルーチンの詳細な手順を示すフローチャートである。FIG. 21 is a flowchart showing a detailed procedure of a rekeying pattern C control processing subroutine in FIG. 20. FIG. 図17(a)のデューティ比テーブルのうち、第3〜第5状態ST3〜ST5に対応する部分((a))と、この部分にそれぞれ対応する再打鍵用デューティ比テーブルA,BおよびCの各一例((b)〜(d))を示す図である。Of the duty ratio table of FIG. 17 (a), the portion corresponding to the third to fifth states ST3 to ST5 ((a)) and the rekey key duty ratio tables A, B and C respectively corresponding to this portion. It is a figure which shows each example ((b)-(d)).

以下、本発明の実施の形態を図面に基づいて詳細に説明する。   Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.

(第1の実施の形態)
図1は、本発明の第1の実施の形態に係る制御装置を適用した自動演奏電子ピアノ(以下、「電子ピアノ」と略して言う)の概略構成を示すブロック図である。
(First embodiment)
FIG. 1 is a block diagram showing a schematic configuration of an automatic performance electronic piano (hereinafter abbreviated as “electronic piano”) to which the control device according to the first embodiment of the present invention is applied.

同図に示すように、本実施の形態の電子ピアノは、各種情報を入力するための複数のスイッチやホイール、ジョイスティックを含む設定操作子1と、設定操作子1の操作状態を検出する検出回路2と、音高情報を含む演奏情報を入力するための鍵盤装置3と、装置全体の制御を司るCPU4と、該CPU4が実行する制御プログラムや、各種テーブルデータ等を記憶するROM5と、曲データ、各種入力情報および演算結果等を一時的に記憶するRAM6と、タイマ割込み処理における割込み時間や各種時間を計時するタイマ7と、各種情報等を表示する、たとえば液晶ディスプレイ(LCD)および発光ダイオード(LED)等を備えた表示器8と、前記制御プログラムを含む各種アプリケーションプログラムや各種曲データ、各種データ等を記憶する外部記憶装置9と、外部MIDI機器等の外部機器100を接続し、この外部機器100とデータの送受信を行う通信インターフェース(I/F)10と、鍵盤装置3から入力された演奏情報や、前記外部記憶装置9に記憶されたいずれかの曲データを自動再生することによって得られた演奏情報等をオーディオ信号に変換し、これに適宜効果を付与する音源11と、該音源11からのオーディオ信号を音響に変換する、たとえば、DAC(digital-to-analog converter)やアンプ、スピーカ等のサウンドシステム12とにより構成されている。   As shown in the figure, the electronic piano of the present embodiment includes a setting operator 1 including a plurality of switches, wheels, and joysticks for inputting various types of information, and a detection circuit that detects the operation state of the setting operator 1. 2, a keyboard device 3 for inputting performance information including pitch information, a CPU 4 for controlling the entire device, a control program executed by the CPU 4, a ROM 5 for storing various table data, etc., and song data A RAM 6 that temporarily stores various input information and calculation results, a timer 7 that measures interrupt time and various times in timer interrupt processing, and displays various information such as a liquid crystal display (LCD) and a light emitting diode ( LED) and the like, various application programs including the control program, various music data, various data Is connected to an external device 100 such as an external MIDI device, and a communication interface (I / F) 10 for transmitting / receiving data to / from the external device 100 and performance information input from the keyboard device 3 Or a sound source 11 that converts performance information obtained by automatically reproducing any piece of music data stored in the external storage device 9 into an audio signal, and appropriately applies an effect to the audio signal. For example, a sound system 12 such as a DAC (digital-to-analog converter), an amplifier, or a speaker.

上記構成要素2〜11は、バス13を介して相互に接続され、CPU4にはタイマ7が接続され、通信I/F10には外部機器100が接続され、音源11にはサウンドシステム12が接続されている。ここで、通信I/F10は、有線方式のものに限らず、無線方式のものであってもよい。また、両方式のものを備えていてもよい。   The above components 2 to 11 are connected to each other via a bus 13, a timer 7 is connected to the CPU 4, an external device 100 is connected to the communication I / F 10, and a sound system 12 is connected to the sound source 11. ing. Here, the communication I / F 10 is not limited to a wired system but may be a wireless system. In addition, both types may be provided.

外部記憶装置9は、たとえば、フレキシブルディスク(FD)、ハードディスク(HD)、CD−ROM、DVD(digital versatile disc)、光磁気ディスク(MO)および半導体メモリなどの記憶媒体とその駆動装置である。記憶媒体は、駆動装置から着脱可能であってもよいし、外部記憶装置9自体が、本実施の形態の電子ピアノから着脱可能であってもよい。あるいは、記憶媒体も外部記憶装置9も着脱不可能であってもよい。そして、外部記憶装置9には、前述のように、CPU4が実行する制御プログラムも記憶でき、ROM5に制御プログラムが記憶されていない場合には、この外部記憶装置9に制御プログラムを記憶させておき、それをRAM6に読み込むことにより、ROM5に制御プログラムを記憶している場合と同様の動作をCPU4にさせることができる。このようにすると、制御プログラムの追加やバージョンアップ等が容易に行える。   The external storage device 9 is, for example, a storage medium such as a flexible disk (FD), a hard disk (HD), a CD-ROM, a DVD (digital versatile disc), a magneto-optical disk (MO), and a semiconductor memory, and a driving device thereof. The storage medium may be detachable from the drive device, or the external storage device 9 itself may be detachable from the electronic piano of the present embodiment. Alternatively, neither the storage medium nor the external storage device 9 may be detachable. As described above, the external storage device 9 can also store a control program to be executed by the CPU 4. If the control program is not stored in the ROM 5, the control program is stored in the external storage device 9. By reading it into the RAM 6, it is possible to cause the CPU 4 to perform the same operation as when the control program is stored in the ROM 5. In this way, control programs can be easily added and upgraded.

通信I/F10には、図示例では、外部機器100が接続されているが、これに限られず、たとえばLAN(local area network)やインターネット、電話回線等の通信ネットワークを介して、サーバコンピュータが接続されるようにしてもよい。この場合、外部記憶装置9に上記各プログラムや各種パラメータが記憶されていなければ、通信I/F10は、サーバコンピュータからプログラムやパラメータをダウンロードするために用いられる。クライアントとなる電子ピアノは、通信I/F10および通信ネットワークを介してサーバコンピュータへとプログラムやパラメータのダウンロードを要求するコマンドを送信する。サーバコンピュータは、このコマンドを受け、要求されたプログラムやパラメータを、通信ネットワークを介して電子ピアノへと配信し、電子ピアノが通信I/F10を介して、これらプログラムやパラメータを受信して外部記憶装置9に蓄積することにより、ダウンロードが完了する。   In the illustrated example, the external device 100 is connected to the communication I / F 10, but the present invention is not limited to this. For example, a server computer is connected via a communication network such as a LAN (local area network), the Internet, or a telephone line. You may be made to do. In this case, if the above programs and various parameters are not stored in the external storage device 9, the communication I / F 10 is used to download the programs and parameters from the server computer. The electronic piano as a client transmits a command for requesting downloading of a program and parameters to the server computer via the communication I / F 10 and the communication network. Upon receiving this command, the server computer distributes the requested program and parameters to the electronic piano via the communication network, and the electronic piano receives these programs and parameters via the communication I / F 10 and stores them externally. Downloading is completed by accumulating in the device 9.

図2は、鍵盤装置3の各鍵の駆動を制御する制御構成を示すブロック図である。ただし、図2には、説明の都合上、CPU4も記載されている。   FIG. 2 is a block diagram showing a control configuration for controlling the driving of each key of the keyboard device 3. However, FIG. 2 also shows the CPU 4 for convenience of explanation.

同図に示すように、鍵盤装置3は、複数の鍵(たとえば、88鍵)を備えた鍵盤3aと、鍵毎に設けられたソレノイド3b1(後述する図3および図4では、ソレノイドからなるアクチュエータ330)に電力を供給する電力供給部3bと、各ソレノイド3b1の駆動を制御する駆動制御部3cと、各鍵にそれぞれ設けられた鍵スイッチ(図3および図4では、鍵スイッチSW)のオン/オフ状態を検出するスキャン部3dと、駆動制御部3c、スキャン部3dおよびCPU4間を接続するバス3eとによって、主として構成されている。   As shown in the figure, the keyboard device 3 includes a keyboard 3a having a plurality of keys (for example, 88 keys) and a solenoid 3b1 provided for each key (in FIGS. 3 and 4 described later, an actuator including a solenoid). 330), a power control unit 3c for controlling the driving of each solenoid 3b1, and a key switch (key switch SW in FIGS. 3 and 4) provided on each key. The scan unit 3d that detects the / off state and the bus 3e that connects the drive control unit 3c, the scan unit 3d, and the CPU 4 are mainly configured.

鍵盤3aは、「低域」、「中低域」、「中高域」および「高域」の4つの鍵域(各鍵域にはそれぞれ、22鍵が属している)に分割され、各鍵域に属する22個のソレノイド3b1のそれぞれへの電力供給は、鍵域毎に1つの電力供給部3bによって制御されている。さらに1つの電力供給部3bは、1つの駆動制御部3cによって制御されている。なお、鍵域の分割態様や分割数は、これに限らないことは言うまでもない。   The keyboard 3a is divided into four key ranges of “low range”, “middle low range”, “middle high range” and “high range” (22 keys belong to each key range). Power supply to each of the 22 solenoids 3b1 belonging to the range is controlled by one power supply unit 3b for each key range. Furthermore, one power supply unit 3b is controlled by one drive control unit 3c. Needless to say, the key area division mode and the number of divisions are not limited thereto.

駆動制御部3cは、駆動制御処理部4aとして機能するCPU4によって制御される。具体的には、ある1つの鍵を押鍵方向に駆動させたい場合、駆動制御処理部4aは、その鍵(のソレノイド3b1)の駆動制御を担当する1つの駆動制御部3c(4つの駆動制御部3cのうちの1つ)をサーチし、サーチした駆動制御部3cを指定し、その鍵のキーナンバ(各鍵に付与された番号)および駆動オンをバス3e上に送信する(以下、「駆動オン要求」という)と、その駆動オン要求は、指定された駆動制御部3cによって受信される。駆動オン要求を受信した駆動制御部3cは、その駆動オン要求内に記載された鍵のソレノイド3b1に電力が供給されるように、電力供給部3bに対して、所定のタイミングで所定のPWM波形信号を供給する。これに応じて、ソレノイド3b1には、電力供給部3bから所定量の電力が供給され、ソレノイド3b1は、対応する鍵を押下方向に段階的に引き下げる。これとは逆に、ある1つの鍵を離鍵方向に駆動させたい場合、駆動制御処理部4aは、その鍵(のソレノイド3b1)の駆動制御を担当する1つの駆動制御部3cをサーチし、サーチした駆動制御部3cを指定し、その鍵のキーナンバおよび駆動オフをバス3e上に送信する(以下、「駆動オフ要求」という)と、その駆動オフ要求は、指定された駆動制御部3cによって受信される。駆動オフ要求を受信した駆動制御部3cは、その駆動オフ要求内に記載された鍵のソレノイド3b1に電力が供給されなくなるように、電力供給部3bに対して、PWM波形信号の供給を段階的に停止する。これに応じて、ソレノイド3b1には、電力供給部3bから電力が段階的に供給されなくなるので、ソレノイド3b1に対する引き下げ動作も停止して、鍵は離鍵方向に引き上げられる。   The drive control unit 3c is controlled by the CPU 4 that functions as the drive control processing unit 4a. Specifically, when it is desired to drive a certain key in the key pressing direction, the drive control processing unit 4a has one drive control unit 3c (four drive controls) in charge of driving control of the key (solenoid 3b1). Search for one of the units 3c, specify the searched drive control unit 3c, and transmit the key number (number given to each key) of the key and drive-on on the bus 3e (hereinafter referred to as “drive”). The request to turn on ”is received by the designated drive control unit 3c. Upon receiving the drive-on request, the drive control unit 3c gives a predetermined PWM waveform at a predetermined timing to the power supply unit 3b so that power is supplied to the key solenoid 3b1 described in the drive-on request. Supply signal. In response, a predetermined amount of power is supplied to the solenoid 3b1 from the power supply unit 3b, and the solenoid 3b1 pulls down the corresponding key stepwise in the pressing direction. On the contrary, when it is desired to drive a certain key in the key release direction, the drive control processing unit 4a searches for one drive control unit 3c responsible for drive control of the key (solenoid 3b1), When the searched drive control unit 3c is designated and the key number and the drive off of the key are transmitted on the bus 3e (hereinafter referred to as “drive off request”), the drive off request is transmitted by the designated drive control unit 3c. Received. Upon receiving the drive-off request, the drive control unit 3c gradually supplies the PWM waveform signal to the power supply unit 3b so that power is not supplied to the key solenoid 3b1 described in the drive-off request. To stop. Accordingly, power is not supplied to the solenoid 3b1 stepwise from the power supply unit 3b, so that the pulling operation for the solenoid 3b1 is stopped and the key is pulled up in the key release direction.

なお、電力供給部3bは、ソレノイド3b1の故障(異常発熱など)をハードウェア的に検出し、それを駆動制御部3cに通知するエラー通知機能も備えている。駆動制御部3cは、電力供給部3bからエラー通知が送信されてくると、そのエラー通知を駆動制御処理部4aに転送する。   The power supply unit 3b also has an error notification function that detects a failure (such as abnormal heat generation) of the solenoid 3b1 in hardware and notifies the drive control unit 3c of the failure. When an error notification is transmitted from the power supply unit 3b, the drive control unit 3c transfers the error notification to the drive control processing unit 4a.

各鍵には、前述のように、1つの鍵スイッチが設けられている。本実施の形態では、鍵スイッチとして、接点時間差タイプの3メイク式タッチレスポンススイッチを採用している。スキャン部3dは、この各鍵スイッチにそれぞれ設けられた3つの接点(図3および図4では、第1〜第3スイッチSW1〜SW3)を所定の時間毎にスキャンし、鍵毎に各接点のオン/オフ状態を検出する。検出した鍵毎の各接点のオン/オフ状態は、バス3eを介して、駆動制御処理部4aに送信される。なお、鍵スイッチのメイク数は、上記3つに限らず、4つ以上でもよい。ただし、2つ以下の場合には、鍵の駆動制御に利用する情報が不足するので、現実的でない。一方、鍵毎にその非押鍵状態から最深押鍵状態までの全工程内の押下位置を略連続的に検出するために、たとえば光学的なセンサ、つまり高性能なキーセンサを用いた場合には、背景技術に記載したように、製造コストの上昇により本発明の目的や趣旨が薄れてしまうので、現実的でない。   Each key is provided with one key switch as described above. In this embodiment, a contact time difference type three-make touch response switch is employed as the key switch. The scanning unit 3d scans the three contacts provided in each key switch (first to third switches SW1 to SW3 in FIGS. 3 and 4) at predetermined time intervals, Detect on / off state. The detected ON / OFF state of each contact for each key is transmitted to the drive control processing unit 4a via the bus 3e. Note that the number of make-ups of the key switch is not limited to three, but may be four or more. However, in the case of two or less, information used for key drive control is insufficient, which is not realistic. On the other hand, for example, when using an optical sensor, that is, a high-performance key sensor, in order to detect the pressed position in the entire process from the non-pressed state to the deepest pressed state for each key, for example, As described in the background art, since the object and purpose of the present invention are diminished due to an increase in manufacturing cost, it is not realistic.

図3および図4は、鍵盤装置3の断面図であり、図3が鍵の非押鍵状態を示し、図4が鍵の押鍵状態を示している。   3 and 4 are cross-sectional views of the keyboard device 3. FIG. 3 shows a non-pressed state of the key, and FIG. 4 shows a pressed state of the key.

図3において、本実施の形態の電子ピアノの楽器本体は、全体は図示しないが、棚板315およびそれより上方の部分が該当する。棚板315上には、鍵盤シャーシ(以下、単に「シャーシ」と称する)314が配設固定される。棚板315に対するシャーシ314の固定は不図示の締結具等で行われる。以降、本実施の形態の電子ピアノの奏者側(図3の左方)を「前方」と呼ぶことにする。   In FIG. 3, the entire musical instrument main body of the electronic piano of the present embodiment is not shown, but corresponds to the shelf 315 and the portion above it. A keyboard chassis (hereinafter simply referred to as “chassis”) 314 is disposed and fixed on the shelf board 315. The chassis 314 is fixed to the shelf plate 315 with a fastener (not shown) or the like. Hereinafter, the player side (left side in FIG. 3) of the electronic piano of the present embodiment will be referred to as “front”.

シャーシ314の前部から棚板315の前部にかけて、口棒部317が、全鍵幅に亘って設けられる。口棒部317によって、金具318および弾性材319を介して、シャーシ314の前部が棚板315に押しつけられている。   From the front part of the chassis 314 to the front part of the shelf board 315, a mouth bar part 317 is provided over the entire key width. The front portion of the chassis 314 is pressed against the shelf plate 315 by the mouth bar portion 317 through the metal fitting 318 and the elastic material 319.

シャーシ314には、複数の鍵310および各鍵310に対応するハンマ体HMが個々に支持される。鍵310は、押下操作され、後部の鍵回動支点PKを中心として各々上下方向に回動(前端部が揺動)自在になっている。鍵310として白鍵310Wおよび黒鍵310Bがそれぞれ複数存在する。各鍵310の前部下部には、ハンマ体駆動部311が設けられる。   A plurality of keys 310 and hammer bodies HM corresponding to the keys 310 are individually supported on the chassis 314. The key 310 is operated to be pressed and can be pivoted in the vertical direction (the front end swings) about the rear key pivot fulcrum PK. There are a plurality of white keys 310W and black keys 310B as the keys 310, respectively. A hammer body driving unit 311 is provided at the lower front portion of each key 310.

各鍵310の下方には、各鍵310に対応してハンマ体HMが配置される。シャーシ314には、各ハンマ体HMに対応するハンマ体回動軸PHが設けられ、各ハンマ体HMは、対応するハンマ体回動軸PHを中心に上下方向に回動(後端部が揺動)自在になっている。また、ハンマ体HMの係合部321が、鍵310のハンマ体駆動部311と常に係合状態にあり、ハンマ体HMが鍵310に連動して回動するようになっている。奏者による押鍵操作に応じて、鍵310のハンマ体駆動部311により係合部321が駆動され、ハンマ体HMがハンマ体回動軸PHを中心に同図反時計方向(押鍵方向に対応する方向)に回動することで、適切な慣性が付与され、良好な押鍵感触が得られる。各鍵310の構成、および各ハンマ体HMの構成は、それぞれ同様である。なお、押鍵感触のキースケーリングを実現するために、白鍵用と黒鍵用とで、あるいは音高に応じてハンマ体HMの長さや重さ等を異ならせてもよい。   Below each key 310, a hammer body HM is arranged corresponding to each key 310. The chassis 314 is provided with a hammer body rotation shaft PH corresponding to each hammer body HM, and each hammer body HM rotates in the vertical direction around the corresponding hammer body rotation shaft PH (the rear end portion swings). Movement) is free. Further, the engaging portion 321 of the hammer body HM is always in engagement with the hammer body driving portion 311 of the key 310, and the hammer body HM is rotated in conjunction with the key 310. In response to the key pressing operation by the player, the engaging portion 321 is driven by the hammer body driving portion 311 of the key 310, and the hammer body HM is counterclockwise (corresponding to the key pressing direction) about the hammer body rotation axis PH. By rotating in the direction of movement), an appropriate inertia is imparted and a good key pressing feeling is obtained. The configuration of each key 310 and the configuration of each hammer body HM are the same. In addition, in order to realize key scaling of the key press feeling, the length and weight of the hammer body HM may be made different for the white key and the black key or according to the pitch.

ハンマ体HMにおいて、ハンマ体回動軸PHよりも後方の基部322から質量部材323が延設されている。ハンマ体HMは、質量部材323の自重によって、同図時計方向(離鍵方向に対応する方向)に常に付勢されており、図3に示すハンマ体HMの位置は、初期状態である非押鍵状態における位置である。   In the hammer body HM, a mass member 323 is extended from the base 322 behind the hammer body rotation shaft PH. The hammer body HM is always urged clockwise by the weight of the mass member 323 (the direction corresponding to the key release direction), and the position of the hammer body HM shown in FIG. The position in the key state.

鍵310の押鍵状態からの復帰力は、質量部材323の重さによるハンマ体HMの復帰力によるものである。復帰時にも、ハンマ体HMは、対応する鍵310と連動して回動する。   The return force of the key 310 from the depressed state is due to the return force of the hammer body HM due to the weight of the mass member 323. Also at the time of return, the hammer body HM rotates in conjunction with the corresponding key 310.

シャーシ314の後部上部および後部下部にはそれぞれ、フェルト等の上側ストッパ312および下側ストッパ313が設けられている。上側ストッパ312は押鍵時にハンマ体HMの質量部材323と当接して鍵310の押鍵終了位置を規制する(図4参照)。下側ストッパ313は非押鍵時に質量部材323と当接して鍵310の非押鍵状態への復帰位置を規制する(図3参照)。   An upper stopper 312 and a lower stopper 313 such as felt are provided on the upper rear portion and the lower rear portion of the chassis 314, respectively. The upper stopper 312 abuts against the mass member 323 of the hammer body HM when the key is depressed, and restricts the key depression end position of the key 310 (see FIG. 4). The lower stopper 313 contacts the mass member 323 when the key is not pressed, and restricts the return position of the key 310 to the non-key pressed state (see FIG. 3).

また、本実施の形態の電子ピアノには、シャーシ314の前部に配設されたスイッチ基板326上に3メイク式の鍵スイッチSWが設けられる。この鍵スイッチSWには、前述のように、第1〜第3スイッチSW1〜SW3が設けられている。押鍵時、すなわちスイッチ押圧部324の下方への変位時に、第1スイッチSW1、第2スイッチSW2および第3スイッチSW3の順にオフからオンに切換えられる。そして、押鍵が維持されていれば、第1〜第3スイッチSW1〜SW3はオン状態に保たれる。一方、離鍵時、すなわちスイッチ押圧部324の上方への変位時には、第3スイッチSW3、第2スイッチSW2および第1スイッチSW1の順にオンからオフに切換えられる。第1スイッチSW1のオン/オフが、アコースティックピアノで言うところのダンパのオフ(リリース)/オン(ホールド)に対応し、第2スイッチSW2のオフがキーオフ(消音指示)に対応し、第3スイッチSW3のオンがキーオン(発音指示)に対応する。鍵スイッチSWは、ハンマ体HMのスイッチ押圧部324によって押圧駆動されて、キーベロシティ(第2スイッチSW2のオンから第3スイッチSW3のオンまでの時間差に基づいて検出される)を含む鍵動作を検出する。奏者による押鍵動作、すなわちリアルタイム演奏の場合は、スイッチ押圧部324の検出結果に基づいて、楽音制御がなされる。   In addition, the electronic piano of the present embodiment is provided with a 3-make key switch SW on a switch board 326 disposed at the front of the chassis 314. As described above, the key switch SW is provided with the first to third switches SW1 to SW3. When the key is depressed, that is, when the switch pressing portion 324 is displaced downward, the first switch SW1, the second switch SW2, and the third switch SW3 are switched from OFF to ON in this order. If the key depression is maintained, the first to third switches SW1 to SW3 are kept in the on state. On the other hand, when the key is released, that is, when the switch pressing portion 324 is displaced upward, the third switch SW3, the second switch SW2, and the first switch SW1 are switched from on to off in this order. The on / off state of the first switch SW1 corresponds to the damper off (release) / on (hold) state of an acoustic piano, the off state of the second switch SW2 corresponds to the key off (silence instruction), and the third switch. SW3 ON corresponds to key-on (sound generation instruction). The key switch SW is pressed and driven by the switch pressing unit 324 of the hammer body HM, and performs a key operation including key velocity (detected based on a time difference from turning on the second switch SW2 to turning on the third switch SW3). To detect. In the case of a key pressing operation by a player, that is, a real-time performance, tone control is performed based on the detection result of the switch pressing unit 324.

本実施の形態の電子ピアノにはまた、自動演奏用の鍵駆動手段として、駆動ユニットUNTが配設される。図5は、駆動ユニットUNTの平面図である。駆動ユニットUNTは、透磁性のある上側ヨーク335と下側ヨーク340とを備える。上側ヨーク335および下側ヨーク340は、全鍵幅の長さを有する。駆動ユニットUNTには、各ハンマ体HMに対応する全鍵分のアクチュエータ(ソレノイド)330が含まれる。アクチュエータ330は、鍵並び方向に沿った前列と後列の2列に並列的に、それぞれ一直線上に配置、すなわち、千鳥配置される。すべてのアクチュエータ330は、配置位置を除きいずれも同様に構成される。   The electronic piano of the present embodiment is also provided with a drive unit UNT as a key drive means for automatic performance. FIG. 5 is a plan view of the drive unit UNT. The drive unit UNT includes a magnetically permeable upper yoke 335 and a lower yoke 340. The upper yoke 335 and the lower yoke 340 have a full key width. The drive unit UNT includes actuators (solenoids) 330 for all keys corresponding to each hammer body HM. The actuators 330 are arranged in a straight line, that is, in a staggered manner, in parallel in the front row and the rear row along the key arrangement direction. All the actuators 330 are configured in the same manner except for their arrangement positions.

図3に示すように、上側ヨーク335は、下方に開口した断面コ字状に一体に形成される。下側ヨーク340は、上側ヨーク335を受け入れる断面コ字状の凹部343と、凹部343から後方に延設された後方水平部341と、凹部343から前方に延設された前方水平部342とを有して一体に形成される。後方水平部341は、後方に十分に長く、質量部材323の先端よりも後方まで延びている。下側ヨーク340が、断面コ字状の凹部343を有して逆ハット型であることで、下側ヨーク340の剛性が高くなっている。   As shown in FIG. 3, the upper yoke 335 is integrally formed in a U-shaped cross section that opens downward. The lower yoke 340 includes a concave portion 343 having a U-shaped cross section for receiving the upper yoke 335, a rear horizontal portion 341 extending backward from the concave portion 343, and a front horizontal portion 342 extending forward from the concave portion 343. And integrally formed. The rear horizontal portion 341 is sufficiently long rearward and extends further to the rear than the tip of the mass member 323. Since the lower yoke 340 has a concave portion 343 having a U-shaped cross section and is an inverted hat type, the rigidity of the lower yoke 340 is increased.

棚板315には、少なくとも全鍵幅に亘る長さの装着穴315b(図3参照)が形成されている。上側ヨーク335は、下側ヨーク340の凹部343内に収容され、これにより上側ヨーク335および下側ヨーク340が重なっている部分を含むアクチュエータ330が、装着穴315b内に位置している。この位置は、ハンマ体回動軸PHに近接している。プランジャ333のストロークが小さくて済むようにする観点から、アクチュエータ330の位置は、鍵回動支点PKとハンマ体回動軸PHとの間であってハンマ体回動軸PHに極力近接した位置に配設するのが好ましい。   The shelf plate 315 is formed with a mounting hole 315b (see FIG. 3) having a length extending at least over the entire key width. The upper yoke 335 is accommodated in the concave portion 343 of the lower yoke 340, whereby the actuator 330 including a portion where the upper yoke 335 and the lower yoke 340 overlap is located in the mounting hole 315b. This position is close to the hammer body rotation axis PH. From the viewpoint of reducing the stroke of the plunger 333, the position of the actuator 330 is between the key rotation fulcrum PK and the hammer body rotation axis PH and as close as possible to the hammer body rotation axis PH. It is preferable to arrange.

図3に示すように、各アクチュエータ330において、上側ヨーク335の内側であってボビン331の周囲にソレノイドコイル332が巻回される。また、ボビン331の内部をプランジャ333が上下方向に往復動作可能に配設される。プランジャ333の上部には、弾性材でなる駆動部334が設けられる。各アクチュエータ330は、上側ヨーク335および下側ヨーク340が重なっている部分を主な磁路として利用して成り立っている。   As shown in FIG. 3, in each actuator 330, a solenoid coil 332 is wound around the bobbin 331 inside the upper yoke 335. A plunger 333 is disposed inside the bobbin 331 so as to be able to reciprocate in the vertical direction. A drive unit 334 made of an elastic material is provided on the top of the plunger 333. Each actuator 330 is formed by using a portion where the upper yoke 335 and the lower yoke 340 overlap as a main magnetic path.

上側ヨーク335と下側ヨーク340とは、複数のネジ337(図3、図5参照)で固定される。ネジ337による固定は、ボビン331およびソレノイドコイル332を上側ヨーク335および下側ヨーク340間に固定することにも役立っている。アクチュエータ330が千鳥配置であることで、個々のアクチュエータ330のソレノイドコイル332の巻回の径(ボビン331の径)を大きく、巻き数を多く設定でき、駆動力の効率的な向上に有利となっている。   The upper yoke 335 and the lower yoke 340 are fixed by a plurality of screws 337 (see FIGS. 3 and 5). The fixing with the screw 337 also serves to fix the bobbin 331 and the solenoid coil 332 between the upper yoke 335 and the lower yoke 340. Since the actuators 330 are arranged in a staggered manner, the winding diameter (bobbin 331 diameter) of the solenoid coil 332 of each actuator 330 can be increased and the number of windings can be set large, which is advantageous for efficient improvement of the driving force. ing.

図3に示すように、駆動ユニットUNTは、下側ヨーク340の取り付け用穴341ab、342ab(図5参照)を通じて、複数のネジ329にて、シャーシ314の後部下部における取り付け部314a、前部下部における取り付け部314bに締結固定される。   As shown in FIG. 3, the drive unit UNT includes a plurality of screws 329 through the mounting holes 341ab and 342ab (see FIG. 5) of the lower yoke 340, and the mounting portion 314a and the front lower portion of the rear portion of the chassis 314. Are fastened and fixed to the mounting portion 314b.

駆動ユニットUNTのすぐ後方であって、棚板315の下部には、駆動ユニットUNTの動作を制御するための基板344が、複数のネジ346によって固定されている。また、駆動ユニットUNTおよび基板344を下方から覆うユニットカバー345が設けられる。ユニットカバー345は、板金または樹脂等で構成され、その前後の取り付け部345bが、複数のネジ347によって棚板315の下面に固定される。   A substrate 344 for controlling the operation of the drive unit UNT is fixed by a plurality of screws 346 immediately behind the drive unit UNT and below the shelf plate 315. Further, a unit cover 345 that covers the drive unit UNT and the substrate 344 from below is provided. The unit cover 345 is made of sheet metal, resin, or the like, and front and rear attachment portions 345b are fixed to the lower surface of the shelf board 315 by a plurality of screws 347.

非押鍵状態では、アクチュエータ330の駆動部334が、対応するハンマ体HMに近接している。なお、非押鍵状態においては、駆動部334がハンマ体HMに当接するようにしてもよい。ソレノイドコイル332に通電されると、プランジャ333が上方に移動し、駆動部334とハンマ体HMとの当接を通じてハンマ体HMを押し上げ駆動する。すると、ハンマ体HMに連動して、鍵310が押鍵方向(鍵310の先端が下方に変位する方向)に回動する(図4参照)。   In the non-key-pressed state, the drive unit 334 of the actuator 330 is close to the corresponding hammer body HM. In the non-key-pressed state, the drive unit 334 may abut on the hammer body HM. When the solenoid coil 332 is energized, the plunger 333 moves upward and pushes up and drives the hammer body HM through contact between the drive unit 334 and the hammer body HM. Then, in conjunction with the hammer body HM, the key 310 rotates in the key pressing direction (the direction in which the tip of the key 310 is displaced downward) (see FIG. 4).

通電が解除されると、ハンマ体HMおよび鍵310の復帰に伴い、プランジャ333がハンマ体HMに押されることに加えて、自重によって元の初期位置(図3で示す位置)に復帰する。   When the energization is released, the plunger 333 is pushed by the hammer body HM along with the return of the hammer body HM and the key 310, and returns to the original initial position (position shown in FIG. 3) by its own weight.

なお本実施の形態では、鍵盤装置として、ハンマ体を介して鍵を駆動するようにしたものを採用したが、これに限らず、ハンマ体を介さずに直接、鍵を駆動するようにしたものを採用してもよい。この場合、ハンマ体を備えた構造のものと、ハンマ体を備えない構造のものがあるが、いずれの構造のものを採用してもよい。   In this embodiment, a keyboard device that drives a key through a hammer body is used. However, the present invention is not limited to this, and the keyboard device is driven directly without using a hammer body. May be adopted. In this case, there are a structure with a hammer body and a structure without a hammer body, but any structure may be adopted.

また本実施の形態では、下側ヨーク340をシャーシ314に固定し、下側ヨーク340の固定されたシャーシ314を前記締結具等で棚板315に固定するようにしたが、これに限らず、下側ヨーク340もシャーシ314も、たとえばネジによって直接、棚板315に締結固定するようにしてもよい。   Further, in the present embodiment, the lower yoke 340 is fixed to the chassis 314, and the chassis 314 to which the lower yoke 340 is fixed is fixed to the shelf plate 315 with the fastener or the like. Both the lower yoke 340 and the chassis 314 may be fastened and fixed to the shelf plate 315 directly by screws, for example.

以上のように構成された電子ピアノ、特に前記CPU4が実行する自動鍵駆動制御処理を、図6〜図17を参照して詳細に説明するが、以下、基本動作と同一鍵連打動作に分けて説明する。同一鍵連打動作とは、自動鍵駆動制御により、同一の鍵が短時間内にオン・オフ動作を繰り返す動作である。基本動作とは、各鍵が非押鍵状態から最深押鍵状態を経由して非押鍵状態に戻るまでの全工程間で、同一鍵連打動作などの特殊な動作がなされない基本的な動作である。なお、特殊な動作としては、同一鍵連打動作以外にも、自動鍵駆動制御により、複数の鍵が短時間内にオン動作してオン状態を同時に維持する「複数鍵連打動作」や、自動鍵駆動制御中にマニュアル演奏がされた場合の動作である「マニュアル演奏との競合動作」などがあるが、これらの動作については、本実施の形態では考慮されていない。この理由は、本発明の特徴、すなわち押鍵が指示されるタイミング(駆動オンイベントが読み出されるタイミング)に応じて、用いるデューティ比テーブルの種類が異なるという特徴を説明するには、上記「基本動作」と「同一鍵連打動作」を例に挙げて説明するだけで十分であるからである。このように本実施の形態において、上記「複数鍵連打動作」および「マニュアル演奏との競合動作」を考慮しないのは、専ら説明の都合上である。そして、本実施の形態は、前記特許文献1の実施の形態に基づいて構成され、特許文献1の実施の形態には「複数鍵連打動作」および「マニュアル演奏との競合動作」についての制御処理が詳述されているので、この制御処理の記載に基づいて本発明を「複数鍵連打動作」および「マニュアル演奏との競合動作」に簡単に適用することができる。   The electronic piano constructed as described above, in particular, the automatic key drive control process executed by the CPU 4 will be described in detail with reference to FIGS. explain. The same key repetitive operation is an operation in which the same key repeats an on / off operation within a short time by automatic key drive control. Basic operation is a basic operation in which each key does not perform special operations such as repeated keystrokes during the entire process from the non-pressed state to the non-pressed state via the deepest pressed state. It is. As a special operation, in addition to the same key repetitive operation, multiple key repetitive operation in which a plurality of keys are turned on within a short time by the automatic key drive control and the on state is maintained at the same time. Although there are “competitive operations with manual performance” which are operations when a manual performance is performed during drive control, these operations are not considered in this embodiment. The reason for this is to explain the feature of the present invention, that is, the feature that the type of duty ratio table to be used differs depending on the timing when the key depression is instructed (the timing when the drive-on event is read). This is because it is sufficient to describe only “same key repeated operation” and “example”. As described above, in the present embodiment, the above-mentioned “multi-key repeated operation” and “competitive operation with manual performance” are not considered for the convenience of explanation. The present embodiment is configured based on the embodiment of Patent Document 1 described above. The embodiment of Patent Document 1 includes a control process for “multi-key repeated operation” and “competitive operation with manual performance”. Therefore, the present invention can be easily applied to "multi-key repeated operation" and "competitive operation with manual performance" based on the description of the control processing.

(1)基本動作
ユーザが、たとえば前記設定操作子1に含まれるモードスイッチ(図示せず)を操作して自動演奏モードを選択すると、図示しないプログラムの実行により、表示器8に曲の選択指示が表示される。そしてユーザは、この指示に従って外部記憶装置9に記憶されている所望の曲を設定操作子1に含まれる所定の操作子の操作により選択する。この選択により、選択された曲の曲データおよび鍵駆動用データが外部記憶装置9から読み出されて、RAM6の所定位置に確保された曲データ格納領域および鍵駆動用データ格納領域(ともに図示せず)にそれぞれ記憶される。なお、ユーザが所望とする曲の曲データおよび鍵駆動用データが外部記憶装置9に記憶されていない場合には、ユーザがあるいは自動的に、本実施の形態の電子ピアノの外部、たとえば前記外部機器100から、その曲データおよび鍵駆動用データを通信I/F10を介してRAM6内に取り込むようにしてもよい。
(1) Basic operation When a user operates a mode switch (not shown) included in the setting operation element 1 to select an automatic performance mode, for example, a song selection instruction is given to the display 8 by executing a program (not shown). Is displayed. Then, the user selects a desired song stored in the external storage device 9 by operating a predetermined operator included in the setting operator 1 in accordance with this instruction. As a result of this selection, the music data and key driving data of the selected music are read from the external storage device 9, and the music data storage area and the key driving data storage area (both not shown) secured at predetermined positions in the RAM 6 are displayed. Respectively). If the song data of the song desired by the user and the key driving data are not stored in the external storage device 9, the user or automatically, outside the electronic piano of the present embodiment, for example, the external The music data and key driving data may be taken into the RAM 6 from the device 100 via the communication I / F 10.

本実施の形態で用いる曲データは、ヘッダ、一連のイベントデータ、発生タイミングデータおよびエンドデータからなる。ヘッダは、曲名、初期の音色、音量、演奏テンポなどを表す複数のデータからなる。イベントデータには、キーオンイベントデータ、キーオフイベントデータ、楽音制御イベントデータおよびテンポイベントデータなどが含まれる。キーオンイベントデータは、発生楽音の音高を表すキーコードKCおよび楽音の発生開始を表すキーオンKONを有する。キーオフイベントデータは、発生中の楽音の音高を表すキーコードKCおよび楽音の発生停止を表すキーオフKOFを有する。楽音制御イベントデータは、発生楽音の音色、音量を制御するための制御データを有する。発生タイミングデータは、各イベントデータに付随して(隣接して)設けられ、当該イベントデータの楽曲中の発生タイミングを表すテンポクロックタイミングTCLTを有する。テンポイベントデータは、自動演奏のテンポを変更するための制御データを有する。エンドデータは、曲データの終了を表す。   The music data used in this embodiment includes a header, a series of event data, generation timing data, and end data. The header is composed of a plurality of data representing a song title, initial tone color, volume, performance tempo, and the like. The event data includes key-on event data, key-off event data, musical tone control event data, tempo event data, and the like. The key-on event data has a key code KC representing the pitch of the generated musical sound and a key-on KON representing the generation start of the musical sound. The key-off event data includes a key code KC that represents the pitch of the musical sound that is being generated and a key-off KOF that represents the stop of the musical sound. The musical tone control event data includes control data for controlling the tone color and volume of the generated musical tone. The generation timing data is provided accompanying (adjacent to) each event data, and has a tempo clock timing TCLT that represents the generation timing of the event data in the music. Tempo event data has control data for changing the tempo of automatic performance. End data represents the end of song data.

一方、本実施の形態で用いる鍵駆動用データは、ヘッダ、一連の駆動イベントデータ、駆動タイミングデータおよびエンドデータからなる。ヘッダには、曲名を表すデータが含まれる。駆動イベントデータには、駆動オンイベントデータおよび駆動オフイベントデータが含まれる。駆動オンイベントデータは、駆動鍵のキーナンバ(各鍵に付与された番号のうち、駆動鍵に付与された番号)を表すキーコードKCおよび駆動開始を表す駆動オンKONを有する。駆動オフイベントデータは、駆動中の鍵のキーナンバを表すキーコードKCおよび駆動停止を表す駆動オフKOFを有する。駆動タイミングデータは、各駆動イベントデータに付随して(隣接して)設けられ、当該駆動イベントデータの楽曲中の駆動タイミングを表すテンポクロックタイミングTCLTを有する。エンドデータは、鍵駆動用データの終了を表す。   On the other hand, the key driving data used in the present embodiment includes a header, a series of driving event data, driving timing data, and end data. The header includes data representing the song name. The drive event data includes drive on event data and drive off event data. The drive-on event data includes a key code KC that represents the key number of the drive key (the number assigned to the drive key among the numbers assigned to each key) and the drive-on KON that represents the start of driving. The drive-off event data has a key code KC that represents the key number of the key being driven and a drive-off KOF that represents a drive stop. The drive timing data is provided accompanying (adjacent to) each drive event data, and has a tempo clock timing TCLT that represents the drive timing of the drive event data in the music. The end data represents the end of the key driving data.

なお本実施の形態では、曲データが記憶されていれば必ず、鍵駆動用データも記憶されているとし(したがって、ある曲データが外部記憶装置9に記憶されていれば、その曲データに対応する鍵駆動用データも外部記憶装置9あるいは外部機器100などに記憶されている)、上述のように曲が選択されると、その曲データだけでなくその鍵駆動用データも読み出されてRAM6内に取り込まれる。しかし、曲データと鍵駆動用データとの違いは、曲データ内の発生タイミングデータによって表される発生タイミングと、その発生タイミングデータに対応する、鍵駆動用データ内の駆動タイミングデータによって表される駆動タイミングとが若干異なる(つまり、鍵駆動制御は発音制御に比べて時間がかかるので、駆動タイミングを発生タイミングより早くする必要がある)程度であるので、外部記憶装置9には曲データのみを記憶しておき、鍵駆動用データが必要となったときに、その鍵駆動用データを対応する曲データから生成するようにしてもよい。   In the present embodiment, it is assumed that the key driving data is always stored if the song data is stored (therefore, if a certain song data is stored in the external storage device 9, it corresponds to the song data). The key driving data to be stored is also stored in the external storage device 9 or the external device 100). When a song is selected as described above, not only the song data but also the key driving data is read and the RAM 6 It is taken in. However, the difference between the song data and the key driving data is represented by the generation timing represented by the generation timing data in the song data and the driving timing data in the key driving data corresponding to the generation timing data. Since the drive timing is slightly different (that is, the key drive control takes more time than the sound generation control, it is necessary to make the drive timing earlier than the generation timing). Therefore, only music data is stored in the external storage device 9. The key driving data may be generated from the corresponding music data when the key driving data is required.

また、自動演奏の指示により、図示しない初期設定処理が実行されて、RAM6内に、自動演奏用テーブルおよび鍵駆動用テーブルが用意される。自動演奏用テーブルは、曲データに基づいて自動演奏(楽音信号の自動生成)を行うためのテーブルであり、鍵駆動用テーブルは、鍵駆動用データに基づいて鍵盤装置3の駆動制御を行うためのテーブルである。後述するように、自動演奏と鍵盤装置3の駆動制御とは並行して実行されるが、本発明の特徴は鍵盤装置3の駆動制御にあり、自動演奏にはないので、自動演奏用テーブルの構成や自動演奏用テーブルを用いてどのように自動演奏を行うかについての説明は省略する。   Also, an initial setting process (not shown) is executed in response to an instruction for automatic performance, and an automatic performance table and a key driving table are prepared in the RAM 6. The automatic performance table is a table for performing automatic performance (automatic generation of musical tone signals) based on the song data, and the key driving table is for controlling the driving of the keyboard device 3 based on the key driving data. It is a table. As will be described later, although the automatic performance and the drive control of the keyboard device 3 are executed in parallel, the feature of the present invention is the drive control of the keyboard device 3 and not in the automatic performance. A description of how to perform an automatic performance using the configuration and the automatic performance table will be omitted.

鍵駆動用テーブルは、図6に示すように、鍵駆動用データ中の駆動オンイベントデータを割り当てるための複数(本実施の形態では、10個)のチャンネルch1〜ch10を有する。なお、この10個のチャンネルは例示であって、これに限定されることなく、他の個数を採用してもよい。各チャンネルchi(iは、1から10までの整数)には、キーコードKC(i)、鍵駆動状態ST(i)、経過時間TM(i)、オフディレイフラグOFDL(i)、オンディレイフラグONDL(i)、同一鍵再打鍵フラグRSK(i)および第1〜第3スイッチフラグSW1(i)〜SW3(i)がそれぞれ記憶されるようになっている。   As shown in FIG. 6, the key driving table has a plurality of channels (10 in this embodiment) ch1 to ch10 for assigning driving on event data in the key driving data. Note that these ten channels are merely examples, and the present invention is not limited thereto, and other numbers may be adopted. Each channel chi (i is an integer from 1 to 10) includes a key code KC (i), a key driving state ST (i), an elapsed time TM (i), an off-delay flag OFDL (i), and an on-delay flag. The ONDL (i), the same key re-keying flag RSK (i), and the first to third switch flags SW1 (i) to SW3 (i) are stored.

キーコードKC(i)は、駆動オンイベントデータ中のキーコードKCである。鍵駆動状態ST(i)は、駆動オンタイミング、すなわちアクチュエータ330への通電制御開始からの時間経過(ただし、駆動オン維持時間を除外する)に従った第1〜第10状態ST1〜ST10のいずれかを表す(図17(a)参照)。経過時間TM(i)は、駆動オンタイミングおよび駆動オフタイミングからの経過時間を表す。ただし、駆動オフに関する経過時間TM(i)は、駆動オフタイミングからの時間に、駆動オンタイミングから駆動オン持続開始タイミングまでの時間を加算して表している。オフディレイフラグOFDL(i)は、同一鍵の連打に関係して同一鍵に関する駆動オン直後の駆動オフに対して駆動オフ制御を遅延させるためのフラグであり、“1”により遅延を表し、“0”により非遅延を表す。オンディレイフラグONDL(i)は、同一鍵の連打に関係して同一鍵に関する駆動オフ直後の駆動オンに対して駆動オン制御を遅延させるためのフラグであり、“1”により遅延を表し、“0”により非遅延を表す。同一鍵再打鍵フラグRSK(i)は、駆動オフイベントデータが読み出されてから当該鍵が初期状態に戻るまでの間に、同一鍵の駆動オンイベントデータが読み出された場合に発生する再打鍵鍵駆動制御の状態を表すフラグであり、“1”により再打鍵鍵駆動制御状態を表し、“0”により再打鍵鍵駆動非制御状態を表す。第1〜第3スイッチフラグSW1(i)〜SW3(i)は、第1〜第3スイッチSW1〜SW3のオン/オフ状態をそれぞれ表すもので、“0”によりオフ状態を表し、“1”によりオン状態を表す。   The key code KC (i) is the key code KC in the drive-on event data. The key drive state ST (i) is any one of the first to tenth states ST1 to ST10 according to the drive on timing, that is, the time elapsed from the start of energization control to the actuator 330 (however, the drive on maintenance time is excluded). (See FIG. 17A). The elapsed time TM (i) represents the elapsed time from the drive on timing and the drive off timing. However, the elapsed time TM (i) related to driving off is represented by adding the time from the driving on timing to the driving on sustain start timing to the time from the driving off timing. The off-delay flag OFDL (i) is a flag for delaying the drive-off control with respect to the drive-off immediately after the drive-on with respect to the same key in relation to repeated strikes of the same key. “0” represents non-delay. The on-delay flag ONDL (i) is a flag for delaying the drive-on control with respect to the drive-on immediately after the drive-off with respect to the same key in relation to repeated hits of the same key. “0” represents non-delay. The same key re-keying flag RSK (i) is generated when the driving on-event data of the same key is read after the driving-off event data is read and before the key returns to the initial state. This is a flag indicating the key-on key drive control state. “1” represents the re-key key drive control state, and “0” represents the re-key key drive non-control state. The first to third switch flags SW1 (i) to SW3 (i) represent the on / off states of the first to third switches SW1 to SW3, respectively, “0” represents the off state, and “1”. Represents the ON state.

この鍵駆動用テーブルの初期設定においては、キーコードKC(i)、経過時間TM(i)および鍵駆動状態ST(i)は、それぞれ“0”にリセットされる。オフディレイフラグOFDL(i)、オンディレイフラグONDL(i)、同一鍵再打鍵フラグRSK(i)および第1〜第3スイッチフラグSW1(i)〜SW3(i)は、それぞれ“0”にリセットされる。   In the initial setting of the key driving table, the key code KC (i), the elapsed time TM (i), and the key driving state ST (i) are each reset to “0”. The off-delay flag OFDL (i), the on-delay flag ONDL (i), the same key re-keying flag RSK (i), and the first to third switch flags SW1 (i) to SW3 (i) are reset to “0”, respectively. Is done.

前記曲の選択および初期設定後、CPU4は、タイマ7との協働により、曲データのヘッダ部分に含まれているテンポデータにより表された演奏テンポによって規定される所定の短時間毎に、図7の自動演奏処理プログラムを繰り返し実行し始める。所定の短時間とは、たとえば、4分音符の時間長の1/16,1/32程度の時間長である。この演奏テンポは、設定操作子1に含まれるテンポ操作子(図示せず)の操作によっても変更される。   After the selection and initial setting of the music, the CPU 4 cooperates with the timer 7 every predetermined short time defined by the performance tempo represented by the tempo data included in the header portion of the music data. The automatic performance processing program 7 is repeatedly executed. The predetermined short time is, for example, a time length of about 1/16 or 1/32 of the time length of a quarter note. This performance tempo is also changed by an operation of a tempo operator (not shown) included in the setting operator 1.

自動演奏処理プログラムの実行が開始されると、CPU4は、ステップS1にてランフラグRUNが“1”であるか否かを判定する。ランフラグRUNは、“1”により自動演奏の動作中を表し、“0”により自動演奏の待機中を表す。ランフラグRUNは“0”に初期設定されているので、最初CPU4は、ステップS1にて“NO”と判定して、ステップS2の判定処理により、ユーザによるスタート指示を待つ。ユーザが自動演奏のスタートを指示しなければ、CPU4は、ステップS2にて“NO”と判定して、この自動演奏処理プログラムの実行を一旦終了する。ユーザが、たとえば設定操作子1に含まれる自動演奏スタートスイッチ(図示せず)を操作して自動演奏のスタートを指示すると、CPU4は、ステップS2にて“YES”と判定して、ステップS3にてランフラグRUNを“1”に設定するとともに、テンポクロックTCLを“0”にクリアする。その後、ステップS5〜S14からなる処理が実行される。   When the execution of the automatic performance processing program is started, the CPU 4 determines whether or not the run flag RUN is “1” in step S1. In the run flag RUN, “1” indicates that the automatic performance is being performed, and “0” indicates that the automatic performance is on standby. Since the run flag RUN is initially set to “0”, the CPU 4 first determines “NO” in step S1, and waits for a start instruction from the user through the determination process in step S2. If the user does not instruct the start of the automatic performance, the CPU 4 determines “NO” in step S2, and temporarily ends the execution of the automatic performance processing program. When the user operates, for example, an automatic performance start switch (not shown) included in the setting operator 1 to instruct the start of automatic performance, the CPU 4 determines “YES” in step S2, and proceeds to step S3. The run flag RUN is set to “1” and the tempo clock TCL is cleared to “0”. Then, the process consisting of steps S5 to S14 is executed.

前述のようにして、ランフラグRUNが“1”に設定されると、以降の自動演奏処理プログラムの実行時に、CPU4は、ステップS1にて“YES”と判定し、ステップS4にてテンポクロックTCLに“1”を加算する。次に、ステップS5以降の処理について説明する。CPU4は、ステップS5にて、曲データ中に、テンポクロックTCLにより示されたタイミングを表すタイミングデータの付随したイベントデータがあるか否かを判定する。該当するイベントデータがなければ、CPU4は、ステップS5にて“NO”と判定して、処理をステップS9に進める。   As described above, when the run flag RUN is set to “1”, the CPU 4 determines “YES” in step S1 during the subsequent execution of the automatic performance processing program, and sets the tempo clock TCL in step S4. Add “1”. Next, the process after step S5 is demonstrated. In step S5, the CPU 4 determines whether there is event data accompanied by timing data representing the timing indicated by the tempo clock TCL in the music data. If there is no corresponding event data, the CPU 4 determines “NO” in the step S5, and advances the process to a step S9.

該当するイベントデータがあれば、CPU4は、ステップS5にて“YES”と判定して、ステップS6にて該当する1つのイベントデータを読み出し、ステップS7の自動演奏イベント処理を実行する。この自動演奏イベント処理では、CPU4は、読み出されたイベントデータがキーオンイベントデータであれば、当該キーオンイベントデータ中のキーコードKCおよびキーオンKONを音源11に出力し、読み出されたイベントデータがキーオフイベントデータであれば、当該キーオフイベントデータ中のキーコードKCおよびキーオフKOFを音源11に出力し、読み出されたイベントデータが楽音制御イベントデータであれば、当該楽音制御イベントデータ中の楽音パラメータを音源11に出力し、読み出されたイベントデータがテンポイベントデータであれば、自動演奏のテンポを変更する。   If there is corresponding event data, the CPU 4 determines “YES” in step S5, reads out one corresponding event data in step S6, and executes the automatic performance event processing in step S7. In this automatic performance event processing, if the read event data is key-on event data, the CPU 4 outputs the key code KC and key-on KON in the key-on event data to the sound source 11, and the read event data is If it is key-off event data, the key code KC and key-off KOF in the key-off event data are output to the sound source 11, and if the read-out event data is musical tone control event data, the musical tone parameter in the musical tone control event data is output. Is output to the sound source 11, and if the read event data is tempo event data, the tempo of the automatic performance is changed.

ステップS7の処理後、CPU4は、ステップS8にて該当する残りのイベントデータが曲データ中にあるか否かを判定し、該当する残りのイベントデータがあれば、前記ステップS6およびS7の処理を実行する。ステップS8の判定処理は、曲データ中に同じ発生タイミングのイベントデータが複数存在する場合に必要なものである。つまり、ステップS6では、同じ発生タイミングのイベントデータが複数あったとしても、そのうちの1つだけを読み出し、そのイベントデータを次のステップS7の自動演奏イベント処理に渡しているため、当該イベントデータが複数ある場合には、その個数に応じた回数だけ、ステップS6およびS7の処理を繰り返す必要があるからである。このようにして、該当するイベントデータは、ステップS7の自動演奏イベント処理にて1つずつ処理される。該当する残りのイベントデータがなくなると、CPU4は、ステップS8にて“NO”と判定して、ステップS9にて、鍵駆動用データ中に、テンポクロックTCLにより示された駆動タイミングを表す駆動タイミングデータの付随した駆動イベントデータがあるか否かを判定する。該当する駆動イベントデータがなければ、CPU4は、ステップS9にて“NO”と判定して、この自動演奏処理プログラムを一旦終了する。   After the process of step S7, the CPU 4 determines whether or not the corresponding remaining event data is in the song data in step S8, and if there is the corresponding remaining event data, the processes of steps S6 and S7 are performed. Run. The determination process in step S8 is necessary when there are a plurality of event data having the same generation timing in the music data. That is, in step S6, even if there are a plurality of event data having the same occurrence timing, only one of them is read, and the event data is passed to the automatic performance event processing in the next step S7. This is because if there are a plurality, it is necessary to repeat the processes in steps S6 and S7 as many times as the number. In this way, the corresponding event data is processed one by one in the automatic performance event processing in step S7. When there is no corresponding remaining event data, the CPU 4 determines “NO” in step S8, and in step S9, the drive timing representing the drive timing indicated by the tempo clock TCL in the key drive data. It is determined whether there is drive event data accompanied by data. If there is no corresponding drive event data, the CPU 4 determines "NO" in step S9, and once ends this automatic performance processing program.

該当する駆動イベントデータがあれば、CPU4は、ステップS9にて“YES”と判定して、ステップS10にて該当する1つの駆動イベントデータを読み出し、ステップS11にて鍵駆動イベント処理サブルーチンを実行する。ステップS11の処理後、CPU4は、ステップS12にて該当する残りの駆動イベントデータが鍵駆動用データ中にあるか否かを判定し、該当する残りの駆動イベントデータがあれば、前記ステップS10およびS11の処理を実行する。なお、ステップS12の判定処理を設けた理由は、前記ステップS8の判定処理を設けた理由と同様である。このようにして、該当する駆動イベントデータは、ステップS11の鍵駆動イベント処理サブルーチンにて1つずつ処理される。該当する残りの駆動イベントデータがなくなると、CPU4は、ステップS12にて“NO”と判定して、ステップS13にて鍵駆動用データの読み出しがエンドデータまで達したか否かを判定する。そして、エンドデータに達するまで、すなわち1曲分の鍵駆動用データの読み出しが終了するまで、演奏テンポに応じた短時間毎に、ステップS4〜S13の処理が繰り返し実行される。   If there is corresponding drive event data, the CPU 4 determines “YES” in step S 9, reads one corresponding drive event data in step S 10, and executes a key drive event processing subroutine in step S 11. . After the processing of step S11, the CPU 4 determines whether or not the corresponding remaining driving event data is present in the key driving data in step S12, and if there is the corresponding remaining driving event data, the steps S10 and The process of S11 is executed. The reason for providing the determination process in step S12 is the same as the reason for providing the determination process in step S8. In this way, the corresponding drive event data is processed one by one in the key drive event processing subroutine of step S11. When there is no corresponding remaining drive event data, the CPU 4 determines “NO” in step S12, and determines in step S13 whether or not the reading of the key driving data has reached the end data. Then, until the end data is reached, that is, until the reading of the key driving data for one song is completed, the processes in steps S4 to S13 are repeatedly executed for each short time according to the performance tempo.

鍵駆動用データの読み出しがエンドデータまで達すると、CPU4は、ステップS13にて“YES”と判定し、ステップS14にてランフラグRUNを“0”に設定して、この自動演奏処理プログラムの実行を終了する。このようにしてランフラグRUNが“0”に設定されると、自動演奏処理プログラムが次に実行されたときには、前述のように、ステップS1およびS2の処理により、ユーザによってスタートが指示されるまで、曲データおよび鍵駆動用データの読み出し処理は実行されない。   When the reading of the key driving data reaches the end data, the CPU 4 determines “YES” in step S13, sets the run flag RUN to “0” in step S14, and executes the automatic performance processing program. finish. When the run flag RUN is set to “0” in this way, when the automatic performance processing program is executed next, as described above, until the start is instructed by the user by the processing of steps S1 and S2, The process of reading the song data and the key driving data is not executed.

なお、鍵駆動用データ内の最後の駆動イベントデータ(エンドデータの直前の駆動イベントデータ)の読み出しが、曲データ内の対応するイベントデータの読み出しより早く終了することが起こり得る(前述のように、駆動イベントデータの駆動タイミングを、対応するイベントデータの発生タイミングより早くする必要があるため)が、この場合には、図7のフローチャートでは、曲データ内の最後のイベントデータを読み出すことができない。これに対処するためには、曲データの読み出しがエンドデータに至ったときに“1”に設定し、それ以外は“0”に設定する曲データ読出終了フラグと、鍵駆動用データの読み出しがエンドデータに至ったときに“1”に設定し、それ以外は“0”に設定する鍵駆動用データ読出終了フラグを設け、曲データ読出終了フラグおよび鍵駆動用データ読出終了フラグがいずれも“1”に設定されているときに、ランフラグRUNを“0”に設定するようにすればよい。   Note that the reading of the last driving event data in the key driving data (the driving event data immediately before the end data) may end earlier than the reading of the corresponding event data in the music data (as described above). However, in this case, the last event data in the song data cannot be read out in the flowchart of FIG. 7 in this case. . In order to cope with this, the music data reading end flag set to “1” when the reading of the music data reaches the end data and set to “0” otherwise, and the key driving data is read. A key drive data read end flag is set that is set to “1” when the end data is reached, and is set to “0” otherwise. Both the song data read end flag and the key drive data read end flag are set to “ The run flag RUN may be set to “0” when it is set to “1”.

次に、前記ステップS11の鍵駆動イベント処理サブルーチンについて説明する。鍵駆動イベント処理サブルーチンは、図8に詳細に示されている。その実行が開始されると、CPU4は、ステップS21にて、前記読み出した駆動イベントデータが駆動オンイベントデータであるか否かを判定する。駆動オンイベントデータであれば、CPU4は、ステップS21にて“YES”と判定して、処理をステップS22に進める。前記読み出したイベントデータが駆動オンイベントデータでない場合には、CPU4は、ステップS21において“NO”と判定して、処理をステップS25に進める。まず、読み出された駆動イベントデータが駆動オンイベントデータである場合について説明を続ける。ステップS22においては、CPU4は、鍵駆動用テーブルを参照し、前記読み出した駆動オンイベントデータ中に含まれているキーコードKCと同一のキーコードKCを記憶したチャンネルが存在するか否かを判定する。この判定条件は、後述する同一鍵連打に関する判定条件である。この基本動作においては、同一鍵連打に関係して同一鍵に関する駆動オンイベントデータが短時間内に発生しないことを前提としているので、前記読み出した駆動オンイベントデータ中に含まれているキーコードKCと同一のキーコードKCを記憶したチャンネルは存在しない。なお、該当するチャンネルが存在する場合については詳しく後述する。したがって、この場合、CPU4は、ステップS22にて“NO”と判定して、処理をステップS23に進める。   Next, the key driving event processing subroutine of step S11 will be described. The key drive event processing subroutine is shown in detail in FIG. When the execution is started, the CPU 4 determines in step S21 whether or not the read drive event data is drive-on event data. If it is drive-on event data, the CPU 4 determines “YES” in step S21, and advances the process to step S22. If the read event data is not drive-on event data, the CPU 4 determines “NO” in step S21 and advances the process to step S25. First, the description continues when the read drive event data is drive-on event data. In step S22, the CPU 4 refers to the key driving table and determines whether or not there is a channel that stores the same key code KC as the key code KC included in the read driving on event data. To do. This determination condition is a determination condition related to the same key repetitive strike described later. This basic operation is based on the premise that drive-on event data related to the same key does not occur within a short time in relation to the same key repetitive keystrokes. Therefore, the key code KC included in the read drive-on event data is used. There is no channel that stores the same key code KC. The case where the corresponding channel exists will be described later in detail. Therefore, in this case, the CPU 4 determines “NO” in the step S22, and advances the process to the step S23.

ステップS23においては、CPU4は、鍵駆動用テーブル内にて第1スイッチフラグSW1が“0”であり、かつ割当て優先度が最大であるチャンネルchiを探し出し、同探し出したチャンネルchiに前記図7のステップS10の処理により鍵駆動用データ中から読み出した駆動イベントデータである駆動オンイベントデータを割当てる。すなわち、鍵駆動用テーブルの前記探し出したチャンネルchiのキーコードKC(i)を駆動オンイベントデータ中に含まれるキーコードKCに設定し、鍵駆動状態ST(i)を第1状態ST1に設定し、経過時間TM(i)を“0”にリセットし、オフディレイフラグOFDL(i)、オンディレイフラグONDL(i)、同一鍵再打鍵フラグRSK(i)および第1〜第3スイッチフラグSW1(i)〜SW3(i)をそれぞれ“0”に設定する。なお、ステップS23中のカッコ書き、すなわち、同一鍵再打鍵AフラグRSKA(i)、同一鍵再打鍵BフラグRSKB(i)および同一鍵再打鍵CフラグRSKC(i)は、本発明の第2の実施の形態に係る制御装置で使用されるものである。   In step S23, the CPU 4 searches for the channel chi whose first switch flag SW1 is “0” and has the highest allocation priority in the key driving table, and assigns the channel chi to the searched channel chi in FIG. Drive-on event data, which is drive event data read from the key drive data in the process of step S10, is assigned. That is, the key code KC (i) of the found channel chi in the key drive table is set to the key code KC included in the drive-on event data, and the key drive state ST (i) is set to the first state ST1. The elapsed time TM (i) is reset to “0”, the off-delay flag OFDL (i), the on-delay flag ONDL (i), the same key re-keying flag RSK (i), and the first to third switch flags SW1 ( i) to SW3 (i) are set to “0”, respectively. The parentheses in step S23, that is, the same key re-key A flag RSKA (i), the same key re-key B flag RSKB (i), and the same key re-key C flag RSKC (i) are the second in the present invention. This is used in the control device according to the embodiment.

次にCPU4は、ステップS24にて、前記記憶したキーコードKC(i)が予め割当てられているデューティ比テーブル(特許請求の範囲では、「駆動信号パターン」に対応する)を探し出して、同探し出したデューティ比テーブル内の第1状態ST1に対応したデューティ比をキーコードKC(i)と共に前記駆動制御部3cに出力する。そして、CPU4は、この鍵駆動イベント処理サブルーチンの実行を一旦終了する。   Next, in step S24, the CPU 4 searches for a duty ratio table (corresponding to “driving signal pattern” in the claims) to which the stored key code KC (i) is assigned in advance. The duty ratio corresponding to the first state ST1 in the duty ratio table is output to the drive control section 3c together with the key code KC (i). Then, the CPU 4 once ends the execution of this key driving event processing subroutine.

本実施の形態では、前記ROM5または外部記憶装置9には、アクチュエータ330を通電制御するためのデューティ比を記憶した複数のデューティ比テーブルが記憶されている。複数のデューティ比テーブルはそれぞれ、押鍵時に鍵310を円滑に突き上げるためにアクチュエータ330を通電制御する際のデューティ比を押鍵開始からの時間の関数として記憶しているとともに、離鍵時の鍵310を円滑に降下させるためにアクチュエータ330を通電制御する際のデューティ比を離鍵開始からの時間の関数として記憶している。本実施の形態では、図17(a)に示すように、各デューティ比テーブルは、押鍵時のデューティ比として階段状に変化する5種類(ST1〜ST5)のデューティ比、押鍵維持のための1種類(ST6)のデューティ比、および離鍵時のデューティ比として階段状に変化する4種類(ST7〜ST10)のデューティ比が用意されている。また、複数のデューティ比テーブル内にそれぞれ記憶された時間変化するデューティ比の各平均値はそれぞれ異なる。そして、鍵310をなるべく均一な速度で変位させるために、鍵の属する音域(たとえば、低域、中低域、中高域および高域)、白鍵または黒鍵、および千鳥状に配置されたアクチュエータ330の前後位置の組み合わせに応じて、鍵310は複数のデューティ比テーブルのうちのいずれか1つのデューティ比テーブルに予め割当てられている。具体的には、鍵盤装置3の質量部材323は低音域ほど重いために(すなわち、回転モーメントが大きいために)、低音域の鍵310ほど、前記平均値の大きなデューティ比テーブルに割当てられている。白鍵310Wは、黒鍵310Bに比べて回転モーメントが大きいために、黒鍵310Bに比べて前記平均値の大きなデューティ比テーブルに割当てられている。アクチュエータ330が前側に位置している鍵310は、アクチュエータ330が後側に位置している鍵310に比べてハンマ体回動軸PHからの距離が短いために、前記平均値の大きなデューティ比テーブルに割当てられている。   In the present embodiment, the ROM 5 or the external storage device 9 stores a plurality of duty ratio tables storing duty ratios for energization control of the actuator 330. Each of the plurality of duty ratio tables stores the duty ratio when energizing the actuator 330 to smoothly push up the key 310 when the key is pressed as a function of the time from the start of the key pressing, and the key when the key is released In order to smoothly lower 310, the duty ratio at the time of energization control of the actuator 330 is stored as a function of time from the start of key release. In the present embodiment, as shown in FIG. 17 (a), each duty ratio table has five types (ST1 to ST5) of duty ratios that change stepwise as the duty ratio at the time of key depression, for key depression maintenance. 4 types (ST7 to ST10) of duty ratios that change stepwise are prepared as one type (ST6) duty ratio and a duty ratio at the time of key release. In addition, the average values of the duty ratios that change with time stored in the plurality of duty ratio tables are different. In order to displace the key 310 at a uniform speed as much as possible, a sound range to which the key belongs (for example, a low range, a mid-low range, a mid-high range and a high range), a white key or a black key, and an actuator arranged in a staggered manner Depending on the combination of the front and rear positions of 330, the key 310 is assigned in advance to any one of the plurality of duty ratio tables. Specifically, since the mass member 323 of the keyboard device 3 is heavier in the lower sound range (that is, because the rotational moment is larger), the lower sound key 310 is assigned to the duty ratio table having a larger average value. . Since the white key 310W has a larger rotation moment than the black key 310B, the white key 310W is assigned to the duty ratio table having a larger average value than the black key 310B. Since the key 310 in which the actuator 330 is located on the front side has a shorter distance from the hammer body rotation shaft PH than the key 310 in which the actuator 330 is located on the rear side, the duty ratio table having a large average value is used. Assigned.

前記ステップS24の処理のように、第1状態ST1に対応したデューティ比およびキーコードKC(i)が駆動制御部3cに出力されると、駆動制御部3cは、キーコードKC(i)により表された鍵310に対応したアクチュエータ330を前記デューティ比に応じたPWM波形で通電制御する。   When the duty ratio and the key code KC (i) corresponding to the first state ST1 are output to the drive control unit 3c as in step S24, the drive control unit 3c is represented by the key code KC (i). The actuator 330 corresponding to the key 310 is energized with a PWM waveform corresponding to the duty ratio.

一方、前記図7の自動演奏処理プログラムの実行に並行して、CPU4は、タイマ7との協働により、所定の短時間(たとえば、100μs)毎に、図12〜図15の鍵駆動制御処理プログラムを繰り返し実行している。この鍵駆動制御処理プログラムの実行が開始されると、CPU4は、ステップS101にて鍵駆動用テーブルのチャンネルch1〜ch10を順に指定する変数iを“1”に設定した後、図15のステップS158およびS159の処理により、変数iが“10”に達するまで、ステップS102〜S157の処理を繰り返し実行する。   On the other hand, in parallel with the execution of the automatic performance processing program of FIG. 7, the CPU 4 cooperates with the timer 7 to perform the key drive control processing of FIGS. 12 to 15 every predetermined short time (for example, 100 μs). The program is executed repeatedly. When the execution of this key drive control processing program is started, the CPU 4 sets a variable i for sequentially specifying the channels ch1 to ch10 of the key drive table to “1” in step S101, and then step S158 in FIG. The processes of steps S102 to S157 are repeatedly executed until the variable i reaches “10” by the processes of S159 and S159.

この場合、全てのチャンネルは共通の動作をするので、前記図8のステップS23の処理により、駆動オンイベントデータが登録された鍵駆動用テーブルの1つのチャンネルiについてのみ説明する。ステップS102においては、CPU4は、鍵駆動状態ST(i)が第6状態ST6を表しているか否かを判定する。この場合、前記図8のステップS23の処理により、鍵駆動状態ST(i)は第1状態ST1に設定されているので、CPU4は、ステップS102にて“NO”と判定して、ステップS103にて経過時間TM(i)に所定の短い時間値Tcを表す値を加算する。この時間値Tcは、この鍵駆動制御処理プログラムの実行周期(たとえば、100μs)である。   In this case, since all the channels perform a common operation, only one channel i of the key driving table in which the drive-on event data is registered by the process of step S23 in FIG. 8 will be described. In step S102, the CPU 4 determines whether or not the key driving state ST (i) represents the sixth state ST6. In this case, since the key drive state ST (i) is set to the first state ST1 by the process of step S23 of FIG. 8, the CPU 4 determines “NO” in step S102, and then proceeds to step S103. Then, a value representing a predetermined short time value Tc is added to the elapsed time TM (i). This time value Tc is an execution cycle (for example, 100 μs) of the key drive control processing program.

前記ステップS103の処理後、鍵駆動状態ST(i)は第1状態ST1に設定されているので、CPU4は、ステップS104にて“YES”と判定して、ステップS105にて経過時間TM(i)が第1状態ST1の終了タイミングを示す所定の第1時間値T1(図17(a)参照)以上であるか否かを判定する。経過時間TM(i)が第1時間値T1以上でなければ、CPU4は、ステップS105にて“NO”と判定して、処理をステップS158以降に進める。そして、鍵駆動制御処理プログラムが再び実行されても、経過時間TM(i)が第1時間値T1以上になるまで、前記ステップS101〜S105,S158およびS159の処理を繰り返す。この繰り返し処理中、駆動制御部3cは、図8のステップS24の処理によって供給されたデューティ比に応じたPWM波形で、キーコードKC(i)により表されたアクチュエータ330を通電制御し続ける。   After the process of step S103, since the key driving state ST (i) is set to the first state ST1, the CPU 4 determines “YES” in step S104, and the elapsed time TM (i) in step S105. ) Is equal to or greater than a predetermined first time value T1 (see FIG. 17A) indicating the end timing of the first state ST1. If the elapsed time TM (i) is not equal to or greater than the first time value T1, the CPU 4 determines “NO” in step S105, and advances the process to step S158 and subsequent steps. Even if the key drive control processing program is executed again, the processes of steps S101 to S105, S158, and S159 are repeated until the elapsed time TM (i) becomes equal to or greater than the first time value T1. During this repetitive process, the drive control unit 3c continues energization control of the actuator 330 represented by the key code KC (i) with the PWM waveform corresponding to the duty ratio supplied by the process of step S24 in FIG.

一方、前記ステップS103の加算処理により、経過時間TM(i)が第1時間値T1以上になると、CPU4は、ステップS105にて“YES”と判定して、ステップS106にて鍵駆動状態ST(i)を第2状態ST2に変更する。そして、CPU4は、ステップS107にて、キーコードKC(i)が予め割当てられているデューティ比テーブルを探し出して、同探し出したデューティ比テーブル(図17(a)参照)内の第2状態ST2に対応したデューティ比をキーコードKC(i)と共に駆動制御部3cに出力する。駆動制御部3cは、キーコードKC(i)により表された鍵310に対応したアクチュエータ330を前記デューティ比に応じたPWM波形で通電制御する。前記ステップS107の処理後、CPU4は、処理をステップS158以降に進める。   On the other hand, when the elapsed time TM (i) becomes equal to or greater than the first time value T1 by the addition processing in step S103, the CPU 4 determines “YES” in step S105, and in step S106, the key driving state ST ( i) is changed to the second state ST2. In step S107, the CPU 4 searches for the duty ratio table to which the key code KC (i) is assigned in advance, and enters the second state ST2 in the searched duty ratio table (see FIG. 17A). The corresponding duty ratio is output to the drive control unit 3c together with the key code KC (i). The drive control unit 3c controls energization of the actuator 330 corresponding to the key 310 represented by the key code KC (i) with a PWM waveform corresponding to the duty ratio. After the process of step S107, the CPU 4 advances the process to step S158 and subsequent steps.

次にこの鍵駆動制御処理プログラムが実行されたときには、鍵駆動状態ST(i)は第2状態ST2に設定されているので、CPU4は、ステップS108にて“YES”と判定して、前記ステップS105〜S107と同様なステップS109〜S111の処理により、駆動制御部3cとの協働により、キーコードKC(i)により表された鍵310に対応したアクチュエータ330を、第2状態ST2に対応したデューティ比に応じたPWM波形で、第2状態ST2の終了タイミングを示す所定の第2時間値T2になるまで通電制御し続ける。そして、経過時間TM(i)が第2時間値T2に達すると、前記と同じアクチュエータ330を、第3状態ST3に対応したデューティ比に応じたPWM波形で通電制御し始める。したがって、キーコードKC(i)により表された鍵310に対応したアクチュエータ330は、時間T2−T1だけ、第2状態ST2に対応したデューティ比に応じたPWM波形で通電制御され、その後に第3状態ST3に対応したデューティ比に応じたPWM波形の通電制御に切換えられる。   Next, when this key drive control processing program is executed, since the key drive state ST (i) is set to the second state ST2, the CPU 4 makes a determination of “YES” in step S108, and the step Through the processing in steps S109 to S111 similar to S105 to S107, the actuator 330 corresponding to the key 310 represented by the key code KC (i) is associated with the second state ST2 in cooperation with the drive control unit 3c. The energization control is continued until a predetermined second time value T2 indicating the end timing of the second state ST2 with a PWM waveform corresponding to the duty ratio. When the elapsed time TM (i) reaches the second time value T2, energization control of the same actuator 330 as described above starts with a PWM waveform corresponding to the duty ratio corresponding to the third state ST3. Accordingly, the actuator 330 corresponding to the key 310 represented by the key code KC (i) is energized and controlled by the PWM waveform corresponding to the duty ratio corresponding to the second state ST2 for the time T2-T1, and then the third Switching to energization control of the PWM waveform corresponding to the duty ratio corresponding to the state ST3 is performed.

次にこの鍵駆動制御処理プログラムが実行されたときには、鍵駆動状態ST(i)は第3状態ST3に設定されているので、CPU4は、ステップS112にて“YES”と判定して、ステップS113にて同一鍵再打鍵フラグRSK(i)が“1”に設定されているか否かを判定する。この基本動作においては、同一鍵再打鍵フラグRSK(i)は必ず“0”に設定されているので、CPU4は、ステップS113にて“NO”と判定して、処理をステップS114に進める。CPU4は、ステップS114にて第1スイッチSW1のオンイベントが前記図2のスキャン部3dによって検出されたか否かを判定する。第1スイッチSW1のオンイベントが検出されなければ、CPU4は、ステップS114にて“NO”と判定して、処理をステップS158以降に進める。一方、第1スイッチSW1のオンイベントが検出されると、CPU4は、ステップS114にて“YES”と判定して、ステップS115にて第1スイッチフラグSW1(i)を“1”に設定する。そしてCPU4は、ステップS116にて、鍵駆動状態ST(i)を第4状態ST4に変更し、ステップS117にて、キーコードKC(i)が予め割当てられているデューティ比テーブルを探し出して、同探し出したデューティ比テーブル内の第4状態ST4に対応したデューティ比をキーコードKC(i)と共に駆動制御部3cに出力する。駆動制御部3cは、キーコードKC(i)により表された鍵310に対応したアクチュエータ330を前記デューティ比に応じたPWM波形で通電制御する。前記ステップS117の処理後、CPU4は、処理をステップS158以降に進める。   Next, when this key drive control processing program is executed, since the key drive state ST (i) is set to the third state ST3, the CPU 4 determines “YES” in the step S112, and a step S113. It is determined whether or not the same key re-keying flag RSK (i) is set to “1”. In this basic operation, since the same key re-keying flag RSK (i) is always set to “0”, the CPU 4 determines “NO” in the step S113 and advances the process to a step S114. In step S114, the CPU 4 determines whether an on event of the first switch SW1 has been detected by the scanning unit 3d in FIG. If the ON event of the first switch SW1 is not detected, the CPU 4 determines “NO” in step S114, and advances the process to step S158 and subsequent steps. On the other hand, when the ON event of the first switch SW1 is detected, the CPU 4 determines “YES” in step S114, and sets the first switch flag SW1 (i) to “1” in step S115. In step S116, the CPU 4 changes the key driving state ST (i) to the fourth state ST4. In step S117, the CPU 4 searches for a duty ratio table to which the key code KC (i) is assigned in advance. The duty ratio corresponding to the fourth state ST4 in the found duty ratio table is output to the drive control unit 3c together with the key code KC (i). The drive control unit 3c controls energization of the actuator 330 corresponding to the key 310 represented by the key code KC (i) with a PWM waveform corresponding to the duty ratio. After the process of step S117, the CPU 4 advances the process to step S158 and subsequent steps.

次にこの鍵駆動制御処理プログラムが実行されたときには、鍵駆動状態ST(i)は第4状態ST4であるので、CPU4は、図13のステップS119にて“YES”と判定して、ステップS120にて第3スイッチSW3のオンイベントがスキャン部3dによって検出されたか否かを判定する。第3スイッチSW3のオンイベントが検出されなければ、CPU4は、ステップS120にて“NO”と判定して、処理をステップS158以降に進める。一方、第3スイッチSW3のオンイベントが検出されると、CPU4は、ステップS120にて“YES”と判定して、ステップS121にて第2および第3スイッチフラグSW2(i)およびSW3(i)をそれぞれ“1”に設定し、ステップS122にて鍵駆動状態ST(i)を第5状態ST5に変更する。そして、CPU4は、ステップS123にて、キーコードKC(i)が予め割当てられているデューティ比テーブルを探し出して、同探し出したデューティ比テーブル内の第5状態ST5に対応したデューティ比をキーコードKC(i)と共に駆動制御部3cに出力する。駆動制御部3cは、キーコードKC(i)により表された鍵310に対応したアクチュエータ330を前記デューティ比に応じたPWM波形で通電制御する。さらにCPU4は、ステップS124にて、第5状態ST5を継続させる時間ΔTst5(図17(a)参照)と経過時間TM(i)との加算値を第5時間値T5とした後、処理をステップS158以降に進める。このように第5時間値T5を設定するのは、第4状態ST4から第5状態ST5に切り替わる時刻、つまり第4時間値T4は、固定値ではなく、第3スイッチSW3のオンイベントの発生タイミングによって決まる変動値であり、その変動値に対して常に所定時間、すなわち時間ΔTst5だけ第5状態ST5を継続させたいからである。   Next, when this key drive control processing program is executed, since the key drive state ST (i) is the fourth state ST4, the CPU 4 determines “YES” in step S119 of FIG. It is determined whether or not the on-event of the third switch SW3 is detected by the scanning unit 3d. If the ON event of the third switch SW3 is not detected, the CPU 4 determines “NO” in the step S120, and advances the process to the step S158 and the subsequent steps. On the other hand, when the ON event of the third switch SW3 is detected, the CPU 4 determines “YES” in step S120, and in step S121, the second and third switch flags SW2 (i) and SW3 (i) are determined. Are respectively set to “1”, and the key driving state ST (i) is changed to the fifth state ST5 in step S122. In step S123, the CPU 4 searches the duty ratio table to which the key code KC (i) is assigned in advance, and sets the duty ratio corresponding to the fifth state ST5 in the searched duty ratio table to the key code KC. Output to the drive control unit 3c together with (i). The drive control unit 3c controls energization of the actuator 330 corresponding to the key 310 represented by the key code KC (i) with a PWM waveform corresponding to the duty ratio. Further, in step S124, the CPU 4 sets the added value of the time ΔTst5 (see FIG. 17A) for continuing the fifth state ST5 and the elapsed time TM (i) to the fifth time value T5, and then performs the processing step. Proceed to S158 and thereafter. The fifth time value T5 is set in this way at the time when the fourth state ST4 switches to the fifth state ST5, that is, the fourth time value T4 is not a fixed value, but the on-event occurrence timing of the third switch SW3. This is because it is desired to continue the fifth state ST5 only for a predetermined time, that is, the time ΔTst5 with respect to the fluctuation value.

次に、鍵駆動状態ST(i)が第5状態ST5になった場合について説明する。この場合、CPU4は、前記第2状態ST2の場合と異なり、ステップS125〜S133の処理を実行する。しかし、ステップS127,S130〜S133の処理は、同一鍵連打に関係してオフディレイフラグOFDL(i)が“1”に設定されている場合の処理であり、この基本動作においては、オフディレイフラグOFDL(i)は必ず“0”に設定されている。したがって、この場合、ステップS127における“YES”との判定のもとに、実質的には、ステップS125,S126,S128およびS129の処理が実行される。そして、これらのステップS125,S126,S128およびS129の処理は、前述したステップS104〜S107およびステップS108〜S111の各処理に対応している。したがって、この場合も、キーコードKC(i)により表された鍵310に対応したアクチュエータ330は、前記の処理と同様に、時間T5−T4(=ΔTst5)の間、第5状態ST5に対応したデューティ比に応じたPWM波形で通電制御され、その後に、第6状態ST6に対応したデューティ比に応じたPWM波形で通電制御され続ける。   Next, a case where the key driving state ST (i) becomes the fifth state ST5 will be described. In this case, unlike the case of the second state ST2, the CPU 4 executes the processes of steps S125 to S133. However, the processes in steps S127 and S130 to S133 are processes when the off-delay flag OFDL (i) is set to “1” in relation to the same key repeated striking. In this basic operation, the off-delay flag OFDL (i) is always set to “0”. Therefore, in this case, the processes of steps S125, S126, S128, and S129 are substantially executed based on the determination of “YES” in step S127. The processes in steps S125, S126, S128, and S129 correspond to the processes in steps S104 to S107 and steps S108 to S111 described above. Accordingly, in this case as well, the actuator 330 corresponding to the key 310 represented by the key code KC (i) corresponds to the fifth state ST5 for the time T5-T4 (= ΔTst5), similarly to the above-described processing. The energization control is performed with the PWM waveform corresponding to the duty ratio, and thereafter the energization control is continued with the PWM waveform corresponding to the duty ratio corresponding to the sixth state ST6.

この第1〜第5状態ST1〜ST5の制御により、鍵310およびハンマ体HMは図3の状態から図4の状態に変化し、ハンマ体HMの質量部材323の後端部は上側ストッパ312により上方への変位が規制される。この状態は、ユーザが鍵310の押鍵を維持している状態に対応する。   By the control of the first to fifth states ST1 to ST5, the key 310 and the hammer body HM are changed from the state of FIG. 3 to the state of FIG. 4, and the rear end portion of the mass member 323 of the hammer body HM is moved by the upper stopper 312. The upward displacement is restricted. This state corresponds to a state in which the user holds down the key 310.

このような状態で、図7のステップS10の処理により駆動イベントデータである駆動オフイベントデータが読み出されて、図7のステップS11、すなわち図8の鍵駆動イベント処理サブルーチンが実行されると、CPU4は、図8のステップS21にて“NO”と判定するとともに、ステップS25にて“YES”と判定して、ステップS26にて鍵駆動オフ処理サブルーチンを実行する。   In this state, when the drive off event data, which is the drive event data, is read out by the process of step S10 in FIG. 7, and the step S11 in FIG. 7, that is, the key drive event process subroutine in FIG. The CPU 4 determines “NO” in step S21 of FIG. 8, determines “YES” in step S25, and executes a key drive off processing subroutine in step S26.

鍵駆動オフ処理サブルーチンは、図9に詳細に示されている。その実行が開始されると、CPU4は、ステップS31にて、鍵駆動用テーブルを参照し、前記読み出した駆動オフイベントデータ中に含まれているキーコードKCと同一のキーコードKCを記憶しているチャンネルchiを探し出す。次に、前記探し出したチャンネルchiにより指定される鍵駆動用テーブル内の鍵駆動状態ST(i)が第6状態ST6であるか否かを判定する。この場合、前記探し出したチャンネルchiは、前述した図12のステップS101〜図13のステップS129の処理により、鍵駆動状態ST(i)が第6状態ST6に設定されたチャンネルと同じであるものとして話を進める。したがって、CPU4は、ステップS32にて“YES”と判定して、処理をステップS33以降に進める。なお、ステップS32にて“NO”、すなわち鍵駆動状態ST(i)が第6状態ST6でないと判定される場合は、この基本動作でない同一鍵連打に関する場合である。   The key drive off processing subroutine is shown in detail in FIG. When the execution is started, the CPU 4 refers to the key driving table in step S31 and stores the same key code KC as the key code KC included in the read driving off event data. Find a channel chi. Next, it is determined whether or not the key driving state ST (i) in the key driving table designated by the found channel chi is the sixth state ST6. In this case, the found channel chi is assumed to be the same as the channel in which the key driving state ST (i) is set to the sixth state ST6 by the processing of step S101 of FIG. 12 to step S129 of FIG. Proceed with the story. Therefore, the CPU 4 determines “YES” in the step S32, and advances the process to the step S33 and subsequent steps. If “NO” in step S32, that is, if it is determined that the key driving state ST (i) is not the sixth state ST6, this is a case relating to the same key repetitive key stroke that is not this basic operation.

前記ステップS32の“YES”との判定後、CPU4は、ステップS33にて鍵駆動状態ST(i)を第7状態ST7に変更し、ステップS34にてキーコードKC(i)が予め割当てられているデューティ比テーブルを探し出して、同探し出したデューティ比テーブル(図17(a)参照)内の第7状態ST7に対応したデューティ比をキーコードKC(i)と共に駆動制御部3cに出力する。駆動制御部3cは、前記場合と同様に、キーコードKC(i)により表された鍵310に対応したアクチュエータ330を前記デューティ比に応じたPWM波形で通電制御する。なお、この制御および今後の制御は、図4の状態にある鍵310およびハンマ体HMを図3の状態に戻す動作、すなわち駆動オフ動作に対応する。   After determining “YES” in step S32, the CPU 4 changes the key drive state ST (i) to the seventh state ST7 in step S33, and the key code KC (i) is assigned in advance in step S34. A duty ratio table corresponding to the seventh state ST7 in the searched duty ratio table (see FIG. 17A) is output to the drive control unit 3c together with the key code KC (i). Similarly to the above case, the drive control unit 3c controls energization of the actuator 330 corresponding to the key 310 represented by the key code KC (i) with a PWM waveform corresponding to the duty ratio. This control and future control correspond to an operation for returning the key 310 and the hammer body HM in the state of FIG. 4 to the state of FIG. 3, that is, a drive-off operation.

一方、前述のように、CPU4は、図12〜図15の鍵駆動制御処理プログラムを所定の短い時間値Tc毎に繰り返し実行している。前記図9の鍵駆動オフ処理サブルーチンによって、鍵駆動状態ST(i)は第7状態ST7に設定されているので、図14のステップS134〜S138の処理が実行される。このステップS134〜S138の処理は、前述した図13のステップS119〜S123の処理と同様であり、CPU4は、駆動制御部3cとの協働により、キーコードKC(i)により表された鍵310に対応したアクチュエータ330を、第7状態ST7に対応したデューティ比に応じたPWM波形で、第2スイッチSW2のオフイベントがスキャン部3dによって検出されるまで(ただし、ステップS119〜S123の処理では、第3スイッチSW3のオンイベントが検出されるまで)通電制御し、その後に第8状態ST8に対応したデューティ比に応じたPWM波形の通電制御に切換える。また、図14のステップS139〜S144は、前述した図13のステップS119〜S124の処理と同様であり、CPU4は、駆動制御部3cとの協働により、キーコードKC(i)により表された鍵310に対応したアクチュエータ330を、第8状態ST8に対応したデューティ比に応じたPWM波形で、第1スイッチSW1のオフイベントがスキャン部3dによって検出されるまで通電制御し、その後に第9状態ST9に対応したデューティ比に応じたPWM波形の通電制御に切換えるとともに、第9状態ST9を継続させる時間ΔTst9(図17(a)参照)と経過時間TM(i)との加算値を第9時間値T9とする。さらに、図15のステップS145〜S148の処理は、前述した図12のステップS104〜S107などの処理と同様であり、CPU4は、駆動制御部3cとの協働により、キーコードKC(i)により表された鍵310に対応したアクチュエータ330を、第9状態ST9に対応したデューティ比に応じたPWM波形で、時間ΔTst9にわたって通電制御し、その後に第10状態ST10に対応したデューティ比に応じたPWM波形の通電制御に切換える。   On the other hand, as described above, the CPU 4 repeatedly executes the key drive control processing program of FIGS. 12 to 15 every predetermined short time value Tc. Since the key drive state ST (i) is set to the seventh state ST7 by the key drive off process subroutine of FIG. 9, the processes of steps S134 to S138 of FIG. 14 are executed. The processing of steps S134 to S138 is the same as the processing of steps S119 to S123 of FIG. 13 described above, and the CPU 4 cooperates with the drive control unit 3c to generate the key 310 represented by the key code KC (i). Until the off-event of the second switch SW2 is detected by the scanning unit 3d with a PWM waveform corresponding to the duty ratio corresponding to the seventh state ST7 (in the processing of steps S119 to S123, The energization control is performed (until an on-event of the third switch SW3 is detected), and thereafter, the control is switched to the energization control of the PWM waveform corresponding to the duty ratio corresponding to the eighth state ST8. Further, steps S139 to S144 in FIG. 14 are the same as the processes in steps S119 to S124 in FIG. 13 described above, and the CPU 4 is represented by the key code KC (i) in cooperation with the drive control unit 3c. The actuator 330 corresponding to the key 310 is energized with a PWM waveform corresponding to the duty ratio corresponding to the eighth state ST8 until the off event of the first switch SW1 is detected by the scanning unit 3d, and then the ninth state While switching to PWM waveform energization control corresponding to the duty ratio corresponding to ST9, the added value of the time ΔTst9 (see FIG. 17A) for continuing the ninth state ST9 and the elapsed time TM (i) is set to the ninth time. The value is T9. Further, the processes in steps S145 to S148 in FIG. 15 are the same as the processes in steps S104 to S107 in FIG. 12 described above, and the CPU 4 uses the key code KC (i) in cooperation with the drive control unit 3c. The actuator 330 corresponding to the represented key 310 is energized and controlled over time ΔTst9 with a PWM waveform corresponding to the duty ratio corresponding to the ninth state ST9, and then PWM corresponding to the duty ratio corresponding to the tenth state ST10. Switch to waveform energization control.

次に、鍵駆動状態ST(i)が第10状態ST10になった場合について説明する。この場合、CPU4は、前記第9状態ST9の場合と異なり、ステップS149〜S157の処理を実行する。しかし、ステップS151,S154〜S157の処理は、同一鍵連打に関係してオンディレイフラグONDL(i)が“1”に設定されている場合の処理であり、この基本動作においては、オンディレイフラグONDL(i)は必ず“0”に設定されているので、ステップS151における“YES”との判定のもとに、実質的には、ステップS150〜S153の処理が実行される。したがって、経過時間TM(i)が第10時間値T10以上になると、CPU4は、ステップS152にて、“0”を表すデューティ比をキーコードKC(i)と共に駆動制御部3cに出力する。したがって、駆動制御部3cは、キーコードKC(i)により表された鍵310に対応したアクチュエータ330の通電制御を停止する。   Next, the case where the key driving state ST (i) becomes the tenth state ST10 will be described. In this case, unlike the case of the ninth state ST9, the CPU 4 executes the processes of steps S149 to S157. However, the processing in steps S151 and S154 to S157 is processing when the on-delay flag ONDL (i) is set to “1” in relation to the same key repetitive keystroke. In this basic operation, the on-delay flag Since ONDL (i) is always set to “0”, the processes of steps S150 to S153 are substantially executed based on the determination of “YES” in step S151. Therefore, when the elapsed time TM (i) becomes equal to or greater than the tenth time value T10, the CPU 4 outputs a duty ratio representing “0” to the drive control unit 3c together with the key code KC (i) in step S152. Therefore, the drive control unit 3c stops the energization control of the actuator 330 corresponding to the key 310 represented by the key code KC (i).

この第7状態ST7〜第10状態ST10の制御により、鍵310およびハンマ体HMは図4の状態から図3の状態に変化し、ハンマ体HMの質量部材323の後端部は下側ストッパ313により下方への変位が規制される。この状態は、ユーザが鍵310の押鍵を解除した後の鍵の初期状態に対応する。   Under the control of the seventh state ST7 to the tenth state ST10, the key 310 and the hammer body HM are changed from the state shown in FIG. 4 to the state shown in FIG. Due to this, downward displacement is regulated. This state corresponds to the initial state of the key after the user releases the key 310.

前記ステップS152の処理後、CPU4は、ステップS153にて、鍵駆動用テーブル内のチャンネルchiのデータを初期値にクリアする。これにより、駆動イベントデータである次の駆動オンイベントデータの鍵駆動用テーブルへの登録に備える。   After the process of step S152, the CPU 4 clears the data of the channel chi in the key driving table to the initial value in step S153. This prepares for registration of the next drive-on event data, which is drive event data, in the key drive table.

なお本実施の形態では、図7のステップS10の処理により、駆動イベントデータとして、駆動オンイベントデータおよび駆動オフイベントデータ以外のイベントデータが読み出されることはないが、何らかの事情で駆動オン/オフイベントデータ以外のイベントデータが読み出された場合、CPU4は、図7のステップS11、すなわち図8の鍵駆動イベント処理サブルーチンのステップS21およびS25にて“NO”とそれぞれ判定して、何もせずにこの鍵駆動イベント処理サブルーチンを終了する。   In the present embodiment, the event data other than the drive-on event data and the drive-off event data are not read out as the drive event data by the process in step S10 in FIG. When event data other than data is read, the CPU 4 determines “NO” in step S11 of FIG. 7, that is, steps S21 and S25 of the key drive event processing subroutine of FIG. 8, and does nothing. This key drive event processing subroutine is terminated.

以上説明したように、この基本動作においては、図8のステップS23,S24、図9のステップS31〜S34、図12のステップS101〜S117、図13のステップS119〜S129、図14のステップS134〜S144,図15のステップS145〜S153,S158およびS159の処理により、鍵310の押鍵および離鍵動作を制御するために、アクチュエータ330が図17(a)に示すデューティ比の時間変化に応じて制御される。すなわち、アクチュエータ330への通電量および駆動力が時間経過と共に図17(a)に示すデューティ比に比例して制御される。   As described above, in this basic operation, steps S23 and S24 in FIG. 8, steps S31 to S34 in FIG. 9, steps S101 to S117 in FIG. 12, steps S119 to S129 in FIG. 13, and steps S134 in FIG. In order to control the key pressing and key release operations of the key 310 by the processing of S144, steps S145 to S153, S158 and S159 of FIG. 15, the actuator 330 responds to the time change of the duty ratio shown in FIG. Be controlled. That is, the energization amount and driving force to the actuator 330 are controlled in proportion to the duty ratio shown in FIG.

このデューティ比の変化においては、鍵310およびハンマ体HMの押鍵に対応した押鍵動作の開始時には、図17(a)の第1状態ST1で示すように、アクチュエータ330は中程度のデューティ比で通電制御、すなわち鍵310およびハンマ体HMは中程度の駆動力で駆動制御される。これは、押鍵動作の開始前には駆動部334は基部322から離れており、駆動部334の上端が基部322に接触した際の衝突を小さくするためである。次に、第2状態ST2で、アクチュエータ330は大きなデューティ比で通電制御、すなわち鍵310およびハンマ体HMは大きな駆動力で駆動制御される。次に、第3状態ST3で、デューティ比を若干下げる、すなわち鍵310およびハンマ体HMの駆動力を若干下げるようにした。   In the change of the duty ratio, at the start of the key pressing operation corresponding to the key pressing of the key 310 and the hammer body HM, the actuator 330 has a medium duty ratio as shown in the first state ST1 in FIG. Thus, energization control, that is, the key 310 and the hammer body HM are driven and controlled with a medium driving force. This is because the driving unit 334 is separated from the base 322 before the key pressing operation is started, and the collision when the upper end of the driving unit 334 contacts the base 322 is reduced. Next, in the second state ST2, the actuator 330 is energized with a large duty ratio, that is, the key 310 and the hammer body HM are controlled with a large driving force. Next, in the third state ST3, the duty ratio is slightly lowered, that is, the driving force of the key 310 and the hammer body HM is slightly lowered.

第3状態ST3の終了後、第4状態ST4では、アクチュエータ330は中程度のデューティ比で通電制御、すなわち鍵310およびハンマ体HMは中程度の駆動力で駆動制御される。このように、第4状態ST4におけるデューティ比を第3状態ST3におけるデューティ比より小さく設定したのは、第3状態ST3での大きな駆動力により、鍵310およびハンマ体HMには押鍵方向への勢い(慣性力)がついているために、駆動力をセーブして省電力化を図るようにしているからである。また、ハンマ体HMの質量部材323の後端部の上方への変位が上側ストッパ312に衝突して規制される際に、当該衝突を緩和して衝突に伴う衝撃音を低減させる意味もある。   After the end of the third state ST3, in the fourth state ST4, the actuator 330 is energized with a medium duty ratio, that is, the key 310 and the hammer body HM are controlled with a medium driving force. As described above, the duty ratio in the fourth state ST4 is set to be smaller than the duty ratio in the third state ST3 because the large driving force in the third state ST3 causes the key 310 and the hammer body HM to move in the key pressing direction. This is because the momentum (inertial force) is applied, so that the driving force is saved to save power. Further, when the upward displacement of the rear end portion of the mass member 323 of the hammer body HM is restricted by colliding with the upper stopper 312, there is also a meaning that the impact noise is reduced by reducing the collision.

第4状態ST4の終了後、第5状態ST5では、アクチュエータ330は再び大きなデューティ比で通電制御、すなわち鍵310およびハンマ体HMは再び大きな駆動力で駆動制御される。これは、ハンマ体HMの質量部材323の後端部の上側ストッパ312への衝突の反発力により、質量部材323が下方へ変位することを防止、すなわち質量部材323のリバウンドを回避するためである。   After the end of the fourth state ST4, in the fifth state ST5, the actuator 330 is again energized with a large duty ratio, that is, the key 310 and the hammer body HM are again controlled with a large driving force. This is to prevent the mass member 323 from being displaced downward by the repulsive force of the collision of the rear end portion of the mass member 323 of the hammer body HM with the upper stopper 312, that is, to avoid the rebound of the mass member 323. .

その後の第6状態ST6では、アクチュエータ330は中程度のデューティ比で通電制御、すなわち鍵310およびハンマ体HMは中程度の駆動力で駆動制御される。第6状態ST6は押鍵維持状態、すなわちハンマ体HMの質量部材323の後端部を上側ストッパ312に接触させ続ける状態であり、この状態は長時間継続することもあり、電力消費の観点からも、押鍵状態を維持できる最低限のデューティ比でアクチュエータ330を通電制御することが望ましいからである。   In the subsequent sixth state ST6, the actuator 330 is energized and controlled with a medium duty ratio, that is, the key 310 and the hammer body HM are driven and controlled with a medium driving force. The sixth state ST6 is a key press maintaining state, that is, a state in which the rear end portion of the mass member 323 of the hammer body HM is kept in contact with the upper stopper 312. This state may continue for a long time, from the viewpoint of power consumption. This is because it is desirable to control the energization of the actuator 330 with a minimum duty ratio that can maintain the key depression state.

そして、鍵310の押鍵解除、すなわちハンマ体HMの原位置への復帰時には、最初アクチュエータ330は、第7状態ST7で小さなデューティ比で通電制御、すなわち鍵310およびハンマ体HMは、小さな駆動力で駆動制御される。これは、押鍵解除に伴い、ハンマ体HMの質量部材323を急激に落下させるためである。その後、アクチュエータ330は、第8状態ST8で中低度のデューティ比で通電制御、すなわち鍵310およびハンマ体HMは中程度の駆動力で駆動制御される。そして、第8状態ST8から第10状態ST10まで少しずつ段階的に大きくなるデューティ比で通電制御、すなわち鍵310およびハンマ体HMは少しずつ段階的に大きくなる駆動力で駆動制御され、最終的にデューティ比が“0”、すなわち鍵310およびハンマ体HMの駆動制御が終了する。これらの第8状態ST8から第10状態ST10においてデューティ比(駆動力)を上昇させる理由は、押鍵解除に伴うハンマ体HMの原位置への復帰時において質量部材323の後端の下側ストッパ313への衝突を緩和して衝突に伴う衝撃音の発生を防止するとともに同後部のリバウンドを回避するために、アクチュエータ330はある程度大きな推力を必要とするからである。そして、質量部材323の後端が下側ストッパ313上に完全に静止した後に、アクチュエータ330への通電制御を解除してアクチュエータ330の推力を“0”にするためである。特に、鍵310およびハンマ体HMが原位置に近づくほど、すなわちプランジャ333がボビン331の内底面に近づいてソレノイドコイル332との対向面積が減少するほど、デューティ比(ソレノイドコイル332への通電量)が同じでも、プランジャ333を引き上げる電磁力は減少する。この電磁力の減少を補正するためにも、前記第8状態ST8から第10状態ST10に渡ってデューティ比を大きくする必要がある。   When the key 310 is released, that is, when the hammer body HM is returned to the original position, the first actuator 330 controls the energization with a small duty ratio in the seventh state ST7, that is, the key 310 and the hammer body HM have a small driving force. It is driven and controlled. This is because the mass member 323 of the hammer body HM is suddenly dropped with the release of the key depression. Thereafter, the actuator 330 is energized and controlled with a medium to low duty ratio in the eighth state ST8, that is, the key 310 and the hammer body HM are driven and controlled with a medium driving force. The energization control is performed with the duty ratio gradually increasing from the eighth state ST8 to the tenth state ST10, that is, the key 310 and the hammer body HM are driven and controlled with the driving force gradually increasing gradually. The duty ratio is “0”, that is, the drive control of the key 310 and the hammer body HM ends. The reason for increasing the duty ratio (driving force) in the eighth state ST8 to the tenth state ST10 is that the lower end stopper of the rear end of the mass member 323 is returned when the hammer body HM is returned to the original position when the key is released. This is because the actuator 330 requires a certain amount of thrust in order to mitigate the collision with 313 and prevent the generation of impact sound due to the collision and to avoid rebounding at the rear part. Then, after the rear end of the mass member 323 completely rests on the lower stopper 313, the energization control to the actuator 330 is canceled and the thrust of the actuator 330 is set to “0”. In particular, the closer the key 310 and the hammer body HM are to the original position, that is, the closer the plunger 333 is to the inner bottom surface of the bobbin 331 and the smaller the area facing the solenoid coil 332, the duty ratio (energization amount to the solenoid coil 332). However, the electromagnetic force that pulls up the plunger 333 decreases. In order to correct this decrease in electromagnetic force, it is necessary to increase the duty ratio from the eighth state ST8 to the tenth state ST10.

このような押鍵動作における第1状態ST1から第5状態ST5までの制御、押鍵維持動作における第6状態ST6の制御、および離鍵動作における第7状態ST7から第10状態ST10までの制御により、鍵310およびハンマ体HMを、機械的な雑音の発生を低減させつつ、円滑に変位させることができる。   By such control from the first state ST1 to the fifth state ST5 in the key pressing operation, control of the sixth state ST6 in the key pressing maintaining operation, and control from the seventh state ST7 to the tenth state ST10 in the key release operation. The key 310 and the hammer body HM can be smoothly displaced while reducing the generation of mechanical noise.

また、前述のようにアクチュエータ330のデューティ比を制御するために、複数のデューティ比テーブルが用意されている。そして、これらの複数のデューティ比テーブルは、鍵310の属する音域(たとえば、低域、中低域、中高域および高域)、白鍵または黒鍵、および千鳥状に配置されたアクチュエータ330の前後位置の組み合わせに応じて用意されているとともに、各鍵310に予め割当てられている。これにより、鍵310毎に適切なデューティ比を用いてアクチュエータ330への通電制御がなされるので、各鍵310や各アクチュエータ330のばらつきの影響を軽減させつつ、鍵盤装置3の構造とは無関係に、いずれの鍵310およびハンマ体HMも適切に駆動される。   In addition, a plurality of duty ratio tables are prepared in order to control the duty ratio of the actuator 330 as described above. The plurality of duty ratio tables include the sound range to which the key 310 belongs (for example, a low range, a mid-low range, a mid-high range, and a high range), white keys or black keys, and front and rear of the actuators 330 arranged in a staggered manner. It is prepared according to the combination of positions and is assigned to each key 310 in advance. As a result, the energization control of the actuator 330 is performed using an appropriate duty ratio for each key 310, so that the influence of the variation of each key 310 and each actuator 330 is reduced, and regardless of the structure of the keyboard device 3. Any of the keys 310 and the hammer body HM are appropriately driven.

なお、この基本動作、すなわち図17(a)に示すデューティ比の時間変化に応じてアクチュエータ330を通電制御する動作は、駆動オンタイミング(あるいは駆動オフタイミング)からの経過時間TMに従って鍵駆動状態STを切換え、この鍵駆動状態STに応じたデューティ比のPWM波形で、対応するアクチュエータ330を通電制御する点では、前記特許文献1に記載の基本動作とほぼ同じである。しかし、特許文献1に記載の基本動作では、鍵駆動状態STの切換えを単純に経過時間TMのみに従って行うようにしている(すなわち、完全なフィードフォワード制御によって鍵駆動制御を行っている)のに対して、本実施の形態における基本動作では、鍵駆動状態STの一部、具体的には、第4状態ST4、第5状態ST5、第8状態ST8および第9状態ST9への切換えを第1〜第3スイッチSWのオン/オフイベントが検出されたことに従って行うようにしている(すなわち、フィードフォワード制御を基本としつつ、部分的に鍵スイッチSWを用いたフィードバック制御によって鍵駆動制御を行っている)点が異なっている。これにより、本実施の形態の電子ピアノでは、各鍵の押鍵から離鍵に至る全工程をセンシングすることなく、その一部、具体的には、それぞれ独立して発生するダンパオフ(リリース)/オン(ホールド)およびキーオン/オフを検出することで、各鍵の動きを簡易的にフィードバックして押鍵/離鍵動作を制御することができる。したがって、可及的に簡略な鍵盤および駆動装置構成で自動演奏時の鍵盤動作を精度良く制御することが可能となる。   Note that this basic operation, that is, the operation for controlling energization of the actuator 330 in accordance with the time change of the duty ratio shown in FIG. 17A is the key drive state ST according to the elapsed time TM from the drive on timing (or drive off timing). The basic operation described in Patent Document 1 is substantially the same in that the corresponding actuator 330 is energized and controlled with a PWM waveform having a duty ratio corresponding to the key drive state ST. However, in the basic operation described in Patent Document 1, the key driving state ST is simply switched according to only the elapsed time TM (that is, key driving control is performed by complete feedforward control). On the other hand, in the basic operation in the present embodiment, a part of the key driving state ST, specifically, switching to the fourth state ST4, the fifth state ST5, the eighth state ST8 and the ninth state ST9 is the first. ~ The third switch SW is performed in accordance with the detection of the on / off event (that is, the key drive control is performed by the feedback control using the key switch SW partially while using the feed forward control as a basis). Is different). Thus, in the electronic piano of the present embodiment, the damper off (release) / release that occurs independently, in part, specifically, without sensing all the steps from key depression to key release. By detecting on (hold) and key on / off, the movement of each key can be simply fed back to control the key press / key release operation. Therefore, it is possible to accurately control the keyboard operation during automatic performance with the simplest possible keyboard and drive device configuration.

(2)同一鍵連打動作
次に、同一鍵連打に関係して、同一キーコードKCを有する複数の駆動オンイベントデータおよび駆動オフイベントデータが鍵駆動用データ中から短時間内に読み出された場合について説明する。これは、鍵駆動用データ中に極めて速い同一鍵の連打を表す駆動オンイベントデータおよび駆動オフイベントデータが駆動イベントデータとして予め含まれている場合や、前記テンポ操作子の操作により自動演奏のテンポが速められた場合などに生ずる。
(2) Same key repeated operation Next, a plurality of drive on event data and drive off event data having the same key code KC are read from the key drive data within a short time in relation to the same key repeated operation. The case will be described. This is because the drive on event data and the drive off event data representing the extremely fast repetition of the same key are included in the key drive data as drive event data in advance, or the tempo of the automatic performance is operated by operating the tempo operator. Occurs when the speed is increased.

この同一鍵連打動作については、連打の条件別に説明する。連打の条件とは、
(A)駆動オンイベントデータが鍵駆動用データ中から読み出された直後に、当該駆動オンイベントデータと同一キーコードKCを有する駆動オフイベントデータが鍵駆動用データ中から読み出された場合(以下、「駆動オン直後の駆動オフ」という)
(B)上記(A)駆動オン直後の駆動オフの直後に、さらに当該駆動オンイベントデータおよび駆動オフイベントデータと同一キーコードKCを有する駆動オンイベントデータが鍵駆動用データ中から読み出された場合(以下、「駆動オン直後の駆動オフ・オン」という)
(C)駆動オフイベントデータが鍵駆動用データ中から読み出された直後に、当該駆動オフイベントデータと同一キーコードKCを有する駆動オンイベントデータが鍵駆動用データ中から読み出された場合(以下、「駆動オフ直後の駆動オン」という)
(D)上記(C)駆動オフ直後の駆動オンの直後に、さらに当該駆動オフイベントデータおよび駆動オンイベントデータと同一キーコードKCを有する駆動オフイベントデータが鍵駆動用データ中から読み出された場合(以下、「駆動オフ直後の駆動オン・オフ」という)
(E)上記(D)駆動オフ直後の駆動オン・オフの直後に、当該駆動オフイベントデータおよび駆動オンイベントデータと同一キーコードKCを有する駆動オンイベントデータが鍵駆動用データ中から読み出された場合(以下、「駆動オフ直後の駆動オン・オフ・オン」という)
である。以下、上記(A)〜(E)の各連打条件がそれぞれ成立したときになされる各「同一鍵連打動作」について順次説明する。
This same key repetitive operation will be described for each repetitive condition. What are the conditions for repeated strikes?
(A) Immediately after the driving on event data is read from the key driving data, driving off event data having the same key code KC as the driving on event data is read from the key driving data ( Hereinafter referred to as “drive off immediately after drive on”)
(B) Immediately after (A) driving off immediately after driving on, driving on event data having the same key code KC as the driving on event data and driving off event data is read from the key driving data. Case (hereinafter referred to as “drive off / on immediately after drive on”)
(C) Immediately after the driving off event data is read from the key driving data, driving on event data having the same key code KC as the driving off event data is read from the key driving data ( Hereinafter referred to as “drive on immediately after drive off”)
(D) (C) Immediately after the drive is turned on immediately after the drive is turned off, the drive off event data and the drive off event data having the same key code KC as the drive on event data are read from the key drive data. Case (hereinafter referred to as “drive on / off immediately after drive off”)
(E) Immediately after (D) driving on / off immediately after driving off, the driving off event data and the driving on event data having the same key code KC as the driving on event data are read from the key driving data. (Hereinafter referred to as “drive on / off / on immediately after drive off”)
It is. In the following, each “same key repeated operation” performed when each of the above-described consecutive hit conditions (A) to (E) is satisfied will be sequentially described.

(A)駆動オン直後の駆動オフ
この駆動オン直後の駆動オフは、具体的には、駆動オンイベントデータが鍵駆動用データ中から読み出された後、鍵駆動状態ST(i)が第6状態ST6に達する前に、当該駆動オンイベントデータと同一のキーコードKCを有する駆動オフイベントデータが鍵駆動用データ中から読み出された場合である。この場合、前記図9の鍵駆動オフ処理サブルーチンにおいて、CPU4は、ステップS35にて“YES”、すなわち駆動オフイベントデータに含まれるキーコードKCと同一キーコードKCを記憶したチャンネルchiの鍵駆動状態ST(i)が第1〜第5状態ST1〜ST5のいずれかであると判定する。そして、CPU4は、ステップS36にて、前記チャンネルchiのオフディレイフラグOFDL(i)を“1”に設定する。
(A) Drive-off immediately after drive-on This drive-off immediately after drive-on is specifically the case where the key-drive state ST (i) is the sixth after the drive-on event data is read from the key drive data. This is a case where drive off event data having the same key code KC as the drive on event data is read from the key drive data before reaching the state ST6. In this case, in the key drive off processing subroutine of FIG. 9, the CPU 4 determines “YES” in step S35, that is, the key drive state of the channel chi that stores the same key code KC as the key code KC included in the drive off event data. It is determined that ST (i) is one of the first to fifth states ST1 to ST5. In step S36, the CPU 4 sets the off delay flag OFDL (i) of the channel chi to “1”.

この状態で、図12〜図15の鍵駆動制御処理プログラムの実行により、経過時間TM(i)が増加して、鍵駆動状態ST(i)が第5状態ST5の終了時を表す第5時間値T5に達すると、CPU4は、図13のステップS126の処理後のステップS127にて、前記“1”に設定したオフディレイフラグOFDL(i)に基づいて“NO”と判定して、ステップS130〜S133の処理を実行する。ステップS130においては、鍵駆動状態ST(i)を第7状態ST7に設定する。ステップS131においては、経過時間TM(i)を第7状態ST7の開始時(すなわち第6状態ST6の終了時)を表す第6時間値T6(第5時間値T5に等しい)に設定する。ステップS132においては、キーコードKC(i)が予め割当てられているデューティ比テーブルを探し出して、同探し出したデューティ比テーブル(図17(a)参照)内の第7状態ST7に対応したデューティ比をキーコードKC(i)と共に駆動制御部3cに出力する。駆動制御部3cは、キーコードKC(i)により表された鍵310に対応したアクチュエータ330を前記デューティ比に応じたPWM波形で通電制御する。ステップS133においては、オフディレイフラグOFDL(i)を“0”にリセットする。   In this state, the elapsed time TM (i) increases due to the execution of the key drive control processing program of FIGS. 12 to 15, and the key drive state ST (i) is the fifth time indicating the end of the fifth state ST5. When the value T5 is reached, the CPU 4 determines “NO” based on the off-delay flag OFDL (i) set to “1” in step S127 after the process of step S126 in FIG. The process of ~ S133 is executed. In step S130, the key driving state ST (i) is set to the seventh state ST7. In step S131, the elapsed time TM (i) is set to a sixth time value T6 (equal to the fifth time value T5) representing the start time of the seventh state ST7 (that is, the end time of the sixth state ST6). In step S132, the duty ratio table to which the key code KC (i) is assigned in advance is searched, and the duty ratio corresponding to the seventh state ST7 in the searched duty ratio table (see FIG. 17A) is obtained. It is output to the drive control unit 3c together with the key code KC (i). The drive control unit 3c controls energization of the actuator 330 corresponding to the key 310 represented by the key code KC (i) with a PWM waveform corresponding to the duty ratio. In step S133, the off-delay flag OFDL (i) is reset to “0”.

このような処理により、鍵駆動状態ST(i)が第1状態ST1〜第5状態ST5のいずれかである状態で、同一キーコードKCに関する駆動オフイベントデータが読み出されると、第5状態ST5の終了時まで待って、鍵駆動状態ST(i)は第6状態ST6を飛ばして第7状態ST7に変更される。したがってこの場合には、駆動オフイベントデータが読み出されてから、ハンマ体HMの質量部材323の後端部が上側ストッパ312により規制された状態になるまで待った後、鍵310およびハンマ体HMの原位置への復帰制御が開始されることになる。これにより、楽音信号の発生タイミングとは異なるものの、鍵310の押鍵動作および離鍵動作が確実に行われる。また、楽音信号の発生から短時間内に鍵310の離鍵動作が開始されるので、視覚的にも不自然ではない。   By such processing, when drive off event data relating to the same key code KC is read in a state in which the key drive state ST (i) is one of the first state ST1 to the fifth state ST5, the fifth state ST5 Waiting until the end, the key driving state ST (i) is changed to the seventh state ST7 by skipping the sixth state ST6. Therefore, in this case, after the drive-off event data is read, after waiting until the rear end portion of the mass member 323 of the hammer body HM is regulated by the upper stopper 312, the key 310 and the hammer body HM Return control to the original position is started. This ensures that the key 310 is depressed and released, although the timing of generating the tone signal is different. Further, since the key release operation of the key 310 is started within a short time after the musical sound signal is generated, it is not unnatural visually.

(B)駆動オン直後の駆動オフ・オン
この駆動オン直後の駆動オフ・オンは、具体的には、駆動オンイベントデータが鍵駆動用データ中から読み出された後、鍵駆動状態ST(i)が第6状態ST6に達する前に、前記駆動オンイベントデータと同一のキーコードKCを有する駆動オフイベントデータおよび駆動オンイベントデータが鍵駆動用データ中から読み出された場合である。この場合、前記「(A)駆動オン直後の駆動オフ」で説明したように、駆動オフイベントデータが読み出されたときに、図9のステップS36の処理により、オフディレイフラグOFDL(i)が“1”に設定される。そして、前記駆動オフイベントデータと同一のキーコードKCを有する駆動オンイベントデータが読み出されると、鍵310およびハンマ体HMは押鍵駆動状態にあり、鍵駆動用テーブル内には駆動オンイベントデータ中のキーコードKCを記憶したチャンネルchiが存在する。したがって、CPU4は、図8の鍵駆動イベント処理サブルーチンのステップS22にて“YES”と判定して、ステップS27、すなわち図10および図11の再打鍵処理サブルーチンのステップS41にて“YES”、すなわち駆動オンイベントデータに含まれるキーコードKCを記憶したチャンネルchiの鍵駆動状態ST(i)が第1状態ST1〜第5状態ST5のいずれかであると判定する。そして、CPU4は、ステップS42およびS43の処理により、前記チャンネルchiのオフディレイフラグOFDL(i)を“0”にリセットする。
(B) Driving off / on immediately after driving on The driving off / on immediately after driving on is specifically the key driving state ST (i after the driving on event data is read out from the key driving data. ) Before reaching the sixth state ST6, the drive-off event data and the drive-on event data having the same key code KC as the drive-on event data are read from the key drive data. In this case, as described in “(A) Drive OFF immediately after drive ON”, when the drive OFF event data is read, the OFF delay flag OFDL (i) is set by the process of step S36 in FIG. Set to “1”. When the drive on event data having the same key code KC as the drive off event data is read, the key 310 and the hammer body HM are in the key depression drive state, and the drive on event data is in the key drive table. There is a channel chi that stores the key code KC. Therefore, the CPU 4 determines “YES” in step S22 of the key drive event processing subroutine of FIG. 8, and determines “YES” in step S27, that is, step S41 of the rekeying processing subroutine of FIGS. It is determined that the key drive state ST (i) of the channel chi storing the key code KC included in the drive-on event data is one of the first state ST1 to the fifth state ST5. Then, the CPU 4 resets the off-delay flag OFDL (i) of the channel chi to “0” by the processing of steps S42 and S43.

したがって、この場合には、駆動オン直後の駆動オフイベントデータおよび駆動オンイベントデータがキャンセルされてしまい、鍵310およびハンマ体HMは短時間内で離鍵および押鍵動作することはない。これは、連打に関係した駆動オンイベントデータおよび駆動オフイベントデータに応答して鍵310およびハンマ体HMを駆動しても駆動に遅れが生じ、かつ最終的には鍵310およびハンマ体HMは押鍵状態に設定されるので、鍵310およびハンマ体HMを駆動しない方が自然に感じられるからである。   Therefore, in this case, the drive-off event data and the drive-on event data immediately after the drive is turned on are canceled, and the key 310 and the hammer body HM do not perform the key release and key press operations within a short time. This is because even if the key 310 and the hammer body HM are driven in response to the drive-on event data and the drive-off event data related to repeated hits, the drive is delayed, and finally the key 310 and the hammer body HM are pressed. This is because the key state is set, so that it is naturally felt that the key 310 and the hammer body HM are not driven.

(C)駆動オフ直後の駆動オン
この駆動オフ直後の駆動オンは、具体的には、駆動オンイベントデータが鍵駆動用データ中から読み出された後、鍵駆動状態ST(i)が第10状態ST10を終了する前に、当該駆動オフイベントデータと同一のキーコードKCを有する駆動オンイベントデータが鍵駆動用データ中から読み出された場合である。この場合、駆動オンイベントデータの読み出し時期が第7状態ST7から第10状態ST10のいずれに属するかにより制御が異なるので、これらを順次説明する。
(C) Drive-on immediately after drive-off This drive-on immediately after drive-off is specifically, after the drive-on event data is read from the key drive data, the key drive state ST (i) is the 10th. This is a case where drive on event data having the same key code KC as the drive off event data is read from the key drive data before the state ST10 is finished. In this case, the control differs depending on which of the seventh state ST7 to the tenth state ST10 the read timing of the drive on event data belongs to, and these will be sequentially described.

まず、駆動オンイベントデータが第7状態ST7で鍵駆動用データ中から読み出された場合について説明する。この場合、前記図10および図11の再打鍵処理サブルーチンにおいて、CPU4は、ステップS41にて“NO”と判定して、ステップS44にて同一鍵再打鍵フラグRSK(i)を“1”に設定する。そしてCPU4は、ステップS45にて“YES”、すなわち駆動オンイベントデータに含まれるキーコードKCを記憶したチャンネルchiの鍵駆動状態ST(i)が第7状態ST7であると判定して、ステップS46以降の処理を実行する。この場合、オフディレイフラグOFDL(i)は“0”に設定されているので、CPU4は、ステップS46にて“NO”と判定して、処理をステップS48に進める。CPU4は、ステップS48にて、鍵駆動状態ST(i)を第3R3状態ST3R3に設定するとともに、経過時間TM(i)を第3R3状態ST3R3の開始時(すなわち第3R2状態ST3R2の終了時)を表す第3R2時間値T3R2に設定する。そしてCPU4は、ステップS49にて、キーコードKC(i)が予め割当てられている再打鍵用デューティ比テーブルを探し出して、同探し出した再打鍵用デューティ比テーブル内の第3R3状態ST3R3に対応したデューティ比をキーコードKC(i)と共に駆動制御部3cに出力する。駆動制御部3cは、キーコードKC(i)により表された鍵310に対応したアクチュエータ330を前記デューティ比に応じたPWM波形で通電制御する。   First, the case where drive-on event data is read from the key drive data in the seventh state ST7 will be described. In this case, in the rekeying subroutine of FIGS. 10 and 11, the CPU 4 determines “NO” in step S41, and sets the same key rekey key RSK (i) to “1” in step S44. To do. Then, the CPU 4 determines “YES” in step S45, that is, the key drive state ST (i) of the channel chi storing the key code KC included in the drive-on event data is the seventh state ST7, and step S46. The subsequent processing is executed. In this case, since the off-delay flag OFDL (i) is set to “0”, the CPU 4 determines “NO” in the step S46, and advances the process to the step S48. In step S48, the CPU 4 sets the key driving state ST (i) to the third R3 state ST3R3 and sets the elapsed time TM (i) at the start of the third R3 state ST3R3 (ie, at the end of the third R2 state ST3R2). The third R2 time value to be represented is set to T3R2. In step S49, the CPU 4 searches for a rekey key duty ratio table to which the key code KC (i) is assigned in advance, and the duty corresponding to the third R3 state ST3R3 in the rekey key duty ratio table thus found. The ratio is output to the drive control unit 3c together with the key code KC (i). The drive control unit 3c controls energization of the actuator 330 corresponding to the key 310 represented by the key code KC (i) with a PWM waveform corresponding to the duty ratio.

図17(b)は、図17(a)の(基本動作用)デューティ比テーブルに対応する再打鍵用デューティ比テーブルの一例を示す図である。前述のように、(基本動作用)デューティ比テーブルは複数設けられ、各デューティ比テーブルにはいずれかの鍵310が予め割り当てられているが、これと同様にして、再打鍵用デューティ比テーブルも複数設けられ、各再打鍵用デューティ比テーブルにはいずれかの鍵310が予め割り当てられている。つまり、各再打鍵用デューティ比テーブルは、再打鍵専用のものとして、各(基本動作用)デューティ比テーブルとは別個に設けられ、たとえば前記ROM5または外部記憶装置9に予め記憶されている。したがって、図17(a)は、ある鍵310を通常打鍵で駆動制御するときに用いられる(基本動作用)デューティ比テーブルの一例を示し、図17(b)は、その鍵310を離鍵時の再打鍵で駆動制御するときに用いられる再打鍵用デューティ比テーブルの一例を示している。   FIG. 17B is a diagram illustrating an example of a rekey key duty ratio table corresponding to the duty ratio table (for basic operation) in FIG. As described above, a plurality of duty ratio tables (for basic operation) are provided, and any one of the keys 310 is assigned in advance to each duty ratio table. A plurality of keys 310 are assigned in advance to each rekey key duty ratio table. That is, each re-keying duty ratio table is dedicated to re-keying, provided separately from each (basic operation) duty ratio table, and stored in advance in the ROM 5 or the external storage device 9, for example. Accordingly, FIG. 17A shows an example of a duty ratio table (for basic operation) used when driving control of a certain key 310 with normal keystroke, and FIG. 4 shows an example of a rekey key duty ratio table used when driving control is performed with a rekey key.

前記ステップS49の処理が終了した後、図12〜図15の鍵駆動制御処理プログラムが実行されると、鍵駆動状態ST(i)は第3R3状態ST3R3、すなわち第3状態ST3(の一部)であるので、CPU4は、図12のステップS112にて“YES”と判定して、処理をステップS113に進める。このとき、同一鍵再打鍵フラグRSK(i)は前記ステップS44において“1”に設定されているので、CPU4は、ステップS113にて“YES”と判定して、ステップS118にて再打鍵鍵駆動制御処理サブルーチンを実行する。   When the key drive control processing program of FIGS. 12 to 15 is executed after the process of step S49 is completed, the key drive state ST (i) is the third R3 state ST3R3, that is, the third state ST3 (part thereof). Therefore, the CPU 4 determines “YES” in step S112 of FIG. 12, and advances the process to step S113. At this time, since the same key re-keying flag RSK (i) is set to “1” in step S44, the CPU 4 determines “YES” in step S113, and re-keying key driving in step S118. A control processing subroutine is executed.

再打鍵鍵駆動制御処理サブルーチンは、図16に詳細に示されている。その実行が開始されると、CPU4は、ステップS201にて、鍵駆動状態ST(i)が第3R1状態ST3R1であるか否か、ステップS205にて、鍵駆動状態ST(i)が第3R2状態ST3R2であるか否か、ステップS209にて、鍵駆動状態ST(i)が第3R3状態ST3R3であるか否かをそれぞれ判定する。この場合、鍵駆動状態ST(i)は第3R3状態ST3R3であるので、CPU4は、ステップS201にて“NO”と判定し、ステップS205にて“NO”と判定し、ステップS209にて“YES”と判定して、処理をステップS210に進める。ステップS210〜S213の処理は、前記図12の鍵駆動制御処理プログラムのステップS114〜S117の処理と同様であり、CPU4は、駆動制御部3cとの協働により、キーコードKC(i)により表された鍵310に対応したアクチュエータ330を、再打鍵用デューティ比テーブル(図17(b)参照)内の第3R3状態ST3R3に対応したデューティ比に応じたPWM波形で、第1スイッチSW1のオンイベントがスキャン部3dによって検出されるまで通電制御し、その後に(基本動作用)デューティ比テーブル(図17(a)参照)内の第4状態ST4に対応したデューティ比に応じたPWM波形の通電制御に切換える。そしてCPU4は、ステップS214にて同一鍵再打鍵フラグRSK(i)を“0”にリセットする。   The rekey key drive control processing subroutine is shown in detail in FIG. When the execution is started, the CPU 4 determines in step S201 whether or not the key driving state ST (i) is in the third R1 state ST3R1, and in step S205, the key driving state ST (i) is in the third R2 state. In step S209, it is determined whether the key driving state ST (i) is the third R3 state ST3R3. In this case, since the key driving state ST (i) is the third R3 state ST3R3, the CPU 4 determines “NO” in step S201, determines “NO” in step S205, and “YES” in step S209. Is determined, and the process proceeds to step S210. The processing of steps S210 to S213 is the same as the processing of steps S114 to S117 of the key drive control processing program of FIG. 12, and the CPU 4 is represented by the key code KC (i) in cooperation with the drive control unit 3c. The on-event of the first switch SW1 with the PWM waveform corresponding to the duty ratio corresponding to the third R3 state ST3R3 in the rekey key duty ratio table (see FIG. 17 (b)). Is controlled until the current is detected by the scanning unit 3d, and then the PWM waveform energization control according to the duty ratio corresponding to the fourth state ST4 in the duty ratio table (for basic operation) (see FIG. 17A). Switch to. In step S214, the CPU 4 resets the same key re-keying flag RSK (i) to “0”.

このような処理により、鍵駆動状態ST(i)が第7状態ST7で、同一キーコードKCに関する駆動オンイベントデータが読み出されると、鍵駆動状態ST(i)が第3R3状態ST3R3に変更される。したがって、この場合には、駆動オフイベントデータの読み出し直後の駆動オンイベントデータの読み出しにより、鍵310およびハンマ体HMは離鍵動作を中止して、ただちに押鍵動作を行う。これにより、楽音信号の発生タイミングと鍵310が離鍵動作から押鍵動作に切換わるタイミングとがほぼ一致し、視覚的にも自然に感じられる。   By such processing, when the key driving state ST (i) is the seventh state ST7 and the driving on event data relating to the same key code KC is read, the key driving state ST (i) is changed to the third R3 state ST3R3. . Accordingly, in this case, the key 310 and the hammer body HM stop the key release operation and immediately perform the key pressing operation by reading the drive on event data immediately after the read of the drive off event data. As a result, the generation timing of the musical sound signal and the timing at which the key 310 is switched from the key release operation to the key press operation are substantially the same, and it can be felt visually and naturally.

次に、駆動オンイベントデータが第8状態ST8で鍵駆動用データ中から読み出された場合について説明する。この場合、前記図10および図11の再打鍵処理サブルーチンにおいて、CPU4は、ステップS50にて“YES”、すなわち駆動オンイベントデータに含まれるキーコードKCを記憶したチャンネルchiの鍵駆動状態ST(i)が第8状態ST8であると判定して、ステップS51およびS52の処理を実行する。ステップS51においては、CPU4は、鍵駆動状態ST(i)を第3R2状態ST3R2に設定するとともに、経過時間TM(i)を第3R1状態ST3R1の終了時を表す第3R1時間値T3R1に設定する。ステップS52においては、CPU4は、駆動オンイベントデータに含まれているキーコードKCが予め割当てられている再打鍵用デューティ比テーブルを探し出して、同探し出した再打鍵用デューティ比テーブル(図17(b)参照)内の第3R2状態ST3R2に対応したデューティ比をキーコードKC(i)と共に駆動制御部3cに出力する。駆動制御部3cは、キーコードKCにより表された鍵310に対応したアクチュエータ330を前記デューティ比に応じたPWM波形で通電制御する。   Next, a case where drive-on event data is read from the key drive data in the eighth state ST8 will be described. In this case, in the rekeying subroutine of FIG. 10 and FIG. 11, the CPU 4 determines “YES” in step S50, that is, the key driving state ST (i of the channel chi storing the key code KC included in the driving on event data. ) Is in the eighth state ST8, and the processes of steps S51 and S52 are executed. In step S51, the CPU 4 sets the key driving state ST (i) to the third R2 state ST3R2, and sets the elapsed time TM (i) to the third R1 time value T3R1 representing the end of the third R1 state ST3R1. In step S52, the CPU 4 searches for a rekeying duty ratio table to which the key code KC included in the drive-on event data is assigned in advance, and the rekeyed duty ratio table (FIG. 17B). The duty ratio corresponding to the third R2 state ST3R2 is output to the drive control unit 3c together with the key code KC (i). The drive control unit 3c controls energization of the actuator 330 corresponding to the key 310 represented by the key code KC with a PWM waveform corresponding to the duty ratio.

この状態で、図12〜図15の鍵駆動制御処理プログラムが実行されると、鍵駆動状態ST(i)は第3R2状態ST3R2、すなわち第3状態ST3(の一部)であるので、CPU4は、図12のステップS112にて“YES”と判定して、処理をステップS113に進める。このとき、同一鍵再打鍵フラグRSK(i)は前記ステップS44において“1”に設定されているので、CPU4は、ステップS113にて“YES”と判定して、ステップS118にて再打鍵鍵駆動制御処理サブルーチンを実行する。   When the key drive control processing program of FIGS. 12 to 15 is executed in this state, the key drive state ST (i) is the third R2 state ST3R2, that is, the third state ST3 (a part thereof). Then, “YES” is determined in step S112 in FIG. 12, and the process proceeds to step S113. At this time, since the same key re-keying flag RSK (i) is set to “1” in step S44, the CPU 4 determines “YES” in step S113, and re-keying key driving in step S118. A control processing subroutine is executed.

前記図16の再打鍵鍵駆動制御処理サブルーチンでは、CPU4は、ステップS205にて“YES”と判定して、処理をステップS206に進める。CPU4は、ステップS206にて、経過時間TM(i)が第3R2状態ST3R2の終了タイミングを示す所定の第3R2時間値T3R2(図17(b)参照)以上であるか否かを判定する。経過時間TM(i)が第3R2時間値T3R2以上でなければ、CPU4は、ステップS206にて“NO”と判定して、この再打鍵鍵駆動制御処理サブルーチンを終了する。そして、鍵駆動制御処理プログラムが再び実行されても、経過時間TM(i)が第3R2時間値T3R2以上になるまで、前記処理を繰り返す。この繰り返し処理中、駆動制御部3cは、図10のステップS52の処理によって供給されたデューティ比に応じたPWM波形で、キーコードKC(i)により表されたアクチュエータ330を通電制御し続ける。   In the rekey key drive control processing subroutine of FIG. 16, the CPU 4 determines “YES” in the step S205, and advances the process to a step S206. In step S206, the CPU 4 determines whether or not the elapsed time TM (i) is equal to or greater than a predetermined third R2 time value T3R2 (see FIG. 17B) indicating the end timing of the third R2 state ST3R2. If the elapsed time TM (i) is not equal to or greater than the third R2 time value T3R2, the CPU 4 determines “NO” in step S206 and ends the rekey key drive control processing subroutine. Even when the key drive control processing program is executed again, the above process is repeated until the elapsed time TM (i) becomes equal to or greater than the third R2 time value T3R2. During this repetitive process, the drive control unit 3c continues energization control of the actuator 330 represented by the key code KC (i) with a PWM waveform corresponding to the duty ratio supplied by the process of step S52 of FIG.

一方、前記図12のステップS103の加算処理により、経過時間TM(i)が第3R2時間値T3R2以上になると、CPU4は、ステップS206にて“YES”と判定して、ステップS207にて鍵駆動状態ST(i)を第3R3状態ST3R3に変更する。そして、CPU4は、ステップS208にて、キーコードKC(i)が予め割当てられている再打鍵用デューティ比テーブルを探し出して、同探し出した再打鍵用デューティ比テーブル(図17(b)参照)内の第3R3状態ST3R3に対応したデューティ比をキーコードKC(i)と共に駆動制御部3cに出力する。駆動制御部3cは、キーコードKC(i)により表された鍵310に対応したアクチュエータ330を前記デューティ比に応じたPWM波形で通電制御する。前記ステップS208の処理後、CPU4は、この再打鍵鍵駆動制御処理サブルーチンを終了する。   On the other hand, when the elapsed time TM (i) becomes equal to or greater than the third R2 time value T3R2 by the addition process in step S103 of FIG. 12, the CPU 4 determines “YES” in step S206, and performs key drive in step S207. The state ST (i) is changed to the third R3 state ST3R3. In step S208, the CPU 4 searches for a rekey key duty ratio table to which the key code KC (i) is assigned in advance, and finds the rekey key duty ratio table (see FIG. 17B). The duty ratio corresponding to the third R3 state ST3R3 is output to the drive control unit 3c together with the key code KC (i). The drive control unit 3c controls energization of the actuator 330 corresponding to the key 310 represented by the key code KC (i) with a PWM waveform corresponding to the duty ratio. After the process of step S208, the CPU 4 ends the rekey key drive control process subroutine.

次にこの鍵駆動制御処理プログラムが実行されると、鍵駆動状態ST(i)は第3R3状態ST3R3であるので、CPU4は、前記ステップS209にて“YES”と判定して、前記ステップS210〜S214の処理を実行する。   Next, when this key drive control processing program is executed, since the key drive state ST (i) is the third R3 state ST3R3, the CPU 4 determines “YES” in the step S209, and the steps S210 to S210. The process of S214 is executed.

このような処理により、鍵駆動状態ST(i)が第8状態ST8で、同一キーコードKCに関する駆動オンイベントデータが読み出されると、鍵駆動状態ST(i)が第3R2状態ST3R2に変更される。したがって、この場合にも、駆動オフイベントデータの読み出し直後の駆動オンイベントデータの読み出しにより、鍵310およびハンマ体HMは離鍵動作を中止して、ただちに押鍵動作を行う。ただしこの場合には、第2スイッチSW2は既にオフ状態にあり、鍵310およびハンマ体HMは離鍵動作がある程度完了した後に、押鍵動作に入る。これにより、楽音信号の発生タイミングとは異なるものの、鍵310の離鍵動作および押鍵動作が確実に行われ、視覚的にも不自然ではない。   With this process, when the key driving state ST (i) is the eighth state ST8 and the driving on event data relating to the same key code KC is read, the key driving state ST (i) is changed to the third R2 state ST3R2. . Therefore, also in this case, the key 310 and the hammer body HM stop the key release operation and immediately perform the key pressing operation by reading the drive on event data immediately after reading the drive off event data. However, in this case, the second switch SW2 is already in the OFF state, and the key 310 and the hammer body HM enter the key pressing operation after the key releasing operation is completed to some extent. Thereby, although the timing of generating the tone signal is different, the key release operation and the key press operation of the key 310 are surely performed, and it is not unnatural visually.

次に、駆動オンイベントデータが第9状態ST9で鍵駆動用データ中から読み出された場合について説明する。この場合、前記図10および図11の再打鍵処理サブルーチンにおいて、CPU4は、ステップS53にて“YES”、すなわち駆動オンイベントデータに含まれるキーコードKCを記憶したチャンネルchiの鍵駆動状態ST(i)が第9状態ST9であると判定して、前記ステップS51およびS52の処理と同様なステップS54およびS55の処理を実行する。その後、CPU4は、前記図16の再打鍵鍵駆動制御処理サブルーチンにおいて、前記ステップS206〜S208の処理と同様のステップS202〜S204の処理を実行し、さらに前記ステップS205〜S214の処理を実行する。これによりCPU4は、駆動制御部3cとの協働により、キーコードKC(i)により表された鍵310に対応したアクチュエータ330を、再打鍵用デューティ比テーブル内の第3R1状態ST3R1に対応したデューティ比に応じたPWM波形で、経過時間TM(i)が第3R1時間値T3R1になるまで通電制御した後、再打鍵用デューティ比テーブル内の第3R2状態ST3R2に対応したデューティ比に応じたPWM波形の通電制御に切換え、そのPWM波形で、経過時間TM(i)が第3R2時間値T3R2になるまで通電制御し、さらに再打鍵用デューティ比テーブル内の第3R3状態ST3R3に対応したデューティ比に応じたPWM波形の通電制御に切換え、そのPWM波形で、経過時間TM(i)が第3時間値T3になるまで通電制御する。   Next, a case where drive-on event data is read from the key drive data in the ninth state ST9 will be described. In this case, in the rekeying subroutine of FIG. 10 and FIG. 11, the CPU 4 determines “YES” in step S53, that is, the key driving state ST (i of the channel chi storing the key code KC included in the driving on event data. ) Is in the ninth state ST9, and the processes of steps S54 and S55 similar to the processes of steps S51 and S52 are executed. Thereafter, in the rekey key drive control processing subroutine of FIG. 16, the CPU 4 executes the processes of steps S202 to S204 similar to the processes of steps S206 to S208, and further executes the processes of steps S205 to S214. Thus, the CPU 4 cooperates with the drive control unit 3c to change the actuator 330 corresponding to the key 310 represented by the key code KC (i) to the duty corresponding to the third R1 state ST3R1 in the rekey key duty ratio table. After the energization control is performed until the elapsed time TM (i) reaches the third R1 time value T3R1, the PWM waveform corresponding to the duty ratio corresponding to the third R2 state ST3R2 in the rekey key duty ratio table. In the PWM waveform, the energization control is performed until the elapsed time TM (i) reaches the third R2 time value T3R2, and the duty ratio corresponding to the third R3 state ST3R3 in the rekey key duty ratio table is determined. Switch to energization control of the PWM waveform, and energize with the PWM waveform until the elapsed time TM (i) reaches the third time value T3. To your.

このような処理により、鍵駆動状態ST(i)が第9状態ST9で、同一キーコードKCに関する駆動オンイベントデータが読み出されると、鍵駆動状態ST(i)が第3R1状態ST3R1に変更される。したがって、この場合にも、駆動オフイベントデータの読み出し直後の駆動オンイベントデータの読み出しにより、鍵310およびハンマ体HMは離鍵動作を中止して、ただちに押鍵動作を行う。ただしこの場合には、第2スイッチSW2に加え第1スイッチSW1も既にオフ状態にあり、鍵310およびハンマ体HMは離鍵動作がさらにある程度完了した後に、押鍵動作に入る。これにより、楽音信号の発生タイミングとは異なるものの、鍵310の離鍵動作および押鍵動作が確実に行われ、視覚的にも不自然ではない。   By such processing, when the key driving state ST (i) is the ninth state ST9 and the driving on event data relating to the same key code KC is read, the key driving state ST (i) is changed to the third R1 state ST3R1. . Therefore, also in this case, the key 310 and the hammer body HM stop the key release operation and immediately perform the key pressing operation by reading the drive on event data immediately after reading the drive off event data. However, in this case, in addition to the second switch SW2, the first switch SW1 is already in the OFF state, and the key 310 and the hammer body HM enter the key pressing operation after the key release operation is further completed to some extent. Thereby, although the timing of generating the tone signal is different, the key release operation and the key press operation of the key 310 are surely performed, and it is not unnatural visually.

次に、駆動オンイベントデータが第10状態ST10で鍵駆動用データ中から読み出された場合について説明する。この場合、前記図10および図11の再打鍵処理サブルーチンにおいて、CPU4は、ステップS56にて“YES”、すなわち駆動オンイベントデータに含まれるキーコードKCを記憶したチャンネルchiの鍵駆動状態ST(i)が第10状態ST10であると判定して、ステップS57以降の処理を実行する。この場合、オフディレイフラグOFDL(i)は“0”に設定されているので、CPU4は、ステップS57にて“NO”と判定して、ステップS59にてオンディレイフラグONDL(i)を“1”に設定し、ステップS60にて同一鍵再打鍵フラグRSK(i)を“0”にリセットする。そして、経過時間TM(i)が第10状態ST10の終了時に達すると、CPU4は、前記図15の鍵駆動制御処理プログラムのステップS151にて“NO”、すなわちオンディレイフラグONDL(i)が“0”でないと判定して、ステップS154以降の処理を実行する。   Next, a case where drive-on event data is read from the key drive data in the tenth state ST10 will be described. In this case, in the rekeying subroutine shown in FIGS. 10 and 11, the CPU 4 determines “YES” in step S56, that is, the key driving state ST (i of the channel chi storing the key code KC included in the driving on event data. ) Is in the tenth state ST10, and the processes in and after step S57 are executed. In this case, since the off-delay flag OFDL (i) is set to “0”, the CPU 4 determines “NO” in step S57, and sets the on-delay flag ONDL (i) to “1” in step S59. In step S60, the same key re-key key RSK (i) is reset to “0”. When the elapsed time TM (i) reaches the end of the tenth state ST10, the CPU 4 determines “NO” in step S151 of the key drive control processing program of FIG. 15, that is, the on-delay flag ONDL (i) is “ It determines with it not being 0 ", and the process after step S154 is performed.

CPU4は、ステップS154にて鍵駆動状態ST(i)を第2状態ST2に設定し、ステップS155にて経過時間TM(i)を第1状態ST1の終了時を表す時間値T1に設定する。そしてCPU4は、ステップS156にて、駆動オンイベントデータに含まれているキーコードKCが予め割当てられているデューティ比テーブルを探し出して、同探し出したデューティ比テーブル(図17(a)参照)内の第2状態ST2に対応したデューティ比をキーコードKCと共に駆動制御部3cに出力する。さらにCPU4は、ステップS157にてオンディレイフラグONDL(i)を“0”にリセットしておく。駆動制御部3cは、キーコードKCにより表された鍵310に対応したアクチュエータ330を前記デューティ比に応じたPWM波形で通電制御する。   In step S154, the CPU 4 sets the key driving state ST (i) to the second state ST2, and in step S155, sets the elapsed time TM (i) to a time value T1 representing the end of the first state ST1. In step S156, the CPU 4 searches for a duty ratio table to which the key code KC included in the drive-on event data is pre-assigned, and within the searched duty ratio table (see FIG. 17A). The duty ratio corresponding to the second state ST2 is output to the drive control unit 3c together with the key code KC. Further, the CPU 4 resets the on-delay flag ONDL (i) to “0” in step S157. The drive control unit 3c controls energization of the actuator 330 corresponding to the key 310 represented by the key code KC with a PWM waveform corresponding to the duty ratio.

このような処理により、鍵駆動状態ST(i)が第10状態ST10で、同一キーコードKCに関する駆動オンイベントデータが読み出されると、鍵駆動状態ST(i)が第10状態ST10を終了するまで待って、鍵駆動状態ST(i)が第2状態ST2に変更される。したがって、この場合には、駆動オフイベントデータの読み出し直後の駆動オンイベントデータの読み出しにより、鍵310およびハンマ体HMは、離鍵動作の終了後、鍵駆動状態ST(i)の途中から(第1状態ST1からではなく、第2状態ST2から)押鍵動作に入る。これにより、楽音信号の発生タイミングとは僅かに異なるものの、鍵310の離鍵動作および押鍵動作が確実に行われ、視覚的にも不自然ではない。   By such processing, when the key-on state ST (i) is in the tenth state ST10 and the drive-on event data related to the same key code KC is read, the key-driving state ST (i) is finished in the tenth state ST10. After waiting, the key driving state ST (i) is changed to the second state ST2. Therefore, in this case, the key 310 and the hammer body HM are read from the middle of the key drive state ST (i) after the key release operation is completed by reading the drive on event data immediately after the drive off event data is read (the first operation). The key-pressing operation is entered from the second state ST2 (not from the first state ST1). Thereby, although slightly different from the generation timing of the musical tone signal, the key releasing operation and the key pressing operation of the key 310 are surely performed, and it is not unnatural visually.

このように、駆動オフイベントデータの読み出しの直後に駆動オンイベントデータが読み出された場合には、読み出しのタイミングが第7〜第10状態ST7〜ST10のいずれの状態にあるかにより、鍵310およびハンマ体HMを駆動するために、第2状態ST2および第3R1〜第3R3状態ST3R1〜ST3R3のうち、特定の1つの状態に戻るようにした。これは、ハンマ体HMの質量部材323の後部が下側ストッパ313に近づくほど大きな推力で質量部材323を押し上げる必要があり、そのために、駆動オンイベントデータの読み出しタイミングが第10状態ST10に近づくほど、鍵310およびハンマ体HMを駆動するためのアクチュエータ330による推力を大きくするためである。したがって、駆動オフイベントデータの読み出し直後の駆動オンイベントデータによる鍵310およびハンマ体HMの押鍵動作が適切に行われる。このような理由により、デューティ比テーブルおよび再打鍵用デューティ比テーブル内のデューティ比は、第2状態ST2から第3R3状態ST3R3にわたって、段階的に少しずつ下げられている。また、第7〜第9状態ST7〜ST9のいずれかから戻るときには、(基本動作用)デューティ比テーブルではなく再打鍵用デューティ比テーブルを用いるようにしたので、再打鍵時の鍵の駆動制御をより安定化することができる。なお、前記特許文献1に記載の発明では、(基本動作用)デューティ比テーブルのみ設け、そのデューティ比テーブルの第3状態ST3を3つに分割して第3〜第5状態ST3〜ST5とし、再打鍵時には、第7〜第9状態ST7〜ST9(特許文献1では、第9〜第11状態ST9〜ST11)から第3〜第5状態ST3〜ST5のうち、特定の1つの状態に戻るようにした、すなわち、基本動作時には必要とされない第3状態ST3のより細かな分割を行って、再打鍵時に備えるようにしたので、通常打鍵時(基本動作時)の鍵の駆動制御は多少なりとも犠牲にされていた。本発明では、この通常打鍵時の鍵の駆動制御も最適化することができる。   As described above, when the drive-on event data is read out immediately after the drive-off event data is read, the key 310 depends on whether the read timing is in the seventh to tenth states ST7 to ST10. In order to drive the hammer body HM, the second state ST2 and the third R1 to third R3 states ST3R1 to ST3R3 are returned to a specific one state. This is because it is necessary to push up the mass member 323 with a larger thrust as the rear part of the mass member 323 of the hammer body HM approaches the lower stopper 313. For this reason, the read timing of the drive-on event data approaches the tenth state ST10. This is because the thrust by the actuator 330 for driving the key 310 and the hammer body HM is increased. Therefore, the key pressing operation of the key 310 and the hammer body HM by the drive on event data immediately after the read of the drive off event data is appropriately performed. For this reason, the duty ratios in the duty ratio table and the rekey key duty ratio table are gradually reduced from the second state ST2 to the third R3 state ST3R3. Further, when returning from any of the seventh to ninth states ST7 to ST9, the keystroke duty ratio table is used instead of the duty ratio table (for basic operation). It can be more stabilized. In the invention described in Patent Document 1, only the duty ratio table (for basic operation) is provided, and the third state ST3 of the duty ratio table is divided into three to be the third to fifth states ST3 to ST5, At the time of re-keying, the seventh to ninth states ST7 to ST9 (in Patent Document 1, the ninth to eleventh states ST9 to ST11) return to a specific one of the third to fifth states ST3 to ST5. In other words, since the third state ST3, which is not required during the basic operation, is divided more finely and prepared for re-keying, the key drive control at the time of normal key pressing (basic operation) is somewhat Had been sacrificed. In the present invention, it is possible to optimize the key drive control at the time of the normal keystroke.

(D)駆動オフ直後の駆動オン・オフ
この駆動オフ直後の駆動オン・オフは、具体的には、鍵駆動状態ST(i)が第7〜第10状態ST7〜ST10のいずれかにあるときに駆動オンイベントデータが鍵駆動用データ中から読み出され、第7〜第10状態ST7〜ST10のいずれかから第2状態ST2および第3R1〜第3R3状態ST3R1〜ST3R3のうち、特定の1つの状態に切換わる前に、さらに駆動オフイベントデータが鍵駆動用データ中から読み出された場合である。
(D) Driving On / Off Immediately after Driving Off This driving on / off immediately after driving off is specifically when the key driving state ST (i) is in any of the seventh to tenth states ST7 to ST10. The drive-on event data is read out from the key drive data, and one of the seventh to tenth states ST7 to ST10 is selected from the second state ST2 and the third R1 to third R3 states ST3R1 to ST3R3. This is a case where the driving off event data is read from the key driving data before switching to the state.

まず、鍵駆動状態ST(i)が第7状態ST7にあるときに駆動オンイベントデータが鍵駆動用データ中から読み出され、その直後に駆動オフイベントデータが鍵駆動用データ中から読み出された場合について説明する。この場合、前記「(C)駆動オフ直後の駆動オン」で説明したように、駆動オンイベントデータの読み出し時に、図10のステップS44の処理により、同一鍵再打鍵フラグRSK(i)が“1”に設定される。そして、この状態で、前記駆動オンイベントデータと同一のキーコードKCを有する駆動オフイベントデータが読み出されると、前記図9の鍵駆動オフ処理サブルーチンにおいて、CPU4は、ステップS32にて“NO”と判定し、ステップS35にて“NO”と判定して、この鍵駆動オフ処理サブルーチンを終了するので、特に何もしない。すなわち、この駆動オフイベントデータの読み出しは無視(キャンセル)される。したがって、この場合の鍵駆動制御処理は、前記「(C)駆動オフ直後の駆動オン」における、「鍵駆動状態ST(i)が第7状態ST7であるときに駆動オンイベントデータが鍵駆動用データ中から読み出された場合」の鍵駆動制御処理に一致する。   First, when the key driving state ST (i) is in the seventh state ST7, the driving on event data is read from the key driving data, and immediately after that, the driving off event data is read from the key driving data. The case will be described. In this case, as described in “(C) Driving on immediately after driving off”, the same key re-keying flag RSK (i) is set to “1” by the process of step S44 in FIG. "Is set. In this state, when drive-off event data having the same key code KC as the drive-on event data is read, in the key drive-off process subroutine of FIG. 9, the CPU 4 determines “NO” in step S32. In step S35, “NO” is determined, and this key driving off processing subroutine is terminated. That is, the reading of the drive-off event data is ignored (cancelled). Accordingly, the key drive control process in this case is performed when the “drive on event data for the key drive” is “when the key drive state ST (i) is the seventh state ST7” in “(C) drive on immediately after drive off”. This corresponds to the key drive control process “when read from the data”.

次に、鍵駆動状態ST(i)が第8〜第10状態ST8〜ST10のいずれかにあるときに駆動オンイベントデータが鍵駆動用データ中から読み出され、その直後に駆動オフイベントデータが鍵駆動用データ中から読み出された場合についても、最後の駆動オフイベントデータの読み出しは無視されるので、この場合の鍵駆動制御処理は、前記「(C)駆動オフ直後の駆動オン」における、「鍵駆動状態ST(i)が第8〜第10状態ST8〜ST10のいずれかであるときに駆動オンイベントデータが鍵駆動用データ中から読み出された場合」の鍵駆動制御処理に一致する。   Next, when the key driving state ST (i) is in any of the eighth to tenth states ST8 to ST10, the driving on event data is read from the key driving data, and immediately after that, the driving off event data is stored. Even when read from the key driving data, the reading of the last driving off event data is ignored, so the key driving control process in this case is the same as that in “(C) Driving on immediately after driving off”. The key drive control process coincides with “when the drive on event data is read from the key drive data when the key drive state ST (i) is any of the eighth to tenth states ST8 to ST10”. To do.

(E)駆動オフ直後の駆動オン・オフ・オン
この駆動オフ直後の駆動オン・オフ・オンは、具体的には、鍵駆動状態ST(i)が第7〜第10状態ST7〜ST10のいずれかにあるときに駆動オンイベントデータおよび駆動オフイベントデータが鍵駆動用データ中から順次読み出され、第7〜第10状態ST7〜ST10のいずれかから第2状態ST2および第3R1〜第3R3状態ST3R1〜ST3R3のうち、特定の1つの状態に切換わる前に、さらに駆動オンイベントデータが鍵駆動用データ中から読み出された場合である。
(E) Driving on / off / on immediately after driving off The driving on / off / on immediately after driving off is specifically the key driving state ST (i) in any of the seventh to tenth states ST7 to ST10. Drive on event data and drive off event data are sequentially read out from the key driving data, and the second state ST2 and the third R1 to third R3 states from any of the seventh to tenth states ST7 to ST10. This is a case where drive-on event data is further read from the key drive data before switching to a specific one of ST3R1 to ST3R3.

まず、鍵駆動状態ST(i)が第7状態ST7にあるときに駆動オンイベントデータおよび駆動オフイベントデータが読み出され、その直後に駆動オンイベントデータが読み出された場合については、前記「(D)駆動オフ直後の駆動オン・オフ」で説明したように、前の駆動オンイベントデータの読み出し時に、前記図10のステップS44の処理により、同一鍵再打鍵フラグRSK(i)が“1”に設定され、駆動オフイベントデータの読み出し時には、特に何もされない。   First, when the drive on event data and the drive off event data are read out when the key drive state ST (i) is in the seventh state ST7, and the drive on event data is read out immediately thereafter, the above-mentioned “ As described in (D) Driving ON / OFF Immediately after Driving OFF, the same key re-keying flag RSK (i) is set to “1” by the process of step S44 of FIG. When the drive-off event data is read out, nothing is done.

その後、駆動オンイベントデータの読み出しにより、CPU4は、前記図10の再打鍵処理サブルーチンにおいて、前の駆動オンイベントデータの読み出し時に実行した処理と同様の処理を行う。すなわち、後の駆動オフイベントデータおよび駆動オンイベントデータの各読み出しは無視される。したがって、この場合の鍵駆動制御処理は、前記「(C)駆動オフ直後の駆動オン」における、「鍵駆動状態ST(i)が第7状態ST7であるときに駆動オンイベントデータが鍵駆動用データ中から読み出された場合」の鍵駆動制御処理に一致する。   Thereafter, by reading the drive-on event data, the CPU 4 performs the same process as the process executed at the time of reading the previous drive-on event data in the rekeying subroutine of FIG. That is, each subsequent read of the drive-off event data and drive-on event data is ignored. Accordingly, the key drive control process in this case is performed when the “drive on event data for the key drive” is “when the key drive state ST (i) is the seventh state ST7” in “(C) drive on immediately after drive off”. This corresponds to the key drive control process “when read from the data”.

次に、鍵駆動状態ST(i)が第8〜第10状態ST8〜ST10のいずれかにあるときに駆動オンイベントデータおよび駆動オフイベントデータが読み出され、その直後に駆動オンイベントデータが読み出された場合についても、後の駆動オフイベントデータおよび駆動オンイベントデータの各読み出しは無視されるので、この場合の鍵駆動制御処理は、前記「(C)駆動オフ直後の駆動オン」における、「鍵駆動状態ST(i)が第8〜第10状態ST8〜ST10のいずれかであるときに駆動オンイベントデータが鍵駆動用データ中から読み出された場合」の鍵駆動制御処理に一致する。   Next, when the key drive state ST (i) is in any of the eighth to tenth states ST8 to ST10, the drive on event data and the drive off event data are read, and immediately after that, the drive on event data is read. Even in the case of the output, since the subsequent reading of the drive-off event data and the drive-on event data is ignored, the key drive control process in this case is the “(C) Drive-on immediately after drive-off”. This coincides with the key drive control process of “when the drive on event data is read from the key drive data when the key drive state ST (i) is any of the eighth to tenth states ST8 to ST10”. .

(第2の実施の形態)
以下、本発明の第2の実施の形態に係る制御装置を適用した電子ピアノについて説明する。
(Second Embodiment)
Hereinafter, an electronic piano to which the control device according to the second embodiment of the present invention is applied will be described.

本実施の形態の電子ピアノは、上記第1の実施の形態の電子ピアノに対して、制御処理の一部、具体的には、鍵駆動状態ST(i)が第7〜第9状態ST7〜ST9のいずれかにあるときに駆動オンイベントデータが鍵駆動用データ中から読み出された場合の制御処理が異なるのみであるので、そのハードウェアは、上記第1の実施の形態の電子ピアノと同様のハードウェア、すなわち図1〜図5に記載のものをそのまま使用することにする。   The electronic piano of the present embodiment is a part of the control process, specifically, the key driving state ST (i) is in the seventh to ninth states ST7 to ST7 to the electronic piano of the first embodiment. Since only the control process when the drive-on event data is read from the key drive data when in any of ST9 is different, the hardware is different from the electronic piano of the first embodiment. Similar hardware, that is, those shown in FIGS. 1 to 5 will be used as they are.

本実施の形態の制御処理と上記第1の実施の形態の制御処理との違いは、上記第1の実施の形態における連打条件(A)〜(E)のうち、「駆動オフ直後の駆動オン」が含まれる連打条件(C)〜(E)で現れる。そして、連打条件(D)および(E)がそれぞれ成立したときになされる各「同一鍵連打動作」は、上記第1の実施の形態で説明したように、連打条件(C)が成立したときになされる「同一鍵連打動作」とほぼ同様であるので、以下、連打条件(C)が成立したときの「同一鍵連打動作」だけを例に挙げて、本実施の形態の制御処理を説明する。   The difference between the control process of the present embodiment and the control process of the first embodiment is that, among the repeated hitting conditions (A) to (E) in the first embodiment, “drive on immediately after drive off”. ”Appears in consecutive hit conditions (C) to (E). Then, each “same key continuous hitting operation” performed when the continuous hitting conditions (D) and (E) are satisfied is the same as that when the continuous hitting condition (C) is satisfied as described in the first embodiment. This is almost the same as the “same key repetitive operation” performed, and therefore, the control processing of the present embodiment will be described below by taking only “same key repetitive operation” when the continuous repetitive condition (C) is satisfied as an example. To do.

まず、駆動オンイベントデータが第7状態ST7で鍵駆動用データ中から読み出された場合について説明する。この場合、図18および図19の再打鍵処理サブルーチン(同図中、前記図10および図11中のステップと同一処理を行うステップには、同一ステップ番号が付されている)において、CPU4は、ステップS41にて“NO”と判定して、ステップS44にて同一鍵再打鍵フラグRSK(i)を“1”に設定する。そしてCPU4は、ステップS45にて“YES”と判定して、ステップS71にて同一鍵再打鍵AフラグRSKA(i)を“1”に設定する。ここで同一鍵再打鍵AフラグRSKA(i)は、駆動オフイベントデータが読み出されてから鍵駆動状態ST(i)が第7状態ST7にあるときに、同一鍵の駆動オンイベントデータが読み出された場合に発生する再打鍵パターンA制御の状態を表すフラグであり、“1”により再打鍵パターンA制御状態を表し、“0”により再打鍵パターンA非制御状態を表す。さらにCPU4は、前記図10のステップS46およびS47の処理と同様の処理を実行した後、処理をステップS72に進める。CPU4は、ステップS72にて、鍵駆動状態ST(i)を第3状態STA3に設定するとともに、経過時間TM(i)を第3状態STA3の開始時を表す第2時間値TA2に設定する。そしてCPU4は、ステップS73にて、キーコードKC(i)が予め割当てられている再打鍵用デューティ比テーブルAを探し出して、同探し出した再打鍵用デューティ比テーブルA内の第3状態STA3に対応したデューティ比をキーコードKC(i)と共に駆動制御部3cに出力する。駆動制御部3cは、キーコードKC(i)により表された鍵310に対応したアクチュエータ330を前記デューティ比に応じたPWM波形で通電制御する。   First, the case where drive-on event data is read from the key drive data in the seventh state ST7 will be described. In this case, in the rekeying subroutine shown in FIGS. 18 and 19 (in FIG. 18, steps that perform the same processes as those in FIGS. 10 and 11 are given the same step numbers), the CPU 4 In step S41, “NO” is determined, and in step S44, the same key re-keying flag RSK (i) is set to “1”. Then, the CPU 4 determines “YES” in the step S45, and sets the same key re-keying A flag RSKA (i) to “1” in a step S71. Here, the same key re-keying A flag RSKA (i) is read when the key driving state ST (i) is in the seventh state ST7 after the driving off event data is read. This is a flag indicating the state of the rekeying pattern A control that occurs when the key is issued. “1” represents the rekeying pattern A control state, and “0” represents the rekeying pattern A non-control state. Further, after executing the same processing as the processing in steps S46 and S47 in FIG. 10, the CPU 4 advances the processing to step S72. In step S72, the CPU 4 sets the key driving state ST (i) to the third state STA3 and sets the elapsed time TM (i) to the second time value TA2 representing the start time of the third state STA3. In step S73, the CPU 4 searches for the rekey key duty ratio table A to which the key code KC (i) is assigned in advance, and corresponds to the third state STA3 in the rekey key duty ratio table A thus searched. The duty ratio is output to the drive controller 3c together with the key code KC (i). The drive control unit 3c controls energization of the actuator 330 corresponding to the key 310 represented by the key code KC (i) with a PWM waveform corresponding to the duty ratio.

図24(a)は、上記第1の実施の形態で説明した(基本動作用)デューティ比テーブル(図17(a)参照)のうち、第3〜第5状態ST3〜ST5に対応する部分を抜き出したものであり、図24(b)は、この(基本動作用)デューティ比テーブルの一部に対応する再打鍵用デューティ比テーブルAの一例を示す図である。上記第1の実施の形態で説明したように、(基本動作用)デューティ比テーブルは複数設けられ、各デューティ比テーブルにはいずれかの鍵310が予め割り当てられているが、これと同様にして、再打鍵用デューティ比テーブルAも複数設けられ、各再打鍵用デューティ比テーブルAにはいずれかの鍵310が予め割り当てられている。つまり、各再打鍵用デューティ比テーブルAは、再打鍵(ただし、鍵駆動状態STが第7状態ST7にあるときの再打鍵)専用のものとして、各(基本動作用)デューティ比テーブルとは別個に設けられ、たとえばROM5または外部記憶装置9に予め記憶されている。   FIG. 24A shows portions corresponding to the third to fifth states ST3 to ST5 in the duty ratio table (for basic operation) described in the first embodiment (see FIG. 17A). FIG. 24B shows an example of the rekey key duty ratio table A corresponding to a part of the (basic operation) duty ratio table. As described in the first embodiment, a plurality of duty ratio tables (for basic operation) are provided, and one of the keys 310 is assigned in advance to each duty ratio table. A plurality of rekey key duty ratio tables A are also provided, and one of the keys 310 is assigned to each rekey key duty ratio table A in advance. That is, each re-keying duty ratio table A is dedicated to re-keying (however, re-keying when the key driving state ST is in the seventh state ST7), and is separate from each (for basic operation) duty ratio table. For example, stored in advance in the ROM 5 or the external storage device 9.

前記ステップS73の処理が終了した後、前記図12〜図15の鍵駆動制御処理プログラムが実行されると、鍵駆動状態ST(i)は第3状態STA3、すなわち第3状態ST3(の一部)であるので、CPU4は、図12のステップS112にて“YES”と判定して、処理をステップS113に進める。このとき、同一鍵再打鍵フラグRSK(i)は前記ステップS44において“1”に設定されているので、CPU4は、ステップS113にて“YES”と判定して、ステップS118にて再打鍵鍵駆動制御処理サブルーチンを実行する。   When the key drive control processing program of FIGS. 12 to 15 is executed after the process of step S73 is completed, the key drive state ST (i) is in the third state STA3, that is, a part of the third state ST3 ( Therefore, the CPU 4 determines “YES” in the step S112 in FIG. 12, and advances the process to a step S113. At this time, since the same key re-keying flag RSK (i) is set to “1” in step S44, the CPU 4 determines “YES” in step S113, and re-keying key driving in step S118. A control processing subroutine is executed.

再打鍵鍵駆動制御処理サブルーチンは、図20に詳細に示されている。その実行が開始されると、CPU4は、ステップS301にて、同一鍵再打鍵AフラグRSKA(i)が“1”に設定されているか否か、ステップS302にて、同一鍵再打鍵BフラグRSKB(i)が“1”に設定されているか否かをそれぞれ判定する。ただし同一鍵再打鍵BフラグRSKB(i)は、駆動オフイベントデータが読み出されてから鍵駆動状態ST(i)が第8状態ST8にあるときに、同一鍵の駆動オンイベントデータが読み出された場合に発生する再打鍵パターンB制御の状態を表すフラグであり、“1”により再打鍵パターンB制御状態を表し、“0”により再打鍵パターンB非制御状態を表す。この場合、同一鍵再打鍵AフラグRSKA(i)は前記ステップS71にて“1”に設定されているので、CPU4は、ステップS301にて“YES”と判定して、ステップS303にて再打鍵パターンA制御処理サブルーチンを実行する。   The rekey key drive control processing subroutine is shown in detail in FIG. When the execution is started, the CPU 4 determines whether or not the same key re-keying A flag RSKA (i) is set to “1” in step S301, and whether or not the same key re-keying B flag RSKB is determined in step S302. It is determined whether (i) is set to “1”. However, the same key re-key B flag RSKB (i) reads the drive on event data of the same key when the key drive state ST (i) is in the eighth state ST8 after the drive off event data is read. This is a flag indicating the state of the rekeying pattern B control that occurs when the key is pressed. “1” represents the rekeying pattern B control state, and “0” represents the rekeying pattern B non-control state. In this case, since the same key re-keying A flag RSKA (i) is set to “1” in step S71, the CPU 4 determines “YES” in step S301 and re-keys in step S303. The pattern A control processing subroutine is executed.

再打鍵パターンA制御処理サブルーチンは、図21に詳細に示されている。その実行が開始されると、CPU4は、ステップS311にて、鍵駆動状態ST(i)が第3状態STA3であるか否かを判定する。この場合、鍵駆動状態ST(i)は第3状態STA3であるので、CPU4は、ステップS311にて“YES”と判定して、処理をステップS312に進める。ステップS312〜S315の処理は、前記図12の鍵駆動制御処理プログラムのステップS114〜S117の処理と同様であり、CPU4は、駆動制御部3cとの協働により、キーコードKC(i)により表された鍵310に対応したアクチュエータ330を、再打鍵用デューティ比テーブルA内の第3状態STA3(ただしステップS114〜S117の処理では、(基本動作用)デューティ比テーブル(図24(a)参照)内の第3状態ST3)に対応したデューティ比に応じたPWM波形で、第1スイッチSW1のオンイベントがスキャン部3dによって検出されるまで通電制御し、その後に再打鍵用デューティ比テーブルA内の第4状態STA4(ただしステップS114〜S117の処理では、(基本動作用)デューティ比テーブル(図24(a)参照)内の第4状態ST4)に対応したデューティ比に応じたPWM波形の通電制御に切換える。   The rekeying pattern A control processing subroutine is shown in detail in FIG. When the execution is started, in step S311, the CPU 4 determines whether or not the key driving state ST (i) is the third state STA3. In this case, since the key driving state ST (i) is the third state STA3, the CPU 4 determines “YES” in the step S311, and advances the process to a step S312. The processing of steps S312 to S315 is the same as the processing of steps S114 to S117 of the key drive control processing program of FIG. 12, and the CPU 4 is represented by the key code KC (i) in cooperation with the drive control unit 3c. The actuator 330 corresponding to the key 310 is moved to the third state STA3 in the rekey key duty ratio table A (however, in the processing of steps S114 to S117, the duty ratio table (for basic operation) (see FIG. 24A)). In the PWM waveform corresponding to the duty ratio corresponding to the third state ST3), the energization control is performed until the on-event of the first switch SW1 is detected by the scanning unit 3d. Fourth state STA4 (however, in the processing of steps S114 to S117, the duty ratio table (for basic operation) Le switched to the conduction control of the PWM waveform corresponding to the duty ratio corresponding to (FIG. 24 (a) see) fourth state ST4 in).

次にこの鍵駆動制御処理プログラムが実行されたときには、鍵駆動状態ST(i)は第4状態STA4であるので、CPU4は、ステップS311にて“NO”と判定し、ステップS316にて“YES”と判定して、処理をステップS317に進める。ステップS317〜S321の処理は、前記図13のステップS120〜S124の処理と同様であり、CPU4は、駆動制御部3cとの協働により、キーコードKC(i)により表された鍵310に対応したアクチュエータ330を、再打鍵用デューティ比テーブルA内の第4状態STA4に対応したデューティ比に応じたPWM波形で、第3スイッチSW3のオンイベントがスキャン部3dによって検出されるまで通電制御し、その後に再打鍵用デューティ比テーブルA内の第5状態STA5に対応したデューティ比に応じたPWM波形の通電制御に切換える。   Next, when this key drive control processing program is executed, since the key drive state ST (i) is the fourth state STA4, the CPU 4 determines “NO” in step S311, and “YES” in step S316. Is determined, and the process proceeds to step S317. The processing in steps S317 to S321 is the same as the processing in steps S120 to S124 in FIG. 13, and the CPU 4 corresponds to the key 310 represented by the key code KC (i) in cooperation with the drive control unit 3c. The energized actuator 330 is energized and controlled until the on-event of the third switch SW3 is detected by the scan unit 3d with a PWM waveform corresponding to the duty ratio corresponding to the fourth state STA4 in the rekey key duty ratio table A, Thereafter, switching to energization control of the PWM waveform according to the duty ratio corresponding to the fifth state STA5 in the rekey key duty ratio table A is performed.

次にこの鍵駆動制御処理プログラムが実行されたときには、鍵駆動状態ST(i)は第5状態STA5であるので、CPU4は、ステップS311にて“NO”と判定し、ステップS316にて“NO”と判定し、ステップS322にて“YES”と判定して、処理をステップS323に進める。ステップS323〜S325の処理は、前記図13のステップS126,S128およびS129の処理と同様であり、CPU4は、駆動制御部3cとの協働により、キーコードKC(i)により表された鍵310に対応したアクチュエータ330を、再打鍵用デューティ比テーブルA内の第5状態STA5に対応したデューティ比に応じたPWM波形で、時間ΔTsta5にわたって通電制御し、その後に第6状態ST6に対応したデューティ比に応じたPWM波形の通電制御に切換える。さらにCPU4は、ステップS326にて、同一鍵再打鍵AフラグRSKA(i)および同一鍵再打鍵フラグRSK(i)をそれぞれ“0”にリセットする。   Next, when this key drive control processing program is executed, since the key drive state ST (i) is the fifth state STA5, the CPU 4 determines “NO” in step S311, and “NO” in step S316. "", It is determined "YES" in step S322, and the process proceeds to step S323. The processing of steps S323 to S325 is the same as the processing of steps S126, S128, and S129 of FIG. 13, and the CPU 4 cooperates with the drive control unit 3c to generate the key 310 represented by the key code KC (i). The actuator 330 corresponding to is energized and controlled over time ΔTsta5 with a PWM waveform corresponding to the fifth state STA5 in the rekey key duty ratio table A, and then the duty ratio corresponding to the sixth state ST6 Switch to energization control of PWM waveform according to. Further, in step S326, the CPU 4 resets the same key re-keying A flag RSKA (i) and the same key re-keying flag RSK (i) to “0”.

このような処理により、鍵駆動状態ST(i)が第7状態ST7で、同一キーコードKCに関する駆動オンイベントデータが読み出されると、再打鍵用デューティ比テーブルAが参照されて、第3〜第5状態STA3〜STA5にそれぞれ対応したデューティ比に応じたPWM波形の通電制御が実行される。図24(b)に示すように、第3〜第5状態STA3〜STA5における再打鍵用デューティ比テーブルAのパターン(同図(b)では、実線で描かれている)と基本動作用デューティ比テーブルのパターン(同図(b)では、一点鎖線で描かれている)とを比較すると、第3状態STA3に対応するデューティ比は、第3状態ST3に対応するデューティ比に対して若干小さく、しかも制御時間はかなり短く設定されている。これは、第7状態ST7では、鍵310およびハンマ体HMが離鍵動作を開始してから間もないために、それほど大きな推力でハンマ体HMの質量部材323を押し上げる必要はないからである。このように第3状態STA3における制御時間を基本動作時よりかなり短くしたので、鍵310およびハンマ体HMには押鍵方向への勢い(慣性力)がついていないために、駆動力をあまりセーブせずに、第4状態STA4における推力を基本動作時より若干大きくしている。そして、この基本動作時より若干大きな推力では、依然として鍵310およびハンマ体HMにはそれほどの押鍵方向への勢い(慣性力)がついていないので、ハンマ体HMの質量部材323の後端部が上側ストッパ312へ衝突する際に発生するリバウンドは小さいと推定して、第5状態STA5における推力を基本動作時より若干小さくしている。   With this process, when the key drive state ST (i) is the seventh state ST7 and the drive-on event data related to the same key code KC is read, the rekey key duty ratio table A is referred to, and the third to third The PWM waveform energization control corresponding to the duty ratios corresponding to the five states STA3 to STA5 is executed. As shown in FIG. 24B, the pattern of the keystroke duty ratio table A in the third to fifth states STA3 to STA5 (shown by a solid line in FIG. 24B) and the basic operation duty ratio. Comparing with the pattern of the table (indicated by the alternate long and short dash line in FIG. 5B), the duty ratio corresponding to the third state STA3 is slightly smaller than the duty ratio corresponding to the third state ST3, Moreover, the control time is set considerably short. This is because in the seventh state ST7, since the key 310 and the hammer body HM have just started the key release operation, it is not necessary to push up the mass member 323 of the hammer body HM with a very large thrust. As described above, since the control time in the third state STA3 is considerably shorter than that in the basic operation, the key 310 and the hammer body HM have no momentum (inertial force) in the key-pressing direction. The thrust in the fourth state STA4 is slightly larger than that in the basic operation. Then, with a slightly larger thrust than that during the basic operation, the key 310 and the hammer body HM still do not have so much momentum (inertial force) in the key pressing direction, so that the rear end portion of the mass member 323 of the hammer body HM It is presumed that the rebound generated when colliding with the upper stopper 312 is small, and the thrust in the fifth state STA5 is made slightly smaller than in the basic operation.

次に、駆動オンイベントデータが第8状態ST8で鍵駆動用データ中から読み出された場合について説明する。この場合、前記図18および図19の再打鍵処理サブルーチンにおいて、CPU4は、ステップS50にて“YES”と判定して、ステップS74〜S76の処理を実行する。ステップS74〜S76の処理は、前記S71,S72およびS73の処理と同様であり、同一鍵再打鍵BフラグRSKB(i)を“1”に設定し、鍵駆動状態ST(i)を第3状態STB3に設定し、経過時間TM(i)を第3状態STB3の開始時を表す第2時間値TB2に設定した後、キーコードKC(i)が予め割当てられている再打鍵用デューティ比テーブルBを探し出して、同探し出した再打鍵用デューティ比テーブルB内の第3状態STB3に対応したデューティ比をキーコードKC(i)と共に駆動制御部3cに出力する。駆動制御部3cは、キーコードKC(i)により表された鍵310に対応したアクチュエータ330を前記デューティ比に応じたPWM波形で通電制御する。   Next, a case where drive-on event data is read from the key drive data in the eighth state ST8 will be described. In this case, in the rekeying subroutine of FIGS. 18 and 19, the CPU 4 determines “YES” in step S50, and executes the processes of steps S74 to S76. The processing of steps S74 to S76 is the same as the processing of S71, S72 and S73, the same key re-key B flag RSKB (i) is set to “1”, and the key driving state ST (i) is set to the third state. After setting to STB3 and setting the elapsed time TM (i) to the second time value TB2 indicating the start time of the third state STB3, the keystroke duty ratio table B to which the key code KC (i) is assigned in advance is set. And the duty ratio corresponding to the third state STB3 in the rekey key duty ratio table B found out is output to the drive control unit 3c together with the key code KC (i). The drive control unit 3c controls energization of the actuator 330 corresponding to the key 310 represented by the key code KC (i) with a PWM waveform corresponding to the duty ratio.

図24(c)は、図24(a)の(基本動作用)デューティ比テーブルの一部に対応する再打鍵用デューティ比テーブルBの一例を示す図である。(基本動作用)デューティ比テーブルおよび再打鍵用デューティ比テーブルAと同様に、再打鍵用デューティ比テーブルBも複数設けられ、各再打鍵用デューティ比テーブルBにもいずれかの鍵310が予め割り当てられている。つまり、各再打鍵用デューティ比テーブルBは、再打鍵(ただし、鍵駆動状態STが第8状態ST8にあるときの再打鍵)専用のものとして、各(基本動作用)デューティ比テーブルおよび再打鍵用デューティ比テーブルAとは別個に設けられ、たとえば前記ROM5または外部記憶装置9に予め記憶されている。   FIG. 24C is a diagram showing an example of a key repetitive duty ratio table B corresponding to a part of the duty ratio table (for basic operation) in FIG. Similar to the duty ratio table (for basic operation) and the rekey key duty ratio table A, a plurality of rekey key duty ratio tables B are also provided, and any key 310 is assigned to each rekey key duty ratio table B in advance. It has been. That is, each re-keying duty ratio table B is dedicated to re-keying (however, re-keying when the key driving state ST is in the eighth state ST8), and each (for basic operation) duty ratio table and re-keying. Provided separately from the duty ratio table A, for example, stored in advance in the ROM 5 or the external storage device 9.

前記ステップS76の処理が終了した後、前記図12〜図15の鍵駆動制御処理プログラムが実行されると、前記ステップS118にて再打鍵鍵駆動制御処理サブルーチンが実行される。この再打鍵鍵駆動制御処理サブルーチンでは、CPU4は、前記ステップS301にて“NO”と判定し、前記ステップS302にて“YES”と判定して、ステップS304にて再打鍵パターンB制御処理サブルーチンを実行する。   When the key drive control processing program of FIGS. 12 to 15 is executed after the process of step S76 is completed, a rekey key drive control process subroutine is executed in step S118. In this rekey key drive control processing subroutine, the CPU 4 determines “NO” in step S301, determines “YES” in step S302, and executes the rekey key pattern B control processing subroutine in step S304. Run.

再打鍵パターンB制御処理サブルーチンは、図22に詳細に示されている。再打鍵パターンB制御処理サブルーチンと前記再打鍵パターンA制御処理サブルーチンとの主な違いは、それぞれが参照する再打鍵用デューティ比テーブルのパターン(の形状)が異なることである。具体的には、図24(c)に示すように、第3状態STB3に対応するデューティ比は、基本動作用デューティ比テーブル内の第3状態ST3に対応するデューティ比より若干大きく(再打鍵用デューティ比テーブルA内の第3状態STA3に対応するデューティ比よりかなり大きく)、しかも制御時間も基本動作時とほぼ同等に(第3状態STA3時よりはかなり長く)設定されている。これは、第8状態ST8では、第7状態ST7と比較して、鍵310およびハンマ体HMには離鍵方向への勢い(慣性力)がついている(第7状態ST7は、鍵310およびハンマ体HMが離鍵動作を開始した直後で、鍵310およびハンマ体HMにはそれほどの離鍵方向への勢いがついていない)ので、離鍵方向への勢いがついている鍵310およびハンマ体HMを瞬時に逆方向(押鍵方向)へ駆動させるために、基本動作時より若干大きな推力(第3状態STA3時よりはかなり大きな推力)かつ基本動作時とほぼ同等の(第3状態STA3時よりはかなり長い)制御時間で、質量部材323を押し上げる必要があるからである。このように第3状態STB3における推力を基本動作時より若干大きくしながら、基本動作時とほぼ同等の時間だけ制御を続けるので、第1スイッチSW1のオンイベントが発生する際(経過時間TM(i)が第3時間値TB3に到達する際)の推力は、基本動作時より若干大きくなる。このため、第4状態STB4における推力を基本動作時より若干小さくしている。しかしこの場合、質量部材323の後端部の上側ストッパ312への衝突の反発力は基本動作時より若干大きいと推定して、第5状態STB5における推力を基本動作時より若干大きくしている。   The rekeying pattern B control processing subroutine is shown in detail in FIG. The main difference between the rekeying pattern B control processing subroutine and the rekeying pattern A control processing subroutine is that the patterns (shapes) of the rekeying duty ratio table to which they refer are different. Specifically, as shown in FIG. 24C, the duty ratio corresponding to the third state STB3 is slightly larger than the duty ratio corresponding to the third state ST3 in the basic operation duty ratio table (for re-keying). The duty ratio is considerably larger than the duty ratio corresponding to the third state STA3 in the duty ratio table A), and the control time is set substantially equal to that during the basic operation (much longer than that in the third state STA3). This is because, in the eighth state ST8, the key 310 and the hammer body HM have momentum (inertial force) in the key release direction compared to the seventh state ST7 (the seventh state ST7 has the key 310 and the hammer. Immediately after the body HM starts the key release operation, the key 310 and the hammer body HM do not have much momentum in the key release direction). In order to instantaneously drive in the reverse direction (key-pressing direction), a slightly larger thrust than the basic operation (a much larger thrust than in the third state STA3) and almost the same as in the basic operation (from the third state STA3) This is because the mass member 323 needs to be pushed up in a considerably long control time. As described above, since the control in the third state STB3 is slightly larger than that in the basic operation and the control is continued for substantially the same time as in the basic operation, the on-event of the first switch SW1 occurs (elapsed time TM (i ) Reaches a third time value TB3), and the thrust becomes slightly larger than in the basic operation. For this reason, the thrust in the fourth state STB4 is made slightly smaller than that in the basic operation. However, in this case, it is estimated that the repulsive force of the collision of the rear end portion of the mass member 323 with the upper stopper 312 is slightly larger than that in the basic operation, and the thrust in the fifth state STB5 is slightly larger than that in the basic operation.

次に、駆動オンイベントデータが第9状態ST9で鍵駆動用データ中から読み出された場合について説明する。この場合、前記図18および図19の再打鍵処理サブルーチンにおいて、CPU4は、ステップS53にて“YES”と判定して、ステップS77〜S79の処理を実行する。ステップS77〜S79の処理は、前記S71,S72およびS73の処理と同様であり、同一鍵再打鍵CフラグRSKC(i)を“1”に設定し、鍵駆動状態ST(i)を第3状態STC3に設定し、経過時間TM(i)を第3状態STC3の開始時を表す第2時間値TC2に設定した後、キーコードKC(i)が予め割当てられている再打鍵用デューティ比テーブルCを探し出して、同探し出した再打鍵用デューティ比テーブルC内の第3状態STC3に対応したデューティ比をキーコードKC(i)と共に駆動制御部3cに出力する。駆動制御部3cは、キーコードKC(i)により表された鍵310に対応したアクチュエータ330を前記デューティ比に応じたPWM波形で通電制御する。なお、同一鍵再打鍵CフラグRSKC(i)は、駆動オフイベントデータが読み出されてから鍵駆動状態ST(i)が第9状態ST9にあるときに、同一鍵の駆動オンイベントデータが読み出された場合に発生する再打鍵パターンC制御の状態を表すフラグであり、“1”により再打鍵パターンC制御状態を表し、“0”により再打鍵パターンC非制御状態を表す。   Next, a case where drive-on event data is read from the key drive data in the ninth state ST9 will be described. In this case, in the rekeying subroutine of FIGS. 18 and 19, the CPU 4 determines “YES” in step S53, and executes the processes of steps S77 to S79. The processing of steps S77 to S79 is the same as the processing of S71, S72 and S73, the same key re-keying C flag RSKC (i) is set to “1”, and the key driving state ST (i) is set to the third state. After setting to STC3 and setting the elapsed time TM (i) to the second time value TC2 indicating the start time of the third state STC3, the keystroke duty ratio table C to which the key code KC (i) is assigned in advance is set. And the duty ratio corresponding to the third state STC3 in the rekey key duty ratio table C searched for is output to the drive control unit 3c together with the key code KC (i). The drive control unit 3c controls energization of the actuator 330 corresponding to the key 310 represented by the key code KC (i) with a PWM waveform corresponding to the duty ratio. The same key re-keying C flag RSKC (i) reads the same key driving on-event data when the key driving state ST (i) is in the ninth state ST9 after the driving off event data is read. It is a flag that indicates the state of the rekeying pattern C control that occurs when the key is issued. “1” indicates the rekeying pattern C control state, and “0” indicates the rekeying pattern C non-control state.

図24(d)は、図24(a)の(基本動作用)デューティ比テーブルの一部に対応する再打鍵用デューティ比テーブルCの一例を示す図である。(基本動作用)デューティ比テーブルおよび再打鍵用デューティ比テーブルA,Bと同様に、再打鍵用デューティ比テーブルCも複数設けられ、各再打鍵用デューティ比テーブルCにもいずれかの鍵310が予め割り当てられている。つまり、各再打鍵用デューティ比テーブルCは、再打鍵(ただし、鍵駆動状態STが第9状態ST9にあるときの再打鍵)専用のものとして、各(基本動作用)デューティ比テーブルおよび再打鍵用デューティ比テーブルA,Bとは別個に設けられ、たとえば前記ROM5または外部記憶装置9に予め記憶されている。   FIG. 24D is a diagram showing an example of a key repetitive duty ratio table C corresponding to a part of the (for basic operation) duty ratio table in FIG. Similar to the duty ratio table (for basic operation) and the rekey key duty ratio tables A and B, a plurality of rekey key duty ratio tables C are also provided. Already assigned. That is, each re-keying duty ratio table C is dedicated to re-keying (however, re-keying when the key driving state ST is in the ninth state ST9), and each (for basic operation) duty ratio table and re-keying. The duty ratio tables A and B are provided separately and stored in advance in the ROM 5 or the external storage device 9, for example.

前記ステップS79の処理が終了した後、前記図12〜図15の鍵駆動制御処理プログラムが実行されると、前記ステップS118にて再打鍵鍵駆動制御処理サブルーチンが実行される。この再打鍵鍵駆動制御処理サブルーチンでは、CPU4は、前記ステップS301にて“NO”と判定し、前記ステップS302にて“NO”と判定して、ステップS305にて再打鍵パターンC制御処理サブルーチンを実行する。   When the key drive control process program of FIGS. 12 to 15 is executed after the process of step S79 is completed, a rekey key drive control process subroutine is executed in step S118. In this rekey key drive control processing subroutine, the CPU 4 determines “NO” in step S301, determines “NO” in step S302, and executes the rekey key pattern C control processing subroutine in step S305. Run.

再打鍵パターンC制御処理サブルーチンは、図23に詳細に示されている。再打鍵パターンC制御処理サブルーチンと前記再打鍵パターンA制御処理サブルーチンおよび再打鍵パターンB制御処理サブルーチンとの主な違いは、それぞれが参照する再打鍵用デューティ比テーブルのパターン(の形状)が異なることである。具体的には、図24(d)に示すように、第3状態STC3に対応するデューティ比は、基本動作用デューティ比テーブル内の第3状態ST3に対応するデューティ比よりかなり大きく(再打鍵用デューティ比テーブルB内の第3状態STB3に対応するデューティ比よりもかなり大きく)、しかも制御時間も基本動作時よりかなり長く(第3状態STB3時よりもかなり長く)設定されている。これは、第9状態ST9では、第8状態ST8と比較して、鍵310およびハンマ体HMには離鍵方向への勢い(慣性力)がさらについているので、離鍵方向への勢いがさらについている鍵310およびハンマ体HMを瞬時に逆方向(押鍵方向)へ駆動させるために、基本動作時よりかなり大きな(第3状態STA3時よりもかなり大きな)推力かつかなり長い(第3状態STA3時よりもかなり長い)制御時間で、質量部材323を押し上げる必要があるからである。このように第3状態STC3における推力を基本動作時よりかなり大きくしながら、基本動作時よりもかなり長い時間だけ制御を続けるので、第1スイッチSW1のオンイベントが発生する際(経過時間TM(i)が第3時間値TC3に到達する際)の推力は、基本動作時よりかなり大きくなる。このため、第4状態STC4における推力を基本動作時よりかなり小さくしている。しかしこの場合、質量部材323の後端部の上側ストッパ312への衝突の反発力は基本動作時よりかなり大きいと推定して、第5状態STC5における推力を基本動作時よりかなり大きくしている。   The rekeying pattern C control processing subroutine is shown in detail in FIG. The main difference between the rekeying pattern C control processing subroutine, the rekeying pattern A control processing subroutine, and the rekeying pattern B control processing subroutine is that the patterns (shapes) of the rekeying duty ratio table to which they refer are different. It is. Specifically, as shown in FIG. 24D, the duty ratio corresponding to the third state STC3 is considerably larger than the duty ratio corresponding to the third state ST3 in the basic operation duty ratio table (for re-keying). The duty ratio is considerably larger than the duty ratio corresponding to the third state STB3 in the duty ratio table B), and the control time is set to be considerably longer than that in the basic operation (much longer than that in the third state STB3). In the ninth state ST9, compared to the eighth state ST8, the key 310 and the hammer body HM are further provided with momentum (inertial force) in the key release direction. In order to instantaneously drive the attached key 310 and the hammer body HM in the opposite direction (key pressing direction), the thrust is considerably larger than the basic operation (much larger than that in the third state STA3) and considerably longer (the third state STA3). This is because the mass member 323 needs to be pushed up in a control time (which is considerably longer than the time). As described above, since the control in the third state STC3 is considerably larger than that in the basic operation and the control is continued for a considerably longer time than in the basic operation, the ON event of the first switch SW1 occurs (elapsed time TM (i ) When reaching the third time value TC3) is considerably larger than in the basic operation. For this reason, the thrust in the fourth state STC4 is made considerably smaller than in the basic operation. In this case, however, the repulsive force of the collision of the rear end portion of the mass member 323 with the upper stopper 312 is estimated to be considerably larger than that in the basic operation, and the thrust in the fifth state STC5 is considerably larger than that in the basic operation.

このように本実施の形態では、駆動オフイベントデータの読み出しの直後に駆動オンイベントデータが読み出された場合には、読み出しのタイミングが第7〜第9状態ST7〜ST9のいずれの状態にあるかにより、鍵310およびハンマ体HMを駆動するために参照する再打鍵用デューティ比テーブルを異ならせたので、鍵の再打鍵時の駆動制御をさらにきめ細かく行うことが可能となる。   As described above, in the present embodiment, when the drive on event data is read immediately after the drive off event data is read, the read timing is in any of the seventh to ninth states ST7 to ST9. Thus, since the rekey key duty ratio table referred to for driving the key 310 and the hammer body HM is made different, it becomes possible to perform the drive control at the time of key rekeying more finely.

なお本実施の形態では、再打鍵パターンA〜Cの各制御処理サブルーチンにおいて、鍵駆動状態STの第3状態から第4状態への切換えおよび第4状態から第5状態への切換えは、第1および第3スイッチSW1およびSW3の各キーオンイベントの発生に応じて行うようにしたが、これに限らず、予め設定された(固定の)時間値を用いて行うようにしてもよい。   In the present embodiment, in each control processing subroutine of the rekeying patterns A to C, the switching of the key driving state ST from the third state to the fourth state and the switching from the fourth state to the fifth state are as follows. The third switch SW1 and the third switch SW3 are performed in response to the occurrence of each key-on event. However, the present invention is not limited to this, and a preset (fixed) time value may be used.

また、再打鍵用デューティ比テーブルA,BおよびCの各テーブルにおける第3〜第5の各鍵駆動状態に対応する各デューティ比の大きさおよび当該デューティ比で通電制御を行う時間(当該鍵駆動状態を保持する時間)と、基本動作用デューティ比テーブルの第3〜第5の各鍵駆動状態に対応する各デューティ比の大きさおよび当該デューティ比で通電制御を行う時間との相関関係は、ハンマ体HMの質量やアクチュエータ330の推力などによって変わるので、図24に示したものに限らないことは言うまでもない。   Also, the duty ratios corresponding to the third to fifth key drive states in the rekey key duty ratio tables A, B, and C and the time during which energization control is performed with the duty ratio (the key drive) State holding time) and the magnitude of each duty ratio corresponding to each of the third to fifth key driving states of the basic operation duty ratio table and the time for performing energization control with the duty ratio are as follows: Needless to say, it is not limited to the one shown in FIG.

なお、上述した各実施の形態の機能を実現するソフトウェアのプログラムコードを記録した記憶媒体を、システムまたは装置に供給し、そのシステムまたは装置のコンピュータ(またはCPUやMPU)が記憶媒体に格納されたプログラムコードを読出し実行することによっても、本発明の目的が達成されることは言うまでもない。   A storage medium storing software program codes for realizing the functions of the above-described embodiments is supplied to the system or apparatus, and the computer (or CPU or MPU) of the system or apparatus is stored in the storage medium. It goes without saying that the object of the present invention can also be achieved by reading and executing the program code.

この場合、記憶媒体から読出されたプログラムコード自体が本発明の新規な機能を実現することになり、そのプログラムコードおよび該プログラムコードを記憶した記憶媒体は本発明を構成することになる。   In this case, the program code itself read from the storage medium realizes the novel function of the present invention, and the program code and the storage medium storing the program code constitute the present invention.

プログラムコードを供給するための記憶媒体としては、たとえば、フレキシブルディスク、ハードディスク、光磁気ディスク、CD−ROM、CD−R、CD−RW、DVD−ROM、DVD−RAM、DVD−RW、DVD+RW、磁気テープ、不揮発性のメモリカード、ROMなどを用いることができる。また、通信ネットワークを介してサーバコンピュータからプログラムコードが供給されるようにしてもよい。   As a storage medium for supplying the program code, for example, a flexible disk, hard disk, magneto-optical disk, CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD + RW, magnetic A tape, a non-volatile memory card, a ROM, or the like can be used. Further, the program code may be supplied from a server computer via a communication network.

また、コンピュータが読出したプログラムコードを実行することにより、上述した各実施の形態の機能が実現されるだけでなく、そのプログラムコードの指示に基づき、コンピュータ上で稼働しているOSなどが実際の処理の一部または全部を行い、その処理によって上述した各実施の形態の機能が実現される場合も含まれることは言うまでもない。   Further, by executing the program code read out by the computer, not only the functions of the above-described embodiments are realized, but the OS running on the computer based on the instruction of the program code is actually used. Needless to say, the present invention includes a case where part or all of the processing is performed and the functions of the above-described embodiments are realized by the processing.

さらに、記憶媒体から読出されたプログラムコードが、コンピュータに挿入された機能拡張ボードやコンピュータに接続された機能拡張ユニットに備わるメモリに書込まれた後、そのプログラムコードの指示に基づき、その機能拡張ボードや機能拡張ユニットに備わるCPUなどが実際の処理の一部または全部を行い、その処理によって上述した各実施の形態の機能が実現される場合も含まれることは言うまでもない。   Further, after the program code read from the storage medium is written into a memory provided in a function expansion board inserted into the computer or a function expansion unit connected to the computer, the function expansion is performed based on the instruction of the program code. It goes without saying that the CPU or the like provided in the board or the function expansion unit performs part or all of the actual processing, and the functions of the above-described embodiments are realized by the processing.

3a…鍵盤,3b…電力供給部(鍵駆動手段),3c…駆動制御部(鍵駆動手段),3d…スキャン部(検出手段),4…CPU(鍵駆動手段、鍵駆動制御手段、再打鍵判定手段、計測手段、経過時間判定手段),6…RAM(記憶手段),7…タイマ(計測手段),9…外部記憶装置(記憶手段) 3a ... Keyboard, 3b ... Power supply section (key drive means), 3c ... Drive control section (key drive means), 3d ... Scan section (detection means), 4 ... CPU (key drive means, key drive control means, re-keying) Determination means, measurement means, elapsed time determination means), 6 ... RAM (storage means), 7 ... timer (measurement means), 9 ... external storage device (storage means)

Claims (6)

複数の鍵をそれぞれ独立に駆動して、あるいは複数の鍵のそれぞれと連動する部材をそれぞれ独立に駆動して、鍵を押鍵前の初期位置から押鍵位置まで変位させる押鍵動作、および鍵を前記押鍵位置から前記初期位置まで変位させる離鍵動作を含む押離鍵動作を鍵毎に行わせる鍵駆動手段と、
時間経過に従って供給される鍵の押鍵および離鍵を表す鍵情報に応じて、駆動信号を前記鍵駆動手段に供給することにより、対応する鍵の押離鍵動作を制御する鍵駆動制御手段と、
前記鍵駆動制御手段が前記対応する鍵の押離鍵動作を制御するための駆動信号パターンを複数種類記憶する記憶手段であって、前記複数種類の駆動信号パターンには、当該押離鍵動作を時間経過に従って複数の段階に分割して得られたそれぞれの段階に予め設定された駆動力を発生させる駆動信号を規定した第1の駆動信号パターンと、当該第1の駆動信号パターンの前記段階の少なくとも一部について、当該第1の駆動信号パターンとは異なる分割で、且つ異なる駆動力を発生させる駆動信号を規定した第2の駆動信号パターンが含まれるものを記憶する記憶手段と、
各鍵について離鍵動作開始から当該離鍵動作終了までの間に、当該離鍵動作中の鍵に対して再度の押鍵を表す鍵情報が供給されたか否かを判定することにより、各鍵について再打鍵が指示されたか否かを判定する再打鍵判定手段と
を有し、
前記鍵駆動制御手段は、前記再打鍵判定手段による判定結果、再打鍵の指示がなされなかったときには、前記第1の駆動信号パターンを用いる一方、再打鍵の指示がなされたときには、前記第2の駆動信号パターンを用いて、対応する鍵の押離鍵動作を制御することを特徴とする自動演奏電子ピアノの制御装置。
A key-pressing operation for displacing the key from the initial position before pressing the key to the key-pressing position by driving each of the plurality of keys independently or by independently driving a member interlocking with each of the keys; and the key A key driving means for performing a key pressing operation including a key releasing operation for displacing the key from the key pressing position to the initial position,
A key drive control means for controlling a key pressing operation of the corresponding key by supplying a drive signal to the key drive means in accordance with key information representing key depression and key release supplied over time; ,
Storage means for storing a plurality of types of drive signal patterns for the key drive control means to control the key pressing and releasing operation of the corresponding key , wherein the plurality of types of driving signal patterns include the key pressing and releasing operation; A first drive signal pattern defining a drive signal for generating a preset driving force at each stage obtained by dividing the stage into a plurality of stages over time, and the stage of the first drive signal pattern Storage means for storing at least a portion including a second drive signal pattern that defines a drive signal for generating a different driving force in a different division from the first drive signal pattern ;
For each key, each key is determined by determining whether or not key information representing the key depression again is supplied to the key during the key release operation from the start of the key release operation to the end of the key release operation. Re-keying determination means for determining whether or not re-keying is instructed about,
The key drive control means uses the first drive signal pattern when no rekeying instruction is given as a result of the determination by the rekeying determination means, while the second driving signal pattern uses the second driving signal pattern when the rekeying instruction is given. A control device for an automatic performance electronic piano, characterized in that the key-pressing operation of the corresponding key is controlled using the drive signal pattern .
各鍵について離鍵を表す鍵情報の供給が開始してから、当該鍵の次の押鍵を表す鍵情報が供給されるまでの経過時間を計測する計測手段と、
前記計測手段によって計測された経過時間が、対応する鍵の離鍵動作開始から当該離鍵動作終了までの所定時間を分割して得られた複数の部分区間のうちのいずれかに該当するか否かを判定する経過時間判定手段と
をさらに有し、
前記経過時間判定手段によって、前記経過時間が前記複数の部分区間のいずれかに該当すると判定されたときには、前記鍵駆動制御手段は、前記該当する部分区間に応じて異なる押鍵動作用駆動信号を用いて、対応する鍵の押離鍵動作を制御することを特徴とする請求項1に記載の自動演奏電子ピアノの制御装置。
Measuring means for measuring an elapsed time from the start of supply of key information representing a key release for each key to the supply of key information representing the next key press of the key;
Whether the elapsed time measured by the measuring means corresponds to one of a plurality of partial sections obtained by dividing a predetermined time from the start of the key release operation of the corresponding key to the end of the key release operation And an elapsed time determining means for determining
When the elapsed time determining means determines that the elapsed time corresponds to one of the plurality of partial sections, the key drive control means outputs a key pressing operation drive signal that differs depending on the corresponding partial section. The control device for an automatic performance electronic piano according to claim 1, wherein the key pressing operation of the corresponding key is controlled.
前記第2の駆動信号パターン、押鍵動作用駆動信号パターンであって、押鍵動作領域において段階的に変化する駆動力を発生するように変化する複数の駆動信号によって構成され、
前記経過時間判定手段によって、前記経過時間が前記複数の部分区間のいずれかに該当すると判定されたときには、前記鍵駆動制御手段は、前記押鍵動作用駆動信号パターン内の、前記該当する部分区間に応じて異なる段階の駆動信号を用いて、対応する鍵の押離鍵動作を制御することを特徴とする請求項2に記載の自動演奏電子ピアノの制御装置。
The second driving signal pattern is a driving signal pattern press key operation, is constituted by a plurality of drive signals changes so as to generate a driving force which varies stepwise in the key depression operation region,
When the elapsed time determination means determines that the elapsed time corresponds to one of the plurality of partial sections, the key drive control means is configured to output the corresponding partial section in the key pressing operation drive signal pattern. 3. The control device for an automatic musical performance electronic piano according to claim 2, wherein a key pressing operation of the corresponding key is controlled using drive signals at different stages according to the control signal.
前記第2の駆動信号パターン、前記部分区間の個数に応じた複数の押鍵動作用駆動信号パターンであって、それぞれが独立したものによって構成され
前記経過時間判定手段によって、前記経過時間が前記複数の部分区間のいずれかに該当すると判定されたときには、前記鍵駆動制御手段は、前記複数の押鍵動作用駆動信号パターンから、前記該当する部分区間に応じていずれか1つを選択し、該選択された押鍵動作用駆動信号パターンを用いて、対応する鍵の押離鍵動作を制御することを特徴とする請求項2に記載の自動演奏電子ピアノの制御装置。
Said second drive signal pattern may be a plurality of drive signal pattern for the key depression operation in accordance with the number of prior SL subintervals, it is constituted by what each independent,
When the elapsed time determination means determines that the elapsed time corresponds to one of the plurality of partial sections, the key drive control means determines that the corresponding portion from the plurality of key pressing operation drive signal patterns. 3. The automatic operation according to claim 2, wherein any one is selected in accordance with a section, and the key pressing operation of the corresponding key is controlled using the selected key pressing operation signal pattern. Control device for playing electronic piano.
前記押離鍵動作に応じた鍵の変位により、鍵の押下位置が複数の所定位置のいずれかに
到達したことを、対応する検出信号を出力して検出する検出手段をさらに有し、
前記鍵駆動制御手段は、前記検出手段から出力された検出信号に応じて、前記選択された駆動信号パターン内の段階を切り替え、該切り替えられた段階に対応する駆動信号を前記鍵駆動手段に供給することにより、対応する鍵の押離鍵動作を制御することを特徴とする請求項1〜4のいずれかに記載の自動演奏電子ピアノの制御装置。
A detection unit that outputs a corresponding detection signal to detect that the key pressing position has reached one of a plurality of predetermined positions due to the displacement of the key in accordance with the key release operation;
The key drive control means switches the stage in the selected drive signal pattern according to the detection signal output from the detection means, and supplies the drive signal corresponding to the switched stage to the key drive means. The control device for an automatic performance electronic piano according to claim 1, wherein the key pressing operation of the corresponding key is controlled.
複数の鍵をそれぞれ独立に駆動して、あるいは複数の鍵のそれぞれと連動する部材をそれぞれ独立に駆動して、鍵を押鍵前の初期位置から押鍵位置まで変位させる押鍵動作、および鍵を前記押鍵位置から前記初期位置まで変位させる離鍵動作を含む押離鍵動作を鍵毎に行わせる鍵駆動手段と、前記鍵の押離鍵動作を制御するための駆動信号パターンを複数種類記憶する記憶手段であって、前記複数種類の駆動信号パターンには、当該押離鍵動作を時間経過に従って複数の段階に分割して得られたそれぞれの段階に予め設定された駆動力を発生させる駆動信号を規定した第1の駆動信号パターンと、当該第1の駆動信号パターンの前記段階の少なくとも一部について、当該第1の駆動信号パターンとは異なる分割で、且つ異なる駆動力を発生させる駆動信号を規定した第2の駆動信号パターンが含まれるものを記憶する記憶手段とを備えた自動演奏電子ピアノを制御する制御方法をコンピュータに実行させるプログラムであって、  A key-pressing operation for displacing the key from the initial position before pressing the key to the key-pressing position by driving each of the plurality of keys independently or by independently driving a member interlocking with each of the keys; and the key A plurality of types of drive signal patterns for controlling the key pressing and releasing operation of the key, and a key driving means for performing the key pressing and releasing operation including a key releasing operation for displacing the key from the key pressing position to the initial position. Storage means for storing, wherein the plurality of types of driving signal patterns generate a driving force set in advance in each stage obtained by dividing the key release key operation into a plurality of stages over time. A first driving signal pattern that defines a driving signal and at least a part of the first stage of the first driving signal pattern are generated in different divisions and different driving forces from the first driving signal pattern. A second program for executing the control method on a computer for controlling the automatic playing electronic piano and a storage means for storing intended to include the drive signal pattern defining a driving signal that,
前記制御方法は、  The control method is:
時間経過に従って供給される鍵の押鍵および離鍵を表す鍵情報に応じて、駆動信号を前記鍵駆動手段に供給することにより、対応する鍵の押離鍵動作を制御する鍵駆動制御ステップと、  A key driving control step for controlling a key pressing operation of the corresponding key by supplying a driving signal to the key driving means in accordance with key information representing key pressing and key release supplied over time; ,
各鍵について離鍵動作開始から当該離鍵動作終了までの間に、当該離鍵動作中の鍵に対して再度の押鍵を表す鍵情報が供給されたか否かを判定することにより、各鍵について再打鍵が指示されたか否かを判定する再打鍵判定ステップと  For each key, each key is determined by determining whether or not key information representing the key depression again is supplied to the key during the key release operation from the start of the key release operation to the end of the key release operation. A rekeying determination step for determining whether rekeying is instructed for
を有し、Have
前記鍵駆動制御ステップでは、前記再打鍵判定ステップによる判定の結果、再打鍵の指示がなされなかったときには、前記第1の駆動信号パターンを用いる一方、再打鍵の指示がなされたときには、前記第2の駆動信号パターンを用いて、対応する鍵の押離鍵動作を制御する  The key drive control step uses the first drive signal pattern when no rekeying instruction is given as a result of the determination by the rekeying determination step, while the second driving key pattern uses the second driving signal pattern. Controls the key press / release operation of the corresponding key using the drive signal pattern
ことを特徴とするプログラム。A program characterized by that.
JP2009004707A 2009-01-13 2009-01-13 Automatic performance electronic piano control device and program for realizing the control method Expired - Fee Related JP5444719B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009004707A JP5444719B2 (en) 2009-01-13 2009-01-13 Automatic performance electronic piano control device and program for realizing the control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009004707A JP5444719B2 (en) 2009-01-13 2009-01-13 Automatic performance electronic piano control device and program for realizing the control method

Publications (2)

Publication Number Publication Date
JP2010164630A JP2010164630A (en) 2010-07-29
JP5444719B2 true JP5444719B2 (en) 2014-03-19

Family

ID=42580867

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009004707A Expired - Fee Related JP5444719B2 (en) 2009-01-13 2009-01-13 Automatic performance electronic piano control device and program for realizing the control method

Country Status (1)

Country Link
JP (1) JP5444719B2 (en)

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH056165A (en) * 1991-06-26 1993-01-14 Yamaha Corp Automatic playing piano
JP4716422B2 (en) * 2006-01-19 2011-07-06 株式会社河合楽器製作所 Resonant sound generator
JP2008233828A (en) * 2007-03-23 2008-10-02 Yamaha Corp Controller of musical instrument

Also Published As

Publication number Publication date
JP2010164630A (en) 2010-07-29

Similar Documents

Publication Publication Date Title
EP0696790B1 (en) Keyboard musical instrument estimating hammer impact and timing for tone-generation from one of hammer motion and key motion
US7265281B2 (en) Automatic player musical instrument having playback table partially prepared through transcription from reference table and computer program used therein
US7754957B2 (en) Musical instrument capable of producing after-tones and automatic playing system
EP2688062B1 (en) Keyboard musical instrument, method of controlling actuator in the keyboard musical instrument, and program for controlling the actuator
US8859877B2 (en) Damper drive device for musical instrument, and musical instrument
US20070169608A1 (en) Automatic player musical instrument producing short tones without missing tone and automatic playing system used therein
EP2509068B1 (en) Keyboard musical instrument and corresponding program
JP2014112221A (en) Drive control device for percussion member in sound production mechanism
JP2005234155A (en) Automatic playing apparatus
JP2009003238A (en) Performance support device and performance device
JP5444719B2 (en) Automatic performance electronic piano control device and program for realizing the control method
US5335574A (en) Self playing piano and an apparatus for automatic playing of a piano
JP5428344B2 (en) Automatic performance electronic piano control device
JP3997956B2 (en) Performance equipment
JP3891410B2 (en) Performance equipment
JP2008233828A (en) Controller of musical instrument
JP2014130197A (en) Half point specification method, device, and program of pedal of keyboard musical instrument
JP5119704B2 (en) Instrument control device
JP5772504B2 (en) Performance equipment
JP2005292803A (en) Player piano and program for automatically operating key
JP5062401B2 (en) Instrument control device
WO2024034285A1 (en) Automatic player piano, automatic playing method, and automatic playing program
JP2508208B2 (en) Low-pitched sound device of automatic playing piano
JP5169576B2 (en) Electronic keyboard instrument
JP4192982B2 (en) Performance equipment

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20111121

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20130111

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130219

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20130411

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20131209

R150 Certificate of patent or registration of utility model

Ref document number: 5444719

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees