JP2009169061A - Switching operation detection apparatus - Google Patents

Switching operation detection apparatus Download PDF

Info

Publication number
JP2009169061A
JP2009169061A JP2008006637A JP2008006637A JP2009169061A JP 2009169061 A JP2009169061 A JP 2009169061A JP 2008006637 A JP2008006637 A JP 2008006637A JP 2008006637 A JP2008006637 A JP 2008006637A JP 2009169061 A JP2009169061 A JP 2009169061A
Authority
JP
Japan
Prior art keywords
plug
switch
input port
level
jack
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2008006637A
Other languages
Japanese (ja)
Other versions
JP5204496B2 (en
Inventor
Kenji Tsuboi
研次 坪井
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.)
Roland Corp
Original Assignee
Roland 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 Roland Corp filed Critical Roland Corp
Priority to JP2008006637A priority Critical patent/JP5204496B2/en
Publication of JP2009169061A publication Critical patent/JP2009169061A/en
Application granted granted Critical
Publication of JP5204496B2 publication Critical patent/JP5204496B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Details Of Connecting Devices For Male And Female Coupling (AREA)
  • Coupling Device And Connection With Printed Circuit (AREA)
  • Electrophonic Musical Instruments (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a switching operation detection apparatus capable of preventing malfunction arising when a plug is pulled out. <P>SOLUTION: When a flag 1 is not "1" (S3: No), it indicates that a level of an input port 1 is changed from low to high, and then, it is determined whether a flag 2 is set at "1" (S5). When the flag 2 is not set at "1" (S5: No), a level of an input port 2 is low, and then, it is determined whether a flag 3 is set at "1" (S6). When a flag 3 is "1" (S6: Yes), it indicates that the plug 21 is inserted into a jack 6, and therefore, it is determined that a first switch FSW1 is switched on, and starting processing or stopping processing of automatic playing is performed (S7). <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、ジャックからプラグが抜かれた場合の誤動作を防止することができるスイッチ操作検出装置に関するものである。   The present invention relates to a switch operation detection device that can prevent malfunction when a plug is removed from a jack.

従来より電子楽器や音響機器などにはジャックが備えられ、主に足で操作されるフットスイッチなどがプラグを介して着脱自在に装着され、機器の各種機能のオンオフなどがフットスイッチにより操作される(特許文献1)。プラグには、2極の電極を有するモノラルプラグと、3極の電極を有するステレオプラグがある。また、プラグのサイズにより、マイクロプラグ、ミニプラグ、標準プラグと呼ばれるものがある。   Conventionally, electronic musical instruments and audio equipment are equipped with jacks, and foot switches that are mainly operated with feet are detachably attached via plugs, and various functions of the devices are operated with foot switches. (Patent Document 1). The plug includes a mono plug having two electrodes and a stereo plug having three electrodes. Depending on the size of the plug, there is a so-called micro plug, mini plug, or standard plug.

これらの種類に対応して、ジャックにも、モノラルジャック、ステレオジャックがあり、サイズにより、マイクロジャック、ミニジャック、標準ジャックがある。   Corresponding to these types, there are also monaural jacks and stereo jacks, and there are micro jacks, mini jacks, and standard jacks depending on the size.

モノラルプラグは、その先端にチップと呼ばれる電極が形成され、絶縁リングを挟んでスリーブと呼ばれ接地される電極が形成される。ステレオプラグは、モノラルプラグと同様に、先端にチップと呼ばれる第1電極が形成され、スリーブとの間に、リングと呼ばれる第2電極が形成され、リングの両側には、絶縁リングが形成される。   In the monaural plug, an electrode called a tip is formed at the tip, and an electrode called a sleeve and grounded is formed with an insulating ring interposed therebetween. In the stereo plug, like the monaural plug, a first electrode called a tip is formed at the tip, a second electrode called a ring is formed between the sleeve, and an insulating ring is formed on both sides of the ring. .

また、ジャックには、プラグが挿入されることにより開閉されるスイッチが設けられ、そのスイッチの状態により、プラグが挿入されているか否かを判断することができるものもある。
特開平5−88672号公報
Some jacks are provided with a switch that is opened and closed when a plug is inserted, and it is possible to determine whether or not the plug is inserted according to the state of the switch.
JP-A-5-88672

しかしながら、機器に電源が投入されている状態において、ジャックに挿入されていたプラグが抜かれると、スイッチがオン操作されていないにもかかわらず、スイッチがオンされたと誤って判断されるという問題点があった。   However, when the device is powered on, if the plug inserted in the jack is removed, it is erroneously determined that the switch is turned on even though the switch is not turned on. was there.

これは、ジャックにプラグが挿入されている際のジャックの電極のレベルが、プラグを抜くことによって反転し、スイッチがオン操作されたと判定されることによる誤動作である。この誤動作を防止するために、プラグが挿入されているか否かを検出するスイッチが設けられているジャックも供給されているが、この検出スイッチによってジャックが抜かれたことを検出する場合、検出タイミングが遅く、誤動作する場合がある。   This is a malfunction due to the fact that the level of the electrode of the jack when the plug is inserted into the jack is reversed by removing the plug and it is determined that the switch is turned on. In order to prevent this malfunction, a jack provided with a switch for detecting whether or not a plug is inserted is also provided, but when detecting that the jack has been removed by this detection switch, the detection timing is It may be slow and malfunction.

そのため、例えば、楽曲の演奏データを記憶し、設定されたテンポで演奏を行う自動演奏装置において、自動演奏の開始および停止をフットスイッチにより指示する場合に、プラグをジャックから抜くと、フットスイッチがオン操作されたと誤って判断されて、停止していた自動演奏を開始する場合がある。同様に、録音や録画を行う機器において、録音や録画の開始および停止をフットスイッチにより指示する場合に、プラグをジャックから抜くと、録画または録音が開始されてしまうという問題点があった。   Therefore, for example, in an automatic performance device that stores musical performance data and performs at a set tempo, when the start and stop of automatic performance is instructed by the foot switch, if the plug is removed from the jack, the foot switch There is a case where it is erroneously determined that the on-operation has been made and the automatic performance which has been stopped is started. Similarly, in a device that performs recording or recording, there is a problem that recording or recording starts when the plug is removed from the jack when the start or stop of recording or recording is instructed by a foot switch.

本発明は、上述した問題点を解決するためになされたものであり、プラグが抜かれた場合の誤動作を防止することができるスイッチ操作検出装置を提供することを目的とする。   The present invention has been made to solve the above-described problems, and an object of the present invention is to provide a switch operation detection device that can prevent malfunction when a plug is removed.

上記目的を達成するために、本発明の請求項1記載のスイッチ操作検出装置は、プラグの先端に形成される電極であるチップと接触し、第1電気信号を入力する第1接点と、チップよりプラグの根本側に形成される電極と接触し、第2電気信号を入力する第2接点とを有するジャックを備え、そのジャックに挿入されたプラグを介して接続されるスイッチの操作を検出するものであり、前記第1接点から入力された第1電気信号がオフ状態からオン状態に変化したかを検出する第1検出手段と、前記第2接点から入力された第2電気信号がオン状態かオフ状態かを検出する第2検出手段と、前記第1検出手段により前記第1電気信号がオフ状態からオン状態に変化したことが検出された場合に、前記第2検出手段により第2電気信号がオフ状態であると検出されれば前記スイッチが操作されたと判定し、前記第2検出手段により第2電気信号がオン状態であると検出されれば前記スイッチが操作されたのではないと判定する判定手段とを備えている。   In order to achieve the above object, a switch operation detecting device according to claim 1 of the present invention is in contact with a chip which is an electrode formed at the tip of a plug, and a first contact for inputting a first electric signal; A jack having a second contact for inputting a second electrical signal is provided that is in contact with an electrode formed on the base side of the plug, and detects an operation of a switch connected via the plug inserted into the jack. First detection means for detecting whether the first electrical signal input from the first contact has changed from an off state to an on state, and a second electrical signal input from the second contact is on. Second detecting means for detecting whether the first electric signal is changed from an off state to an on state by the first detecting means. Signal off If it is detected that the switch is operated, it is determined that the switch has been operated, and if the second electric signal is detected to be in the ON state by the second detecting means, it is determined that the switch has not been operated. And.

請求項2記載のスイッチ操作検出装置は、請求項1記載のスイッチ操作検出装置において、前記ジャックにプラグが装着されているか否かを検出するプラグ検出手段を備え、前記判定手段は、前記第1検出手段により前記第1電気信号がオフ状態からオン状態に変化したことが検出された場合に、前記第2検出手段により第2電気信号がオフ状態であると検出され且つ前記プラグ検出手段によりプラグが装着されていると検出されれば前記スイッチが操作されたと判定し、前記第2検出手段により第2電気信号がオン状態であると検出された場合、又は前記プラグ検出手段によりプラグが装着されていないと検出された場合に前記スイッチが操作されたのではないと判定する。   The switch operation detection device according to claim 2 is provided with a plug detection means for detecting whether or not a plug is attached to the jack in the switch operation detection device according to claim 1, wherein the determination means includes the first operation means. When it is detected by the detecting means that the first electric signal has changed from the off state to the on state, the second detecting means detects that the second electric signal is in the off state and the plug detecting means If it is detected that the switch is operated, the second detection means detects that the second electrical signal is in the on state, or the plug detection means attaches a plug. If it is detected that the switch is not, it is determined that the switch is not operated.

請求項1記載のスイッチ操作検出装置によれば、第1検出手段は、第1接点から入力された第1電気信号がオフ状態からオン状態に変化したかを検出し、第2検出手段は、第2接点から入力された第2電気信号がオン状態かオフ状態かを検出する。   According to the switch operation detecting device of the first aspect, the first detecting means detects whether the first electric signal input from the first contact has changed from the off state to the on state, and the second detecting means includes: Whether the second electrical signal input from the second contact is on or off is detected.

判定手段は、第1検出手段により第1電気信号がオフ状態からオン状態に変化したことが検出された場合に、第2検出手段により第2電気信号がオフ状態であると検出されればスイッチが操作されたと判定し、第2検出手段により第2電気信号がオン状態であると検出されればスイッチが操作されたのではないと判定する。   When the first detection means detects that the first electrical signal has changed from the OFF state to the ON state, the determination means switches if the second detection signal is detected as being in the OFF state. If the second detection means detects that the second electrical signal is on, it is determined that the switch has not been operated.

スイッチに接続されるプラグがジャックに正常に挿入されていて、その第1接点に接続されるスイッチが操作されることにより第1電気信号がオフ状態からオン状態に変化した場合は、そのタイミングにおいて第2電気信号は、オフ状態である。一方、プラグがジャックから抜かれることにより、第1電気信号がオフ状態からオン状態に変化した場合は、そのタイミングにおいて第2電気信号はオン状態であるので、判定手段は、スイッチが操作されたのか、スイッチが操作されたのではなくプラグが抜かれたかを判定することでき、誤動作を防止することができるという効果がある。   When the plug connected to the switch is normally inserted into the jack and the switch connected to the first contact is operated to change the first electric signal from the off state to the on state, at that timing The second electrical signal is in an off state. On the other hand, when the first electrical signal changes from the off state to the on state due to the plug being removed from the jack, the second electrical signal is in the on state at that timing, so that the determination means has operated the switch In other words, it is possible to determine whether the switch is not operated but the plug is pulled out, and it is possible to prevent malfunction.

請求項2記載のスイッチ操作検出装置によれば、請求項1記載のスイッチ操作検出装置の奏する効果に加え、次のような効果を奏する。即ち、請求項2記載のスイッチ操作検出装置は、ジャックにプラグが装着されているか否かを検出するプラグ検出手段を備え、判定手段は、第1検出手段により第1電気信号がオフ状態からオン状態に変化したことが検出された場合に、第2検出手段により第2電気信号がオフ状態であると検出され且つプラグ検出手段によりプラグが装着されていると検出されればスイッチが操作されたと判定し、第2検出手段により第2電気信号がオン状態であると検出された場合、又はプラグ検出手段によりプラグが装着されていないと検出された場合にスイッチが操作されたのではないと判定する。   According to the switch operation detecting device of the second aspect, in addition to the effect produced by the switch operation detecting device of the first aspect, the following effect is obtained. In other words, the switch operation detecting device according to claim 2 includes plug detecting means for detecting whether or not a plug is attached to the jack, and the determining means is configured to turn on the first electric signal from the off state by the first detecting means. When it is detected that the state has changed, the second detection means detects that the second electrical signal is in the OFF state, and if the plug detection means detects that the plug is mounted, the switch is operated. When the second detection means detects that the second electrical signal is in the ON state, or when the plug detection means detects that the plug is not attached, it is determined that the switch is not operated. To do.

プラグに接触する第1接点および第2接点の位置は、ジャックにより異なる場合がある。また、これらの接点が形成される金属片は経年変化により変形し、位置や動作が変化する。その場合には、プラグが抜かれ、第1電気信号がオフ状態からオン状態に変化したとき、第2電気信号がオフ状態であることがある。プラグが装着されているか否かを検出するスイッチが設けられているジャックを用いる場合には、第1電気信号がオフ状態からオン状態に変化した際に、第2電気信号がオフ状態であっても、プラグが抜かれたことを検出し、誤動作を防止することができるという効果がある。   The positions of the first contact and the second contact that contact the plug may differ depending on the jack. Further, the metal pieces on which these contacts are formed are deformed due to aging, and the position and operation are changed. In that case, when the plug is removed and the first electrical signal changes from the off state to the on state, the second electrical signal may be in the off state. When using a jack provided with a switch for detecting whether or not a plug is attached, when the first electrical signal changes from the off state to the on state, the second electrical signal is in the off state. In addition, it is possible to detect that the plug has been removed and to prevent malfunction.

以下、本発明の好ましい第1実施形態について、添付図面を参照して説明する。図1は、本発明の実施形態におけるスイッチ操作検出装置を備えた電子楽器1の電気的構成を示すブロック図である。このスイッチ操作検出装置は、ジャックに挿入されたプラグを抜く場合に生じるスイッチの誤動作を防止することができるものである。   Hereinafter, a preferred first embodiment of the present invention will be described with reference to the accompanying drawings. FIG. 1 is a block diagram showing an electrical configuration of an electronic musical instrument 1 including a switch operation detection device according to an embodiment of the present invention. This switch operation detection device can prevent a malfunction of the switch that occurs when a plug inserted in a jack is pulled out.

図1に示すように、電子楽器1は、CPU2、ROM3、RAM4、I/O回路5、ジャック6、操作子7、音源8、アンプ9、スピーカ10を主に設けている。CPU2とROM3とRAM4とI/O回路5と操作子7と音源8とはバスラインにより相互に接続されている。   As shown in FIG. 1, the electronic musical instrument 1 mainly includes a CPU 2, a ROM 3, a RAM 4, an I / O circuit 5, a jack 6, an operator 7, a sound source 8, an amplifier 9, and a speaker 10. The CPU 2, the ROM 3, the RAM 4, the I / O circuit 5, the operation element 7, and the sound source 8 are connected to each other by a bus line.

CPU2は、ROM3やRAM4に記憶される固定値データや制御プログラムに従って、電子楽器1の各部を制御するものである。ROM3は、書き替え不能なメモリであって、プログラムメモリ3aを設け、そのプログラムメモリ3aに図5に示すフローチャートの処理や、図示しない自動演奏を実行させる処理を行う制御プログラムなどが記憶される。ROM3には、その制御プログラムの他に制御プログラムが実行される際にCPU2により参照される固定値データが記憶される。固定値データとしては、自動演奏を実行するプログラムにより演奏される複数曲の演奏データなどが記憶される。   The CPU 2 controls each part of the electronic musical instrument 1 according to fixed value data and control programs stored in the ROM 3 and RAM 4. The ROM 3 is a non-rewritable memory, and is provided with a program memory 3a, in which a control program for performing the processing of the flowchart shown in FIG. 5 and processing for executing an automatic performance (not shown) is stored. In addition to the control program, the ROM 3 stores fixed value data that is referred to by the CPU 2 when the control program is executed. As the fixed value data, performance data of a plurality of pieces of music performed by a program for executing automatic performance is stored.

RAM4は、CPU2がROM3に記憶される制御プログラムの実行に当たって、各種のデータなどを一時的に記憶するための書き替え可能なメモリであり、フラグを記憶するフラグメモリ4aを設けている。このフラグメモリ4aには、フラグ1、フラグ2およびフラグ3が記憶される。   The RAM 4 is a rewritable memory for temporarily storing various data when the CPU 2 executes the control program stored in the ROM 3, and includes a flag memory 4a for storing a flag. The flag memory 4a stores a flag 1, a flag 2, and a flag 3.

フラグ1は、ジャック6に形成される第1接点J1がハイレベルであれば1に、ローレベルであれば0に設定され、フラグ2は、ジャック6に形成される第2接点J2がハイレベルであれば1に、ローレベルであれば0に設定される。   The flag 1 is set to 1 if the first contact J1 formed on the jack 6 is high level, and is set to 0 if the first contact J1 is low level. The flag 2 is set to 0 if the second contact J2 formed on the jack 6 is high level. If it is low, it is set to 1;

フラグ3は、ジャック6にプラグ21が装着されているか否かを示すフラグであり、プラグ21が装着されている場合に1に、装着されていない場合に0に、それぞれ設定される。ジャック6には、プラグ21が装着された場合に遮断(オフ)し、プラグ21が装着されていない場合に投入(オン)されるプラグスイッチSWが設けられ、CPU2によりプラグスイッチSWが検出されて、フラグ3が設定される。   The flag 3 is a flag indicating whether or not the plug 21 is attached to the jack 6, and is set to 1 when the plug 21 is attached and set to 0 when the plug 21 is not attached. The jack 6 is provided with a plug switch SW that is shut off (turned off) when the plug 21 is attached and is turned on (on) when the plug 21 is not attached, and the CPU 2 detects the plug switch SW. , Flag 3 is set.

I/O回路5は、入力ポートを複数設けたインターフェースIC回路であり、この実施形態では、第1の入力ポートである入力ポートP1にジャック6の第1接点J1が、第2の入力ポートである入力ポートP2にジャック6の第2接点J2がそれぞれ接続され、第3の入力ポートである入力ポートP3には、ジャック6に形成されるプラグスイッチSWの一方の接点が接続される。   The I / O circuit 5 is an interface IC circuit in which a plurality of input ports are provided. In this embodiment, the first contact J1 of the jack 6 is connected to the input port P1, which is the first input port, as the second input port. The second contact J2 of the jack 6 is connected to a certain input port P2, and one contact of the plug switch SW formed on the jack 6 is connected to the input port P3 which is the third input port.

これらの入力ポートP1〜P3は、プルアップ抵抗R1,R2,R3によりプルアップされ、各入力ポートが開放されている場合は、各入力ポートの電圧は、ハイレベルに設定される。入力ポートP1およびP2は、ジャック6にプラグ21が挿入されない場合は、開放されている状態となりハイレベルに設定され、プラグ21が挿入されると、接地されローレベルに設定され、プラグ21に接続されるスイッチがオン操作されると、開放されてハイレベルに設定される。   These input ports P1 to P3 are pulled up by pull-up resistors R1, R2, and R3. When each input port is open, the voltage of each input port is set to a high level. The input ports P1 and P2 are opened when the plug 21 is not inserted into the jack 6 and set to a high level. When the plug 21 is inserted, the input ports P1 and P2 are grounded and set to a low level and connected to the plug 21. When the switch to be operated is turned on, it is released and set to the high level.

入力ポートP3は、プラグ21が挿入されない状態で、接地されローレベルに設定され、プラグ21が挿入されると開放されてハイレベルに設定される。これらの入力ポートP1〜P3のレベルは、CPU2により検出される。   The input port P3 is grounded and set to a low level when the plug 21 is not inserted, and is opened and set to a high level when the plug 21 is inserted. The levels of these input ports P1 to P3 are detected by the CPU2.

ジャック6は、いわゆるステレオ用ジャックと呼ばれるもので、プラグ21の先端部分の電極であるチップに接触する第1接点J1と、チップとは絶縁リングを介して隣接して配置される電極であるリングに接触する第2接点J2と、プラグ21の根本側に形成され、リングと絶縁リングを介して隣接するスリーブに接触するグランド端子Gの3つの電極を設けている。   The jack 6 is a so-called stereo jack. The first contact J1 that contacts the chip that is the electrode at the tip of the plug 21 and the ring that is an electrode that is arranged adjacent to the chip via an insulating ring. There are provided two electrodes, a second contact J2 that contacts the ground terminal G, and a ground terminal G that is formed on the base side of the plug 21 and contacts the adjacent sleeve via the ring and the insulating ring.

第1接点J1は、I/O回路5の入力ポートP1に接続されるとともに、プルアップ抵抗R1を介して電源の正電極に接続される。同様に、第2接点J2は、I/O回路5の入力ポートP2に接続されるとともに、プルアップ抵抗R2を介して電源の正電極に接続される。   The first contact J1 is connected to the input port P1 of the I / O circuit 5 and is connected to the positive electrode of the power supply via the pull-up resistor R1. Similarly, the second contact J2 is connected to the input port P2 of the I / O circuit 5 and is connected to the positive electrode of the power supply via the pull-up resistor R2.

従って、プラグ21がジャック6に挿入されない状態では、入力ポートP1およびP2は、ハイレベルに設定される。このジャック6に接続されるスイッチ装置22では、スイッチが操作されない状態では、スイッチの接点が接地され、ローレベルに設定され、スイッチがオン操作された場合に、開放されてハイレベルに設定される。   Therefore, when the plug 21 is not inserted into the jack 6, the input ports P1 and P2 are set to the high level. In the switch device 22 connected to the jack 6, when the switch is not operated, the contact of the switch is grounded and set to the low level, and when the switch is turned on, the switch device 22 is opened and set to the high level. .

また、ジャック6には、プラグ21が挿入されると遮断され、プラグ21が抜かれると投入されるプラグスイッチSWが設けられている。このプラグスイッチSWの一方の接点は、接地され、他方の接点は、I/O回路5の入力ポートP3に接続されるとともに、プルアップ抵抗R3を介して電源の正電極に接続される。プラグ21が挿入されていない場合は、このプラグスイッチSWは、投入され入力ポートP3は、ローレベルに設定され、プラグ21が挿入された場合は、このプラグスイッチSWが遮断され入力ポートP3は、ハイレベルに設定される。図1では、プラグ21が装着されていない場合で遮断されているプラグスイッチSWを示している。プラグ21がジャック6から抜かれる際のプラグスイッチSWが切り替えられるタイミングについては、図4を参照して後述する。   Further, the jack 6 is provided with a plug switch SW which is shut off when the plug 21 is inserted and turned on when the plug 21 is removed. One contact of the plug switch SW is grounded, and the other contact is connected to the input port P3 of the I / O circuit 5 and to the positive electrode of the power supply via the pull-up resistor R3. When the plug 21 is not inserted, the plug switch SW is turned on and the input port P3 is set to a low level. When the plug 21 is inserted, the plug switch SW is cut off and the input port P3 is Set to high level. FIG. 1 shows the plug switch SW that is shut off when the plug 21 is not attached. The timing at which the plug switch SW is switched when the plug 21 is removed from the jack 6 will be described later with reference to FIG.

スイッチ装置22は、主に足で操作されるフットスイッチであり、ギターや電子鍵盤楽器を演奏しながら、足で各種機能のオンオフ操作を行うものである。このスイッチ装置22には、独立して操作される第1スイッチFSW1と、第2スイッチFSW2とが設けられ、これらのスイッチは、自己復帰型のスイッチであり、操作板を踏みつけるとスイッチが遮断され、離すと投入されるものであり、接続コードを介してプラグ21に接続されている。   The switch device 22 is a foot switch mainly operated with a foot, and performs on / off operations of various functions with the foot while playing a guitar or an electronic keyboard instrument. The switch device 22 is provided with a first switch FSW1 and a second switch FSW2 that are operated independently. These switches are self-reset type switches, and are switched off when the operation plate is stepped on. , It is inserted when released, and is connected to the plug 21 via a connection cord.

プラグ21は、いわゆるステレオ用プラグであって、プラグ21の先端に形成される電極であるチップTには、第1スイッチFSW1の一方の電極が接続される。チップTと絶縁リングを介し根本側に形成される電極であるリングRには、第2スイッチFSW2の一方の電極が接続される。更にリングRと絶縁リングを介し根本側に形成される電極であるスリーブSが形成される。このスリーブSは、ジャック6に挿入されるとジャック6に形成されるグランド端子Gと接触し接地される。   The plug 21 is a so-called stereo plug, and one electrode of the first switch FSW1 is connected to the chip T which is an electrode formed at the tip of the plug 21. One electrode of the second switch FSW2 is connected to the ring R, which is an electrode formed on the base side through the chip T and the insulating ring. Further, a sleeve S which is an electrode formed on the base side through the ring R and the insulating ring is formed. When the sleeve S is inserted into the jack 6, it contacts the ground terminal G formed on the jack 6 and is grounded.

第1スイッチFSW1の他方の電極と、第2スイッチFSW2の他方の電極は、プラグ21の接地電極Sに接続される。第1スイッチFSW1および第2スイッチFSW2は、操作されない状態で投入され、操作されることにより遮断されるブレーク型のスイッチである。図1では、第1スイッチFSW1および第2スイッチFSW2が操作されていない場合であって、投入された状態を示している。   The other electrode of the first switch FSW1 and the other electrode of the second switch FSW2 are connected to the ground electrode S of the plug 21. The first switch FSW1 and the second switch FSW2 are break type switches that are turned on in an unoperated state and shut off when operated. FIG. 1 shows a state where the first switch FSW1 and the second switch FSW2 are not operated and are turned on.

電子楽器1は、第1スイッチFSW1を操作することにより、自動演奏の開始または停止を指示し、第2スイッチFSW2を操作することにより、自動演奏のテンポを設定するように構成されている。自動演奏を開始する前、または自動演奏中に、演奏者がこの第2スイッチFSW2を複数回操作すると、その操作したタイミングの時間間隔が検出される。そして、その時間間隔に対応するテンポが設定され、その設定されたテンポで自動演奏が行われる。   The electronic musical instrument 1 is configured to instruct the start or stop of automatic performance by operating the first switch FSW1 and to set the tempo of automatic performance by operating the second switch FSW2. When the performer operates the second switch FSW2 a plurality of times before starting the automatic performance or during the automatic performance, the time interval of the operated timing is detected. Then, a tempo corresponding to the time interval is set, and automatic performance is performed at the set tempo.

操作子7は、各種スイッチやボリュームつまみなどの複数の操作子を設けたものであり、スピーカ10から出力される音量を調整するボリュームや、自動演奏を行わせる際の、選曲を行うスイッチが設けられている。   The operation element 7 is provided with a plurality of operation elements such as various switches and volume knobs, and is provided with a volume for adjusting the volume output from the speaker 10 and a switch for selecting a music when performing an automatic performance. It has been.

音源8は、複数の楽音波形を記憶し、楽音の発生を指示する情報に応じて、記憶されている楽音波形を読み出し、指示に応じた音高、音量、音色の楽音を発生する。自動演奏プログラムがCPU2により実行されると、そのプログラムされた時間経過に従って楽音の発生や停止を指示する情報が音源8に送信され、音源8は、指示する情報に応じた楽音を発生し、アンプ9に出力する。音源8により出力された楽音信号は、アンプ9により増幅され、スピーカ10により放音される。   The sound source 8 stores a plurality of musical sound waveforms, reads out the stored musical sound waveforms in accordance with information instructing the generation of musical sounds, and generates musical sounds having pitches, sound volumes, and timbres according to the instructions. When the automatic performance program is executed by the CPU 2, information for instructing generation or stop of a musical tone is transmitted to the sound source 8 according to the programmed time, and the sound source 8 generates a musical tone according to the instructed information, and the amplifier Output to 9. The musical sound signal output from the sound source 8 is amplified by the amplifier 9 and emitted from the speaker 10.

次に、図2を参照してプラグ21がジャック6に正常に装着され、フットスイッチFSW1またはFSW2が操作された場合の入力ポートP1〜P3のレベルについて説明する。図2は、プラグ21がジャック6に挿入され、フットスイッチが操作された場合の入力ポートP1〜P3それぞれのレベルの変化を示すタイムチャートである。このタイムチャートは、横軸を時刻tとし、入力ポートP1〜P3の各電圧がハイレベル(H)であるかローレベル(L)であるかを示している。   Next, the level of the input ports P1 to P3 when the plug 21 is normally attached to the jack 6 and the foot switch FSW1 or FSW2 is operated will be described with reference to FIG. FIG. 2 is a time chart showing changes in the levels of the input ports P1 to P3 when the plug 21 is inserted into the jack 6 and the foot switch is operated. In this time chart, the horizontal axis indicates time t, and each voltage of the input ports P1 to P3 indicates whether the voltage is high level (H) or low level (L).

図2は、まず演奏者が第2スイッチFSW2を操作して自動演奏のテンポを設定し、次に、第1スイッチFSW1を操作して自動演奏の開始を指示する。そして自動演奏がしばらく行われた後、再び第1スイッチFSW1を操作して自動演奏を停止する場合を示している。   In FIG. 2, the performer first operates the second switch FSW2 to set the tempo of the automatic performance, and then operates the first switch FSW1 to instruct the start of the automatic performance. Then, after the automatic performance has been performed for a while, the automatic performance is stopped by operating the first switch FSW1 again.

図2に示すように、時刻t1に第2スイッチFSW2が短時間押下されると、入力ポートP2のレベルがローからハイに変化し、短時間後ローに戻る。次に、時刻t2に第2スイッチFSW2が短時間押下されると、入力ポートP2のレベルがローからハイに変化し、短時間後ローに戻る。この操作により、時刻t1と時刻t2の間の時間Δtが計時され、この計時された時間に応じて自動演奏のテンポが設定される。   As shown in FIG. 2, when the second switch FSW2 is pressed for a short time at time t1, the level of the input port P2 changes from low to high and returns to low after a short time. Next, when the second switch FSW2 is pressed for a short time at time t2, the level of the input port P2 changes from low to high and returns to low after a short time. By this operation, the time Δt between the time t1 and the time t2 is timed, and the tempo of the automatic performance is set according to this timed time.

次に、時刻t3に第1スイッチFSW1が短時間押下されると、入力ポートP1のレベルがローからハイに変化し、短時間後ローに戻る。この変化が検出されると、自動演奏が開始される。自動演奏が開始された後、時刻t4に再度第1スイッチFSW1が短時間押下されると、入力ポートP1のレベルがローからハイに変化し、短時間後ローに戻る。この変化が検出されると、自動演奏が停止される。プラグ21がジャック6に正常に装着されている状態では、入力ポートP3のレベルは、常にハイに維持されている。   Next, when the first switch FSW1 is pressed for a short time at time t3, the level of the input port P1 changes from low to high and returns to low after a short time. When this change is detected, automatic performance is started. After the automatic performance is started, when the first switch FSW1 is pressed again for a short time at time t4, the level of the input port P1 changes from low to high and returns to low after a short time. When this change is detected, the automatic performance is stopped. In a state where the plug 21 is normally attached to the jack 6, the level of the input port P3 is always kept high.

このように、第2スイッチFSW2の操作に応じてテンポが設定され、第1スイッチFSW1の操作に応じて自動演奏の開始または停止が指示される。これらテンポ設定と自動演奏の開始または停止の指示とは、機能的に大きく異なるため、第1スイッチFSW1と第2スイッチFSW2とが同時に操作されることは通常ない。   Thus, the tempo is set according to the operation of the second switch FSW2, and the start or stop of the automatic performance is instructed according to the operation of the first switch FSW1. Since the tempo setting and the instruction to start or stop the automatic performance are greatly different in function, the first switch FSW1 and the second switch FSW2 are not usually operated at the same time.

次に、図3および図4を参照してプラグ21がジャック6から抜かれる場合について説明する。図3は、プラグ21が次第に抜かれる際のプラグ21の接点と、ジャック6の接点との接触状態の変化を(a)から(f)まで示す模式図である。図3に示すように、プラグの電極は、先端にチップTが形成され絶縁リングZ1を挟んでリングRが形成され、さらに絶縁リングZ2を挟んでスリーブSが形成される。   Next, a case where the plug 21 is removed from the jack 6 will be described with reference to FIGS. 3 and 4. FIG. 3 is a schematic diagram showing changes in the contact state between the contact of the plug 21 and the contact of the jack 6 when the plug 21 is gradually pulled out, from (a) to (f). As shown in FIG. 3, the plug electrode has a tip T formed at the tip, a ring R formed with an insulating ring Z1 interposed therebetween, and a sleeve S formed with an insulating ring Z2 interposed therebetween.

図4は、図3(a)から(f)までの状態に対応して入力ポートP1〜P3のレベルの変化を示すタイムチャートである。このタイムチャートは、横軸を時刻tとし、入力ポートP1,入力ポートP2,入力ポートP3の各電圧がハイレベル(H)であるかローレベル(L)であるかを示している。なおここでは、第1スイッチFSW1および第2スイッチFSW2は、オン操作されていないものとする。   FIG. 4 is a time chart showing changes in the levels of the input ports P1 to P3 corresponding to the states from FIG. 3 (a) to FIG. 3 (f). In this time chart, the horizontal axis indicates time t, and each voltage of the input port P1, the input port P2, and the input port P3 indicates whether the voltage is high level (H) or low level (L). Here, it is assumed that the first switch FSW1 and the second switch FSW2 are not turned on.

図3(a)は、プラグ21が正常にジャック6に装着されている状態を示し、この状態では、第1接点J1は、チップTに形成された窪みに接触して第1スイッチFSW1の接地されていない接点と接続される。また、第2接点J2は、リングRに接触し、第2スイッチFSW2の接地されていない接点と接続される。図4に示すように、状態(a)では、入力ポートP1および入力ポートP2は接地され、レベルはローである。   FIG. 3A shows a state in which the plug 21 is normally attached to the jack 6, and in this state, the first contact J <b> 1 contacts the recess formed in the chip T to ground the first switch FSW <b> 1. It is connected with the contact that is not done. The second contact J2 is in contact with the ring R and is connected to a contact point of the second switch FSW2 that is not grounded. As shown in FIG. 4, in state (a), input port P1 and input port P2 are grounded and the level is low.

図3(b)は、(a)に示す状態からプラグ21が少し抜かれた状態を示し、第2接点J2が、チップTとリングTとの間に形成される絶縁リングZ1に接触し、リングRが開放された状態である。この時、チップTと第1接点J1とは、接触を保っている。図4に示すように、時刻t11に、第2接点J2がリングRとの接触を解除し、入力ポートP2のレベルはハイに変化する。状態(b)では、入力ポートP1のレベルはローであるが、入力ポートP2のレベルはハイである。   FIG. 3B shows a state in which the plug 21 has been slightly removed from the state shown in FIG. 3A, and the second contact J2 is in contact with the insulating ring Z1 formed between the tip T and the ring T. R is in an open state. At this time, the chip T and the first contact J1 are kept in contact. As shown in FIG. 4, at time t11, the second contact J2 releases the contact with the ring R, and the level of the input port P2 changes to high. In state (b), the level of the input port P1 is low, but the level of the input port P2 is high.

更に、プラグ21が抜かれた状態が図3(c)であり、第2接点J2が、チップTに接触する。図4に示すように、時刻t12がその接触を開始した時刻であり、入力ポートP2のレベルは、再びローに変化する。状態(c)では、第1接点J1と第2接点J2とが共にチップTに接触し、入力ポートP1及び入力ポートP2のレベルは、ローである。   Further, FIG. 3C shows a state in which the plug 21 is removed, and the second contact J2 contacts the chip T. As shown in FIG. 4, time t12 is the time when the contact is started, and the level of the input port P2 changes to low again. In the state (c), the first contact J1 and the second contact J2 are both in contact with the chip T, and the levels of the input port P1 and the input port P2 are low.

更に、プラグ21が抜かれた状態が図3(d)であり、第2接点J2が、チップTに形成される窪みの位置に来るため、チップTと接触しなくなる。図4に示すように時刻t13に入力ポートP2のレベルは、再びハイに変化する。状態(d)では、第1接点J1は、チップTとの接触を維持しているので、入力ポートP1のレベルはロー、入力ポートP2のレベルは、ハイである。   Furthermore, the state in which the plug 21 is removed is shown in FIG. 3D, and the second contact J2 comes to the position of the recess formed in the chip T, and therefore does not come into contact with the chip T. As shown in FIG. 4, at time t13, the level of the input port P2 changes to high again. In the state (d), since the first contact J1 maintains contact with the chip T, the level of the input port P1 is low and the level of the input port P2 is high.

更に、プラグ21が抜かれると図3(e)に示すように、第1接点J1は、チップTとの接触を解除する。この状態(e)では、第2接点J2は、チップTに形成される窪みの位置にあり、チップTと接触しない。よって、図4に示すように、時刻t14において入力ポートP1のレベルがハイに変化し、入力ポートP2のレベルはハイのままである。   Further, when the plug 21 is removed, the first contact J1 releases the contact with the chip T as shown in FIG. In this state (e), the second contact J2 is in the position of the recess formed in the chip T and does not contact the chip T. Therefore, as shown in FIG. 4, at the time t14, the level of the input port P1 changes to high, and the level of the input port P2 remains high.

更に、プラグ21を抜くと、図3(f)に示すように、第1接点J1は、チップTとの接触を解除したままで、第2接点J2は、再びチップTに接触する。よって、図4に示すように、時刻t15において入力ポートP2のレベルがローに変化し、入力ポートP1のレベルはハイのままである。   Further, when the plug 21 is pulled out, as shown in FIG. 3 (f), the first contact J 1 remains released from the contact with the chip T, and the second contact J 2 comes into contact with the chip T again. Therefore, as shown in FIG. 4, the level of the input port P2 changes to low at time t15, and the level of the input port P1 remains high.

更に、プラグ21を抜くと、第2接点J2もチップTとの接触を解除し、図4に示すように、時刻t16において、入力ポートP1および入力ポートP2のレベルはハイとなる。   Further, when the plug 21 is removed, the second contact J2 is also released from contact with the chip T, and as shown in FIG. 4, the levels of the input port P1 and the input port P2 become high at time t16.

更に、プラグ21を抜くと、ジャック6に内蔵されるプラグスイッチSWは、それまでは、遮断されていたが、時刻t17に投入される。よって、入力ポートP3のレベルは、時刻t17にハイからローに変化する。   Further, when the plug 21 is pulled out, the plug switch SW built in the jack 6 has been cut off until then, but is turned on at time t17. Therefore, the level of the input port P3 changes from high to low at time t17.

以上、図3および図4を参照して説明したように、入力ポートP2のレベルがハイである場合に、入力ポートP1のレベルがローからハイに変化した場合(時刻t14)は、プラグ21が抜かれたとことによるものであると判定する。一方、ジャック6にプラグ21が正常に装着されている状態(a)では、入力ポートP2のレベルは、ローであるので、入力ポートP2のレベルがローである場合に、入力ポートP1のレベルがローからハイに変化した場合は、プラグ21を介して接続される第1スイッチFSW1が操作されたものと判定する。よって、ジャック6からプラグ21が抜かれる際に、誤って第1スイッチFSW1がオン操作されたと判定することを防止できる。   As described above with reference to FIGS. 3 and 4, when the level of the input port P2 changes from low to high when the level of the input port P2 is high (time t14), the plug 21 is It is determined that it is due to being removed. On the other hand, in the state (a) in which the plug 21 is normally attached to the jack 6, the level of the input port P2 is low. Therefore, when the level of the input port P2 is low, the level of the input port P1 is When it changes from low to high, it is determined that the first switch FSW1 connected through the plug 21 has been operated. Therefore, it can be prevented that the first switch FSW1 is erroneously turned on when the plug 21 is removed from the jack 6.

なお、図3および図4は、典型的なジャック6とプラグ21との変化を示すものであって、ジャック6やプラグ21の種類、また、プラグ21を抜く速度により、これらの時間間隔(t11,t12など)が変化する。状態(b)や(c)の変化を検出し、更に状態(d)から(e)への変化を検出した場合に、プラグ21が抜かれたと判定すると、より正確にプラグ21が抜かれたことを検出できるが、スイッチが切り替わる際には、チャタリングが発生するため、そのチャタリングと、状態(b)、(c)の変化との判別が困難であることが多い。   3 and 4 show typical changes between the jack 6 and the plug 21. These time intervals (t11) depend on the type of the jack 6 and the plug 21 and the speed at which the plug 21 is pulled out. , T12, etc.) change. If it is determined that the plug 21 has been removed when a change in the state (b) or (c) is detected and further a change from the state (d) to (e) is detected, it is confirmed that the plug 21 has been removed more accurately. Although it can be detected, chattering occurs when the switch is switched, and it is often difficult to distinguish the chattering from the changes in the states (b) and (c).

