JP5772504B2 - Performance equipment - Google Patents

Performance equipment Download PDF

Info

Publication number
JP5772504B2
JP5772504B2 JP2011234669A JP2011234669A JP5772504B2 JP 5772504 B2 JP5772504 B2 JP 5772504B2 JP 2011234669 A JP2011234669 A JP 2011234669A JP 2011234669 A JP2011234669 A JP 2011234669A JP 5772504 B2 JP5772504 B2 JP 5772504B2
Authority
JP
Japan
Prior art keywords
key
state
plunger
solenoid
flag
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
JP2011234669A
Other languages
Japanese (ja)
Other versions
JP2013092648A (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 JP2011234669A priority Critical patent/JP5772504B2/en
Publication of JP2013092648A publication Critical patent/JP2013092648A/en
Application granted granted Critical
Publication of JP5772504B2 publication Critical patent/JP5772504B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Electrophonic Musical Instruments (AREA)

Description

本発明は、押鍵及び離鍵を表す鍵情報に応じて、楽音信号を発生するとともに鍵を駆動する演奏装置に関する。   The present invention relates to a performance device that generates a musical sound signal and drives a key in accordance with key information representing key depression and key release.

従来から、例えば、下記特許文献1に示されているように、予め記録しておいた押離鍵情報を自動演奏装置によって読み出して、前記読み出した押離鍵情報に従って、楽音信号を発生させるとともに鍵を駆動する演奏装置は知られている。この演奏装置においては、押離鍵情報を読み出すと、その押離鍵情報に応じて、即座に楽音信号の生成が制御される。しかし、同一鍵についての繰り返し間隔の短い押離鍵情報に、鍵を駆動する駆動装置が追従できないこともある。そこで、発生される楽音に対する鍵の動きが不自然に感じられないように、駆動装置が追従できないような繰り返し間隔の短い押離鍵情報を、前記鍵の駆動制御に適用しないようにしている。   Conventionally, for example, as shown in Patent Document 1 below, the pre-recorded key release information is read by an automatic performance device, and a musical tone signal is generated according to the read key release key information. Performance devices that drive keys are known. In this performance device, when the key release / release information is read, the generation of the tone signal is immediately controlled in accordance with the key release / release information. However, the drive device that drives the key may not be able to follow the pressed / released key information with a short repetition interval for the same key. Therefore, in order not to feel the movement of the key with respect to the generated musical sound unnaturally, the pressing / release key information with a short repetition interval that cannot be followed by the driving device is not applied to the driving control of the key.

特開2008−233825JP2008-233825A

上記従来の演奏装置では、例えば同一鍵の連打演奏時のように、鍵の押鍵深さが押鍵開始時の深さからその最大深さに達するまでの短期間内に同一鍵に関する押離鍵情報を繰り返し読み出した場合(すなわち、同一鍵に関する複数組の離鍵情報及び押鍵情報を読み出した場合)には、これらの複数組の離鍵情報及び押鍵情報が全てキャンセルされる。また、離鍵開始直後又は離鍵終了直前の所定の期間内に、前記鍵に関する複数組の離鍵情報及び押鍵情報を読み出した場合も、これらの複数組の離鍵情報及び押鍵情報が全てキャンセルされる。したがって、短期間内における同一鍵についての押離鍵の繰り返し回数が多い連打演奏において、発音回数に対して鍵の駆動回数が少なくなることがあり、不自然に感じられることがあった。   In the conventional performance device described above, for example, during repeated performance of the same key, the key pressing depth of the key is within a short period of time until the key pressing depth reaches the maximum depth from the depth at the time of the key pressing start. When the key information is repeatedly read (that is, when a plurality of sets of key release information and key press information related to the same key are read), all the plurality of sets of key release information and key press information are canceled. Also, when a plurality of sets of key release information and key press information related to the key are read out immediately after the start of key release or immediately before the end of key release, the plurality of sets of key release information and key press information are All are canceled. Therefore, in a repetitive strike performance in which the number of times the key is pressed and released for the same key within a short period of time, the number of times the key is driven may be less than the number of times of sound generation, which may seem unnatural.

本発明は上記問題に対処するためになされたもので、その目的は、同一鍵に関して、短期間内の押離鍵の繰り返し回数が多い場合であっても、発音に対する鍵の動作が自然に感じられる演奏装置を提供することにある。なお、下記本発明の各構成要件の記載及び図17に示す作動原理図においては、本発明の理解を容易にするために、実施形態の対応箇所の符号を括弧内に記載しているが、本発明の各構成要件は、実施形態の符号によって示された対応箇所の構成に限定解釈されるべきものではない。   The present invention has been made to cope with the above problem, and the purpose of the present invention is to naturally feel the operation of the key with respect to the pronunciation even when the number of times the key is repeatedly pressed within a short period of time for the same key. It is in providing the performance apparatus. In addition, in the description of each constituent element of the present invention below and the operation principle diagram shown in FIG. 17, in order to facilitate understanding of the present invention, reference numerals of corresponding portions of the embodiment are described in parentheses. Each component of the present invention should not be construed as being limited to the configuration of the corresponding portion indicated by the reference numerals of the embodiments.

上記目的を達成するために、本発明の特徴は、揺動可能に支持された鍵(11)と、鍵を押鍵動作及び離鍵動作させる駆動手段(31)と、鍵の押鍵深さを検出する押鍵深さ検出手段(40)と、楽曲の演奏内容を表わす演奏情報に従って、鍵の押鍵を表す押鍵情報及び鍵の離鍵を表す離鍵情報を出力する自動演奏制御手段(45,S40〜S54)と、自動演奏制御手段及び外部機器のいずれか一方又は両方から入力した押鍵情報及び離鍵情報に応じて駆動手段を制御する鍵駆動制御手段であって、所定の短い期間内に押鍵情報及び離鍵情報を繰り返し入力したとき、離鍵動作途中に押鍵動作に切り替えて、鍵を連打するよう駆動手段を制御する鍵駆動制御手段(44,45,S60〜S86)と、自動演奏制御手段及び外部機器のいずれか一方又は両方から入力した押鍵情報及び離鍵情報に応じて楽音信号の発生を制御する楽音信号発生手段(48)とを備えた演奏装置において、鍵駆動制御手段は、連打の最初の押鍵開始後、前記入力した押鍵情報の回数をカウントする第1カウンタ(ONCT)と、連打の最初の押鍵開始後、鍵を押鍵動作させた回数をカウントする第2カウンタ(KDCT)と、鍵の離鍵動作途中であって、押鍵深さ検出手段によって検出した鍵の押鍵深さが所定の範囲内にある状態において、第1カウンタのカウント値と第2カウンタのカウント値との差(DIF)に応じて、連打を継続するか、連打を終了するかを決定する連打決定手段(S74,S82,S84,ST14,ST15)を備えたことにある。   In order to achieve the above object, the present invention is characterized by a key (11) supported so as to be swingable, a driving means (31) for pressing and releasing the key, and a key pressing depth of the key. A key depression depth detecting means (40) for detecting the key and automatic performance control means for outputting the key depression information representing the key depression and the key release information representing the key release in accordance with the performance information representing the performance content of the music. (45, S40 to S54) and a key drive control means for controlling the drive means in accordance with key pressing information and key release information input from either or both of the automatic performance control means and the external device, When key depression information and key release information are repeatedly input within a short period of time, the key drive control means (44, 45, S60˜) controls the drive means to switch to the key depression operation during the key release operation and repeatedly press the key. S86), any of automatic performance control means and external equipment In a performance apparatus comprising a musical tone signal generating means (48) for controlling the generation of musical tone signals in accordance with key pressing information and key release information input from one or both, the key drive control means is the first key pressing of repeated hits. A first counter (ONCT) that counts the number of times the input key pressing information is entered after the start, a second counter (KDCT) that counts the number of times that the key is pressed after the start of the first keystroke, While the key release operation is in progress and the key pressing depth detected by the key pressing depth detection means is within a predetermined range, the count value of the first counter and the count value of the second counter According to the difference (DIF), there is provided a continuous hit determining means (S74, S82, S84, ST14, ST15) for determining whether to continue the continuous hit or to end the continuous hit.

また、この場合、連打決定手段は、前記第1カウンタのカウント値と前記第2カウンタのカウント値との差が所定の第1基準値(b)よりも大きい場合、連打を継続し、第1カウンタのカウント値と第2カウンタのカウント値との差が第1基準値以下である場合、連打を終了すると決定するとよい。   Further, in this case, the continuous hit determining means continues the continuous hit when the difference between the count value of the first counter and the count value of the second counter is larger than a predetermined first reference value (b), When the difference between the count value of the counter and the count value of the second counter is equal to or less than the first reference value, it may be determined that the continuous hitting is ended.

また、この場合、連打決定手段は、連打を終了すると決定した後であって、鍵の離鍵動作が終了する前に新たな押鍵情報を入力したとき、連打を終了する決定を取り消して、連打を継続すると決定するとよい。なお、外部機器とは、演奏装置に接続されるMIDIシーケンサ、パーソナルコンピュータなどである。   Further, in this case, the repeated hit determining means cancels the determination to end the repeated hits after determining to end the repeated hits and when new key pressing information is input before the key release operation ends. It is good to decide to continue hitting. The external device is a MIDI sequencer, personal computer, or the like connected to the performance device.

これによれば、短期間内に同一鍵に関する押鍵情報及び離鍵情報が鍵駆動制御手段に繰り返し供給される場合、これらの押鍵情報及び離鍵情報に同期して、楽音信号の発生及び停止が制御される。また、同一鍵の連打が終了するまでに入力した押鍵情報の数と鍵の駆動回数とのずれが所定の回数(例えば、2回)以下であるので、前記連打時における押離鍵の回数が多い場合であっても、発音に対する鍵の動作が自然に感じられる。   According to this, when key press information and key release information relating to the same key are repeatedly supplied to the key drive control means within a short period of time, the generation of a tone signal is synchronized with these key press information and key release information and Stop is controlled. In addition, since the difference between the number of key press information input and the number of times the key is driven before the end of repeated hitting of the same key is less than or equal to a predetermined number (for example, 2 times), the number of pressed keys at the time of repeated hitting Even if there are many, the movement of the key with respect to pronunciation is felt naturally.

また、本発明の他の特徴は、連打決定手段は、第1カウンタのカウント値と第2カウンタのカウント値との差が、第1基準値よりも大きい場合であっても、第1基準値よりも大きな第2基準値(a)よりも大きい場合には、連打を終了すると決定することにある。   In addition, another feature of the present invention is that the repeated hit determination means has the first reference value even if the difference between the count value of the first counter and the count value of the second counter is larger than the first reference value. If it is larger than the larger second reference value (a), it is decided to end the repeated hitting.

上記のように構成すれば、連打動作途中において、連打開始からそれまでに供給された押鍵情報の数と鍵の駆動回数のずれが非常に大きくなった場合(例えば、6回)には、連打を終了させて、発音が終了した後になっても鍵が駆動されることを防止できる。すなわち、連打演奏において、最後の楽音の発生の停止とほぼ同時に、鍵の駆動も終了する。この場合、押離鍵回数が非常に多いので、楽音の発生回数と鍵の駆動回数とのずれが多少大きくても、鍵の動作が不自然に感じられることはない。   According to the above configuration, when the deviation between the number of key press information supplied from the start of repeated hitting and the number of times of key driving becomes very large (for example, six times) during the continuous hitting operation, It is possible to prevent the key from being driven even after the repeated hitting is finished and the sound generation is finished. That is, in the repeated performance, the driving of the key is ended almost simultaneously with the stop of the generation of the last musical sound. In this case, since the number of times the key is pressed and released is very large, even if the difference between the number of times the musical sound is generated and the number of times the key is driven is somewhat large, the key operation does not feel unnatural.

本発明の一実施形態に係る演奏装置が適用された電子楽器の全体ブロック図である。1 is an overall block diagram of an electronic musical instrument to which a performance device according to an embodiment of the present invention is applied. 図1の鍵盤装置の1つの鍵及びその周辺部についての側面図である。It is a side view about one key and its peripheral part of the keyboard apparatus of FIG. 図2のソレノイド及びその周辺部の拡大側面図である。FIG. 3 is an enlarged side view of the solenoid of FIG. 2 and its peripheral part. デューティ比テーブルの概念図である。It is a conceptual diagram of a duty ratio table. 制御状態の分類表である。It is a classification table of a control state. 初期化プログラムのフローチャートである。It is a flowchart of an initialization program. 手動演奏プログラムのフローチャートである。It is a flowchart of a manual performance program. 図7のキーイベント処理ルーチンのフローチャートである。It is a flowchart of the key event processing routine of FIG. 自動演奏プログラムのフローチャートである。It is a flowchart of an automatic performance program. 鍵駆動プログラムのフローチャートである。It is a flowchart of a key drive program. ソレノイドの制御状態の遷移を表す状態遷移図である。It is a state transition diagram showing transition of the control state of a solenoid. 通常駆動時のソレノイドの状態遷移及びプランジャ軌跡の説明図である。It is explanatory drawing of the state transition of a solenoid at the time of normal drive, and a plunger locus | trajectory. スタッカート駆動時のソレノイドの状態遷移及びプランジャ軌跡の説明図である。It is explanatory drawing of the state transition of a solenoid at the time of a staccato drive, and a plunger locus | trajectory. 連打駆動時のソレノイドの状態遷移及びプランジャ軌跡の前半部分の説明図である。It is explanatory drawing of the first half part of the state transition of a solenoid at the time of continuous driving, and a plunger locus | trajectory. 連打駆動時のソレノイドの状態遷移及びプランジャ軌跡の後半部分の説明図である。It is explanatory drawing of the latter half part of the state transition of a solenoid at the time of continuous driving, and a plunger locus | trajectory. 図14Bの連打駆動において、連打を終了せずに、さらに連打を継続した場合のソレノイドの状態遷移及びプランジャ軌跡の説明図である。14B is an explanatory diagram of solenoid state transition and plunger trajectory when continuous hitting is continued without ending the continuous hitting in the continuous hitting drive of FIG. 14B. 本発明の変形例に係るソレノイド及びその周辺部の拡大図である。It is an enlarged view of the solenoid which concerns on the modification of this invention, and its peripheral part. 図16Aの連結部材周辺の拡大図である。FIG. 16B is an enlarged view around the connecting member of FIG. 16A. 本発明の作動原理図である。It is an operation principle diagram of the present invention.

本発明の一実施形態について図面を用いて説明する。この電子楽器は、図1及び図2に示すように、鍵盤装置10を備えている。鍵盤装置10は、それぞれ発生させる楽音信号の音高を指定するとともに楽音信号の発生及び停止を指示する複数の白鍵及び黒鍵を有する。なお、図2においては、1つの白鍵及びその周辺の構成部品を示しているが、黒鍵に関する構成も同様である。また、白鍵及び黒鍵の動作も同様であるので、以下の説明においては、白鍵及び黒鍵を鍵11として説明する。   An embodiment of the present invention will be described with reference to the drawings. As shown in FIGS. 1 and 2, the electronic musical instrument includes a keyboard device 10. The keyboard device 10 has a plurality of white keys and black keys that designate the pitches of the tone signals to be generated and instruct the generation and stop of the tone signals. In FIG. 2, one white key and its peripheral components are shown, but the configuration relating to the black key is the same. Since the operations of the white key and the black key are the same, the white key and the black key will be described as the key 11 in the following description.

鍵11は、前後方向の中間部が、フレームFRの鍵支持部材12に支持されている。鍵支持部材12は、フレームFRにおいて、鍵11の配列方向に沿って延設されたバランスレール12aと、バランスレール12aの上に垂直に設けられた支点ピン12bを備えている。鍵11の前後方向の中間部には、上下に貫通する貫通孔11aが設けられていて、この貫通孔11aに支点ピン12bが挿入されている。貫通孔11aは、下端部から上端部へ向かうに従って、前後方向の幅が広くなっている。これにより、鍵11は、支点ピン12bを支点として揺動可能となっている。すなわち、演奏者による押離鍵操作によって、鍵11の前端部及び後端部が上下方向へ移動可能となっている。また、鍵11の前端部の下方には、フロントピン13が、垂直に延設されている。フロントピン13は、その上端部が鍵11の下面に設けられた孔部に挿入されており、鍵11の前端部の横方向の振れを規制する。   The key 11 is supported by the key support member 12 of the frame FR at the middle part in the front-rear direction. The key support member 12 includes a balance rail 12a extending in the arrangement direction of the keys 11 in the frame FR, and a fulcrum pin 12b provided vertically on the balance rail 12a. A through hole 11a penetrating vertically is provided in an intermediate portion in the front-rear direction of the key 11, and a fulcrum pin 12b is inserted into the through hole 11a. The through-hole 11a has a width in the front-rear direction that increases from the lower end to the upper end. As a result, the key 11 can swing about the fulcrum pin 12b as a fulcrum. That is, the front end portion and the rear end portion of the key 11 can be moved in the vertical direction by a key release operation by the performer. A front pin 13 extends vertically below the front end of the key 11. The front pin 13 is inserted at its upper end into a hole provided in the lower surface of the key 11, and restricts lateral deflection of the front end of the key 11.

鍵11の後端部の下方のフレームFRの表面には、上限ストッパー14が接着されている。上限ストッパー14は、フエルトなどの緩衝材によって構成され、鍵11が押鍵されない状態において、鍵11の後端部の下面に当接して、鍵11の前端部の上方向への移動を規制する。このように、前端部の上方向への移動が規制された状態の鍵11の前端部の押鍵深さ方向の位置をレスト位置という。また、鍵11の前端部の下方のフレームFRの表面には、下限ストッパー15が接着されている。下限ストッパー15は、上限ストッパー14と同様に構成され、鍵11が押鍵された状態において、鍵11の前端部の下面に当接して、鍵11の前端部の下方向への移動を規制する。このように、前端部の下方向への移動が規制された状態の鍵11の前端部の押鍵深さ方向の位置をフルストローク位置という。   An upper limit stopper 14 is bonded to the surface of the frame FR below the rear end of the key 11. The upper limit stopper 14 is made of a cushioning material such as felt, and abuts against the lower surface of the rear end portion of the key 11 in a state where the key 11 is not depressed, thereby restricting the upward movement of the front end portion of the key 11. . As described above, the position of the front end portion of the key 11 in the state where the upward movement of the front end portion is restricted is referred to as a rest position. A lower limit stopper 15 is bonded to the surface of the frame FR below the front end of the key 11. The lower limit stopper 15 is configured in the same manner as the upper limit stopper 14, and abuts against the lower surface of the front end portion of the key 11 in a state where the key 11 is pressed, thereby restricting the downward movement of the front end portion of the key 11. . Thus, the position of the front end portion of the key 11 in a state where the downward movement of the front end portion is restricted is referred to as a full stroke position.