また、第1接点J1および第2接点J2の位置は、ジャック6の製品毎に異なる。更に第1接点J1および第2接点J2は、弾性を有する金属片により形成されるが、経年変化により変形したり、弾性の特性が変化して動作が変化する場合がある。図4では、入力ポートP1のレベルがローからハイに変化する時刻t14において、入力ポートP2のレベルがハイであると説明したが、場合によっては時刻t14において、入力ポートP2のレベルがローである場合がある。   The positions of the first contact J1 and the second contact J2 are different for each jack 6 product. Further, the first contact J1 and the second contact J2 are formed of a metal piece having elasticity. However, the first contact J1 and the second contact J2 may be deformed due to aging, or the operation may be changed due to a change in elasticity characteristics. In FIG. 4, it has been described that the level of the input port P2 is high at time t14 when the level of the input port P1 changes from low to high. However, in some cases, the level of the input port P2 is low at time t14. There is a case.

一方、図4では、ジャック6にプラグ21が装着されているか否かを示す入力ポート3のレベルが、時刻t14より後の時刻t17に変化するものとしたが、プラグ21が急速に引き抜かれた場合や、ジャック6の種類によっては、より早くプラグ21が抜かれたことを検出し、入力ポートP1のレベルがローからハイに変化するのを検出すると同時に、入力ポートP3のレベルによりプラグ21が抜かれたことを検出できる場合がある。   On the other hand, in FIG. 4, the level of the input port 3 indicating whether or not the plug 21 is attached to the jack 6 changes at time t17 after time t14, but the plug 21 is rapidly pulled out. In some cases, depending on the type of jack 6, it is detected that the plug 21 has been removed earlier, and the level of the input port P1 changes from low to high. At the same time, the plug 21 is removed depending on the level of the input port P3. May be detected.

よって、この実施の形態では、入力ポートP1のレベルがローからハイに変化した場合に、入力ポートP2のレベルがローであり且つ入力ポートP3のレベルがハイである場合に、スイッチ装置22の第1スイッチFSW1が操作されたと判定し、入力ポートP2のレベルがローである場合、または入力ポートP3のレベルがローである場合はプラグ21が抜かれたと判定する。   Therefore, in this embodiment, when the level of the input port P1 changes from low to high, when the level of the input port P2 is low and the level of the input port P3 is high, the switch device 22 It is determined that one switch FSW1 has been operated, and when the level of the input port P2 is low, or when the level of the input port P3 is low, it is determined that the plug 21 has been removed.

次に、図5を参照して、電子楽器1のCPU2により実行される処理について説明する。図5は、電子楽器1のメイン処理を示すフローチャートである。このメイン処理は、電子楽器1の電源が投入されたとき起動され、電源が遮断されるまで繰り返し行われる処理である。   Next, processing executed by the CPU 2 of the electronic musical instrument 1 will be described with reference to FIG. FIG. 5 is a flowchart showing main processing of the electronic musical instrument 1. This main process is started when the power of the electronic musical instrument 1 is turned on, and is repeatedly performed until the power is turned off.

このメイン処理では、まず、初期設定を行う(S1)。初期設定としては、RAM4のフラグメモリ4aに記憶されるフラグ1、フラグ2及びフラグ3を0に設定する。次に、入力ポート1のレベルがハイか否かを検出し(S2)、ハイであれば(S2:Yes)、フラグ1が1に設定されているか否かを判断する(S3)。フラグ1が1でなければ(S3:No)、入力ポート1のレベルがローからハイに変化したことを示し、フラグ1を1に設定し(S4)、フラグ2が1に設定されているか否かを判断する(S5)。   In this main process, first, initial setting is performed (S1). As an initial setting, flags 1, 2 and 3 stored in the flag memory 4a of the RAM 4 are set to 0. Next, it is detected whether or not the level of the input port 1 is high (S2), and if it is high (S2: Yes), it is determined whether or not the flag 1 is set to 1 (S3). If flag 1 is not 1 (S3: No), this indicates that the level of input port 1 has changed from low to high, flag 1 is set to 1 (S4), and flag 2 is set to 1 or not. Is determined (S5).