また、鍵支持部材12より後方には、各鍵11と連動してそれぞれ揺動するハンマー20が設けられている。ハンマー20は、ハンマー支持部21に支持されている。ハンマー20は、棒状のハンマーシャンク20aとハンマーシャンク20aの後端に組み付けられた質量体20bからなる。低音部のハンマー20から高音部のハンマー20に向かうに従って、質量体20bを徐々に軽くして、手動演奏時の鍵タッチ感をアコースティックピアノの鍵タッチ感に近似させている。   In addition, behind the key support member 12, hammers 20 that swing in conjunction with the keys 11 are provided. The hammer 20 is supported by a hammer support portion 21. The hammer 20 includes a rod-shaped hammer shank 20a and a mass body 20b assembled at the rear end of the hammer shank 20a. The mass body 20b is gradually lightened from the low-pitched hammer 20 toward the high-pitched hammer 20, and the key touch feeling during manual performance is approximated to the key touch feeling of an acoustic piano.

ハンマー支持部21は、支持板21a、ハンマーレール21b、上限ストッパーレール21c、下限ストッパーレール21d、上限ストッパー21e、及び下限ストッパー21fからなる。支持板21aは、左右方向に薄肉の板状に形成され、前後方向かつ垂直方向に延設されている。複数の支持板21aが、フレームFR上に、左右方向に所定の間隔(例えば、1オクターブごと)をおいて設けられている。すなわち、支持板21aは、所定の隣り合う2つの鍵(例えば、B鍵とC鍵)の間に設けられている。前記所定の隣り合う2つの鍵の後端部は、支持板21aと干渉しないように、他の鍵11に比べて、左右方向の幅がやや狭く形成されている。また、支持板21aの上端部の中央の部分が下方へ向かって大きく切り欠かれている。この切り欠きよりも前方の部分を前部21a1と呼び、後方の部分を後部21a2と呼ぶ。前部21a1の上端には、レール状に形成されたハンマーレール21bが、隣り合う支持板21aを連結するようにして、組み付けられている。すなわち、ハンマーレール21bは、鍵11の並び方向に延設されていて、その下面が各前部21a1の上端に支持されている。   The hammer support portion 21 includes a support plate 21a, a hammer rail 21b, an upper limit stopper rail 21c, a lower limit stopper rail 21d, an upper limit stopper 21e, and a lower limit stopper 21f. The support plate 21a is formed in a thin plate shape in the left-right direction, and extends in the front-rear direction and the vertical direction. A plurality of support plates 21a are provided on the frame FR at predetermined intervals (for example, every one octave) in the left-right direction. That is, the support plate 21a is provided between two predetermined adjacent keys (for example, B key and C key). The rear end portions of the two predetermined adjacent keys are formed to be slightly narrower in the left-right direction than the other keys 11 so as not to interfere with the support plate 21a. Further, the central portion of the upper end portion of the support plate 21a is greatly cut out downward. A portion in front of the notch is referred to as a front portion 21a1, and a portion in the rear is referred to as a rear portion 21a2. A hammer rail 21b formed in a rail shape is assembled to the upper end of the front portion 21a1 so as to connect adjacent support plates 21a. That is, the hammer rail 21b extends in the direction in which the keys 11 are arranged, and the lower surface thereof is supported by the upper end of each front portion 21a1.

ハンマーレール21bの後端部には、ハンマー20を支持するハンマー支点部21b1が設けられていて、ハンマーシャンク20aの前端部がハンマー支点部21b1に支持されている。これにより、ハンマー20がハンマー支点部21b1を支点として揺動可能となっている。すなわち、鍵11が揺動することにより、ハンマー20の質量体20b側が、上下に移動可能となっている。また、後部21a2の後端部の中央の部分が切り欠かれて、前方へ凹んだ凹部が形成されている。この凹部の上端部及び下端部には、レール状に形成された上限ストッパーレール21c及び下限ストッパーレール21dがそれぞれ組み付けられている。   A hammer fulcrum portion 21b1 for supporting the hammer 20 is provided at the rear end portion of the hammer rail 21b, and the front end portion of the hammer shank 20a is supported by the hammer fulcrum portion 21b1. Thereby, the hammer 20 can swing around the hammer fulcrum portion 21b1. That is, when the key 11 swings, the mass body 20b side of the hammer 20 can be moved up and down. Moreover, the center part of the rear-end part of the rear part 21a2 is notched, and the recessed part dented ahead is formed. An upper limit stopper rail 21c and a lower limit stopper rail 21d formed in a rail shape are respectively assembled to the upper end portion and the lower end portion of the recess.

上限ストッパーレール21c及び下限ストッパーレール21dは、鍵11の並び方向に延設されていて、各支持板21aの後部21a2にそれぞれ支持されている。上限ストッパーレール21cの下面には、鍵11の上限ストッパー14と同様の、上限ストッパー21eが組み付けられている。上限ストッパー21eは、鍵11が押鍵された状態において、ハンマーシャンク20aの後端部の上面に当接して、ハンマー20の後端部の上方向への移動を規制する。一方、下限ストッパーレール21dの上面には、上限ストッパー14と同様の、下限ストッパー21fが組み付けられている。下限ストッパー21fは、鍵11が押鍵されない状態において、ハンマーシャンク20aの後端部の下面に当接して、ハンマー20の後端部の下方向への移動を規制する。   The upper limit stopper rail 21c and the lower limit stopper rail 21d extend in the direction in which the keys 11 are arranged, and are respectively supported by the rear portions 21a2 of the support plates 21a. An upper limit stopper 21e similar to the upper limit stopper 14 of the key 11 is assembled to the lower surface of the upper limit stopper rail 21c. The upper limit stopper 21e abuts on the upper surface of the rear end portion of the hammer shank 20a in a state where the key 11 is pressed, and restricts the upward movement of the rear end portion of the hammer 20. On the other hand, a lower limit stopper 21f similar to the upper limit stopper 14 is assembled on the upper surface of the lower limit stopper rail 21d. The lower limit stopper 21f abuts on the lower surface of the rear end portion of the hammer shank 20a in a state where the key 11 is not depressed, and restricts the downward movement of the rear end portion of the hammer 20.

支持板21aの後部21a2の前端部には、レール状に形成されたソレノイドレール30が組み付けられている。すなわち、ソレノイドレール30は、鍵11の並び方向に延設されていて、各支持板21aの後部21a2に支持されている。ソレノイドレール30には、各鍵11に対応したソレノイド31がそれぞれ組み付けられている。ソレノイド31は、図3に示すように、ボビン31a、コイル31b、プランジャ31c及びヨーク31dからなる。ボビン31aは、円筒状に形成されている。ボビン31aの外周部には、電線が巻き付けられてコイル31bが形成されている。プランジャ31cは、ボビン31a内に上下に移動可能に収容されていて、ソレノイド31への非通電時には、自重及びハンマー20の重量により降下する。一方、ソレノイド31への通電時には、プランジャ31cは、電磁力により自重及びハンマー20の重量に抗して上方へ変位する。また、ヨーク31dは、コイル31bを取り囲むようにして設けられ、漏れ磁束を低減する。ソレノイド31は、ヨーク31dに設けた図示しない取り付け部にてソレノイドレール30に固定されている。   A solenoid rail 30 formed in a rail shape is assembled to the front end portion of the rear portion 21a2 of the support plate 21a. That is, the solenoid rail 30 extends in the direction in which the keys 11 are arranged, and is supported by the rear portion 21a2 of each support plate 21a. A solenoid 31 corresponding to each key 11 is assembled to the solenoid rail 30. As shown in FIG. 3, the solenoid 31 includes a bobbin 31a, a coil 31b, a plunger 31c, and a yoke 31d. The bobbin 31a is formed in a cylindrical shape. An electric wire is wound around the outer periphery of the bobbin 31a to form a coil 31b. The plunger 31c is accommodated in the bobbin 31a so as to be movable up and down, and descends due to its own weight and the weight of the hammer 20 when the solenoid 31 is not energized. On the other hand, when the solenoid 31 is energized, the plunger 31c is displaced upward against its own weight and the weight of the hammer 20 by electromagnetic force. The yoke 31d is provided so as to surround the coil 31b, and reduces leakage magnetic flux. The solenoid 31 is fixed to the solenoid rail 30 by a mounting portion (not shown) provided on the yoke 31d.

プランジャ31cの上端には、プランジャ31cよりも細い第1ロッド32が連結されている。また、プランジャ31cの下端には、第1ロッド32と同程度の太さの第2ロッド33が連結されている。プランジャ31c、第1ロッド32及び第2ロッド33の中心軸は共通である。第1ロッド32の上端面には、後述する位置センサ40の一部を構成する反射板35が組み付けられている。   A first rod 32 thinner than the plunger 31c is connected to the upper end of the plunger 31c. A second rod 33 having the same thickness as the first rod 32 is connected to the lower end of the plunger 31c. The central axes of the plunger 31c, the first rod 32, and the second rod 33 are common. On the upper end surface of the first rod 32, a reflecting plate 35 constituting a part of a position sensor 40 described later is assembled.

反射板35は、合成樹脂によって形成された軽量な部材で、第1ロッド32の上端面に組み付けられている。反射板35は、前方へ延設された水平部35aと水平部35aの前端部から下方へ垂直に延設された垂直壁部35bからなり、水平部35aの下面と第1ロッド32の上端面とが接着されている。反射板35の水平部35aの上面には、台部材36が組み付けられている。台部材36の上面は、水平に形成されている。   The reflecting plate 35 is a lightweight member made of synthetic resin and is assembled to the upper end surface of the first rod 32. The reflection plate 35 includes a horizontal portion 35 a extending forward and a vertical wall portion 35 b extending vertically downward from a front end portion of the horizontal portion 35 a, and includes a lower surface of the horizontal portion 35 a and an upper end surface of the first rod 32. And are adhered. A base member 36 is assembled on the upper surface of the horizontal portion 35 a of the reflecting plate 35. The upper surface of the base member 36 is formed horizontally.

ハンマーシャンク20aにおける、台部材36に対向する部分には、円筒状のローラ20a1が組み付けられている。ローラ20a1の中心軸は、鍵11の並び方向に平行である。離鍵状態において、ローラ20a1の下側の外周面が、台部材36の上面に当接している。一方、第2ロッド33の下端には、連結部材であるプランジャキャップ37が組み付けられている。プランジャキャップ37の下端面には、シート状の緩衝シート37aが貼り付けられている。そして、緩衝シート37aの下面には、シート状の低摩擦シート37bが貼り付けられている。緩衝シート37aは、後述するキャプスタンスクリュー38とプランジャキャップ37との当接による衝撃を吸収する。また、低摩擦シート37bは、キャプスタンスクリュー38と緩衝シート37aとの摩擦を低減する。   A cylindrical roller 20a1 is assembled to a portion of the hammer shank 20a facing the base member 36. The central axis of the roller 20a1 is parallel to the direction in which the keys 11 are arranged. In the key release state, the lower outer peripheral surface of the roller 20 a 1 is in contact with the upper surface of the base member 36. On the other hand, a plunger cap 37 as a connecting member is assembled to the lower end of the second rod 33. A sheet-like buffer sheet 37 a is attached to the lower end surface of the plunger cap 37. And the sheet-like low friction sheet | seat 37b is affixed on the lower surface of the buffer sheet | seat 37a. The buffer sheet 37 a absorbs an impact caused by contact between a capstan screw 38 and a plunger cap 37 described later. Further, the low friction sheet 37b reduces friction between the capstan screw 38 and the buffer sheet 37a.

また、鍵11の後端部であって、プランジャキャップ37に対向する部分には、キャプスタンスクリュー38が組み付けられている。キャプスタンスクリュー38の上面は、凸状かつ曲面状に形成されている。上記のように、ソレノイド31への非通電時には、プランジャ31cは、自重及びハンマー20の重量により降下する。これにより、低摩擦シート37bの下面がキャプスタンスクリュー38の上面に当接して、キャプスタンスクリュー38を下方へ押すことにより、鍵11の前端部が上方へ移動してレスト位置にて停止する。一方、ソレノイド31への通電時には、プランジャ31cは、電磁力により自重及びハンマー20の重量に抗して上方へ移動する。これにより、プランジャキャップ37も上方へ移動する。鍵11は、後端部よりも前端部の方が重いので、鍵11の前端部が下方へ移動する。   A capstan screw 38 is assembled to the rear end portion of the key 11 and facing the plunger cap 37. The upper surface of the capstan screw 38 is formed in a convex and curved shape. As described above, when the solenoid 31 is not energized, the plunger 31 c is lowered by its own weight and the weight of the hammer 20. As a result, the lower surface of the low friction sheet 37b comes into contact with the upper surface of the capstan screw 38 and pushes the capstan screw 38 downward, so that the front end of the key 11 moves upward and stops at the rest position. On the other hand, when the solenoid 31 is energized, the plunger 31c moves upward against its own weight and the weight of the hammer 20 by electromagnetic force. As a result, the plunger cap 37 also moves upward. Since the front end of the key 11 is heavier than the rear end, the front end of the key 11 moves downward.

また、鍵盤装置10は、プランジャ31cの位置を検出する位置センサ40を備えている。位置センサ40は、ヨーク31dの前面に設けた発光部40a、受光部40b、及び反射板35からなる。発光部40aから出射された光は、反射板35にて反射して、受光部40bによって受光される。反射板35の垂直壁部35bの後面の光の反射率が、下部から上部に向かうに従って徐々に変化するように構成されている。ソレノイド31が駆動され、反射板35が上下に移動することにより、受光部40bに入射する光の強度が変化する。すなわち、受光部40bにて受光した光の強度は、プランジャ31cの上下方向の位置に対応している。位置センサ40は、受光部40bにて受光した光の強度に応じて、プランジャ31cの位置Pを表す位置信号を出力する。   The keyboard device 10 also includes a position sensor 40 that detects the position of the plunger 31c. The position sensor 40 includes a light emitting unit 40a, a light receiving unit 40b, and a reflecting plate 35 provided on the front surface of the yoke 31d. The light emitted from the light emitting unit 40a is reflected by the reflecting plate 35 and received by the light receiving unit 40b. The reflectance of the light on the rear surface of the vertical wall portion 35b of the reflecting plate 35 is configured to gradually change from the lower portion toward the upper portion. As the solenoid 31 is driven and the reflecting plate 35 moves up and down, the intensity of light incident on the light receiving unit 40b changes. That is, the intensity of the light received by the light receiving unit 40b corresponds to the vertical position of the plunger 31c. The position sensor 40 outputs a position signal indicating the position P of the plunger 31c according to the intensity of light received by the light receiving unit 40b.

また、各鍵11の前端部の下方には、手動演奏時の鍵11の押離鍵操作を検出する鍵スイッチSWが設けられている。鍵スイッチSWは、第1スイッチSW1及び第2スイッチSW2からなる。鍵11が押鍵されない状態においては、両スイッチはオフ状態である。そして、鍵11を押すと、まず第1スイッチSW1がオフ状態からオン状態に切り替わり、さらに、押鍵深さが大きくなると、第2スイッチSW2がオフ状態からオン状態に切り替わる。そして、鍵11を離すと、第2スイッチSW2がオン状態からオフ状態に切り替わり、さらに押鍵深さが小さくなると、第1スイッチSW1がオン状態からオフ状態に切り替わる。   Further, below the front end of each key 11, there is provided a key switch SW for detecting a key release operation of the key 11 during manual performance. The key switch SW includes a first switch SW1 and a second switch SW2. When the key 11 is not depressed, both switches are in the off state. When the key 11 is pressed, the first switch SW1 is first switched from the OFF state to the ON state, and when the key pressing depth is further increased, the second switch SW2 is switched from the OFF state to the ON state. When the key 11 is released, the second switch SW2 is switched from the on state to the off state, and when the key depression depth is further reduced, the first switch SW1 is switched from the on state to the off state.

また、この電子楽器は、バス42に接続された検出回路43を備えている。手動演奏時における各鍵11の第1スイッチSW1及び第2スイッチSW2のオン・オフ動作は、検出回路43によって検出される。すなわち、検出回路43は、各鍵11の第1スイッチSW1及び第2スイッチSW2を走査して、スイッチSW2がオフ状態からオン状態へ変化したことを検出すると、後述するコンピュータ部45に、割り込み信号を出力するとともに、同スイッチの属する鍵11に割り当てられた音高を表すキーコード及び押鍵されたことを表すキーオン指令(キーオンデータ)を出力してキーオンイベントを発生させる。また、検出回路43は、第1スイッチSW1がオン状態からオフ状態に変化したことを検出すると、コンピュータ部45に、割り込み信号を出力するとともに、同スイッチの属する鍵11の音高を表すキーコード及び離鍵されたことを表すキーオフ指令(キーオフデータ)を出力してキーオフイベントを発生させる。また、検出回路43は、コンピュータ部45からの指示に応じて、位置センサ40からプランジャ31cの位置Pを表す位置信号を入力して、コンピュータ部45に出力する。   The electronic musical instrument also includes a detection circuit 43 connected to the bus 42. The on / off operation of the first switch SW1 and the second switch SW2 of each key 11 during manual performance is detected by the detection circuit 43. That is, when the detection circuit 43 scans the first switch SW1 and the second switch SW2 of each key 11 and detects that the switch SW2 has changed from the off state to the on state, the detection circuit 43 sends an interrupt signal to the computer unit 45 described later. And a key code indicating the pitch assigned to the key 11 to which the switch belongs and a key-on command (key-on data) indicating that the key has been depressed are generated to generate a key-on event. When the detection circuit 43 detects that the first switch SW1 has changed from the on state to the off state, the detection circuit 43 outputs an interrupt signal to the computer unit 45 and also represents a key code representing the pitch of the key 11 to which the switch belongs. A key-off command (key-off data) indicating that the key has been released is output to generate a key-off event. Further, the detection circuit 43 inputs a position signal indicating the position P of the plunger 31 c from the position sensor 40 in accordance with an instruction from the computer unit 45 and outputs the position signal to the computer unit 45.