フラグ2が1に設定されていない場合は(S5:No)、入力ポート2のレベルがローであり、更にフラグ3が0に設定されているか否かを判断する(S6)。フラグ3が0でなければ(S6:No)、プラグ21がジャック6に挿入されていることを示すので、第1スイッチFSW1がオン操作されたものと判断し、自動演奏の開始又は停止処理を行う(S7)。この処理は、自動演奏が停止している場合には、自動演奏を開始するように制御し、自動演奏中であれば、自動演奏を停止する処理である。S7の処理を終了した場合は、S11の処理に進む。   If the flag 2 is not set to 1 (S5: No), it is determined whether or not the level of the input port 2 is low and the flag 3 is set to 0 (S6). If the flag 3 is not 0 (S6: No), it indicates that the plug 21 is inserted into the jack 6, so it is determined that the first switch FSW1 is turned on, and the automatic performance start or stop process is performed. Perform (S7). This process is a process of controlling the automatic performance to start when the automatic performance is stopped, and stopping the automatic performance when the automatic performance is being performed. When the process of S7 is completed, the process proceeds to S11.

一方、S5の判断処理においてフラグ2が1に設定されている場合は(S5:Yes)、入力ポート2のレベルがハイであるので、プラグ21が抜かれたと判断し、自動演奏の開始又は停止処理(S7)を行わずS11の処理に進む。また、S3の判断処理において、フラグ1が1に設定されている場合は(S3:Yes)、入力ポート1のレベルがハイに持続されていることになりS11の処理に進む。   On the other hand, when the flag 2 is set to 1 in the determination process of S5 (S5: Yes), it is determined that the plug 21 is removed because the level of the input port 2 is high, and the automatic performance start or stop process is performed. The process proceeds to S11 without performing (S7). In the determination process of S3, when the flag 1 is set to 1 (S3: Yes), the level of the input port 1 is maintained high and the process proceeds to S11.

また、S6の判断処理において、フラグ3が0に設定されていれば(S6:Yes)、プラグ21がジャック6に装着されていない場合であるので、自動演奏の開始又は停止所処理(S7)を行わずにS11の処理に進む。なお、図4のタイムチャートに示すように、プラグ21がジャック6から抜かれる場合、入力ポートP1のレベルがローからハイへ変化する時刻(t14)より後の時刻に(t17)、入力ポートP3のレベルがハイからローへ変化する。しかし、各入力ポートでは、スイッチのチャタリングによる変化を抑制するために、所定時間の変化を無視したり、変化を平滑化するなどのチャタリング処理を行う。したがって、プラグ21がジャック6から急速に引き抜かれる場合は、時刻t14と時刻t17との差が短くなり、ほぼ同時に入力ポートP1の変化と入力ポートP3の変化が検出される場合がある。S6の判断処理において、フラグ3が0に設定されている場合(S6:Yes)は、そのような場合である。   If the flag 3 is set to 0 in the determination process of S6 (S6: Yes), it means that the plug 21 is not attached to the jack 6, so the automatic performance start or stop process (S7). Without proceeding to S11. As shown in the time chart of FIG. 4, when the plug 21 is removed from the jack 6, the input port P3 is at a time after the time (t14) when the level of the input port P1 changes from low to high (t17). Level changes from high to low. However, each input port performs chattering processing such as ignoring a change in a predetermined time or smoothing the change in order to suppress a change due to chattering of the switch. Therefore, when the plug 21 is rapidly pulled out from the jack 6, the difference between the time t14 and the time t17 is shortened, and the change in the input port P1 and the change in the input port P3 may be detected almost simultaneously. This is the case when the flag 3 is set to 0 in the determination process of S6 (S6: Yes).