また、この電子楽器は、バス42に接続された駆動回路44を備えている。駆動回路44は、パルス幅変調(PWM)した駆動信号を供給して、ソレノイド31を駆動する。具体的には、バス42を介して、コンピュータ部45から供給されるキーコード及びデューティ比を入力して、キーコードによって表される鍵11に対応したソレノイド31に、前記デューティ比に設定されたPWM信号を駆動信号として供給する。   The electronic musical instrument also includes a drive circuit 44 connected to the bus 42. The drive circuit 44 supplies a pulse width modulated (PWM) drive signal to drive the solenoid 31. Specifically, the key code and the duty ratio supplied from the computer unit 45 are input via the bus 42, and the duty ratio is set to the solenoid 31 corresponding to the key 11 represented by the key code. A PWM signal is supplied as a drive signal.

また、この電子楽器は、バス42に接続されたコンピュータ部45を備えている。コンピュータ部45は、CPU45a、タイマ45b、ROM45c及びRAM45dからなる。CPU45aは、後述の各種プログラムを実行して音源回路48を制御して、自動演奏及び手動演奏に応じた楽音信号を発生させる。さらに、自動演奏時においては、ソレノイド31を制御して、鍵11を駆動する。本実施形態においては、詳しくは後述するように、ソレノイド31の制御状態が、複数のフラグの値の組み合わせに応じて分類されている。キーイベントの発生、プランジャ31cの移動などに起因して、前記複数のフラグの値が変化する。これにより、ソレノイド31の制御状態が遷移する。各制御状態において、ソレノイド31へ供給する駆動信号の制御情報(すなわち、出力フラグPWFの値)が規定されていて、CPU45aは、この制御情報に従ってソレノイド31を制御する。   The electronic musical instrument also includes a computer unit 45 connected to the bus 42. The computer unit 45 includes a CPU 45a, a timer 45b, a ROM 45c, and a RAM 45d. The CPU 45a executes various programs to be described later and controls the tone generator circuit 48 to generate musical tone signals corresponding to automatic performance and manual performance. Further, during automatic performance, the solenoid 11 is controlled to drive the key 11. In the present embodiment, as will be described in detail later, the control states of the solenoid 31 are classified according to combinations of a plurality of flag values. Due to the occurrence of a key event, movement of the plunger 31c, etc., the values of the plurality of flags change. As a result, the control state of the solenoid 31 changes. In each control state, control information (that is, the value of the output flag PWF) of the drive signal supplied to the solenoid 31 is defined, and the CPU 45a controls the solenoid 31 according to this control information.

タイマ45bは、予めCPU45aによって設定された周期で、割り込み信号をCPU45aに出力する。ROM45cは、この電子楽器に予め組み込まれている半導体メモリ及びハードディスク、並びにこの電子楽器に装着可能なHDD、FDD、CD−ROM、MO、DVDなどの大容量の不揮発性記録媒体と、同各記録媒体に対応するドライブユニットを含むものであり、各種プログラム及び各種データを記憶する。   The timer 45b outputs an interrupt signal to the CPU 45a at a cycle set in advance by the CPU 45a. The ROM 45c includes a semiconductor memory and a hard disk built in the electronic musical instrument in advance, a large-capacity nonvolatile recording medium such as an HDD, FDD, CD-ROM, MO, and DVD that can be mounted on the electronic musical instrument, It includes a drive unit corresponding to the medium, and stores various programs and various data.

本実施形態においては、ROM45cに、楽曲を自動演奏するための複数の曲データ、ソレノイド31へ供給する駆動信号のデューティ比を表す複数のデューティ比テーブルなどが記憶されている。各曲データは、ヘッダ、及び一連のイベントデータからなる。ヘッダは、曲名、初期の音色、音量、演奏のテンポなどを表す複数のデータからなる。イベントデータには、キーオンデータ、キーオフデータ、楽音制御データ、テンポデータ、エンドデータなどが含まれる。詳しくは後述するように、CPU45aによって、この曲データを読み出して再生することにより、コンピュータ部45は、自動演奏制御装置として動作する。   In the present embodiment, the ROM 45c stores a plurality of song data for automatically playing a song, a plurality of duty ratio tables indicating the duty ratio of the drive signal supplied to the solenoid 31, and the like. Each piece of music data includes a header and a series of event 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 data, key-off data, musical tone control data, tempo data, end data, and the like. As will be described in detail later, the computer unit 45 operates as an automatic performance control device by reading and reproducing the music data by the CPU 45a.

キーオンデータは、発生させる楽音信号の音高を表すキーコード及び押鍵を表すキーオン指令から構成されている。すなわち、キーオンデータは、手動演奏における押鍵時に検出回路43から出力されるキーコード及びキーオン指令と同様のデータから構成されている。キーオフデータは、発生中の楽音の音高を表すキーコード及び離鍵を表すキーオフ指令から構成されている。すなわち、キーオフデータは、手動演奏における離鍵時に検出回路43から出力されるキーコード及びキーオフ指令と同様のデータから構成されている。   The key-on data is composed of a key code representing the pitch of the musical sound signal to be generated and a key-on command representing the key depression. That is, the key-on data is composed of the same data as the key code and key-on command output from the detection circuit 43 when the key is depressed during manual performance. The key-off data is composed of a key code representing the pitch of the musical tone being generated and a key-off command representing the key release. That is, the key-off data is composed of data similar to the key code and key-off command output from the detection circuit 43 when the key is released during manual performance.

楽音制御データは、発生中の楽音信号の音色、音量などを変化させる制御データから構成されている。テンポデータは、自動演奏のテンポを変更させる制御データから構成されている。これらのキーオンデータ、キーオフデータ、楽音制御データ及びテンポデータは、それらの楽曲中のタイミングを表すテンポクロックタイミングをそれぞれ含む。エンドデータは、曲の終了を表す。なお、上述のキーオンデータ、キーオフデータ及び楽音制御データを、楽音制御パラメータと呼ぶ。また、上述の曲データ及びプログラムは予め各記録媒体に記録されていてもよいし、後述するMIDIインターフェース回路52及び通信インターフェース回路53を介して外部機器から取り込んでもよい。   The musical tone control data is composed of control data for changing the tone color and volume of the musical tone signal being generated. The tempo data is composed of control data for changing the tempo of automatic performance. These key-on data, key-off data, musical tone control data, and tempo data each include a tempo clock timing representing the timing in the music. End data represents the end of the song. The above key-on data, key-off data, and musical tone control data are referred to as musical tone control parameters. The music data and program described above may be recorded in advance on each recording medium, or may be taken in from an external device via a MIDI interface circuit 52 and a communication interface circuit 53 described later.

複数のデューティ比テーブルは、図4に示すように、それぞれ、鍵11を円滑に移動させるために、プランジャ31cの位置(すなわち、押鍵深さ)とソレノイド31に供給する駆動信号(PWM信号)のデューティ比との関係を規定している。押鍵時のテーブルと離鍵時のテーブルは異なる。すなわち、各デューティ比テーブルは、ヒステリシスを有する。以下の説明において、鍵11をレスト位置からフルストローク位置へ向かって移動させるときにソレノイド31へ供給する駆動信号を押鍵用の駆動信号といい、鍵11をフルストローク位置からレスト位置へ向かって移動させるときにソレノイド31へ供給する駆動信号を離鍵用の駆動信号という。また、プランジャ31cの位置に応じたデューティ比の平均値は、デューティ比テーブルごとに異なる。鍵11の属する音域(例えば、低音域、中音域、高音域)に応じて、鍵11は、複数のデューティ比テーブルのうちのいずれか1つに割り当てられている。具体的には、鍵盤装置10の質量体は低音域ほど重い(すなわち、回転モーメントが大きい)ため、低音域の鍵11ほど、デューティ比の平均値が大きいデューティ比テーブルに割り当てられている。   As shown in FIG. 4, each of the plurality of duty ratio tables includes a position of the plunger 31c (that is, a key pressing depth) and a drive signal (PWM signal) supplied to the solenoid 31 in order to move the key 11 smoothly. It defines the relationship with the duty ratio. The table at the time of key pressing is different from the table at the time of key release. That is, each duty ratio table has hysteresis. In the following description, a drive signal supplied to the solenoid 31 when the key 11 is moved from the rest position toward the full stroke position is referred to as a key pressing drive signal, and the key 11 is moved from the full stroke position toward the rest position. A drive signal supplied to the solenoid 31 when moving is referred to as a key release drive signal. Further, the average value of the duty ratio according to the position of the plunger 31c differs for each duty ratio table. The key 11 is assigned to any one of a plurality of duty ratio tables according to the sound range to which the key 11 belongs (for example, a low sound range, a middle sound range, and a high sound range). Specifically, since the mass body of the keyboard device 10 is heavier in the lower sound range (that is, the rotational moment is larger), the key 11 in the lower sound range is assigned to a duty ratio table having a larger average value of the duty ratio.

RAM45dは、各種プログラムの実行に必要なデータを一時的に記憶する。とくに、本実施形態においては、RAM45dは、鍵11ごとに、ソレノイド31の制御状態を判定するためのデータを記憶する。具体的には、MIDIステータスフラグMSF、プランジャ位置フラグPF1乃至PF3、前状態出力フラグPPWF、キーオン回数ONCT、キーオフ回数OFCT、鍵駆動回数KDCT、キーオフ回数フラグOFF及び鍵駆動回数フラグKDFの値を記憶する。   The RAM 45d temporarily stores data necessary for executing various programs. In particular, in the present embodiment, the RAM 45 d stores data for determining the control state of the solenoid 31 for each key 11. Specifically, the values of MIDI status flag MSF, plunger position flags PF1 to PF3, previous state output flag PPWF, key-on count ONCT, key-off count OFCT, key drive count KDCT, key-off count flag OFF, and key drive count flag KDF are stored. To do.

MIDIステータスフラグMSFは、自動演奏時において発生した最新のキーイベントの種類を表す。すなわち、MIDIステータスフラグMSFは、キーオンイベントが発生すると「1」に設定され、キーオフイベントが発生すると「0」に設定される。   The MIDI status flag MSF represents the type of the latest key event that occurred during automatic performance. That is, the MIDI status flag MSF is set to “1” when a key-on event occurs, and is set to “0” when a key-off event occurs.

プランジャ位置フラグP1乃至P3の値は、プランジャ31cの位置に応じて決定される。ここで、ソレノイド31の非通電状態であって、鍵11がレスト位置にあるときのプランジャ31cの位置を初期位置PS(0mm)とし、ソレノイド31が駆動されて、鍵11がフルストローク位置にあるときのプランジャ31cの位置を限界位置PE(5mm)とする。そして、初期位置PSと限界位置PEとの間に第1位置P1(0.3mm)、第2位置P2(3.5mm)及び第3位置P3(4.7mm)を設定している。プランジャ31cが、初期位置PSから第1位置P1までの間にあるとき、プランジャ位置フラグPF1乃至PF3は、いずれも「0」に設定される。プランジャ31cが、第1位置P1から第2位置P2までの間にあるとき、プランジャ位置フラグPF1が「1」に設定され、残りのプランジャ位置フラグPF2及びPF3は「0」に設定される。プランジャ31cが第2位置P2から第3位置P3までの間にあるとき、プランジャ位置フラグPF1及びPF2が「1」に設定され、プランジャ位置フラグPF3が「0」に設定される。そして、プランジャ31cが、第3位置P3から限界位置PEまでの間にあるとき、プランジャ位置フラグPF1乃至PF3が「1」に設定される。   The values of the plunger position flags P1 to P3 are determined according to the position of the plunger 31c. Here, when the solenoid 31 is in a non-energized state, the position of the plunger 31c when the key 11 is at the rest position is set to the initial position PS (0 mm), the solenoid 31 is driven, and the key 11 is at the full stroke position. The position of the plunger 31c at this time is defined as a limit position PE (5 mm). A first position P1 (0.3 mm), a second position P2 (3.5 mm), and a third position P3 (4.7 mm) are set between the initial position PS and the limit position PE. When the plunger 31c is between the initial position PS and the first position P1, the plunger position flags PF1 to PF3 are all set to “0”. When the plunger 31c is between the first position P1 and the second position P2, the plunger position flag PF1 is set to “1”, and the remaining plunger position flags PF2 and PF3 are set to “0”. When the plunger 31c is between the second position P2 and the third position P3, the plunger position flags PF1 and PF2 are set to “1”, and the plunger position flag PF3 is set to “0”. When the plunger 31c is between the third position P3 and the limit position PE, the plunger position flags PF1 to PF3 are set to “1”.

前状態出力フラグPPWFは、1つ前の制御状態におけるソレノイド31への駆動信号の種類を表す。すなわち、前状態出力フラグPPWFは、1つ前の制御状態においてソレノイド31に押鍵用の駆動信号を供給していたとき「1」に設定され、1つ前の制御状態においてソレノイド31に離鍵用の駆動信号を供給していたとき「0」に設定される。   The previous state output flag PPWF represents the type of drive signal to the solenoid 31 in the previous control state. That is, the previous state output flag PPWF is set to “1” when a key pressing drive signal is supplied to the solenoid 31 in the previous control state, and is released to the solenoid 31 in the previous control state. It is set to “0” when a driving signal for use is supplied.

キーオン回数ONCT及びキーオフ回数OFCTは、鍵11が、駆動回路44によって駆動されて、レスト位置から移動し始めてから再びレスト位置に戻るまでの間に発生した、鍵11に関するキーオンイベント及びキーオフイベントの回数を表す。短い期間内に同一鍵を繰り返し打鍵する連打演奏においては、鍵11がレスト位置に戻る前に、キーオンイベント及びキーオフイベントが繰り返し発生する。この場合、詳しくは後述するように、駆動回路44は、鍵11の離鍵動作の途中で、再び押鍵動作に切り替える。CPU45aは、この連打演奏時のキーオンイベント及びキーオフイベントの回数をカウントして、キーオン回数ONCT及びキーオフ回数OFCTとしてRAM45dに記憶する。また、CPU45aは、前記連打演奏時において、プランジャ31cが限界位置PEに達した回数を鍵駆動回数KDCTとしてRAM45dに記憶する。   The key-on number ONCT and the key-off number OFCT are the number of key-on events and key-off events related to the key 11 that occur between the time when the key 11 is driven by the drive circuit 44 and the key 11 starts to move from the rest position to the rest position again. Represents. In the continuous hit performance in which the same key is repeatedly pressed within a short period, the key-on event and the key-off event are repeatedly generated before the key 11 returns to the rest position. In this case, as will be described in detail later, the drive circuit 44 switches to the key pressing operation again during the key releasing operation of the key 11. The CPU 45a counts the number of key-on events and key-off events at the time of this continuous playing and stores them in the RAM 45d as the key-on number ONCT and the key-off number OFCT. Further, the CPU 45a stores, in the RAM 45d, the number of times that the plunger 31c has reached the limit position PE as the key driving number KDCT during the repeated performance.

キーオフ回数フラグOFFは、キーオフ回数OFCTが「0」であるとき「0」に設定され、キーオフ回数OFCTが「1」以上であるとき「1」に設定される。また、鍵駆動回数フラグKDFは、キーオン回数ONCTと鍵駆動回数KDCTとの差DIF(=ONCT−KDCT)が、所定の基準値bより大きいとき「1」に設定され、差DIFが、基準値b以下であるとき「0」に設定される。ただし、差DIFが基準値aよりも大きいとき、差DIFは、「0」に設定される。なお、基準値a及び基準値bは、ソレノイド31の出力特性(すなわち、供給電力に対する推力)に関係している。したがって、ソレノイド31の特性及びデューティ比テーブルに応じて、最適な基準値a及び基準値bを求める。また、最適な基準値a及び基準値bを実験的に求めてもよい。本実施形態においては、a=6かつb=2であるときに最も良好な結果が得られた。すなわち、発音に対する鍵の駆動が自然に感じられた。   The key-off count flag OFF is set to “0” when the key-off count OFCT is “0”, and is set to “1” when the key-off count OFCT is “1” or more. The key driving number flag KDF is set to “1” when the difference DIF (= ONCT−KDCT) between the key-on number ONCT and the key driving number KDCT is larger than a predetermined reference value b, and the difference DIF is set to the reference value. When it is less than or equal to b, it is set to “0”. However, when the difference DIF is larger than the reference value a, the difference DIF is set to “0”. Note that the reference value a and the reference value b are related to the output characteristics of the solenoid 31 (that is, the thrust with respect to the supplied power). Therefore, the optimum reference value a and reference value b are obtained according to the characteristics of the solenoid 31 and the duty ratio table. Further, the optimum reference value a and reference value b may be obtained experimentally. In the present embodiment, the best results were obtained when a = 6 and b = 2. In other words, the key drive for pronunciation was felt naturally.

ソレノイド31の制御状態は、図5に示すように、MIDIステータスフラグMSF、プランジャ位置フラグPF1乃至PF3、前状態出力フラグPPWF、キーオフ回数フラグOFF及び鍵駆動回数フラグKDFの値の組み合わせに応じて、状態ST1〜ST16の16種類の状態に分類されている。そして、上記のように分類された各状態において、ソレノイド31へ駆動信号を供給するか否かを表す出力フラグPWFの値がそれぞれ設定されてROM45cに記憶されている。同図中、出力フラグPWFの値が「1」と記載されている状態においては、ソレノイド31へ押鍵用の駆動信号を供給し、出力フラグPWFの値が「0」と記載されている状態においては、ソレノイド31へ離鍵用の駆動信号を供給する。なお、同図中、「NC」とは、「0」又は「1」のいずれの値であってもよいことを表す。また、以下の説明において、「ST1」〜「ST16」を状態番号という。   As shown in FIG. 5, the control state of the solenoid 31 depends on the combination of the values of the MIDI status flag MSF, the plunger position flags PF1 to PF3, the previous state output flag PPWF, the key-off count flag OFF, and the key drive count flag KDF. There are 16 types of states ST1 to ST16. In each state classified as described above, the value of the output flag PWF indicating whether or not to supply a drive signal to the solenoid 31 is set and stored in the ROM 45c. In the figure, in a state where the value of the output flag PWF is described as “1”, a driving signal for key depression is supplied to the solenoid 31 and the value of the output flag PWF is described as “0”. , A key release drive signal is supplied to the solenoid 31. In the figure, “NC” represents any value of “0” or “1”. In the following description, “ST1” to “ST16” are referred to as state numbers.