S2の判断処理において、入力ポート1のレベルがハイではなくローであれば(S2:
No)、フラグ1が1に設定されているか否かを判断する(S8)。フラグ1が1に設定されていれば(S8:Yes)、入力ポート1のレベルがハイからローに変化したので、フラグ1を0に設定し(S9)、S11の処理に進む。S8の判断処理において、フラグ1が1ではない場合は(S8:No)、入力ポート1のレベルがローに持続されていることになるので、S9の処理を行わず、S11の処理に進む。
In the determination process of S2, if the level of the input port 1 is not high but low (S2:
No), it is determined whether or not the flag 1 is set to 1 (S8). If the flag 1 is set to 1 (S8: Yes), since the level of the input port 1 has changed from high to low, the flag 1 is set to 0 (S9), and the process proceeds to S11. In the determination process of S8, when the flag 1 is not 1 (S8: No), the level of the input port 1 is kept low, so the process of S9 is not performed and the process proceeds to S11.

S11の処理においては、入力ポート2のレベルがハイか否かを検出し(S11)、入力ポート2のレベルがハイであれば(S11:Yes)、フラグ2が1に設定されているか否かを判断する(S12)。フラグ2が1に設定されていない場合は(S12:No)、入力ポート2のレベルがローからハイに変化したので、フラグ2を1に設定し(S13)、タップ処理を行う(S14)。このタップ処理は、前回、入力ポート2のレベルがローからハイに変化した時刻からの時間を計時し、その時間に対応するテンポを自動演奏のテンポとする処理である。   In the process of S11, it is detected whether the level of the input port 2 is high (S11). If the level of the input port 2 is high (S11: Yes), whether the flag 2 is set to 1 or not. Is determined (S12). If the flag 2 is not set to 1 (S12: No), since the level of the input port 2 has changed from low to high, the flag 2 is set to 1 (S13), and tap processing is performed (S14). This tap process is a process of measuring the time from the time when the level of the input port 2 changed from low to high last time and setting the tempo corresponding to the time as the tempo of automatic performance.

S12の判断処理において、フラグ2が1に設定されている場合は(S12:Yes)、入力ポート2のレベルがハイに持続されていることになるので、S21の処理に進む。   In the determination process of S12, when the flag 2 is set to 1 (S12: Yes), the level of the input port 2 is maintained high, so the process proceeds to S21.

S11の判断処理において、入力ポート2のレベルがハイでなければ(S11:No)、フラグ2が1に設定されているか否かを判断し(S17)、フラグ2が1に設定されていれば(S17:Yes)、入力ポート2のレベルがハイからローに変化したことになるのでフラグ2を0に設定し(S18)、S21の処理に進む。S17の判断処理においてフラグ2が1に設定されていない場合は(S17:No)、入力ポート2のレベルがローに持続されていることになるので、S16の処理を行わず、S21の処理に進む。   In the determination process of S11, if the level of the input port 2 is not high (S11: No), it is determined whether the flag 2 is set to 1 (S17), and if the flag 2 is set to 1, (S17: Yes) Since the level of the input port 2 has changed from high to low, the flag 2 is set to 0 (S18), and the process proceeds to S21. If the flag 2 is not set to 1 in the determination process of S17 (S17: No), the level of the input port 2 is kept low, so the process of S16 is not performed and the process of S21 is performed. move on.

S21の処理では、入力ポート3のレベルがローか否かを検出し(S21)、入力ポート3のレベルがローでなければ(S21:No)、フラグ3が0に設定されているか否かを判断する(S22)。フラグ3が0に設定されている場合は(22:Yes)、入力ポート3のレベルがローからハイに変化したので、フラグ3を1に設定する(S23)。   In the process of S21, it is detected whether or not the level of the input port 3 is low (S21). If the level of the input port 3 is not low (S21: No), it is determined whether or not the flag 3 is set to 0. Judgment is made (S22). When the flag 3 is set to 0 (22: Yes), since the level of the input port 3 has changed from low to high, the flag 3 is set to 1 (S23).

S22の判断処理において、フラグ3が1に設定されている場合は(S22:Yes)、入力ポート3のレベルがハイに持続されていることになるので、S23の処理を行わず、S31の処理に進む。   In the determination process of S22, when the flag 3 is set to 1 (S22: Yes), the level of the input port 3 is maintained high, so the process of S23 is not performed and the process of S31 is performed. Proceed to

S21の判断処理において、入力ポート3のレベルがローであれば(S21:Yes)、フラグ3が0に設定されているか否かを判断し(S27)、フラグ3が0に設定されていなければ(S27:No)、入力ポート3のレベルがハイからローに変化したことになるのでフラグ3を0に設定し(S28)、S31の処理に進む。S27の判断処理においてフラグ3が0に設定されている場合は(S27:Yes)、入力ポート3のレベルがローに持続されていることになるので、S28の処理を行わず、S31の処理に進む。   In the determination process of S21, if the level of the input port 3 is low (S21: Yes), it is determined whether or not the flag 3 is set to 0 (S27). If the flag 3 is not set to 0, (S27: No), since the level of the input port 3 has changed from high to low, the flag 3 is set to 0 (S28), and the process proceeds to S31. If the flag 3 is set to 0 in the determination process of S27 (S27: Yes), the level of the input port 3 is kept low, so the process of S28 is not performed and the process of S31 is performed. move on.

S31の処理では、その他の処理を行う(S31)。このその他の処理としては、例えば、音量を調整する操作子の設定を読み込み、その設定に対応した処理や、自動演奏される演奏曲を選択する操作子の設定を読み込み、その設定に対応した処理などである。S21の処理を終了した場合は、S2の処理に戻る。   In the process of S31, other processes are performed (S31). As this other process, for example, the setting of an operator for adjusting the volume is read, the process corresponding to the setting, the setting of the operator for selecting a performance piece to be automatically played, and the process corresponding to the setting are read. Etc. When the process of S21 is completed, the process returns to S2.

以上、第1実施形態に基づいて説明したように、第1入力ポートのレベルがローからハイに変化した場合に、第2入力ポートのレベルがローであれば、第1スイッチFSW1が操作されたと判定し、第2入力ポートのレベルがハイであれば、プラグ21がジャック6から外されたと判定することができる。よって、プラグ21が抜かれたことにより、第1スイッチFSW1が操作されたと誤った判定を行うことを防止することができる。   As described above based on the first embodiment, when the level of the first input port changes from low to high and the level of the second input port is low, the first switch FSW1 is operated. If it is determined that the level of the second input port is high, it can be determined that the plug 21 is disconnected from the jack 6. Therefore, it is possible to prevent erroneous determination that the first switch FSW1 has been operated due to the plug 21 being removed.

上記、第1実施形態のように、第1スイッチFSW1が操作された場合に、自動演奏の開始を指示する場合には、プラグ21が抜かれることにより、誤って自動演奏が開始されるのを防止することができる。   As in the first embodiment, when the first switch FSW1 is operated and the start of automatic performance is instructed, the automatic performance is erroneously started by removing the plug 21. Can be prevented.

また、録音や再生を行う音響機器にも、この機能を搭載すれば、録音や再生を指示するフットスイッチのプラグを抜いた際に、録音や再生が開始されるのを防止することができる。なお、上記実施形態では、第2スイッチFSW2により、自動演奏のテンポを設定するものとしたが、第2スイッチFSW2は、プラグ21が抜かれることによりスイッチがオン操作されたと判定されるのを防止できないので、スイッチがオン操作されたと判定されても問題ない機能を割り当てるようにすることが望ましい。   Also, if this function is installed in an audio device that performs recording and playback, recording and playback can be prevented from starting when the plug of the foot switch that instructs recording and playback is unplugged. In the above embodiment, the tempo of automatic performance is set by the second switch FSW2. However, the second switch FSW2 prevents the switch 21 from being determined to be turned on when the plug 21 is removed. Therefore, it is desirable to assign a function that does not cause a problem even if it is determined that the switch is turned on.

次に、図6を参照して第2実施形態について説明する。上記第1実施形態では、制御プログラムにより、入力ポートP1のレベルがローからハイに変化した場合に、入力ポートP2およびP3のレベルに応じて、第1スイッチFSW1が操作されたか否かを判定するものとしたが、図6に示すように、論理回路により、判定を行って、入力ポートP1のレベルのみにより、第1スイッチFSW1が操作されたか否かを判定するものとしてもよい。図6は、第2実施形態における電気的構成を示すブロック図である。第1実施形態と同一の構成については、同一の番号を付し、その説明を省略する。   Next, a second embodiment will be described with reference to FIG. In the first embodiment, when the level of the input port P1 changes from low to high according to the control program, it is determined whether or not the first switch FSW1 is operated according to the levels of the input ports P2 and P3. However, as shown in FIG. 6, it is also possible to determine whether or not the first switch FSW1 has been operated based only on the level of the input port P1 by making a determination using a logic circuit. FIG. 6 is a block diagram showing an electrical configuration in the second embodiment. About the same structure as 1st Embodiment, the same number is attached | subjected and the description is abbreviate | omitted.

図6に示すように、この構成では、ジャック6とI/O回路5との間に、アンド回路31とアンド回路32とインバータ33とを設けている。   As shown in FIG. 6, in this configuration, an AND circuit 31, an AND circuit 32, and an inverter 33 are provided between the jack 6 and the I / O circuit 5.

ジャック6の第1接点J1は、アンド回路31の一つの入力に接続されると共に、プルアップ抵抗R1を介して電源の正電極と接続される。また、ジャック6の第2接点J2は、インバータ33の入力とI/O回路5の入力ポートP2に接続されると共に、プルアップ抵抗R2を介して電源の正電極と接続され、インバータ33の出力は、アンド回路32の一つの入力に接続される。   The first contact J1 of the jack 6 is connected to one input of the AND circuit 31 and is connected to the positive electrode of the power supply via the pull-up resistor R1. The second contact J2 of the jack 6 is connected to the input of the inverter 33 and the input port P2 of the I / O circuit 5, and is connected to the positive electrode of the power source via the pull-up resistor R2, and the output of the inverter 33 Is connected to one input of the AND circuit 32.

ジャック6に形成されるプラグスイッチSWの一方の接点は、アンド回路32の他方の入力に接続されると共に、プルアップ抵抗R3を介して電源の正電極と接続され、アンド回路32の出力は、アンド回路31の他方の入力に接続される。また、アンド回路31の出力は、I/O回路5の入力ポートP1に接続される。   One contact of the plug switch SW formed in the jack 6 is connected to the other input of the AND circuit 32 and is connected to the positive electrode of the power source via the pull-up resistor R3. The other input of the AND circuit 31 is connected. The output of the AND circuit 31 is connected to the input port P 1 of the I / O circuit 5.

図6から明らかなように、ジャック6の第1接点J1がハイになった場合、第2接点J2がローであり且つプラグスイッチSWが遮断されている場合に(プラグ21が正常に装着されている場合)に、アンド回路31の出力がハイに変化する。即ち、プラグ21が抜かれて、第2接点J2がハイになった場合や、プラグスイッチSWが投入された場合には、アンド回路31の出力は、ハイに変化しない。   As is apparent from FIG. 6, when the first contact J1 of the jack 6 becomes high, the second contact J2 is low and the plug switch SW is cut off (the plug 21 is normally attached). The output of the AND circuit 31 changes to high. That is, when the plug 21 is removed and the second contact J2 becomes high, or when the plug switch SW is turned on, the output of the AND circuit 31 does not change to high.

従って、プラグ21が正常に装着されている場合には、プラグ21を介して入力される第1スイッチFSW1の操作を検出し、プラグ21が抜かれた場合には第1スイッチFSW1が操作されたと誤って判定することを防止することができる。   Therefore, when the plug 21 is normally attached, the operation of the first switch FSW1 input through the plug 21 is detected. When the plug 21 is removed, it is erroneously assumed that the first switch FSW1 has been operated. Determination can be prevented.

以上、実施形態に基づき本発明を説明したが、本発明は上述した実施形態に何ら限定されるものではなく、本発明の趣旨を逸脱しない範囲内で種々の改良変更が可能であることは容易に推察できるものである。   The present invention has been described above based on the embodiments. However, the present invention is not limited to the above-described embodiments, and various modifications and changes can be easily made without departing from the spirit of the present invention. Can be inferred.