例えば、状態ST1は、MIDIステータスフラグMSF、プランジャ位置フラグPF1乃至PF3、前状態出力フラグPPWF、キーオフ回数フラグOFF及び鍵駆動回数フラグKDFの値が「0」に設定されている状態である。この状態ST1においては、出力フラグPWFの値が「0」と規定されているので、ソレノイド31へ離鍵用の駆動信号を供給する。また、例えば、状態ST2は、MIDIステータスフラグMSF、プランジャ位置フラグPF1乃至PF3、前状態出力フラグPPWF、キーオフ回数フラグOFF及び鍵駆動回数フラグKDFのうち、MIDIステータスフラグMSFのみが「1」に設定され、他のフラグが「0」に設定されている状態である。この状態ST9においては、出力フラグPWFの値が「1」と規定されているので、ソレノイド31へ押鍵用の駆動信号を供給する。他の制御状態においても、出力フラグPWFの値に従って、ソレノイド31への駆動信号の供給を制御する。   For example, the state ST1 is a state in which the values of the MIDI status flag MSF, the plunger position flags PF1 to PF3, the previous state output flag PPWF, the key-off count flag OFF, and the key drive count flag KDF are set to “0”. In this state ST1, since the value of the output flag PWF is defined as “0”, a drive signal for key release is supplied to the solenoid 31. Further, for example, in the state ST2, only the MIDI status flag MSF is set to “1” among the MIDI status flag MSF, the plunger position flags PF1 to PF3, the previous state output flag PPWF, the key-off count flag OFF, and the key drive count flag KDF. And the other flags are set to “0”. In this state ST9, since the value of the output flag PWF is defined as “1”, a drive signal for key depression is supplied to the solenoid 31. Even in other control states, the supply of the drive signal to the solenoid 31 is controlled according to the value of the output flag PWF.

また、この電子楽器は、複数のパネル操作子46、ディスプレイ47及び音源回路48を備えている。複数のパネル操作子46は、この電子楽器の操作パネル上に設けられていて、この電子楽器の各種データの設定に利用される。例えば、鍵盤10を押離鍵操作したときに発生させる楽音の音色を選択するために利用される。また、例えば、ROM45cに記憶されている曲データを選択し、自動演奏させるために利用される。複数のパネル操作子46の操作は、バス42に接続された検出回路49によって検出される。   The electronic musical instrument also includes a plurality of panel operators 46, a display 47, and a sound source circuit 48. The plurality of panel operators 46 are provided on the operation panel of the electronic musical instrument, and are used for setting various data of the electronic musical instrument. For example, it is used to select a tone color of a musical sound that is generated when the keyboard 10 is pressed and released. Also, for example, it is used to select music data stored in the ROM 45c and automatically play it. The operation of the plurality of panel operators 46 is detected by a detection circuit 49 connected to the bus 42.

検出回路49は、複数のパネル操作子46の操作を表す操作情報をコンピュータ部45に出力する。例えば、ユーザが、パネル操作子を用いて、鍵盤10に割り当てる音色を選択すると、検出回路49は、コンピュータ部45に割り込み信号を出力するとともに、前記選択された音色を表す音色番号を出力する。また、例えば、ユーザが、曲データを選択し、自動演奏の開始を指示すると、検出回路49は、コンピュータ部45に割り込み信号を出力するとともに、前記選択された曲を表す曲番号及び自動演奏の開始を表す演奏開始データを出力する。ディスプレイ47は、操作パネル上に設けられた液晶ディスプレイ、CRTなどで構成され、文字、数字、図形などを表示する。このディスプレイ47の表示内容は、バス42に接続された表示回路50によって制御される。   The detection circuit 49 outputs operation information representing the operation of the plurality of panel operators 46 to the computer unit 45. For example, when the user selects a timbre to be assigned to the keyboard 10 using the panel operator, the detection circuit 49 outputs an interrupt signal to the computer unit 45 and also outputs a timbre number representing the selected timbre. Further, for example, when the user selects music data and gives an instruction to start automatic performance, the detection circuit 49 outputs an interrupt signal to the computer unit 45, and at the same time, the music number indicating the selected music and the automatic performance. The performance start data indicating the start is output. The display 47 is composed of a liquid crystal display, CRT, or the like provided on the operation panel, and displays characters, numbers, figures, and the like. The display content of the display 47 is controlled by a display circuit 50 connected to the bus 42.

音源回路48は、バス42に接続されていて、バス42を介してCPU45aから供給された楽音信号の生成開始を表わす楽音制御パラメータに応じて、楽音信号の生成を開始する。また、音源回路48は、バス42を介してCPU45aから供給された楽音信号の生成停止を表わす楽音制御パラメータに応じて、楽音信号の生成を停止する。楽音信号の生成の停止とは、楽音信号をリリース制御(減衰制御)した後に、その生成を停止することを意味する。なお、音源回路48は、複数の発音チャンネルを有しており、本実施形態においては、キーオンイベントの発生時には、いずれかの発音チャンネルにて楽音信号が生成される。音源回路48にて生成された楽音信号は、サウンドシステム51を介して放音される。サウンドシステム51は、楽音信号をD/A変換するD/A変換器、D/A変換器によってアナログ信号に変換された楽音信号を増幅するアンプ、及びアンプによって増幅されたアナログ信号を空気振動に変換して放音するスピーカなどが含まれている。   The tone generator circuit 48 is connected to the bus 42 and starts generating a musical sound signal in accordance with a musical sound control parameter indicating the generation start of the musical sound signal supplied from the CPU 45a via the bus 42. Further, the tone generator circuit 48 stops the generation of the tone signal in accordance with the tone control parameter indicating the stop of the generation of the tone signal supplied from the CPU 45a via the bus 42. Stopping the generation of a musical sound signal means stopping the generation after the release control (attenuation control) of the musical sound signal. The tone generator circuit 48 has a plurality of tone generation channels. In this embodiment, when a key-on event occurs, a tone signal is generated on any one of the tone generation channels. The musical tone signal generated by the tone generator circuit 48 is emitted through the sound system 51. The sound system 51 includes a D / A converter that D / A converts a musical sound signal, an amplifier that amplifies the musical sound signal converted into an analog signal by the D / A converter, and the analog signal amplified by the amplifier into air vibration. A speaker that converts and emits sound is included.

また、この電子楽器は、種々の外部機器52に接続可能となっている。すなわち、この電子楽器は、バス42に接続されたMIDIインターフェース回路53を備えていて、MIDI対応のMIDI機器54(例えば、シーケンサ)に接続可能となっている。また、この電子楽器は、通信インターフェース回路55を備えていて、インターネットなどの通信ネットワークNTを介してサーバコンピュータ56に接続可能となっている。   The electronic musical instrument can be connected to various external devices 52. That is, the electronic musical instrument includes a MIDI interface circuit 53 connected to the bus 42 and can be connected to a MIDI device 54 (for example, a sequencer) that supports MIDI. The electronic musical instrument is provided with a communication interface circuit 55 and can be connected to a server computer 56 via a communication network NT such as the Internet.

次に、上記のように構成した電子楽器の動作について説明する。ユーザがこの電子楽器の図示しない電源スイッチをオンにすると、CPU45aは、図6の初期化プログラムを実行する。CPU45aは、ステップS10にて初期化処理を開始すると、ステップS12にて、この電子楽器の各回路を初期状態に設定する。すなわち、鍵盤10に割り当てられる音色のデータ、ディスプレイ47に表示する表示データなどをROM45cから読み出して、それぞれの初期値として設定する。つぎに、CPU45aは、ステップS14にて、タイマ45bを作動開始させ、所定の間隔(例えば、1ミリ秒間隔)でタイマ割り込みを発生させるよう設定する。つぎに、CPU45aは、ステップS16にて、検出回路43及び検出回路49からの割り込みを許可する。そして、CPU45aは、ステップS18にて初期化処理を終了する。   Next, the operation of the electronic musical instrument configured as described above will be described. When the user turns on a power switch (not shown) of the electronic musical instrument, the CPU 45a executes the initialization program shown in FIG. When starting the initialization process in step S10, the CPU 45a sets each circuit of the electronic musical instrument to an initial state in step S12. That is, timbre data assigned to the keyboard 10, display data to be displayed on the display 47, and the like are read from the ROM 45c and set as initial values. Next, in step S14, the CPU 45a starts operation of the timer 45b, and sets the timer interrupt to be generated at a predetermined interval (for example, every 1 millisecond interval). Next, the CPU 45a permits an interrupt from the detection circuit 43 and the detection circuit 49 in step S16. Then, the CPU 45a ends the initialization process in step S18.

検出回路43からキーイベント(キーオンイベント又はキーオフイベント)に関する割り込みが発生すると、CPU45aは、図7に示す手動演奏プログラムを実行する。CPU45aは、ステップS20にて手動演奏処理を開始すると、ステップS22にて、検出回路43からキーイベントデータ(キーオンデータ又はキーオフデータ)を取り込んで、RAM45d内のイベント処理バッファに記憶する。イベント処理バッファは、複数のキーイベントデータを記憶できるFIFO(First In First Out)メモリである。すなわち、イベント処理バッファに記憶されている複数のデータは、記憶されたタイミングが古い順に、次に説明するキーイベントプログラム、及び後述する鍵駆動プログラムによって処理される。そして、CPU45aは、ステップS24にて、図8に示すキーイベントプログラムを実行する。   When an interrupt related to a key event (key-on event or key-off event) occurs from the detection circuit 43, the CPU 45a executes a manual performance program shown in FIG. When the manual performance process is started in step S20, the CPU 45a takes key event data (key-on data or key-off data) from the detection circuit 43 and stores it in the event processing buffer in the RAM 45d in step S22. The event processing buffer is a FIFO (First In First Out) memory that can store a plurality of key event data. That is, the plurality of data stored in the event processing buffer is processed by the key event program described below and the key driving program described later in order of the stored timing. In step S24, the CPU 45a executes the key event program shown in FIG.

キーイベントプログラムは、手動演奏プログラム及び後述する自動演奏プログラムに共通のサブルーチンである。CPU45aは、ステップS30にて、キーイベント処理を開始すると、ステップS32にて、イベント処理バッファに記憶されているキーイベントデータがキーオンイベントであるかキーオフイベントであるか判定する。そして、イベント処理バッファに記憶されているキーイベントデータがキーオンイベントを表すときには、CPU45aは、ステップS34にて、音源回路48に発音を指示する。すなわち、キーイベントデータを用いて、発生させる楽音を規定する楽音制御パラメータを生成して、音源回路48に出力する。音源回路48は、入力した楽音制御パラメータに応じた楽音信号を生成して、サウンドシステム51へ供給する。そして、CPU45aは、後述のステップS38へ処理を進める。   The key event program is a subroutine common to the manual performance program and the automatic performance program described later. When the CPU 45a starts key event processing in step S30, it determines in step S32 whether the key event data stored in the event processing buffer is a key-on event or a key-off event. When the key event data stored in the event processing buffer represents a key-on event, the CPU 45a instructs the sound source circuit 48 to generate a sound in step S34. That is, using the key event data, a tone control parameter that defines the tone to be generated is generated and output to the tone generator circuit 48. The tone generator circuit 48 generates a tone signal corresponding to the input tone control parameter and supplies it to the sound system 51. And CPU45a advances a process to below-mentioned step S38.

一方、ステップS32において、イベント処理バッファに記憶されているキーイベントデータがキーオフイベントを表すときには、CPU45aは、ステップS36にて、消音を指示する。すなわち、キーイベントデータによって特定された楽音信号の発生を停止するよう、音源回路48に指示する。これにより、音源回路48は、前記発生中の楽音信号の音量を減衰させて、前記楽音の発生を停止する。そして、CPU45aは、ステップS38にて、キーイベントプログラムを終了して、メインルーチンに戻る。上記の場合、キーイベントプログラムは、手動演奏プログラムのサブルーチンとして実行されたので、CPU45aは、メインルーチンである手動演奏プログラムに戻り、手動演奏プログラムのステップS26にて手動演奏処理を終了する。   On the other hand, when the key event data stored in the event processing buffer represents a key-off event in step S32, the CPU 45a instructs mute in step S36. That is, the tone generator circuit 48 is instructed to stop the generation of the tone signal specified by the key event data. As a result, the tone generator circuit 48 attenuates the volume of the musical tone signal being generated and stops the generation of the musical tone. In step S38, the CPU 45a ends the key event program and returns to the main routine. In the above case, since the key event program is executed as a subroutine of the manual performance program, the CPU 45a returns to the manual performance program which is the main routine, and ends the manual performance processing in step S26 of the manual performance program.

また、検出回路49から割り込みが発生し、その割り込み要因がユーザからの自動演奏の開始指示であることをCPU45aが検出すると、CPU45aは、図9に示す自動演奏プログラムと、図10に示す鍵駆動プログラムを実行する。自動演奏プログラムと鍵駆動プログラムとは、並列に実行される。   Further, when an interrupt is generated from the detection circuit 49 and the CPU 45a detects that the interrupt factor is an instruction to start automatic performance from the user, the CPU 45a displays the automatic performance program shown in FIG. 9 and the key drive shown in FIG. Run the program. The automatic performance program and the key driving program are executed in parallel.

まず、自動演奏プログラムについて説明する。CPU45aは、ステップS40にて自動演奏処理を開始すると、ステップS42にて、タイマ45bを用いて時間計測を開始する。つぎに、CPU45aは、ステップS44にて、ユーザによって選択された曲データのイベントデータのうち、テンポクロックタイミングと現在時刻が一致するイベントデータを検索する。該当するイベントデータが無い場合には、「No」と判定して、再びステップS44を実行する。一方、該当するイベントデータがある場合には、「Yes」と判定して、ステップS46にて、そのイベントデータを読み出してイベント処理バッファに記憶する。そして、CPU45aは、ステップS48にて、イベント処理バッファに記憶したイベントデータの種類に応じて、次に実行する処理を決定する。すなわち、前記記憶したイベントデータがキーイベントデータである場合には、ステップS50にて、上記のキーイベントプログラムを実行して、ステップS44に戻る。なお、自動演奏においては、後述する鍵駆動プログラムによって鍵11を駆動するので、駆動した鍵11の第1スイッチSW1及び第2スイッチSW2のオン・オフ状態が変化するが、この駆動した鍵11に関しては、手動演奏プログラムを実行しない。ただし、駆動していない鍵11の第1スイッチSW1及び第2スイッチSW2のオン・オフ状態が変化した場合(すなわち、駆動していない鍵11が、演奏者によって押離鍵操作された場合)には、手動演奏プログラムを実行する。   First, the automatic performance program will be described. When starting the automatic performance process in step S40, the CPU 45a starts measuring time using the timer 45b in step S42. Next, in step S44, the CPU 45a searches the event data of the music data selected by the user for event data whose tempo clock timing matches the current time. If there is no corresponding event data, it is determined as “No”, and Step S44 is executed again. On the other hand, if there is corresponding event data, it is determined as “Yes”, and in step S46, the event data is read and stored in the event processing buffer. In step S48, the CPU 45a determines the next process to be executed according to the type of event data stored in the event processing buffer. That is, if the stored event data is key event data, the key event program is executed in step S50, and the process returns to step S44. In the automatic performance, since the key 11 is driven by a key driving program described later, the on / off state of the first switch SW1 and the second switch SW2 of the driven key 11 changes. Does not run a manual performance program. However, when the on / off state of the first switch SW1 and the second switch SW2 of the non-driven key 11 changes (that is, when the non-driven key 11 is pressed and released by the performer). Run a manual performance program.

また、ステップS46において記憶したイベントデータがその他のデータである場合には、CPU45aは、ステップS52にて、そのイベントデータに応じた処理を実行して、ステップS44に戻る。例えば、イベントデータが音色を変更するプログラムチェンジデータである場合には、音色を変更することを表す楽音制御パラメータを生成して音源回路48に出力し、ステップS44に戻る。また、ステップS46において記憶したイベントデータがエンドデータである場合には、CPU45aは、ステップS54にて、自動演奏処理を終了する。   If the event data stored in step S46 is other data, the CPU 45a executes processing corresponding to the event data in step S52, and returns to step S44. For example, if the event data is program change data for changing the timbre, a tone control parameter indicating that the timbre is changed is generated and output to the tone generator circuit 48, and the process returns to step S44. If the event data stored in step S46 is end data, the CPU 45a ends the automatic performance process in step S54.

つぎに、鍵駆動プログラムについて説明する。鍵駆動プログラムは、以下説明するステップS64〜ステップS86を繰り返し実行し、ソレノイド31の制御状態を遷移させる。以下、1つの鍵11の鍵駆動処理について説明するが、他の鍵についても同様に処理する。CPU45aは、ステップS60にて鍵駆動処理を開始すると、ステップS62にて、初期化処理を実行する。すなわち、全てのフラグの値を「0」に設定する。また、キーオン回数ONCT、キーオフ回数OFCT及び鍵駆動回数KDCTの値を「0」に設定する。さらに、現在の制御状態に遷移する1つ前の制御状態の状態番号を記憶しておく状態番号バッファを「ST1」に設定する。   Next, the key driving program will be described. The key driving program repeatedly executes steps S64 to S86 described below, and changes the control state of the solenoid 31. Hereinafter, the key driving process of one key 11 will be described, but the same process is performed for other keys. When starting the key driving process in step S60, the CPU 45a executes an initialization process in step S62. That is, all the flag values are set to “0”. Further, the values of the key-on count ONCT, the key-off count OFCT, and the key drive count KDCT are set to “0”. Further, the state number buffer for storing the state number of the immediately previous control state that transits to the current control state is set to “ST1”.

つぎに、CPU45aは、ステップS64にて、上記の自動演奏プログラムのステップS46の実行によりイベント処理バッファに記憶されたイベントデータのうち、鍵駆動処理の実行されていない未処理のイベントデータがあるか否かを検出する。未処理のイベントデータが無い場合には、CPU45aは、「No」と判定して、後述のステップS70に処理を進める。一方、未処理のイベントデータがある場合には、CPU45aは、「Yes」と判定して、ステップS66にて、前記未処理のイベントデータの種類に応じて、次に実行する処理を決定する。   Next, in step S64, the CPU 45a determines whether there is unprocessed event data that has not been subjected to key driving processing among the event data stored in the event processing buffer by executing step S46 of the automatic performance program. Detect whether or not. If there is no unprocessed event data, the CPU 45a determines “No” and advances the process to step S70 described later. On the other hand, if there is unprocessed event data, the CPU 45a determines “Yes” and determines the next process to be executed in step S66 according to the type of the unprocessed event data.

前記未処理のイベントデータが、キーイベントデータ及びエンドデータとは異なるその他のデータである場合には、CPU45aは、後述のステップS70に処理を進める。また、前記未処理のイベントデータが、キーイベントデータである場合には、CPU45aは、ステップS68にて、キーイベントデータが表すイベントの種類(すなわち、キーオンイベント又はキーオフイベント)に応じて、前記キーイベントデータが表すキーコードに対応する、MIDIステータスフラグMSFを更新するとともに、キーオン回数ONCT又はキーオフ回数OFCTを更新する。すなわち、キーイベントデータがキーオンイベントを表す場合には、MIDIステータスフラグMSFを「1」に設定するとともに、キーオン回数ONCTをインクリメントする。この場合、差DIF(=ONCT−KDCT)に応じて、鍵駆動回数フラグKDFを更新する。すなわち、差DIFが基準値b以下であれば、鍵駆動回数フラグKDFを「0」に設定し、差DIFが基準値bより大きければ鍵駆動回数フラグKDFを「1」に設定する。ただし、差DIFが、基準値aよりも大きい場合は、差DIFを「0」とみなして鍵駆動回数フラグKDFを設定する。一方、キーオフイベントを表す場合には、MIDIステータスフラグMSFを「0」に設定するとともに、キーオフ回数OFCTをインクリメントする。この場合、キーオフ回数OFCTが「1」以上になるので、キーオフ回数フラグOFFを「1」に設定する。さらに、前状態出力フラグPPWFを1つ前の制御状態の出力フラグPWFの値に設定する。   When the unprocessed event data is other data different from the key event data and the end data, the CPU 45a advances the process to step S70 described later. If the unprocessed event data is key event data, the CPU 45a determines in step S68 the key event data according to the type of event represented by the key event data (that is, key-on event or key-off event). The MIDI status flag MSF corresponding to the key code represented by the event data is updated, and the key-on count ONCT or the key-off count OFCT is updated. That is, when the key event data represents a key-on event, the MIDI status flag MSF is set to “1” and the key-on count ONCT is incremented. In this case, the key driving number flag KDF is updated according to the difference DIF (= ONCT−KDCT). That is, if the difference DIF is equal to or smaller than the reference value b, the key driving number flag KDF is set to “0”, and if the difference DIF is larger than the reference value b, the key driving number flag KDF is set to “1”. However, when the difference DIF is larger than the reference value a, the difference DIF is regarded as “0” and the key driving number flag KDF is set. On the other hand, when a key-off event is indicated, the MIDI status flag MSF is set to “0” and the key-off count OFCT is incremented. In this case, since the key-off count OFCT is “1” or more, the key-off count flag OFF is set to “1”. Further, the previous state output flag PPWF is set to the value of the output flag PWF of the previous control state.

つぎに、CPU45aは、ステップS70にて、検出回路43を介して、位置センサ40から、現在のプランジャ31cの位置Pを読み込み、前記読み込んだ位置Pに応じて、プランジャ位置フラグPF1乃至PF3を更新する。すなわち、位置Pが、初期位置PSから第1位置P1までの間にあるとき、プランジャ位置フラグPF1乃至PF3を、いずれも「0」に設定する。また、位置Pが、第1位置P1から第2位置P2までの間にあるとき、プランジャ位置フラグPF1を「1」に設定し、残りのプランジャ位置フラグPF2及びPF3を「0」に設定する。また、位置Pが、第2位置P2から第3位置P3までの間にあるとき、プランジャ位置フラグPF1及びPF2を「1」に設定し、プランジャ位置フラグPF3を「0」に設定する。そして、位置Pが、第3位置P3から限界位置PEまでの間にあるとき、プランジャ位置フラグPF1乃至PF3を「1」に設定する。   Next, in step S70, the CPU 45a reads the current position P of the plunger 31c from the position sensor 40 via the detection circuit 43, and updates the plunger position flags PF1 to PF3 according to the read position P. To do. That is, when the position P is between the initial position PS and the first position P1, the plunger position flags PF1 to PF3 are all set to “0”. When the position P is between the first position P1 and the second position P2, the plunger position flag PF1 is set to “1”, and the remaining plunger position flags PF2 and PF3 are set to “0”. When the position P is between the second position P2 and the third position P3, the plunger position flags PF1 and PF2 are set to “1”, and the plunger position flag PF3 is set to “0”. When the position P is between the third position P3 and the limit position PE, the plunger position flags PF1 to PF3 are set to “1”.

つぎに、CPU45aは、ステップS72にて、MIDIステータスフラグMSF、プランジャ位置フラグPF1乃至PF3の値が全て「0」であるか否か判定する。MIDIステータスフラグMSF、プランジャ位置フラグPF1乃至PF3のうちの少なくとも1つのフラグの値が「1」であれば、「No」と判定して、CPU45aは、処理を後述のステップS76に進める、一方、MIDIステータスフラグMSF、プランジャ位置フラグPF1乃至PF3の値が全て「0」であれば、「Yes」と判定して、CPU45aは、ステップS74にて、前状態出力フラグPPWF、キーオフ回数フラグOFF、鍵駆動回数フラグKDF、キーオン回数ONCT、キーオフ回数OFCT及び鍵駆動回数KDCTを、「0」に設定する。   Next, in step S72, the CPU 45a determines whether or not the values of the MIDI status flag MSF and the plunger position flags PF1 to PF3 are all “0”. If the value of at least one of the MIDI status flag MSF and the plunger position flags PF1 to PF3 is “1”, it is determined as “No”, and the CPU 45a advances the process to step S76 described later. If the values of the MIDI status flag MSF and the plunger position flags PF1 to PF3 are all “0”, it is determined as “Yes”, and the CPU 45a determines in step S74 that the previous state output flag PPWF, the key-off count flag OFF, the key The drive count flag KDF, key-on count ONCT, key-off count OFCT, and key drive count KDCT are set to “0”.

つぎに、CPU45aは、ステップS76にて、MIDIステータスフラグMSF、プランジャ位置フラグPF1乃至PF3、前状態出力フラグPPWF、キーオフ回数フラグOFF及び鍵駆動回数フラグKDFの値を用いて、現在のソレノイド31の制御状態が、制御状態ST1〜ST16のうちの、どの制御状態に該当するかを判別する。例えば、鍵駆動プログラムの開始直後においては、MIDIステータスフラグMSF、プランジャ位置フラグPF1乃至PF3、前状態出力フラグPPWF、キーオフ回数フラグOFF及び鍵駆動回数フラグKDFは全て「0」に初期化されているので、CPU45aは、制御状態ST1に該当すると判定する。   Next, in step S76, the CPU 45a uses the values of the MIDI status flag MSF, the plunger position flags PF1 to PF3, the previous state output flag PPWF, the key-off count flag OFF, and the key drive count flag KDF, to determine the current solenoid 31. It is determined which control state the control state corresponds to among the control states ST1 to ST16. For example, immediately after the start of the key drive program, the MIDI status flag MSF, the plunger position flags PF1 to PF3, the previous state output flag PPWF, the key-off count flag OFF, and the key drive count flag KDF are all initialized to “0”. Therefore, the CPU 45a determines that it corresponds to the control state ST1.

つぎに、CPU45aは、ステップS78にて、ソレノイド31の制御状態が遷移したか否かを判定する。すなわち、状態番号バッファに記憶されている状態番号が表わす1つ前の制御状態とステップS76にて判定した現在の制御状態とが一致するか否かを判定する。両制御状態が一致する場合には「No」と判定して、CPU45aは、後述のステップS84に処理を進める。一方、両制御状態が異なる場合には、「Yes」と判定して、ステップS80にて、上記制御状態の遷移が、状態ST4から状態ST5への遷移、状態ST4から状態ST6への遷移又は状態ST8から制御状態ST9への遷移のいずれかに該当するか否か判定する。いずれの遷移にも該当しない場合は、CPU45aは、「No」と判定して、ステップS84に処理を進める。一方、いずれかの遷移に該当する場合は、CPU45aは、「Yes」と判定して、ステップS82にて、鍵駆動回数KDCT及び鍵駆動回数フラグKDFを更新する。すなわち、鍵駆動回数KDCTをインクリメントする。そして、差DIFを算出し、差DIFが基準値b以下であれば、鍵駆動回数フラグKDFを「0」に設定し、差DIFが基準値bより大きければ鍵駆動回数フラグKDFを「1」に設定する。ただし、差DIFが、基準値aよりも大きい場合は、差DIFを「0」とみなして鍵駆動回数フラグKDFを設定する。   Next, in step S78, the CPU 45a determines whether or not the control state of the solenoid 31 has changed. That is, it is determined whether or not the previous control state represented by the state number stored in the state number buffer matches the current control state determined in step S76. If both control states match, it is determined as “No”, and the CPU 45a advances the process to step S84 described later. On the other hand, if the two control states are different, it is determined as “Yes”, and in step S80, the transition of the control state is the transition from the state ST4 to the state ST5, the transition from the state ST4 to the state ST6, or the state. It is determined whether or not any of the transitions from ST8 to control state ST9 is applicable. If it does not correspond to any transition, the CPU 45a determines “No” and advances the process to step S84. On the other hand, if any of the transitions is satisfied, the CPU 45a determines “Yes” and updates the key driving number KDCT and the key driving number flag KDF in step S82. That is, the key driving frequency KDCT is incremented. Then, the difference DIF is calculated. If the difference DIF is equal to or smaller than the reference value b, the key driving number flag KDF is set to “0”, and if the difference DIF is larger than the reference value b, the key driving number flag KDF is set to “1”. Set to. However, when the difference DIF is larger than the reference value a, the difference DIF is regarded as “0” and the key driving number flag KDF is set.

つぎに、CPU45aは、ステップS84にて、前記判定した現在の制御状態の出力フラグPWFの値に従って、ソレノイド31への駆動信号の供給を制御する。具体的には、出力フラグPWFの値が「1」であれば、CPU45aは、駆動対象のソレノイド31を表すキーコードを駆動回路44に供給するとともに、上記の押鍵用のデューティ比テーブルに従って、デューティ比を駆動回路44に供給する。一方、出力フラグPWFの値が「0」であれば、CPU45aは、駆動対象のソレノイド31を表すキーコードを駆動回路44に供給するとともに、上記の離鍵用のデューティ比テーブルに従って、デューティ比を駆動回路44に供給する。   Next, in step S84, the CPU 45a controls the supply of the drive signal to the solenoid 31 according to the value of the output flag PWF in the determined current control state. Specifically, if the value of the output flag PWF is “1”, the CPU 45a supplies a key code representing the solenoid 31 to be driven to the drive circuit 44, and in accordance with the key pressing duty ratio table described above. The duty ratio is supplied to the drive circuit 44. On the other hand, if the value of the output flag PWF is “0”, the CPU 45a supplies a key code representing the solenoid 31 to be driven to the drive circuit 44 and sets the duty ratio according to the above-described key release duty ratio table. This is supplied to the drive circuit 44.

つぎに、CPU45aは、ステップS86にて、現在の制御状態の状態番号を1つ前の制御状態の状態番号として制御状態バッファに記憶して、ステップS64に戻る。このように、CPU45aは、上記のステップS64〜S86の処理を繰り返す。ただし、ステップS66において、イベントデータの種類がエンドデータである場合には、CPU45aは、ステップS88にて、鍵駆動プログラムを終了する。上記のステップS64〜S86を繰り返す処理は高速に実行されるので、ステップS64〜S86の実行において、いずれのフラグ及びカウンタの値も更新されないこともある。すなわち、一度ステップS64〜S86を実行しただけでは、制御状態が遷移しないこともある。   Next, in step S86, the CPU 45a stores the state number of the current control state in the control state buffer as the state number of the previous control state, and returns to step S64. In this way, the CPU 45a repeats the processes of steps S64 to S86 described above. However, if the type of event data is end data in step S66, the CPU 45a ends the key driving program in step S88. Since the process of repeating steps S64 to S86 is executed at high speed, none of the flags and counter values may be updated in the execution of steps S64 to S86. That is, there is a case where the control state does not change only by executing steps S64 to S86 once.

つぎに、ソレノイド31の制御状態の遷移及び各状態における動作について、図11乃至図15を用いて具体的に説明する。なお、図11の各制御状態を示すブロック中において、各制御状態のMIDIステータスフラグMSF、プランジャ位置フラグPF1乃至PF3、前状態出力フラグPPWF、キーオフ回数フラグOFF及び鍵駆動回数フラグKDFの値をこの順に括弧内に列記している。そして、各種フラグの値を列記した括弧の下に、各制御状態に規定されている出力フラグPWFの値を記載している。また、図12乃至図15におけるキーオン指令及びキーオフ指令を表すキーオン信号KEYON及びキーオフ信号KEYOFFのパルスのそれぞれの立下り時に、キーオンイベント及びキーオフイベントがそれぞれ発生する。   Next, the transition of the control state of the solenoid 31 and the operation in each state will be specifically described with reference to FIGS. In the block indicating each control state in FIG. 11, the values of the MIDI status flag MSF, the plunger position flags PF1 to PF3, the previous state output flag PPWF, the key-off number flag OFF, and the key-drive number flag KDF in each control state are shown. They are listed in parentheses in order. And the value of the output flag PWF prescribed | regulated to each control state is described under the parenthesis which listed the value of various flags. In addition, a key-on event and a key-off event occur at the fall of each of the pulses of the key-on signal KEYON and the key-off signal KEYOFF representing the key-on command and the key-off command in FIGS.

A.通常駆動
まず、鍵11を押鍵してフルストローク位置に一定時間保持した後にレスト位置まで戻す通常駆動における、ソレノイド31の制御状態の遷移及び各制御状態における動作について、図11及び図12を用いて説明する。
A. Normal Drive First, the control state transition of the solenoid 31 and the operation in each control state in the normal drive in which the key 11 is depressed and held at the full stroke position for a certain time and then returned to the rest position will be described with reference to FIGS. 11 and 12. I will explain.

(A1)状態ST1
鍵11の駆動開始時においては、全てのフラグが「0」に初期化される(S62)ので、ソレノイド31の制御状態は、状態ST1である。
(A1) State ST1
At the start of driving of the key 11, all the flags are initialized to “0” (S62), so the control state of the solenoid 31 is the state ST1.

(A2)状態ST1〜状態ST2
つぎに、キーオンイベントにより、MIDIステータスフラグMSFが「1」に設定され(S68)、キーオン回数ONCTがインクリメントされて「1」に設定される。また、キーオン回数ONCTと鍵駆動回数KDCTとの差DIFが「1」になる。差DIFは「b」(=「2」)以下であるので、鍵駆動回数フラグKDFは「0」のままである。また、他のフラグ及び他のカウンタの値も、「0」のままである。以下の説明においては、各ステップにおいて値が変更されたフラグについてのみ説明し、値が変更されていないフラグについての説明を省略する。これにより、ソレノイド31の制御状態は、状態ST2に遷移する(S76)。状態ST2においては、出力フラグPWFが「1」に設定されているので、ソレノイド31に押鍵用の駆動信号が供給され(S84)、プランジャ31cが上昇する。
(A2) State ST1 to state ST2
Next, due to the key-on event, the MIDI status flag MSF is set to “1” (S68), and the key-on count ONCT is incremented and set to “1”. Further, the difference DIF between the key-on count ONCT and the key drive count KDCT is “1”. Since the difference DIF is equal to or smaller than “b” (= “2”), the key driving number flag KDF remains “0”. Also, the values of other flags and other counters remain “0”. In the following description, only a flag whose value has been changed in each step will be described, and a description of a flag whose value has not been changed will be omitted. As a result, the control state of the solenoid 31 transitions to the state ST2 (S76). In the state ST2, since the output flag PWF is set to “1”, a drive signal for key pressing is supplied to the solenoid 31 (S84), and the plunger 31c is raised.

(A3)状態ST2〜状態ST3
プランジャ31cの位置Pが第1位置P1を超えると、位置フラグPF1が「1」に設定され、前状態出力フラグPPWFが、1つ前の制御状態である状態ST2の出力フラグPWFの値に設定される(S70)。すなわち、前状態出力フラグPPWFが「1」に設定される。これにより、ソレノイド31の制御状態は、状態ST3に遷移する(S76)。状態ST3においては、出力フラグPWFが「1」に設定されているので、ソレノイド31に押鍵用の駆動信号が供給され(S84)、プランジャ31cがさらに上昇する。
(A3) State ST2 to state ST3
When the position P of the plunger 31c exceeds the first position P1, the position flag PF1 is set to “1”, and the previous state output flag PPWF is set to the value of the output flag PWF in the state ST2 that is the previous control state. (S70). That is, the previous state output flag PPWF is set to “1”. Thereby, the control state of the solenoid 31 is changed to the state ST3 (S76). In the state ST3, since the output flag PWF is set to “1”, a driving signal for key pressing is supplied to the solenoid 31 (S84), and the plunger 31c further rises.

(A4)状態ST3〜状態ST4
つぎに、プランジャ31cの位置Pが第2位置P2を超えると、プランジャ位置フラグPF2が「1」に設定され、前状態出力フラグPPWFが「1」に設定される(S70)。これにより、ソレノイド31の制御状態は、状態ST4に遷移する(S76)。状態ST4においては、出力フラグPWFが「1」に設定されているので、ソレノイド31に押鍵用の駆動信号が供給され(S84)、プランジャ31cがさらに上昇する。
(A4) State ST3 to state ST4
Next, when the position P of the plunger 31c exceeds the second position P2, the plunger position flag PF2 is set to “1”, and the previous state output flag PPWF is set to “1” (S70). As a result, the control state of the solenoid 31 transitions to the state ST4 (S76). In the state ST4, since the output flag PWF is set to “1”, a drive signal for key pressing is supplied to the solenoid 31 (S84), and the plunger 31c further rises.

(A5)状態ST4〜状態ST5
つぎに、プランジャ31cの位置Pが第3位置P3を超えると、プランジャ位置フラグPF3が「1」に設定され、前状態出力フラグPPWFが「1」に設定される(S70)。また、キーオフ回数OFCTは「0」であるので、ソレノイド31の制御状態は、状態ST5に遷移する(S76)。状態ST4から状態ST5への遷移であるので、鍵駆動回数KDCTがインクリメントされて(S82)、「1」に設定される。これにより、鍵駆動回数KDCTとキーオン回数ONCTの差DIFは「0」となる。鍵駆動回数フラグKDFは「0」のままである。状態ST5においては、出力フラグPWFが「1」に設定されているので、ソレノイド31に押鍵用の駆動信号が供給され、プランジャ31cがさらに上昇し、限界位置PEに保持される。すなわち、鍵11がフルストローク位置に保持される。
(A5) State ST4 to state ST5
Next, when the position P of the plunger 31c exceeds the third position P3, the plunger position flag PF3 is set to “1”, and the previous state output flag PPWF is set to “1” (S70). Further, since the key-off count OFCT is “0”, the control state of the solenoid 31 transitions to the state ST5 (S76). Since this is a transition from the state ST4 to the state ST5, the key drive count KDCT is incremented (S82) and set to “1”. As a result, the difference DIF between the key drive count KDCT and the key-on count ONCT is “0”. The key driving number flag KDF remains “0”. In the state ST5, since the output flag PWF is set to “1”, a key pressing drive signal is supplied to the solenoid 31, and the plunger 31c is further raised and held at the limit position PE. That is, the key 11 is held at the full stroke position.

(A6)状態ST5〜状態ST9
つぎに、キーオフイベントにより、MIDIステータスフラグMSFが「0」に設定され、前状態出力フラグPPWFが「1」に設定される(S68)。また、キーオフ回数OFCTがインクリメントされて「1」に設定され、キーオフ回数フラグOFFが「1」に設定される(S68)。これにより、ソレノイド31の制御状態は、状態ST9に遷移する(S76)。状態ST9においては、出力フラグPWFが「0」に設定されているので、ソレノイド31への離鍵用の駆動信号が供給され(S84)、プランジャ31cが下降する。
(A6) State ST5 to State ST9
Next, due to the key-off event, the MIDI status flag MSF is set to “0”, and the previous state output flag PPWF is set to “1” (S68). The key-off count OFCT is incremented and set to “1”, and the key-off count flag OFF is set to “1” (S68). As a result, the control state of the solenoid 31 transitions to the state ST9 (S76). In the state ST9, since the output flag PWF is set to “0”, a key release drive signal is supplied to the solenoid 31 (S84), and the plunger 31c is lowered.

(A7)状態ST9〜状態ST13
つぎに、プランジャ31cの位置Pが第3位置P3を下回ると、プランジャ位置フラグPF3が「0」に設定され、前状態出力フラグPPWFが「0」に設定される(S70)。これにより、ソレノイド31の制御状態は、状態ST13に遷移する(S76)。状態ST13においては、出力フラグPWFが「0」に設定されているので、ソレノイド31に離鍵用の駆動信号が供給されていて(S84)、プランジャ31cがさらに下降する。
(A7) State ST9 to state ST13
Next, when the position P of the plunger 31c falls below the third position P3, the plunger position flag PF3 is set to “0”, and the previous state output flag PPWF is set to “0” (S70). Thereby, the control state of the solenoid 31 is changed to the state ST13 (S76). In the state ST13, since the output flag PWF is set to “0”, a drive signal for key release is supplied to the solenoid 31 (S84), and the plunger 31c is further lowered.

(A8)状態ST13〜状態ST15
つぎに、プランジャ31cの位置Pが第2位置P2を下回ると、プランジャ位置フラグPF2が「0」に設定され、前状態出力フラグPPWFが「0」に設定される(S70)。また、鍵駆動回数フラグKDFは「0」であるから、ソレノイド31の制御状態は、状態ST15に遷移する(S76)。状態ST15においては、出力フラグPWFが「0」に設定されているので、ソレノイド31に離鍵用の駆動信号が供給されていて(S84)、プランジャ31cがさらに下降する。
(A8) State ST13 to state ST15
Next, when the position P of the plunger 31c falls below the second position P2, the plunger position flag PF2 is set to “0”, and the previous state output flag PPWF is set to “0” (S70). Further, since the key driving number flag KDF is “0”, the control state of the solenoid 31 transitions to the state ST15 (S76). In the state ST15, since the output flag PWF is set to “0”, a drive signal for key release is supplied to the solenoid 31 (S84), and the plunger 31c is further lowered.

(A9)状態ST15〜状態ST1
そして、プランジャ31cの位置Pが第1位置P1を下回ると、プランジャ位置フラグPF1が「0」に設定され、前状態出力フラグPPWFが「0」に設定される(S70)。これにより、ソレノイド31の制御状態は、状態ST1に遷移して(S76)、鍵11がレスト位置にて停止する。
(A9) State ST15 to state ST1
When the position P of the plunger 31c falls below the first position P1, the plunger position flag PF1 is set to “0”, and the previous state output flag PPWF is set to “0” (S70). As a result, the control state of the solenoid 31 transitions to the state ST1 (S76), and the key 11 stops at the rest position.

B.スタッカート駆動
つぎに、鍵11を押鍵して、鍵11がフルストローク位置に達する前にキーオフイベントが発生し、鍵11がフルストローク位置に達した直後に離鍵動作に移行して、鍵11をレスト位置に戻すスタッカート駆動における、ソレノイド31の制御状態の遷移及び各制御状態における動作について、図11及び図13を用いて説明する。
B. Staccato drive Next, when the key 11 is depressed, a key-off event occurs before the key 11 reaches the full stroke position, and immediately after the key 11 reaches the full stroke position, the operation shifts to a key release operation. The transition of the control state of the solenoid 31 and the operation in each control state in the staccato drive for returning the valve to the rest position will be described with reference to FIGS. 11 and 13.

(B1)状態ST1〜状態ST2〜状態ST3
状態ST1から状態ST3までの状態遷移及び各状態における動作は、上記の通常駆動と同様であるので、説明を省略する。
(B1) State ST1 to state ST2 to state ST3
Since the state transition from the state ST1 to the state ST3 and the operation in each state are the same as those in the normal driving described above, the description thereof is omitted.

(B2)状態ST3〜状態ST7
状態ST3において、キーオフイベントが発生すると、MIDIステータスフラグMSFが「0」に設定され、前状態出力フラグPPWFが「1」に設定される(S68)。また、キーオフ回数OFCTがインクリメントされて「1」に設定され、キーオフ回数フラグOFFが「1」に設定される(S68)。これにより、ソレノイド31の制御状態は、状態ST7に遷移する(S76)。状態ST7においては、出力フラグPWFが「1」に設定されているので、ソレノイド31に押鍵用の駆動信号が供給され(S84)、プランジャ31cがさらに上昇する。
(B2) State ST3 to state ST7
When a key-off event occurs in the state ST3, the MIDI status flag MSF is set to “0”, and the previous state output flag PPWF is set to “1” (S68). The key-off count OFCT is incremented and set to “1”, and the key-off count flag OFF is set to “1” (S68). As a result, the control state of the solenoid 31 transitions to the state ST7 (S76). In the state ST7, since the output flag PWF is set to “1”, a driving signal for key pressing is supplied to the solenoid 31 (S84), and the plunger 31c further rises.

(B3)状態ST7〜状態ST8
つぎに、プランジャ31cの位置Pが第2位置P2を超えると、プランジャ位置フラグPF2が「1」に設定され、前状態出力フラグPPWFが「1」に設定される(S70)。これにより、ソレノイド31の制御状態は、状態ST8に遷移する(S76)。状態ST8においては、出力フラグPWFが「1」に設定されているので、ソレノイド31に押鍵用の駆動信号が供給され(S84)、プランジャ31cがさらに上昇する。
(B3) State ST7 to state ST8
Next, when the position P of the plunger 31c exceeds the second position P2, the plunger position flag PF2 is set to “1”, and the previous state output flag PPWF is set to “1” (S70). As a result, the control state of the solenoid 31 transitions to the state ST8 (S76). In the state ST8, since the output flag PWF is set to “1”, a driving signal for key depression is supplied to the solenoid 31 (S84), and the plunger 31c further rises.

(B4)状態ST8〜・・・〜状態ST1
つぎに、プランジャ31cの位置Pが第3位置P3を超えると、プランジャ位置フラグPF3が「1」に設定され、前状態出力フラグPPWFが「1」に設定される(S70)。これにより、ソレノイド31の制御状態は、状態ST9に遷移する(S76)。状態ST8から状態ST9への遷移であるので、鍵駆動回数KDCTがインクリメントされて(S82)、「1」に設定される。これにより、鍵駆動回数KDCTとキーオン回数ONCTの差DIFは「0」となる。鍵駆動回数フラグKDFは「0」のままである。状態ST9においては、出力フラグPWFが「0」に設定されているが、CPU45aが、ソレノイド31へ供給する駆動信号を離鍵用の駆動信号に切り替えても、プランジャ31cは惰性により若干上方へ移動する(図12参照)。そして、プランジャ31cは限界位置PEに達した後、下降する。その後、ソレノイド31の制御状態は、上記通常駆動と同様に、状態ST13、状態ST15、状態ST1の順に遷移し、鍵11がレスト位置にて停止する。
(B4) State ST8 to ... State ST1
Next, when the position P of the plunger 31c exceeds the third position P3, the plunger position flag PF3 is set to “1”, and the previous state output flag PPWF is set to “1” (S70). As a result, the control state of the solenoid 31 transitions to the state ST9 (S76). Since this is a transition from the state ST8 to the state ST9, the key drive count KDCT is incremented (S82) and set to “1”. As a result, the difference DIF between the key drive count KDCT and the key-on count ONCT is “0”. The key driving number flag KDF remains “0”. In the state ST9, the output flag PWF is set to “0”, but even if the CPU 45a switches the drive signal supplied to the solenoid 31 to the key release drive signal, the plunger 31c moves slightly upward due to inertia. (See FIG. 12). The plunger 31c moves down after reaching the limit position PE. Thereafter, the control state of the solenoid 31 is changed in the order of the state ST13, the state ST15, and the state ST1 in the same manner as the normal driving, and the key 11 stops at the rest position.

C.連打駆動
つぎに、鍵11を押鍵して、鍵11がフルストローク位置に達する前にキーオフイベントが発生し、鍵11がフルストローク位置に達した直後に離鍵動作に移行し、離鍵動作途中にキーオンイベントが発生し、鍵11がレスト位置に達する前に押鍵動作に移行する連打駆動における、ソレノイド31の制御状態の遷移及び各制御状態における動作について、図11、図14A及び図14Bを用いて説明する。
C. Next, the key 11 is depressed, a key-off event is generated before the key 11 reaches the full stroke position, and the key release operation is started immediately after the key 11 reaches the full stroke position. FIG. 11, FIG. 14A, and FIG. 14B show the transition of the control state of the solenoid 31 and the operation in each control state in the continuous driving in which a key-on event occurs in the middle and the key 11 moves to the key pressing operation before reaching the rest position. Will be described.

(C1)状態ST1〜・・・〜状態ST9
状態ST1から状態ST9へ至るまでの状態遷移及び各状態における動作は、上記スタッカート駆動における動作と同様であるので、説明を省略する。
(C1) States ST1 to ST9
Since the state transition from the state ST1 to the state ST9 and the operation in each state are the same as the operation in the staccato drive, description thereof is omitted.

(C2)状態ST9〜状態ST11
状態ST9において、キーオンイベントが発生すると、MIDIステータスフラグMSFが「1」に設定され、前状態出力フラグPPWFが「0」に設定される(S68)。また、キーオン回数ONCTがインクリメントされて「2」に設定され、差DIFが「1」になるが、鍵駆動回数フラグKDFは「0」のままである(S68)。これにより、ソレノイド31の制御状態は、状態ST11に遷移する(S76)。状態ST11においては、出力フラグPWFが「0」に設定されているので、ソレノイド31に離鍵用の駆動信号が供給され(S84)、プランジャ31cが下降する。
(C2) State ST9 to state ST11
When a key-on event occurs in the state ST9, the MIDI status flag MSF is set to “1”, and the previous state output flag PPWF is set to “0” (S68). Further, the key-on count ONCT is incremented and set to “2”, and the difference DIF becomes “1”, but the key drive count flag KDF remains “0” (S68). Thereby, the control state of the solenoid 31 is changed to the state ST11 (S76). In the state ST11, since the output flag PWF is set to “0”, a key release drive signal is supplied to the solenoid 31 (S84), and the plunger 31c is lowered.

(C3)状態ST11〜状態ST10
状態ST11において、キーオフイベントが発生すると、MIDIステータスフラグMSFが「0」に設定され、前状態出力フラグPPWFが「0」に設定される(S68)。また、キーオフ回数OFCTがインクリメントされて「2」に設定され、キーオフ回数フラグOFFが「1」に設定される(S68)。これにより、ソレノイド31の制御状態は、状態ST10に遷移する(S76)。状態ST10においては、出力フラグPWFが「0」に設定されているので、ソレノイド31に押鍵用の駆動信号が供給され(S84)、プランジャ31cがさらに下降する。
(C3) State ST11 to State ST10
When a key-off event occurs in the state ST11, the MIDI status flag MSF is set to “0”, and the previous state output flag PPWF is set to “0” (S68). Further, the key-off count OFCT is incremented and set to “2”, and the key-off count flag OFF is set to “1” (S68). Thereby, the control state of the solenoid 31 is changed to the state ST10 (S76). In the state ST10, since the output flag PWF is set to “0”, a driving signal for key pressing is supplied to the solenoid 31 (S84), and the plunger 31c is further lowered.

(C4)状態ST10〜状態ST15
つぎに、プランジャ31cの位置Pが第2位置P2を下回ると、プランジャ位置フラグPF2が「0」に設定され、前状態出力フラグPPWFが「0」に設定される(S70)。これにより、ソレノイド31の制御状態は、状態ST13に遷移する(S76)。状態ST13においては、出力フラグPWFが「0」に設定されているので、ソレノイド31に離鍵用の駆動信号が供給されていて(S84)、プランジャ31cがさらに下降する。そして、ソレノイド31の制御状態は、状態ST15へ遷移する。状態ST13から状態ST15への遷移及び状態ST15における動作は、上記通常駆動と同様なので、説明を省略する。
(C4) State ST10 to State ST15
Next, when the position P of the plunger 31c falls below the second position P2, the plunger position flag PF2 is set to “0”, and the previous state output flag PPWF is set to “0” (S70). Thereby, the control state of the solenoid 31 is changed to the state ST13 (S76). In the state ST13, since the output flag PWF is set to “0”, a drive signal for key release is supplied to the solenoid 31 (S84), and the plunger 31c is further lowered. Then, the control state of the solenoid 31 transitions to the state ST15. Since the transition from the state ST13 to the state ST15 and the operation in the state ST15 are the same as those in the normal driving, the description thereof is omitted.

(C5)状態ST15〜状態ST16
状態ST15において、キーオンイベントが発生すると、MIDIステータスフラグMSFが「1」に設定され、前状態出力フラグPPWFが「0」に設定される(S68)。また、キーオン回数ONCTがインクリメントされて「3」に設定され、差DIFが「2」になるが、鍵駆動回数フラグKDFは「0」のままである(S68)。これにより、ソレノイド31の制御状態は、状態ST16に遷移する(S76)。状態ST16においては、出力フラグPWFが「1」に設定されているので、ソレノイド31に押鍵用の駆動信号が供給されるが(S84)、プランジャ31cは、惰性により若干下降した後、上昇し始める。すなわち、プランジャ31cは、初期位置PSに達する前に、再び上昇し始める。
(C5) State ST15 to state ST16
When a key-on event occurs in the state ST15, the MIDI status flag MSF is set to “1”, and the previous state output flag PPWF is set to “0” (S68). Further, the key-on count ONCT is incremented and set to “3”, and the difference DIF becomes “2”, but the key drive count flag KDF remains “0” (S68). Thereby, the control state of the solenoid 31 is changed to the state ST16 (S76). In the state ST16, since the output flag PWF is set to “1”, a drive signal for key pressing is supplied to the solenoid 31 (S84), but the plunger 31c is raised after being slightly lowered due to inertia. start. That is, the plunger 31c starts to rise again before reaching the initial position PS.

(C6)状態ST16〜状態ST4
つぎに、プランジャ31cの位置Pが第2位置P2を超えると、プランジャ位置フラグPF2が「1」に設定され、前状態出力フラグPPWFが「1」に設定される(S70)。これにより、ソレノイド31の制御状態は、状態ST4に遷移する(S76)。状態ST4においては、出力フラグPWFが「1」に設定されているので、ソレノイド31に押鍵用の駆動信号が供給され(S84)、プランジャ31cがさらに上昇する。
(C6) State ST16 to state ST4
Next, when the position P of the plunger 31c exceeds the second position P2, the plunger position flag PF2 is set to “1”, and the previous state output flag PPWF is set to “1” (S70). As a result, the control state of the solenoid 31 transitions to the state ST4 (S76). In the state ST4, since the output flag PWF is set to “1”, a drive signal for key pressing is supplied to the solenoid 31 (S84), and the plunger 31c further rises.

(C7)状態ST4〜状態ST6
つぎに、プランジャ31cの位置Pが第3位置P3を超えると、プランジャ位置フラグPF3が「1」に設定され、前状態出力フラグPPWFが「1」に設定される(S70)。また、キーオフ回数OFCTは「2」であるので、ソレノイド31の制御状態は、状態ST6に遷移する(S76)。状態ST4から状態ST6への遷移であるので、鍵駆動回数KDCTがインクリメントされて(S82)、「2」に設定される。これにより、鍵駆動回数KDCTとキーオン回数ONCTの差DIFは「1」となる。鍵駆動回数フラグKDFは「0」のままである。状態ST6においては、出力フラグPWFが「0」に設定されているので、ソレノイド31に離鍵用の駆動信号が供給されるが、プランジャ31cは惰性により若干上昇し、位置Pが第3位置P3を超える。
(C7) State ST4 to state ST6
Next, when the position P of the plunger 31c exceeds the third position P3, the plunger position flag PF3 is set to “1”, and the previous state output flag PPWF is set to “1” (S70). Further, since the key-off count OFCT is “2”, the control state of the solenoid 31 transitions to the state ST6 (S76). Since this is a transition from the state ST4 to the state ST6, the key drive count KDCT is incremented (S82) and set to “2”. As a result, the difference DIF between the key drive count KDCT and the key-on count ONCT is “1”. The key driving number flag KDF remains “0”. In the state ST6, since the output flag PWF is set to “0”, a drive signal for releasing the key is supplied to the solenoid 31, but the plunger 31c slightly rises due to inertia and the position P becomes the third position P3. Over.

(C8)状態ST6〜状態ST10
状態ST6において、キーオフイベントが発生すると、MIDIステータスフラグMSFが「0」に設定され、前状態出力フラグPPWFが「0」に設定される(S68)。また、キーオフ回数OFCTがインクリメントされて「3」に設定される(S68)。これにより、ソレノイド31の制御状態は、状態ST10に遷移する(S76)。状態ST10においても、状態ST6に引き続き、出力フラグPWFが「0」に設定されているが、プランジャ31cは惰性によりさらに上昇して限界位置PEに達した後、下降し始める。
(C8) State ST6 to state ST10
When a key-off event occurs in the state ST6, the MIDI status flag MSF is set to “0”, and the previous state output flag PPWF is set to “0” (S68). Also, the key-off count OFCT is incremented and set to “3” (S68). Thereby, the control state of the solenoid 31 is changed to the state ST10 (S76). Also in the state ST10, the output flag PWF is set to “0” following the state ST6. However, the plunger 31c further rises due to inertia and reaches the limit position PE and then starts to fall.

(C9)状態ST10〜状態ST11
状態ST10において、キーオンイベントが発生すると、MIDIステータスフラグMSFが「1」に設定され、前状態出力フラグPPWFが「0」に設定される(S68)。また、キーオン回数ONCTがインクリメントされて「4」に設定され、差DIFが「2」になるが、鍵駆動回数フラグは「0」のままである(S68)。これにより、ソレノイド31の制御状態は、状態ST11に遷移する(S76)。状態ST11においては、出力フラグPWFが「0」に設定されているので、ソレノイド31に離鍵用の駆動信号が供給され(S84)、プランジャ31cが下降する。
(C9) State ST10 to State ST11
When a key-on event occurs in the state ST10, the MIDI status flag MSF is set to “1”, and the previous state output flag PPWF is set to “0” (S68). Further, the key-on count ONCT is incremented and set to “4”, and the difference DIF becomes “2”, but the key drive count flag remains “0” (S68). Thereby, the control state of the solenoid 31 is changed to the state ST11 (S76). In the state ST11, since the output flag PWF is set to “0”, a key release drive signal is supplied to the solenoid 31 (S84), and the plunger 31c is lowered.

(C10)状態ST11〜状態ST12
つぎに、プランジャ31cの位置Pが第3位置P3を下回ると、プランジャ位置フラグPF3が「0」に設定され、前状態出力フラグPPWFが「0」に設定される(S70)。これにより、ソレノイド31の制御状態は、状態ST12に遷移する(S76)。状態ST12においては、出力フラグPWFが「0」に設定されているので、ソレノイド31に離鍵用の駆動信号が供給され(S84)、プランジャ31cがさらに下降する。
(C10) State ST11 to State ST12
Next, when the position P of the plunger 31c falls below the third position P3, the plunger position flag PF3 is set to “0”, and the previous state output flag PPWF is set to “0” (S70). As a result, the control state of the solenoid 31 transitions to the state ST12 (S76). In the state ST12, since the output flag PWF is set to “0”, a key release drive signal is supplied to the solenoid 31 (S84), and the plunger 31c is further lowered.

(C11)状態ST12〜状態ST16〜状態ST4
つぎに、プランジャ31cの位置Pが第2位置P2を下回ると、プランジャ位置フラグPF2が「0」に設定され、前状態出力フラグPPWFが「0」に設定される(S70)。これにより、ソレノイド31の制御状態は、状態ST16に遷移し(S76)、再びプランジャ31cが上昇し始める。そして、(C6)において説明したように、ソレノイド31の制御状態は、再び状態ST4へ遷移する。
(C11) State ST12 to state ST16 to state ST4
Next, when the position P of the plunger 31c falls below the second position P2, the plunger position flag PF2 is set to “0”, and the previous state output flag PPWF is set to “0” (S70). As a result, the control state of the solenoid 31 transitions to the state ST16 (S76), and the plunger 31c starts to rise again. And as demonstrated in (C6), the control state of the solenoid 31 changes to state ST4 again.

(C12)状態ST4〜状態ST8
状態ST4において、キーオフイベントが発生すると、MIDIステータスフラグMSFが「0」に設定され、前状態出力フラグPPWFが「1」に設定される(S68)。また、キーオフ回数OFCTがインクリメントされて「4」に設定される(S68)。これにより、ソレノイド31の制御状態は、状態ST8に遷移し(S76)、プランジャ31cはさらに上昇する。
(C12) State ST4 to state ST8
When a key-off event occurs in the state ST4, the MIDI status flag MSF is set to “0”, and the previous state output flag PPWF is set to “1” (S68). Also, the key-off count OFCT is incremented and set to “4” (S68). As a result, the control state of the solenoid 31 transitions to the state ST8 (S76), and the plunger 31c further rises.

(C13)状態ST8〜状態ST9〜状態ST11〜状態ST12
プランジャ31cの位置Pが第3位置P3を超えると、状態ST9へ遷移する。鍵駆動回数KDCTがインクリメントされて「3」に設定され、差DIFが「1」になる。鍵駆動回数フラグKDFは「0」のままである。そして、プランジャ31cが下降して、状態ST11へ遷移する。キーオン回数ONCTがインクリメントされて「5」に設定され、差DIFが「2」になる。鍵駆動回数フラグKDFは「0」のままである。そして、プランジャ31cがさらに下降して、ソレノイド31の制御状態は、状態ST12へ遷移する。
(C13) State ST8 to state ST9 to state ST11 to state ST12
When the position P of the plunger 31c exceeds the third position P3, the state transitions to the state ST9. The key driving frequency KDCT is incremented and set to “3”, and the difference DIF becomes “1”. The key driving number flag KDF remains “0”. And plunger 31c descends and changes to state ST11. The key-on count ONCT is incremented and set to “5”, and the difference DIF becomes “2”. The key driving number flag KDF remains “0”. Then, the plunger 31c is further lowered, and the control state of the solenoid 31 transitions to the state ST12.

(C14)状態ST12〜・・・〜状態ST12
プランジャ31cの位置Pが第2位置P2を下回ると、ソレノイド31の制御状態は、状態ST16へ遷移する。以降、状態ST16、状態ST4、状態ST8、状態ST9、状態ST11、状態ST12の順に遷移する。状態ST4から状態ST8への遷移において、キーオフ回数OFCTがインクリメントされて「5」に設定される。また、状態ST8から状態ST9への遷移において、鍵駆動回数KDCTがインクリメントされて「4」に設定される。これにより差DIFが「1」になるが、鍵駆動回数フラグKDFは「0」のままである。また、状態ST9から状態ST11への遷移において、キーオン回数ONCTがインクリメントされて「6」に設定される。これにより差DIFが「2」になるが、鍵駆動回数フラグKDFは「0」のままである。
(C14) State ST12 to ... State ST12
When the position P of the plunger 31c falls below the second position P2, the control state of the solenoid 31 transitions to the state ST16. Thereafter, transition is made in the order of state ST16, state ST4, state ST8, state ST9, state ST11, and state ST12. In the transition from the state ST4 to the state ST8, the key-off count OFCT is incremented and set to “5”. Further, in the transition from the state ST8 to the state ST9, the key driving number KDCT is incremented and set to “4”. As a result, the difference DIF becomes “1”, but the key driving number flag KDF remains “0”. In the transition from the state ST9 to the state ST11, the key-on count ONCT is incremented and set to “6”. As a result, the difference DIF becomes “2”, but the key driving number flag KDF remains “0”.

(C15)状態ST12〜状態ST13
状態ST12において、キーオフイベントが発生すると、MIDIステータスフラグMSFが「0」に設定され、前状態出力フラグPPWFが「0」に設定される(S68)。また、キーオフ回数OFCTがインクリメントされて「6」に設定される(S68)。これにより、ソレノイド31の制御状態は、状態ST13に遷移し(S76)、プランジャ31cがさらに下降する。
(C15) State ST12 to state ST13
When a key-off event occurs in the state ST12, the MIDI status flag MSF is set to “0”, and the previous state output flag PPWF is set to “0” (S68). Also, the key-off count OFCT is incremented and set to “6” (S68). Thereby, the control state of the solenoid 31 is changed to the state ST13 (S76), and the plunger 31c is further lowered.

(C16)状態ST13〜状態ST15〜状態ST1
プランジャ31cが下降して、ソレノイド31の制御状態が、状態ST15、状態ST1の順に遷移し、鍵11がレスト位置にて停止する。
(C16) State ST13 to State ST15 to State ST1
The plunger 31c descends, and the control state of the solenoid 31 transitions in order of the state ST15 and the state ST1, and the key 11 stops at the rest position.

つぎに、上記の図14Bの状態ST15において、さらにキーオンイベントが発生してさらに連打を継続する例を図11及び図15を用いて説明する。   Next, in the state ST15 of FIG. 14B described above, an example in which a key-on event further occurs and further continuous hitting will be described with reference to FIGS.

(C17)状態ST15〜状態ST16〜・・・〜ST13
この場合、ソレノイド31の制御状態は、状態ST16に遷移する。この例においては、その後、ソレノイド31の制御状態が、状態ST4、状態ST6、状態ST10、状態ST11、状態ST12、状態ST13の順に遷移している。これらの状態遷移及び各状態における動作は、上記の連打駆動と同様である。なお、状態ST15から状態ST16への遷移において、キーオン回数ONCTがインクリメントされて「7」に設定される。これにより差DIFが「3」になるので、鍵駆動回数フラグKDFが「1」に設定される。また、状態ST4から状態ST6への遷移において、鍵駆動回数KDCTがインクリメントされて「5」に設定される。これにより差DIFが「2」になり、鍵駆動回数フラグKDFが「0」に設定される。また、状態ST6から状態ST10への遷移において、キーオフ回数OFCTがインクリメントされて「7」に設定される。これにより差DIFが「2」になるが、鍵駆動回数フラグKDFは「0」のままである。また、状態ST10から状態ST11への遷移において、キーオン回数ONCTがインクリメントされて「8」に設定される。これにより差DIFが「3」になるので、鍵駆動回数フラグKDFが「1」に設定される。また、状態ST12から状態ST13への遷移において、キーオフ回数OFCTがインクリメントされて「8」に設定される。
(C17) State ST15 to State ST16 to ... ST13
In this case, the control state of the solenoid 31 transitions to the state ST16. In this example, the control state of the solenoid 31 subsequently changes in the order of the state ST4, the state ST6, the state ST10, the state ST11, the state ST12, and the state ST13. These state transitions and operations in each state are the same as in the above-described continuous driving. In the transition from the state ST15 to the state ST16, the key-on count ONCT is incremented and set to “7”. As a result, the difference DIF becomes “3”, so that the key driving number flag KDF is set to “1”. Further, in the transition from the state ST4 to the state ST6, the key driving number KDCT is incremented and set to “5”. As a result, the difference DIF becomes “2”, and the key driving number flag KDF is set to “0”. In the transition from the state ST6 to the state ST10, the key-off count OFCT is incremented and set to “7”. As a result, the difference DIF becomes “2”, but the key driving number flag KDF remains “0”. In the transition from the state ST10 to the state ST11, the key-on count ONCT is incremented and set to “8”. As a result, the difference DIF becomes “3”, so that the key driving number flag KDF is set to “1”. In the transition from the state ST12 to the state ST13, the key-off number OFCT is incremented and set to “8”.

(C18)状態ST13〜状態ST14
つぎに、プランジャ31cの位置Pが第2位置P2を下回ると、プランジャ位置フラグPF2が「0」に設定され、前状態出力フラグPPWFが「0」に設定される(S70)。また、鍵駆動回数フラグKDFは「1」であるから、ソレノイド31の制御状態は、状態ST14に遷移する(S76)。状態ST14においては、出力フラグPWFが「1」に設定されているので、ソレノイド31に押鍵用の駆動信号が供給されるが(S84)、プランジャ31cは惰性により若干下降した後、上昇し始める。
(C18) State ST13 to State ST14
Next, when the position P of the plunger 31c falls below the second position P2, the plunger position flag PF2 is set to “0”, and the previous state output flag PPWF is set to “0” (S70). Further, since the key driving number flag KDF is “1”, the control state of the solenoid 31 is shifted to the state ST14 (S76). In the state ST14, since the output flag PWF is set to “1”, a driving signal for pressing the key is supplied to the solenoid 31 (S84), but the plunger 31c starts to rise after being slightly lowered due to inertia. .

(C19)状態ST14〜状態ST8
つぎに、プランジャ31cの位置Pが第2位置P2を超えると、プランジャ位置フラグPF2が「1」に設定され、前状態出力フラグPPWFが「1」に設定される(S70)。これにより、ソレノイド31の制御状態は、状態ST8に遷移する(S76)。これにより、プランジャ31cがさらに上昇する。
(C19) State ST14 to State ST8
Next, when the position P of the plunger 31c exceeds the second position P2, the plunger position flag PF2 is set to “1”, and the previous state output flag PPWF is set to “1” (S70). As a result, the control state of the solenoid 31 transitions to the state ST8 (S76). Thereby, the plunger 31c further rises.

以降、状態ST9、状態ST11、状態ST12、状態ST13、状態ST15、状態ST16、状態ST4、状態ST6、状態ST10、状態ST11、状態ST12、状態ST14の順に遷移し、再び状態ST8に戻る動作を繰り返すと、差DIFが基準値a(=「6」)を超える。この場合、状態ST13において、差DIFを「0」とみなす。これにより、状態ST13から状態ST14へ遷移するのではなく、状態ST15へ遷移する。そして、状態ST15においてキーオンイベントが発生しなければ、状態ST1へ遷移して、鍵11がレスト位置にて停止する。   Thereafter, the state ST9, the state ST11, the state ST12, the state ST13, the state ST15, the state ST16, the state ST4, the state ST6, the state ST10, the state ST11, the state ST12, and the state ST14 are changed in this order, and the operation of returning to the state ST8 again is repeated. The difference DIF exceeds the reference value a (= “6”). In this case, the difference DIF is regarded as “0” in the state ST13. Thereby, instead of transition from state ST13 to state ST14, transition is made to state ST15. If no key-on event occurs in the state ST15, the state transits to the state ST1, and the key 11 stops at the rest position.

D.その他
つぎに、ソレノイド31の制御状態のその他の遷移について説明する。
D. Others Next, other transitions of the control state of the solenoid 31 will be described.

状態ST8において、キーオンイベントが発生すると、MIDIステータスフラグMSFが「1」に設定され、前状態出力フラグPPWFが「1」に設定される(S68)。また、キーオン回数ONCTがインクリメントされ、差DIFに応じて、鍵駆動回数フラグが設定される(S68)。これにより、ソレノイド31の制御状態は、状態ST4に遷移する(S76)。そして、状態ST8に引き続き、プランジャ31cは上昇する。   When a key-on event occurs in the state ST8, the MIDI status flag MSF is set to “1”, and the previous state output flag PPWF is set to “1” (S68). Further, the key-on number ONCT is incremented, and the key driving number flag is set according to the difference DIF (S68). As a result, the control state of the solenoid 31 transitions to the state ST4 (S76). Then, following the state ST8, the plunger 31c moves up.

また、状態ST6において、プランジャ31cが下降し、プランジャ31cの位置Pが第3位置P3を下回ると、プランジャ位置フラグPF3が「0」に設定され、前状態出力フラグPPWFが「0」に設定される(S70)。これにより、ソレノイド31の制御状態は、状態ST12に遷移する(S76)。そして、状態ST6に引き続き、プランジャ31cは下降する。   In the state ST6, when the plunger 31c is lowered and the position P of the plunger 31c is lower than the third position P3, the plunger position flag PF3 is set to “0”, and the previous state output flag PPWF is set to “0”. (S70). As a result, the control state of the solenoid 31 transitions to the state ST12 (S76). Then, following the state ST6, the plunger 31c is lowered.

また、状態ST13において、キーオンイベントが発生すると、MIDIステータスフラグMSFが「1」に設定され、前状態出力フラグPPWFが「0」に設定される(S68)。また、キーオン回数ONCTがインクリメントされ、差DIFに応じて、鍵駆動回数フラグが設定される(S68)。これにより、ソレノイド31の制御状態は、状態ST12に遷移する(S76)。そして、状態ST13に引き続き、プランジャ31cは下降する。   In the state ST13, when a key-on event occurs, the MIDI status flag MSF is set to “1”, and the previous state output flag PPWF is set to “0” (S68). Further, the key-on number ONCT is incremented, and the key driving number flag is set according to the difference DIF (S68). As a result, the control state of the solenoid 31 transitions to the state ST12 (S76). Then, following the state ST13, the plunger 31c descends.

また、状態ST7において、キーオンイベントが発生すると、MIDIステータスフラグMSFが「1」に設定され、前状態出力フラグPPWFが「1」に設定される(S68)。また、キーオン回数ONCTがインクリメントされ、差DIFに応じて、鍵駆動回数フラグKDFが設定される(S68)。これにより、ソレノイド31の制御状態は、状態ST3に遷移する(S76)。そして、状態ST7に引き続き、プランジャ31cは上昇する。   In the state ST7, when a key-on event occurs, the MIDI status flag MSF is set to “1”, and the previous state output flag PPWF is set to “1” (S68). Further, the key-on number ONCT is incremented, and the key driving number flag KDF is set according to the difference DIF (S68). Thereby, the control state of the solenoid 31 is changed to the state ST3 (S76). Then, following the state ST7, the plunger 31c moves up.

また、状態ST16において、キーオフイベントが発生すると、MIDIステータスフラグMSFが「0」に設定され、前状態出力フラグPPWFが「1」に設定される(S68)。また、キーオフ回数OFCTがインクリメントされる(S68)。これにより、ソレノイド31の制御状態は、状態ST7に遷移する(S76)。そして、状態ST16に引き続き、プランジャ31cは上昇する。   In the state ST16, when a key-off event occurs, the MIDI status flag MSF is set to “0”, and the previous state output flag PPWF is set to “1” (S68). Further, the key-off count OFCT is incremented (S68). As a result, the control state of the solenoid 31 transitions to the state ST7 (S76). Subsequently to the state ST16, the plunger 31c moves up.

なお、本実施形態においては、初期位置PSと第1位置P1との間隔を非常に狭く設定したので、状態ST2から状態ST3へ遷移する前に、キーオフイベントが発生することを考慮していない。   In this embodiment, since the interval between the initial position PS and the first position P1 is set very narrow, it is not considered that a key-off event occurs before the transition from the state ST2 to the state ST3.

上記のように構成した電子楽器によれば、短期間内に鍵11に関するキーオンイベント及びキーオフイベントが繰り返し発生した場合、これらのキーオンイベント及びキーオフイベントの発生に同期して、楽音信号の発生及び停止が制御される。そして、鍵11の連打開始から終了までのキーオン回数ONCTと鍵駆動回数KDCTとの差DIFは、基準値b以下であるので、前記連打時における押離鍵の回数が多い場合であっても、発音に対する鍵11の動作が自然である。   According to the electronic musical instrument configured as described above, when a key-on event and a key-off event related to the key 11 are repeatedly generated within a short period of time, generation and stop of a musical sound signal is synchronized with the generation of these key-on event and key-off event. Is controlled. Since the difference DIF between the key-on count ONCT and the key drive count KDCT from the start to the end of the key 11 is less than or equal to the reference value b, The operation of the key 11 with respect to pronunciation is natural.

また、鍵11の連打開始から終了までのキーオン回数ONCTと鍵駆動回数KDCTとの差DIFが基準値aよりも大きいとき、差DIFを「0」とみなすようにした。これにより、連打動作途中において、連打開始からそれまでに供給された押鍵情報の数と鍵の駆動回数のずれが基準値aより大きくなった場合には、連打を終了させる。すなわち、押離鍵回数分の発音が終了するのと、ほぼ同時に鍵11の駆動も終了する。これにより、楽音の発生に対する鍵11の動作が不自然に感じられることを防止できる。この場合、押離鍵回数が非常に多いので、楽音の発生回数と鍵11の駆動回数とのずれが多少大きくても、鍵11の動作が不自然に感じられることはない。   Further, when the difference DIF between the key-on count ONCT and the key drive count KDCT from the start to the end of the key 11 is larger than the reference value a, the difference DIF is regarded as “0”. Thereby, in the middle of the continuous hitting operation, when the difference between the number of key press information supplied from the start of the continuous hitting and the number of times of key driving becomes larger than the reference value a, the continuous hitting is ended. That is, the driving of the key 11 ends almost simultaneously with the end of the sound generation for the number of times the key is pressed and released. Thereby, it can prevent that the operation | movement of the key 11 with respect to generation | occurrence | production of a musical sound is felt unnatural. In this case, since the number of times the key is pressed and released is very large, even if the difference between the number of times the musical sound is generated and the number of times the key 11 is driven is somewhat large, the operation of the key 11 does not feel unnatural.

また、上記のように、デューティ比テーブルは、プランジャ31cの位置(すなわち、押鍵深さ)とソレノイド31に供給する駆動信号(PWM信号)のデューティ比との関係を規定しているだけであるので、プランジャ31cの移動速度は、奏法(上記の通常駆動、スタッカート駆動、連打駆動など)に依存しない。したがって、ソレノイド31に供給する駆動信号の制御が簡単である。   Further, as described above, the duty ratio table only defines the relationship between the position of the plunger 31c (that is, the key pressing depth) and the duty ratio of the drive signal (PWM signal) supplied to the solenoid 31. Therefore, the moving speed of the plunger 31c does not depend on the performance method (the above normal driving, staccato driving, continuous driving, etc.). Therefore, the control of the drive signal supplied to the solenoid 31 is simple.

さらに、本発明の実施にあたっては、上記実施形態に限定されるものではなく、本発明の目的を逸脱しない限りにおいて種々の変更が可能である。   Furthermore, in carrying out the present invention, the present invention is not limited to the above embodiment, and various modifications can be made without departing from the object of the present invention.

例えば、プランジャ31cと鍵11との係合部を、図16Aに示すように構成してもよい。この場合、プランジャキャップ37に代えてプランジャキャップ37Aを用いている。プランジャキャップ37Aの下端部には、鍵11の左方向及び右方向へ向かってそれぞれ延設された軸37A1,37A1が設けられている。また、鍵11の後端部であって、プランジャキャップ37Aに対向する部分には、連結部材38Aが組み付けられている。すなわち、連結部材38Aの下端部には、上下方向に延設された突起が設けられていて、この突起を鍵11に設けられた嵌合孔に圧入した後、接着することにより、連結部材38Aが鍵11の後端部に組み付けられている。連結部材38の上端部には、前側から見て上方に開いたV字型の溝が設けられている。そして、連結部材38の側面部には、前記溝の下端部から高音側及び低音側へそれぞれ貫通していて前後方向に長い長孔38A1,38A1が設けられている。長孔38A1,38A1の上端面には、図16Bに示すように、上記実施形態と同様の緩衝シート37a及び低摩擦シート37bが貼り付けられている。プランジャキャップ37Aを連結部材38Aの上方から前記溝部に押し込むと、前記溝部の弾性によって前記溝部が若干開き、軸37A1,37A1が、長孔38A1,38A1にそれぞれ嵌合し、軸37A1,37A1の上面が低摩擦シート37bの下面に当接する。上記のように構成した場合、ソレノイド31への非通電時には、プランジャ31cの自重及びハンマー20の重量が軸37A1,37A1を介して連結部38Aに伝達され、連結部38Aが下方へ押される。これにより、鍵11の前端部が上方へ移動する。一方、ソレノイド31への通電時には、軸37A1,37A1によって、連結部材38Aが上方へ引き上げられるので、鍵11の前端部が下方へ移動する。その他の動作及び効果は、上記実施形態と同様である。   For example, the engaging portion between the plunger 31c and the key 11 may be configured as shown in FIG. 16A. In this case, a plunger cap 37A is used in place of the plunger cap 37. The lower end portion of the plunger cap 37A is provided with shafts 37A1 and 37A1 extending in the left direction and the right direction of the key 11, respectively. Further, a connecting member 38A is assembled to the rear end portion of the key 11 and facing the plunger cap 37A. That is, a protrusion extending in the vertical direction is provided at the lower end portion of the connecting member 38A. The protrusion is press-fitted into a fitting hole provided in the key 11, and then bonded, whereby the connecting member 38A is bonded. Is assembled to the rear end of the key 11. A V-shaped groove that opens upward as viewed from the front side is provided at the upper end of the connecting member 38. The side surface of the connecting member 38 is provided with long holes 38A1 and 38A1 that penetrate from the lower end of the groove to the high sound side and the low sound side, respectively, and are long in the front-rear direction. As shown in FIG. 16B, a buffer sheet 37a and a low friction sheet 37b similar to those of the above embodiment are attached to the upper end surfaces of the long holes 38A1 and 38A1. When the plunger cap 37A is pushed into the groove from above the connecting member 38A, the groove is slightly opened by the elasticity of the groove, the shafts 37A1 and 37A1 are fitted into the long holes 38A1 and 38A1, respectively, and the top surfaces of the shafts 37A1 and 37A1 Contacts the lower surface of the low friction sheet 37b. When configured as described above, when the solenoid 31 is not energized, the weight of the plunger 31c and the weight of the hammer 20 are transmitted to the connecting portion 38A via the shafts 37A1 and 37A1, and the connecting portion 38A is pushed downward. As a result, the front end of the key 11 moves upward. On the other hand, when the solenoid 31 is energized, the connecting member 38A is pulled upward by the shafts 37A1 and 37A1, so that the front end portion of the key 11 moves downward. Other operations and effects are the same as in the above embodiment.

上記実施形態においては、鍵駆動プログラムのステップS64〜ステップS86を繰り返し実行して、プランジャ31cの移動を監視するようにした。しかし、これに代えて、プランジャ31cの位置が第1位置P1、第2位置P2及び第3位置P3に達するごとに、検出回路43が、CPU45aに割り込み信号を出力するようにしておき、この割り込み信号をトリガとして、プランジャ位置フラグPF1乃至PF3を更新するようにしてもよい。このように構成すれば、ステップS64〜ステップS86の実行において、ステップS70を省略できるので、CPU45aの負荷を軽減できる。   In the above embodiment, the movement of the plunger 31c is monitored by repeatedly executing Step S64 to Step S86 of the key driving program. However, instead of this, every time the position of the plunger 31c reaches the first position P1, the second position P2, and the third position P3, the detection circuit 43 outputs an interrupt signal to the CPU 45a. The plunger position flags PF1 to PF3 may be updated using a signal as a trigger. If comprised in this way, since step S70 can be abbreviate | omitted in execution of step S64-step S86, the load of CPU45a can be reduced.

駆動回路44は、MIDIインターフェース回路52又は通信インターフェース回路53を介して外部機器52から供給されるMIDI信号によって制御されるようにしてもよい。すなわち、CPU45aは、上記の鍵駆動プログラムと平行して、外部機器52から供給されたMIDI信号に含まれるイベントデータをイベント処理バッファに記憶するプログラムを実行するように構成すればよい。   The drive circuit 44 may be controlled by a MIDI signal supplied from the external device 52 via the MIDI interface circuit 52 or the communication interface circuit 53. That is, the CPU 45a may be configured to execute a program for storing event data included in the MIDI signal supplied from the external device 52 in the event processing buffer in parallel with the above-described key driving program.

また、上記実施形態においては、位置センサ40は、プランジャ31cの位置を検出するようにしたが、これに代えて、鍵11の押鍵深さを検出するようにしてもよい。すなわち、鍵11の前端部又は後端部の上下方向の位置を検出するようにしてもよい。   In the above-described embodiment, the position sensor 40 detects the position of the plunger 31c. Instead, the position sensor 40 may detect the key pressing depth of the key 11. That is, the vertical position of the front end portion or the rear end portion of the key 11 may be detected.

11・・・鍵、31・・・ソレノイド(駆動手段)、40・・・位置センサ(押鍵深さ検出手段)、44・・・駆動回路(鍵駆動制御手段)、45・・・コンピュータ部(自動演奏制御手段、鍵駆動制御手段、連打決定手段)、48・・・楽音信号発生手段、MSF・・・MIDIステータスフラグ、PF1,PF2,PF3・・・プランジャ位置フラグ、PPWF・・・前状態出力フラグ、PWF・・・出力フラグ、OFF・・・キーオフ回数フラグ、KDF・・・鍵駆動回数フラグ、ONCT・・・キーオン回数(第1カウンタ)、OFCT・・・キーオフ回数、KDCT・・・鍵駆動回数(第2カウンタ)、DIF・・・差 DESCRIPTION OF SYMBOLS 11 ... Key, 31 ... Solenoid (drive means), 40 ... Position sensor (key press depth detection means), 44 ... Drive circuit (key drive control means), 45 ... Computer part (Automatic performance control means, key drive control means, continuous strike determination means), 48... Tone signal generation means, MSF... MIDI status flag, PF1, PF2, PF3... Plunger position flag, PPWF. Status output flag, PWF ... Output flag, OFF ... Key-off count flag, KDF ... Key drive count flag, ONCT ... Key-on count (first counter), OFCT ... Key-off count, KDCT ...・ Number of key driving (second counter), DIF ... Difference

Claims (4)

揺動可能に支持された鍵と、
前記鍵を押鍵動作及び離鍵動作させる駆動手段と、
前記鍵の押鍵深さを検出する押鍵深さ検出手段と、
楽曲の演奏内容を表わす演奏情報に従って、前記鍵の押鍵を表す押鍵情報及び前記鍵の離鍵を表す離鍵情報を出力する自動演奏制御手段と、
前記自動演奏制御手段及び外部機器のいずれか一方又は両方から入力した前記押鍵情報及び前記離鍵情報に応じて前記駆動手段を制御する鍵駆動制御手段であって、所定の短い期間内に前記押鍵情報及び前記離鍵情報を繰り返し入力したとき、前記離鍵動作途中に前記押鍵動作に切り替えて、前記鍵を連打するよう前記駆動手段を制御する鍵駆動制御手段と、
前記自動演奏制御手段及び外部機器のいずれか一方又は両方から入力した前記押鍵情報及び前記離鍵情報に応じて楽音信号の発生を制御する楽音信号発生手段とを備えた演奏装置において、
前記鍵駆動制御手段は、
前記連打の最初の押鍵開始後、前記入力した前記押鍵情報の回数をカウントする第1カウンタと、
前記連打の最初の押鍵開始後、前記鍵を押鍵動作させた回数をカウントする第2カウンタと、
前記鍵の離鍵動作途中であって、前記押鍵深さ検出手段によって検出した前記鍵の押鍵深さが所定の範囲内にある状態において、前記第1カウンタのカウント値と前記第2カウンタのカウント値との差に応じて、前記連打を継続するか、前記連打を終了するかを決定する連打決定手段を備えたことを特徴とする演奏装置。
A key that is pivotally supported;
Driving means for pressing and releasing the key;
A key pressing depth detecting means for detecting a key pressing depth of the key;
Automatic performance control means for outputting key press information indicating key press and key release information indicating key release according to performance information indicating the performance content of the music;
Key drive control means for controlling the drive means in accordance with the key press information and the key release information input from one or both of the automatic performance control means and the external device, wherein the key drive control means controls the drive means within a predetermined short period of time. A key drive control means for controlling the drive means to repeatedly press the key by switching to the key press operation during the key release operation when the key press information and the key release information are repeatedly input;
In a performance apparatus comprising a musical tone signal generating means for controlling generation of a musical tone signal in accordance with the key depression information and the key release information input from either or both of the automatic performance control means and an external device,
The key driving control means includes
A first counter that counts the number of times of the input key pressing information after the first key pressing of the continuous hitting;
A second counter that counts the number of times the key is depressed after the first key depression of the continuous hitting;
While the key release operation is in progress and the key pressing depth detected by the key pressing depth detection means is within a predetermined range, the count value of the first counter and the second counter A performance device comprising: a continuous hit determining means for determining whether to continue the continuous hit or to end the continuous hit in accordance with a difference from the count value.
請求項1に記載の演奏装置において、
連打決定手段は、前記第1カウンタのカウント値と前記第2カウンタのカウント値との差が所定の第1基準値よりも大きい場合、前記連打を継続し、前記第1カウンタのカウント値と前記第2カウンタのカウント値との差が前記第1基準値以下である場合、前記連打を終了すると決定することを特徴とする演奏装置。
The performance device according to claim 1,
When the difference between the count value of the first counter and the count value of the second counter is larger than a predetermined first reference value, the repeated hit determination means continues the continuous hit, and the count value of the first counter and the count value of the first counter The performance apparatus, wherein when the difference from the count value of the second counter is equal to or less than the first reference value, it is determined to end the continuous hitting.
請求項2に記載の演奏装置において、
前記連打決定手段は、前記第1カウンタのカウント値と前記第2カウンタのカウント値との差が、前記第1基準値よりも大きい場合であっても、前記第1基準値よりも大きな第2基準値よりも大きい場合には、前記連打を終了すると決定することを特徴とする演奏装置。
The performance device according to claim 2,
The repeated hit determining means is configured to detect a second value larger than the first reference value even if a difference between the count value of the first counter and the count value of the second counter is larger than the first reference value. The performance device is characterized in that when it is larger than the reference value, it is determined that the continuous hitting is ended.
請求項1乃至請求項3のうちのいずれか1つに記載の演奏装置において、
前記連打決定手段は、前記連打を終了すると決定した後であって、前記鍵の離鍵動作が終了する前に新たな押鍵情報を入力したとき、前記連打を終了する決定を取り消して、前記連打を継続すると決定することを特徴とする演奏装置。
The performance device according to any one of claims 1 to 3,
The repeated hitting determination unit cancels the determination to end the repeated hits after determining to end the repeated hits and when new key pressing information is input before the key release operation ends. A performance device characterized in that it is determined that continuous hitting is continued.
JP2011234669A 2011-10-26 2011-10-26 Performance equipment Expired - Fee Related JP5772504B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011234669A JP5772504B2 (en) 2011-10-26 2011-10-26 Performance equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011234669A JP5772504B2 (en) 2011-10-26 2011-10-26 Performance equipment

Publications (2)

Publication Number Publication Date
JP2013092648A JP2013092648A (en) 2013-05-16
JP5772504B2 true JP5772504B2 (en) 2015-09-02

Family

ID=48615812

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011234669A Expired - Fee Related JP5772504B2 (en) 2011-10-26 2011-10-26 Performance equipment

Country Status (1)

Country Link
JP (1) JP5772504B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108074555B (en) * 2016-11-18 2021-05-14 北京酷我科技有限公司 Evaluation method and system for piano playing

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5062401B2 (en) * 2007-03-23 2012-10-31 ヤマハ株式会社 Instrument control device

Also Published As

Publication number Publication date
JP2013092648A (en) 2013-05-16

Similar Documents

Publication Publication Date Title
JP4736883B2 (en) Automatic performance device
CN103000170B (en) Audio gives equipment and piano
JP5028849B2 (en) Method and apparatus for identifying half point of pedal of keyboard instrument
US20180033407A1 (en) Sound producing apparatus, keyboard instrument, and sound production control method
JP6149354B2 (en) Electronic keyboard instrument, method and program
JP2007199411A (en) Keyboard musical instrument
JP5736917B2 (en) Keyboard instrument, program, performance data conversion program and device
US8933309B2 (en) Simulating muting in a drive control device for striking member in sound generation mechanism
JP2010026417A (en) Electronic keyboard musical instrument
JP4661143B2 (en) A musical instrument performance driving apparatus, a method for driving a musical instrument performance operator by feedback control, and a control program for executing the method by a computer.
JP5772504B2 (en) Performance equipment
JP4134952B2 (en) Automatic piano
US5335574A (en) Self playing piano and an apparatus for automatic playing of a piano
JPH0962255A (en) Automatic playing keyboard instrument
JP2001005458A (en) Keyboard instrument
JP5842799B2 (en) piano
JP2001005447A (en) Keyboard instrument
JP5104928B2 (en) Performance information playback device
JP5169576B2 (en) Electronic keyboard instrument
JP2009025687A (en) Piano
JP2004094277A (en) Keyboard instrument
JP5228668B2 (en) Electronic keyboard instrument
JP5657868B2 (en) Musical sound control method and musical sound control device
JP5428344B2 (en) Automatic performance electronic piano control device
JP5532747B2 (en) Keyboard device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20140820

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20150529

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20150615

LAPS Cancellation because of no payment of annual fees