例えば、上記実施形態では、第1スイッチFSW1により、自動演奏の開始および停止を指示するものとしたが、音声や画像のレコーダの再生の開始および停止を指示したり、録音や録画の開始および停止を指示したりするものとしてもよい。また、音声を発生する機器において、ミュートする機能を有する場合に、その機能のオンオフを指示するようにしてもよい。   For example, in the above embodiment, the first switch FSW1 is used to instruct the start and stop of automatic performance. Or may be instructed. In addition, in a case where a device that generates sound has a function of muting, the function may be instructed to be turned on / off.

また、上記実施形態では、プラグ21としてステレオ用プラグを用い、チップを介して入力される電子信号により、自動演奏の開始又は停止を指示し、リングを介して入力される電子信号により、自動演奏のテンポを指示するものとしたが、モノーラル用プラグを用いて、自動演奏の開始又は停止のみを指示するようにしてもよい。その場合においても、本発明は、適用される。   In the above embodiment, a stereo plug is used as the plug 21, and an automatic performance start or stop is instructed by an electronic signal input through the chip, and an automatic performance is performed by an electronic signal input through the ring. However, a monaural plug may be used to instruct only the start or stop of automatic performance. Even in that case, the present invention is applied.

本発明における第1実施形態の電子楽器の電気的構成を示すブロック図である。It is a block diagram which shows the electric constitution of the electronic musical instrument of 1st Embodiment in this invention. プラグがジャックに装着されている場合の電気信号の変化を示すタイムチャートである。It is a time chart which shows the change of an electric signal when a plug is attached to a jack. プラグがジャックから抜かれる過程を示す模式図である。It is a schematic diagram which shows the process in which a plug is extracted from a jack. プラグがジャックから抜かれる過程における電気信号の変化を示すタイムチャートである。It is a time chart which shows the change of the electric signal in the process in which a plug is extracted from a jack. CPUにより実行されるメイン処理を示すフローチャートである。It is a flowchart which shows the main process performed by CPU. 第2実施形態における電気的構成を示すブロック図である。It is a block diagram which shows the electric constitution in 2nd Embodiment.

符号の説明Explanation of symbols

1 電子楽器(スイッチ操作検出装置)
2 CPU
3 ROM
4 RAM
5 I/O回路
6 ジャック
8 音源
21 プラグ
22 スイッチ装置
FSW1 第1スイッチ(スイッチ)
SW プラグスイッチ(プラグ検出手段)
J1 第1接点
J2 第2接点
S2 第1検出手段
S11 第2検出手段
S3,S5,S6 判定手段
1 Electronic musical instrument (switch operation detection device)
2 CPU
3 ROM
4 RAM
5 I / O circuit 6 Jack 8 Sound source 21 Plug 22 Switch device FSW1 First switch (switch)
SW plug switch (plug detection means)
J1 first contact J2 second contact S2 first detection means S11 second detection means S3, S5, S6 determination means

Claims (2)

プラグの先端に形成される電極であるチップと接触し、第1電気信号を入力する第1接点と、チップよりプラグの根本側に形成される電極と接触し、第2電気信号を入力する第2接点とを有するジャックを備え、そのジャックに挿入されたプラグを介して接続されるスイッチの操作を検出するスイッチ操作検出装置において、
前記第1接点から入力された第1電気信号がオフ状態からオン状態に変化したかを検出する第1検出手段と、
前記第2接点から入力された第2電気信号がオン状態かオフ状態かを検出する第2検出手段と、
前記第1検出手段により前記第1電気信号がオフ状態からオン状態に変化したことが検出された場合に、前記第2検出手段により第2電気信号がオフ状態であると検出されれば前記スイッチが操作されたと判定し、前記第2検出手段により第2電気信号がオン状態であると検出されれば前記スイッチが操作されたのではないと判定する判定手段とを備えていることを特徴とするスイッチ操作検出装置。
A first contact that contacts the chip, which is an electrode formed at the tip of the plug, inputs a first electrical signal, and an electrode that is formed on the base side of the plug from the chip, and inputs a second electrical signal. In a switch operation detection device comprising a jack having two contacts and detecting an operation of a switch connected via a plug inserted into the jack,
First detection means for detecting whether the first electrical signal input from the first contact has changed from an off state to an on state;
Second detection means for detecting whether the second electrical signal input from the second contact is on or off;
If it is detected by the first detection means that the first electric signal has changed from an off state to an on state, the switch is detected if the second detection signal is detected by the second detection means to be in an off state. And determining means for determining that the switch is not operated if it is detected by the second detecting means that the second electrical signal is in an ON state. Switch operation detection device.
前記ジャックにプラグが装着されているか否かを検出するプラグ検出手段を備え、
前記判定手段は、前記第1検出手段により前記第1電気信号がオフ状態からオン状態に変化したことが検出された場合に、前記第2検出手段により第2電気信号がオフ状態であると検出され且つ前記プラグ検出手段によりプラグが装着されていると検出されれば前記スイッチが操作されたと判定し、前記第2検出手段により第2電気信号がオン状態であると検出された場合、又は前記プラグ検出手段によりプラグが装着されていないと検出された場合に前記スイッチが操作されたのではないと判定することを特徴とする請求項1記載のスイッチ操作検出装置。
Comprising a plug detection means for detecting whether or not a plug is attached to the jack;
The determination means detects that the second electric signal is in an OFF state by the second detection means when the first detection means detects that the first electric signal has changed from an OFF state to an ON state. And if it is detected by the plug detection means that the plug is attached, it is determined that the switch has been operated, and if the second detection signal is detected by the second detection means to be on, or 2. The switch operation detecting device according to claim 1, wherein when the plug detecting means detects that the plug is not attached, it is determined that the switch is not operated.
JP2008006637A 2008-01-16 2008-01-16 Switch operation detection device Expired - Fee Related JP5204496B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008006637A JP5204496B2 (en) 2008-01-16 2008-01-16 Switch operation detection device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008006637A JP5204496B2 (en) 2008-01-16 2008-01-16 Switch operation detection device

Publications (2)

Publication Number Publication Date
JP2009169061A true JP2009169061A (en) 2009-07-30
JP5204496B2 JP5204496B2 (en) 2013-06-05

Family

ID=40970299

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008006637A Expired - Fee Related JP5204496B2 (en) 2008-01-16 2008-01-16 Switch operation detection device

Country Status (1)

Country Link
JP (1) JP5204496B2 (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0588672A (en) * 1991-07-09 1993-04-09 Yamaha Corp Electronic musical instrument
JP2003029754A (en) * 2001-07-18 2003-01-31 Korg Inc Single terminal effector

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0588672A (en) * 1991-07-09 1993-04-09 Yamaha Corp Electronic musical instrument
JP2003029754A (en) * 2001-07-18 2003-01-31 Korg Inc Single terminal effector

Also Published As

Publication number Publication date
JP5204496B2 (en) 2013-06-05

Similar Documents

Publication Publication Date Title
US8772618B2 (en) Mixing automatic accompaniment input and musical device input during a loop recording
US20080170707A1 (en) Sound device
KR20080023199A (en) Audio reproduction apparatus and method and storage medium
JP5204496B2 (en) Switch operation detection device
JP2014187413A (en) Acoustic device and program
JP7346807B2 (en) Electronic keyboard instruments, methods and programs
JPH04274491A (en) Automatic player
JP7251050B2 (en) Electronic musical instrument, control method and program for electronic musical instrument
JP6024403B2 (en) Electronic music apparatus, parameter setting method, and program for realizing the parameter setting method
JP4479633B2 (en) Audio equipment setting device and program thereof
JP2007093679A (en) Sound source setting device and sound source setting program
JP6171503B2 (en) Audio equipment
JP5228642B2 (en) Recording / playback device
KR20010046233A (en) An area setting and a play executing method for repeat-playing in a digital audio player
EP3092643B1 (en) Selective sound storage device
JP7070538B2 (en) Programs, methods, electronic devices, and performance data display systems
JP2008026344A (en) Electronic musical device and musical information record program
CN108702570B (en) Sound equipment
JP2009122687A (en) Audio regeneration device and audio regeneration method
JP2006293210A (en) Electronic equipment and data processing method
JP2005266392A (en) Performance data reproducing device and program
JP3636604B2 (en) Electronic musical instruments
JP6105779B2 (en) Recording apparatus, recording method, and computer program for recording control
JP2005017473A (en) Recording controller for electronic musical sound generating device
JP4148040B2 (en) Operator function explanation method, electronic device and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20110114

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20120111

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20121011

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20121023

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20121217

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20130215

R150 Certificate of patent or registration of utility model

Ref document number: 5204496

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20160222

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees